@kong-ui-public/dashboard-renderer 10.6.1 → 10.6.2-pr.4102.c0e0091e7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function(ee,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-utilities"),require("@kong/icons"),require("@kong-ui-public/analytics-chart"),require("swrv"),require("@kong-ui-public/analytics-metric-provider"),require("ag-grid-vue3"),require("ag-grid-community"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-config-store"),require("@kong/kongponents"),require("vue-echarts"),require("echarts/core"),require("echarts/renderers"),require("echarts/components"),require("echarts/charts"),require("axios"),require("@kong-ui-public/analytics-geo-map")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-utilities","@kong/icons","@kong-ui-public/analytics-chart","swrv","@kong-ui-public/analytics-metric-provider","ag-grid-vue3","ag-grid-community","@kong-ui-public/i18n","@kong-ui-public/analytics-config-store","@kong/kongponents","vue-echarts","echarts/core","echarts/renderers","echarts/components","echarts/charts","axios","@kong-ui-public/analytics-geo-map"],n):(ee=typeof globalThis<"u"?globalThis:ee||self,n(ee["kong-ui-public-dashboard-renderer"]={},ee.Vue,ee["kong-ui-public-analytics-utilities"],ee.KongIcons,ee["kong-ui-public-analytics-chart"],ee.swrv,ee["kong-ui-public-analytics-metric-provider"],ee.AgGridVue,ee.agGridCommunity,ee["kong-ui-public-i18n"],ee["kong-ui-public-analytics-config-store"],ee.Kongponents,ee.VueECharts,ee.echarts,ee.echarts,ee.echarts,ee.echarts,ee.axios,ee["kong-ui-public-analytics-geo-map"]))})(this,(function(ee,n,re,se,Re,si,oi,Wr,je,ct,Se,ai,Vr,St,Yr,ut,li,r_,ci){"use strict";const Xr=r=>{const e=r.length;let t=5381;for(let i=0;i<e;i++)t=t*33^r.charCodeAt(i);return t>>>0},jr="#0044f4",ui="#6c7489",Qr="#d60027",Zr="#ffc400",Jr="#bee2ff",en="#8fc1ff",tn="#5f9aff",rn="#306fff",nn="#b5ffee",sn="#00fabe",on="#00d6a4",an="#00a17b",ln="#007d60",cn="#005944",un="#b5ffee",dn="#00fabe",hn="#b5ffee",fn="#00a17b",mn="#fff296",pn="#ffe04b",gn="#ffc400",_n="#b37600",yn="#995c00",Rn="#804400",Cn="#fff296",En="#ffe04b",bn="#ffc2b3",On="#ff9877",wn="#ff723c",Tn="#f75008",vn="#d13500",Sn="#a31f00",xn="#ffc2b3",In="#ff9877",Dn="#ff723c",kn="#f75008",Nn="#d13500",An="#a31f00",Ln="#ffc2b3",Un="#ff9877",Mn="#ff723c",Kn="#f75008",Bn="#d13500",zn="#a31f00",Pn="#ffc2b3",qn="#ff9877",Hn="#ff723c",Gn="#f75008",$n="#d13500",Fn="#a31f00",Wn="#ffc2b3",Vn="#ff9877",Yn="#ff723c",Xn="#f75008",jn="#d13500",Qn="#ffabab",Zn="#ff7272",Jn="#ff3954",es="#f50045",ts="#d60027",is="#ad000e",rs="#ffabab",ns="#ff7272",ss="#ff3954",os="#f50045",as="#d60027",ls="#eefaff",cs="#ecfffb",us="#fffce0",ds="#fff1ef",hs="#ffe5e5",fs="#5f9aff",ms="#00d6a4",ps="#ffc400",gs="#ff723c",_s="#ff3954",ys={100:Jr,101:en,102:tn,103:rn,200:nn,201:sn,202:on,203:an,204:ln,205:cn,206:un,207:dn,208:hn,226:fn,300:mn,301:pn,302:gn,303:_n,304:yn,305:Rn,307:Cn,308:En,400:bn,401:On,402:wn,403:Tn,404:vn,405:Sn,406:xn,407:In,408:Dn,409:kn,410:Nn,411:An,412:Ln,413:Un,414:Mn,415:Kn,416:Bn,417:zn,418:Pn,421:qn,422:Hn,423:Gn,424:$n,425:Fn,426:Wn,428:Vn,429:Yn,431:Xn,451:jn,500:Qn,501:Zn,502:Jn,503:es,504:ts,505:is,506:rs,507:ns,508:ss,510:os,511:as},Rs={100:ls,200:cs,300:us,400:ds,500:hs},di={"1XX":fs,"2XX":ms,"3XX":ps,"4XX":gs,"5XX":_s},Cs={error:Qr,warning:Zr,empty:"#9DA99D",neutral:ui,____OTHER____:jr},xt=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],It=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],Es=r=>Xr(r),bs=({theme:r="light"}={})=>r==="dark"?It:xt,hi=({discriminator:r,theme:e="light"})=>{const t=Math.abs(Math.floor(r));return e==="dark"?It[t%It.length]:xt[t%xt.length]},Qe=({state:r})=>Cs[r]??ui,Os=({statusCode:r})=>{const e=typeof r=="number"?r:Number.parseInt(r,10),t=`${e}`,i=`${Math.floor(e/100)*100}`;return ys[t]??Rs[i]??Qe({state:"neutral"})},ws=({group:r})=>di[r]?di[r]:Qe({state:"neutral"}),Ts=({discriminator:r=void 0,state:e=void 0,dimension:t=void 0,dimensionValue:i=void 0,metric:s=void 0,coordinator:o=void 0,order:a=void 0,chartUuid:l=void 0,customDimensionColors:u=void 0})=>{let c="light";if(n.hasInjectionContext()&&(c=n.inject("app:konnectColorMode",n.computed(()=>"light")).value),e!==void 0)return Qe({state:e});if(i!==void 0&&u!==void 0&&u[i])return u[i];if(i&&["empty","____OTHER____"].includes(i))return Qe({state:i});if(t!==void 0&&i!==void 0){if(t==="status_code")return Os({statusCode:i});if(t==="status_code_grouped")return ws({group:i})}if(r!==void 0)return hi({discriminator:r,theme:c});if(t||i||s){const d=`${t??""}${i??""}${s??""}`,h=o?o.resolveDiscriminator({name:d,order:a,chartUuid:l,theme:c}):Es(d);return hi({discriminator:h,theme:c})}return Qe({state:"neutral"})},vs="__no_chart__";function Ss(){const r=new Map,e=new Map,t=new Map,i=o=>{e.set(o,(e.get(o)??0)+1)},s=(o,a)=>{let l=-1,u=1/0;for(let c=0;c<o;c++){if(a.has(c))continue;const d=e.get(c)??0;d<u&&(l=c,u=d)}return l!==-1?l:o<1?0:s(o,new Set)};return{resolveDiscriminator:({name:o,order:a,chartUuid:l,theme:u})=>{const c=l??vs,d=a??null,h=bs({theme:u});let f;if(r.has(o))f=r.get(o);else{const p=new Set,C=t.get(c);d!==null&&C?.order!==null&&C?.order!==void 0&&d===C.order+1&&p.add(C.index);const O=h.length;f=s(O,p),r.set(o,f),i(f)}return t.set(c,{order:d,index:f}),f},reset:()=>{r.clear(),e.clear(),t.clear()}}}function xs(){const r=n.ref(null),e=n.ref(null),t=n.ref(null),i=n.ref(null),s=n.ref(null),o=300,a=300,l=10,u=Ss(),c=({chartUuid:h,timestamp:f=null,dimension:p=null,dimensionValue:C=null,metric:O=null})=>{r.value=h,e.value=f,t.value=p,i.value=C,s.value=O},d=({chartUuid:h})=>{r.value===h&&(r.value=null,e.value=null,t.value=null,i.value=null,s.value=null)};return{activate:c,activeChart:n.readonly(r),activeDimension:n.readonly(t),activeDimensionValue:n.readonly(i),activeMetric:n.readonly(s),activeTimestamp:n.readonly(e),deactivate:d,DIMENSION_DEBOUNCE_MS:o,METRIC_DEBOUNCE_MS:a,TIMESTAMP_DEBOUNCE_MS:l,color:u}}const Is={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ds=(r,e,t)=>{let i;const s=Is[r];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function Dt(r){return(e={})=>{const t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}const ks={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ns={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},As={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ls={date:Dt({formats:ks,defaultWidth:"full"}),time:Dt({formats:Ns,defaultWidth:"full"}),dateTime:Dt({formats:As,defaultWidth:"full"})},Us={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ms=(r,e,t,i)=>Us[r];function Ze(r){return(e,t)=>{const i=t?.context?String(t.context):"standalone";let s;if(i==="formatting"&&r.formattingValues){const a=r.defaultFormattingWidth||r.defaultWidth,l=t?.width?String(t.width):a;s=r.formattingValues[l]||r.formattingValues[a]}else{const a=r.defaultWidth,l=t?.width?String(t.width):r.defaultWidth;s=r.values[l]||r.values[a]}const o=r.argumentCallback?r.argumentCallback(e):e;return s[o]}}const Ks={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Bs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zs={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ps={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qs={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Hs={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Gs={ordinalNumber:(r,e)=>{const t=Number(r),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ze({values:Ks,defaultWidth:"wide"}),quarter:Ze({values:Bs,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Ze({values:zs,defaultWidth:"wide"}),day:Ze({values:Ps,defaultWidth:"wide"}),dayPeriod:Ze({values:qs,defaultWidth:"wide",formattingValues:Hs,defaultFormattingWidth:"wide"})};function Je(r){return(e,t={})=>{const i=t.width,s=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(l)?Fs(l,h=>h.test(a)):$s(l,h=>h.test(a));let c;c=r.valueCallback?r.valueCallback(u):u,c=t.valueCallback?t.valueCallback(c):c;const d=e.slice(a.length);return{value:c,rest:d}}}function $s(r,e){for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function Fs(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return t}function Ws(r){return(e,t={})=>{const i=e.match(r.matchPattern);if(!i)return null;const s=i[0],o=e.match(r.parsePattern);if(!o)return null;let a=r.valueCallback?r.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Vs=/^(\d+)(th|st|nd|rd)?/i,Ys=/\d+/i,Xs={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},js={any:[/^b/i,/^(a|c)/i]},Qs={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Zs={any:[/1/i,/2/i,/3/i,/4/i]},Js={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},eo={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},to={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},io={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ro={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},no={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},so={ordinalNumber:Ws({matchPattern:Vs,parsePattern:Ys,valueCallback:r=>parseInt(r,10)}),era:Je({matchPatterns:Xs,defaultMatchWidth:"wide",parsePatterns:js,defaultParseWidth:"any"}),quarter:Je({matchPatterns:Qs,defaultMatchWidth:"wide",parsePatterns:Zs,defaultParseWidth:"any",valueCallback:r=>r+1}),month:Je({matchPatterns:Js,defaultMatchWidth:"wide",parsePatterns:eo,defaultParseWidth:"any"}),day:Je({matchPatterns:to,defaultMatchWidth:"wide",parsePatterns:io,defaultParseWidth:"any"}),dayPeriod:Je({matchPatterns:ro,defaultMatchWidth:"any",parsePatterns:no,defaultParseWidth:"any"})},oo={code:"en-US",formatDistance:Ds,formatLong:Ls,formatRelative:Ms,localize:Gs,match:so,options:{weekStartsOn:0,firstWeekContainsDate:1}};let ao={};function et(){return ao}const fi=6048e5,lo=864e5,mi=Symbol.for("constructDateFrom");function Me(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&mi in r?r[mi](e):r instanceof Date?new r.constructor(e):new Date(e)}function xe(r,e){return Me(e||r,r)}function pi(r){const e=xe(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function co(r,...e){const t=Me.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function gi(r,e){const t=xe(r,e?.in);return t.setHours(0,0,0,0),t}function uo(r,e,t){const[i,s]=co(t?.in,r,e),o=gi(i),a=gi(s),l=+o-pi(o),u=+a-pi(a);return Math.round((l-u)/lo)}function ho(r,e){const t=xe(r,e?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function fo(r,e){const t=xe(r,e?.in);return uo(t,ho(t))+1}function tt(r,e){const t=et(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,s=xe(r,e?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function dt(r,e){return tt(r,{...e,weekStartsOn:1})}function _i(r,e){const t=xe(r,e?.in),i=t.getFullYear(),s=Me(t,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=dt(s),a=Me(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=dt(a);return t.getTime()>=o.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function mo(r,e){const t=_i(r,e),i=Me(r,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),dt(i)}function po(r,e){const t=xe(r,e?.in),i=+dt(t)-+mo(t);return Math.round(i/fi)+1}function yi(r,e){const t=xe(r,e?.in),i=t.getFullYear(),s=et(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=Me(e?.in||r,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const l=tt(a,e),u=Me(e?.in||r,0);u.setFullYear(i,0,o),u.setHours(0,0,0,0);const c=tt(u,e);return+t>=+l?i+1:+t>=+c?i:i-1}function go(r,e){const t=et(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,s=yi(r,e),o=Me(e?.in||r,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),tt(o,e)}function _o(r,e){const t=xe(r,e?.in),i=+tt(t,e)-+go(t,e);return Math.round(i/fi)+1}function le(r,e){const t=r<0?"-":"",i=Math.abs(r).toString().padStart(e,"0");return t+i}const Ke={y(r,e){const t=r.getFullYear(),i=t>0?t:1-t;return le(e==="yy"?i%100:i,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):le(t+1,2)},d(r,e){return le(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];default:return t==="am"?"a.m.":"p.m."}},h(r,e){return le(r.getHours()%12||12,e.length)},H(r,e){return le(r.getHours(),e.length)},m(r,e){return le(r.getMinutes(),e.length)},s(r,e){return le(r.getSeconds(),e.length)},S(r,e){const t=e.length,i=r.getMilliseconds(),s=Math.trunc(i*Math.pow(10,t-3));return le(s,e.length)}},We={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ri={G:function(r,e,t){const i=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});default:return t.era(i,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const i=r.getFullYear(),s=i>0?i:1-i;return t.ordinalNumber(s,{unit:"year"})}return Ke.y(r,e)},Y:function(r,e,t,i){const s=yi(r,i),o=s>0?s:1-s;if(e==="YY"){const a=o%100;return le(a,2)}return e==="Yo"?t.ordinalNumber(o,{unit:"year"}):le(o,e.length)},R:function(r,e){const t=_i(r);return le(t,e.length)},u:function(r,e){const t=r.getFullYear();return le(t,e.length)},Q:function(r,e,t){const i=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return le(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,e,t){const i=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return le(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,e,t){const i=r.getMonth();switch(e){case"M":case"MM":return Ke.M(r,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(r,e,t){const i=r.getMonth();switch(e){case"L":return String(i+1);case"LL":return le(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(r,e,t,i){const s=_o(r,i);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):le(s,e.length)},I:function(r,e,t){const i=po(r);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):le(i,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):Ke.d(r,e)},D:function(r,e,t){const i=fo(r);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):le(i,e.length)},E:function(r,e,t){const i=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(r,e,t,i){const s=r.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return le(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(s,{width:"short",context:"formatting"});default:return t.day(s,{width:"wide",context:"formatting"})}},c:function(r,e,t,i){const s=r.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return le(o,e.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(s,{width:"narrow",context:"standalone"});case"cccccc":return t.day(s,{width:"short",context:"standalone"});default:return t.day(s,{width:"wide",context:"standalone"})}},i:function(r,e,t){const i=r.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return le(s,e.length);case"io":return t.ordinalNumber(s,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(r,e,t){const s=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(s,{width:"narrow",context:"formatting"});default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(r,e,t){const i=r.getHours();let s;switch(i===12?s=We.noon:i===0?s=We.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(s,{width:"narrow",context:"formatting"});default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(r,e,t){const i=r.getHours();let s;switch(i>=17?s=We.evening:i>=12?s=We.afternoon:i>=4?s=We.morning:s=We.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(s,{width:"narrow",context:"formatting"});default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let i=r.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return Ke.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):Ke.H(r,e)},K:function(r,e,t){const i=r.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):le(i,e.length)},k:function(r,e,t){let i=r.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):le(i,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):Ke.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):Ke.s(r,e)},S:function(r,e){return Ke.S(r,e)},X:function(r,e,t){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Ei(i);case"XXXX":case"XX":return qe(i);default:return qe(i,":")}},x:function(r,e,t){const i=r.getTimezoneOffset();switch(e){case"x":return Ei(i);case"xxxx":case"xx":return qe(i);default:return qe(i,":")}},O:function(r,e,t){const i=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ci(i,":");default:return"GMT"+qe(i,":")}},z:function(r,e,t){const i=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ci(i,":");default:return"GMT"+qe(i,":")}},t:function(r,e,t){const i=Math.trunc(+r/1e3);return le(i,e.length)},T:function(r,e,t){return le(+r,e.length)}};function Ci(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=Math.trunc(i/60),o=i%60;return o===0?t+String(s):t+String(s)+e+le(o,2)}function Ei(r,e){return r%60===0?(r>0?"-":"+")+le(Math.abs(r)/60,2):qe(r,e)}function qe(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=le(Math.trunc(i/60),2),o=le(i%60,2);return t+s+e+o}const bi=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Oi=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},yo={p:Oi,P:(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],i=t[1],s=t[2];if(!s)return bi(r,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",bi(i,e)).replace("{{time}}",Oi(s,e))}},Ro=/^D+$/,Co=/^Y+$/,Eo=["D","DD","YY","YYYY"];function bo(r){return Ro.test(r)}function Oo(r){return Co.test(r)}function wo(r,e,t){const i=To(r,e,t);if(console.warn(i),Eo.includes(r))throw new RangeError(i)}function To(r,e,t){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function vo(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function So(r){return!(!vo(r)&&typeof r!="number"||isNaN(+xe(r)))}const xo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Io=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Do=/^'([^]*?)'?$/,ko=/''/g,No=/[a-zA-Z]/;function Ao(r,e,t){const i=et(),s=t?.locale??i.locale??oo,o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=xe(r,t?.in);if(!So(l))throw new RangeError("Invalid time value");let u=e.match(Io).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=yo[h];return f(d,s.formatLong)}return d}).join("").match(xo).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:Lo(d)};if(Ri[h])return{isToken:!0,value:d};if(h.match(No))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(u=s.localize.preprocessor(l,u));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return u.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!t?.useAdditionalWeekYearTokens&&Oo(h)||!t?.useAdditionalDayOfYearTokens&&bo(h))&&wo(h,e,String(r));const f=Ri[h[0]];return f(l,h,s.localize,c)}).join("")}function Lo(r){const e=r.match(Do);return e?e[1].replace(ko,"'"):r}function Uo(){return Object.assign({},et())}function wi(r,e,t){const i=Uo(),s=Bo(r,t.timeZone,t.locale??i.locale);return"formatToParts"in s?Mo(s,e):Ko(s,e)}function Mo(r,e){const t=r.formatToParts(e);for(let i=t.length-1;i>=0;--i)if(t[i].type==="timeZoneName")return t[i].value}function Ko(r,e){const t=r.format(e).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(t);return i?i[0].substr(1):""}function Bo(r,e,t){return new Intl.DateTimeFormat(t?[t.code,"en-US"]:void 0,{timeZone:e,timeZoneName:r})}function zo(r,e){const t=$o(e);return"formatToParts"in t?qo(t,r):Ho(t,r)}const Po={year:0,month:1,day:2,hour:3,minute:4,second:5};function qo(r,e){try{const t=r.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const o=Po[t[s].type];o!==void 0&&(i[o]=parseInt(t[s].value,10))}return i}catch(t){if(t instanceof RangeError)return[NaN];throw t}}function Ho(r,e){const t=r.format(e),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const kt={},Ti=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Go=Ti==="06/25/2014, 00:00:00"||Ti==="06/25/2014 00:00:00";function $o(r){return kt[r]||(kt[r]=Go?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:r,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),kt[r]}function vi(r,e,t,i,s,o,a){const l=new Date(0);return l.setUTCFullYear(r,e,t),l.setUTCHours(i,s,o,a),l}const Si=36e5,Fo=6e4,Nt={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function At(r,e,t){if(!r)return 0;let i=Nt.timezoneZ.exec(r);if(i)return 0;let s,o;if(i=Nt.timezoneHH.exec(r),i)return s=parseInt(i[1],10),xi(s)?-(s*Si):NaN;if(i=Nt.timezoneHHMM.exec(r),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return xi(s,a)?(o=Math.abs(s)*Si+a*Fo,i[1]==="+"?-o:o):NaN}if(Yo(r)){e=new Date(e||Date.now());const a=t?e:Wo(e),l=Lt(a,r);return-(t?l:Vo(e,l,r))}return NaN}function Wo(r){return vi(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())}function Lt(r,e){const t=zo(r,e),i=vi(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime();let s=r.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function Vo(r,e,t){let s=r.getTime()-e;const o=Lt(new Date(s),t);if(e===o)return e;s-=o-e;const a=Lt(new Date(s),t);return o===a?o:Math.max(o,a)}function xi(r,e){return-23<=r&&r<=23&&(e==null||0<=e&&e<=59)}const Ii={};function Yo(r){if(Ii[r])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:r}),Ii[r]=!0,!0}catch{return!1}}const Xo=60*1e3,jo={X:function(r,e,t){const i=Ut(t.timeZone,r);if(i===0)return"Z";switch(e){case"X":return Di(i);case"XXXX":case"XX":return Ve(i);default:return Ve(i,":")}},x:function(r,e,t){const i=Ut(t.timeZone,r);switch(e){case"x":return Di(i);case"xxxx":case"xx":return Ve(i);default:return Ve(i,":")}},O:function(r,e,t){const i=Ut(t.timeZone,r);switch(e){case"O":case"OO":case"OOO":return"GMT"+Qo(i,":");default:return"GMT"+Ve(i,":")}},z:function(r,e,t){switch(e){case"z":case"zz":case"zzz":return wi("short",r,t);default:return wi("long",r,t)}}};function Ut(r,e){const t=r?At(r,e,!0)/Xo:e?.getTimezoneOffset()??0;if(Number.isNaN(t))throw new RangeError("Invalid time zone specified: "+r);return t}function ht(r,e){const t=r<0?"-":"";let i=Math.abs(r).toString();for(;i.length<e;)i="0"+i;return t+i}function Ve(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=ht(Math.floor(i/60),2),o=ht(Math.floor(i%60),2);return t+s+e+o}function Di(r,e){return r%60===0?(r>0?"-":"+")+ht(Math.abs(r)/60,2):Ve(r,e)}function Qo(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=Math.floor(i/60),o=i%60;return o===0?t+String(s):t+String(s)+e+ht(o,2)}function ki(r){const e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+r-+e}const Zo=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mt=36e5,Ni=6e4,Jo=2,Ce={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Zo};function Ai(r,e={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(r===null)return new Date(NaN);const t=e.additionalDigits==null?Jo:Number(e.additionalDigits);if(t!==2&&t!==1&&t!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]")return new Date(r.getTime());if(typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]")return new Date(r);if(Object.prototype.toString.call(r)!=="[object String]")return new Date(NaN);const i=ea(r),{year:s,restDateString:o}=ta(i.date,t),a=ia(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,c;if(i.time&&(u=ra(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(c=At(i.timeZone||e.timeZone,new Date(l+u)),isNaN(c))return new Date(NaN)}else c=ki(new Date(l+u)),c=ki(new Date(l+u+c));return new Date(l+u+c)}else return new Date(NaN)}function ea(r){const e={};let t=Ce.dateTimePattern.exec(r),i;if(t?(e.date=t[1],i=t[3]):(t=Ce.datePattern.exec(r),t?(e.date=t[1],i=t[2]):(e.date=null,i=r)),i){const s=Ce.timeZone.exec(i);s?(e.time=i.replace(s[1],""),e.timeZone=s[1].trim()):e.time=i}return e}function ta(r,e){if(r){const t=Ce.YYY[e],i=Ce.YYYYY[e];let s=Ce.YYYY.exec(r)||i.exec(r);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:r.slice(o.length)}}if(s=Ce.YY.exec(r)||t.exec(r),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:r.slice(o.length)}}}return{year:null}}function ia(r,e){if(e===null)return null;let t,i,s;if(!r||!r.length)return t=new Date(0),t.setUTCFullYear(e),t;let o=Ce.MM.exec(r);if(o)return t=new Date(0),i=parseInt(o[1],10)-1,Mi(e,i)?(t.setUTCFullYear(e,i),t):new Date(NaN);if(o=Ce.DDD.exec(r),o){t=new Date(0);const a=parseInt(o[1],10);return oa(e,a)?(t.setUTCFullYear(e,0,a),t):new Date(NaN)}if(o=Ce.MMDD.exec(r),o){t=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return Mi(e,i,a)?(t.setUTCFullYear(e,i,a),t):new Date(NaN)}if(o=Ce.Www.exec(r),o)return s=parseInt(o[1],10)-1,Ki(s)?Li(e,s):new Date(NaN);if(o=Ce.WwwD.exec(r),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return Ki(s,a)?Li(e,s,a):new Date(NaN)}return null}function ra(r){let e,t,i=Ce.HH.exec(r);if(i)return e=parseFloat(i[1].replace(",",".")),Kt(e)?e%24*Mt:NaN;if(i=Ce.HHMM.exec(r),i)return e=parseInt(i[1],10),t=parseFloat(i[2].replace(",",".")),Kt(e,t)?e%24*Mt+t*Ni:NaN;if(i=Ce.HHMMSS.exec(r),i){e=parseInt(i[1],10),t=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Kt(e,t,s)?e%24*Mt+t*Ni+s*1e3:NaN}return null}function Li(r,e,t){e=e||0,t=t||0;const i=new Date(0);i.setUTCFullYear(r,0,4);const s=i.getUTCDay()||7,o=e*7+t+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const na=[31,28,31,30,31,30,31,31,30,31,30,31],sa=[31,29,31,30,31,30,31,31,30,31,30,31];function Ui(r){return r%400===0||r%4===0&&r%100!==0}function Mi(r,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;const i=Ui(r);if(i&&t>sa[e]||!i&&t>na[e])return!1}return!0}function oa(r,e){if(e<1)return!1;const t=Ui(r);return!(t&&e>366||!t&&e>365)}function Ki(r,e){return!(r<0||r>52||e!=null&&(e<0||e>6))}function Kt(r,e,t){return!(r<0||r>=25||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}const aa=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Bt(r,e,t={}){e=String(e);const i=e.match(aa);if(i){const s=Ai(t.originalDate||r,t);e=i.reduce(function(o,a){if(a[0]==="'")return o;const l=o.indexOf(a),u=o[l-1]==="'",c=o.replace(a,"'"+jo[a[0]](s,a,t)+"'");return u?c.substring(0,l-1)+c.substring(l+1):c},e)}return Ao(r,e,t)}function la(r,e,t){r=Ai(r,t);const i=At(e,r,!0),s=new Date(r.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function ca(r,e,t,i){return i={...i,timeZone:e,originalDate:r},Bt(la(r,e,{timeZone:i.timeZone}),t,i)}const ua="#6c7489",da="768px",Bi="12px",ha="16px",zi="32px",fa="12px",Pi="20px";var ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ma(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var mt={exports:{}},pa=mt.exports,qi;function ga(){return qi||(qi=1,(function(r,e){(function(t,i){i()})(pa,function(){function t(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,d,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){u(f.response,d,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ft=="object"&&ft.global===ft?ft:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(c,d,h){var f=a.URL||a.webkitURL,p=document.createElement("a");d=d||c.name||"download",p.download=d,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?o(p):s(p.href)?i(c,d,h):o(p,p.target="_blank")):(p.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(p.href)},4e4),setTimeout(function(){o(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,h){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(t(c,h),d);else if(s(c))i(c,d,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){o(f)})}}:function(c,d,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,d,h);var p=c.type==="application/octet-stream",C=/constructor/i.test(a.HTMLElement)||a.safari,O=/CriOS\/[\d]+/.test(navigator.userAgent);if((O||p&&C||l)&&typeof FileReader<"u"){var R=new FileReader;R.onloadend=function(){var b=R.result;b=O?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=b:location=b,f=null},R.readAsDataURL(c)}else{var T=a.URL||a.webkitURL,P=T.createObjectURL(c);f?f.location=P:location.href=P,f=null,setTimeout(function(){T.revokeObjectURL(P)},4e4)}});a.saveAs=u.saveAs=u,r.exports=u})})(mt)),mt.exports}var _a=ga(),pt={exports:{}};var ya=pt.exports,Hi;function Ra(){return Hi||(Hi=1,(function(r,e){((t,i)=>{r.exports=i()})(ya,function t(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function c(g){return g.charCodeAt(0)===65279?g.slice(1):g}function d(g){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(m){var _=k(m);_.chunkSize=parseInt(_.chunkSize),m.step||m.chunk||(_.chunkSize=null),this._handle=new O(_),(this._handle.streamer=this)._config=_}).call(this,g),this.parseChunk=function(m,_){var U=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<U){let F=this._config.newline;F||(A=this._config.quoteChar||'"',F=this._handle.guessLineEndings(m,A)),m=[...m.split(F).slice(U)].join(F)}this.isFirstChunk&&K(this._config.beforeFirstChunk)&&(A=this._config.beforeFirstChunk(m))!==void 0&&(m=A),this.isFirstChunk=!1,this._halted=!1;var U=this._partialLine+m,A=(this._partialLine="",this._handle.parse(U,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(m=A.meta.cursor,U=(this._finished||(this._partialLine=U.substring(m-this._baseIndex),this._baseIndex=m),A&&A.data&&(this._rowCount+=A.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)i.postMessage({results:A,workerId:u.WORKER_ID,finished:U});else if(K(this._config.chunk)&&!_){if(this._config.chunk(A,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=A=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(A.data),this._completeResults.errors=this._completeResults.errors.concat(A.errors),this._completeResults.meta=A.meta),this._completed||!U||!K(this._config.complete)||A&&A.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),U||A&&A.meta.paused||this._nextChunk(),A}this._halted=!0},this._sendError=function(m){K(this._config.error)?this._config.error(m):o&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:m,finished:!1})}}function h(g){var m;(g=g||{}).chunkSize||(g.chunkSize=u.RemoteChunkSize),d.call(this,g),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(_){this._input=_,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(m=new XMLHttpRequest,this._config.withCredentials&&(m.withCredentials=this._config.withCredentials),s||(m.onload=x(this._chunkLoaded,this),m.onerror=x(this._chunkError,this)),m.ontimeout=x(this._chunkTimeout,this),m.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadTimeout&&!s&&(m.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var _,U=this._config.downloadRequestHeaders;for(_ in U)m.setRequestHeader(_,U[_])}var A;this._config.chunkSize&&(A=this._start+this._config.chunkSize-1,m.setRequestHeader("Range","bytes="+this._start+"-"+A));try{m.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}s&&m.status===0&&this._chunkError()}},this._chunkLoaded=function(){m.readyState===4&&(m.status<200||400<=m.status?this._chunkError():(this._start+=this._config.chunkSize||m.responseText.length,this._finished=!this._config.chunkSize||this._start>=(_=>(_=_.getResponseHeader("Content-Range"))!==null?parseInt(_.substring(_.lastIndexOf("/")+1)):-1)(m),this.parseChunk(m.responseText)))},this._chunkError=function(_){_=m.statusText||_,this._sendError(new Error(_))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function f(g){(g=g||{}).chunkSize||(g.chunkSize=u.LocalChunkSize),d.call(this,g);var m,_,U=typeof FileReader<"u";this.stream=function(A){this._input=A,_=A.slice||A.webkitSlice||A.mozSlice,U?((m=new FileReader).onload=x(this._chunkLoaded,this),m.onerror=x(this._chunkError,this)):m=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var A=this._input,F=(this._config.chunkSize&&(F=Math.min(this._start+this._config.chunkSize,this._input.size),A=_.call(A,this._start,F)),m.readAsText(A,this._config.encoding));U||this._chunkLoaded({target:{result:F}})},this._chunkLoaded=function(A){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(A.target.result)},this._chunkError=function(){this._sendError(m.error)}}function p(g){var m;d.call(this,g=g||{}),this.stream=function(_){return m=_,this._nextChunk()},this._nextChunk=function(){var _,U;if(!this._finished)return _=this._config.chunkSize,m=_?(U=m.substring(0,_),m.substring(_)):(U=m,""),this._finished=!m,this.parseChunk(U)}}function C(g){d.call(this,g=g||{});var m=[],_=!0,U=!1;this.pause=function(){d.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){d.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(A){this._input=A,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){U&&m.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),m.length?this.parseChunk(m.shift()):_=!0},this._streamData=x(function(A){try{m.push(typeof A=="string"?A:A.toString(this._config.encoding)),_&&(_=!1,this._checkIsFinished(),this.parseChunk(m.shift()))}catch(F){this._streamError(F)}},this),this._streamError=x(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=x(function(){this._streamCleanUp(),U=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function O(g){var m,_,U,A,F=Math.pow(2,53),v=-F,q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,V=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,W=this,w=0,S=0,G=!1,M=!1,D=[],N={data:[],errors:[],meta:{}};function oe(ie){return g.skipEmptyLines==="greedy"?ie.join("").trim()==="":ie.length===1&&ie[0].length===0}function ae(){if(N&&U&&(ge("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),U=!1),g.skipEmptyLines&&(N.data=N.data.filter(function(z){return!oe(z)})),de()){let z=function(Y){D.push(Y)};if(N)if(Array.isArray(N.data[0])){for(var ie=0;de()&&ie<N.data.length;ie++)N.data[ie].forEach(z);N.data.splice(0,1)}else N.data.forEach(z)}function I(z,Y){for(var J=g.header?{}:[],L=0;L<z.length;L++){var $=L,j=z[L],j=((ce,Z)=>(ne=>(g.dynamicTypingFunction&&g.dynamicTyping[ne]===void 0&&(g.dynamicTyping[ne]=g.dynamicTypingFunction(ne)),(g.dynamicTyping[ne]||g.dynamicTyping)===!0))(ce)?Z==="true"||Z==="TRUE"||Z!=="false"&&Z!=="FALSE"&&((ne=>{if(q.test(ne)&&(ne=parseFloat(ne),v<ne&&ne<F))return 1})(Z)?parseFloat(Z):V.test(Z)?new Date(Z):Z===""?null:Z):Z)($=g.header?L>=D.length?"__parsed_extra":D[L]:$,j=g.transform?g.transform(j,$):j);$==="__parsed_extra"?(J[$]=J[$]||[],J[$].push(j)):J[$]=j}return g.header&&(L>D.length?ge("FieldMismatch","TooManyFields","Too many fields: expected "+D.length+" fields but parsed "+L,S+Y):L<D.length&&ge("FieldMismatch","TooFewFields","Too few fields: expected "+D.length+" fields but parsed "+L,S+Y)),J}var B;N&&(g.header||g.dynamicTyping||g.transform)&&(B=1,!N.data.length||Array.isArray(N.data[0])?(N.data=N.data.map(I),B=N.data.length):N.data=I(N.data,0),g.header&&N.meta&&(N.meta.fields=D),S+=B)}function de(){return g.header&&D.length===0}function ge(ie,I,B,z){ie={type:ie,code:I,message:B},z!==void 0&&(ie.row=z),N.errors.push(ie)}K(g.step)&&(A=g.step,g.step=function(ie){N=ie,de()?ae():(ae(),N.data.length!==0&&(w+=ie.data.length,g.preview&&w>g.preview?_.abort():(N.data=N.data[0],A(N,W))))}),this.parse=function(ie,I,B){var z=g.quoteChar||'"',z=(g.newline||(g.newline=this.guessLineEndings(ie,z)),U=!1,g.delimiter?K(g.delimiter)&&(g.delimiter=g.delimiter(ie),N.meta.delimiter=g.delimiter):((z=((Y,J,L,$,j)=>{var ce,Z,ne,me;j=j||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var _e=0;_e<j.length;_e++){for(var Oe,ze=j[_e],fe=0,we=0,he=0,ye=(ne=void 0,new T({comments:$,delimiter:ze,newline:J,preview:10}).parse(Y)),Te=0;Te<ye.data.length;Te++)L&&oe(ye.data[Te])?he++:(Oe=ye.data[Te].length,we+=Oe,ne===void 0?ne=Oe:0<Oe&&(fe+=Math.abs(Oe-ne),ne=Oe));0<ye.data.length&&(we/=ye.data.length-he),1.99<we&&(Z===void 0||fe<Z||fe===Z&&me<we)&&(Z=fe,ce=ze,me=we)}return{successful:!!(g.delimiter=ce),bestDelimiter:ce}})(ie,g.newline,g.skipEmptyLines,g.comments,g.delimitersToGuess)).successful?g.delimiter=z.bestDelimiter:(U=!0,g.delimiter=u.DefaultDelimiter),N.meta.delimiter=g.delimiter),k(g));return z.header=de(),g.preview&&g.header&&z.preview++,m=ie,_=new T(z),N=_.parse(m,I,B),ae(),G?{meta:{paused:!0}}:N||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,_.abort(),m=K(g.chunk)?"":m.substring(_.getCharIndex())},this.resume=function(){W.streamer._halted?(G=!1,W.streamer.parseChunk(m,!0)):setTimeout(W.resume,3)},this.aborted=function(){return M},this.abort=function(){M=!0,_.abort(),N.meta.aborted=!0,K(g.complete)&&g.complete(N),m=""},this.guessLineEndings=function(Y,z){Y=Y.substring(0,1048576);var z=new RegExp(R(z)+"([^]*?)"+R(z),"gm"),B=(Y=Y.replace(z,"")).split("\r"),z=Y.split(`
|
|
1
|
+
(function(ee,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@kong-ui-public/analytics-utilities"),require("@kong/icons"),require("@kong-ui-public/analytics-chart"),require("swrv"),require("@kong-ui-public/analytics-metric-provider"),require("ag-grid-vue3"),require("ag-grid-community"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-config-store"),require("@kong/kongponents"),require("vue-echarts"),require("echarts/core"),require("echarts/renderers"),require("echarts/components"),require("echarts/charts"),require("axios"),require("@kong-ui-public/analytics-geo-map")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/analytics-utilities","@kong/icons","@kong-ui-public/analytics-chart","swrv","@kong-ui-public/analytics-metric-provider","ag-grid-vue3","ag-grid-community","@kong-ui-public/i18n","@kong-ui-public/analytics-config-store","@kong/kongponents","vue-echarts","echarts/core","echarts/renderers","echarts/components","echarts/charts","axios","@kong-ui-public/analytics-geo-map"],n):(ee=typeof globalThis<"u"?globalThis:ee||self,n(ee["kong-ui-public-dashboard-renderer"]={},ee.Vue,ee["kong-ui-public-analytics-utilities"],ee.KongIcons,ee["kong-ui-public-analytics-chart"],ee.swrv,ee["kong-ui-public-analytics-metric-provider"],ee.AgGridVue,ee.agGridCommunity,ee["kong-ui-public-i18n"],ee["kong-ui-public-analytics-config-store"],ee.Kongponents,ee.VueECharts,ee.echarts,ee.echarts,ee.echarts,ee.echarts,ee.axios,ee["kong-ui-public-analytics-geo-map"]))})(this,(function(ee,n,re,se,Re,si,oi,Wr,je,ct,Se,ai,Vr,St,Yr,ut,li,r_,ci){"use strict";const Xr=r=>{const e=r.length;let t=5381;for(let i=0;i<e;i++)t=t*33^r.charCodeAt(i);return t>>>0},jr="#0044f4",ui="#6c7489",Qr="#d60027",Zr="#ffc400",Jr="#bee2ff",en="#8fc1ff",tn="#5f9aff",rn="#306fff",nn="#b5ffee",sn="#00fabe",on="#00d6a4",an="#00a17b",ln="#007d60",cn="#005944",un="#b5ffee",dn="#00fabe",hn="#b5ffee",fn="#00a17b",mn="#fff296",pn="#ffe04b",gn="#ffc400",_n="#b37600",yn="#995c00",Rn="#804400",Cn="#fff296",En="#ffe04b",bn="#ffc2b3",On="#ff9877",wn="#ff723c",Tn="#f75008",vn="#d13500",Sn="#a31f00",xn="#ffc2b3",In="#ff9877",kn="#ff723c",Dn="#f75008",Nn="#d13500",An="#a31f00",Ln="#ffc2b3",Un="#ff9877",Mn="#ff723c",Kn="#f75008",Bn="#d13500",zn="#a31f00",Pn="#ffc2b3",qn="#ff9877",Hn="#ff723c",Gn="#f75008",$n="#d13500",Fn="#a31f00",Wn="#ffc2b3",Vn="#ff9877",Yn="#ff723c",Xn="#f75008",jn="#d13500",Qn="#ffabab",Zn="#ff7272",Jn="#ff3954",es="#f50045",ts="#d60027",is="#ad000e",rs="#ffabab",ns="#ff7272",ss="#ff3954",os="#f50045",as="#d60027",ls="#eefaff",cs="#ecfffb",us="#fffce0",ds="#fff1ef",hs="#ffe5e5",fs="#5f9aff",ms="#00d6a4",ps="#ffc400",gs="#ff723c",_s="#ff3954",ys={100:Jr,101:en,102:tn,103:rn,200:nn,201:sn,202:on,203:an,204:ln,205:cn,206:un,207:dn,208:hn,226:fn,300:mn,301:pn,302:gn,303:_n,304:yn,305:Rn,307:Cn,308:En,400:bn,401:On,402:wn,403:Tn,404:vn,405:Sn,406:xn,407:In,408:kn,409:Dn,410:Nn,411:An,412:Ln,413:Un,414:Mn,415:Kn,416:Bn,417:zn,418:Pn,421:qn,422:Hn,423:Gn,424:$n,425:Fn,426:Wn,428:Vn,429:Yn,431:Xn,451:jn,500:Qn,501:Zn,502:Jn,503:es,504:ts,505:is,506:rs,507:ns,508:ss,510:os,511:as},Rs={100:ls,200:cs,300:us,400:ds,500:hs},di={"1XX":fs,"2XX":ms,"3XX":ps,"4XX":gs,"5XX":_s},Cs={error:Qr,warning:Zr,empty:"#9DA99D",neutral:ui,____OTHER____:jr},xt=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],It=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],Es=r=>Xr(r),bs=({theme:r="light"}={})=>r==="dark"?It:xt,hi=({discriminator:r,theme:e="light"})=>{const t=Math.abs(Math.floor(r));return e==="dark"?It[t%It.length]:xt[t%xt.length]},Qe=({state:r})=>Cs[r]??ui,Os=({statusCode:r})=>{const e=typeof r=="number"?r:Number.parseInt(r,10),t=`${e}`,i=`${Math.floor(e/100)*100}`;return ys[t]??Rs[i]??Qe({state:"neutral"})},ws=({group:r})=>di[r]?di[r]:Qe({state:"neutral"}),Ts=({discriminator:r=void 0,state:e=void 0,dimension:t=void 0,dimensionValue:i=void 0,metric:s=void 0,coordinator:o=void 0,order:a=void 0,chartUuid:l=void 0,customDimensionColors:u=void 0})=>{let c="light";if(n.hasInjectionContext()&&(c=n.inject("app:konnectColorMode",n.computed(()=>"light")).value),e!==void 0)return Qe({state:e});if(i!==void 0&&u!==void 0&&u[i])return u[i];if(i&&["empty","____OTHER____"].includes(i))return Qe({state:i});if(t!==void 0&&i!==void 0){if(t==="status_code")return Os({statusCode:i});if(t==="status_code_grouped")return ws({group:i})}if(r!==void 0)return hi({discriminator:r,theme:c});if(t||i||s){const d=`${t??""}${i??""}${s??""}`,h=o?o.resolveDiscriminator({name:d,order:a,chartUuid:l,theme:c}):Es(d);return hi({discriminator:h,theme:c})}return Qe({state:"neutral"})},vs="__no_chart__";function Ss(){const r=new Map,e=new Map,t=new Map,i=o=>{e.set(o,(e.get(o)??0)+1)},s=(o,a)=>{let l=-1,u=1/0;for(let c=0;c<o;c++){if(a.has(c))continue;const d=e.get(c)??0;d<u&&(l=c,u=d)}return l!==-1?l:o<1?0:s(o,new Set)};return{resolveDiscriminator:({name:o,order:a,chartUuid:l,theme:u})=>{const c=l??vs,d=a??null,h=bs({theme:u});let f;if(r.has(o))f=r.get(o);else{const p=new Set,C=t.get(c);d!==null&&C?.order!==null&&C?.order!==void 0&&d===C.order+1&&p.add(C.index);const O=h.length;f=s(O,p),r.set(o,f),i(f)}return t.set(c,{order:d,index:f}),f},reset:()=>{r.clear(),e.clear(),t.clear()}}}function xs(){const r=n.ref(null),e=n.ref(null),t=n.ref(null),i=n.ref(null),s=n.ref(null),o=300,a=300,l=10,u=Ss(),c=({chartUuid:h,timestamp:f=null,dimension:p=null,dimensionValue:C=null,metric:O=null})=>{r.value=h,e.value=f,t.value=p,i.value=C,s.value=O},d=({chartUuid:h})=>{r.value===h&&(r.value=null,e.value=null,t.value=null,i.value=null,s.value=null)};return{activate:c,activeChart:n.readonly(r),activeDimension:n.readonly(t),activeDimensionValue:n.readonly(i),activeMetric:n.readonly(s),activeTimestamp:n.readonly(e),deactivate:d,DIMENSION_DEBOUNCE_MS:o,METRIC_DEBOUNCE_MS:a,TIMESTAMP_DEBOUNCE_MS:l,color:u}}const Is={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ks=(r,e,t)=>{let i;const s=Is[r];return typeof s=="string"?i=s:e===1?i=s.one:i=s.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function kt(r){return(e={})=>{const t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}const Ds={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ns={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},As={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ls={date:kt({formats:Ds,defaultWidth:"full"}),time:kt({formats:Ns,defaultWidth:"full"}),dateTime:kt({formats:As,defaultWidth:"full"})},Us={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ms=(r,e,t,i)=>Us[r];function Ze(r){return(e,t)=>{const i=t?.context?String(t.context):"standalone";let s;if(i==="formatting"&&r.formattingValues){const a=r.defaultFormattingWidth||r.defaultWidth,l=t?.width?String(t.width):a;s=r.formattingValues[l]||r.formattingValues[a]}else{const a=r.defaultWidth,l=t?.width?String(t.width):r.defaultWidth;s=r.values[l]||r.values[a]}const o=r.argumentCallback?r.argumentCallback(e):e;return s[o]}}const Ks={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Bs={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},zs={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ps={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qs={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Hs={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Gs={ordinalNumber:(r,e)=>{const t=Number(r),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},era:Ze({values:Ks,defaultWidth:"wide"}),quarter:Ze({values:Bs,defaultWidth:"wide",argumentCallback:r=>r-1}),month:Ze({values:zs,defaultWidth:"wide"}),day:Ze({values:Ps,defaultWidth:"wide"}),dayPeriod:Ze({values:qs,defaultWidth:"wide",formattingValues:Hs,defaultFormattingWidth:"wide"})};function Je(r){return(e,t={})=>{const i=t.width,s=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],u=Array.isArray(l)?Fs(l,h=>h.test(a)):$s(l,h=>h.test(a));let c;c=r.valueCallback?r.valueCallback(u):u,c=t.valueCallback?t.valueCallback(c):c;const d=e.slice(a.length);return{value:c,rest:d}}}function $s(r,e){for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function Fs(r,e){for(let t=0;t<r.length;t++)if(e(r[t]))return t}function Ws(r){return(e,t={})=>{const i=e.match(r.matchPattern);if(!i)return null;const s=i[0],o=e.match(r.parsePattern);if(!o)return null;let a=r.valueCallback?r.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Vs=/^(\d+)(th|st|nd|rd)?/i,Ys=/\d+/i,Xs={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},js={any:[/^b/i,/^(a|c)/i]},Qs={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Zs={any:[/1/i,/2/i,/3/i,/4/i]},Js={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},eo={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},to={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},io={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ro={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},no={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},so={ordinalNumber:Ws({matchPattern:Vs,parsePattern:Ys,valueCallback:r=>parseInt(r,10)}),era:Je({matchPatterns:Xs,defaultMatchWidth:"wide",parsePatterns:js,defaultParseWidth:"any"}),quarter:Je({matchPatterns:Qs,defaultMatchWidth:"wide",parsePatterns:Zs,defaultParseWidth:"any",valueCallback:r=>r+1}),month:Je({matchPatterns:Js,defaultMatchWidth:"wide",parsePatterns:eo,defaultParseWidth:"any"}),day:Je({matchPatterns:to,defaultMatchWidth:"wide",parsePatterns:io,defaultParseWidth:"any"}),dayPeriod:Je({matchPatterns:ro,defaultMatchWidth:"any",parsePatterns:no,defaultParseWidth:"any"})},oo={code:"en-US",formatDistance:ks,formatLong:Ls,formatRelative:Ms,localize:Gs,match:so,options:{weekStartsOn:0,firstWeekContainsDate:1}};let ao={};function et(){return ao}const fi=6048e5,lo=864e5,mi=Symbol.for("constructDateFrom");function Me(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&mi in r?r[mi](e):r instanceof Date?new r.constructor(e):new Date(e)}function xe(r,e){return Me(e||r,r)}function pi(r){const e=xe(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function co(r,...e){const t=Me.bind(null,e.find(i=>typeof i=="object"));return e.map(t)}function gi(r,e){const t=xe(r,e?.in);return t.setHours(0,0,0,0),t}function uo(r,e,t){const[i,s]=co(t?.in,r,e),o=gi(i),a=gi(s),l=+o-pi(o),u=+a-pi(a);return Math.round((l-u)/lo)}function ho(r,e){const t=xe(r,e?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function fo(r,e){const t=xe(r,e?.in);return uo(t,ho(t))+1}function tt(r,e){const t=et(),i=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,s=xe(r,e?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function dt(r,e){return tt(r,{...e,weekStartsOn:1})}function _i(r,e){const t=xe(r,e?.in),i=t.getFullYear(),s=Me(t,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=dt(s),a=Me(t,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const l=dt(a);return t.getTime()>=o.getTime()?i+1:t.getTime()>=l.getTime()?i:i-1}function mo(r,e){const t=_i(r,e),i=Me(r,0);return i.setFullYear(t,0,4),i.setHours(0,0,0,0),dt(i)}function po(r,e){const t=xe(r,e?.in),i=+dt(t)-+mo(t);return Math.round(i/fi)+1}function yi(r,e){const t=xe(r,e?.in),i=t.getFullYear(),s=et(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=Me(e?.in||r,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const l=tt(a,e),u=Me(e?.in||r,0);u.setFullYear(i,0,o),u.setHours(0,0,0,0);const c=tt(u,e);return+t>=+l?i+1:+t>=+c?i:i-1}function go(r,e){const t=et(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,s=yi(r,e),o=Me(e?.in||r,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),tt(o,e)}function _o(r,e){const t=xe(r,e?.in),i=+tt(t,e)-+go(t,e);return Math.round(i/fi)+1}function le(r,e){const t=r<0?"-":"",i=Math.abs(r).toString().padStart(e,"0");return t+i}const Ke={y(r,e){const t=r.getFullYear(),i=t>0?t:1-t;return le(e==="yy"?i%100:i,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):le(t+1,2)},d(r,e){return le(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];default:return t==="am"?"a.m.":"p.m."}},h(r,e){return le(r.getHours()%12||12,e.length)},H(r,e){return le(r.getHours(),e.length)},m(r,e){return le(r.getMinutes(),e.length)},s(r,e){return le(r.getSeconds(),e.length)},S(r,e){const t=e.length,i=r.getMilliseconds(),s=Math.trunc(i*Math.pow(10,t-3));return le(s,e.length)}},We={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ri={G:function(r,e,t){const i=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});default:return t.era(i,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const i=r.getFullYear(),s=i>0?i:1-i;return t.ordinalNumber(s,{unit:"year"})}return Ke.y(r,e)},Y:function(r,e,t,i){const s=yi(r,i),o=s>0?s:1-s;if(e==="YY"){const a=o%100;return le(a,2)}return e==="Yo"?t.ordinalNumber(o,{unit:"year"}):le(o,e.length)},R:function(r,e){const t=_i(r);return le(t,e.length)},u:function(r,e){const t=r.getFullYear();return le(t,e.length)},Q:function(r,e,t){const i=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return le(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,e,t){const i=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return le(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,e,t){const i=r.getMonth();switch(e){case"M":case"MM":return Ke.M(r,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(r,e,t){const i=r.getMonth();switch(e){case"L":return String(i+1);case"LL":return le(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(r,e,t,i){const s=_o(r,i);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):le(s,e.length)},I:function(r,e,t){const i=po(r);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):le(i,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):Ke.d(r,e)},D:function(r,e,t){const i=fo(r);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):le(i,e.length)},E:function(r,e,t){const i=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(r,e,t,i){const s=r.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return le(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(s,{width:"short",context:"formatting"});default:return t.day(s,{width:"wide",context:"formatting"})}},c:function(r,e,t,i){const s=r.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return le(o,e.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(s,{width:"narrow",context:"standalone"});case"cccccc":return t.day(s,{width:"short",context:"standalone"});default:return t.day(s,{width:"wide",context:"standalone"})}},i:function(r,e,t){const i=r.getDay(),s=i===0?7:i;switch(e){case"i":return String(s);case"ii":return le(s,e.length);case"io":return t.ordinalNumber(s,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(r,e,t){const s=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(s,{width:"narrow",context:"formatting"});default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(r,e,t){const i=r.getHours();let s;switch(i===12?s=We.noon:i===0?s=We.midnight:s=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(s,{width:"narrow",context:"formatting"});default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(r,e,t){const i=r.getHours();let s;switch(i>=17?s=We.evening:i>=12?s=We.afternoon:i>=4?s=We.morning:s=We.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(s,{width:"narrow",context:"formatting"});default:return t.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let i=r.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return Ke.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):Ke.H(r,e)},K:function(r,e,t){const i=r.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):le(i,e.length)},k:function(r,e,t){let i=r.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):le(i,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):Ke.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):Ke.s(r,e)},S:function(r,e){return Ke.S(r,e)},X:function(r,e,t){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return Ei(i);case"XXXX":case"XX":return qe(i);default:return qe(i,":")}},x:function(r,e,t){const i=r.getTimezoneOffset();switch(e){case"x":return Ei(i);case"xxxx":case"xx":return qe(i);default:return qe(i,":")}},O:function(r,e,t){const i=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ci(i,":");default:return"GMT"+qe(i,":")}},z:function(r,e,t){const i=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ci(i,":");default:return"GMT"+qe(i,":")}},t:function(r,e,t){const i=Math.trunc(+r/1e3);return le(i,e.length)},T:function(r,e,t){return le(+r,e.length)}};function Ci(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=Math.trunc(i/60),o=i%60;return o===0?t+String(s):t+String(s)+e+le(o,2)}function Ei(r,e){return r%60===0?(r>0?"-":"+")+le(Math.abs(r)/60,2):qe(r,e)}function qe(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=le(Math.trunc(i/60),2),o=le(i%60,2);return t+s+e+o}const bi=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Oi=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},yo={p:Oi,P:(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],i=t[1],s=t[2];if(!s)return bi(r,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",bi(i,e)).replace("{{time}}",Oi(s,e))}},Ro=/^D+$/,Co=/^Y+$/,Eo=["D","DD","YY","YYYY"];function bo(r){return Ro.test(r)}function Oo(r){return Co.test(r)}function wo(r,e,t){const i=To(r,e,t);if(console.warn(i),Eo.includes(r))throw new RangeError(i)}function To(r,e,t){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function vo(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function So(r){return!(!vo(r)&&typeof r!="number"||isNaN(+xe(r)))}const xo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Io=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ko=/^'([^]*?)'?$/,Do=/''/g,No=/[a-zA-Z]/;function Ao(r,e,t){const i=et(),s=t?.locale??i.locale??oo,o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=xe(r,t?.in);if(!So(l))throw new RangeError("Invalid time value");let u=e.match(Io).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=yo[h];return f(d,s.formatLong)}return d}).join("").match(xo).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:Lo(d)};if(Ri[h])return{isToken:!0,value:d};if(h.match(No))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(u=s.localize.preprocessor(l,u));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return u.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!t?.useAdditionalWeekYearTokens&&Oo(h)||!t?.useAdditionalDayOfYearTokens&&bo(h))&&wo(h,e,String(r));const f=Ri[h[0]];return f(l,h,s.localize,c)}).join("")}function Lo(r){const e=r.match(ko);return e?e[1].replace(Do,"'"):r}function Uo(){return Object.assign({},et())}function wi(r,e,t){const i=Uo(),s=Bo(r,t.timeZone,t.locale??i.locale);return"formatToParts"in s?Mo(s,e):Ko(s,e)}function Mo(r,e){const t=r.formatToParts(e);for(let i=t.length-1;i>=0;--i)if(t[i].type==="timeZoneName")return t[i].value}function Ko(r,e){const t=r.format(e).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(t);return i?i[0].substr(1):""}function Bo(r,e,t){return new Intl.DateTimeFormat(t?[t.code,"en-US"]:void 0,{timeZone:e,timeZoneName:r})}function zo(r,e){const t=$o(e);return"formatToParts"in t?qo(t,r):Ho(t,r)}const Po={year:0,month:1,day:2,hour:3,minute:4,second:5};function qo(r,e){try{const t=r.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const o=Po[t[s].type];o!==void 0&&(i[o]=parseInt(t[s].value,10))}return i}catch(t){if(t instanceof RangeError)return[NaN];throw t}}function Ho(r,e){const t=r.format(e),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Dt={},Ti=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Go=Ti==="06/25/2014, 00:00:00"||Ti==="06/25/2014 00:00:00";function $o(r){return Dt[r]||(Dt[r]=Go?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:r,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Dt[r]}function vi(r,e,t,i,s,o,a){const l=new Date(0);return l.setUTCFullYear(r,e,t),l.setUTCHours(i,s,o,a),l}const Si=36e5,Fo=6e4,Nt={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function At(r,e,t){if(!r)return 0;let i=Nt.timezoneZ.exec(r);if(i)return 0;let s,o;if(i=Nt.timezoneHH.exec(r),i)return s=parseInt(i[1],10),xi(s)?-(s*Si):NaN;if(i=Nt.timezoneHHMM.exec(r),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return xi(s,a)?(o=Math.abs(s)*Si+a*Fo,i[1]==="+"?-o:o):NaN}if(Yo(r)){e=new Date(e||Date.now());const a=t?e:Wo(e),l=Lt(a,r);return-(t?l:Vo(e,l,r))}return NaN}function Wo(r){return vi(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())}function Lt(r,e){const t=zo(r,e),i=vi(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime();let s=r.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function Vo(r,e,t){let s=r.getTime()-e;const o=Lt(new Date(s),t);if(e===o)return e;s-=o-e;const a=Lt(new Date(s),t);return o===a?o:Math.max(o,a)}function xi(r,e){return-23<=r&&r<=23&&(e==null||0<=e&&e<=59)}const Ii={};function Yo(r){if(Ii[r])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:r}),Ii[r]=!0,!0}catch{return!1}}const Xo=60*1e3,jo={X:function(r,e,t){const i=Ut(t.timeZone,r);if(i===0)return"Z";switch(e){case"X":return ki(i);case"XXXX":case"XX":return Ve(i);default:return Ve(i,":")}},x:function(r,e,t){const i=Ut(t.timeZone,r);switch(e){case"x":return ki(i);case"xxxx":case"xx":return Ve(i);default:return Ve(i,":")}},O:function(r,e,t){const i=Ut(t.timeZone,r);switch(e){case"O":case"OO":case"OOO":return"GMT"+Qo(i,":");default:return"GMT"+Ve(i,":")}},z:function(r,e,t){switch(e){case"z":case"zz":case"zzz":return wi("short",r,t);default:return wi("long",r,t)}}};function Ut(r,e){const t=r?At(r,e,!0)/Xo:e?.getTimezoneOffset()??0;if(Number.isNaN(t))throw new RangeError("Invalid time zone specified: "+r);return t}function ht(r,e){const t=r<0?"-":"";let i=Math.abs(r).toString();for(;i.length<e;)i="0"+i;return t+i}function Ve(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=ht(Math.floor(i/60),2),o=ht(Math.floor(i%60),2);return t+s+e+o}function ki(r,e){return r%60===0?(r>0?"-":"+")+ht(Math.abs(r)/60,2):Ve(r,e)}function Qo(r,e=""){const t=r>0?"-":"+",i=Math.abs(r),s=Math.floor(i/60),o=i%60;return o===0?t+String(s):t+String(s)+e+ht(o,2)}function Di(r){const e=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return e.setUTCFullYear(r.getFullYear()),+r-+e}const Zo=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mt=36e5,Ni=6e4,Jo=2,Ce={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Zo};function Ai(r,e={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(r===null)return new Date(NaN);const t=e.additionalDigits==null?Jo:Number(e.additionalDigits);if(t!==2&&t!==1&&t!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]")return new Date(r.getTime());if(typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]")return new Date(r);if(Object.prototype.toString.call(r)!=="[object String]")return new Date(NaN);const i=ea(r),{year:s,restDateString:o}=ta(i.date,t),a=ia(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const l=a.getTime();let u=0,c;if(i.time&&(u=ra(i.time),u===null||isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(c=At(i.timeZone||e.timeZone,new Date(l+u)),isNaN(c))return new Date(NaN)}else c=Di(new Date(l+u)),c=Di(new Date(l+u+c));return new Date(l+u+c)}else return new Date(NaN)}function ea(r){const e={};let t=Ce.dateTimePattern.exec(r),i;if(t?(e.date=t[1],i=t[3]):(t=Ce.datePattern.exec(r),t?(e.date=t[1],i=t[2]):(e.date=null,i=r)),i){const s=Ce.timeZone.exec(i);s?(e.time=i.replace(s[1],""),e.timeZone=s[1].trim()):e.time=i}return e}function ta(r,e){if(r){const t=Ce.YYY[e],i=Ce.YYYYY[e];let s=Ce.YYYY.exec(r)||i.exec(r);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:r.slice(o.length)}}if(s=Ce.YY.exec(r)||t.exec(r),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:r.slice(o.length)}}}return{year:null}}function ia(r,e){if(e===null)return null;let t,i,s;if(!r||!r.length)return t=new Date(0),t.setUTCFullYear(e),t;let o=Ce.MM.exec(r);if(o)return t=new Date(0),i=parseInt(o[1],10)-1,Mi(e,i)?(t.setUTCFullYear(e,i),t):new Date(NaN);if(o=Ce.DDD.exec(r),o){t=new Date(0);const a=parseInt(o[1],10);return oa(e,a)?(t.setUTCFullYear(e,0,a),t):new Date(NaN)}if(o=Ce.MMDD.exec(r),o){t=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return Mi(e,i,a)?(t.setUTCFullYear(e,i,a),t):new Date(NaN)}if(o=Ce.Www.exec(r),o)return s=parseInt(o[1],10)-1,Ki(s)?Li(e,s):new Date(NaN);if(o=Ce.WwwD.exec(r),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return Ki(s,a)?Li(e,s,a):new Date(NaN)}return null}function ra(r){let e,t,i=Ce.HH.exec(r);if(i)return e=parseFloat(i[1].replace(",",".")),Kt(e)?e%24*Mt:NaN;if(i=Ce.HHMM.exec(r),i)return e=parseInt(i[1],10),t=parseFloat(i[2].replace(",",".")),Kt(e,t)?e%24*Mt+t*Ni:NaN;if(i=Ce.HHMMSS.exec(r),i){e=parseInt(i[1],10),t=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Kt(e,t,s)?e%24*Mt+t*Ni+s*1e3:NaN}return null}function Li(r,e,t){e=e||0,t=t||0;const i=new Date(0);i.setUTCFullYear(r,0,4);const s=i.getUTCDay()||7,o=e*7+t+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const na=[31,28,31,30,31,30,31,31,30,31,30,31],sa=[31,29,31,30,31,30,31,31,30,31,30,31];function Ui(r){return r%400===0||r%4===0&&r%100!==0}function Mi(r,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;const i=Ui(r);if(i&&t>sa[e]||!i&&t>na[e])return!1}return!0}function oa(r,e){if(e<1)return!1;const t=Ui(r);return!(t&&e>366||!t&&e>365)}function Ki(r,e){return!(r<0||r>52||e!=null&&(e<0||e>6))}function Kt(r,e,t){return!(r<0||r>=25||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}const aa=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Bt(r,e,t={}){e=String(e);const i=e.match(aa);if(i){const s=Ai(t.originalDate||r,t);e=i.reduce(function(o,a){if(a[0]==="'")return o;const l=o.indexOf(a),u=o[l-1]==="'",c=o.replace(a,"'"+jo[a[0]](s,a,t)+"'");return u?c.substring(0,l-1)+c.substring(l+1):c},e)}return Ao(r,e,t)}function la(r,e,t){r=Ai(r,t);const i=At(e,r,!0),s=new Date(r.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function ca(r,e,t,i){return i={...i,timeZone:e,originalDate:r},Bt(la(r,e,{timeZone:i.timeZone}),t,i)}const ua="#6c7489",da="768px",Bi="12px",ha="16px",zi="32px",fa="12px",Pi="20px";var ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ma(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var mt={exports:{}},pa=mt.exports,qi;function ga(){return qi||(qi=1,(function(r,e){(function(t,i){i()})(pa,function(){function t(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,d,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){u(f.response,d,h)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function o(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ft=="object"&&ft.global===ft?ft:void 0,l=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(c,d,h){var f=a.URL||a.webkitURL,p=document.createElement("a");d=d||c.name||"download",p.download=d,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?o(p):s(p.href)?i(c,d,h):o(p,p.target="_blank")):(p.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(p.href)},4e4),setTimeout(function(){o(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,h){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(t(c,h),d);else if(s(c))i(c,d,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){o(f)})}}:function(c,d,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,d,h);var p=c.type==="application/octet-stream",C=/constructor/i.test(a.HTMLElement)||a.safari,O=/CriOS\/[\d]+/.test(navigator.userAgent);if((O||p&&C||l)&&typeof FileReader<"u"){var R=new FileReader;R.onloadend=function(){var b=R.result;b=O?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=b:location=b,f=null},R.readAsDataURL(c)}else{var T=a.URL||a.webkitURL,P=T.createObjectURL(c);f?f.location=P:location.href=P,f=null,setTimeout(function(){T.revokeObjectURL(P)},4e4)}});a.saveAs=u.saveAs=u,r.exports=u})})(mt)),mt.exports}var _a=ga(),pt={exports:{}};var ya=pt.exports,Hi;function Ra(){return Hi||(Hi=1,(function(r,e){((t,i)=>{r.exports=i()})(ya,function t(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,o=i.IS_PAPA_WORKER||!1,a={},l=0,u={};function c(g){return g.charCodeAt(0)===65279?g.slice(1):g}function d(g){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(m){var _=D(m);_.chunkSize=parseInt(_.chunkSize),m.step||m.chunk||(_.chunkSize=null),this._handle=new O(_),(this._handle.streamer=this)._config=_}).call(this,g),this.parseChunk=function(m,_){var U=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<U){let F=this._config.newline;F||(A=this._config.quoteChar||'"',F=this._handle.guessLineEndings(m,A)),m=[...m.split(F).slice(U)].join(F)}this.isFirstChunk&&K(this._config.beforeFirstChunk)&&(A=this._config.beforeFirstChunk(m))!==void 0&&(m=A),this.isFirstChunk=!1,this._halted=!1;var U=this._partialLine+m,A=(this._partialLine="",this._handle.parse(U,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(m=A.meta.cursor,U=(this._finished||(this._partialLine=U.substring(m-this._baseIndex),this._baseIndex=m),A&&A.data&&(this._rowCount+=A.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)i.postMessage({results:A,workerId:u.WORKER_ID,finished:U});else if(K(this._config.chunk)&&!_){if(this._config.chunk(A,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=A=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(A.data),this._completeResults.errors=this._completeResults.errors.concat(A.errors),this._completeResults.meta=A.meta),this._completed||!U||!K(this._config.complete)||A&&A.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),U||A&&A.meta.paused||this._nextChunk(),A}this._halted=!0},this._sendError=function(m){K(this._config.error)?this._config.error(m):o&&this._config.error&&i.postMessage({workerId:u.WORKER_ID,error:m,finished:!1})}}function h(g){var m;(g=g||{}).chunkSize||(g.chunkSize=u.RemoteChunkSize),d.call(this,g),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(_){this._input=_,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(m=new XMLHttpRequest,this._config.withCredentials&&(m.withCredentials=this._config.withCredentials),s||(m.onload=x(this._chunkLoaded,this),m.onerror=x(this._chunkError,this)),m.ontimeout=x(this._chunkTimeout,this),m.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadTimeout&&!s&&(m.timeout=this._config.downloadTimeout),this._config.downloadRequestHeaders){var _,U=this._config.downloadRequestHeaders;for(_ in U)m.setRequestHeader(_,U[_])}var A;this._config.chunkSize&&(A=this._start+this._config.chunkSize-1,m.setRequestHeader("Range","bytes="+this._start+"-"+A));try{m.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}s&&m.status===0&&this._chunkError()}},this._chunkLoaded=function(){m.readyState===4&&(m.status<200||400<=m.status?this._chunkError():(this._start+=this._config.chunkSize||m.responseText.length,this._finished=!this._config.chunkSize||this._start>=(_=>(_=_.getResponseHeader("Content-Range"))!==null?parseInt(_.substring(_.lastIndexOf("/")+1)):-1)(m),this.parseChunk(m.responseText)))},this._chunkError=function(_){_=m.statusText||_,this._sendError(new Error(_))},this._chunkTimeout=function(){this._chunkError("Request timed out after "+this._config.downloadTimeout+"ms")}}function f(g){(g=g||{}).chunkSize||(g.chunkSize=u.LocalChunkSize),d.call(this,g);var m,_,U=typeof FileReader<"u";this.stream=function(A){this._input=A,_=A.slice||A.webkitSlice||A.mozSlice,U?((m=new FileReader).onload=x(this._chunkLoaded,this),m.onerror=x(this._chunkError,this)):m=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var A=this._input,F=(this._config.chunkSize&&(F=Math.min(this._start+this._config.chunkSize,this._input.size),A=_.call(A,this._start,F)),m.readAsText(A,this._config.encoding));U||this._chunkLoaded({target:{result:F}})},this._chunkLoaded=function(A){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(A.target.result)},this._chunkError=function(){this._sendError(m.error)}}function p(g){var m;d.call(this,g=g||{}),this.stream=function(_){return m=_,this._nextChunk()},this._nextChunk=function(){var _,U;if(!this._finished)return _=this._config.chunkSize,m=_?(U=m.substring(0,_),m.substring(_)):(U=m,""),this._finished=!m,this.parseChunk(U)}}function C(g){d.call(this,g=g||{});var m=[],_=!0,U=!1;this.pause=function(){d.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){d.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(A){this._input=A,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){U&&m.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),m.length?this.parseChunk(m.shift()):_=!0},this._streamData=x(function(A){try{m.push(typeof A=="string"?A:A.toString(this._config.encoding)),_&&(_=!1,this._checkIsFinished(),this.parseChunk(m.shift()))}catch(F){this._streamError(F)}},this),this._streamError=x(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=x(function(){this._streamCleanUp(),U=!0,this._streamData("")},this),this._streamCleanUp=x(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function O(g){var m,_,U,A,F=Math.pow(2,53),v=-F,q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,V=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,W=this,w=0,S=0,G=!1,M=!1,k=[],N={data:[],errors:[],meta:{}};function oe(ie){return g.skipEmptyLines==="greedy"?ie.join("").trim()==="":ie.length===1&&ie[0].length===0}function ae(){if(N&&U&&(ge("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),U=!1),g.skipEmptyLines&&(N.data=N.data.filter(function(z){return!oe(z)})),de()){let z=function(Y){k.push(Y)};if(N)if(Array.isArray(N.data[0])){for(var ie=0;de()&&ie<N.data.length;ie++)N.data[ie].forEach(z);N.data.splice(0,1)}else N.data.forEach(z)}function I(z,Y){for(var J=g.header?{}:[],L=0;L<z.length;L++){var $=L,j=z[L],j=((ce,Z)=>(ne=>(g.dynamicTypingFunction&&g.dynamicTyping[ne]===void 0&&(g.dynamicTyping[ne]=g.dynamicTypingFunction(ne)),(g.dynamicTyping[ne]||g.dynamicTyping)===!0))(ce)?Z==="true"||Z==="TRUE"||Z!=="false"&&Z!=="FALSE"&&((ne=>{if(q.test(ne)&&(ne=parseFloat(ne),v<ne&&ne<F))return 1})(Z)?parseFloat(Z):V.test(Z)?new Date(Z):Z===""?null:Z):Z)($=g.header?L>=k.length?"__parsed_extra":k[L]:$,j=g.transform?g.transform(j,$):j);$==="__parsed_extra"?(J[$]=J[$]||[],J[$].push(j)):J[$]=j}return g.header&&(L>k.length?ge("FieldMismatch","TooManyFields","Too many fields: expected "+k.length+" fields but parsed "+L,S+Y):L<k.length&&ge("FieldMismatch","TooFewFields","Too few fields: expected "+k.length+" fields but parsed "+L,S+Y)),J}var B;N&&(g.header||g.dynamicTyping||g.transform)&&(B=1,!N.data.length||Array.isArray(N.data[0])?(N.data=N.data.map(I),B=N.data.length):N.data=I(N.data,0),g.header&&N.meta&&(N.meta.fields=k),S+=B)}function de(){return g.header&&k.length===0}function ge(ie,I,B,z){ie={type:ie,code:I,message:B},z!==void 0&&(ie.row=z),N.errors.push(ie)}K(g.step)&&(A=g.step,g.step=function(ie){N=ie,de()?ae():(ae(),N.data.length!==0&&(w+=ie.data.length,g.preview&&w>g.preview?_.abort():(N.data=N.data[0],A(N,W))))}),this.parse=function(ie,I,B){var z=g.quoteChar||'"',z=(g.newline||(g.newline=this.guessLineEndings(ie,z)),U=!1,g.delimiter?K(g.delimiter)&&(g.delimiter=g.delimiter(ie),N.meta.delimiter=g.delimiter):((z=((Y,J,L,$,j)=>{var ce,Z,ne,me;j=j||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var _e=0;_e<j.length;_e++){for(var Oe,ze=j[_e],fe=0,we=0,he=0,ye=(ne=void 0,new T({comments:$,delimiter:ze,newline:J,preview:10}).parse(Y)),Te=0;Te<ye.data.length;Te++)L&&oe(ye.data[Te])?he++:(Oe=ye.data[Te].length,we+=Oe,ne===void 0?ne=Oe:0<Oe&&(fe+=Math.abs(Oe-ne),ne=Oe));0<ye.data.length&&(we/=ye.data.length-he),1.99<we&&(Z===void 0||fe<Z||fe===Z&&me<we)&&(Z=fe,ce=ze,me=we)}return{successful:!!(g.delimiter=ce),bestDelimiter:ce}})(ie,g.newline,g.skipEmptyLines,g.comments,g.delimitersToGuess)).successful?g.delimiter=z.bestDelimiter:(U=!0,g.delimiter=u.DefaultDelimiter),N.meta.delimiter=g.delimiter),D(g));return z.header=de(),g.preview&&g.header&&z.preview++,m=ie,_=new T(z),N=_.parse(m,I,B),ae(),G?{meta:{paused:!0}}:N||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,_.abort(),m=K(g.chunk)?"":m.substring(_.getCharIndex())},this.resume=function(){W.streamer._halted?(G=!1,W.streamer.parseChunk(m,!0)):setTimeout(W.resume,3)},this.aborted=function(){return M},this.abort=function(){M=!0,_.abort(),N.meta.aborted=!0,K(g.complete)&&g.complete(N),m=""},this.guessLineEndings=function(Y,z){Y=Y.substring(0,1048576);var z=new RegExp(R(z)+"([^]*?)"+R(z),"gm"),B=(Y=Y.replace(z,"")).split("\r"),z=Y.split(`
|
|
2
2
|
`),Y=1<z.length&&z[0].length<B[0].length;if(B.length===1||Y)return`
|
|
3
3
|
`;for(var J=0,L=0;L<B.length;L++)B[L][0]===`
|
|
4
4
|
`&&J++;return J>=B.length/2?`\r
|
|
5
5
|
`:"\r"}}function R(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(g){var m=(g=g||{}).delimiter,_=g.newline,U=g.comments,A=g.step,F=g.preview,v=g.fastMode,q=null,V=!1,W=g.quoteChar==null?'"':g.quoteChar,w=W;if(g.escapeChar!==void 0&&(w=g.escapeChar),(typeof m!="string"||-1<u.BAD_DELIMITERS.indexOf(m))&&(m=","),U===m)throw new Error("Comment character same as delimiter");U===!0?U="#":(typeof U!="string"||-1<u.BAD_DELIMITERS.indexOf(U))&&(U=!1),_!==`
|
|
6
6
|
`&&_!=="\r"&&_!==`\r
|
|
7
7
|
`&&(_=`
|
|
8
|
-
`);var S=0,G=!1;this.parse=function(M,
|
|
9
|
-
`,v='"',q=v+v,V=!1,W=null,w=!1,S=((()=>{if(typeof m=="object"){if(typeof m.delimiter!="string"||u.BAD_DELIMITERS.filter(function(
|
|
8
|
+
`);var S=0,G=!1;this.parse=function(M,k,N){if(typeof M!="string")throw new Error("Input must be a string");var oe=M.length,ae=m.length,de=_.length,ge=U.length,ie=K(A),I=[],B=[],z=[],Y=S=0;if(!M)return fe();if(v||v!==!1&&M.indexOf(W)===-1){for(var J=M.split(_),L=0;L<J.length;L++){if(z=J[L],S+=z.length,L!==J.length-1)S+=_.length;else if(N)return fe();if(!U||z.substring(0,ge)!==U){if(ie){if(I=[],me(z.split(m)),we(),G)return fe()}else me(z.split(m));if(F&&F<=L)return I=I.slice(0,F),fe(!0)}}return fe()}for(var $=M.indexOf(m,S),j=M.indexOf(_,S),ce=new RegExp(R(w)+R(W),"g"),Z=M.indexOf(W,S);;)if(M[S]===W)for(Z=S,S++;;){if((Z=M.indexOf(W,Z+1))===-1)return N||B.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:I.length,index:S}),Oe();if(Z===oe-1)return Oe(M.substring(S,Z).replace(ce,W));if(W===w&&M[Z+1]===w)Z++;else if(W===w||Z===0||M[Z-1]!==w){$!==-1&&$<Z+1&&($=M.indexOf(m,Z+1));var ne=_e((j=j!==-1&&j<Z+1?M.indexOf(_,Z+1):j)===-1?$:Math.min($,j));if(M.substr(Z+1+ne,ae)===m){z.push(M.substring(S,Z).replace(ce,W)),M[S=Z+1+ne+ae]!==W&&(Z=M.indexOf(W,S)),$=M.indexOf(m,S),j=M.indexOf(_,S);break}if(ne=_e(j),M.substring(Z+1+ne,Z+1+ne+de)===_){if(z.push(M.substring(S,Z).replace(ce,W)),ze(Z+1+ne+de),$=M.indexOf(m,S),Z=M.indexOf(W,S),ie&&(we(),G))return fe();if(F&&I.length>=F)return fe(!0);break}B.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:I.length,index:S}),Z++}}else if(U&&z.length===0&&M.substring(S,S+ge)===U){if(j===-1)return fe();S=j+de,j=M.indexOf(_,S),$=M.indexOf(m,S)}else if($!==-1&&($<j||j===-1))z.push(M.substring(S,$)),S=$+ae,$=M.indexOf(m,S);else{if(j===-1)break;if(z.push(M.substring(S,j)),ze(j+de),ie&&(we(),G))return fe();if(F&&I.length>=F)return fe(!0)}return Oe();function me(he){I.push(he),Y=S}function _e(he){var ye=0;return ye=he!==-1&&(he=M.substring(Z+1,he))&&he.trim()===""?he.length:ye}function Oe(he){return N||(he===void 0&&(he=M.substring(S)),z.push(he),S=oe,me(z),ie&&we()),fe()}function ze(he){S=he,me(z),z=[],j=M.indexOf(_,S)}function fe(he){if(g.header&&!k&&I.length&&!V){var ye=I[0],Te=Object.create(null),lt=new Set(ye);let Tt=!1;for(let Pe=0;Pe<ye.length;Pe++){let ve=c(ye[Pe]);if(Te[ve=K(g.transformHeader)?g.transformHeader(ve,Pe):ve]){let He,vt=Te[ve];for(;He=ve+"_"+vt,vt++,lt.has(He););lt.add(He),ye[Pe]=He,Te[ve]++,Tt=!0,(q=q===null?{}:q)[He]=ve}else Te[ve]=1,ye[Pe]=ve;lt.add(ve)}Tt&&console.warn("Duplicate headers found and renamed."),V=!0}return{data:I,errors:B,meta:{delimiter:m,linebreak:_,aborted:G,truncated:!!he,cursor:Y+(k||0),renamedHeaders:q}}}function we(){A(fe()),I=[],B=[]}},this.abort=function(){G=!0},this.getCharIndex=function(){return S}}function P(g){var m=g.data,_=a[m.workerId],U=!1;if(m.error)_.userError(m.error,m.file);else if(m.results&&m.results.data){var A={abort:function(){U=!0,b(m.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:E,resume:E};if(K(_.userStep)){for(var F=0;F<m.results.data.length&&(_.userStep({data:m.results.data[F],errors:m.results.errors,meta:m.results.meta},A),!U);F++);delete m.results}else K(_.userChunk)&&(_.userChunk(m.results,A,m.file),delete m.results)}m.finished&&!U&&b(m.workerId,m.results)}function b(g,m){var _=a[g];K(_.userComplete)&&_.userComplete(m),_.terminate(),delete a[g]}function E(){throw new Error("Not implemented.")}function D(g){if(typeof g!="object"||g===null)return g;var m,_=Array.isArray(g)?[]:{};for(m in g)_[m]=D(g[m]);return _}function x(g,m){return function(){g.apply(m,arguments)}}function K(g){return typeof g=="function"}return u.parse=function(g,m){var _=(m=m||{}).dynamicTyping||!1;if(K(_)&&(m.dynamicTypingFunction=_,_={}),m.dynamicTyping=_,m.transform=!!K(m.transform)&&m.transform,m.downloadTimeout!==void 0){var _=parseInt(m.downloadTimeout);if(isNaN(_))throw new Error("Config downloadTimeout value ("+m.downloadTimeout+") not parsable by parseInt(val).");m.downloadTimeout=_}if(!m.worker||!u.WORKERS_SUPPORTED)return _=null,u.NODE_STREAM_INPUT,typeof g=="string"?(g=c(g),_=new(m.download?h:p)(m)):g.readable===!0&&K(g.read)&&K(g.on)?_=new C(m):(i.File&&g instanceof File||g instanceof Object)&&(_=new f(m)),_.stream(g);(_=(()=>{var U;return!!u.WORKERS_SUPPORTED&&(U=(()=>{var A=i.URL||i.webkitURL||null,F=t.toString();return u.BLOB_URL||(u.BLOB_URL=A.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",F,")();"],{type:"text/javascript"})))})(),(U=new i.Worker(U)).onmessage=P,U.id=l++,a[U.id]=U)})()).userStep=m.step,_.userChunk=m.chunk,_.userComplete=m.complete,_.userError=m.error,m.step=K(m.step),m.chunk=K(m.chunk),m.complete=K(m.complete),m.error=K(m.error),delete m.worker,_.postMessage({input:g,config:m,workerId:_.id})},u.unparse=function(g,m){var _=!1,U=!0,A=",",F=`\r
|
|
9
|
+
`,v='"',q=v+v,V=!1,W=null,w=!1,S=((()=>{if(typeof m=="object"){if(typeof m.delimiter!="string"||u.BAD_DELIMITERS.filter(function(k){return m.delimiter.indexOf(k)!==-1}).length||(A=m.delimiter),typeof m.quotes!="boolean"&&typeof m.quotes!="function"&&!Array.isArray(m.quotes)||(_=m.quotes),typeof m.skipEmptyLines!="boolean"&&typeof m.skipEmptyLines!="string"||(V=m.skipEmptyLines),typeof m.newline=="string"&&(F=m.newline),typeof m.quoteChar=="string"&&(v=m.quoteChar,q=v+v),typeof m.header=="boolean"&&(U=m.header),Array.isArray(m.columns)){if(m.columns.length===0)throw new Error("Option columns is empty");W=m.columns}m.escapeChar!==void 0&&(q=m.escapeChar+v),m.escapeFormulae instanceof RegExp?w=m.escapeFormulae:typeof m.escapeFormulae=="boolean"&&m.escapeFormulae&&(w=/^[=+\-@\t\r].*$/)}})(),new RegExp(R(v),"g"));if(typeof g=="string"&&(g=JSON.parse(g)),Array.isArray(g)){if(!g.length||Array.isArray(g[0]))return G(null,g,V);if(typeof g[0]=="object")return G(W||Object.keys(g[0]),g,V)}else if(typeof g=="object")return typeof g.data=="string"&&(g.data=JSON.parse(g.data)),Array.isArray(g.data)&&(g.fields||(g.fields=g.meta&&g.meta.fields||W),g.fields||(g.fields=Array.isArray(g.data[0])?g.fields:typeof g.data[0]=="object"?Object.keys(g.data[0]):[]),Array.isArray(g.data[0])||typeof g.data[0]=="object"||(g.data=[g.data])),G(g.fields||[],g.data||[],V);throw new Error("Unable to serialize unrecognized input");function G(k,N,oe){var ae="",de=(typeof k=="string"&&(k=JSON.parse(k)),typeof N=="string"&&(N=JSON.parse(N)),Array.isArray(k)&&0<k.length),ge=!Array.isArray(N[0]);if(de&&U){for(var ie=0;ie<k.length;ie++)0<ie&&(ae+=A),ae+=M(k[ie],ie);0<N.length&&(ae+=F)}for(var I=0;I<N.length;I++){var B=(de?k:N[I]).length,z=!1,Y=de?Object.keys(N[I]).length===0:N[I].length===0;if(oe&&!de&&(z=oe==="greedy"?N[I].join("").trim()==="":N[I].length===1&&N[I][0].length===0),oe==="greedy"&&de){for(var J=[],L=0;L<B;L++){var $=ge?k[L]:L;J.push(N[I][$])}z=J.join("").trim()===""}if(!z){for(var j=0;j<B;j++){0<j&&!Y&&(ae+=A);var ce=de&&ge?k[j]:j;ae+=M(N[I][ce],j)}I<N.length-1&&(!oe||0<B&&!Y)&&(ae+=F)}}return ae}function M(k,N){var oe,ae,de;return k==null?"":k.constructor===Date?isNaN(k.getTime())?"":k.toISOString():(de=!1,w&&typeof k=="string"&&w.test(k)&&(k="'"+k,de=!0),ae=(oe=k.toString()).replace(S,q),(de=de||_===!0||typeof _=="function"&&_(k,N)||Array.isArray(_)&&_[N]||((ge,ie)=>{for(var I=0;I<ie.length;I++)if(-1<ge.indexOf(ie[I]))return!0;return!1})(ae,u.BAD_DELIMITERS)||-1<ae.indexOf(A)||-1<oe.indexOf(v)||ae.charAt(0)===" "||ae.charAt(ae.length-1)===" ")?v+ae+v:ae)}},u.RECORD_SEP="",u.UNIT_SEP="",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",`
|
|
10
10
|
`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!s&&!!i.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=T,u.ParserHandle=O,u.NetworkStreamer=h,u.FileStreamer=f,u.StringStreamer=p,u.ReadableStreamStreamer=C,o&&(i.onmessage=function(g){g=g.data,u.WORKER_ID===void 0&&g&&(u.WORKER_ID=g.workerId),typeof g.input=="string"?i.postMessage({workerId:u.WORKER_ID,results:u.parse(g.input,g.config),finished:!0}):(i.File&&g.input instanceof File||g.input instanceof Object)&&(g=u.parse(g.input,g.config))&&i.postMessage({workerId:u.WORKER_ID,results:g,finished:!0})}),(h.prototype=Object.create(d.prototype)).constructor=h,(f.prototype=Object.create(d.prototype)).constructor=f,(p.prototype=Object.create(p.prototype)).constructor=p,(C.prototype=Object.create(d.prototype)).constructor=C,u})})(pt)),pt.exports}var Ca=Ra(),Ye=(r=>(r.String="string",r.Number="number",r.Boolean="boolean",r.Object="object",r.Undefined="undefined",r))(Ye||{});const Ea=["id"],ba=n.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(r,{emit:e}){const t=e,i=r,s=n.computed(()=>`export_${new Date().getTime()}`),o=n.computed(()=>{const d=u();return d.length?d:null}),a=()=>{const d=i.labels;if(typeof i.fields!==Ye.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return d!==null&&typeof d===Ye.Object?h=>Object.fromEntries(Object.entries(h).map(([f,p])=>[d[f]||f,p])):h=>h},l=()=>{const d=i.fields;if(typeof i.fields!==Ye.Object&&!Array.isArray(d))throw new Error("Fields needs to be an array of strings.");return Array.isArray(d)?h=>Object.fromEntries(d.filter(f=>f in h).map(f=>[f,h[f]])):h=>h},u=()=>{if(typeof i.fields===Ye.Undefined&&typeof i.labels===Ye.Undefined)return i.data;const d=a(),h=l();return i.data.map(f=>d(h(f)))},c=()=>{if(!o.value){console.warn("No data to export");return}t("export-started",o.value);let d=Ca.unparse(o.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(d="SEP="+i.delimiter+`\r
|
|
11
|
-
`+d),i.encoding==="utf-8"&&(d="\uFEFF"+d),t("export-finished",i.filename),!i.testing){const h=new Blob([d],{type:"text/csv;charset="+i.encoding});_a.saveAs(h,i.filename)}};return(d,h)=>(n.openBlock(),n.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[n.renderSlot(d.$slots,"default",{},()=>[n.createTextVNode("Download "+n.toDisplayString(r.filename),1)])],8,Ea))}}),Oa=n.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(r){const e=r,t=n.computed(()=>Object.keys(e.headers));return(i,s)=>(n.openBlock(),n.createElementBlock("div",null,[n.createVNode(ba,{data:r.rows,fields:t.value,filename:r.filename,labels:r.headers},{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),wa={renderer:{not_configured:{title:"Chart is not fully configured",description:"Begin by choosing at least one metric"},noQueryBridge:"No query bridge provided. Unable to render dashboard.",unexpectedError:"An unexpected error has occurred.",trendRange:{"24h":"Last 24-hour summary","7d":"Last 7-day summary","30d":"Last 30-day summary"},edit:"Edit",tileActions:"Tile actions",duplicateTile:"Duplicate",exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",remove:"Remove",delete:"Delete",as_of_today:"As of today",noDataAvailable:{title:"No data in the current time frame",description:"Once there is traffic, it will display here"},treemapUnsupported:{title:"This query can't be shown as a treemap",description:"Treemaps need a count or total metric, such as requests or tokens, and no time dimension"}},pdfExport:{branding:"Kong Konnect",generated:"Generated {timestamp}",dashboardNote:"For a live, interactive experience, open this dashboard in Konnect",pageOf:"{page} / {total}"},csvExport:{defaultFilename:"Chart export",exportAsCsv:"Export as CSV",dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportTimeRange:"Time range",exportAsOf:"As of {time}",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},chartLabels:{control_plane:"Control plane",data_plane_node_version:"Data plane node version",env:"Environment",gateway_service:"Gateway service",hostname:"Hostname",plugin:"Plugin",plugin_name:"Plugin name",plugin_scope:"Plugin scope",region:"Region",request_count:"Request count",route:"Route",status_code:"Status code",team:"Team",name:"Name",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_gateway_version:"AI gateway version",ai_count:"LLM request count",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",total_tokens_per_minute:"Total tokens per minute",control_plane_group:"Control plane group",consumer:"Consumer",consumer_group:"Consumer group",country_code:"Country",country:"Country",data_plane_node:"Data plane node",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",application:"Application",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"API product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",share_of_requests:"Share of requests",cost:"Costs",cost_per_request_average:"Request cost (avg per million)",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",oidc_credential:"OIDC credential",principal:"Principal",principal_group:"Principal group",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",share_of_cost:"Share of cost"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},jumpToExplore:"Explore",jumpToRequests:"View requests",unsupported_time_range_badge:"Limited timeframe",unsupported_time_range_warning:"The selected timeframe exceeds what this datasource supports, so this tile is limited to the maximum supported timeframe.",query_aged_out_warning:"This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.",granularities:{daily:"1 day",fiveMinutely:"5 minutes",hourly:"1 hour",minutely:"1 minute",tenMinutely:"10 minutes",tenSecondly:"10 seconds",thirtyMinutely:"30 minutes",thirtySecondly:"30 seconds",twelveHourly:"12 hours",twoHourly:"2 hours",weekly:"1 week",unknown:"Unknown"}};function gt(){const r=ct.createI18n("en-us",wa);return{i18n:r,i18nT:ct.i18nTComponent(r)}}const it=170,zt=6,rt=20,Ie="analytics-query-provider",Gi="analytics-dashboard-coordinator",Pt="{entity-id}",$i="{cp-id}",Fi="{timeframe}",Wi=30*1e3,Vi=3e5,Yi=36e5;function Ta(){const r=n.inject(Ie);return{evaluateFeatureFlag:(t,i)=>typeof r?.evaluateFeatureFlagFn!="function"?i:r.evaluateFeatureFlagFn(t,i)}}var qt={exports:{}},Xi;function va(){return Xi||(Xi=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function s(u,c,d){this.fn=u,this.context=c,this.once=d||!1}function o(u,c,d,h,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,h||u,f),C=t?t+c:c;return u._events[C]?u._events[C].fn?u._events[C]=[u._events[C],p]:u._events[C].push(p):(u._events[C]=p,u._eventsCount++),u}function a(u,c){--u._eventsCount===0?u._events=new i:delete u._events[c]}function l(){this._events=new i,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],d,h;if(this._eventsCount===0)return c;for(h in d=this._events)e.call(d,h)&&c.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},l.prototype.listeners=function(c){var d=t?t+c:c,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,p=h.length,C=new Array(p);f<p;f++)C[f]=h[f].fn;return C},l.prototype.listenerCount=function(c){var d=t?t+c:c,h=this._events[d];return h?h.fn?1:h.length:0},l.prototype.emit=function(c,d,h,f,p,C){var O=t?t+c:c;if(!this._events[O])return!1;var R=this._events[O],T=arguments.length,P,b;if(R.fn){switch(R.once&&this.removeListener(c,R.fn,void 0,!0),T){case 1:return R.fn.call(R.context),!0;case 2:return R.fn.call(R.context,d),!0;case 3:return R.fn.call(R.context,d,h),!0;case 4:return R.fn.call(R.context,d,h,f),!0;case 5:return R.fn.call(R.context,d,h,f,p),!0;case 6:return R.fn.call(R.context,d,h,f,p,C),!0}for(b=1,P=new Array(T-1);b<T;b++)P[b-1]=arguments[b];R.fn.apply(R.context,P)}else{var E=R.length,k;for(b=0;b<E;b++)switch(R[b].once&&this.removeListener(c,R[b].fn,void 0,!0),T){case 1:R[b].fn.call(R[b].context);break;case 2:R[b].fn.call(R[b].context,d);break;case 3:R[b].fn.call(R[b].context,d,h);break;case 4:R[b].fn.call(R[b].context,d,h,f);break;default:if(!P)for(k=1,P=new Array(T-1);k<T;k++)P[k-1]=arguments[k];R[b].fn.apply(R[b].context,P)}}return!0},l.prototype.on=function(c,d,h){return o(this,c,d,h,!1)},l.prototype.once=function(c,d,h){return o(this,c,d,h,!0)},l.prototype.removeListener=function(c,d,h,f){var p=t?t+c:c;if(!this._events[p])return this;if(!d)return a(this,p),this;var C=this._events[p];if(C.fn)C.fn===d&&(!f||C.once)&&(!h||C.context===h)&&a(this,p);else{for(var O=0,R=[],T=C.length;O<T;O++)(C[O].fn!==d||f&&!C[O].once||h&&C[O].context!==h)&&R.push(C[O]);R.length?this._events[p]=R.length===1?R[0]:R:a(this,p)}return this},l.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&a(this,d)):(this._events=new i,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,r.exports=l})(qt)),qt.exports}var Sa=va();const xa=ma(Sa);class Ht extends Error{name="TimeoutError";constructor(e,t){super(e,t),Error.captureStackTrace?.(this,Ht)}}const ji=r=>r.reason??new DOMException("This operation was aborted.","AbortError");function Ia(r,e){const{milliseconds:t,fallback:i,message:s,customTimers:o={setTimeout,clearTimeout},signal:a}=e;let l,u;const d=new Promise((h,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(a?.aborted){f(ji(a));return}if(a&&(u=()=>{f(ji(a))},a.addEventListener("abort",u,{once:!0})),r.then(h,f),t===Number.POSITIVE_INFINITY)return;const p=new Ht;l=o.setTimeout.call(void 0,()=>{if(i){try{h(i())}catch(C){f(C)}return}typeof r.cancel=="function"&&r.cancel(),s===!1?h():s instanceof Error?f(s):(p.message=s??`Promise timed out after ${t} milliseconds`,f(p))},t)}).finally(()=>{d.clear(),u&&a&&a.removeEventListener("abort",u)});return d.clear=()=>{o.clearTimeout.call(void 0,l),l=void 0},d}function Da(r,e,t){let i=0,s=r.length;for(;s>0;){const o=Math.trunc(s/2);let a=i+o;t(r[a],e)<=0?(i=++a,s-=o+1):s=o}return i}const ka=100;class Qi{#t=[];#e=0;enqueue(e,t){const{priority:i=0,id:s}=t??{},{size:o}=this,a={priority:i,id:s,run:e};if(o===0){this.#t.length=0,this.#e=0,this.#t.push(a);return}if(this.#t.at(-1).priority>=i){this.#t.push(a);return}this.#s();const l=Da(this.#t,a,(u,c)=>c.priority-u.priority);this.#t.splice(l,0,a)}setPriority(e,t){const i=this.#t.findIndex((o,a)=>a>=this.#e&&o.id===e);if(i===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[s]=this.#t.splice(i,1);this.enqueue(s.run,{priority:t,id:e})}remove(e){const t=this.#t.findIndex((i,s)=>s<this.#e?!1:typeof e=="string"?i.id===e:i.run===e);t!==-1&&this.#t.splice(t,1)}dequeue(){if(this.#e===this.#t.length)return;const e=this.#t[this.#e];return this.#e++,this.#e===this.#t.length?(this.#t.length=0,this.#e=0):this.#e>ka&&this.#e>this.#t.length/2&&this.#s(),e?.run}filter(e){const t=[];for(let i=this.#e;i<this.#t.length;i++){const s=this.#t[i];s.priority===e.priority&&t.push(s.run)}return t}get size(){return this.#t.length-this.#e}#s(){this.#e!==0&&(this.#t.splice(0,this.#e),this.#e=0)}}class Na extends xa{#t;#e;#s=0;#f;#p=!1;#R=!1;#c;#C=0;#l;#u;#a;#o=[];#n=0;#i;#v;#r=0;#g;#d;#N=1n;#_=new Map;#E=new Set;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Qi,strict:!1,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#t=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#e=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#f=e.intervalCap,this.#c=e.interval,this.#a=e.strict,this.#i=new e.queueClass,this.#v=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#d=e.autoStart===!1,this.#P()}#b(e){for(;this.#n<this.#o.length;){const i=this.#o[this.#n];if(i!==void 0&&e-i>=this.#c)this.#n++;else break}(this.#n>100&&this.#n>this.#o.length/2||this.#n===this.#o.length)&&(this.#o=this.#o.slice(this.#n),this.#n=0)}#A(e){this.#a?this.#o.push(e):this.#s++}#L(){this.#a?this.#o.length>this.#n&&this.#o.pop():this.#s>0&&this.#s--}#O(){return this.#o.length-this.#n}get#U(){return this.#e?!0:this.#a?this.#O()<this.#f:this.#s<this.#f}get#M(){return this.#r<this.#g}#K(){this.#r--,this.#r===0&&this.emit("pendingZero"),this.#y(),this.emit("next")}#B(){this.#u=void 0,this.#D(),this.#I()}#z(e){if(this.#a){if(this.#b(e),this.#O()>=this.#f){const i=this.#o[this.#n],s=this.#c-(e-i);return this.#S(s),!0}return!1}if(this.#l===void 0){const t=this.#C-e;if(t<0)this.#s=this.#t?this.#r:0;else return this.#S(t),!0}return!1}#S(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#B()},e))}#w(){this.#l&&(clearInterval(this.#l),this.#l=void 0)}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#y(){if(this.#i.size===0){if(this.#w(),this.emit("empty"),this.#r===0){if(this.#x(),this.#a&&this.#n>0){const t=Date.now();this.#b(t)}this.emit("idle")}return!1}let e=!1;if(!this.#d){const t=Date.now(),i=!this.#z(t);if(this.#U&&this.#M){const s=this.#i.dequeue();this.#e||(this.#A(t),this.#m()),i&&this.#I(),this.emit("active"),s(),e=!0}}return e}#I(){this.#e||this.#l!==void 0||this.#a||(this.#l=setInterval(()=>{this.#D()},this.#c),this.#C=Date.now()+this.#c)}#D(){this.#a||(this.#l!==void 0&&(this.#s===0&&this.#r===0?this.#w():this.#C=Date.now()+this.#c),this.#s=this.#t?this.#r:0),this.#T(),this.#m()}#T(){for(;this.#y(););}get concurrency(){return this.#g}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#g=e,this.#T()}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#i.setPriority(e,t)}async add(e,t={}){if(t={timeout:this.timeout,...t,id:t.id??(this.#N++).toString()},t.timeout!==void 0&&!(Number.isFinite(t.timeout)&&t.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);return new Promise((i,s)=>{const o=Symbol(`task-${t.id}`);let a=()=>{};const l=async()=>{a(),this.#r++,this.#_.set(o,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let c;try{try{t.signal?.throwIfAborted()}catch(f){throw this.#q(),this.#_.delete(o),f}let d=e({signal:t.signal});if(t.timeout!==void 0&&(d=Ia(Promise.resolve(d),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#r} running, ${this.#i.size} waiting)`})),t.signal){const{signal:f}=t;d=Promise.race([d,new Promise((p,C)=>{c=()=>{C(f.reason)},f.addEventListener("abort",c,{once:!0})})])}const h=await d;i(h),this.emit("completed",h)}catch(d){s(d),this.emit("error",d)}finally{c&&t.signal?.removeEventListener("abort",c),this.#_.delete(o),queueMicrotask(()=>{this.#K()})}};this.#i.enqueue(l,t);const u=()=>{if(this.#i instanceof Qi){this.#i.remove(l);return}this.#i.remove?.(t.id)};if(t.signal){const{signal:c}=t,d=()=>{a(),u(),s(c.reason),this.#y(),this.emit("next")};if(a=()=>{c.removeEventListener("abort",d),this.#E.delete(a)},c.aborted){d();return}c.addEventListener("abort",d,{once:!0}),this.#E.add(a)}this.emit("add"),this.#y()})}async addAll(e,t){return Promise.all(e.map(async i=>this.add(i,t)))}start(){return this.#d?(this.#d=!1,this.#T(),this):this}pause(){this.#d=!0}clear(){for(const e of this.#E)e();this.#i=new this.#v,this.#w(),this.#k(),this.emit("empty"),this.#r===0&&(this.#x(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#i.size!==0&&await this.#h("empty")}async onSizeLessThan(e){this.#i.size<e||await this.#h(["next","active"],()=>this.#i.size<e)}async onIdle(){this.#r===0&&this.#i.size===0||await this.#h("idle")}async onPendingZero(){this.#r!==0&&await this.#h("pendingZero")}async onRateLimit(){this.isRateLimited||await this.#h("rateLimit")}async onRateLimitCleared(){this.isRateLimited&&await this.#h("rateLimitCleared")}onError(){return new Promise((e,t)=>{const i=s=>{this.off("error",i),t(s)};this.on("error",i)})}async#h(e,t){const i=Array.isArray(e)?e:[e];return new Promise(s=>{const o=()=>{if(!(t&&!t())){for(const a of i)this.off(a,o);s()}};for(const a of i)this.on(a,o)})}get size(){return this.#i.size}sizeBy(e){return this.#i.filter(e).length}get pending(){return this.#r}get isPaused(){return this.#d}#P(){this.#e||(this.on("add",()=>{this.#i.size>0&&this.#m()}),this.on("next",()=>{this.#m()}))}#m(){this.#e||this.#R||(this.#R=!0,queueMicrotask(()=>{this.#R=!1,this.#k()}))}#q(){this.#e||(this.#L(),this.#m())}#k(){const e=this.#p;if(this.#e||this.#i.size===0){e&&(this.#p=!1,this.emit("rateLimitCleared"));return}let t;if(this.#a){const s=Date.now();this.#b(s),t=this.#O()}else t=this.#s;const i=t>=this.#f;i!==e&&(this.#p=i,this.emit(i?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#p}get isSaturated(){return this.#r===this.#g&&this.#i.size>0||this.isRateLimited&&this.#i.size>0}get runningTasks(){return[...this.#_.values()].map(e=>({...e,timeoutRemaining:e.timeout?Math.max(0,e.startTime+e.timeout-Date.now()):void 0}))}}const Aa=()=>{const r=Se.useAnalyticsConfigStore(),e=n.inject(Ie);if(!e)return;if(e.queryFnOverride){console.warn("Detected incorrect use of useRequestQueue. This composable should not be used in nested components. Please discuss with team-data or report an issue if you feel you have a use case.");return}const t=new Na({carryoverConcurrencyCount:!0,concurrency:r.maxParallelRequests,interval:r.requestInterval,intervalCap:r.requestIntervalCap}),i={...e,queryFnOverride:!0,queryFn:(s,o)=>t.add(()=>e.queryFn(s,o))};n.provide(Ie,i)};function La(r){const e=`[${r.name}] ${r.message}`,t=[];return r.fix&&t.push(`fix: ${r.fix}`),r.sources?.length&&t.push(`sources: ${r.sources.join(", ")}`),r.docs&&t.push(`see: ${r.docs}`),t.length===0?e:[e,...t.map((i,s)=>`${s<t.length-1?"├▶":"╰▶"} ${i}`)].join(`
|
|
12
|
-
`)}function Zi(r,...e){return typeof r=="function"?r(...e):r}function Ua({method:r="warn",formatter:e=La}={}){return(t,{method:i=r}={})=>{console[i](e(t))}}const Ma=Error.captureStackTrace;var Ka=class Fr extends Error{name;code;docs;fix;sources;get why(){return this.message}constructor(e,t=Fr){super(e.why,{cause:e.cause}),this.code=this.name=e.code,this.fix=e.fix,this.docs=e.docs,this.sources=e.sources,Ma?.(this,t)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function Ba(r,e){return typeof r=="string"?`${r}/${e.toLowerCase()}`:r?.(e)}function za(r){const e=r.reporters??[],t={},{docsBase:i}=r;for(const s of Object.keys(r.codes)){const o=r.codes[s],a=o.docs===!1?void 0:o.docs||Ba(i,s),l=(u={},c={})=>{const d=new Ka({code:s,why:Zi(o.why,u),fix:Zi(o.fix,u),docs:a,cause:u.cause,sources:u.sources},l);for(const h of e)h(d,c);return d};t[s]=l}return t}const Pa=typeof window<"u",qa=za({reporters:[Ua()],codes:{PINIA_R1001:{why:'Directly pass all stores to "mapStores()" without putting them in an array. This will fail in production.',fix:"Replace mapStores([useAuthStore, useCartStore]) with mapStores(useAuthStore, useCartStore).",docs:"https://pinia.vuejs.org/cookbook/options-api.html#Giving-access-to-the-whole-store"},PINIA_R1002:{why:r=>`A getter cannot have the same name as another state property. Found "${r.name}" in store "${r.id}".`,fix:"Rename either the getter or the state property.",docs:"https://pinia.vuejs.org/core-concepts/getters.html#Accessing-other-getters"},PINIA_R1003:{why:r=>`The "state" must be a plain object. Found in store "${r.id}".`,fix:"Return a plain object, e.g. avoid state: () => new MyClass().",docs:"https://pinia.vuejs.org/core-concepts/state.html#State"},PINIA_R1004:{why:"Pinia instance not found in context. This falls back to the global activePinia, which exposes you to cross-request pollution on the server.",fix:'"useStore()" is a composable and follows the same rules: call it at the top of setup() (or another composable), or pass the pinia instance explicitly when used outside of a component.',docs:"https://pinia.vuejs.org/ssr/#Using-the-store-outside-of-setup-"},PINIA_R1005:{why:r=>`The store id changed from "${r.from}" to "${r.to}", forcing a reload.`,docs:"https://pinia.vuejs.org/cookbook/hot-module-replacement.html#HMR-Hot-Module-Replacement-"},PINIA_R1006:{why:r=>`Property "${r.key}" of store "${r.id}" is not reactive (not a ref, reactive object, or shallowRef), so storeToRefs() ignores it.`,fix:"If it should be reactive state, wrap it with ref(), reactive(), or shallowRef(). If it is an intentional non-reactive property, wrap it with markRaw() so storeToRefs() skips it explicitly.",docs:"https://pinia.vuejs.org/core-concepts/plugins.html#Adding-new-external-properties"},PINIA_R1007:{why:r=>`The same callback was passed to "$subscribe()" of store "${r.id}" more than once. Subscriptions are deduplicated, so the duplicate is ignored.`,fix:"Subscribe each callback only once. If you need to resubscribe, call the returned function to remove the previous subscription first, or create a new function.",docs:"https://pinia.vuejs.org/core-concepts/state.html#Subscribing-to-the-state"},PINIA_R1008:{why:r=>`"$dispose()" was called on an old instance of store "${r.id}" that has already been replaced by a new one. This also removes the new store.`,fix:"Avoid keeping references to disposed stores. Call the useStore() function again to get the current store.",docs:"https://pinia.vuejs.org/api/pinia/interfaces/StoreWithState.html#-dispose-"}}});let Ji;process.env.NODE_ENV;const er=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();process.env.NODE_ENV;function Xe(r){const e=n.toRaw(r),t={};for(const i in e){const s=e[i];s?.effect?t[i]=n.computed({get:()=>r[i],set(o){r[i]=o}}):(n.isRef(s)||n.isReactive(s))&&(t[i]=n.toRef(r,i))}return t}const Ne=r=>r?.chart.type==="table",_t=r=>r?.query?.datasource==="requests",Gt=r=>!!r&&!Ne(r)&&!_t(r),Ha=(r,e)=>{const t=r.header_description??("description"in r.chart?r.chart.description:void 0);if(t)return t.replaceAll(Fi,e)||void 0},Ga=r=>!r||r==="basic"?"api_usage":re.isPlatformDatasource(r)?"platform_usage":r;function $a({queryBridge:r,context:e,definition:t,chartData:i}){const s=n.ref(""),o=n.ref(""),a=n.ref(void 0),l=n.ref(void 0),u=Se.useAnalyticsConfigStore(),c=Se.useDatasourceConfigStore(),{stripUnknownFilters:d,datasourceConfigMap:h,datasourceConfigError:f,loading:p}=Xe(c),C=n.computed(()=>Ne(t.value));n.onMounted(async()=>{s.value=await r?.exploreBaseUrl?.()??"",o.value=await r?.requestsBaseUrl?.()??""});const O=n.computed(()=>u.analytics&&u.percentiles),R=n.computed(()=>{const v=t.value.chart.type;return["golden_signals","gauge"].includes(v)?!1:v==="top_n"?!!e.value.editable||!!e.value.showTileActions:!0}),T=n.computed(()=>{const v=t.value.query?.datasource??"api_usage";return v.startsWith("goap")?!f.value:!!h.value[v]?.showRequestsLink}),P=n.computed(()=>{if(_t(t.value))return!1;const v=Ga(t.value.query?.datasource);return!!h.value[v]?.showInUI}),b=n.computed(()=>o.value&&t.value.query&&!C.value&&T.value&&O.value&&!p.value),E=n.computed(()=>s.value&&t.value.query&&P.value&&O.value&&!p.value),k=n.computed(()=>i.value?re.msToGranularity(i.value.meta.granularity_ms):void 0),x=n.computed(()=>{const v=t.value,q=[...e.value.filters,...v.query.filters??[]],V="metrics"in v.query?v.query.metrics:void 0,W=v.query?.datasource??"api_usage";return d.value({datasource:W,filters:q,queryFields:V})}),K=n.computed(()=>{if(!E.value||!R.value)return"";const v=t.value;if(Ne(v))return F({...v.query,filters:x.value});const q=v.query.time_range||e.value.timeSpec,V=A(q,x.value);return F(V)}),g=n.computed(()=>{if(!b.value||!R.value)return"";const v=x.value,q=t.value;if(Ne(q))return"";const V=_(q.query.time_range||e.value.timeSpec,v);return m(V)}),m=v=>b.value?`${o.value}?q=${JSON.stringify(v)}`:"",_=(v,q)=>{const V=i.value?.meta?.start?new Date(i.value.meta.start):void 0,W=i.value?.meta?.end?new Date(i.value.meta.end):void 0;return{filter:q,timeframe:{timePeriodsKey:v.type==="relative"?v.time_range:"custom",start:v.type==="absolute"?V:void 0,end:v.type==="absolute"?W:void 0}}},U=(v,q)=>({filter:q,timeframe:{timePeriodsKey:v.type==="relative"?v.time_range:"custom",start:v.type==="absolute"?v.start:void 0,end:v.type==="absolute"?v.end:void 0}}),A=(v,q)=>{const V=t.value;if(!Gt(V))throw new Error("Cannot build a chart explore query for table or api-requests definitions");const W=[...V.query.dimensions??[]],w=[...V.query.metrics??[]];return{filters:q,metrics:w,dimensions:W,time_range:v,granularity:V.query.granularity||k.value||void 0}},F=v=>{if(!E.value)return"";const q=t.value.query.datasource&&t.value.query.datasource!=="basic"?t.value.query.datasource:"api_usage";return`${s.value}?q=${JSON.stringify(v)}&d=${q}&c=${t.value.chart.type}`};return n.watch([b,E],([v,q])=>{v&&(a.value={href:""}),q&&(l.value={href:""})}),{exploreLinkKebabMenu:K,requestsLinkKebabMenu:g,canShowKebabMenu:R,canGenerateRequestsLink:b,canGenerateExploreLink:E,requestsLinkZoomActions:a,exploreLinkZoomActions:l,buildExploreQuery:A,buildRequestsQueryZoomActions:U,buildExploreLink:F,buildRequestLink:m}}const $t=r=>r.type==="relative"?re.TimePeriods.get(re.TIMEFRAME_LOOKUP[r.time_range])?.timeframeLengthMs():new Date(r.end).getTime()-new Date(r.start).getTime(),Fa=r=>r.reduce((e,t)=>{const i=re.TimePeriods.get(re.TIMEFRAME_LOOKUP[t])?.maximumTimeframeLength();return i===void 0||e&&i<=e.durationSeconds?e:{durationSeconds:i,key:t}},void 0),Ft=(r,e)=>{if(!r||!e?.length)return;const t=$t(r),i=Fa(e);return t!==void 0&&i&&t>i.durationSeconds*1e3?i:void 0},Wt=(r,e)=>{const t=Ft(r,e);return!t||!r?r:r.type==="relative"?{...r,time_range:t.key}:{...r,start:new Date(new Date(r.end).getTime()-t.durationSeconds*1e3)}};function Wa(){const r=n.inject(Ie),e=Se.useDatasourceConfigStore(),{datasourceConfigMap:t,stripUnknownFilters:i}=Xe(e);let s=null;return n.onUnmounted(()=>{s?.abort()}),{issueQuery:async(a,l,u)=>{if(!r)throw new Error("Query bridge is not defined");s?.abort();const c=new AbortController;s=c,await e.isReady();const{datasource:d,limit:h,...f}=a,p=d||"basic",C=re.isPlatformDatasource(p),O=i.value({datasource:p,filters:[...a.filters??[],...l.filters],queryFields:a.metrics}).filter(({operator:P})=>!C||!re.requestFilterTypeEmptyV2.some(b=>b===P));let R=a.time_range;!R&&l.timeSpec?R={...l.timeSpec,tz:l.tz}:R&&!R.tz&&(R={...R,tz:l.tz}),R=Wt(R,t.value[p]?.timeRangeOptions);const T={datasource:p,query:{...f,time_range:R,filters:O,limit:u??h}};return r.queryFn(T,c)}}}const Va="24H",Ya={status_code:"response_http_status",upstream_status_code:"upstream_status"},Xa={cost:"usd",latencies_response_ms:"ms",latencies_upstream_ms:"ms",latencies_kong_gateway_ms:"ms",latencies_kong_internal_ms:"ms",request_body_size:"bytes",response_body_size:"bytes",response_header_content_length:"bytes",ai_count:"count"},ja=r=>re.relativeTimeRangeValuesRequestV2.includes(r),Qa=r=>{const e=r?.tz?{tz:r.tz}:{};if(r?.type==="absolute")return{type:"absolute",start:r.start,end:r.end,...e};const t=r?.time_range.toUpperCase()??"";return{type:"relative",time_range:ja(t)?t:Va,...e}},tr=r=>Ya[r]??r,Za=r=>({metric:tr(r.metric),dimension:r.dimension?tr(r.dimension):void 0,unroll:r.unroll,metricUnit:Xa[r.metric],extraFields:r.extra_fields}),Vt="requests";function Ja(){const r=n.inject(Ie),e=Se.useDatasourceConfigStore(),{datasourceConfigMap:t,stripUnknownFilters:i}=Xe(e);let s=null;n.onUnmounted(()=>{s?.abort()});const o=(l,u)=>{const c=l.time_range??u.timeSpec;return Wt(c&&{...c,tz:c.tz??u.tz},t.value[Vt]?.timeRangeOptions)};return{issueRequestsQuery:async(l,u)=>{const c=r?.requestsQueryFn;if(!c)throw new Error("Query bridge cannot fetch request records");s?.abort();const d=new AbortController;s=d,await e.isReady();const h=i.value({datasource:Vt,filters:[...l.filters??[],...u.filters]});return re.fetchAllRequests(c,{datasource:Vt,query:{filters:h,time_range:Qa(o(l,u))}},d,{maxRecords:l.max_records})}}}function el({context:r,globalFilters:e=n.ref([]),isFullscreen:t=n.ref(!1),preview:i=n.ref(!1)}){const s=Se.useAnalyticsConfigStore(),o=Se.useDatasourceConfigStore(),{loading:a}=Xe(s),{loading:l}=Xe(o),u=n.computed(()=>r.value.timeSpec?r.value.timeSpec:{type:"relative",time_range:s.defaultQueryTimeForOrg}),c=n.computed(()=>{const{tz:E}=r.value;return E||new Intl.DateTimeFormat().resolvedOptions().timeZone}),d=n.computed(()=>{const{editable:E}=r.value;return E===void 0||i.value?!1:E}),h=n.computed(()=>{const{showTileActions:E}=r.value;return i.value?!1:E===void 0?!0:E}),f=n.computed(()=>[...r.value.filters??[],...e.value]),p=n.computed(()=>{let{refreshInterval:E}=r.value;if(E===void 0&&(E=Wi),t.value){let k=!1;if(u.value.type==="relative")k=["15m","1h","6h","12h","24h"].includes(u.value.time_range);else{const g=u.value.start.getTime(),m=u.value.end.getTime();k=Math.abs(m-g)<=864e5}const x=new Date().getTime();u.value.type==="absolute"&&u.value.end.getTime()<x||u.value.type==="relative"&&["previous_week","previous_month"].includes(u.value.time_range)?E=0:k?E=Vi:E=Yi}return E}),C=n.computed(()=>({...r.value,filters:f.value,timeSpec:u.value,tz:c.value,refreshInterval:p.value,editable:d.value,showTileActions:h.value})),O=n.computed(()=>!a.value&&!l.value),R=n.computed(()=>!i.value&&!!n.getCurrentInstance()?.vnode?.props?.onTileTimeRangeZoom),T=n.computed(()=>!i.value),P=n.computed(()=>!i.value),b=n.computed(()=>({enabled:R.value,showExploreAction:T.value,showRequestsAction:P.value,showZoomInAction:R.value}));return{editable:d,enrichedContext:C,filters:f,queryReady:O,refreshInterval:p,showTileActions:h,timeSpec:u,tz:c,zoomConfiguration:b}}const tl=6,ir=6,rr=4;function il(r,e){const{pageWidth:t,pageHeight:i,margin:s}=e,o=s+1,a=s+e.headerHeight-3,l=i-s-ir+3,u=l+4;e.title&&(r.setFont("helvetica","bold"),r.setFontSize(11),r.setTextColor(60),r.text(e.title,s,o)),r.setFont("helvetica","normal"),r.setFontSize(8),r.setTextColor(120),r.text(e.generatedAt,t-s,o,{align:"right"}),e.subtitle&&r.text(e.subtitle,s,o+rr),r.setDrawColor(220),r.line(s,a,t-s,a),r.line(s,l,t-s,l),r.setFont("helvetica","bold"),r.setTextColor(60),r.text(e.branding,s,u);const c=r.getTextWidth(e.branding);r.setFont("helvetica","normal");const d=` ${e.dashboardNote}`;e.dashboardUrl?(r.setTextColor(0,68,204),r.textWithLink(d,s+c,u,{url:e.dashboardUrl})):(r.setTextColor(120),r.text(d,s+c,u)),r.setTextColor(120),r.text(e.pageLabel,t-s,u,{align:"right"})}function rl(r){const e=r.querySelectorAll(".kong-ui-public-grid-layout, .grid-stack"),t=[];if(e.forEach(o=>{t.push(...o.querySelectorAll(":scope > .grid-cell:not(.empty-cell), :scope > .grid-stack-item"))}),!t.length)return[];const i=r.getBoundingClientRect().top,s=new Map;return t.forEach(o=>{const a=o.getBoundingClientRect(),l=Math.round(a.top-i),u=Math.round(a.bottom-i),c=s.get(l);s.set(l,c!==void 0?Math.max(c,u):u)}),[...s.entries()].map(([o,a])=>({top:o,bottom:a})).sort((o,a)=>o.top-a.top)}function nl(r,e,t,i){if(!r.length){const a=[];let l=0;for(;l<e;){const u=Math.min(t,e-l);a.push({startY:l,height:u}),l+=u}return a}const s=[];let o=0;for(const a of r){const l=a.top*i,u=a.bottom*i;u-o>t&&(l>o?(s.push({startY:o,height:l-o}),o=l):(s.push({startY:o,height:u-o}),o=u))}return o<e&&s.push({startY:o,height:e-o}),s}function sl(r){const{i18n:e}=gt(),t=n.ref({status:"idle"});async function i(s={}){const{filename:o="dashboard-export",title:a,subtitle:l,dashboardUrl:u,orientation:c="landscape",pageSize:d="letter",margin:h=4,scale:f=2,exclude:p=[".tile-actions",".tooltip",".popover",".dropdown-popover"],output:C="download",onBeforeCapture:O,onAfterCapture:R}=s,T=r.value;if(!T){t.value={status:"error",error:new Error("Dashboard layout container not found.")};return}try{t.value={status:"preparing"},await O?.();const[{snapdom:P},{jsPDF:b}]=await Promise.all([import("@zumer/snapdom"),import("jspdf")]);t.value={status:"capturing"};const E={name:"kong-webgl-snapshot",beforeClone:()=>re.prepareForCapture(),afterClone:()=>re.restoreAfterCapture()},k=await P.toCanvas(T,{scale:f,exclude:p,excludeMode:"remove",embedFonts:!0,plugins:[E]}),x=rl(T),K=T.getBoundingClientRect().width,g=K?k.width/K:f;t.value={status:"generating"};const m=new Date,_=new b({orientation:c,unit:"mm",format:d}),U=_.internal.pageSize.getWidth(),A=_.internal.pageSize.getHeight(),F=tl+(l?rr:0),v=U-h*2,q=A-h*2-F-ir,V=k.width/v,W=q*V,w=nl(x,k.height,W,g),S={title:a,subtitle:l,dashboardUrl:u,generatedAt:e.t("pdfExport.generated",{timestamp:m.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}),branding:e.t("pdfExport.branding"),dashboardNote:e.t("pdfExport.dashboardNote"),pageWidth:U,pageHeight:A,headerHeight:F,margin:h};for(let G=0;G<w.length;G++){G>0&&_.addPage();const{startY:M,height:D}=w[G],N=document.createElement("canvas");N.width=k.width,N.height=D,N.getContext("2d").drawImage(k,0,M,k.width,D,0,0,k.width,D),_.addImage(N.toDataURL("image/png"),"PNG",h,h+F,v,D/V),il(_,{...S,pageLabel:e.t("pdfExport.pageOf",{page:String(G+1),total:String(w.length)})})}if(C==="blob"){const G=_.output("blob");return t.value={status:"complete",pageCount:w.length},G}_.save(o),t.value={status:"complete",pageCount:w.length}}catch(P){t.value={status:"error",error:P}}finally{re.restoreAfterCapture(),await R?.()}}return{exportPdf:i,exportState:n.readonly(t)}}const ol=r=>r.toLowerCase().endsWith("count")?"":r;function al(){const{i18n:r}=gt(),{formatUnit:e}=re.unitFormatter({i18n:r}),t=ue.useFieldLabel();return i=>{const s=i.meta?.metric_names?.[0]??"",o=i.meta?.metric_units?.[s]??"";return{seriesName:t(s),valueFormatter:a=>e(a,o,{translateUnit:ol})}}}const nr=(r,e,t,{prefix:i="chartLabels",fallback:s=t}={})=>{const o=`${i}.${t}`;return e.get(t)||(r.te(o)?r.t(o):s)};function ll(){const{i18n:r}=gt(),e=Se.useDatasourceConfigStore();return(t,i)=>nr(r,e.fieldTranslationMap,t,i)}const ue={useContextLinks:$a,useDashboardContext:el,useEvaluateFeatureFlag:Ta,useExportPdf:sl,useFieldLabel:ll,useI18n:gt,useIssueQuery:Wa,useIssueRequestsQuery:Ja,useMetricFormatter:al,useRequestQueue:Aa},cl={class:"kong-ui-public-csv-export-modal"},ul={key:0,class:"selected-range"},dl={key:4,class:"text-muted",tag:"span"},sr=3,or=n.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(r,{emit:e}){const{i18n:t}=ue.useI18n(),i=ue.useFieldLabel(),s=r,o=e,a=`${s.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,l=n.ref(1),u=n.computed(()=>p.value.rows.length),c=n.computed(()=>s.exportState.status==="success"&&!!s.exportState.chartData?.data?.length),d=n.computed(()=>{if(s.exportState.status!=="success"||!s.exportState.chartData?.meta)return"";const{start:O,end:R}=s.exportState.chartData.meta;return!O||!R?"":new Date(O).getTime()===new Date(R).getTime()?t.t("csvExport.exportAsOf",{time:re.formatTimestamp(new Date(O),{includeTZ:!0})}):`${t.t("csvExport.exportTimeRange")}: ${re.formatTimestamp(new Date(O))} - ${re.formatTimestamp(new Date(R),{includeTZ:!0})}`}),h=n.computed(()=>s.exportState.status!=="success"?"":t.t("csvExport.previewRows",{rowsMax:Math.min(sr,u.value),rowsTotal:u.value,plural:u.value===1?"":"s"})),f=()=>{o("closeModal")},p=n.computed(()=>{if(s.exportState.status!=="success"||!c.value||!s.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const O=s.exportState.chartData,R=O.data.some(x=>x.timestamp!==O.data[0].timestamp),T=O.data.map(x=>{const K=new Date(x.timestamp);return{...Object.keys(x.event).reduce((m,_)=>{if(_ in O.meta.display){const U=x.event[_],A=O.meta.display[_],F=U&&A?.[U]?.name||x.event[_];m[_]=U===Re.OTHER_DIMENSION_ID?t.t("chartLabels.____OTHER____"):F}else m[_]=x.event[_];return m},{}),...R?{timestamp:Bt(K,"yyyy-MM-dd HH:mm:ss"),tzOffset:Bt(K,"XXX")}:{}}});let P=[];R&&(P=[{label:t.t("csvExport.Timestamp"),key:"timestamp"},{label:t.t("csvExport.UtcOffset"),key:"tzOffset"}]);const b="display"in s.exportState.chartData.meta&&s.exportState.chartData.meta.display?s.exportState.chartData.meta.display:{},E=[...P,...Object.keys(b).map(x=>({label:i(x),key:x})),...s.exportState.chartData.meta.metric_names.map(x=>({label:i(x),key:x}))],k=E.reduce((x,K)=>(x[K.key]=K.label,x),{});return{headers:E,csvHeaders:k,rows:T}}),C=async()=>{if(s.exportState.status!=="success")return{total:0,data:[]};const{rows:O}=p.value;return{total:Number(O.length)||0,data:O.slice(0,sr)}};return n.watch(p,()=>{l.value++}),(O,R)=>{const T=n.resolveComponent("KSkeleton"),P=n.resolveComponent("KEmptyState"),b=n.resolveComponent("KTableData"),E=n.resolveComponent("KTooltip"),k=n.resolveComponent("KButton"),x=n.resolveComponent("KModal");return n.openBlock(),n.createElementBlock("div",cl,[n.createVNode(x,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:n.unref(t).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:n.withKeys(f,["esc"])},{default:n.withCtx(()=>[n.createElementVNode("div",null,[r.exportState.status==="success"&&c.value?(n.openBlock(),n.createElementBlock("div",ul,[n.createElementVNode("p",null,n.toDisplayString(r.modalDescription?r.modalDescription:n.unref(t).t("csvExport.exportDescription")),1),n.createElementVNode("p",null,n.toDisplayString(d.value),1)])):n.createCommentVNode("",!0),r.exportState.status==="loading"?(n.openBlock(),n.createBlock(T,{key:1,class:"chart-skeleton",type:"table"})):r.exportState.status==="success"?(n.openBlock(),n.createBlock(b,{key:2,class:"vitals-table",fetcher:C,"fetcher-cache-key":String(l.value),headers:p.value.headers,"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":n.withCtx(()=>[n.createVNode(P,{"action-button-visible":!1},{title:n.withCtx(()=>[n.createElementVNode("h5",null,n.toDisplayString(n.unref(t).t("csvExport.noDataRange")),1)]),default:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(n.unref(t).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):r.exportState.status==="error"?(n.openBlock(),n.createBlock(P,{key:3,"action-button-visible":!1},{title:n.withCtx(()=>[n.createElementVNode("h5",null,n.toDisplayString(n.unref(t).t("csvExport.dataError")),1)]),_:1})):n.createCommentVNode("",!0),r.exportState.status==="success"&&c.value?(n.openBlock(),n.createElementBlock("div",dl,[n.createTextVNode(n.toDisplayString(h.value)+" ",1),n.createVNode(E,{class:"preview-tooltip",placement:"right",text:n.unref(t).t("csvExport.maximumRecordAmount",{value:n.unref(re.EXPORT_RECORD_LIMIT)})},{default:n.withCtx(()=>[n.createVNode(n.unref(se.InfoIcon),{color:`var(--kui-color-text-neutral, ${n.unref(ua)})`,size:`var(--kui-icon-size-30, ${n.unref(ha)})`},null,8,["color","size"])]),_:1},8,["text"])])):n.createCommentVNode("",!0)])]),"footer-actions":n.withCtx(()=>[n.createVNode(k,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(t).t("csvExport.cancelButton")),1)]),_:1}),n.createVNode(Oa,{class:"vitals-report-export-button",filename:a,headers:p.value.csvHeaders,rows:p.value.rows},{default:n.withCtx(()=>[n.createVNode(k,{appearance:"primary","data-testid":"csv-download-button",disabled:r.exportState.status!=="success"||!c.value},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(t).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});var ar=(r=>(r.VALIDATING="VALIDATING",r.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",r.PENDING="PENDING",r.SUCCESS="SUCCESS",r.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",r.ERROR="ERROR",r.STALE_IF_ERROR="STALE_IF_ERROR",r))(ar||{});const hl=r=>r?!!(Object.keys(r)?.length||r.data?.length||r.data?.data?.length||!r.data?.data&&typeof r.data=="object"&&Object.keys(r?.data).length):!1;function lr(r=n.ref({}),e,t,i=hl){const s=n.ref("PENDING");return n.watchEffect(()=>{const o=i(r.value);if(r.value&&o&&t.value){s.value="VALIDATING_HAS_DATA";return}if(r.value&&t.value){s.value="VALIDATING";return}if(r.value&&e.value){s.value="STALE_IF_ERROR";return}if(r.value===void 0&&!e.value){s.value="PENDING";return}if(r.value&&!e.value&&o){s.value="SUCCESS_HAS_DATA";return}if(r.value&&!e.value){s.value="SUCCESS";return}r.value===void 0&&e&&(s.value="ERROR")}),{state:s,swrvState:ar}}const Be=n.defineComponent({__name:"QueryDataProvider",props:{context:{},limitOverride:{},query:{},queryReady:{type:Boolean},refreshCounter:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),{issueQuery:o}=ue.useIssueQuery(),a=n.inject(Ie),l=()=>t.queryReady&&a?JSON.stringify([t.query,t.context,t.refreshCounter]):null,{data:u,error:c,isValidating:d}=si(l,async E=>{try{const k=await o(t.query,t.context,t.limitOverride);return l()!==E?void 0:(C.value=null,{key:E,result:k})}catch(k){if(l()!==E)return;throw C.value=Re.handleQueryError(k),k}finally{l()===E&&i("query-complete")}},{refreshInterval:t.context.refreshInterval,revalidateOnFocus:!1,shouldRetryOnError:!1}),h=n.computed(()=>u.value?.result),{state:f,swrvState:p}=lr(u,c,d),C=n.ref(null),O=n.computed(()=>f.value===p.ERROR||!!C.value),R=n.computed(()=>!t.queryReady||f.value===p.PENDING),T=n.ref(),P=n.computed(()=>h.value??(t.queryReady&&f.value===p.PENDING?T.value:void 0)),b=n.computed(()=>!!P.value&&u.value?.key!==l());return n.watch([()=>h.value,()=>f.value],([E,k])=>{E&&(k==="SUCCESS_HAS_DATA"||k==="SUCCESS")&&E!==T.value&&(T.value=E,i("chart-data",E))},{immediate:!0}),(E,k)=>{const x=n.resolveComponent("KSkeleton"),K=n.resolveComponent("KEmptyState");return(R.value||!h.value&&!O.value)&&!P.value?(n.openBlock(),n.createBlock(x,{key:0,class:"chart-skeleton",type:"table"})):O.value&&!R.value?(n.openBlock(),n.createBlock(K,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state"},n.createSlots({icon:n.withCtx(()=>[C.value?.type==="forbidden"?(n.openBlock(),n.createBlock(n.unref(se.VisibilityOffIcon),{key:0})):(n.openBlock(),n.createBlock(n.unref(se.WarningOutlineIcon),{key:1}))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(C.value?.message||n.unref(s).t("renderer.unexpectedError")),1)]),_:2},[C.value?.details?{name:"default",fn:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(C.value.details),1)]),key:"0"}:void 0]),1024)):P.value?(n.openBlock(),n.createBlock(n.unref(Re.LoadingOverlay),{key:2,loading:b.value},{default:n.withCtx(()=>[n.renderSlot(E.$slots,"default",{data:P.value})]),_:3},8,["loading"])):n.createCommentVNode("",!0)}}}),fl=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{},fitToContent:{type:Boolean}},setup(r){const e=r,t=n.computed(()=>e.chartOptions.type==="single_value"),i=n.computed(()=>e.chartOptions.type==="single_value"?{...e.chartOptions,alignX:e.chartOptions.align_x??"left",showTrend:e.query.granularity==="trend",compact:!!e.fitToContent,hideMetricName:!e.chartOptions.chart_title}:e.chartOptions);return(s,o)=>(n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",{class:n.normalizeClass(["analytics-chart",{"single-value":t.value,compact:t.value&&r.fitToContent}]),style:n.normalizeStyle(t.value?void 0:{height:`${r.height}px`})},[n.createVNode(n.unref(Re.SimpleChart),{"chart-data":a,"chart-options":i.value,"synthetics-data-key":t.value?void 0:r.chartOptions.synthetics_data_key},null,8,["chart-data","chart-options","synthetics-data-key"])],6)]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),De=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},cr=De(fl,[["__scopeId","data-v-df5d87ad"]]),ml={class:"analytics-chart"},Yt=De(n.defineComponent({__name:"BaseAnalyticsChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{},extraProps:{}},emits:["edit-tile","chart-data","zoom-time-range","view-requests","select-chart-range"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),o=n.computed(()=>({type:t.chartOptions.type,stacked:t.chartOptions.stacked??!1,chartDatasetColors:t.chartOptions.chart_dataset_colors,threshold:t.chartOptions.threshold,metricAxisMap:t.chartOptions.metric_axis_map,yAxes:t.chartOptions.y_axes&&{left:a(t.chartOptions.y_axes.left),right:a(t.chartOptions.y_axes.right)},hideTruncationWarning:t.query.limit!==void 0&&t.query.limit>0})),a=c=>c&&{title:c.title,showGrid:c.show_grid},l=()=>{i("edit-tile")},u=c=>{i("chart-data",c)};return(c,d)=>{const h=n.resolveComponent("KDropdownItem");return n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:u},{default:n.withCtx(({data:f})=>[n.createElementVNode("div",ml,[n.createVNode(n.unref(Re.AnalyticsChart),n.mergeProps({"active-metric":r.activeMetric,"chart-data":f,"chart-options":o.value,"explore-link":r.exploreLink,"legend-position":"bottom","requests-link":r.requestsLink,"synthetics-data-key":r.chartOptions.synthetics_data_key,"timeseries-zoom":r.zoomConfiguration?.showZoomInAction,"tooltip-title":""},r.extraProps,{onSelectChartRange:d[0]||(d[0]=p=>i("select-chart-range",p)),onZoomTimeRange:d[1]||(d[1]=p=>i("zoom-time-range",p))}),n.createSlots({_:2},[r.context.editable?{name:"menu-items",fn:n.withCtx(()=>[n.createVNode(h,{onClick:l},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.edit")),1)]),_:1})]),key:"0"}:void 0]),1040,["active-metric","chart-data","chart-options","explore-link","requests-link","synthetics-data-key","timeseries-zoom"])])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-5e3d0a14"]]),ur=n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},setup(r){return(e,t)=>(n.openBlock(),n.createBlock(Yt,{"chart-options":r.chartOptions,context:r.context,"extra-props":{showAnnotations:!1},height:r.height,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),pl={class:"analytics-chart"},gl={key:3,class:"analytics-chart"},_l=De(n.defineComponent({__name:"ScatterChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),{issueRequestsQuery:o}=ue.useIssueRequestsQuery(),a=n.computed(()=>t.query.datasource==="requests"),l=n.computed(()=>{const x=t.query,K=x.time_range??t.context.timeSpec,g=K?$t(K):void 0;if(!g)return x;const m=re.finestGranularityForDuration(g);let _;return x.granularity&&re.Granularities[x.granularity]>=re.Granularities[m]?_=x.granularity:_=m,{...x,granularity:_}}),u=()=>a.value&&t.queryReady?JSON.stringify([t.query,t.context,t.refreshCounter]):null,c=n.ref(null),{data:d,error:h,isValidating:f}=si(u,async x=>{const K=t.query;try{const g=await o(K,t.context);return u()!==x?void 0:(c.value=null,{key:x,result:Re.requestsToScatterData(g,Za(K))})}catch(g){if(u()!==x)return;throw c.value=Re.handleQueryError(g),g}finally{u()===x&&i("query-complete")}},{refreshInterval:t.context.refreshInterval,revalidateOnFocus:!1,shouldRetryOnError:!1}),p=n.computed(()=>d.value?.result),{state:C,swrvState:O}=lr(d,h,f),R=n.ref(),T=n.computed(()=>p.value??R.value);n.watch(p,x=>{x&&(R.value=x)});const P=n.computed(()=>C.value===O.ERROR||!!c.value),b=n.computed(()=>!P.value&&(!t.queryReady||C.value===O.PENDING)&&!T.value),E=n.computed(()=>!!T.value&&d.value?.key!==u()),k=n.computed(()=>({type:"scatter",chartDatasetColors:t.chartOptions.chart_dataset_colors,scatter:{percentileLines:t.chartOptions.percentile_lines?.map(x=>({percentile:x.percentile,label:x.label,borderDash:x.border_dash,color:x.color})),outlierPercentile:t.chartOptions.outlier_percentile,shadeOutlierRegion:t.chartOptions.shade_outlier_region,jitterMs:t.chartOptions.jitter_ms,pointRadius:t.chartOptions.point_radius,pointOpacity:t.chartOptions.point_opacity}}));return(x,K)=>{const g=n.resolveComponent("KSkeleton"),m=n.resolveComponent("KEmptyState");return a.value?b.value?(n.openBlock(),n.createBlock(g,{key:1,class:"chart-skeleton",type:"table"})):P.value?(n.openBlock(),n.createBlock(m,{key:2,"action-button-visible":!1,"data-testid":"scatter-chart-empty-state"},n.createSlots({icon:n.withCtx(()=>[c.value?.type==="forbidden"?(n.openBlock(),n.createBlock(n.unref(se.VisibilityOffIcon),{key:0})):(n.openBlock(),n.createBlock(n.unref(se.WarningOutlineIcon),{key:1}))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(c.value?.message||n.unref(s).t("renderer.unexpectedError")),1)]),_:2},[c.value?.details?{name:"default",fn:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(c.value.details),1)]),key:"0"}:void 0]),1024)):T.value?(n.openBlock(),n.createElementBlock("div",gl,[n.createVNode(n.unref(Re.AnalyticsChart),{"chart-data":T.value,"chart-options":k.value,"legend-position":"bottom",loading:E.value,"synthetics-data-key":r.chartOptions.synthetics_data_key,"tooltip-title":""},null,8,["chart-data","chart-options","loading","synthetics-data-key"])])):n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Be,{key:0,context:r.context,query:l.value,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:K[0]||(K[0]=_=>i("chart-data",_)),onQueryComplete:K[1]||(K[1]=_=>i("query-complete"))},{default:n.withCtx(({data:_})=>[n.createElementVNode("div",pl,[n.createVNode(n.unref(Re.AnalyticsChart),{"chart-data":_,"chart-options":k.value,"legend-position":"bottom","synthetics-data-key":r.chartOptions.synthetics_data_key,"tooltip-title":""},null,8,["chart-data","chart-options","synthetics-data-key"])])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}}),[["__scopeId","data-v-f6f628be"]]),dr=n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["zoom-time-range","select-chart-range"],setup(r,{emit:e}){const t=e;return(i,s)=>(n.openBlock(),n.createBlock(Yt,{"active-metric":r.activeMetric,"chart-options":r.chartOptions,context:r.context,"explore-link":r.exploreLink,height:r.height,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,"requests-link":r.requestsLink,"zoom-configuration":r.zoomConfiguration,onSelectChartRange:s[0]||(s[0]=o=>t("select-chart-range",o)),onZoomTimeRange:s[1]||(s[1]=o=>t("zoom-time-range",o))},null,8,["active-metric","chart-options","context","explore-link","height","query","query-ready","refresh-counter","requests-link","zoom-configuration"]))}}),yl=De(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},setup(r){const e=r,t=n.computed(()=>{const s=e.query?.datasource;if(s&&s!=="api_usage"&&s!=="basic")throw new Error(`Invalid datasource value: ${s}`);return{datasource:e.query?.datasource,overrideTimeRange:e.context.timeSpec,additionalFilter:e.context.filters,longCardTitles:e.chartOptions.long_card_titles,percentileLatency:e.chartOptions.percentile_latency,refreshInterval:e.context.refreshInterval,queryReady:e.queryReady,refreshCounter:e.refreshCounter}}),i=n.computed(()=>!!(e.chartOptions.chart_title||e.headerDescription));return(s,o)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["metric-card-tile-wrapper",{titled:i.value}])},[n.createVNode(n.unref(oi.MetricsProvider),n.normalizeProps(n.guardReactiveProps(t.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(oi.MetricsConsumer))]),_:1},16)],2))}}),[["__scopeId","data-v-3eda5028"]]);var nt=(r=>(r.PENDING="PENDING",r.LOADING="LOADING",r.SUCCESS="SUCCESS",r.ERROR="ERROR",r))(nt||{});const Rl=r=>!!r?.length;function Cl(r,e,t,i=Rl){const s=n.computed(()=>i(r.value)),o=n.computed(()=>{const a=r.value!==void 0,l=e.value!==void 0&&e.value!==null;return t.value?"LOADING":s.value?"SUCCESS":l?"ERROR":a?"SUCCESS":"PENDING"});return{fetchState:nt,hasData:s,state:o}}const El=({emitState:r,fetchLifecycleState:e,hasData:t})=>{n.watch(()=>({hasData:t.value,state:e.value}),({hasData:i,state:s})=>{if(s!==nt.PENDING){if(s===nt.LOADING){r({hasData:i,state:"loading"});return}if(s===nt.ERROR){r({hasData:i,state:"error"});return}r({hasData:i,state:"success"})}})},bl=({startRow:r,endRow:e})=>{const t=e-r;return{blockIndex:t>0?Math.floor(r/t):0,pageSize:t}},Ol=({startRow:r,rowsLength:e,pageSize:t,total:i,hasMore:s})=>{if(typeof i=="number")return i;if(s!==!0&&(s===!1||e<t))return r+e},wl=({fetcher:r,resetKey:e,sort:t})=>{const i=new Map,s=new Map,o=n.ref(0),a=n.ref(0),l=n.shallowRef(),u=n.shallowRef(),c=n.shallowRef(),d=n.ref(0),h=n.ref(!1);let f,p,C=t?.value?.sortColumnKey,O=t?.value?.sortColumnOrder;const R=v=>v===o.value&&f===r.value&&p===e?.value,T=(v,q)=>R(v)&&q===a.value&&C===t?.value?.sortColumnKey&&O===t?.value?.sortColumnOrder,P=v=>{if(!t)return!0;const q=t.value;return!q?.sortColumnKey||!q.sortColumnOrder?v.length===0:v.length===1&&v[0].colId===q.sortColumnKey&&v[0].sort===q.sortColumnOrder},b=()=>{h.value=d.value>0},E=()=>{a.value+=1,C=t?.value?.sortColumnKey,O=t?.value?.sortColumnOrder;for(const v of s.values())v.resolve(!1);i.clear(),s.clear(),u.value=void 0,c.value=void 0,d.value=0,b()},k=()=>{c.value=void 0,d.value+=1,b()},x=()=>{d.value=Math.max(0,d.value-1),b()},K=v=>{const q=s.get(v);if(q)return q;let V;const W={promise:new Promise(w=>{V=w}),resolve:w=>V(w)};return s.set(v,W),W},g=(v,q)=>{q.resolve(!1),s.get(v)===q&&s.delete(v)},m=async({blockIndex:v,currentBlockCompletion:q,datasourceId:V,requestGeneration:W})=>{if(v===0)return"ready";const w=s.get(v-1);if(!w)return g(v,q),"failed";const S=await w.promise;return T(V,W)?S?"ready":(g(v,q),"failed"):(g(v,q),"stale")},_=({blockIndex:v,currentBlockCompletion:q,getRowsParams:V,pageSize:W,result:w})=>{w.cursor!==void 0&&i.set(v,w.cursor),V.successCallback(w.data,Ol({startRow:V.startRow,rowsLength:w.data.length,pageSize:W,total:w.total,hasMore:w.hasMore})),V.startRow===0&&(u.value=w.data),q.resolve(!0)},U=({blockIndex:v,currentBlockCompletion:q,fetchError:V,getRowsParams:W})=>{c.value=V,W.failCallback(),g(v,q)},A=()=>{const v=r.value;if(!v)throw new Error("TableDataGrid requires a fetcher in infinite mode");f=v,p=e?.value;const q=o.value+1;return o.value=q,E(),{async getRows(V){if(!R(q)||!P(V.sortModel)){V.failCallback();return}const{blockIndex:W,pageSize:w}=bl({startRow:V.startRow,endRow:V.endRow});W===0&&s.has(0)&&E();const S=a.value,G=K(W);if(await m({blockIndex:W,currentBlockCompletion:G,datasourceId:q,requestGeneration:S})!=="ready"||!T(q,S)){V.failCallback(),g(W,G);return}k();try{const M=W>0?i.get(W-1):void 0,D=await v({mode:"infinite",pageSize:w,cursor:M,sort:t?.value});if(!T(q,S)){V.failCallback(),g(W,G);return}_({blockIndex:W,currentBlockCompletion:G,getRowsParams:V,pageSize:w,result:D})}catch(M){if(!T(q,S)){V.failCallback(),g(W,G);return}U({blockIndex:W,currentBlockCompletion:G,fetchError:M,getRowsParams:V})}finally{T(q,S)&&x()}}}},F=()=>{l.value=A()};return n.watch([r,()=>e?.value],()=>{F()},{immediate:!0}),n.watch([()=>t?.value?.sortColumnKey,()=>t?.value?.sortColumnOrder],()=>E()),{datasource:n.readonly(l),data:n.shallowReadonly(u),error:n.readonly(c),isFetching:n.readonly(h)}},Tl={title:"No Data",message:"There is no data to display."},vl={title:"An error occurred",message:"Data cannot be displayed due to an error."},Sl={emptyState:Tl,errorState:vl};function hr(){const r=ct.createI18n("en-us",Sl);return{i18n:r,i18nT:ct.i18nTComponent(r)}}const{i18n:xl}=hr(),fr=(r,e)=>{const t=Reflect.get(e,r.key);return r.valueFormatter?r.valueFormatter(t,e):String(t??"")},yt=r=>typeof r!="number"?null:Number.isFinite(r)?r:null,Il=(r,e)=>r.reduce((t,i)=>{const s=yt(Reflect.get(i,e.key));return s===null?t:{sum:t.sum+s,max:Math.max(t.max,s)}},{sum:0,max:0}),Dl=(r,e)=>{const t=(e??[]).filter(s=>Number.isFinite(s.value)&&r>=s.value);if(!t.length)return;const i=Math.max(...t.map(s=>s.value));return t.filter(s=>s.value===i).some(s=>s.type==="error")?"error":"warning"},kl=(r,e,t)=>{if(r===null)return 0;const i=t==="relative"?e.sum:e.max;return i>0?Math.min(Math.max(r/i,0),1):0},Nl=r=>{const e=t=>xl.formatNumber(t,{maximumFractionDigits:2});return r>0&&r<.01?`< ${e(.01)} %`:`${e(r)} %`},mr=({value:r,stats:e,header:t})=>{if(r===null||e.sum<=0)return;const i=r/e.sum*100;return t.percentageFormatter?.(i)??Nl(i)},pr=(r,e)=>e!==void 0&&e.length>(r?.length??-1)?e:r,Al=({rows:r,header:e,stats:t})=>r.reduce((i,s)=>({value:pr(i.value,fr(e,s))??"",relative:e.showPercentage?pr(i.relative,mr({value:yt(Reflect.get(s,e.key)),stats:t,header:e})):void 0}),{value:""}),Ll=["data-threshold"],Ul={class:"table-data-grid-cell-label-track"},Ml={class:"table-data-grid-cell-label"},Kl={key:0,class:"table-data-grid-cell-relative","data-testid":"table-data-grid-cell-relative"},Bl={key:0,"aria-hidden":"true",class:"table-data-grid-cell-label table-data-grid-cell-label-sizer"},zl=["data-text"],Pl=["data-text"],ql=["data-threshold"],Hl=n.defineComponent({name:"TableDataGridCellRenderer",__name:"TableDataGridCellRenderer",props:{params:{}},setup(r,{expose:e}){const t=n.shallowRef(r.params),i=n.ref(null),s=n.ref(!1),o=n.computed(()=>t.value.headerDef??{key:"",label:""}),a=n.computed(()=>t.value.context?.presentation),l=n.computed(()=>t.value.context?.cells?.tooltipTarget?.value??"body"),u=n.computed(()=>t.value.valueFormatted??String(t.value.value??"")),c=n.computed(()=>t.value.value),d=n.computed(()=>yt(c.value)),h=n.computed(()=>a.value?.stats[o.value.key]),f=n.computed(()=>o.value.showPercentage&&h.value?mr({value:d.value,stats:h.value,header:o.value}):void 0),p=n.computed(()=>!!o.value.bar&&!!h.value&&(d.value!==null||c.value===null||c.value===void 0)),C=n.computed(()=>p.value&&h.value?kl(d.value,h.value,o.value.bar)*100:0),O=n.computed(()=>p.value?a.value?.labelSizers[o.value.key]:void 0),R=n.computed(()=>o.value.thresholds?.length&&d.value!==null?Dl(d.value,o.value.thresholds):void 0),T=n.computed(()=>({column:o.value,refreshCell:()=>{const _=t.value.node;_&&t.value.api.refreshCells({force:!0,rowNodes:[_]})},row:t.value.data??{},rowIndex:t.value.node?.rowIndex??0,rowValue:t.value.value,selected:t.value.node?.isSelected()??!1})),P=(_,{slots:U})=>{const A=t.value.colDef?.colId,F=t.value.context?.cells?.slots;return!A||A==="cell-icon"||!F?.[A]?U.default?.():n.h("span",{class:"table-data-grid-cell-slot-content"},n.renderSlot(F,A,T.value,()=>U.default?.()??[]))},b=()=>{const _=t.value.context?.cells?.slots;return _?.["cell-icon"]?n.renderSlot(_,"cell-icon",T.value):null};let E,k,x=!1;const K=()=>{const _=i.value;s.value=!!_&&_.scrollWidth>_.clientWidth},g=()=>{x||(k!==void 0&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{k=void 0,K()}))},m=_=>{if(E?.disconnect(),_){E?.observe(_);const U=_.closest(".ag-cell");U&&E?.observe(U)}g()};return n.onMounted(()=>{E=new ResizeObserver(g),m(i.value)}),n.watch(i,m),n.onUnmounted(()=>{x=!0,E?.disconnect(),k!==void 0&&cancelAnimationFrame(k)}),e({refresh(_){return t.value=_,n.nextTick(g),!0}}),(_,U)=>{const A=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(["table-data-grid-cell-renderer",{"table-data-grid-cell-renderer--bar":p.value,"table-data-grid-cell-renderer--percentage":!!f.value,[`table-data-grid-cell-renderer--text-${R.value}`]:!p.value&&!!R.value}]),"data-threshold":R.value},[n.createElementVNode("span",Ul,[n.createElementVNode("span",Ml,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(b))),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(P),null,{default:n.withCtx(()=>[n.createVNode(A,{class:"table-data-grid-cell-tooltip",disabled:!s.value,"kpop-attributes":{popoverDelay:400},"max-width":"300",placement:"bottom-start",target:l.value,text:u.value},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"contentElement",ref:i,class:"table-data-grid-cell-content"},n.toDisplayString(u.value),513)]),_:1},8,["disabled","target","text"])]),_:1})),f.value?(n.openBlock(),n.createElementBlock("span",Kl,"("+n.toDisplayString(f.value)+")",1)):n.createCommentVNode("",!0)]),O.value?(n.openBlock(),n.createElementBlock("span",Bl,[n.createElementVNode("span",{class:"table-data-grid-cell-sizer-value","data-text":O.value.value},null,8,zl),O.value.relative?(n.openBlock(),n.createElementBlock("span",{key:0,class:"table-data-grid-cell-sizer-relative","data-text":`(${O.value.relative})`},null,8,Pl)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),p.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"table-data-grid-cell-bar","data-testid":"table-data-grid-cell-bar","data-threshold":R.value},[n.createElementVNode("span",{class:"table-data-grid-cell-bar-fill","data-testid":"table-data-grid-cell-bar-fill",style:n.normalizeStyle({width:`${C.value}%`})},null,4)],8,ql)):n.createCommentVNode("",!0)],10,Ll)}}}),Gl=({headers:r,slots:e,initialSort:t,mode:i,rows:s,tooltipTarget:o})=>{const a=i??"infinite",l=new Set,u=p=>!!(p.showPercentage||p.bar||p.thresholds?.length);n.watch([r,()=>s?.value],()=>{r.value.forEach(p=>{if(!u(p))return;let C;if(a==="infinite"&&(p.showPercentage||p.bar)?C="percentage and bar presentation is only supported in unpaginated mode":a==="unpaginated"&&s?.value?.some(R=>{const T=Reflect.get(R,p.key);return T!=null&&yt(T)===null})&&(C="contains non-finite or nonnumeric values; numeric presentation skips those values"),!C)return;const O=`${p.key}:${C}`;l.has(O)||(l.add(O),console.warn(`[TableDataGrid] Column "${p.key}" ${C}.`))})},{immediate:!0});const c=n.computed(()=>{if(a!=="unpaginated")return{};const p=s?.value??[];return Object.fromEntries(r.value.filter(C=>C.showPercentage||C.bar).map(C=>[C.key,Il(p,C)]))}),d=n.computed(()=>{if(a!=="unpaginated")return{};const p=s?.value??[];return Object.fromEntries(r.value.filter(C=>C.bar).map(C=>[C.key,Al({rows:p,header:C,stats:c.value[C.key]})]))}),h=n.computed(()=>({cells:{slots:e,tooltipTarget:o},presentation:{stats:c.value,labelSizers:d.value}})),f=p=>{const C=t?.sortColumnKey===p.key;return{colId:p.key,flex:!p.width&&!p.maxWidth?1:void 0,headerName:p.label,maxWidth:p.maxWidth,minWidth:p.minWidth,sortable:p.sortable??!1,unSortIcon:p.showSortIcon,...C?{initialSort:t?.sortColumnOrder,initialSortIndex:0}:{},valueGetter:O=>O.data?.[p.key],valueFormatter:O=>O.data?fr(p,O.data):String(O.value??""),width:p.width,cellRenderer:Hl,cellRendererParams:{headerDef:p}}};return{columnDefs:n.computed(()=>r.value.map(f)),gridContext:h}},Xt=({config:r,headers:e,pageSize:t})=>{const i=new Set(e.filter(o=>o.sortable).map(o=>o.key)),s=r?.sortColumnKey&&i.has(r.sortColumnKey)?r.sortColumnKey:void 0;return{sortColumnKey:s,sortColumnOrder:s?r?.sortColumnOrder:void 0,pageSize:r?.pageSize??t,...r?.fitToContent!==void 0?{fitToContent:r.fitToContent}:{}}},gr=(r,e)=>r.sortColumnKey===e.sortColumnKey&&r.sortColumnOrder===e.sortColumnOrder&&r.pageSize===e.pageSize&&r.fitToContent===e.fitToContent,$l=({headers:r,pageSize:e,tableConfig:t,emitSort:i,emitTableConfigUpdate:s,onExternalConfigChange:o})=>{const a=n.computed(()=>t.value?Xt({config:t.value,headers:r.value,pageSize:e.value}):void 0),l=n.ref(a.value??Xt({config:void 0,headers:r.value,pageSize:e.value}));n.watch(a,h=>{h&&!gr(h,l.value)&&(l.value=h,o?.(h))});const u=h=>{const f=Xt({config:{...l.value,...h},headers:r.value,pageSize:e.value});gr(f,l.value)||((f.sortColumnKey!==l.value.sortColumnKey||f.sortColumnOrder!==l.value.sortColumnOrder)&&i({sortColumnKey:f.sortColumnKey,sortColumnOrder:f.sortColumnOrder}),l.value=f,s(f))};n.watch(r,()=>{t.value||u({})},{deep:!0});const c=n.computed(()=>({sortColumnKey:l.value.sortColumnKey,sortColumnOrder:l.value.sortColumnOrder})),d=n.computed(()=>t.value?.pageSize??e.value);return{activeTableConfig:n.readonly(l),activeSort:c,activePageSize:d,patchTableConfig:u}},Fl=({cellClick:r,headers:e,rowClick:t})=>{const i=n.computed(()=>new Set(e.value.filter(a=>a.disableRowClick).map(a=>a.key))),s=a=>{const l=a.event?.target;return l instanceof Element?l.closest(".ag-cell")?.getAttribute("col-id")??void 0:void 0},o=a=>{const l=s(a);return!!(l&&i.value.has(l))};return{onCellClick:a=>{const l=a.colDef.colId;!a.data||!l||r({columnKey:l,row:a.data,value:a.value})},onRowClick:a=>{a.data&&!o(a)&&t(a.data,a)}}},Wl=({activeSort:r,patchTableConfig:e})=>{const t=(i,s)=>{i.applyColumnState({state:s.sortColumnKey?[{colId:s.sortColumnKey,sort:s.sortColumnOrder??null,sortIndex:0}]:[],defaultState:{sort:null,sortIndex:null}})};return{onSortChanged:i=>{const s=i.api.getColumnState().filter(l=>l.sort).sort((l,u)=>(l.sortIndex??0)-(u.sortIndex??0)),o=s[s.length-1],a=o?{sortColumnKey:o.colId,sortColumnOrder:o.sort}:{sortColumnKey:void 0,sortColumnOrder:void 0};(a.sortColumnKey!==r.value.sortColumnKey||a.sortColumnOrder!==r.value.sortColumnOrder)&&e(a),s.length>1&&t(i.api,a)},applySortToGrid:t}},Vl={key:0,class:"table-error-state","data-testid":"table-error-state"},Yl={key:1,class:"table-empty-state","data-testid":"table-empty-state"},Xl=n.defineComponent({__name:"TableDataGrid",props:{headers:{},error:{type:Boolean,default:!1},tableConfig:{},fetcher:{type:Function},mode:{},pageSize:{default:25},refreshKey:{type:[String,Number,Boolean]},rows:{}},emits:["grid:ready","state","row:click","cell:click","sort","update:tableConfig"],setup(r,{emit:e}){je.ModuleRegistry.registerModules([je.AllCommunityModule,je.ClientSideRowModelModule,je.InfiniteRowModelModule]);const t=r.mode??"infinite",i=e,{i18n:s}=hr(),{t:o}=s,a=n.useSlots(),l=n.shallowRef(),u=n.useTemplateRef("rootElement"),c=n.shallowRef("body"),d=()=>{const D=document.fullscreenElement;c.value=D instanceof HTMLElement&&D.contains(u.value??null)?D:"body"};n.onMounted(()=>{d(),document.addEventListener("fullscreenchange",d)}),n.onBeforeUnmount(()=>{document.removeEventListener("fullscreenchange",d)});const{activeTableConfig:h,activeSort:f,activePageSize:p,patchTableConfig:C}=$l({headers:n.toRef(()=>r.headers),pageSize:n.toRef(()=>r.pageSize),tableConfig:n.toRef(()=>r.tableConfig),emitSort:D=>i("sort",D),emitTableConfigUpdate:D=>i("update:tableConfig",D),onExternalConfigChange:D=>{l.value&&R(l.value,D)}}),{onSortChanged:O,applySortToGrid:R}=Wl({activeSort:f,patchTableConfig:C}),T=n.computed(()=>t==="unpaginated"&&!!h.value.fitToContent),P=je.themeQuartz.withParams({autoHeightMinBodyHeight:0}),{onCellClick:b,onRowClick:E}=Fl({cellClick:D=>i("cell:click",D),headers:n.toRef(()=>r.headers),rowClick:(D,N)=>i("row:click",D,N)}),k={resizable:!1,sortable:!1,suppressMovable:!0},x=n.computed(()=>[p.value,r.refreshKey]),K=t==="infinite"?wl({fetcher:n.toRef(()=>r.fetcher),resetKey:x,sort:f}):void 0,g=K?.datasource,m=n.computed(()=>K?K.data.value:r.rows),_=n.computed(()=>K?.isFetching.value??!1),U=n.computed(()=>r.rows?Array.from(r.rows):void 0),{columnDefs:A,gridContext:F}=Gl({headers:n.toRef(()=>r.headers),mode:t,rows:U,slots:a,tooltipTarget:c,initialSort:f.value}),{fetchState:v,hasData:q,state:V}=Cl(m,n.toRef(()=>K?.error.value),_),W=n.computed(()=>V.value===v.SUCCESS&&!q.value);K&&El({emitState:D=>i("state",D),fetchLifecycleState:V,hasData:q});const w=()=>{const D=l.value;if(!D||D.isDestroyed())return;const N=f.value,oe=D.getColumnState().find(ae=>ae.sort);oe?.colId===N.sortColumnKey&&(oe?.sort??void 0)===N.sortColumnOrder||R(D,N)};n.watch([l,f],w);const S=n.ref(!1),G=D=>{D.direction==="vertical"&&(S.value=D.top>0)},M=D=>{l.value=D.api,i("grid:ready",D.api)};return(D,N)=>{const oe=n.resolveComponent("KEmptyState");return n.openBlock(),n.createElementBlock("div",{ref_key:"rootElement",ref:u,class:n.normalizeClass(["kong-ui-public-table-data-grid",{"fit-to-content":T.value,"is-scrolled":S.value}]),"data-testid":"table-data-grid"},[r.error?(n.openBlock(),n.createElementBlock("div",Vl,[n.renderSlot(D.$slots,"error-state",{},()=>[n.createVNode(oe,{"icon-variant":"error",message:n.unref(o)("errorState.message"),title:n.unref(o)("errorState.title")},null,8,["message","title"])],!0)])):W.value?(n.openBlock(),n.createElementBlock("div",Yl,[n.renderSlot(D.$slots,"empty-state",{},()=>[n.createVNode(oe,{message:n.unref(o)("emptyState.message"),title:n.unref(o)("emptyState.title")},null,8,["message","title"])],!0)])):(n.openBlock(),n.createBlock(n.unref(Wr.AgGridVue),{key:2,"cache-block-size":n.unref(t)==="infinite"?n.unref(p):void 0,class:"table-data-grid-grid","column-defs":n.unref(A),context:n.unref(F),datasource:n.unref(t)==="infinite"?n.unref(g):void 0,"default-col-def":k,"dom-layout":T.value?"autoHeight":"normal","infinite-initial-row-count":n.unref(t)==="infinite"?1:void 0,loading:_.value,"row-data":n.unref(t)==="unpaginated"?U.value:void 0,"row-model-type":n.unref(t)==="unpaginated"?"clientSide":"infinite","suppress-cell-focus":!0,"suppress-multi-sort":!0,theme:n.unref(P),onBodyScroll:G,onCellClicked:n.unref(b),onGridReady:M,onNewColumnsLoaded:w,onRowClicked:n.unref(E),onSortChanged:n.unref(O)},null,8,["cache-block-size","column-defs","context","datasource","dom-layout","infinite-initial-row-count","loading","row-data","row-model-type","theme","onCellClicked","onRowClicked","onSortChanged"]))],2)}}}),jl=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},_r=jl(Xl,[["__scopeId","data-v-82e410f3"]]),yr=3,Ql={anthropic:se.AnthropicIcon,azure:se.AzureIcon,bedrock:se.AmazonBedrockIcon,cerebras:se.CerebrasIcon,cohere:se.CohereIcon,databricks:se.DatabricksIcon,deepseek:se.DeepseekIcon,gemini:se.GeminiIcon,huggingface:se.HuggingFaceIcon,llama2:se.MetaLlamaIcon,mistral:se.MistralIcon,moonshot:se.KimiIcon,nvidia:se.NvidiaIcon,ollama:se.OllamaIcon,openai:se.OpenAiIcon,vertex:se.GoogleVertexIcon,vllm:se.VllmIcon,xai:se.GrokIcon},jt=(r,e)=>{if(!r||!e)return;const t=e.toLowerCase();return r[e]??Object.entries(r).find(([i])=>i.toLowerCase()===t)?.[1]},Zl=({columnOptions:r,columnKey:e,rawValue:t})=>{if(!(jt(r,e)?.icon_set!=="ai_provider"||typeof t!="string"))return Ql[t.toLowerCase()]},Jl=r=>{if(r==null||r==="")return null;const e=typeof r=="number"?r:Number(r);return Number.isFinite(e)?e:null},ec=r=>r.toLocaleLowerCase().endsWith("count"),tc=r=>{const e=Object.keys(r?.meta?.display??{}).slice(0,yr),t=r?.meta?.metric_names??[];return(r?.data??[]).map(i=>{const s={record:i};return e.forEach(o=>{s[o]=i.event[o]}),t.forEach(o=>{s[o]=Jl(i.event[o])}),s})},ic=({data:r,columnOptions:e,i18n:t,fieldTranslationMap:i})=>{const{formatUnit:s}=re.unitFormatter({i18n:t}),o=r?.data??[],a=r?.meta,l=a?.display??{},u=Object.keys(l).slice(0,yr),c=a?.metric_names??[],d=c[0],h=u.length>1,f=E=>nr(t,i,E),p=(E,k)=>jt(e,E)?.label||k,C=(E,k)=>{if(ec(E)||E==="requests")return"";const x=k===1?"":"s",K=`chartUnits.${E}`;return t.messages[K]?t.formatMessage({id:K},{plural:x}):E},O=E=>{const k=x=>s(x,"%",{translateUnit:C});return E>0&&E<.01?`< ${k(.01)}`:k(E)},R=(E,k)=>{const x=E.event[k];if(x==null)return"–";const K=typeof x=="number"?x:Number(x);if(Number.isNaN(K))return"–";const g=a?.metric_units?.[k]||"count";return g==="%"?O(K):s(K,g,{approximate:["count","count/minute","token count"].includes(g),isBytes1024:!0,translateUnit:C})},T=(E,k)=>{const x=String(E.record.event[k]),K=l[k]?.[x];return{id:x,label:x===Re.OTHER_DIMENSION_ID?t.t("chartLabels.____OTHER____"):K?.name||"-",deleted:!!K?.deleted}},P=u.map(E=>({key:E,label:p(E,h?f(E):t.t("topNTable.nameLabel")),type:"dimension",valueFormatter:(k,x)=>T(x,E).label,sortable:!1}));c.forEach(E=>{const k=jt(e,E);P.push({key:E,label:k?.label||f(E),type:"metric",valueFormatter:(x,K)=>R(K.record,E),showPercentage:k?.value==="relative",percentageFormatter:O,bar:k?.bar==="max"?"absolute":k?.bar,thresholds:k?.thresholds,sortable:!1})});const b=o.length?a?u.some(E=>!Object.keys(l[E]||{}).length)?t.t("topNTable.errors.display"):d?"":t.t("topNTable.errors.metricNames"):t.t("topNTable.errors.meta"):"";return{headers:P,errorMessage:b,getDimension:T}},rc={class:"fallback-entity-link","data-testid":"entity-link-parent"},Rr=n.defineComponent({__name:"FallbackEntityLink",props:{entityLinkData:{}},setup(r){return(e,t)=>(n.openBlock(),n.createElementBlock("div",rc,n.toDisplayString(r.entityLinkData.label),1))}}),nc=["data-testid"],sc={key:1},oc=De(n.defineComponent({__name:"TopNDataGrid",props:{chartOptions:{},data:{},fitToContent:{type:Boolean,default:!1},height:{}},setup(r){const e=n.inject(Ie),t=Se.useDatasourceConfigStore(),{i18n:i}=ue.useI18n(),s=n.computed(()=>tc(r.data)),o=n.computed(()=>ic({data:r.data,columnOptions:r.chartOptions.column_options,i18n:i,fieldTranslationMap:t.fieldTranslationMap})),a=n.computed(()=>o.value.headers.map(R=>({...R,minWidth:R.type==="dimension"?160:R.bar?260:140}))),l=n.computed(()=>o.value.headers.filter(R=>R.type==="dimension")),u=n.computed(()=>({fitToContent:r.fitToContent})),c=n.computed(()=>r.fitToContent?{height:"auto"}:r.height===void 0?void 0:{height:`${r.height}px`}),d=(R,T)=>Zl({columnOptions:r.chartOptions.column_options,columnKey:R,rawValue:T}),h=n.defineAsyncComponent(async()=>{if(e?.fetchComponent)try{return await e.fetchComponent("EntityLink")}catch{return Rr}return Rr}),f=R=>{const T=r.chartOptions.entity_links;return T&&(T[R]||Object.entries(T).find(([P])=>P.toLowerCase()===R.toLowerCase())?.[1])||""},p=R=>f(R)||l.value[0]?.key===R&&r.chartOptions.entity_link||"",C=(R,T)=>R[T]!=="empty"&&R[T]!==Re.OTHER_DIMENSION_ID,O=(R,T)=>{const P=p(T),b=String(R[T]);if(b.includes(":")){const[E,k]=b.split(":");return P.replace($i,E).replace(Pt,k)}return P.replace(Pt,b)};return(R,T)=>{const P=n.resolveComponent("KEmptyState");return n.openBlock(),n.createElementBlock("div",{class:"top-n-data-grid","data-testid":s.value.length?"top-n-table":void 0,style:n.normalizeStyle(c.value)},[n.createVNode(n.unref(_r),{error:!!o.value.errorMessage,headers:a.value,mode:"unpaginated",rows:s.value,"table-config":u.value},n.createSlots({"error-state":n.withCtx(()=>[n.createVNode(P,{"action-button-visible":!1,"data-testid":"chart-empty-state"},{icon:n.withCtx(()=>[n.createVNode(n.unref(se.WarningOutlineIcon))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(o.value.errorMessage),1)]),_:1})]),"empty-state":n.withCtx(()=>[n.createVNode(P,{"action-button-visible":!1,"data-testid":"top-n-empty-state",title:n.unref(i).t("topNTable.defaultEmptyStateTitle")},null,8,["title"])]),"cell-icon":n.withCtx(({column:b,rowValue:E})=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d(b.key,E)),{class:"top-n-provider-icon","data-testid":"top-n-provider-icon",decorative:"",size:"var(--kui-icon-size-30, 16px)"}))]),_:2},[n.renderList(l.value,b=>({name:b.key,fn:n.withCtx(({row:E})=>[p(b.key)&&C(E,b.key)?(n.openBlock(),n.createBlock(n.unref(h),{key:0,class:"top-n-entity-link","entity-link-data":o.value.getDimension(E,b.key),"external-link":O(E,b.key)},null,8,["entity-link-data","external-link"])):o.value.getDimension(E,b.key).label==="empty"?(n.openBlock(),n.createElementBlock("i",sc,"empty")):n.createCommentVNode("",!0)])}))]),1032,["error","headers","rows","table-config"])],12,nc)}}}),[["__scopeId","data-v-bbc29e85"]]),ac=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{},fitToContent:{type:Boolean}},setup(r){return(e,t)=>(n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},{default:n.withCtx(({data:i})=>[n.createVNode(oc,{"chart-options":r.chartOptions,data:i,"fit-to-content":r.fitToContent,height:r.height},null,8,["chart-options","data","fit-to-content","height"])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),lc=n.defineComponent({__name:"TopTalkersRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["query-complete"],setup(r,{emit:e}){const t=r,i=e,s=n.computed(()=>t.chartOptions.columns.map(c=>({dimension:c.dimension,label:c.label}))),o=c=>({...t.query,dimensions:[c.dimension],filters:[...t.query.filters??[],...c.filters??[]]}),a=n.computed(()=>new Map(s.value.map((c,d)=>[c,o(t.chartOptions.columns[d])]))),l=new Set,u=c=>{l.add(c),l.size===s.value.length&&(l.clear(),i("query-complete"))};return n.watch([a,()=>t.refreshCounter],()=>l.clear()),(c,d)=>(n.openBlock(),n.createBlock(n.unref(Re.TopTalkersGrid),{"column-options":r.chartOptions.column_options,columns:s.value,"size-metric":r.chartOptions.size_metric},{column:n.withCtx(({column:h})=>[n.createVNode(Be,{context:r.context,query:a.value.get(h),"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onQueryComplete:f=>u(h)},{default:n.withCtx(({data:f})=>[n.createVNode(n.unref(Re.TopTalkersColumn),{"column-options":r.chartOptions.column_options,data:f,dimension:h.dimension,label:h.label,"size-metric":r.chartOptions.size_metric},null,8,["column-options","data","dimension","label","size-metric"])]),_:2},1032,["context","query","query-ready","refresh-counter","onQueryComplete"])]),_:1},8,["column-options","columns","size-metric"]))}}),cc=r=>r.records.map(e=>{const t={...e};return Object.entries(e).forEach(([i,s])=>{if(s===null)return;const o=r.meta.display?.[i]?.[String(s)]?.name;o&&(t[i]=o)}),t}),Cr=({columns:r,fieldLabel:e})=>r.map(t=>({key:t,label:e(t)})),uc={platform:Cr,platform_usage:Cr},Er=async({abortController:r,context:e,cursor:t,pageSize:i,query:s,onResponseColumns:o,stripUnknownFilters:a,tabularQueryFn:l})=>{if(!l)throw new Error("AnalyticsBridge.tabularQueryFn is not defined");const u=s.query,c=a({datasource:s.datasource,filters:[...u.filters??[],...e.filters],queryFields:u.entity===void 0?void 0:[u.entity]}),d=await l({datasource:s.datasource,query:{columns:u.columns,cursor:t===void 0?u.cursor:String(t),entity:u.entity,filters:c,page_size:i}},r);return d.meta.columns?.length&&o?.(d.meta.columns),{data:cc(d),cursor:d.meta.cursor,hasMore:!!d.meta.cursor}},dc={platform:Er,platform_usage:Er},hc=De(n.defineComponent({__name:"TableDataGridRenderer",props:{query:{},context:{},queryReady:{type:Boolean},height:{},refreshCounter:{}},emits:["loading-change"],setup(r,{emit:e}){const t=r,i=e,s=n.inject(Ie),o=Se.useDatasourceConfigStore(),a=ue.useFieldLabel(),l=new AbortController,u=n.ref([]),c=n.ref(!1),d=n.computed(()=>t.height===void 0?void 0:{height:`${t.height}px`}),h=n.computed(()=>({datasource:t.query.datasource,query:{columns:t.query.columns,cursor:t.query.cursor,entity:t.query.entity,filters:t.query.filters,page_size:t.query.page_size}})),f=n.computed(()=>JSON.stringify({refreshCounter:t.refreshCounter,query:{columns:t.query.columns,datasource:t.query.datasource,entity:t.query.entity,filters:t.query.filters,page_size:t.query.page_size},context:{filters:t.context.filters,timeSpec:t.context.timeSpec,tz:t.context.tz}}));n.onUnmounted(()=>{l.abort()});const p=n.computed(()=>uc[t.query.datasource]({columns:t.query.columns?.length?t.query.columns:u.value,fieldLabel:R=>a(R)})),C=n.computed(()=>async({cursor:R,pageSize:T})=>{try{await o.isReady();const P=dc[h.value.datasource];if(!P)throw new Error(`No table data grid fetcher found for datasource: ${h.value.datasource}`);const b=await P({abortController:l,context:t.context,cursor:R,pageSize:T,query:h.value,onResponseColumns:E=>{u.value=E},stripUnknownFilters:o.stripUnknownFilters,tabularQueryFn:s?.tabularQueryFn});return c.value=!1,b}catch(P){throw c.value=!0,P}}),O=R=>{R.state==="error"&&(c.value=!0),i("loading-change",R.state==="loading")};return(R,T)=>{const P=n.resolveComponent("KSkeleton");return n.openBlock(),n.createElementBlock("div",{class:"table-data-grid-renderer",style:n.normalizeStyle(d.value)},[r.queryReady?(n.openBlock(),n.createBlock(n.unref(_r),{key:1,error:c.value,fetcher:C.value,headers:p.value,"page-size":r.query.page_size,"refresh-key":f.value,onState:O},null,8,["error","fetcher","headers","page-size","refresh-key"])):(n.openBlock(),n.createBlock(P,{key:0,"data-testid":"table-skeleton",type:"table"}))],4)}}}),[["__scopeId","data-v-c8caabc2"]]),fc=n.defineComponent({__name:"DonutChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},setup(r){return(e,t)=>(n.openBlock(),n.createBlock(Yt,{"chart-options":r.chartOptions,context:r.context,height:r.height,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),br="#ffffff",mc="#0044f4",pc="#d60027",gc="#ad000e",_c="#850000",yc="#5c0000",Rc="#ff3954",Cc="#ffabab",Ec="#ffe5e5",bc="#ecfcff",Oc="#6f28ff",wc="#f1f0ff",Tc="#e0e4ea",vc="#0044f4",Sc="#0030cc",xc="#002099",Ic="#001466",Dc="#5f9aff",kc="#bee2ff",Nc="#eefaff",Ac="#0d0e14",Lc="#6c7489",Uc="#52596e",Mc="#3a3f51",Kc="#232633",Bc="#afb7c5",zc="#e0e4ea",Pc="#f9fafb",qc="rgba(13, 14, 20, 0.6)",Hc="#0044f4",Gc="#0030cc",$c="#002099",Fc="#001466",Wc="#5f9aff",Vc="#bee2ff",Yc="#eefaff",Xc="#007d60",jc="#005944",Qc="#004737",Zc="#003629",Jc="#00d6a4",eu="#b5ffee",tu="#ecfffb",iu="rgba(0, 0, 0, 0)",ru="#995c00",nu="#804400",su="#662d00",ou="#4d1b00",au="#ffc400",lu="#fff296",cu="#fffce0",Or="#e0e4ea",uu="#0044f4",du="#d60027",hu="#ad000e",fu="#850000",mu="#5c0000",pu="#ff3954",gu="#ffabab",_u="#ffe5e5",yu="#6f28ff",Ru="#e0e4ea",Cu="rgba(255, 255, 255, 0.2)",Eu="#6c7489",bu="#52596e",Ou="#3a3f51",wu="#232633",Tu="#afb7c5",vu="#e0e4ea",Su="#f9fafb",xu="#0044f4",Iu="#0030cc",Du="#002099",ku="#001466",Nu="#5f9aff",Au="#bee2ff",Lu="#eefaff",Uu="rgba(0, 0, 0, 0)",Mu="#0044f4",Ku="#0d0e14",Bu="#0044f4",zu="#d60027",Pu="#ad000e",qu="#850000",Hu="#5c0000",Gu="#ff3954",$u="#ffabab",Fu="#ffe5e5",Wu="#00abd2",Vu="#d60067",Yu="#6f28ff",Xu="#5e00f5",ju="#afb7c5",Qu="#0044f4",Zu="#0030cc",Ju="#002099",ed="#001466",td="#5f9aff",id="#bee2ff",rd="#eefaff",nd="#ffffff",sd="#6c7489",od="#52596e",ad="#3a3f51",ld="#232633",cd="#afb7c5",ud="#e0e4ea",dd="#f9fafb",hd="#0044f4",fd="#0030cc",md="#002099",pd="#001466",gd="#5f9aff",_d="#bee2ff",yd="#eefaff",Rd="#007d60",Cd="#005944",Ed="#004737",bd="#003629",Od="#00d6a4",wd="#b5ffee",Td="#ecfffb",vd="#995c00",Sd="#804400",xd="#662d00",Id="#4d1b00",Dd="#ffc400",kd="#fff296",Nd="#fffce0",Ad="0.2s",Ld="0px",Ud="2px",Md="4px",wr="6px",Kd="8px",Bd="10px",zd="12px",Pd="16px",qd="20px",Hd="24px",Gd="32px",$d="50%",Fd="100px",Wd="0px",Tr="1px",Vd="2px",Yd="4px",Xd="640px",jd="768px",Qd="1024px",Zd="1280px",Jd="1536px",eh="'JetBrains Mono', Consolas, monospace",th="'Inter', Roboto, Helvetica, sans-serif",Qt="'Inter', Roboto, Helvetica, sans-serif",ih="10px",rh="12px",nh="14px",sh="16px",oh="18px",ah="20px",lh="24px",ch="32px",uh="40px",dh="48px",hh="700",fh="500",mh="400",ph="600",gh="#f50045",_h="#828a9e",yh="#306fff",Rh="#00a17b",Ch="#ffc400",Eh="10px",bh="12px",Oh="16px",wh="20px",Th="24px",vh="32px",Sh="40px",xh="48px",Ih="normal",Dh="-0.12px",kh="-0.24px",Nh="-0.32px",Ah="-0.4px",Lh="-0.48px",Uh="normal",Mh="12px",Kh="16px",Bh="20px",zh="24px",Ph="28px",qh="32px",Hh="36px",Gh="40px",$h="48px",Fh="56px",Wh="#f1f0ff",Vh="#ffe5e5",Yh="#eefaff",Xh="#52596e",jh="#e0e4ea",Qh="#ecfcff",Zh="#ecfffb",Jh="#fffce0",ef="#fff0f7",tf="#6f28ff",rf="#5e00f5",nf="#d60027",sf="#ad000e",of="#0044f4",af="#0030cc",lf="#e0e4ea",cf="#afb7c5",uf="#52596e",df="#3a3f51",hf="#00819d",ff="#00647a",mf="#007d60",pf="#005944",gf="#995c00",_f="#804400",yf="#d60067",Rf="#ad0053",Cf="#000933",Ef="rgba(255, 255, 255, 0.12)",bf="rgba(255, 255, 255, 0.12)",Of="#00fabe",wf="rgba(255, 255, 255, 0.24)",Tf="#bee2ff",vf="#ffffff",Sf="#eefaff",xf="#00fabe",If="0 0 0 1px rgba(255, 255, 255, 0.12) inset",Df="4px 0 0 0 #00fabe inset",kf="0 0 0 1px rgba(255, 255, 255, 0.60) inset",vr="0px 4px 20px 0px rgba(0, 0, 0, 0.08)",Nf="0px 0px 0px 1px #e0e4ea inset",Af="0px 0px 0px 1px #d60027 inset",Lf="0px 0px 0px 1px #ad000e inset",Uf="0px 0px 0px 1px #e0e4ea inset",Mf="0px 0px 0px 1px #0044f4 inset",Kf="0px 0px 0px 1px #001466 inset",Bf="0px 0px 0px 1px #5f9aff inset",zf="0px 0px 0px 4px rgba(0, 68, 244, 0.2)",Pf="0px",qf="2px",Hf="4px",Gf="6px",$f="8px",Ff="12px",Wf="16px",Vf="20px",Yf="24px",Xf="32px",jf="40px",Qf="48px",Zf="56px",Jf="64px",em="80px",tm="96px",im="auto",rm="#bee2ff",nm="#8fc1ff",sm="#5f9aff",om="#306fff",am="#b5ffee",lm="#00fabe",cm="#00d6a4",um="#00a17b",dm="#007d60",hm="#005944",fm="#b5ffee",mm="#00fabe",pm="#b5ffee",gm="#00a17b",_m="#fff296",ym="#ffe04b",Rm="#ffc400",Cm="#b37600",Em="#995c00",bm="#804400",Om="#fff296",wm="#ffe04b",Tm="#ffc2b3",vm="#ff9877",Sm="#ff723c",xm="#f75008",Im="#d13500",Dm="#a31f00",km="#ffc2b3",Nm="#ff9877",Am="#ff723c",Lm="#f75008",Um="#d13500",Mm="#a31f00",Km="#ffc2b3",Bm="#ff9877",zm="#ff723c",Pm="#f75008",qm="#d13500",Hm="#a31f00",Gm="#ffc2b3",$m="#ff9877",Fm="#ff723c",Wm="#f75008",Vm="#d13500",Ym="#a31f00",Xm="#ffc2b3",jm="#ff9877",Qm="#ff723c",Zm="#f75008",Jm="#d13500",ep="#ffabab",tp="#ff7272",ip="#ff3954",rp="#f50045",np="#d60027",sp="#ad000e",op="#ffabab",ap="#ff7272",lp="#ff3954",cp="#f50045",up="#d60027",dp="#eefaff",hp="#ecfffb",fp="#fffce0",mp="#fff1ef",pp="#ffe5e5",gp="#5f9aff",_p="#00d6a4",yp="#ffc400",Rp="#ff723c",Cp="#ff3954",Ep="#eefaff",bp="#ecfffb",Op="#fffce0",wp="#fff1ef",Tp="#ffe5e5",vp="#0044f4",Sp="#007d60",xp="#995c00",Ip="#d13500",Dp="#d60027",Sr=Object.freeze(Object.defineProperty({__proto__:null,KUI_ANIMATION_DURATION_20:Ad,KUI_BORDER_RADIUS_0:Ld,KUI_BORDER_RADIUS_10:Ud,KUI_BORDER_RADIUS_100:Gd,KUI_BORDER_RADIUS_20:Md,KUI_BORDER_RADIUS_30:wr,KUI_BORDER_RADIUS_40:Kd,KUI_BORDER_RADIUS_50:Bd,KUI_BORDER_RADIUS_60:zd,KUI_BORDER_RADIUS_70:Pd,KUI_BORDER_RADIUS_80:qd,KUI_BORDER_RADIUS_90:Hd,KUI_BORDER_RADIUS_CIRCLE:$d,KUI_BORDER_RADIUS_ROUND:Fd,KUI_BORDER_WIDTH_0:Wd,KUI_BORDER_WIDTH_10:Tr,KUI_BORDER_WIDTH_20:Vd,KUI_BORDER_WIDTH_30:Yd,KUI_BREAKPOINT_DESKTOP:Jd,KUI_BREAKPOINT_LAPTOP:Zd,KUI_BREAKPOINT_MOBILE:Xd,KUI_BREAKPOINT_PHABLET:jd,KUI_BREAKPOINT_TABLET:Qd,KUI_COLOR_BACKGROUND:br,KUI_COLOR_BACKGROUND_ACCENT:mc,KUI_COLOR_BACKGROUND_DANGER:pc,KUI_COLOR_BACKGROUND_DANGER_STRONG:gc,KUI_COLOR_BACKGROUND_DANGER_STRONGER:_c,KUI_COLOR_BACKGROUND_DANGER_STRONGEST:yc,KUI_COLOR_BACKGROUND_DANGER_WEAK:Rc,KUI_COLOR_BACKGROUND_DANGER_WEAKER:Cc,KUI_COLOR_BACKGROUND_DANGER_WEAKEST:Ec,KUI_COLOR_BACKGROUND_DECORATIVE_AQUA_WEAKEST:bc,KUI_COLOR_BACKGROUND_DECORATIVE_PURPLE:Oc,KUI_COLOR_BACKGROUND_DECORATIVE_PURPLE_WEAKEST:wc,KUI_COLOR_BACKGROUND_DISABLED:Tc,KUI_COLOR_BACKGROUND_INFO:vc,KUI_COLOR_BACKGROUND_INFO_STRONG:Sc,KUI_COLOR_BACKGROUND_INFO_STRONGER:xc,KUI_COLOR_BACKGROUND_INFO_STRONGEST:Ic,KUI_COLOR_BACKGROUND_INFO_WEAK:Dc,KUI_COLOR_BACKGROUND_INFO_WEAKER:kc,KUI_COLOR_BACKGROUND_INFO_WEAKEST:Nc,KUI_COLOR_BACKGROUND_INVERSE:Ac,KUI_COLOR_BACKGROUND_NEUTRAL:Lc,KUI_COLOR_BACKGROUND_NEUTRAL_STRONG:Uc,KUI_COLOR_BACKGROUND_NEUTRAL_STRONGER:Mc,KUI_COLOR_BACKGROUND_NEUTRAL_STRONGEST:Kc,KUI_COLOR_BACKGROUND_NEUTRAL_WEAK:Bc,KUI_COLOR_BACKGROUND_NEUTRAL_WEAKER:zc,KUI_COLOR_BACKGROUND_NEUTRAL_WEAKEST:Pc,KUI_COLOR_BACKGROUND_OVERLAY:qc,KUI_COLOR_BACKGROUND_PRIMARY:Hc,KUI_COLOR_BACKGROUND_PRIMARY_STRONG:Gc,KUI_COLOR_BACKGROUND_PRIMARY_STRONGER:$c,KUI_COLOR_BACKGROUND_PRIMARY_STRONGEST:Fc,KUI_COLOR_BACKGROUND_PRIMARY_WEAK:Wc,KUI_COLOR_BACKGROUND_PRIMARY_WEAKER:Vc,KUI_COLOR_BACKGROUND_PRIMARY_WEAKEST:Yc,KUI_COLOR_BACKGROUND_SUCCESS:Xc,KUI_COLOR_BACKGROUND_SUCCESS_STRONG:jc,KUI_COLOR_BACKGROUND_SUCCESS_STRONGER:Qc,KUI_COLOR_BACKGROUND_SUCCESS_STRONGEST:Zc,KUI_COLOR_BACKGROUND_SUCCESS_WEAK:Jc,KUI_COLOR_BACKGROUND_SUCCESS_WEAKER:eu,KUI_COLOR_BACKGROUND_SUCCESS_WEAKEST:tu,KUI_COLOR_BACKGROUND_TRANSPARENT:iu,KUI_COLOR_BACKGROUND_WARNING:ru,KUI_COLOR_BACKGROUND_WARNING_STRONG:nu,KUI_COLOR_BACKGROUND_WARNING_STRONGER:su,KUI_COLOR_BACKGROUND_WARNING_STRONGEST:ou,KUI_COLOR_BACKGROUND_WARNING_WEAK:au,KUI_COLOR_BACKGROUND_WARNING_WEAKER:lu,KUI_COLOR_BACKGROUND_WARNING_WEAKEST:cu,KUI_COLOR_BORDER:Or,KUI_COLOR_BORDER_ACCENT:uu,KUI_COLOR_BORDER_DANGER:du,KUI_COLOR_BORDER_DANGER_STRONG:hu,KUI_COLOR_BORDER_DANGER_STRONGER:fu,KUI_COLOR_BORDER_DANGER_STRONGEST:mu,KUI_COLOR_BORDER_DANGER_WEAK:pu,KUI_COLOR_BORDER_DANGER_WEAKER:gu,KUI_COLOR_BORDER_DANGER_WEAKEST:_u,KUI_COLOR_BORDER_DECORATIVE_PURPLE:yu,KUI_COLOR_BORDER_DISABLED:Ru,KUI_COLOR_BORDER_INVERSE:Cu,KUI_COLOR_BORDER_NEUTRAL:Eu,KUI_COLOR_BORDER_NEUTRAL_STRONG:bu,KUI_COLOR_BORDER_NEUTRAL_STRONGER:Ou,KUI_COLOR_BORDER_NEUTRAL_STRONGEST:wu,KUI_COLOR_BORDER_NEUTRAL_WEAK:Tu,KUI_COLOR_BORDER_NEUTRAL_WEAKER:vu,KUI_COLOR_BORDER_NEUTRAL_WEAKEST:Su,KUI_COLOR_BORDER_PRIMARY:xu,KUI_COLOR_BORDER_PRIMARY_STRONG:Iu,KUI_COLOR_BORDER_PRIMARY_STRONGER:Du,KUI_COLOR_BORDER_PRIMARY_STRONGEST:ku,KUI_COLOR_BORDER_PRIMARY_WEAK:Nu,KUI_COLOR_BORDER_PRIMARY_WEAKER:Au,KUI_COLOR_BORDER_PRIMARY_WEAKEST:Lu,KUI_COLOR_BORDER_TRANSPARENT:Uu,KUI_COLOR_BRAND:Mu,KUI_COLOR_TEXT:Ku,KUI_COLOR_TEXT_ACCENT:Bu,KUI_COLOR_TEXT_DANGER:zu,KUI_COLOR_TEXT_DANGER_STRONG:Pu,KUI_COLOR_TEXT_DANGER_STRONGER:qu,KUI_COLOR_TEXT_DANGER_STRONGEST:Hu,KUI_COLOR_TEXT_DANGER_WEAK:Gu,KUI_COLOR_TEXT_DANGER_WEAKER:$u,KUI_COLOR_TEXT_DANGER_WEAKEST:Fu,KUI_COLOR_TEXT_DECORATIVE_AQUA:Wu,KUI_COLOR_TEXT_DECORATIVE_PINK:Vu,KUI_COLOR_TEXT_DECORATIVE_PURPLE:Yu,KUI_COLOR_TEXT_DECORATIVE_PURPLE_STRONG:Xu,KUI_COLOR_TEXT_DISABLED:ju,KUI_COLOR_TEXT_INFO:Qu,KUI_COLOR_TEXT_INFO_STRONG:Zu,KUI_COLOR_TEXT_INFO_STRONGER:Ju,KUI_COLOR_TEXT_INFO_STRONGEST:ed,KUI_COLOR_TEXT_INFO_WEAK:td,KUI_COLOR_TEXT_INFO_WEAKER:id,KUI_COLOR_TEXT_INFO_WEAKEST:rd,KUI_COLOR_TEXT_INVERSE:nd,KUI_COLOR_TEXT_NEUTRAL:sd,KUI_COLOR_TEXT_NEUTRAL_STRONG:od,KUI_COLOR_TEXT_NEUTRAL_STRONGER:ad,KUI_COLOR_TEXT_NEUTRAL_STRONGEST:ld,KUI_COLOR_TEXT_NEUTRAL_WEAK:cd,KUI_COLOR_TEXT_NEUTRAL_WEAKER:ud,KUI_COLOR_TEXT_NEUTRAL_WEAKEST:dd,KUI_COLOR_TEXT_PRIMARY:hd,KUI_COLOR_TEXT_PRIMARY_STRONG:fd,KUI_COLOR_TEXT_PRIMARY_STRONGER:md,KUI_COLOR_TEXT_PRIMARY_STRONGEST:pd,KUI_COLOR_TEXT_PRIMARY_WEAK:gd,KUI_COLOR_TEXT_PRIMARY_WEAKER:_d,KUI_COLOR_TEXT_PRIMARY_WEAKEST:yd,KUI_COLOR_TEXT_SUCCESS:Rd,KUI_COLOR_TEXT_SUCCESS_STRONG:Cd,KUI_COLOR_TEXT_SUCCESS_STRONGER:Ed,KUI_COLOR_TEXT_SUCCESS_STRONGEST:bd,KUI_COLOR_TEXT_SUCCESS_WEAK:Od,KUI_COLOR_TEXT_SUCCESS_WEAKER:wd,KUI_COLOR_TEXT_SUCCESS_WEAKEST:Td,KUI_COLOR_TEXT_WARNING:vd,KUI_COLOR_TEXT_WARNING_STRONG:Sd,KUI_COLOR_TEXT_WARNING_STRONGER:xd,KUI_COLOR_TEXT_WARNING_STRONGEST:Id,KUI_COLOR_TEXT_WARNING_WEAK:Dd,KUI_COLOR_TEXT_WARNING_WEAKER:kd,KUI_COLOR_TEXT_WARNING_WEAKEST:Nd,KUI_FONT_FAMILY_CODE:eh,KUI_FONT_FAMILY_HEADING:th,KUI_FONT_FAMILY_TEXT:Qt,KUI_FONT_SIZE_10:ih,KUI_FONT_SIZE_100:dh,KUI_FONT_SIZE_20:rh,KUI_FONT_SIZE_30:nh,KUI_FONT_SIZE_40:sh,KUI_FONT_SIZE_50:oh,KUI_FONT_SIZE_60:ah,KUI_FONT_SIZE_70:lh,KUI_FONT_SIZE_80:ch,KUI_FONT_SIZE_90:uh,KUI_FONT_WEIGHT_BOLD:hh,KUI_FONT_WEIGHT_MEDIUM:fh,KUI_FONT_WEIGHT_REGULAR:mh,KUI_FONT_WEIGHT_SEMIBOLD:ph,KUI_ICON_COLOR_DANGER:gh,KUI_ICON_COLOR_NEUTRAL:_h,KUI_ICON_COLOR_PRIMARY:yh,KUI_ICON_COLOR_SUCCESS:Rh,KUI_ICON_COLOR_WARNING:Ch,KUI_ICON_SIZE_10:Eh,KUI_ICON_SIZE_20:bh,KUI_ICON_SIZE_30:Oh,KUI_ICON_SIZE_40:wh,KUI_ICON_SIZE_50:Th,KUI_ICON_SIZE_60:vh,KUI_ICON_SIZE_70:Sh,KUI_ICON_SIZE_80:xh,KUI_LETTER_SPACING_0:Ih,KUI_LETTER_SPACING_MINUS_10:Dh,KUI_LETTER_SPACING_MINUS_20:kh,KUI_LETTER_SPACING_MINUS_30:Nh,KUI_LETTER_SPACING_MINUS_40:Ah,KUI_LETTER_SPACING_MINUS_50:Lh,KUI_LETTER_SPACING_NORMAL:Uh,KUI_LINE_HEIGHT_10:Mh,KUI_LINE_HEIGHT_100:Fh,KUI_LINE_HEIGHT_20:Kh,KUI_LINE_HEIGHT_30:Bh,KUI_LINE_HEIGHT_40:zh,KUI_LINE_HEIGHT_50:Ph,KUI_LINE_HEIGHT_60:qh,KUI_LINE_HEIGHT_70:Hh,KUI_LINE_HEIGHT_80:Gh,KUI_LINE_HEIGHT_90:$h,KUI_METHOD_COLOR_BACKGROUND_CONNECT:Wh,KUI_METHOD_COLOR_BACKGROUND_DELETE:Vh,KUI_METHOD_COLOR_BACKGROUND_GET:Yh,KUI_METHOD_COLOR_BACKGROUND_HEAD:Xh,KUI_METHOD_COLOR_BACKGROUND_OPTIONS:jh,KUI_METHOD_COLOR_BACKGROUND_PATCH:Qh,KUI_METHOD_COLOR_BACKGROUND_POST:Zh,KUI_METHOD_COLOR_BACKGROUND_PUT:Jh,KUI_METHOD_COLOR_BACKGROUND_TRACE:ef,KUI_METHOD_COLOR_TEXT_CONNECT:tf,KUI_METHOD_COLOR_TEXT_CONNECT_STRONG:rf,KUI_METHOD_COLOR_TEXT_DELETE:nf,KUI_METHOD_COLOR_TEXT_DELETE_STRONG:sf,KUI_METHOD_COLOR_TEXT_GET:of,KUI_METHOD_COLOR_TEXT_GET_STRONG:af,KUI_METHOD_COLOR_TEXT_HEAD:lf,KUI_METHOD_COLOR_TEXT_HEAD_STRONG:cf,KUI_METHOD_COLOR_TEXT_OPTIONS:uf,KUI_METHOD_COLOR_TEXT_OPTIONS_STRONG:df,KUI_METHOD_COLOR_TEXT_PATCH:hf,KUI_METHOD_COLOR_TEXT_PATCH_STRONG:ff,KUI_METHOD_COLOR_TEXT_POST:mf,KUI_METHOD_COLOR_TEXT_POST_STRONG:pf,KUI_METHOD_COLOR_TEXT_PUT:gf,KUI_METHOD_COLOR_TEXT_PUT_STRONG:_f,KUI_METHOD_COLOR_TEXT_TRACE:yf,KUI_METHOD_COLOR_TEXT_TRACE_STRONG:Rf,KUI_NAVIGATION_COLOR_BACKGROUND:Cf,KUI_NAVIGATION_COLOR_BACKGROUND_SELECTED:Ef,KUI_NAVIGATION_COLOR_BORDER:bf,KUI_NAVIGATION_COLOR_BORDER_CHILD:Of,KUI_NAVIGATION_COLOR_BORDER_DIVIDER:wf,KUI_NAVIGATION_COLOR_TEXT:Tf,KUI_NAVIGATION_COLOR_TEXT_FOCUS:vf,KUI_NAVIGATION_COLOR_TEXT_HOVER:Sf,KUI_NAVIGATION_COLOR_TEXT_SELECTED:xf,KUI_NAVIGATION_SHADOW_BORDER:If,KUI_NAVIGATION_SHADOW_BORDER_CHILD:Df,KUI_NAVIGATION_SHADOW_FOCUS:kf,KUI_SHADOW:vr,KUI_SHADOW_BORDER:Nf,KUI_SHADOW_BORDER_DANGER:Af,KUI_SHADOW_BORDER_DANGER_STRONG:Lf,KUI_SHADOW_BORDER_DISABLED:Uf,KUI_SHADOW_BORDER_PRIMARY:Mf,KUI_SHADOW_BORDER_PRIMARY_STRONGEST:Kf,KUI_SHADOW_BORDER_PRIMARY_WEAK:Bf,KUI_SHADOW_FOCUS:zf,KUI_SPACE_0:Pf,KUI_SPACE_10:qf,KUI_SPACE_100:jf,KUI_SPACE_110:Qf,KUI_SPACE_120:Zf,KUI_SPACE_130:Jf,KUI_SPACE_140:em,KUI_SPACE_150:tm,KUI_SPACE_20:Hf,KUI_SPACE_30:Gf,KUI_SPACE_40:$f,KUI_SPACE_50:Ff,KUI_SPACE_60:Wf,KUI_SPACE_70:Vf,KUI_SPACE_80:Yf,KUI_SPACE_90:Xf,KUI_SPACE_AUTO:im,KUI_STATUS_COLOR_100:rm,KUI_STATUS_COLOR_100S:gp,KUI_STATUS_COLOR_101:nm,KUI_STATUS_COLOR_102:sm,KUI_STATUS_COLOR_103:om,KUI_STATUS_COLOR_1NA:dp,KUI_STATUS_COLOR_200:am,KUI_STATUS_COLOR_200S:_p,KUI_STATUS_COLOR_201:lm,KUI_STATUS_COLOR_202:cm,KUI_STATUS_COLOR_203:um,KUI_STATUS_COLOR_204:dm,KUI_STATUS_COLOR_205:hm,KUI_STATUS_COLOR_206:fm,KUI_STATUS_COLOR_207:mm,KUI_STATUS_COLOR_208:pm,KUI_STATUS_COLOR_226:gm,KUI_STATUS_COLOR_2NA:hp,KUI_STATUS_COLOR_300:_m,KUI_STATUS_COLOR_300S:yp,KUI_STATUS_COLOR_301:ym,KUI_STATUS_COLOR_302:Rm,KUI_STATUS_COLOR_303:Cm,KUI_STATUS_COLOR_304:Em,KUI_STATUS_COLOR_305:bm,KUI_STATUS_COLOR_307:Om,KUI_STATUS_COLOR_308:wm,KUI_STATUS_COLOR_3NA:fp,KUI_STATUS_COLOR_400:Tm,KUI_STATUS_COLOR_400S:Rp,KUI_STATUS_COLOR_401:vm,KUI_STATUS_COLOR_402:Sm,KUI_STATUS_COLOR_403:xm,KUI_STATUS_COLOR_404:Im,KUI_STATUS_COLOR_405:Dm,KUI_STATUS_COLOR_406:km,KUI_STATUS_COLOR_407:Nm,KUI_STATUS_COLOR_408:Am,KUI_STATUS_COLOR_409:Lm,KUI_STATUS_COLOR_410:Um,KUI_STATUS_COLOR_411:Mm,KUI_STATUS_COLOR_412:Km,KUI_STATUS_COLOR_413:Bm,KUI_STATUS_COLOR_414:zm,KUI_STATUS_COLOR_415:Pm,KUI_STATUS_COLOR_416:qm,KUI_STATUS_COLOR_417:Hm,KUI_STATUS_COLOR_418:Gm,KUI_STATUS_COLOR_421:$m,KUI_STATUS_COLOR_422:Fm,KUI_STATUS_COLOR_423:Wm,KUI_STATUS_COLOR_424:Vm,KUI_STATUS_COLOR_425:Ym,KUI_STATUS_COLOR_426:Xm,KUI_STATUS_COLOR_428:jm,KUI_STATUS_COLOR_429:Qm,KUI_STATUS_COLOR_431:Zm,KUI_STATUS_COLOR_451:Jm,KUI_STATUS_COLOR_4NA:mp,KUI_STATUS_COLOR_500:ep,KUI_STATUS_COLOR_500S:Cp,KUI_STATUS_COLOR_501:tp,KUI_STATUS_COLOR_502:ip,KUI_STATUS_COLOR_503:rp,KUI_STATUS_COLOR_504:np,KUI_STATUS_COLOR_505:sp,KUI_STATUS_COLOR_506:op,KUI_STATUS_COLOR_507:ap,KUI_STATUS_COLOR_508:lp,KUI_STATUS_COLOR_510:cp,KUI_STATUS_COLOR_511:up,KUI_STATUS_COLOR_5NA:pp,KUI_STATUS_COLOR_BACKGROUND_100:Ep,KUI_STATUS_COLOR_BACKGROUND_200:bp,KUI_STATUS_COLOR_BACKGROUND_300:Op,KUI_STATUS_COLOR_BACKGROUND_400:wp,KUI_STATUS_COLOR_BACKGROUND_500:Tp,KUI_STATUS_COLOR_TEXT_100:vp,KUI_STATUS_COLOR_TEXT_200:Sp,KUI_STATUS_COLOR_TEXT_300:xp,KUI_STATUS_COLOR_TEXT_400:Ip,KUI_STATUS_COLOR_TEXT_500:Dp},Symbol.toStringTag,{value:"Module"})),xr=Object.keys(Sr).filter(r=>r.startsWith("KUI_COLOR")),Ir=r=>Sr[r],kp=r=>`--${r.toLowerCase().replaceAll("_","-")}`,Dr=()=>{if(typeof window>"u")return Object.fromEntries(xr.map(t=>[t,Ir(t)]));const r=window.getComputedStyle(document.documentElement),e=(t,i)=>r.getPropertyValue(t).trim()||i;return Object.fromEntries(xr.map(t=>[t,e(kp(t),Ir(t))]))},Zt=r=>{const e=n.ref(Dr());if(typeof window<"u"&&typeof MutationObserver<"u"){const t=new MutationObserver(()=>{e.value=Dr()});t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-kui-theme"]}),n.getCurrentScope()&&n.onScopeDispose(()=>t.disconnect())}return e},Np=()=>typeof window>"u"?Qt:window.getComputedStyle(document.documentElement).getPropertyValue("--kui-font-family-text").trim()||Qt,Ap=[`background-color: var(--kui-pop-color-background, var(--kui-color-background, ${br}));`,`border: var(--kui-pop-border-width, var(--kui-border-width-10, ${Tr})) solid var(--kui-pop-color-border, var(--kui-color-border, ${Or}));`,`border-radius: var(--kui-pop-border-radius, var(--kui-border-radius-30, ${wr}));`,`box-shadow: var(--kui-pop-shadow, var(--kui-shadow, ${vr}));`].join(" "),Lp=r=>{const e=Np(),t={color:r.KUI_COLOR_TEXT,fontFamily:e},i={axisLabel:{color:r.KUI_COLOR_TEXT_NEUTRAL,fontFamily:e},axisLine:{lineStyle:{color:r.KUI_COLOR_BORDER}},splitLine:{lineStyle:{color:r.KUI_COLOR_BORDER}}};return{textStyle:t,categoryAxis:i,valueAxis:i,tooltip:{backgroundColor:r.KUI_COLOR_BACKGROUND,borderWidth:0,padding:0,confine:!0,extraCssText:Ap,textStyle:{color:r.KUI_COLOR_TEXT,fontFamily:e}},visualMap:{textStyle:{color:r.KUI_COLOR_TEXT_NEUTRAL,fontFamily:e}},legend:{textStyle:{color:r.KUI_COLOR_TEXT_NEUTRAL,fontFamily:e}}}},Up=r=>n.computed(()=>Lp(r.value)),Mp={class:"kong-ui-public-echarts-tooltip"},Kp={class:"tooltip-title"},Bp={class:"title"},zp={key:0,class:"subtitle"},Pp={class:"context"},qp={class:"metric"},Hp={class:"tooltip-rows"},Gp={class:"display-value"},$p=n.defineComponent({__name:"ChartTooltip",props:{title:{},context:{},metric:{},rows:{}},setup(r){return(e,t)=>(n.openBlock(),n.createElementBlock("div",Mp,[n.createElementVNode("div",Kp,[n.createElementVNode("div",Bp,n.toDisplayString(r.title),1),r.context||r.metric?(n.openBlock(),n.createElementBlock("div",zp,[n.createElementVNode("div",Pp,n.toDisplayString(r.context),1),n.createElementVNode("div",qp,n.toDisplayString(r.metric),1)])):n.createCommentVNode("",!0)]),n.createElementVNode("ul",Hp,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.rows,(i,s)=>(n.openBlock(),n.createElementBlock("li",{key:`${i.label}-${s}`,class:n.normalizeClass({"extra-row":i.isExtra})},[n.createElementVNode("span",{class:"square-marker",style:n.normalizeStyle(i.isExtra?void 0:{background:i.color})},null,4),n.createElementVNode("span",{class:n.normalizeClass(["display-label",{empty:i.isSegmentEmpty}])},n.toDisplayString(i.label),3),n.createElementVNode("span",Gp,n.toDisplayString(i.value),1)],2))),128))])]))}}),kr=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},Fp=kr($p,[["__scopeId","data-v-ca633353"]]),Jt=r=>Array.isArray(r)?r:[r],Nr=(r,e)=>typeof r=="number"?e?.[r]??String(r):r,ei=(r,e,t,i)=>({color:typeof r.color=="string"?r.color:void 0,label:e,value:i?i(Number(t)):String(t??"")}),Wp=r=>Array.isArray(r)?r[r.length-1]:r,Vp=r=>{const e=Jt(r),t=e[0];return{context:String(t?.axisValueLabel??t?.name??""),rows:e.map(i=>ei(i,i.seriesName??"",Wp(i.value)))}},Yp=r=>{let e;return n.getCurrentScope()&&n.onScopeDispose(()=>{e&&n.render(null,e)}),t=>{const i=(r()??Vp)(t);return i?(e??=document.createElement("div"),n.render(n.h(Fp,i),e),e):""}},Xp={class:"kong-ui-public-echarts"},jp=n.defineComponent({name:"KongECharts",inheritAttrs:!1,__name:"ECharts",props:{option:{},height:{default:"400px"},tooltipContent:{type:Function}},setup(r){n.useCssVars(o=>({v1cecfeed:o.height})),St.use([Yr.CanvasRenderer,ut.GridComponent,ut.TooltipComponent]);const e=Zt(),t=Up(e),i=Yp(()=>r.tooltipContent),s=n.computed(()=>({...r.option,tooltip:{...r.option?.tooltip,formatter:i}}));return(o,a)=>(n.openBlock(),n.createElementBlock("div",Xp,[n.createVNode(n.unref(Vr),n.mergeProps({autoresize:!0,class:"chart",option:s.value,theme:n.unref(t)},o.$attrs),null,16,["option","theme"])]))}}),Ar=kr(jp,[["__scopeId","data-v-68114d20"]]),Lr=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),st=(r,...e)=>{const t={...r};for(const i of e)if(i)for(const[s,o]of Object.entries(i)){if(o===void 0)continue;const a=t[s];t[s]=Lr(a)&&Lr(o)?st(a,o):o}return t},Qp=n.defineComponent({__name:"HeatmapChart",props:{data:{},xAxisLabels:{},yAxisLabels:{},seriesName:{},min:{},max:{},colorRange:{},valueFormatter:{type:Function},visibleRows:{},showValues:{type:Boolean},seriesOption:{},option:{},height:{},tooltipTitle:{}},setup(r){St.use([li.HeatmapChart,ut.VisualMapComponent,ut.DataZoomSliderComponent]);const e=Zt(),t=a=>{const[l]=Jt(a),[u,c,d]=l.value;return{title:r.tooltipTitle,context:Nr(u,r.xAxisLabels),metric:r.seriesName,rows:[ei(l,Nr(c,r.yAxisLabels),d,r.valueFormatter)]}},i=a=>({type:"slider",yAxisIndex:0,startValue:0,endValue:a-1,zoomLock:!0,right:10,width:8,handleSize:0,moveHandleSize:0,showDetail:!1,brushSelect:!1,showDataShadow:!1,borderColor:"transparent",backgroundColor:e.value.KUI_COLOR_BACKGROUND_NEUTRAL_WEAKEST,fillerColor:e.value.KUI_COLOR_BACKGROUND_NEUTRAL_WEAK}),s=n.computed(()=>{const a=r.data??[],l=!!r.visibleRows&&r.visibleRows<(r.yAxisLabels?.length??0),u=r.valueFormatter?c=>r.valueFormatter(Number(c)):void 0;return{grid:{top:10,left:10,right:l?30:20,bottom:70,outerBoundsMode:"same",outerBoundsContain:"axisLabel"},xAxis:{type:"category",data:r.xAxisLabels??[],splitArea:{show:!1},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",data:r.yAxisLabels??[],inverse:!0,splitArea:{show:!1},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{width:160,overflow:"truncate"}},visualMap:{min:r.min??0,max:r.max??a.reduce((c,[,,d])=>Math.max(c,d),1),calculable:!0,orient:"horizontal",left:"center",bottom:0,inRange:{color:r.colorRange??[e.value.KUI_COLOR_BACKGROUND_INFO_WEAKEST,e.value.KUI_COLOR_BACKGROUND_INFO_STRONG]},formatter:u},...l?{dataZoom:[i(r.visibleRows)]}:{},series:[st({name:r.seriesName,type:"heatmap",data:a,animation:!1,label:{show:r.showValues??!1,formatter:r.valueFormatter?({value:c})=>r.valueFormatter(Number(c[2])):void 0},itemStyle:{borderColor:e.value.KUI_COLOR_BACKGROUND,borderWidth:2,borderRadius:2},emphasis:{itemStyle:{shadowBlur:5,shadowColor:e.value.KUI_COLOR_BACKGROUND_OVERLAY}}},r.seriesOption)]}}),o=n.computed(()=>st(s.value,r.option));return(a,l)=>(n.openBlock(),n.createBlock(Ar,{height:r.height,option:o.value,"tooltip-content":t},null,8,["height","option"]))}}),Zp=n.defineComponent({__name:"TreeMapChart",props:{data:{},seriesName:{},showValues:{type:Boolean},valueFormatter:{type:Function},colorPalette:{},drillDown:{type:Boolean,default:!0},leafDepth:{},seriesOption:{},option:{},height:{},tooltipTitle:{}},setup(r){St.use([li.TreemapChart]);const e=Zt(),t=l=>{const[u]=Jt(l),c=u.treePathInfo??[];if(c.length===1)return;const d=c.slice(1,-1).map(({name:h})=>h);return{title:r.tooltipTitle,context:d.length?d.join(" / "):void 0,metric:r.seriesName,rows:[ei(u,u.name,Number(u.value),r.valueFormatter)]}},i=()=>[e.value.KUI_COLOR_BACKGROUND_PRIMARY_WEAK,e.value.KUI_COLOR_BACKGROUND_SUCCESS_WEAK,e.value.KUI_COLOR_BACKGROUND_WARNING_WEAK,e.value.KUI_COLOR_BACKGROUND_DANGER_WEAK,e.value.KUI_COLOR_BACKGROUND_INFO_WEAK,e.value.KUI_COLOR_BACKGROUND_DECORATIVE_PURPLE_WEAKEST,e.value.KUI_COLOR_BACKGROUND_DECORATIVE_AQUA_WEAKEST],s=(l=[])=>l.reduce((u,c)=>Math.max(u,1+s(c.children)),0),o=n.computed(()=>({series:[st({name:r.seriesName,type:"treemap",data:r.data??[],nodeClick:r.drillDown?"zoomToNode":!1,...r.drillDown?{scaleLimit:{min:1,max:1/0},zoomToNodeRatio:.2}:{},leafDepth:r.leafDepth??s(r.data),roam:r.drillDown,left:0,top:0,right:0,bottom:r.drillDown?40:0,visibleMin:0,breadcrumb:{show:r.drillDown,itemStyle:{color:e.value.KUI_COLOR_BACKGROUND_NEUTRAL_WEAK,borderColor:"transparent",borderWidth:0,borderRadius:2,textStyle:{color:e.value.KUI_COLOR_TEXT}},emphasis:{itemStyle:{color:e.value.KUI_COLOR_BACKGROUND_NEUTRAL,textStyle:{color:e.value.KUI_COLOR_TEXT}}}},levels:[{color:r.colorPalette??i(),itemStyle:{borderColor:e.value.KUI_COLOR_BACKGROUND,borderWidth:2,gapWidth:2}},{colorAlpha:[.55,1],itemStyle:{borderColor:e.value.KUI_COLOR_BACKGROUND,borderWidth:1,gapWidth:1}}],label:{show:!0,color:e.value.KUI_COLOR_TEXT,align:"center",verticalAlign:"middle",overflow:"truncate",formatter:r.showValues?({name:l,value:u})=>`${l}
|
|
13
|
-
${r.valueFormatter?r.valueFormatter(Number(u)):String(u)}`:void 0}},r.seriesOption)]})),a=n.computed(()=>st(o.value,r.option));return(l,u)=>(n.openBlock(),n.createBlock(Ar,{height:r.height,option:a.value,"tooltip-content":t},null,8,["height","option"]))}}),Ur=r=>{if(r==null||typeof r=="string"&&r.trim()==="")return;const e=Number(r);return Number.isFinite(e)?e:void 0},Jp=(r,e,t)=>{if(!t.length)return r;const i=t.reduce((o,a)=>Math.min(o,a));if(i<=r)return i;const s=Math.ceil((i-r)/e);return i-s*e},eg=(r,e,t)=>{const i=[];for(let s=r;s<e;s+=t)i.push(s);return i},tg=(r,e,t)=>{const i=o=>ca(o,t,"yyyy-MM-dd"),s=r.length>0&&i(r[0])!==i(r[r.length-1]);return r.map(o=>Re.formatChartTicksByGranularity({tickValue:new Date(o),granularity:e,dayBoundaryCrossed:s,timezone:t}))},ig=(r,e)=>{const t=r.indexOf(e);return t===-1?r.push(e)-1:t},rg=(r,e)=>r[e]?.name??e,ng=(r,{tz:e}={})=>{if(!r?.meta||!r.data)return;const{display:t,metric_names:i,start:s,end:o,granularity_ms:a}=r.meta,l=i?.[0],u=t&&Object.keys(t).find(T=>T!=="time");if(!l||!u||!s||!o){console.error("Cannot build heatmap chart data from this explore result. Missing metric, dimension or time range.");return}const c=a||re.Granularities.daily,d=re.msToGranularity(c)??"daily",h=e||Intl.DateTimeFormat().resolvedOptions().timeZone,f=r.data,p=Jp(new Date(s).getTime(),c,f.map(({timestamp:T})=>new Date(T).getTime())),C=eg(p,new Date(o).getTime(),c),O=[],R=[];for(const{timestamp:T,event:P}of f){const b=Math.floor((new Date(T).getTime()-p)/c),E=Ur(P[l]);b<0||b>=C.length||E===void 0||R.push([b,ig(O,String(P[u])),E])}return{data:R,xAxisLabels:tg(C,d,h),yAxisLabels:O.map(T=>rg(t[u],T))}},sg={class:"wrapper","data-testid":"heatmap-chart"},og=10,ag=De(n.defineComponent({__name:"HeatmapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),o=ue.useMetricFormatter(),a=c=>{const d=ng(c,{tz:t.context.tz});if(d?.data.length)return{data:d.data,xAxisLabels:d.xAxisLabels,yAxisLabels:d.yAxisLabels,...o(c)}},l=new WeakMap,u=c=>(l.has(c)||l.set(c,a(c)),l.get(c));return(c,d)=>{const h=n.resolveComponent("KEmptyState");return n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:d[0]||(d[0]=f=>i("chart-data",f)),onQueryComplete:d[1]||(d[1]=f=>i("query-complete"))},{default:n.withCtx(({data:f})=>[n.createElementVNode("div",sg,[u(f)?(n.openBlock(),n.createBlock(n.unref(Qp),n.mergeProps({key:0,height:"100%","tooltip-title":r.chartOptions.chart_title??void 0,"visible-rows":og},u(f)),null,16,["tooltip-title"])):(n.openBlock(),n.createBlock(h,{key:1,"action-button-visible":!1,"data-testid":"no-data-in-report"},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.title")),1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.description")),1)]),_:1}))])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-3315f2cd"]]),Mr=(r,e,{otherLabel:t})=>({name:e===Re.OTHER_DIMENSION_ID&&t||(r?.[e]?.name??e)}),lg=(r,e,t,i)=>({...Mr(e,t,i),itemStyle:{color:Ts({dimension:r,dimensionValue:t})}}),Kr=(r,e,t)=>{const i=r.get(e)??t();return r.set(e,i),i},ti=(r,e)=>!e.includes("time")&&(!r||re.isMetricSupported("treemap",r)),Br=(r,e)=>{r.value=Number(r.value??0)+e},cg=(r,e,t,[i,s],o)=>{const a=new Map,l=(u,c)=>String(u[c]);for(const{event:u}of r){const c=Ur(u[e]);if(c===void 0)continue;const d=l(u,i),h=Kr(a,d,()=>({node:lg(i,t[i],d,o),children:new Map}));if(!s){Br(h.node,c);continue}const f=l(u,s),p=Kr(h.children,f,()=>Mr(t[s],f,o));Br(p,c)}return a},ug=(r,e={})=>{if(!r?.meta||!r.data)return;const{display:t,metric_names:i}=r.meta,s=i?.[0],o=t?Object.keys(t):[];if(!s||!o.length){console.error("Cannot build treemap chart data from this explore result. Missing metric or dimension.");return}if(!ti(s,o)){console.error("Cannot build treemap chart data from this explore result. Needs an additive metric and no time dimension.");return}return[...cg(r.data,s,t,o,e).values()].map(({node:l,children:u})=>u.size?{...l,children:[...u.values()]}:l)},dg={class:"wrapper","data-testid":"treemap-chart"},hg=De(n.defineComponent({__name:"TreemapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),o=ue.useMetricFormatter(),a=n.computed(()=>ti(t.query.metrics?.[0],t.query.dimensions??[])),l=d=>{const h=ug(d,{otherLabel:s.t("chartLabels.____OTHER____")});if(h?.length)return{data:h,drillDown:h.some(f=>f.children?.length),...o(d)}},u=new WeakMap,c=d=>(u.has(d)||u.set(d,l(d)),u.get(d));return(d,h)=>{const f=n.resolveComponent("KEmptyState");return n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:h[0]||(h[0]=p=>i("chart-data",p)),onQueryComplete:h[1]||(h[1]=p=>i("query-complete"))},{default:n.withCtx(({data:p})=>[n.createElementVNode("div",dg,[a.value?c(p)?(n.openBlock(),n.createBlock(n.unref(Zp),n.mergeProps({key:1,height:"100%","tooltip-title":r.chartOptions.chart_title??void 0},c(p)),null,16,["tooltip-title"])):(n.openBlock(),n.createBlock(f,{key:2,"action-button-visible":!1,"data-testid":"no-data-in-report"},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.title")),1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.description")),1)]),_:1})):(n.openBlock(),n.createBlock(f,{key:0,"action-button-visible":!1,"data-testid":"treemap-unsupported"},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.treemapUnsupported.title")),1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.treemapUnsupported.description")),1)]),_:1}))])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-d818a9ae"]]),fg=["data-testid"],mg={key:0,class:"group-tabs"},pg={key:1,class:"tile-header"},gg={class:"badge-container"},_g={class:"badge-text"},yg={class:"badge-text"},Rg={key:0,class:"metric-selector-wrapper"},Cg={key:1},Eg=["data-testid"],bg=["data-testid"],Og=["data-testid"],wg={class:"delete-option"},Tg=["data-testid"],zr=De(n.defineComponent({__name:"DashboardTile",props:n.mergeModels({context:{},definition:{},fitToContent:{type:Boolean,default:!1},groupTiles:{},height:{default:()=>it},hideActions:{type:Boolean,default:!1},isFullscreen:{type:Boolean},preview:{type:Boolean,default:!1},queryReady:{type:Boolean},showRefresh:{type:Boolean,default:!1},tileId:{},tileType:{default:"chart"}},{refreshCounter:{default:0},refreshCounterModifiers:{}}),emits:n.mergeModels(["chart-data","tile-loaded","edit-tile","duplicate-tile","remove-tile","tile-time-range-zoom","tile-bounds-change"],["update:refreshCounter"]),setup(r,{expose:e,emit:t}){n.useCssVars(H=>({v7f33ad9a:`${H.height}px`}));const i=parseInt(Pi,10),s=n.ref(!1),o=n.ref(),a=n.computed(()=>r.groupTiles?.find(H=>H.id===o.value)?.id??r.groupTiles?.[0]?.id),l=n.computed(()=>a.value??r.tileId.toString()),u=n.computed(()=>r.groupTiles?.find(H=>H.id===o.value)?.definition??r.groupTiles?.[0]?.definition??r.definition),c=ue.useFieldLabel(),{zoomConfiguration:d}=ue.useDashboardContext({context:n.computed(()=>r.context),preview:n.computed(()=>r.preview)}),h=n.useModel(r,"refreshCounter"),f=()=>{m.value=!0,h.value++},p=t,C=n.defineAsyncComponent(()=>Promise.resolve().then(()=>Xg)),O=n.inject(Ie),R=Se.useDatasourceConfigStore(),{datasourceConfigMap:T,stripUnknownFilters:P}=Xe(R),{i18n:b}=ue.useI18n(),E=n.ref(),k=n.ref({status:"loading"}),x=n.ref(!1),K=n.ref(),g=n.ref(!1),m=n.ref(!0),_=n.computed(()=>u.value.chart),U=n.computed(()=>_.value.type==="single_value"),A=n.computed(()=>("chart_title"in _.value?_.value.chart_title:void 0)||(U.value?fe.value:void 0)),F=n.computed(()=>u.value.header_description),v=n.computed(()=>_.value.type==="slottable"),q=n.computed(()=>Ne(u.value)||_t(u.value)?!1:!("allow_csv_export"in _.value)||_.value.allow_csv_export!==!1),{exploreLinkKebabMenu:V,requestsLinkKebabMenu:W,canShowKebabMenu:w,canGenerateRequestsLink:S,canGenerateExploreLink:G,requestsLinkZoomActions:M,exploreLinkZoomActions:D,buildExploreQuery:N,buildExploreLink:oe,buildRequestLink:ae,buildRequestsQueryZoomActions:de}=ue.useContextLinks({queryBridge:O,chartData:n.readonly(E),definition:u,context:n.readonly(n.toRef(()=>r.context))}),{issueQuery:ge}=ue.useIssueQuery();n.watch(u,async(H,te)=>{await n.nextTick(),K.value&&(g.value=K.value.scrollWidth>K.value.clientWidth);try{JSON.stringify(H?.query)!==JSON.stringify(te?.query)&&(m.value=!0)}catch{}},{immediate:!0,deep:!0});const ie=n.computed(()=>b.t("csvExport.defaultFilename")),I=n.computed(()=>!!V.value||q.value||!!r.context.editable),B=n.computed(()=>!r.hideActions&&w.value&&I.value),z=n.computed(()=>B.value&&I.value&&!r.isFullscreen),Y={heatmap:ag,treemap:hg,timeseries_line:dr,timeseries_bar:dr,scatter:_l,horizontal_bar:ur,vertical_bar:ur,gauge:cr,donut:fc,golden_signals:yl,top_n:ac,top_talkers:lc,table:hc,slottable:void 0,single_value:cr,choropleth_map:C},J=n.computed(()=>({...L.value?.rendererEvents.supportsRequests?{"select-chart-range":i_}:{},...L.value?.rendererEvents.supportsZoom?{"zoom-time-range":e_}:{},...L.value?.rendererEvents.supportsBounds?{"bounds-change":t_}:{},...L.value?.rendererEvents.supportsLoadingChange?{"loading-change":Qg}:{}})),L=n.computed(()=>{const H=Y[u.value.chart.type],te=Ne(u.value),pe=!!H?.emits?.includes("select-chart-range"),Ge=!!H?.emits?.includes("zoom-time-range"),Ue=u.value.chart.type==="choropleth_map",$e=!!H?.emits?.includes("loading-change"),ni={query:u.value.query,context:r.context,queryReady:r.queryReady,height:r.height-i*2,refreshCounter:h.value,zoomConfiguration:d.value},Fe={chartOptions:u.value.chart,activeMetric:_e.value,headerDescription:F.value,requestsLink:d.value.showRequestsAction?M.value:void 0,exploreLink:d.value.showExploreAction?D.value:void 0};return H&&{component:H,rendererProps:{...ni,...te?{}:Fe,...["top_n","single_value"].includes(u.value.chart.type)?{fitToContent:r.fitToContent}:{}},rendererEvents:{supportsRequests:pe,supportsZoom:Ge,supportsBounds:Ue,supportsLoadingChange:$e}}}),$=n.computed(()=>{if(Ne(u.value))return null;const H=u.value.query,te=H?.time_range;if(re.isPlatformDatasource(H?.datasource)&&!H.dimensions?.includes("time"))return b.t("renderer.as_of_today");if(te?.type==="relative"){const pe=re.TimePeriods.get(re.TIMEFRAME_LOOKUP[te.time_range]);return pe?pe.display:(console.warn("Did not recognize the given relative time range:",te.time_range),te.time_range)}else if(te?.type==="absolute"){const pe=te.tz||"Etc/UTC";return`${re.formatTime(te.start,{short:!0,tz:pe})} - ${re.formatTime(te.end,{short:!0,tz:pe})}`}return null}),j=n.computed(()=>{const H=u.value.query,te=H?.datasource,pe=te?T.value[te]?.timeRangeOptions:void 0,Ue=(H&&"time_range"in H?H.time_range:void 0)??r.context.timeSpec;return Ft(Ue,pe)}),ce=n.computed(()=>v.value?!1:[!!A.value,z.value,!!$.value,j.value,!!F.value,r.showRefresh,ze.value].some(Boolean)),Z=n.computed(()=>E.value?re.msToGranularity(E.value.meta.granularity_ms):void 0),ne=n.computed(()=>["timeseries_line","timeseries_bar"].includes(_.value.type)),me=n.computed(()=>E.value?.meta.metric_names??[]),_e=n.ref();n.watch(me,H=>{(!_e.value||!H.includes(_e.value))&&(_e.value=H[0])},{immediate:!0}),n.watch(l,()=>{E.value=void 0,_e.value=void 0,m.value=!0});const Oe=n.computed(()=>{const H=_.value;return H.type!=="timeseries_line"?!1:me.value.some(te=>H.metric_axis_map?.[te]==="right")}),ze=n.computed(()=>ne.value&&!Oe.value&&(E.value?.data.length??0)>0&&me.value.length>1&&Object.keys(E.value?.meta.display??{}).length>0),fe=n.computed(()=>{const te=("metrics"in u.value.query?u.value.query.metrics?.[0]:void 0)??me.value[0];if(te)return c(te)}),we=n.computed(()=>(r.groupTiles??[]).map(({id:H,label:te})=>({hash:`#${H}`,title:te}))),he=n.computed({get:()=>`#${a.value}`,set:H=>{o.value=H.slice(1)}}),ye=n.computed(()=>me.value.map(H=>({value:H,label:c(H)}))),Te=n.computed(()=>{if(!Gt(u.value)||!ne.value||!r.queryReady||m.value)return!1;const H=u.value.query.granularity;return!H||!Z.value?!1:H!==Z.value}),lt=n.computed(()=>{const H=re.msToGranularity(E.value?.meta.granularity_ms??0)??"unknown",te=Gt(u.value)?u.value.query.granularity??"unknown":"unknown";return b.t("query_aged_out_warning",{currentGranularity:b.t(`granularities.${H}`),savedGranularity:b.t(`granularities.${te}`)})}),Tt=n.computed(()=>{const H=[...r.context.filters,...u.value.query.filters??[]],te="metrics"in u.value.query?u.value.query.metrics:void 0,pe=u.value.query.datasource??"api_usage";return P.value({datasource:pe,filters:H,queryFields:te})}),Pe=()=>{p("edit-tile",u.value,l.value)},ve=()=>{p("duplicate-tile",u.value,l.value)},He=()=>{p("remove-tile",u.value,l.value)},vt=H=>{E.value=H,m.value=!1,p("chart-data",H),p("tile-loaded")},jg=()=>{m.value=!1,p("tile-loaded")},Qg=H=>{m.value=H,H||p("tile-loaded")},Zg=()=>{x.value=!1},$r=()=>{if(_t(u.value))throw new Error("Cannot export data for a tile backed by the api-requests endpoint");const H=u.value.query.datasource?.startsWith("goap");return O?.staticConfig?.increaseCsvExportLimit!==!1&&!H?ge(u.value.query,r.context,re.EXPORT_RECORD_LIMIT):E.value?Promise.resolve(E.value):new Promise(pe=>{const Ge=n.watch(E,Ue=>{Ue&&(pe(Ue),Ge())})})},Jg=async()=>{x.value=!0,k.value={status:"loading"};try{const H=await $r();k.value={status:"success",chartData:H}}catch(H){k.value={status:"error",error:H}}},e_=H=>{const te={tileId:l.value,timeRange:H};p("tile-time-range-zoom",te)},t_=H=>{const te={tileId:l.value,bounds:H};p("tile-bounds-change",te)},i_=H=>{const te=Tt.value,pe=N(H,te);D.value=G.value?{href:oe(pe)}:void 0,M.value=S.value?{href:ae(de(H,te))}:void 0};return e({getExportData:$r}),(H,te)=>{const pe=n.resolveComponent("KTooltip"),Ge=n.resolveComponent("KBadge"),Ue=n.resolveComponent("KButton"),$e=n.resolveComponent("KDropdownItem"),ni=n.resolveComponent("KDropdown");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["tile-boundary",{editable:r.context.editable,"fit-to-content":r.fitToContent,headless:!ce.value,"compact-single_value":U.value&&r.fitToContent}]),"data-testid":`tile-${r.tileId}`},[r.groupTiles&&r.groupTiles.length>1?(n.openBlock(),n.createElementBlock("div",mg,[n.createVNode(n.unref(ai.KTabs),n.mergeProps({modelValue:he.value,"onUpdate:modelValue":te[0]||(te[0]=Fe=>he.value=Fe)},{hidePanels:!0},{"data-testid":"tile-group-tabs",tabs:we.value}),null,16,["modelValue","tabs"])])):n.createCommentVNode("",!0),ce.value&&!v.value?(n.openBlock(),n.createElementBlock("div",pg,[n.createVNode(pe,{class:"title-tooltip",disabled:!g.value,"max-width":"500",text:A.value},{default:n.withCtx(()=>[n.createElementVNode("div",{ref_key:"titleRef",ref:K,class:"title"},n.toDisplayString(A.value),513)]),_:1},8,["disabled","text"]),n.createElementVNode("div",gg,[j.value?(n.openBlock(),n.createBlock(Ge,{key:0,appearance:"warning","data-testid":"unsupported-time-range-badge",tooltip:n.unref(b).t("unsupported_time_range_warning"),"tooltip-attributes":{maxWidth:"320px"}},{icon:n.withCtx(()=>[n.createVNode(n.unref(se.WarningIcon),{size:`var(--kui-icon-size-20, ${n.unref(Bi)})`},null,8,["size"])]),default:n.withCtx(()=>[n.createElementVNode("span",_g,n.toDisplayString(n.unref(b).t("unsupported_time_range_badge")),1)]),_:1},8,["tooltip"])):n.createCommentVNode("",!0),$.value?(n.openBlock(),n.createBlock(Ge,{key:1,"data-testid":"time-range-badge",tooltip:Te.value?lt.value:void 0,"tooltip-attributes":{maxWidth:"320px"}},n.createSlots({default:n.withCtx(()=>[n.createElementVNode("span",yg,n.toDisplayString($.value),1)]),_:2},[Te.value?{name:"icon",fn:n.withCtx(()=>[n.createVNode(n.unref(se.WarningIcon),{size:`var(--kui-icon-size-20, ${n.unref(Bi)})`},null,8,["size"])]),key:"0"}:void 0]),1032,["tooltip"])):n.createCommentVNode("",!0)]),ze.value?(n.openBlock(),n.createElementBlock("div",Rg,[n.createVNode(n.unref(ai.KSegmentedControl),{modelValue:_e.value,"onUpdate:modelValue":te[1]||(te[1]=Fe=>_e.value=Fe),class:"metric-selector","data-testid":"metric-selector",options:ye.value},null,8,["modelValue","options"])])):n.createCommentVNode("",!0),r.showRefresh?(n.openBlock(),n.createElementBlock("div",Cg,[n.createVNode(Ue,{appearance:"secondary",class:"refresh-button","data-testid":`tile-refresh-button-${r.tileId}`,disabled:m.value,icon:"",size:"small",onClick:f},{default:n.withCtx(()=>[m.value?(n.openBlock(),n.createBlock(n.unref(se.ProgressIcon),{key:0,role:"button",size:`var(--kui-icon-size-60, ${n.unref(zi)})`,tabindex:"0"},null,8,["size"])):(n.openBlock(),n.createBlock(n.unref(se.RefreshIcon),{key:1,role:"button",size:`var(--kui-icon-size-60, ${n.unref(zi)})`,tabindex:"0"},null,8,["size"]))]),_:1},8,["data-testid","disabled"])])):n.createCommentVNode("",!0),F.value?(n.openBlock(),n.createElementBlock("div",{key:2,class:"header-description","data-testid":`tile-description-${r.tileId}`},n.toDisplayString(F.value),9,Eg)):n.createCommentVNode("",!0),B.value?(n.openBlock(),n.createElementBlock("div",{key:3,class:"tile-actions","data-testid":`tile-actions-${r.tileId}`},[B.value&&r.context.editable&&!r.isFullscreen?(n.openBlock(),n.createBlock(Ue,{key:0,appearance:"tertiary","aria-label":n.unref(b).t("renderer.edit"),class:"edit-icon","data-testid":`edit-tile-${r.tileId}`,icon:"",size:"small",onClick:Pe},{default:n.withCtx(()=>[n.createVNode(n.unref(se.EditIcon),{decorative:""})]),_:1},8,["aria-label","data-testid"])):n.createCommentVNode("",!0),B.value&&I.value&&!r.isFullscreen?(n.openBlock(),n.createBlock(ni,{key:1,class:"dropdown","data-testid":`chart-action-menu-${r.tileId}`,"kpop-attributes":{placement:"bottom-end"},onToggleDropdown:te[2]||(te[2]=Fe=>s.value=Fe)},{items:n.withCtx(()=>[n.unref(V)?(n.openBlock(),n.createBlock($e,{key:0,"data-testid":`chart-jump-to-explore-${r.tileId}`,item:{label:n.unref(b).t("jumpToExplore"),to:n.unref(V)}},null,8,["data-testid","item"])):n.createCommentVNode("",!0),!n.unref(Ne)(u.value)&&n.unref(W)?(n.openBlock(),n.createBlock($e,{key:1,"data-testid":`chart-jump-to-requests-${r.tileId}`,item:{label:n.unref(b).t("jumpToRequests"),to:n.unref(W)}},null,8,["data-testid","item"])):n.createCommentVNode("",!0),q.value?(n.openBlock(),n.createBlock($e,{key:2,class:"chart-export-button","data-testid":`chart-csv-export-${r.tileId}`,onClick:Jg},{default:n.withCtx(()=>[n.createElementVNode("span",{class:"chart-export-trigger","data-testid":`csv-export-button-${r.tileId}`},n.toDisplayString(n.unref(b).t("csvExport.exportAsCsv")),9,Og)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0),r.context.editable?(n.openBlock(),n.createBlock($e,{key:3,"data-testid":`duplicate-tile-${r.tileId}`,onClick:ve},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(b).t("renderer.duplicateTile")),1)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0),r.context.editable?(n.openBlock(),n.createBlock($e,{key:4,"data-testid":`remove-tile-${r.tileId}`,onClick:He},{default:n.withCtx(()=>[n.createElementVNode("span",wg,n.toDisplayString(n.unref(b).t("renderer.delete")),1)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(Ue,{appearance:"tertiary","aria-expanded":s.value,"aria-haspopup":"true","aria-label":n.unref(b).t("renderer.tileActions"),class:n.normalizeClass(["kebab-action-menu",{"is-open":s.value}]),"data-testid":`kebab-action-menu-${r.tileId}`,icon:"",size:"small"},{default:n.withCtx(()=>[n.createVNode(n.unref(se.MoreIcon),{decorative:""})]),_:1},8,["aria-expanded","aria-label","class","data-testid"])]),_:1},8,["data-testid"])):n.createCommentVNode("",!0)],8,bg)):n.createCommentVNode("",!0),x.value?(n.openBlock(),n.createBlock(or,{key:4,"data-testid":`csv-export-modal-${r.tileId}`,"export-state":k.value,filename:ie.value,onCloseModal:Zg},null,8,["data-testid","export-state","filename"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["tile-content",`type-${r.tileType}-${_.value.type}`]),"data-testid":`tile-content-${r.tileId}`},[L.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(L.value.component),n.mergeProps({key:l.value},L.value.rendererProps,n.toHandlers(J.value),{onChartData:vt,onQueryComplete:jg}),null,16)):n.createCommentVNode("",!0)],10,Tg)],10,fg)}}}),[["__scopeId","data-v-aaf55d0b"]]);function vg(r,e,t,i,s){const o=(...a)=>(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(r,a));return o.prototype=e.prototype,o}class y{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const o=i.getElementById(e);return o?[o]:[]}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 lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,t){const i=document.createElement("div");return e.forEach(s=>{s&&i.classList.add(s)}),t?.appendChild(i),i}static shouldSizeToContent(e,t=!1){return 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 y.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){const 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;const o=e.y>t.y?e.y:t.y,a=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return a<=o?0:(s-i)*(a-o)}static area(e){return e.w*e.h}static sort(e,t=1){return e.sort((s,o)=>{const a=t*((s.y??1e4)-(o.y??1e4));return a===0?t*((s.x??1e4)-(o.x??1e4)):a})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){const s=document.createElement("style"),o=i?.nonce;return o&&(s.nonce=o),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}static removeStylesheet(e,t){const s=(t||document).querySelector("STYLE[gs-style-id="+e+"]");s&&s.parentNode&&s.remove()}static addCSSRule(e,t,i){e.textContent+=`${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{const 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){const s=e[i],o=t[i];i[0]==="_"||s===o?delete e[i]:s&&typeof s=="object"&&o!==void 0&&(y.removeInternalAndSame(s,o),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){const 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){const s=e.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>o){const a=s.bottom-o,l=s.top,u=this.getScrollElement(e);if(u!==null){const c=u.scrollTop;s.top<0&&i<0?e.offsetHeight>o?u.scrollTop+=i:u.scrollTop+=Math.abs(l)>Math.abs(i)?i:l:i>0&&(e.offsetHeight>o?u.scrollTop+=i:u.scrollTop+=a>i?i:a),t.top+=u.scrollTop-c}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t),o=s.clientHeight,a=s===this.getScrollElement()?0:s.getBoundingClientRect().top,l=e.clientY-a,u=l<i,c=l>o-i;u?s.scrollBy({behavior:"smooth",top:l-i}):c&&s.scrollBy({behavior:"smooth",top:i-(o-l)})}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=y.clone(e);for(const s in i)i.hasOwnProperty(s)&&typeof i[s]=="object"&&s.substring(0,2)!=="__"&&!t.find(o=>o===s)&&(i[s]=y.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=y.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["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>i[o]=e[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>i[o]=e[o]),{...i,...s}}static simulateMouseEvent(e,t,i){const s=e,o=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:s.ctrlKey??!1,altKey:s.altKey??!1,shiftKey:s.shiftKey??!1,metaKey:s.metaKey??!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(o)}static getValuesFromTransformedElement(e){const t=document.createElement("div");y.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}}static swap(e,t,i){if(!e)return;const s=e[t];e[t]=e[i],e[i]=s}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class Ae{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),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 o=t;!this._loading&&this._useEntireRowArea(e,t)&&(o={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,o,s.skip));let a=!1;const l={nested:!0,pack:!1};let u=0;for(;i=i||this.collide(e,o,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||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;const d={...t,y:i.y+i.h,...l};c=this._loading&&y.samePos(e,d)?!0:this.moveNode(e,d),(i.locked||this._loading)&&c?y.copyPos(t,e):!i.locked&&c&&s.pack&&(this._packNodes(),t.y=i.y+i.h,y.copyPos(e,t)),a=a||c}else c=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...l});if(!c)return a;i=void 0}return a}collide(e,t=e,i){const s=e._id,o=i?._id;return this.nodes.find(a=>a._id!==s&&a._id!==o&&y.isIntercepted(a,t))}collideAll(e,t=e,i){const s=e._id,o=i?._id;return this.nodes.filter(a=>a._id!==s&&a._id!==o&&y.isIntercepted(a,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;const s=e._rect,o={...t.rect};o.y>s.y?(o.h+=o.y-s.y,o.y=s.y):o.h+=s.y-o.y,o.x>s.x?(o.w+=o.x-s.x,o.x=s.x):o.w+=s.x-o.x;let a,l=.5;for(let u of i){if(u.locked||!u._rect)break;const c=u._rect;let d=Number.MAX_VALUE,h=Number.MAX_VALUE;s.y<c.y?d=(o.y+o.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(d=(c.y+c.h-o.y)/c.h),s.x<c.x?h=(o.x+o.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(h=(c.x+c.w-o.x)/c.w);const f=Math.min(h,d);f>l&&(l=f,a=u)}return t.collide=a,a}cacheRects(e,t,i,s,o,a){return this.nodes.forEach(l=>l._rect={y:l.y*t+i,x:l.x*e+a,w:l.w*e-a-s,h:l.h*t-i-o}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){const o=t.x,a=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=o,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=a):(e.x=o,e.y=a),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=y.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=y.isTouching(e,t)))){if(t.y<e.y){const o=e;e=t,t=o}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=y.isTouching(e,t)))){if(t.x<e.x){const o=e;e=t,t=o}return i()}return!1}}}isAreaEmpty(e,t,i,s){const o={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(o)}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);const o=this.nodes;return this.nodes=[],o.forEach((a,l,u)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=u[l-1])),this.addNode(a,!1,c)}),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=y.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;){const 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??Ae._idSeq++;const i=e.id;if(i){let o=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+o++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const s={x:0,y:0,w:1,h:1};return y.defaults(e,s),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,y.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=s.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=s.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=s.w),isNaN(e.h)&&(e.h=s.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){const i=e._orig||y.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id&&this.findCacheLayout(e,this.defaultColumn)===-1){const o={...e};o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}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),y.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!y.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const 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=y.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||y.samePos(e,e._orig)||(y.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){const o=s?s.y*i+(s.x+s.w):0;let a=!1;for(let l=o;!a;++l){const u=l%i,c=Math.floor(l/i);if(u+e.w>i)continue;const d={x:u,y:c,w:e.w,h:e.h};t.find(h=>y.isIntercepted(d,h))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,t=!1,i){const s=this.nodes.find(a=>a._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let o;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,o=!0),this.nodes.push(e),t&&this.addedNodes.push(e),o||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;const s=new Ae({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(i={...a},i):{...a})});if(!i)return!1;const o=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!t.resizing&&t.collide){const a=t.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return o?(s.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(u=>u._id===a._id);l&&(y.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const t=new Ae({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=y.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){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);const s=e.w!==t.w||e.h!==t.h,o=y.copyPos({},e,!0);if(y.copyPos(o,t),this.nodeBoundFix(o,s),y.copyPos(t,o),!t.forceCollide&&y.samePos(e,t))return!1;const a=y.copyPos({},e),l=this.collideAll(e,o,t.skip);let u=!0;if(l.length){const c=e._moving&&!t.nested;let d=c?this.directionCollideCoverage(e,t,l):l[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const h=y.areaIntercept(t.rect,d._rect),f=y.area(t.rect),p=y.area(d._rect);h/(f<p?f:p)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,o,d,t):(u=!1,i&&delete t.pack)}return u&&!y.samePos(e,o)&&(e._dirty=!0,y.copyPos(e,o)),t.pack&&this._packNodes()._notify(),!y.samePos(e,a)}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(){const e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){const i=this._layouts?.length,s=i&&this.column!==i-1?this._layouts[i-1]:null,o=[];return this.sortNodes(),this.nodes.forEach(a=>{const l=s?.find(c=>c._id===a._id),u={...a,...l||{}};y.removeInternalForSave(u,!e),t&&t(a,u),o.push(u)}),o}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{const s=i/this.column;e.forEach(o=>{if(!o._orig)return;const a=t.find(l=>l._id===o._id);a&&(a.y>=0&&o.y!==o._orig.y&&(a.y+=o.y-o._orig.y),o.x!==o._orig.x&&(a.x=Math.round(o.x*s)),o.w!==o._orig.w&&(a.w=Math.round(o.w*s)))})}}),this)}columnChanged(e,t,i="moveScale"){if(!this.nodes.length||!t||e===t)return this;const s=i==="compact"||i==="list";s&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let o=[],a=s?this.nodes:y.sort(this.nodes,-1);if(t>e&&this._layouts){const l=this._layouts[t]||[],u=this._layouts.length-1;!l.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(c=>{const d=a.find(h=>h._id===c._id);d&&(!s&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{const d=a.findIndex(h=>h._id===c._id);if(d!==-1){const h=a[d];if(s){h.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(h.x=c.x??h.x,h.y=c.y??h.y,h.w=c.w??h.w,o.push(h)),a.splice(d,1)}})}if(s)this.compact(i,!1);else{if(a.length)if(typeof i=="function")i(t,e,o,a);else{const l=s||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";a.forEach(d=>{d.x=t===1?0:u?Math.round(d.x*l):Math.min(d.x,t-1),d.w=t===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,t),o.push(d)}),a=[]}o=y.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.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){const s=[];return e.forEach((o,a)=>{if(o._id===void 0){const l=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=l?._id??Ae._idSeq++}s[a]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??Ae._idSeq++;const 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]||[];const s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){return this._layouts?.[t]?.findIndex(i=>i._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){const i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(const t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}Ae._idSeq=0;const be={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"};class Q{}const ke=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 Le{}function Rt(r,e){r.touches.length>1||(r.cancelable&&r.preventDefault(),y.simulateMouseEvent(r.changedTouches[0],e))}function Pr(r,e){r.cancelable&&r.preventDefault(),y.simulateMouseEvent(r,e)}function Ct(r){Le.touchHandled||(Le.touchHandled=!0,Rt(r,"mousedown"))}function Et(r){Le.touchHandled&&Rt(r,"mousemove")}function bt(r){if(!Le.touchHandled)return;Le.pointerLeaveTimeout&&(window.clearTimeout(Le.pointerLeaveTimeout),delete Le.pointerLeaveTimeout);const e=!!Q.dragElement;Rt(r,"mouseup"),e||Rt(r,"click"),Le.touchHandled=!1}function Ot(r){r.pointerType!=="mouse"&&r.target.releasePointerCapture(r.pointerId)}function qr(r){Q.dragElement&&r.pointerType!=="mouse"&&Pr(r,"mouseenter")}function Hr(r){Q.dragElement&&r.pointerType!=="mouse"&&(Le.pointerLeaveTimeout=window.setTimeout(()=>{delete Le.pointerLeaveTimeout,Pr(r,"mouseleave")},10))}class wt{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._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${wt.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),ke&&(this.el.addEventListener("touchstart",Ct),this.el.addEventListener("pointerdown",Ot)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),ke&&(this.el.removeEventListener("touchstart",Ct),this.el.removeEventListener("pointerdown",Ot)),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),ke&&(this.el.addEventListener("touchmove",Et),this.el.addEventListener("touchend",bt)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const 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),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ke&&(this.el.removeEventListener("touchmove",Et),this.el.removeEventListener("touchend",bt)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}wt.prefix="ui-resizable-";class ii{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 ot extends ii{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||o;return{position:{left:(a.left-s.left)*this.rectScale.x,top:(a.top-s.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.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){const 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),Q.overResizeElement===this&&delete Q.overResizeElement),this}_mouseOver(e){Q.overResizeElement||Q.dragElement||(Q.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){Q.overResizeElement===this&&(delete Q.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new wt(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=y.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=y.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=y.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=y.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=y.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=ot._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=y.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 ot._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},o=e.clientX-i.clientX,a=this.sizeToContent?0:e.clientY-i.clientY;let l,u;t.indexOf("e")>-1?s.width+=o:t.indexOf("w")>-1&&(s.width-=o,s.left+=o,l=!0),t.indexOf("s")>-1?s.height+=a:t.indexOf("n")>-1&&(s.height-=a,s.top+=a,u=!0);const c=this._constrainSize(s.width,s.height,l,u);return Math.round(s.width)!==Math.round(c.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(e,t,i,s){const o=this.option,a=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,l=o.minWidth/this.rectScale.x||e,u=(s?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||t,d=Math.min(a,Math.max(l,e)),h=Math.min(u,Math.max(c,t));return{width:d,height:h}}_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}}ot._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Sg='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class at extends ii{constructor(e,t={}){super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const i=t?.handle?.substring(1),s=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:s?.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),ke&&(e.addEventListener("touchstart",Ct),e.addEventListener("pointerdown",Ot))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),ke&&(t.removeEventListener("touchstart",Ct),t.removeEventListener("pointerdown",Ot))}),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(!Q.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(Sg)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete Q.dragElement,delete Q.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),ke&&(e.currentTarget.addEventListener("touchmove",Et),e.currentTarget.addEventListener("touchend",bt)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),Q.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=y.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){const t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),Q.pauseDrag){const i=Number.isInteger(Q.pauseDrag)?Q.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),i)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,Q.dragElement=this;const i=this.el.gridstackNode?.grid;i?Q.dropElement=i.el.ddElement.ddDroppable:delete Q.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=y.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const s=y.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(s,this.ui()),this.triggerEvent("dragstart",s),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ke&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Et,!0),e.currentTarget.removeEventListener("touchend",bt,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),Q.dropElement?.el===this.el.parentElement&&delete Q.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const t=y.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),Q.dropElement&&Q.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete Q.dragElement,delete Q.dropElement,delete Q.mouseHandled,e.preventDefault()}_keyEvent(e){const t=this.el.gridstackNode,i=t?.grid||Q.dropElement?.el?.gridstack;if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!y.canBeRotated(t))return;t._origRotate=t._origRotate||{...t._orig},delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",y.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=y.cloneNode(this.el)),e.parentElement||y.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=at.originStyleProp.map(t=>this.el.style[t]),e}_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(){if(this.helper.classList.remove("ui-draggable-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const t=this.helper,i=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",at.originStyleProp.forEach(s=>t.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>t.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const t={left:0,top:0},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,o=0;i&&(s=this.dragTransform.xOffset,o=this.dragTransform.yOffset);const a=t.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-s,offsetTop:-e.clientY+a.top-o,width:a.width*this.dragTransform.xScale,height:a.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}}}}at.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class xg extends ii{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),ke&&(this.el.addEventListener("pointerenter",qr),this.el.addEventListener("pointerleave",Hr)))}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),ke&&(this.el.removeEventListener("pointerenter",qr),this.el.removeEventListener("pointerleave",Hr)))}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(!Q.dragElement||!this._canDrop(Q.dragElement.el))return;e.preventDefault(),e.stopPropagation(),Q.dropElement&&Q.dropElement!==this&&Q.dropElement._mouseLeave(e,!0),Q.dropElement=this;const t=y.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(Q.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){if(!Q.dragElement||Q.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const i=y.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(Q.dragElement)),this.triggerEvent("dropout",i),Q.dropElement===this&&(delete Q.dropElement,!t)){let s,o=this.el.parentElement;for(;!s&&o;)s=o.ddElement?.ddDroppable,o=o.parentElement;s&&s._mouseEnter(e)}}drop(e){e.preventDefault();const t=y.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(Q.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 ri{static init(e){return e.ddElement||(e.ddElement=new ri(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 at(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 ot(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 xg(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Ig{resizable(e,t,i,s){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddResizable&&o.ddResizable[t]();else if(t==="destroy")o.ddResizable&&o.cleanResizable();else if(t==="option")o.setupResizable({[i]:s});else{const l=o.el.gridstackNode.grid;let u=o.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const c=!l.opts.alwaysShowResizeHandle;o.setupResizable({...l.opts.resizable,handles:u,autoHide:c,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,s){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddDraggable&&o.ddDraggable[t]();else if(t==="destroy")o.ddDraggable&&o.cleanDraggable();else if(t==="option")o.setupDraggable({[i]:s});else{const a=o.el.gridstackNode.grid;o.setupDraggable({...a.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=o=>t._accept(o)),this._getDDElements(e,t).forEach(o=>{t==="disable"||t==="enable"?o.ddDroppable&&o.ddDroppable[t]():t==="destroy"?o.ddDroppable&&o.cleanDroppable():t==="option"?o.setupDroppable({[i]:s}):o.setupDroppable(t)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(s=>s.on(t,o=>{i(o,Q.dragElement?Q.dragElement.el:o.target,Q.dragElement?Q.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){const i=e.gridstack||t!=="destroy"&&t!=="disable",s=y.getElements(e);return s.length?s.map(a=>a.ddElement||(i?ri.init(a):null)).filter(a=>a):[]}}const Ee=new Ig;class X{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;const i=X.getGridElement(t);return i?(i.gridstack||(i.gridstack=new X(i,y.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
11
|
+
`+d),i.encoding==="utf-8"&&(d="\uFEFF"+d),t("export-finished",i.filename),!i.testing){const h=new Blob([d],{type:"text/csv;charset="+i.encoding});_a.saveAs(h,i.filename)}};return(d,h)=>(n.openBlock(),n.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[n.renderSlot(d.$slots,"default",{},()=>[n.createTextVNode("Download "+n.toDisplayString(r.filename),1)])],8,Ea))}}),Oa=n.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(r){const e=r,t=n.computed(()=>Object.keys(e.headers));return(i,s)=>(n.openBlock(),n.createElementBlock("div",null,[n.createVNode(ba,{data:r.rows,fields:t.value,filename:r.filename,labels:r.headers},{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),wa={renderer:{not_configured:{title:"Chart is not fully configured",description:"Begin by choosing at least one metric"},noQueryBridge:"No query bridge provided. Unable to render dashboard.",unexpectedError:"An unexpected error has occurred.",trendRange:{"24h":"Last 24-hour summary","7d":"Last 7-day summary","30d":"Last 30-day summary"},edit:"Edit",tileActions:"Tile actions",duplicateTile:"Duplicate",exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",remove:"Remove",delete:"Delete",as_of_today:"As of today",noDataAvailable:{title:"No data in the current time frame",description:"Once there is traffic, it will display here"},treemapUnsupported:{title:"This query can't be shown as a treemap",description:"Treemaps need a count or total metric, such as requests or tokens, and no time dimension"}},pdfExport:{branding:"Kong Konnect",generated:"Generated {timestamp}",dashboardNote:"For a live, interactive experience, open this dashboard in Konnect",pageOf:"{page} / {total}"},csvExport:{defaultFilename:"Chart export",exportAsCsv:"Export as CSV",dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportTimeRange:"Time range",exportAsOf:"As of {time}",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},chartLabels:{control_plane:"Control plane",data_plane_node_version:"Data plane node version",env:"Environment",gateway_service:"Gateway service",hostname:"Hostname",plugin:"Plugin",plugin_name:"Plugin name",plugin_scope:"Plugin scope",region:"Region",request_count:"Request count",route:"Route",status_code:"Status code",team:"Team",name:"Name",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_gateway_version:"AI gateway version",ai_count:"LLM request count",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",error_rate:"Error rate",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",upstream_latency_p99:"Upstream latency (p99)",upstream_latency_p95:"Upstream latency (p95)",upstream_latency_p50:"Upstream latency (p50)",response_size_p99:"Response size (p99)",response_size_p95:"Response size (p95)",response_size_p50:"Response size (p50)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",total_tokens_per_minute:"Total tokens per minute",control_plane_group:"Control plane group",consumer:"Consumer",consumer_group:"Consumer group",country_code:"Country",country:"Country",data_plane_node:"Data plane node",api_package:"API package",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",application:"Application",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",time:"Time",Service:"Service",ServiceVersion:"Service version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime group",GatewayService:"Gateway service",StatusCode:"Status code",CodeClass:"Status code (grouped)",Time:"Time",API_PRODUCT:"Api product",API_PRODUCT_VERSION:"API product version",RUNTIME_GROUP:"Runtime group",GATEWAY_SERVICE:"Gateway service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status code",STATUS_CODE_GROUPED:"Status code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request count",RequestsPerMinute:"Requests per minute",LatencyP99:"Response latency (p99)",LatencyP95:"Response latency (p95)",LatencyP50:"Response latency (p50)",LatencyAverage:"Response latency (avg)",UpstreamLatencyP99:"Upstream latency (p99)",UpstreamLatencyP95:"Upstream latency (p95)",UpstreamLatencyP50:"Upstream latency (p50)",UpstreamLatencyAverage:"Upstream latency (avg)",KongLatencyP99:"Kong latency (p99)",KongLatencyP95:"Kong latency (p95)",KongLatencyP50:"Kong latency (p50)",KongLatencyAverage:"Kong latency (avg)",ResponseSizeP99:"Response size (p99)",ResponseSizeP95:"Response size (p95)",ResponseSizeP50:"Response size (p50)",RequestSizeP99:"Request size (p99)",RequestSizeP95:"Request size (p95)",RequestSizeP50:"Request size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx","3XX":"3xx","2XX":"2xx","1XX":"1xx",REQUEST_COUNT:"Request count",REQUEST_PER_MINUTE:"Requests per minute",RESPONSE_LATENCY_P99:"Response latency",RESPONSE_LATENCY_P95:"Response latency",RESPONSE_LATENCY_P50:"Response latency",RESPONSE_SIZE_P99:"Response size (p99)",RESPONSE_SIZE_P95:"Response size (p95)",RESPONSE_SIZE_P50:"Response size (p50)",REQUEST_SIZE_P99:"Request size (p99)",REQUEST_SIZE_P95:"Request size (p95)",REQUEST_SIZE_P50:"Request size (p50)",CONTROL_PLANE:"Control plane",____OTHER____:"Others",ai_request_count:"Request count",total_tokens:"Total token count",prompt_tokens:"Prompt token count",completion_tokens:"Completion token count",share_of_requests:"Share of requests",cost:"Costs",cost_per_request_average:"Request cost (avg per million)",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A response size (sum)",a2a_context_id:"A2A context ID",a2a_error:"A2A error",a2a_method:"A2A method",a2a_task_id:"A2A task ID",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",mcp_response_size_sum:"MCP response size (sum)",mcp_session_id:"MCP session ID",mcp_tool_name:"MCP tool name",mcp_response_body_size_sum:"MCP response size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",oidc_credential:"OIDC credential",principal:"Principal",principal_group:"Principal group",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",share_of_cost:"Share of cost"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}},jumpToExplore:"Explore",jumpToRequests:"View requests",unsupported_time_range_badge:"Limited timeframe",unsupported_time_range_warning:"The selected timeframe exceeds what this datasource supports, so this tile is limited to the maximum supported timeframe.",query_aged_out_warning:"This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.",granularities:{daily:"1 day",fiveMinutely:"5 minutes",hourly:"1 hour",minutely:"1 minute",tenMinutely:"10 minutes",tenSecondly:"10 seconds",thirtyMinutely:"30 minutes",thirtySecondly:"30 seconds",twelveHourly:"12 hours",twoHourly:"2 hours",weekly:"1 week",unknown:"Unknown"}};function gt(){const r=ct.createI18n("en-us",wa);return{i18n:r,i18nT:ct.i18nTComponent(r)}}const it=170,zt=6,rt=20,Ie="analytics-query-provider",Gi="analytics-dashboard-coordinator",Pt="{entity-id}",$i="{cp-id}",Fi="{timeframe}",Wi=30*1e3,Vi=3e5,Yi=36e5;function Ta(){const r=n.inject(Ie);return{evaluateFeatureFlag:(t,i)=>typeof r?.evaluateFeatureFlagFn!="function"?i:r.evaluateFeatureFlagFn(t,i)}}var qt={exports:{}},Xi;function va(){return Xi||(Xi=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function s(u,c,d){this.fn=u,this.context=c,this.once=d||!1}function o(u,c,d,h,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,h||u,f),C=t?t+c:c;return u._events[C]?u._events[C].fn?u._events[C]=[u._events[C],p]:u._events[C].push(p):(u._events[C]=p,u._eventsCount++),u}function a(u,c){--u._eventsCount===0?u._events=new i:delete u._events[c]}function l(){this._events=new i,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],d,h;if(this._eventsCount===0)return c;for(h in d=this._events)e.call(d,h)&&c.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},l.prototype.listeners=function(c){var d=t?t+c:c,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,p=h.length,C=new Array(p);f<p;f++)C[f]=h[f].fn;return C},l.prototype.listenerCount=function(c){var d=t?t+c:c,h=this._events[d];return h?h.fn?1:h.length:0},l.prototype.emit=function(c,d,h,f,p,C){var O=t?t+c:c;if(!this._events[O])return!1;var R=this._events[O],T=arguments.length,P,b;if(R.fn){switch(R.once&&this.removeListener(c,R.fn,void 0,!0),T){case 1:return R.fn.call(R.context),!0;case 2:return R.fn.call(R.context,d),!0;case 3:return R.fn.call(R.context,d,h),!0;case 4:return R.fn.call(R.context,d,h,f),!0;case 5:return R.fn.call(R.context,d,h,f,p),!0;case 6:return R.fn.call(R.context,d,h,f,p,C),!0}for(b=1,P=new Array(T-1);b<T;b++)P[b-1]=arguments[b];R.fn.apply(R.context,P)}else{var E=R.length,D;for(b=0;b<E;b++)switch(R[b].once&&this.removeListener(c,R[b].fn,void 0,!0),T){case 1:R[b].fn.call(R[b].context);break;case 2:R[b].fn.call(R[b].context,d);break;case 3:R[b].fn.call(R[b].context,d,h);break;case 4:R[b].fn.call(R[b].context,d,h,f);break;default:if(!P)for(D=1,P=new Array(T-1);D<T;D++)P[D-1]=arguments[D];R[b].fn.apply(R[b].context,P)}}return!0},l.prototype.on=function(c,d,h){return o(this,c,d,h,!1)},l.prototype.once=function(c,d,h){return o(this,c,d,h,!0)},l.prototype.removeListener=function(c,d,h,f){var p=t?t+c:c;if(!this._events[p])return this;if(!d)return a(this,p),this;var C=this._events[p];if(C.fn)C.fn===d&&(!f||C.once)&&(!h||C.context===h)&&a(this,p);else{for(var O=0,R=[],T=C.length;O<T;O++)(C[O].fn!==d||f&&!C[O].once||h&&C[O].context!==h)&&R.push(C[O]);R.length?this._events[p]=R.length===1?R[0]:R:a(this,p)}return this},l.prototype.removeAllListeners=function(c){var d;return c?(d=t?t+c:c,this._events[d]&&a(this,d)):(this._events=new i,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,r.exports=l})(qt)),qt.exports}var Sa=va();const xa=ma(Sa);class Ht extends Error{name="TimeoutError";constructor(e,t){super(e,t),Error.captureStackTrace?.(this,Ht)}}const ji=r=>r.reason??new DOMException("This operation was aborted.","AbortError");function Ia(r,e){const{milliseconds:t,fallback:i,message:s,customTimers:o={setTimeout,clearTimeout},signal:a}=e;let l,u;const d=new Promise((h,f)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(a?.aborted){f(ji(a));return}if(a&&(u=()=>{f(ji(a))},a.addEventListener("abort",u,{once:!0})),r.then(h,f),t===Number.POSITIVE_INFINITY)return;const p=new Ht;l=o.setTimeout.call(void 0,()=>{if(i){try{h(i())}catch(C){f(C)}return}typeof r.cancel=="function"&&r.cancel(),s===!1?h():s instanceof Error?f(s):(p.message=s??`Promise timed out after ${t} milliseconds`,f(p))},t)}).finally(()=>{d.clear(),u&&a&&a.removeEventListener("abort",u)});return d.clear=()=>{o.clearTimeout.call(void 0,l),l=void 0},d}function ka(r,e,t){let i=0,s=r.length;for(;s>0;){const o=Math.trunc(s/2);let a=i+o;t(r[a],e)<=0?(i=++a,s-=o+1):s=o}return i}const Da=100;class Qi{#t=[];#e=0;enqueue(e,t){const{priority:i=0,id:s}=t??{},{size:o}=this,a={priority:i,id:s,run:e};if(o===0){this.#t.length=0,this.#e=0,this.#t.push(a);return}if(this.#t.at(-1).priority>=i){this.#t.push(a);return}this.#s();const l=ka(this.#t,a,(u,c)=>c.priority-u.priority);this.#t.splice(l,0,a)}setPriority(e,t){const i=this.#t.findIndex((o,a)=>a>=this.#e&&o.id===e);if(i===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[s]=this.#t.splice(i,1);this.enqueue(s.run,{priority:t,id:e})}remove(e){const t=this.#t.findIndex((i,s)=>s<this.#e?!1:typeof e=="string"?i.id===e:i.run===e);t!==-1&&this.#t.splice(t,1)}dequeue(){if(this.#e===this.#t.length)return;const e=this.#t[this.#e];return this.#e++,this.#e===this.#t.length?(this.#t.length=0,this.#e=0):this.#e>Da&&this.#e>this.#t.length/2&&this.#s(),e?.run}filter(e){const t=[];for(let i=this.#e;i<this.#t.length;i++){const s=this.#t[i];s.priority===e.priority&&t.push(s.run)}return t}get size(){return this.#t.length-this.#e}#s(){this.#e!==0&&(this.#t.splice(0,this.#e),this.#e=0)}}class Na extends xa{#t;#e;#s=0;#f;#p=!1;#R=!1;#c;#C=0;#l;#u;#a;#o=[];#n=0;#i;#v;#r=0;#g;#d;#N=1n;#_=new Map;#E=new Set;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Qi,strict:!1,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#t=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#e=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#f=e.intervalCap,this.#c=e.interval,this.#a=e.strict,this.#i=new e.queueClass,this.#v=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#d=e.autoStart===!1,this.#P()}#b(e){for(;this.#n<this.#o.length;){const i=this.#o[this.#n];if(i!==void 0&&e-i>=this.#c)this.#n++;else break}(this.#n>100&&this.#n>this.#o.length/2||this.#n===this.#o.length)&&(this.#o=this.#o.slice(this.#n),this.#n=0)}#A(e){this.#a?this.#o.push(e):this.#s++}#L(){this.#a?this.#o.length>this.#n&&this.#o.pop():this.#s>0&&this.#s--}#O(){return this.#o.length-this.#n}get#U(){return this.#e?!0:this.#a?this.#O()<this.#f:this.#s<this.#f}get#M(){return this.#r<this.#g}#K(){this.#r--,this.#r===0&&this.emit("pendingZero"),this.#y(),this.emit("next")}#B(){this.#u=void 0,this.#k(),this.#I()}#z(e){if(this.#a){if(this.#b(e),this.#O()>=this.#f){const i=this.#o[this.#n],s=this.#c-(e-i);return this.#S(s),!0}return!1}if(this.#l===void 0){const t=this.#C-e;if(t<0)this.#s=this.#t?this.#r:0;else return this.#S(t),!0}return!1}#S(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#B()},e))}#w(){this.#l&&(clearInterval(this.#l),this.#l=void 0)}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#y(){if(this.#i.size===0){if(this.#w(),this.emit("empty"),this.#r===0){if(this.#x(),this.#a&&this.#n>0){const t=Date.now();this.#b(t)}this.emit("idle")}return!1}let e=!1;if(!this.#d){const t=Date.now(),i=!this.#z(t);if(this.#U&&this.#M){const s=this.#i.dequeue();this.#e||(this.#A(t),this.#m()),i&&this.#I(),this.emit("active"),s(),e=!0}}return e}#I(){this.#e||this.#l!==void 0||this.#a||(this.#l=setInterval(()=>{this.#k()},this.#c),this.#C=Date.now()+this.#c)}#k(){this.#a||(this.#l!==void 0&&(this.#s===0&&this.#r===0?this.#w():this.#C=Date.now()+this.#c),this.#s=this.#t?this.#r:0),this.#T(),this.#m()}#T(){for(;this.#y(););}get concurrency(){return this.#g}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#g=e,this.#T()}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#i.setPriority(e,t)}async add(e,t={}){if(t={timeout:this.timeout,...t,id:t.id??(this.#N++).toString()},t.timeout!==void 0&&!(Number.isFinite(t.timeout)&&t.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);return new Promise((i,s)=>{const o=Symbol(`task-${t.id}`);let a=()=>{};const l=async()=>{a(),this.#r++,this.#_.set(o,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let c;try{try{t.signal?.throwIfAborted()}catch(f){throw this.#q(),this.#_.delete(o),f}let d=e({signal:t.signal});if(t.timeout!==void 0&&(d=Ia(Promise.resolve(d),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#r} running, ${this.#i.size} waiting)`})),t.signal){const{signal:f}=t;d=Promise.race([d,new Promise((p,C)=>{c=()=>{C(f.reason)},f.addEventListener("abort",c,{once:!0})})])}const h=await d;i(h),this.emit("completed",h)}catch(d){s(d),this.emit("error",d)}finally{c&&t.signal?.removeEventListener("abort",c),this.#_.delete(o),queueMicrotask(()=>{this.#K()})}};this.#i.enqueue(l,t);const u=()=>{if(this.#i instanceof Qi){this.#i.remove(l);return}this.#i.remove?.(t.id)};if(t.signal){const{signal:c}=t,d=()=>{a(),u(),s(c.reason),this.#y(),this.emit("next")};if(a=()=>{c.removeEventListener("abort",d),this.#E.delete(a)},c.aborted){d();return}c.addEventListener("abort",d,{once:!0}),this.#E.add(a)}this.emit("add"),this.#y()})}async addAll(e,t){return Promise.all(e.map(async i=>this.add(i,t)))}start(){return this.#d?(this.#d=!1,this.#T(),this):this}pause(){this.#d=!0}clear(){for(const e of this.#E)e();this.#i=new this.#v,this.#w(),this.#D(),this.emit("empty"),this.#r===0&&(this.#x(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#i.size!==0&&await this.#h("empty")}async onSizeLessThan(e){this.#i.size<e||await this.#h(["next","active"],()=>this.#i.size<e)}async onIdle(){this.#r===0&&this.#i.size===0||await this.#h("idle")}async onPendingZero(){this.#r!==0&&await this.#h("pendingZero")}async onRateLimit(){this.isRateLimited||await this.#h("rateLimit")}async onRateLimitCleared(){this.isRateLimited&&await this.#h("rateLimitCleared")}onError(){return new Promise((e,t)=>{const i=s=>{this.off("error",i),t(s)};this.on("error",i)})}async#h(e,t){const i=Array.isArray(e)?e:[e];return new Promise(s=>{const o=()=>{if(!(t&&!t())){for(const a of i)this.off(a,o);s()}};for(const a of i)this.on(a,o)})}get size(){return this.#i.size}sizeBy(e){return this.#i.filter(e).length}get pending(){return this.#r}get isPaused(){return this.#d}#P(){this.#e||(this.on("add",()=>{this.#i.size>0&&this.#m()}),this.on("next",()=>{this.#m()}))}#m(){this.#e||this.#R||(this.#R=!0,queueMicrotask(()=>{this.#R=!1,this.#D()}))}#q(){this.#e||(this.#L(),this.#m())}#D(){const e=this.#p;if(this.#e||this.#i.size===0){e&&(this.#p=!1,this.emit("rateLimitCleared"));return}let t;if(this.#a){const s=Date.now();this.#b(s),t=this.#O()}else t=this.#s;const i=t>=this.#f;i!==e&&(this.#p=i,this.emit(i?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#p}get isSaturated(){return this.#r===this.#g&&this.#i.size>0||this.isRateLimited&&this.#i.size>0}get runningTasks(){return[...this.#_.values()].map(e=>({...e,timeoutRemaining:e.timeout?Math.max(0,e.startTime+e.timeout-Date.now()):void 0}))}}const Aa=()=>{const r=Se.useAnalyticsConfigStore(),e=n.inject(Ie);if(!e)return;if(e.queryFnOverride){console.warn("Detected incorrect use of useRequestQueue. This composable should not be used in nested components. Please discuss with team-data or report an issue if you feel you have a use case.");return}const t=new Na({carryoverConcurrencyCount:!0,concurrency:r.maxParallelRequests,interval:r.requestInterval,intervalCap:r.requestIntervalCap}),i={...e,queryFnOverride:!0,queryFn:(s,o)=>t.add(()=>e.queryFn(s,o))};n.provide(Ie,i)};function La(r){const e=`[${r.name}] ${r.message}`,t=[];return r.fix&&t.push(`fix: ${r.fix}`),r.sources?.length&&t.push(`sources: ${r.sources.join(", ")}`),r.docs&&t.push(`see: ${r.docs}`),t.length===0?e:[e,...t.map((i,s)=>`${s<t.length-1?"├▶":"╰▶"} ${i}`)].join(`
|
|
12
|
+
`)}function Zi(r,...e){return typeof r=="function"?r(...e):r}function Ua({method:r="warn",formatter:e=La}={}){return(t,{method:i=r}={})=>{console[i](e(t))}}const Ma=Error.captureStackTrace;var Ka=class Fr extends Error{name;code;docs;fix;sources;get why(){return this.message}constructor(e,t=Fr){super(e.why,{cause:e.cause}),this.code=this.name=e.code,this.fix=e.fix,this.docs=e.docs,this.sources=e.sources,Ma?.(this,t)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function Ba(r,e){return typeof r=="string"?`${r}/${e.toLowerCase()}`:r?.(e)}function za(r){const e=r.reporters??[],t={},{docsBase:i}=r;for(const s of Object.keys(r.codes)){const o=r.codes[s],a=o.docs===!1?void 0:o.docs||Ba(i,s),l=(u={},c={})=>{const d=new Ka({code:s,why:Zi(o.why,u),fix:Zi(o.fix,u),docs:a,cause:u.cause,sources:u.sources},l);for(const h of e)h(d,c);return d};t[s]=l}return t}const Pa=typeof window<"u",qa=za({reporters:[Ua()],codes:{PINIA_R1001:{why:'Directly pass all stores to "mapStores()" without putting them in an array. This will fail in production.',fix:"Replace mapStores([useAuthStore, useCartStore]) with mapStores(useAuthStore, useCartStore).",docs:"https://pinia.vuejs.org/cookbook/options-api.html#Giving-access-to-the-whole-store"},PINIA_R1002:{why:r=>`A getter cannot have the same name as another state property. Found "${r.name}" in store "${r.id}".`,fix:"Rename either the getter or the state property.",docs:"https://pinia.vuejs.org/core-concepts/getters.html#Accessing-other-getters"},PINIA_R1003:{why:r=>`The "state" must be a plain object. Found in store "${r.id}".`,fix:"Return a plain object, e.g. avoid state: () => new MyClass().",docs:"https://pinia.vuejs.org/core-concepts/state.html#State"},PINIA_R1004:{why:"Pinia instance not found in context. This falls back to the global activePinia, which exposes you to cross-request pollution on the server.",fix:'"useStore()" is a composable and follows the same rules: call it at the top of setup() (or another composable), or pass the pinia instance explicitly when used outside of a component.',docs:"https://pinia.vuejs.org/ssr/#Using-the-store-outside-of-setup-"},PINIA_R1005:{why:r=>`The store id changed from "${r.from}" to "${r.to}", forcing a reload.`,docs:"https://pinia.vuejs.org/cookbook/hot-module-replacement.html#HMR-Hot-Module-Replacement-"},PINIA_R1006:{why:r=>`Property "${r.key}" of store "${r.id}" is not reactive (not a ref, reactive object, or shallowRef), so storeToRefs() ignores it.`,fix:"If it should be reactive state, wrap it with ref(), reactive(), or shallowRef(). If it is an intentional non-reactive property, wrap it with markRaw() so storeToRefs() skips it explicitly.",docs:"https://pinia.vuejs.org/core-concepts/plugins.html#Adding-new-external-properties"},PINIA_R1007:{why:r=>`The same callback was passed to "$subscribe()" of store "${r.id}" more than once. Subscriptions are deduplicated, so the duplicate is ignored.`,fix:"Subscribe each callback only once. If you need to resubscribe, call the returned function to remove the previous subscription first, or create a new function.",docs:"https://pinia.vuejs.org/core-concepts/state.html#Subscribing-to-the-state"},PINIA_R1008:{why:r=>`"$dispose()" was called on an old instance of store "${r.id}" that has already been replaced by a new one. This also removes the new store.`,fix:"Avoid keeping references to disposed stores. Call the useStore() function again to get the current store.",docs:"https://pinia.vuejs.org/api/pinia/interfaces/StoreWithState.html#-dispose-"}}});let Ji;process.env.NODE_ENV;const er=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();process.env.NODE_ENV;function Xe(r){const e=n.toRaw(r),t={};for(const i in e){const s=e[i];s?.effect?t[i]=n.computed({get:()=>r[i],set(o){r[i]=o}}):(n.isRef(s)||n.isReactive(s))&&(t[i]=n.toRef(r,i))}return t}const Ne=r=>r?.chart.type==="table",_t=r=>r?.query?.datasource==="requests",Gt=r=>!!r&&!Ne(r)&&!_t(r),Ha=(r,e)=>{const t=r.header_description??("description"in r.chart?r.chart.description:void 0);if(t)return t.replaceAll(Fi,e)||void 0},Ga=r=>!r||r==="basic"?"api_usage":re.isPlatformDatasource(r)?"platform_usage":r;function $a({queryBridge:r,context:e,definition:t,chartData:i}){const s=n.ref(""),o=n.ref(""),a=n.ref(void 0),l=n.ref(void 0),u=Se.useAnalyticsConfigStore(),c=Se.useDatasourceConfigStore(),{stripUnknownFilters:d,datasourceConfigMap:h,datasourceConfigError:f,loading:p}=Xe(c),C=n.computed(()=>Ne(t.value));n.onMounted(async()=>{s.value=await r?.exploreBaseUrl?.()??"",o.value=await r?.requestsBaseUrl?.()??""});const O=n.computed(()=>u.analytics&&u.percentiles),R=n.computed(()=>{const v=t.value.chart.type;return["golden_signals","gauge"].includes(v)?!1:v==="top_n"?!!e.value.editable||!!e.value.showTileActions:!0}),T=n.computed(()=>{const v=t.value.query?.datasource??"api_usage";return v.startsWith("goap")?!f.value:!!h.value[v]?.showRequestsLink}),P=n.computed(()=>{if(_t(t.value))return!1;const v=Ga(t.value.query?.datasource);return!!h.value[v]?.showInUI}),b=n.computed(()=>o.value&&t.value.query&&!C.value&&T.value&&O.value&&!p.value),E=n.computed(()=>s.value&&t.value.query&&P.value&&O.value&&!p.value),D=n.computed(()=>i.value?re.msToGranularity(i.value.meta.granularity_ms):void 0),x=n.computed(()=>{const v=t.value,q=[...e.value.filters,...v.query.filters??[]],V="metrics"in v.query?v.query.metrics:void 0,W=v.query?.datasource??"api_usage";return d.value({datasource:W,filters:q,queryFields:V})}),K=n.computed(()=>{if(!E.value||!R.value)return"";const v=t.value;if(Ne(v))return F({...v.query,filters:x.value});const q=v.query.time_range||e.value.timeSpec,V=A(q,x.value);return F(V)}),g=n.computed(()=>{if(!b.value||!R.value)return"";const v=x.value,q=t.value;if(Ne(q))return"";const V=_(q.query.time_range||e.value.timeSpec,v);return m(V)}),m=v=>b.value?`${o.value}?q=${JSON.stringify(v)}`:"",_=(v,q)=>{const V=i.value?.meta?.start?new Date(i.value.meta.start):void 0,W=i.value?.meta?.end?new Date(i.value.meta.end):void 0;return{filter:q,timeframe:{timePeriodsKey:v.type==="relative"?v.time_range:"custom",start:v.type==="absolute"?V:void 0,end:v.type==="absolute"?W:void 0}}},U=(v,q)=>({filter:q,timeframe:{timePeriodsKey:v.type==="relative"?v.time_range:"custom",start:v.type==="absolute"?v.start:void 0,end:v.type==="absolute"?v.end:void 0}}),A=(v,q)=>{const V=t.value;if(!Gt(V))throw new Error("Cannot build a chart explore query for table or api-requests definitions");const W=[...V.query.dimensions??[]],w=[...V.query.metrics??[]];return{filters:q,metrics:w,dimensions:W,time_range:v,granularity:V.query.granularity||D.value||void 0}},F=v=>{if(!E.value)return"";const q=t.value.query.datasource&&t.value.query.datasource!=="basic"?t.value.query.datasource:"api_usage";return`${s.value}?q=${JSON.stringify(v)}&d=${q}&c=${t.value.chart.type}`};return n.watch([b,E],([v,q])=>{v&&(a.value={href:""}),q&&(l.value={href:""})}),{exploreLinkKebabMenu:K,requestsLinkKebabMenu:g,canShowKebabMenu:R,canGenerateRequestsLink:b,canGenerateExploreLink:E,requestsLinkZoomActions:a,exploreLinkZoomActions:l,buildExploreQuery:A,buildRequestsQueryZoomActions:U,buildExploreLink:F,buildRequestLink:m}}const $t=r=>r.type==="relative"?re.TimePeriods.get(re.TIMEFRAME_LOOKUP[r.time_range])?.timeframeLengthMs():new Date(r.end).getTime()-new Date(r.start).getTime(),Fa=r=>r.reduce((e,t)=>{const i=re.TimePeriods.get(re.TIMEFRAME_LOOKUP[t])?.maximumTimeframeLength();return i===void 0||e&&i<=e.durationSeconds?e:{durationSeconds:i,key:t}},void 0),Ft=(r,e)=>{if(!r||!e?.length)return;const t=$t(r),i=Fa(e);return t!==void 0&&i&&t>i.durationSeconds*1e3?i:void 0},Wt=(r,e)=>{const t=Ft(r,e);return!t||!r?r:r.type==="relative"?{...r,time_range:t.key}:{...r,start:new Date(new Date(r.end).getTime()-t.durationSeconds*1e3)}};function Wa(){const r=n.inject(Ie),e=Se.useDatasourceConfigStore(),{datasourceConfigMap:t,stripUnknownFilters:i}=Xe(e);let s=null;return n.onUnmounted(()=>{s?.abort()}),{issueQuery:async(a,l,u)=>{if(!r)throw new Error("Query bridge is not defined");s?.abort();const c=new AbortController;s=c,await e.isReady();const{datasource:d,limit:h,...f}=a,p=d||"basic",C=re.isPlatformDatasource(p),O=i.value({datasource:p,filters:[...a.filters??[],...l.filters],queryFields:a.metrics}).filter(({operator:P})=>!C||!re.requestFilterTypeEmptyV2.some(b=>b===P));let R=a.time_range;!R&&l.timeSpec?R={...l.timeSpec,tz:l.tz}:R&&!R.tz&&(R={...R,tz:l.tz}),R=Wt(R,t.value[p]?.timeRangeOptions);const T={datasource:p,query:{...f,time_range:R,filters:O,limit:u??h}};return r.queryFn(T,c)}}}const Va="24H",Ya={status_code:"response_http_status",upstream_status_code:"upstream_status"},Xa={cost:"usd",latencies_response_ms:"ms",latencies_upstream_ms:"ms",latencies_kong_gateway_ms:"ms",latencies_kong_internal_ms:"ms",request_body_size:"bytes",response_body_size:"bytes",response_header_content_length:"bytes",ai_count:"count"},ja=r=>re.relativeTimeRangeValuesRequestV2.includes(r),Qa=r=>{const e=r?.tz?{tz:r.tz}:{};if(r?.type==="absolute")return{type:"absolute",start:r.start,end:r.end,...e};const t=r?.time_range.toUpperCase()??"";return{type:"relative",time_range:ja(t)?t:Va,...e}},tr=r=>Ya[r]??r,Za=r=>({metric:tr(r.metric),dimension:r.dimension?tr(r.dimension):void 0,unroll:r.unroll,metricUnit:Xa[r.metric],extraFields:r.extra_fields}),Vt="requests";function Ja(){const r=n.inject(Ie),e=Se.useDatasourceConfigStore(),{datasourceConfigMap:t,stripUnknownFilters:i}=Xe(e);let s=null;n.onUnmounted(()=>{s?.abort()});const o=(l,u)=>{const c=l.time_range??u.timeSpec;return Wt(c&&{...c,tz:c.tz??u.tz},t.value[Vt]?.timeRangeOptions)};return{issueRequestsQuery:async(l,u)=>{const c=r?.requestsQueryFn;if(!c)throw new Error("Query bridge cannot fetch request records");s?.abort();const d=new AbortController;s=d,await e.isReady();const h=i.value({datasource:Vt,filters:[...l.filters??[],...u.filters]});return re.fetchAllRequests(c,{datasource:Vt,query:{filters:h,time_range:Qa(o(l,u))}},d,{maxRecords:l.max_records})}}}function el({context:r,globalFilters:e=n.ref([]),isFullscreen:t=n.ref(!1),preview:i=n.ref(!1)}){const s=Se.useAnalyticsConfigStore(),o=Se.useDatasourceConfigStore(),{loading:a}=Xe(s),{loading:l}=Xe(o),u=n.computed(()=>r.value.timeSpec?r.value.timeSpec:{type:"relative",time_range:s.defaultQueryTimeForOrg}),c=n.computed(()=>{const{tz:E}=r.value;return E||new Intl.DateTimeFormat().resolvedOptions().timeZone}),d=n.computed(()=>{const{editable:E}=r.value;return E===void 0||i.value?!1:E}),h=n.computed(()=>{const{showTileActions:E}=r.value;return i.value?!1:E===void 0?!0:E}),f=n.computed(()=>[...r.value.filters??[],...e.value]),p=n.computed(()=>{let{refreshInterval:E}=r.value;if(E===void 0&&(E=Wi),t.value){let D=!1;if(u.value.type==="relative")D=["15m","1h","6h","12h","24h"].includes(u.value.time_range);else{const g=u.value.start.getTime(),m=u.value.end.getTime();D=Math.abs(m-g)<=864e5}const x=new Date().getTime();u.value.type==="absolute"&&u.value.end.getTime()<x||u.value.type==="relative"&&["previous_week","previous_month"].includes(u.value.time_range)?E=0:D?E=Vi:E=Yi}return E}),C=n.computed(()=>({...r.value,filters:f.value,timeSpec:u.value,tz:c.value,refreshInterval:p.value,editable:d.value,showTileActions:h.value})),O=n.computed(()=>!a.value&&!l.value),R=n.computed(()=>!i.value&&!!n.getCurrentInstance()?.vnode?.props?.onTileTimeRangeZoom),T=n.computed(()=>!i.value),P=n.computed(()=>!i.value),b=n.computed(()=>({enabled:R.value,showExploreAction:T.value,showRequestsAction:P.value,showZoomInAction:R.value}));return{editable:d,enrichedContext:C,filters:f,queryReady:O,refreshInterval:p,showTileActions:h,timeSpec:u,tz:c,zoomConfiguration:b}}const tl=6,ir=6,rr=4;function il(r,e){const{pageWidth:t,pageHeight:i,margin:s}=e,o=s+1,a=s+e.headerHeight-3,l=i-s-ir+3,u=l+4;e.title&&(r.setFont("helvetica","bold"),r.setFontSize(11),r.setTextColor(60),r.text(e.title,s,o)),r.setFont("helvetica","normal"),r.setFontSize(8),r.setTextColor(120),r.text(e.generatedAt,t-s,o,{align:"right"}),e.subtitle&&r.text(e.subtitle,s,o+rr),r.setDrawColor(220),r.line(s,a,t-s,a),r.line(s,l,t-s,l),r.setFont("helvetica","bold"),r.setTextColor(60),r.text(e.branding,s,u);const c=r.getTextWidth(e.branding);r.setFont("helvetica","normal");const d=` ${e.dashboardNote}`;e.dashboardUrl?(r.setTextColor(0,68,204),r.textWithLink(d,s+c,u,{url:e.dashboardUrl})):(r.setTextColor(120),r.text(d,s+c,u)),r.setTextColor(120),r.text(e.pageLabel,t-s,u,{align:"right"})}function rl(r){const e=r.querySelectorAll(".kong-ui-public-grid-layout, .grid-stack"),t=[];if(e.forEach(o=>{t.push(...o.querySelectorAll(":scope > .grid-cell:not(.empty-cell), :scope > .grid-stack-item"))}),!t.length)return[];const i=r.getBoundingClientRect().top,s=new Map;return t.forEach(o=>{const a=o.getBoundingClientRect(),l=Math.round(a.top-i),u=Math.round(a.bottom-i),c=s.get(l);s.set(l,c!==void 0?Math.max(c,u):u)}),[...s.entries()].map(([o,a])=>({top:o,bottom:a})).sort((o,a)=>o.top-a.top)}function nl(r,e,t,i){if(!r.length){const a=[];let l=0;for(;l<e;){const u=Math.min(t,e-l);a.push({startY:l,height:u}),l+=u}return a}const s=[];let o=0;for(const a of r){const l=a.top*i,u=a.bottom*i;u-o>t&&(l>o?(s.push({startY:o,height:l-o}),o=l):(s.push({startY:o,height:u-o}),o=u))}return o<e&&s.push({startY:o,height:e-o}),s}function sl(r){const{i18n:e}=gt(),t=n.ref({status:"idle"});async function i(s={}){const{filename:o="dashboard-export",title:a,subtitle:l,dashboardUrl:u,orientation:c="landscape",pageSize:d="letter",margin:h=4,scale:f=2,exclude:p=[".tile-actions",".tooltip",".popover",".dropdown-popover"],output:C="download",onBeforeCapture:O,onAfterCapture:R}=s,T=r.value;if(!T){t.value={status:"error",error:new Error("Dashboard layout container not found.")};return}try{t.value={status:"preparing"},await O?.();const[{snapdom:P},{jsPDF:b}]=await Promise.all([import("@zumer/snapdom"),import("jspdf")]);t.value={status:"capturing"};const E={name:"kong-webgl-snapshot",beforeClone:()=>re.prepareForCapture(),afterClone:()=>re.restoreAfterCapture()},D=await P.toCanvas(T,{scale:f,exclude:p,excludeMode:"remove",embedFonts:!0,plugins:[E]}),x=rl(T),K=T.getBoundingClientRect().width,g=K?D.width/K:f;t.value={status:"generating"};const m=new Date,_=new b({orientation:c,unit:"mm",format:d}),U=_.internal.pageSize.getWidth(),A=_.internal.pageSize.getHeight(),F=tl+(l?rr:0),v=U-h*2,q=A-h*2-F-ir,V=D.width/v,W=q*V,w=nl(x,D.height,W,g),S={title:a,subtitle:l,dashboardUrl:u,generatedAt:e.t("pdfExport.generated",{timestamp:m.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}),branding:e.t("pdfExport.branding"),dashboardNote:e.t("pdfExport.dashboardNote"),pageWidth:U,pageHeight:A,headerHeight:F,margin:h};for(let G=0;G<w.length;G++){G>0&&_.addPage();const{startY:M,height:k}=w[G],N=document.createElement("canvas");N.width=D.width,N.height=k,N.getContext("2d").drawImage(D,0,M,D.width,k,0,0,D.width,k),_.addImage(N.toDataURL("image/png"),"PNG",h,h+F,v,k/V),il(_,{...S,pageLabel:e.t("pdfExport.pageOf",{page:String(G+1),total:String(w.length)})})}if(C==="blob"){const G=_.output("blob");return t.value={status:"complete",pageCount:w.length},G}_.save(o),t.value={status:"complete",pageCount:w.length}}catch(P){t.value={status:"error",error:P}}finally{re.restoreAfterCapture(),await R?.()}}return{exportPdf:i,exportState:n.readonly(t)}}const ol=r=>r.toLowerCase().endsWith("count")?"":r;function al(){const{i18n:r}=gt(),{formatUnit:e}=re.unitFormatter({i18n:r}),t=ue.useFieldLabel();return i=>{const s=i.meta?.metric_names?.[0]??"",o=i.meta?.metric_units?.[s]??"";return{seriesName:t(s),valueFormatter:a=>e(a,o,{translateUnit:ol})}}}const nr=(r,e,t,{prefix:i="chartLabels",fallback:s=t}={})=>{const o=`${i}.${t}`;return e.get(t)||(r.te(o)?r.t(o):s)};function ll(){const{i18n:r}=gt(),e=Se.useDatasourceConfigStore();return(t,i)=>nr(r,e.fieldTranslationMap,t,i)}const ue={useContextLinks:$a,useDashboardContext:el,useEvaluateFeatureFlag:Ta,useExportPdf:sl,useFieldLabel:ll,useI18n:gt,useIssueQuery:Wa,useIssueRequestsQuery:Ja,useMetricFormatter:al,useRequestQueue:Aa},cl={class:"kong-ui-public-csv-export-modal"},ul={key:0,class:"selected-range"},dl={key:4,class:"text-muted",tag:"span"},sr=3,or=n.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(r,{emit:e}){const{i18n:t}=ue.useI18n(),i=ue.useFieldLabel(),s=r,o=e,a=`${s.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,l=n.ref(1),u=n.computed(()=>p.value.rows.length),c=n.computed(()=>s.exportState.status==="success"&&!!s.exportState.chartData?.data?.length),d=n.computed(()=>{if(s.exportState.status!=="success"||!s.exportState.chartData?.meta)return"";const{start:O,end:R}=s.exportState.chartData.meta;return!O||!R?"":new Date(O).getTime()===new Date(R).getTime()?t.t("csvExport.exportAsOf",{time:re.formatTimestamp(new Date(O),{includeTZ:!0})}):`${t.t("csvExport.exportTimeRange")}: ${re.formatTimestamp(new Date(O))} - ${re.formatTimestamp(new Date(R),{includeTZ:!0})}`}),h=n.computed(()=>s.exportState.status!=="success"?"":t.t("csvExport.previewRows",{rowsMax:Math.min(sr,u.value),rowsTotal:u.value,plural:u.value===1?"":"s"})),f=()=>{o("closeModal")},p=n.computed(()=>{if(s.exportState.status!=="success"||!c.value||!s.exportState.chartData?.meta.metric_names)return{headers:[],rows:[],csvHeaders:{}};const O=s.exportState.chartData,R=O.data.some(x=>x.timestamp!==O.data[0].timestamp),T=O.data.map(x=>{const K=new Date(x.timestamp);return{...Object.keys(x.event).reduce((m,_)=>{if(_ in O.meta.display){const U=x.event[_],A=O.meta.display[_],F=U&&A?.[U]?.name||x.event[_];m[_]=U===Re.OTHER_DIMENSION_ID?t.t("chartLabels.____OTHER____"):F}else m[_]=x.event[_];return m},{}),...R?{timestamp:Bt(K,"yyyy-MM-dd HH:mm:ss"),tzOffset:Bt(K,"XXX")}:{}}});let P=[];R&&(P=[{label:t.t("csvExport.Timestamp"),key:"timestamp"},{label:t.t("csvExport.UtcOffset"),key:"tzOffset"}]);const b="display"in s.exportState.chartData.meta&&s.exportState.chartData.meta.display?s.exportState.chartData.meta.display:{},E=[...P,...Object.keys(b).map(x=>({label:i(x),key:x})),...s.exportState.chartData.meta.metric_names.map(x=>({label:i(x),key:x}))],D=E.reduce((x,K)=>(x[K.key]=K.label,x),{});return{headers:E,csvHeaders:D,rows:T}}),C=async()=>{if(s.exportState.status!=="success")return{total:0,data:[]};const{rows:O}=p.value;return{total:Number(O.length)||0,data:O.slice(0,sr)}};return n.watch(p,()=>{l.value++}),(O,R)=>{const T=n.resolveComponent("KSkeleton"),P=n.resolveComponent("KEmptyState"),b=n.resolveComponent("KTableData"),E=n.resolveComponent("KTooltip"),D=n.resolveComponent("KButton"),x=n.resolveComponent("KModal");return n.openBlock(),n.createElementBlock("div",cl,[n.createVNode(x,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:n.unref(t).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:n.withKeys(f,["esc"])},{default:n.withCtx(()=>[n.createElementVNode("div",null,[r.exportState.status==="success"&&c.value?(n.openBlock(),n.createElementBlock("div",ul,[n.createElementVNode("p",null,n.toDisplayString(r.modalDescription?r.modalDescription:n.unref(t).t("csvExport.exportDescription")),1),n.createElementVNode("p",null,n.toDisplayString(d.value),1)])):n.createCommentVNode("",!0),r.exportState.status==="loading"?(n.openBlock(),n.createBlock(T,{key:1,class:"chart-skeleton",type:"table"})):r.exportState.status==="success"?(n.openBlock(),n.createBlock(b,{key:2,class:"vitals-table",fetcher:C,"fetcher-cache-key":String(l.value),headers:p.value.headers,"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":n.withCtx(()=>[n.createVNode(P,{"action-button-visible":!1},{title:n.withCtx(()=>[n.createElementVNode("h5",null,n.toDisplayString(n.unref(t).t("csvExport.noDataRange")),1)]),default:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(n.unref(t).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):r.exportState.status==="error"?(n.openBlock(),n.createBlock(P,{key:3,"action-button-visible":!1},{title:n.withCtx(()=>[n.createElementVNode("h5",null,n.toDisplayString(n.unref(t).t("csvExport.dataError")),1)]),_:1})):n.createCommentVNode("",!0),r.exportState.status==="success"&&c.value?(n.openBlock(),n.createElementBlock("div",dl,[n.createTextVNode(n.toDisplayString(h.value)+" ",1),n.createVNode(E,{class:"preview-tooltip",placement:"right",text:n.unref(t).t("csvExport.maximumRecordAmount",{value:n.unref(re.EXPORT_RECORD_LIMIT)})},{default:n.withCtx(()=>[n.createVNode(n.unref(se.InfoIcon),{color:`var(--kui-color-text-neutral, ${n.unref(ua)})`,size:`var(--kui-icon-size-30, ${n.unref(ha)})`},null,8,["color","size"])]),_:1},8,["text"])])):n.createCommentVNode("",!0)])]),"footer-actions":n.withCtx(()=>[n.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(t).t("csvExport.cancelButton")),1)]),_:1}),n.createVNode(Oa,{class:"vitals-report-export-button",filename:a,headers:p.value.csvHeaders,rows:p.value.rows},{default:n.withCtx(()=>[n.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:r.exportState.status!=="success"||!c.value},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(t).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}});var ar=(r=>(r.VALIDATING="VALIDATING",r.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",r.PENDING="PENDING",r.SUCCESS="SUCCESS",r.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",r.ERROR="ERROR",r.STALE_IF_ERROR="STALE_IF_ERROR",r))(ar||{});const hl=r=>r?!!(Object.keys(r)?.length||r.data?.length||r.data?.data?.length||!r.data?.data&&typeof r.data=="object"&&Object.keys(r?.data).length):!1;function lr(r=n.ref({}),e,t,i=hl){const s=n.ref("PENDING");return n.watchEffect(()=>{const o=i(r.value);if(r.value&&o&&t.value){s.value="VALIDATING_HAS_DATA";return}if(r.value&&t.value){s.value="VALIDATING";return}if(r.value&&e.value){s.value="STALE_IF_ERROR";return}if(r.value===void 0&&!e.value){s.value="PENDING";return}if(r.value&&!e.value&&o){s.value="SUCCESS_HAS_DATA";return}if(r.value&&!e.value){s.value="SUCCESS";return}r.value===void 0&&e&&(s.value="ERROR")}),{state:s,swrvState:ar}}const Be=n.defineComponent({__name:"QueryDataProvider",props:{context:{},limitOverride:{},query:{},queryReady:{type:Boolean},refreshCounter:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),{issueQuery:o}=ue.useIssueQuery(),a=n.inject(Ie),l=()=>t.queryReady&&a?JSON.stringify([t.query,t.context,t.refreshCounter]):null,{data:u,error:c,isValidating:d}=si(l,async E=>{try{const D=await o(t.query,t.context,t.limitOverride);return l()!==E?void 0:(C.value=null,{key:E,result:D})}catch(D){if(l()!==E)return;throw C.value=Re.handleQueryError(D),D}finally{l()===E&&i("query-complete")}},{refreshInterval:t.context.refreshInterval,revalidateOnFocus:!1,shouldRetryOnError:!1}),h=n.computed(()=>u.value?.result),{state:f,swrvState:p}=lr(u,c,d),C=n.ref(null),O=n.computed(()=>f.value===p.ERROR||!!C.value),R=n.computed(()=>!t.queryReady||f.value===p.PENDING),T=n.ref(),P=n.computed(()=>h.value??(t.queryReady&&f.value===p.PENDING?T.value:void 0)),b=n.computed(()=>!!P.value&&u.value?.key!==l());return n.watch([()=>h.value,()=>f.value],([E,D])=>{E&&(D==="SUCCESS_HAS_DATA"||D==="SUCCESS")&&E!==T.value&&(T.value=E,i("chart-data",E))},{immediate:!0}),(E,D)=>{const x=n.resolveComponent("KSkeleton"),K=n.resolveComponent("KEmptyState");return(R.value||!h.value&&!O.value)&&!P.value?(n.openBlock(),n.createBlock(x,{key:0,class:"chart-skeleton",type:"table"})):O.value&&!R.value?(n.openBlock(),n.createBlock(K,{key:1,"action-button-visible":!1,"data-testid":"chart-empty-state"},n.createSlots({icon:n.withCtx(()=>[C.value?.type==="forbidden"?(n.openBlock(),n.createBlock(n.unref(se.VisibilityOffIcon),{key:0})):(n.openBlock(),n.createBlock(n.unref(se.WarningOutlineIcon),{key:1}))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(C.value?.message||n.unref(s).t("renderer.unexpectedError")),1)]),_:2},[C.value?.details?{name:"default",fn:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(C.value.details),1)]),key:"0"}:void 0]),1024)):P.value?(n.openBlock(),n.createBlock(n.unref(Re.LoadingOverlay),{key:2,loading:b.value},{default:n.withCtx(()=>[n.renderSlot(E.$slots,"default",{data:P.value})]),_:3},8,["loading"])):n.createCommentVNode("",!0)}}}),fl=n.defineComponent({__name:"SimpleChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{},fitToContent:{type:Boolean}},setup(r){const e=r,t=n.computed(()=>e.chartOptions.type==="single_value"),i=n.computed(()=>e.chartOptions.type==="single_value"?{...e.chartOptions,alignX:e.chartOptions.align_x??"left",showTrend:e.query.granularity==="trend",compact:!!e.fitToContent,hideMetricName:!e.chartOptions.chart_title}:e.chartOptions);return(s,o)=>(n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},{default:n.withCtx(({data:a})=>[n.createElementVNode("div",{class:n.normalizeClass(["analytics-chart",{"single-value":t.value,compact:t.value&&r.fitToContent}]),style:n.normalizeStyle(t.value?void 0:{height:`${r.height}px`})},[n.createVNode(n.unref(Re.SimpleChart),{"chart-data":a,"chart-options":i.value,"synthetics-data-key":t.value?void 0:r.chartOptions.synthetics_data_key},null,8,["chart-data","chart-options","synthetics-data-key"])],6)]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),ke=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},cr=ke(fl,[["__scopeId","data-v-df5d87ad"]]),ml={class:"analytics-chart"},Yt=ke(n.defineComponent({__name:"BaseAnalyticsChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{},extraProps:{}},emits:["edit-tile","chart-data","zoom-time-range","view-requests","select-chart-range"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),o=n.computed(()=>({type:t.chartOptions.type,stacked:t.chartOptions.stacked??!1,chartDatasetColors:t.chartOptions.chart_dataset_colors,threshold:t.chartOptions.threshold,metricAxisMap:t.chartOptions.metric_axis_map,yAxes:t.chartOptions.y_axes&&{left:a(t.chartOptions.y_axes.left),right:a(t.chartOptions.y_axes.right)},hideTruncationWarning:t.query.limit!==void 0&&t.query.limit>0})),a=c=>c&&{title:c.title,showGrid:c.show_grid},l=()=>{i("edit-tile")},u=c=>{i("chart-data",c)};return(c,d)=>{const h=n.resolveComponent("KDropdownItem");return n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:u},{default:n.withCtx(({data:f})=>[n.createElementVNode("div",ml,[n.createVNode(n.unref(Re.AnalyticsChart),n.mergeProps({"active-metric":r.activeMetric,"chart-data":f,"chart-options":o.value,"explore-link":r.exploreLink,"legend-position":"bottom","requests-link":r.requestsLink,"synthetics-data-key":r.chartOptions.synthetics_data_key,"timeseries-zoom":r.zoomConfiguration?.showZoomInAction,"tooltip-title":""},r.extraProps,{onSelectChartRange:d[0]||(d[0]=p=>i("select-chart-range",p)),onZoomTimeRange:d[1]||(d[1]=p=>i("zoom-time-range",p))}),n.createSlots({_:2},[r.context.editable?{name:"menu-items",fn:n.withCtx(()=>[n.createVNode(h,{onClick:l},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.edit")),1)]),_:1})]),key:"0"}:void 0]),1040,["active-metric","chart-data","chart-options","explore-link","requests-link","synthetics-data-key","timeseries-zoom"])])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-5e3d0a14"]]),ur=n.defineComponent({__name:"BarChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},setup(r){return(e,t)=>(n.openBlock(),n.createBlock(Yt,{"chart-options":r.chartOptions,context:r.context,"extra-props":{showAnnotations:!1},height:r.height,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),pl={class:"analytics-chart"},gl={key:3,class:"analytics-chart"},_l=ke(n.defineComponent({__name:"ScatterChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),{issueRequestsQuery:o}=ue.useIssueRequestsQuery(),a=n.computed(()=>t.query.datasource==="requests"),l=n.computed(()=>{const x=t.query,K=x.time_range??t.context.timeSpec,g=K?$t(K):void 0;if(!g)return x;const m=re.finestGranularityForDuration(g);let _;return x.granularity&&re.Granularities[x.granularity]>=re.Granularities[m]?_=x.granularity:_=m,{...x,granularity:_}}),u=()=>a.value&&t.queryReady?JSON.stringify([t.query,t.context,t.refreshCounter]):null,c=n.ref(null),{data:d,error:h,isValidating:f}=si(u,async x=>{const K=t.query;try{const g=await o(K,t.context);return u()!==x?void 0:(c.value=null,{key:x,result:Re.requestsToScatterData(g,Za(K))})}catch(g){if(u()!==x)return;throw c.value=Re.handleQueryError(g),g}finally{u()===x&&i("query-complete")}},{refreshInterval:t.context.refreshInterval,revalidateOnFocus:!1,shouldRetryOnError:!1}),p=n.computed(()=>d.value?.result),{state:C,swrvState:O}=lr(d,h,f),R=n.ref(),T=n.computed(()=>p.value??R.value);n.watch(p,x=>{x&&(R.value=x)});const P=n.computed(()=>C.value===O.ERROR||!!c.value),b=n.computed(()=>!P.value&&(!t.queryReady||C.value===O.PENDING)&&!T.value),E=n.computed(()=>!!T.value&&d.value?.key!==u()),D=n.computed(()=>({type:"scatter",chartDatasetColors:t.chartOptions.chart_dataset_colors,scatter:{percentileLines:t.chartOptions.percentile_lines?.map(x=>({percentile:x.percentile,label:x.label,borderDash:x.border_dash,color:x.color})),outlierPercentile:t.chartOptions.outlier_percentile,shadeOutlierRegion:t.chartOptions.shade_outlier_region,jitterMs:t.chartOptions.jitter_ms,pointRadius:t.chartOptions.point_radius,pointOpacity:t.chartOptions.point_opacity}}));return(x,K)=>{const g=n.resolveComponent("KSkeleton"),m=n.resolveComponent("KEmptyState");return a.value?b.value?(n.openBlock(),n.createBlock(g,{key:1,class:"chart-skeleton",type:"table"})):P.value?(n.openBlock(),n.createBlock(m,{key:2,"action-button-visible":!1,"data-testid":"scatter-chart-empty-state"},n.createSlots({icon:n.withCtx(()=>[c.value?.type==="forbidden"?(n.openBlock(),n.createBlock(n.unref(se.VisibilityOffIcon),{key:0})):(n.openBlock(),n.createBlock(n.unref(se.WarningOutlineIcon),{key:1}))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(c.value?.message||n.unref(s).t("renderer.unexpectedError")),1)]),_:2},[c.value?.details?{name:"default",fn:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(c.value.details),1)]),key:"0"}:void 0]),1024)):T.value?(n.openBlock(),n.createElementBlock("div",gl,[n.createVNode(n.unref(Re.AnalyticsChart),{"chart-data":T.value,"chart-options":D.value,"legend-position":"bottom",loading:E.value,"synthetics-data-key":r.chartOptions.synthetics_data_key,"tooltip-title":""},null,8,["chart-data","chart-options","loading","synthetics-data-key"])])):n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Be,{key:0,context:r.context,query:l.value,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:K[0]||(K[0]=_=>i("chart-data",_)),onQueryComplete:K[1]||(K[1]=_=>i("query-complete"))},{default:n.withCtx(({data:_})=>[n.createElementVNode("div",pl,[n.createVNode(n.unref(Re.AnalyticsChart),{"chart-data":_,"chart-options":D.value,"legend-position":"bottom","synthetics-data-key":r.chartOptions.synthetics_data_key,"tooltip-title":""},null,8,["chart-data","chart-options","synthetics-data-key"])])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}}),[["__scopeId","data-v-f6f628be"]]),dr=n.defineComponent({__name:"TimeseriesChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["zoom-time-range","select-chart-range"],setup(r,{emit:e}){const t=e;return(i,s)=>(n.openBlock(),n.createBlock(Yt,{"active-metric":r.activeMetric,"chart-options":r.chartOptions,context:r.context,"explore-link":r.exploreLink,height:r.height,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,"requests-link":r.requestsLink,"zoom-configuration":r.zoomConfiguration,onSelectChartRange:s[0]||(s[0]=o=>t("select-chart-range",o)),onZoomTimeRange:s[1]||(s[1]=o=>t("zoom-time-range",o))},null,8,["active-metric","chart-options","context","explore-link","height","query","query-ready","refresh-counter","requests-link","zoom-configuration"]))}}),yl=ke(n.defineComponent({__name:"GoldenSignalsRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},setup(r){const e=r,t=n.computed(()=>{const s=e.query?.datasource;if(s&&s!=="api_usage"&&s!=="basic")throw new Error(`Invalid datasource value: ${s}`);return{datasource:e.query?.datasource,overrideTimeRange:e.context.timeSpec,additionalFilter:e.context.filters,longCardTitles:e.chartOptions.long_card_titles,percentileLatency:e.chartOptions.percentile_latency,refreshInterval:e.context.refreshInterval,queryReady:e.queryReady,refreshCounter:e.refreshCounter}}),i=n.computed(()=>!!(e.chartOptions.chart_title||e.headerDescription));return(s,o)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["metric-card-tile-wrapper",{titled:i.value}])},[n.createVNode(n.unref(oi.MetricsProvider),n.normalizeProps(n.guardReactiveProps(t.value)),{default:n.withCtx(()=>[n.createVNode(n.unref(oi.MetricsConsumer))]),_:1},16)],2))}}),[["__scopeId","data-v-3eda5028"]]);var nt=(r=>(r.PENDING="PENDING",r.LOADING="LOADING",r.SUCCESS="SUCCESS",r.ERROR="ERROR",r))(nt||{});const Rl=r=>!!r?.length;function Cl(r,e,t,i=Rl){const s=n.computed(()=>i(r.value)),o=n.computed(()=>{const a=r.value!==void 0,l=e.value!==void 0&&e.value!==null;return t.value?"LOADING":s.value?"SUCCESS":l?"ERROR":a?"SUCCESS":"PENDING"});return{fetchState:nt,hasData:s,state:o}}const El=({emitState:r,fetchLifecycleState:e,hasData:t})=>{n.watch(()=>({hasData:t.value,state:e.value}),({hasData:i,state:s})=>{if(s!==nt.PENDING){if(s===nt.LOADING){r({hasData:i,state:"loading"});return}if(s===nt.ERROR){r({hasData:i,state:"error"});return}r({hasData:i,state:"success"})}})},bl=({startRow:r,endRow:e})=>{const t=e-r;return{blockIndex:t>0?Math.floor(r/t):0,pageSize:t}},Ol=({startRow:r,rowsLength:e,pageSize:t,total:i,hasMore:s})=>{if(typeof i=="number")return i;if(s!==!0&&(s===!1||e<t))return r+e},wl=({fetcher:r,resetKey:e,sort:t})=>{const i=new Map,s=new Map,o=n.ref(0),a=n.ref(0),l=n.shallowRef(),u=n.shallowRef(),c=n.shallowRef(),d=n.ref(0),h=n.ref(!1);let f,p,C=t?.value?.sortColumnKey,O=t?.value?.sortColumnOrder;const R=v=>v===o.value&&f===r.value&&p===e?.value,T=(v,q)=>R(v)&&q===a.value&&C===t?.value?.sortColumnKey&&O===t?.value?.sortColumnOrder,P=v=>{if(!t)return!0;const q=t.value;return!q?.sortColumnKey||!q.sortColumnOrder?v.length===0:v.length===1&&v[0].colId===q.sortColumnKey&&v[0].sort===q.sortColumnOrder},b=()=>{h.value=d.value>0},E=()=>{a.value+=1,C=t?.value?.sortColumnKey,O=t?.value?.sortColumnOrder;for(const v of s.values())v.resolve(!1);i.clear(),s.clear(),u.value=void 0,c.value=void 0,d.value=0,b()},D=()=>{c.value=void 0,d.value+=1,b()},x=()=>{d.value=Math.max(0,d.value-1),b()},K=v=>{const q=s.get(v);if(q)return q;let V;const W={promise:new Promise(w=>{V=w}),resolve:w=>V(w)};return s.set(v,W),W},g=(v,q)=>{q.resolve(!1),s.get(v)===q&&s.delete(v)},m=async({blockIndex:v,currentBlockCompletion:q,datasourceId:V,requestGeneration:W})=>{if(v===0)return"ready";const w=s.get(v-1);if(!w)return g(v,q),"failed";const S=await w.promise;return T(V,W)?S?"ready":(g(v,q),"failed"):(g(v,q),"stale")},_=({blockIndex:v,currentBlockCompletion:q,getRowsParams:V,pageSize:W,result:w})=>{w.cursor!==void 0&&i.set(v,w.cursor),V.successCallback(w.data,Ol({startRow:V.startRow,rowsLength:w.data.length,pageSize:W,total:w.total,hasMore:w.hasMore})),V.startRow===0&&(u.value=w.data),q.resolve(!0)},U=({blockIndex:v,currentBlockCompletion:q,fetchError:V,getRowsParams:W})=>{c.value=V,W.failCallback(),g(v,q)},A=()=>{const v=r.value;if(!v)throw new Error("TableDataGrid requires a fetcher in infinite mode");f=v,p=e?.value;const q=o.value+1;return o.value=q,E(),{async getRows(V){if(!R(q)||!P(V.sortModel)){V.failCallback();return}const{blockIndex:W,pageSize:w}=bl({startRow:V.startRow,endRow:V.endRow});W===0&&s.has(0)&&E();const S=a.value,G=K(W);if(await m({blockIndex:W,currentBlockCompletion:G,datasourceId:q,requestGeneration:S})!=="ready"||!T(q,S)){V.failCallback(),g(W,G);return}D();try{const M=W>0?i.get(W-1):void 0,k=await v({mode:"infinite",pageSize:w,cursor:M,sort:t?.value});if(!T(q,S)){V.failCallback(),g(W,G);return}_({blockIndex:W,currentBlockCompletion:G,getRowsParams:V,pageSize:w,result:k})}catch(M){if(!T(q,S)){V.failCallback(),g(W,G);return}U({blockIndex:W,currentBlockCompletion:G,fetchError:M,getRowsParams:V})}finally{T(q,S)&&x()}}}},F=()=>{l.value=A()};return n.watch([r,()=>e?.value],()=>{F()},{immediate:!0}),n.watch([()=>t?.value?.sortColumnKey,()=>t?.value?.sortColumnOrder],()=>E()),{datasource:n.readonly(l),data:n.shallowReadonly(u),error:n.readonly(c),isFetching:n.readonly(h)}},Tl={title:"No Data",message:"There is no data to display."},vl={title:"An error occurred",message:"Data cannot be displayed due to an error."},Sl={emptyState:Tl,errorState:vl};function hr(){const r=ct.createI18n("en-us",Sl);return{i18n:r,i18nT:ct.i18nTComponent(r)}}const{i18n:xl}=hr(),fr=(r,e)=>{const t=Reflect.get(e,r.key);return r.valueFormatter?r.valueFormatter(t,e):String(t??"")},yt=r=>typeof r!="number"?null:Number.isFinite(r)?r:null,Il=(r,e)=>r.reduce((t,i)=>{const s=yt(Reflect.get(i,e.key));return s===null?t:{sum:t.sum+s,max:Math.max(t.max,s)}},{sum:0,max:0}),kl=(r,e)=>{const t=(e??[]).filter(s=>Number.isFinite(s.value)&&r>=s.value);if(!t.length)return;const i=Math.max(...t.map(s=>s.value));return t.filter(s=>s.value===i).some(s=>s.type==="error")?"error":"warning"},Dl=(r,e,t)=>{if(r===null)return 0;const i=t==="relative"?e.sum:e.max;return i>0?Math.min(Math.max(r/i,0),1):0},Nl=r=>{const e=t=>xl.formatNumber(t,{maximumFractionDigits:2});return r>0&&r<.01?`< ${e(.01)} %`:`${e(r)} %`},mr=({value:r,stats:e,header:t})=>{if(r===null||e.sum<=0)return;const i=r/e.sum*100;return t.percentageFormatter?.(i)??Nl(i)},pr=(r,e)=>e!==void 0&&e.length>(r?.length??-1)?e:r,Al=({rows:r,header:e,stats:t})=>r.reduce((i,s)=>({value:pr(i.value,fr(e,s))??"",relative:e.showPercentage?pr(i.relative,mr({value:yt(Reflect.get(s,e.key)),stats:t,header:e})):void 0}),{value:""}),Ll=["data-threshold"],Ul={class:"table-data-grid-cell-label-track"},Ml={class:"table-data-grid-cell-label"},Kl={key:0,class:"table-data-grid-cell-relative","data-testid":"table-data-grid-cell-relative"},Bl={key:0,"aria-hidden":"true",class:"table-data-grid-cell-label table-data-grid-cell-label-sizer"},zl=["data-text"],Pl=["data-text"],ql=["data-threshold"],Hl=n.defineComponent({name:"TableDataGridCellRenderer",__name:"TableDataGridCellRenderer",props:{params:{}},setup(r,{expose:e}){const t=n.shallowRef(r.params),i=n.ref(null),s=n.ref(!1),o=n.computed(()=>t.value.headerDef??{key:"",label:""}),a=n.computed(()=>t.value.context?.presentation),l=n.computed(()=>t.value.context?.cells?.tooltipTarget?.value??"body"),u=n.computed(()=>t.value.valueFormatted??String(t.value.value??"")),c=n.computed(()=>t.value.value),d=n.computed(()=>yt(c.value)),h=n.computed(()=>a.value?.stats[o.value.key]),f=n.computed(()=>o.value.showPercentage&&h.value?mr({value:d.value,stats:h.value,header:o.value}):void 0),p=n.computed(()=>!!o.value.bar&&!!h.value&&(d.value!==null||c.value===null||c.value===void 0)),C=n.computed(()=>p.value&&h.value?Dl(d.value,h.value,o.value.bar)*100:0),O=n.computed(()=>p.value?a.value?.labelSizers[o.value.key]:void 0),R=n.computed(()=>o.value.thresholds?.length&&d.value!==null?kl(d.value,o.value.thresholds):void 0),T=n.computed(()=>({column:o.value,refreshCell:()=>{const _=t.value.node;_&&t.value.api.refreshCells({force:!0,rowNodes:[_]})},row:t.value.data??{},rowIndex:t.value.node?.rowIndex??0,rowValue:t.value.value,selected:t.value.node?.isSelected()??!1})),P=(_,{slots:U})=>{const A=t.value.colDef?.colId,F=t.value.context?.cells?.slots;return!A||A==="cell-icon"||!F?.[A]?U.default?.():n.h("span",{class:"table-data-grid-cell-slot-content"},n.renderSlot(F,A,T.value,()=>U.default?.()??[]))},b=()=>{const _=t.value.context?.cells?.slots;return _?.["cell-icon"]?n.renderSlot(_,"cell-icon",T.value):null};let E,D,x=!1;const K=()=>{const _=i.value;s.value=!!_&&_.scrollWidth>_.clientWidth},g=()=>{x||(D!==void 0&&cancelAnimationFrame(D),D=requestAnimationFrame(()=>{D=void 0,K()}))},m=_=>{if(E?.disconnect(),_){E?.observe(_);const U=_.closest(".ag-cell");U&&E?.observe(U)}g()};return n.onMounted(()=>{E=new ResizeObserver(g),m(i.value)}),n.watch(i,m),n.onUnmounted(()=>{x=!0,E?.disconnect(),D!==void 0&&cancelAnimationFrame(D)}),e({refresh(_){return t.value=_,n.nextTick(g),!0}}),(_,U)=>{const A=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(["table-data-grid-cell-renderer",{"table-data-grid-cell-renderer--bar":p.value,"table-data-grid-cell-renderer--percentage":!!f.value,[`table-data-grid-cell-renderer--text-${R.value}`]:!p.value&&!!R.value}]),"data-threshold":R.value},[n.createElementVNode("span",Ul,[n.createElementVNode("span",Ml,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(b))),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(P),null,{default:n.withCtx(()=>[n.createVNode(A,{class:"table-data-grid-cell-tooltip",disabled:!s.value,"kpop-attributes":{popoverDelay:400},"max-width":"300",placement:"bottom-start",target:l.value,text:u.value},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"contentElement",ref:i,class:"table-data-grid-cell-content"},n.toDisplayString(u.value),513)]),_:1},8,["disabled","target","text"])]),_:1})),f.value?(n.openBlock(),n.createElementBlock("span",Kl,"("+n.toDisplayString(f.value)+")",1)):n.createCommentVNode("",!0)]),O.value?(n.openBlock(),n.createElementBlock("span",Bl,[n.createElementVNode("span",{class:"table-data-grid-cell-sizer-value","data-text":O.value.value},null,8,zl),O.value.relative?(n.openBlock(),n.createElementBlock("span",{key:0,class:"table-data-grid-cell-sizer-relative","data-text":`(${O.value.relative})`},null,8,Pl)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),p.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"table-data-grid-cell-bar","data-testid":"table-data-grid-cell-bar","data-threshold":R.value},[n.createElementVNode("span",{class:"table-data-grid-cell-bar-fill","data-testid":"table-data-grid-cell-bar-fill",style:n.normalizeStyle({width:`${C.value}%`})},null,4)],8,ql)):n.createCommentVNode("",!0)],10,Ll)}}}),Gl=({headers:r,slots:e,initialSort:t,mode:i,rows:s,tooltipTarget:o})=>{const a=i??"infinite",l=new Set,u=p=>!!(p.showPercentage||p.bar||p.thresholds?.length);n.watch([r,()=>s?.value],()=>{r.value.forEach(p=>{if(!u(p))return;let C;if(a==="infinite"&&(p.showPercentage||p.bar)?C="percentage and bar presentation is only supported in unpaginated mode":a==="unpaginated"&&s?.value?.some(R=>{const T=Reflect.get(R,p.key);return T!=null&&yt(T)===null})&&(C="contains non-finite or nonnumeric values; numeric presentation skips those values"),!C)return;const O=`${p.key}:${C}`;l.has(O)||(l.add(O),console.warn(`[TableDataGrid] Column "${p.key}" ${C}.`))})},{immediate:!0});const c=n.computed(()=>{if(a!=="unpaginated")return{};const p=s?.value??[];return Object.fromEntries(r.value.filter(C=>C.showPercentage||C.bar).map(C=>[C.key,Il(p,C)]))}),d=n.computed(()=>{if(a!=="unpaginated")return{};const p=s?.value??[];return Object.fromEntries(r.value.filter(C=>C.bar).map(C=>[C.key,Al({rows:p,header:C,stats:c.value[C.key]})]))}),h=n.computed(()=>({cells:{slots:e,tooltipTarget:o},presentation:{stats:c.value,labelSizers:d.value}})),f=p=>{const C=t?.sortColumnKey===p.key;return{colId:p.key,flex:!p.width&&!p.maxWidth?1:void 0,headerName:p.label,maxWidth:p.maxWidth,minWidth:p.minWidth,sortable:p.sortable??!1,unSortIcon:p.showSortIcon,...C?{initialSort:t?.sortColumnOrder,initialSortIndex:0}:{},valueGetter:O=>O.data?.[p.key],valueFormatter:O=>O.data?fr(p,O.data):String(O.value??""),width:p.width,cellRenderer:Hl,cellRendererParams:{headerDef:p}}};return{columnDefs:n.computed(()=>r.value.map(f)),gridContext:h}},Xt=({config:r,headers:e,pageSize:t})=>{const i=new Set(e.filter(o=>o.sortable).map(o=>o.key)),s=r?.sortColumnKey&&i.has(r.sortColumnKey)?r.sortColumnKey:void 0;return{sortColumnKey:s,sortColumnOrder:s?r?.sortColumnOrder:void 0,pageSize:r?.pageSize??t,...r?.fitToContent!==void 0?{fitToContent:r.fitToContent}:{}}},gr=(r,e)=>r.sortColumnKey===e.sortColumnKey&&r.sortColumnOrder===e.sortColumnOrder&&r.pageSize===e.pageSize&&r.fitToContent===e.fitToContent,$l=({headers:r,pageSize:e,tableConfig:t,emitSort:i,emitTableConfigUpdate:s,onExternalConfigChange:o})=>{const a=n.computed(()=>t.value?Xt({config:t.value,headers:r.value,pageSize:e.value}):void 0),l=n.ref(a.value??Xt({config:void 0,headers:r.value,pageSize:e.value}));n.watch(a,h=>{h&&!gr(h,l.value)&&(l.value=h,o?.(h))});const u=h=>{const f=Xt({config:{...l.value,...h},headers:r.value,pageSize:e.value});gr(f,l.value)||((f.sortColumnKey!==l.value.sortColumnKey||f.sortColumnOrder!==l.value.sortColumnOrder)&&i({sortColumnKey:f.sortColumnKey,sortColumnOrder:f.sortColumnOrder}),l.value=f,s(f))};n.watch(r,()=>{t.value||u({})},{deep:!0});const c=n.computed(()=>({sortColumnKey:l.value.sortColumnKey,sortColumnOrder:l.value.sortColumnOrder})),d=n.computed(()=>t.value?.pageSize??e.value);return{activeTableConfig:n.readonly(l),activeSort:c,activePageSize:d,patchTableConfig:u}},Fl=({cellClick:r,headers:e,rowClick:t})=>{const i=n.computed(()=>new Set(e.value.filter(a=>a.disableRowClick).map(a=>a.key))),s=a=>{const l=a.event?.target;return l instanceof Element?l.closest(".ag-cell")?.getAttribute("col-id")??void 0:void 0},o=a=>{const l=s(a);return!!(l&&i.value.has(l))};return{onCellClick:a=>{const l=a.colDef.colId;!a.data||!l||r({columnKey:l,row:a.data,value:a.value})},onRowClick:a=>{a.data&&!o(a)&&t(a.data,a)}}},Wl=({activeSort:r,patchTableConfig:e})=>{const t=(i,s)=>{i.applyColumnState({state:s.sortColumnKey?[{colId:s.sortColumnKey,sort:s.sortColumnOrder??null,sortIndex:0}]:[],defaultState:{sort:null,sortIndex:null}})};return{onSortChanged:i=>{const s=i.api.getColumnState().filter(l=>l.sort).sort((l,u)=>(l.sortIndex??0)-(u.sortIndex??0)),o=s[s.length-1],a=o?{sortColumnKey:o.colId,sortColumnOrder:o.sort}:{sortColumnKey:void 0,sortColumnOrder:void 0};(a.sortColumnKey!==r.value.sortColumnKey||a.sortColumnOrder!==r.value.sortColumnOrder)&&e(a),s.length>1&&t(i.api,a)},applySortToGrid:t}},Vl={key:0,class:"table-error-state","data-testid":"table-error-state"},Yl={key:1,class:"table-empty-state","data-testid":"table-empty-state"},Xl=n.defineComponent({__name:"TableDataGrid",props:{headers:{},error:{type:Boolean,default:!1},tableConfig:{},fetcher:{type:Function},mode:{},pageSize:{default:25},refreshKey:{type:[String,Number,Boolean]},rows:{}},emits:["grid:ready","state","row:click","cell:click","sort","update:tableConfig"],setup(r,{emit:e}){je.ModuleRegistry.registerModules([je.AllCommunityModule,je.ClientSideRowModelModule,je.InfiniteRowModelModule]);const t=r.mode??"infinite",i=e,{i18n:s}=hr(),{t:o}=s,a=n.useSlots(),l=n.shallowRef(),u=n.useTemplateRef("rootElement"),c=n.shallowRef("body"),d=()=>{const k=document.fullscreenElement;c.value=k instanceof HTMLElement&&k.contains(u.value??null)?k:"body"};n.onMounted(()=>{d(),document.addEventListener("fullscreenchange",d)}),n.onBeforeUnmount(()=>{document.removeEventListener("fullscreenchange",d)});const{activeTableConfig:h,activeSort:f,activePageSize:p,patchTableConfig:C}=$l({headers:n.toRef(()=>r.headers),pageSize:n.toRef(()=>r.pageSize),tableConfig:n.toRef(()=>r.tableConfig),emitSort:k=>i("sort",k),emitTableConfigUpdate:k=>i("update:tableConfig",k),onExternalConfigChange:k=>{l.value&&R(l.value,k)}}),{onSortChanged:O,applySortToGrid:R}=Wl({activeSort:f,patchTableConfig:C}),T=n.computed(()=>t==="unpaginated"&&!!h.value.fitToContent),P=je.themeQuartz.withParams({autoHeightMinBodyHeight:0}),{onCellClick:b,onRowClick:E}=Fl({cellClick:k=>i("cell:click",k),headers:n.toRef(()=>r.headers),rowClick:(k,N)=>i("row:click",k,N)}),D={resizable:!1,sortable:!1,suppressMovable:!0},x=n.computed(()=>[p.value,r.refreshKey]),K=t==="infinite"?wl({fetcher:n.toRef(()=>r.fetcher),resetKey:x,sort:f}):void 0,g=K?.datasource,m=n.computed(()=>K?K.data.value:r.rows),_=n.computed(()=>K?.isFetching.value??!1),U=n.computed(()=>r.rows?Array.from(r.rows):void 0),{columnDefs:A,gridContext:F}=Gl({headers:n.toRef(()=>r.headers),mode:t,rows:U,slots:a,tooltipTarget:c,initialSort:f.value}),{fetchState:v,hasData:q,state:V}=Cl(m,n.toRef(()=>K?.error.value),_),W=n.computed(()=>V.value===v.SUCCESS&&!q.value);K&&El({emitState:k=>i("state",k),fetchLifecycleState:V,hasData:q});const w=()=>{const k=l.value;if(!k||k.isDestroyed())return;const N=f.value,oe=k.getColumnState().find(ae=>ae.sort);oe?.colId===N.sortColumnKey&&(oe?.sort??void 0)===N.sortColumnOrder||R(k,N)};n.watch([l,f],w);const S=n.ref(!1),G=k=>{k.direction==="vertical"&&(S.value=k.top>0)},M=k=>{l.value=k.api,i("grid:ready",k.api)};return(k,N)=>{const oe=n.resolveComponent("KEmptyState");return n.openBlock(),n.createElementBlock("div",{ref_key:"rootElement",ref:u,class:n.normalizeClass(["kong-ui-public-table-data-grid",{"fit-to-content":T.value,"is-scrolled":S.value}]),"data-testid":"table-data-grid"},[r.error?(n.openBlock(),n.createElementBlock("div",Vl,[n.renderSlot(k.$slots,"error-state",{},()=>[n.createVNode(oe,{"icon-variant":"error",message:n.unref(o)("errorState.message"),title:n.unref(o)("errorState.title")},null,8,["message","title"])],!0)])):W.value?(n.openBlock(),n.createElementBlock("div",Yl,[n.renderSlot(k.$slots,"empty-state",{},()=>[n.createVNode(oe,{message:n.unref(o)("emptyState.message"),title:n.unref(o)("emptyState.title")},null,8,["message","title"])],!0)])):(n.openBlock(),n.createBlock(n.unref(Wr.AgGridVue),{key:2,"cache-block-size":n.unref(t)==="infinite"?n.unref(p):void 0,class:"table-data-grid-grid","column-defs":n.unref(A),context:n.unref(F),datasource:n.unref(t)==="infinite"?n.unref(g):void 0,"default-col-def":D,"dom-layout":T.value?"autoHeight":"normal","infinite-initial-row-count":n.unref(t)==="infinite"?1:void 0,loading:_.value,"row-data":n.unref(t)==="unpaginated"?U.value:void 0,"row-model-type":n.unref(t)==="unpaginated"?"clientSide":"infinite","suppress-cell-focus":!0,"suppress-multi-sort":!0,theme:n.unref(P),onBodyScroll:G,onCellClicked:n.unref(b),onGridReady:M,onNewColumnsLoaded:w,onRowClicked:n.unref(E),onSortChanged:n.unref(O)},null,8,["cache-block-size","column-defs","context","datasource","dom-layout","infinite-initial-row-count","loading","row-data","row-model-type","theme","onCellClicked","onRowClicked","onSortChanged"]))],2)}}}),jl=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},_r=jl(Xl,[["__scopeId","data-v-82e410f3"]]),yr=3,Ql={anthropic:se.AnthropicIcon,azure:se.AzureIcon,bedrock:se.AmazonBedrockIcon,cerebras:se.CerebrasIcon,cohere:se.CohereIcon,databricks:se.DatabricksIcon,deepseek:se.DeepseekIcon,gemini:se.GeminiIcon,huggingface:se.HuggingFaceIcon,llama2:se.MetaLlamaIcon,mistral:se.MistralIcon,moonshot:se.KimiIcon,nvidia:se.NvidiaIcon,ollama:se.OllamaIcon,openai:se.OpenAiIcon,vertex:se.GoogleVertexIcon,vllm:se.VllmIcon,xai:se.GrokIcon},jt=(r,e)=>{if(!r||!e)return;const t=e.toLowerCase();return r[e]??Object.entries(r).find(([i])=>i.toLowerCase()===t)?.[1]},Zl=({columnOptions:r,columnKey:e,rawValue:t})=>{if(!(jt(r,e)?.icon_set!=="ai_provider"||typeof t!="string"))return Ql[t.toLowerCase()]},Jl=r=>{if(r==null||r==="")return null;const e=typeof r=="number"?r:Number(r);return Number.isFinite(e)?e:null},ec=r=>r.toLocaleLowerCase().endsWith("count"),tc=r=>{const e=Object.keys(r?.meta?.display??{}).slice(0,yr),t=r?.meta?.metric_names??[];return(r?.data??[]).map(i=>{const s={record:i};return e.forEach(o=>{s[o]=i.event[o]}),t.forEach(o=>{s[o]=Jl(i.event[o])}),s})},ic=({data:r,columnOptions:e,i18n:t,fieldTranslationMap:i})=>{const{formatUnit:s}=re.unitFormatter({i18n:t}),o=r?.data??[],a=r?.meta,l=a?.display??{},u=Object.keys(l).slice(0,yr),c=a?.metric_names??[],d=c[0],h=u.length>1,f=E=>nr(t,i,E),p=(E,D)=>jt(e,E)?.label||D,C=(E,D)=>{if(ec(E)||E==="requests")return"";const x=D===1?"":"s",K=`chartUnits.${E}`;return t.messages[K]?t.formatMessage({id:K},{plural:x}):E},O=E=>{const D=x=>s(x,"%",{translateUnit:C});return E>0&&E<.01?`< ${D(.01)}`:D(E)},R=(E,D)=>{const x=E.event[D];if(x==null)return"–";const K=typeof x=="number"?x:Number(x);if(Number.isNaN(K))return"–";const g=a?.metric_units?.[D]||"count";return g==="%"?O(K):s(K,g,{approximate:["count","count/minute","token count"].includes(g),isBytes1024:!0,translateUnit:C})},T=(E,D)=>{const x=String(E.record.event[D]),K=l[D]?.[x];return{id:x,label:x===Re.OTHER_DIMENSION_ID?t.t("chartLabels.____OTHER____"):K?.name||"-",deleted:!!K?.deleted}},P=u.map(E=>({key:E,label:p(E,h?f(E):t.t("topNTable.nameLabel")),type:"dimension",valueFormatter:(D,x)=>T(x,E).label,sortable:!1}));c.forEach(E=>{const D=jt(e,E);P.push({key:E,label:D?.label||f(E),type:"metric",valueFormatter:(x,K)=>R(K.record,E),showPercentage:D?.value==="relative",percentageFormatter:O,bar:D?.bar==="max"?"absolute":D?.bar,thresholds:D?.thresholds,sortable:!1})});const b=o.length?a?u.some(E=>!Object.keys(l[E]||{}).length)?t.t("topNTable.errors.display"):d?"":t.t("topNTable.errors.metricNames"):t.t("topNTable.errors.meta"):"";return{headers:P,errorMessage:b,getDimension:T}},rc={class:"fallback-entity-link","data-testid":"entity-link-parent"},Rr=n.defineComponent({__name:"FallbackEntityLink",props:{entityLinkData:{}},setup(r){return(e,t)=>(n.openBlock(),n.createElementBlock("div",rc,n.toDisplayString(r.entityLinkData.label),1))}}),nc=["data-testid"],sc={key:1},oc=ke(n.defineComponent({__name:"TopNDataGrid",props:{chartOptions:{},data:{},fitToContent:{type:Boolean,default:!1},height:{}},setup(r){const e=n.inject(Ie),t=Se.useDatasourceConfigStore(),{i18n:i}=ue.useI18n(),s=n.computed(()=>tc(r.data)),o=n.computed(()=>ic({data:r.data,columnOptions:r.chartOptions.column_options,i18n:i,fieldTranslationMap:t.fieldTranslationMap})),a=n.computed(()=>o.value.headers.map(R=>({...R,minWidth:R.type==="dimension"?160:R.bar?260:140}))),l=n.computed(()=>o.value.headers.filter(R=>R.type==="dimension")),u=n.computed(()=>({fitToContent:r.fitToContent})),c=n.computed(()=>r.fitToContent?{height:"auto"}:r.height===void 0?void 0:{height:`${r.height}px`}),d=(R,T)=>Zl({columnOptions:r.chartOptions.column_options,columnKey:R,rawValue:T}),h=n.defineAsyncComponent(async()=>{if(e?.fetchComponent)try{return await e.fetchComponent("EntityLink")}catch{return Rr}return Rr}),f=R=>{const T=r.chartOptions.entity_links;return T&&(T[R]||Object.entries(T).find(([P])=>P.toLowerCase()===R.toLowerCase())?.[1])||""},p=R=>f(R)||l.value[0]?.key===R&&r.chartOptions.entity_link||"",C=(R,T)=>R[T]!=="empty"&&R[T]!==Re.OTHER_DIMENSION_ID,O=(R,T)=>{const P=p(T),b=String(R[T]);if(b.includes(":")){const[E,D]=b.split(":");return P.replace($i,E).replace(Pt,D)}return P.replace(Pt,b)};return(R,T)=>{const P=n.resolveComponent("KEmptyState");return n.openBlock(),n.createElementBlock("div",{class:"top-n-data-grid","data-testid":s.value.length?"top-n-table":void 0,style:n.normalizeStyle(c.value)},[n.createVNode(n.unref(_r),{error:!!o.value.errorMessage,headers:a.value,mode:"unpaginated",rows:s.value,"table-config":u.value},n.createSlots({"error-state":n.withCtx(()=>[n.createVNode(P,{"action-button-visible":!1,"data-testid":"chart-empty-state"},{icon:n.withCtx(()=>[n.createVNode(n.unref(se.WarningOutlineIcon))]),title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(o.value.errorMessage),1)]),_:1})]),"empty-state":n.withCtx(()=>[n.createVNode(P,{"action-button-visible":!1,"data-testid":"top-n-empty-state",title:n.unref(i).t("topNTable.defaultEmptyStateTitle")},null,8,["title"])]),"cell-icon":n.withCtx(({column:b,rowValue:E})=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d(b.key,E)),{class:"top-n-provider-icon","data-testid":"top-n-provider-icon",decorative:"",size:"var(--kui-icon-size-30, 16px)"}))]),_:2},[n.renderList(l.value,b=>({name:b.key,fn:n.withCtx(({row:E})=>[p(b.key)&&C(E,b.key)?(n.openBlock(),n.createBlock(n.unref(h),{key:0,class:"top-n-entity-link","entity-link-data":o.value.getDimension(E,b.key),"external-link":O(E,b.key)},null,8,["entity-link-data","external-link"])):o.value.getDimension(E,b.key).label==="empty"?(n.openBlock(),n.createElementBlock("i",sc,"empty")):n.createCommentVNode("",!0)])}))]),1032,["error","headers","rows","table-config"])],12,nc)}}}),[["__scopeId","data-v-bbc29e85"]]),ac=n.defineComponent({__name:"TopNTableRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{},fitToContent:{type:Boolean}},setup(r){return(e,t)=>(n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},{default:n.withCtx(({data:i})=>[n.createVNode(oc,{"chart-options":r.chartOptions,data:i,"fit-to-content":r.fitToContent,height:r.height},null,8,["chart-options","data","fit-to-content","height"])]),_:1},8,["context","query","query-ready","refresh-counter"]))}}),lc=n.defineComponent({__name:"TopTalkersRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["query-complete"],setup(r,{emit:e}){const t=r,i=e,s=n.computed(()=>t.chartOptions.columns.map(c=>({dimension:c.dimension,label:c.label}))),o=c=>({...t.query,dimensions:[c.dimension],filters:[...t.query.filters??[],...c.filters??[]]}),a=n.computed(()=>new Map(s.value.map((c,d)=>[c,o(t.chartOptions.columns[d])]))),l=new Set,u=c=>{l.add(c),l.size===s.value.length&&(l.clear(),i("query-complete"))};return n.watch([a,()=>t.refreshCounter],()=>l.clear()),(c,d)=>(n.openBlock(),n.createBlock(n.unref(Re.TopTalkersGrid),{"column-options":r.chartOptions.column_options,columns:s.value,"size-metric":r.chartOptions.size_metric},{column:n.withCtx(({column:h})=>[n.createVNode(Be,{context:r.context,query:a.value.get(h),"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onQueryComplete:f=>u(h)},{default:n.withCtx(({data:f})=>[n.createVNode(n.unref(Re.TopTalkersColumn),{"column-options":r.chartOptions.column_options,data:f,dimension:h.dimension,label:h.label,"size-metric":r.chartOptions.size_metric},null,8,["column-options","data","dimension","label","size-metric"])]),_:2},1032,["context","query","query-ready","refresh-counter","onQueryComplete"])]),_:1},8,["column-options","columns","size-metric"]))}}),cc=r=>r.records.map(e=>{const t={...e};return Object.entries(e).forEach(([i,s])=>{if(s===null)return;const o=r.meta.display?.[i]?.[String(s)]?.name;o&&(t[i]=o)}),t}),Cr=({columns:r,fieldLabel:e})=>r.map(t=>({key:t,label:e(t)})),uc={platform:Cr,platform_usage:Cr},Er=async({abortController:r,context:e,cursor:t,pageSize:i,query:s,onResponseColumns:o,stripUnknownFilters:a,tabularQueryFn:l})=>{if(!l)throw new Error("AnalyticsBridge.tabularQueryFn is not defined");const u=s.query,c=a({datasource:s.datasource,filters:[...u.filters??[],...e.filters],queryFields:u.entity===void 0?void 0:[u.entity]}),d=await l({datasource:s.datasource,query:{columns:u.columns,cursor:t===void 0?u.cursor:String(t),entity:u.entity,filters:c,page_size:i}},r);return d.meta.columns?.length&&o?.(d.meta.columns),{data:cc(d),cursor:d.meta.cursor,hasMore:!!d.meta.cursor}},dc={platform:Er,platform_usage:Er},hc=ke(n.defineComponent({__name:"TableDataGridRenderer",props:{query:{},context:{},queryReady:{type:Boolean},height:{},refreshCounter:{}},emits:["loading-change"],setup(r,{emit:e}){const t=r,i=e,s=n.inject(Ie),o=Se.useDatasourceConfigStore(),a=ue.useFieldLabel(),l=new AbortController,u=n.ref([]),c=n.ref(!1),d=n.computed(()=>t.height===void 0?void 0:{height:`${t.height}px`}),h=n.computed(()=>({datasource:t.query.datasource,query:{columns:t.query.columns,cursor:t.query.cursor,entity:t.query.entity,filters:t.query.filters,page_size:t.query.page_size}})),f=n.computed(()=>JSON.stringify({refreshCounter:t.refreshCounter,query:{columns:t.query.columns,datasource:t.query.datasource,entity:t.query.entity,filters:t.query.filters,page_size:t.query.page_size},context:{filters:t.context.filters,timeSpec:t.context.timeSpec,tz:t.context.tz}}));n.onUnmounted(()=>{l.abort()});const p=n.computed(()=>uc[t.query.datasource]({columns:t.query.columns?.length?t.query.columns:u.value,fieldLabel:R=>a(R)})),C=n.computed(()=>async({cursor:R,pageSize:T})=>{try{await o.isReady();const P=dc[h.value.datasource];if(!P)throw new Error(`No table data grid fetcher found for datasource: ${h.value.datasource}`);const b=await P({abortController:l,context:t.context,cursor:R,pageSize:T,query:h.value,onResponseColumns:E=>{u.value=E},stripUnknownFilters:o.stripUnknownFilters,tabularQueryFn:s?.tabularQueryFn});return c.value=!1,b}catch(P){throw c.value=!0,P}}),O=R=>{R.state==="error"&&(c.value=!0),i("loading-change",R.state==="loading")};return(R,T)=>{const P=n.resolveComponent("KSkeleton");return n.openBlock(),n.createElementBlock("div",{class:"table-data-grid-renderer",style:n.normalizeStyle(d.value)},[r.queryReady?(n.openBlock(),n.createBlock(n.unref(_r),{key:1,error:c.value,fetcher:C.value,headers:p.value,"page-size":r.query.page_size,"refresh-key":f.value,onState:O},null,8,["error","fetcher","headers","page-size","refresh-key"])):(n.openBlock(),n.createBlock(P,{key:0,"data-testid":"table-skeleton",type:"table"}))],4)}}}),[["__scopeId","data-v-c8caabc2"]]),fc=n.defineComponent({__name:"DonutChartRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},setup(r){return(e,t)=>(n.openBlock(),n.createBlock(Yt,{"chart-options":r.chartOptions,context:r.context,height:r.height,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter},null,8,["chart-options","context","height","query","query-ready","refresh-counter"]))}}),br="#ffffff",mc="#0044f4",pc="#d60027",gc="#ad000e",_c="#850000",yc="#5c0000",Rc="#ff3954",Cc="#ffabab",Ec="#ffe5e5",bc="#ecfcff",Oc="#6f28ff",wc="#f1f0ff",Tc="#e0e4ea",vc="#0044f4",Sc="#0030cc",xc="#002099",Ic="#001466",kc="#5f9aff",Dc="#bee2ff",Nc="#eefaff",Ac="#0d0e14",Lc="#6c7489",Uc="#52596e",Mc="#3a3f51",Kc="#232633",Bc="#afb7c5",zc="#e0e4ea",Pc="#f9fafb",qc="rgba(13, 14, 20, 0.6)",Hc="#0044f4",Gc="#0030cc",$c="#002099",Fc="#001466",Wc="#5f9aff",Vc="#bee2ff",Yc="#eefaff",Xc="#007d60",jc="#005944",Qc="#004737",Zc="#003629",Jc="#00d6a4",eu="#b5ffee",tu="#ecfffb",iu="rgba(0, 0, 0, 0)",ru="#995c00",nu="#804400",su="#662d00",ou="#4d1b00",au="#ffc400",lu="#fff296",cu="#fffce0",Or="#e0e4ea",uu="#0044f4",du="#d60027",hu="#ad000e",fu="#850000",mu="#5c0000",pu="#ff3954",gu="#ffabab",_u="#ffe5e5",yu="#6f28ff",Ru="#e0e4ea",Cu="rgba(255, 255, 255, 0.2)",Eu="#6c7489",bu="#52596e",Ou="#3a3f51",wu="#232633",Tu="#afb7c5",vu="#e0e4ea",Su="#f9fafb",xu="#0044f4",Iu="#0030cc",ku="#002099",Du="#001466",Nu="#5f9aff",Au="#bee2ff",Lu="#eefaff",Uu="rgba(0, 0, 0, 0)",Mu="#0044f4",Ku="#0d0e14",Bu="#0044f4",zu="#d60027",Pu="#ad000e",qu="#850000",Hu="#5c0000",Gu="#ff3954",$u="#ffabab",Fu="#ffe5e5",Wu="#00abd2",Vu="#d60067",Yu="#6f28ff",Xu="#5e00f5",ju="#afb7c5",Qu="#0044f4",Zu="#0030cc",Ju="#002099",ed="#001466",td="#5f9aff",id="#bee2ff",rd="#eefaff",nd="#ffffff",sd="#6c7489",od="#52596e",ad="#3a3f51",ld="#232633",cd="#afb7c5",ud="#e0e4ea",dd="#f9fafb",hd="#0044f4",fd="#0030cc",md="#002099",pd="#001466",gd="#5f9aff",_d="#bee2ff",yd="#eefaff",Rd="#007d60",Cd="#005944",Ed="#004737",bd="#003629",Od="#00d6a4",wd="#b5ffee",Td="#ecfffb",vd="#995c00",Sd="#804400",xd="#662d00",Id="#4d1b00",kd="#ffc400",Dd="#fff296",Nd="#fffce0",Ad="0.2s",Ld="0px",Ud="2px",Md="4px",wr="6px",Kd="8px",Bd="10px",zd="12px",Pd="16px",qd="20px",Hd="24px",Gd="32px",$d="50%",Fd="100px",Wd="0px",Tr="1px",Vd="2px",Yd="4px",Xd="640px",jd="768px",Qd="1024px",Zd="1280px",Jd="1536px",eh="'JetBrains Mono', Consolas, monospace",th="'Inter', Roboto, Helvetica, sans-serif",Qt="'Inter', Roboto, Helvetica, sans-serif",ih="10px",rh="12px",nh="14px",sh="16px",oh="18px",ah="20px",lh="24px",ch="32px",uh="40px",dh="48px",hh="700",fh="500",mh="400",ph="600",gh="#f50045",_h="#828a9e",yh="#306fff",Rh="#00a17b",Ch="#ffc400",Eh="10px",bh="12px",Oh="16px",wh="20px",Th="24px",vh="32px",Sh="40px",xh="48px",Ih="normal",kh="-0.12px",Dh="-0.24px",Nh="-0.32px",Ah="-0.4px",Lh="-0.48px",Uh="normal",Mh="12px",Kh="16px",Bh="20px",zh="24px",Ph="28px",qh="32px",Hh="36px",Gh="40px",$h="48px",Fh="56px",Wh="#f1f0ff",Vh="#ffe5e5",Yh="#eefaff",Xh="#52596e",jh="#e0e4ea",Qh="#ecfcff",Zh="#ecfffb",Jh="#fffce0",ef="#fff0f7",tf="#6f28ff",rf="#5e00f5",nf="#d60027",sf="#ad000e",of="#0044f4",af="#0030cc",lf="#e0e4ea",cf="#afb7c5",uf="#52596e",df="#3a3f51",hf="#00819d",ff="#00647a",mf="#007d60",pf="#005944",gf="#995c00",_f="#804400",yf="#d60067",Rf="#ad0053",Cf="#000933",Ef="rgba(255, 255, 255, 0.12)",bf="rgba(255, 255, 255, 0.12)",Of="#00fabe",wf="rgba(255, 255, 255, 0.24)",Tf="#bee2ff",vf="#ffffff",Sf="#eefaff",xf="#00fabe",If="0 0 0 1px rgba(255, 255, 255, 0.12) inset",kf="4px 0 0 0 #00fabe inset",Df="0 0 0 1px rgba(255, 255, 255, 0.60) inset",vr="0px 4px 20px 0px rgba(0, 0, 0, 0.08)",Nf="0px 0px 0px 1px #e0e4ea inset",Af="0px 0px 0px 1px #d60027 inset",Lf="0px 0px 0px 1px #ad000e inset",Uf="0px 0px 0px 1px #e0e4ea inset",Mf="0px 0px 0px 1px #0044f4 inset",Kf="0px 0px 0px 1px #001466 inset",Bf="0px 0px 0px 1px #5f9aff inset",zf="0px 0px 0px 4px rgba(0, 68, 244, 0.2)",Pf="0px",qf="2px",Hf="4px",Gf="6px",$f="8px",Ff="12px",Wf="16px",Vf="20px",Yf="24px",Xf="32px",jf="40px",Qf="48px",Zf="56px",Jf="64px",em="80px",tm="96px",im="auto",rm="#bee2ff",nm="#8fc1ff",sm="#5f9aff",om="#306fff",am="#b5ffee",lm="#00fabe",cm="#00d6a4",um="#00a17b",dm="#007d60",hm="#005944",fm="#b5ffee",mm="#00fabe",pm="#b5ffee",gm="#00a17b",_m="#fff296",ym="#ffe04b",Rm="#ffc400",Cm="#b37600",Em="#995c00",bm="#804400",Om="#fff296",wm="#ffe04b",Tm="#ffc2b3",vm="#ff9877",Sm="#ff723c",xm="#f75008",Im="#d13500",km="#a31f00",Dm="#ffc2b3",Nm="#ff9877",Am="#ff723c",Lm="#f75008",Um="#d13500",Mm="#a31f00",Km="#ffc2b3",Bm="#ff9877",zm="#ff723c",Pm="#f75008",qm="#d13500",Hm="#a31f00",Gm="#ffc2b3",$m="#ff9877",Fm="#ff723c",Wm="#f75008",Vm="#d13500",Ym="#a31f00",Xm="#ffc2b3",jm="#ff9877",Qm="#ff723c",Zm="#f75008",Jm="#d13500",ep="#ffabab",tp="#ff7272",ip="#ff3954",rp="#f50045",np="#d60027",sp="#ad000e",op="#ffabab",ap="#ff7272",lp="#ff3954",cp="#f50045",up="#d60027",dp="#eefaff",hp="#ecfffb",fp="#fffce0",mp="#fff1ef",pp="#ffe5e5",gp="#5f9aff",_p="#00d6a4",yp="#ffc400",Rp="#ff723c",Cp="#ff3954",Ep="#eefaff",bp="#ecfffb",Op="#fffce0",wp="#fff1ef",Tp="#ffe5e5",vp="#0044f4",Sp="#007d60",xp="#995c00",Ip="#d13500",kp="#d60027",Sr=Object.freeze(Object.defineProperty({__proto__:null,KUI_ANIMATION_DURATION_20:Ad,KUI_BORDER_RADIUS_0:Ld,KUI_BORDER_RADIUS_10:Ud,KUI_BORDER_RADIUS_100:Gd,KUI_BORDER_RADIUS_20:Md,KUI_BORDER_RADIUS_30:wr,KUI_BORDER_RADIUS_40:Kd,KUI_BORDER_RADIUS_50:Bd,KUI_BORDER_RADIUS_60:zd,KUI_BORDER_RADIUS_70:Pd,KUI_BORDER_RADIUS_80:qd,KUI_BORDER_RADIUS_90:Hd,KUI_BORDER_RADIUS_CIRCLE:$d,KUI_BORDER_RADIUS_ROUND:Fd,KUI_BORDER_WIDTH_0:Wd,KUI_BORDER_WIDTH_10:Tr,KUI_BORDER_WIDTH_20:Vd,KUI_BORDER_WIDTH_30:Yd,KUI_BREAKPOINT_DESKTOP:Jd,KUI_BREAKPOINT_LAPTOP:Zd,KUI_BREAKPOINT_MOBILE:Xd,KUI_BREAKPOINT_PHABLET:jd,KUI_BREAKPOINT_TABLET:Qd,KUI_COLOR_BACKGROUND:br,KUI_COLOR_BACKGROUND_ACCENT:mc,KUI_COLOR_BACKGROUND_DANGER:pc,KUI_COLOR_BACKGROUND_DANGER_STRONG:gc,KUI_COLOR_BACKGROUND_DANGER_STRONGER:_c,KUI_COLOR_BACKGROUND_DANGER_STRONGEST:yc,KUI_COLOR_BACKGROUND_DANGER_WEAK:Rc,KUI_COLOR_BACKGROUND_DANGER_WEAKER:Cc,KUI_COLOR_BACKGROUND_DANGER_WEAKEST:Ec,KUI_COLOR_BACKGROUND_DECORATIVE_AQUA_WEAKEST:bc,KUI_COLOR_BACKGROUND_DECORATIVE_PURPLE:Oc,KUI_COLOR_BACKGROUND_DECORATIVE_PURPLE_WEAKEST:wc,KUI_COLOR_BACKGROUND_DISABLED:Tc,KUI_COLOR_BACKGROUND_INFO:vc,KUI_COLOR_BACKGROUND_INFO_STRONG:Sc,KUI_COLOR_BACKGROUND_INFO_STRONGER:xc,KUI_COLOR_BACKGROUND_INFO_STRONGEST:Ic,KUI_COLOR_BACKGROUND_INFO_WEAK:kc,KUI_COLOR_BACKGROUND_INFO_WEAKER:Dc,KUI_COLOR_BACKGROUND_INFO_WEAKEST:Nc,KUI_COLOR_BACKGROUND_INVERSE:Ac,KUI_COLOR_BACKGROUND_NEUTRAL:Lc,KUI_COLOR_BACKGROUND_NEUTRAL_STRONG:Uc,KUI_COLOR_BACKGROUND_NEUTRAL_STRONGER:Mc,KUI_COLOR_BACKGROUND_NEUTRAL_STRONGEST:Kc,KUI_COLOR_BACKGROUND_NEUTRAL_WEAK:Bc,KUI_COLOR_BACKGROUND_NEUTRAL_WEAKER:zc,KUI_COLOR_BACKGROUND_NEUTRAL_WEAKEST:Pc,KUI_COLOR_BACKGROUND_OVERLAY:qc,KUI_COLOR_BACKGROUND_PRIMARY:Hc,KUI_COLOR_BACKGROUND_PRIMARY_STRONG:Gc,KUI_COLOR_BACKGROUND_PRIMARY_STRONGER:$c,KUI_COLOR_BACKGROUND_PRIMARY_STRONGEST:Fc,KUI_COLOR_BACKGROUND_PRIMARY_WEAK:Wc,KUI_COLOR_BACKGROUND_PRIMARY_WEAKER:Vc,KUI_COLOR_BACKGROUND_PRIMARY_WEAKEST:Yc,KUI_COLOR_BACKGROUND_SUCCESS:Xc,KUI_COLOR_BACKGROUND_SUCCESS_STRONG:jc,KUI_COLOR_BACKGROUND_SUCCESS_STRONGER:Qc,KUI_COLOR_BACKGROUND_SUCCESS_STRONGEST:Zc,KUI_COLOR_BACKGROUND_SUCCESS_WEAK:Jc,KUI_COLOR_BACKGROUND_SUCCESS_WEAKER:eu,KUI_COLOR_BACKGROUND_SUCCESS_WEAKEST:tu,KUI_COLOR_BACKGROUND_TRANSPARENT:iu,KUI_COLOR_BACKGROUND_WARNING:ru,KUI_COLOR_BACKGROUND_WARNING_STRONG:nu,KUI_COLOR_BACKGROUND_WARNING_STRONGER:su,KUI_COLOR_BACKGROUND_WARNING_STRONGEST:ou,KUI_COLOR_BACKGROUND_WARNING_WEAK:au,KUI_COLOR_BACKGROUND_WARNING_WEAKER:lu,KUI_COLOR_BACKGROUND_WARNING_WEAKEST:cu,KUI_COLOR_BORDER:Or,KUI_COLOR_BORDER_ACCENT:uu,KUI_COLOR_BORDER_DANGER:du,KUI_COLOR_BORDER_DANGER_STRONG:hu,KUI_COLOR_BORDER_DANGER_STRONGER:fu,KUI_COLOR_BORDER_DANGER_STRONGEST:mu,KUI_COLOR_BORDER_DANGER_WEAK:pu,KUI_COLOR_BORDER_DANGER_WEAKER:gu,KUI_COLOR_BORDER_DANGER_WEAKEST:_u,KUI_COLOR_BORDER_DECORATIVE_PURPLE:yu,KUI_COLOR_BORDER_DISABLED:Ru,KUI_COLOR_BORDER_INVERSE:Cu,KUI_COLOR_BORDER_NEUTRAL:Eu,KUI_COLOR_BORDER_NEUTRAL_STRONG:bu,KUI_COLOR_BORDER_NEUTRAL_STRONGER:Ou,KUI_COLOR_BORDER_NEUTRAL_STRONGEST:wu,KUI_COLOR_BORDER_NEUTRAL_WEAK:Tu,KUI_COLOR_BORDER_NEUTRAL_WEAKER:vu,KUI_COLOR_BORDER_NEUTRAL_WEAKEST:Su,KUI_COLOR_BORDER_PRIMARY:xu,KUI_COLOR_BORDER_PRIMARY_STRONG:Iu,KUI_COLOR_BORDER_PRIMARY_STRONGER:ku,KUI_COLOR_BORDER_PRIMARY_STRONGEST:Du,KUI_COLOR_BORDER_PRIMARY_WEAK:Nu,KUI_COLOR_BORDER_PRIMARY_WEAKER:Au,KUI_COLOR_BORDER_PRIMARY_WEAKEST:Lu,KUI_COLOR_BORDER_TRANSPARENT:Uu,KUI_COLOR_BRAND:Mu,KUI_COLOR_TEXT:Ku,KUI_COLOR_TEXT_ACCENT:Bu,KUI_COLOR_TEXT_DANGER:zu,KUI_COLOR_TEXT_DANGER_STRONG:Pu,KUI_COLOR_TEXT_DANGER_STRONGER:qu,KUI_COLOR_TEXT_DANGER_STRONGEST:Hu,KUI_COLOR_TEXT_DANGER_WEAK:Gu,KUI_COLOR_TEXT_DANGER_WEAKER:$u,KUI_COLOR_TEXT_DANGER_WEAKEST:Fu,KUI_COLOR_TEXT_DECORATIVE_AQUA:Wu,KUI_COLOR_TEXT_DECORATIVE_PINK:Vu,KUI_COLOR_TEXT_DECORATIVE_PURPLE:Yu,KUI_COLOR_TEXT_DECORATIVE_PURPLE_STRONG:Xu,KUI_COLOR_TEXT_DISABLED:ju,KUI_COLOR_TEXT_INFO:Qu,KUI_COLOR_TEXT_INFO_STRONG:Zu,KUI_COLOR_TEXT_INFO_STRONGER:Ju,KUI_COLOR_TEXT_INFO_STRONGEST:ed,KUI_COLOR_TEXT_INFO_WEAK:td,KUI_COLOR_TEXT_INFO_WEAKER:id,KUI_COLOR_TEXT_INFO_WEAKEST:rd,KUI_COLOR_TEXT_INVERSE:nd,KUI_COLOR_TEXT_NEUTRAL:sd,KUI_COLOR_TEXT_NEUTRAL_STRONG:od,KUI_COLOR_TEXT_NEUTRAL_STRONGER:ad,KUI_COLOR_TEXT_NEUTRAL_STRONGEST:ld,KUI_COLOR_TEXT_NEUTRAL_WEAK:cd,KUI_COLOR_TEXT_NEUTRAL_WEAKER:ud,KUI_COLOR_TEXT_NEUTRAL_WEAKEST:dd,KUI_COLOR_TEXT_PRIMARY:hd,KUI_COLOR_TEXT_PRIMARY_STRONG:fd,KUI_COLOR_TEXT_PRIMARY_STRONGER:md,KUI_COLOR_TEXT_PRIMARY_STRONGEST:pd,KUI_COLOR_TEXT_PRIMARY_WEAK:gd,KUI_COLOR_TEXT_PRIMARY_WEAKER:_d,KUI_COLOR_TEXT_PRIMARY_WEAKEST:yd,KUI_COLOR_TEXT_SUCCESS:Rd,KUI_COLOR_TEXT_SUCCESS_STRONG:Cd,KUI_COLOR_TEXT_SUCCESS_STRONGER:Ed,KUI_COLOR_TEXT_SUCCESS_STRONGEST:bd,KUI_COLOR_TEXT_SUCCESS_WEAK:Od,KUI_COLOR_TEXT_SUCCESS_WEAKER:wd,KUI_COLOR_TEXT_SUCCESS_WEAKEST:Td,KUI_COLOR_TEXT_WARNING:vd,KUI_COLOR_TEXT_WARNING_STRONG:Sd,KUI_COLOR_TEXT_WARNING_STRONGER:xd,KUI_COLOR_TEXT_WARNING_STRONGEST:Id,KUI_COLOR_TEXT_WARNING_WEAK:kd,KUI_COLOR_TEXT_WARNING_WEAKER:Dd,KUI_COLOR_TEXT_WARNING_WEAKEST:Nd,KUI_FONT_FAMILY_CODE:eh,KUI_FONT_FAMILY_HEADING:th,KUI_FONT_FAMILY_TEXT:Qt,KUI_FONT_SIZE_10:ih,KUI_FONT_SIZE_100:dh,KUI_FONT_SIZE_20:rh,KUI_FONT_SIZE_30:nh,KUI_FONT_SIZE_40:sh,KUI_FONT_SIZE_50:oh,KUI_FONT_SIZE_60:ah,KUI_FONT_SIZE_70:lh,KUI_FONT_SIZE_80:ch,KUI_FONT_SIZE_90:uh,KUI_FONT_WEIGHT_BOLD:hh,KUI_FONT_WEIGHT_MEDIUM:fh,KUI_FONT_WEIGHT_REGULAR:mh,KUI_FONT_WEIGHT_SEMIBOLD:ph,KUI_ICON_COLOR_DANGER:gh,KUI_ICON_COLOR_NEUTRAL:_h,KUI_ICON_COLOR_PRIMARY:yh,KUI_ICON_COLOR_SUCCESS:Rh,KUI_ICON_COLOR_WARNING:Ch,KUI_ICON_SIZE_10:Eh,KUI_ICON_SIZE_20:bh,KUI_ICON_SIZE_30:Oh,KUI_ICON_SIZE_40:wh,KUI_ICON_SIZE_50:Th,KUI_ICON_SIZE_60:vh,KUI_ICON_SIZE_70:Sh,KUI_ICON_SIZE_80:xh,KUI_LETTER_SPACING_0:Ih,KUI_LETTER_SPACING_MINUS_10:kh,KUI_LETTER_SPACING_MINUS_20:Dh,KUI_LETTER_SPACING_MINUS_30:Nh,KUI_LETTER_SPACING_MINUS_40:Ah,KUI_LETTER_SPACING_MINUS_50:Lh,KUI_LETTER_SPACING_NORMAL:Uh,KUI_LINE_HEIGHT_10:Mh,KUI_LINE_HEIGHT_100:Fh,KUI_LINE_HEIGHT_20:Kh,KUI_LINE_HEIGHT_30:Bh,KUI_LINE_HEIGHT_40:zh,KUI_LINE_HEIGHT_50:Ph,KUI_LINE_HEIGHT_60:qh,KUI_LINE_HEIGHT_70:Hh,KUI_LINE_HEIGHT_80:Gh,KUI_LINE_HEIGHT_90:$h,KUI_METHOD_COLOR_BACKGROUND_CONNECT:Wh,KUI_METHOD_COLOR_BACKGROUND_DELETE:Vh,KUI_METHOD_COLOR_BACKGROUND_GET:Yh,KUI_METHOD_COLOR_BACKGROUND_HEAD:Xh,KUI_METHOD_COLOR_BACKGROUND_OPTIONS:jh,KUI_METHOD_COLOR_BACKGROUND_PATCH:Qh,KUI_METHOD_COLOR_BACKGROUND_POST:Zh,KUI_METHOD_COLOR_BACKGROUND_PUT:Jh,KUI_METHOD_COLOR_BACKGROUND_TRACE:ef,KUI_METHOD_COLOR_TEXT_CONNECT:tf,KUI_METHOD_COLOR_TEXT_CONNECT_STRONG:rf,KUI_METHOD_COLOR_TEXT_DELETE:nf,KUI_METHOD_COLOR_TEXT_DELETE_STRONG:sf,KUI_METHOD_COLOR_TEXT_GET:of,KUI_METHOD_COLOR_TEXT_GET_STRONG:af,KUI_METHOD_COLOR_TEXT_HEAD:lf,KUI_METHOD_COLOR_TEXT_HEAD_STRONG:cf,KUI_METHOD_COLOR_TEXT_OPTIONS:uf,KUI_METHOD_COLOR_TEXT_OPTIONS_STRONG:df,KUI_METHOD_COLOR_TEXT_PATCH:hf,KUI_METHOD_COLOR_TEXT_PATCH_STRONG:ff,KUI_METHOD_COLOR_TEXT_POST:mf,KUI_METHOD_COLOR_TEXT_POST_STRONG:pf,KUI_METHOD_COLOR_TEXT_PUT:gf,KUI_METHOD_COLOR_TEXT_PUT_STRONG:_f,KUI_METHOD_COLOR_TEXT_TRACE:yf,KUI_METHOD_COLOR_TEXT_TRACE_STRONG:Rf,KUI_NAVIGATION_COLOR_BACKGROUND:Cf,KUI_NAVIGATION_COLOR_BACKGROUND_SELECTED:Ef,KUI_NAVIGATION_COLOR_BORDER:bf,KUI_NAVIGATION_COLOR_BORDER_CHILD:Of,KUI_NAVIGATION_COLOR_BORDER_DIVIDER:wf,KUI_NAVIGATION_COLOR_TEXT:Tf,KUI_NAVIGATION_COLOR_TEXT_FOCUS:vf,KUI_NAVIGATION_COLOR_TEXT_HOVER:Sf,KUI_NAVIGATION_COLOR_TEXT_SELECTED:xf,KUI_NAVIGATION_SHADOW_BORDER:If,KUI_NAVIGATION_SHADOW_BORDER_CHILD:kf,KUI_NAVIGATION_SHADOW_FOCUS:Df,KUI_SHADOW:vr,KUI_SHADOW_BORDER:Nf,KUI_SHADOW_BORDER_DANGER:Af,KUI_SHADOW_BORDER_DANGER_STRONG:Lf,KUI_SHADOW_BORDER_DISABLED:Uf,KUI_SHADOW_BORDER_PRIMARY:Mf,KUI_SHADOW_BORDER_PRIMARY_STRONGEST:Kf,KUI_SHADOW_BORDER_PRIMARY_WEAK:Bf,KUI_SHADOW_FOCUS:zf,KUI_SPACE_0:Pf,KUI_SPACE_10:qf,KUI_SPACE_100:jf,KUI_SPACE_110:Qf,KUI_SPACE_120:Zf,KUI_SPACE_130:Jf,KUI_SPACE_140:em,KUI_SPACE_150:tm,KUI_SPACE_20:Hf,KUI_SPACE_30:Gf,KUI_SPACE_40:$f,KUI_SPACE_50:Ff,KUI_SPACE_60:Wf,KUI_SPACE_70:Vf,KUI_SPACE_80:Yf,KUI_SPACE_90:Xf,KUI_SPACE_AUTO:im,KUI_STATUS_COLOR_100:rm,KUI_STATUS_COLOR_100S:gp,KUI_STATUS_COLOR_101:nm,KUI_STATUS_COLOR_102:sm,KUI_STATUS_COLOR_103:om,KUI_STATUS_COLOR_1NA:dp,KUI_STATUS_COLOR_200:am,KUI_STATUS_COLOR_200S:_p,KUI_STATUS_COLOR_201:lm,KUI_STATUS_COLOR_202:cm,KUI_STATUS_COLOR_203:um,KUI_STATUS_COLOR_204:dm,KUI_STATUS_COLOR_205:hm,KUI_STATUS_COLOR_206:fm,KUI_STATUS_COLOR_207:mm,KUI_STATUS_COLOR_208:pm,KUI_STATUS_COLOR_226:gm,KUI_STATUS_COLOR_2NA:hp,KUI_STATUS_COLOR_300:_m,KUI_STATUS_COLOR_300S:yp,KUI_STATUS_COLOR_301:ym,KUI_STATUS_COLOR_302:Rm,KUI_STATUS_COLOR_303:Cm,KUI_STATUS_COLOR_304:Em,KUI_STATUS_COLOR_305:bm,KUI_STATUS_COLOR_307:Om,KUI_STATUS_COLOR_308:wm,KUI_STATUS_COLOR_3NA:fp,KUI_STATUS_COLOR_400:Tm,KUI_STATUS_COLOR_400S:Rp,KUI_STATUS_COLOR_401:vm,KUI_STATUS_COLOR_402:Sm,KUI_STATUS_COLOR_403:xm,KUI_STATUS_COLOR_404:Im,KUI_STATUS_COLOR_405:km,KUI_STATUS_COLOR_406:Dm,KUI_STATUS_COLOR_407:Nm,KUI_STATUS_COLOR_408:Am,KUI_STATUS_COLOR_409:Lm,KUI_STATUS_COLOR_410:Um,KUI_STATUS_COLOR_411:Mm,KUI_STATUS_COLOR_412:Km,KUI_STATUS_COLOR_413:Bm,KUI_STATUS_COLOR_414:zm,KUI_STATUS_COLOR_415:Pm,KUI_STATUS_COLOR_416:qm,KUI_STATUS_COLOR_417:Hm,KUI_STATUS_COLOR_418:Gm,KUI_STATUS_COLOR_421:$m,KUI_STATUS_COLOR_422:Fm,KUI_STATUS_COLOR_423:Wm,KUI_STATUS_COLOR_424:Vm,KUI_STATUS_COLOR_425:Ym,KUI_STATUS_COLOR_426:Xm,KUI_STATUS_COLOR_428:jm,KUI_STATUS_COLOR_429:Qm,KUI_STATUS_COLOR_431:Zm,KUI_STATUS_COLOR_451:Jm,KUI_STATUS_COLOR_4NA:mp,KUI_STATUS_COLOR_500:ep,KUI_STATUS_COLOR_500S:Cp,KUI_STATUS_COLOR_501:tp,KUI_STATUS_COLOR_502:ip,KUI_STATUS_COLOR_503:rp,KUI_STATUS_COLOR_504:np,KUI_STATUS_COLOR_505:sp,KUI_STATUS_COLOR_506:op,KUI_STATUS_COLOR_507:ap,KUI_STATUS_COLOR_508:lp,KUI_STATUS_COLOR_510:cp,KUI_STATUS_COLOR_511:up,KUI_STATUS_COLOR_5NA:pp,KUI_STATUS_COLOR_BACKGROUND_100:Ep,KUI_STATUS_COLOR_BACKGROUND_200:bp,KUI_STATUS_COLOR_BACKGROUND_300:Op,KUI_STATUS_COLOR_BACKGROUND_400:wp,KUI_STATUS_COLOR_BACKGROUND_500:Tp,KUI_STATUS_COLOR_TEXT_100:vp,KUI_STATUS_COLOR_TEXT_200:Sp,KUI_STATUS_COLOR_TEXT_300:xp,KUI_STATUS_COLOR_TEXT_400:Ip,KUI_STATUS_COLOR_TEXT_500:kp},Symbol.toStringTag,{value:"Module"})),xr=Object.keys(Sr).filter(r=>r.startsWith("KUI_COLOR")),Ir=r=>Sr[r],Dp=r=>`--${r.toLowerCase().replaceAll("_","-")}`,kr=()=>{if(typeof window>"u")return Object.fromEntries(xr.map(t=>[t,Ir(t)]));const r=window.getComputedStyle(document.documentElement),e=(t,i)=>r.getPropertyValue(t).trim()||i;return Object.fromEntries(xr.map(t=>[t,e(Dp(t),Ir(t))]))},Zt=r=>{const e=n.ref(kr());if(typeof window<"u"&&typeof MutationObserver<"u"){const t=new MutationObserver(()=>{e.value=kr()});t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-kui-theme"]}),n.getCurrentScope()&&n.onScopeDispose(()=>t.disconnect())}return e},Np=()=>typeof window>"u"?Qt:window.getComputedStyle(document.documentElement).getPropertyValue("--kui-font-family-text").trim()||Qt,Ap=[`background-color: var(--kui-pop-color-background, var(--kui-color-background, ${br}));`,`border: var(--kui-pop-border-width, var(--kui-border-width-10, ${Tr})) solid var(--kui-pop-color-border, var(--kui-color-border, ${Or}));`,`border-radius: var(--kui-pop-border-radius, var(--kui-border-radius-30, ${wr}));`,`box-shadow: var(--kui-pop-shadow, var(--kui-shadow, ${vr}));`].join(" "),Lp=r=>{const e=Np(),t={color:r.KUI_COLOR_TEXT,fontFamily:e},i={axisLabel:{color:r.KUI_COLOR_TEXT_NEUTRAL,fontFamily:e},axisLine:{lineStyle:{color:r.KUI_COLOR_BORDER}},splitLine:{lineStyle:{color:r.KUI_COLOR_BORDER}}};return{textStyle:t,categoryAxis:i,valueAxis:i,tooltip:{backgroundColor:r.KUI_COLOR_BACKGROUND,borderWidth:0,padding:0,confine:!0,extraCssText:Ap,textStyle:{color:r.KUI_COLOR_TEXT,fontFamily:e}},visualMap:{textStyle:{color:r.KUI_COLOR_TEXT_NEUTRAL,fontFamily:e}},legend:{textStyle:{color:r.KUI_COLOR_TEXT_NEUTRAL,fontFamily:e}}}},Up=r=>n.computed(()=>Lp(r.value)),Mp={class:"kong-ui-public-echarts-tooltip"},Kp={class:"tooltip-title"},Bp={class:"title"},zp={key:0,class:"subtitle"},Pp={class:"context"},qp={class:"metric"},Hp={class:"tooltip-rows"},Gp={class:"display-value"},$p=n.defineComponent({__name:"ChartTooltip",props:{title:{},context:{},metric:{},rows:{}},setup(r){return(e,t)=>(n.openBlock(),n.createElementBlock("div",Mp,[n.createElementVNode("div",Kp,[n.createElementVNode("div",Bp,n.toDisplayString(r.title),1),r.context||r.metric?(n.openBlock(),n.createElementBlock("div",zp,[n.createElementVNode("div",Pp,n.toDisplayString(r.context),1),n.createElementVNode("div",qp,n.toDisplayString(r.metric),1)])):n.createCommentVNode("",!0)]),n.createElementVNode("ul",Hp,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.rows,(i,s)=>(n.openBlock(),n.createElementBlock("li",{key:`${i.label}-${s}`,class:n.normalizeClass({"extra-row":i.isExtra})},[n.createElementVNode("span",{class:"square-marker",style:n.normalizeStyle(i.isExtra?void 0:{background:i.color})},null,4),n.createElementVNode("span",{class:n.normalizeClass(["display-label",{empty:i.isSegmentEmpty}])},n.toDisplayString(i.label),3),n.createElementVNode("span",Gp,n.toDisplayString(i.value),1)],2))),128))])]))}}),Dr=(r,e)=>{const t=r.__vccOpts||r;for(const[i,s]of e)t[i]=s;return t},Fp=Dr($p,[["__scopeId","data-v-ca633353"]]),Jt=r=>Array.isArray(r)?r:[r],Nr=(r,e)=>typeof r=="number"?e?.[r]??String(r):r,ei=(r,e,t,i)=>({color:typeof r.color=="string"?r.color:void 0,label:e,value:i?i(Number(t)):String(t??"")}),Wp=r=>Array.isArray(r)?r[r.length-1]:r,Vp=r=>{const e=Jt(r),t=e[0];return{context:String(t?.axisValueLabel??t?.name??""),rows:e.map(i=>ei(i,i.seriesName??"",Wp(i.value)))}},Yp=r=>{let e;return n.getCurrentScope()&&n.onScopeDispose(()=>{e&&n.render(null,e)}),t=>{const i=(r()??Vp)(t);return i?(e??=document.createElement("div"),n.render(n.h(Fp,i),e),e):""}},Xp={class:"kong-ui-public-echarts"},jp=n.defineComponent({name:"KongECharts",inheritAttrs:!1,__name:"ECharts",props:{option:{},height:{default:"400px"},tooltipContent:{type:Function}},setup(r){n.useCssVars(o=>({v1cecfeed:o.height})),St.use([Yr.CanvasRenderer,ut.GridComponent,ut.TooltipComponent]);const e=Zt(),t=Up(e),i=Yp(()=>r.tooltipContent),s=n.computed(()=>({...r.option,tooltip:{...r.option?.tooltip,formatter:i}}));return(o,a)=>(n.openBlock(),n.createElementBlock("div",Xp,[n.createVNode(n.unref(Vr),n.mergeProps({autoresize:!0,class:"chart",option:s.value,theme:n.unref(t)},o.$attrs),null,16,["option","theme"])]))}}),Ar=Dr(jp,[["__scopeId","data-v-68114d20"]]),Lr=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),st=(r,...e)=>{const t={...r};for(const i of e)if(i)for(const[s,o]of Object.entries(i)){if(o===void 0)continue;const a=t[s];t[s]=Lr(a)&&Lr(o)?st(a,o):o}return t},Qp=n.defineComponent({__name:"HeatmapChart",props:{data:{},xAxisLabels:{},yAxisLabels:{},seriesName:{},min:{},max:{},colorRange:{},valueFormatter:{type:Function},visibleRows:{},showValues:{type:Boolean},seriesOption:{},option:{},height:{},tooltipTitle:{}},setup(r){St.use([li.HeatmapChart,ut.VisualMapComponent,ut.DataZoomSliderComponent]);const e=Zt(),t=a=>{const[l]=Jt(a),[u,c,d]=l.value;return{title:r.tooltipTitle,context:Nr(u,r.xAxisLabels),metric:r.seriesName,rows:[ei(l,Nr(c,r.yAxisLabels),d,r.valueFormatter)]}},i=a=>({type:"slider",yAxisIndex:0,startValue:0,endValue:a-1,zoomLock:!0,right:10,width:8,handleSize:0,moveHandleSize:0,showDetail:!1,brushSelect:!1,showDataShadow:!1,borderColor:"transparent",backgroundColor:e.value.KUI_COLOR_BACKGROUND_NEUTRAL_WEAKEST,fillerColor:e.value.KUI_COLOR_BACKGROUND_NEUTRAL_WEAK}),s=n.computed(()=>{const a=r.data??[],l=!!r.visibleRows&&r.visibleRows<(r.yAxisLabels?.length??0),u=r.valueFormatter?c=>r.valueFormatter(Number(c)):void 0;return{grid:{top:10,left:10,right:l?30:20,bottom:70,outerBoundsMode:"same",outerBoundsContain:"axisLabel"},xAxis:{type:"category",data:r.xAxisLabels??[],splitArea:{show:!1},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",data:r.yAxisLabels??[],inverse:!0,splitArea:{show:!1},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{width:160,overflow:"truncate"}},visualMap:{min:r.min??0,max:r.max??a.reduce((c,[,,d])=>Math.max(c,d),1),calculable:!0,orient:"horizontal",left:"center",bottom:0,inRange:{color:r.colorRange??[e.value.KUI_COLOR_BACKGROUND_INFO_WEAKEST,e.value.KUI_COLOR_BACKGROUND_INFO_STRONG]},formatter:u},...l?{dataZoom:[i(r.visibleRows)]}:{},series:[st({name:r.seriesName,type:"heatmap",data:a,animation:!1,label:{show:r.showValues??!1,formatter:r.valueFormatter?({value:c})=>r.valueFormatter(Number(c[2])):void 0},itemStyle:{borderColor:e.value.KUI_COLOR_BACKGROUND,borderWidth:2,borderRadius:2},emphasis:{itemStyle:{shadowBlur:5,shadowColor:e.value.KUI_COLOR_BACKGROUND_OVERLAY}}},r.seriesOption)]}}),o=n.computed(()=>st(s.value,r.option));return(a,l)=>(n.openBlock(),n.createBlock(Ar,{height:r.height,option:o.value,"tooltip-content":t},null,8,["height","option"]))}}),Zp=n.defineComponent({__name:"TreeMapChart",props:{data:{},seriesName:{},showValues:{type:Boolean},valueFormatter:{type:Function},colorPalette:{},drillDown:{type:Boolean,default:!0},leafDepth:{},seriesOption:{},option:{},height:{},tooltipTitle:{}},setup(r){St.use([li.TreemapChart]);const e=Zt(),t=l=>{const[u]=Jt(l),c=u.treePathInfo??[];if(c.length===1)return;const d=c.slice(1,-1).map(({name:h})=>h);return{title:r.tooltipTitle,context:d.length?d.join(" / "):void 0,metric:r.seriesName,rows:[ei(u,u.name,Number(u.value),r.valueFormatter)]}},i=()=>[e.value.KUI_COLOR_BACKGROUND_PRIMARY_WEAK,e.value.KUI_COLOR_BACKGROUND_SUCCESS_WEAK,e.value.KUI_COLOR_BACKGROUND_WARNING_WEAK,e.value.KUI_COLOR_BACKGROUND_DANGER_WEAK,e.value.KUI_COLOR_BACKGROUND_INFO_WEAK,e.value.KUI_COLOR_BACKGROUND_DECORATIVE_PURPLE_WEAKEST,e.value.KUI_COLOR_BACKGROUND_DECORATIVE_AQUA_WEAKEST],s=(l=[])=>l.reduce((u,c)=>Math.max(u,1+s(c.children)),0),o=n.computed(()=>({series:[st({name:r.seriesName,type:"treemap",data:r.data??[],nodeClick:r.drillDown?"zoomToNode":!1,...r.drillDown?{scaleLimit:{min:1,max:1/0},zoomToNodeRatio:.2}:{},leafDepth:r.leafDepth??s(r.data),roam:r.drillDown,left:0,top:0,right:0,bottom:r.drillDown?40:0,visibleMin:0,breadcrumb:{show:r.drillDown,itemStyle:{color:e.value.KUI_COLOR_BACKGROUND_NEUTRAL_WEAK,borderColor:"transparent",borderWidth:0,borderRadius:2,textStyle:{color:e.value.KUI_COLOR_TEXT}},emphasis:{itemStyle:{color:e.value.KUI_COLOR_BACKGROUND_NEUTRAL,textStyle:{color:e.value.KUI_COLOR_TEXT}}}},levels:[{color:r.colorPalette??i(),itemStyle:{borderColor:e.value.KUI_COLOR_BACKGROUND,borderWidth:2,gapWidth:2}},{colorAlpha:[.55,1],itemStyle:{borderColor:e.value.KUI_COLOR_BACKGROUND,borderWidth:1,gapWidth:1}}],label:{show:!0,color:e.value.KUI_COLOR_TEXT,align:"center",verticalAlign:"middle",overflow:"truncate",formatter:r.showValues?({name:l,value:u})=>`${l}
|
|
13
|
+
${r.valueFormatter?r.valueFormatter(Number(u)):String(u)}`:void 0}},r.seriesOption)]})),a=n.computed(()=>st(o.value,r.option));return(l,u)=>(n.openBlock(),n.createBlock(Ar,{height:r.height,option:a.value,"tooltip-content":t},null,8,["height","option"]))}}),Ur=r=>{if(r==null||typeof r=="string"&&r.trim()==="")return;const e=Number(r);return Number.isFinite(e)?e:void 0},Jp=(r,e,t)=>{if(!t.length)return r;const i=t.reduce((o,a)=>Math.min(o,a));if(i<=r)return i;const s=Math.ceil((i-r)/e);return i-s*e},eg=(r,e,t)=>{const i=[];for(let s=r;s<e;s+=t)i.push(s);return i},tg=(r,e,t)=>{const i=o=>ca(o,t,"yyyy-MM-dd"),s=r.length>0&&i(r[0])!==i(r[r.length-1]);return r.map(o=>Re.formatChartTicksByGranularity({tickValue:new Date(o),granularity:e,dayBoundaryCrossed:s,timezone:t}))},ig=(r,e)=>{const t=r.indexOf(e);return t===-1?r.push(e)-1:t},rg=(r,e)=>r[e]?.name??e,ng=(r,{tz:e}={})=>{if(!r?.meta||!r.data)return;const{display:t,metric_names:i,start:s,end:o,granularity_ms:a}=r.meta,l=i?.[0],u=t&&Object.keys(t).find(T=>T!=="time");if(!l||!u||!s||!o){console.error("Cannot build heatmap chart data from this explore result. Missing metric, dimension or time range.");return}const c=a||re.Granularities.daily,d=re.msToGranularity(c)??"daily",h=e||Intl.DateTimeFormat().resolvedOptions().timeZone,f=r.data,p=Jp(new Date(s).getTime(),c,f.map(({timestamp:T})=>new Date(T).getTime())),C=eg(p,new Date(o).getTime(),c),O=[],R=[];for(const{timestamp:T,event:P}of f){const b=Math.floor((new Date(T).getTime()-p)/c),E=Ur(P[l]);b<0||b>=C.length||E===void 0||R.push([b,ig(O,String(P[u])),E])}return{data:R,xAxisLabels:tg(C,d,h),yAxisLabels:O.map(T=>rg(t[u],T))}},sg={class:"wrapper","data-testid":"heatmap-chart"},og=10,ag=ke(n.defineComponent({__name:"HeatmapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),o=ue.useMetricFormatter(),a=c=>{const d=ng(c,{tz:t.context.tz});if(d?.data.length)return{data:d.data,xAxisLabels:d.xAxisLabels,yAxisLabels:d.yAxisLabels,...o(c)}},l=new WeakMap,u=c=>(l.has(c)||l.set(c,a(c)),l.get(c));return(c,d)=>{const h=n.resolveComponent("KEmptyState");return n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:d[0]||(d[0]=f=>i("chart-data",f)),onQueryComplete:d[1]||(d[1]=f=>i("query-complete"))},{default:n.withCtx(({data:f})=>[n.createElementVNode("div",sg,[u(f)?(n.openBlock(),n.createBlock(n.unref(Qp),n.mergeProps({key:0,height:"100%","tooltip-title":r.chartOptions.chart_title??void 0,"visible-rows":og},u(f)),null,16,["tooltip-title"])):(n.openBlock(),n.createBlock(h,{key:1,"action-button-visible":!1,"data-testid":"no-data-in-report"},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.title")),1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.description")),1)]),_:1}))])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-3315f2cd"]]),Mr=(r,e,{otherLabel:t})=>({name:e===Re.OTHER_DIMENSION_ID&&t||(r?.[e]?.name??e)}),lg=(r,e,t,i)=>({...Mr(e,t,i),itemStyle:{color:Ts({dimension:r,dimensionValue:t})}}),Kr=(r,e,t)=>{const i=r.get(e)??t();return r.set(e,i),i},ti=(r,e)=>!e.includes("time")&&(!r||re.isMetricSupported("treemap",r)),Br=(r,e)=>{r.value=Number(r.value??0)+e},cg=(r,e,t,[i,s],o)=>{const a=new Map,l=(u,c)=>String(u[c]);for(const{event:u}of r){const c=Ur(u[e]);if(c===void 0)continue;const d=l(u,i),h=Kr(a,d,()=>({node:lg(i,t[i],d,o),children:new Map}));if(!s){Br(h.node,c);continue}const f=l(u,s),p=Kr(h.children,f,()=>Mr(t[s],f,o));Br(p,c)}return a},ug=(r,e={})=>{if(!r?.meta||!r.data)return;const{display:t,metric_names:i}=r.meta,s=i?.[0],o=t?Object.keys(t):[];if(!s||!o.length){console.error("Cannot build treemap chart data from this explore result. Missing metric or dimension.");return}if(!ti(s,o)){console.error("Cannot build treemap chart data from this explore result. Needs an additive metric and no time dimension.");return}return[...cg(r.data,s,t,o,e).values()].map(({node:l,children:u})=>u.size?{...l,children:[...u.values()]}:l)},dg={class:"wrapper","data-testid":"treemap-chart"},hg=ke(n.defineComponent({__name:"TreemapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["chart-data","query-complete"],setup(r,{emit:e}){const t=r,i=e,{i18n:s}=ue.useI18n(),o=ue.useMetricFormatter(),a=n.computed(()=>ti(t.query.metrics?.[0],t.query.dimensions??[])),l=d=>{const h=ug(d,{otherLabel:s.t("chartLabels.____OTHER____")});if(h?.length)return{data:h,drillDown:h.some(f=>f.children?.length),...o(d)}},u=new WeakMap,c=d=>(u.has(d)||u.set(d,l(d)),u.get(d));return(d,h)=>{const f=n.resolveComponent("KEmptyState");return n.openBlock(),n.createBlock(Be,{context:r.context,query:r.query,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:h[0]||(h[0]=p=>i("chart-data",p)),onQueryComplete:h[1]||(h[1]=p=>i("query-complete"))},{default:n.withCtx(({data:p})=>[n.createElementVNode("div",dg,[a.value?c(p)?(n.openBlock(),n.createBlock(n.unref(Zp),n.mergeProps({key:1,height:"100%","tooltip-title":r.chartOptions.chart_title??void 0},c(p)),null,16,["tooltip-title"])):(n.openBlock(),n.createBlock(f,{key:2,"action-button-visible":!1,"data-testid":"no-data-in-report"},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.title")),1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.noDataAvailable.description")),1)]),_:1})):(n.openBlock(),n.createBlock(f,{key:0,"action-button-visible":!1,"data-testid":"treemap-unsupported"},{title:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.treemapUnsupported.title")),1)]),default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s).t("renderer.treemapUnsupported.description")),1)]),_:1}))])]),_:1},8,["context","query","query-ready","refresh-counter"])}}}),[["__scopeId","data-v-d818a9ae"]]),fg=["data-testid"],mg={key:0,class:"group-tabs"},pg={key:1,class:"tile-header"},gg={class:"badge-container"},_g={class:"badge-text"},yg={class:"badge-text"},Rg={key:0,class:"metric-selector-wrapper"},Cg={key:1},Eg=["data-testid"],bg=["data-testid"],Og=["data-testid"],wg={class:"delete-option"},Tg=["data-testid"],zr=ke(n.defineComponent({__name:"DashboardTile",props:n.mergeModels({context:{},definition:{},fitToContent:{type:Boolean,default:!1},groupTiles:{},height:{default:()=>it},hideActions:{type:Boolean,default:!1},isFullscreen:{type:Boolean},preview:{type:Boolean,default:!1},queryReady:{type:Boolean},showRefresh:{type:Boolean,default:!1},tileId:{},tileType:{default:"chart"}},{refreshCounter:{default:0},refreshCounterModifiers:{}}),emits:n.mergeModels(["chart-data","tile-loaded","edit-tile","duplicate-tile","remove-tile","tile-time-range-zoom","tile-bounds-change"],["update:refreshCounter"]),setup(r,{expose:e,emit:t}){n.useCssVars(H=>({v7f33ad9a:`${H.height}px`}));const i=parseInt(Pi,10),s=n.ref(!1),o=n.ref(),a=n.computed(()=>r.groupTiles?.find(H=>H.id===o.value)?.id??r.groupTiles?.[0]?.id),l=n.computed(()=>a.value??r.tileId.toString()),u=n.computed(()=>r.groupTiles?.find(H=>H.id===o.value)?.definition??r.groupTiles?.[0]?.definition??r.definition),c=ue.useFieldLabel(),{zoomConfiguration:d}=ue.useDashboardContext({context:n.computed(()=>r.context),preview:n.computed(()=>r.preview)}),h=n.useModel(r,"refreshCounter"),f=()=>{m.value=!0,h.value++},p=t,C=n.defineAsyncComponent(()=>Promise.resolve().then(()=>Xg)),O=n.inject(Ie),R=Se.useDatasourceConfigStore(),{datasourceConfigMap:T,stripUnknownFilters:P}=Xe(R),{i18n:b}=ue.useI18n(),E=n.ref(),D=n.ref({status:"loading"}),x=n.ref(!1),K=n.ref(),g=n.ref(!1),m=n.ref(!0),_=n.computed(()=>u.value.chart),U=n.computed(()=>_.value.type==="single_value"),A=n.computed(()=>("chart_title"in _.value?_.value.chart_title:void 0)||(U.value?fe.value:void 0)),F=n.computed(()=>u.value.header_description),v=n.computed(()=>_.value.type==="slottable"),q=n.computed(()=>Ne(u.value)||_t(u.value)?!1:!("allow_csv_export"in _.value)||_.value.allow_csv_export!==!1),{exploreLinkKebabMenu:V,requestsLinkKebabMenu:W,canShowKebabMenu:w,canGenerateRequestsLink:S,canGenerateExploreLink:G,requestsLinkZoomActions:M,exploreLinkZoomActions:k,buildExploreQuery:N,buildExploreLink:oe,buildRequestLink:ae,buildRequestsQueryZoomActions:de}=ue.useContextLinks({queryBridge:O,chartData:n.readonly(E),definition:u,context:n.readonly(n.toRef(()=>r.context))}),{issueQuery:ge}=ue.useIssueQuery();n.watch(u,async(H,te)=>{await n.nextTick(),K.value&&(g.value=K.value.scrollWidth>K.value.clientWidth);try{JSON.stringify(H?.query)!==JSON.stringify(te?.query)&&(m.value=!0)}catch{}},{immediate:!0,deep:!0});const ie=n.computed(()=>b.t("csvExport.defaultFilename")),I=n.computed(()=>!!V.value||q.value||!!r.context.editable),B=n.computed(()=>!r.hideActions&&w.value&&I.value),z=n.computed(()=>B.value&&I.value&&!r.isFullscreen),Y={heatmap:ag,treemap:hg,timeseries_line:dr,timeseries_bar:dr,scatter:_l,horizontal_bar:ur,vertical_bar:ur,gauge:cr,donut:fc,golden_signals:yl,top_n:ac,top_talkers:lc,table:hc,slottable:void 0,single_value:cr,choropleth_map:C},J=n.computed(()=>({...L.value?.rendererEvents.supportsRequests?{"select-chart-range":i_}:{},...L.value?.rendererEvents.supportsZoom?{"zoom-time-range":e_}:{},...L.value?.rendererEvents.supportsBounds?{"bounds-change":t_}:{},...L.value?.rendererEvents.supportsLoadingChange?{"loading-change":Qg}:{}})),L=n.computed(()=>{const H=Y[u.value.chart.type],te=Ne(u.value),pe=!!H?.emits?.includes("select-chart-range"),Ge=!!H?.emits?.includes("zoom-time-range"),Ue=u.value.chart.type==="choropleth_map",$e=!!H?.emits?.includes("loading-change"),ni={query:u.value.query,context:r.context,queryReady:r.queryReady,height:r.height-i*2,refreshCounter:h.value,zoomConfiguration:d.value},Fe={chartOptions:u.value.chart,activeMetric:_e.value,headerDescription:F.value,requestsLink:d.value.showRequestsAction?M.value:void 0,exploreLink:d.value.showExploreAction?k.value:void 0};return H&&{component:H,rendererProps:{...ni,...te?{}:Fe,...["top_n","single_value"].includes(u.value.chart.type)?{fitToContent:r.fitToContent}:{}},rendererEvents:{supportsRequests:pe,supportsZoom:Ge,supportsBounds:Ue,supportsLoadingChange:$e}}}),$=n.computed(()=>{if(Ne(u.value))return null;const H=u.value.query,te=H?.time_range;if(re.isPlatformDatasource(H?.datasource)&&!H.dimensions?.includes("time"))return b.t("renderer.as_of_today");if(te?.type==="relative"){const pe=re.TimePeriods.get(re.TIMEFRAME_LOOKUP[te.time_range]);return pe?pe.display:(console.warn("Did not recognize the given relative time range:",te.time_range),te.time_range)}else if(te?.type==="absolute"){const pe=te.tz||"Etc/UTC";return`${re.formatTime(te.start,{short:!0,tz:pe})} - ${re.formatTime(te.end,{short:!0,tz:pe})}`}return null}),j=n.computed(()=>{const H=u.value.query,te=H?.datasource,pe=te?T.value[te]?.timeRangeOptions:void 0,Ue=(H&&"time_range"in H?H.time_range:void 0)??r.context.timeSpec;return Ft(Ue,pe)}),ce=n.computed(()=>v.value?!1:[!!A.value,z.value,!!$.value,j.value,!!F.value,r.showRefresh,ze.value].some(Boolean)),Z=n.computed(()=>E.value?re.msToGranularity(E.value.meta.granularity_ms):void 0),ne=n.computed(()=>["timeseries_line","timeseries_bar"].includes(_.value.type)),me=n.computed(()=>E.value?.meta.metric_names??[]),_e=n.ref();n.watch(me,H=>{(!_e.value||!H.includes(_e.value))&&(_e.value=H[0])},{immediate:!0}),n.watch(l,()=>{E.value=void 0,_e.value=void 0,m.value=!0});const Oe=n.computed(()=>{const H=_.value;return H.type!=="timeseries_line"?!1:me.value.some(te=>H.metric_axis_map?.[te]==="right")}),ze=n.computed(()=>ne.value&&!Oe.value&&(E.value?.data.length??0)>0&&me.value.length>1&&Object.keys(E.value?.meta.display??{}).length>0),fe=n.computed(()=>{const te=("metrics"in u.value.query?u.value.query.metrics?.[0]:void 0)??me.value[0];if(te)return c(te)}),we=n.computed(()=>(r.groupTiles??[]).map(({id:H,label:te})=>({hash:`#${H}`,title:te}))),he=n.computed({get:()=>`#${a.value}`,set:H=>{o.value=H.slice(1)}}),ye=n.computed(()=>me.value.map(H=>({value:H,label:c(H)}))),Te=n.computed(()=>{if(!Gt(u.value)||!ne.value||!r.queryReady||m.value)return!1;const H=u.value.query.granularity;return!H||!Z.value?!1:H!==Z.value}),lt=n.computed(()=>{const H=re.msToGranularity(E.value?.meta.granularity_ms??0)??"unknown",te=Gt(u.value)?u.value.query.granularity??"unknown":"unknown";return b.t("query_aged_out_warning",{currentGranularity:b.t(`granularities.${H}`),savedGranularity:b.t(`granularities.${te}`)})}),Tt=n.computed(()=>{const H=[...r.context.filters,...u.value.query.filters??[]],te="metrics"in u.value.query?u.value.query.metrics:void 0,pe=u.value.query.datasource??"api_usage";return P.value({datasource:pe,filters:H,queryFields:te})}),Pe=()=>{p("edit-tile",u.value,l.value)},ve=()=>{p("duplicate-tile",u.value,l.value)},He=()=>{p("remove-tile",u.value,l.value)},vt=H=>{E.value=H,m.value=!1,p("chart-data",H),p("tile-loaded")},jg=()=>{m.value=!1,p("tile-loaded")},Qg=H=>{m.value=H,H||p("tile-loaded")},Zg=()=>{x.value=!1},$r=()=>{if(_t(u.value))throw new Error("Cannot export data for a tile backed by the api-requests endpoint");const H=u.value.query.datasource?.startsWith("goap");return O?.staticConfig?.increaseCsvExportLimit!==!1&&!H?ge(u.value.query,r.context,re.EXPORT_RECORD_LIMIT):E.value?Promise.resolve(E.value):new Promise(pe=>{const Ge=n.watch(E,Ue=>{Ue&&(pe(Ue),Ge())})})},Jg=async()=>{x.value=!0,D.value={status:"loading"};try{const H=await $r();D.value={status:"success",chartData:H}}catch(H){D.value={status:"error",error:H}}},e_=H=>{const te={tileId:l.value,timeRange:H};p("tile-time-range-zoom",te)},t_=H=>{const te={tileId:l.value,bounds:H};p("tile-bounds-change",te)},i_=H=>{const te=Tt.value,pe=N(H,te);k.value=G.value?{href:oe(pe)}:void 0,M.value=S.value?{href:ae(de(H,te))}:void 0};return e({getExportData:$r}),(H,te)=>{const pe=n.resolveComponent("KTooltip"),Ge=n.resolveComponent("KBadge"),Ue=n.resolveComponent("KButton"),$e=n.resolveComponent("KDropdownItem"),ni=n.resolveComponent("KDropdown");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["tile-boundary",{editable:r.context.editable,"fit-to-content":r.fitToContent,headless:!ce.value,"compact-single_value":U.value&&r.fitToContent}]),"data-testid":`tile-${r.tileId}`},[r.groupTiles&&r.groupTiles.length>1?(n.openBlock(),n.createElementBlock("div",mg,[n.createVNode(n.unref(ai.KTabs),n.mergeProps({modelValue:he.value,"onUpdate:modelValue":te[0]||(te[0]=Fe=>he.value=Fe)},{hidePanels:!0},{"data-testid":"tile-group-tabs",tabs:we.value}),null,16,["modelValue","tabs"])])):n.createCommentVNode("",!0),ce.value&&!v.value?(n.openBlock(),n.createElementBlock("div",pg,[n.createVNode(pe,{class:"title-tooltip",disabled:!g.value,"max-width":"500",text:A.value},{default:n.withCtx(()=>[n.createElementVNode("div",{ref_key:"titleRef",ref:K,class:"title"},n.toDisplayString(A.value),513)]),_:1},8,["disabled","text"]),n.createElementVNode("div",gg,[j.value?(n.openBlock(),n.createBlock(Ge,{key:0,appearance:"warning","data-testid":"unsupported-time-range-badge",tooltip:n.unref(b).t("unsupported_time_range_warning"),"tooltip-attributes":{maxWidth:"320px"}},{icon:n.withCtx(()=>[n.createVNode(n.unref(se.WarningIcon),{size:`var(--kui-icon-size-20, ${n.unref(Bi)})`},null,8,["size"])]),default:n.withCtx(()=>[n.createElementVNode("span",_g,n.toDisplayString(n.unref(b).t("unsupported_time_range_badge")),1)]),_:1},8,["tooltip"])):n.createCommentVNode("",!0),$.value?(n.openBlock(),n.createBlock(Ge,{key:1,"data-testid":"time-range-badge",tooltip:Te.value?lt.value:void 0,"tooltip-attributes":{maxWidth:"320px"}},n.createSlots({default:n.withCtx(()=>[n.createElementVNode("span",yg,n.toDisplayString($.value),1)]),_:2},[Te.value?{name:"icon",fn:n.withCtx(()=>[n.createVNode(n.unref(se.WarningIcon),{size:`var(--kui-icon-size-20, ${n.unref(Bi)})`},null,8,["size"])]),key:"0"}:void 0]),1032,["tooltip"])):n.createCommentVNode("",!0)]),ze.value?(n.openBlock(),n.createElementBlock("div",Rg,[n.createVNode(n.unref(ai.KSegmentedControl),{modelValue:_e.value,"onUpdate:modelValue":te[1]||(te[1]=Fe=>_e.value=Fe),class:"metric-selector","data-testid":"metric-selector",options:ye.value},null,8,["modelValue","options"])])):n.createCommentVNode("",!0),r.showRefresh?(n.openBlock(),n.createElementBlock("div",Cg,[n.createVNode(Ue,{appearance:"secondary",class:"refresh-button","data-testid":`tile-refresh-button-${r.tileId}`,disabled:m.value,icon:"",size:"small",onClick:f},{default:n.withCtx(()=>[m.value?(n.openBlock(),n.createBlock(n.unref(se.ProgressIcon),{key:0,role:"button",size:`var(--kui-icon-size-60, ${n.unref(zi)})`,tabindex:"0"},null,8,["size"])):(n.openBlock(),n.createBlock(n.unref(se.RefreshIcon),{key:1,role:"button",size:`var(--kui-icon-size-60, ${n.unref(zi)})`,tabindex:"0"},null,8,["size"]))]),_:1},8,["data-testid","disabled"])])):n.createCommentVNode("",!0),F.value?(n.openBlock(),n.createElementBlock("div",{key:2,class:"header-description","data-testid":`tile-description-${r.tileId}`},n.toDisplayString(F.value),9,Eg)):n.createCommentVNode("",!0),B.value?(n.openBlock(),n.createElementBlock("div",{key:3,class:"tile-actions","data-testid":`tile-actions-${r.tileId}`},[B.value&&r.context.editable&&!r.isFullscreen?(n.openBlock(),n.createBlock(Ue,{key:0,appearance:"tertiary","aria-label":n.unref(b).t("renderer.edit"),class:"edit-icon","data-testid":`edit-tile-${r.tileId}`,icon:"",size:"small",onClick:Pe},{default:n.withCtx(()=>[n.createVNode(n.unref(se.EditIcon),{decorative:""})]),_:1},8,["aria-label","data-testid"])):n.createCommentVNode("",!0),B.value&&I.value&&!r.isFullscreen?(n.openBlock(),n.createBlock(ni,{key:1,class:"dropdown","data-testid":`chart-action-menu-${r.tileId}`,"kpop-attributes":{placement:"bottom-end"},onToggleDropdown:te[2]||(te[2]=Fe=>s.value=Fe)},{items:n.withCtx(()=>[n.unref(V)?(n.openBlock(),n.createBlock($e,{key:0,"data-testid":`chart-jump-to-explore-${r.tileId}`,item:{label:n.unref(b).t("jumpToExplore"),to:n.unref(V)}},null,8,["data-testid","item"])):n.createCommentVNode("",!0),!n.unref(Ne)(u.value)&&n.unref(W)?(n.openBlock(),n.createBlock($e,{key:1,"data-testid":`chart-jump-to-requests-${r.tileId}`,item:{label:n.unref(b).t("jumpToRequests"),to:n.unref(W)}},null,8,["data-testid","item"])):n.createCommentVNode("",!0),q.value?(n.openBlock(),n.createBlock($e,{key:2,class:"chart-export-button","data-testid":`chart-csv-export-${r.tileId}`,onClick:Jg},{default:n.withCtx(()=>[n.createElementVNode("span",{class:"chart-export-trigger","data-testid":`csv-export-button-${r.tileId}`},n.toDisplayString(n.unref(b).t("csvExport.exportAsCsv")),9,Og)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0),r.context.editable?(n.openBlock(),n.createBlock($e,{key:3,"data-testid":`duplicate-tile-${r.tileId}`,onClick:ve},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(b).t("renderer.duplicateTile")),1)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0),r.context.editable?(n.openBlock(),n.createBlock($e,{key:4,"data-testid":`remove-tile-${r.tileId}`,onClick:He},{default:n.withCtx(()=>[n.createElementVNode("span",wg,n.toDisplayString(n.unref(b).t("renderer.delete")),1)]),_:1},8,["data-testid"])):n.createCommentVNode("",!0)]),default:n.withCtx(()=>[n.createVNode(Ue,{appearance:"tertiary","aria-expanded":s.value,"aria-haspopup":"true","aria-label":n.unref(b).t("renderer.tileActions"),class:n.normalizeClass(["kebab-action-menu",{"is-open":s.value}]),"data-testid":`kebab-action-menu-${r.tileId}`,icon:"",size:"small"},{default:n.withCtx(()=>[n.createVNode(n.unref(se.MoreIcon),{decorative:""})]),_:1},8,["aria-expanded","aria-label","class","data-testid"])]),_:1},8,["data-testid"])):n.createCommentVNode("",!0)],8,bg)):n.createCommentVNode("",!0),x.value?(n.openBlock(),n.createBlock(or,{key:4,"data-testid":`csv-export-modal-${r.tileId}`,"export-state":D.value,filename:ie.value,onCloseModal:Zg},null,8,["data-testid","export-state","filename"])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["tile-content",`type-${r.tileType}-${_.value.type}`]),"data-testid":`tile-content-${r.tileId}`},[L.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(L.value.component),n.mergeProps({key:l.value},L.value.rendererProps,n.toHandlers(J.value),{onChartData:vt,onQueryComplete:jg}),null,16)):n.createCommentVNode("",!0)],10,Tg)],10,fg)}}}),[["__scopeId","data-v-aaf55d0b"]]);function vg(r,e,t,i,s){const o=(...a)=>(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(r,a));return o.prototype=e.prototype,o}class y{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const o=i.getElementById(e);return o?[o]:[]}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 lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,t){const i=document.createElement("div");return e.forEach(s=>{s&&i.classList.add(s)}),t?.appendChild(i),i}static shouldSizeToContent(e,t=!1){return 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 y.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){const 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;const o=e.y>t.y?e.y:t.y,a=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return a<=o?0:(s-i)*(a-o)}static area(e){return e.w*e.h}static sort(e,t=1){return e.sort((s,o)=>{const a=t*((s.y??1e4)-(o.y??1e4));return a===0?t*((s.x??1e4)-(o.x??1e4)):a})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){const s=document.createElement("style"),o=i?.nonce;return o&&(s.nonce=o),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}static removeStylesheet(e,t){const s=(t||document).querySelector("STYLE[gs-style-id="+e+"]");s&&s.parentNode&&s.remove()}static addCSSRule(e,t,i){e.textContent+=`${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{const 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){const s=e[i],o=t[i];i[0]==="_"||s===o?delete e[i]:s&&typeof s=="object"&&o!==void 0&&(y.removeInternalAndSame(s,o),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){const 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){const s=e.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>o){const a=s.bottom-o,l=s.top,u=this.getScrollElement(e);if(u!==null){const c=u.scrollTop;s.top<0&&i<0?e.offsetHeight>o?u.scrollTop+=i:u.scrollTop+=Math.abs(l)>Math.abs(i)?i:l:i>0&&(e.offsetHeight>o?u.scrollTop+=i:u.scrollTop+=a>i?i:a),t.top+=u.scrollTop-c}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t),o=s.clientHeight,a=s===this.getScrollElement()?0:s.getBoundingClientRect().top,l=e.clientY-a,u=l<i,c=l>o-i;u?s.scrollBy({behavior:"smooth",top:l-i}):c&&s.scrollBy({behavior:"smooth",top:i-(o-l)})}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=y.clone(e);for(const s in i)i.hasOwnProperty(s)&&typeof i[s]=="object"&&s.substring(0,2)!=="__"&&!t.find(o=>o===s)&&(i[s]=y.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=y.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["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>i[o]=e[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>i[o]=e[o]),{...i,...s}}static simulateMouseEvent(e,t,i){const s=e,o=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:s.ctrlKey??!1,altKey:s.altKey??!1,shiftKey:s.shiftKey??!1,metaKey:s.metaKey??!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(o)}static getValuesFromTransformedElement(e){const t=document.createElement("div");y.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}}static swap(e,t,i){if(!e)return;const s=e[t];e[t]=e[i],e[i]=s}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class Ae{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),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 o=t;!this._loading&&this._useEntireRowArea(e,t)&&(o={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,o,s.skip));let a=!1;const l={nested:!0,pack:!1};let u=0;for(;i=i||this.collide(e,o,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||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;const d={...t,y:i.y+i.h,...l};c=this._loading&&y.samePos(e,d)?!0:this.moveNode(e,d),(i.locked||this._loading)&&c?y.copyPos(t,e):!i.locked&&c&&s.pack&&(this._packNodes(),t.y=i.y+i.h,y.copyPos(e,t)),a=a||c}else c=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...l});if(!c)return a;i=void 0}return a}collide(e,t=e,i){const s=e._id,o=i?._id;return this.nodes.find(a=>a._id!==s&&a._id!==o&&y.isIntercepted(a,t))}collideAll(e,t=e,i){const s=e._id,o=i?._id;return this.nodes.filter(a=>a._id!==s&&a._id!==o&&y.isIntercepted(a,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;const s=e._rect,o={...t.rect};o.y>s.y?(o.h+=o.y-s.y,o.y=s.y):o.h+=s.y-o.y,o.x>s.x?(o.w+=o.x-s.x,o.x=s.x):o.w+=s.x-o.x;let a,l=.5;for(let u of i){if(u.locked||!u._rect)break;const c=u._rect;let d=Number.MAX_VALUE,h=Number.MAX_VALUE;s.y<c.y?d=(o.y+o.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(d=(c.y+c.h-o.y)/c.h),s.x<c.x?h=(o.x+o.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(h=(c.x+c.w-o.x)/c.w);const f=Math.min(h,d);f>l&&(l=f,a=u)}return t.collide=a,a}cacheRects(e,t,i,s,o,a){return this.nodes.forEach(l=>l._rect={y:l.y*t+i,x:l.x*e+a,w:l.w*e-a-s,h:l.h*t-i-o}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){const o=t.x,a=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=o,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=a):(e.x=o,e.y=a),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=y.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=y.isTouching(e,t)))){if(t.y<e.y){const o=e;e=t,t=o}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=y.isTouching(e,t)))){if(t.x<e.x){const o=e;e=t,t=o}return i()}return!1}}}isAreaEmpty(e,t,i,s){const o={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(o)}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);const o=this.nodes;return this.nodes=[],o.forEach((a,l,u)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=u[l-1])),this.addNode(a,!1,c)}),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=y.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;){const 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??Ae._idSeq++;const i=e.id;if(i){let o=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+o++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const s={x:0,y:0,w:1,h:1};return y.defaults(e,s),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,y.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=s.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=s.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=s.w),isNaN(e.h)&&(e.h=s.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){const i=e._orig||y.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&e._id&&this.findCacheLayout(e,this.defaultColumn)===-1){const o={...e};o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}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),y.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!y.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const 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=y.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||y.samePos(e,e._orig)||(y.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){const o=s?s.y*i+(s.x+s.w):0;let a=!1;for(let l=o;!a;++l){const u=l%i,c=Math.floor(l/i);if(u+e.w>i)continue;const d={x:u,y:c,w:e.w,h:e.h};t.find(h=>y.isIntercepted(d,h))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,t=!1,i){const s=this.nodes.find(a=>a._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let o;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,o=!0),this.nodes.push(e),t&&this.addedNodes.push(e),o||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;const s=new Ae({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(i={...a},i):{...a})});if(!i)return!1;const o=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!t.resizing&&t.collide){const a=t.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return o?(s.nodes.filter(a=>a._dirty).forEach(a=>{const l=this.nodes.find(u=>u._id===a._id);l&&(y.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const t=new Ae({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=y.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){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);const s=e.w!==t.w||e.h!==t.h,o=y.copyPos({},e,!0);if(y.copyPos(o,t),this.nodeBoundFix(o,s),y.copyPos(t,o),!t.forceCollide&&y.samePos(e,t))return!1;const a=y.copyPos({},e),l=this.collideAll(e,o,t.skip);let u=!0;if(l.length){const c=e._moving&&!t.nested;let d=c?this.directionCollideCoverage(e,t,l):l[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const h=y.areaIntercept(t.rect,d._rect),f=y.area(t.rect),p=y.area(d._rect);h/(f<p?f:p)>.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,o,d,t):(u=!1,i&&delete t.pack)}return u&&!y.samePos(e,o)&&(e._dirty=!0,y.copyPos(e,o)),t.pack&&this._packNodes()._notify(),!y.samePos(e,a)}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(){const e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){const i=this._layouts?.length,s=i&&this.column!==i-1?this._layouts[i-1]:null,o=[];return this.sortNodes(),this.nodes.forEach(a=>{const l=s?.find(c=>c._id===a._id),u={...a,...l||{}};y.removeInternalForSave(u,!e),t&&t(a,u),o.push(u)}),o}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{const s=i/this.column;e.forEach(o=>{if(!o._orig)return;const a=t.find(l=>l._id===o._id);a&&(a.y>=0&&o.y!==o._orig.y&&(a.y+=o.y-o._orig.y),o.x!==o._orig.x&&(a.x=Math.round(o.x*s)),o.w!==o._orig.w&&(a.w=Math.round(o.w*s)))})}}),this)}columnChanged(e,t,i="moveScale"){if(!this.nodes.length||!t||e===t)return this;const s=i==="compact"||i==="list";s&&this.sortNodes(1),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let o=[],a=s?this.nodes:y.sort(this.nodes,-1);if(t>e&&this._layouts){const l=this._layouts[t]||[],u=this._layouts.length-1;!l.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(c=>{const d=a.find(h=>h._id===c._id);d&&(!s&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{const d=a.findIndex(h=>h._id===c._id);if(d!==-1){const h=a[d];if(s){h.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(h.x=c.x??h.x,h.y=c.y??h.y,h.w=c.w??h.w,o.push(h)),a.splice(d,1)}})}if(s)this.compact(i,!1);else{if(a.length)if(typeof i=="function")i(t,e,o,a);else{const l=s||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";a.forEach(d=>{d.x=t===1?0:u?Math.round(d.x*l):Math.min(d.x,t-1),d.w=t===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,t),o.push(d)}),a=[]}o=y.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.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){const s=[];return e.forEach((o,a)=>{if(o._id===void 0){const l=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=l?._id??Ae._idSeq++}s[a]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??Ae._idSeq++;const 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]||[];const s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){return this._layouts?.[t]?.findIndex(i=>i._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){const i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(const t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}Ae._idSeq=0;const be={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"};class Q{}const De=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 Le{}function Rt(r,e){r.touches.length>1||(r.cancelable&&r.preventDefault(),y.simulateMouseEvent(r.changedTouches[0],e))}function Pr(r,e){r.cancelable&&r.preventDefault(),y.simulateMouseEvent(r,e)}function Ct(r){Le.touchHandled||(Le.touchHandled=!0,Rt(r,"mousedown"))}function Et(r){Le.touchHandled&&Rt(r,"mousemove")}function bt(r){if(!Le.touchHandled)return;Le.pointerLeaveTimeout&&(window.clearTimeout(Le.pointerLeaveTimeout),delete Le.pointerLeaveTimeout);const e=!!Q.dragElement;Rt(r,"mouseup"),e||Rt(r,"click"),Le.touchHandled=!1}function Ot(r){r.pointerType!=="mouse"&&r.target.releasePointerCapture(r.pointerId)}function qr(r){Q.dragElement&&r.pointerType!=="mouse"&&Pr(r,"mouseenter")}function Hr(r){Q.dragElement&&r.pointerType!=="mouse"&&(Le.pointerLeaveTimeout=window.setTimeout(()=>{delete Le.pointerLeaveTimeout,Pr(r,"mouseleave")},10))}class wt{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._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const e=this.el=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${wt.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),De&&(this.el.addEventListener("touchstart",Ct),this.el.addEventListener("pointerdown",Ot)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),De&&(this.el.removeEventListener("touchstart",Ct),this.el.removeEventListener("pointerdown",Ot)),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),De&&(this.el.addEventListener("touchmove",Et),this.el.addEventListener("touchend",bt)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const 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),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),De&&(this.el.removeEventListener("touchmove",Et),this.el.removeEventListener("touchend",bt)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}wt.prefix="ui-resizable-";class ii{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 ot extends ii{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||o;return{position:{left:(a.left-s.left)*this.rectScale.x,top:(a.top-s.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.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){const 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),Q.overResizeElement===this&&delete Q.overResizeElement),this}_mouseOver(e){Q.overResizeElement||Q.dragElement||(Q.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){Q.overResizeElement===this&&(delete Q.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new wt(this.el,e,{start:t=>{this._resizeStart(t)},stop:t=>{this._resizeStop(t)},move:t=>{this._resizing(t,e)}})),this}_resizeStart(e){this.sizeToContent=y.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=y.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=y.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=y.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=y.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=ot._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=y.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 ot._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},o=e.clientX-i.clientX,a=this.sizeToContent?0:e.clientY-i.clientY;let l,u;t.indexOf("e")>-1?s.width+=o:t.indexOf("w")>-1&&(s.width-=o,s.left+=o,l=!0),t.indexOf("s")>-1?s.height+=a:t.indexOf("n")>-1&&(s.height-=a,s.top+=a,u=!0);const c=this._constrainSize(s.width,s.height,l,u);return Math.round(s.width)!==Math.round(c.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(e,t,i,s){const o=this.option,a=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,l=o.minWidth/this.rectScale.x||e,u=(s?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||t,d=Math.min(a,Math.max(l,e)),h=Math.min(u,Math.max(c,t));return{width:d,height:h}}_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}}ot._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Sg='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class at extends ii{constructor(e,t={}){super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const i=t?.handle?.substring(1),s=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:s?.subGrid?[e.querySelector(t.handle)||e]:Array.from(e.querySelectorAll(t.handle)),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),De&&(e.addEventListener("touchstart",Ct),e.addEventListener("pointerdown",Ot))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),De&&(t.removeEventListener("touchstart",Ct),t.removeEventListener("pointerdown",Ot))}),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(!Q.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(Sg)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete Q.dragElement,delete Q.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),De&&(e.currentTarget.addEventListener("touchmove",Et),e.currentTarget.addEventListener("touchend",bt)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),Q.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=y.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){const t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),Q.pauseDrag){const i=Number.isInteger(Q.pauseDrag)?Q.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),i)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,Q.dragElement=this;const i=this.el.gridstackNode?.grid;i?Q.dropElement=i.el.ddElement.ddDroppable:delete Q.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=y.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const s=y.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(s,this.ui()),this.triggerEvent("dragstart",s),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),De&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Et,!0),e.currentTarget.removeEventListener("touchend",bt,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),Q.dropElement?.el===this.el.parentElement&&delete Q.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const t=y.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),Q.dropElement&&Q.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete Q.dragElement,delete Q.dropElement,delete Q.mouseHandled,e.preventDefault()}_keyEvent(e){const t=this.el.gridstackNode,i=t?.grid||Q.dropElement?.el?.gridstack;if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!y.canBeRotated(t))return;t._origRotate=t._origRotate||{...t._orig},delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",y.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=y.cloneNode(this.el)),e.parentElement||y.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=at.originStyleProp.map(t=>this.el.style[t]),e}_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(){if(this.helper.classList.remove("ui-draggable-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const t=this.helper,i=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",at.originStyleProp.forEach(s=>t.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>t.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const t={left:0,top:0},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,o=0;i&&(s=this.dragTransform.xOffset,o=this.dragTransform.yOffset);const a=t.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-s,offsetTop:-e.clientY+a.top-o,width:a.width*this.dragTransform.xScale,height:a.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}}}}at.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class xg extends ii{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),De&&(this.el.addEventListener("pointerenter",qr),this.el.addEventListener("pointerleave",Hr)))}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),De&&(this.el.removeEventListener("pointerenter",qr),this.el.removeEventListener("pointerleave",Hr)))}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(!Q.dragElement||!this._canDrop(Q.dragElement.el))return;e.preventDefault(),e.stopPropagation(),Q.dropElement&&Q.dropElement!==this&&Q.dropElement._mouseLeave(e,!0),Q.dropElement=this;const t=y.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(Q.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){if(!Q.dragElement||Q.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const i=y.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(Q.dragElement)),this.triggerEvent("dropout",i),Q.dropElement===this&&(delete Q.dropElement,!t)){let s,o=this.el.parentElement;for(;!s&&o;)s=o.ddElement?.ddDroppable,o=o.parentElement;s&&s._mouseEnter(e)}}drop(e){e.preventDefault();const t=y.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(Q.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 ri{static init(e){return e.ddElement||(e.ddElement=new ri(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 at(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 ot(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 xg(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Ig{resizable(e,t,i,s){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddResizable&&o.ddResizable[t]();else if(t==="destroy")o.ddResizable&&o.cleanResizable();else if(t==="option")o.setupResizable({[i]:s});else{const l=o.el.gridstackNode.grid;let u=o.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const c=!l.opts.alwaysShowResizeHandle;o.setupResizable({...l.opts.resizable,handles:u,autoHide:c,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,s){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddDraggable&&o.ddDraggable[t]();else if(t==="destroy")o.ddDraggable&&o.cleanDraggable();else if(t==="option")o.setupDraggable({[i]:s});else{const a=o.el.gridstackNode.grid;o.setupDraggable({...a.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=o=>t._accept(o)),this._getDDElements(e,t).forEach(o=>{t==="disable"||t==="enable"?o.ddDroppable&&o.ddDroppable[t]():t==="destroy"?o.ddDroppable&&o.cleanDroppable():t==="option"?o.setupDroppable({[i]:s}):o.setupDroppable(t)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(s=>s.on(t,o=>{i(o,Q.dragElement?Q.dragElement.el:o.target,Q.dragElement?Q.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){const i=e.gridstack||t!=="destroy"&&t!=="disable",s=y.getElements(e);return s.length?s.map(a=>a.ddElement||(i?ri.init(a):null)).filter(a=>a):[]}}const Ee=new Ig;class X{static init(e={},t=".grid-stack"){if(typeof document>"u")return null;const i=X.getGridElement(t);return i?(i.gridstack||(i.gridstack=new X(i,y.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
14
14
|
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"){const i=[];return typeof document>"u"||(X.getGridElements(t).forEach(s=>{s.gridstack||(s.gridstack=new X(s,y.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 ?
|
|
15
|
-
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 a=i.gridstack;return t&&(a.opts={...a.opts,...t}),t.children!==void 0&&a.load(t.children),a}return(!e.classList.contains("grid-stack")||X.addRemoveCB)&&(X.addRemoveCB?i=X.addRemoveCB(e,t,!0,!0):i=y.createDiv(["grid-stack",t.class],e)),X.init(t,i)}static registerEngine(e){X.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=y.createDiv([this.opts.placeholderClass,be.itemClass,this.opts.itemClass]);const e=y.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);const i=y.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s=t.columnOpts?.breakpoints;const o=t;if(o.oneColumnModeDomSort&&(delete o.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),o.oneColumnSize||o.disableOneColumnMode===!1){const h=o.oneColumnSize||768;delete o.oneColumnSize,delete o.disableOneColumnMode,t.columnOpts=t.columnOpts||{},s=t.columnOpts.breakpoints=t.columnOpts.breakpoints||[];let f=s.find(p=>p.c===1);f?f.w=h:(f={c:1,w:h},s.push(f,{c:12,w:h+1}))}const a=t.columnOpts;a&&(!a.columnWidth&&!a.breakpoints?.length?(delete t.columnOpts,s=void 0):a.columnMax=a.columnMax||12),s?.length>1&&s.sort((h,f)=>(f.w||0)-(h.w||0));const l={...y.cloneDeep(be),column:y.toNumber(e.getAttribute("gs-column"))||be.column,minRow:i||y.toNumber(e.getAttribute("gs-min-row"))||be.minRow,maxRow:i||y.toNumber(e.getAttribute("gs-max-row"))||be.maxRow,staticGrid:y.toBool(e.getAttribute("gs-static"))||be.staticGrid,sizeToContent:y.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||be.draggable.handle},removableOptions:{accept:t.itemClass||be.removableOptions.accept,decline:be.removableOptions.decline}};e.getAttribute("gs-animate")&&(l.animate=y.toBool(e.getAttribute("gs-animate"))),t=y.defaults(t,l),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 c=this.el.closest("."+be.itemClass)?.gridstackNode;c&&(c.subGrid=this,this.parentGridNode=c,this.el.classList.add("grid-stack-nested"),c.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!==be.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit),this.cellHeight(t.cellHeight,!1)),t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=ke),this._styleSheetClass="gs-id-"+Ae._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();const d=t.engineClass||X.engineClass||Ae;if(this.engine=new d({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:h=>{let f=0;this.engine.nodes.forEach(p=>{f=Math.max(f,p.y+p.h)}),h.forEach(p=>{const C=p.el;C&&(p._removeDOM?(C&&C.remove(),delete p._removeDOM):this._writePosAttr(C,p))}),this._updateStyles(!1,f)}}),this._updateStyles(!1,0),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(h=>this._prepareElement(h)),delete this.engine._loading,this.batchUpdate(!1)),t.children){const h=t.children;delete t.children,h.length&&this.load(h)}this.setAnimation(),t.subGridDynamic&&!Q.pauseDrag&&(Q.pauseDrag=!0),t.draggable?.pause!==void 0&&(Q.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e){if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i?.el?t=i.el:X.addRemoveCB?t=X.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return t;const s=this._readAttr(t);return y.defaults(e,s),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){const t=y.createDiv(["grid-stack-item",this.opts.itemClass]),i=y.createDiv(["grid-stack-item-content"],t);return y.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,X.renderCB(i,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(t))):X.renderCB(i,e),t}makeSubGrid(e,t,i,s=!0){let o=e.gridstackNode;if(o||(o=this.makeWidget(e).gridstackNode),o.subGrid?.el)return o.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;t=y.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...t||o.subGridOpts||{}}),o.subGridOpts=t;let u;t.column==="auto"&&(u=!0,t.column=Math.max(o.w||1,i?.w||1),delete t.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),d,h;if(s&&(this._removeDD(o.el),h={...o,x:0,y:0},y.removeInternalForSave(h),delete h.subGridOpts,o.content&&(h.content=o.content,delete o.content),X.addRemoveCB?d=X.addRemoveCB(this.el,h,!0,!1):(d=y.createDiv(["grid-stack-item"]),d.appendChild(c),c=y.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){const p=u?t.column:o.w,C=o.h+i.h,O=o.el.style;O.transition="none",this.update(o.el,{w:p,h:C}),setTimeout(()=>O.transition=null)}const f=o.subGrid=X.addGrid(c,t);return i?._moving&&(f._isTemp=!0),u&&(f._autoColumn=!0),s&&f.makeWidget(d,h),i&&(i._moving?window.setTimeout(()=>y.simulateMouseEvent(i._event,"mouseenter",f.el),0):f.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),f}removeAsSubGrid(e){const t=this.parentGridNode?.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,t.makeWidget(i.el,i)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>y.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=X.saveCB){const s=this.engine.save(e,i);if(s.forEach(o=>{if(e&&o.el&&!o.subGrid&&!i){const a=o.el.querySelector(".grid-stack-item-content");o.content=a?.innerHTML,o.content||delete o.content}else if(!e&&!i&&delete o.content,o.subGrid?.el){const a=o.subGrid.save(e,t,i);o.subGridOpts=t?a:{children:a},delete o.subGrid}delete o.el}),t){const o=y.cloneDeep(this.opts);o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===(this.el.style.direction==="rtl")&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto");const a=o._alwaysShowResizeHandle;return delete o._alwaysShowResizeHandle,a!==void 0?o.alwaysShowResizeHandle=a:delete o.alwaysShowResizeHandle,y.removeInternalAndSame(o,be),o.children=s,o}return s}load(e,t=X.addRemoveCB||!0){e=y.cloneDeep(e);const i=this.getColumn();e.forEach(c=>{c.w=c.w||1,c.h=c.h||1}),e=y.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(c=>{s=Math.max(s,(c.x||0)+c.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&this.engine.cacheLayout(e,s,!0);const o=X.addRemoveCB;typeof t=="function"&&(X.addRemoveCB=t);const a=[];this.batchUpdate();const l=!this.engine.nodes.length;l&&this.setAnimation(!1),!l&&t&&[...this.engine.nodes].forEach(d=>{if(!d.id)return;y.find(e,d.id)||(X.addRemoveCB&&X.addRemoveCB(this.el,d,!1,!1),a.push(d),this.removeWidget(d.el,!0,!1))}),this.engine._loading=!0;const u=[];return this.engine.nodes=this.engine.nodes.filter(c=>y.find(e,c.id)?(u.push(c),!1):!0),e.forEach(c=>{const d=y.find(u,c.id);if(d){if(y.shouldSizeToContent(d)&&(c.h=d.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||d.w,c.h=c.h||d.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(d),y.samePos(d,c)&&this.engine.nodes.length>1&&(this.moveNode(d,{...c,forceCollide:!0}),y.copyPos(c,d)),this.update(d.el,c),c.subGridOpts?.children){const h=d.el.querySelector(".grid-stack");h&&h.gridstack&&h.gridstack.load(c.subGridOpts.children)}}else t&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?X.addRemoveCB=o:delete X.addRemoveCB,l&&this.opts?.animate&&this.setAnimation(this.opts.animate,!0),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;const t=this.el.querySelector("."+this.opts.itemClass);if(t){const s=y.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}const 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){const s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}const i=y.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){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.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 o=0;for(;o<e.breakpoints.length&&s<=e.breakpoints[o].w;)i=e.breakpoints[o++].c||t}if(i!==t){const o=e.breakpoints?.find(a=>a.c===i);return this.column(i,o?.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;const 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))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}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(),delete this.parentGridNode?.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,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){const i=this.el.getBoundingClientRect();let s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};const o=e.left-s.left,a=e.top-s.top,l=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/l),y:Math.floor(a/u)}}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){const i=X.getElement(e);if(!i)return;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);const s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&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=>{s.detail&&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 e?(X.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let o=s.gridstackNode;o||(o=this.engine.nodes.find(a=>s===a.el)),o&&(t&&X.addRemoveCB&&X.addRemoveCB(this.el,o,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(o,t,i),t&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&X.addRemoveCB&&X.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=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):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.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){const t=this.opts;return e.acceptWidgets!==void 0&&this._setupAcceptWidget(),e.animate!==void 0&&this.setAnimation(),e.cellHeight&&(this.cellHeight(e.cellHeight,!0),delete e.cellHeight),e.class&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),this.el.classList.add(e.class)),typeof e.column=="number"&&!e.columnOpts&&(this.column(e.column),delete e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0&&(t.minRow=t.maxRow=e.row),e.children?.length&&(this.load(e.children),delete e.children),this.opts={...this.opts,...e},this}update(e,t){return X.getElements(e).forEach(i=>{const s=i?.gridstackNode;if(!s)return;const o={...y.copyPos({},s),...y.cloneDeep(t)};this.engine.nodeBoundFix(o),delete o.autoPosition;const a=["x","y","w","h"];let l;if(a.some(d=>o[d]!==void 0&&o[d]!==s[d])&&(l={},a.forEach(d=>{l[d]=o[d]!==void 0?o[d]:s[d],delete o[d]})),!l&&(o.minW||o.minH||o.maxW||o.maxH)&&(l={}),o.content!==void 0){const d=i.querySelector(".grid-stack-item-content");d&&d.textContent!==o.content&&(s.content=o.content,X.renderCB(d,o),s.subGrid?.el&&(d.appendChild(s.subGrid.el),s.subGrid.opts.styleInHead||s.subGrid._updateStyles(!0))),delete o.content}let u=!1,c=!1;for(const d in o)d[0]!=="_"&&s[d]!==o[d]&&(s[d]=o[d],u=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(y.sanitizeMinMax(s),l){const d=l.w!==void 0&&l.w!==s.w;this.moveNode(s,l),d&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(d,s),delete s._orig}(l||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el)}),this}moveNode(e,t){const i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(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 o=t.h?t.h*s:e.clientHeight,a;if(t.resizeToContentParent&&(a=e.querySelector(t.resizeToContentParent)),a||(a=e.querySelector(X.resizeToContentParent)),!a)return;const l=e.clientHeight-a.clientHeight,u=t.h?t.h*s-l:a.clientHeight;let c;if(t.subGrid){c=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);const f=t.subGrid.el.getBoundingClientRect(),p=t.subGrid.el.parentElement.getBoundingClientRect();c+=f.top-p.top}else{if(t.subGridOpts?.children?.length)return;{const f=a.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${X.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=f.getBoundingClientRect().height||u}}if(u===c)return;o+=c-u;let d=Math.ceil(o/s);const h=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;h&&d>h&&(d=h,e.classList.add("size-to-content-max")),t.minH&&d<t.minH?d=t.minH:t.maxH&&d>t.maxH&&(d=t.maxH),d!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:d}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){X.resizeToContentCB?X.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return X.getElements(e).forEach(i=>{const s=i.gridstackNode;if(!y.canBeRotated(s))return;const o={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(t){const l=t.left>0?Math.floor(t.left/this.cellWidth()):0,u=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;o.x=s.x+l-(s.h-(u+1)),o.y=s.y+u-l}Object.keys(o).forEach(l=>{o[l]===void 0&&delete o[l]});const a=s._orig;this.update(i,o),s._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const i=y.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");const t=arguments;let 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;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(t=>{delete t._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,t){const 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;y.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;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit,o=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){const a=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=y.createStylesheet(this._styleSheetClass,a,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,y.addCSSRule(this._styles,o,`height: ${i}${s}`);const l=this.opts.marginTop+this.opts.marginUnit,u=this.opts.marginBottom+this.opts.marginUnit,c=this.opts.marginRight+this.opts.marginUnit,d=this.opts.marginLeft+this.opts.marginUnit,h=`${o} > .grid-stack-item-content`,f=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;y.addCSSRule(this._styles,h,`top: ${l}; right: ${c}; bottom: ${u}; left: ${d};`),y.addCSSRule(this._styles,f,`top: ${l}; right: ${c}; bottom: ${u}; left: ${d};`),y.addCSSRule(this._styles,`${o} > .ui-resizable-n`,`top: ${l};`),y.addCSSRule(this._styles,`${o} > .ui-resizable-s`,`bottom: ${u}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${c}; top: ${l}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${c}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${c}; bottom: ${u}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${d}; top: ${l}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${d}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${d}; bottom: ${u}`)}if(t=t||this._styles._max,t>this._styles._max){const a=l=>i*l+s;for(let l=this._styles._max+1;l<=t;l++)y.addCSSRule(this._styles,`${o}[gs-y="${l}"]`,`top: ${a(l)}`),y.addCSSRule(this._styles,`${o}[gs-h="${l+1}"]`,`height: ${a(l+1)}`);this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let t=this.getRow()+this._extraDragRow;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!e){const o=y.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===s){const a=Math.floor(o.h/i);t<a&&(t=a)}}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&&y.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(be.itemClass,this.opts.itemClass);const s=y.shouldSizeToContent(i);return s?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),y.lazyLoad(i)||this.prepareDragDrop(i.el),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);const i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const s in i)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){const i={};i.x=y.toNumber(e.getAttribute("gs-x")),i.y=y.toNumber(e.getAttribute("gs-y")),i.w=y.toNumber(e.getAttribute("gs-w")),i.h=y.toNumber(e.getAttribute("gs-h")),i.autoPosition=y.toBool(e.getAttribute("gs-auto-position")),i.noResize=y.toBool(e.getAttribute("gs-no-resize")),i.noMove=y.toBool(e.getAttribute("gs-no-move")),i.locked=y.toBool(e.getAttribute("gs-locked"));const s=e.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=y.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=e.getAttribute("gs-id"),i.maxW=y.toNumber(e.getAttribute("gs-max-w")),i.minW=y.toNumber(e.getAttribute("gs-min-w")),i.maxH=y.toNumber(e.getAttribute("gs-max-h")),i.minH=y.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 o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="gs-size-to-content"&&delete i[o]}return i}_setStaticClass(){const 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(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let t=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),t=!0):t=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(t),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),this.animationDelay);if(t)y.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>y.shouldSizeToContent(i))){const i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{y.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.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=y.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 y.getElement(e)}static getElements(e=".grid-stack-item"){return y.getElements(e)}static getGridElement(e){return X.getElement(e)}static getGridElements(e){return y.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=y.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=y.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=y.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=y.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=y.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 Ee}static setupDragIn(e,t,i,s=document){t?.pause!==void 0&&(Q.pauseDrag=t.pause),t={appendTo:"body",helper:"clone",...t||{}},(typeof e=="string"?y.getElements(e,s):e).forEach((a,l)=>{Ee.isDraggable(a)||Ee.dragIn(a,t),i?.[l]&&(a.gridstackNode=i[l])})}movable(e,t){return this.opts.staticGrid?this:(X.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(X.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),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.prepareDragDrop(i.el),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.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&X._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Ee.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 Ee.droppable(this.el,"destroy"),this;let e,t;const i=(s,o,a)=>{a=a||o;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const f=a.getBoundingClientRect();a.style.left=f.x+(this.dragTransform.xScale-1)*(s.clientX-f.x)/this.dragTransform.xScale+"px",a.style.top=f.y+(this.dragTransform.yScale-1)*(s.clientY-f.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:u,left:c}=a.getBoundingClientRect();const d=this.el.getBoundingClientRect();c-=d.left,u-=d.top;const h={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/t)),l.y=Math.max(0,Math.round(u/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){Ee.off(o,"drag");return}l._willFitPos&&(y.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,s,h,l,t,e)}else this._dragOrResize(a,s,h,l,t,e)};return Ee.droppable(this.el,{accept:s=>{const o=s.gridstackNode||this._readAttr(s,!1);if(o?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(s);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=s.matches(l)}if(a&&o&&this.opts.maxRow){const l={w:o.w,h:o.h,minW:o.minW,minH:o.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(s,o,a)=>{let l=a?.gridstackNode||o.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(o,a),a=a||o,t=this.cellWidth(),e=this.getCellHeight(!0),!l){const d=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(d){try{l=JSON.parse(d)}catch{console.error("Gridstack dropover: Bad JSON format: ",d)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}l||(l=this._readAttr(a)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,a.gridstackNode=l);const u=l.w||Math.round(a.offsetWidth/t)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=l),o.gridstackNode=l={...l,w:u,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=u,l.h=c,l._temporaryRemoved=!0),X._itemRemoving(l.el,!1),Ee.on(o,"drag",i),i(s,o,a),!1}).on(this.el,"dropout",(s,o,a)=>{const l=a?.gridstackNode||o.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(o,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(s,o,a)=>{const l=a?.gridstackNode||o.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const u=!!this.placeholder.parentElement,c=o!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode;const d=u&&this.opts.animate;d&&this.setAnimation(!1);const h=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,u&&h?.grid&&h.grid!==this){const p=h.grid;p.engine.removeNodeFromLayoutCache(h),p.engine.removedNodes.push(h),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!l||(u&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Ee.off(o,"drag"),a!==o?(a.remove(),o=a):o.remove(),this._removeDD(o),!u))return!1;const f=l.subGrid?.el?.gridstack;return y.copyPos(l,this._readAttr(this.placeholder)),y.removePositioningStyles(o),c&&(l.content||l.subGridOpts||X.addRemoveCB)?(delete l.el,o=this.addWidget(l)):(this._prepareElement(o,!0,l),this.el.appendChild(o),this.resizeToContentCheck(!1,l),f&&(f.parentGridNode=l,f.opts.styleInHead||f._updateStyles(!0)),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},h&&h.grid?h:void 0,l),d&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(e,t){if(!e)return;const i=e?e.gridstackNode:void 0;!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;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Ee.isDroppable(e)&&Ee.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>X._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>X._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){const i=e?.gridstackNode;if(!i)return;const s=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,a=this.opts.staticGrid||s&&o;if((t||a)&&(i._initDD&&(this._removeDD(e),delete i._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!i._initDD){let l,u;const c=(f,p)=>{this._gsEventHandler[f.type]&&this._gsEventHandler[f.type](f,f.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,f,p,i,l,u)},d=(f,p)=>{this._dragOrResize(e,f,p,i,l,u)},h=f=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._event,delete i._lastTried;const p=i.w!==i._orig.w,C=f.target;if(!(!C.gridstackNode||C.gridstackNode.grid!==this)){if(i.el=C,i._isAboutToRemove){const O=e.gridstackNode.grid;O._gsEventHandler[f.type]&&O._gsEventHandler[f.type](f,C),O.engine.nodes.push(i),O.removeWidget(e,!0,!0)}else y.removePositioningStyles(C),i._temporaryRemoved?(y.copyPos(i,i._orig),this._writePosAttr(C,i),this.engine.addNode(i)):this._writePosAttr(C,i),this._gsEventHandler[f.type]&&this._gsEventHandler[f.type](f,C);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),f.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(p,i))}};Ee.draggable(e,{start:c,stop:h,drag:d}).resizable(e,{start:c,stop:h,resize:d}),i._initDD=!0}return Ee.draggable(e,s?"disable":"enable").resizable(e,o?"disable":"enable"),this}_onStartMoving(e,t,i,s,o,a){if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,s.grid?.el)this.dragTransform=y.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=y.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(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(o,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){const l=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;Ee.resizable(e,"option","minWidth",o*Math.min(s.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(s.minH||1,u)).resizable(e,"option","maxWidth",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(e,"option","maxHeight",a*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",a*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(e,t,i,s,o,a){const l={...s._orig};let u,c=this.opts.marginLeft,d=this.opts.marginRight,h=this.opts.marginTop,f=this.opts.marginBottom;const p=Math.round(a*.1),C=Math.round(o*.1);if(c=Math.min(c,C),d=Math.min(d,C),h=Math.min(h,p),f=Math.min(f,p),t.type==="drag"){if(s._temporaryRemoved)return;const R=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&y.updateScrollPosition(e,i.position,R);const T=i.position.left+(i.position.left>s._lastUiPosition.left?-d:c),P=i.position.top+(i.position.top>s._lastUiPosition.top?-f:h);l.x=Math.round(T/o),l.y=Math.round(P/a);const b=this._extraDragRow;if(this.engine.collide(s,l)){const E=this.getRow();let k=Math.max(0,l.y+s.h-E);this.opts.maxRow&&E+k>this.opts.maxRow&&(k=Math.max(0,this.opts.maxRow-E)),this._extraDragRow=k}else this._extraDragRow=0;if(this._extraDragRow!==b&&this._updateContainerHeight(),s.x===l.x&&s.y===l.y)return}else if(t.type==="resize"){if(l.x<0||(y.updateScrollResize(t,e,a),l.w=Math.round((i.size.width-c)/o),l.h=Math.round((i.size.height-h)/a),s.w===l.w&&s.h===l.h)||s._lastTried&&s._lastTried.w===l.w&&s._lastTried.h===l.h)return;const R=i.position.left+c,T=i.position.top+h;l.x=Math.round(R/o),l.y=Math.round(T/a),u=!0}s._event=t,s._lastTried=l;const O={x:i.position.left+c,y:i.position.top+h,w:(i.size?i.size.width:s.w*o)-c-d,h:(i.size?i.size.height:s.h*a)-h-f};if(this.engine.moveNodeCheck(s,{...l,cellWidth:o,cellHeight:a,rect:O,resizing:u})){s._lastUiPosition=i.position,this.engine.cacheRects(o,a,h,d,f,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const R=t.target;s._sidebarOrig||this._writePosAttr(R,s),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,R)}}_leave(e,t){t=t||e;const i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,Ee.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;const s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&X._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return vg(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}X.renderCB=(r,e)=>{r&&e?.content&&(r.textContent=e.content)},X.resizeToContentParent=".grid-stack-item-content",X.Utils=y,X.Engine=Ae,X.GDRev="11.5.1";const Dg=(r,e)=>{let t=0;const i=new Map;e.forEach(o=>{const a=o.layout.position.row,l=i.get(a),u=o.layout.size.rows===1&&!!o.layout.size.fit_to_content;t=Math.max(t,a+o.layout.size.rows),l===void 0?i.set(a,u):i.set(a,l&&u)});const s=[];for(let o=0;o<t;o++)i.get(o)?s.push("auto"):s.push(`${r}px`);return s},Gr=(r,e,t)=>e.get(`${r.id}`)??r.layout.size.rows*t,kg=(r,e,t,i)=>e.map((s,o)=>{if(s!=="auto")return i;const a=r.filter(l=>l.layout.position.row===o);return Math.max(...a.map(l=>Gr(l,t,i)))}),Ng=(r,e,t)=>{const i=[...r].sort((a,l)=>a.layout.position.row-l.layout.position.row||a.layout.position.col-l.layout.position.col),s=new Map;let o=0;return i.forEach(a=>{const l=Gr(a,e,t);s.set(`${a.id}`,{x:0,y:o,w:1,h:l}),o+=l}),s},Ag=(r,e,t,{cellsPerRow:i,columns:s})=>{if(s===1)return Ng(r,t,i);const o=[0];return kg(r,e,t,i).forEach(a=>{o.push(o[o.length-1]+a)}),new Map(r.map(a=>{const{position:l,size:u}=a.layout,c=o[l.row],d=o[l.row+u.rows];return[`${a.id}`,{x:l.col,y:c,w:u.cols,h:d-c}]}))},Lg=["data-id","data-testid"],Ug={class:"grid-stack-item-content"},Mg=De(n.defineComponent({__name:"DraggableGridLayout",props:{tiles:{},tileHeight:{default:it},columns:{default:zt},editable:{type:Boolean,default:!1},bottomTrim:{default:0}},emits:["update-tiles"],setup(r,{expose:e,emit:t}){const i=r,s=t,o=n.ref(null),a=n.ref(new Map(i.tiles.map(w=>[`${w.id}`,w])));let l=null,u=!1;const c=w=>`[data-id="${w}"]`,d=n.computed(()=>Dg(i.tileHeight,i.tiles)),h=w=>!i.editable&&d.value[w.layout.position.row]==="auto",f=()=>i.editable?1:rt,p=parseInt(fa,10)/2,C=n.ref(new Map),O=n.ref(new Map),R=n.ref(!1),T=w=>R.value||h(w),P=n.computed(()=>Ag(i.tiles,d.value,C.value,{cellsPerRow:rt,columns:R.value?1:i.columns})),b=n.computed(()=>{if(i.editable)return 0;const S=(R.value?[...i.tiles].sort((N,oe)=>N.layout.position.row-oe.layout.position.row||N.layout.position.col-oe.layout.position.col).slice(-1):i.tiles.filter(N=>N.layout.position.row===d.value.length-1)).filter(N=>C.value.has(`${N.id}`));if(!S.length||!S.every(T))return 0;const G=Math.max(...S.map(N=>C.value.get(`${N.id}`))),M=Math.max(...S.map(N=>O.value.get(`${N.id}`))),D=G*(i.tileHeight/rt)-(M+2*p);return Math.max(0,Math.round(D*100)/100)}),E=w=>i.editable?{id:`${w.id}`,x:w.layout.position.col,y:w.layout.position.row,w:w.layout.size.cols,h:w.layout.size.rows}:{id:`${w.id}`,...P.value.get(`${w.id}`)},k=()=>({margin:p,column:i.columns,cellHeight:i.tileHeight/f(),resizable:{handles:"se, sw"},handle:".tile-header",staticGrid:!i.editable,float:!i.editable}),x=w=>w.map(S=>{const G=a.value.get(`${S.el?.getAttribute("data-id")}`);if(G)return{...G,layout:{position:{col:Number(S.x),row:Number(S.y)},size:{...G.layout.size,cols:Number(S.w),rows:Number(S.h)}}}}).filter(S=>S!==void 0),K=(w,S)=>{l&&!u&&(x(S).forEach(M=>{a.value.set(`${M.id}`,M)}),s("update-tiles",Array.from(a.value.values())))},g=(w,S)=>{S.forEach(G=>{a.value.delete(`${G.el?.getAttribute("data-id")}`)}),s("update-tiles",Array.from(a.value.values()))},m=w=>o.value?.querySelector(`${c(w)} > .grid-stack-item-content > :first-child`),_=w=>Math.ceil((w+2*p)/(i.tileHeight/rt)),U=()=>{const w=new Map,S=new Map;i.tiles.filter(T).forEach(D=>{const N=m(D.id);if(N){const{height:oe}=N.getBoundingClientRect();w.set(`${D.id}`,_(oe)),S.set(`${D.id}`,oe)}}),(w.size!==C.value.size||[...w].some(([D,N])=>C.value.get(D)!==N))&&(C.value=w),(S.size!==O.value.size||[...S].some(([D,N])=>O.value.get(D)!==N))&&(O.value=S)},A=new ResizeObserver(()=>window.requestAnimationFrame(U)),F=()=>{A.disconnect(),i.tiles.filter(T).forEach(w=>{const S=m(w.id);S&&A.observe(S)})},v=new ResizeObserver(([w])=>{R.value=!i.editable&&w.contentRect.width<=parseInt(da,10)}),q=(w,S)=>{const G=w.x===S.x&&w.y===S.y,M=w.w===S.w&&w.h===S.h;return G&&M},V=()=>{if(!l)return;const w=new Set(i.tiles.map(M=>`${M.id}`)),S=new Map(l.engine.nodes.map(M=>[`${M.id}`,M]));S.forEach((M,D)=>{!w.has(D)&&M.el&&(l.removeWidget(M.el,!1,!1),a.value.delete(D))});const G=i.tiles.filter(M=>S.has(`${M.id}`)).map(E);u=!0,G.some(M=>!q(S.get(`${M.id}`),M))&&l.load(G,!1),u=!1,i.tiles.filter(M=>!S.has(`${M.id}`)).forEach(M=>{l.makeWidget(c(M.id),{...E(M),autoPosition:i.editable})}),F()};n.onMounted(()=>{o.value&&(l=X.init(k(),o.value),l.batchUpdate(),i.tiles.forEach(w=>l.makeWidget(c(w.id),E(w))),l.batchUpdate(!1),F(),v.observe(o.value),i.editable&&(l.on("change",K),l.on("added",K),l.on("removed",g)))}),n.onUnmounted(()=>{A.disconnect(),v.disconnect(),l&&l.destroy(!1)});const W=w=>{if(l&&o.value){const S=o.value.querySelector(c(w));S&&l.removeWidget(S)}};return n.watch(R,w=>l?.column(w?1:i.columns,"none")),n.watch(()=>[i.tiles.map(w=>[w.id,w.layout]),P.value],V,{deep:!0,flush:"post"}),n.watchEffect(()=>{i.tiles.forEach(w=>{a.value.set(`${w.id}`,w)})}),e({removeWidget:W}),(w,S)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:o,class:"grid-stack",style:n.normalizeStyle({marginBottom:`-${r.bottomTrim+b.value}px`})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.tiles,G=>(n.openBlock(),n.createElementBlock("div",{key:G.id,"data-id":`${G.id}`,"data-testid":`grid-stack-item-${G.id}`},[n.createElementVNode("div",Ug,[n.renderSlot(w.$slots,"tile",{fitToContent:h(G),tile:G},void 0,!0)])],8,Lg))),128))],4))}}),[["__scopeId","data-v-8a2b0f6f"]]),Kg=r=>{const e={position:{col:0,row:0},size:r.layout.size};if(r.type==="slottable")return{id:crypto.randomUUID(),type:"slottable",layout:e};const t=r.meta,i={...t,chart:{...t.chart}};return"chart_title"in i.chart&&(i.chart.chart_title=i.chart.chart_title?`Copy of ${i.chart.chart_title}`:""),{id:crypto.randomUUID(),type:"chart",definition:i,layout:e}},Bg={key:0,class:"fullscreen-header"},zg=["id"],Pg={key:1,class:"boundary-header"},qg={key:0,class:"boundary-title"},Hg={key:1,class:"boundary-description"},Gg=De(n.defineComponent({__name:"DashboardRenderer",props:n.mergeModels({context:{},preview:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:n.mergeModels(["edit-tile","tile-time-range-zoom","tiles-loaded"],["update:modelValue"]),setup(r,{expose:e,emit:t}){if(n.useCssVars(I=>({v46ff5d3f:C.value})),r.context.disableCoordination!==!0){const I=xs();n.provide(Gi,I)}const i=t,s=n.useModel(r,"modelValue"),o=n.computed(()=>Array.isArray(s.value)?s.value:[{definition:s.value}]),a=I=>o.value[I].definition,l=n.computed(()=>{const I=B=>B.type==="slottable"||"definition"in B&&B.definition?.chart?.type==="slottable";return o.value.reduce((B,z)=>{const Y=x(z),J=new Set;return z.definition.tiles.forEach(L=>{if(I(L))return;const $=L.id?Y[L.id]:void 0;$?J.has($.groupId)||(J.add($.groupId),B++):B++}),B},0)}),{i18n:u}=ue.useI18n(),c=n.ref(0),d=[],h=(I,B)=>{d[I]=B},f=n.ref(),p=n.ref(),C=n.ref("scale(1)"),O=new Set,R=n.inject(Ie);R||(console.warn("Analytics dashboards require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")),ue.useRequestQueue();const{exportPdf:T,exportState:P}=ue.useExportPdf(p),b=(I,B)=>{O.add(`${B}-${I.id}`),O.size>=l.value&&i("tiles-loaded",!0)},E=n.computed(()=>{const B=`renderer.trendRange.${ge.value.type==="absolute"?"custom":ge.value.time_range}`;return u.te(B)?u.t(B):""}),k=(I,B)=>{const z=I.layout.position.row-B.layout.position.row;return z!==0?z:I.layout.position.col-B.layout.position.col},x=I=>{const B={};return I.tileGroups?.forEach(z=>{z.tileIdLabels.forEach(([Y])=>{B[Y]=z})}),B},K=I=>{const B=I.definition.tiles.map(L=>{if(N.value&&!L.id&&console.warn("No id provided for tile. One will be generated automatically,","however tracking changes to this tile may not work as expected.",L),L.type==="slottable")return{layout:L.layout,type:L.type,id:L.id??crypto.randomUUID()};let $=L.definition;const j=L.type??"chart",ce=Ha($,E.value);return ce!==$.header_description&&($={...$,header_description:ce}),{layout:L.layout,meta:$,type:j,id:L.id??crypto.randomUUID()}}),z=x(I),Y=new Map(B.map(L=>[L.id,L])),J=new Set;return B.reduce((L,$)=>{const j=z[$.id];if(!j)return L.push($),L;if(J.has(j.groupId))return L;J.add(j.groupId);const ce=j.tileIdLabels.map(([ne,me])=>({id:ne,label:me,tile:Y.get(ne)})).filter(({tile:ne})=>!!ne?.meta).map(({id:ne,label:me,tile:_e})=>({id:ne,label:me,definition:_e.meta})),Z=Y.get(ce[0]?.id);return Z&&L.push({...Z,layout:j.layout,groupTiles:ce}),L},[])},g=n.computed(()=>o.value.map(I=>K(I))),m=(I,B)=>{const z=I.groupTiles?.find(Y=>Y.id===B);return z&&z.id!==I.id?{...I,id:z.id,meta:z.definition}:I},_=(I,B)=>{i("edit-tile",m(I,B))},U=I=>I.type==="slottable"?!0:I.meta?.chart.type==="slottable",A=I=>I.type==="slottable",F=I=>{if(I.type==="slottable")return I.id;const B=I.meta?.chart;return B&&A(B)?B.id:void 0},v=(I,B,z)=>{const Y=a(B);try{const J=Kg(m(I,z));Y.tiles.push(JSON.parse(JSON.stringify(J)))}catch(J){console.warn(J)}},q=(I,B,z)=>{const Y=I.groupTiles,J=Y?.some(L=>L.id===z)?z:I.id;if(Y&&Y.length>1){const L=a(B);L.tiles=L.tiles.filter($=>$.id!==J)}else d[B]?.removeWidget(I.id);O.delete(`${B}-${J}`)},V=()=>{O.clear(),c.value++},W=(I,B)=>{const z=a(B),Y=I.map($=>$.type==="slottable"?{id:$.id,type:$.type,layout:$.layout}:{id:$.id,type:$.type,layout:$.layout,definition:$.meta}),J=new Set(Y.map($=>$.id)),L=z.tiles.filter($=>$.id&&!J.has($.id)&&x(o.value[B])[$.id]);z.tiles=[...Y,...L].sort(k)},w=async()=>{if(C.value="scale(1)",await n.nextTick(),p.value){const{availWidth:I,availHeight:B}=window.screen,{width:z,height:Y}=p.value.getBoundingClientRect(),J=Math.min(B/Y,I/z);C.value=`scale(${J})`}},S=()=>{f.value&&(document.fullscreenElement?document.exitFullscreen():f.value.requestFullscreen())},G=n.ref(!1),M=n.computed(()=>N.value&&!G.value),D=()=>{G.value=document.fullscreenElement!==null,G.value&&w()},{editable:N,enrichedContext:oe,queryReady:ae,showTileActions:de,timeSpec:ge}=ue.useDashboardContext({globalFilters:n.computed(()=>[]),context:n.computed(()=>r.context),isFullscreen:G,preview:n.computed(()=>r.preview)}),ie=I=>({...oe.value,filters:[...r.context.filters??[],...I.preset_filters??[]]});return e({refresh:V,toggleFullscreen:S,exportPdf:T,pdfExportState:P}),(I,B)=>{const z=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",{ref_key:"dashboardContainer",ref:f,class:n.normalizeClass(["kong-ui-public-dashboard-renderer",{"is-fullscreen":G.value}]),onFullscreenchange:D},[n.createElementVNode("div",{ref_key:"layoutContainer",ref:p,class:"layout"},[n.unref(R)&&G.value?(n.openBlock(),n.createElementBlock("div",Bg,[n.renderSlot(I.$slots,"fullscreenHeader",{},void 0,!0)])):n.createCommentVNode("",!0),n.unref(R)?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(o.value,(Y,J)=>(n.openBlock(),n.createElementBlock("div",{key:`dash-${J}`,class:n.normalizeClass(["dashboard-boundary",{multiple:o.value.length>1}])},[Y.anchorId?(n.openBlock(),n.createElementBlock("a",{key:0,id:Y.anchorId},null,8,zg)):n.createCommentVNode("",!0),Y.title||Y.description?(n.openBlock(),n.createElementBlock("div",Pg,[Y.title?(n.openBlock(),n.createElementBlock("div",qg,n.toDisplayString(Y.title),1)):n.createCommentVNode("",!0),Y.description?(n.openBlock(),n.createElementBlock("div",Hg,n.toDisplayString(Y.description),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(Mg,{key:`layout-${M.value}`,ref_for:!0,ref:L=>h(J,L),"bottom-trim":o.value.length>1?4:0,columns:Y.definition.columns,editable:M.value,"tile-height":Y.definition.tile_height,tiles:g.value[J],onUpdateTiles:L=>W(L,J)},{tile:n.withCtx(({tile:L,fitToContent:$})=>[U(L)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["tile-container slottable-tile",{"fit-to-content":$}])},[n.renderSlot(I.$slots,F(L),{},void 0,!0)],2)):(n.openBlock(),n.createBlock(zr,{key:G.value?`${L.id}-tile`:`${L.id}-tile-fullscreen`,"refresh-counter":c.value,"onUpdate:refreshCounter":B[0]||(B[0]=j=>c.value=j),class:"tile-container",context:ie(Y.definition),definition:L.meta,"fit-to-content":$,"group-tiles":L.groupTiles,height:L.layout.size.rows*(Y.definition.tile_height||n.unref(it))+parseInt(n.unref(Pi),10),"hide-actions":!n.unref(de),"is-fullscreen":G.value,preview:r.preview,"query-ready":n.unref(ae),"tile-id":L.id,"tile-type":L.type,onDuplicateTile:(j,ce)=>v(L,J,ce),onEditTile:(j,ce)=>_(L,ce),onRemoveTile:(j,ce)=>q(L,J,ce),onTileLoaded:j=>b(L,J),onTileTimeRangeZoom:B[1]||(B[1]=j=>i("tile-time-range-zoom",j))},null,8,["refresh-counter","context","definition","fit-to-content","group-tiles","height","hide-actions","is-fullscreen","preview","query-ready","tile-id","tile-type","onDuplicateTile","onEditTile","onRemoveTile","onTileLoaded"]))]),_:2},1032,["bottom-trim","columns","editable","tile-height","tiles","onUpdateTiles"]))],2))),128)):(n.openBlock(),n.createBlock(z,{key:1,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(u).t("renderer.noQueryBridge")),1)]),_:1}))],512)],34)}}}),[["__scopeId","data-v-1df9740b"]]),$g=n.defineComponent({__name:"DashboardTilePreview",props:{context:{},definition:{},globalFilters:{default:()=>[]},preview:{type:Boolean,default:!1}},emits:["chart-data","tile-time-range-zoom","tile-bounds-change"],setup(r,{expose:e,emit:t}){const i=n.useTemplateRef("root"),s=n.useTemplateRef("dashboard-tile"),o=crypto.randomUUID(),a=t,l=b=>{a("tile-time-range-zoom",b)},u=b=>{a("chart-data",b)},c=b=>{a("tile-bounds-change",b)},{i18n:d}=ue.useI18n(),{enrichedContext:h,queryReady:f}=ue.useDashboardContext({globalFilters:n.toRef(()=>r.globalFilters),context:n.toRef(()=>r.context),preview:n.computed(()=>r.preview)}),p=n.computed(()=>Ne(r.definition)),C=n.computed(()=>p.value?"columns"in r.definition.query&&!r.definition.query.columns?.length:!("metrics"in r.definition.query)||!r.definition.query.metrics||r.definition.query.metrics.length===0),O=n.ref(it);let R;n.onMounted(()=>{const b=i.value?.parentElement;b&&(O.value=b.getBoundingClientRect().height,R=new ResizeObserver(([E])=>{const{height:k}=E.contentRect;O.value=k}),R.observe(b))}),n.onUnmounted(()=>R?.disconnect());const T=n.ref(0);return e({refresh:()=>{T.value++},getExportData:()=>s.value?.getExportData()}),(b,E)=>{const k=n.resolveComponent("KEmptyState");return n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:i,"data-testid":"dashboard-tile-preview-root"},[C.value?(n.openBlock(),n.createBlock(k,{key:0,"action-button-visible":!1,"data-testid":"chart-not-configured-empty-state"},{title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(n.unref(d).t("renderer.not_configured.title")),1)]),default:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(n.unref(d).t("renderer.not_configured.description")),1)]),_:1})):(n.openBlock(),n.createBlock(zr,{key:1,ref:"dashboard-tile","refresh-counter":T.value,"onUpdate:refreshCounter":E[0]||(E[0]=x=>T.value=x),context:{...n.unref(h),editable:!1},definition:r.definition,height:O.value,"hide-actions":"",preview:r.preview,"query-ready":n.unref(f),"show-refresh":"","tile-id":n.unref(o),onChartData:u,onTileBoundsChange:c,onTileTimeRangeZoom:l},null,8,["refresh-counter","context","definition","height","preview","query-ready","tile-id"]))],512)}}}),Fg=r=>{if(r.type!=="chart")return r;const e=r.definition?.query;if(!e)return r;if(e.datasource==="api_usage"){console.warn("[@kong-ui-public/dashboard-renderer] A tile was filtered out for the Basic Tier",r);return}return r},Wg=r=>{if(r.type!=="chart"||Ne(r.definition))return r;const e=r.definition?.query;if(!e)return r;const t={...e,datasource:e.datasource==="basic"?"api_usage":e.datasource};return{...r,definition:{...r.definition,query:t}}},Vg=(r,e=zt)=>{if(!r.length)return[];let t=0,i=0,s=0;const o=[];for(const a of r){const l=a.layout?.size?.cols??1,u=a.layout?.size?.rows??1;i+l>e&&(t+=s,i=0,s=0);const c={...a,layout:{...a.layout,position:{...a.layout?.position??{},col:i,row:t}}};o.push(c),i+=l,s=Math.max(s,u)}return o},Yg=(r,e)=>{if(e){const s=r.tiles.map(Wg);return{...r,tiles:s}}const t=r.tiles.map(Fg).filter(s=>s!==void 0),i=Vg(t,r.columns);return{...r,tiles:i}},Xg=Object.freeze(Object.defineProperty({__proto__:null,default:n.defineComponent({__name:"GeoMapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["bounds-change"],setup(r,{emit:e}){const t=r,i=n.ref(void 0),s=n.computed(()=>i.value?ci.exploreResultToCountryMetrics(i.value):{}),o=n.computed(()=>i.value?i.value?.meta.metric_names&&i.value.meta.metric_names[0]:""),a=n.computed(()=>t.query.limit!==void 0&&t.query.limit>0?t.query.limit:re.COUNTRIES.length),l=n.computed(()=>{if(!t.query.filters?.find(({field:p,operator:C})=>p==="country_code"&&(C==="not_empty"||C==="empty"||C==="in"))){const p={field:"country_code",operator:"not_empty"};return{...t.query,filters:[...t.query.filters||[],p]}}return t.query}),u=n.computed(()=>{if(!i.value)return"";const f=i?.value?.meta.metric_units,p=i?.value?.meta?.metric_names;return f&&p&&f[p[0]]}),c=f=>{i.value=f},d=e,h=f=>{d("bounds-change",f)};return(f,p)=>(n.openBlock(),n.createBlock(Be,{context:r.context,"limit-override":a.value,query:l.value,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:c},{default:n.withCtx(()=>[n.createVNode(n.unref(ci.AnalyticsGeoMap),{bounds:r.chartOptions.bounds,"country-metrics":s.value,"fit-to-country":r.chartOptions.fit_to_country,metric:o.value,"metric-unit":u.value,"with-legend":r.chartOptions.legend||!1,onBoundsChange:h},null,8,["bounds","country-metrics","fit-to-country","metric","metric-unit","with-legend"])]),_:1},8,["context","limit-override","query","query-ready","refresh-counter"]))}})},Symbol.toStringTag,{value:"Module"}));ee.CELLS_PER_ROW=rt,ee.CP_ID_TOKEN=$i,ee.CsvExportModal=or,ee.DASHBOARD_COLS=zt,ee.DEFAULT_TILE_HEIGHT=it,ee.DEFAULT_TILE_REFRESH_INTERVAL_MS=Wi,ee.DashboardRenderer=Gg,ee.DashboardTilePreview=$g,ee.ENTITY_ID_TOKEN=Pt,ee.FULLSCREEN_LONG_REFRESH_INTERVAL_MS=Yi,ee.FULLSCREEN_SHORT_REFRESH_INTERVAL_MS=Vi,ee.INJECT_DASHBOARD_COORDINATOR=Gi,ee.INJECT_QUERY_PROVIDER=Ie,ee.TIMEFRAME_TOKEN=Fi,ee.configureAllowedDefinition=Yg,ee.getTimeRangeDurationMs=$t,ee.isTimeRangeUnsupported=Ft,ee.isTreemapCompatible=ti,ee.limitTimeRange=Wt,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})}));
|
|
15
|
+
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 a=i.gridstack;return t&&(a.opts={...a.opts,...t}),t.children!==void 0&&a.load(t.children),a}return(!e.classList.contains("grid-stack")||X.addRemoveCB)&&(X.addRemoveCB?i=X.addRemoveCB(e,t,!0,!0):i=y.createDiv(["grid-stack",t.class],e)),X.init(t,i)}static registerEngine(e){X.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=y.createDiv([this.opts.placeholderClass,be.itemClass,this.opts.itemClass]);const e=y.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);const i=y.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s=t.columnOpts?.breakpoints;const o=t;if(o.oneColumnModeDomSort&&(delete o.oneColumnModeDomSort,console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")),o.oneColumnSize||o.disableOneColumnMode===!1){const h=o.oneColumnSize||768;delete o.oneColumnSize,delete o.disableOneColumnMode,t.columnOpts=t.columnOpts||{},s=t.columnOpts.breakpoints=t.columnOpts.breakpoints||[];let f=s.find(p=>p.c===1);f?f.w=h:(f={c:1,w:h},s.push(f,{c:12,w:h+1}))}const a=t.columnOpts;a&&(!a.columnWidth&&!a.breakpoints?.length?(delete t.columnOpts,s=void 0):a.columnMax=a.columnMax||12),s?.length>1&&s.sort((h,f)=>(f.w||0)-(h.w||0));const l={...y.cloneDeep(be),column:y.toNumber(e.getAttribute("gs-column"))||be.column,minRow:i||y.toNumber(e.getAttribute("gs-min-row"))||be.minRow,maxRow:i||y.toNumber(e.getAttribute("gs-max-row"))||be.maxRow,staticGrid:y.toBool(e.getAttribute("gs-static"))||be.staticGrid,sizeToContent:y.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||be.draggable.handle},removableOptions:{accept:t.itemClass||be.removableOptions.accept,decline:be.removableOptions.decline}};e.getAttribute("gs-animate")&&(l.animate=y.toBool(e.getAttribute("gs-animate"))),t=y.defaults(t,l),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 c=this.el.closest("."+be.itemClass)?.gridstackNode;c&&(c.subGrid=this,this.parentGridNode=c,this.el.classList.add("grid-stack-nested"),c.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!==be.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit),this.cellHeight(t.cellHeight,!1)),t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=De),this._styleSheetClass="gs-id-"+Ae._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();const d=t.engineClass||X.engineClass||Ae;if(this.engine=new d({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:h=>{let f=0;this.engine.nodes.forEach(p=>{f=Math.max(f,p.y+p.h)}),h.forEach(p=>{const C=p.el;C&&(p._removeDOM?(C&&C.remove(),delete p._removeDOM):this._writePosAttr(C,p))}),this._updateStyles(!1,f)}}),this._updateStyles(!1,0),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(h=>this._prepareElement(h)),delete this.engine._loading,this.batchUpdate(!1)),t.children){const h=t.children;delete t.children,h.length&&this.load(h)}this.setAnimation(),t.subGridDynamic&&!Q.pauseDrag&&(Q.pauseDrag=!0),t.draggable?.pause!==void 0&&(Q.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e){if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i?.el?t=i.el:X.addRemoveCB?t=X.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return t;const s=this._readAttr(t);return y.defaults(e,s),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){const t=y.createDiv(["grid-stack-item",this.opts.itemClass]),i=y.createDiv(["grid-stack-item-content"],t);return y.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,X.renderCB(i,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(t))):X.renderCB(i,e),t}makeSubGrid(e,t,i,s=!0){let o=e.gridstackNode;if(o||(o=this.makeWidget(e).gridstackNode),o.subGrid?.el)return o.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridNode?.grid;t=y.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...a||{},...t||o.subGridOpts||{}}),o.subGridOpts=t;let u;t.column==="auto"&&(u=!0,t.column=Math.max(o.w||1,i?.w||1),delete t.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),d,h;if(s&&(this._removeDD(o.el),h={...o,x:0,y:0},y.removeInternalForSave(h),delete h.subGridOpts,o.content&&(h.content=o.content,delete o.content),X.addRemoveCB?d=X.addRemoveCB(this.el,h,!0,!1):(d=y.createDiv(["grid-stack-item"]),d.appendChild(c),c=y.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){const p=u?t.column:o.w,C=o.h+i.h,O=o.el.style;O.transition="none",this.update(o.el,{w:p,h:C}),setTimeout(()=>O.transition=null)}const f=o.subGrid=X.addGrid(c,t);return i?._moving&&(f._isTemp=!0),u&&(f._autoColumn=!0),s&&f.makeWidget(d,h),i&&(i._moving?window.setTimeout(()=>y.simulateMouseEvent(i._event,"mouseenter",f.el),0):f.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),f}removeAsSubGrid(e){const t=this.parentGridNode?.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,t.makeWidget(i.el,i)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>y.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=X.saveCB){const s=this.engine.save(e,i);if(s.forEach(o=>{if(e&&o.el&&!o.subGrid&&!i){const a=o.el.querySelector(".grid-stack-item-content");o.content=a?.innerHTML,o.content||delete o.content}else if(!e&&!i&&delete o.content,o.subGrid?.el){const a=o.subGrid.save(e,t,i);o.subGridOpts=t?a:{children:a},delete o.subGrid}delete o.el}),t){const o=y.cloneDeep(this.opts);o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===(this.el.style.direction==="rtl")&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto");const a=o._alwaysShowResizeHandle;return delete o._alwaysShowResizeHandle,a!==void 0?o.alwaysShowResizeHandle=a:delete o.alwaysShowResizeHandle,y.removeInternalAndSame(o,be),o.children=s,o}return s}load(e,t=X.addRemoveCB||!0){e=y.cloneDeep(e);const i=this.getColumn();e.forEach(c=>{c.w=c.w||1,c.h=c.h||1}),e=y.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(c=>{s=Math.max(s,(c.x||0)+c.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&this.engine.cacheLayout(e,s,!0);const o=X.addRemoveCB;typeof t=="function"&&(X.addRemoveCB=t);const a=[];this.batchUpdate();const l=!this.engine.nodes.length;l&&this.setAnimation(!1),!l&&t&&[...this.engine.nodes].forEach(d=>{if(!d.id)return;y.find(e,d.id)||(X.addRemoveCB&&X.addRemoveCB(this.el,d,!1,!1),a.push(d),this.removeWidget(d.el,!0,!1))}),this.engine._loading=!0;const u=[];return this.engine.nodes=this.engine.nodes.filter(c=>y.find(e,c.id)?(u.push(c),!1):!0),e.forEach(c=>{const d=y.find(u,c.id);if(d){if(y.shouldSizeToContent(d)&&(c.h=d.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||d.w,c.h=c.h||d.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(d),y.samePos(d,c)&&this.engine.nodes.length>1&&(this.moveNode(d,{...c,forceCollide:!0}),y.copyPos(c,d)),this.update(d.el,c),c.subGridOpts?.children){const h=d.el.querySelector(".grid-stack");h&&h.gridstack&&h.gridstack.load(c.subGridOpts.children)}}else t&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=a,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?X.addRemoveCB=o:delete X.addRemoveCB,l&&this.opts?.animate&&this.setAnimation(this.opts.animate,!0),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;const t=this.el.querySelector("."+this.opts.itemClass);if(t){const s=y.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}const 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){const s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}const i=y.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){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.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 o=0;for(;o<e.breakpoints.length&&s<=e.breakpoints[o].w;)i=e.breakpoints[o++].c||t}if(i!==t){const o=e.breakpoints?.find(a=>a.c===i);return this.column(i,o?.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;const 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))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}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(),delete this.parentGridNode?.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,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){const i=this.el.getBoundingClientRect();let s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};const o=e.left-s.left,a=e.top-s.top,l=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/l),y:Math.floor(a/u)}}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){const i=X.getElement(e);if(!i)return;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);const s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&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=>{s.detail&&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 e?(X.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let o=s.gridstackNode;o||(o=this.engine.nodes.find(a=>s===a.el)),o&&(t&&X.addRemoveCB&&X.addRemoveCB(this.el,o,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(o,t,i),t&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&X.addRemoveCB&&X.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=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):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.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){const t=this.opts;return e.acceptWidgets!==void 0&&this._setupAcceptWidget(),e.animate!==void 0&&this.setAnimation(),e.cellHeight&&(this.cellHeight(e.cellHeight,!0),delete e.cellHeight),e.class&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),this.el.classList.add(e.class)),typeof e.column=="number"&&!e.columnOpts&&(this.column(e.column),delete e.column),e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0&&(t.minRow=t.maxRow=e.row),e.children?.length&&(this.load(e.children),delete e.children),this.opts={...this.opts,...e},this}update(e,t){return X.getElements(e).forEach(i=>{const s=i?.gridstackNode;if(!s)return;const o={...y.copyPos({},s),...y.cloneDeep(t)};this.engine.nodeBoundFix(o),delete o.autoPosition;const a=["x","y","w","h"];let l;if(a.some(d=>o[d]!==void 0&&o[d]!==s[d])&&(l={},a.forEach(d=>{l[d]=o[d]!==void 0?o[d]:s[d],delete o[d]})),!l&&(o.minW||o.minH||o.maxW||o.maxH)&&(l={}),o.content!==void 0){const d=i.querySelector(".grid-stack-item-content");d&&d.textContent!==o.content&&(s.content=o.content,X.renderCB(d,o),s.subGrid?.el&&(d.appendChild(s.subGrid.el),s.subGrid.opts.styleInHead||s.subGrid._updateStyles(!0))),delete o.content}let u=!1,c=!1;for(const d in o)d[0]!=="_"&&s[d]!==o[d]&&(s[d]=o[d],u=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(y.sanitizeMinMax(s),l){const d=l.w!==void 0&&l.w!==s.w;this.moveNode(s,l),d&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(d,s),delete s._orig}(l||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el)}),this}moveNode(e,t){const i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(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 o=t.h?t.h*s:e.clientHeight,a;if(t.resizeToContentParent&&(a=e.querySelector(t.resizeToContentParent)),a||(a=e.querySelector(X.resizeToContentParent)),!a)return;const l=e.clientHeight-a.clientHeight,u=t.h?t.h*s-l:a.clientHeight;let c;if(t.subGrid){c=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);const f=t.subGrid.el.getBoundingClientRect(),p=t.subGrid.el.parentElement.getBoundingClientRect();c+=f.top-p.top}else{if(t.subGridOpts?.children?.length)return;{const f=a.firstElementChild;if(!f){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${X.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=f.getBoundingClientRect().height||u}}if(u===c)return;o+=c-u;let d=Math.ceil(o/s);const h=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;h&&d>h&&(d=h,e.classList.add("size-to-content-max")),t.minH&&d<t.minH?d=t.minH:t.maxH&&d>t.maxH&&(d=t.maxH),d!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:d}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){X.resizeToContentCB?X.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return X.getElements(e).forEach(i=>{const s=i.gridstackNode;if(!y.canBeRotated(s))return;const o={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(t){const l=t.left>0?Math.floor(t.left/this.cellWidth()):0,u=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;o.x=s.x+l-(s.h-(u+1)),o.y=s.y+u-l}Object.keys(o).forEach(l=>{o[l]===void 0&&delete o[l]});const a=s._orig;this.update(i,o),s._orig=a}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const i=y.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");const t=arguments;let 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;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(t=>{delete t._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,t){const 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;y.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;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit,o=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){const a=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=y.createStylesheet(this._styleSheetClass,a,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,y.addCSSRule(this._styles,o,`height: ${i}${s}`);const l=this.opts.marginTop+this.opts.marginUnit,u=this.opts.marginBottom+this.opts.marginUnit,c=this.opts.marginRight+this.opts.marginUnit,d=this.opts.marginLeft+this.opts.marginUnit,h=`${o} > .grid-stack-item-content`,f=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;y.addCSSRule(this._styles,h,`top: ${l}; right: ${c}; bottom: ${u}; left: ${d};`),y.addCSSRule(this._styles,f,`top: ${l}; right: ${c}; bottom: ${u}; left: ${d};`),y.addCSSRule(this._styles,`${o} > .ui-resizable-n`,`top: ${l};`),y.addCSSRule(this._styles,`${o} > .ui-resizable-s`,`bottom: ${u}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${c}; top: ${l}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${c}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${c}; bottom: ${u}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${d}; top: ${l}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${d}`),y.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${d}; bottom: ${u}`)}if(t=t||this._styles._max,t>this._styles._max){const a=l=>i*l+s;for(let l=this._styles._max+1;l<=t;l++)y.addCSSRule(this._styles,`${o}[gs-y="${l}"]`,`top: ${a(l)}`),y.addCSSRule(this._styles,`${o}[gs-h="${l+1}"]`,`height: ${a(l+1)}`);this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let t=this.getRow()+this._extraDragRow;const i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!e){const o=y.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===s){const a=Math.floor(o.h/i);t<a&&(t=a)}}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&&y.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(be.itemClass,this.opts.itemClass);const s=y.shouldSizeToContent(i);return s?e.classList.add("size-to-content"):e.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),y.lazyLoad(i)||this.prepareDragDrop(i.el),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);const i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const s in i)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){const i={};i.x=y.toNumber(e.getAttribute("gs-x")),i.y=y.toNumber(e.getAttribute("gs-y")),i.w=y.toNumber(e.getAttribute("gs-w")),i.h=y.toNumber(e.getAttribute("gs-h")),i.autoPosition=y.toBool(e.getAttribute("gs-auto-position")),i.noResize=y.toBool(e.getAttribute("gs-no-resize")),i.noMove=y.toBool(e.getAttribute("gs-no-move")),i.locked=y.toBool(e.getAttribute("gs-locked"));const s=e.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=y.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=e.getAttribute("gs-id"),i.maxW=y.toNumber(e.getAttribute("gs-max-w")),i.minW=y.toNumber(e.getAttribute("gs-min-w")),i.maxH=y.toNumber(e.getAttribute("gs-max-h")),i.minH=y.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 o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="gs-size-to-content"&&delete i[o]}return i}_setStaticClass(){const 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(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let t=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),t=!0):t=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(t),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),this.animationDelay);if(t)y.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>y.shouldSizeToContent(i))){const i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{y.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.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=y.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 y.getElement(e)}static getElements(e=".grid-stack-item"){return y.getElements(e)}static getGridElement(e){return X.getElement(e)}static getGridElements(e){return y.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=y.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=y.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=y.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=y.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=y.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 Ee}static setupDragIn(e,t,i,s=document){t?.pause!==void 0&&(Q.pauseDrag=t.pause),t={appendTo:"body",helper:"clone",...t||{}},(typeof e=="string"?y.getElements(e,s):e).forEach((a,l)=>{Ee.isDraggable(a)||Ee.dragIn(a,t),i?.[l]&&(a.gridstackNode=i[l])})}movable(e,t){return this.opts.staticGrid?this:(X.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(X.getElements(e).forEach(i=>{const s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),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.prepareDragDrop(i.el),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.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&X._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Ee.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 Ee.droppable(this.el,"destroy"),this;let e,t;const i=(s,o,a)=>{a=a||o;const l=a.gridstackNode;if(!l)return;if(!l.grid?.el){a.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const f=a.getBoundingClientRect();a.style.left=f.x+(this.dragTransform.xScale-1)*(s.clientX-f.x)/this.dragTransform.xScale+"px",a.style.top=f.y+(this.dragTransform.yScale-1)*(s.clientY-f.y)/this.dragTransform.yScale+"px",a.style.transformOrigin="0px 0px"}let{top:u,left:c}=a.getBoundingClientRect();const d=this.el.getBoundingClientRect();c-=d.left,u-=d.top;const h={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/t)),l.y=Math.max(0,Math.round(u/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){Ee.off(o,"drag");return}l._willFitPos&&(y.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,s,h,l,t,e)}else this._dragOrResize(a,s,h,l,t,e)};return Ee.droppable(this.el,{accept:s=>{const o=s.gridstackNode||this._readAttr(s,!1);if(o?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(s);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=s.matches(l)}if(a&&o&&this.opts.maxRow){const l={w:o.w,h:o.h,minW:o.minW,minH:o.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(s,o,a)=>{let l=a?.gridstackNode||o.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(o,a),a=a||o,t=this.cellWidth(),e=this.getCellHeight(!0),!l){const d=a.getAttribute("data-gs-widget")||a.getAttribute("gridstacknode");if(d){try{l=JSON.parse(d)}catch{console.error("Gridstack dropover: Bad JSON format: ",d)}a.removeAttribute("data-gs-widget"),a.removeAttribute("gridstacknode")}l||(l=this._readAttr(a)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,a.gridstackNode=l);const u=l.w||Math.round(a.offsetWidth/t)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=l),o.gridstackNode=l={...l,w:u,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=u,l.h=c,l._temporaryRemoved=!0),X._itemRemoving(l.el,!1),Ee.on(o,"drag",i),i(s,o,a),!1}).on(this.el,"dropout",(s,o,a)=>{const l=a?.gridstackNode||o.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(o,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(s,o,a)=>{const l=a?.gridstackNode||o.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const u=!!this.placeholder.parentElement,c=o!==a;this.placeholder.remove(),delete this.placeholder.gridstackNode;const d=u&&this.opts.animate;d&&this.setAnimation(!1);const h=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,u&&h?.grid&&h.grid!==this){const p=h.grid;p.engine.removeNodeFromLayoutCache(h),p.engine.removedNodes.push(h),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!l||(u&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,Ee.off(o,"drag"),a!==o?(a.remove(),o=a):o.remove(),this._removeDD(o),!u))return!1;const f=l.subGrid?.el?.gridstack;return y.copyPos(l,this._readAttr(this.placeholder)),y.removePositioningStyles(o),c&&(l.content||l.subGridOpts||X.addRemoveCB)?(delete l.el,o=this.addWidget(l)):(this._prepareElement(o,!0,l),this.el.appendChild(o),this.resizeToContentCheck(!1,l),f&&(f.parentGridNode=l,f.opts.styleInHead||f._updateStyles(!0)),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},h&&h.grid?h:void 0,l),d&&this.setAnimation(this.opts.animate,!0),!1}),this}static _itemRemoving(e,t){if(!e)return;const i=e?e.gridstackNode:void 0;!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;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Ee.isDroppable(e)&&Ee.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>X._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>X._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){const i=e?.gridstackNode;if(!i)return;const s=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,a=this.opts.staticGrid||s&&o;if((t||a)&&(i._initDD&&(this._removeDD(e),delete i._initDD),a&&e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!t))return this;if(!i._initDD){let l,u;const c=(f,p)=>{this._gsEventHandler[f.type]&&this._gsEventHandler[f.type](f,f.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,f,p,i,l,u)},d=(f,p)=>{this._dragOrResize(e,f,p,i,l,u)},h=f=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._event,delete i._lastTried;const p=i.w!==i._orig.w,C=f.target;if(!(!C.gridstackNode||C.gridstackNode.grid!==this)){if(i.el=C,i._isAboutToRemove){const O=e.gridstackNode.grid;O._gsEventHandler[f.type]&&O._gsEventHandler[f.type](f,C),O.engine.nodes.push(i),O.removeWidget(e,!0,!0)}else y.removePositioningStyles(C),i._temporaryRemoved?(y.copyPos(i,i._orig),this._writePosAttr(C,i),this.engine.addNode(i)):this._writePosAttr(C,i),this._gsEventHandler[f.type]&&this._gsEventHandler[f.type](f,C);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),f.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(p,i))}};Ee.draggable(e,{start:c,stop:h,drag:d}).resizable(e,{start:c,stop:h,resize:d}),i._initDD=!0}return Ee.draggable(e,s?"disable":"enable").resizable(e,o?"disable":"enable"),this}_onStartMoving(e,t,i,s,o,a){if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,s.grid?.el)this.dragTransform=y.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=y.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(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(o,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){const l=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;Ee.resizable(e,"option","minWidth",o*Math.min(s.minW||1,l)).resizable(e,"option","minHeight",a*Math.min(s.minH||1,u)).resizable(e,"option","maxWidth",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(e,"option","maxHeight",a*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",a*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(e,t,i,s,o,a){const l={...s._orig};let u,c=this.opts.marginLeft,d=this.opts.marginRight,h=this.opts.marginTop,f=this.opts.marginBottom;const p=Math.round(a*.1),C=Math.round(o*.1);if(c=Math.min(c,C),d=Math.min(d,C),h=Math.min(h,p),f=Math.min(f,p),t.type==="drag"){if(s._temporaryRemoved)return;const R=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&y.updateScrollPosition(e,i.position,R);const T=i.position.left+(i.position.left>s._lastUiPosition.left?-d:c),P=i.position.top+(i.position.top>s._lastUiPosition.top?-f:h);l.x=Math.round(T/o),l.y=Math.round(P/a);const b=this._extraDragRow;if(this.engine.collide(s,l)){const E=this.getRow();let D=Math.max(0,l.y+s.h-E);this.opts.maxRow&&E+D>this.opts.maxRow&&(D=Math.max(0,this.opts.maxRow-E)),this._extraDragRow=D}else this._extraDragRow=0;if(this._extraDragRow!==b&&this._updateContainerHeight(),s.x===l.x&&s.y===l.y)return}else if(t.type==="resize"){if(l.x<0||(y.updateScrollResize(t,e,a),l.w=Math.round((i.size.width-c)/o),l.h=Math.round((i.size.height-h)/a),s.w===l.w&&s.h===l.h)||s._lastTried&&s._lastTried.w===l.w&&s._lastTried.h===l.h)return;const R=i.position.left+c,T=i.position.top+h;l.x=Math.round(R/o),l.y=Math.round(T/a),u=!0}s._event=t,s._lastTried=l;const O={x:i.position.left+c,y:i.position.top+h,w:(i.size?i.size.width:s.w*o)-c-d,h:(i.size?i.size.height:s.h*a)-h-f};if(this.engine.moveNodeCheck(s,{...l,cellWidth:o,cellHeight:a,rect:O,resizing:u})){s._lastUiPosition=i.position,this.engine.cacheRects(o,a,h,d,f,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const R=t.target;s._sidebarOrig||this._writePosAttr(R,s),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,R)}}_leave(e,t){t=t||e;const i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,Ee.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;const s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&X._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return vg(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}X.renderCB=(r,e)=>{r&&e?.content&&(r.textContent=e.content)},X.resizeToContentParent=".grid-stack-item-content",X.Utils=y,X.Engine=Ae,X.GDRev="11.5.1";const kg=(r,e)=>{let t=0;const i=new Map;e.forEach(o=>{const a=o.layout.position.row,l=i.get(a),u=o.layout.size.rows===1&&!!o.layout.size.fit_to_content;t=Math.max(t,a+o.layout.size.rows),l===void 0?i.set(a,u):i.set(a,l&&u)});const s=[];for(let o=0;o<t;o++)i.get(o)?s.push("auto"):s.push(`${r}px`);return s},Gr=(r,e,t)=>e.get(`${r.id}`)??r.layout.size.rows*t,Dg=(r,e,t,i)=>e.map((s,o)=>{if(s!=="auto")return i;const a=r.filter(l=>l.layout.position.row===o);return Math.max(...a.map(l=>Gr(l,t,i)))}),Ng=(r,e,t)=>{const i=[...r].sort((a,l)=>a.layout.position.row-l.layout.position.row||a.layout.position.col-l.layout.position.col),s=new Map;let o=0;return i.forEach(a=>{const l=Gr(a,e,t);s.set(`${a.id}`,{x:0,y:o,w:1,h:l}),o+=l}),s},Ag=(r,e,t,{cellsPerRow:i,columns:s})=>{if(s===1)return Ng(r,t,i);const o=[0];return Dg(r,e,t,i).forEach(a=>{o.push(o[o.length-1]+a)}),new Map(r.map(a=>{const{position:l,size:u}=a.layout,c=o[l.row],d=o[l.row+u.rows];return[`${a.id}`,{x:l.col,y:c,w:u.cols,h:d-c}]}))},Lg=["data-id","data-testid"],Ug={class:"grid-stack-item-content"},Mg=ke(n.defineComponent({__name:"DraggableGridLayout",props:{tiles:{},tileHeight:{default:it},columns:{default:zt},editable:{type:Boolean,default:!1},bottomTrim:{default:0}},emits:["update-tiles"],setup(r,{expose:e,emit:t}){const i=r,s=t,o=n.ref(null),a=n.ref(new Map(i.tiles.map(w=>[`${w.id}`,w])));let l=null,u=!1;const c=w=>`[data-id="${w}"]`,d=n.computed(()=>kg(i.tileHeight,i.tiles)),h=w=>!i.editable&&d.value[w.layout.position.row]==="auto",f=()=>i.editable?1:rt,p=parseInt(fa,10)/2,C=n.ref(new Map),O=n.ref(new Map),R=n.ref(!1),T=w=>R.value||h(w),P=n.computed(()=>Ag(i.tiles,d.value,C.value,{cellsPerRow:rt,columns:R.value?1:i.columns})),b=n.computed(()=>{if(i.editable)return 0;const S=(R.value?[...i.tiles].sort((N,oe)=>N.layout.position.row-oe.layout.position.row||N.layout.position.col-oe.layout.position.col).slice(-1):i.tiles.filter(N=>N.layout.position.row===d.value.length-1)).filter(N=>C.value.has(`${N.id}`));if(!S.length||!S.every(T))return 0;const G=Math.max(...S.map(N=>C.value.get(`${N.id}`))),M=Math.max(...S.map(N=>O.value.get(`${N.id}`))),k=G*(i.tileHeight/rt)-(M+2*p);return Math.max(0,Math.round(k*100)/100)}),E=w=>i.editable?{id:`${w.id}`,x:w.layout.position.col,y:w.layout.position.row,w:w.layout.size.cols,h:w.layout.size.rows}:{id:`${w.id}`,...P.value.get(`${w.id}`)},D=()=>({margin:p,column:i.columns,cellHeight:i.tileHeight/f(),resizable:{handles:"se, sw"},handle:".tile-header",staticGrid:!i.editable,float:!i.editable}),x=w=>w.map(S=>{const G=a.value.get(`${S.el?.getAttribute("data-id")}`);if(G)return{...G,layout:{position:{col:Number(S.x),row:Number(S.y)},size:{...G.layout.size,cols:Number(S.w),rows:Number(S.h)}}}}).filter(S=>S!==void 0),K=(w,S)=>{l&&!u&&(x(S).forEach(M=>{a.value.set(`${M.id}`,M)}),s("update-tiles",Array.from(a.value.values())))},g=(w,S)=>{S.forEach(G=>{a.value.delete(`${G.el?.getAttribute("data-id")}`)}),s("update-tiles",Array.from(a.value.values()))},m=w=>o.value?.querySelector(`${c(w)} > .grid-stack-item-content > :first-child`),_=w=>Math.ceil((w+2*p)/(i.tileHeight/rt)),U=()=>{const w=new Map,S=new Map;i.tiles.filter(T).forEach(k=>{const N=m(k.id);if(N){const{height:oe}=N.getBoundingClientRect();w.set(`${k.id}`,_(oe)),S.set(`${k.id}`,oe)}}),(w.size!==C.value.size||[...w].some(([k,N])=>C.value.get(k)!==N))&&(C.value=w),(S.size!==O.value.size||[...S].some(([k,N])=>O.value.get(k)!==N))&&(O.value=S)},A=new ResizeObserver(()=>window.requestAnimationFrame(U)),F=()=>{A.disconnect(),i.tiles.filter(T).forEach(w=>{const S=m(w.id);S&&A.observe(S)})},v=new ResizeObserver(([w])=>{R.value=!i.editable&&w.contentRect.width<=parseInt(da,10)}),q=(w,S)=>{const G=w.x===S.x&&w.y===S.y,M=w.w===S.w&&w.h===S.h;return G&&M},V=()=>{if(!l)return;const w=new Set(i.tiles.map(M=>`${M.id}`)),S=new Map(l.engine.nodes.map(M=>[`${M.id}`,M]));S.forEach((M,k)=>{!w.has(k)&&M.el&&(l.removeWidget(M.el,!1,!1),a.value.delete(k))});const G=i.tiles.filter(M=>S.has(`${M.id}`)).map(E);u=!0,G.some(M=>!q(S.get(`${M.id}`),M))&&l.load(G,!1),u=!1,i.tiles.filter(M=>!S.has(`${M.id}`)).forEach(M=>{l.makeWidget(c(M.id),{...E(M),autoPosition:i.editable})}),F()};n.onMounted(()=>{o.value&&(l=X.init(D(),o.value),l.batchUpdate(),i.tiles.forEach(w=>l.makeWidget(c(w.id),E(w))),l.batchUpdate(!1),F(),v.observe(o.value),i.editable&&(l.on("change",K),l.on("added",K),l.on("removed",g)))}),n.onUnmounted(()=>{A.disconnect(),v.disconnect(),l&&l.destroy(!1)});const W=w=>{if(l&&o.value){const S=o.value.querySelector(c(w));S&&l.removeWidget(S)}};return n.watch(R,w=>l?.column(w?1:i.columns,"none")),n.watch(()=>[i.tiles.map(w=>[w.id,w.layout]),P.value],V,{deep:!0,flush:"post"}),n.watchEffect(()=>{i.tiles.forEach(w=>{a.value.set(`${w.id}`,w)})}),e({removeWidget:W}),(w,S)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"gridContainer",ref:o,class:"grid-stack",style:n.normalizeStyle({marginBottom:`-${r.bottomTrim+b.value}px`})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.tiles,G=>(n.openBlock(),n.createElementBlock("div",{key:G.id,"data-id":`${G.id}`,"data-testid":`grid-stack-item-${G.id}`},[n.createElementVNode("div",Ug,[n.renderSlot(w.$slots,"tile",{fitToContent:h(G),tile:G},void 0,!0)])],8,Lg))),128))],4))}}),[["__scopeId","data-v-8a2b0f6f"]]),Kg=r=>{const e={position:{col:0,row:0},size:r.layout.size};if(r.type==="slottable")return{id:crypto.randomUUID(),type:"slottable",layout:e};const t=r.meta,i={...t,chart:{...t.chart}};return"chart_title"in i.chart&&(i.chart.chart_title=i.chart.chart_title?`Copy of ${i.chart.chart_title}`:""),{id:crypto.randomUUID(),type:"chart",definition:i,layout:e}},Bg={key:0,class:"fullscreen-header"},zg=["id"],Pg={key:1,class:"boundary-header"},qg={key:0,class:"boundary-title"},Hg={key:1,class:"boundary-description"},Gg=ke(n.defineComponent({__name:"DashboardRenderer",props:n.mergeModels({context:{},preview:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:n.mergeModels(["edit-tile","tile-time-range-zoom","tiles-loaded"],["update:modelValue"]),setup(r,{expose:e,emit:t}){if(n.useCssVars(I=>({v46ff5d3f:C.value})),r.context.disableCoordination!==!0){const I=xs();n.provide(Gi,I)}const i=t,s=n.useModel(r,"modelValue"),o=n.computed(()=>Array.isArray(s.value)?s.value:[{definition:s.value}]),a=I=>o.value[I].definition,l=n.computed(()=>{const I=B=>B.type==="slottable"||"definition"in B&&B.definition?.chart?.type==="slottable";return o.value.reduce((B,z)=>{const Y=x(z),J=new Set;return z.definition.tiles.forEach(L=>{if(I(L))return;const $=L.id?Y[L.id]:void 0;$?J.has($.groupId)||(J.add($.groupId),B++):B++}),B},0)}),{i18n:u}=ue.useI18n(),c=n.ref(0),d=[],h=(I,B)=>{d[I]=B},f=n.ref(),p=n.ref(),C=n.ref("scale(1)"),O=new Set,R=n.inject(Ie);R||(console.warn("Analytics dashboards require a query bridge supplied via provide / inject."),console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"),console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")),ue.useRequestQueue();const{exportPdf:T,exportState:P}=ue.useExportPdf(p),b=(I,B)=>{O.add(`${B}-${I.id}`),O.size>=l.value&&i("tiles-loaded",!0)},E=n.computed(()=>{const B=`renderer.trendRange.${ge.value.type==="absolute"?"custom":ge.value.time_range}`;return u.te(B)?u.t(B):""}),D=(I,B)=>{const z=I.layout.position.row-B.layout.position.row;return z!==0?z:I.layout.position.col-B.layout.position.col},x=I=>{const B={};return I.tileGroups?.forEach(z=>{z.tileIdLabels.forEach(([Y])=>{B[Y]=z})}),B},K=I=>{const B=I.definition.tiles.map(L=>{if(N.value&&!L.id&&console.warn("No id provided for tile. One will be generated automatically,","however tracking changes to this tile may not work as expected.",L),L.type==="slottable")return{layout:L.layout,type:L.type,id:L.id??crypto.randomUUID()};let $=L.definition;const j=L.type??"chart",ce=Ha($,E.value);return ce!==$.header_description&&($={...$,header_description:ce}),{layout:L.layout,meta:$,type:j,id:L.id??crypto.randomUUID()}}),z=x(I),Y=new Map(B.map(L=>[L.id,L])),J=new Set;return B.reduce((L,$)=>{const j=z[$.id];if(!j)return L.push($),L;if(J.has(j.groupId))return L;J.add(j.groupId);const ce=j.tileIdLabels.map(([ne,me])=>({id:ne,label:me,tile:Y.get(ne)})).filter(({tile:ne})=>!!ne?.meta).map(({id:ne,label:me,tile:_e})=>({id:ne,label:me,definition:_e.meta})),Z=Y.get(ce[0]?.id);return Z&&L.push({...Z,layout:j.layout,groupTiles:ce}),L},[])},g=n.computed(()=>o.value.map(I=>K(I))),m=(I,B)=>{const z=I.groupTiles?.find(Y=>Y.id===B);return z&&z.id!==I.id?{...I,id:z.id,meta:z.definition}:I},_=(I,B)=>{i("edit-tile",m(I,B))},U=I=>I.type==="slottable"?!0:I.meta?.chart.type==="slottable",A=I=>I.type==="slottable",F=I=>{if(I.type==="slottable")return I.id;const B=I.meta?.chart;return B&&A(B)?B.id:void 0},v=(I,B,z)=>{const Y=a(B);try{const J=Kg(m(I,z));Y.tiles.push(JSON.parse(JSON.stringify(J)))}catch(J){console.warn(J)}},q=(I,B,z)=>{const Y=I.groupTiles,J=Y?.some(L=>L.id===z)?z:I.id;if(Y&&Y.length>1){const L=a(B);L.tiles=L.tiles.filter($=>$.id!==J)}else d[B]?.removeWidget(I.id);O.delete(`${B}-${J}`)},V=()=>{O.clear(),c.value++},W=(I,B)=>{const z=a(B),Y=I.map($=>$.type==="slottable"?{id:$.id,type:$.type,layout:$.layout}:{id:$.id,type:$.type,layout:$.layout,definition:$.meta}),J=new Set(Y.map($=>$.id)),L=z.tiles.filter($=>$.id&&!J.has($.id)&&x(o.value[B])[$.id]);z.tiles=[...Y,...L].sort(D)},w=async()=>{if(C.value="scale(1)",await n.nextTick(),p.value){const{availWidth:I,availHeight:B}=window.screen,{width:z,height:Y}=p.value.getBoundingClientRect(),J=Math.min(B/Y,I/z);C.value=`scale(${J})`}},S=()=>{f.value&&(document.fullscreenElement?document.exitFullscreen():f.value.requestFullscreen())},G=n.ref(!1),M=n.computed(()=>N.value&&!G.value),k=()=>{G.value=document.fullscreenElement!==null,G.value&&w()},{editable:N,enrichedContext:oe,queryReady:ae,showTileActions:de,timeSpec:ge}=ue.useDashboardContext({globalFilters:n.computed(()=>[]),context:n.computed(()=>r.context),isFullscreen:G,preview:n.computed(()=>r.preview)}),ie=I=>({...oe.value,filters:[...r.context.filters??[],...I.preset_filters??[]]});return e({refresh:V,toggleFullscreen:S,exportPdf:T,pdfExportState:P}),(I,B)=>{const z=n.resolveComponent("KAlert");return n.openBlock(),n.createElementBlock("div",{ref_key:"dashboardContainer",ref:f,class:n.normalizeClass(["kong-ui-public-dashboard-renderer",{"is-fullscreen":G.value}]),onFullscreenchange:k},[n.createElementVNode("div",{ref_key:"layoutContainer",ref:p,class:"layout"},[n.unref(R)&&G.value?(n.openBlock(),n.createElementBlock("div",Bg,[n.renderSlot(I.$slots,"fullscreenHeader",{},void 0,!0)])):n.createCommentVNode("",!0),n.unref(R)?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(o.value,(Y,J)=>(n.openBlock(),n.createElementBlock("div",{key:`dash-${J}`,class:n.normalizeClass(["dashboard-boundary",{multiple:o.value.length>1}])},[Y.anchorId?(n.openBlock(),n.createElementBlock("a",{key:0,id:Y.anchorId},null,8,zg)):n.createCommentVNode("",!0),Y.title||Y.description?(n.openBlock(),n.createElementBlock("div",Pg,[Y.title?(n.openBlock(),n.createElementBlock("div",qg,n.toDisplayString(Y.title),1)):n.createCommentVNode("",!0),Y.description?(n.openBlock(),n.createElementBlock("div",Hg,n.toDisplayString(Y.description),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(Mg,{key:`layout-${M.value}`,ref_for:!0,ref:L=>h(J,L),"bottom-trim":o.value.length>1?4:0,columns:Y.definition.columns,editable:M.value,"tile-height":Y.definition.tile_height,tiles:g.value[J],onUpdateTiles:L=>W(L,J)},{tile:n.withCtx(({tile:L,fitToContent:$})=>[U(L)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["tile-container slottable-tile",{"fit-to-content":$}])},[n.renderSlot(I.$slots,F(L),{},void 0,!0)],2)):(n.openBlock(),n.createBlock(zr,{key:G.value?`${L.id}-tile`:`${L.id}-tile-fullscreen`,"refresh-counter":c.value,"onUpdate:refreshCounter":B[0]||(B[0]=j=>c.value=j),class:"tile-container",context:ie(Y.definition),definition:L.meta,"fit-to-content":$,"group-tiles":L.groupTiles,height:L.layout.size.rows*(Y.definition.tile_height||n.unref(it))+parseInt(n.unref(Pi),10),"hide-actions":!n.unref(de),"is-fullscreen":G.value,preview:r.preview,"query-ready":n.unref(ae),"tile-id":L.id,"tile-type":L.type,onDuplicateTile:(j,ce)=>v(L,J,ce),onEditTile:(j,ce)=>_(L,ce),onRemoveTile:(j,ce)=>q(L,J,ce),onTileLoaded:j=>b(L,J),onTileTimeRangeZoom:B[1]||(B[1]=j=>i("tile-time-range-zoom",j))},null,8,["refresh-counter","context","definition","fit-to-content","group-tiles","height","hide-actions","is-fullscreen","preview","query-ready","tile-id","tile-type","onDuplicateTile","onEditTile","onRemoveTile","onTileLoaded"]))]),_:2},1032,["bottom-trim","columns","editable","tile-height","tiles","onUpdateTiles"]))],2))),128)):(n.openBlock(),n.createBlock(z,{key:1,appearance:"danger"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(u).t("renderer.noQueryBridge")),1)]),_:1}))],512)],34)}}}),[["__scopeId","data-v-1df9740b"]]),$g=n.defineComponent({__name:"DashboardTilePreview",props:{context:{},definition:{},globalFilters:{default:()=>[]},preview:{type:Boolean,default:!1}},emits:["chart-data","tile-time-range-zoom","tile-bounds-change"],setup(r,{expose:e,emit:t}){const i=n.useTemplateRef("root"),s=n.useTemplateRef("dashboard-tile"),o=crypto.randomUUID(),a=t,l=b=>{a("tile-time-range-zoom",b)},u=b=>{a("chart-data",b)},c=b=>{a("tile-bounds-change",b)},{i18n:d}=ue.useI18n(),{enrichedContext:h,queryReady:f}=ue.useDashboardContext({globalFilters:n.toRef(()=>r.globalFilters),context:n.toRef(()=>r.context),preview:n.computed(()=>r.preview)}),p=n.computed(()=>Ne(r.definition)),C=n.computed(()=>p.value?"columns"in r.definition.query&&!r.definition.query.columns?.length:!("metrics"in r.definition.query)||!r.definition.query.metrics||r.definition.query.metrics.length===0),O=n.ref(it);let R;n.onMounted(()=>{const b=i.value?.parentElement;b&&(O.value=b.getBoundingClientRect().height,R=new ResizeObserver(([E])=>{const{height:D}=E.contentRect;O.value=D}),R.observe(b))}),n.onUnmounted(()=>R?.disconnect());const T=n.ref(0);return e({refresh:()=>{T.value++},getExportData:()=>s.value?.getExportData()}),(b,E)=>{const D=n.resolveComponent("KEmptyState");return n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:i,"data-testid":"dashboard-tile-preview-root"},[C.value?(n.openBlock(),n.createBlock(D,{key:0,"action-button-visible":!1,"data-testid":"chart-not-configured-empty-state"},{title:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(n.unref(d).t("renderer.not_configured.title")),1)]),default:n.withCtx(()=>[n.createElementVNode("p",null,n.toDisplayString(n.unref(d).t("renderer.not_configured.description")),1)]),_:1})):(n.openBlock(),n.createBlock(zr,{key:1,ref:"dashboard-tile","refresh-counter":T.value,"onUpdate:refreshCounter":E[0]||(E[0]=x=>T.value=x),context:{...n.unref(h),editable:!1},definition:r.definition,height:O.value,"hide-actions":"",preview:r.preview,"query-ready":n.unref(f),"show-refresh":"","tile-id":n.unref(o),onChartData:u,onTileBoundsChange:c,onTileTimeRangeZoom:l},null,8,["refresh-counter","context","definition","height","preview","query-ready","tile-id"]))],512)}}}),Fg=r=>{if(r.type!=="chart")return r;const e=r.definition?.query;if(!e)return r;if(e.datasource==="api_usage"){console.warn("[@kong-ui-public/dashboard-renderer] A tile was filtered out for the Basic Tier",r);return}return r},Wg=r=>{if(r.type!=="chart"||Ne(r.definition))return r;const e=r.definition?.query;if(!e)return r;const t={...e,datasource:e.datasource==="basic"?"api_usage":e.datasource};return{...r,definition:{...r.definition,query:t}}},Vg=(r,e=zt)=>{if(!r.length)return[];let t=0,i=0,s=0;const o=[];for(const a of r){const l=a.layout?.size?.cols??1,u=a.layout?.size?.rows??1;i+l>e&&(t+=s,i=0,s=0);const c={...a,layout:{...a.layout,position:{...a.layout?.position??{},col:i,row:t}}};o.push(c),i+=l,s=Math.max(s,u)}return o},Yg=(r,e)=>{if(e){const s=r.tiles.map(Wg);return{...r,tiles:s}}const t=r.tiles.map(Fg).filter(s=>s!==void 0),i=Vg(t,r.columns);return{...r,tiles:i}},Xg=Object.freeze(Object.defineProperty({__proto__:null,default:n.defineComponent({__name:"GeoMapRenderer",props:{query:{},context:{},queryReady:{type:Boolean},chartOptions:{},height:{},refreshCounter:{},activeMetric:{},headerDescription:{},requestsLink:{},exploreLink:{},zoomConfiguration:{}},emits:["bounds-change"],setup(r,{emit:e}){const t=r,i=n.ref(void 0),s=n.computed(()=>i.value?ci.exploreResultToCountryMetrics(i.value):{}),o=n.computed(()=>i.value?i.value?.meta.metric_names&&i.value.meta.metric_names[0]:""),a=n.computed(()=>t.query.limit!==void 0&&t.query.limit>0?t.query.limit:re.COUNTRIES.length),l=n.computed(()=>{if(!t.query.filters?.find(({field:p,operator:C})=>p==="country_code"&&(C==="not_empty"||C==="empty"||C==="in"))){const p={field:"country_code",operator:"not_empty"};return{...t.query,filters:[...t.query.filters||[],p]}}return t.query}),u=n.computed(()=>{if(!i.value)return"";const f=i?.value?.meta.metric_units,p=i?.value?.meta?.metric_names;return f&&p&&f[p[0]]}),c=f=>{i.value=f},d=e,h=f=>{d("bounds-change",f)};return(f,p)=>(n.openBlock(),n.createBlock(Be,{context:r.context,"limit-override":a.value,query:l.value,"query-ready":r.queryReady,"refresh-counter":r.refreshCounter,onChartData:c},{default:n.withCtx(()=>[n.createVNode(n.unref(ci.AnalyticsGeoMap),{bounds:r.chartOptions.bounds,"country-metrics":s.value,"fit-to-country":r.chartOptions.fit_to_country,metric:o.value,"metric-unit":u.value,"with-legend":r.chartOptions.legend||!1,onBoundsChange:h},null,8,["bounds","country-metrics","fit-to-country","metric","metric-unit","with-legend"])]),_:1},8,["context","limit-override","query","query-ready","refresh-counter"]))}})},Symbol.toStringTag,{value:"Module"}));ee.CELLS_PER_ROW=rt,ee.CP_ID_TOKEN=$i,ee.CsvExportModal=or,ee.DASHBOARD_COLS=zt,ee.DEFAULT_TILE_HEIGHT=it,ee.DEFAULT_TILE_REFRESH_INTERVAL_MS=Wi,ee.DashboardRenderer=Gg,ee.DashboardTilePreview=$g,ee.ENTITY_ID_TOKEN=Pt,ee.FULLSCREEN_LONG_REFRESH_INTERVAL_MS=Yi,ee.FULLSCREEN_SHORT_REFRESH_INTERVAL_MS=Vi,ee.INJECT_DASHBOARD_COORDINATOR=Gi,ee.INJECT_QUERY_PROVIDER=Ie,ee.TIMEFRAME_TOKEN=Fi,ee.configureAllowedDefinition=Yg,ee.getTimeRangeDurationMs=$t,ee.isTimeRangeUnsupported=Ft,ee.isTreemapCompatible=ti,ee.limitTimeRange=Wt,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})}));
|