b&&(b=h),k=v*v*w,T=Math.max(b/k,k/x),T>E){v-=h;break}E=T}s.push(u={value:v,dice:m ha))l.moveTo(0,0);else if(v>Mg-ha)l.moveTo(m*Lf(g),m*nc(g)),l.arc(0,0,m,g,y,!x),p>ha&&(l.moveTo(p*Lf(y),p*nc(y)),l.arc(0,0,p,y,g,x));else{var b=g,T=y,E=g,w=y,k=v,C=v,D=s.apply(this,arguments)/2,R=D>ha&&(n?+n.apply(this,arguments):e0(p*p+m*m)),O=_5(k9(m-p)/2,+r.apply(this,arguments)),L=O,S=O,A,_;if(R>ha){var N=S9(R/p*nc(D)),M=S9(R/m*nc(D));(k-=N*2)>ha?(N*=x?1:-1,E+=N,w-=N):(k=0,E=w=(g+y)/2),(C-=M*2)>ha?(M*=x?1:-1,b+=M,T-=M):(C=0,b=T=(g+y)/2)}var P=m*Lf(b),B=m*nc(b),F=p*Lf(w),G=p*nc(w);if(O>ha){var $=m*Lf(T),V=m*nc(T),K=p*Lf(E),ee=p*nc(E),H;if(v b&&(b=h),k=v*v*w,T=Math.max(b/k,k/x),T>E){v-=h;break}E=T}s.push(u={value:v,dice:m0;){if(h=N2(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function ec(){var t=ix();return t.copy=function(){return g5(t,ec())},_f.apply(t,arguments),vRe(t)}var MZ=I(()=>{"use strict";Tf();t9();nx();NZ();o(vRe,"linearish");o(ec,"linear")});function n9(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(n9,"nice")});function Mn(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hMn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(i9.setTime(+a),a9.setTime(+s),t(i9),t(a9),Math.floor(r(i9,a9))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}var i9,a9,hh=I(()=>{"use strict";i9=new Date,a9=new Date;o(Mn,"timeInterval")});var jc,OZ,s9=I(()=>{"use strict";hh();jc=Mn(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);jc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Mn(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):jc);OZ=jc.range});var No,PZ,o9=I(()=>{"use strict";hh();No=Mn(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),PZ=No.range});var fh,xRe,y5,bRe,l9=I(()=>{"use strict";hh();fh=Mn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),xRe=fh.range,y5=Mn(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),bRe=y5.range});var dh,TRe,v5,wRe,c9=I(()=>{"use strict";hh();dh=Mn(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),TRe=dh.range,v5=Mn(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),wRe=v5.range});var ll,kRe,sx,SRe,x5,ERe,u9=I(()=>{"use strict";hh();ll=Mn(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),kRe=ll.range,sx=Mn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),SRe=sx.range,x5=Mn(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),ERe=x5.range});function Kp(t){return Mn(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function Qp(t){return Mn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var tc,Df,b5,T5,Kc,w5,k5,FZ,CRe,ARe,_Re,DRe,RRe,LRe,Zp,Rg,$Z,zZ,Rf,GZ,VZ,qZ,NRe,MRe,IRe,ORe,PRe,BRe,h9=I(()=>{"use strict";hh();o(Kp,"timeWeekday");tc=Kp(0),Df=Kp(1),b5=Kp(2),T5=Kp(3),Kc=Kp(4),w5=Kp(5),k5=Kp(6),FZ=tc.range,CRe=Df.range,ARe=b5.range,_Re=T5.range,DRe=Kc.range,RRe=w5.range,LRe=k5.range;o(Qp,"utcWeekday");Zp=Qp(0),Rg=Qp(1),$Z=Qp(2),zZ=Qp(3),Rf=Qp(4),GZ=Qp(5),VZ=Qp(6),qZ=Zp.range,NRe=Rg.range,MRe=$Z.range,IRe=zZ.range,ORe=Rf.range,PRe=GZ.range,BRe=VZ.range});var ph,FRe,S5,$Re,f9=I(()=>{"use strict";hh();ph=Mn(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),FRe=ph.range,S5=Mn(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),$Re=S5.range});var Mo,zRe,rc,GRe,d9=I(()=>{"use strict";hh();Mo=Mn(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Mo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Mn(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});zRe=Mo.range,rc=Mn(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());rc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Mn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});GRe=rc.range});function WZ(t,e,r,n,i,a){let s=[[No,1,1e3],[No,5,5*1e3],[No,15,15*1e3],[No,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=f{"use strict";Tf();s9();o9();l9();c9();u9();h9();f9();d9();o(WZ,"ticker");[qRe,URe]=WZ(rc,S5,Zp,x5,v5,y5),[p9,m9]=WZ(Mo,ph,tc,ll,dh,fh)});var E5=I(()=>{"use strict";s9();o9();l9();c9();u9();h9();f9();d9();HZ()});function g9(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function y9(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ox(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function v9(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,s=t.shortDays,l=t.months,u=t.shortMonths,h=lx(i),f=cx(i),d=lx(a),p=cx(a),m=lx(s),g=cx(s),y=lx(l),v=cx(l),x=lx(u),b=cx(u),T={a:P,A:B,b:F,B:G,c:null,d:ZZ,e:ZZ,f:dLe,g:kLe,G:ELe,H:uLe,I:hLe,j:fLe,L:nJ,m:pLe,M:mLe,p:$,q:V,Q:tJ,s:rJ,S:gLe,u:yLe,U:vLe,V:xLe,w:bLe,W:TLe,x:null,X:null,y:wLe,Y:SLe,Z:CLe,"%":eJ},E={a:K,A:ee,b:H,B:he,c:null,d:JZ,e:JZ,f:RLe,g:zLe,G:VLe,H:ALe,I:_Le,j:DLe,L:aJ,m:LLe,M:NLe,p:Z,q:de,Q:tJ,s:rJ,S:MLe,u:ILe,U:OLe,V:PLe,w:BLe,W:FLe,x:null,X:null,y:$Le,Y:GLe,Z:qLe,"%":eJ},w={a:O,A:L,b:S,B:A,c:_,d:KZ,e:KZ,f:sLe,g:XZ,G:jZ,H:QZ,I:QZ,j:rLe,L:aLe,m:tLe,M:nLe,p:R,q:eLe,Q:lLe,s:cLe,S:iLe,u:XRe,U:KRe,V:QRe,w:jRe,W:ZRe,x:N,X:M,y:XZ,Y:jZ,Z:JRe,"%":oLe};T.x=k(r,T),T.X=k(n,T),T.c=k(e,T),E.x=k(r,E),E.X=k(n,E),E.c=k(e,E);function k(re,ne){return function(te){var Q=[],le=-1,J=0,ge=re.length,ie,Te,j;for(te instanceof Date||(te=new Date(+te));++le{"use strict";e1();Wg();o(YMe,"copyObject");gl=YMe});function jMe(t,e){for(var r=-1,n=Array(t);++r
"},r),nt.lineBreakRegex.test(t)))return t;let n=t.split(" ").filter(Boolean),i=[],a="";return n.forEach((s,l)=>{let u=ma(`${s} `,r),h=ma(a,r);if(u>e){let{hyphenatedStrings:p,remainingWord:m}=OIe(s,e,"-",r);i.push(a,...p),a=m}else h+u>=e?(i.push(a),a=s):a=[a,s].filter(Boolean).join(" ");l+1===n.length&&i.push(a)}),i.filter(s=>s!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),OIe=Vg((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);let i=[...t],a=[],s="";return i.forEach((l,u)=>{let h=`${s}${l}`;if(ma(h,n)>=e){let d=u+1,p=i.length===d,m=`${h}${r}`;a.push(p?h:m),s=""}else s=h}),{hyphenatedStrings:a,remainingWord:s}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);o(dk,"calculateTextHeight");o(ma,"calculateTextWidth");xN=Vg((t,e)=>{let{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};let[,a]=ru(r),s=["sans-serif",n],l=t.split(nt.lineBreakRegex),u=[],h=He("body");if(!h.remove)return{width:0,height:0,lineHeight:0};let f=h.append("svg");for(let p of s){let m=0,g={width:0,height:0,lineHeight:0};for(let y of l){let v=MIe();v.text=y||fN;let x=IIe(f,v).style("font-size",a).style("font-weight",i).style("font-family",p),b=(x._groups||x)[0][0].getBBox();if(b.width===0&&b.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,b.width)),m=Math.round(b.height),g.height+=m,g.lineHeight=Math.round(Math.max(g.lineHeight,m))}u.push(g)}f.remove();let d=isNaN(u[1].height)||isNaN(u[1].width)||isNaN(u[1].lineHeight)||u[0].height>u[1].height&&u[0].width>u[1].width&&u[0].lineHeight>u[1].lineHeight?0:1;return u[d]},(t,e)=>`${t}${e.fontSize}${e.fontWeight}${e.fontFamily}`),hN=class{constructor(e=!1,r){this.count=0;this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{o(this,"InitIDGenerator")}},PIe=o(function(t){return fk=fk||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),fk.innerHTML=t,unescape(fk.textContent)},"entityDecode");o(bN,"isDetailedError");BIe=o((t,e,r,n)=>{if(!n)return;let i=t.node()?.getBBox();i&&t.append("text").text(n).attr("text-anchor","middle").attr("x",i.x+i.width/2).attr("y",-r).attr("class",e)},"insertTitle"),ru=o(t=>{if(typeof t=="number")return[t,t+"px"];let e=parseInt(t??"",10);return Number.isNaN(e)?[void 0,void 0]:t===String(e)?[e,t+"px"]:[e,t]},"parseFontSize");o(Qn,"cleanAndMerge");jt={assignWithDepth:$n,wrapLabel:vN,calculateTextHeight:dk,calculateTextWidth:ma,calculateTextDimensions:xN,cleanAndMerge:Qn,detectInit:SIe,detectDirective:sre,isSubstringInArray:EIe,interpolateToCurve:dN,calcLabelPosition:DIe,calcCardinalityPosition:RIe,calcTerminalLabelPosition:LIe,formatUrl:CIe,getStylesFromArray:mN,generateId:gN,random:yN,runFunc:AIe,entityDecode:PIe,insertTitle:BIe,isLabelCoordinateInPath:FIe,parseFontSize:ru,InitIDGenerator:hN},cre=o(function(t){let e=t;return e=e.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),e=e.replace(/#\w+;/g,function(r){let n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"\uFB02\xB0\xB0"+n+"\xB6\xDF":"\uFB02\xB0"+n+"\xB6\xDF"}),e},"encodeEntities"),ga=o(function(t){return t.replace(/fl°°/g,"").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),nu=o((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");o(On,"handleUndefinedAttr");o(FIe,"isLabelCoordinateInPath")});function cc(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=vN(e[t].text,i,n),e[t].textLines=e[t].text.split(nt.lineBreakRegex).length,e[t].width=i,e[t].height=dk(e[t].text,n);else{let a=e[t].text.split(nt.lineBreakRegex);e[t].textLines=a.length;let s=0;e[t].height=0,e[t].width=0;for(let l of a)e[t].width=Math.max(ma(l,n),e[t].width),s=dk(l,n),e[t].height=e[t].height+s}}function pre(t,e,r,n,i){let a=new yk(i);a.data.widthLimit=r.data.widthLimit/Math.min(TN,n.length);for(let[s,l]of n.entries()){let u=0;l.image={width:0,height:0,Y:0},l.sprite&&(l.image.width=48,l.image.height=48,l.image.Y=u,u=l.image.Y+l.image.height);let h=l.wrap&&Xt.wrap,f=pk(Xt);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",cc("label",l,h,f,a.data.widthLimit),l.label.Y=u+8,u=l.label.Y+l.label.height,l.type&&l.type.text!==""){l.type.text="["+l.type.text+"]";let g=pk(Xt);cc("type",l,h,g,a.data.widthLimit),l.type.Y=u+5,u=l.type.Y+l.type.height}if(l.descr&&l.descr.text!==""){let g=pk(Xt);g.fontSize=g.fontSize-2,cc("descr",l,h,g,a.data.widthLimit),l.descr.Y=u+20,u=l.descr.Y+l.descr.height}if(s==0||s%TN===0){let g=r.data.startx+Xt.diagramMarginX,y=r.data.stopy+Xt.diagramMarginY+u;a.setData(g,g,y,y)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Xt.diagramMarginX:a.data.startx,y=a.data.starty;a.setData(g,g,y,y)}a.name=l.alias;let d=i.db.getC4ShapeArray(l.alias),p=i.db.getC4ShapeKeys(l.alias);p.length>0&&dre(a,t,d,p),e=l.alias;let m=i.db.getBoundaries(e);m.length>0&&pre(t,e,a,m,i),l.alias!=="global"&&fre(t,l,a),r.data.stopy=Math.max(a.data.stopy+Xt.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Xt.c4ShapeMargin,r.data.stopx),mk=Math.max(mk,r.data.stopx),gk=Math.max(gk,r.data.stopy)}}var mk,gk,hre,TN,Xt,yk,wN,zx,pk,$Ie,fre,dre,to,ure,zIe,GIe,VIe,kN,mre=I(()=>{"use strict";kr();uee();gt();sD();wr();gD();Qt();tg();sr();Fi();mk=0,gk=0,hre=4,TN=2;E2.yy=L2;Xt={},yk=class{static{o(this,"Bounds")}constructor(e){this.name="",this.data={},this.data.startx=void 0,this.data.stopx=void 0,this.data.starty=void 0,this.data.stopy=void 0,this.data.widthLimit=void 0,this.nextData={},this.nextData.startx=void 0,this.nextData.stopx=void 0,this.nextData.starty=void 0,this.nextData.stopy=void 0,this.nextData.cnt=0,wN(e.db.getConfig())}setData(e,r,n,i){this.nextData.startx=this.data.startx=e,this.nextData.stopx=this.data.stopx=r,this.nextData.starty=this.data.starty=n,this.nextData.stopy=this.data.stopy=i}updateVal(e,r,n,i){e[r]===void 0?e[r]=n:e[r]=i(n,e[r])}insert(e){this.nextData.cnt=this.nextData.cnt+1;let r=this.nextData.startx===this.nextData.stopx?this.nextData.stopx+e.margin:this.nextData.stopx+e.margin*2,n=r+e.width,i=this.nextData.starty+e.margin*2,a=i+e.height;(r>=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>hre)&&(r=this.nextData.startx+e.margin+Xt.nextLinePaddingX,i=this.nextData.stopy+e.margin*2,this.nextData.stopx=n=r+e.width,this.nextData.starty=this.nextData.stopy,this.nextData.stopy=a=i+e.height,this.nextData.cnt=1),e.x=r,e.y=i,this.updateVal(this.data,"startx",r,Math.min),this.updateVal(this.data,"starty",i,Math.min),this.updateVal(this.data,"stopx",n,Math.max),this.updateVal(this.data,"stopy",a,Math.max),this.updateVal(this.nextData,"startx",r,Math.min),this.updateVal(this.nextData,"starty",i,Math.min),this.updateVal(this.nextData,"stopx",n,Math.max),this.updateVal(this.nextData,"stopy",a,Math.max)}init(e){this.name="",this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,widthLimit:void 0},this.nextData={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0,cnt:0},wN(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},wN=o(function(t){$n(Xt,t),t.fontFamily&&(Xt.personFontFamily=Xt.systemFontFamily=Xt.messageFontFamily=t.fontFamily),t.fontSize&&(Xt.personFontSize=Xt.systemFontSize=Xt.messageFontSize=t.fontSize),t.fontWeight&&(Xt.personFontWeight=Xt.systemFontWeight=Xt.messageFontWeight=t.fontWeight)},"setConf"),zx=o((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),pk=o(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),$Ie=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");o(cc,"calcC4ShapeTextWH");fre=o(function(t,e,r){e.x=r.data.startx,e.y=r.data.starty,e.width=r.data.stopx-r.data.startx,e.height=r.data.stopy-r.data.starty,e.label.y=Xt.c4ShapeMargin-35;let n=e.wrap&&Xt.wrap,i=pk(Xt);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=ma(e.label.text,i);cc("label",e,n,i,a),sc.drawBoundary(t,e,Xt)},"drawBoundary"),dre=o(function(t,e,r,n){let i=0;for(let a of n){i=0;let s=r[a],l=zx(Xt,s.typeC4Shape.text);switch(l.fontSize=l.fontSize-2,s.typeC4Shape.width=ma("\xAB"+s.typeC4Shape.text+"\xBB",l),s.typeC4Shape.height=l.fontSize+2,s.typeC4Shape.Y=Xt.c4ShapePadding,i=s.typeC4Shape.Y+s.typeC4Shape.height-4,s.image={width:0,height:0,Y:0},s.typeC4Shape.text){case"person":case"external_person":s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height;break}s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=i,i=s.image.Y+s.image.height);let u=s.wrap&&Xt.wrap,h=Xt.width-Xt.c4ShapePadding*2,f=zx(Xt,s.typeC4Shape.text);if(f.fontSize=f.fontSize+2,f.fontWeight="bold",cc("label",s,u,f,h),s.label.Y=i+8,i=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let m=zx(Xt,s.typeC4Shape.text);cc("type",s,u,m,h),s.type.Y=i+5,i=s.type.Y+s.type.height}else if(s.techn&&s.techn.text!==""){s.techn.text="["+s.techn.text+"]";let m=zx(Xt,s.techn.text);cc("techn",s,u,m,h),s.techn.Y=i+5,i=s.techn.Y+s.techn.height}let d=i,p=s.label.width;if(s.descr&&s.descr.text!==""){let m=zx(Xt,s.typeC4Shape.text);cc("descr",s,u,m,h),s.descr.Y=i+20,i=s.descr.Y+s.descr.height,p=Math.max(s.label.width,s.descr.width),d=i-s.descr.textLines*5}p=p+Xt.c4ShapePadding,s.width=Math.max(s.width||Xt.width,p,Xt.width),s.height=Math.max(s.height||Xt.height,d,Xt.height),s.margin=s.margin||Xt.c4ShapeMargin,t.insert(s),sc.drawC4Shape(e,s,Xt)}t.bumpLastMargin(Xt.c4ShapeMargin)},"drawC4ShapeArray"),to=class{static{o(this,"Point")}constructor(e,r){this.x=e,this.y=r}},ure=o(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,s=r+t.width/2,l=n+t.height/2,u=Math.abs(r-i),h=Math.abs(n-a),f=h/u,d=t.height/t.width,p=null;return n==a&&ri?p=new to(r,l):r==i&&na&&(p=new to(s,n)),r>i&&n=f?p=new to(r,l+f*t.width/2):p=new to(s-u/h*t.height/2,n+t.height):r=f?p=new to(r+t.width,l+f*t.width/2):p=new to(s+u/h*t.height/2,n+t.height):ra?d>=f?p=new to(r+t.width,l-f*t.width/2):p=new to(s+t.height/2*u/h,n):r>i&&n>a&&(d>=f?p=new to(r,l-t.width/2*f):p=new to(s-t.height/2*u/h,n)),p},"getIntersectPoint"),zIe=o(function(t,e){let r={x:0,y:0};r.x=e.x+e.width/2,r.y=e.y+e.height/2;let n=ure(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=ure(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),GIe=o(function(t,e,r,n){let i=0;for(let a of e){i=i+1;let s=a.wrap&&Xt.wrap,l=$Ie(Xt);n.db.getC4Type()==="C4Dynamic"&&(a.label.text=i+": "+a.label.text);let h=ma(a.label.text,l);cc("label",a,s,l,h),a.techn&&a.techn.text!==""&&(h=ma(a.techn.text,l),cc("techn",a,s,l,h)),a.descr&&a.descr.text!==""&&(h=ma(a.descr.text,l),cc("descr",a,s,l,h));let f=r(a.from),d=r(a.to),p=zIe(f,d);a.startPoint=p.startPoint,a.endPoint=p.endPoint}sc.drawRels(t,e,Xt)},"drawRels");o(pre,"drawInsideBoundary");VIe=o(function(t,e,r,n){Xt=xe().c4;let i=xe().securityLevel,a;i==="sandbox"&&(a=He("#i"+e));let s=i==="sandbox"?He(a.nodes()[0].contentDocument.body):He("body"),l=n.db;n.db.setWrap(Xt.wrap),hre=l.getC4ShapeInRow(),TN=l.getC4BoundaryInRow(),X.debug(`C:${JSON.stringify(Xt,null,2)}`);let u=i==="sandbox"?s.select(`[id="${e}"]`):He(`[id="${e}"]`);sc.insertComputerIcon(u),sc.insertDatabaseIcon(u),sc.insertClockIcon(u);let h=new yk(n);h.setData(Xt.diagramMarginX,Xt.diagramMarginX,Xt.diagramMarginY,Xt.diagramMarginY),h.data.widthLimit=screen.availWidth,mk=Xt.diagramMarginX,gk=Xt.diagramMarginY;let f=n.db.getTitle(),d=n.db.getBoundaries("");pre(u,"",h,d,n),sc.insertArrowHead(u),sc.insertArrowEnd(u),sc.insertArrowCrossHead(u),sc.insertArrowFilledHead(u),GIe(u,n.db.getRels(),n.db.getC4Shape,n),h.data.stopx=mk,h.data.stopy=gk;let p=h.data,g=p.stopy-p.starty+2*Xt.diagramMarginY,v=p.stopx-p.startx+2*Xt.diagramMarginX;f&&u.append("text").text(f).attr("x",(p.stopx-p.startx)/2-4*Xt.diagramMarginX).attr("y",p.starty+Xt.diagramMarginY),Sn(u,g,v,Xt.useMaxWidth);let x=f?60:0;u.attr("viewBox",p.startx-Xt.diagramMarginX+" -"+(Xt.diagramMarginY+x)+" "+v+" "+(g+x)),X.debug("models:",p)},"draw"),kN={drawPersonOrSystemArray:dre,drawBoundary:fre,setConf:wN,draw:VIe}});var qIe,gre,yre=I(()=>{"use strict";qIe=o(t=>`.person {
+`},"getStyles"),SX=o((t,e)=>{e!==void 0&&(Pw[t]=e)},"addStylesForDiagram"),CX=q8e});var $2={};vr($2,{clear:()=>_r,getAccDescription:()=>Br,getAccTitle:()=>Or,getDiagramTitle:()=>Fr,setAccDescription:()=>Pr,setAccTitle:()=>Lr,setDiagramTitle:()=>zr});var kD,ED,SD,CD,_r,Lr,Or,Pr,Br,zr,Fr,si=O(()=>{"use strict";Ur();$r();kD="",ED="",SD="",CD=o(t=>wr(t,Zt()),"sanitizeText"),_r=o(()=>{kD="",SD="",ED=""},"clear"),Lr=o(t=>{kD=CD(t).replace(/^\s+/g,"")},"setAccTitle"),Or=o(()=>kD,"getAccTitle"),Pr=o(t=>{SD=CD(t).replace(/\n\s+/g,`
+`)},"setAccDescription"),Br=o(()=>SD,"getAccDescription"),zr=o(t=>{ED=CD(t)},"setDiagramTitle"),Fr=o(()=>ED,"getDiagramTitle")});var AX,U8e,ve,z2,Fw,G2,_D,W8e,Bw,$p,V2,AD,jt=O(()=>{"use strict";Fp();xt();$r();Ur();Ti();wD();si();AX=K,U8e=h2,ve=Zt,z2=ew,Fw=vf,G2=o(t=>wr(t,ve()),"sanitizeText"),_D=Kc,W8e=o(()=>$2,"getCommonDb"),Bw={},$p=o((t,e,r)=>{Bw[t]&&AX.warn(`Diagram with id ${t} already registered. Overwriting.`),Bw[t]=e,r&&bD(t,r),SX(t,e.styles),e.injectUtils?.(AX,U8e,ve,G2,_D,W8e(),()=>{})},"registerDiagram"),V2=o(t=>{if(t in Bw)return Bw[t];throw new AD(t)},"getDiagram"),AD=class extends Error{static{o(this,"DiagramNotFoundError")}constructor(e){super(`Diagram ${e} not found.`)}}});var ec,Ef,As,Jl,Qc,q2,DD,RD,$w,zw,_X,H8e,Y8e,j8e,X8e,K8e,Q8e,Z8e,J8e,eDe,tDe,rDe,nDe,iDe,aDe,sDe,oDe,lDe,DX,cDe,uDe,RX,hDe,fDe,dDe,pDe,Sf,mDe,gDe,yDe,vDe,xDe,U2,LD=O(()=>{"use strict";jt();Ur();si();ec=[],Ef=[""],As="global",Jl="",Qc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],q2=[],DD="",RD=!1,$w=4,zw=2,H8e=o(function(){return _X},"getC4Type"),Y8e=o(function(t){_X=wr(t,ve())},"setC4Type"),j8e=o(function(t,e,r,n,i,a,s,l,u){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let h={},f=q2.find(d=>d.from===e&&d.to===r);if(f?h=f:q2.push(h),h.type=t,h.from=e,h.to=r,h.label={text:n},i==null)h.techn={text:""};else if(typeof i=="object"){let[d,p]=Object.entries(i)[0];h[d]={text:p}}else h.techn={text:i};if(a==null)h.descr={text:""};else if(typeof a=="object"){let[d,p]=Object.entries(a)[0];h[d]={text:p}}else h.descr={text:a};if(typeof s=="object"){let[d,p]=Object.entries(s)[0];h[d]=p}else h.sprite=s;if(typeof l=="object"){let[d,p]=Object.entries(l)[0];h[d]=p}else h.tags=l;if(typeof u=="object"){let[d,p]=Object.entries(u)[0];h[d]=p}else h.link=u;h.wrap=Sf()},"addRel"),X8e=o(function(t,e,r,n,i,a,s){if(e===null||r===null)return;let l={},u=ec.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,ec.push(l)),r==null?l.label={text:""}:l.label={text:r},n==null)l.descr={text:""};else if(typeof n=="object"){let[h,f]=Object.entries(n)[0];l[h]={text:f}}else l.descr={text:n};if(typeof i=="object"){let[h,f]=Object.entries(i)[0];l[h]=f}else l.sprite=i;if(typeof a=="object"){let[h,f]=Object.entries(a)[0];l[h]=f}else l.tags=a;if(typeof s=="object"){let[h,f]=Object.entries(s)[0];l[h]=f}else l.link=s;l.typeC4Shape={text:t},l.parentBoundary=As,l.wrap=Sf()},"addPersonOrSystem"),K8e=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ec.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ec.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=Sf(),u.typeC4Shape={text:t},u.parentBoundary=As},"addContainer"),Q8e=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=ec.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,ec.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.techn={text:""};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.techn={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof a=="object"){let[f,d]=Object.entries(a)[0];u[f]=d}else u.sprite=a;if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.wrap=Sf(),u.typeC4Shape={text:t},u.parentBoundary=As},"addComponent"),Z8e=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=Qc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Qc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=As,a.wrap=Sf(),Jl=As,As=t,Ef.push(Jl)},"addPersonOrSystemBoundary"),J8e=o(function(t,e,r,n,i){if(t===null||e===null)return;let a={},s=Qc.find(l=>l.alias===t);if(s&&t===s.alias?a=s:(a.alias=t,Qc.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[l,u]=Object.entries(r)[0];a[l]={text:u}}else a.type={text:r};if(typeof n=="object"){let[l,u]=Object.entries(n)[0];a[l]=u}else a.tags=n;if(typeof i=="object"){let[l,u]=Object.entries(i)[0];a[l]=u}else a.link=i;a.parentBoundary=As,a.wrap=Sf(),Jl=As,As=t,Ef.push(Jl)},"addContainerBoundary"),eDe=o(function(t,e,r,n,i,a,s,l){if(e===null||r===null)return;let u={},h=Qc.find(f=>f.alias===e);if(h&&e===h.alias?u=h:(u.alias=e,Qc.push(u)),r==null?u.label={text:""}:u.label={text:r},n==null)u.type={text:"node"};else if(typeof n=="object"){let[f,d]=Object.entries(n)[0];u[f]={text:d}}else u.type={text:n};if(i==null)u.descr={text:""};else if(typeof i=="object"){let[f,d]=Object.entries(i)[0];u[f]={text:d}}else u.descr={text:i};if(typeof s=="object"){let[f,d]=Object.entries(s)[0];u[f]=d}else u.tags=s;if(typeof l=="object"){let[f,d]=Object.entries(l)[0];u[f]=d}else u.link=l;u.nodeType=t,u.parentBoundary=As,u.wrap=Sf(),Jl=As,As=e,Ef.push(Jl)},"addDeploymentNode"),tDe=o(function(){As=Jl,Ef.pop(),Jl=Ef.pop(),Ef.push(Jl)},"popBoundaryParseStack"),rDe=o(function(t,e,r,n,i,a,s,l,u,h,f){let d=ec.find(p=>p.alias===e);if(!(d===void 0&&(d=Qc.find(p=>p.alias===e),d===void 0))){if(r!=null)if(typeof r=="object"){let[p,m]=Object.entries(r)[0];d[p]=m}else d.bgColor=r;if(n!=null)if(typeof n=="object"){let[p,m]=Object.entries(n)[0];d[p]=m}else d.fontColor=n;if(i!=null)if(typeof i=="object"){let[p,m]=Object.entries(i)[0];d[p]=m}else d.borderColor=i;if(a!=null)if(typeof a=="object"){let[p,m]=Object.entries(a)[0];d[p]=m}else d.shadowing=a;if(s!=null)if(typeof s=="object"){let[p,m]=Object.entries(s)[0];d[p]=m}else d.shape=s;if(l!=null)if(typeof l=="object"){let[p,m]=Object.entries(l)[0];d[p]=m}else d.sprite=l;if(u!=null)if(typeof u=="object"){let[p,m]=Object.entries(u)[0];d[p]=m}else d.techn=u;if(h!=null)if(typeof h=="object"){let[p,m]=Object.entries(h)[0];d[p]=m}else d.legendText=h;if(f!=null)if(typeof f=="object"){let[p,m]=Object.entries(f)[0];d[p]=m}else d.legendSprite=f}},"updateElStyle"),nDe=o(function(t,e,r,n,i,a,s){let l=q2.find(u=>u.from===e&&u.to===r);if(l!==void 0){if(n!=null)if(typeof n=="object"){let[u,h]=Object.entries(n)[0];l[u]=h}else l.textColor=n;if(i!=null)if(typeof i=="object"){let[u,h]=Object.entries(i)[0];l[u]=h}else l.lineColor=i;if(a!=null)if(typeof a=="object"){let[u,h]=Object.entries(a)[0];l[u]=parseInt(h)}else l.offsetX=parseInt(a);if(s!=null)if(typeof s=="object"){let[u,h]=Object.entries(s)[0];l[u]=parseInt(h)}else l.offsetY=parseInt(s)}},"updateRelStyle"),iDe=o(function(t,e,r){let n=$w,i=zw;if(typeof e=="object"){let a=Object.values(e)[0];n=parseInt(a)}else n=parseInt(e);if(typeof r=="object"){let a=Object.values(r)[0];i=parseInt(a)}else i=parseInt(r);n>=1&&($w=n),i>=1&&(zw=i)},"updateLayoutConfig"),aDe=o(function(){return $w},"getC4ShapeInRow"),sDe=o(function(){return zw},"getC4BoundaryInRow"),oDe=o(function(){return As},"getCurrentBoundaryParse"),lDe=o(function(){return Jl},"getParentBoundaryParse"),DX=o(function(t){return t==null?ec:ec.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),cDe=o(function(t){return ec.find(e=>e.alias===t)},"getC4Shape"),uDe=o(function(t){return Object.keys(DX(t))},"getC4ShapeKeys"),RX=o(function(t){return t==null?Qc:Qc.filter(e=>e.parentBoundary===t)},"getBoundaries"),hDe=RX,fDe=o(function(){return q2},"getRels"),dDe=o(function(){return DD},"getTitle"),pDe=o(function(t){RD=t},"setWrap"),Sf=o(function(){return RD},"autoWrap"),mDe=o(function(){ec=[],Qc=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Jl="",As="global",Ef=[""],q2=[],Ef=[""],DD="",RD=!1,$w=4,zw=2},"clear"),gDe={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25},yDe={FILLED:0,OPEN:1},vDe={LEFTOF:0,RIGHTOF:1,OVER:2},xDe=o(function(t){DD=wr(t,ve())},"setTitle"),U2={addPersonOrSystem:X8e,addPersonOrSystemBoundary:Z8e,addContainer:K8e,addContainerBoundary:J8e,addComponent:Q8e,addDeploymentNode:eDe,popBoundaryParseStack:tDe,addRel:j8e,updateElStyle:rDe,updateRelStyle:nDe,updateLayoutConfig:iDe,autoWrap:Sf,setWrap:pDe,getC4ShapeArray:DX,getC4Shape:cDe,getC4ShapeKeys:uDe,getBoundaries:RX,getBoundarys:hDe,getCurrentBoundaryParse:oDe,getParentBoundaryParse:lDe,getRels:fDe,getTitle:dDe,getC4Type:H8e,getC4ShapeInRow:aDe,getC4BoundaryInRow:sDe,setAccTitle:Lr,getAccTitle:Or,getAccDescription:Br,setAccDescription:Pr,getConfig:o(()=>ve().c4,"getConfig"),clear:mDe,LINETYPE:gDe,ARROWTYPE:yDe,PLACEMENT:vDe,setTitle:xDe,setC4Type:Y8e}});function zp(t,e){return t==null||e==null?NaN:t0)for(var r=new Array(i),n=0,i,a;n{"use strict";XX()});var Xw,UD,WD=O(()=>{"use strict";Xw="http://www.w3.org/1999/xhtml",UD={svg:"http://www.w3.org/2000/svg",xhtml:Xw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Zc(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),UD.hasOwnProperty(e)?{space:UD[e],local:t}:t}var Kw=O(()=>{"use strict";WD();o(Zc,"default")});function BDe(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Xw&&e.documentElement.namespaceURI===Xw?e.createElement(t):e.createElementNS(r,t)}}function FDe(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function H2(t){var e=Zc(t);return(e.local?FDe:BDe)(e)}var HD=O(()=>{"use strict";Kw();WD();o(BDe,"creatorInherit");o(FDe,"creatorFixed");o(H2,"default")});function $De(){}function Af(t){return t==null?$De:function(){return this.querySelector(t)}}var Qw=O(()=>{"use strict";o($De,"none");o(Af,"default")});function YD(t){typeof t!="function"&&(t=Af(t));for(var e=this._groups,r=e.length,n=new Array(r),i=0;i{"use strict";tc();o(oR,"default")});function lR(){for(var t=this._groups,e=-1,r=t.length;++e0;){if(h=W2(s,l,r),h===u)return n[i]=s,n[a]=l,e(n);if(h>0)s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h;else if(h<0)s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h;else break;u=h}return t},t}function sc(){var t=yx();return t.copy=function(){return D5(t,sc())},Mf.apply(t,arguments),t9e(t)}var dJ=O(()=>{"use strict";Cf();g9();gx();fJ();o(t9e,"linearish");o(sc,"linear")});function v9(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],s;return a{"use strict";o(v9,"nice")});function In(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return o(i,"interval"),i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{let s=i(a),l=i.ceil(a);return a-s0))return u;let h;do u.push(h=new Date(+a)),e(a,l),t(a);while(hIn(s=>{if(s>=s)for(;t(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;e(s,-1),!a(s););else for(;--l>=0;)for(;e(s,1),!a(s););}),r&&(i.count=(a,s)=>(x9.setTime(+a),b9.setTime(+s),t(x9),t(b9),Math.floor(r(x9,b9))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}var x9,b9,gh=O(()=>{"use strict";x9=new Date,b9=new Date;o(In,"timeInterval")});var ru,mJ,T9=O(()=>{"use strict";gh();ru=In(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);ru.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?In(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):ru);mJ=ru.range});var $o,gJ,w9=O(()=>{"use strict";gh();$o=In(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*1e3)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds()),gJ=$o.range});var yh,r9e,R5,n9e,k9=O(()=>{"use strict";gh();yh=In(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getMinutes()),r9e=yh.range,R5=In(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*6e4)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes()),n9e=R5.range});var vh,i9e,L5,a9e,E9=O(()=>{"use strict";gh();vh=In(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*1e3-t.getMinutes()*6e4)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getHours()),i9e=vh.range,L5=In(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*36e5)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours()),a9e=L5.range});var gl,s9e,xx,o9e,N5,l9e,S9=O(()=>{"use strict";gh();gl=In(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1),s9e=gl.range,xx=In(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1),o9e=xx.range,N5=In(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5)),l9e=N5.range});function Jp(t){return In(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}function e0(t){return In(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/6048e5)}var oc,If,M5,I5,iu,O5,P5,vJ,c9e,u9e,h9e,f9e,d9e,p9e,t0,Bg,xJ,bJ,Of,TJ,wJ,kJ,m9e,g9e,y9e,v9e,x9e,b9e,C9=O(()=>{"use strict";gh();o(Jp,"timeWeekday");oc=Jp(0),If=Jp(1),M5=Jp(2),I5=Jp(3),iu=Jp(4),O5=Jp(5),P5=Jp(6),vJ=oc.range,c9e=If.range,u9e=M5.range,h9e=I5.range,f9e=iu.range,d9e=O5.range,p9e=P5.range;o(e0,"utcWeekday");t0=e0(0),Bg=e0(1),xJ=e0(2),bJ=e0(3),Of=e0(4),TJ=e0(5),wJ=e0(6),kJ=t0.range,m9e=Bg.range,g9e=xJ.range,y9e=bJ.range,v9e=Of.range,x9e=TJ.range,b9e=wJ.range});var xh,T9e,B5,w9e,A9=O(()=>{"use strict";gh();xh=In(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth()),T9e=xh.range,B5=In(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth()),w9e=B5.range});var zo,k9e,lc,E9e,_9=O(()=>{"use strict";gh();zo=In(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());zo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:In(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});k9e=zo.range,lc=In(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());lc.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:In(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});E9e=lc.range});function SJ(t,e,r,n,i,a){let s=[[$o,1,1e3],[$o,5,5*1e3],[$o,15,15*1e3],[$o,30,30*1e3],[a,1,6e4],[a,5,5*6e4],[a,15,15*6e4],[a,30,30*6e4],[i,1,36e5],[i,3,3*36e5],[i,6,6*36e5],[i,12,12*36e5],[n,1,864e5],[n,2,2*864e5],[r,1,6048e5],[e,1,2592e6],[e,3,3*2592e6],[t,1,31536e6]];function l(h,f,d){let p=f