var Et=Object.defineProperty;var Ct=(n,e,t)=>e in n?Et(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var p=(n,e,t)=>(Ct(n,typeof e!="symbol"?e+"":e,t),t);import{d as Z,x as Dt,o as A,a as j,g as R,f as z,u as D,j as Tt,e as T,t as F,p as Qe,y as et,q as he,s as de,_ as ue,z as Ae,c as I,r as V,b as K,F as Ce,i as De,n as tt,A as it,k as st,w as se,B as Le,l as Rt,v as Mt,h as B,C as kt}from"./index-ByA9DPlo.js";import{t as v,g as L,m as ce,h as fe,i as Ht,j as Se,k as Nt,l as zt,s as oe,n as rt,o as Ot,q as Pt,r as nt,v as Lt,w as Xe,x as At,y as Ve,z as St,A as ze,D as It,C as ot,F as at,p as lt,G as ht,P as dt,H as Wt,a as ut,b as ct,I as Bt,J as Te,K as Ft,O as Yt,f as Ut,Q as $t,S as Gt,L as qt,T as Qt,c as Xt,d as Vt,N as te,M as jt,R as Kt,E as ie,B as Zt,$ as Jt,u as ei,e as ti,W as Oe}from"./flowbite-vue-DLGmfvqf.js";function Re(n,e){const t=v(n);return isNaN(e)?L(n,NaN):(e&&t.setDate(t.getDate()+e),t)}function Ie(n,e){const t=v(n);if(isNaN(e))return L(n,NaN);if(!e)return t;const i=t.getDate(),s=L(n,t.getTime());s.setMonth(t.getMonth()+e+1,0);const r=s.getDate();return i>=r?s:(t.setFullYear(s.getFullYear(),s.getMonth(),i),t)}function Me(n,e){const t=+v(n);return L(n,t+e)}function ii(n,e){return Me(n,e*ce)}function si(n,e){return Me(n,e*fe)}function ri(n,e){const t=e*3;return Ie(n,t)}function ni(n,e){return Me(n,e*1e3)}function oi(n,e){const t=e*7;return Re(n,t)}function ai(n,e){return Ie(n,e*12)}function ne(n,e){const t=v(n),i=v(e),s=t.getTime()-i.getTime();return s<0?-1:s>0?1:s}function li(n,e){const t=v(n),i=v(e),s=t.getFullYear()-i.getFullYear(),r=t.getMonth()-i.getMonth();return s*12+r}function hi(n,e){const t=v(n),i=v(e);return t.getFullYear()-i.getFullYear()}function ft(n,e){const t=v(n),i=v(e),s=je(t,i),r=Math.abs(Ht(t,i));t.setDate(t.getDate()-s*r);const o=+(je(t,i)===-s),a=s*(r-o);return a===0?0:a}function je(n,e){const t=n.getFullYear()-e.getFullYear()||n.getMonth()-e.getMonth()||n.getDate()-e.getDate()||n.getHours()-e.getHours()||n.getMinutes()-e.getMinutes()||n.getSeconds()-e.getSeconds()||n.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function ge(n){return e=>{const i=(n?Math[n]:Math.trunc)(e);return i===0?0:i}}function ke(n,e){return+v(n)-+v(e)}function di(n,e,t){const i=ke(n,e)/ce;return ge(t==null?void 0:t.roundingMethod)(i)}function ui(n,e,t){const i=ke(n,e)/fe;return ge(t==null?void 0:t.roundingMethod)(i)}function gt(n){const e=v(n);return e.setHours(23,59,59,999),e}function pt(n){const e=v(n),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function ci(n){const e=v(n);return+gt(e)==+pt(e)}function mt(n,e){const t=v(n),i=v(e),s=ne(t,i),r=Math.abs(li(t,i));let o;if(r<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-s*r);let a=ne(t,i)===-s;ci(v(n))&&r===1&&ne(n,i)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function fi(n,e,t){const i=mt(n,e)/3;return ge(t==null?void 0:t.roundingMethod)(i)}function gi(n,e,t){const i=ke(n,e)/1e3;return ge(t==null?void 0:t.roundingMethod)(i)}function pi(n,e,t){const i=ft(n,e)/7;return ge(t==null?void 0:t.roundingMethod)(i)}function mi(n,e){const t=v(n),i=v(e),s=ne(t,i),r=Math.abs(hi(t,i));t.setFullYear(1584),i.setFullYear(1584);const o=ne(t,i)===-s,a=s*(r-+o);return a===0?0:a}function yi(n){const e=v(n);return e.setSeconds(0,0),e}function _i(n){const e=v(n),t=e.getMonth(),i=t-t%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}function wi(n){const e=v(n);return e.setDate(1),e.setHours(0,0,0,0),e}function bi(n){const e=v(n),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function vi(n){const e=v(n);return e.setMinutes(59,59,999),e}function xi(n,e){var a,l;const t=Se(),i=t.weekStartsOn??((l=(a=t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=v(n),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function Ei(n){const e=v(n);return e.setSeconds(59,999),e}function Ci(n){const e=v(n),t=e.getMonth(),i=t-t%3+3;return e.setMonth(i,0),e.setHours(23,59,59,999),e}function Di(n){const e=v(n);return e.setMilliseconds(999),e}function Ti(){return Object.assign({},Se())}function Ri(n){let t=v(n).getDay();return t===0&&(t=7),t}function Mi(n,e){const t=e instanceof Date?L(e,0):new e(0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),t}const ki=10;class yt{constructor(){p(this,"subPriority",0)}validate(e,t){return!0}}class Hi extends yt{constructor(e,t,i,s,r){super(),this.value=e,this.validateValue=t,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,i){return this.setValue(e,t,this.value,i)}}class Ni extends yt{constructor(){super(...arguments);p(this,"priority",ki);p(this,"subPriority",-1)}set(t,i){return i.timestampIsSet?t:L(t,Mi(t,Date))}}class C{run(e,t,i,s){const r=this.parse(e,t,i,s);return r?{setter:new Hi(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(e,t,i){return!0}}class zi extends C{constructor(){super(...arguments);p(this,"priority",140);p(this,"incompatibleTokens",["R","u","t","T"])}parse(t,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"});case"GGGGG":return s.era(t,{width:"narrow"});case"GGGG":default:return s.era(t,{width:"wide"})||s.era(t,{width:"abbreviated"})||s.era(t,{width:"narrow"})}}set(t,i,s){return i.era=s,t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}const O={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},G={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function P(n,e){return n&&{value:e(n.value),rest:n.rest}}function M(n,e){const t=e.match(n);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function q(n,e){const t=e.match(n);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};const i=t[1]==="+"?1:-1,s=t[2]?parseInt(t[2],10):0,r=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:i*(s*ce+r*fe+o*Nt),rest:e.slice(t[0].length)}}function _t(n){return M(O.anyDigitsSigned,n)}function H(n,e){switch(n){case 1:return M(O.singleDigit,e);case 2:return M(O.twoDigits,e);case 3:return M(O.threeDigits,e);case 4:return M(O.fourDigits,e);default:return M(new RegExp("^\\d{1,"+n+"}"),e)}}function ye(n,e){switch(n){case 1:return M(O.singleDigitSigned,e);case 2:return M(O.twoDigitsSigned,e);case 3:return M(O.threeDigitsSigned,e);case 4:return M(O.fourDigitsSigned,e);default:return M(new RegExp("^-?\\d{1,"+n+"}"),e)}}function We(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function wt(n,e){const t=e>0,i=t?e:1-e;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return t?s:1-s}function bt(n){return n%400===0||n%4===0&&n%100!==0}class Oi extends C{constructor(){super(...arguments);p(this,"priority",130);p(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return P(H(4,t),r);case"yo":return P(s.ordinalNumber(t,{unit:"year"}),r);default:return P(H(i.length,t),r)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,s){const r=t.getFullYear();if(s.isTwoDigitYear){const a=wt(s.year,r);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const o=!("era"in i)||i.era===1?s.year:1-s.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class Pi extends C{constructor(){super(...arguments);p(this,"priority",130);p(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return P(H(4,t),r);case"Yo":return P(s.ordinalNumber(t,{unit:"year"}),r);default:return P(H(i.length,t),r)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,s,r){const o=zt(t,r);if(s.isTwoDigitYear){const l=wt(s.year,o);return t.setFullYear(l,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),oe(t,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return t.setFullYear(a,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),oe(t,r)}}class Li extends C{constructor(){super(...arguments);p(this,"priority",130);p(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,i){return ye(i==="R"?4:i.length,t)}set(t,i,s){const r=L(t,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),rt(r)}}class Ai extends C{constructor(){super(...arguments);p(this,"priority",130);p(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,i){return ye(i==="u"?4:i.length,t)}set(t,i,s){return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class Si extends C{constructor(){super(...arguments);p(this,"priority",120);p(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,i,s){switch(i){case"Q":case"QQ":return H(i.length,t);case"Qo":return s.ordinalNumber(t,{unit:"quarter"});case"QQQ":return s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(t,{width:"wide",context:"formatting"})||s.quarter(t,{width:"abbreviated",context:"formatting"})||s.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=1&&i<=4}set(t,i,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Ii extends C{constructor(){super(...arguments);p(this,"priority",120);p(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,i,s){switch(i){case"q":case"qq":return H(i.length,t);case"qo":return s.ordinalNumber(t,{unit:"quarter"});case"qqq":return s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(t,{width:"wide",context:"standalone"})||s.quarter(t,{width:"abbreviated",context:"standalone"})||s.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=1&&i<=4}set(t,i,s){return t.setMonth((s-1)*3,1),t.setHours(0,0,0,0),t}}class Wi extends C{constructor(){super(...arguments);p(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);p(this,"priority",110)}parse(t,i,s){const r=o=>o-1;switch(i){case"M":return P(M(O.month,t),r);case"MM":return P(H(2,t),r);case"Mo":return P(s.ordinalNumber(t,{unit:"month"}),r);case"MMM":return s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(t,{width:"wide",context:"formatting"})||s.month(t,{width:"abbreviated",context:"formatting"})||s.month(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}class Bi extends C{constructor(){super(...arguments);p(this,"priority",110);p(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,i,s){const r=o=>o-1;switch(i){case"L":return P(M(O.month,t),r);case"LL":return P(H(2,t),r);case"Lo":return P(s.ordinalNumber(t,{unit:"month"}),r);case"LLL":return s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(t,{width:"wide",context:"standalone"})||s.month(t,{width:"abbreviated",context:"standalone"})||s.month(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.setMonth(s,1),t.setHours(0,0,0,0),t}}function Fi(n,e,t){const i=v(n),s=Ot(i,t)-e;return i.setDate(i.getDate()-s*7),i}class Yi extends C{constructor(){super(...arguments);p(this,"priority",100);p(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,i,s){switch(i){case"w":return M(O.week,t);case"wo":return s.ordinalNumber(t,{unit:"week"});default:return H(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,s,r){return oe(Fi(t,s,r),r)}}function Ui(n,e){const t=v(n),i=Pt(t)-e;return t.setDate(t.getDate()-i*7),t}class $i extends C{constructor(){super(...arguments);p(this,"priority",100);p(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,i,s){switch(i){case"I":return M(O.week,t);case"Io":return s.ordinalNumber(t,{unit:"week"});default:return H(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,s){return rt(Ui(t,s))}}const Gi=[31,28,31,30,31,30,31,31,30,31,30,31],qi=[31,29,31,30,31,30,31,31,30,31,30,31];class Qi extends C{constructor(){super(...arguments);p(this,"priority",90);p(this,"subPriority",1);p(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,i,s){switch(i){case"d":return M(O.date,t);case"do":return s.ordinalNumber(t,{unit:"date"});default:return H(i.length,t)}}validate(t,i){const s=t.getFullYear(),r=bt(s),o=t.getMonth();return r?i>=1&&i<=qi[o]:i>=1&&i<=Gi[o]}set(t,i,s){return t.setDate(s),t.setHours(0,0,0,0),t}}class Xi extends C{constructor(){super(...arguments);p(this,"priority",90);p(this,"subpriority",1);p(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,i,s){switch(i){case"D":case"DD":return M(O.dayOfYear,t);case"Do":return s.ordinalNumber(t,{unit:"date"});default:return H(i.length,t)}}validate(t,i){const s=t.getFullYear();return bt(s)?i>=1&&i<=366:i>=1&&i<=365}set(t,i,s){return t.setMonth(0,s),t.setHours(0,0,0,0),t}}function Be(n,e,t){var h,f,g,y;const i=Se(),s=(t==null?void 0:t.weekStartsOn)??((f=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((y=(g=i.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??0,r=v(n),o=r.getDay(),l=(e%7+7)%7,u=7-s,c=e<0||e>6?e-(o+u)%7:(l+u)%7-(o+u)%7;return Re(r,c)}class Vi extends C{constructor(){super(...arguments);p(this,"priority",90);p(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,r){return t=Be(t,s,r),t.setHours(0,0,0,0),t}}class ji extends C{constructor(){super(...arguments);p(this,"priority",90);p(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return P(H(i.length,t),o);case"eo":return P(s.ordinalNumber(t,{unit:"day"}),o);case"eee":return s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeeee":return s.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,r){return t=Be(t,s,r),t.setHours(0,0,0,0),t}}class Ki extends C{constructor(){super(...arguments);p(this,"priority",90);p(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return P(H(i.length,t),o);case"co":return P(s.ordinalNumber(t,{unit:"day"}),o);case"ccc":return s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"ccccc":return s.day(t,{width:"narrow",context:"standalone"});case"cccccc":return s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(t,{width:"wide",context:"standalone"})||s.day(t,{width:"abbreviated",context:"standalone"})||s.day(t,{width:"short",context:"standalone"})||s.day(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=6}set(t,i,s,r){return t=Be(t,s,r),t.setHours(0,0,0,0),t}}function Zi(n,e){const t=v(n),i=Ri(t),s=e-i;return Re(t,s)}class Ji extends C{constructor(){super(...arguments);p(this,"priority",90);p(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return H(i.length,t);case"io":return s.ordinalNumber(t,{unit:"day"});case"iii":return P(s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return P(s.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return P(s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),r);case"iiii":default:return P(s.day(t,{width:"wide",context:"formatting"})||s.day(t,{width:"abbreviated",context:"formatting"})||s.day(t,{width:"short",context:"formatting"})||s.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,i){return i>=1&&i<=7}set(t,i,s){return t=Zi(t,s),t.setHours(0,0,0,0),t}}class es extends C{constructor(){super(...arguments);p(this,"priority",80);p(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(We(s),0,0,0),t}}class ts extends C{constructor(){super(...arguments);p(this,"priority",80);p(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(We(s),0,0,0),t}}class is extends C{constructor(){super(...arguments);p(this,"priority",80);p(this,"incompatibleTokens",["a","b","t","T"])}parse(t,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(t,{width:"wide",context:"formatting"})||s.dayPeriod(t,{width:"abbreviated",context:"formatting"})||s.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,s){return t.setHours(We(s),0,0,0),t}}class ss extends C{constructor(){super(...arguments);p(this,"priority",70);p(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,i,s){switch(i){case"h":return M(O.hour12h,t);case"ho":return s.ordinalNumber(t,{unit:"hour"});default:return H(i.length,t)}}validate(t,i){return i>=1&&i<=12}set(t,i,s){const r=t.getHours()>=12;return r&&s<12?t.setHours(s+12,0,0,0):!r&&s===12?t.setHours(0,0,0,0):t.setHours(s,0,0,0),t}}class rs extends C{constructor(){super(...arguments);p(this,"priority",70);p(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,i,s){switch(i){case"H":return M(O.hour23h,t);case"Ho":return s.ordinalNumber(t,{unit:"hour"});default:return H(i.length,t)}}validate(t,i){return i>=0&&i<=23}set(t,i,s){return t.setHours(s,0,0,0),t}}class ns extends C{constructor(){super(...arguments);p(this,"priority",70);p(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,i,s){switch(i){case"K":return M(O.hour11h,t);case"Ko":return s.ordinalNumber(t,{unit:"hour"});default:return H(i.length,t)}}validate(t,i){return i>=0&&i<=11}set(t,i,s){return t.getHours()>=12&&s<12?t.setHours(s+12,0,0,0):t.setHours(s,0,0,0),t}}class os extends C{constructor(){super(...arguments);p(this,"priority",70);p(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,i,s){switch(i){case"k":return M(O.hour24h,t);case"ko":return s.ordinalNumber(t,{unit:"hour"});default:return H(i.length,t)}}validate(t,i){return i>=1&&i<=24}set(t,i,s){const r=s<=24?s%24:s;return t.setHours(r,0,0,0),t}}class as extends C{constructor(){super(...arguments);p(this,"priority",60);p(this,"incompatibleTokens",["t","T"])}parse(t,i,s){switch(i){case"m":return M(O.minute,t);case"mo":return s.ordinalNumber(t,{unit:"minute"});default:return H(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,s){return t.setMinutes(s,0,0),t}}class ls extends C{constructor(){super(...arguments);p(this,"priority",50);p(this,"incompatibleTokens",["t","T"])}parse(t,i,s){switch(i){case"s":return M(O.second,t);case"so":return s.ordinalNumber(t,{unit:"second"});default:return H(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,s){return t.setSeconds(s,0),t}}class hs extends C{constructor(){super(...arguments);p(this,"priority",30);p(this,"incompatibleTokens",["t","T"])}parse(t,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return P(H(i.length,t),s)}set(t,i,s){return t.setMilliseconds(s),t}}class ds extends C{constructor(){super(...arguments);p(this,"priority",10);p(this,"incompatibleTokens",["t","T","x"])}parse(t,i){switch(i){case"X":return q(G.basicOptionalMinutes,t);case"XX":return q(G.basic,t);case"XXXX":return q(G.basicOptionalSeconds,t);case"XXXXX":return q(G.extendedOptionalSeconds,t);case"XXX":default:return q(G.extended,t)}}set(t,i,s){return i.timestampIsSet?t:L(t,t.getTime()-nt(t)-s)}}class us extends C{constructor(){super(...arguments);p(this,"priority",10);p(this,"incompatibleTokens",["t","T","X"])}parse(t,i){switch(i){case"x":return q(G.basicOptionalMinutes,t);case"xx":return q(G.basic,t);case"xxxx":return q(G.basicOptionalSeconds,t);case"xxxxx":return q(G.extendedOptionalSeconds,t);case"xxx":default:return q(G.extended,t)}}set(t,i,s){return i.timestampIsSet?t:L(t,t.getTime()-nt(t)-s)}}class cs extends C{constructor(){super(...arguments);p(this,"priority",40);p(this,"incompatibleTokens","*")}parse(t){return _t(t)}set(t,i,s){return[L(t,s*1e3),{timestampIsSet:!0}]}}class fs extends C{constructor(){super(...arguments);p(this,"priority",20);p(this,"incompatibleTokens","*")}parse(t){return _t(t)}set(t,i,s){return[L(t,s),{timestampIsSet:!0}]}}const gs={G:new zi,y:new Oi,Y:new Pi,R:new Li,u:new Ai,Q:new Si,q:new Ii,M:new Wi,L:new Bi,w:new Yi,I:new $i,d:new Qi,D:new Xi,E:new Vi,e:new ji,c:new Ki,i:new Ji,a:new es,b:new ts,B:new is,h:new ss,H:new rs,K:new ns,k:new os,m:new as,s:new ls,S:new hs,X:new ds,x:new us,t:new cs,T:new fs},ps=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ms=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ys=/^'([^]*?)'?$/,_s=/''/g,ws=/\S/,bs=/[a-zA-Z]/;function vs(n,e,t,i){var b,m,E,N,U,J,ee,Ue;const s=Ti(),r=(i==null?void 0:i.locale)??s.locale??Lt,o=(i==null?void 0:i.firstWeekContainsDate)??((m=(b=i==null?void 0:i.locale)==null?void 0:b.options)==null?void 0:m.firstWeekContainsDate)??s.firstWeekContainsDate??((N=(E=s.locale)==null?void 0:E.options)==null?void 0:N.firstWeekContainsDate)??1,a=(i==null?void 0:i.weekStartsOn)??((J=(U=i==null?void 0:i.locale)==null?void 0:U.options)==null?void 0:J.weekStartsOn)??s.weekStartsOn??((Ue=(ee=s.locale)==null?void 0:ee.options)==null?void 0:Ue.weekStartsOn)??0;if(e==="")return n===""?v(t):L(t,NaN);const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r},u=[new Ni],c=e.match(ms).map(x=>{const k=x[0];if(k in Xe){const $=Xe[k];return $(x,r.formatLong)}return x}).join("").match(ps),h=[];for(let x of c){!(i!=null&&i.useAdditionalWeekYearTokens)&&At(x)&&Ve(x,e,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&St(x)&&Ve(x,e,n);const k=x[0],$=gs[k];if($){const{incompatibleTokens:$e}=$;if(Array.isArray($e)){const Ge=h.find(qe=>$e.includes(qe.token)||qe.token===k);if(Ge)throw new RangeError(`The format string mustn't contain \`${Ge.fullToken}\` and \`${x}\` at the same time`)}else if($.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${x}\` and any other token at the same time`);h.push({token:k,fullToken:x});const Ne=$.run(n,x,r.match,l);if(!Ne)return L(t,NaN);u.push(Ne.setter),n=Ne.rest}else{if(k.match(bs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");if(x==="''"?x="'":k==="'"&&(x=xs(x)),n.indexOf(x)===0)n=n.slice(x.length);else return L(t,NaN)}}if(n.length>0&&ws.test(n))return L(t,NaN);const f=u.map(x=>x.priority).sort((x,k)=>k-x).filter((x,k,$)=>$.indexOf(x)===k).map(x=>u.filter(k=>k.priority===x).sort((k,$)=>$.subPriority-k.subPriority)).map(x=>x[0]);let g=v(t);if(isNaN(g.getTime()))return L(t,NaN);const y={};for(const x of f){if(!x.validate(g,l))return L(t,NaN);const k=x.set(g,y,l);Array.isArray(k)?(g=k[0],Object.assign(y,k[1])):g=k}return L(t,g)}function xs(n){return n.match(ys)[1].replace(_s,"'")}function Es(n){const e=v(n);return e.setMinutes(0,0,0),e}function Cs(n){const e=v(n);return e.setMilliseconds(0),e}function Ds(n,e){const t=(e==null?void 0:e.additionalDigits)??2,i=ks(n);let s;if(i.date){const l=Hs(i.date,t);s=Ns(l.restDateString,l.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const r=s.getTime();let o=0,a;if(i.time&&(o=zs(i.time),isNaN(o)))return new Date(NaN);if(i.timezone){if(a=Os(i.timezone),isNaN(a))return new Date(NaN)}else{const l=new Date(r+o),u=new Date(0);return u.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),u.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),u}return new Date(r+o+a)}const pe={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ts=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Rs=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Ms=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ks(n){const e={},t=n.split(pe.dateTimeDelimiter);let i;if(t.length>2)return e;if(/:/.test(t[0])?i=t[0]:(e.date=t[0],i=t[1],pe.timeZoneDelimiter.test(e.date)&&(e.date=n.split(pe.timeZoneDelimiter)[0],i=n.substr(e.date.length,n.length))),i){const s=pe.timezone.exec(i);s?(e.time=i.replace(s[1],""),e.timezone=s[1]):e.time=i}return e}function Hs(n,e){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=n.match(t);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Ns(n,e){if(e===null)return new Date(NaN);const t=n.match(Ts);if(!t)return new Date(NaN);const i=!!t[4],s=re(t[1]),r=re(t[2])-1,o=re(t[3]),a=re(t[4]),l=re(t[5])-1;if(i)return Is(e,a,l)?Ps(e,a,l):new Date(NaN);{const u=new Date(0);return!As(e,r,o)||!Ss(e,s)?new Date(NaN):(u.setUTCFullYear(e,r,Math.max(s,o)),u)}}function re(n){return n?parseInt(n):1}function zs(n){const e=n.match(Rs);if(!e)return NaN;const t=Pe(e[1]),i=Pe(e[2]),s=Pe(e[3]);return Ws(t,i,s)?t*ce+i*fe+s*1e3:NaN}function Pe(n){return n&&parseFloat(n.replace(",","."))||0}function Os(n){if(n==="Z")return 0;const e=n.match(Ms);if(!e)return 0;const t=e[1]==="+"?-1:1,i=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return Bs(i,s)?t*(i*ce+s*fe):NaN}function Ps(n,e,t){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(e-1)*7+t+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Ls=[31,null,31,30,31,30,31,31,30,31,30,31];function vt(n){return n%400===0||n%4===0&&n%100!==0}function As(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(Ls[e]||(vt(n)?29:28))}function Ss(n,e){return e>=1&&e<=(vt(n)?366:365)}function Is(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function Ws(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function Bs(n,e){return e>=0&&e<=59}const Fs=n=>(he("data-v-98fbf881"),n=n(),de(),n),Ys=Fs(()=>T("span",{class:"breadcrumb__item-text"},"Dashboard",-1)),Us={class:"breadcrumb__item-text"},$s={class:"breadcrumb__item-text"},Gs=Z({__name:"AppBreadcrumb",setup(n){const e=et(),t=e.params.runId,i=e.params.scenarioName;return(s,r)=>{const o=Dt("router-link");return A(),j(D(It),null,{default:R(()=>[z(D(ze),{class:"breadcrumb__item",home:"",href:"/dashboard"},{"home-icon":R(()=>[z(D(Tt),{icon:["fas","clone"],class:"breadcrumb__icon breadcrumb__item-text"})]),default:R(()=>[T("div",null,[z(o,{to:"/dashboard",class:"flex items-center"},{default:R(()=>[Ys]),_:1})])]),_:1}),D(t)?(A(),j(D(ze),{key:0,class:"breadcrumb__item"},{default:R(()=>[T("span",Us,"Cardamon Run ID: "+F(D(t)),1)]),_:1})):Qe("",!0),D(i)?(A(),j(D(ze),{key:1,class:"breadcrumb__item"},{default:R(()=>[T("span",$s,"Scenario ID: "+F(D(i)),1)]),_:1})):Qe("",!0)]),_:1})}}}),qs=ue(Gs,[["__scopeId","data-v-98fbf881"]]);function Qs(n,e,t,i,s){let r=(...o)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(n,o));return r.prototype=e.prototype,r}class d{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const r=i.getElementById(e);return r?[r]:[]}let s=t.querySelectorAll(e);return!s.length&&e[0]!=="."&&e[0]!=="#"&&(s=t.querySelectorAll("."+e),s.length||(s=t.querySelectorAll("#"+e))),Array.from(s)}return[e]}static getElement(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let s=t.querySelector(e);return i&&!s&&(s=i.getElementById(e)),s||(s=t.querySelector("."+e)),s}return e}static shouldSizeToContent(e,t=!1){return(e==null?void 0:e.grid)&&(t?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return d.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){let i=e.x>t.x?e.x:t.x,s=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(s<=i)return 0;let r=e.y>t.y?e.y:t.y,o=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return o<=r?0:(s-i)*(o-r)}static area(e){return e.w*e.h}static sort(e,t=1){return e.sort((s,r)=>{let o=t*((s.y??1e4)-(r.y??1e4));return o===0?t*((s.x??1e4)-(r.x??1e4)):o})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){let s=document.createElement("style");const r=i==null?void 0:i.nonce;return r&&(s.nonce=r),s.setAttribute("type","text/css"),s.setAttribute("gs-style-id",e),s.styleSheet?s.styleSheet.cssText="":s.appendChild(document.createTextNode("")),t?t.insertBefore(s,t.firstChild):(t=document.getElementsByTagName("head")[0],t.appendChild(s)),s.sheet}static removeStylesheet(e,t){let s=(t||document).querySelector("STYLE[gs-style-id="+e+"]");s&&s.parentNode&&s.remove()}static addCSSRule(e,t,i){typeof e.addRule=="function"?e.addRule(t,i):typeof e.insertRule=="function"&&e.insertRule(`${t}{${i}}`)}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{let s=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!s)throw new Error(`Invalid height val = ${e}`);i=s[2]||"px",t=parseFloat(s[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(const s in i){if(!i.hasOwnProperty(s))return;e[s]===null||e[s]===void 0?e[s]=i[s]:typeof i[s]=="object"&&typeof e[s]=="object"&&this.defaults(e[s],i[s])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object"))for(let i in e){let s=e[i];if(i[0]==="_"||s===t[i])delete e[i];else if(s&&typeof s=="object"&&t[i]!==void 0){for(let r in s)(s[r]===t[i][r]||r[0]==="_")&&delete s[r];Object.keys(s).length||delete e[i]}}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...s)=>{i||(i=!0,setTimeout(()=>{e(...s),i=!1},t))}}static removePositioningStyles(e){let t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const t=getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowY)?e:this.getScrollElement(e.parentElement)}static updateScrollPosition(e,t,i){let s=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>r){let o=s.bottom-r,a=s.top,l=this.getScrollElement(e);if(l!==null){let u=l.scrollTop;s.top<0&&i<0?e.offsetHeight>r?l.scrollTop+=i:l.scrollTop+=Math.abs(a)>Math.abs(i)?i:a:i>0&&(e.offsetHeight>r?l.scrollTop+=i:l.scrollTop+=o>i?i:o),t.top+=l.scrollTop-u}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t),r=s.clientHeight,o=s===this.getScrollElement()?0:s.getBoundingClientRect().top,a=e.clientY-o,l=a<i,u=a>r-i;l?s.scrollBy({behavior:"smooth",top:a-i}):u&&s.scrollBy({behavior:"smooth",top:i-(r-a)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const t=["parentGrid","el","grid","subGrid","engine"],i=d.clone(e);for(const s in i)i.hasOwnProperty(s)&&typeof i[s]=="object"&&s.substring(0,2)!=="__"&&!t.find(r=>r===s)&&(i[s]=d.cloneDeep(e[s]));return i}static cloneNode(e){const t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=d.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(const i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(s=>{e.style[i]=s}):e.style[i]=t[i])}static initEvent(e,t){const i={type:t.type},s={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return e.dataTransfer&&(i.dataTransfer=e.dataTransfer),["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>i[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>i[r]=e[r]),{...i,...s}}static simulateMouseEvent(e,t,i){const s=document.createEvent("MouseEvents");s.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,e.target),(i||e.target).dispatchEvent(s)}static getValuesFromTransformedElement(e){const t=document.createElement("div");d.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);const i=t.getBoundingClientRect();return e.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}}class Q{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.column=e.column||12,this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,s={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!s.nested&&!this.float&&this.swap(e,i))return!0;let r=t;this._useEntireRowArea(e,t)&&(r={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,r,s.skip));let o=!1,a={nested:!0,pack:!1};for(;i=i||this.collide(e,r,s.skip);){let l;if(i.locked||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,{...i,y:e.y},e)||!this.collide(i,{...i,y:t.y-i.h},e))?(e._skipDown=e._skipDown||t.y>e.y,l=this.moveNode(e,{...t,y:i.y+i.h,...a}),i.locked&&l?d.copyPos(t,e):!i.locked&&l&&s.pack&&(this._packNodes(),t.y=i.y+i.h,d.copyPos(e,t)),o=o||l):l=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...a}),!l)return o;i=void 0}return o}collide(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.find(o=>o._id!==s&&o._id!==r&&d.isIntercepted(o,t))}collideAll(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.filter(o=>o._id!==s&&o._id!==r&&d.isIntercepted(o,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let s=e._rect,r={...t.rect};r.y>s.y?(r.h+=r.y-s.y,r.y=s.y):r.h+=s.y-r.y,r.x>s.x?(r.w+=r.x-s.x,r.x=s.x):r.w+=s.x-r.x;let o,a=.5;for(let l of i){if(l.locked||!l._rect)break;let u=l._rect,c=Number.MAX_VALUE,h=Number.MAX_VALUE;s.y<u.y?c=(r.y+r.h-u.y)/u.h:s.y+s.h>u.y+u.h&&(c=(u.y+u.h-r.y)/u.h),s.x<u.x?h=(r.x+r.w-u.x)/u.w:s.x+s.w>u.x+u.w&&(h=(u.x+u.w-r.x)/u.w);let f=Math.min(h,c);f>a&&(a=f,o=l)}return t.collide=o,o}cacheRects(e,t,i,s,r,o){return this.nodes.forEach(a=>a._rect={y:a.y*t+i,x:a.x*e+o,w:a.w*e-o-s,h:a.h*t-i-r}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let r=t.x,o=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=r,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=o):(e.x=r,e.y=o),e._dirty=t._dirty=!0,!0}let s;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(s=d.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=d.isTouching(e,t)))){if(t.y<e.y){let r=e;e=t,t=r}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=d.isTouching(e,t)))){if(t.x<e.x){let r=e;e=t,t=r}return i()}return!1}}}isAreaEmpty(e,t,i,s){let r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const i=this.batchMode;i||this.batchUpdate();const s=this._inColumnResize;s||(this._inColumnResize=!0);let r=this.nodes;return this.nodes=[],r.forEach((o,a,l)=>{let u;o.locked||(o.autoPosition=!0,e==="list"&&a&&(u=l[a-1])),this.addNode(o,!1,u)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=d.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??Q._idSeq++,(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let i={x:0,y:0,w:1,h:1};return d.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,d.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=i.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=i.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=i.w),isNaN(e.h)&&(e.h=i.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||d.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w,e.maxW)),e.maxH&&(e.h=Math.min(e.h,e.maxH)),e.minW&&e.minW<=this.column&&(e.w=Math.max(e.w,e.minW)),e.minH&&(e.h=Math.max(e.h,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<12&&!this._inColumnResize&&e._id&&this.findCacheLayout(e,12)===-1){let r={...e};r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(11,r.x),r.w=Math.min(12,r.w||1),this.cacheOneLayout(r,12)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),d.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!d.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=d.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{d.samePos(e,e._orig)||(d.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){let r=s?s.y*i+(s.x+s.w):0,o=!1;for(let a=r;!o;++a){let l=a%i,u=Math.floor(a/i);if(l+e.w>i)continue;let c={x:l,y:u,w:e.w,h:e.h};t.find(h=>d.isIntercepted(c,h))||((e.x!==l||e.y!==u)&&(e._dirty=!0),e.x=l,e.y=u,delete e.autoPosition,o=!0)}return o}addNode(e,t=!1,i){let s=this.nodes.find(o=>o._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,r=!0),this.nodes.push(e),t&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(s=>s._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(s=>s._removeDOM=!0);const i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,s=new Q({column:this.column,float:this.float,nodes:this.nodes.map(o=>o._id===e._id?(i={...o},i):{...o})});if(!i)return!1;let r=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!t.resizing&&t.collide){let o=t.collide.el.gridstackNode;if(this.swap(e,o))return this._notify(),!0}return r?(s.nodes.filter(o=>o._dirty).forEach(o=>{let a=this.nodes.find(l=>l._id===o._id);a&&(d.copyPos(a,o),a._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new Q({column:this.column,float:this.float,nodes:this.nodes.map(s=>({...s}))}),i={...e};return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=d.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){var u,c;if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let s=e.w!==t.w||e.h!==t.h,r=d.copyPos({},e,!0);if(d.copyPos(r,t),this.nodeBoundFix(r,s),d.copyPos(t,r),!t.forceCollide&&d.samePos(e,t))return!1;let o=d.copyPos({},e),a=this.collideAll(e,r,t.skip),l=!0;if(a.length){let h=e._moving&&!t.nested,f=h?this.directionCollideCoverage(e,t,a):a[0];if(h&&f&&((c=(u=e.grid)==null?void 0:u.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){let g=d.areaIntercept(t.rect,f._rect),y=d.area(t.rect),b=d.area(f._rect);g/(y<b?y:b)>.8&&(f.grid.makeSubGrid(f.el,void 0,e),f=void 0)}f?l=!this._fixCollisions(e,r,f,t):(l=!1,i&&delete t.pack)}return l&&(e._dirty=!0,d.copyPos(e,r)),t.pack&&this._packNodes()._notify(),!d.samePos(e,o)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){var o;let i=(o=this._layouts)==null?void 0:o.length,s=i&&this.column!==i-1?this._layouts[i-1]:null,r=[];return this.sortNodes(),this.nodes.forEach(a=>{let l=s==null?void 0:s.find(c=>c._id===a._id),u={...a,...l||{}};d.removeInternalForSave(u,!e),t&&t(a,u),r.push(u)}),r}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;e.forEach(r=>{if(!r._orig)return;let o=t.find(a=>a._id===r._id);o&&(o.y>=0&&r.y!==r._orig.y&&(o.y+=r.y-r._orig.y),r.x!==r._orig.x&&(o.x=Math.round(r.x*s)),r.w!==r._orig.w&&(o.w=Math.round(r.w*s)))})}}),this)}columnChanged(e,t,i="moveScale"){var a;if(!this.nodes.length||!t||e===t)return this;if(i==="none")return this;const s=i==="compact"||i==="list";s&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let r=[],o=s?this.nodes:d.sort(this.nodes,-1);if(t>e&&this._layouts){const l=this._layouts[t]||[];let u=this._layouts.length-1;!l.length&&e!==u&&((a=this._layouts[u])!=null&&a.length)&&(e=u,this._layouts[u].forEach(c=>{let h=o.find(f=>f._id===c._id);h&&(!s&&!c.autoPosition&&(h.x=c.x??h.x,h.y=c.y??h.y),h.w=c.w??h.w,(c.x==null||c.y===void 0)&&(h.autoPosition=!0))})),l.forEach(c=>{let h=o.findIndex(f=>f._id===c._id);if(h!==-1){const f=o[h];if(s){f.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(f.x=c.x??f.x,f.y=c.y??f.y,f.w=c.w??f.w,r.push(f)),o.splice(h,1)}})}if(s)this.compact(i,!1);else{if(o.length)if(typeof i=="function")i(t,e,r,o);else{let l=s?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";o.forEach(h=>{h.x=t===1?0:u?Math.round(h.x*l):Math.min(h.x,t-1),h.w=t===1||e===1?1:c?Math.round(h.w*l)||1:Math.min(h.w,t),r.push(h)}),o=[]}r=d.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let s=[];return e.forEach((r,o)=>{if(r._id===void 0){const a=r.id?this.nodes.find(l=>l.id===r.id):void 0;r._id=(a==null?void 0:a._id)??Q._idSeq++}s[o]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??Q._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){var i,s;return((s=(i=this._layouts)==null?void 0:i[t])==null?void 0:s.findIndex(r=>r._id===e._id))??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){let i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(let t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}Q._idSeq=0;const W={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},Xs={handle:".grid-stack-item-content",appendTo:"body"};class _{}const Y=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class X{}function _e(n,e){if(n.touches.length>1)return;n.cancelable&&n.preventDefault();const t=n.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(i)}function xt(n,e){n.cancelable&&n.preventDefault();const t=document.createEvent("MouseEvents");t.initMouseEvent(e,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(t)}function we(n){X.touchHandled||(X.touchHandled=!0,_e(n,"mousedown"))}function be(n){X.touchHandled&&_e(n,"mousemove")}function ve(n){if(!X.touchHandled)return;X.pointerLeaveTimeout&&(window.clearTimeout(X.pointerLeaveTimeout),delete X.pointerLeaveTimeout);const e=!!_.dragElement;_e(n,"mouseup"),e||_e(n,"click"),X.touchHandled=!1}function xe(n){n.pointerType!=="mouse"&&n.target.releasePointerCapture(n.pointerId)}function Ke(n){_.dragElement&&n.pointerType!=="mouse"&&xt(n,"mouseenter")}function Ze(n){_.dragElement&&n.pointerType!=="mouse"&&(X.pointerLeaveTimeout=window.setTimeout(()=>{delete X.pointerLeaveTimeout,xt(n,"mouseleave")},10))}class He{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._init()}_init(){const e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${He.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Y&&(this.el.addEventListener("touchstart",we),this.el.addEventListener("pointerdown",xe)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Y&&(this.el.removeEventListener("touchstart",we),this.el.removeEventListener("pointerdown",xe)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Y&&(this.el.addEventListener("touchmove",be),this.el.addEventListener("touchend",ve)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e)),e.stopPropagation()}_mouseUp(e){this.moving&&this._triggerEvent("stop",e),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Y&&(this.el.removeEventListener("touchmove",be),this.el.removeEventListener("touchend",ve)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}He.prefix="ui-resizable-";class Fe{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}}class ae extends Fe{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=this.temporalRect||r;return{position:{left:(o.left-s.left)*this.rectScale.x,top:(o.top-s.top)*this.rectScale.y},size:{width:o.width*this.rectScale.x,height:o.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(s=>this.option[s]=e[s]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),_.overResizeElement===this&&delete _.overResizeElement),this}_mouseOver(e){_.overResizeElement||_.dragElement||(_.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){_.overResizeElement===this&&(delete _.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new He(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=d.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=d.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=d.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();const i=d.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){const t=d.initEvent(e,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=ae._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=d.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return ae._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){const i=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-i.clientX,o=this.sizeToContent?0:e.clientY-i.clientY;t.indexOf("e")>-1?s.width+=r:t.indexOf("w")>-1&&(s.width-=r,s.left+=r),t.indexOf("s")>-1?s.height+=o:t.indexOf("n")>-1&&(s.height-=o,s.top+=o);const a=this._constrainSize(s.width,s.height);return Math.round(s.width)!==Math.round(a.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-a.width),s.width=a.width),Math.round(s.height)!==Math.round(a.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-a.height),s.height=a.height),s}_constrainSize(e,t){const i=this.option.maxWidth||Number.MAX_SAFE_INTEGER,s=this.option.minWidth/this.rectScale.x||e,r=this.option.maxHeight||Number.MAX_SAFE_INTEGER,o=this.option.minHeight/this.rectScale.y||t,a=Math.min(i,Math.max(s,e)),l=Math.min(r,Math.max(o,t));return{width:a,height:l}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const t=this.el.parentElement,{left:i,top:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const i=this.temporalRect[t],s=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}ae._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Vs='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class le extends Fe{constructor(e,t={}){super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=t.handle.substring(1);this.dragEl=e.classList.contains(i)?e:e.querySelector(t.handle)||e,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEl.addEventListener("mousedown",this._mouseDown),Y&&(this.dragEl.addEventListener("touchstart",we),this.dragEl.addEventListener("pointerdown",xe)),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),Y&&(this.dragEl.removeEventListener("touchstart",we),this.dragEl.removeEventListener("pointerdown",xe)),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(!_.mouseHandled)return e.button!==0||e.target.closest(Vs)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete _.dragElement,delete _.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Y&&(this.dragEl.addEventListener("touchmove",be),this.dragEl.addEventListener("touchend",ve)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),_.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=d.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;let t=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(e),_.pauseDrag){const s=Number.isInteger(_.pauseDrag)?_.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),s)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,_.dragElement=this;let s=(i=this.el.gridstackNode)==null?void 0:i.grid;s?_.dropElement=s.el.ddElement.ddDroppable:delete _.dropElement,this.helper=this._createHelper(e),this._setupHelperContainmentStyle(),this.dragTransform=d.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment);const r=d.initEvent(e,{target:this.el,type:"dragstart"});this._setupHelperStyle(e),this.option.start&&this.option.start(r,this.ui()),this.triggerEvent("dragstart",r)}return!0}_mouseUp(e){var t;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Y&&(this.dragEl.removeEventListener("touchmove",be,!0),this.dragEl.removeEventListener("touchend",ve,!0)),this.dragging){delete this.dragging,((t=_.dropElement)==null?void 0:t.el)===this.el.parentElement&&delete _.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();const i=d.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),_.dropElement&&_.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete _.dragElement,delete _.dropElement,delete _.mouseHandled,e.preventDefault()}_createHelper(e){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(e):this.option.helper==="clone"&&(t=d.cloneNode(this.el)),document.body.contains(t)||d.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),t===this.el&&(this.dragElementOriginStyle=le.originStyleProp.map(i=>this.el.style[i])),t}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging");const t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){var t;this.helper.classList.remove("ui-draggable-dragging");let e=(t=this.helper)==null?void 0:t.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){let i=this.helper,s=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",le.originStyleProp.forEach(r=>i.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>i.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0};const i=this.helper.style,s=this.dragOffset;i.left=(e.clientX+s.offsetLeft-t.left)*this.dragTransform.xScale+"px",i.top=(e.clientY+s.offsetTop-t.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let s=0,r=0;i&&(s=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const o=t.getBoundingClientRect();return{left:o.left,top:o.top,offsetLeft:-e.clientX+o.left-s,offsetTop:-e.clientY+o.top-r,width:o.width*this.dragTransform.xScale,height:o.height*this.dragTransform.yScale}}ui(){const t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:(i.left-t.left)*this.dragTransform.xScale}}}}le.originStyleProp=["transition","pointerEvents","position","left","top","minWidth","willChange"];class js extends Fe{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Y&&(this.el.addEventListener("pointerenter",Ke),this.el.addEventListener("pointerleave",Ze)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Y&&(this.el.removeEventListener("pointerenter",Ke),this.el.removeEventListener("pointerleave",Ze)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!_.dragElement||!this._canDrop(_.dragElement.el))return;e.preventDefault(),e.stopPropagation(),_.dropElement&&_.dropElement!==this&&_.dropElement._mouseLeave(e,!0),_.dropElement=this;const t=d.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(_.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){var s;if(!_.dragElement||_.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const i=d.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(_.dragElement)),this.triggerEvent("dropout",i),_.dropElement===this&&(delete _.dropElement,!t)){let r,o=this.el.parentElement;for(;!r&&o;)r=(s=o.ddElement)==null?void 0:s.ddDroppable,o=o.parentElement;r&&r._mouseEnter(e)}}drop(e){e.preventDefault();const t=d.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(_.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class Ye{static init(e){return e.ddElement||(e.ddElement=new Ye(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new le(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new ae(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new js(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Ks{resizable(e,t,i,s){return this._getDDElements(e).forEach(r=>{if(t==="disable"||t==="enable")r.ddResizable&&r.ddResizable[t]();else if(t==="destroy")r.ddResizable&&r.cleanResizable();else if(t==="option")r.setupResizable({[i]:s});else{const a=r.el.gridstackNode.grid;let l=r.el.getAttribute("gs-resize-handles")||a.opts.resizable.handles||"e,s,se";l==="all"&&(l="n,e,s,w,se,sw,ne,nw");const u=!a.opts.alwaysShowResizeHandle;r.setupResizable({...a.opts.resizable,handles:l,autoHide:u,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,s){return this._getDDElements(e).forEach(r=>{if(t==="disable"||t==="enable")r.ddDraggable&&r.ddDraggable[t]();else if(t==="destroy")r.ddDraggable&&r.cleanDraggable();else if(t==="option")r.setupDraggable({[i]:s});else{const o=r.el.gridstackNode.grid;r.setupDraggable({...o.opts.draggable,start:t.start,stop:t.stop,drag:t.drag})}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,s){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=r=>t._accept(r)),this._getDDElements(e).forEach(r=>{t==="disable"||t==="enable"?r.ddDroppable&&r.ddDroppable[t]():t==="destroy"?r.ddDroppable&&r.cleanDroppable():t==="option"?r.setupDroppable({[i]:s}):r.setupDroppable(t)}),this}isDroppable(e){return!!(e&&e.ddElement&&e.ddElement.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e&&e.ddElement&&e.ddElement.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e&&e.ddElement&&e.ddElement.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(s=>s.on(t,r=>{i(r,_.dragElement?_.dragElement.el:r.target,_.dragElement?_.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t=!0){let i=d.getElements(e);if(!i.length)return[];let s=i.map(r=>r.ddElement||(t?Ye.init(r):null));return t||s.filter(r=>r),s}}/*!
* GridStack 10.1.2
* https://gridstackjs.com/
*
* Copyright (c) 2021-2022 Alain Dumesny
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
*/const S=new Ks;class w{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;let i=w.getGridElement(t);return i?(i.gridstack||(i.gridstack=new w(i,d.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},t=".grid-stack"){let i=[];return typeof document>"u"||(w.getGridElements(t).forEach(s=>{s.gridstack||(s.gridstack=new w(s,d.cloneDeep(e))),i.push(s.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){const o=i.gridstack;return t&&(o.opts={...o.opts,...t}),t.children!==void 0&&o.load(t.children),o}if(!e.classList.contains("grid-stack")||w.addRemoveCB)if(w.addRemoveCB)i=w.addRemoveCB(e,t,!0,!0);else{let o=document.implementation.createHTMLDocument("");o.body.innerHTML=`<div class="grid-stack ${t.class||""}"></div>`,i=o.body.children[0],e.appendChild(i)}return w.init(t,i)}static registerEngine(e){w.engineClass=e}get placeholder(){if(!this._placeholder){let e=document.createElement("div");e.className="placeholder-content",this.opts.placeholderText&&(e.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,W.itemClass,this.opts.itemClass),this.placeholder.appendChild(e)}return this._placeholder}constructor(e,t={}){var h,f,g,y;this.el=e,this.opts=t,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);let i=d.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s=(h=t.columnOpts)==null?void 0:h.breakpoints;const r=t;if(r.oneColumnModeDomSort&&(delete r.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),r.oneColumnSize||r.disableOneColumnMode===!1){const b=r.oneColumnSize||768;delete r.oneColumnSize,delete r.disableOneColumnMode,t.columnOpts=t.columnOpts||{},s=t.columnOpts.breakpoints=t.columnOpts.breakpoints||[];let m=s.find(E=>E.c===1);m?m.w=b:(m={c:1,w:b},s.push(m,{c:12,w:b+1}))}const o=t.columnOpts;o&&(!o.columnWidth&&!((f=o.breakpoints)!=null&&f.length)?(delete t.columnOpts,s=void 0):o.columnMax=o.columnMax||12),(s==null?void 0:s.length)>1&&s.sort((b,m)=>(m.w||0)-(b.w||0));let a={...d.cloneDeep(W),column:d.toNumber(e.getAttribute("gs-column"))||W.column,minRow:i||d.toNumber(e.getAttribute("gs-min-row"))||W.minRow,maxRow:i||d.toNumber(e.getAttribute("gs-max-row"))||W.maxRow,staticGrid:d.toBool(e.getAttribute("gs-static"))||W.staticGrid,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||W.draggable.handle},removableOptions:{accept:t.itemClass||W.removableOptions.accept,decline:W.removableOptions.decline}};e.getAttribute("gs-animate")&&(a.animate=d.toBool(e.getAttribute("gs-animate"))),t=d.defaults(t,a),this._initMargin(),this.checkDynamicColumn(),this.el.classList.add("gs-"+t.column),t.rtl==="auto"&&(t.rtl=e.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");const l=(g=this.el.parentElement)==null?void 0:g.parentElement;let u=l!=null&&l.classList.contains(W.itemClass)?l.gridstackNode:void 0;u&&(u.subGrid=this,this.parentGridItem=u,this.el.classList.add("grid-stack-nested"),u.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==W.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit),this.cellHeight(t.cellHeight,!1)),t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=Y),this._styleSheetClass="gs-id-"+Q._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let c=t.engineClass||w.engineClass||Q;if(this.engine=new c({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:b=>{let m=0;this.engine.nodes.forEach(E=>{m=Math.max(m,E.y+E.h)}),b.forEach(E=>{let N=E.el;N&&(E._removeDOM?(N&&N.remove(),delete E._removeDOM):this._writePosAttr(N,E))}),this._updateStyles(!1,m)}}),this._updateStyles(!1,0),t.auto&&(this.batchUpdate(),this.getGridItems().forEach(b=>this._prepareElement(b)),this.batchUpdate(!1)),t.children){let b=t.children;delete t.children,b.length&&this.load(b)}this.setAnimation(t.animate),t.subGridDynamic&&!_.pauseDrag&&(_.pauseDrag=!0),((y=t.draggable)==null?void 0:y.pause)!==void 0&&(_.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e,t){function i(a){return a.el!==void 0||a.x!==void 0||a.y!==void 0||a.w!==void 0||a.h!==void 0||a.content!==void 0}let s,r;if(typeof e=="string"){let a=document.implementation.createHTMLDocument("");a.body.innerHTML=e,s=a.body.children[0]}else if(arguments.length===0||arguments.length===1&&i(e))if(r=t=e,r!=null&&r.el)s=r.el;else if(w.addRemoveCB)s=w.addRemoveCB(this.el,t,!0,!1);else{let a=(t==null?void 0:t.content)||"",l=document.implementation.createHTMLDocument("");l.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${a}</div></div>`,s=l.body.children[0]}else s=e;if(!s)return;if(r=s.gridstackNode,r&&s.parentElement===this.el&&this.engine.nodes.find(a=>a._id===r._id))return s;let o=this._readAttr(s);return t=d.cloneDeep(t)||{},d.defaults(t,o),r=this.engine.prepareNode(t),this._writeAttr(s,t),this._insertNotAppend?this.el.prepend(s):this.el.appendChild(s),this.makeWidget(s,t),s}makeSubGrid(e,t,i,s=!0){var g,y,b;let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),(g=r.subGrid)!=null&&g.el)return r.subGrid;let o,a=this;for(;a&&!o;)o=(y=a.opts)==null?void 0:y.subGridOpts,a=(b=a.parentGridItem)==null?void 0:b.grid;t=d.cloneDeep({...o||{},children:void 0,...t||r.subGridOpts||{}}),r.subGridOpts=t;let l;t.column==="auto"&&(l=!0,t.column=Math.max(r.w||1,(i==null?void 0:i.w)||1),delete t.columnOpts);let u=r.el.querySelector(".grid-stack-item-content"),c,h;if(s){if(this._removeDD(r.el),h={...r,x:0,y:0},d.removeInternalForSave(h),delete h.subGridOpts,r.content&&(h.content=r.content,delete r.content),w.addRemoveCB)c=w.addRemoveCB(this.el,h,!0,!1);else{let m=document.implementation.createHTMLDocument("");m.body.innerHTML='<div class="grid-stack-item"></div>',c=m.body.children[0],c.appendChild(u),m.body.innerHTML='<div class="grid-stack-item-content"></div>',u=m.body.children[0],r.el.appendChild(u)}this._prepareDragDropByNode(r)}if(i){let m=l?t.column:r.w,E=r.h+i.h,N=r.el.style;N.transition="none",this.update(r.el,{w:m,h:E}),setTimeout(()=>N.transition=null)}let f=r.subGrid=w.addGrid(u,t);return i!=null&&i._moving&&(f._isTemp=!0),l&&(f._autoColumn=!0),s&&f.addWidget(c,h),i&&(i._moving?window.setTimeout(()=>d.simulateMouseEvent(i._event,"mouseenter",f.el),0):f.addWidget(r.el,r)),f}removeAsSubGrid(e){var i;let t=(i=this.parentGridItem)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridItem.x,s.y+=this.parentGridItem.y,t.addWidget(s.el,s)}),t.batchUpdate(!1),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,e&&window.setTimeout(()=>d.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=w.saveCB){let s=this.engine.save(e,i);if(s.forEach(r=>{var o;if(e&&r.el&&!r.subGrid&&!i){let a=r.el.querySelector(".grid-stack-item-content");r.content=a?a.innerHTML:void 0,r.content||delete r.content}else if(!e&&!i&&delete r.content,(o=r.subGrid)!=null&&o.el){const a=r.subGrid.save(e,t,i);r.subGridOpts=t?a:{children:a},delete r.subGrid}delete r.el}),t){let r=d.cloneDeep(this.opts);r.marginBottom===r.marginTop&&r.marginRight===r.marginLeft&&r.marginTop===r.marginRight&&(r.margin=r.marginTop,delete r.marginTop,delete r.marginRight,delete r.marginBottom,delete r.marginLeft),r.rtl===(this.el.style.direction==="rtl")&&(r.rtl="auto"),this._isAutoCellHeight&&(r.cellHeight="auto"),this._autoColumn&&(r.column="auto");const o=r._alwaysShowResizeHandle;return delete r._alwaysShowResizeHandle,o!==void 0?r.alwaysShowResizeHandle=o:delete r.alwaysShowResizeHandle,d.removeInternalAndSame(r,W),r.children=s,r}return s}load(e,t=w.addRemoveCB||!0){var c;e=d.cloneDeep(e);const i=this.getColumn();let s=e.filter(h=>(h.x===void 0||h.y===void 0)&&!d.find(this.engine.nodes,h.id));s.length&&s.length!==e.length?e=e.filter(h=>!d.find(s,h.id)):s=[];const r=e.some(h=>h.x!==void 0||h.y!==void 0);r&&(e=d.sort(e,-1)),this._insertNotAppend=r,e.some(h=>(h.x||0)+(h.w||1)>i)&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(e,12,!0));const o=w.addRemoveCB;typeof t=="function"&&(w.addRemoveCB=t);let a=[];this.batchUpdate();const l=!this.engine.nodes.length;l&&this.setAnimation(!1),t&&[...this.engine.nodes].forEach(f=>{if(!f.id)return;d.find(e,f.id)||(w.addRemoveCB&&w.addRemoveCB(this.el,f,!1,!1),a.push(f),this.removeWidget(f.el,!0,!1))});let u=[];return this.engine.nodes=this.engine.nodes.filter(h=>d.find(e,h.id)?(u.push(h),!1):!0),e.forEach(h=>{var g;let f=d.find(u,h.id);if(f){if(d.shouldSizeToContent(f)&&(h.h=f.h),this.engine.nodeBoundFix(h),(h.autoPosition||h.x===void 0||h.y===void 0)&&(h.w=h.w||f.w,h.h=h.h||f.h,this.engine.findEmptyPosition(h)),this.engine.nodes.push(f),d.samePos(f,h)&&this.moveNode(f,{...h,forceCollide:!0}),this.update(f.el,h),(g=h.subGridOpts)!=null&&g.children){let y=f.el.querySelector(".grid-stack");y&&y.gridstack&&(y.gridstack.load(h.subGridOpts.children),this._insertNotAppend=!0)}}else t&&this.addWidget(h)}),t&&s.forEach(h=>this.addWidget(h)),this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,o?w.addRemoveCB=o:delete w.addRemoveCB,l&&((c=this.opts)!=null&&c.animate)&&setTimeout(()=>{this.opts&&this.setAnimation(this.opts.animate)}),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let t=this.el.querySelector("."+this.opts.itemClass);if(t){let s=d.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e,t=!0){if(t&&e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){let s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}let i=d.parseHeight(e);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.resizeToContentCheck(),t&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){var t;return e&&((t=this.opts.columnOpts)!=null&&t.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,o;const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!((r=e.breakpoints)!=null&&r.length))return!1;const t=this.getColumn();let i=t;const s=this._widthOrContainer(!0);if(e.columnWidth)i=Math.min(Math.round(s/e.columnWidth)||1,e.columnMax);else{i=e.columnMax;let a=0;for(;a<e.breakpoints.length&&s<=e.breakpoints[a].w;)i=e.breakpoints[a++].c||t}if(i!==t){const a=(o=e.breakpoints)==null?void 0:o.find(l=>l.c===i);return this.column(i,(a==null?void 0:a.layout)||e.layout),!0}return!1}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;let i=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+i),this.el.classList.add("gs-"+e),this.engine.columnChanged(i,e,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){let i=this.el.getBoundingClientRect(),s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let r=e.left-s.left,o=e.top-s.top,a=i.width/this.getColumn(),l=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/a),y:Math.floor(o/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,s){return this.engine.isAreaEmpty(e,t,i,s)}makeWidget(e,t){let i=w.getElement(e);this._prepareElement(i,!0,t);const s=i.gridstackNode;return this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1),this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(s=>this.on(s,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=s=>t(s):this._gsEventHandler[e]=s=>t(s,s.detail),this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return w.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let r=s.gridstackNode;r||(r=this.engine.nodes.find(o=>s===o.el)),r&&(t&&w.addRemoveCB&&w.addRemoveCB(this.el,r,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(r,t,i),t&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&w.addRemoveCB&&w.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(e,t),t&&this._triggerRemoveEvent(),this}setAnimation(e){return e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this._prepareDragDropByNode(s),s.subGrid&&i&&s.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}update(e,t){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let i=arguments,s=1;return t={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(e,t)}return w.getElements(e).forEach(i=>{var c;let s=i==null?void 0:i.gridstackNode;if(!s)return;let r=d.cloneDeep(t);this.engine.nodeBoundFix(r),delete r.autoPosition,delete r.id;let o=["x","y","w","h"],a;if(o.some(h=>r[h]!==void 0&&r[h]!==s[h])&&(a={},o.forEach(h=>{a[h]=r[h]!==void 0?r[h]:s[h],delete r[h]})),!a&&(r.minW||r.minH||r.maxW||r.maxH)&&(a={}),r.content!==void 0){const h=i.querySelector(".grid-stack-item-content");h&&h.innerHTML!==r.content&&(h.innerHTML=r.content,(c=s.subGrid)!=null&&c.el&&(h.appendChild(s.subGrid.el),s.subGrid.opts.styleInHead||s.subGrid._updateStyles(!0))),delete r.content}let l=!1,u=!1;for(const h in r)h[0]!=="_"&&s[h]!==r[h]&&(s[h]=r[h],l=!0,u=u||!this.opts.staticGrid&&(h==="noResize"||h==="noMove"||h==="locked"));if(d.sanitizeMinMax(s),a){const h=a.w!==void 0&&a.w!==s.w;this.moveNode(s,a),this.resizeToContentCheck(h,s)}(a||l)&&this._writeAttr(i,s),u&&this._prepareDragDropByNode(s)}),this}moveNode(e,t){this.engine.cleanNodes().beginUpdate(e).moveNode(e,t),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const t=e.gridstackNode;if(!t)return;const i=t.grid;if(!i||e.parentElement!==i.el)return;const s=i.getCellHeight(!0);if(!s)return;let r=t.h?t.h*s:e.clientHeight,o;if(t.resizeToContentParent&&(o=e.querySelector(t.resizeToContentParent)),o||(o=e.querySelector(w.resizeToContentParent)),!o)return;const a=e.clientHeight-o.clientHeight,l=t.h?t.h*s-a:o.clientHeight;let u;if(t.subGrid)u=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);else{const f=o.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${w.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}u=f.getBoundingClientRect().height||l}if(l===u)return;r+=u-l;let c=Math.ceil(r/s);const h=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;h&&c>h&&(c=h,e.classList.add("size-to-content-max")),t.minH&&c<t.minH?c=t.minH:t.maxH&&c>t.maxH&&(c=t.maxH),c!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:c}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){w.resizeToContentCB?w.resizeToContentCB(e):this.resizeToContent(e)}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=d.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(e){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let t=arguments,i=0,s={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(s)}return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.addedNodes)!=null&&e.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});const t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.removedNodes)!=null&&e.length){const t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(e,t){let i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e);return this.el.dispatchEvent(i),this}_removeStylesheet(){if(this._styles){const e=this.opts.styleInHead?void 0:this.el.parentNode;d.removeStylesheet(this._styleSheetClass,e),delete this._styles}return this}_updateStyles(e=!1,t){if(e&&this._removeStylesheet(),t===void 0&&(t=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit,r=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){const o=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=d.createStylesheet(this._styleSheetClass,o,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,d.addCSSRule(this._styles,r,`height: ${i}${s}`);let a=this.opts.marginTop+this.opts.marginUnit,l=this.opts.marginBottom+this.opts.marginUnit,u=this.opts.marginRight+this.opts.marginUnit,c=this.opts.marginLeft+this.opts.marginUnit,h=`${r} > .grid-stack-item-content`,f=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;d.addCSSRule(this._styles,h,`top: ${a}; right: ${u}; bottom: ${l}; left: ${c};`),d.addCSSRule(this._styles,f,`top: ${a}; right: ${u}; bottom: ${l}; left: ${c};`),d.addCSSRule(this._styles,`${r} > .ui-resizable-n`,`top: ${a};`),d.addCSSRule(this._styles,`${r} > .ui-resizable-s`,`bottom: ${l}`),d.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${u}`),d.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${u}`),d.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${u}; bottom: ${l}`),d.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${c}`),d.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${c}`),d.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${c}; bottom: ${l}`)}if(t=t||this._styles._max,t>this._styles._max){let o=a=>i*a+s;for(let a=this._styles._max+1;a<=t;a++)d.addCSSRule(this._styles,`${r}[gs-y="${a}"]`,`top: ${o(a)}`),d.addCSSRule(this._styles,`${r}[gs-h="${a+1}"]`,`height: ${o(a+1)}`);this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridItem;let t=this.getRow()+this._extraDragRow;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!e){const r=d.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===s){const o=Math.floor(r.h/i);t<o&&(t=o)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[e?"minHeight":"height"]=t*i+s),e&&!e.grid.engine.batchMode&&d.shouldSizeToContent(e)&&e.grid.resizeToContentCBCheck(e.el),this}_prepareElement(e,t=!1,i){i=i||this._readAttr(e),e.gridstackNode=i,i.el=e,i.grid=this,i=this.engine.addNode(i,t),this._writeAttr(e,i),e.classList.add(W.itemClass,this.opts.itemClass);const s=d.shouldSizeToContent(i);return s?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),this._prepareDragDropByNode(i),this}_writePosAttr(e,t){return t.x!==void 0&&t.x!==null&&e.setAttribute("gs-x",String(t.x)),t.y!==void 0&&t.y!==null&&e.setAttribute("gs-y",String(t.y)),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);let i={autoPosition:"gs-auto-position",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id"};for(const s in i)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){let i={};i.x=d.toNumber(e.getAttribute("gs-x")),i.y=d.toNumber(e.getAttribute("gs-y")),i.w=d.toNumber(e.getAttribute("gs-w")),i.h=d.toNumber(e.getAttribute("gs-h")),i.autoPosition=d.toBool(e.getAttribute("gs-auto-position")),i.noResize=d.toBool(e.getAttribute("gs-no-resize")),i.noMove=d.toBool(e.getAttribute("gs-no-move")),i.locked=d.toBool(e.getAttribute("gs-locked")),i.id=e.getAttribute("gs-id"),i.maxW=d.toNumber(e.getAttribute("gs-max-w")),i.minW=d.toNumber(e.getAttribute("gs-min-w")),i.maxH=d.toNumber(e.getAttribute("gs-max-h")),i.minH=d.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(const s in i){if(!i.hasOwnProperty(s))return;!i[s]&&i[s]!==0&&delete i[s]}return i}_setStaticClass(){let e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(){var t;if(!((t=this.el)!=null&&t.clientWidth)||this.prevWidth===this.el.clientWidth)return;this.prevWidth=this.el.clientWidth,this.batchUpdate();let e=!1;return this._autoColumn&&this.parentGridItem?this.opts.column!==this.parentGridItem.w&&(this.column(this.parentGridItem.w,"none"),e=!0):e=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(e),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,t=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),310);if(t)d.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>d.shouldSizeToContent(i))){const i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{d.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,t?[t]:this.engine.nodes)}}_updateResizeEvent(e=!1){const t=!this.parentGridItem&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=d.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return d.getElement(e)}static getElements(e=".grid-stack-item"){return d.getElements(e)}static getGridElement(e){return w.getElement(e)}static getGridElements(e){return d.getElements(e)}_initMargin(){let e,t=0,i=[];return typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(e=d.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),this.opts.marginTop===void 0?this.opts.marginTop=t:(e=d.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=d.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=d.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=d.parseHeight(this.opts.marginLeft),this.opts.marginLeft=e.h,delete this.opts.margin),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return S}static setupDragIn(e,t,i=document){(t==null?void 0:t.pause)!==void 0&&(_.pauseDrag=t.pause),t={...Xs,...t||{}};let s=typeof e=="string"?d.getElements(e,i):e;s.length&&(s==null||s.forEach(r=>{S.isDraggable(r)||S.dragIn(r,t)}))}movable(e,t){return this.opts.staticGrid?this:(w.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this._prepareDragDropByNode(s))}),this)}resizable(e,t){return this.opts.staticGrid?this:(w.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this._prepareDragDropByNode(s))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this._prepareDragDropByNode(i),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this._prepareDragDropByNode(i),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}_removeDD(e){return S.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return S.droppable(this.el,"destroy"),this;let e,t,i=(s,r,o)=>{var f;let a=r.gridstackNode;if(!a)return;if(o=o||r,!((f=a.grid)!=null&&f.el)){o.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const g=o.getBoundingClientRect();o.style.left=g.x+(this.dragTransform.xScale-1)*(s.clientX-g.x)/this.dragTransform.xScale+"px",o.style.top=g.y+(this.dragTransform.yScale-1)*(s.clientY-g.y)/this.dragTransform.yScale+"px",o.style.transformOrigin="0px 0px"}let l=this.el.getBoundingClientRect(),{top:u,left:c}=o.getBoundingClientRect();c-=l.left,u-=l.top;let h={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(a._temporaryRemoved){if(a.x=Math.max(0,Math.round(c/t)),a.y=Math.max(0,Math.round(u/e)),delete a.autoPosition,this.engine.nodeBoundFix(a),!this.engine.willItFit(a)){if(a.autoPosition=!0,!this.engine.willItFit(a)){S.off(r,"drag");return}a._willFitPos&&(d.copyPos(a,a._willFitPos),delete a._willFitPos)}this._onStartMoving(o,s,h,a,t,e)}else this._dragOrResize(o,s,h,a,t,e)};return S.droppable(this.el,{accept:s=>{let r=s.gridstackNode||this._readAttr(s,!1);if((r==null?void 0:r.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let o=!0;if(typeof this.opts.acceptWidgets=="function")o=this.opts.acceptWidgets(s);else{let a=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;o=s.matches(a)}if(o&&r&&this.opts.maxRow){let a={w:r.w,h:r.h,minW:r.minW,minH:r.minH};o=this.engine.willItFit(a)}return o}}).on(this.el,"dropover",(s,r,o)=>{let a=r.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._temporaryRemoved)return!1;a!=null&&a.grid&&a.grid!==this&&!a._temporaryRemoved&&a.grid._leave(r,o),t=this.cellWidth(),e=this.getCellHeight(!0),a||(a=this._readAttr(r,!1)),a.grid||(a._isExternal=!0,r.gridstackNode=a),o=o||r;let l=a.w||Math.round(o.offsetWidth/t)||1,u=a.h||Math.round(o.offsetHeight/e)||1;return a.grid&&a.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=a),r.gridstackNode=a={...a,w:l,h:u,grid:this},delete a.x,delete a.y,this.engine.cleanupNode(a).nodeBoundFix(a),a._initDD=a._isExternal=a._temporaryRemoved=!0):(a.w=l,a.h=u,a._temporaryRemoved=!0),w._itemRemoving(a.el,!1),S.on(r,"drag",i),i(s,r,o),!1}).on(this.el,"dropout",(s,r,o)=>{let a=r.gridstackNode;return a&&(!a.grid||a.grid===this)&&(this._leave(r,o),this._isTemp&&this.removeAsSubGrid(a)),!1}).on(this.el,"drop",(s,r,o)=>{var f,g;let a=r.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;const l=!!this.placeholder.parentElement;this.placeholder.remove();const u=l&&this.opts.animate;u&&this.setAnimation(!1);let c=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,l&&(c!=null&&c.grid)&&c.grid!==this){let y=c.grid;y.engine.removeNodeFromLayoutCache(c),y.engine.removedNodes.push(c),y._triggerRemoveEvent()._triggerChangeEvent(),y.parentGridItem&&!y.engine.nodes.length&&y.opts.subGridDynamic&&y.removeAsSubGrid()}if(!a||(l&&(this.engine.cleanupNode(a),a.grid=this),delete a.grid._isTemp,S.off(r,"drag"),o!==r?(o.remove(),r.gridstackNode=c,l&&(r=r.cloneNode(!0))):(r.remove(),this._removeDD(r)),!l))return!1;r.gridstackNode=a,a.el=r;let h=(g=(f=a.subGrid)==null?void 0:f.el)==null?void 0:g.gridstack;return d.copyPos(a,this._readAttr(this.placeholder)),d.removePositioningStyles(r),this.el.appendChild(r),this._prepareElement(r,!0,a),h&&(h.parentGridItem=a,h.opts.styleInHead||h._updateStyles(!0)),this._updateContainerHeight(),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},c&&c.grid?c:void 0,a),u&&setTimeout(()=>{this.opts&&this.setAnimation(this.opts.animate)}),!1}),this}static _itemRemoving(e,t){const i=e?e.gridstackNode:void 0;!(i!=null&&i.grid)||e.classList.contains(i.grid.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!S.isDroppable(e)&&S.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>w._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>w._itemRemoving(i,!1)),this):this}_prepareDragDropByNode(e){let t=e.el;const i=e.noMove||this.opts.disableDrag,s=e.noResize||this.opts.disableResize;if(this.opts.staticGrid||i&&s)return e._initDD&&(this._removeDD(t),delete e._initDD),t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!e._initDD){let r,o,a=(c,h)=>{this._gsEventHandler[c.type]&&this._gsEventHandler[c.type](c,c.target),r=this.cellWidth(),o=this.getCellHeight(!0),this._onStartMoving(t,c,h,e,r,o)},l=(c,h)=>{this._dragOrResize(t,c,h,e,r,o)},u=c=>{this.placeholder.remove(),delete e._moving,delete e._event,delete e._lastTried;const h=e.w!==e._orig.w;let f=c.target;if(!(!f.gridstackNode||f.gridstackNode.grid!==this)){if(e.el=f,e._isAboutToRemove){let g=t.gridstackNode.grid;g._gsEventHandler[c.type]&&g._gsEventHandler[c.type](c,f),g.engine.nodes.push(e),g.removeWidget(t,!0,!0)}else d.removePositioningStyles(f),e._temporaryRemoved?(d.copyPos(e,e._orig),this._writePosAttr(f,e),this.engine.addNode(e)):this._writePosAttr(f,e),this._gsEventHandler[c.type]&&this._gsEventHandler[c.type](c,f);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),c.type==="resizestop"&&(Number.isInteger(e.sizeToContent)&&(e.sizeToContent=e.h),this.resizeToContentCheck(h,e))}};S.draggable(t,{start:a,stop:u,drag:l}).resizable(t,{start:a,stop:u,resize:l}),e._initDD=!0}return S.draggable(t,i?"disable":"enable").resizable(t,s?"disable":"enable"),this}_onStartMoving(e,t,i,s,r,o){var a;if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),(a=s.grid)!=null&&a.el)this.dragTransform=d.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=d.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=t.type==="dragstart",delete s._lastTried,t.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(r,o,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"&&(S.resizable(e,"option","minWidth",r*(s.minW||1)).resizable(e,"option","minHeight",o*(s.minH||1)),s.maxW&&S.resizable(e,"option","maxWidth",r*s.maxW),s.maxH&&S.resizable(e,"option","maxHeight",o*s.maxH))}_dragOrResize(e,t,i,s,r,o){let a={...s._orig},l,u=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,f=this.opts.marginBottom,g=Math.round(o*.1),y=Math.round(r*.1);if(u=Math.min(u,y),c=Math.min(c,y),h=Math.min(h,g),f=Math.min(f,g),t.type==="drag"){if(s._temporaryRemoved)return;let m=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&d.updateScrollPosition(e,i.position,m);let E=i.position.left+(i.position.left>s._lastUiPosition.left?-c:u),N=i.position.top+(i.position.top>s._lastUiPosition.top?-f:h);a.x=Math.round(E/r),a.y=Math.round(N/o);let U=this._extraDragRow;if(this.engine.collide(s,a)){let J=this.getRow(),ee=Math.max(0,a.y+s.h-J);this.opts.maxRow&&J+ee>this.opts.maxRow&&(ee=Math.max(0,this.opts.maxRow-J)),this._extraDragRow=ee}else this._extraDragRow=0;if(this._extraDragRow!==U&&this._updateContainerHeight(),s.x===a.x&&s.y===a.y)return}else if(t.type==="resize"){if(a.x<0||(d.updateScrollResize(t,e,o),a.w=Math.round((i.size.width-u)/r),a.h=Math.round((i.size.height-h)/o),s.w===a.w&&s.h===a.h)||s._lastTried&&s._lastTried.w===a.w&&s._lastTried.h===a.h)return;let m=i.position.left+u,E=i.position.top+h;a.x=Math.round(m/r),a.y=Math.round(E/o),l=!0}s._event=t,s._lastTried=a;let b={x:i.position.left+u,y:i.position.top+h,w:(i.size?i.size.width:s.w*r)-u-c,h:(i.size?i.size.height:s.h*o)-h-f};if(this.engine.moveNodeCheck(s,{...a,cellWidth:r,cellHeight:o,rect:b,resizing:l})){s._lastUiPosition=i.position,this.engine.cacheRects(r,o,h,c,f,u),delete s._skipDown,l&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let m=t.target;this._writePosAttr(m,s),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,m)}}_leave(e,t){let i=e.gridstackNode;i&&(t=t||e,t.style.transform="scale(1)",S.off(e,"drag"),!i._temporaryRemoved&&(i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e,this.opts.removable===!0&&w._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&(delete i.el,delete e.gridstackNode,this.engine.restoreInitial())))}commit(){return Qs(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}w.resizeToContentParent=".grid-stack-item-content";w.Utils=d;w.Engine=Q;w.GDRev="10.1.2";const Zs=Z({__name:"PieChart",props:{chartData:{},chartOptions:{}},setup(n){ot.register(at,lt,ht,dt,Wt,ut,ct);const e=n,t=Ae(),i=I(()=>t.darkMode),s=I(()=>{const r={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"right",labels:{color:i.value?"white":"black"}},tooltip:{enabled:!0,backgroundColor:i.value?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:i.value?"black":"white",bodyColor:i.value?"black":"white"}},interaction:{mode:"nearest",axis:"x",intersect:!1}};return{...e.chartOptions,...r}});return(r,o)=>(A(),j(D(Bt),{data:r.chartData,options:s.value},null,8,["data","options"]))}});var me=(n=>(n.CO2="CO2",n.POWER="POWER",n))(me||{});const Je=["#FF6384","#36A2EB","#FFCE56","#4BC0C0","#9966FF","#FF9F40","#FFCD56","#4BC0C0","#36A2EB","#FF6384","#9966FF","#FF9F40","#FFCE56","#36A2EB","#4BC0C0","#FF6384","#9966FF","#FF9F40","#FFCD56","#36A2EB"],Js=()=>{const n="0123456789ABCDEF";let e="#";for(let t=0;t<6;t++)e+=n[Math.floor(Math.random()*16)];return e},Ee=n=>n<Je.length?Je[n]:Js(),er=n=>(he("data-v-f914510d"),n=n(),de(),n),tr=["id","gs-id","gs-x","gs-y","gs-w","gs-h"],ir={class:"grid-stack-item-content grid-stack-item dynamic-chart"},sr={class:"dynamic-chart__header"},rr=er(()=>T("h3",{class:"dynamic-chart__title"},"Distribution by Processes",-1)),nr={class:"dynamic-chart__controls"},or={class:"dynamic-chart__metrics"},ar=["onClick"],lr={class:"dynamic-chart__total"},hr={class:"dynamic-chart__total-title"},dr={class:"dynamic-chart__total-value"},ur={class:"dynamic-chart__chart-container"},cr=3,fr=5,gr=Z({__name:"DynamicChart",props:{data:{}},setup(n){const e=Te(),t=I(()=>e.selectedRun),i=V(me.POWER),s=Object.values(me),r=V(Zs),o=Ae(),a=I(()=>o.darkMode),l=I(()=>{var f,g;return i.value===me.POWER?`${(f=t.value)==null?void 0:f.pow.toFixed(4)} Wh`:`${(g=t.value)==null?void 0:g.co2.toFixed(4)} g`}),u=I(()=>{var f,g,y,b;return{labels:((f=t.value)==null?void 0:f.processes.map(m=>m.processName))||[],datasets:[{label:"Power Contribution",data:((g=t.value)==null?void 0:g.processes.map(m=>m.powContribPerc))||[],backgroundColor:(y=t.value)==null?void 0:y.processes.map((m,E)=>Ee(E)),borderColor:(b=t.value)==null?void 0:b.processes.map((m,E)=>Ee(E)),borderWidth:1}]}}),c=I(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{tooltip:{enabled:!0,backgroundColor:a.value?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:a.value?"black":"white",bodyColor:a.value?"black":"white"},legend:{display:!0,position:"bottom",labels:{color:a.value?"white":"black"}}}})),h=f=>{i.value=f};return(f,g)=>(A(),K("div",{id:f.data.id,"gs-id":f.data.id,"gs-x":f.data.grid.x,"gs-y":f.data.grid.y,"gs-w":f.data.grid.w,"gs-h":f.data.grid.h,"gs-min-w":cr,"gs-min-h":fr},[T("div",ir,[T("div",sr,[rr,T("div",nr,[T("div",or,[(A(!0),K(Ce,null,De(D(s),y=>(A(),K("button",{key:y,onClick:b=>h(y),class:tt(["dynamic-chart__metric-button",{active:i.value===y}])},F(y),11,ar))),128))])])]),T("div",lr,[T("div",hr,"TOTAL "+F(i.value),1),T("div",dr,F(l.value),1)]),T("div",ur,[(A(),j(it(r.value),{"chart-data":u.value,"chart-options":c.value},null,8,["chart-data","chart-options"]))])])],8,tr))}}),pr=ue(gr,[["__scopeId","data-v-f914510d"]]);/*!
* chartjs-adapter-date-fns v3.0.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-date-fns Contributors
* Released under the MIT license
*/const mr={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Ft._date.override({_id:"date-fns",formats:function(){return mr},parse:function(n,e){if(n===null||typeof n>"u")return null;const t=typeof n;return t==="number"||n instanceof Date?n=v(n):t==="string"&&(typeof e=="string"?n=vs(n,e,new Date,this.options):n=Ds(n,this.options)),Yt(n)?n.getTime():null},format:function(n,e){return Ut(n,e,this.options)},add:function(n,e,t){switch(t){case"millisecond":return Me(n,e);case"second":return ni(n,e);case"minute":return si(n,e);case"hour":return ii(n,e);case"day":return Re(n,e);case"week":return oi(n,e);case"month":return Ie(n,e);case"quarter":return ri(n,e);case"year":return ai(n,e);default:return n}},diff:function(n,e,t){switch(t){case"millisecond":return ke(n,e);case"second":return gi(n,e);case"minute":return ui(n,e);case"hour":return di(n,e);case"day":return ft(n,e);case"week":return pi(n,e);case"month":return mt(n,e);case"quarter":return fi(n,e);case"year":return mi(n,e);default:return 0}},startOf:function(n,e,t){switch(e){case"second":return Cs(n);case"minute":return yi(n);case"hour":return Es(n);case"day":return Gt(n);case"week":return oe(n);case"isoWeek":return oe(n,{weekStartsOn:+t});case"month":return wi(n);case"quarter":return _i(n);case"year":return $t(n);default:return n}},endOf:function(n,e){switch(e){case"second":return Di(n);case"minute":return Ei(n);case"hour":return vi(n);case"day":return gt(n);case"week":return xi(n);case"month":return pt(n);case"quarter":return Ci(n);case"year":return bi(n);default:return n}}});const yr=Z({__name:"LineChart",props:{chartData:{},chartOptions:{}},setup(n){ot.register(at,lt,ht,qt,dt,ut,ct,Qt);const e=n,t=Ae(),i=I(()=>t.darkMode),s=I(()=>({...{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!0,position:"top",labels:{color:i.value?"white":"black"}},tooltip:{enabled:!0,backgroundColor:i.value?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:i.value?"black":"white",bodyColor:i.value?"black":"white"},title:{display:!0,text:"Line Chart",color:i.value?"white":"black"}},scales:{x:{ticks:{color:i.value?"white":"black"},grid:{color:i.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)"}},y:{ticks:{color:i.value?"white":"black"},grid:{color:i.value?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)"}}},interaction:{mode:"nearest",axis:"x",intersect:!1}},...e.chartOptions}));return(r,o)=>(A(),j(D(Xt),{data:r.chartData,options:s.value},null,8,["data","options"]))}}),_r=n=>(he("data-v-e509ec65"),n=n(),de(),n),wr=["id","gs-id","gs-x","gs-y","gs-w","gs-h"],br={class:"cpu-usage grid-stack-item-content grid-stack-item"},vr=_r(()=>T("div",{class:"cpu-usage__header"},[T("h3",{class:"cpu-usage__title"},"CPU Usage Timeline")],-1)),xr={class:"cpu-usage__selectors"},Er={class:"cpu-usage__selector-container"},Cr=["value"],Dr={class:"cpu-usage__chart-container"},Tr=2,Rr=5,Mr=Z({__name:"CpuUsageChart",props:{data:{}},setup(n){const e=Te(),t=V(0),i=I(()=>e.selectedRun),s=I(()=>{var l,u;return((u=(l=i.value)==null?void 0:l.processes[0])==null?void 0:u.iterationMetrics)||[]}),r=V({labels:[],datasets:[]}),o=()=>{const l=t.value;if(!i.value||!i.value.processes.length){r.value={labels:[],datasets:[]};return}const u=new Set;i.value.processes.forEach(f=>{const g=f.iterationMetrics[l];g&&g.length>1&&g.slice(1).forEach(y=>u.add(y.timestamp))});const c=Array.from(u).sort((f,g)=>f-g),h=i.value.processes.map((f,g)=>{const y=f.iterationMetrics[l];if(!y||y.length<=1)return null;const b=new Map(y.slice(1).map(m=>[m.timestamp,m.cpu_usage]));return{label:f.processName,data:c.map(m=>({x:m,y:b.get(m)??null})),backgroundColor:Ee(g),borderColor:Ee(g),borderWidth:1,fill:!1,tension:.1,spanGaps:!0}}).filter(Boolean);r.value={datasets:h}};st(()=>{o()}),se(t,o),se(()=>i.value,async()=>{await Le(),o()},{deep:!0});const a={responsive:!0,maintainAspectRatio:!1,scales:{y:{beginAtZero:!0,title:{display:!0,text:"CPU Usage (%)"}},x:{type:"time",time:{unit:"second",stepSize:1,displayFormats:{second:"HH:mm:ss"}},title:{display:!0,text:"Time"},ticks:{source:"auto",autoSkip:!1,maxRotation:0}}},plugins:{tooltip:{callbacks:{title:l=>{const u=l[0].parsed.x;return new Date(u).toLocaleString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}}}}};return(l,u)=>(A(),K("div",{id:l.data.id,"gs-id":l.data.id,"gs-x":l.data.grid.x,"gs-y":l.data.grid.y,"gs-w":l.data.grid.w,"gs-h":l.data.grid.h,"gs-min-w":Tr,"gs-min-h":Rr},[T("div",br,[vr,T("div",xr,[T("div",Er,[Rt(T("select",{id:"run-iteration-select","onUpdate:modelValue":u[0]||(u[0]=c=>t.value=c),onChange:o,class:"cpu-usage__select"},[(A(!0),K(Ce,null,De(s.value,(c,h)=>(A(),K("option",{key:h,value:h}," Iteration "+F(h+1),9,Cr))),128))],544),[[Mt,t.value]])])]),T("div",Dr,[z(yr,{chartData:r.value,chartOptions:a},null,8,["chartData"])])])],8,wr))}}),kr=ue(Mr,[["__scopeId","data-v-e509ec65"]]),Hr=n=>(he("data-v-9d7e6fbb"),n=n(),de(),n),Nr=["id","gs-id","gs-x","gs-y","gs-w","gs-h","gs-min-w","gs-min-h"],zr={class:"grid-stack-item-content grid-stack-item data-table__container"},Or=Hr(()=>T("div",{class:"data-table__header"},[T("div",{class:"data-table__title-container"},[T("h3",{class:"data-table__title"},"List of runs")])],-1)),Pr={class:"data-table__table-container"},Lr={class:"data-table__pagination-container"},Ar=Z({__name:"RunsTable",props:{data:{}},emits:["updatePage"],setup(n,{emit:e}){const t=n,i=e,s=Te(),r=I(()=>t.data.metadata.runs),o=I(()=>t.data.metadata.pagination),a=V(o.value.currentPage),l=I(()=>o.value.totalPages),u=I(()=>s.selectedRun),c=g=>{a.value=g,i("updatePage",g)},h=g=>{console.log("selectRun",g),s.setSelectedRun(g)};se(()=>o.value.currentPage,g=>{a.value=g}),se(r,g=>{g.length>0&&!u.value&&h(g[0])},{immediate:!0});const f=g=>new Date(g).toLocaleString();return(g,y)=>(A(),K("div",{id:g.data.id,"gs-id":g.data.id,"gs-x":g.data.grid.x,"gs-y":g.data.grid.y,"gs-w":g.data.grid.w,"gs-h":g.data.grid.h,"gs-min-w":g.minWidth,"gs-min-h":g.minHeight},[T("div",zr,[Or,T("div",Pr,[z(D(Zt),{hoverable:""},{default:R(()=>[z(D(Vt),{class:"data-table__table-header"},{default:R(()=>[z(D(te),{class:"data-table__table-head-cell"},{default:R(()=>[B("Region")]),_:1}),z(D(te),{class:"data-table__table-head-cell"},{default:R(()=>[B("Start Time")]),_:1}),z(D(te),{class:"data-table__table-head-cell"},{default:R(()=>[B("Duration")]),_:1}),z(D(te),{class:"data-table__table-head-cell"},{default:R(()=>[B("Power Consumption")]),_:1}),z(D(te),{class:"data-table__table-head-cell"},{default:R(()=>[B("Carbon Intensity")]),_:1}),z(D(te),{class:"data-table__table-head-cell"},{default:R(()=>[B("CO2 Emission")]),_:1})]),_:1}),z(D(jt),null,{default:R(()=>[(A(!0),K(Ce,null,De(r.value,(b,m)=>(A(),j(D(Kt),{key:m,class:tt([{"data-table__table-row--selected":b===u.value},"data-table__table-row"]),onClick:E=>h(b)},{default:R(()=>[z(D(ie),{class:"data-table__table-cell"},{default:R(()=>[B(F(b.region),1)]),_:2},1024),z(D(ie),{class:"data-table__table-cell"},{default:R(()=>[B(F(f(b.startTime)),1)]),_:2},1024),z(D(ie),{class:"data-table__table-cell"},{default:R(()=>[B(F(b.duration.toFixed(4))+" s",1)]),_:2},1024),z(D(ie),{class:"data-table__table-cell"},{default:R(()=>[B(F(b.pow.toFixed(4))+" Wh",1)]),_:2},1024),z(D(ie),{class:"data-table__table-cell"},{default:R(()=>[B(F(b.ci.toFixed(4))+" gWh",1)]),_:2},1024),z(D(ie),{class:"data-table__table-cell"},{default:R(()=>[B(F(b.co2.toFixed(4))+" g",1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1})]),T("div",Lr,[z(D(Jt),{modelValue:a.value,"onUpdate:modelValue":[y[0]||(y[0]=b=>a.value=b),c],"total-pages":l.value,"slice-length":5,class:"data-table__pagination",onPageChanged:c},null,8,["modelValue","total-pages"])])])],8,Nr))}}),Sr=ue(Ar,[["__scopeId","data-v-9d7e6fbb"]]),Ir=n=>(he("data-v-2a5b5df2"),n=n(),de(),n),Wr=Ir(()=>T("h1",{class:"main-layout__title"},"Scenario Detail",-1)),Br=Z({__name:"ScenarioDetail",setup(n){const t=et().params.scenarioName,i=ei(),s=Te(),r=V(!0),o=V([]),a=async m=>{try{r.value=!0,await i.fetchScenarioDetails(t,{page:m}),await s.initializeWidgets(t)}finally{o.value=s.scenarioWidgets[t]||[],r.value=!1}},l=V(null),u=V(null),c=m=>{switch(m){case Oe.CHART:return pr;case Oe.CPU_USAGE:return kr;case Oe.TABLE:return Sr;default:return null}},h=async()=>{await Le(),l.value&&(u.value=w.init({column:6,cellHeight:100,margin:10}),u.value.on("change",y),f(o.value))},f=m=>{m.forEach(E=>{g(E)})},g=m=>{var N;const E=(N=l.value)==null?void 0:N.querySelector(`[gs-id="${m.id}"]`);E&&u.value&&u.value.addWidget(E)},y=(m,E)=>{const N=E.map(U=>({id:U.id,x:U.x,y:U.y,w:U.w,h:U.h}));s.updateWidgetsPos(t,N)},b=async m=>{await i.fetchScenarioDetails(t,{page:m}),await s.updateWidgetsData(t,i.scenarioDetails[t])};return se(()=>o.value,async()=>{u.value&&(await Le(),g(o.value[o.value.length-1]))},{deep:!0}),se(()=>s.scenarioWidgets[t],m=>{o.value=m||[]}),kt(()=>{u.value&&u.value.destroy(!1)}),st(async()=>{await a(1),h()}),(m,E)=>(A(),j(ti,null,{title:R(()=>[Wr]),breadcrumbs:R(()=>[z(qs)]),dashboard:R(()=>[T("div",{ref_key:"gridContainer",ref:l,class:"grid-stack pd-0"},[(A(!0),K(Ce,null,De(o.value,N=>(A(),j(it(c(N.type)),{key:N.id,data:N,onUpdatePage:b},null,40,["data"]))),128))],512)]),_:1}))}}),$r=ue(Br,[["__scopeId","data-v-2a5b5df2"]]);export{$r as default};