1?arguments[1]:void 0)},Qa}function ml(){return nl?il:(nl=1,function(){if(el)return cl;el=1;var t=Li(),e=pl();t({target:"Array",proto:!0,forced:[].forEach!==e},{forEach:e})}(),il=Sr()("Array","forEach"))}function fl(){return sl?ol:(sl=1,ol=ml())}function gl(){if(al)return rl;al=1;var t=Gi(),e=Ne(),i=Bt(),n=fl(),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return rl=function(r){var a=r.forEach;return r===o||i(o,r)&&a===o.forEach||e(s,t(r))?n:a},rl}var vl,bl,yl,_l,wl,xl,kl,Dl,Sl,Cl=n(hl?ll:(hl=1,ll=gl())),Tl={};function Ml(){return yl?bl:(yl=1,function(){if(vl)return Tl;vl=1;var t=Li(),e=z(),i=Ni(),n=e([].reverse),o=[1,2];t({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),n(this)}})}(),bl=Sr()("Array","reverse"))}function Ol(){if(wl)return _l;wl=1;var t=Bt(),e=Ml(),i=Array.prototype;return _l=function(n){var o=n.reverse;return n===i||t(i,n)&&o===i.reverse?e:o},_l}function El(){return kl?xl:(kl=1,xl=Ol())}var Pl,Il,Ll,Nl,Al,Fl,Rl,Yl,jl,zl,Hl,Gl,Wl,Bl=n(Sl?Dl:(Sl=1,Dl=El())),Vl={};function Ul(){if(Il)return Pl;Il=1;var t=K(),e=Ni(),i=TypeError,n=Object.getOwnPropertyDescriptor,o=t&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();return Pl=o?function(t,o){if(e(t)&&!n(t,"length").writable)throw new i("Cannot set read only .length");return t.length=o}:function(t,e){return t.length=e}}function Xl(){if(Nl)return Ll;Nl=1;var t=Zt(),e=TypeError;return Ll=function(i,n){if(!delete i[n])throw new e("Cannot delete property "+t(n)+" of "+t(i))}}function ql(){return Rl?Fl:(Rl=1,function(){if(Al)return Vl;Al=1;var t=Li(),e=Le(),i=wn(),n=Fi(),o=Yi(),s=Ul(),r=ji(),a=Ui(),l=zi(),h=Xl(),d=Xi()("splice"),c=Math.max,u=Math.min;t({target:"Array",proto:!0,forced:!d},{splice:function(t,d){var p,m,f,g,v,b,y=e(this),_=o(y),w=i(t,_),x=arguments.length;for(0===x?p=m=0:1===x?(p=0,m=_-w):(p=x-2,m=u(c(n(d),0),_-w)),r(_+p-m),f=a(y,m),g=0;g_-m+p;g--)h(y,g-1)}else if(p>m)for(g=_-m;g>w;g--)b=g+p-1,(v=g+m-1)in y?y[b]=y[v]:h(y,b);for(g=0;gu;)for(var f,g=l(arguments[u++]),v=p?c(o(g),p(g)):o(g),b=v.length,y=0;b>y;)f=v[y++],t&&!i(m,g,f)||(h[f]=g[f]);return h}:h,$l}function hh(){return eh?th:(eh=1,function(){if(Ql)return ah;Ql=1;var t=Li(),e=lh();t({target:"Object",stat:!0,arity:2,forced:Object.assign!==e},{assign:e})}(),th=Gt().Object.assign)}function dh(){return nh?ih:(nh=1,ih=hh())}var ch,uh,ph,mh=n(sh?oh:(sh=1,oh=dh())),fh={};function gh(){return ph?uh:(ph=1,function(){if(ch)return fh;ch=1;var t=Li(),e=xn().includes,i=R(),n=Ks();t({target:"Array",proto:!0,forced:i(function(){return!Array(1).includes()})},{includes:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),n("includes")}(),uh=Sr()("Array","includes"))}var vh,bh,yh,_h,wh,xh,kh,Dh,Sh,Ch,Th,Mh,Oh,Eh,Ph,Ih={};function Lh(){if(bh)return vh;bh=1;var t=Ht(),e=H(),i=Fe()("match");return vh=function(n){var o;return t(n)&&(void 0!==(o=n[i])?!!o:"RegExp"===e(n))},vh}function Nh(){if(_h)return yh;_h=1;var t=Lh(),e=TypeError;return yh=function(i){if(t(i))throw new e("The method doesn't accept regular expressions");return i},yh}function Ah(){if(xh)return wh;xh=1;var t=Fe()("match");return wh=function(e){var i=/./;try{"/./"[e](i)}catch(n){try{return i[t]=!1,"/./"[e](i)}catch(t){}}return!1}}function Fh(){return Sh?Dh:(Sh=1,function(){if(kh)return Ih;kh=1;var t=Li(),e=z(),i=Nh(),n=jt(),o=Qi(),s=Ah(),r=e("".indexOf);t({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~r(o(n(this)),o(i(t)),arguments.length>1?arguments[1]:void 0)}})}(),Dh=Sr()("String","includes"))}function Rh(){if(Th)return Ch;Th=1;var t=Bt(),e=gh(),i=Fh(),n=Array.prototype,o=String.prototype;return Ch=function(s){var r=s.includes;return s===n||t(n,s)&&r===n.includes?e:"string"==typeof s||s===o||t(o,s)&&r===o.includes?i:r},Ch}function Yh(){return Oh?Mh:(Oh=1,Mh=Rh())}var jh,zh,Hh,Gh,Wh,Bh,Vh,Uh=n(Ph?Eh:(Ph=1,Eh=Yh())),Xh={};function qh(){return Hh?zh:(Hh=1,function(){if(jh)return Xh;jh=1;var t=Li(),e=R(),i=Le(),n=Qs(),o=Js();t({target:"Object",stat:!0,forced:e(function(){n(1)}),sham:!o},{getPrototypeOf:function(t){return n(i(t))}})}(),zh=Gt().Object.getPrototypeOf)}function Kh(){return Wh?Gh:(Wh=1,Gh=qh())}var Zh,$h,Jh,Qh,td,ed,id,nd,od=n(Vh?Bh:(Vh=1,Bh=Kh()));function sd(){return $h?Zh:($h=1,qi(),Zh=Sr()("Array","concat"))}function rd(){if(Qh)return Jh;Qh=1;var t=Bt(),e=sd(),i=Array.prototype;return Jh=function(n){var o=n.concat;return n===i||t(i,n)&&o===i.concat?e:o},Jh}function ad(){return ed?td:(ed=1,td=rd())}var ld,hd,dd,cd,ud,pd,md,fd,gd,vd=n(nd?id:(nd=1,id=ad())),bd={};function yd(){return dd?hd:(dd=1,function(){if(ld)return bd;ld=1;var t=Li(),e=_o().filter;t({target:"Array",proto:!0,forced:!Xi()("filter")},{filter:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}})}(),hd=Sr()("Array","filter"))}function _d(){if(ud)return cd;ud=1;var t=Bt(),e=yd(),i=Array.prototype;return cd=function(n){var o=n.filter;return n===i||t(i,n)&&o===i.filter?e:o},cd}function wd(){return md?pd:(md=1,pd=_d())}var xd,kd,Dd,Sd,Cd,Td,Md,Od,Ed,Pd=n(gd?fd:(gd=1,fd=wd())),Id={};function Ld(){if(kd)return xd;kd=1;var t=K(),e=R(),i=z(),n=Qs(),o=Cn(),s=zt(),r=i(At().f),a=i([].push),l=t&&e(function(){var t=Object.create(null);return t[2]=2,!r(t,2)}),h=function(e){return function(i){for(var h,d=s(i),c=o(d),u=l&&null===n(d),p=c.length,m=0,f=[];p>m;)h=c[m++],t&&!(u?h in d:r(d,h))||a(f,e?[h,d[h]]:d[h]);return f}};return xd={entries:h(!0),values:h(!1)}}function Nd(){return Cd?Sd:(Cd=1,function(){if(Dd)return Id;Dd=1;var t=Li(),e=Ld().values;t({target:"Object",stat:!0},{values:function(t){return e(t)}})}(),Sd=Gt().Object.values)}function Ad(){return Md?Td:(Md=1,Td=Nd())}var Fd,Rd,Yd,jd,zd,Hd,Gd,Wd,Bd,Vd,Ud,Xd,qd,Kd=n(Ed?Od:(Ed=1,Od=Ad())),Zd={};function $d(){return Rd?Fd:(Rd=1,Fd="\t\n\v\f\r \u2028\u2029\ufeff")}function Jd(){if(jd)return Yd;jd=1;var t=z(),e=jt(),i=Qi(),n=$d(),o=t("".replace),s=RegExp("^["+n+"]+"),r=RegExp("(^|[^"+n+"])["+n+"]+$"),a=function(t){return function(n){var a=i(e(n));return 1&t&&(a=o(a,s,"")),2&t&&(a=o(a,r,"$1")),a}};return Yd={start:a(1),end:a(2),trim:a(3)}}function Qd(){if(Hd)return zd;Hd=1;var t=F(),e=R(),i=z(),n=Qi(),o=Jd().trim,s=$d(),r=t.parseInt,a=t.Symbol,l=a&&a.iterator,h=/^[+-]?0x/i,d=i(h.exec),c=8!==r(s+"08")||22!==r(s+"0x16")||l&&!e(function(){r(Object(l))});return zd=c?function(t,e){var i=o(n(t));return r(i,e>>>0||(d(h,i)?16:10))}:r,zd}function tc(){return Bd?Wd:(Bd=1,function(){if(Gd)return Zd;Gd=1;var t=Li(),e=Qd();t({global:!0,forced:parseInt!==e},{parseInt:e})}(),Wd=Gt().parseInt)}function ec(){return Ud?Vd:(Ud=1,Vd=tc())}var ic,nc,oc,sc,rc,ac,lc,hc,dc,cc=n(qd?Xd:(qd=1,Xd=ec())),uc={};function pc(){return oc?nc:(oc=1,function(){if(ic)return uc;ic=1;var t=Li(),e=G(),i=xn().indexOf,n=ul(),o=e([].indexOf),s=!!o&&1/o([1],1,-0)<0;t({target:"Array",proto:!0,forced:s||!n("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return s?o(this,t,e)||0:i(this,t,e)}})}(),nc=Sr()("Array","indexOf"))}function mc(){if(rc)return sc;rc=1;var t=Bt(),e=pc(),i=Array.prototype;return sc=function(n){var o=n.indexOf;return n===i||t(i,n)&&o===i.indexOf?e:o},sc}function fc(){return lc?ac:(lc=1,ac=mc())}var gc,vc,bc,yc,_c,wc,xc,kc=n(dc?hc:(dc=1,hc=fc())),Dc={};function Sc(){return bc?vc:(bc=1,function(){if(gc)return Dc;gc=1;var t=Li(),e=Ld().entries;t({target:"Object",stat:!0},{entries:function(t){return e(t)}})}(),vc=Gt().Object.entries)}function Cc(){return _c?yc:(_c=1,yc=Sc())}var Tc,Mc,Oc,Ec,Pc,Ic,Lc,Nc=n(xc?wc:(xc=1,wc=Cc()));function Ac(){if(Oc)return Mc;Oc=1,Tc||(Tc=1,Li()({target:"Object",stat:!0,sham:!K()},{create:En()}));var t=Gt().Object;return Mc=function(e,i){return t.create(e,i)}}function Fc(){return Pc?Ec:(Pc=1,Ec=Ac())}var Rc,Yc,jc,zc,Hc,Gc,Wc,Bc,Vc,Uc,Xc,qc,Kc,Zc=n(Lc?Ic:(Lc=1,Ic=Fc())),$c={};function Jc(){if(Yc)return Rc;Yc=1;var t=Fi(),e=Qi(),i=jt(),n=RangeError;return Rc=function(o){var s=e(i(this)),r="",a=t(o);if(a<0||a===1/0)throw new n("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(s+=s))1&a&&(r+=s);return r}}function Qc(){if(zc)return jc;zc=1;var t=z(),e=Ri(),i=Qi(),n=Jc(),o=jt(),s=t(n),r=t("".slice),a=Math.ceil,l=function(t){return function(n,l,h){var d,c,u=i(o(n)),p=e(l),m=u.length,f=void 0===h?" ":i(h);return p<=m||""===f?u:((c=s(f,a((d=p-m)/f.length))).length>d&&(c=r(c,0,d)),t?u+c:c+u)}};return jc={start:l(!1),end:l(!0)}}function tu(){if(Gc)return Hc;Gc=1;var t=z(),e=R(),i=Qc().start,n=RangeError,o=isFinite,s=Math.abs,r=Date.prototype,a=r.toISOString,l=t(r.getTime),h=t(r.getUTCDate),d=t(r.getUTCFullYear),c=t(r.getUTCHours),u=t(r.getUTCMilliseconds),p=t(r.getUTCMinutes),m=t(r.getUTCMonth),f=t(r.getUTCSeconds);return Hc=e(function(){return"0385-07-25T07:06:39.999Z"!==a.call(new Date(-50000000000001))})||!e(function(){a.call(new Date(NaN))})?function(){if(!o(l(this)))throw new n("Invalid time value");var t=this,e=d(t),r=u(t),a=e<0?"-":e>9999?"+":"";return a+i(s(e),a?6:4,0)+"-"+i(m(t)+1,2,0)+"-"+i(h(t),2,0)+"T"+i(c(t),2,0)+":"+i(p(t),2,0)+":"+i(f(t),2,0)+"."+i(r,3,0)+"Z"}:a,Hc}function eu(){if(Vc)return Bc;Vc=1,function(){if(Wc)return $c;Wc=1;var t=Li(),e=Z(),i=Le(),n=Re(),o=tu(),s=H();t({target:"Date",proto:!0,forced:R()(function(){return null!==new Date(NaN).toJSON()||1!==e(Date.prototype.toJSON,{toISOString:function(){return 1}})})},{toJSON:function(t){var r=i(this),a=n(r,"number");return"number"!=typeof a||isFinite(a)?"toISOString"in r||"Date"!==s(r)?r.toISOString():e(o,r):null}})}(),Lo();var t=Gt(),e=j();return t.JSON||(t.JSON={stringify:JSON.stringify}),Bc=function(i,n,o){return e(t.JSON.stringify,null,arguments)},Bc}function iu(){return Xc?Uc:(Xc=1,Uc=eu())}var nu,ou,su,ru,au,lu,hu,du=n(Kc?qc:(Kc=1,qc=iu())),cu={},uu={};function pu(){if(ou)return nu;ou=1;var t=F(),e=Vt(),i=H(),n=function(t){return e.slice(0,t.length)===t};return nu=n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&"string"==typeof Bun.version?"BUN":t.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(t.process)?"NODE":t.window&&t.document?"BROWSER":"REST"}function mu(){if(ru)return su;ru=1;var t=TypeError;return su=function(e,i){if(eo,c=n(s)?s:l(s),u=d?r(arguments,o):[],p=d?function(){i(c,this,u)}:c;return e?t(p,h):t(p)}:t},au}var gu,vu,bu,yu,_u,wu,xu={};function ku(){return vu||(vu=1,function(){if(hu)return uu;hu=1;var t=Li(),e=F(),i=fu()(e.setInterval,!0);t({global:!0,bind:!0,forced:e.setInterval!==i},{setInterval:i})}(),function(){if(gu)return xu;gu=1;var t=Li(),e=F(),i=fu()(e.setTimeout,!0);t({global:!0,bind:!0,forced:e.setTimeout!==i},{setTimeout:i})}()),cu}function Du(){return yu?bu:(yu=1,ku(),bu=Gt().setTimeout)}var Su,Cu,Tu,Mu,Ou,Eu,Pu,Iu,Lu,Nu,Au,Fu=n(wu?_u:(wu=1,_u=Du())),Ru={};function Yu(){if(Cu)return Su;Cu=1;var t=Le(),e=wn(),i=Yi();return Su=function(n){for(var o=t(this),s=i(o),r=arguments.length,a=e(r>1?arguments[1]:void 0,s),l=r>2?arguments[2]:void 0,h=void 0===l?s:e(l,s);h>a;)o[a++]=n;return o},Su}function ju(){return Ou?Mu:(Ou=1,function(){if(Tu)return Ru;Tu=1;var t=Li(),e=Yu(),i=Ks();t({target:"Array",proto:!0},{fill:e}),i("fill")}(),Mu=Sr()("Array","fill"))}function zu(){if(Pu)return Eu;Pu=1;var t=Bt(),e=ju(),i=Array.prototype;return Eu=function(n){var o=n.fill;return n===i||t(i,n)&&o===i.fill?e:o},Eu}function Hu(){return Lu?Iu:(Lu=1,Iu=zu())}var Gu,Wu=n(Au?Nu:(Au=1,Nu=Hu())),Bu={exports:{}};var Vu,Uu=(Gu||(Gu=1,function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o-1}var Cp=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===ap&&(t=this.compute()),rp&&this.manager.element.style&&pp[t]&&(this.manager.element.style[sp]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return kp(this.manager.recognizers,function(e){Dp(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(t){if(Sp(t,dp))return dp;var e=Sp(t,cp),i=Sp(t,up);return e&&i?dp:e||i?e?cp:up:Sp(t,hp)?hp:lp}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=Sp(n,dp)&&!pp[dp],s=Sp(n,up)&&!pp[up],r=Sp(n,cp)&&!pp[cp];if(o){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!r||!s)return o||s&&6&i||r&&i&_p?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Tp(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Mp(t){var e=t.length;if(1===e)return{x:ep(t[0].clientX),y:ep(t[0].clientY)};for(var i=0,n=0,o=0;o=ip(e)?t<0?2:4:e<0?8:yp}function Lp(t,e,i){return{x:e/t||0,y:i/t||0}}function Np(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=Op(e)),o>1&&!i.firstMultiple?i.firstMultiple=Op(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=Mp(n);e.timeStamp=np(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Pp(a,l),e.distance=Ep(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};1!==e.eventType&&4!==s.eventType||(o=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=Ip(e.deltaX,e.deltaY);var h,d,c=Lp(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=ip(c.x)>ip(c.y)?c.x:c.y,e.scale=r?(h=r.pointers,Ep((d=n)[0],d[1],xp)/Ep(h[0],h[1],xp)):1,e.rotation=r?function(t,e){return Pp(e[1],e[0],xp)+Pp(t[1],t[0],xp)}(r.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,r=t.lastInterval||e,a=e.timeStamp-r.timeStamp;if(8!==e.eventType&&(a>25||void 0===r.velocity)){var l=e.deltaX-r.deltaX,h=e.deltaY-r.deltaY,d=Lp(a,l,h);n=d.x,o=d.y,i=ip(d.x)>ip(d.y)?d.x:d.y,s=Ip(l,h),t.lastInterval=e}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var u,p=t.element,m=e.srcEvent;Tp(u=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=u),e.target=p}function Ap(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=1&e&&n-o===0,r=12&e&&n-o===0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,Np(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Fp(t){return t.trim().split(/\s+/g)}function Rp(t,e,i){kp(Fp(e),function(e){t.addEventListener(e,i,!1)})}function Yp(t,e,i){kp(Fp(e),function(e){t.removeEventListener(e,i,!1)})}function jp(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var zp=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){Dp(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Rp(this.element,this.evEl,this.domHandler),this.evTarget&&Rp(this.target,this.evTarget,this.domHandler),this.evWin&&Rp(jp(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Yp(this.element,this.evEl,this.domHandler),this.evTarget&&Yp(this.target,this.evTarget,this.domHandler),this.evWin&&Yp(jp(this.element),this.evWin,this.domHandler)},t}();function Hp(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]}):n.sort()),n}var Kp={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Zp=function(t){function e(){var i;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).targetIds={},i}return Ku(e,t),e.prototype.handler=function(t){var e=Kp[t.type],i=$p.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:vp,srcEvent:t})},e}(zp);function $p(t,e){var i,n,o=Xp(t.touches),s=this.targetIds;if(3&e&&1===o.length)return s[o[0].identifier]=!0,[o,o];var r=Xp(t.changedTouches),a=[],l=this.target;if(n=o.filter(function(t){return Tp(t.target,l)}),1===e)for(i=0;i-1&&n.splice(t,1)},2500)}}function em(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,tm.call(this,e)):12&t&&tm.call(this,e)}function im(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+lm(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+lm(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=sm},e.canEmit=function(){for(var t=0;te.threshold&&o&e.direction},i.attrTest=function(t){return cm.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=um(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(cm),mm=function(t){function e(e){return void 0===e&&(e={}),t.call(this,qu({event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},e))||this}Ku(e,t);var i=e.prototype;return i.getTouchAction=function(){return pm.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return 30&n?i=e.overallVelocity:6&n?i=e.overallVelocityX:n&_p&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&ip(i)>this.options.velocity&&4&e.eventType},i.emit=function(t){var e=um(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(cm),fm=function(t){function e(e){return void 0===e&&(e={}),t.call(this,qu({event:"pinch",threshold:0,pointers:2},e))||this}Ku(e,t);var i=e.prototype;return i.getTouchAction=function(){return[dp]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(cm),gm=function(t){function e(e){return void 0===e&&(e={}),t.call(this,qu({event:"rotate",threshold:0,pointers:2},e))||this}Ku(e,t);var i=e.prototype;return i.getTouchAction=function(){return[dp]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(cm),vm=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,qu({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}Ku(e,t);var i=e.prototype;return i.getTouchAction=function(){return[lp]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distancei.time;if(this._input=t,!o||!n||12&t.eventType&&!s)this.reset();else if(1&t.eventType)this.reset(),this._timer=setTimeout(function(){e.state=8,e.tryEmit()},i.time);else if(4&t.eventType)return 8;return sm},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=np(),this.manager.emit(this.options.event,this._input)))},e}(hm),bm={domEvents:!1,touchAction:ap,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ym=[[gm,{enable:!1}],[fm,{enable:!1},["rotate"]],[mm,{direction:6}],[pm,{direction:6},["swipe"]],[dm],[dm,{event:"doubletap",taps:2},["tap"]],[vm]];function _m(t,e){var i,n=t.element;n.style&&(kp(t.options.cssProps,function(o,s){i=op(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}var wm=function(){function t(t,e){var i,n=this;this.options=Ju({},bm,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(fp?Up:gp?Zp:mp?nm:Qp))(i,Ap),this.touchAction=new Cp(this,this.options.touchAction),_m(this,!0),kp(this.options.recognizers,function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}var e=t.prototype;return e.set=function(t){return Ju(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&8&o.state)&&(e.curRecognizer=null,o=null);for(var s=0;s\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var Cm=Sm(function(t,e,i){for(var n=Object.keys(e),o=0;o1?e-1:0),n=1;n2)return Nm(Lm(e[0],e[1]),...Yr(e).call(e,2));const n=e[0],o=e[1];if(n instanceof Date&&o instanceof Date)return n.setTime(o.getTime()),n;for(const t of Kr(o))Object.prototype.propertyIsEnumerable.call(o,t)&&(o[t]===Pm?delete n[t]:null===n[t]||null===o[t]||"object"!=typeof n[t]||"object"!=typeof o[t]||aa(n[t])||aa(o[t])?n[t]=Am(o[t]):n[t]=Nm(n[t],o[t]));return n}function Am(t){return aa(t)?ya(t).call(t,t=>Am(t)):"object"==typeof t&&null!==t?t instanceof Date?new Date(t.getTime()):Nm({},t):t}function Fm(t){for(const e of Ea(t))t[e]===Pm?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&Fm(t[e])}const Rm="undefined"!=typeof window?window.Hammer||Em:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function Ym(t){var e;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});const i=Rm(this._dom.overlay);i.on("tap",dl(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push(()=>{i.destroy()});const n=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];Cl(n).call(n,t=>{i.on(t,t=>{t.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}Xu(Ym.prototype),Ym.current=null,Ym.prototype.destroy=function(){this.deactivate();for(const i of Bl(t=rh(e=this._cleanupQueue).call(e,0)).call(t)){var t,e;i()}},Ym.prototype.activate=function(){Ym.current&&Ym.current.deactivate(),Ym.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},Ym.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},Ym.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const jm=/^\/?Date\((-?\d+)/i,zm=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Hm=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Gm=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,Wm=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function Bm(t){return t instanceof Number||"number"==typeof t}function Vm(t){return t instanceof String||"string"==typeof t}function Um(t){return"object"==typeof t&&null!==t}function Xm(t,e,i,n){let o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}const qm=mh;function Km(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)||!0===i)if("object"==typeof e[s]&&null!==e[s]&&od(e[s])===Object.prototype)void 0===t[s]?t[s]=Km({},e[s],i):"object"==typeof t[s]&&null!==t[s]&&od(t[s])===Object.prototype?Km(t[s],e[s],i):Xm(t,e,s,n);else if(aa(e[s])){var o;t[s]=Yr(o=e[s]).call(o)}else Xm(t,e,s,n);return t}function Zm(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":aa(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function $m(t,e){return[...t,e]}function Jm(t){return Yr(t).call(t)}const Qm=Kd;const tf={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null),asString:(t,e)=>("function"==typeof t&&(t=t()),null!=t?String(t):e||null),asSize:(t,e)=>("function"==typeof t&&(t=t()),Vm(t)?t:Bm(t)?t+"px":e||null),asElement:(t,e)=>("function"==typeof t&&(t=t()),t||e||null)};function ef(t){let e;switch(t.length){case 3:case 4:return e=Hm.exec(t),e?{r:cc(e[1]+e[1],16),g:cc(e[2]+e[2],16),b:cc(e[3]+e[3],16)}:null;case 6:case 7:return e=zm.exec(t),e?{r:cc(e[1],16),g:cc(e[2],16),b:cc(e[3],16)}:null;default:return null}}function nf(t,e,i){var n;return"#"+Yr(n=((1<<24)+(t<<16)+(e<<8)+i).toString(16)).call(n,1)}function of(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,Math.min(e,i)),o=Math.max(t,Math.max(e,i));if(n===o)return{h:0,s:0,v:n};return{h:60*((t===n?3:i===n?1:5)-(t===n?e-i:i===n?t-e:i-t)/(o-n))/360,s:(o-n)/o,v:o}}function sf(t){const e=document.createElement("div"),i={};e.style.cssText=t;for(let t=0;tt,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};const mf={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};let ff=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return mf[t]}setColor(t){let e,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"===t)return;const n=this._isColorString(t);if(void 0!==n&&(t=n),!0===Vm(t)){if(!0===df(t)){const i=t.substr(4).substr(0,t.length-5).split(",");e={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===cf(t)){const i=t.substr(5).substr(0,t.length-6).split(",");e={r:i[0],g:i[1],b:i[2],a:i[3]}}else if(!0===hf(t)){const i=ef(t);e={r:i.r,g:i.g,b:i.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){const i=void 0!==t.a?t.a:"1.0";e={r:t.r,g:t.g,b:t.b,a:i}}if(void 0===e)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+du(t));this._setColor(e,i)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=mh({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",Fu(()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=mh({},t)),this.color=t;const e=of(t.r,t.g,t.b),i=2*Math.PI,n=this.r*e.s,o=this.centerCoordinates.x+n*Math.sin(i*e.h),s=this.centerCoordinates.y+n*Math.cos(i*e.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=s-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){const e=of(this.color.r,this.color.g,this.color.b);e.v=t/100;const i=rf(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color;const e=of(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Wu(i).call(i),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var t,e,i,n;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=dl(t=this._hide).call(t,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=dl(e=this._apply).call(e,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=dl(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=dl(n=this._loadLast).call(n,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new Rm(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",t=>{t.isFirst&&this._moveSelector(t)}),this.hammer.on("tap",t=>{this._moveSelector(t)}),this.hammer.on("panstart",t=>{this._moveSelector(t)}),this.hammer.on("panmove",t=>{this._moveSelector(t)}),this.hammer.on("panend",t=>{this._moveSelector(t)})}_generateHueCircle(){if(!1===this.generated){const t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;let n,o,s,r;t.clearRect(0,0,e,i),this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;const a=2*Math.PI/360,l=1/360,h=1/this.r;let d;for(s=0;s<360;s++)for(r=0;r3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>!1;this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},mh(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new ff(n),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(aa(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==Pd(t)&&(this.options.filter=Pd(t)),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===Pd(this.options)&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const t=Pd(this.options);let e=0,i=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(n,[]),i=i||this._handleObject(this.configureOptions[n],[n],!0)):!0!==t&&-1===kc(t).call(t,n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let t=0;t1?e-1:0),n=1;n{o.appendChild(t)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(t){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}_makeLabel(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===i){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(gf("i","b",t))}else n.innerText=t+":";return n}_makeDropdown(t,e,i){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==kc(t).call(t,e)&&(o=kc(t).call(t,e));for(let e=0;es&&1!==s&&(a.max=Math.ceil(e*t),h=a.max,l="range increased"),a.value=e}else a.value=n;const d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=a.value;const c=this;a.onchange=function(){d.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){d.value=this.value};const u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,d);""!==l&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){const t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Fu(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Fu(()=>{this._removePopup()},1800)}}_makeCheckbox(t,e,i){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));const o=this;n.onchange=function(){o._update(this.checked,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeTextInput(t,e,i){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});const o=this;n.onchange=function(){o._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeColorField(t,e,i){const n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback(t=>{const n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)}),this.colorPicker.setCloseCallback(()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}})}_handleObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1;const o=Pd(this.options);let s=!1;for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){n=!0;const a=t[r],l=$m(e,r);if("function"==typeof o&&(n=o(r,e),!1===n&&!aa(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==n){s=!0;const t=this._getValue(l);if(aa(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){if(!this.hideOption(e,r,this.moduleOptions))if(void 0!==a.enabled){const t=$m(l,"enabled"),e=this._getValue(t);if(!0===e){const t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}else this._makeCheckbox(a,e,l)}else{const t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}}else console.error("dont know how to handle",a,r,l)}}return s}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){const i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;in-this.padding&&(i=!0),o=i?this.x-e:this.x,s=r?this.y-t:this.y}else s=this.y-t,s+t+this.padding>i&&(s=i-t-this.padding),sn&&(o=n-e-this.padding),os.distance?" in "+t.printLocation(o.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+t.printLocation(s.path,s.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+t.printLocation(o.path,e):". Did you mean one of these: "+t.print(Ea(i))+t.printLocation(n,e),console.error('%cUnknown option detected: "'+e+'"'+r,yf),bf=!0}static findInOptions(e,i,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[];const l=e.toLowerCase();let h;for(const c in i){let u;if(void 0!==i[c].__type__&&!0===o){const o=t.findInOptions(e,i[c],$m(n,c));s>o.distance&&(r=o.closestMatch,a=o.path,s=o.distance,h=o.indexMatch)}else{var d;-1!==kc(d=c.toLowerCase()).call(d,l)&&(h=c),u=t.levenshteinDistance(e,c),s>u&&(r=c,a=Jm(n),s=u)}}return{closestMatch:r,path:a,distance:s,indexMatch:h}}static printLocation(t,e){let i="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n";for(let e=0;e>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=4294967296*n}return 2.3283064365386963e-10*(t>>>0)}}();let e=t(" "),i=t(" "),n=t(" ");for(let o=0;o{const t=2091639*e+2.3283064365386963e-10*o;return e=i,i=n,n=t-(o=0|t)};return s.uint32=()=>4294967296*s(),s.fract53=()=>s()+11102230246251565e-32*(2097152*s()|0),s.algorithm="Alea",s.seed=t,s.version="0.9",s}(e.length?e:[Va()])},ColorPicker:wf,Configurator:xf,DELETE:Pm,HSVToHex:af,HSVToRGB:rf,Hammer:kf,Popup:Df,RGBToHSV:of,RGBToHex:nf,VALIDATOR_PRINT_STYLE:Sf,Validator:Cf,addClassName:function(t,e){let i=t.className.split(" ");const n=e.split(" ");i=vd(i).call(i,Pd(n).call(n,function(t){return!Uh(i).call(i,t)})),t.className=i.join(" ")},addCssText:function(t,e){const i=sf(e);for(const[e,n]of Nc(i))t.style.setProperty(e,n)},binarySearchCustom:function(t,e,i,n){let o=0,s=0,r=t.length-1;for(;s<=r&&o<1e4;){const a=Math.floor((s+r)/2),l=t[a],h=e(void 0===n?l[i]:l[i][n]);if(0==h)return a;-1==h?s=a+1:r=a-1,o++}return-1},binarySearchValue:function(t,e,i,n,o){let s,r,a,l,h=0,d=0,c=t.length-1;for(o=null!=o?o:function(t,e){return t==e?0:t0)return"before"==n?Math.max(0,l-1):l;if(o(r,e)<0&&o(a,e)>0)return"before"==n?l:Math.min(t.length-1,l+1);o(r,e)<0?d=l+1:c=l-1,h++}return-1},bridgeObject:uf,copyAndExtendArray:$m,copyArray:Jm,deepExtend:Km,deepObjectAssign:Lm,easingFunctions:pf,equalArray:function(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i2&&void 0!==arguments[2]&&arguments[2];for(const o in e)if(void 0!==i[o])if(null===i[o]||"object"!=typeof i[o])Xm(e,i,o,n);else{const s=e[o],r=i[o];Um(s)&&Um(r)&&t(s,r,n)}},forEach:function(t,e){if(aa(t)){const i=t.length;for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:window.event,e=null;return t&&(t.target?e=t.target:t.srcElement&&(e=t.srcElement)),e instanceof Element&&(null==e.nodeType||3!=e.nodeType||(e=e.parentNode,e instanceof Element))?e:null},getType:Zm,hasParent:function(t,e){let i=t;for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1},hexToHSV:lf,hexToRGB:ef,insertSort:function(t,e){for(let i=0;i0&&e(n,t[o-1])<0;o--)t[o]=t[o-1];t[o]=n}return t},isDate:function(t){if(t instanceof Date)return!0;if(Vm(t)){if(jm.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1},isNumber:Bm,isObject:Um,isString:Vm,isValidHex:hf,isValidRGB:df,isValidRGBA:cf,mergeOptions:function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=function(t){return null!=t},s=function(t){return null!==t&&"object"==typeof t};if(!s(t))throw new Error("Parameter mergeTarget must be an object");if(!s(e))throw new Error("Parameter options must be an object");if(!o(i))throw new Error("Parameter option must have a value");if(!s(n))throw new Error("Parameter globalOptions must be an object");const r=e[i],a=s(n)&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[i]:void 0,l=a?a.enabled:void 0;if(void 0===r)return;if("boolean"==typeof r)return s(t[i])||(t[i]={}),void(t[i].enabled=r);if(null===r&&!s(t[i])){if(!o(a))return;t[i]=Zc(a)}if(!s(r))return;let h=!0;void 0!==r.enabled?h=r.enabled:void 0!==l&&(h=a.enabled),function(t,e,i){s(t[i])||(t[i]={});const n=e[i],o=t[i];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(o[t]=n[t])}(t,e,i),t[i].enabled=h},option:tf,overrideOpacity:function(t,e){if(Uh(t).call(t,"rgba"))return t;if(Uh(t).call(t,"rgb")){const i=t.substr(kc(t).call(t,"(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}{const i=ef(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+e+")"}},parseColor:function(t,e){if(Vm(t)){let e=t;if(df(e)){var i;const t=ya(i=e.substr(4).substr(0,e.length-5).split(",")).call(i,function(t){return cc(t)});e=nf(t[0],t[1],t[2])}if(!0===hf(e)){const t=lf(e),i={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},n={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},o=af(n.h,n.s,n.v),s=af(i.h,i.s,i.v);return{background:e,border:o,highlight:{background:s,border:o},hover:{background:s,border:o}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}if(e){return{background:t.background||e.background,border:t.border||e.border,highlight:Vm(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||e.highlight.background,border:t.highlight&&t.highlight.border||e.highlight.border},hover:Vm(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||e.hover.border,background:t.hover&&t.hover.background||e.hover.background}}}return{background:t.background||void 0,border:t.border||void 0,highlight:Vm(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:Vm(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}},preventDefault:function(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},pureDeepObjectAssign:Im,recursiveDOMDelete:function t(e){if(e)for(;!0===e.hasChildNodes();){const i=e.firstChild;i&&(t(i),e.removeChild(i))}},removeClassName:function(t,e){let i=t.className.split(" ");const n=e.split(" ");i=Pd(i).call(i,function(t){return!Uh(n).call(n,t)}),t.className=i.join(" ")},removeCssText:function(t,e){const i=sf(e);for(const e of Ea(i))t.style.removeProperty(e)},selectiveBridgeObject:function(t,e){if(null!==e&&"object"==typeof e){const i=Zc(e);for(let n=0;n3&&void 0!==arguments[3]&&arguments[3];if(aa(i))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o2?i-2:0),o=2;o3&&void 0!==arguments[3]&&arguments[3];if(aa(i))throw new TypeError("Arrays are not supported by deepExtend");for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&!Uh(t).call(t,o))if(i[o]&&i[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?Km(e[o],i[o]):Xm(e,i,o,n);else if(aa(i[o])){e[o]=[];for(let t=0;t{e||(e=!0,requestAnimationFrame(()=>{e=!1,t()}))}},toArray:Qm,topMost:function(t,e){let i;aa(e)||(e=[e]);for(const n of t)if(n){i=n[e[0]];for(let t=1;t0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n}function If(t,e,i,n){var o;return Object.prototype.hasOwnProperty.call(e,t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElement(t),void 0!==n?i.insertBefore(o,n):i.appendChild(o)):(o=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(o,n):i.appendChild(o)),e[t].used.push(o),o}function Lf(t,e,i,n,o,s){var r;if("circle"==i.style?((r=Pf("circle",n,o)).setAttributeNS(null,"cx",t),r.setAttributeNS(null,"cy",e),r.setAttributeNS(null,"r",.5*i.size)):((r=Pf("rect",n,o)).setAttributeNS(null,"x",t-.5*i.size),r.setAttributeNS(null,"y",e-.5*i.size),r.setAttributeNS(null,"width",i.size),r.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&r.setAttributeNS(null,"style",i.styles),r.setAttributeNS(null,"class",i.className+" vis-point"),s){var a=Pf("text",n,o);s.xOffset&&(t+=s.xOffset),s.yOffset&&(e+=s.yOffset),s.content&&(a.textContent=s.content),s.className&&a.setAttributeNS(null,"class",s.className+" vis-label"),a.setAttributeNS(null,"x",t),a.setAttributeNS(null,"y",e)}return r}function Nf(t,e,i,n,o,s,r,a){if(0!=n){n<0&&(e-=n*=-1);var l=Pf("rect",s,r);l.setAttributeNS(null,"x",t-.5*i),l.setAttributeNS(null,"y",e),l.setAttributeNS(null,"width",i),l.setAttributeNS(null,"height",n),l.setAttributeNS(null,"class",o),a&&l.setAttributeNS(null,"style",a)}}function Af(){try{return navigator?navigator.languages&&navigator.languages.length?navigator.languages:navigator.userLanguage||navigator.language||navigator.browserLanguage||"en":"en"}catch(t){return"en"}}var Ff,Rf,Yf,jf,zf,Hf,Gf=Object.freeze({__proto__:null,cleanupElements:Of,drawBar:Nf,drawPoint:Lf,getDOMElement:If,getNavigatorLanguage:Af,getSVGElement:Pf,prepareElements:Mf,resetElements:Ef});function Wf(){return Rf?Ff:(Rf=1,Ro(),Ff=Gt().Object.getOwnPropertySymbols)}function Bf(){return jf?Yf:(jf=1,Yf=Wf())}var Vf,Uf,Xf,qf,Kf,Zf,$f=n(Hf?zf:(Hf=1,zf=Bf())),Jf={exports:{}},Qf={};function tg(){if(Uf)return Jf.exports;Uf=1,function(){if(Vf)return Qf;Vf=1;var t=Li(),e=R(),i=zt(),n=He().f,o=K();t({target:"Object",stat:!0,forced:!o||e(function(){n(1)}),sham:!o},{getOwnPropertyDescriptor:function(t,e){return n(i(t),e)}})}();var t=Gt().Object,e=Jf.exports=function(e,i){return t.getOwnPropertyDescriptor(e,i)};return t.getOwnPropertyDescriptor.sham&&(e.sham=!0),Jf.exports}function eg(){return qf?Xf:(qf=1,Xf=tg())}var ig,ng,og,sg,rg,ag,lg,hg=n(Zf?Kf:(Zf=1,Kf=eg())),dg={};function cg(){return og?ng:(og=1,function(){if(ig)return dg;ig=1;var t=Li(),e=K(),i=jr(),n=zt(),o=He(),s=zi();t({target:"Object",stat:!0,sham:!e},{getOwnPropertyDescriptors:function(t){for(var e,r,a=n(t),l=o.f,h=i(a),d={},c=0;h.length>c;)void 0!==(r=l(a,e=h[c++]))&&s(d,e,r);return d}})}(),ng=Gt().Object.getOwnPropertyDescriptors)}function ug(){return rg?sg:(rg=1,sg=cg())}var pg,mg,fg,gg,vg,bg,yg=n(lg?ag:(lg=1,ag=ug())),_g={exports:{}},wg={};function xg(){if(pg)return wg;pg=1;var t=Li(),e=K(),i=Tn().f;return t({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!e},{defineProperties:i}),wg}function kg(){if(mg)return _g.exports;mg=1,xg();var t=Gt().Object,e=_g.exports=function(e,i){return t.defineProperties(e,i)};return t.defineProperties.sham&&(e.sham=!0),_g.exports}function Dg(){return gg?fg:(gg=1,fg=kg())}var Sg,Cg,Tg,Mg,Og,Eg,Pg,Ig,Lg,Ng,Ag=n(bg?vg:(bg=1,vg=Dg())),Fg={exports:{}},Rg={};function Yg(){if(Sg)return Rg;Sg=1;var t=Li(),e=K(),i=Pi().f;return t({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!e},{defineProperty:i}),Rg}function jg(){if(Cg)return Fg.exports;Cg=1,Yg();var t=Gt().Object,e=Fg.exports=function(e,i,n){return t.defineProperty(e,i,n)};return t.defineProperty.sham&&(e.sham=!0),Fg.exports}function zg(){return Mg?Tg:(Mg=1,Tg=jg())}function Hg(){return Eg?Og:(Eg=1,Og=zg())}function Gg(){return Ig?Pg:(Ig=1,Pg=Hg())}function Wg(){return Ng?Lg:(Ng=1,Lg=Gg())}var Bg,Vg=n(Wg()),Ug={};var Xg;var qg;var Kg,Zg,$g;function Jg(){if($g)return Zg;$g=1;var t=cr();return function(){if(Bg)return Ug;Bg=1;var t=Fe(),e=Pi().f,i=t("metadata"),n=Function.prototype;void 0===n[i]&&e(n,i,{value:null})}(),Xg||(Xg=1,zo()),qg||(qg=1,Bo()),Kg||(Kg=1,mo()("metadata")),Zg=t}var Qg,tv,ev;function iv(){if(tv)return Qg;tv=1;var t=Wt(),e=z(),i=t("Symbol"),n=i.keyFor,o=e(i.prototype.valueOf);return Qg=i.isRegisteredSymbol||function(t){try{return void 0!==n(o(t))}catch(t){return!1}}}var nv,ov,sv;function rv(){if(ov)return nv;ov=1;for(var t=Ie(),e=Wt(),i=z(),n=Kt(),o=Fe(),s=e("Symbol"),r=s.isWellKnownSymbol,a=e("Object","getOwnPropertyNames"),l=i(s.prototype.valueOf),h=t("wks"),d=0,c=a(s),u=c.length;d=p?t?"":void 0:(h=s(c,u))<55296||h>56319||u+1===p||(d=s(c,u+1))<56320||d>57343?t?o(c,u):h:t?r(c,u,u+2):d-56320+(h-55296<<10)+65536}};return wv={codeAt:a(!1),charAt:a(!0)}}function Rv(){if(kv)return Av;kv=1;var t=Fv().charAt,e=Qi(),i=yo(),n=rr(),o=ar(),s="String Iterator",r=i.set,a=i.getterFor(s);return n(String,"String",function(t){r(this,{type:s,string:e(t),index:0})},function(){var e,i=a(this),n=i.string,s=i.index;return s>=n.length?o(void 0,!0):(e=t(n,s),i.index+=e.length,o(e,!1))}),Av}function Yv(){return Sv?Dv:(Sv=1,lr(),Rv(),Ko(),Dv=po().f("iterator"))}function jv(){if(Tv)return Cv;Tv=1;var t=Yv();return dr(),Cv=t}function zv(){return Ov?Mv:(Ov=1,Mv=jv())}function Hv(){return Pv?Ev:(Pv=1,Ev=zv())}function Gv(){return Lv?Iv:(Lv=1,Iv=Hv())}var Wv,Bv,Vv,Uv,Xv,qv,Kv,Zv,$v,Jv,Qv=n(Gv());function tb(t){return tb="function"==typeof Nv&&"symbol"==typeof Qv?function(t){return typeof t}:function(t){return t&&"function"==typeof Nv&&t.constructor===Nv&&t!==Nv.prototype?"symbol":typeof t},tb(t)}function eb(){return Bv?Wv:(Bv=1,os(),Wv=po().f("toPrimitive"))}function ib(){return Uv?Vv:(Uv=1,Vv=eb())}function nb(){return qv?Xv:(qv=1,Xv=ib())}function ob(){return Zv?Kv:(Zv=1,Kv=nb())}function sb(){return Jv?$v:(Jv=1,$v=ob())}var rb=n(sb());function ab(t){var e=function(t,e){if("object"!=tb(t)||!t)return t;var i=t[rb];if(void 0!==i){var n=i.call(t,e);if("object"!=tb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tb(e)?e:e+""}function lb(t,e,i){return(e=ab(e))in t?Vg(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var hb,db,cb,ub,pb,mb,fb,gb,vb,bb,yb,_b,wb,xb={};function kb(){if(db)return hb;db=1;var t=$t(),e=Le(),i=Rt(),n=Yi(),o=TypeError,s="Reduce of empty array with no initial value",r=function(r){return function(a,l,h,d){var c=e(a),u=i(c),p=n(c);if(t(l),0===p&&h<2)throw new o(s);var m=r?p-1:0,f=r?-1:1;if(h<2)for(;;){if(m in u){d=u[m],m+=f;break}if(m+=f,r?m<0:p<=m)throw new o(s)}for(;r?m>=0:p>m;m+=f)m in u&&(d=l(d,u[m],m,c));return d}};return hb={left:r(!1),right:r(!0)}}function Db(){return ub?cb:(ub=1,cb="NODE"===pu())}function Sb(){return fb?mb:(fb=1,function(){if(pb)return xb;pb=1;var t=Li(),e=kb().left,i=ul(),n=Ut();t({target:"Array",proto:!0,forced:!Db()&&n>79&&n<83||!i("reduce")},{reduce:function(t){var i=arguments.length;return e(this,t,i,i>1?arguments[1]:void 0)}})}(),mb=Sr()("Array","reduce"))}function Cb(){if(vb)return gb;vb=1;var t=Bt(),e=Sb(),i=Array.prototype;return gb=function(n){var o=n.reduce;return n===i||t(i,n)&&o===i.reduce?e:o},gb}function Tb(){return yb?bb:(yb=1,bb=Cb())}var Mb,Ob,Eb,Pb=n(wb?_b:(wb=1,_b=Tb())),Ib={};function Lb(){if(Ob)return Mb;Ob=1;var t=Ni(),e=Yi(),i=ji(),n=We(),o=function(s,r,a,l,h,d,c,u){for(var p,m,f=h,g=0,v=!!c&&n(c,u);g0&&t(p)?(m=e(p),f=o(s,r,p,m,f,d-1)-1):(i(f+1),s[f]=p),f++),g++;return f};return Mb=o}var Nb,Ab,Fb,Rb,Yb,jb,zb,Hb,Gb;function Wb(){return Fb?Ab:(Fb=1,function(){if(Eb)return Ib;Eb=1;var t=Li(),e=Lb(),i=$t(),n=Le(),o=Yi(),s=Ui();t({target:"Array",proto:!0},{flatMap:function(t){var r,a=n(this),l=o(a);return i(t),(r=s(a,0)).length=e(r,a,a,l,0,1,t,arguments.length>1?arguments[1]:void 0),r}})}(),Nb||(Nb=1,Ks()("flatMap")),Ab=Sr()("Array","flatMap"))}function Bb(){if(Yb)return Rb;Yb=1;var t=Bt(),e=Wb(),i=Array.prototype;return Rb=function(n){var o=n.flatMap;return n===i||t(i,n)&&o===i.flatMap?e:o},Rb}function Vb(){return zb?jb:(zb=1,jb=Bb())}var Ub,Xb,qb=n(Gb?Hb:(Gb=1,Hb=Vb()));var Kb,Zb,$b,Jb,Qb,ty,ey,iy,ny,oy,sy,ry,ay,ly,hy,dy,cy,uy,py,my,fy,gy,vy,by,yy,_y,wy,xy,ky,Dy=n(Xb?Ub:(Xb=1,Ub=jv())),Sy={},Cy={exports:{}};function Ty(){return Zb?Kb:(Zb=1,Kb=R()(function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))}function My(){if(Jb)return $b;Jb=1;var t=R(),e=Ht(),i=H(),n=Ty(),o=Object.isExtensible,s=t(function(){});return $b=s||n?function(t){return!!e(t)&&((!n||"ArrayBuffer"!==i(t))&&(!o||o(t)))}:o,$b}function Oy(){return ty?Qb:(ty=1,Qb=!R()(function(){return Object.isExtensible(Object.preventExtensions({}))}))}function Ey(){if(ey)return Cy.exports;ey=1;var t=Li(),e=z(),i=kn(),n=Ht(),o=Ne(),s=Pi().f,r=Ln(),a=jn(),l=My(),h=Ae(),d=Oy(),c=!1,u=h("meta"),p=0,m=function(t){s(t,u,{value:{objectID:"O"+p++,weakData:{}}})},f=Cy.exports={enable:function(){f.enable=function(){},c=!0;var i=r.f,n=e([].splice),o={};o[u]=1,i(o).length&&(r.f=function(t){for(var e=i(t),o=0,s=e.length;ob;b++)if((_=E(p[b]))&&r(u,_))return _;return new c(!1)}g=a(p,v)}for(w=S?p.next:g.next;!(x=e(w,g)).done;){try{_=E(x.value)}catch(t){h(g,"throw",t)}if("object"==typeof _&&_&&r(u,_))return _}return new c(!1)},dy}function Fy(){if(py)return uy;py=1;var t=Bt(),e=TypeError;return uy=function(i,n){if(t(n,i))return i;throw new e("Incorrect invocation")},uy}function Ry(){if(fy)return my;fy=1;var t=Li(),e=F(),i=Ey(),n=R(),o=Ii(),s=Ay(),r=Fy(),a=W(),l=Ht(),h=Yt(),d=vo(),c=Pi().f,u=_o().forEach,p=K(),m=yo(),f=m.set,g=m.getterFor;return my=function(m,v,b){var y,_=-1!==m.indexOf("Map"),w=-1!==m.indexOf("Weak"),x=_?"set":"add",k=e[m],D=k&&k.prototype,S={};if(p&&a(k)&&(w||D.forEach&&!n(function(){(new k).entries().next()}))){var C=(y=v(function(t,e){f(r(t,C),{type:m,collection:new k}),h(e)||s(e,t[x],{that:t,AS_ENTRIES:_})})).prototype,T=g(m);u(["add","clear","delete","forEach","get","has","set","keys","values","entries"],function(t){var e="add"===t||"set"===t;!(t in D)||w&&"clear"===t||o(C,t,function(i,n){var o=T(this).collection;if(!e&&w&&!l(i))return"get"===t&&void 0;var s=o[t](0===i?0:i,n);return e?this:s})}),w||c(C,"size",{configurable:!0,get:function(){return T(this).collection.size}})}else y=b.getConstructor(v,m,_,x),i.enable();return d(y,m,!1,!0),S[m]=y,t({global:!0,forced:!0},S),w||b.setStrong(y,m,_),y}}function Yy(){if(vy)return gy;vy=1;var t=Xn();return gy=function(e,i,n){for(var o in i)n&&n.unsafe&&e[o]?e[o]=i[o]:t(e,o,i[o],n);return e}}function jy(){if(yy)return by;yy=1;var t=Wt(),e=qn(),i=Fe(),n=K(),o=i("species");return by=function(i){var s=t(i);n&&s&&!s[o]&&e(s,o,{configurable:!0,get:function(){return this}})}}function zy(){if(wy)return _y;wy=1;var t=En(),e=qn(),i=Yy(),n=We(),o=Fy(),s=Yt(),r=Ay(),a=rr(),l=ar(),h=jy(),d=K(),c=Ey().fastKey,u=yo(),p=u.set,m=u.getterFor;return _y={getConstructor:function(a,l,h,u){var f=a(function(e,i){o(e,g),p(e,{type:l,index:t(null),first:null,last:null,size:0}),d||(e.size=0),s(i)||r(i,e[u],{that:e,AS_ENTRIES:h})}),g=f.prototype,v=m(l),b=function(t,e,i){var n,o,s=v(t),r=y(t,e);return r?r.value=i:(s.last=r={index:o=c(e,!0),key:e,value:i,previous:n=s.last,next:null,removed:!1},s.first||(s.first=r),n&&(n.next=r),d?s.size++:t.size++,"F"!==o&&(s.index[o]=r)),t},y=function(t,e){var i,n=v(t),o=c(e);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key===e)return i};return i(g,{clear:function(){for(var e=v(this),i=e.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=null),i=i.next;e.first=e.last=null,e.index=t(null),d?e.size=0:this.size=0},delete:function(t){var e=this,i=v(e),n=y(e,t);if(n){var o=n.next,s=n.previous;delete i.index[n.index],n.removed=!0,s&&(s.next=o),o&&(o.previous=s),i.first===n&&(i.first=o),i.last===n&&(i.last=s),d?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=v(this),o=n(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(o(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!y(this,t)}}),i(g,h?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return b(this,0===t?0:t,e)}}:{add:function(t){return b(this,t=0===t?0:t,t)}}),d&&e(g,"size",{configurable:!0,get:function(){return v(this).size}}),f},setStrong:function(t,e,i){var n=e+" Iterator",o=m(e),s=m(n);a(t,e,function(t,e){p(this,{type:n,target:t,state:o(t),kind:e,last:null})},function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?l("keys"===e?i.key:"values"===e?i.value:[i.key,i.value],!1):(t.target=null,l(void 0,!0))},i?"entries":"values",!i,!0),h(e)}},_y}function Hy(){return ky||(ky=1,xy||(xy=1,Ry()("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},zy()))),Sy}var Gy,Wy,By,Vy,Uy,Xy,qy,Ky,Zy,$y,Jy,Qy={};function t_(){return Wy||(Wy=1,Gy=function(t,e){return 1===e?function(e,i){return e[t](i)}:function(e,i,n){return e[t](i,n)}}),Gy}function e_(){if(Vy)return By;Vy=1;var t=Wt(),e=t_(),i=t("Map");return By={Map:i,set:e("set",2),get:e("get",1),has:e("has",1),remove:e("delete",1),proto:i.prototype}}function i_(){return qy?Xy:(qy=1,lr(),Hy(),function(){if(Uy)return Qy;Uy=1;var t=Li(),e=z(),i=$t(),n=jt(),o=Ay(),s=e_(),r=Oe(),a=R(),l=s.Map,h=s.has,d=s.get,c=s.set,u=e([].push),p=r||a(function(){return 1!==l.groupBy("ab",function(t){return t}).get("a").length});t({target:"Map",stat:!0,forced:r||p},{groupBy:function(t,e){n(t),i(e);var s=new l,r=0;return o(t,function(t){var i=e(t,r++);h(s,i)?u(d(s,i),t):c(s,i,[t])}),s}})}(),Rv(),Xy=Gt().Map)}function n_(){if(Zy)return Ky;Zy=1;var t=i_();return dr(),Ky=t}var o_,s_,r_=n(Jy?$y:(Jy=1,$y=n_())),a_={};function l_(){return s_||(s_=1,o_||(o_=1,Ry()("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},zy()))),a_}var h_,d_,c_,u_,p_,m_,f_,g_,v_,b_,y_,__,w_,x_,k_,D_,S_,C_,T_,M_,O_,E_={};function P_(){if(d_)return h_;d_=1;var t=Zt(),e=TypeError;return h_=function(i){if("object"==typeof i&&"size"in i&&"has"in i&&"add"in i&&"delete"in i&&"keys"in i)return i;throw new e(t(i)+" is not a set")},h_}function I_(){if(u_)return c_;u_=1;var t=Wt(),e=t_(),i=t("Set"),n=i.prototype;return c_={Set:i,add:e("add",1),has:e("has",1),remove:e("delete",1),proto:n}}function L_(){if(m_)return p_;m_=1;var t=Z();return p_=function(e,i,n){for(var o,s,r=n?e:e.iterator,a=e.next;!(o=t(a,r)).done;)if(void 0!==(s=i(o.value)))return s},p_}function N_(){if(g_)return f_;g_=1;var t=L_();return f_=function(e,i,n){return n?t(e.keys(),i,!0):e.forEach(i)},f_}function A_(){if(b_)return v_;b_=1;var t=I_(),e=N_(),i=t.Set,n=t.add;return v_=function(t){var o=new i;return e(t,function(t){n(o,t)}),o},v_}function F_(){return __||(__=1,y_=function(t){return t.size}),y_}function R_(){return x_?w_:(x_=1,w_=function(t){return{iterator:t,next:t.next,done:!1}})}function Y_(){if(D_)return k_;D_=1;var t=$t(),e=Ei(),i=Z(),n=Fi(),o=R_(),s="Invalid size",r=RangeError,a=TypeError,l=Math.max,h=function(e,i){this.set=e,this.size=l(i,0),this.has=t(e.has),this.keys=t(e.keys)};return h.prototype={getIterator:function(){return o(e(i(this.keys,this.set)))},includes:function(t){return i(this.has,this.set,t)}},k_=function(t){e(t);var i=+t.size;if(i!=i)throw new a(s);var o=n(i);if(o<0)throw new r(s);return new h(t,o)}}function j_(){if(C_)return S_;C_=1;var t=P_(),e=I_(),i=A_(),n=F_(),o=Y_(),s=N_(),r=L_(),a=e.has,l=e.remove;return S_=function(e){var h=t(this),d=o(e),c=i(h);return n(h)<=d.size?s(h,function(t){d.includes(t)&&l(c,t)}):r(d.getIterator(),function(t){a(c,t)&&l(c,t)}),c}}function z_(){return M_?T_:(M_=1,T_=function(){return!1})}var H_,G_,W_,B_={};function V_(){if(G_)return H_;G_=1;var t=P_(),e=I_(),i=F_(),n=Y_(),o=N_(),s=L_(),r=e.Set,a=e.add,l=e.has;return H_=function(e){var h=t(this),d=n(e),c=new r;return i(h)>d.size?s(d.getIterator(),function(t){l(h,t)&&a(c,t)}):o(h,function(t){d.includes(t)&&a(c,t)}),c}}var U_,X_,q_,K_={};function Z_(){if(X_)return U_;X_=1;var t=P_(),e=I_().has,i=F_(),n=Y_(),o=N_(),s=L_(),r=Ny();return U_=function(a){var l=t(this),h=n(a);if(i(l)<=h.size)return!1!==o(l,function(t){if(h.includes(t))return!1},!0);var d=h.getIterator();return!1!==s(d,function(t){if(e(l,t))return r(d,"normal",!1)})},U_}var $_,J_,Q_,tw={};function ew(){if(J_)return $_;J_=1;var t=P_(),e=F_(),i=N_(),n=Y_();return $_=function(o){var s=t(this),r=n(o);return!(e(s)>r.size)&&!1!==i(s,function(t){if(!r.includes(t))return!1},!0)}}var iw,nw,ow,sw={};function rw(){if(nw)return iw;nw=1;var t=P_(),e=I_().has,i=F_(),n=Y_(),o=L_(),s=Ny();return iw=function(r){var a=t(this),l=n(r);if(i(a)1;return e.has(1)&&e.clear(),{done:i,value:2}}}}},e=new Set([1,2,3,4]);return 3!==e.difference(t).size})},{difference:e})}(),function(){if(W_)return B_;W_=1;var t=Li(),e=R(),i=V_();t({target:"Set",proto:!0,real:!0,forced:!z_()("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||e(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:i})}(),function(){if(q_)return K_;q_=1;var t=Li(),e=Z_();t({target:"Set",proto:!0,real:!0,forced:!z_()("isDisjointFrom",function(t){return!t})},{isDisjointFrom:e})}(),function(){if(Q_)return tw;Q_=1;var t=Li(),e=ew();t({target:"Set",proto:!0,real:!0,forced:!z_()("isSubsetOf",function(t){return t})},{isSubsetOf:e})}(),function(){if(ow)return sw;ow=1;var t=Li(),e=rw();t({target:"Set",proto:!0,real:!0,forced:!z_()("isSupersetOf",function(t){return!t})},{isSupersetOf:e})}(),function(){if(cw)return uw;cw=1;var t=Li(),e=pw(),i=mw();t({target:"Set",proto:!0,real:!0,forced:!z_()("symmetricDifference")||!i("symmetricDifference")},{symmetricDifference:e})}(),function(){if(vw)return Dw;vw=1;var t=Li(),e=Sw(),i=mw();t({target:"Set",proto:!0,real:!0,forced:!z_()("union")||!i("union")},{union:e})}(),Rv(),bw=Gt().Set)}function Tw(){if(ww)return _w;ww=1;var t=Cw();return dr(),_w=t}var Mw,Ow,Ew,Pw,Iw,Lw,Nw,Aw,Fw,Rw,Yw,jw,zw=n(kw?xw:(kw=1,xw=Tw()));function Hw(){return Ow?Mw:(Ow=1,lr(),Rv(),Mw=Ly())}function Gw(){if(Pw)return Ew;Pw=1;var t=Hw();return dr(),Ew=t}function Ww(){return Lw?Iw:(Lw=1,Iw=Gw())}function Bw(){return Aw?Nw:(Aw=1,Nw=Ww())}function Vw(){return Rw?Fw:(Rw=1,Fw=Bw())}var Uw,Xw,qw,Kw,Zw,$w,Jw,Qw,tx,ex,ix,nx,ox,sx,rx,ax,lx,hx=n(jw?Yw:(jw=1,Yw=Vw())),dx={};function cx(){if(Xw)return Uw;Xw=1;var t=Yn(),e=Math.floor,i=function(n,o){var s=n.length;if(s<8)for(var r,a,l=1;l0;)n[a]=n[--a];a!==l++&&(n[a]=r)}else for(var h=e(s/2),d=i(t(n,0,h),o),c=i(t(n,h),o),u=d.length,p=c.length,m=0,f=0;m3)){if(c)return!0;if(p)return p<603;var t,e,i,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)m.push({k:e+n,v:i})}for(m.sort(function(t,e){return e.v-t.v}),n=0;nr(i)?1:-1}}(t)),a=o(d),h=0;h1?arguments[1]:void 0)}})}(),_x=Sr()("Array","some"))}function Px(){if(kx)return xx;kx=1;var t=Bt(),e=Ex(),i=Array.prototype;return xx=function(n){var o=n.some;return n===i||t(i,n)&&o===i.some?e:o},xx}function Ix(){return Sx?Dx:(Sx=1,Dx=Px())}var Lx,Nx,Ax,Fx,Rx,Yx,jx,zx,Hx=n(Tx?Cx:(Tx=1,Cx=Ix()));function Gx(){return Nx?Lx:(Nx=1,lr(),Lx=Sr()("Array","keys"))}function Wx(){return Fx?Ax:(Fx=1,Ax=Gx())}function Bx(){if(Yx)return Rx;Yx=1,dr();var t=Gi(),e=Ne(),i=Bt(),n=Wx(),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return Rx=function(r){var a=r.keys;return r===o||i(o,r)&&a===o.keys||e(s,t(r))?n:a},Rx}var Vx,Ux,Xx,qx,Kx,Zx,$x,Jx,Qx=n(zx?jx:(zx=1,jx=Bx()));function tk(){return Ux?Vx:(Ux=1,lr(),Vx=Sr()("Array","values"))}function ek(){return qx?Xx:(qx=1,Xx=tk())}function ik(){if(Zx)return Kx;Zx=1,dr();var t=Gi(),e=Ne(),i=Bt(),n=ek(),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return Kx=function(r){var a=r.values;return r===o||i(o,r)&&a===o.values||e(s,t(r))?n:a},Kx}var nk,ok,sk,rk,ak,lk,hk,dk,ck=n(Jx?$x:(Jx=1,$x=ik()));function uk(){return ok?nk:(ok=1,lr(),nk=Sr()("Array","entries"))}function pk(){return rk?sk:(rk=1,sk=uk())}function mk(){if(lk)return ak;lk=1,dr();var t=Gi(),e=Ne(),i=Bt(),n=pk(),o=Array.prototype,s={DOMTokenList:!0,NodeList:!0};return ak=function(r){var a=r.entries;return r===o||i(o,r)&&a===o.entries||e(s,t(r))?n:a},ak}var fk,gk,vk=n(dk?hk:(dk=1,hk=mk()));var bk=n(gk?fk:(gk=1,fk=zg()));const yk=[];for(let t=0;t<256;++t)yk.push((t+256).toString(16).slice(1));const _k=new Uint8Array(16);function wk(t,e,i){return crypto.randomUUID?crypto.randomUUID():function(t){t=t||{};const e=t.random??t.rng?.()??crypto.getRandomValues(_k);if(e.length<16)throw new Error("Random bytes length must be >= 16");return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(t,e=0){return(yk[t[e+0]]+yk[t[e+1]]+yk[t[e+2]]+yk[t[e+3]]+"-"+yk[t[e+4]]+yk[t[e+5]]+"-"+yk[t[e+6]]+yk[t[e+7]]+"-"+yk[t[e+8]]+yk[t[e+9]]+"-"+yk[t[e+10]]+yk[t[e+11]]+yk[t[e+12]]+yk[t[e+13]]+yk[t[e+14]]+yk[t[e+15]]).toLowerCase()}(e)}(t)}function xk(t,e){var i=Ea(t);if($f){var n=$f(t);e&&(n=Pd(n).call(n,function(e){return hg(t,e).enumerable})),i.push.apply(i,n)}return i}function kk(t){for(var e=1;ee(t),t)}_add(t,e){null!=e&&this._target.add(this._transformItems(this._source.get(e.items)))}_update(t,e){null!=e&&this._target.update(this._transformItems(this._source.get(e.items)))}_remove(t,e){null!=e&&this._target.remove(this._transformItems(e.oldData))}}class Sk{constructor(t){lb(this,"_source",void 0),lb(this,"_transformers",[]),this._source=t}filter(t){return this._transformers.push(e=>Pd(e).call(e,t)),this}map(t){return this._transformers.push(e=>ya(e).call(e,t)),this}flatMap(t){return this._transformers.push(e=>qb(e).call(e,t)),this}to(t){return new Dk(this._source,this._transformers,t)}}function Ck(t){return"string"==typeof t||"number"==typeof t}class Tk{constructor(t){lb(this,"delay",void 0),lb(this,"max",void 0),lb(this,"_queue",[]),lb(this,"_timeout",null),lb(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(t)}setOptions(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}static extend(t,e){const i=new Tk(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=()=>{i.flush()};const n=[{name:"flush",original:void 0}];if(e&&e.replace)for(let o=0;othis.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=Fu(()=>{this.flush()},this.delay))}flush(){var t,e;Cl(t=rh(e=this._queue).call(e,0)).call(t,t=>{t.fn.apply(t.context||t.fn,t.args||[])})}}class Mk{constructor(){lb(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),lb(this,"subscribe",Mk.prototype.on),lb(this,"unsubscribe",Mk.prototype.off)}_trigger(t,e,i){var n;if("*"===t)throw new Error("Cannot trigger event *");Cl(n=[...this._subscribers[t],...this._subscribers["*"]]).call(n,n=>{n(t,e,null!=i?i:null)})}on(t,e){"function"==typeof e&&this._subscribers[t].push(e)}off(t,e){var i;this._subscribers[t]=Pd(i=this._subscribers[t]).call(i,t=>t!==e)}}class Ok{constructor(t){lb(this,"_pairs",void 0),this._pairs=t}*[Dy](){for(const[t,e]of this._pairs)yield[t,e]}*entries(){for(const[t,e]of this._pairs)yield[t,e]}*keys(){for(const[t]of this._pairs)yield t}*values(){for(const[,t]of this._pairs)yield t}toIdArray(){var t;return ya(t=[...this._pairs]).call(t,t=>t[0])}toItemArray(){var t;return ya(t=[...this._pairs]).call(t,t=>t[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){const t=Zc(null);for(const[e,i]of this._pairs)t[e]=i;return t}toMap(){return new r_(this._pairs)}toIdSet(){return new zw(this.toIdArray())}toItemSet(){return new zw(this.toItemArray())}cache(){return new Ok([...this._pairs])}distinct(t){const e=new zw;for(const[i,n]of this._pairs)e.add(t(n,i));return e}filter(t){const e=this._pairs;return new Ok({*[Dy](){for(const[i,n]of e)t(n,i)&&(yield[i,n])}})}forEach(t){for(const[e,i]of this._pairs)t(i,e)}map(t){const e=this._pairs;return new Ok({*[Dy](){for(const[i,n]of e)yield[i,t(n,i)]}})}max(t){const e=hx(this._pairs);let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,s]=i.value,r=t(s,e);r>o&&(o=r,n=s)}return n}min(t){const e=hx(this._pairs);let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,s]=i.value,r=t(s,e);r{var e;return hx(Mx(e=[...this._pairs]).call(e,(e,i)=>{let[n,o]=e,[s,r]=i;return t(o,r,n,s)}))}})}}class Ek extends Mk{get idProp(){return this._idProp}constructor(t,e){super(),lb(this,"flush",void 0),lb(this,"length",void 0),lb(this,"_options",void 0),lb(this,"_data",void 0),lb(this,"_idProp",void 0),lb(this,"_queue",null),t&&!aa(t)&&(e=t,t=[]),this._options=e||{},this._data=new r_,this.length=0,this._idProp=this._options.fieldId||"id",t&&t.length&&this.add(t),this.setOptions(e)}setOptions(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Tk.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"==typeof t.queue&&this._queue.setOptions(t.queue)))}add(t,e){const i=[];let n;if(aa(t)){const e=ya(t).call(t,t=>t[this._idProp]);if(Hx(e).call(e,t=>this._data.has(t)))throw new Error("A duplicate id was found in the parameter array.");for(let e=0,o=t.length;e{const e=t[r];if(null!=e&&this._data.has(e)){const i=t,r=mh({},this._data.get(e)),a=this._updateItem(i);n.push(a),s.push(i),o.push(r)}else{const e=this._addItem(t);i.push(e)}};if(aa(t))for(let e=0,i=t.length;e{const e=this._data.get(t[this._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}})).call(i,t=>{let{oldData:e,update:i}=t;const n=e[this._idProp],o=Im(e,i);return this._data.set(n,o),{id:n,oldData:e,updatedData:o}});if(n.length){const t={items:ya(n).call(n,t=>t.id),oldData:ya(n).call(n,t=>t.oldData),data:ya(n).call(n,t=>t.updatedData)};return this._trigger("update",t,e),t.items}return[]}get(t,e){let i,n,o;Ck(t)?(i=t,o=e):aa(t)?(n=t,o=e):o=t;const s=o&&"Object"===o.returnType?"Object":"Array",r=o&&Pd(o),a=[];let l,h,d;if(null!=i)l=this._data.get(i),l&&r&&!r(l)&&(l=void 0);else if(null!=n)for(let t=0,e=n.length;t(e[i]=t[i],e),{}):t}_sort(t,e){if("string"==typeof e){const i=e;Mx(t).call(t,(t,e)=>{const n=t[i],o=e[i];return n>o?1:ni)&&(e=o,i=s)}return e||null}min(t){let e=null,i=null;for(const o of ck(n=this._data).call(n)){var n;const s=o[t];"number"==typeof s&&(null==i||ss(t)&&r(t)),null==n?this._data.get(o):this._data.get(n,o)}getIds(t){if(this._data.length){const e=Pd(this._options),i=null!=t?Pd(t):null;let n;return n=i?e?t=>e(t)&&i(t):i:e,this._data.getIds({filter:n,order:t&&t.order})}return[]}forEach(t,e){if(this._data){var i;const n=Pd(this._options),o=e&&Pd(e);let s;s=o?n?function(t){return n(t)&&o(t)}:o:n,Cl(i=this._data).call(i,t,{filter:s,order:e&&e.order})}}map(t,e){if(this._data){var i;const n=Pd(this._options),o=e&&Pd(e);let s;return s=o?n?t=>n(t)&&o(t):o:n,ya(i=this._data).call(i,t,{filter:s,order:e&&e.order})}return[]}getDataSet(){return this._data.getDataSet()}stream(t){var e;return this._data.stream(t||{[Dy]:dl(e=Qx(this._ids)).call(e,this._ids)})}dispose(){var t;null!==(t=this._data)&&void 0!==t&&t.off&&this._data.off("*",this._listener);const e="This data view has already been disposed of.",i={get:()=>{throw new Error(e)},set:()=>{throw new Error(e)},configurable:!1};for(const t of Kr(Pk.prototype))bk(this,t,i)}_onEvent(t,e,i){if(!e||!e.items||!this._data)return;const n=e.items,o=[],s=[],r=[],a=[],l=[],h=[];switch(t){case"add":for(let t=0,e=n.length;t/g,l=/"/g,h=/"/g,d=/([a-zA-Z0-9]*);?/gim,c=/:?/gim,u=/&newline;?/gim,p=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,m=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,f=/u\s*r\s*l\s*\(.*/gi;function g(t){return t.replace(l,""")}function v(t){return t.replace(h,'"')}function b(t){return t.replace(d,function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))})}function y(t){return t.replace(c,":").replace(u," ")}function _(t){for(var e="",n=0,o=t.length;n0;e--){var i=t[e];if(" "!==i)return"="===i?e:-1}}function a(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}return rD.parseTag=function(t,n,o){var s="",r=0,a=!1,l=!1,h=0,d=t.length,c="",u="";t:for(h=0;h"===p||h===d-1){s+=o(t.slice(r,a)),c=e(u=t.slice(a,h+1)),s+=n(a,s.length,c,u,i(u)),r=h+1,a=!1;continue}if('"'===p||"'"===p)for(var m=1,f=t.charAt(h-m);""===f.trim()||"="===f;){if("="===f){l=p;continue t}f=t.charAt(h-++m)}}else if(p===l){l=!1;continue}}return r";var y=function(t){var e=s.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var i="/"===(t=s.trim(t.slice(e+1,-1)))[t.length-1];return i&&(t=s.trim(t.slice(0,-1))),{html:t,closing:i}}(n),_=l[i],w=o(y.html,function(t,e){var n=-1!==s.indexOf(_,t),o=c(i,t,e,n);return r(o)?n?(e=p(i,t,e,g))?t+"="+f+e+f:t:r(o=u(i,t,e,n))?void 0:o:o});return n="<"+i,w&&(n+=" "+w),y.closing&&(n+=" /"),n+=">"}return r(b=d(i,n,v))?m(n):b},m);return v&&(b=v.remove(b)),b},nD=a}var hD=(sD||(sD=1,function(t,e){var i=eD(),n=aD(),o=lD();function s(t,e){return new o(e).process(t)}(e=t.exports=s).filterXSS=s,e.FilterXSS=o,function(){for(var t in i)e[t]=i[t];for(var o in n)e[o]=n[o]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(Uk,Uk.exports)),Uk.exports),dD=n(hD);function cD(t,e){var i=Ea(t);if($f){var n=$f(t);e&&(n=Pd(n).call(n,function(e){return hg(t,e).enumerable})),i.push.apply(i,n)}return i}function uD(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{start:"Date",end:"Date"};const l=t._idProp,h=new Ek({fieldId:l}),d=ya((c=t,e=new Sk(c))).call(e,t=>{var e;return Pb(e=Ea(t)).call(e,(e,i)=>(e[i]=gD(t[i],a[i]),e),{})}).to(h);var c;return d.all().start(),{add:function(){return t.getDataSet().add(...arguments)},remove:function(){return t.getDataSet().remove(...arguments)},update:function(){return t.getDataSet().update(...arguments)},updateOnly:function(){return t.getDataSet().updateOnly(...arguments)},clear:function(){return t.getDataSet().clear(...arguments)},forEach:dl(i=Cl(h)).call(i,h),get:dl(n=h.get).call(n,h),getIds:dl(o=h.getIds).call(o,h),off:dl(s=h.off).call(s,h),on:dl(r=h.on).call(r,h),get length(){return h.length},idProp:l,type:a,rawDS:t,coercedDS:h,dispose:()=>d.stop()}}const bD=t=>{const e=new dD.FilterXSS(t);return t=>"string"==typeof t?e.process(t):t},yD=t=>t;let _D=bD();const wD=uD(uD({},Tf),{},{convert:gD,setupXSSProtection:t=>{t&&(!0===t.disabled?(_D=yD,console.warn("You disabled XSS protection for vis-Timeline. I sure hope you know what you're doing!")):t.filterOptions&&(_D=bD(t.filterOptions)))}});bk(wD,"xss",{get:function(){return _D}});var xD,kD,DD,SD,CD,TD,MD,OD,ED,PD={};function ID(){if(kD)return xD;kD=1;var t=F(),e=R(),i=z(),n=Qi(),o=Jd().trim,s=$d(),r=i("".charAt),a=t.parseFloat,l=t.Symbol,h=l&&l.iterator,d=1/a(s+"-0")!=-1/0||h&&!e(function(){a(Object(h))});return xD=d?function(t){var e=o(n(t)),i=a(e);return 0===i&&"-"===r(e,0)?-0:i}:a,xD}function LD(){return CD?SD:(CD=1,function(){if(DD)return PD;DD=1;var t=Li(),e=ID();t({global:!0,forced:parseFloat!==e},{parseFloat:e})}(),SD=Gt().parseFloat)}function ND(){return MD?TD:(MD=1,TD=LD())}var AD=n(ED?OD:(ED=1,OD=ND()));class FD{constructor(){this.options=null,this.props=null}setOptions(t){t&&wD.extend(this.options,t)}redraw(){return!1}destroy(){}_isResized(){const t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t}}var RD,YD,jD,zD,HD,GD,WD,BD,VD;function UD(){return jD?YD:(jD=1,RD||(RD=1,Li()({target:"String",proto:!0},{repeat:Jc()})),YD=Sr()("String","repeat"))}function XD(){if(HD)return zD;HD=1;var t=Bt(),e=UD(),i=String.prototype;return zD=function(n){var o=n.repeat;return"string"==typeof n||n===i||t(i,n)&&o===i.repeat?e:o},zD}function qD(){return WD?GD:(WD=1,GD=XD())}var KD=n(VD?BD:(VD=1,BD=qD()));function ZD(t,e,i){if(i&&!aa(i))return ZD(t,e,[i]);if(e.hiddenDates=[],i&&1==aa(i)){var n;for(let n=0;nt.start-e.start)}}function $D(t,e,i){if(i&&!aa(i))return $D(t,e,[i]);if(i&&void 0!==e.domProps.centerContainer.width){ZD(t,e,i);const n=t(e.range.start),o=t(e.range.end),s=(e.range.end-e.range.start)/e.domProps.centerContainer.width;for(let r=0;r=4*s){let t=0,s=o.clone();switch(KD(i[r])){case"daily":a.day()!=l.day()&&(t=1),a=a.dayOfYear(n.dayOfYear()).year(n.year()).subtract(7,"days"),l=l.dayOfYear(n.dayOfYear()).year(n.year()).subtract(7-t,"days"),s.add(1,"weeks");break;case"weekly":{const t=l.diff(a,"days"),e=a.day();a=a.date(n.date()).month(n.month()).year(n.year()),l=a.clone(),a=a.day(e).subtract(1,"weeks"),l=l.day(e).add(t,"days").subtract(1,"weeks"),s.add(1,"weeks");break}case"monthly":a.month()!=l.month()&&(t=1),a=a.month(n.month()).year(n.year()).subtract(1,"months"),l=l.month(n.month()).year(n.year()).subtract(1,"months").add(t,"months"),s.add(1,"months");break;case"yearly":a.year()!=l.year()&&(t=1),a=a.year(n.year()).subtract(1,"years"),l=l.year(n.year()).subtract(1,"years").add(t,"years"),s.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",KD(i[r]))}for(;a=i[o].start&&i[t].end<=i[o].end?i[t].remove=!0:i[t].start>=i[o].start&&i[t].start<=i[o].end?(i[o].end=i[t].end,i[t].remove=!0):i[t].end>=i[o].start&&i[t].end<=i[o].end&&(i[o].start=i[t].start,i[t].remove=!0));for(o=0;ot.start-e.start)}function QD(t,e,i){let n=!1;const o=e.current.valueOf();for(let t=0;t=i&&ot.range.end){const o={start:t.range.start,end:e};return e=oS(t.options.moment,t.body.hiddenDates,o,e),n=t.range.conversion(i,s),(e.valueOf()-n.offset)*n.scale}return e=oS(t.options.moment,t.body.hiddenDates,t.range,e),n=t.range.conversion(i,s),(e.valueOf()-n.offset)*n.scale}}function eS(t,e,i){if(0==t.body.hiddenDates.length){const n=t.range.conversion(i);return new Date(e/n.scale+n.offset)}{const n=iS(t.body.hiddenDates,t.range.start,t.range.end),o=(t.range.end-t.range.start-n)*e/i,s=rS(t.body.hiddenDates,t.range,o);return new Date(s+o+t.range.start)}}function iS(t,e,i){let n=0;for(let o=0;o=e&&r=e&&r<=i&&(n+=r-s)}return n}function oS(t,e,i,n){return n=t(n).toDate().valueOf(),n-=sS(t,e,i,n)}function sS(t,e,i,n){let o=0;n=t(n).toDate().valueOf();for(let t=0;t=i.start&&r=r&&(o+=r-s)}return o}function rS(t,e,i){let n=0,o=0,s=e.start;for(let r=0;r=e.start&&l=i)break;n+=l-a}}return n}function aS(t,e,i,n){const o=lS(e,t);return 1==o.hidden?i<0?1==n?o.startDate-(o.endDate-e)-1:o.startDate-1:1==n?o.endDate+(e-o.startDate)+1:o.endDate+1:e}function lS(t,e){for(let o=0;o=i&&t1e3&&(i=1e3),t.body.dom.rollingModeBtn.style.visibility="hidden",t.currentTimeTimer=Fu(e,i)}()}stopRolling(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),this.rolling=!1,this.body.dom.rollingModeBtn.style.visibility="visible")}setRange(t,e,i,n,o){i||(i={}),!0!==i.byUser&&(i.byUser=!1);const s=this,r=null!=t?wD.convert(t,"Date").valueOf():null,a=null!=e?wD.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),this.millisecondsPerPixelCache=void 0,i.animation){const t=this.start,e=this.end,d="object"==typeof i.animation&&"duration"in i.animation?i.animation.duration:500,c="object"==typeof i.animation&&"easingFunction"in i.animation?i.animation.easingFunction:"easeInOutQuad",u=wD.easingFunctions[c];var l;if(!u)throw new Error(vd(l="Unknown easing function ".concat(du(c),". Choose from: ")).call(l,Ea(wD.easingFunctions).join(", ")));const p=Va();let m=!1;const f=()=>{if(!s.props.touch.dragging){const l=Va()-p,c=u(l/d),g=l>d,v=g||null===r?r:t+(r-t)*c,b=g||null===a?a:e+(a-e)*c;h=s._applyRange(v,b),$D(s.options.moment,s.body,s.options.hiddenDates),m=m||h;const y={start:new Date(s.start),end:new Date(s.end),byUser:i.byUser,event:i.event};if(o&&o(c,h,g),h&&s.body.emitter.emit("rangechange",y),g){if(m&&(s.body.emitter.emit("rangechanged",y),n))return n()}else s.animationTimer=Fu(f,20)}};return f()}var h=this._applyRange(r,a);if($D(this.options.moment,this.body,this.options.hiddenDates),h){const t={start:new Date(this.start),end:new Date(this.end),byUser:i.byUser,event:i.event};if(this.body.emitter.emit("rangechange",t),clearTimeout(s.timeoutID),s.timeoutID=Fu(()=>{s.body.emitter.emit("rangechanged",t)},200),n)return n()}}getMillisecondsPerPixel(){return void 0===this.millisecondsPerPixelCache&&(this.millisecondsPerPixelCache=(this.end-this.start)/this.body.dom.center.clientWidth),this.millisecondsPerPixelCache}_cancelAnimation(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)}_applyRange(t,e){let i=null!=t?wD.convert(t,"Date").valueOf():this.start,n=null!=e?wD.convert(e,"Date").valueOf():this.end;const o=null!=this.options.max?wD.convert(this.options.max,"Date").valueOf():null,s=null!=this.options.min?wD.convert(this.options.min,"Date").valueOf():null;let r;if(isNaN(i)||null===i)throw new Error('Invalid start "'.concat(t,'"'));if(isNaN(n)||null===n)throw new Error('Invalid end "'.concat(e,'"'));if(no&&(n=o)),null!==o&&n>o&&(r=n-o,i-=r,n-=r,null!=s&&i=this.start-e&&n<=this.end?(i=this.start,n=this.end):(r=t-(n-i),i-=r/2,n+=r/2)}}if(null!==this.options.zoomMax){let t=AD(this.options.zoomMax);t<0&&(t=0),n-i>t&&(this.end-this.start===t&&ithis.end?(i=this.start,n=this.end):(r=n-i-t,i+=r/2,n-=r/2))}const a=this.start!=i||this.end!=n;return i>=this.start&&i<=this.end||n>=this.start&&n<=this.end||this.start>=i&&this.start<=n||this.end>=i&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=i,this.end=n,a}getRange(){return{start:this.start,end:this.end}}conversion(t,e){return mS.conversion(this.start,this.end,t,e)}static conversion(t,e,i,n){return void 0===n&&(n=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-n)}:{offset:0,scale:1}}_onDragStart(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.stopRolling(),this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))}_onDrag(t){if(!t)return;if(!this.props.touch.dragging)return;if(!this.options.moveable)return;if(!this.props.touch.allowDragging)return;const e=this.options.direction;fS(e);let i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;let n=this.props.touch.end-this.props.touch.start;n-=iS(this.body.hiddenDates,this.start,this.end);const o="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;let s;s=this.options.rtl?i/o*n:-i/o*n;const r=this.props.touch.start+s,a=this.props.touch.end+s,l=aS(this.body.hiddenDates,r,this.previousDelta-i,!0),h=aS(this.body.hiddenDates,a,this.previousDelta-i,!0);if(l!=r||h!=a)return this.deltaDifference+=i,this.props.touch.start=l,this.props.touch.end=h,void this._onDrag(t);this.previousDelta=i,this._applyRange(r,a);const d=new Date(this.start),c=new Date(this.end);this.body.emitter.emit("rangechange",{start:d,end:c,byUser:!0,event:t}),this.body.emitter.emit("panmove")}_onDragEnd(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0,event:t}))}_onMouseWheel(t){let e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail?e=-t.detail/3:t.deltaY&&(e=-t.deltaY/3),!(this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable)&&this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){const i=this.options.zoomFriction||5;let n,o;if(n=e<0?1-e/i:1/(1+e/i),this.rolling){const t=this.options.rollingMode&&this.options.rollingMode.offset||.5;o=this.start+(this.end-this.start)*t}else{const e=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center);o=this._pointerToDate(e)}this.zoom(n,o,e,t),t.preventDefault()}}_onTouch(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.props.touch.centerDate=null,this.scaleOffset=0,this.deltaDifference=0,wD.preventDefault(t)}_onPinch(t){if(!this.options.zoomable||!this.options.moveable)return;wD.preventDefault(t),this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center),this.props.touch.centerDate=this._pointerToDate(this.props.touch.center)),this.stopRolling();const e=1/(t.scale+this.scaleOffset),i=this.props.touch.centerDate,n=iS(this.body.hiddenDates,this.start,this.end),o=sS(this.options.moment,this.body.hiddenDates,this,i),s=n-o;let r=i-o+(this.props.touch.start-(i-o))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;const l=aS(this.body.hiddenDates,r,1-e,!0),h=aS(this.body.hiddenDates,a,e-1,!0);l==r&&h==a||(this.props.touch.start=l,this.props.touch.end=h,this.scaleOffset=1-t.scale,r=l,a=h);const d={animation:!1,byUser:!0,event:t};this.setRange(r,a,d),this.startToFront=!1,this.endToFront=!0}_isInsideRange(t){const e=t.center?t.center.x:t.clientX,i=this.body.dom.centerContainer.getBoundingClientRect(),n=this.options.rtl?e-i.left:i.right-e,o=this.body.util.toTime(n);return o>=this.start&&o<=this.end}_pointerToDate(t){let e;const i=this.options.direction;if(fS(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();{const i=this.body.domProps.center.height;return e=this.conversion(i),t.y/e.scale+e.offset}}getPointer(t,e){const i=e.getBoundingClientRect();return this.options.rtl?{x:i.right-t.x,y:t.y-i.top}:{x:t.x-i.left,y:t.y-i.top}}zoom(t,e,i,n){null==e&&(e=(this.start+this.end)/2);const o=iS(this.body.hiddenDates,this.start,this.end),s=sS(this.options.moment,this.body.hiddenDates,this,e),r=o-s;let a=e-s+(this.start-(e-s))*t,l=e+r+(this.end-(e+r))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);const h=aS(this.body.hiddenDates,a,i,!0),d=aS(this.body.hiddenDates,l,-i,!0);h==a&&d==l||(a=h,l=d);const c={animation:!1,byUser:!0,event:n};this.setRange(a,l,c),this.startToFront=!1,this.endToFront=!0}move(t){const e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n}moveTo(t){const e=(this.start+this.end)/2-t,i=this.start-e,n=this.end-e;this.setRange(i,n,{animation:!1,byUser:!0,event:null})}destroy(){this.stopRolling()}}function fS(t){if("horizontal"!=t&&"vertical"!=t)throw new TypeError('Unknown direction "'.concat(t,'". Choose "horizontal" or "vertical".'))}function gS(){return dS?hS:(dS=1,ku(),hS=Gt().setInterval)}var vS=n(uS?cS:(uS=1,cS=gS())),bS=null;let yS;if("undefined"!=typeof window){yS=function t(e,i){var n=i||{preventDefault:!1};if(e.Manager){var o=e,s=function(e,i){var s=Object.create(n);return i&&o.assign(s,i),t(new o(e,s),s)};return o.assign(s,o),s.Manager=function(e,i){var s=Object.create(n);return i&&o.assign(s,i),t(new o.Manager(e,s),s)},s}var r=Object.create(e),a=e.element;function l(t){return t.match(/[^ ]+/g)}function h(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var e=!1;t.stopPropagation=function(){e=!0};var i=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof i&&(t.srcEvent.stopPropagation=function(){i(),t.stopPropagation()}),t.firstTarget=bS;for(var n=bS.isConnected?bS:t.target;n&&!e;){var o=n.hammer;if(o)for(var s,r=0;r0?r._handlers[t]=n:(e.off(t,h),delete r._handlers[t]))}),r},r.emit=function(t,i){bS=i.target,e.emit(t,i)},r.destroy=function(){var t=e.element.hammer,i=t.indexOf(r);-1!==i&&t.splice(i,1),t.length||delete e.element.hammer,r._handlers={},e.destroy()},r}(window.Hammer||Em,{preventDefault:"mouse"})}else yS=function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};var _S=yS;function wS(t,e){e.inputHandler=function(t){t.isFirst&&e(t)},t.on("hammer.input",e.inputHandler)}class xS{constructor(t,e,i,n,o){this.moment=o&&o.moment||Nk,this.options=o||{},this.current=this.moment(),this._start=this.moment(),this._end=this.moment(),this.autoScale=!0,this.scale="day",this.step=1,this.setRange(t,e,i),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,aa(n)?this.hiddenDates=n:this.hiddenDates=null!=n?[n]:[],this.format=xS.FORMAT}setMoment(t){this.moment=t,this.current=this.moment(this.current.valueOf()),this._start=this.moment(this._start.valueOf()),this._end=this.moment(this._end.valueOf())}setFormat(t){const e=wD.deepExtend({},xS.FORMAT);this.format=wD.deepExtend(e,t)}setRange(t,e,i){if(!(t instanceof Date&&e instanceof Date))throw"No legal start or end date in method setRange";this._start=null!=t?this.moment(t.valueOf()):Va(),this._end=null!=e?this.moment(e.valueOf()):Va(),this.autoScale&&this.setMinimumStep(i)}start(){this.current=this._start.clone(),this.roundToMinor()}roundToMinor(){switch("week"==this.scale&&this.current.weekday(0),this.scale){case"year":this.current=this.current.year(this.step*Math.floor(this.current.year()/this.step)).month(0);case"month":this.current=this.current.date(1);case"week":case"day":case"weekday":this.current=this.current.hours(0);case"hour":this.current=this.current.minutes(0);case"minute":this.current=this.current.seconds(0);case"second":this.current=this.current.milliseconds(0)}if(1!=this.step){let t=this.current.clone();switch(this.scale){case"millisecond":this.current=this.current.subtract(this.current.milliseconds()%this.step,"milliseconds");break;case"second":this.current=this.current.subtract(this.current.seconds()%this.step,"seconds");break;case"minute":this.current=this.current.subtract(this.current.minutes()%this.step,"minutes");break;case"hour":this.current=this.current.subtract(this.current.hours()%this.step,"hours");break;case"weekday":case"day":this.current=this.current.subtract((this.current.date()-1)%this.step,"day");break;case"week":this.current=this.current.subtract(this.current.week()%this.step,"week");break;case"month":this.current=this.current.subtract(this.current.month()%this.step,"month");break;case"year":this.current=this.current.subtract(this.current.year()%this.step,"year")}t.isSame(this.current)||(this.current=this.moment(aS(this.hiddenDates,this.current.valueOf(),-1,!0)))}}hasNext(){return this.current.valueOf()<=this._end.valueOf()}next(){const t=this.current.valueOf();switch(this.scale){case"millisecond":this.current=this.current.add(this.step,"millisecond");break;case"second":this.current=this.current.add(this.step,"second");break;case"minute":this.current=this.current.add(this.step,"minute");break;case"hour":this.current=this.current.add(this.step,"hour"),this.current.month()<6?this.current=this.current.subtract(this.current.hours()%this.step,"hour"):this.current.hours()%this.step!==0&&(this.current=this.current.add(this.step-this.current.hours()%this.step,"hour"));break;case"weekday":case"day":this.current=this.current.add(this.step,"day");break;case"week":if(0!==this.current.weekday())this.current=this.current.weekday(0).add(this.step,"week");else if(!1===this.options.showMajorLabels)this.current=this.current.add(this.step,"week");else{const t=this.current.clone();t.add(1,"week"),t.isSame(this.current,"month")?this.current=this.current.add(this.step,"week"):this.current=this.current.add(this.step,"week").date(1)}break;case"month":this.current=this.current.add(this.step,"month");break;case"year":this.current=this.current.add(this.step,"year")}if(1!=this.step)switch(this.scale){case"millisecond":this.current.milliseconds()>0&&this.current.milliseconds()0&&this.current.seconds()0&&this.current.minutes()0&&this.current.hours()0?t.step:1,this.autoScale=!1)}setAutoScale(t){this.autoScale=t}setMinimumStep(t){if(null==t)return;const e=31104e6,i=2592e6,n=864e5,o=36e5,s=6e4,r=1e3;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),7776e6>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),6048e5>t&&this.options.showWeekScale&&(this.scale="week",this.step=1),1728e5>t&&(this.scale="day",this.step=2),n>t&&(this.scale="day",this.step=1),432e5>t&&(this.scale="weekday",this.step=1),144e5>t&&(this.scale="hour",this.step=4),o>t&&(this.scale="hour",this.step=1),9e5>t&&(this.scale="minute",this.step=15),6e5>t&&(this.scale="minute",this.step=10),3e5>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15e3>t&&(this.scale="second",this.step=15),1e4>t&&(this.scale="second",this.step=10),5e3>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200>t&&(this.scale="millisecond",this.step=200),100>t&&(this.scale="millisecond",this.step=100),50>t&&(this.scale="millisecond",this.step=50),10>t&&(this.scale="millisecond",this.step=10),5>t&&(this.scale="millisecond",this.step=5),1>t&&(this.scale="millisecond",this.step=1)}static snap(t,e,i){let n=Nk(t);if("year"==e){const t=n.year()+Math.round(n.month()/12);n=n.year(Math.round(t/i)*i).month(0).date(0).hours(0).minutes(0).seconds(0).milliseconds(0)}else if("month"==e)n=n.date()>15?n.date(1).add(1,"month"):n.date(1),n=n.hours(0).minutes(0).seconds(0).milliseconds(0);else if("week"==e)n=n.weekday()>2?n.weekday(0).add(1,"week"):n.weekday(0),n=n.hours(0).minutes(0).seconds(0).milliseconds(0);else if("day"==e){switch(i){case 5:case 2:n=n.hours(24*Math.round(n.hours()/24));break;default:n=n.hours(12*Math.round(n.hours()/12))}n=n.minutes(0).seconds(0).milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:n=n.hours(12*Math.round(n.hours()/12));break;default:n=n.hours(6*Math.round(n.hours()/6))}n=n.minutes(0).seconds(0).milliseconds(0)}else if("hour"==e){if(4===i)n=n.minutes(60*Math.round(n.minutes()/60));else n=n.minutes(30*Math.round(n.minutes()/30));n=n.seconds(0).milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:n=n.minutes(5*Math.round(n.minutes()/5)).seconds(0);break;case 5:n=n.seconds(60*Math.round(n.seconds()/60));break;default:n=n.seconds(30*Math.round(n.seconds()/30))}n=n.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:n=n.seconds(5*Math.round(n.seconds()/5)).milliseconds(0);break;case 5:n=n.milliseconds(1e3*Math.round(n.milliseconds()/1e3));break;default:n=n.milliseconds(500*Math.round(n.milliseconds()/500))}else if("millisecond"==e){const t=i>5?i/2:1;n=n.milliseconds(Math.round(n.milliseconds()/t)*t)}return n}isMajor(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}const t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return this.options.showWeekScale?1==t.isoWeekday():1==t.date();case"week":return 1==t.date();case"month":return 0==t.month();default:return!1}}getLabelMinor(t){if(null==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);const e=this.format.minorLabels[this.scale];return"week"===this.scale&&1===t.date()&&0!==t.weekday()?"":e&&e.length>0?this.moment(t).format(e):""}getLabelMajor(t){if(null==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);const e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""}getClassName(){var t;const e=this.moment,i=this.moment(this.current),n=i.locale?i.locale("en"):i.lang("en"),o=this.step,s=[];function r(t){return t/o%2==0?" vis-even":" vis-odd"}function a(t){return t.isSame(Va(),"day")?" vis-today":t.isSame(e().add(1,"day"),"day")?" vis-tomorrow":t.isSame(e().add(-1,"day"),"day")?" vis-yesterday":""}function l(t){return t.isSame(Va(),"week")?" vis-current-week":""}function h(t){return t.isSame(Va(),"month")?" vis-current-month":""}switch(this.scale){case"millisecond":s.push(a(n)),s.push(r(n.milliseconds()));break;case"second":s.push(a(n)),s.push(r(n.seconds()));break;case"minute":s.push(a(n)),s.push(r(n.minutes()));break;case"hour":s.push(vd(t="vis-h".concat(n.hours())).call(t,4==this.step?"-h"+(n.hours()+4):"")),s.push(a(n)),s.push(r(n.hours()));break;case"weekday":s.push("vis-".concat(n.format("dddd").toLowerCase())),s.push(a(n)),s.push(l(n)),s.push(r(n.date()));break;case"day":s.push("vis-day".concat(n.date())),s.push("vis-".concat(n.format("MMMM").toLowerCase())),s.push(a(n)),s.push(h(n)),s.push(this.step<=2?a(n):""),s.push(this.step<=2?"vis-".concat(n.format("dddd").toLowerCase()):""),s.push(r(n.date()-1));break;case"week":s.push("vis-week".concat(n.format("w"))),s.push(l(n)),s.push(r(n.week()));break;case"month":s.push("vis-".concat(n.format("MMMM").toLowerCase())),s.push(h(n)),s.push(r(n.month()));break;case"year":s.push("vis-year".concat(n.year())),s.push(function(t){return t.isSame(Va(),"year")?" vis-current-year":""}(n)),s.push(r(n.year()))}return Pd(s).call(s,String).join(" ")}}xS.FORMAT={minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",week:"w",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",week:"MMMM YYYY",month:"YYYY",year:""}};class kS extends FD{constructor(t,e){super(),this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,showWeekScale:!1,maxMinorChars:7,format:wD.extend({},xS.FORMAT),moment:Nk,timeAxis:null},this.options=wD.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}setOptions(t){t&&(wD.selectiveExtend(["showMinorLabels","showMajorLabels","showWeekScale","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),wD.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"==typeof t.orientation&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof Nk.locale?Nk.locale(t.locale):Nk.lang(t.locale)))}_create(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"}destroy(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null}redraw(){const t=this.props,e=this.dom.foreground,i=this.dom.background,n="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,o=e.parentNode!==n;this._calculateCharSize();const s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;const a=e.nextSibling,l=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height="".concat(this.props.height,"px"),this._repaintLabels(),a?n.insertBefore(e,a):n.appendChild(e),l?this.body.dom.backgroundVertical.insertBefore(i,l):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||o}_repaintLabels(){const t=this.options.orientation.axis,e=wD.convert(this.body.range.start,"Number"),i=wD.convert(this.body.range.end,"Number"),n=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf();let o=n-sS(this.options.moment,this.body.hiddenDates,this.body.range,n);o-=this.body.util.toTime(0).valueOf();const s=new xS(new Date(e),new Date(i),o,this.body.hiddenDates,this.options);s.setMoment(this.options.moment),this.options.format&&s.setFormat(this.options.format),this.options.timeAxis&&s.setScale(this.options.timeAxis),this.step=s;const r=this.dom;let a,l,h,d,c,u;r.redundant.lines=r.lines,r.redundant.majorTexts=r.majorTexts,r.redundant.minorTexts=r.minorTexts,r.lines=[],r.majorTexts=[],r.minorTexts=[];let p,m,f,g=0,v=0;const b=1e3;let y;for(s.start(),l=s.getCurrent(),d=this.body.util.toScreen(l);s.hasNext()&&v=.4*p;if(this.options.showMinorLabels&&u){var _=this._repaintMinorText(h,s.getLabelMinor(a),t,y);_.style.width="".concat(g,"px")}c&&this.options.showMajorLabels?(h>0&&(null==f&&(f=h),_=this._repaintMajorText(h,s.getLabelMajor(a),t,y)),m=this._repaintMajorLine(h,g,t,y)):u?m=this._repaintMinorLine(h,g,t,y):m&&(m.style.width="".concat(cc(m.style.width)+g,"px"))}if(v!==b||DS||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to ".concat(b," lines.")),DS=!0),this.options.showMajorLabels){const e=this.body.util.toTime(0),i=s.getLabelMajor(e),n=i.length*(this.props.majorCharWidth||10)+10;(null==f||n{for(;t.length;){const e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})}_repaintMinorText(t,e,i,n){let o=this.dom.redundant.minorTexts.shift();if(!o){const t=document.createTextNode("");o=document.createElement("div"),o.appendChild(t),this.dom.foreground.appendChild(o)}this.dom.minorTexts.push(o),o.innerHTML=wD.xss(e);let s="top"==i?this.props.majorLabelHeight:0;return this._setXY(o,t,s),o.className="vis-text vis-minor ".concat(n),o}_repaintMajorText(t,e,i,n){let o=this.dom.redundant.majorTexts.shift();if(!o){const t=document.createElement("div");o=document.createElement("div"),o.appendChild(t),this.dom.foreground.appendChild(o)}o.childNodes[0].innerHTML=wD.xss(e),o.className="vis-text vis-major ".concat(n);let s="top"==i?0:this.props.minorLabelHeight;return this._setXY(o,t,s),this.dom.majorTexts.push(o),o}_setXY(t,e,i){var n;const o=this.options.rtl?-1*e:e;t.style.transform=vd(n="translate(".concat(o,"px, ")).call(n,i,"px)")}_repaintMinorLine(t,e,i,n){var o;let s=this.dom.redundant.lines.shift();s||(s=document.createElement("div"),this.dom.background.appendChild(s)),this.dom.lines.push(s);const r=this.props;s.style.width="".concat(e,"px"),s.style.height="".concat(r.minorLineHeight,"px");let a="top"==i?r.majorLabelHeight:this.body.domProps.top.height,l=t-r.minorLineWidth/2;return this._setXY(s,l,a),s.className=vd(o="vis-grid ".concat(this.options.rtl?"vis-vertical-rtl":"vis-vertical"," vis-minor ")).call(o,n),s}_repaintMajorLine(t,e,i,n){var o;let s=this.dom.redundant.lines.shift();s||(s=document.createElement("div"),this.dom.background.appendChild(s)),this.dom.lines.push(s);const r=this.props;s.style.width="".concat(e,"px"),s.style.height="".concat(r.majorLineHeight,"px");let a="top"==i?0:this.body.domProps.top.height,l=t-r.majorLineWidth/2;return this._setXY(s,l,a),s.className=vd(o="vis-grid ".concat(this.options.rtl?"vis-vertical-rtl":"vis-vertical"," vis-major ")).call(o,n),s}_calculateCharSize(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth}}var DS=!1;function SS(t){var e,i=t&&t.preventDefault||!1,n=t&&t.container||window,o={},s={keydown:{},keyup:{}},r={};for(e=97;e<=122;e++)r[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)r[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){h(t,"keydown")},l=function(t){h(t,"keyup")},h=function(t,e){if(void 0!==s[e][t.keyCode]){for(var n=s[e][t.keyCode],o=0;o{this.options.locales[t]=wD.extend({},n,this.options.locales[t])}),e&&null!=e.time?this.customTime=e.time:this.customTime=new Date,this.eventParams={},this._create()}setOptions(t){t&&wD.selectiveExtend(["moment","locale","locales","id","title","rtl","snap"],this.options,t)}_create(){var t,e,i;const n=document.createElement("div");n["custom-time"]=this,n.className="vis-custom-time ".concat(this.options.id||""),n.style.position="absolute",n.style.top="0px",n.style.height="100%",this.bar=n;const o=document.createElement("div");function s(t){this.body.range._onMouseWheel(t)}o.style.position="relative",o.style.top="0px",this.options.rtl?o.style.right="-10px":o.style.left="-10px",o.style.height="100%",o.style.width="20px",o.addEventListener?(o.addEventListener("mousewheel",dl(s).call(s,this),!1),o.addEventListener("DOMMouseScroll",dl(s).call(s,this),!1)):o.attachEvent("onmousewheel",dl(s).call(s,this)),n.appendChild(o),this.hammer=new _S(o),this.hammer.on("panstart",dl(t=this._onDragStart).call(t,this)),this.hammer.on("panmove",dl(e=this._onDrag).call(e,this)),this.hammer.on("panend",dl(i=this._onDragEnd).call(i,this)),this.hammer.get("pan").set({threshold:5,direction:_S.DIRECTION_ALL}),this.hammer.get("press").set({time:1e4})}destroy(){this.hide(),this.hammer.destroy(),this.hammer=null,this.body=null}redraw(){const t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar));const e=this.body.util.toScreen(this.customTime);let i=this.options.locales[this.options.locale];i||(this.warned||(console.warn("WARNING: options.locales['".concat(this.options.locale,"'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization")),this.warned=!0),i=this.options.locales.en);let n=this.options.title;var o;void 0===n?(n=vd(o="".concat(i.time,": ")).call(o,this.options.moment(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss")),n=n.charAt(0).toUpperCase()+n.substring(1)):"function"==typeof n&&(n=n.call(this,this.customTime));return this.options.rtl?this.bar.style.right="".concat(e,"px"):this.bar.style.left="".concat(e,"px"),this.bar.title=n,!1}hide(){this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar)}setCustomTime(t){this.customTime=wD.convert(t,"Date"),this.redraw()}getCustomTime(){return new Date(this.customTime.valueOf())}setCustomMarker(t,e){var i;(this.marker&&this.bar.removeChild(this.marker),this.marker=document.createElement("div"),this.marker.className="vis-custom-time-marker",this.marker.innerHTML=wD.xss(t),this.marker.style.position="absolute",e)&&(this.marker.setAttribute("contenteditable","true"),this.marker.addEventListener("pointerdown",()=>{this.marker.focus()}),this.marker.addEventListener("input",dl(i=this._onMarkerChange).call(i,this)),this.marker.title=t,this.marker.addEventListener("blur",t=>{this.title!=t.target.innerHTML&&(this._onMarkerChanged(t),this.title=t.target.innerHTML)}));this.bar.appendChild(this.marker)}setCustomTitle(t){this.options.title=t}_onDragStart(t){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,t.stopPropagation()}_onDrag(t){if(!this.eventParams.dragging)return;let e=this.options.rtl?-1*t.deltaX:t.deltaX;const i=this.body.util.toScreen(this.eventParams.customTime)+e,n=this.body.util.toTime(i),o=this.body.util.getScale(),s=this.body.util.getStep(),r=this.options.snap,a=r?r(n,o,s):n;this.setCustomTime(a),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf()),event:t}),t.stopPropagation()}_onDragEnd(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf()),event:t}),t.stopPropagation())}_onMarkerChange(t){this.body.emitter.emit("markerchange",{id:this.options.id,title:t.target.innerHTML,event:t}),t.stopPropagation()}_onMarkerChanged(t){this.body.emitter.emit("markerchanged",{id:this.options.id,title:t.target.innerHTML,event:t}),t.stopPropagation()}static customTimeFromTarget(t){let e=t.target;for(;e;){if(Object.prototype.hasOwnProperty.call(e,"custom-time"))return e["custom-time"];e=e.parentNode}return null}}class BS{_create(t){var e,i,n;this.dom={},this.dom.container=t,this.dom.container.style.position="relative",this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.rollingModeBtn=document.createElement("div"),this.dom.loadingScreen=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.rollingModeBtn.className="vis-rolling-mode-btn",this.dom.loadingScreen.className="vis-loading-screen",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.rollingModeBtn),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.on("rangechange",()=>{!0===this.initialDrawDone&&this._redraw()}),this.on("rangechanged",()=>{this.initialRangeChangeDone||(this.initialRangeChangeDone=!0)}),this.on("touch",dl(e=this._onTouch).call(e,this)),this.on("panmove",dl(i=this._onDrag).call(i,this));const o=this;this._origRedraw=dl(n=this._redraw).call(n,this),this._redraw=wD.throttle(this._origRedraw),this.on("_change",t=>{o.itemSet&&o.itemSet.initialItemSetDrawn&&t&&1==t.queue?o._redraw():o._origRedraw()}),this.hammer=new _S(this.dom.root);const s=this.hammer.get("pinch").set({enable:!0});s&&function(t){t.getTouchAction=function(){return["pan-y"]}}(s),this.hammer.get("pan").set({threshold:5,direction:_S.DIRECTION_ALL}),this.timelineListeners={};const r=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];var a,l;function h(t){if(!this.isActive())return;if(this.emit("mousewheel",t),this.options.preferZoom){if(!this.options.zoomKey||t[this.options.zoomKey])return}else if(this.options.zoomKey&&t[this.options.zoomKey])return;if(!this.options.verticalScroll&&!this.options.horizontalScroll)return;let e=0,i=0;"detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(e=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(e=t.deltaX);t.deltaMode&&(1===t.deltaMode?(e*=40,i*=40):(e*=40,i*=800));const n=this.options.verticalScroll,o=Math.abs(i)>=Math.abs(e),s=this.options.horizontalScroll&&this.options.horizontalScrollKey&&t[this.options.horizontalScrollKey];if(n&&o&&!s){const e=this.props.scrollTop,n=e+i;return void(this._setScrollTop(n)!==e&&(this._redraw(),this.emit("scroll",t),t.preventDefault()))}if(this.options.horizontalScroll){this.range.stopRolling();let n=(o?i:e)/120*(this.range.end-this.range.start)/20;this.options.horizontalScrollInvert&&o&&(n=-n);const s=this.range.start+n,r=this.range.end+n,a={animation:!1,byUser:!0,event:t};return this.range.setRange(s,r,a),void t.preventDefault()}}Cl(r).call(r,t=>{const e=e=>{o.isActive()&&o.emit(t,e)};o.hammer.on(t,e),o.timelineListeners[t]=e}),wS(this.hammer,t=>{o.emit("touch",t)}),a=this.hammer,(l=t=>{o.emit("release",t)}).inputHandler=function(t){t.isFinal&&l(t)},a.on("hammer.input",l.inputHandler);const d="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":this.dom.centerContainer.addEventListener?"DOMMouseScroll":"onmousewheel";function c(t){if(o.options.verticalScroll&&(t.preventDefault(),o.isActive())){const e=-t.target.scrollTop;o._setScrollTop(e),o._redraw(),o.emit("scrollSide",t)}}this.dom.top.addEventListener,this.dom.bottom.addEventListener,this.dom.centerContainer.addEventListener(d,dl(h).call(h,this),!1),this.dom.top.addEventListener(d,dl(h).call(h,this),!1),this.dom.bottom.addEventListener(d,dl(h).call(h,this),!1),this.dom.left.parentNode.addEventListener("scroll",dl(c).call(c,this)),this.dom.right.parentNode.addEventListener("scroll",dl(c).call(c,this));let u=!1;function p(t){var e;if(t.preventDefault&&(o.emit("dragover",o.getEventProperties(t)),t.preventDefault()),kc(e=t.target.className).call(e,"timeline")>-1&&!u)return t.dataTransfer.dropEffect="move",u=!0,!1}function m(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation();try{var e=JSON.parse(t.dataTransfer.getData("text"));if(!e||!e.content)return}catch(t){return!1}return u=!1,t.center={x:t.clientX,y:t.clientY},"item"!==e.target?o.itemSet._onAddItem(t):o.itemSet._onDropObjectOnItem(t),o.emit("drop",o.getEventProperties(t)),!1}if(this.dom.center.addEventListener("dragover",dl(p).call(p,this),!1),this.dom.center.addEventListener("drop",dl(m).call(m,this),!1),this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,this.initialRangeChangeDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root),t.appendChild(this.dom.loadingScreen)}setOptions(t){var e;if(t){const e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","preferZoom","rtl","zoomKey","horizontalScroll","horizontalScrollKey","horizontalScrollInvert","verticalScroll","longSelectPressTime","snap"];if(wD.selectiveExtend(e,this.options,t),this.dom.rollingModeBtn.style.visibility="hidden",this.options.rtl&&(this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"),this.options.verticalScroll&&(this.options.rtl?this.dom.rightContainer.className="vis-panel vis-right vis-vertical-scroll":this.dom.leftContainer.className="vis-panel vis-left vis-vertical-scroll"),"object"!=typeof this.options.orientation&&(this.options.orientation={item:void 0,axis:void 0}),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"==typeof t.orientation&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){const t=this.timeAxis2=new kS(this.body,this.options);t.setOptions=e=>{const i=e?wD.extend({},e):{};i.orientation="top",kS.prototype.setOptions.call(t,i)},this.components.push(t)}}else if(this.timeAxis2){var i;const t=kc(i=this.components).call(i,this.timeAxis2);var n;if(-1!==t)rh(n=this.components).call(n,t,1);this.timeAxis2.destroy(),this.timeAxis2=null}"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&ZD(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new CS(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),this._initAutoResize()}if(Cl(e=this.components).call(e,e=>e.setOptions(t)),"configure"in t){var o;this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);const e=wD.deepExtend({},this.options);Cl(o=this.components).call(o,t=>{wD.deepExtend(e,t.options)}),this.configurator.setModuleOptions({global:e})}this._redraw()}isActive(){return!this.activator||this.activator.active}destroy(){var t;this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(const t in this.timelineListeners)Object.prototype.hasOwnProperty.call(this.timelineListeners,t)&&delete this.timelineListeners[t];this.timelineListeners=null,this.hammer&&this.hammer.destroy(),this.hammer=null,Cl(t=this.components).call(t,t=>t.destroy()),this.body=null}setCustomTime(t,e){var i;const n=Pd(i=this.customTimes).call(i,t=>e===t.options.id);if(0===n.length)throw new Error("No custom time bar found with id ".concat(du(e)));n.length>0&&n[0].setCustomTime(t)}getCustomTime(t){var e;const i=Pd(e=this.customTimes).call(e,e=>e.options.id===t);if(0===i.length)throw new Error("No custom time bar found with id ".concat(du(t)));return i[0].getCustomTime()}setCustomTimeMarker(t,e,i){var n;const o=Pd(n=this.customTimes).call(n,t=>t.options.id===e);if(0===o.length)throw new Error("No custom time bar found with id ".concat(du(e)));o.length>0&&o[0].setCustomMarker(t,i)}setCustomTimeTitle(t,e){var i;const n=Pd(i=this.customTimes).call(i,t=>t.options.id===e);if(0===n.length)throw new Error("No custom time bar found with id ".concat(du(e)));if(n.length>0)return n[0].setCustomTitle(t)}getEventProperties(t){return{event:t}}addCustomTime(t,e){var i;const n=void 0!==t?wD.convert(t,"Date"):new Date,o=Hx(i=this.customTimes).call(i,t=>t.options.id===e);if(o)throw new Error("A custom time with id ".concat(du(e)," already exists"));const s=new WS(this.body,wD.extend({},this.options,{time:n,id:e,snap:this.itemSet?this.itemSet.options.snap:this.options.snap}));return this.customTimes.push(s),this.components.push(s),this._redraw(),e}removeCustomTime(t){var e;const i=Pd(e=this.customTimes).call(e,e=>e.options.id===t);if(0===i.length)throw new Error("No custom time bar found with id ".concat(du(t)));Cl(i).call(i,t=>{var e,i,n,o;rh(e=this.customTimes).call(e,kc(i=this.customTimes).call(i,t),1),rh(n=this.components).call(n,kc(o=this.components).call(o,t),1),t.destroy()})}getVisibleItems(){return this.itemSet&&this.itemSet.getVisibleItems()||[]}getItemsAtCurrentTime(t){return this.time=t,this.itemSet&&this.itemSet.getItemsAtCurrentTime(this.time)||[]}getVisibleGroups(){return this.itemSet&&this.itemSet.getVisibleGroups()||[]}fit(t,e){const i=this.getDataRange();if(null===i.min&&null===i.max)return;const n=i.max-i.min,o=new Date(i.min.valueOf()-.01*n),s=new Date(i.max.valueOf()+.01*n),r=!t||void 0===t.animation||t.animation;this.range.setRange(o,s,{animation:r},e)}getDataRange(){throw new Error("Cannot invoke abstract method getDataRange")}setWindow(t,e,i,n){let o,s;"function"==typeof arguments[2]&&(n=arguments[2],i={}),1==arguments.length?(s=arguments[0],o=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:o})):2==arguments.length&&"function"==typeof arguments[1]?(s=arguments[0],n=arguments[1],o=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:o},n)):(o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,{animation:o},n))}moveTo(t,e,i){"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.range.end-this.range.start,o=wD.convert(t,"Date").valueOf(),s=o-n/2,r=o+n/2,a=!e||void 0===e.animation||e.animation;this.range.setRange(s,r,{animation:a},i)}getWindow(){const t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}}zoomIn(t,e,i){if(!t||t<0||t>1)return;"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.getWindow(),o=n.start.valueOf(),s=n.end.valueOf(),r=s-o,a=(r-r/(1+t))/2,l=o+a,h=s-a;this.setWindow(l,h,e,i)}zoomOut(t,e,i){if(!t||t<0||t>1)return;"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.getWindow(),o=n.start.valueOf(),s=n.end.valueOf(),r=s-o,a=o-r*t/2,l=s+r*t/2;this.setWindow(a,l,e,i)}redraw(){this._redraw()}_redraw(){var t;this.redrawCount++;const e=this.dom;if(!e||!e.container||0==e.root.offsetWidth)return;let i=!1;const n=this.options,o=this.props;$D(this.options.moment,this.body,this.options.hiddenDates),"top"==n.orientation?(wD.addClassName(e.root,"vis-top"),wD.removeClassName(e.root,"vis-bottom")):(wD.removeClassName(e.root,"vis-top"),wD.addClassName(e.root,"vis-bottom")),n.rtl?(wD.addClassName(e.root,"vis-rtl"),wD.removeClassName(e.root,"vis-ltr")):(wD.addClassName(e.root,"vis-ltr"),wD.removeClassName(e.root,"vis-rtl")),e.root.style.maxHeight=wD.option.asSize(n.maxHeight,""),e.root.style.minHeight=wD.option.asSize(n.minHeight,""),e.root.style.width=wD.option.asSize(n.width,"");const s=e.root.offsetWidth;o.border.left=1,o.border.right=1,o.border.top=1,o.border.bottom=1,o.center.height=e.center.offsetHeight,o.left.height=e.left.offsetHeight,o.right.height=e.right.offsetHeight,o.top.height=e.top.clientHeight||-o.border.top,o.bottom.height=Math.round(e.bottom.getBoundingClientRect().height)||e.bottom.clientHeight||-o.border.bottom;const r=Math.max(o.left.height,o.center.height,o.right.height),a=o.top.height+r+o.bottom.height+o.border.top+o.border.bottom;e.root.style.height=wD.option.asSize(n.height,"".concat(a,"px")),o.root.height=e.root.offsetHeight,o.background.height=o.root.height;const l=o.root.height-o.top.height-o.bottom.height;o.centerContainer.height=l,o.leftContainer.height=l,o.rightContainer.height=o.leftContainer.height,o.root.width=s,o.background.width=o.root.width,this.initialDrawDone||(o.scrollbarWidth=wD.getScrollBarWidth());const h=e.leftContainer.clientWidth,d=e.rightContainer.clientWidth;n.verticalScroll?n.rtl?(o.left.width=h||-o.border.left,o.right.width=d+o.scrollbarWidth||-o.border.right):(o.left.width=h+o.scrollbarWidth||-o.border.left,o.right.width=d||-o.border.right):(o.left.width=h||-o.border.left,o.right.width=d||-o.border.right),this._setDOM();let c=this._updateScrollTop();"top"!=n.orientation.item&&(c+=Math.max(o.centerContainer.height-o.center.height-o.border.top-o.border.bottom,0)),e.center.style.transform="translateY(".concat(c,"px)");const u=0==o.scrollTop?"hidden":"",p=o.scrollTop==o.scrollTopMin?"hidden":"";e.shadowTop.style.visibility=u,e.shadowBottom.style.visibility=p,e.shadowTopLeft.style.visibility=u,e.shadowBottomLeft.style.visibility=p,e.shadowTopRight.style.visibility=u,e.shadowBottomRight.style.visibility=p,n.verticalScroll&&(e.rightContainer.className="vis-panel vis-right vis-vertical-scroll",e.leftContainer.className="vis-panel vis-left vis-vertical-scroll",e.shadowTopRight.style.visibility="hidden",e.shadowBottomRight.style.visibility="hidden",e.shadowTopLeft.style.visibility="hidden",e.shadowBottomLeft.style.visibility="hidden",e.left.style.top="0px",e.right.style.top="0px"),(!n.verticalScroll||o.center.heighto.centerContainer.height;this.hammer.get("pan").set({direction:m?_S.DIRECTION_ALL:_S.DIRECTION_HORIZONTAL}),this.hammer.get("press").set({time:this.options.longSelectPressTime}),Cl(t=this.components).call(t,t=>{i=t.redraw()||i});if(i){if(this.redrawCount<5)return void this.body.emitter.emit("_change");console.log("WARNING: infinite loop in redraw?")}else this.redrawCount=0;this.body.emitter.emit("changed")}_setDOM(){const t=this.props,e=this.dom;t.leftContainer.width=t.left.width,t.rightContainer.width=t.right.width;const i=t.root.width-t.left.width-t.right.width;t.center.width=i,t.centerContainer.width=i,t.top.width=i,t.bottom.width=i,e.background.style.height="".concat(t.background.height,"px"),e.backgroundVertical.style.height="".concat(t.background.height,"px"),e.backgroundHorizontal.style.height="".concat(t.centerContainer.height,"px"),e.centerContainer.style.height="".concat(t.centerContainer.height,"px"),e.leftContainer.style.height="".concat(t.leftContainer.height,"px"),e.rightContainer.style.height="".concat(t.rightContainer.height,"px"),e.background.style.width="".concat(t.background.width,"px"),e.backgroundVertical.style.width="".concat(t.centerContainer.width,"px"),e.backgroundHorizontal.style.width="".concat(t.background.width,"px"),e.centerContainer.style.width="".concat(t.center.width,"px"),e.top.style.width="".concat(t.top.width,"px"),e.bottom.style.width="".concat(t.bottom.width,"px"),e.background.style.left="0",e.background.style.top="0",e.backgroundVertical.style.left="".concat(t.left.width+t.border.left,"px"),e.backgroundVertical.style.top="0",e.backgroundHorizontal.style.left="0",e.backgroundHorizontal.style.top="".concat(t.top.height,"px"),e.centerContainer.style.left="".concat(t.left.width,"px"),e.centerContainer.style.top="".concat(t.top.height,"px"),e.leftContainer.style.left="0",e.leftContainer.style.top="".concat(t.top.height,"px"),e.rightContainer.style.left="".concat(t.left.width+t.center.width,"px"),e.rightContainer.style.top="".concat(t.top.height,"px"),e.top.style.left="".concat(t.left.width,"px"),e.top.style.top="0",e.bottom.style.left="".concat(t.left.width,"px"),e.bottom.style.top="".concat(t.top.height+t.centerContainer.height,"px"),e.center.style.left="0",e.left.style.left="0",e.right.style.left="0"}setCurrentTime(t){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");this.currentTime.setCurrentTime(t)}getCurrentTime(){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");return this.currentTime.getCurrentTime()}_toTime(t){return eS(this,t,this.props.center.width)}_toGlobalTime(t){return eS(this,t,this.props.root.width)}_toScreen(t){return tS(this,t,this.props.center.width)}_toGlobalScreen(t){return tS(this,t,this.props.root.width)}_initAutoResize(){1==this.options.autoResize?this._startAutoResize():this._stopAutoResize()}_startAutoResize(){const t=this;this._stopAutoResize(),this._onResize=()=>{if(1==t.options.autoResize){if(t.dom.root){const e=t.dom.root.offsetHeight,i=t.dom.root.offsetWidth;i==t.props.lastWidth&&e==t.props.lastHeight||(t.props.lastWidth=i,t.props.lastHeight=e,t.props.scrollbarWidth=wD.getScrollBarWidth(),t.body.emitter.emit("_change"))}}else t._stopAutoResize()},window.addEventListener("resize",this._onResize),t.dom.root&&(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight),this.watchTimer=vS(this._onResize,1e3)}_stopAutoResize(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0),this._onResize&&(window.removeEventListener("resize",this._onResize),this._onResize=null)}_onTouch(){this.touch.allowDragging=!0,this.touch.initialScrollTop=this.props.scrollTop}_onPinch(){this.touch.allowDragging=!1}_onDrag(t){if(!t)return;if(!this.touch.allowDragging)return;const e=t.deltaY,i=this._getScrollTop(),n=this._setScrollTop(this.touch.initialScrollTop+e);this.options.verticalScroll&&(this.dom.left.parentNode.scrollTop=-this.props.scrollTop,this.dom.right.parentNode.scrollTop=-this.props.scrollTop),n!=i&&this.emit("verticalDrag")}_setScrollTop(t){return this.props.scrollTop=t,this._updateScrollTop(),this.props.scrollTop}_updateScrollTop(){const t=Math.min(this.props.centerContainer.height-this.props.border.top-this.props.border.bottom-this.props.center.height,0);return t!=this.props.scrollTopMin&&("top"!=this.options.orientation.item&&(this.props.scrollTop+=t-this.props.scrollTopMin),this.props.scrollTopMin=t),this.props.scrollTop>0&&(this.props.scrollTop=0),this.props.scrollTop{this.options.locales[t]=wD.extend({},n,this.options.locales[t])}),this.offset=0,this._create()}_create(){const t=document.createElement("div");t.className="vis-current-time",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t}destroy(){this.options.showCurrentTime=!1,this.redraw(),this.body=null}setOptions(t){t&&wD.selectiveExtend(["rtl","showCurrentTime","alignCurrentTime","moment","locale","locales"],this.options,t)}redraw(){if(this.options.showCurrentTime){var t,e;const i=this.body.dom.backgroundVertical;this.bar.parentNode!=i&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),i.appendChild(this.bar),this.start());let n=this.options.moment(Va()+this.offset);this.options.alignCurrentTime&&(n=n.startOf(this.options.alignCurrentTime));const o=this.body.util.toScreen(n);let s=this.options.locales[this.options.locale];s||(this.warned||(console.warn("WARNING: options.locales['".concat(this.options.locale,"'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization")),this.warned=!0),s=this.options.locales.en);let r=vd(t=vd(e="".concat(s.current," ")).call(e,s.time,": ")).call(t,n.format("dddd, MMMM Do YYYY, H:mm:ss"));r=r.charAt(0).toUpperCase()+r.substring(1),this.options.rtl?this.bar.style.transform="translateX(".concat(-1*o,"px)"):this.bar.style.transform="translateX(".concat(o,"px)"),this.bar.title=r}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1}start(){const t=this;!function e(){t.stop();let i=1/t.body.range.conversion(t.body.domProps.center.width).scale/10;i<30&&(i=30),i>1e3&&(i=1e3),t.redraw(),t.body.emitter.emit("currentTimeTick"),t.currentTimeTimer=Fu(e,i)}()}stop(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)}setCurrentTime(t){const e=wD.convert(t,"Date").valueOf(),i=Va();this.offset=e-i,this.redraw()}getCurrentTime(){return new Date(Va()+this.offset)}}var US,XS,qS,KS,ZS,$S,JS,QS,tC,eC={};function iC(){return qS?XS:(qS=1,function(){if(US)return eC;US=1;var t=Li(),e=_o().find,i=Ks(),n="find",o=!0;n in[]&&Array(1)[n](function(){o=!1}),t({target:"Array",proto:!0,forced:o},{find:function(t){return e(this,t,arguments.length>1?arguments[1]:void 0)}}),i(n)}(),XS=Sr()("Array","find"))}function nC(){if(ZS)return KS;ZS=1;var t=Bt(),e=iC(),i=Array.prototype;return KS=function(n){var o=n.find;return n===i||t(i,n)&&o===i.find?e:o},KS}function oC(){return JS?$S:(JS=1,$S=nC())}var sC=n(tC?QS:(tC=1,QS=oC()));const rC=.001;function aC(t){Mx(t).call(t,(t,e)=>t.data.start-e.data.start)}function lC(t){Mx(t).call(t,(t,e)=>("end"in t.data?t.data.end:t.data.start)-("end"in e.data?e.data.end:e.data.start))}function hC(t,e,i,n){return null===mC(t,e.item,!1,t=>t.stack&&(i||null===t.top),t=>t.stack,()=>e.axis,n)}function dC(t,e,i){const n=mC(t,e.item,!1,t=>t.stack,()=>!0,t=>t.baseTop);i.height=n-i.top+.5*e.item.vertical}function cC(t,e,i,n){for(let o=0;o=i[t[o].data.subgroup].index||(s+=i[e].height,i[t[o].data.subgroup].top=s);t[o].top=s+.5*e.item.vertical}n||uC(t,e,i)}function uC(t,e,i){var n;mC(Mx(n=Kd(i)).call(n,(t,e)=>t.index>e.index?1:t.index!0,()=>!0,()=>0);for(let n=0;ni[t].index&&(i[r].top+=i[t].height);const a=t[r];for(let t=0;tt.start,l=t=>t.end;if(!i){const i=!(!t[0]||!t[0].options.rtl);a=i?t=>t.right:t=>t.left,l=t=>a(t)+t.width+e.horizontal}const h=[],d=[];let c=null,u=0;for(const e of t)if(n(e))h.push(e);else if(o(e)){const t=a(e);null!==c&&ta(e)-rC>t,u),rh(d).call(d,u,0,e),u++}c=null;let p=null;u=0;let m=0,f=0,g=0;for(;h.length>0;){var v;const t=h.shift();t.top=s(t);const i=a(t),n=l(t);null!==c&&ic+rC)&&(m=gC(d,t=>inn&&(f=vC(d,t=>n+rC>=a(t),m,f)+1),p=n;const b=Mx(v=bC(d,t=>it.top-e.top);for(let i=0;ia(t)-rC>i,u),rh(d).call(d,u,0,t),ug&&(g=y),r&&r())return null}return g}function fC(t,e,i){return t.top-i.vertical+rCe.top}function gC(t,e,i){i||(i=0);for(let n=i;n=i;o--)if(e(t[o]))return o;return i-1}function bC(t,e,i,n){i||(i=0),n=n?Math.min(n,t.length):t.length;const o=[];for(let s=i;s{this.checkRangedItems=!0};this.itemSet.body.emitter.on("checkRangedItems",n),this._disposeCallbacks.push(()=>{this.itemSet.body.emitter.off("checkRangedItems",n)}),this._create(),this.setData(e)}_create(){const t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;const e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;const i=document.createElement("div");i.className="vis-group",i["vis-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.style.position="absolute",this.dom.marker.innerHTML="",this.dom.background.appendChild(this.dom.marker)}setData(t){if(this.itemSet.groupTouchParams.isDragging)return;let e,i;if(t&&t.subgroupVisibility)for(const e in t.subgroupVisibility)Object.prototype.hasOwnProperty.call(t.subgroupVisibility,e)&&(this.subgroupVisibility[e]=t.subgroupVisibility[e]);var n;this.itemSet.options&&this.itemSet.options.groupTemplate?(i=dl(n=this.itemSet.options.groupTemplate).call(n,this),e=i(t,this.dom.inner)):e=t&&t.content;if(e instanceof Element){for(;this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object&&e.isReactComponent||(e instanceof Object?i(t,this.dom.inner):this.dom.inner.innerHTML=null!=e?wD.xss(e):wD.xss(this.groupId||""));this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?wD.removeClassName(this.dom.inner,"vis-hidden"):wD.addClassName(this.dom.inner,"vis-hidden"),t&&t.nestedGroups?(this.nestedGroups&&this.nestedGroups==t.nestedGroups||(this.nestedGroups=t.nestedGroups),void 0===t.showNested&&void 0!==this.showNested||(0==t.showNested?this.showNested=!1:this.showNested=!0),wD.addClassName(this.dom.label,"vis-nesting-group"),this.showNested?(wD.removeClassName(this.dom.label,"collapsed"),wD.addClassName(this.dom.label,"expanded")):(wD.removeClassName(this.dom.label,"expanded"),wD.addClassName(this.dom.label,"collapsed"))):this.nestedGroups&&(this.nestedGroups=null,wD.removeClassName(this.dom.label,"collapsed"),wD.removeClassName(this.dom.label,"expanded"),wD.removeClassName(this.dom.label,"vis-nesting-group")),t&&(t.treeLevel||t.nestedInGroup)?(wD.addClassName(this.dom.label,"vis-nested-group"),t.treeLevel?wD.addClassName(this.dom.label,"vis-group-level-"+t.treeLevel):wD.addClassName(this.dom.label,"vis-group-level-unknown-but-gte1")):wD.addClassName(this.dom.label,"vis-group-level-0");const o=t&&t.className||null;o!=this.className&&(this.className&&(wD.removeClassName(this.dom.label,this.className),wD.removeClassName(this.dom.foreground,this.className),wD.removeClassName(this.dom.background,this.className),wD.removeClassName(this.dom.axis,this.className)),wD.addClassName(this.dom.label,o),wD.addClassName(this.dom.foreground,o),wD.addClassName(this.dom.background,o),wD.addClassName(this.dom.axis,o),this.className=o),this.style&&(wD.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(wD.addCssText(this.dom.label,t.style),this.style=t.style)}getLabelWidth(){return this.props.label.width}_didMarkerHeightChange(){const t=this.dom.marker.clientHeight;if(t!=this.lastMarkerHeight){this.lastMarkerHeight=t;const e={};let i=0;Cl(wD).call(wD,this.items,(t,n)=>{if(t.dirty=!0,t.displayed){const o=!0;e[n]=t.redraw(o),i=e[n].length}});if(i>0)for(let t=0;t{e[t]()});return!0}return!1}_calculateGroupSizeAndPosition(){const{offsetTop:t,offsetLeft:e,offsetWidth:i}=this.dom.foreground;this.top=t,this.right=e,this.width=i}_shouldBailItemsRedraw(){const t=this,e=this.itemSet.options.onTimeout,i={relativeBailingTime:this.itemSet.itemsSettingTime,bailTimeMs:e&&e.timeoutMs,userBailFunction:e&&e.callback,shouldBailStackItems:this.shouldBailStackItems};let n=null;if(!this.itemSet.initialDrawDone){if(i.shouldBailStackItems)return!0;Math.abs(Va()-new Date(i.relativeBailingTime))>i.bailTimeMs&&(i.userBailFunction&&null==this.itemSet.userContinueNotBail?i.userBailFunction(e=>{t.itemSet.userContinueNotBail=e,n=!e}):n=0==t.itemSet.userContinueNotBail)}return n}_redrawItems(t,e,i,n){if(t||this.stackDirty||this.isVisible&&!e){var o,s,r,a,l,h;const t={byEnd:Pd(o=this.orderedItems.byEnd).call(o,t=>!t.isCluster),byStart:Pd(s=this.orderedItems.byStart).call(s,t=>!t.isCluster)},e={byEnd:[...new zw(Pd(r=ya(a=this.orderedItems.byEnd).call(a,t=>t.cluster)).call(r,t=>!!t))],byStart:[...new zw(Pd(l=ya(h=this.orderedItems.byStart).call(h,t=>t.cluster)).call(l,t=>!!t))]},f=()=>{var i,o;return[...this._updateItemsInRange(t,Pd(i=this.visibleItems).call(i,t=>!t.isCluster),n),...this._updateClustersInRange(e,Pd(o=this.visibleItems).call(o,t=>t.isCluster),n)]},g=t=>{let e={};for(const n in this.subgroups){var i;if(!Object.prototype.hasOwnProperty.call(this.subgroups,n))continue;const o=Pd(i=this.visibleItems).call(i,t=>t.data.subgroup===n);e[n]=t?Mx(o).call(o,(e,i)=>t(e.data,i.data)):o}return e};if("function"==typeof this.itemSet.options.order){const t=this;if(this.doInnerStack&&this.itemSet.options.stackSubgroups){pC(g(this.itemSet.options.order),i,this.subgroups),this.visibleItems=f(),this._updateSubGroupHeights(i)}else{var d,c,u,p;this.visibleItems=f(),this._updateSubGroupHeights(i);const e=Mx(d=Pd(c=Yr(u=this.visibleItems).call(u)).call(c,t=>t.isCluster||!t.isCluster&&!t.cluster)).call(d,(e,i)=>t.itemSet.options.order(e.data,i.data));this.shouldBailStackItems=hC(e,i,!0,dl(p=this._shouldBailItemsRedraw).call(p,this))}}else if(this.visibleItems=f(),this._updateSubGroupHeights(i),this.itemSet.options.stack)if(this.doInnerStack&&this.itemSet.options.stackSubgroups){pC(g(),i,this.subgroups)}else{var m;this.shouldBailStackItems=hC(this.visibleItems,i,!0,dl(m=this._shouldBailItemsRedraw).call(m,this))}else cC(this.visibleItems,i,this.subgroups,this.itemSet.options.stackSubgroups);for(let t=0;t{t.cluster&&t.displayed&&t.hide()}),this.shouldBailStackItems&&this.itemSet.body.emitter.emit("destroyTimeline"),this.stackDirty=!1}}_didResize(t,e){t=wD.updateProperty(this,"height",e)||t;const i=this.dom.inner.clientWidth,n=this.dom.inner.clientHeight;return t=wD.updateProperty(this.props.label,"width",i)||t,t=wD.updateProperty(this.props.label,"height",n)||t}_applyGroupHeight(t){this.dom.background.style.height="".concat(t,"px"),this.dom.foreground.style.height="".concat(t,"px"),this.dom.label.style.height="".concat(t,"px")}_updateItemsVerticalPosition(t){for(let e=0,i=this.visibleItems.length;e{i=this._didMarkerHeightChange.call(this)||i},dl(o=this._updateSubGroupHeights).call(o,this,e),dl(s=this._calculateGroupSizeAndPosition).call(s,this),()=>{var i;this.isVisible=dl(i=this._isGroupVisible).call(i,this)(t,e)},()=>{var n;dl(n=this._redrawItems).call(n,this)(i,d,e,t)},dl(r=this._updateSubgroupsSizes).call(r,this),()=>{var t;c=this.height=dl(t=this._calculateHeight).call(t,this)(e)},dl(a=this._calculateGroupSizeAndPosition).call(a,this),()=>{var t;h=dl(t=this._didResize).call(t,this)(h,c)},()=>{var t;dl(t=this._applyGroupHeight).call(t,this)(c)},()=>{var t;dl(t=this._updateItemsVerticalPosition).call(t,this)(e)},dl(l=()=>(!this.isVisible&&this.height&&(h=!1),h)).call(l,this)];if(n)return u;{let t;return Cl(u).call(u,e=>{t=e()}),t}}_updateSubGroupHeights(t){if(Ea(this.subgroups).length>0){const e=this;this._resetSubgroups(),Cl(wD).call(wD,this.visibleItems,i=>{void 0!==i.data.subgroup&&(e.subgroups[i.data.subgroup].height=Math.max(e.subgroups[i.data.subgroup].height,i.height+t.item.vertical),e.subgroups[i.data.subgroup].visible=void 0===this.subgroupVisibility[i.data.subgroup]||Boolean(this.subgroupVisibility[i.data.subgroup]))})}}_isGroupVisible(t,e){return this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop}_calculateHeight(t){let e,i;if(i="fixed"===this.heightMode?wD.toArray(this.items):this.visibleItems,!this.isVisible&&this.height)e=Math.max(this.height,this.props.label.height);else if(i.length>0){let n=i[0].top,o=i[0].top+i[0].height;if(Cl(wD).call(wD,i,t=>{n=Math.min(n,t.top),o=Math.max(o,t.top+t.height)}),n>t.axis){const e=n-t.axis;o-=e,Cl(wD).call(wD,i,t=>{t.top-=e})}e=Math.ceil(o+t.item.vertical/2),"fitItems"!==this.heightMode&&(e=Math.max(e,this.props.label.height))}else e=this.props.label.height;return e}show(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)}hide(){const t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);const e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);const i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);const n=this.dom.axis;n.parentNode&&n.parentNode.removeChild(n)}add(t){var e;if(this.items[t.id]=t,t.setParent(this),this.stackDirty=!0,void 0!==t.data.subgroup&&(this._addToSubgroup(t),this.orderSubgroups()),!Uh(e=this.visibleItems).call(e,t)){const e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}}_addToSubgroup(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.data.subgroup;null!=e&&void 0===this.subgroups[e]&&(this.subgroups[e]={height:0,top:0,start:t.data.start,end:t.data.end||t.data.start,visible:!1,index:this.subgroupIndex,items:[],stack:this.subgroupStackAll||this.subgroupStack[e]||!1},this.subgroupIndex++),new Date(t.data.start)new Date(this.subgroups[e].end)&&(this.subgroups[e].end=i),this.subgroups[e].items.push(t)}_updateSubgroupsSizes(){const t=this;if(t.subgroups)for(const i in t.subgroups){var e;if(!Object.prototype.hasOwnProperty.call(t.subgroups,i))continue;const n=t.subgroups[i].items[0].data.end||t.subgroups[i].items[0].data.start;let o=t.subgroups[i].items[0].data.start,s=n-1;Cl(e=t.subgroups[i].items).call(e,t=>{new Date(t.data.start)new Date(s)&&(s=e)}),t.subgroups[i].start=o,t.subgroups[i].end=new Date(s-1)}}orderSubgroups(){if(void 0!==this.subgroupOrderer){const t=[];if("string"==typeof this.subgroupOrderer){for(const e in this.subgroups)Object.prototype.hasOwnProperty.call(this.subgroups,e)&&t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});Mx(t).call(t,(t,e)=>t.sortField-e.sortField)}else if("function"==typeof this.subgroupOrderer){for(const e in this.subgroups)Object.prototype.hasOwnProperty.call(this.subgroups,e)&&t.push(this.subgroups[e].items[0].data);Mx(t).call(t,this.subgroupOrderer)}if(t.length>0)for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:t.data.subgroup;if(null!=e){const o=this.subgroups[e];if(o){var i;const s=kc(i=o.items).call(i,t);var n;if(s>=0)rh(n=o.items).call(n,s,1),o.items.length?this._updateSubgroupsSizes():delete this.subgroups[e]}}}removeFromDataSet(t){this.itemSet.removeItem(t.id)}order(){const t=wD.toArray(this.items),e=[],i=[];for(let n=0;n{const{start:e,end:i}=t;return i0)for(let t=0;ttt.data.startl),1==this.checkRangedItems){this.checkRangedItems=!1;for(let e=0;et.data.endl)}this._sortVisibleItems(t.byStart,n,o);const c={};let u=0;for(let t=0;t0)for(let t=0;t{e[t]()});for(let t=0;t=0;s--){let t=e[s];if(o(t))break;t.isCluster&&!t.hasItems()||t.cluster||void 0===n[t.id]&&(n[t.id]=!0,i.unshift(t))}for(let s=t+1;s0)for(let t=0;t0)for(var a=0;a{this.options.locales[t]=wD.extend({},o,this.options.locales[t])}),this.selected=!1,this.displayed=!1,this.groupShowing=!0,this.selectable=i&&i.selectable||!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.setSelectability(t),this.editable=null,this._updateEditStatus()}select(){this.selectable&&(this.selected=!0,this.dirty=!0,this.displayed&&this.redraw())}unselect(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()}setData(t){null!=t.group&&this.data.group!=t.group&&null!=this.parent&&this.parent.itemSet._moveToGroup(this,t.group),this.setSelectability(t),this.parent&&(this.parent.stackDirty=!0);null!=t.subgroup&&this.data.subgroup!=t.subgroup&&null!=this.parent&&this.parent.changeSubgroup(this,this.data.subgroup,t.subgroup),this.data=t,this._updateEditStatus(),this.dirty=!0,this.displayed&&this.redraw()}setSelectability(t){t&&(this.selectable=void 0===t.selectable||Boolean(t.selectable))}setParent(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t}isVisible(){return!1}show(){return!1}hide(){return!1}redraw(){}repositionX(){}repositionY(){}_repaintDragCenter(){if(this.selected&&this.editable.updateTime&&!this.dom.dragCenter){var t,e;const i=this,n=document.createElement("div");n.className="vis-drag-center",n.dragCenterItem=this,this.hammerDragCenter=new _S(n),this.hammerDragCenter.on("tap",t=>{i.parent.itemSet.body.emitter.emit("click",{event:t,item:i.id})}),this.hammerDragCenter.on("doubletap",t=>{t.stopPropagation(),i.parent.itemSet._onUpdateItem(i),i.parent.itemSet.body.emitter.emit("doubleClick",{event:t,item:i.id})}),this.hammerDragCenter.on("panstart",t=>{t.stopPropagation(),i.parent.itemSet._onDragStart(t)}),this.hammerDragCenter.on("panmove",dl(t=i.parent.itemSet._onDrag).call(t,i.parent.itemSet)),this.hammerDragCenter.on("panend",dl(e=i.parent.itemSet._onDragEnd).call(e,i.parent.itemSet)),this.hammerDragCenter.get("press").set({time:1e4}),this.dom.box?this.dom.dragLeft?this.dom.box.insertBefore(n,this.dom.dragLeft):this.dom.box.appendChild(n):this.dom.point&&this.dom.point.appendChild(n),this.dom.dragCenter=n}else!this.selected&&this.dom.dragCenter&&(this.dom.dragCenter.parentNode&&this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter),this.dom.dragCenter=null,this.hammerDragCenter&&(this.hammerDragCenter.destroy(),this.hammerDragCenter=null))}_repaintDeleteButton(t){const e=(this.options.editable.overrideItems||null==this.editable)&&this.options.editable.remove||!this.options.editable.overrideItems&&null!=this.editable&&this.editable.remove;if(this.selected&&e&&!this.dom.deleteButton){const e=this,i=document.createElement("div");this.options.rtl?i.className="vis-delete-rtl":i.className="vis-delete";let n=this.options.locales[this.options.locale];n||(this.warned||(console.warn("WARNING: options.locales['".concat(this.options.locale,"'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization")),this.warned=!0),n=this.options.locales.en),i.title=n.deleteSelected,this.hammerDeleteButton=new _S(i).on("tap",t=>{t.stopPropagation(),e.parent.removeFromDataSet(e)}),t.appendChild(i),this.dom.deleteButton=i}else this.selected&&e||!this.dom.deleteButton||(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null,this.hammerDeleteButton&&(this.hammerDeleteButton.destroy(),this.hammerDeleteButton=null))}_repaintOnItemUpdateTimeTooltip(t){if(!this.options.tooltipOnItemUpdateTime)return;const e=(this.options.editable.updateTime||!0===this.data.editable)&&!1!==this.data.editable;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){const e=document.createElement("div");e.className="vis-onUpdateTime-tooltip",t.appendChild(e),this.dom.onItemUpdateTimeTooltip=e}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.dom.onItemUpdateTimeTooltip.style.transform="translateX(-50%)",this.dom.onItemUpdateTimeTooltip.style.left="50%";const t=50,e=this.parent.itemSet.body.domProps.scrollTop;let n;n="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;let o,s;var i;if(n+this.parent.top-t<-e?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top="".concat(this.height+2,"px")):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom="".concat(this.height+2,"px")),this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template)s=dl(i=this.options.tooltipOnItemUpdateTime.template).call(i,this),o=s(this.data);else o="start: ".concat(Nk(this.data.start).format("MM/DD/YYYY hh:mm")),this.data.end&&(o+="
end: ".concat(Nk(this.data.end).format("MM/DD/YYYY hh:mm")));this.dom.onItemUpdateTimeTooltip.innerHTML=wD.xss(o)}}_getItemData(){return this.parent.itemSet.itemsData.get(this.id)}_updateContents(t){let e,i,n,o,s;const r=this._getItemData(),a=(this.dom.box||this.dom.point).getElementsByClassName("vis-item-visible-frame")[0];var l,h;this.options.visibleFrameTemplate?(s=dl(l=this.options.visibleFrameTemplate).call(l,this),o=wD.xss(s(r,a))):o="";if(a)if(o instanceof Object&&!(o instanceof Element))s(r,a);else if(i=this._contentToString(this.itemVisibleFrameContent)!==this._contentToString(o),i){if(o instanceof Element)a.innerHTML="",a.appendChild(o);else if(null!=o)a.innerHTML=wD.xss(o);else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '.concat(this.id));this.itemVisibleFrameContent=o}this.options.template?(n=dl(h=this.options.template).call(h,this),e=n(r,t,this.data)):e=this.data.content;if(e instanceof Object&&!(e instanceof Element))n(r,t);else if(i=this._contentToString(this.content)!==this._contentToString(e),i){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(null!=e)t.innerHTML=wD.xss(e);else if("background"!=this.data.type||void 0!==this.data.content)throw new Error('Property "content" missing in item '.concat(this.id));this.content=e}}_updateDataAttributes(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){let e=[];if(aa(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Ea(this.data)}for(const i of e){const e=this.data[i];null!=e?t.setAttribute("data-".concat(i),e):t.removeAttribute("data-".concat(i))}}}_updateStyle(t){this.style&&(wD.removeCssText(t,this.style),this.style=null),this.data.style&&(wD.addCssText(t,this.data.style),this.style=this.data.style)}_contentToString(t){return"string"==typeof t?t:t&&"outerHTML"in t?t.outerHTML:t}_updateEditStatus(){this.options&&("boolean"==typeof this.options.editable?this.editable={updateTime:this.options.editable,updateGroup:this.options.editable,remove:this.options.editable}:"object"==typeof this.options.editable&&(this.editable={},wD.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,this.options.editable))),this.options&&this.options.editable&&!0===this.options.editable.overrideItems||this.data&&("boolean"==typeof this.data.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"==typeof this.data.editable&&(this.editable={},wD.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,this.data.editable)))}getWidthLeft(){return 0}getWidthRight(){return 0}getTitle(){if(this.options.tooltip&&this.options.tooltip.template){var t;return dl(t=this.options.tooltip.template).call(t,this)(this._getItemData(),this.data)}return this.data.title}}kC.prototype.stack=!0;class DC extends kC{constructor(t,e,i){if(super(t,e,i),this.props={dot:{width:0,height:0},line:{width:0,height:0}},t&&null==t.start)throw new Error('Property "start" missing in item '.concat(t))}isVisible(t){if(this.cluster)return!1;let e;const i=this.data.align||this.options.align,n=this.width*t.getMillisecondsPerPixel();return e="right"==i?this.data.start.getTime()>t.start&&this.data.start.getTime()-nt.start&&this.data.start.getTime()t.start&&this.data.start.getTime()-n/2{this.dirty&&(s=this._getDomComponentsSizes())},()=>{var t;this.dirty&&dl(t=this._updateDomComponentsSizes).call(t,this)(s)},dl(o=this._repaintDomAdditionals).call(o,this)];if(t)return r;{let t;return Cl(r).call(r,e=>{t=e()}),t}}show(t){if(!this.displayed)return this.redraw(t)}hide(){if(this.displayed){const t=this.dom;t.box.remove?t.box.remove():t.box.parentNode&&t.box.parentNode.removeChild(t.box),t.line.remove?t.line.remove():t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.remove?t.dot.remove():t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot),this.displayed=!1}}repositionXY(){const t=this.options.rtl,e=function(t,e,i){var n;if(void 0===e&&void 0===i)return;const o=arguments.length>3&&void 0!==arguments[3]&&arguments[3]?-1*e:e;t.style.transform=void 0!==i?void 0!==e?vd(n="translate(".concat(o,"px, ")).call(n,i,"px)"):"translateY(".concat(i,"px)"):"translateX(".concat(o,"px)")};e(this.dom.box,this.boxX,this.boxY,t),e(this.dom.dot,this.dotX,this.dotY,t),e(this.dom.line,this.lineX,this.lineY,t)}repositionX(){const t=this.conversion.toScreen(this.data.start),e=void 0===this.data.align?this.options.align:this.data.align,i=this.props.line.width,n=this.props.dot.width;"right"==e?(this.boxX=t-this.width,this.lineX=t-i,this.dotX=t-i/2-n/2):"left"==e?(this.boxX=t,this.lineX=t,this.dotX=t+i/2-n/2):(this.boxX=t-this.width/2,this.lineX=this.options.rtl?t-i:t-i/2,this.dotX=t-n/2),this.options.rtl?this.right=this.boxX:this.left=this.boxX,this.repositionXY()}repositionY(){const t=this.options.orientation.item,e=this.dom.line.style;if("top"==t){const t=this.parent.top+this.top+1;this.boxY=this.top||0,e.height="".concat(t,"px"),e.bottom="",e.top="0"}else{const t=this.parent.itemSet.props.height-this.parent.top-this.parent.height+this.top;this.boxY=this.parent.height-this.top-(this.height||0),e.height="".concat(t,"px"),e.top="",e.bottom="0"}this.dotY=-this.props.dot.height/2,this.repositionXY()}getWidthLeft(){return this.width/2}getWidthRight(){return this.width/2}}class SC extends kC{constructor(t,e,i){if(super(t,e,i),this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0,marginRight:0}},t&&null==t.start)throw new Error('Property "start" missing in item '.concat(t))}isVisible(t){if(this.cluster)return!1;const e=this.width*t.getMillisecondsPerPixel();return this.data.start.getTime()+e>t.start&&this.data.start{this.dirty&&(s=this._getDomComponentsSizes())},()=>{var t;this.dirty&&dl(t=this._updateDomComponentsSizes).call(t,this)(s)},dl(o=this._repaintDomAdditionals).call(o,this)];if(t)return r;{let t;return Cl(r).call(r,e=>{t=e()}),t}}repositionXY(){const t=this.options.rtl;!function(t,e,i){var n;if(void 0===e&&void 0===i)return;const o=arguments.length>3&&void 0!==arguments[3]&&arguments[3]?-1*e:e;t.style.transform=void 0!==i?void 0!==e?vd(n="translate(".concat(o,"px, ")).call(n,i,"px)"):"translateY(".concat(i,"px)"):"translateX(".concat(o,"px)")}(this.dom.point,this.pointX,this.pointY,t)}show(t){if(!this.displayed)return this.redraw(t)}hide(){this.displayed&&(this.dom.point.parentNode&&this.dom.point.parentNode.removeChild(this.dom.point),this.displayed=!1)}repositionX(){const t=this.conversion.toScreen(this.data.start);this.pointX=t,this.options.rtl?this.right=t-this.props.dot.width:this.left=t-this.props.dot.width,this.repositionXY()}repositionY(){const t=this.options.orientation.item;this.pointY="top"==t?this.top:this.parent.height-this.top-this.height,this.repositionXY()}getWidthLeft(){return this.props.dot.width}getWidthRight(){return this.props.dot.width}}class CC extends kC{constructor(t,e,i){if(super(t,e,i),this.props={content:{width:0}},this.overflow=!1,t){if(null==t.start)throw new Error('Property "start" missing in item '.concat(t.id));if(null==t.end)throw new Error('Property "end" missing in item '.concat(t.id))}}isVisible(t){return!this.cluster&&(this.data.startt.start)}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("div"),this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-item-overflow",this.dom.box.appendChild(this.dom.frame),this.dom.visibleFrame=document.createElement("div"),this.dom.visibleFrame.className="vis-item-visible-frame",this.dom.box.appendChild(this.dom.visibleFrame),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.frame.appendChild(this.dom.content),this.dom.box["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.editable.updateTime||this.editable.updateGroup,e=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(t?" vis-editable":" vis-readonly");this.dom.box.className=this.baseClassName+e,this.dom.content.style.maxWidth="none"}}_getDomComponentsSizes(){return this.overflow="hidden"!==window.getComputedStyle(this.dom.frame).overflow,this.whiteSpace="nowrap"!==window.getComputedStyle(this.dom.content).whiteSpace,{content:{width:this.dom.content.offsetWidth},box:{height:this.dom.box.offsetHeight}}}_updateDomComponentsSizes(t){this.props.content.width=t.content.width,this.height=t.box.height,this.dom.content.style.maxWidth="",this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box),this._repaintDeleteButton(this.dom.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()}redraw(t){var e,i,n,o;let s;const r=[dl(e=this._createDomElement).call(e,this),dl(i=this._appendDomElement).call(i,this),dl(n=this._updateDirtyDomComponents).call(n,this),()=>{var t;this.dirty&&(s=dl(t=this._getDomComponentsSizes).call(t,this)())},()=>{var t;this.dirty&&dl(t=this._updateDomComponentsSizes).call(t,this)(s)},dl(o=this._repaintDomAdditionals).call(o,this)];if(t)return r;{let t;return Cl(r).call(r,e=>{t=e()}),t}}show(t){if(!this.displayed)return this.redraw(t)}hide(){if(this.displayed){const t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}}repositionX(t){const e=this.parent.width;let i=this.conversion.toScreen(this.data.start),n=this.conversion.toScreen(this.data.end);const o=void 0===this.data.align?this.options.align:this.data.align;let s,r;!1===this.data.limitSize||void 0!==t&&!0!==t||(i<-e&&(i=-e),n>2*e&&(n=2*e));const a=Math.max(Math.round(1e3*(n-i))/1e3,1);switch(this.overflow?(this.options.rtl?this.right=i:this.left=i,this.width=a+this.props.content.width,r=this.props.content.width):(this.options.rtl?this.right=i:this.left=i,this.width=a,r=Math.min(n-i,this.props.content.width)),this.options.rtl?this.dom.box.style.transform="translateX(".concat(-1*this.right,"px)"):this.dom.box.style.transform="translateX(".concat(this.left,"px)"),this.dom.box.style.width="".concat(a,"px"),this.whiteSpace&&(this.height=this.dom.box.offsetHeight),o){case"left":this.dom.content.style.transform="translateX(0)";break;case"right":if(this.options.rtl){const t=-1*Math.max(a-r,0);this.dom.content.style.transform="translateX(".concat(t,"px)")}else this.dom.content.style.transform="translateX(".concat(Math.max(a-r,0),"px)");break;case"center":if(this.options.rtl){const t=-1*Math.max((a-r)/2,0);this.dom.content.style.transform="translateX(".concat(t,"px)")}else this.dom.content.style.transform="translateX(".concat(Math.max((a-r)/2,0),"px)");break;default:if(s=this.overflow?n>0?Math.max(-i,0):-r:i<0?-i:0,this.options.rtl){const t=-1*s;this.dom.content.style.transform="translateX(".concat(t,"px)")}else this.dom.content.style.transform="translateX(".concat(s,"px)")}}repositionY(){const t=this.options.orientation.item,e=this.dom.box;e.style.top="".concat("top"==t?this.top:this.parent.height-this.top-this.height,"px")}_repaintDragLeft(){if((this.selected||this.options.itemsAlwaysDraggable.range)&&this.editable.updateTime&&!this.dom.dragLeft){const t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else this.selected||this.options.itemsAlwaysDraggable.range||!this.dom.dragLeft||(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)}_repaintDragRight(){if((this.selected||this.options.itemsAlwaysDraggable.range)&&this.editable.updateTime&&!this.dom.dragRight){const t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else this.selected||this.options.itemsAlwaysDraggable.range||!this.dom.dragRight||(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)}}CC.prototype.baseClassName="vis-item vis-range";class TC extends kC{constructor(t,e,i){if(super(t,e,i),this.props={content:{width:0}},this.overflow=!1,t){if(null==t.start)throw new Error('Property "start" missing in item '.concat(t.id));if(null==t.end)throw new Error('Property "end" missing in item '.concat(t.id))}}isVisible(t){return this.data.startt.start}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("div"),this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-item-overflow",this.dom.box.appendChild(this.dom.frame),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.frame.appendChild(this.dom.content),this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.background;if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.box)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);const t=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");this.dom.box.className=this.baseClassName+t}}_getDomComponentsSizes(){return this.overflow="hidden"!==window.getComputedStyle(this.dom.content).overflow,{content:{width:this.dom.content.offsetWidth}}}_updateDomComponentsSizes(t){this.props.content.width=t.content.width,this.height=0,this.dirty=!1}_repaintDomAdditionals(){}redraw(t){var e,i,n,o;let s;const r=[dl(e=this._createDomElement).call(e,this),dl(i=this._appendDomElement).call(i,this),dl(n=this._updateDirtyDomComponents).call(n,this),()=>{var t;this.dirty&&(s=dl(t=this._getDomComponentsSizes).call(t,this)())},()=>{var t;this.dirty&&dl(t=this._updateDomComponentsSizes).call(t,this)(s)},dl(o=this._repaintDomAdditionals).call(o,this)];if(t)return r;{let t;return Cl(r).call(r,e=>{t=e()}),t}}repositionY(){let t;const e=this.options.orientation.item;if(void 0!==this.data.subgroup){const t=this.data.subgroup;this.dom.box.style.height="".concat(this.parent.subgroups[t].height,"px"),this.dom.box.style.top="".concat("top"==e?this.parent.top+this.parent.subgroups[t].top:this.parent.top+this.parent.height-this.parent.subgroups[t].top-this.parent.subgroups[t].height,"px"),this.dom.box.style.bottom=""}else this.parent instanceof xC?(t=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.bottom="bottom"==e?"0":"",this.dom.box.style.top="top"==e?"0":""):(t=this.parent.height,this.dom.box.style.top="".concat(this.parent.top,"px"),this.dom.box.style.bottom="");this.dom.box.style.height="".concat(t,"px")}}TC.prototype.baseClassName="vis-item vis-background",TC.prototype.stack=!1,TC.prototype.show=CC.prototype.show,TC.prototype.hide=CC.prototype.hide,TC.prototype.repositionX=CC.prototype.repositionX;class MC{constructor(t,e){this.container=t,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(t,e){this.x=cc(t),this.y=cc(e)}setText(t){t instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(t)):this.frame.innerHTML=wD.xss(t)}show(t){if(void 0===t&&(t=!0),!0===t){var e=this.frame.clientHeight,i=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,r=0;if("flip"==this.overflowMethod||"none"==this.overflowMethod){let t=!1,n=!0;"flip"==this.overflowMethod&&(this.y-eo-this.padding&&(t=!0)),s=t?this.x-i:this.x,r=n?this.y-e:this.y}else(r=this.y-e)+e+this.padding>n&&(r=n-e-this.padding),ro&&(s=o-i-this.padding),s1?arguments[1]:void 0)}})}(),EC=Sr()("Array","every"))}function zC(){if(LC)return IC;LC=1;var t=Bt(),e=jC(),i=Array.prototype;return IC=function(n){var o=n.every;return n===i||t(i,n)&&o===i.every?e:o},IC}function HC(){return AC?NC:(AC=1,NC=zC())}var GC=n(RC?FC:(RC=1,FC=HC()));class WC extends kC{constructor(t,e,i){if(super(t,e,mh({},{fitOnDoubleClick:!0},i,{editable:!1})),this.props={content:{width:0,height:0}},!t||null==t.uiItems)throw new Error('Property "uiItems" missing in item '+t.id);this.id=wk(),this.group=t.group,this._setupRange(),this.emitter=this.data.eventEmitter,this.range=this.data.range,this.attached=!1,this.isCluster=!0,this.data.isCluster=!0}hasItems(){return this.data.uiItems&&this.data.uiItems.length&&this.attached}setUiItems(t){this.detach(),this.data.uiItems=t,this._setupRange(),this.attach()}isVisible(t){const e=this.data.end?this.data.end-this.data.start:0,i=this.width*t.getMillisecondsPerPixel(),n=Math.max(this.data.start.getTime()+e,this.data.start.getTime()+i);return this.data.startt.start&&this.hasItems()}getData(){return{isCluster:!0,id:this.id,items:this.data.items||[],data:this.data}}redraw(t){var e,i,n,o,s,r,a,l,h=[dl(e=this._createDomElement).call(e,this),dl(i=this._appendDomElement).call(i,this),dl(n=this._updateDirtyDomComponents).call(n,this),dl(o=function(){this.dirty&&(a=this._getDomComponentsSizes())}).call(o,this),dl(s=function(){var t;this.dirty&&dl(t=this._updateDomComponentsSizes).call(t,this)(a)}).call(s,this),dl(r=this._repaintDomAdditionals).call(r,this)];return t?h:(Cl(h).call(h,function(t){l=t()}),l)}show(){this.displayed||this.redraw()}hide(){if(this.displayed){var t=this.dom;t.box.parentNode&&t.box.parentNode.removeChild(t.box),this.options.showStipes&&(t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot)),this.displayed=!1}}repositionX(){let t=this.conversion.toScreen(this.data.start),e=this.data.end?this.conversion.toScreen(this.data.end):0;if(e)this.repositionXWithRanges(t,e);else{let e=void 0===this.data.align?this.options.align:this.data.align;this.repositionXWithoutRanges(t,e)}this.options.showStipes&&(this.dom.line.style.display=this._isStipeVisible()?"block":"none",this.dom.dot.style.display=this._isStipeVisible()?"block":"none",this._isStipeVisible()&&this.repositionStype(t,e))}repositionStype(t,e){this.dom.line.style.display="block",this.dom.dot.style.display="block";const i=this.dom.line.offsetWidth,n=this.dom.dot.offsetWidth;if(e){const o=i+t+(e-t)/2,s=o-n/2,r=this.options.rtl?-1*o:o,a=this.options.rtl?-1*s:s;this.dom.line.style.transform="translateX(".concat(r,"px)"),this.dom.dot.style.transform="translateX(".concat(a,"px)")}else{const e=this.options.rtl?-1*t:t,i=this.options.rtl?-1*(t-n/2):t-n/2;this.dom.line.style.transform="translateX(".concat(e,"px)"),this.dom.dot.style.transform="translateX(".concat(i,"px)")}}repositionXWithoutRanges(t,e){"right"==e?this.options.rtl?(this.right=t-this.width,this.dom.box.style.right=this.right+"px"):(this.left=t-this.width,this.dom.box.style.left=this.left+"px"):"left"==e?this.options.rtl?(this.right=t,this.dom.box.style.right=this.right+"px"):(this.left=t,this.dom.box.style.left=this.left+"px"):this.options.rtl?(this.right=t-this.width/2,this.dom.box.style.right=this.right+"px"):(this.left=t-this.width/2,this.dom.box.style.left=this.left+"px")}repositionXWithRanges(t,e){let i=Math.round(Math.max(e-t+.5,1));this.options.rtl?this.right=t:this.left=t,this.width=Math.max(i,this.minWidth||0),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=i+"px"}repositionY(){var t=this.options.orientation.item,e=this.dom.box;if(e.style.top="top"==t?(this.top||0)+"px":(this.parent.height-this.top-this.height||0)+"px",this.options.showStipes){if("top"==t)this.dom.line.style.top="0",this.dom.line.style.height=this.parent.top+this.top+1+"px",this.dom.line.style.bottom="";else{var i=this.parent.itemSet.props.height,n=i-this.parent.top-this.parent.height+this.top;this.dom.line.style.top=i-n+"px",this.dom.line.style.bottom="0"}this.dom.dot.style.top=-this.dom.dot.offsetHeight/2+"px"}}getWidthLeft(){return this.width/2}getWidthRight(){return this.width/2}move(){this.repositionX(),this.repositionY()}attach(){var t;for(let t of this.data.uiItems)t.cluster=this;this.data.items=ya(t=this.data.uiItems).call(t,t=>t.data),this.attached=!0,this.dirty=!0}detach(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.hasItems()){for(let t of this.data.uiItems)delete t.cluster;this.attached=!1,t&&this.group&&(this.group.remove(this),this.group=null),this.data.items=[],this.dirty=!0}}_onDoubleClick(){this._fit()}_setupRange(){var t,e,i;const n=ya(t=this.data.uiItems).call(t,t=>({start:t.data.start.valueOf(),end:t.data.end?t.data.end.valueOf():t.data.start.valueOf()}));this.data.min=Math.min(...ya(n).call(n,t=>Math.min(t.start,t.end||t.start))),this.data.max=Math.max(...ya(n).call(n,t=>Math.max(t.start,t.end||t.start)));const o=ya(e=this.data.uiItems).call(e,t=>t.center),s=Pb(o).call(o,(t,e)=>t+e,0)/this.data.uiItems.length;Hx(i=this.data.uiItems).call(i,t=>t.data.end)?(this.data.start=new Date(this.data.min),this.data.end=new Date(this.data.max)):(this.data.start=new Date(s),this.data.end=null)}_getUiItems(){var t;return this.data.uiItems&&this.data.uiItems.length?Pd(t=this.data.uiItems).call(t,t=>t.cluster===this):[]}_createDomElement(){if(!this.dom){var t;if(this.dom={},this.dom.box=document.createElement("DIV"),this.dom.content=document.createElement("DIV"),this.dom.content.className="vis-item-content",this.dom.box.appendChild(this.dom.content),this.options.showStipes&&(this.dom.line=document.createElement("DIV"),this.dom.line.className="vis-cluster-line",this.dom.line.style.display="none",this.dom.dot=document.createElement("DIV"),this.dom.dot.className="vis-cluster-dot",this.dom.dot.style.display="none"),this.options.fitOnDoubleClick)this.dom.box.ondblclick=dl(t=WC.prototype._onDoubleClick).call(t,this);this.dom.box["vis-item"]=this,this.dirty=!0}}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}const t=this.parent.dom.background;if(this.options.showStipes){if(!this.dom.line.parentNode){if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.line)}if(!this.dom.dot.parentNode){var e=this.parent.dom.axis;if(!t)throw new Error("Cannot redraw item: parent has no axis container element");e.appendChild(this.dom.dot)}}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.baseClassName+" "+(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+" vis-readonly";this.dom.box.className="vis-item "+t,this.options.showStipes&&(this.dom.line.className="vis-item vis-cluster-line "+(this.selected?" vis-selected":""),this.dom.dot.className="vis-item vis-cluster-dot "+(this.selected?" vis-selected":"")),this.data.end&&(this.dom.content.style.maxWidth="none")}}_getDomComponentsSizes(){const t={previous:{right:this.dom.box.style.right,left:this.dom.box.style.left},box:{width:this.dom.box.offsetWidth,height:this.dom.box.offsetHeight}};return this.options.showStipes&&(t.dot={height:this.dom.dot.offsetHeight,width:this.dom.dot.offsetWidth},t.line={width:this.dom.line.offsetWidth}),t}_updateDomComponentsSizes(t){this.options.rtl?this.dom.box.style.right="0px":this.dom.box.style.left="0px",this.data.end?this.minWidth=t.box.width:this.width=t.box.width,this.height=t.box.height,this.options.rtl?this.dom.box.style.right=t.previous.right:this.dom.box.style.left=t.previous.left,this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box)}_isStipeVisible(){return this.minWidth>=this.width||!this.data.end}_getFitRange(){const t=.05*(this.data.max-this.data.min)/2;return{fitStart:this.data.min-t,fitEnd:this.data.max+t}}_fit(){if(this.emitter){const{fitStart:t,fitEnd:e}=this._getFitRange(),i={start:new Date(t),end:new Date(e),animation:!0};this.emitter.emit("fit",i)}}_getItemData(){return this.data}}WC.prototype.baseClassName="vis-item vis-range vis-cluster";const BC="__ungrouped__";class VC{constructor(t){this.itemSet=t,this.groups={},this.cache={},this.cache[-1]=[]}createClusterItem(t,e,i){return new WC(t,e,i)}setItems(t,e){this.items=t||[],this.dataChanged=!0,this.applyOnChangedLevel=!1,e&&e.applyOnChangedLevel&&(this.applyOnChangedLevel=e.applyOnChangedLevel)}updateData(){this.dataChanged=!0,this.applyOnChangedLevel=!1}getClusters(t,e,i){let{maxItems:n,clusterCriteria:o}="boolean"==typeof i?{}:i;o||(o=()=>!0),n=n||1;let s=-1,r=0;if(e>0){if(e>=1)return[];s=Math.abs(Math.round(Math.log(100/e)/Math.log(2))),r=Math.abs(Math.pow(2,s))}if(this.dataChanged){const t=s!=this.cacheLevel;(!this.applyOnChangedLevel||t)&&(this._dropLevelsCache(),this._filterData())}this.cacheLevel=s;let a=this.cache[s];if(!a){a=[];for(let e in this.groups){if(!Object.prototype.hasOwnProperty.call(this.groups,e))continue;const s=this.groups[e],l=s.length;let h=0;for(;h=0&&e.center-s[d].center=0&&e.center-a[u].centern){const r=l-n+1,d=[];let c=h;for(;d.lengtht.center-e.center)}this.dataChanged=!1}_getClusterForItems(t,e,i,n){var o;const s=ya(o=i||[]).call(o,t=>{var e;return{cluster:t,itemsIds:new zw(ya(e=t.data.uiItems).call(e,t=>t.id))}});let r;if(s.length)for(let e of s)if(e.itemsIds.size===t.length&&GC(t).call(t,t=>e.itemsIds.has(t.id))){r=e.cluster;break}if(r)return r.setUiItems(t),r.group!==e&&(r.group&&r.group.remove(r),e&&(e.add(r),r.group=e)),r;let a=n.titleTemplate||"";const l={toScreen:this.itemSet.body.util.toScreen,toTime:this.itemSet.body.util.toTime},h=a.replace(/{count}/,t.length),d=''+t.length+"
",c=mh({},n,this.itemSet.options),u={content:d,title:h,group:e,uiItems:t,eventEmitter:this.itemSet.body.emitter,range:this.itemSet.body.range};return r=this.createClusterItem(u,l,c),e&&(e.add(r),r.group=e),r.attach(),r}_dropLevelsCache(){this.cache={},this.cacheLevel=-1,this.cache[this.cacheLevel]=[]}}const UC="__ungrouped__",XC="__background__";class qC extends FD{constructor(t,e){super(),this.body=t,this.defaultOptions={type:null,orientation:{item:"bottom"},align:"auto",stack:!0,stackSubgroups:!0,groupOrderSwap(t,e){const i=e.order;e.order=t.order,t.order=i},groupOrder:"order",selectable:!0,multiselect:!1,longSelectPressTime:251,itemsAlwaysDraggable:{item:!1,range:!1},editable:{updateTime:!1,updateGroup:!1,add:!1,remove:!1,overrideItems:!1},groupEditable:{order:!1,add:!1,remove:!1},snap:xS.snap,onDropObjectOnItem(t,e,i){i(e)},onAdd(t,e){e(t)},onUpdate(t,e){e(t)},onMove(t,e){e(t)},onRemove(t,e){e(t)},onMoving(t,e){e(t)},onAddGroup(t,e){e(t)},onMoveGroup(t,e){e(t)},onRemoveGroup(t,e){e(t)},margin:{item:{horizontal:10,vertical:10},axis:20},showTooltips:!0,tooltip:{followMouse:!1,overflowMethod:"flip",delay:500},tooltipOnItemUpdateTime:!1},this.options=wD.extend({},this.defaultOptions),this.options.rtl=e.rtl,this.options.onTimeout=e.onTimeout,this.conversion={toScreen:t.util.toScreen,toTime:t.util.toTime},this.dom={},this.props={},this.hammer=null;const i=this;this.itemsData=null,this.groupsData=null,this.itemsSettingTime=null,this.initialItemSetDrawn=!1,this.userContinueNotBail=null,this.sequentialSelection=!1,this.itemListeners={add(t,e){i._onAdd(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()},update(t,e){i._onUpdate(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()},remove(t,e){i._onRemove(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()}},this.groupListeners={add(t,e,n){if(i._onAddGroups(e.items),i.groupsData&&i.groupsData.length>0){var o;const t=i.groupsData.getDataSet();Cl(o=t.get()).call(o,e=>{if(e.nestedGroups){var i;0!=e.showNested&&(e.showNested=!0);let o=[];Cl(i=e.nestedGroups).call(i,i=>{const n=t.get(i);n&&(n.nestedInGroup=e.id,0==e.showNested&&(n.visible=!1),o=vd(o).call(o,n))}),t.update(o,n)}})}},update(t,e){i._onUpdateGroups(e.items)},remove(t,e){i._onRemoveGroups(e.items)}},this.items={},this.groups={},this.groupIds=[],this.selection=[],this.popup=null,this.popupTimer=null,this.touchParams={},this.groupTouchParams={group:null,isDragging:!1},this._create(),this.setOptions(e),this.clusters=[]}_create(){var t,e,i,n,o,s,r,a,l,h,d,c,u,p,m;const f=document.createElement("div");f.className="vis-itemset",f["vis-itemset"]=this,this.dom.frame=f;const g=document.createElement("div");g.className="vis-background",f.appendChild(g),this.dom.background=g;const v=document.createElement("div");v.className="vis-foreground",f.appendChild(v),this.dom.foreground=v;const b=document.createElement("div");b.className="vis-axis",this.dom.axis=b;const y=document.createElement("div");y.className="vis-labelset",this.dom.labelSet=y,this._updateUngrouped();const _=new xC(XC,null,this);_.show(),this.groups[XC]=_,this.hammer=new _S(this.body.dom.centerContainer),this.hammer.on("hammer.input",t=>{t.isFirst&&this._onTouch(t)}),this.hammer.on("panstart",dl(t=this._onDragStart).call(t,this)),this.hammer.on("panmove",dl(e=this._onDrag).call(e,this)),this.hammer.on("panend",dl(i=this._onDragEnd).call(i,this)),this.hammer.get("pan").set({threshold:5,direction:_S.ALL}),this.hammer.get("press").set({time:1e4}),this.hammer.on("tap",dl(n=this._onSelectItem).call(n,this)),this.hammer.on("press",dl(o=this._onMultiSelectItem).call(o,this)),this.hammer.get("press").set({time:1e4}),this.hammer.on("doubletap",dl(s=this._onAddItem).call(s,this)),this.options.rtl?this.groupHammer=new _S(this.body.dom.rightContainer):this.groupHammer=new _S(this.body.dom.leftContainer),this.groupHammer.on("tap",dl(r=this._onGroupClick).call(r,this)),this.groupHammer.on("panstart",dl(a=this._onGroupDragStart).call(a,this)),this.groupHammer.on("panmove",dl(l=this._onGroupDrag).call(l,this)),this.groupHammer.on("panend",dl(h=this._onGroupDragEnd).call(h,this)),this.groupHammer.get("pan").set({threshold:5,direction:_S.DIRECTION_VERTICAL}),this.body.dom.centerContainer.addEventListener("mouseover",dl(d=this._onMouseOver).call(d,this)),this.body.dom.centerContainer.addEventListener("mouseout",dl(c=this._onMouseOut).call(c,this)),this.body.dom.centerContainer.addEventListener("mousemove",dl(u=this._onMouseMove).call(u,this)),this.body.dom.centerContainer.addEventListener("contextmenu",dl(p=this._onDragEnd).call(p,this)),this.body.dom.centerContainer.addEventListener("mousewheel",dl(m=this._onMouseWheel).call(m,this)),this.show()}setOptions(t){if(t){var e,i;const n=["type","rtl","align","order","stack","stackSubgroups","selectable","multiselect","sequentialSelection","multiselectPerGroup","longSelectPressTime","groupOrder","dataAttributes","template","groupTemplate","visibleFrameTemplate","hide","snap","groupOrderSwap","showTooltips","tooltip","tooltipOnItemUpdateTime","groupHeightMode","onTimeout"];wD.selectiveExtend(n,this.options,t),"itemsAlwaysDraggable"in t&&("boolean"==typeof t.itemsAlwaysDraggable?(this.options.itemsAlwaysDraggable.item=t.itemsAlwaysDraggable,this.options.itemsAlwaysDraggable.range=!1):"object"==typeof t.itemsAlwaysDraggable&&(wD.selectiveExtend(["item","range"],this.options.itemsAlwaysDraggable,t.itemsAlwaysDraggable),this.options.itemsAlwaysDraggable.item||(this.options.itemsAlwaysDraggable.range=!1))),"sequentialSelection"in t&&"boolean"==typeof t.sequentialSelection&&(this.options.sequentialSelection=t.sequentialSelection),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.item="top"===t.orientation?"top":"bottom":"object"==typeof t.orientation&&"item"in t.orientation&&(this.options.orientation.item=t.orientation.item)),"margin"in t&&("number"==typeof t.margin?(this.options.margin.axis=t.margin,this.options.margin.item.horizontal=t.margin,this.options.margin.item.vertical=t.margin):"object"==typeof t.margin&&(wD.selectiveExtend(["axis"],this.options.margin,t.margin),"item"in t.margin&&("number"==typeof t.margin.item?(this.options.margin.item.horizontal=t.margin.item,this.options.margin.item.vertical=t.margin.item):"object"==typeof t.margin.item&&wD.selectiveExtend(["horizontal","vertical"],this.options.margin.item,t.margin.item)))),Cl(e=["locale","locales"]).call(e,e=>{e in t&&(this.options[e]=t[e])}),"editable"in t&&("boolean"==typeof t.editable?(this.options.editable.updateTime=t.editable,this.options.editable.updateGroup=t.editable,this.options.editable.add=t.editable,this.options.editable.remove=t.editable,this.options.editable.overrideItems=!1):"object"==typeof t.editable&&wD.selectiveExtend(["updateTime","updateGroup","add","remove","overrideItems"],this.options.editable,t.editable)),"groupEditable"in t&&("boolean"==typeof t.groupEditable?(this.options.groupEditable.order=t.groupEditable,this.options.groupEditable.add=t.groupEditable,this.options.groupEditable.remove=t.groupEditable):"object"==typeof t.groupEditable&&wD.selectiveExtend(["order","add","remove"],this.options.groupEditable,t.groupEditable));const o=e=>{const i=t[e];if(i){var n;if("function"!=typeof i)throw new Error(vd(n="option ".concat(e," must be a function ")).call(n,e,"(item, callback)"));this.options[e]=i}};Cl(i=["onDropObjectOnItem","onAdd","onUpdate","onRemove","onMove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup"]).call(i,o),t.cluster?(mh(this.options,{cluster:t.cluster}),this.clusterGenerator||(this.clusterGenerator=new VC(this)),this.clusterGenerator.setItems(this.items,{applyOnChangedLevel:!1}),this.markDirty({refreshItems:!0,restackGroups:!0}),this.redraw()):this.clusterGenerator?(this._detachAllClusters(),this.clusters=[],this.clusterGenerator=null,this.options.cluster=void 0,this.markDirty({refreshItems:!0,restackGroups:!0}),this.redraw()):this.markDirty()}}markDirty(t){this.groupIds=[],t&&(t.refreshItems&&Cl(wD).call(wD,this.items,t=>{t.dirty=!0,t.displayed&&t.redraw()}),t.restackGroups&&Cl(wD).call(wD,this.groups,(t,e)=>{e!==XC&&(t.stackDirty=!0)}))}destroy(){this.clearPopupTimer(),this.hide(),this.setItems(null),this.setGroups(null),this.hammer&&this.hammer.destroy(),this.groupHammer&&this.groupHammer.destroy(),this.hammer=null,this.body=null,this.conversion=null}hide(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.axis.parentNode&&this.dom.axis.parentNode.removeChild(this.dom.axis),this.dom.labelSet.parentNode&&this.dom.labelSet.parentNode.removeChild(this.dom.labelSet)}show(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame),this.dom.axis.parentNode||this.body.dom.backgroundVertical.appendChild(this.dom.axis),this.dom.labelSet.parentNode||(this.options.rtl?this.body.dom.right.appendChild(this.dom.labelSet):this.body.dom.left.appendChild(this.dom.labelSet))}setPopupTimer(t){if(this.clearPopupTimer(),t){const e=this.options.tooltip.delay||"number"==typeof this.options.tooltip.delay?this.options.tooltip.delay:500;this.popupTimer=Fu(function(){t.show()},e)}}clearPopupTimer(){null!=this.popupTimer&&(clearTimeout(this.popupTimer),this.popupTimer=null)}setSelection(t){var e;null==t&&(t=[]),aa(t)||(t=[t]);const i=Pd(e=this.selection).call(e,e=>-1===kc(t).call(t,e));for(let t of i){const e=this.getItemById(t);e&&e.unselect()}this.selection=[...t];for(let e of t){const t=this.getItemById(e);t&&t.select()}}getSelection(){var t;return vd(t=this.selection).call(t,[])}getVisibleItems(){const t=this.body.range.getRange();let e,i;this.options.rtl?(e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end)):(i=this.body.util.toScreen(t.start),e=this.body.util.toScreen(t.end));const n=[];for(const t in this.groups){if(!Object.prototype.hasOwnProperty.call(this.groups,t))continue;const o=this.groups[t],s=o.isVisible?o.visibleItems:[];for(const t of s)this.options.rtl?t.righte&&n.push(t.id):t.lefti&&n.push(t.id)}return n}getItemsAtCurrentTime(t){let e,i;this.options.rtl?(e=this.body.util.toScreen(t),i=this.body.util.toScreen(t)):(i=this.body.util.toScreen(t),e=this.body.util.toScreen(t));const n=[];for(const t in this.groups){if(!Object.prototype.hasOwnProperty.call(this.groups,t))continue;const o=this.groups[t],s=o.isVisible?o.visibleItems:[];for(const t of s)this.options.rtl?t.righte&&n.push(t.id):t.lefti&&n.push(t.id)}return n}getVisibleGroups(){const t=[];for(const e in this.groups){if(!Object.prototype.hasOwnProperty.call(this.groups,e))continue;this.groups[e].isVisible&&t.push(e)}return t}getItemById(t){var e;return this.items[t]||sC(e=this.clusters).call(e,e=>e.id===t)}_deselect(t){const e=this.selection;for(let i=0,n=e.length;i{if(i===XC)return;const n=t==p?m:f;b[i]=t.redraw(e,n,u,!0),y=b[i].length});if(y>0){const t={};for(let e=0;e{t[n]=i[e]()});Cl(wD).call(wD,this.groups,(e,i)=>{if(i===XC)return;const n=t[i];s=n||s,g+=e.height}),g=Math.max(g,v)}return g=Math.max(g,v),r.style.height=i(g),this.props.width=r.offsetWidth,this.props.height=g,this.dom.axis.style.top=i("top"==o?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.options.rtl?this.dom.axis.style.right="0":this.dom.axis.style.left="0",this.hammer.get("press").set({time:this.options.longSelectPressTime}),this.initialItemSetDrawn=!0,s=this._isResized()||s,s}_firstGroup(){const t="top"==this.options.orientation.item?0:this.groupIds.length-1,e=this.groupIds[t];return this.groups[e]||this.groups[UC]||null}_updateUngrouped(){let t,e,i=this.groups[UC];if(this.groupsData){if(i)for(e in i.dispose(),delete this.groups[UC],this.items){if(!Object.prototype.hasOwnProperty.call(this.items,e))continue;t=this.items[e],t.parent&&t.parent.remove(t);const i=this.getGroupId(t.data),n=this.groups[i];n&&n.add(t)||t.hide()}}else if(!i){const n=null,o=null;for(e in i=new wC(n,o,this),this.groups[UC]=i,this.items)Object.prototype.hasOwnProperty.call(this.items,e)&&(t=this.items[e],i.add(t));i.show()}}getLabelSet(){return this.dom.labelSet}setItems(t){this.itemsSettingTime=new Date;const e=this;let i;const n=this.itemsData;if(t){if(!pD(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.itemsData=vD(t)}else this.itemsData=null;if(n&&(Cl(wD).call(wD,this.itemListeners,(t,e)=>{n.off(e,t)}),n.dispose(),i=n.getIds(),this._onRemove(i)),this.itemsData){const t=this.id;Cl(wD).call(wD,this.itemListeners,(i,n)=>{e.itemsData.on(n,i,t)}),i=this.itemsData.getIds(),this._onAdd(i),this._updateUngrouped()}this.body.emitter.emit("_change",{queue:!0})}getItems(){return null!=this.itemsData?this.itemsData.rawDS:null}setGroups(t){const e=this;let i;if(this.groupsData&&(Cl(wD).call(wD,this.groupListeners,(t,i)=>{e.groupsData.off(i,t)}),i=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(i)),t){if(!pD(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var n;const t=this.groupsData.getDataSet();Cl(n=t.get()).call(n,e=>{var i;e.nestedGroups&&Cl(i=e.nestedGroups).call(i,i=>{const n=t.get(i);n.nestedInGroup=e.id,0==e.showNested&&(n.visible=!1),t.update(n)})});const o=this.id;Cl(wD).call(wD,this.groupListeners,(t,i)=>{e.groupsData.on(i,t,o)}),i=this.groupsData.getIds(),this._onAddGroups(i)}this._updateUngrouped(),this._order(),this.options.cluster&&(this.clusterGenerator.updateData(),this._clusterItems(),this.markDirty({refreshItems:!0,restackGroups:!0})),this.body.emitter.emit("_change",{queue:!0})}getGroups(){return this.groupsData}removeItem(t){const e=this.itemsData.get(t);e&&this.options.onRemove(e,e=>{e&&this.itemsData.remove(t)})}_getType(t){return t.type||this.options.type||(t.end?"range":"box")}getGroupId(t){return"background"==this._getType(t)&&null==t.group?XC:this.groupsData?t.group:UC}_onUpdate(t){const e=this;Cl(t).call(t,t=>{const i=e.itemsData.get(t);let n=e.items[t];const o=i?e._getType(i):null,s=qC.types[o];let r;if(n&&(s&&n instanceof s?e._updateItem(n,i):(r=n.selected,e._removeItem(n),n=null)),!n&&i){if(!s)throw new TypeError('Unknown item type "'.concat(o,'"'));n=new s(i,e.conversion,e.options),n.id=t,e._addItem(n),r&&(this.selection.push(t),n.select())}}),this._order(),this.options.cluster&&(this.clusterGenerator.setItems(this.items,{applyOnChangedLevel:!1}),this._clusterItems()),this.body.emitter.emit("_change",{queue:!0})}_onRemove(t){let e=0;const i=this;Cl(t).call(t,t=>{const n=i.items[t];n&&(e++,i._removeItem(n))}),e&&(this._order(),this.body.emitter.emit("_change",{queue:!0}))}_order(){Cl(wD).call(wD,this.groups,t=>{t.order()})}_onUpdateGroups(t){this._onAddGroups(t)}_onAddGroups(t){const e=this;Cl(t).call(t,t=>{const i=e.groupsData.get(t);let n=e.groups[t];if(n)n.setData(i);else{if(t==UC||t==XC)throw new Error("Illegal group id. ".concat(t," is a reserved id."));const o=Zc(e.options);wD.extend(o,{height:null}),n=new wC(t,i,e),e.groups[t]=n;for(const i in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,i))continue;const o=e.items[i];o.data.group==t&&n.add(o)}n.order(),n.show()}}),this.body.emitter.emit("_change",{queue:!0})}_onRemoveGroups(t){Cl(t).call(t,t=>{const e=this.groups[t];e&&(e.dispose(),delete this.groups[t])}),this.options.cluster&&(this.clusterGenerator.updateData(),this._clusterItems()),this.markDirty({restackGroups:!!this.options.cluster}),this.body.emitter.emit("_change",{queue:!0})}_orderGroups(){if(this.groupsData){let t=this.groupsData.getIds({order:this.options.groupOrder});t=this._orderNestedGroups(t);const e=!wD.equalArray(t,this.groupIds);if(e){const e=this.groups;Cl(t).call(t,t=>{e[t].hide()}),Cl(t).call(t,t=>{e[t].show()}),this.groupIds=t}return e}return!1}_orderNestedGroups(t){return function t(e,i){let n=[];return Cl(i).call(i,i=>{n.push(i);if(e.groupsData.get(i).nestedGroups){var o;const s=ya(o=e.groupsData.get({filter:t=>t.nestedInGroup==i,order:e.options.groupOrder})).call(o,t=>t.id);n=vd(n).call(n,t(e,s))}}),n}(this,Pd(t).call(t,t=>!this.groupsData.get(t).nestedInGroup))}_addItem(t){this.items[t.id]=t;const e=this.getGroupId(t.data),i=this.groups[e];i?i&&i.data&&i.data.showNested&&(t.groupShowing=!0):t.groupShowing=!1,i&&i.add(t)}_updateItem(t,e){t.setData(e);const i=this.getGroupId(t.data),n=this.groups[i];n?n&&n.data&&n.data.showNested&&(t.groupShowing=!0):t.groupShowing=!1}_removeItem(t){var e,i;t.hide(),delete this.items[t.id];const n=kc(e=this.selection).call(e,t.id);-1!=n&&rh(i=this.selection).call(i,n,1),t.parent&&t.parent.remove(t),null!=this.popup&&this.popup.hide()}_constructByEndArray(t){const e=[];for(let i=0;i{const o=i.items[e],s=i._getGroupIndex(o.data.group);return{item:o,initialX:t.center.x,groupOffset:n-s,data:this._cloneItemData(o.data)}})}t.stopPropagation()}else this.options.editable.add&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey)&&this._onDragStartAddItem(t)}_onDragStartAddItem(t){const e=this.options.snap||null,i=this.dom.frame.getBoundingClientRect(),n=this.options.rtl?i.right-t.center.x+10:t.center.x-i.left-10,o=this.body.util.toTime(n),s=this.body.util.getScale(),r=this.body.util.getStep(),a=e?e(o,s,r):o,l={type:"range",start:a,end:a,content:"new item"},h=wk();l[this.itemsData.idProp]=h;const d=this.groupFromTarget(t);d&&(l.group=d.groupId);const c=new CC(l,this.conversion,this.options);c.id=h,c.data=this._cloneItemData(l),this._addItem(c),this.touchParams.selectedItem=c;const u={item:c,initialX:t.center.x,data:c.data};this.options.rtl?u.dragLeft=!0:u.dragRight=!0,this.touchParams.itemProps=[u],t.stopPropagation()}_onDrag(t){if(null!=this.popup&&this.options.showTooltips&&!this.popup.hidden){const e=this.body.dom.centerContainer,i=e.getBoundingClientRect();this.popup.setPosition(t.center.x-i.left+e.offsetLeft,t.center.y-i.top+e.offsetTop),this.popup.show()}if(this.touchParams.itemProps){var e;t.stopPropagation();const i=this,n=this.options.snap||null,o=this.body.dom.root.offsetLeft,s=this.options.rtl?o+this.body.domProps.right.width:o+this.body.domProps.left.width,r=this.body.util.getScale(),a=this.body.util.getStep(),l=this.touchParams.selectedItem,h=(this.options.editable.overrideItems||null==l.editable)&&this.options.editable.updateGroup||!this.options.editable.overrideItems&&null!=l.editable&&l.editable.updateGroup;let d=null;if(h&&l&&null!=l.data.group){const e=i.groupFromTarget(t);e&&(d=this._getGroupIndex(e.groupId))}Cl(e=this.touchParams.itemProps).call(e,e=>{const o=i.body.util.toTime(t.center.x-s),c=i.body.util.toTime(e.initialX-s);let u,p,m,f,g;u=this.options.rtl?-(o-c):o-c;let v=this._cloneItemData(e.item.data);if(null!=e.item.editable&&!e.item.editable.updateTime&&!e.item.editable.updateGroup&&!i.options.editable.overrideItems)return;if((this.options.editable.overrideItems||null==l.editable)&&this.options.editable.updateTime||!this.options.editable.overrideItems&&null!=l.editable&&l.editable.updateTime)if(e.dragLeft)this.options.rtl?null!=v.end&&(m=wD.convert(e.data.end,"Date"),g=new Date(m.valueOf()+u),v.end=n?n(g,r,a):g):null!=v.start&&(p=wD.convert(e.data.start,"Date"),f=new Date(p.valueOf()+u),v.start=n?n(f,r,a):f);else if(e.dragRight)this.options.rtl?null!=v.start&&(p=wD.convert(e.data.start,"Date"),f=new Date(p.valueOf()+u),v.start=n?n(f,r,a):f):null!=v.end&&(m=wD.convert(e.data.end,"Date"),g=new Date(m.valueOf()+u),v.end=n?n(g,r,a):g);else if(null!=v.start)if(p=wD.convert(e.data.start,"Date").valueOf(),f=new Date(p+u),null!=v.end){m=wD.convert(e.data.end,"Date");const t=m.valueOf()-p.valueOf();v.start=n?n(f,r,a):f,v.end=new Date(v.start.valueOf()+t)}else v.start=n?n(f,r,a):f;if(h&&!e.dragLeft&&!e.dragRight&&null!=d&&null!=v.group){let t=d-e.groupOffset;t=Math.max(0,t),t=Math.min(i.groupIds.length-1,t),v.group=i.groupIds[t]}v=this._cloneItemData(v),i.options.onMoving(v,t=>{t&&e.item.setData(this._cloneItemData(t,"Date"))})}),this.body.emitter.emit("_change")}}_moveToGroup(t,e){const i=this.groups[e];if(i&&i.groupId!=t.data.group){const e=t.parent;e.remove(t),e.order(),t.data.group=i.groupId,i.add(t),i.order()}}_onDragEnd(t){if(this.touchParams.itemIsDragging=!1,this.touchParams.itemProps){t.stopPropagation();const e=this,i=this.touchParams.itemProps;this.touchParams.itemProps=null,Cl(i).call(i,t=>{const i=t.item.id;if(null!=e.itemsData.get(i)){const n=this._cloneItemData(t.item.data);e.options.onMove(n,n=>{n?(n[this.itemsData.idProp]=i,this.itemsData.update(n)):(t.item.setData(t.data),e.body.emitter.emit("_change"))})}else e.options.onAdd(t.item.data,i=>{e._removeItem(t.item),i&&e.itemsData.add(i),e.body.emitter.emit("_change")})})}}_onGroupClick(t){const e=this.groupFromTarget(t);Fu(()=>{this.toggleGroupShowNested(e)},1)}toggleGroupShowNested(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!t||!t.nestedGroups)return;const i=this.groupsData.getDataSet();t.showNested=null!=e?!!e:!t.showNested;let n=i.get(t.groupId);n.showNested=t.showNested;let o=t.nestedGroups,s=o;for(;s.length>0;){let t=s;s=[];for(let e=0;e0&&(o=vd(o).call(o,s))}var r;if(n.showNested){var a=i.get(n.nestedGroups);for(let t=0;t0&&(null==e.showNested||1==e.showNested)&&a.push(...i.get(e.nestedGroups))}r=ya(a).call(a,function(t){return null==t.visible&&(t.visible=!0),t.visible=!!n.showNested,t})}else{var l;r=ya(l=i.get(o)).call(l,function(t){return null==t.visible&&(t.visible=!0),t.visible=!!n.showNested,t})}i.update(vd(r).call(r,n)),n.showNested?(wD.removeClassName(t.dom.label,"collapsed"),wD.addClassName(t.dom.label,"expanded")):(wD.removeClassName(t.dom.label,"expanded"),wD.addClassName(t.dom.label,"collapsed"))}toggleGroupDragClassName(t){t.dom.label.classList.toggle("vis-group-is-dragging"),t.dom.foreground.classList.toggle("vis-group-is-dragging")}_onGroupDragStart(t){this.groupTouchParams.isDragging||this.options.groupEditable.order&&(this.groupTouchParams.group=this.groupFromTarget(t),this.groupTouchParams.group&&(t.stopPropagation(),this.groupTouchParams.isDragging=!0,this.toggleGroupDragClassName(this.groupTouchParams.group),this.groupTouchParams.originalOrder=this.groupsData.getIds({order:this.options.groupOrder})))}_onGroupDrag(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();const e=this.groupsData.getDataSet(),i=this.groupFromTarget(t);if(i&&i.height!=this.groupTouchParams.group.height){const e=i.topn)return}}if(i&&i!=this.groupTouchParams.group){const t=e.get(i.groupId),n=e.get(this.groupTouchParams.group.groupId);n&&t&&(this.options.groupOrderSwap(n,t,e),e.update(n),e.update(t));const o=e.getIds({order:this.options.groupOrder});if(!wD.equalArray(o,this.groupTouchParams.originalOrder)){const t=this.groupTouchParams.originalOrder,i=this.groupTouchParams.group.groupId,n=Math.min(t.length,o.length);let s=0,r=0,a=0;for(;s=n)break;if(o[s+r]==i)r=1;else if(t[s+a]==i)a=1;else{const i=kc(o).call(o,t[s+a]),n=e.get(o[s+r]),l=e.get(t[s+a]);this.options.groupOrderSwap(n,l,e),e.update(n),e.update(l);const h=o[s+r];o[s+r]=t[s+a],o[i]=h,s++}}}}}}_onGroupDragEnd(t){if(this.groupTouchParams.isDragging=!1,this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();const e=this,i=e.groupTouchParams.group.groupId,n=e.groupsData.getDataSet(),o=wD.extend({},n.get(i));e.options.onMoveGroup(o,t=>{if(t)t[n._idProp]=i,n.update(t);else{const t=n.getIds({order:e.options.groupOrder});if(!wD.equalArray(t,e.groupTouchParams.originalOrder)){const i=e.groupTouchParams.originalOrder,o=Math.min(i.length,t.length);let s=0;for(;s=o)break;const r=kc(t).call(t,i[s]),a=n.get(t[s]),l=n.get(i[s]);e.options.groupOrderSwap(a,l,n),n.update(a),n.update(l);const h=t[s];t[s]=i[s],t[r]=h,s++}}}}),e.body.emitter.emit("groupDragged",{groupId:i}),this.toggleGroupDragClassName(this.groupTouchParams.group),this.groupTouchParams.group=null}}_onSelectItem(t){if(!this.options.selectable)return;const e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);const n=this.getSelection(),o=this.itemFromTarget(t),s=o&&o.selectable?[o.id]:[];this.setSelection(s);const r=this.getSelection();(r.length>0||n.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}_onMouseOver(t){const e=this.itemFromTarget(t);if(!e)return;if(e===this.itemFromRelatedTarget(t))return;const i=e.getTitle();if(this.options.showTooltips&&i){null==this.popup&&(this.popup=new MC(this.body.dom.root,this.options.tooltip.overflowMethod||"flip")),this.popup.setText(i);const e=this.body.dom.centerContainer,n=e.getBoundingClientRect();this.popup.setPosition(t.clientX-n.left+e.offsetLeft,t.clientY-n.top+e.offsetTop),this.setPopupTimer(this.popup)}else this.clearPopupTimer(),null!=this.popup&&this.popup.hide();this.body.emitter.emit("itemover",{item:e.id,event:t})}_onMouseOut(t){const e=this.itemFromTarget(t);if(!e)return;e!==this.itemFromRelatedTarget(t)&&(this.clearPopupTimer(),null!=this.popup&&this.popup.hide(),this.body.emitter.emit("itemout",{item:e.id,event:t}))}_onMouseMove(t){if(this.itemFromTarget(t)&&(null!=this.popupTimer&&this.setPopupTimer(this.popup),this.options.showTooltips&&this.options.tooltip.followMouse&&this.popup&&!this.popup.hidden)){const e=this.body.dom.centerContainer,i=e.getBoundingClientRect();this.popup.setPosition(t.clientX-i.left+e.offsetLeft,t.clientY-i.top+e.offsetTop),this.popup.show()}}_onMouseWheel(t){this.touchParams.itemIsDragging&&this._onDragEnd(t)}_onUpdateItem(t){if(!this.options.selectable)return;if(!this.options.editable.updateTime&&!this.options.editable.updateGroup)return;const e=this;if(t){const i=e.itemsData.get(t.id);this.options.onUpdate(i,t=>{t&&e.itemsData.update(t)})}}_onDropObjectOnItem(t){const e=this.itemFromTarget(t),i=JSON.parse(t.dataTransfer.getData("text"));this.options.onDropObjectOnItem(i,e)}_onAddItem(t){if(!this.options.selectable)return;if(!this.options.editable.add)return;const e=this,i=this.options.snap||null,n=this.dom.frame.getBoundingClientRect(),o=this.options.rtl?n.right-t.center.x:t.center.x-n.left,s=this.body.util.toTime(o),r=this.body.util.getScale(),a=this.body.util.getStep();let l,h;"drop"==t.type?(h=JSON.parse(t.dataTransfer.getData("text")),h.content=h.content?h.content:"new item",h.start=h.start?h.start:i?i(s,r,a):s,h.type=h.type||"box",h[this.itemsData.idProp]=h.id||wk(),"range"!=h.type||h.end||(l=this.body.util.toTime(o+this.props.width/5),h.end=i?i(l,r,a):l)):(h={start:i?i(s,r,a):s,content:"new item"},h[this.itemsData.idProp]=wk(),"range"===this.options.type&&(l=this.body.util.toTime(o+this.props.width/5),h.end=i?i(l,r,a):l));const d=this.groupFromTarget(t);d&&(h.group=d.groupId),h=this._cloneItemData(h),this.options.onAdd(h,i=>{i&&(e.itemsData.add(i),"drop"==t.type&&e.setSelection([i.id]))})}_onMultiSelectItem(t){if(!this.options.selectable)return;const e=this.itemFromTarget(t);if(e){let i=this.options.multiselect?this.getSelection():[];if((t.srcEvent&&t.srcEvent.shiftKey||!1||this.options.sequentialSelection)&&this.options.multiselect){const t=this.itemsData.get(e.id).group;let n;this.options.multiselectPerGroup&&i.length>0&&(n=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&null!=n&&n!=t||i.push(e.id);const o=qC._getItemRange(this.itemsData.get(i));if(!this.options.multiselectPerGroup||n==t){i=[];for(const t in this.items){if(!Object.prototype.hasOwnProperty.call(this.items,t))continue;const e=this.items[t],s=e.data.start,r=void 0!==e.data.end?e.data.end:s;!(s>=o.min&&r<=o.max)||this.options.multiselectPerGroup&&n!=this.itemsData.get(e.id).group||e instanceof TC||i.push(e.id)}}}else{const t=kc(i).call(i,e.id);-1==t?i.push(e.id):rh(i).call(i,t,1)}const n=Pd(i).call(i,t=>this.getItemById(t).selectable);this.setSelection(n),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}static _getItemRange(t){let e=null,i=null;return Cl(t).call(t,t=>{(null==i||t.starte)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)}),{min:i,max:e}}itemFromElement(t){let e=t;for(;e;){if(Object.prototype.hasOwnProperty.call(e,"vis-item"))return e["vis-item"];e=e.parentNode}return null}itemFromTarget(t){return this.itemFromElement(t.target)}itemFromRelatedTarget(t){return this.itemFromElement(t.relatedTarget)}groupFromTarget(t){const e=t.center?t.center.y:t.clientY;let i=this.groupIds;i.length<=0&&this.groupsData&&(i=this.groupsData.getIds({order:this.options.groupOrder}));for(let t=0;t=r.top&&er.top)return o}else if(0===t&&et.id)),s=Pd(e=this.clusters).call(e,t=>!o.has(t.id));let r=!1;for(let t of s){var i;const e=kc(i=this.selection).call(i,t.id);var n;if(-1!==e)t.unselect(),rh(n=this.selection).call(n,e,1),r=!0}if(r){const t=this.getSelection();this.body.emitter.emit("select",{items:t,event:event})}}this.clusters=t||[]}}qC.types={background:TC,box:DC,range:CC,point:SC},qC.prototype._onAdd=qC.prototype._onUpdate;let KC,ZC=!1,$C="background: #FFeeee; color: #dd0000";class JC{constructor(){}static validate(t,e,i){ZC=!1,KC=e;let n=e;return void 0!==i&&(n=e[i]),JC.parse(t,n,[]),ZC}static parse(t,e,i){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&JC.check(n,t,e,i)}static check(t,e,i,n){if(void 0===i[t]&&void 0===i.__any__)return void JC.getSuggestion(t,i,n);let o=t,s=!0;void 0===i[t]&&void 0!==i.__any__&&(o="__any__",s="object"===JC.getType(e[t]));let r=i[o];s&&void 0!==r.__type__&&(r=r.__type__),JC.checkFields(t,e,i,o,r,n)}static checkFields(t,e,i,n,o,s){let r=function(e){console.log("%c"+e+JC.printLocation(s,t),$C)},a=JC.getType(e[t]),l=o[a];void 0!==l?"array"===JC.getType(l)&&-1===kc(l).call(l,e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+JC.print(l)+' not "'+e[t]+'". '),ZC=!0):"object"===a&&"__any__"!==n&&(s=wD.copyAndExtendArray(s,t),JC.parse(e[t],i[n],s)):void 0===o.any&&(r('Invalid type received for "'+t+'". Expected: '+JC.print(Ea(o))+". Received ["+a+'] "'+e[t]+'"'),ZC=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":aa(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let n,o=JC.findInOptions(t,e,i,!1),s=JC.findInOptions(t,KC,[],!0);n=void 0!==o.indexMatch?" in "+JC.printLocation(o.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':s.distance<=4&&o.distance>s.distance?" in "+JC.printLocation(o.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+JC.printLocation(s.path,s.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+JC.printLocation(o.path,t):". Did you mean one of these: "+JC.print(Ea(e))+JC.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+n,$C),ZC=!0}static findInOptions(t,e,i){let n,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=1e9,r="",a=[],l=t.toLowerCase();for(let d in e){if(!Object.prototype.hasOwnProperty.call(e,d))continue;let c;if(void 0!==e[d].__type__&&!0===o){let o=JC.findInOptions(t,e[d],wD.copyAndExtendArray(i,d));s>o.distance&&(r=o.closestMatch,a=o.path,s=o.distance,n=o.indexMatch)}else{var h;-1!==kc(h=d.toLowerCase()).call(h,l)&&(n=d),c=JC.levenshteinDistance(t,d),s>c&&(r=d,a=wD.copyArray(i),s=c)}}return{closestMatch:r,path:a,distance:s,indexMatch:n}}static printLocation(t,e){let i="\n\n"+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Problem value found at: \n")+"options = {\n";for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:1;this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return lT[t]}setColor(t){let e,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("none"!==t){var n=this._isColorString(t);if(void 0!==n&&(t=n),!0===wD.isString(t)){if(!0===wD.isValidRGB(t)){let i=t.substr(4).substr(0,t.length-5).split(",");e={r:i[0],g:i[1],b:i[2],a:1}}else if(!0===wD.isValidRGBA(t)){let i=t.substr(5).substr(0,t.length-6).split(",");e={r:i[0],g:i[1],b:i[2],a:i[3]}}else if(!0===wD.isValidHex(t)){let i=wD.hexToRGB(t);e={r:i.r,g:i.g,b:i.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){let i=void 0!==t.a?t.a:"1.0";e={r:t.r,g:t.g,b:t.b,a:i}}if(void 0===e)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+du(t));this._setColor(e,i)}}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(){!0===(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.previousColor=wD.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",Fu(()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)},0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t){!0===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&(this.initialColor=wD.extend({},t)),this.color=t;let e=wD.RGBToHSV(t.r,t.g,t.b),i=2*Math.PI,n=this.r*e.s,o=this.centerCoordinates.x+n*Math.sin(i*e.h),s=this.centerCoordinates.y+n*Math.cos(i*e.h);this.colorPickerSelector.style.left=o-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=s-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){let e=wD.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;let i=wD.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.color,e=wD.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),Wu(i).call(i),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){var t,e,i,n;if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){let t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var o=this;this.opacityRange.onchange=function(){o._setOpacity(this.value)},this.opacityRange.oninput=function(){o._setOpacity(this.value)},this.brightnessRange.onchange=function(){o._setBrightness(this.value)},this.brightnessRange.oninput=function(){o._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=dl(t=this._hide).call(t,this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=dl(e=this._apply).call(e,this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=dl(i=this._save).call(i,this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=dl(n=this._loadLast).call(n,this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new _S(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),wS(this.hammer,t=>{this._moveSelector(t)}),this.hammer.on("tap",t=>{this._moveSelector(t)}),this.hammer.on("panstart",t=>{this._moveSelector(t)}),this.hammer.on("panmove",t=>{this._moveSelector(t)}),this.hammer.on("panend",t=>{this._moveSelector(t)})}_generateHueCircle(){if(!1===this.generated){let t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let e,i,n,o,s=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,s,r),this.centerCoordinates={x:.5*s,y:.5*r},this.r=.49*s;let a,l=2*Math.PI/360,h=1/360,d=1/this.r;for(n=0;n<360;n++)for(o=0;o3&&void 0!==arguments[3]?arguments[3]:1;this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},wD.extend(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new hT(n),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(aa(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==Pd(t)&&(this.options.filter=Pd(t)),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===Pd(this.options)&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let t=Pd(this.options),e=0,i=!1;for(let n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(n,[]),i=i||this._handleObject(this.configureOptions[n],[n],!0)):!0!==t&&-1===kc(t).call(t,n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t1?e-1:0),n=1;n{o.appendChild(t)}),this.domElements.push(o),this.domElements.length}return 0}_makeHeader(t){let e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerHTML=wD.xss(t),this._makeItem([],e)}_makeLabel(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+e.length,n.innerHTML=!0===i?wD.xss(""+t+":"):wD.xss(t+":"),n}_makeDropdown(t,e,i){let n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==kc(t).call(t,e)&&(o=kc(t).call(t,e));for(let e=0;es&&1!==s&&(a.max=Math.ceil(e*t),h=a.max,l="range increased"),a.value=e}else a.value=n;let d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=Number(a.value);var c=this;a.onchange=function(){d.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){d.value=this.value};let u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,d);""!==l&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){let t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){let t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=Fu(()=>{this.popupDiv.html.style.opacity=0},1500),this.popupDiv.deleteTimeout=Fu(()=>{this._removePopup()},1800)}}_makeCheckbox(t,e,i){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));let o=this;n.onchange=function(){o._update(this.checked,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeTextInput(t,e,i){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});let o=this;n.onchange=function(){o._update(this.value,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeColorField(t,e,i){let n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback(t=>{let n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)}),this.colorPicker.setCloseCallback(()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}})}_handleObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1,o=Pd(this.options),s=!1;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;n=!0;let a=t[r],l=wD.copyAndExtendArray(e,r);if("function"==typeof o&&(n=o(r,e),!1===n&&!aa(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==n){s=!0;let t=this._getValue(l);if(aa(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){let t=!0;if(-1!==kc(e).call(e,"physics")&&this.moduleOptions.physics.solver!==r&&(t=!1),!0===t)if(void 0!==a.enabled){let t=wD.copyAndExtendArray(l,"enabled"),e=this._getValue(t);if(!0===e){let t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}else this._makeCheckbox(a,e,l)}else{let t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}}else console.error("dont know how to handle",a,r,l)}}return s}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){let i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;ivar options = "+du(t,null,2)+""}getOptions(){let t={};for(var e=0;ec.timeAxis.step.scale,getStep:()=>c.timeAxis.step.step,toScreen:dl(a=c._toScreen).call(a,c),toGlobalScreen:dl(l=c._toGlobalScreen).call(l,c),toTime:dl(h=c._toTime).call(h,c),toGlobalTime:dl(d=c._toGlobalTime).call(d,c)}},this.range=new mS(this.body,this.options),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new kS(this.body,this.options),this.timeAxis2=null,this.components.push(this.timeAxis),this.currentTime=new VS(this.body,this.options),this.components.push(this.currentTime),this.itemSet=new qC(this.body,this.options),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,this.dom.root.onclick=t=>m("click",t),this.dom.root.ondblclick=t=>m("doubleClick",t),this.dom.root.oncontextmenu=t=>m("contextmenu",t),this.dom.root.onmouseover=t=>m("mouseOver",t),window.PointerEvent?(this.dom.root.onpointerdown=t=>m("mouseDown",t),this.dom.root.onpointermove=t=>m("mouseMove",t),this.dom.root.onpointerup=t=>m("mouseUp",t)):(this.dom.root.onmousemove=t=>m("mouseMove",t),this.dom.root.onmousedown=t=>m("mouseDown",t),this.dom.root.onmouseup=t=>m("mouseUp",t)),this.initialFitDone=!1,this.on("changed",()=>{if(null!=c.itemsData){if(!c.initialFitDone&&!c.options.rollingMode)if(c.initialFitDone=!0,null!=c.options.start||null!=c.options.end){if(null==c.options.start||null==c.options.end)var t=c.getItemRange();const e=null!=c.options.start?c.options.start:t.min,i=null!=c.options.end?c.options.end:t.max;c.setWindow(e,i,{animation:!1})}else c.fit({animation:!1});c.initialDrawDone||!c.initialRangeChangeDone&&(c.options.start||c.options.end)&&!c.options.rollingMode||(c.initialDrawDone=!0,c.itemSet.initialDrawDone=!0,c.dom.root.style.visibility="visible",c.dom.loadingScreen.parentNode.removeChild(c.dom.loadingScreen),c.options.onInitialDrawComplete&&Fu(()=>c.options.onInitialDrawComplete(),0))}}),this.on("destroyTimeline",()=>{c.destroy()}),n&&this.setOptions(n),this.body.emitter.on("fit",t=>{this._onFit(t),this.redraw()}),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}_createConfigurator(){return new dT(this,this.dom.container,aT)}redraw(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()}setOptions(t){if(!0===JC.validate(t,rT)&&console.log("%cErrors have been found in the supplied options object.",$C),BS.prototype.setOptions.call(this,t),"type"in t&&t.type!==this.options.type){this.options.type=t.type;const e=this.itemsData;if(e){const t=this.getSelection();this.setItems(null),this.setItems(e.rawDS),this.setSelection(t)}}}setItems(t){let e;this.itemsDone=!1,e=t?pD(t)?vD(t):vD(new Ek(t)):null,this.itemsData&&this.itemsData.dispose(),this.itemsData=e,this.itemSet&&this.itemSet.setItems(null!=e?e.rawDS:null)}setGroups(t){let e;const i=t=>!1!==t.visible;t?(aa(t)&&(t=new Ek(t)),e=new Pk(t,{filter:i})):e=null,null!=this.groupsData&&"function"==typeof this.groupsData.setData&&this.groupsData.setData(null),this.groupsData=e,this.itemSet.setGroups(e)}setData(t){t&&t.groups&&this.setGroups(t.groups),t&&t.items&&this.setItems(t.items)}setSelection(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)}getSelection(){return this.itemSet&&this.itemSet.getSelection()||[]}focus(t,e){if(!this.itemsData||null==t)return;const i=aa(t)?t:[t],n=this.itemsData.get(i);let o=null,s=null;if(Cl(n).call(n,t=>{const e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===o||es)&&(s=i)}),null!==o&&null!==s){const t=this,n=this.itemSet.items[i[0]];let r=-1*this._getScrollTop(),a=null;const l=(e,i,o)=>{const s=mT(t,n);if(!1===s)return;if(a||(a=s),a.itemTop==s.itemTop&&!a.shouldScroll)return;a.itemTop!=s.itemTop&&s.shouldScroll&&(a=s,r=-1*t._getScrollTop());const l=r,h=a.scrollOffset,d=o?h:l+(h-l)*e;t._setScrollTop(-d),i||t._redraw()},h=()=>{const e=mT(t,n);e.shouldScroll&&e.itemTop!=a.itemTop&&(t._setScrollTop(-e.scrollOffset),t._redraw())},d=()=>{h(),Fu(h,100)},c=!e||void 0===e.zoom||e.zoom,u=(o+s)/2,p=c?1.1*(s-o):Math.max(this.range.end-this.range.start,1.1*(s-o)),m=!e||void 0===e.animation||e.animation;m||(a={shouldScroll:!1,scrollOffset:-1,itemTop:-1}),this.range.stopRolling(),this.range.setRange(u-p/2,u+p/2,{animation:m},d,l)}}fit(t,e){const i=!t||void 0===t.animation||t.animation;let n;1===this.itemsData.length&&void 0===this.itemsData.get()[0].end?(n=this.getDataRange(),this.moveTo(n.min.valueOf(),{animation:i},e)):(n=this.getItemRange(),this.range.setRange(n.min,n.max,{animation:i},e))}getItemRange(){const t=this.getDataRange();let e=null!==t.min?t.min.valueOf():null,i=null!==t.max?t.max.valueOf():null,n=null,o=null;if(null!=e&&null!=i){let t=i-e;t<=0&&(t=10);const s=t/this.props.center.width,r={};let a=0;Cl(wD).call(wD,this.itemSet.items,(t,e)=>{if(t.groupShowing){const i=!0;r[e]=t.redraw(i),a=r[e].length}});if(a>0)for(let t=0;t{e[t]()});if(Cl(wD).call(wD,this.itemSet.items,t=>{const r=uT(t),a=pT(t);let l,h;this.options.rtl?(l=r-(t.getWidthRight()+10)*s,h=a+(t.getWidthLeft()+10)*s):(l=r-(t.getWidthLeft()+10)*s,h=a+(t.getWidthRight()+10)*s),li&&(i=h,o=t)}),n&&o){const s=n.getWidthLeft()+10,r=o.getWidthRight()+10,a=this.props.center.width-s-r;a>0&&(this.options.rtl?(e=uT(n)-r*t/a,i=pT(o)+s*t/a):(e=uT(n)-s*t/a,i=pT(o)+r*t/a))}}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}}getDataRange(){let t=null,e=null;var i;this.itemsData&&Cl(i=this.itemsData).call(i,i=>{const n=wD.convert(i.start,"Date").valueOf(),o=wD.convert(null!=i.end?i.end:i.start,"Date").valueOf();(null===t||ne)&&(e=o)});return{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}}getEventProperties(t){const e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,n=this.dom.centerContainer.getBoundingClientRect(),o=this.options.rtl?n.right-e:e-n.left,s=i-n.top,r=this.itemSet.itemFromTarget(t),a=this.itemSet.groupFromTarget(t),l=WS.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),c=this.body.util.getStep(),u=this._toTime(o),p=h?h(u,d,c):u,m=wD.getTarget(t);let f=null;return null!=r?f="item":null!=l?f="custom-time":wD.hasParent(m,this.timeAxis.dom.foreground)||this.timeAxis2&&wD.hasParent(m,this.timeAxis2.dom.foreground)?f="axis":wD.hasParent(m,this.itemSet.dom.labelSet)?f="group-label":wD.hasParent(m,this.currentTime.bar)?f="current-time":wD.hasParent(m,this.dom.center)&&(f="background"),{event:t,item:r?r.id:null,isCluster:!!r&&!!r.isCluster,items:r?r.items||[]:null,group:a?a.groupId:null,customTime:l?l.options.id:null,what:f,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:s,time:u,snappedTime:p}}toggleRollingMode(){this.range.rolling?this.range.stopRolling():(null==this.options.rollingMode&&this.setOptions(this.options),this.range.startRolling())}_redraw(){BS.prototype._redraw.call(this)}_onFit(t){const{start:e,end:i,animation:n}=t;i?this.range.setRange(e,i,{animation:n}):this.moveTo(e.valueOf(),{animation:n})}}function uT(t){return wD.convert(t.data.start,"Date").valueOf()}function pT(t){const e=null!=t.data.end?t.data.end:t.data.start;return wD.convert(e,"Date").valueOf()}function mT(t,e){if(!e.parent)return!1;const i=t.options.rtl?t.props.rightContainer.height:t.props.leftContainer.height,n=t.props.center.height,o=e.parent;let s=o.top,r=!0;const a=t.timeAxis.options.orientation.axis,l=()=>"bottom"==a?o.height-e.top-e.height:e.top,h=-1*t._getScrollTop(),d=s+l(),c=e.height;return dh+i?s+=l()+c-i+t.itemSet.options.margin.item.vertical:r=!1,s=Math.min(s,n-i),{shouldScroll:r,scrollOffset:s,itemTop:d}}class fT{constructor(t,e,i,n,o,s){let r=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=o,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=n,this.formattingFunction=a,i||n){const t=this,e=e=>{const i=e-e%(t.magnitudefactor*t.minorSteps[t.minorStepIdx]);return e%(t.magnitudefactor*t.minorSteps[t.minorStepIdx])>t.magnitudefactor*t.minorSteps[t.minorStepIdx]*.5?i+t.magnitudefactor*t.minorSteps[t.minorStepIdx]:i};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=e(this._start)),n&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=e(this._end)),this.determineScale()}}setCharHeight(t){this.majorCharHeight=t}setHeight(t){this.containerHeight=t}determineScale(){const t=this._end-this._start;this.scale=this.containerHeight/t;const e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);let n=0;i<0&&(n=i);let o=!1;for(let t=n;Math.abs(t)<=Math.abs(i);t++){this.magnitudefactor=Math.pow(10,t);for(let t=0;t=e){o=!0,this.minorStepIdx=t;break}}if(!0===o)break}}is_major(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])===0}getStep(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]}getFirstMajor(){const t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)}formatValue(t){let e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?"".concat(e):"string"==typeof e?e:t.toPrecision(5)}getLines(){const t=[],e=this.getStep(),i=(e-this._start%e)%e;for(let n=this._start+i;this._end-n>1e-5;n+=e)n!=this._start&&t.push({major:this.is_major(n),y:this.convertValue(n),val:this.formatValue(n)});return t}followScale(t){const e=this.minorStepIdx,i=this._start,n=this._end,o=this,s=()=>{o.magnitudefactor*=2},r=()=>{o.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdxn+1e-5)r(),h=!1;else{if(!this.autoScaleStart&&this._start=0)){r(),h=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&e"".concat(AD(t.toPrecision(3))),title:{text:void 0,style:void 0}},right:{range:{min:void 0,max:void 0},format:t=>"".concat(AD(t.toPrecision(3))),title:{text:void 0,style:void 0}}},this.linegraphOptions=n,this.linegraphSVG=i,this.props={},this.DOMelements={lines:{},labels:{},title:{}},this.dom={},this.scale=void 0,this.range={start:0,end:0},this.options=wD.extend({},this.defaultOptions),this.conversionFactor=1,this.setOptions(e),this.width=Number("".concat(this.options.width).replace("px","")),this.minWidth=this.width,this.height=this.linegraphSVG.getBoundingClientRect().height,this.hidden=!1,this.stepPixels=25,this.zeroCrossing=-1,this.amountOfSteps=-1,this.lineOffset=0,this.master=!0,this.masterAxis=null,this.svgElements={},this.iconsRemoved=!1,this.groups={},this.amountOfGroups=0,this._create(),null==this.scale&&this._redrawLabels(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups};const o=this;this.body.emitter.on("verticalDrag",()=>{o.dom.lineContainer.style.top="".concat(o.body.domProps.scrollTop,"px")})}addGroup(t,e){Object.prototype.hasOwnProperty.call(this.groups,t)||(this.groups[t]=e),this.amountOfGroups+=1}updateGroup(t,e){Object.prototype.hasOwnProperty.call(this.groups,t)||(this.amountOfGroups+=1),this.groups[t]=e}removeGroup(t){Object.prototype.hasOwnProperty.call(this.groups,t)&&(delete this.groups[t],this.amountOfGroups-=1)}setOptions(t){if(t){let e=!1;this.options.orientation!=t.orientation&&void 0!==t.orientation&&(e=!0);const i=["orientation","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","width","visible","left","right","alignZeros"];wD.selectiveDeepExtend(i,this.options,t),this.minWidth=Number("".concat(this.options.width).replace("px","")),!0===e&&this.dom.frame&&(this.hide(),this.show())}}_create(){this.dom.frame=document.createElement("div"),this.dom.frame.style.width=this.options.width,this.dom.frame.style.height=this.height,this.dom.lineContainer=document.createElement("div"),this.dom.lineContainer.style.width="100%",this.dom.lineContainer.style.height=this.height,this.dom.lineContainer.style.position="relative",this.dom.lineContainer.style.visibility="visible",this.dom.lineContainer.style.display="block",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.height="100%",this.svg.style.width="100%",this.svg.style.display="block",this.dom.frame.appendChild(this.svg)}_redrawGroupIcons(){let t;Mf(this.svgElements);const e=this.options.iconWidth;let i=11.5;t="left"===this.options.orientation?4:this.width-e-4;const n=Ea(this.groups);Mx(n).call(n,(t,e)=>t{const i=t.y,n=t.major;this.options.showMinorLabels&&!1===n&&this._redrawLabel(i-2,t.val,e,"vis-y-axis vis-minor",this.props.minorCharHeight),n&&i>=0&&this._redrawLabel(i-2,t.val,e,"vis-y-axis vis-major",this.props.majorCharHeight),!0===this.master&&(n?this._redrawLine(i,e,"vis-grid vis-horizontal vis-major",this.options.majorLinesOffset,this.props.majorLineWidth):this._redrawLine(i,e,"vis-grid vis-horizontal vis-minor",this.options.minorLinesOffset,this.props.minorLineWidth))});let r=0;void 0!==this.options[e].title&&void 0!==this.options[e].title.text&&(r=this.props.titleCharHeight);const a=!0===this.options.icons?Math.max(this.options.iconWidth,r)+this.options.labelOffsetX+15:r+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-a&&!0===this.options.visible?(this.width=this.maxLabelSize+a,this.options.width="".concat(this.width,"px"),Of(this.DOMelements.lines),Of(this.DOMelements.labels),this.redraw(),t=!0):this.maxLabelSizethis.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+a),this.options.width="".concat(this.width,"px"),Of(this.DOMelements.lines),Of(this.DOMelements.labels),this.redraw(),t=!0):(Of(this.DOMelements.lines),Of(this.DOMelements.labels),t=!1),t}convertValue(t){return this.scale.convertValue(t)}screenToValue(t){return this.scale.screenToValue(t)}_redrawLabel(t,e,i,n,o){const s=If("div",this.DOMelements.labels,this.dom.frame);s.className=n,s.innerHTML=wD.xss(e),"left"===i?(s.style.left="-".concat(this.options.labelOffsetX,"px"),s.style.textAlign="right"):(s.style.right="-".concat(this.options.labelOffsetX,"px"),s.style.textAlign="left"),s.style.top="".concat(t-.5*o+this.options.labelOffsetY,"px"),e+="";const r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize0&&(i=Math.min(i,Math.abs(e[n-1].screen_x-e[n].screen_x))),0===i&&(void 0===t[e[n].screen_x]&&(t[e[n].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[n].screen_x].amount+=1)},yT._getSafeDrawData=function(t,e,i){var n,o;return t0?(n=t0){Mx(t).call(t,function(t,e){return t.screen_x===e.screen_x?t.groupIde[s].screen_y?e[s].screen_y:n,o=ot[r].accumulatedNegative?t[r].accumulatedNegative:n)>t[r].accumulatedPositive?t[r].accumulatedPositive:n,o=(o=o0){return 1==e.options.interpolation.enabled?_T._catmullRom(t,e):_T._linear(t)}},_T.drawIcon=function(t,e,i,n,o,s){var r,a,l=.5*o,h=Pf("rect",s.svgElements,s.svg);(h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i-l),h.setAttributeNS(null,"width",n),h.setAttributeNS(null,"height",2*l),h.setAttributeNS(null,"class","vis-outline"),(r=Pf("path",s.svgElements,s.svg)).setAttributeNS(null,"class",t.className),void 0!==t.style&&r.setAttributeNS(null,"style",t.style),r.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+n)+","+i),1==t.options.shaded.enabled&&(a=Pf("path",s.svgElements,s.svg),"top"==t.options.shaded.orientation?a.setAttributeNS(null,"d","M"+e+", "+(i-l)+"L"+e+","+i+" L"+(e+n)+","+i+" L"+(e+n)+","+(i-l)):a.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+l)+" L"+(e+n)+","+(i+l)+"L"+(e+n)+","+i),a.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&a.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled)&&Lf(e+.5*n,i,{style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className},s.svgElements,s.svg)},_T.drawShading=function(t,e,i,n){if(1==e.options.shaded.enabled){var o,s=Number(n.svg.style.height.replace("px","")),r=Pf("path",n.svgElements,n.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var l=0;l="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),o="group"==e.options.shaded.orientation&&null!=i&&null!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+l+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",o)}},_T.draw=function(t,e,i){if(null!=t&&null!=t){var n=Pf("path",i.svgElements,i.svg);n.setAttributeNS(null,"class",e.className),void 0!==e.style&&n.setAttributeNS(null,"style",e.style);var o="L";1==e.options.interpolation.enabled&&(o="C"),n.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,o,!1))}},_T.serializePath=function(t,e,i){if(t.length<2)return"";var n,o=e;if(i)for(n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(n=1;n0&&(m=1/m),(f=3*g*(g+v))>0&&(f=1/f),a={screen_x:(-y*n.screen_x+u*o.screen_x+_*s.screen_x)*m,screen_y:(-y*n.screen_y+u*o.screen_y+_*s.screen_y)*m},l={screen_x:(b*o.screen_x+p*s.screen_x-y*r.screen_x)*f,screen_y:(b*o.screen_y+p*s.screen_y-y*r.screen_y)*f},0==a.screen_x&&0==a.screen_y&&(a=o),0==l.screen_x&&0==l.screen_y&&(l=s),x.push([a.screen_x,a.screen_y]),x.push([l.screen_x,l.screen_y]),x.push([s.screen_x,s.screen_y]);return x},_T._linear=function(t){for(var e=[],i=0;ie.x?1:-1})):this.itemsData=[]},wT.prototype.getItems=function(){return this.itemsData},wT.prototype.setZeroPosition=function(t){this.zeroPosition=t},wT.prototype.setOptions=function(t){if(void 0!==t){wD.selectiveDeepExtend(["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"],this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),wD.mergeOptions(this.options,t,"interpolation"),wD.mergeOptions(this.options,t,"drawPoints"),wD.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==typeof t.interpolation&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},wT.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},wT.prototype.getLegend=function(t,e,i,n,o){null!=i&&null!=i||(i={svg:document.createElementNS("http://www.w3.org/2000/svg","svg"),svgElements:{},options:this.options,groups:[this]});switch(null!=n&&null!=n||(n=0),null!=o&&null!=o||(o=.5*e),this.options.style){case"line":_T.drawIcon(this,n,o,t,e,i);break;case"points":case"point":vT.drawIcon(this,n,o,t,e,i);break;case"bar":yT.drawIcon(this,n,o,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},wT.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,n=0;nt[n].y?t[n].y:e,i=i");this.dom.textArea.innerHTML=wD.xss(s),this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},xT.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Ea(this.groups);Mx(t).call(t,function(t,e){return t0){var r={};for(this._getRelevantData(s,r,n,o),this._applySampling(s,r),e=0;e0)switch(t.options.style){case"line":Object.prototype.hasOwnProperty.call(l,s[e])||(l[s[e]]=_T.calcPath(r[s[e]],t)),_T.draw(l[s[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||vT.draw(r[s[e]],t,this.framework)}}}return Of(this.svgElements),!1},DT.prototype._stack=function(t,e){var i,n,o,s,r;i=0;for(var a=0;at[a].x){r=e[l],s=0==l?r:e[l-1],i=l;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),n=r.x-s.x,o=r.y-s.y,t[a].y=0==n?t[a].orginalY+r.y:t[a].orginalY+o/n*(t[a].x-s.x)+s.y}},DT.prototype._getRelevantData=function(t,e,i,n){var o,s,r,a;if(t.length>0)for(s=0;s0)for(var i=0;i0){var o,s=n.length,r=s/(this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x));o=Math.min(Math.ceil(.2*s),Math.max(1,Math.round(r)));for(var a=new Array(s),l=0;l0){for(s=0;s0&&(o=this.groups[t[s]],!0===r.stack&&"bar"===r.style?"left"===r.yAxisOrientation?a=vd(a).call(a,n):l=vd(l).call(l,n):i[t[s]]=o.getYRange(n,t[s]));yT.getStackedYRange(a,i,t,"__barStackLeft","left"),yT.getStackedYRange(l,i,t,"__barStackRight","right")}},DT.prototype._updateYAxis=function(t,e){var i,n,o=!1,s=!1,r=!1,a=1e9,l=1e9,h=-1e9,d=-1e9;if(t.length>0){for(var c=0;ci?i:a,h=hi?i:l,d=du.timeAxis.step.scale,getStep:()=>u.timeAxis.step.step,toScreen:dl(a=u._toScreen).call(a,u),toGlobalScreen:dl(l=u._toGlobalScreen).call(l,u),toTime:dl(h=u._toTime).call(h,u),toGlobalTime:dl(d=u._toGlobalTime).call(d,u)}},this.range=new mS(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new kS(this.body),this.components.push(this.timeAxis),this.currentTime=new VS(this.body),this.components.push(this.currentTime),this.linegraph=new DT(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",function(t){u.emit("click",u.getEventProperties(t))}),this.on("doubletap",function(t){u.emit("doubleClick",u.getEventProperties(t))}),this.dom.root.oncontextmenu=function(t){u.emit("contextmenu",u.getEventProperties(t))},this.initialFitDone=!1,this.on("changed",function(){if(null!=u.itemsData){if(!u.initialFitDone&&!u.options.rollingMode)if(u.initialFitDone=!0,null!=u.options.start||null!=u.options.end){if(null==u.options.start||null==u.options.end)var t=u.getItemRange();var e=null!=u.options.start?u.options.start:t.min,i=null!=u.options.end?u.options.end:t.max;u.setWindow(e,i,{animation:!1})}else u.fit({animation:!1});u.initialDrawDone||!u.initialRangeChangeDone&&(u.options.start||u.options.end)&&!u.options.rollingMode||(u.initialDrawDone=!0,u.dom.root.style.visibility="visible",u.dom.loadingScreen.parentNode.removeChild(u.dom.loadingScreen),u.options.onInitialDrawComplete&&Fu(()=>u.options.onInitialDrawComplete(),0))}}),n&&this.setOptions(n),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}LT.prototype=new BS,LT.prototype.setOptions=function(t){!0===JC.validate(t,PT)&&console.log("%cErrors have been found in the supplied options object.",$C),BS.prototype.setOptions.call(this,t)},LT.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?pD(t)?vD(t):vD(new Ek(t)):null,this.itemsData&&this.itemsData.dispose(),this.itemsData=e,this.linegraph&&this.linegraph.setItems(null!=e?e.rawDS:null),i)if(null!=this.options.start||null!=this.options.end){var n=null!=this.options.start?this.options.start:null,o=null!=this.options.end?this.options.end:null;this.setWindow(n,o,{animation:!1})}else this.fit({animation:!1})},LT.prototype.setGroups=function(t){var e;e=t?pD(t)?t:new Ek(t):null,this.groupsData=e,this.linegraph.setGroups(e)},LT.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},LT.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},LT.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(Object.prototype.hasOwnProperty.call(this.linegraph.groups,i)&&!0===this.linegraph.groups[i].visible)for(var n=0;ns?s:t,e=null==e||e0&&h.push(d.screenToValue(o)),!c.hidden&&this.itemsData.length>0&&h.push(c.screenToValue(o)),{event:t,customTime:r?r.options.id:null,what:l,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:n,y:o,time:s,value:h}},LT.prototype._createConfigurator=function(){return new dT(this,this.dom.container,IT)};const NT=Af();Nk.locale(NT);const AT={Core:BS,DateUtil:pS,Range:mS,stack:yC,TimeStep:xS,components:{items:{Item:kC,BackgroundItem:TC,BoxItem:DC,ClusterItem:WC,PointItem:SC,RangeItem:CC},BackgroundGroup:xC,Component:FD,CurrentTime:VS,CustomTime:WS,DataAxis:gT,DataScale:fT,GraphGroup:wT,Group:wC,ItemSet:qC,Legend:xT,LineGraph:DT,TimeAxis:kS}};t.DOMutil=Gf,t.DataSet=Ek,t.DataView=Pk,t.Graph2d=LT,t.Hammer=_S,t.Queue=Tk,t.Timeline=cT,t.keycharm=SS,t.moment=Nk,t.timeline=AT,t.util=Tf});
+//# sourceMappingURL=vis-timeline-graph2d.min.js.map
diff --git a/claude_code_log/html/renderer.py b/claude_code_log/html/renderer.py
index 92900896..1ebaa80e 100644
--- a/claude_code_log/html/renderer.py
+++ b/claude_code_log/html/renderer.py
@@ -1582,6 +1582,27 @@ def _generate_inner(
self._output_dir = output_dir
self._image_counter = 0
+ # Vendored timeline assets (issue #278), fully offline either way:
+ # - With an output directory, drop vis-timeline's JS/CSS into a
+ # sibling ``assets/`` dir once and point the template at the
+ # relative path (small pages; the multi-file default).
+ # - Without an output directory (bare-string render, e.g. the
+ # ``generate_html`` convenience API), there is nowhere to put a
+ # sidecar, so inline the JS/CSS directly into the page so a
+ # single self-contained file still has a working timeline.
+ timeline_asset_base: Optional[str] = None
+ timeline_inline_js: Optional[str] = None
+ timeline_inline_css: Optional[str] = None
+ if output_dir is not None:
+ from .utils import ensure_vendor_assets, VENDOR_ASSETS_DIRNAME
+
+ ensure_vendor_assets(output_dir)
+ timeline_asset_base = VENDOR_ASSETS_DIRNAME
+ else:
+ from .utils import read_vendor_timeline_inline
+
+ timeline_inline_js, timeline_inline_css = read_vendor_timeline_inline()
+
if not title:
title = "Claude Transcript"
@@ -1634,6 +1655,9 @@ def _generate_inner(
is_session_header=is_session_header,
page_info=page_info,
page_stats=page_stats,
+ timeline_asset_base=timeline_asset_base,
+ timeline_inline_js=timeline_inline_js,
+ timeline_inline_css=timeline_inline_css,
)
)
diff --git a/claude_code_log/html/templates/components/timeline.html b/claude_code_log/html/templates/components/timeline.html
index b68766db..b07668b5 100644
--- a/claude_code_log/html/templates/components/timeline.html
+++ b/claude_code_log/html/templates/components/timeline.html
@@ -10,6 +10,15 @@
+{# Inline vis-timeline (issue #278) only when there is no output directory
+ to hold a sidecar — keeps a bare-string / single-file render's timeline
+ working offline. The content is our own vendored asset, not transcript
+ data, and its {{ timeline_inline_css | safe }}
+
+{%- endif %}
+
`` tag. The current
+ vendored build contains none, but a future upgrade might; this makes
+ the inline path safe regardless. Cached because the 530 KB read
+ would otherwise repeat on every string render.
+ """
+ src_dir = _vendor_source_dir()
+ js = (src_dir / "vis-timeline-graph2d.min.js").read_text(encoding="utf-8")
+ css = (src_dir / "vis-timeline-graph2d.min.css").read_text(encoding="utf-8")
+ js = js.replace("
+
+
+
+
+
+
+
+
+
'
+_INLINE_VIS_CSS_PATTERN = r''
+_INLINE_VIS_JS_REPLACEMENT = (
+ ''
+)
+_INLINE_VIS_CSS_REPLACEMENT = (
+ ''
+)
+
class NormalisedMarkdownSerializer(AmberSnapshotExtension):
"""
@@ -77,4 +92,19 @@ def _normalise_html(cls, html: str) -> str:
html,
)
+ # Collapse the inlined vis-timeline library (issue #278) so its
+ # ~530 KB of third-party bytes don't bloat or churn the snapshots.
+ html = re.sub(
+ _INLINE_VIS_JS_PATTERN,
+ _INLINE_VIS_JS_REPLACEMENT,
+ html,
+ flags=re.DOTALL,
+ )
+ html = re.sub(
+ _INLINE_VIS_CSS_PATTERN,
+ _INLINE_VIS_CSS_REPLACEMENT,
+ html,
+ flags=re.DOTALL,
+ )
+
return html