@datama/studio 0.0.0-stage → 1.0.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.
- package/README.md +298 -2
- package/dist/datama-studio.css +1994 -0
- package/dist/datama-studio.es.js +146656 -0
- package/dist/datama-studio.js +6646 -0
- package/dist/datama.min.css +1994 -0
- package/dist/datama.min.js +6646 -0
- package/dist/plotter.min.css +1 -0
- package/dist/plotter.min.js +717 -0
- package/package.json +41 -5
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
(function(Qe){"use strict";const la="Plotter",ca="background: #4F46E5; color: #EEF2FF; padding: 1px 6px; border-radius: 3px; font-weight: 700;",tu="background: #0F172A;",eu="color: #38BDF8;",su="color: #C084FC;",nu="color: #34D399;",ha="color: #FBBF24;",iu="color: #FB7185;",ua="color: #A3E635;",ru="Error cannot be stringify, probably due to circular reference",au="An error happened",ou="Debug :";class Et{static#t=null;static#e=!1;static setDebug(t){Et.#e=t===!0}static isDebugEnabled(){return Et.#e}static get shared(){try{return Et.#t==null&&(Et.#t=new Et),Et.#t}catch{return}}constructor(){try{if(Et.#t!=null)return Et.#t;Et.#t=this}catch{}}info(t,...e){Et.#e&&this.#s(()=>{this.#n("info",eu,this.#i(t)),this.#a(e)})}loading(t,...e){Et.#e&&this.#s(()=>{this.#n("info",su,this.#i(t)),this.#a(e)})}ok(t,...e){Et.#e&&this.#s(()=>{this.#n("info",nu,this.#i(t)),this.#a(e)})}warning(t,...e){this.#s(()=>{const s=this.#i(t);typeof s=="string"?this.#n("warn",ha,s):(this.#n("warn",ha,au),this.#r("warn",s)),this.#a(e)})}error(t,...e){this.#s(()=>{this.#n("error",iu,this.#i(t)),this.#a(e)})}debug(t){this.#s(()=>{typeof t=="string"?this.#n("debug",ua,t):(this.#n("debug",ua,ou),this.#r("debug",t))})}#s(t){try{t()}catch{}}#n(t,e,s){const n=tu+e;if(typeof s=="string"){this.#r(t,`%c${la}%c ${s}`,ca,n);return}this.#r(t,`%c${la}`,ca),this.#r(t,s)}#r(t,...e){try{let s=null;typeof console<"u"&&typeof console[t]=="function"?s=console[t]:typeof console<"u"&&typeof console.log=="function"&&(s=console.log),s&&s.apply(console,e)}catch{}}#i(t){if(Array.isArray(t))return t.join(`
|
|
2
|
+
`);if(typeof t=="object")try{return t instanceof Error?t:JSON.stringify(t)}catch{return this.#r("warn",ru),t}return t}#a(t){t!=null&&t.length>0&&this.#r("debug",...t)}}const da="span";class Bn{static ensureFallbacks(){lu()}static translate(t,e=null){return ft(t,e)}}function lu(){typeof String.prototype.translate!="function"&&(String.prototype.translate=cu),typeof Number.prototype.format!="function"&&(Number.prototype.format=hu)}function ft(o,t=null){if(typeof Node<"u"&&o instanceof Node)return o.textContent||"";if(typeof o!="string")return o;if(typeof o.translate=="function")try{const e=o.translate(t);if(typeof e=="string")return e;if(typeof Node<"u"&&e instanceof Node)return e.textContent||""}catch{return zn(o,t)}return zn(o,t)}function pa(o){const t=o==null?"":String(o);if(t.length&&typeof t.translate=="function")try{const e=t.translate(null,"node","span",!0);if(typeof Node<"u"&&e instanceof Node)return e}catch{}return document.createTextNode(t)}function cu(o=null,t="text",e=da){const s=zn(String(this),o);if(t==="node"){const n=e||da,i=document.createElement(n);return i.textContent=s,i}return s}function hu(o={}){const t=Number(this);if(!Number.isFinite(t))return String(this);const e=o!=null&&o.unit!=null?String(o.unit):"";return`${t}${e}`}function zn(o,t){return t==null||typeof t!="object"?o:o.replace(/\{([^}]+)\}/g,(e,s)=>{const n=uu(t,s);return n==null?e:String(n)})}function uu(o,t){const e=String(t).split(".");let s=o;for(let n=0;n<e.length;n++){if(s==null||typeof s!="object")return;const i=e[n];if(!Object.prototype.hasOwnProperty.call(s,i))return;s=s[i]}return s}const du=["svg","path","g"],pu="http://www.w3.org/2000/svg",fu="plotter-divider",_u="vertical",gu="plotter-divider-half";class x{static getNode(t="div",e=!1,s=[],n=null,i={}){const r=typeof e=="string"&&e!=="";let a=r?document.getElementById(e):null;a||(du.indexOf(t)!==-1?a=document.createElementNS(pu,t):a=document.createElement(t),r&&(a.id=e),n&&n.append(a));const l=typeof s=="string"?s.split(" "):s||[];x.#t(a,""),l.forEach(h=>{h&&a.classList.add(h)});const c=i||{};return Object.keys(c).forEach(h=>{if(h==="text"){a.innerText=c[h];return}if(h==="disabled"){c[h]?a.setAttribute(h,"true"):a.removeAttribute("disabled");return}a.setAttribute(h,c[h])}),a}static divider(t="li",e=!1,s=!1,n=[],i=!1){const r=x.getNode(t,s);return r.classList.add(fu,...n||[]),e&&r.classList.add(_u),i&&r.classList.add(gu),r}static clear(t){if(!t)return t;for(;t.firstChild;)t.removeChild(t.firstChild);return t}static#t(t,e){if(typeof t.className=="string"){t.className=e;return}t.setAttribute("class",e)}}class ht{static isRenderable(t){const e=t!=null&&typeof t.render=="function",s=t!=null&&t.__parameters__!=null;return e&&s}__nodes__={};__node__=!1;constructor(t){this.__parameters__=t}clearChild(t){return x.clear(t)}unmount(){Object.keys(this.__nodes__).forEach(t=>{const e=this.__nodes__[t];if(e instanceof Element){e.remove(),delete this.__nodes__[t];return}if(Array.isArray(e)){e.forEach(n=>{n instanceof Element&&n.remove()}),delete this.__nodes__[t];return}typeof e=="object"&&e&&Object.keys(e).forEach(n=>{e[n]instanceof Element&&(e[n].remove(),delete e[n])})}),this.__node__&&this.__node__.remove()}render(){return this.__node__}}const $="__table__",fa="custom";function Vn(o,t){return t===$?o?.configuration?.table?.enabled?{label:o.configuration.table.label||"Table",type:"table"}:null:!o?.traces||Array.isArray(o.traces)?null:o.traces[t]??null}function qt(o,t){const e=Vn(o,t);return e?e.type===fa?typeof e.template=="function":typeof e.template=="function"&&!Array.isArray(e.traces):!1}function mu(o,t,e={}){return{layer:o,viewKey:t,configuration:o?.configuration,data:e.data,...e}}const $n=new Set(["waterfall","tree"]);function yu(o){return!o||typeof o!="object"?[]:o.type===fa?[]:Array.isArray(o.traces)?o.traces.filter(t=>t&&typeof t=="object"):o.type&&o.type!=="table"?[o]:[]}function _a(o,t){if(!t||t===$||qt(o,t))return null;const e=Vn(o,t),s=yu(e);if(s.length!==1)return null;const n=s[0]?.type;return n!=null&&String(n).length>0?String(n):null}function ga(o,t,e){if(!t||!e||String(t)===String(e))return!1;const s=_a(o,t),n=_a(o,e);return!s||!n||s===n?!1:$n.has(s)&&$n.has(n)}function ws(o){return o!=null&&$n.has(String(o))}function bu(o,t){const e=String(o),s=String(t||"view").replace(/[^a-z0-9_-]/gi,"_");return`${e}-surface-${s}`}function Au(o,t,e=[]){const s=new Set(Array.from(e||[]).filter(a=>a!=null&&String(a).length>0).map(String)),n=bu(o,t);if(!s.has(n))return n;let i=1,r=`${n}-${i}`;for(;s.has(r);)i+=1,r=`${n}-${i}`;return r}function Lu(o,t,e,s=()=>""){const n=Array.isArray(t)?t.map(String):[],i=Array.isArray(e)?e.map(String):[],r=new Set,a=[];for(let l=0;l<n.length;l++){const c=n[l],h=typeof s=="function"?String(s(o,c)||""):"",u=i.filter(p=>r.has(p)?!1:ga(o,c,p));if(!u.length)continue;let d=u.find(p=>String(s(o,p)||"")===h);d||(d=u[0]),r.add(d),a.push({fromKey:c,toKey:d})}return a}const ma=18,Tu=14,ya=400,Wn="defaultsOmitPlot",ba="comment-default";function Aa(){return{title:{display:!0,size:ma,weight:ya,family:null,color:null},subtitle:{display:!0,size:Tu,weight:ya,family:null,color:null}}}function qe(o){const t=Aa();if(!o.header||typeof o.header!="object"||Array.isArray(o.header))return o.header=JSON.parse(JSON.stringify(t)),o.header;const e=o.header;return["title","subtitle"].forEach(s=>{if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s])){e[s]=JSON.parse(JSON.stringify(t[s]));return}const n=t[s];Object.keys(n).forEach(i=>{Object.prototype.hasOwnProperty.call(e[s],i)||(e[s][i]=n[i])})}),e}function La(o,t){const e=o?.header?.[t];return!(e&&e.display===!1)}function Gn(o){return o?.layout?.[Wn]===!0}function Je(o){if(!o||typeof o!="object"||Array.isArray(o))return;if((Array.isArray(o.pinnedViews)?o.pinnedViews:[]).some(s=>s!==$&&s!==ba)){delete o[Wn];return}o[Wn]=!0}const Ta=Object.freeze(["top","bottom","left","right","center"]),jn="__default__",Ea=Object.freeze(["pin","changeView"]),it=12,Ft=1,Rs=.05,Un=1,Eu=.5,xu=2/3,Su=1/3,St=80,Yn=8;function vu(o){return!o||typeof o!="object"||Array.isArray(o)?{}:Object.fromEntries(Object.entries(o).filter(([t,e])=>t&&(e===null||typeof e=="string")))}function xt(){return{pinnedViews:[],hiddenViews:[],viewSelectorMode:"changeView",pinnedGrid:{columns:2},pinnedRows:[],pinnedRowWeights:[],pinnedRowHeightsPx:[],pinnedViewColWeights:{},pinnedViewColSpans:{}}}const Cu=Object.freeze({header:"top",shortcut:"top"}),wu=Object.freeze({header:1,shortcut:2,legend:1});function Ce(o){const t=o?.legends?.position;return t==="left"||t==="right"||t==="top"||t==="bottom"?t:"right"}function Kn(o,t){if(o==="legend"){const e=Ce(t);return e==="top"||e==="bottom"?e:"center"}return Cu[o]||"top"}function Xn(o){return wu[o]??1}function Zn(o,t){if(o==="legend"){const e=Ce(t);return e==="top"||e==="bottom"}return o==="header"||o==="shortcut"}function Ru(o,t={}){if(!o||typeof o!="object")return o;const e=JSON.parse(JSON.stringify(o)),s=t.layout||xt(),n=e.layout&&typeof e.layout=="object"?e.layout:{};return e.layout={pinnedViews:Array.isArray(n.pinnedViews)?[...n.pinnedViews]:[],hiddenViews:Array.isArray(n.hiddenViews)?[...n.hiddenViews]:[],viewSelectorMode:Ea.includes(n.viewSelectorMode)?n.viewSelectorMode:s.viewSelectorMode||"changeView",pinnedGrid:{columns:Ns(n.pinnedGrid?.columns,s.pinnedGrid?.columns??2)},pinnedRowWeights:zu(n.pinnedRowWeights),pinnedRowHeightsPx:Vu(n.pinnedRowHeightsPx),pinnedViewColWeights:$u(n.pinnedViewColWeights,null),pinnedViewColSpans:Wu(n.pinnedViewColSpans,null),pinnedRows:Gu(n.pinnedRows,null),pinnedViewAnchors:vu(n.pinnedViewAnchors)},ju(e.layout,e.layout.pinnedViews),e.layout.pinnedViews=et(e.layout.pinnedViews,null),e.layout.hiddenViews=[],e}function we(o){const t=[];return o?.traces&&!Array.isArray(o.traces)&&t.push(...Object.keys(o.traces)),o?.configuration?.table?.enabled&&ku(o)&&t.push($),t}function ku(o){return o?.traces!=null&&!Array.isArray(o.traces)&&Object.keys(o.traces).length>0}function Qn(o,t){return t===$?!!o?.configuration?.table?.enabled:o?.traces?.[t]?.active!==!1}function ks(o){return we(o).filter(t=>Qn(o,t))}function et(o,t=null){const e=t?new Set(ks(t)):null,s=[];return(Array.isArray(o)?o:[]).forEach(i=>{typeof i!="string"||!i||e&&!e.has(i)||s.includes(i)||s.push(i)}),s}function Nu(o,t,e){const s=Array.isArray(o?.pinnedViews)?o.pinnedViews:[];if(!o)return s;(!o.pinnedViewAnchors||typeof o.pinnedViewAnchors!="object")&&(o.pinnedViewAnchors={});const n=o.pinnedViewAnchors,i=t.filter(u=>!s.includes(u));if(i.forEach(u=>{const d=t.indexOf(u);n[u]=t.slice(d+1).find(p=>s.includes(p))??null}),!e||!s.includes(e)||t.includes(e))return s;const r=i.length===1?i[0]:e,a=Object.prototype.hasOwnProperty.call(n,r),l=a?n[r]:void 0;delete n[e];const c=s.filter(u=>u!==e);if(l===null)return[...c,e];let h=a?c.indexOf(l):-1;if(h<0){const u=d=>d===$||d===ba;h=u(e)?-1:c.findIndex(u)}return h<0?s:(c.splice(h,0,e),c)}function Mu(o,t,e,s=null){const n=et(o,s),i=n.indexOf(t),r=n.indexOf(e);if(i<0||r<0||t===e)return n;n.splice(i,1);const a=n.indexOf(e);return n.splice(a,0,t),et(n,s)}function xa(o,t,e,s=null){const n=et(t,s),r=ss(n,e,s).find(c=>c.viewKeys.includes(o)),a={start:1,span:it};return r?Os(r.viewKeys,e,s,n)[o]??a:a}function qn(o,t){return et(o?.configuration?.layout?.pinnedViews,o).includes(t)}function Sa(o,t){o.configuration.layout||(o.configuration.layout=xt());const e=o.configuration.layout,s=et(e.pinnedViews,o),n=s.indexOf(t);if(n>=0){if(!qn(o,t))return!1;const r=ni(s,e,o).find(a=>a.viewKeys.includes(t));s.splice(n,1),e.pinnedViews=et(s,o),o.trace===t&&(o.trace=e.pinnedViews[0]||o.trace),r&&Yu(e,r.viewKeys,t)}else s.push(t),e.pinnedViews=et(s,o),(!e.pinnedViewColSpans||typeof e.pinnedViewColSpans!="object")&&(e.pinnedViewColSpans={}),e.pinnedViewColSpans[t]==null&&(te(o),e.pinnedViewColSpans[t]=wa(),e.pinnedViewColWeights=e.pinnedViewColWeights||{},e.pinnedViewColWeights[t]=e.pinnedViewColSpans[t]);return ge(o),ee(o?.configuration)!=="pin"&&(ts(o),ge(o)),!0}function Iu(o,t){if(ee(o?.configuration)!=="pin"){ti(o,t);return}o.configuration.layout||(o.configuration.layout=xt());const e=o.configuration.layout;let s=et(e.pinnedViews,o);s.includes(t)||(s.push(t),e.pinnedViews=et(s,o)),o.trace=t}function va(o,t){if(!Array.isArray(t)||t.length<2)return!1;const e=Jt(o,t[0]);return e?t.every(s=>Jt(o,s)===e):!1}function Ou(o){if(!o||ee(o?.configuration)==="pin")return;o.configuration?.layout||(o.configuration.layout=xt());const t=o.configuration.layout,e=et(t.pinnedViews,o),s=e.includes($),n=e.filter(a=>a!==$),i=o.trace&&o.trace!==$?o.trace:n[0];if(!i)return;const r=va(o,n);n.length>1&&!r?t.pinnedViews=et(s?[i,$]:[i],o):n.length===1&&n[0]!==i?t.pinnedViews=et(s?[i,$]:[i],o):r&&!n.includes(i)&&(o.trace=n[0]),o.trace!==i&&o.trace!==$&&n.length<=1&&(o.trace=i),ts(o)}function ts(o){if(!o||ee(o?.configuration)==="pin"||!o.configuration?.layout)return;const t=o.configuration.layout,e=et(t.pinnedViews,o),s=e.filter(c=>c!==$),n=e.includes($),i=o.trace&&s.includes(o.trace)?o.trace:s[0];if(!i)return;(!t.pinnedViewColSpans||typeof t.pinnedViewColSpans!="object")&&(t.pinnedViewColSpans={}),(!t.pinnedViewColWeights||typeof t.pinnedViewColWeights!="object")&&(t.pinnedViewColWeights={});const r=it,a=r/2,l=Ms(t.pinnedRows,e);if(n&&s.length===1){l||(t.pinnedRows=[[i],[$]]),[i,$].forEach(c=>{t.pinnedViewColSpans[c]==null&&(t.pinnedViewColSpans[c]=r,t.pinnedViewColWeights[c]=r)});return}if(s.length===1){l||(t.pinnedRows=[[i]]),t.pinnedViewColSpans[i]==null&&(t.pinnedViewColSpans[i]=r,t.pinnedViewColWeights[i]=r);return}if(va(o,s)){const c=new Map;e.forEach(h=>{const u=Jt(o,h);u&&(c.has(u)||c.set(u,[]),c.get(u).push(h))}),c.forEach(h=>{const u=e.filter(d=>h.includes(d));if(u.length>=2){u.forEach(d=>{t.pinnedViewColSpans[d]==null&&(t.pinnedViewColSpans[d]=a,t.pinnedViewColWeights[d]=a)});return}if(u.length===1){const d=u[0];t.pinnedViewColSpans[d]==null&&(t.pinnedViewColSpans[d]=r,t.pinnedViewColWeights[d]=r)}}),n&&t.pinnedViewColSpans[$]==null&&(t.pinnedViewColSpans[$]=r,t.pinnedViewColWeights[$]=r),l||(t.pinnedRows=Ca(o,e,c))}}function Jn(o){if(!o?.configuration?.layout||ee(o?.configuration)!=="changeView")return;const t=o.configuration.layout;t.pinnedViews=et(t.pinnedViews,o);const e=t.pinnedViews.filter(s=>s!==$);t.pinnedViews.length&&o.trace&&o.trace!==$&&!t.pinnedViews.includes(o.trace)&&(o.trace=e[0]||t.pinnedViews[0]),ts(o),ge(o)}function Jt(o,t){if(!t||t===$)return"";const e=o?.traces?.[t]?.group;return e?String(e):""}function Pu(o,t){return!t||!o?.traces||Array.isArray(o.traces)?[]:Object.keys(o.traces).filter(e=>Jt(o,e)===String(t))}function Du(o){if(!o?.configuration?.layout||ee(o?.configuration)!=="pin")return;const t=o.configuration.layout,e=et(t.pinnedViews,o);if(!e.length)return;(!t.pinnedViewColSpans||typeof t.pinnedViewColSpans!="object")&&(t.pinnedViewColSpans={}),(!t.pinnedViewColWeights||typeof t.pinnedViewColWeights!="object")&&(t.pinnedViewColWeights={});const s=new Map;e.forEach(i=>{const r=Jt(o,i);r&&(s.has(r)||s.set(r,[]),s.get(r).push(i))});let n=!1;s.forEach(i=>{if(i.length<2)return;n=!0,e.filter(a=>i.includes(a)).forEach(a=>{t.pinnedViewColSpans[a]=it,t.pinnedViewColWeights[a]=it})}),n&&(t.pinnedRows=Ca(o,e,s,{stackSubgroups:!0}))}function Ca(o,t,e,s={}){const n=s.stackSubgroups===!0,i=[],r=new Set;return t.forEach(a=>{if(r.has(a))return;const l=Jt(o,a);if(l&&e.has(l)){const c=t.filter(h=>e.get(l).includes(h));if(c.length>=2){if(n){c.forEach(h=>{r.has(h)||(i.push([h]),r.add(h))});return}i.push([...c]),c.forEach(h=>r.add(h));return}}i.push([a]),r.add(a)}),i}function Fu(o){o?.configuration?.layout||(o.configuration.layout=xt());const t=o.configuration.layout;t.pinnedViews=et(t.pinnedViews,o),t.pinnedViews.length&&o.trace&&!t.pinnedViews.includes(o.trace)&&(o.trace=t.pinnedViews[0]),Du(o),ge(o)}function te(o){const t=o?.configuration?.layout?.pinnedViews,e=et(t,o);if(e.length)return e;if(Array.isArray(o?.traces))return[jn];if(Array.isArray(t))return[];const s=o?.trace;return s?[s]:[]}function Ns(o,t=2){const e=Number(o);return Number.isFinite(e)?e<=1?1:2:t}function ee(o){const t=o?.layout?.viewSelectorMode;return Ea.includes(t)?t:"changeView"}function ti(o,t){o.configuration.layout||(o.configuration.layout=xt());const e=o.configuration.layout,s=(e.pinnedViews||[]).includes($);if(t===$){let i=et(e.pinnedViews,o);if(i.includes($))i=i.filter(r=>r!==$),i.length||(i=[o.trace||ks(o)[0]].filter(Boolean));else{const r=o.trace||i[0]||ks(o)[0];i=r?[r,$]:[$]}e.pinnedViews=et(i,o),e.pinnedViews.includes(o.trace)||(o.trace=e.pinnedViews.find(r=>r!==$)||e.pinnedViews[0]),ts(o);return}o.trace=t;const n=(e.pinnedViews||[]).find(i=>i!==$&&i!==t);e.pinnedViews=s&&e.pinnedViews.includes($)?et([t,$],o):et([t],o),n&&ei(e,n,t),ts(o)}function Hu(o,t){if(!o?.trace||!t||t===o.trace)return!1;o.configuration.layout||(o.configuration.layout=xt());const e=o.configuration.layout,s=et(e.pinnedViews,o),n=o.trace;if(!s.includes(n)||s.includes(t))return!1;const i=s.indexOf(n);return s[i]=t,o.trace=t,e.pinnedViews=et(s,o),ei(e,n,t),!0}function Bu(o){const t=new Set(et(o?.configuration?.layout?.pinnedViews,o));return ks(o).filter(e=>!t.has(e))}function es(o,t=Un){const e=Number(o),s=Number.isFinite(t)&&t>=Rs?t:Un;return!Number.isFinite(e)||e<Rs?s:e}function zu(o){return Array.isArray(o)?o.map(t=>es(t)):[]}function Vu(o){return Array.isArray(o)?o.map(t=>{const e=Number(t);return!Number.isFinite(e)||e<=0?null:Math.round(e)}).filter(t=>t!=null):[]}function $u(o,t=null){const e=t?new Set(we(t)):null,s={};return Object.entries(o&&typeof o=="object"?o:{}).forEach(([i,r])=>{typeof i!="string"||!i||e&&!e.has(i)||(s[i]=es(r))}),s}function _e(o,t=it){const e=Math.round(Number(o)),s=Number.isFinite(t)&&t>=Ft&&t<=it?Math.round(t):it;return!Number.isFinite(e)||e<Ft?s:Math.min(it,e)}function Wu(o,t=null){const e=t?new Set(we(t)):null,s={};return Object.entries(o&&typeof o=="object"?o:{}).forEach(([i,r])=>{typeof i!="string"||!i||e&&!e.has(i)||(s[i]=_e(r))}),s}function Gu(o,t=null){if(!Array.isArray(o))return[];const e=t?new Set(we(t)):null,s=[];return o.forEach(n=>{if(!Array.isArray(n))return;const i=[];n.forEach(r=>{typeof r!="string"||!r||e&&!e.has(r)||i.includes(r)||i.push(r)}),i.length&&s.push(i)}),s}function Ms(o,t){const e=Array.isArray(o)?o:[],s=Array.isArray(t)?t:[],n=e.flat();if(n.length!==s.length)return!1;for(let i=0;i<s.length;i++)if(n[i]!==s[i])return!1;return!0}function wa(o,t){return it}function ei(o,t,e){if(!o||!t||!e||String(t)===String(e))return;const s=String(t),n=String(e);(!o.pinnedViewColSpans||typeof o.pinnedViewColSpans!="object")&&(o.pinnedViewColSpans={}),(!o.pinnedViewColWeights||typeof o.pinnedViewColWeights!="object")&&(o.pinnedViewColWeights={}),o.pinnedViewColSpans[s]!=null&&(o.pinnedViewColSpans[n]=o.pinnedViewColSpans[s]),delete o.pinnedViewColSpans[s],o.pinnedViewColWeights[s]!=null&&(o.pinnedViewColWeights[n]=o.pinnedViewColWeights[s]),delete o.pinnedViewColWeights[s],Array.isArray(o.pinnedRows)&&(o.pinnedRows=o.pinnedRows.map(i=>Array.isArray(i)?i.map(r=>String(r)===s?n:r):i)),o.pinnedViewAnchors&&typeof o.pinnedViewAnchors=="object"&&(Object.prototype.hasOwnProperty.call(o.pinnedViewAnchors,s)&&(o.pinnedViewAnchors[n]=o.pinnedViewAnchors[s],delete o.pinnedViewAnchors[s]),Object.keys(o.pinnedViewAnchors).forEach(i=>{o.pinnedViewAnchors[i]===s&&(o.pinnedViewAnchors[i]=n)}))}function Ra(o,t=2){const e=Array.isArray(o)?o:[];if(Ns(t)===1)return e.map(i=>({viewKeys:[i],isFullWidth:!0}));const n=[];for(let i=0;i<e.length;i+=2){const r=e.slice(i,i+2);n.push({viewKeys:r,isFullWidth:r.length===1})}return n}function ju(o,t=[]){if(!o||typeof o!="object")return;const e=Array.isArray(t)?t:[];if(!e.length)return;const s=o?.pinnedViewColSpans&&typeof o.pinnedViewColSpans=="object"&&Object.keys(o.pinnedViewColSpans).length>0,n=Ms(o.pinnedRows,e);if(s||n)return;(!o.pinnedViewColSpans||typeof o.pinnedViewColSpans!="object")&&(o.pinnedViewColSpans={}),(!o.pinnedViewColWeights||typeof o.pinnedViewColWeights!="object")&&(o.pinnedViewColWeights={});const i=Ns(o.pinnedGrid?.columns,2),r=Ra(e,i);o.pinnedRows=r.map(a=>[...a.viewKeys]),e.forEach(a=>{if(o.pinnedViewColSpans[a]!=null)return;const c=o.pinnedRows.find(h=>h.includes(a))?.length===1?it:it/2;o.pinnedViewColSpans[a]=c,o.pinnedViewColWeights[a]=c})}function si(o,t,e=null,s=null){const n=t?.pinnedViewColSpans?.[o];if(Number.isFinite(Number(n)))return _e(n);const i=Array.isArray(s)?s:[],r=t?.pinnedRows;if(Ms(r,i)){const a=r.find(l=>l.includes(o));if(a)return a.length===1?it:Math.max(Ft,Math.round(it/a.length))}return wa()}function Uu(o){if(!o?.configuration?.layout)return;const t=o.configuration.layout,e=te(o);(!t.pinnedViewColSpans||typeof t.pinnedViewColSpans!="object")&&(t.pinnedViewColSpans={}),(!t.pinnedViewColWeights||typeof t.pinnedViewColWeights!="object")&&(t.pinnedViewColWeights={}),e.forEach(s=>{if(t.pinnedViewColSpans[s]==null){const n=si(s,t,o,e);t.pinnedViewColSpans[s]=n,t.pinnedViewColWeights[s]=n}})}function ka(o,t,e=null,s=null){const n=Array.isArray(o)?o:[],i=Array.isArray(s)?s:n,r=[];let a=null,l=0;if(n.forEach(c=>{const h=l>=it;(!a||h)&&(a={viewKeys:[],spans:[]},r.push(a),l=0);const u=si(c,t,e,i),d=it-l,p=Math.max(Ft,Math.min(u,d));a.viewKeys.push(c),a.spans.push(p),l+=p}),a&&l<it){const c=a.spans.length-1;a.spans[c]+=it-l}return r}function ss(o,t,e=null){const s=Array.isArray(o)?o:[];return ka(s,t,e,s).map(i=>({viewKeys:[...i.viewKeys],isFullWidth:i.viewKeys.length===1&&i.spans[0]===it}))}function ni(o,t=null,e=null){const s=Array.isArray(o)?o:[];if(!s.length)return[];if(t?.pinnedViewColSpans&&typeof t.pinnedViewColSpans=="object"&&Object.keys(t.pinnedViewColSpans).length>0)return ss(s,t,e);const i=t?.pinnedRows;if(Ms(i,s))return i.map(l=>({viewKeys:[...l],isFullWidth:l.length===1}));const r=xt(),a=Ns(t?.pinnedGrid?.columns,r.pinnedGrid.columns);return Ra(s,a)}function ge(o){if(!o?.configuration?.layout)return;const t=o.configuration.layout,e=te(o);Uu(o),ss(e,t,o).forEach(n=>{Ma(n.viewKeys,t)}),t.pinnedRows=ss(e,t,o).map(n=>[...n.viewKeys])}function Yu(o,t,e){if(!o||!e)return;const n=(Array.isArray(t)?t:[]).filter(l=>l!==e);if(n.length!==1)return;const i=n[0],r=it/2;(!o.pinnedViewColSpans||typeof o.pinnedViewColSpans!="object")&&(o.pinnedViewColSpans={}),(!o.pinnedViewColWeights||typeof o.pinnedViewColWeights!="object")&&(o.pinnedViewColWeights={});const a=o.pinnedViewColSpans[i];(a==null||a<=r)&&(o.pinnedViewColSpans[i]=it,o.pinnedViewColWeights[i]=it)}const Is=8;function Na(o,t,e,s){const i=(e>0?e:1)/it,r=s-1,a=Math.round((o-t)/i),l=_e(a-r,Ft);return{span:l,boundaryLeftPx:(r+l)*i-Is/2}}function Ku(o,t,e,s,n){const r=(e>0?e:1)/it,l=s-1+n;let c=Math.round((o-t)/r);c=Math.max(0,Math.min(l-Ft,c));const h=_e(l-c,Ft);return{start:l-h+1,span:h,boundaryLeftPx:c*r-Is/2}}function Xu(o,t,e,s=null){if(!o||!t)return!1;const n=et(o.pinnedViews,s),r=ss(n,o,s).find(f=>f.viewKeys.includes(t));if(!r)return!1;const a=Os(r.viewKeys,o,s,n),l=a[t];if(!l)return!1;const c=l.start+l.span-1,h=Math.max(1,Math.min(c,Math.round(e))),u=c-h+1;if(u<Ft||h===l.start)return!1;const d=h-l.start,p=r.viewKeys.indexOf(t);if(p>0){const f=r.viewKeys[p-1],g=(a[f]?.span??Ft)+d;if(g<Ft)return!1;Ps(o,f,g,null)}else if(h!==1)return!1;return Ps(o,t,u,s),!0}function Os(o,t,e=null,s=null){const n=Array.isArray(o)?o:[],i=ka(n,t,e,s),r={};return i.forEach(a=>{let l=1;a.viewKeys.forEach((c,h)=>{const u=a.spans[h];r[c]={start:l,span:u},l+=u})}),r}function Ma(o,t){if(!t||typeof t!="object")return;const e=Array.isArray(o)?o:[];if(e.length!==0){if((!t.pinnedViewColSpans||typeof t.pinnedViewColSpans!="object")&&(t.pinnedViewColSpans={}),(!t.pinnedViewColWeights||typeof t.pinnedViewColWeights!="object")&&(t.pinnedViewColWeights={}),e.length===1){const s=_e(t.pinnedViewColSpans[e[0]]);t.pinnedViewColSpans[e[0]]=s,t.pinnedViewColWeights[e[0]]=s;return}e.forEach(s=>{const n=_e(t.pinnedViewColSpans[s]);t.pinnedViewColSpans[s]=n,t.pinnedViewColWeights[s]=n})}}function Re(o){if(!o?.configuration?.layout)return;ge(o);const t=o.configuration.layout,e=te(o),s=ni(e,t,o),n=s.length;Array.isArray(t.pinnedRowWeights)||(t.pinnedRowWeights=[]),(!t.pinnedViewColWeights||typeof t.pinnedViewColWeights!="object")&&(t.pinnedViewColWeights={}),(!t.pinnedViewColSpans||typeof t.pinnedViewColSpans!="object")&&(t.pinnedViewColSpans={});const i=[];for(let r=0;r<n;r++){const a=t.pinnedRowWeights[r];i.push(es(a,Un))}t.pinnedRowWeights=i,s.forEach(r=>{Ma(r.viewKeys,t)})}function Zu(o,t,e,s){if(!o||!Array.isArray(o.pinnedRowWeights))return;const n=es(e),i=es(s);o.pinnedRowWeights[t]=n,o.pinnedRowWeights[t+1]=i}function Ps(o,t,e,s=null){if(!o)return;(!o.pinnedViewColSpans||typeof o.pinnedViewColSpans!="object")&&(o.pinnedViewColSpans={}),(!o.pinnedViewColWeights||typeof o.pinnedViewColWeights!="object")&&(o.pinnedViewColWeights={});const n=_e(e,Ft);o.pinnedViewColSpans[t]=n,o.pinnedViewColWeights[t]=n,s&&ge(s)}function Ia(o,t){return t===2?o===0?xu:Su:Eu}function Oa(o,t){const e=Number.isFinite(o)&&o>0?o:St*Math.max(1,t);return t<2?e:Math.max(St*t,e-Yn*(t-1))}function Pa(o,t=0,e=2){const s=Oa(o,e),n=Ia(t,e);return Math.max(St,Math.round(s*n))}function Qu(o,t,e){if(!o||t<2||!(e>0))return;const s=o.pinnedRowHeightsPx;if(!Array.isArray(s)||s.length!==t)return;const n=s.map(c=>Number(c));if(n.some(c=>!(c>0)))return;const i=n.reduce((c,h)=>c+h,0),r=Oa(e,t);if(i>e+1||i===r)return;let l=0;for(let c=0;c<t-1;c++){const h=Math.max(St,Math.round(n[c]*(r/i)));s[c]=h,l+=h}s[t-1]=Math.max(St,r-l)}function ii(o,t,e,s){if(t<=1)return Math.max(St,Math.round(s));const n=e?.pinnedRowHeightsPx,i=Number(n?.[o]);return Array.isArray(n)&&n.length===t&&Number.isFinite(i)&&i>0?Math.round(i):Pa(s,o,t)}function qu(o,t,e){const s=Array.isArray(o)?o:[],n=s.length;return n<=1?Math.max(St,Math.round(e)):s.reduce((r,a,l)=>r+ii(l,n,t,e),0)+Yn*(n-1)}function Ju(o,t,e,s){!o||!Array.isArray(o.pinnedRowHeightsPx)||(o.pinnedRowHeightsPx[t]=Math.max(St,Math.round(e)),o.pinnedRowHeightsPx[t+1]=Math.max(St,Math.round(s)))}function ri(o,t,e=null,s={}){const n=Array.isArray(o)?o:[];if(n.length===0)return[];const i=Number(s.containerHeightPx)||0;return n.length===1?i>0?[`minmax(${St}px, 1fr)`]:["minmax(0, 1fr)"]:i>0?(Qu(t,n.length,i),n.map((r,a)=>`${ii(a,n.length,t,i)}px`)):n.map((r,a)=>`minmax(0, ${Ia(a,n.length)*100}%)`)}function ai(o,t,e=null,s={}){const n=t?.layout,i=Array.isArray(o)?o:[],r=ni(i,n,e),a=Number(s.containerHeightPx)||0,l=ri(r,n,e,s),c=l.length?l.join(" "):"minmax(0, 1fr)",h=!1,u=a>0?qu(r,n,a):0,d=r.length>1&&a>0&&u>a+1,p=`repeat(${it}, minmax(0, 1fr))`,f={};return r.forEach((_,g)=>{const m=Os(_.viewKeys,n,e,i);_.viewKeys.forEach(y=>{const b=m[y]||{start:1,span:it};f[y]={gridRow:String(g+1),gridColumn:`${b.start} / span ${b.span}`}})}),{gridTemplateColumns:p,gridTemplateRows:c,rowGroups:r,usesIntrinsicRowHeights:h,totalGridHeightPx:u,scrollableRowStack:d,getPaneStyle(_){return f[_]||{gridRow:"1",gridColumn:`1 / span ${it}`}}}}const Da="__plotBackground",Fa="__commentPane",Ds="__traceTitle",Ha="__traceSubtitle",Ba="__headerTitle",za="__headerSubtitle",Va="__legend",oi="__axisTick",$a="__axisTickMeasure",ns="axis.ticks",Wa="chart.title",Ga="chart.subtitle",ja="header.title",Ua="header.subtitle",td="axis",Ya="custom.view",ed="waterfall.labels",sd="waterfall.topLine",Ka="__lineEndLabel",K=Object.freeze({BAR:"bar",BAR_LABEL:"barLabel",LINE:"line",POINT:"point",LINE_END_LABEL:"lineEndLabel",LEGEND:"legend",AXIS:"axis",AXIS_TITLE:"axisTitle",BACKGROUND:"background"}),nd=Object.freeze([K.BAR,K.LINE,K.POINT,K.BACKGROUND]),id=[".plotter-trace-element-path",".plotter-axis-tick-hitbox",".plotter-axis-header-hitbox",".plotter-waterfall-value-label",".plotter-waterfall-top-line-label",".plotter-bar-label",".plotter-line-end-label"].join(","),Xa=Object.freeze([{selector:".plotter-trace-title",focus:Wa},{selector:".plotter-trace-subtitle",focus:Ga},{selector:".plotter-custom-view",focus:Ya},{selector:".plotter-waterfall-value-label",focus:ed},{selector:".plotter-waterfall-top-line-label",focus:sd},{selector:".plotter-title",focus:ja},{selector:".plotter-subtitle",focus:Ua},{selector:".plotter-axis-tick-hitbox",focus:ns},{selector:".plotter-axis",focus:td}]),rd=".plotter-axis, .plotter-axis-tick-hitbox, .plotter-axis-header-hitbox";function Za(o,t){const e=o?.target;return e instanceof Element&&e.closest(rd)?!0:t?.[oi]===!0}function Qa(o){const t=o?.target;return t instanceof Element?!!t.closest(id):!1}function qa(o){return o?.[Da]===!0}function Fs(o){return o?.[Fa]===!0}function li(o){return o?.[Ds]===!0}function ci(o){return o?.[Ha]===!0}function hi(o){return o?.[Ba]===!0}function ui(o){return o?.[za]===!0}function ad(o){return o?.[Va]===!0}function Ja(o){return qa(o)||Fs(o)||li(o)||ci(o)||hi(o)||ui(o)}function to(o){return Fs(o)||li(o)||ci(o)||hi(o)||ui(o)}function od(o){return o?.[oi]===!0}function ld(o,t,e){const s=o?.target instanceof Element?o.target:null;if(ad(t))return K.LEGEND;if(s?.closest(".plotter-axis-label, .plotter-axis-header-hitbox"))return K.AXIS_TITLE;if(Za(o,t))return K.AXIS;if(s?.closest(".plotter-bar-label"))return K.BAR_LABEL;if(t?.[Ka]===!0)return K.LINE_END_LABEL;if(qa(t))return K.BACKGROUND;if(t==null||Ja(t))return null;const n=e?.trace?.type;return n==="bars"||n==="mekko100"?K.BAR:n==="bubble"?K.POINT:n==="lines"||n==="areas"&&e.trace.line?K.LINE:null}const _t={elementAction:()=>"Trace Action".translate(),traceAction:()=>"Trace Action".translate(),solutionAction:o=>o.translate(),plotAction:()=>"Chart".translate(),translation:()=>"Translation".translate(),calendar:()=>"Calendar".translate(),layerAction:o=>o.translate(),table:()=>"Table".translate(),column:()=>"Column".translate(),row:()=>"Row".translate(),cell:()=>"Cell".translate(),footer:()=>"Footer".translate()};function cd(o){const t=o||"compare";return t.charAt(0).toUpperCase()+t.slice(1)}function hd(o){const t=typeof o=="string"?o:"";return _t.solutionAction(cd(t))}function ud(o,t){const e=o?.target;if(e instanceof Element)for(let s=0;s<Xa.length;s++){const{selector:n,focus:i}=Xa[s];if(e.closest(n))return i}return od(t)?ns:null}function dd(o,t){const e=o?.settingsFocus;return e==null?!1:Array.isArray(e)?e.includes(t):e===t}function pd(o,t,{solutionGroupLabel:e=null}={}){const s=Array.isArray(o)?o:[],n=_t.translation(),i=s.some(u=>u?.group===n),r=typeof e=="string"&&e.length>0;if(!i&&!r&&!t)return s;const a=[],l=[],c=[],h=[];for(let u=0;u<s.length;u++){const d=s[u];if(i&&d?.group===n){a.push(d);continue}if(r&&d?.group===e){l.push(d);continue}if(t&&dd(d,t)){c.push(d);continue}h.push(d)}return[...a,...l,...c,...h]}const fd=Object.freeze(["Texts","Markers","Title","Subtitle","Slide title","Slide subtitle","Baseline","Hierarchy lines","Grid","Legend","Comment","Labels","End labels","Waterfall","Tree","Element","Table","Column","Row","Cell","Footer"]);function _d(o){if(typeof o!="string"||!o.length)return!1;if(fd.some(e=>e.translate()===o))return!0;const t="Series {name}".translate({name:""}).trim();return t.length>0&&o.startsWith(t)}function gd(o){return o?.action===!0?!0:!o||typeof o.click!="function"||o.items?!1:!o.switchInput&&!o.numericValue&&!o.numericInput&&!o.colorSwatch&&!o.checkboxInput}function md(o){return Array.isArray(o)?o.map(t=>{if(!t?.icon||!_d(t.group)||gd(t))return t;const{icon:e,...s}=t;return s}):[]}function eo(o,t){const e=o??[],s=t??[];if(!s.length)return e;const n=_t.calendar(),i=e.findIndex(l=>l?.group===n);if(i===-1)return[...e,...s];const r=e.slice(0,i),a=e.slice(i);return[...r,...s,...a]}const Hs="plotter-header",yd="plotter-region",so="plotter-title",no="plotter-subtitle",io="datama-story-module-title",ro="datama-story-module-subtitle";class bd extends ht{init(){this.__node__||(this.__node__=x.getNode("div",this.__parameters__.id,[Hs],this.__parameters__.parent.getChromeRegionNode("header"),{style:`order: ${Xn("header")}`})),this.clearChild(this.__node__);const t=[this.#r(),this.#i()];return new Promise((e,s)=>{Promise.all(t).then(()=>{this.#t(),e(this.__node__)}).catch(n=>{s(n)})})}#t(){const t=this.__node__;t instanceof HTMLElement&&(this.#e(t).forEach(e=>{e!==t&&e.remove()}),[[so,this.__nodes__.title],[no,this.__nodes__.subtitle]].forEach(([e,s])=>{t.querySelectorAll(`:scope > .${e}`).forEach(n=>{n!==s&&n.remove()})}))}#e(t){const e=this.__parameters__.parent?.__node__;if(e instanceof HTMLElement&&e.contains(t))return Array.from(e.querySelectorAll(`:scope > .${Hs}, :scope > .${yd} > .${Hs}`));const s=t.parentNode;return s instanceof HTMLElement?Array.from(s.querySelectorAll(`:scope > .${Hs}`)):[]}setTitle(t=[]){return this.__parameters__.parent.layer.title||(this.__parameters__.parent.layer.title={}),this.__parameters__.parent.layer.title.content=t,this.init()}setSubtitle(t=[]){return this.__parameters__.parent.layer.subtitle||(this.__parameters__.parent.layer.subtitle={}),this.__parameters__.parent.layer.subtitle.content=t,this.init()}#s(){const t=this.__parameters__.parent.layer?.configuration;return qe(t||{})}#n(t,e){!t||!e||(e.size!=null?t.style.setProperty("--plotter-header-font-size",`${e.size}px`):t.style.removeProperty("--plotter-header-font-size"),e.weight!=null?t.style.setProperty("--plotter-header-font-weight",String(e.weight)):t.style.removeProperty("--plotter-header-font-weight"),e.family?t.style.setProperty("--plotter-header-font-family",e.family):t.style.removeProperty("--plotter-header-font-family"),e.color?t.style.setProperty("--plotter-header-font-color",e.color):t.style.removeProperty("--plotter-header-font-color"))}#r(){return new Promise((t,e)=>{try{const s=this.__parameters__.parent.layer?.configuration;if(!La(s,"title")){t(null);return}const n=this.#s();this.__nodes__.title?this.__nodes__.title.classList.add(io):(this.__nodes__.title=x.getNode("div",!1,[so,io,...this.__parameters__.parent.layer.title?.classList||[]]),this.#a(this.__nodes__.title,Ba)),this.__nodes__.title.replaceChildren(),this.#n(this.__nodes__.title,n.title),(this.__parameters__.parent.layer.title?.content||[]).forEach(r=>{ht.isRenderable(r)?this.__nodes__.title.append(r.render()):r instanceof HTMLElement&&this.__nodes__.title.append(r)}),this.__node__.append(this.__nodes__.title),t(this.__nodes__.title)}catch(s){e(s)}})}#i(){return new Promise((t,e)=>{try{const s=this.__parameters__.parent.layer?.configuration;if(!La(s,"subtitle")){t(null);return}const n=this.#s();this.__nodes__.subtitle?this.__nodes__.subtitle.classList.add(ro):(this.__nodes__.subtitle=x.getNode("div",!1,[no,ro,...this.__parameters__.parent.layer.subtitle?.classList||[]]),this.#a(this.__nodes__.subtitle,za)),this.__nodes__.subtitle.replaceChildren(),this.#n(this.__nodes__.subtitle,n.subtitle);const i=(this.__parameters__.parent.layer.subtitle?.content||[]).filter(r=>r instanceof HTMLElement||typeof r=="string");this.__nodes__.subtitle.append(...i),this.__node__.append(this.__nodes__.subtitle),t(this.__nodes__.subtitle)}catch(s){e(s)}})}#a(t,e){!(t instanceof HTMLElement)||t.dataset.plotterHeaderContextMenuBound==="true"||(t.dataset.plotterHeaderContextMenuBound="true",t.addEventListener("contextmenu",s=>{this.#l(s,e)}))}#l(t,e){t.preventDefault(),t.stopPropagation();let s=t.target;if(s instanceof Element||(s=s?.parentElement),!(s instanceof Element))return;const n=this.__parameters__.parent?.__instance__?.contextMenu;if(!n)return;const i=this.__parameters__.parent?.__instance__?.plot,r=this.#h(i);n.render(t,{[e]:!0},r)}#h(t){const e=t?.instances;if(!e||typeof e!="object")return null;const s=Object.keys(e);for(let n=0;n<s.length;n++){const i=s[n];if(i==="legends"||i==="hover"||i==="differences")continue;const r=e[i];if(r?.trace)return r}return null}}const ao=24,Ad=ao/1024,Ld=ao/512,Td=.05,di="http://www.w3.org/2000/svg",oo=Object.freeze({"close-svg":"cross-svg","stacked-svg":"bars-stacked-svg","unstacked-svg":"bars-svg"}),lo=Object.freeze({"annotate-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
3
|
+
<g>
|
|
4
|
+
<g>
|
|
5
|
+
<path fill="none" stroke="currentColor" stroke-width="1.65" stroke-linecap="round" stroke-linejoin="round" d="M 6,18.5 V 5 H 18 V 12.5"/>
|
|
6
|
+
<path fill="currentColor" d="M 18,16.1 L 15.4,12.5 H 20.6 Z"/>
|
|
7
|
+
</g>
|
|
8
|
+
</g>
|
|
9
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
10
|
+
<g>
|
|
11
|
+
<g>
|
|
12
|
+
<path fill="none" stroke="currentColor" stroke-width="1.65" stroke-linecap="round" stroke-linejoin="round" d="M 6,18.5 V 5 H 18 V 12.5"/>
|
|
13
|
+
<path fill="currentColor" d="M 18,16.1 L 15.4,12.5 H 20.6 Z"/>
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
17
|
+
<g>
|
|
18
|
+
<g>
|
|
19
|
+
<path fill="none" stroke="white" stroke-width="1.65" stroke-linecap="round" stroke-linejoin="round" d="M 6,18.5 V 5 H 18 V 12.5"/>
|
|
20
|
+
<path fill="white" d="M 18,16.1 L 15.4,12.5 H 20.6 Z"/>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</g>`},"areas-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 4,14 L 8,8.5 L 12.5,11 L 16.5,5.5 L 20,4.5 V 19.5 H 4 Z"},"arrow-down-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
24
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M12 5 L12 10.5 M8 10.5 L12 15 L16 10.5"/>\r
|
|
25
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
26
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M12 5 L12 10.5 M8 10.5 L12 15 L16 10.5"/>\r
|
|
27
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
28
|
+
<path fill="none" stroke="white" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M12 5 L12 10.5 M8 10.5 L12 15 L16 10.5"/>\r
|
|
29
|
+
</g>`},"arrow-up-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
30
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M12 19 L12 13.5 M8 13.5 L12 9 L16 13.5"/>\r
|
|
31
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
32
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M12 19 L12 13.5 M8 13.5 L12 9 L16 13.5"/>\r
|
|
33
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
34
|
+
<path fill="none" stroke="white" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M12 19 L12 13.5 M8 13.5 L12 9 L16 13.5"/>\r
|
|
35
|
+
</g>`},"axis-cut-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 3.375,11.25 L 7.35,11.25 Q 7.725,11.25 7.725,11.625 L 7.725,12.375 Q 7.725,12.75 7.35,12.75 L 3.375,12.75 Q 3,12.75 3,12.375 L 3,11.625 Q 3,11.25 3.375,11.25 Z M 13.525,11.25 L 16.125,11.25 Q 16.5,11.25 16.5,11.625 L 16.5,12.375 Q 16.5,12.75 16.125,12.75 L 13.525,12.75 Q 13.15,12.75 13.15,12.375 L 13.15,11.625 Q 13.15,11.25 13.525,11.25 Z M 16.75,8.75 L 21,12 L 16.75,15.25 Z M 7.4,16.125 L 8.65,16.125 L 9.85,7.875 L 8.6,7.875 Z M 10.65,16.125 L 11.9,16.125 L 13.1,7.875 L 11.85,7.875 Z"},"axis-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
36
|
+
<g>
|
|
37
|
+
<g>
|
|
38
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.25,19.25 V 5.75 M 5.25,19.25 H 18.75"/>
|
|
39
|
+
<path fill="currentColor" d="M 5.25,3.4 L 2.85,7.1 H 7.65 Z M 20.6,19.25 L 16.9,16.85 V 21.65 Z"/>
|
|
40
|
+
</g>
|
|
41
|
+
</g>
|
|
42
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
43
|
+
<g>
|
|
44
|
+
<g>
|
|
45
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.25,19.25 V 5.75 M 5.25,19.25 H 18.75"/>
|
|
46
|
+
<path fill="currentColor" d="M 5.25,3.4 L 2.85,7.1 H 7.65 Z M 20.6,19.25 L 16.9,16.85 V 21.65 Z"/>
|
|
47
|
+
</g>
|
|
48
|
+
</g>
|
|
49
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
50
|
+
<g>
|
|
51
|
+
<g>
|
|
52
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.25,19.25 V 5.75 M 5.25,19.25 H 18.75"/>
|
|
53
|
+
<path fill="white" d="M 5.25,3.4 L 2.85,7.1 H 7.65 Z M 20.6,19.25 L 16.9,16.85 V 21.65 Z"/>
|
|
54
|
+
</g>
|
|
55
|
+
</g>
|
|
56
|
+
</g>`},"bars-stacked-svg":{viewBox:"0 0 24 24",isComplex:!1,path:`\r
|
|
57
|
+
M 4.5,13 H 9 V 15.4 H 4.5 Z\r
|
|
58
|
+
M 4.5,16.6 H 9 V 19.5 H 4.5 Z\r
|
|
59
|
+
M 10.25,7 H 14.75 V 12.2 H 10.25 Z\r
|
|
60
|
+
M 10.25,13.4 H 14.75 V 19.5 H 10.25 Z\r
|
|
61
|
+
M 16,10.5 H 20.5 V 13.6 H 16 Z\r
|
|
62
|
+
M 16,14.8 H 20.5 V 19.5 H 16 Z\r
|
|
63
|
+
`},"balance-scale-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="matrix(0.01875 0 0 0.01875 0 2.4)">\r
|
|
64
|
+
<path fill="currentColor" d="M987.429 256l-219.429 402.286h438.857zM256 256l-219.429 402.286h438.857zM725.143 146.286c-10.857 30.857-36 56-66.857 66.857v737.714h347.429c10.286 0 18.286 8 18.286 18.286v36.571c0 10.286-8 18.286-18.286 18.286h-768c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h347.429v-737.714c-30.857-10.857-56-36-66.857-66.857h-280.571c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h280.571c15.429-42.857 55.429-73.143 103.429-73.143s88 30.286 103.429 73.143h280.571c10.286 0 18.286 8 18.286 18.286v36.571c0 10.286-8 18.286-18.286 18.286h-280.571zM621.714 155.429c25.143 0 45.714-20.571 45.714-45.714s-20.571-45.714-45.714-45.714-45.714 20.571-45.714 45.714 20.571 45.714 45.714 45.714zM1243.429 658.286c0 117.714-162.857 164.571-256 164.571s-256-46.857-256-164.571v0c0-22.286 199.429-375.429 224-420 6.286-11.429 18.857-18.857 32-18.857s25.714 7.429 32 18.857c24.571 44.571 224 397.714 224 420v0zM512 658.286c0 117.714-162.857 164.571-256 164.571s-256-46.857-256-164.571v0c0-22.286 199.429-375.429 224-420 6.286-11.429 18.857-18.857 32-18.857s25.714 7.429 32 18.857c24.571 44.571 224 397.714 224 420z"/>\r
|
|
65
|
+
</g>`,selectiveFillContent:`<g transform="matrix(0.01875 0 0 0.01875 0 2.4)">\r
|
|
66
|
+
<path fill="currentColor" d="M987.429 256l-219.429 402.286h438.857zM256 256l-219.429 402.286h438.857zM725.143 146.286c-10.857 30.857-36 56-66.857 66.857v737.714h347.429c10.286 0 18.286 8 18.286 18.286v36.571c0 10.286-8 18.286-18.286 18.286h-768c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h347.429v-737.714c-30.857-10.857-56-36-66.857-66.857h-280.571c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h280.571c15.429-42.857 55.429-73.143 103.429-73.143s88 30.286 103.429 73.143h280.571c10.286 0 18.286 8 18.286 18.286v36.571c0 10.286-8 18.286-18.286 18.286h-280.571zM621.714 155.429c25.143 0 45.714-20.571 45.714-45.714s-20.571-45.714-45.714-45.714-45.714 20.571-45.714 45.714 20.571 45.714 45.714 45.714zM1243.429 658.286c0 117.714-162.857 164.571-256 164.571s-256-46.857-256-164.571v0c0-22.286 199.429-375.429 224-420 6.286-11.429 18.857-18.857 32-18.857s25.714 7.429 32 18.857c24.571 44.571 224 397.714 224 420v0zM512 658.286c0 117.714-162.857 164.571-256 164.571s-256-46.857-256-164.571v0c0-22.286 199.429-375.429 224-420 6.286-11.429 18.857-18.857 32-18.857s25.714 7.429 32 18.857c24.571 44.571 224 397.714 224 420z"/>\r
|
|
67
|
+
</g>`,invertFillContent:`<g transform="matrix(0.01875 0 0 0.01875 0 2.4)">\r
|
|
68
|
+
<path fill="white" d="M987.429 256l-219.429 402.286h438.857zM256 256l-219.429 402.286h438.857zM725.143 146.286c-10.857 30.857-36 56-66.857 66.857v737.714h347.429c10.286 0 18.286 8 18.286 18.286v36.571c0 10.286-8 18.286-18.286 18.286h-768c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h347.429v-737.714c-30.857-10.857-56-36-66.857-66.857h-280.571c-10.286 0-18.286-8-18.286-18.286v-36.571c0-10.286 8-18.286 18.286-18.286h280.571c15.429-42.857 55.429-73.143 103.429-73.143s88 30.286 103.429 73.143h280.571c10.286 0 18.286 8 18.286 18.286v36.571c0 10.286-8 18.286-18.286 18.286h-280.571zM621.714 155.429c25.143 0 45.714-20.571 45.714-45.714s-20.571-45.714-45.714-45.714-45.714 20.571-45.714 45.714 20.571 45.714 45.714 45.714zM1243.429 658.286c0 117.714-162.857 164.571-256 164.571s-256-46.857-256-164.571v0c0-22.286 199.429-375.429 224-420 6.286-11.429 18.857-18.857 32-18.857s25.714 7.429 32 18.857c24.571 44.571 224 397.714 224 420v0zM512 658.286c0 117.714-162.857 164.571-256 164.571s-256-46.857-256-164.571v0c0-22.286 199.429-375.429 224-420 6.286-11.429 18.857-18.857 32-18.857s25.714 7.429 32 18.857c24.571 44.571 224 397.714 224 420z"/>\r
|
|
69
|
+
</g>`},"bars-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 4.5,13 H 9 V 19.5 H 4.5 Z M 10.25,7 H 14.75 V 19.5 H 10.25 Z M 16,10.5 H 20.5 V 19.5 H 16 Z"},"bookmark-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
70
|
+
<path d="M139.78,43.28l230.71-.26c32.57,4.71,54.47,29.71,56.56,62.44v341.08c-1.21,16.2-11.77,25.13-28.07,21.99-48.64-31.69-94.63-67.56-142.63-100.33l-138.68,97.97c-14.83,8.55-32.13-1.55-32.7-18.63l.05-344.02c2.3-30.6,24.38-55.5,54.76-60.24ZM384,406V102.5c0-1.18-4.03-8.53-5.15-9.85-4.49-5.28-11.53-7.53-18.3-7.7l-211.04.06c-5.09.88-11.18,2.32-15,6-1.58,1.52-6.51,9.79-6.51,11.49v303.5l114.87-81.63c8.28-6.18,18.72-5.87,26.85.4l114.27,81.23Z"/>\r
|
|
71
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
72
|
+
<path d="M139.78,43.28l230.71-.26c32.57,4.71,54.47,29.71,56.56,62.44v341.08c-1.21,16.2-11.77,25.13-28.07,21.99-48.64-31.69-94.63-67.56-142.63-100.33l-138.68,97.97c-14.83,8.55-32.13-1.55-32.7-18.63l.05-344.02c2.3-30.6,24.38-55.5,54.76-60.24ZM384,406V102.5c0-1.18-4.03-8.53-5.15-9.85-4.49-5.28-11.53-7.53-18.3-7.7l-211.04.06c-5.09.88-11.18,2.32-15,6-1.58,1.52-6.51,9.79-6.51,11.49v303.5l114.87-81.63c8.28-6.18,18.72-5.87,26.85.4l114.27,81.23Z" fill="currentColor"/>\r
|
|
73
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
74
|
+
<path d="M139.78,43.28l230.71-.26c32.57,4.71,54.47,29.71,56.56,62.44v341.08c-1.21,16.2-11.77,25.13-28.07,21.99-48.64-31.69-94.63-67.56-142.63-100.33l-138.68,97.97c-14.83,8.55-32.13-1.55-32.7-18.63l.05-344.02c2.3-30.6,24.38-55.5,54.76-60.24ZM384,406V102.5c0-1.18-4.03-8.53-5.15-9.85-4.49-5.28-11.53-7.53-18.3-7.7l-211.04.06c-5.09.88-11.18,2.32-15,6-1.58,1.52-6.51,9.79-6.51,11.49v303.5l114.87-81.63c8.28-6.18,18.72-5.87,26.85.4l114.27,81.23Z" fill="white" stroke="white"/>\r
|
|
75
|
+
</g>`},"calendar-display-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M3 4H21V21H3V4Z M3 6H21V8H3V6Z M6 5A1 1 0 1 0 8 5A1 1 0 1 0 6 5Z M11 5A1 1 0 1 0 13 5A1 1 0 1 0 11 5Z M16 5A1 1 0 1 0 18 5A1 1 0 1 0 16 5Z M7.5 14A4.5 4.5 0 1 0 16.5 14A4.5 4.5 0 1 0 7.5 14Z M9.1 13A0.9 0.9 0 1 0 10.9 13A0.9 0.9 0 1 0 9.1 13Z M13.1 13A0.9 0.9 0 1 0 14.9 13A0.9 0.9 0 1 0 13.1 13Z M11.1 11.5A0.9 0.9 0 1 0 12.9 11.5A0.9 0.9 0 1 0 11.1 11.5Z M11.1 15.5A0.9 0.9 0 1 0 12.9 15.5A0.9 0.9 0 1 0 11.1 15.5Z M8.1 16A0.9 0.9 0 1 0 9.9 16A0.9 0.9 0 1 0 8.1 16Z"},"calendar-markers-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M5 21A2 2 0 1 0 1 21A2 2 0 1 0 5 21Z M14 14A2 2 0 1 0 10 14A2 2 0 1 0 14 14Z M23 4A2 2 0 1 0 19 4A2 2 0 1 0 23 4Z M4.9 20.1L5.1 19.9L11.1 14.9L10.9 15.1Z M10.9 15.1L11.1 14.9L21.1 4.9L20.9 5.1Z"},"calendar-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M19,19V8H5V19H19M16,1H18V3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1M7,10H9V12H7V10M15,10H17V12H15V10M11,14H13V16H11V14M15,14H17V16H15V14Z"},"cards-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
76
|
+
<g>
|
|
77
|
+
<g>
|
|
78
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.5,4.75 H 18.5 Q 20.25,4.75 20.25,6.5 V 17.5 Q 20.25,19.25 18.5,19.25 H 5.5 Q 3.75,19.25 3.75,17.5 V 6.5 Q 3.75,4.75 5.5,4.75 Z"/>
|
|
79
|
+
</g>
|
|
80
|
+
</g>
|
|
81
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
82
|
+
<g>
|
|
83
|
+
<g>
|
|
84
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.5,4.75 H 18.5 Q 20.25,4.75 20.25,6.5 V 17.5 Q 20.25,19.25 18.5,19.25 H 5.5 Q 3.75,19.25 3.75,17.5 V 6.5 Q 3.75,4.75 5.5,4.75 Z"/>
|
|
85
|
+
</g>
|
|
86
|
+
</g>
|
|
87
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
88
|
+
<g>
|
|
89
|
+
<g>
|
|
90
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.5,4.75 H 18.5 Q 20.25,4.75 20.25,6.5 V 17.5 Q 20.25,19.25 18.5,19.25 H 5.5 Q 3.75,19.25 3.75,17.5 V 6.5 Q 3.75,4.75 5.5,4.75 Z"/>
|
|
91
|
+
</g>
|
|
92
|
+
</g>
|
|
93
|
+
</g>`},"check-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
94
|
+
<path d="M421.74,107.24c19.88-3.38,33.53,16.37,22.26,33.26l-238.47,238.53c-7.28,6.52-18.16,6.73-26.02.97l-110.53-110.47c-15.33-19.39,6.81-43.41,27.73-31.73l95.65,94.14,220.62-220.45c2.33-1.88,5.83-3.74,8.76-4.24Z" fill="currentColor"/>\r
|
|
95
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
96
|
+
<path d="M421.74,107.24c19.88-3.38,33.53,16.37,22.26,33.26l-238.47,238.53c-7.28,6.52-18.16,6.73-26.02.97l-110.53-110.47c-15.33-19.39,6.81-43.41,27.73-31.73l95.65,94.14,220.62-220.45c2.33-1.88,5.83-3.74,8.76-4.24Z" fill="currentColor"/>\r
|
|
97
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
98
|
+
<path d="M421.74,107.24c19.88-3.38,33.53,16.37,22.26,33.26l-238.47,238.53c-7.28,6.52-18.16,6.73-26.02.97l-110.53-110.47c-15.33-19.39,6.81-43.41,27.73-31.73l95.65,94.14,220.62-220.45c2.33-1.88,5.83-3.74,8.76-4.24Z" fill="white"/>\r
|
|
99
|
+
</g>`},"chevron-down-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
100
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M7.5 9 L12 14.5 L16.5 9"/>\r
|
|
101
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
102
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M7.5 9 L12 14.5 L16.5 9"/>\r
|
|
103
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
104
|
+
<path fill="none" stroke="white" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M7.5 9 L12 14.5 L16.5 9"/>\r
|
|
105
|
+
</g>`},"chevron-right-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
106
|
+
<g transform="translate(10.2669, 6.0591) scale(0.02191531)">\r
|
|
107
|
+
<path fill="currentColor" d="M414.165 798.165l256-256c16.683-16.683 16.683-43.691 0-60.331l-256-256c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331l225.835 225.835-225.835 225.835c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0z"/>\r
|
|
108
|
+
</g>\r
|
|
109
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
110
|
+
<g transform="translate(10.2669, 6.0591) scale(0.02191531)">\r
|
|
111
|
+
<path fill="currentColor" d="M414.165 798.165l256-256c16.683-16.683 16.683-43.691 0-60.331l-256-256c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331l225.835 225.835-225.835 225.835c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0z"/>\r
|
|
112
|
+
</g>\r
|
|
113
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
114
|
+
<g transform="translate(10.2669, 6.0591) scale(0.02191531)">\r
|
|
115
|
+
<path fill="white" d="M414.165 798.165l256-256c16.683-16.683 16.683-43.691 0-60.331l-256-256c-16.683-16.683-43.691-16.683-60.331 0s-16.683 43.691 0 60.331l225.835 225.835-225.835 225.835c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0z"/>\r
|
|
116
|
+
</g>\r
|
|
117
|
+
</g>`},"chevron-up-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
118
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M7.5 15 L12 9.5 L16.5 15"/>\r
|
|
119
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
120
|
+
<path fill="none" stroke="currentColor" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M7.5 15 L12 9.5 L16.5 15"/>\r
|
|
121
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
122
|
+
<path fill="none" stroke="white" stroke-width="1.35" stroke-linecap="round" stroke-linejoin="round" fill-rule="evenodd" d="M7.5 15 L12 9.5 L16.5 15"/>\r
|
|
123
|
+
</g>`},"cluster-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M9 6A3 3 0 1 1 3 6A3 3 0 1 1 9 6Z M21 8A3 3 0 1 1 15 8A3 3 0 1 1 21 8Z M13 20A3 3 0 1 1 7 20A3 3 0 1 1 13 20Z"},"cog-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
124
|
+
<g>\r
|
|
125
|
+
<g>\r
|
|
126
|
+
<!-- Original cog silhouette: outline only (outer teeth + center hole), no fill -->\r
|
|
127
|
+
<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M9.25001 22L8.85001 18.8C8.63335 18.7167 8.42918 18.6167 8.23751 18.5C8.04585 18.3833 7.85835 18.2583 7.67501 18.125L4.70001 19.375L1.95001 14.625L4.52501 12.675C4.50835 12.5583 4.50001 12.4458 4.50001 12.3375V11.6625C4.50001 11.5542 4.50835 11.4417 4.52501 11.325L1.95001 9.375L4.70001 4.625L7.67501 5.875C7.85835 5.74167 8.05001 5.61667 8.25001 5.5C8.45001 5.38333 8.65001 5.28333 8.85001 5.2L9.25001 2H14.75L15.15 5.2C15.3667 5.28333 15.5708 5.38333 15.7625 5.5C15.9542 5.61667 16.1417 5.74167 16.325 5.875L19.3 4.625L22.05 9.375L19.475 11.325C19.4917 11.4417 19.5 11.5542 19.5 11.6625V12.3375C19.5 12.4458 19.4833 12.5583 19.45 12.675L22.025 14.625L19.275 19.375L16.325 18.125C16.1417 18.2583 15.95 18.3833 15.75 18.5C15.55 18.6167 15.35 18.7167 15.15 18.8L14.75 22H9.25001ZM12.05 15.5C13.0167 15.5 13.8417 15.1583 14.525 14.475C15.2083 13.7917 15.55 12.9667 15.55 12C15.55 11.0333 15.2083 10.2083 14.525 9.525C13.8417 8.84167 13.0167 8.5 12.05 8.5C11.0667 8.5 10.2375 8.84167 9.56251 9.525C8.88751 10.2083 8.55001 11.0333 8.55001 12C8.55001 12.9667 8.88751 13.7917 9.56251 14.475C10.2375 15.1583 11.0667 15.5 12.05 15.5Z"/>\r
|
|
128
|
+
</g>\r
|
|
129
|
+
</g>\r
|
|
130
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
131
|
+
<g>\r
|
|
132
|
+
<g>\r
|
|
133
|
+
<!-- Original cog silhouette: outline only (outer teeth + center hole), no fill -->\r
|
|
134
|
+
<path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M9.25001 22L8.85001 18.8C8.63335 18.7167 8.42918 18.6167 8.23751 18.5C8.04585 18.3833 7.85835 18.2583 7.67501 18.125L4.70001 19.375L1.95001 14.625L4.52501 12.675C4.50835 12.5583 4.50001 12.4458 4.50001 12.3375V11.6625C4.50001 11.5542 4.50835 11.4417 4.52501 11.325L1.95001 9.375L4.70001 4.625L7.67501 5.875C7.85835 5.74167 8.05001 5.61667 8.25001 5.5C8.45001 5.38333 8.65001 5.28333 8.85001 5.2L9.25001 2H14.75L15.15 5.2C15.3667 5.28333 15.5708 5.38333 15.7625 5.5C15.9542 5.61667 16.1417 5.74167 16.325 5.875L19.3 4.625L22.05 9.375L19.475 11.325C19.4917 11.4417 19.5 11.5542 19.5 11.6625V12.3375C19.5 12.4458 19.4833 12.5583 19.45 12.675L22.025 14.625L19.275 19.375L16.325 18.125C16.1417 18.2583 15.95 18.3833 15.75 18.5C15.55 18.6167 15.35 18.7167 15.15 18.8L14.75 22H9.25001ZM12.05 15.5C13.0167 15.5 13.8417 15.1583 14.525 14.475C15.2083 13.7917 15.55 12.9667 15.55 12C15.55 11.0333 15.2083 10.2083 14.525 9.525C13.8417 8.84167 13.0167 8.5 12.05 8.5C11.0667 8.5 10.2375 8.84167 9.56251 9.525C8.88751 10.2083 8.55001 11.0333 8.55001 12C8.55001 12.9667 8.88751 13.7917 9.56251 14.475C10.2375 15.1583 11.0667 15.5 12.05 15.5Z"/>\r
|
|
135
|
+
</g>\r
|
|
136
|
+
</g>\r
|
|
137
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
138
|
+
<g>\r
|
|
139
|
+
<g>\r
|
|
140
|
+
<!-- Original cog silhouette: outline only (outer teeth + center hole), no fill -->\r
|
|
141
|
+
<path fill="none" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" d="M9.25001 22L8.85001 18.8C8.63335 18.7167 8.42918 18.6167 8.23751 18.5C8.04585 18.3833 7.85835 18.2583 7.67501 18.125L4.70001 19.375L1.95001 14.625L4.52501 12.675C4.50835 12.5583 4.50001 12.4458 4.50001 12.3375V11.6625C4.50001 11.5542 4.50835 11.4417 4.52501 11.325L1.95001 9.375L4.70001 4.625L7.67501 5.875C7.85835 5.74167 8.05001 5.61667 8.25001 5.5C8.45001 5.38333 8.65001 5.28333 8.85001 5.2L9.25001 2H14.75L15.15 5.2C15.3667 5.28333 15.5708 5.38333 15.7625 5.5C15.9542 5.61667 16.1417 5.74167 16.325 5.875L19.3 4.625L22.05 9.375L19.475 11.325C19.4917 11.4417 19.5 11.5542 19.5 11.6625V12.3375C19.5 12.4458 19.4833 12.5583 19.45 12.675L22.025 14.625L19.275 19.375L16.325 18.125C16.1417 18.2583 15.95 18.3833 15.75 18.5C15.55 18.6167 15.35 18.7167 15.15 18.8L14.75 22H9.25001ZM12.05 15.5C13.0167 15.5 13.8417 15.1583 14.525 14.475C15.2083 13.7917 15.55 12.9667 15.55 12C15.55 11.0333 15.2083 10.2083 14.525 9.525C13.8417 8.84167 13.0167 8.5 12.05 8.5C11.0667 8.5 10.2375 8.84167 9.56251 9.525C8.88751 10.2083 8.55001 11.0333 8.55001 12C8.55001 12.9667 8.88751 13.7917 9.56251 14.475C10.2375 15.1583 11.0667 15.5 12.05 15.5Z"/>\r
|
|
142
|
+
</g>\r
|
|
143
|
+
</g>\r
|
|
144
|
+
</g>`},"cogs-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
145
|
+
<mask id="mask0_210_51" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">\r
|
|
146
|
+
<rect width="24" height="24" fill="#D9D9D9"/>\r
|
|
147
|
+
</mask>\r
|
|
148
|
+
<g mask="url(#mask0_210_51)">\r
|
|
149
|
+
<path d="M5.85 12L5.55 10.5C5.35 10.4167 5.1625 10.3292 4.9875 10.2375C4.8125 10.1458 4.63333 10.0333 4.45 9.9L3 10.35L2 8.65L3.15 7.65C3.11667 7.43333 3.1 7.21667 3.1 7C3.1 6.78333 3.11667 6.56667 3.15 6.35L2 5.35L3 3.65L4.45 4.1C4.63333 3.96667 4.8125 3.85417 4.9875 3.7625C5.1625 3.67083 5.35 3.58333 5.55 3.5L5.85 2H7.85L8.15 3.5C8.35 3.58333 8.5375 3.67083 8.7125 3.7625C8.8875 3.85417 9.06667 3.96667 9.25 4.1L10.7 3.65L11.7 5.35L10.55 6.35C10.5833 6.56667 10.6 6.78333 10.6 7C10.6 7.21667 10.5833 7.43333 10.55 7.65L11.7 8.65L10.7 10.35L9.25 9.9C9.06667 10.0333 8.8875 10.1458 8.7125 10.2375C8.5375 10.3292 8.35 10.4167 8.15 10.5L7.85 12H5.85ZM6.85 9C7.4 9 7.87083 8.80417 8.2625 8.4125C8.65417 8.02083 8.85 7.55 8.85 7C8.85 6.45 8.65417 5.97917 8.2625 5.5875C7.87083 5.19583 7.4 5 6.85 5C6.3 5 5.82917 5.19583 5.4375 5.5875C5.04583 5.97917 4.85 6.45 4.85 7C4.85 7.55 5.04583 8.02083 5.4375 8.4125C5.82917 8.80417 6.3 9 6.85 9ZM14.8 23L14.35 20.9C14.0667 20.8 13.8042 20.6792 13.5625 20.5375C13.3208 20.3958 13.0833 20.2333 12.85 20.05L10.85 20.7L9.45 18.3L11.05 16.9C11.0167 16.6 11 16.3 11 16C11 15.7 11.0167 15.4 11.05 15.1L9.45 13.7L10.85 11.3L12.85 11.95C13.0833 11.7667 13.3208 11.6042 13.5625 11.4625C13.8042 11.3208 14.0667 11.2 14.35 11.1L14.8 9H17.6L18.05 11.1C18.3333 11.2 18.5958 11.3208 18.8375 11.4625C19.0792 11.6042 19.3167 11.7667 19.55 11.95L21.55 11.3L22.95 13.7L21.35 15.1C21.3833 15.4 21.4 15.7 21.4 16C21.4 16.3 21.3833 16.6 21.35 16.9L22.95 18.3L21.55 20.7L19.55 20.05C19.3167 20.2333 19.0792 20.3958 18.8375 20.5375C18.5958 20.6792 18.3333 20.8 18.05 20.9L17.6 23H14.8ZM16.2 19C17.0333 19 17.7417 18.7083 18.325 18.125C18.9083 17.5417 19.2 16.8333 19.2 16C19.2 15.1667 18.9083 14.4583 18.325 13.875C17.7417 13.2917 17.0333 13 16.2 13C15.3667 13 14.6583 13.2917 14.075 13.875C13.4917 14.4583 13.2 15.1667 13.2 16C13.2 16.8333 13.4917 17.5417 14.075 18.125C14.6583 18.7083 15.3667 19 16.2 19Z" fill="currentColor"/>\r
|
|
150
|
+
</g>\r
|
|
151
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
152
|
+
<mask id="mask0_210_51" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">\r
|
|
153
|
+
<rect width="24" height="24" fill="currentColor"/>\r
|
|
154
|
+
</mask>\r
|
|
155
|
+
<g mask="url(#mask0_210_51)">\r
|
|
156
|
+
<path d="M5.85 12L5.55 10.5C5.35 10.4167 5.1625 10.3292 4.9875 10.2375C4.8125 10.1458 4.63333 10.0333 4.45 9.9L3 10.35L2 8.65L3.15 7.65C3.11667 7.43333 3.1 7.21667 3.1 7C3.1 6.78333 3.11667 6.56667 3.15 6.35L2 5.35L3 3.65L4.45 4.1C4.63333 3.96667 4.8125 3.85417 4.9875 3.7625C5.1625 3.67083 5.35 3.58333 5.55 3.5L5.85 2H7.85L8.15 3.5C8.35 3.58333 8.5375 3.67083 8.7125 3.7625C8.8875 3.85417 9.06667 3.96667 9.25 4.1L10.7 3.65L11.7 5.35L10.55 6.35C10.5833 6.56667 10.6 6.78333 10.6 7C10.6 7.21667 10.5833 7.43333 10.55 7.65L11.7 8.65L10.7 10.35L9.25 9.9C9.06667 10.0333 8.8875 10.1458 8.7125 10.2375C8.5375 10.3292 8.35 10.4167 8.15 10.5L7.85 12H5.85ZM6.85 9C7.4 9 7.87083 8.80417 8.2625 8.4125C8.65417 8.02083 8.85 7.55 8.85 7C8.85 6.45 8.65417 5.97917 8.2625 5.5875C7.87083 5.19583 7.4 5 6.85 5C6.3 5 5.82917 5.19583 5.4375 5.5875C5.04583 5.97917 4.85 6.45 4.85 7C4.85 7.55 5.04583 8.02083 5.4375 8.4125C5.82917 8.80417 6.3 9 6.85 9ZM14.8 23L14.35 20.9C14.0667 20.8 13.8042 20.6792 13.5625 20.5375C13.3208 20.3958 13.0833 20.2333 12.85 20.05L10.85 20.7L9.45 18.3L11.05 16.9C11.0167 16.6 11 16.3 11 16C11 15.7 11.0167 15.4 11.05 15.1L9.45 13.7L10.85 11.3L12.85 11.95C13.0833 11.7667 13.3208 11.6042 13.5625 11.4625C13.8042 11.3208 14.0667 11.2 14.35 11.1L14.8 9H17.6L18.05 11.1C18.3333 11.2 18.5958 11.3208 18.8375 11.4625C19.0792 11.6042 19.3167 11.7667 19.55 11.95L21.55 11.3L22.95 13.7L21.35 15.1C21.3833 15.4 21.4 15.7 21.4 16C21.4 16.3 21.3833 16.6 21.35 16.9L22.95 18.3L21.55 20.7L19.55 20.05C19.3167 20.2333 19.0792 20.3958 18.8375 20.5375C18.5958 20.6792 18.3333 20.8 18.05 20.9L17.6 23H14.8ZM16.2 19C17.0333 19 17.7417 18.7083 18.325 18.125C18.9083 17.5417 19.2 16.8333 19.2 16C19.2 15.1667 18.9083 14.4583 18.325 13.875C17.7417 13.2917 17.0333 13 16.2 13C15.3667 13 14.6583 13.2917 14.075 13.875C13.4917 14.4583 13.2 15.1667 13.2 16C13.2 16.8333 13.4917 17.5417 14.075 18.125C14.6583 18.7083 15.3667 19 16.2 19Z" fill="currentColor"/>\r
|
|
157
|
+
</g>\r
|
|
158
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
159
|
+
<mask id="mask0_210_51" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">\r
|
|
160
|
+
<rect width="24" height="24" fill="white"/>\r
|
|
161
|
+
</mask>\r
|
|
162
|
+
<g mask="url(#mask0_210_51)">\r
|
|
163
|
+
<path d="M5.85 12L5.55 10.5C5.35 10.4167 5.1625 10.3292 4.9875 10.2375C4.8125 10.1458 4.63333 10.0333 4.45 9.9L3 10.35L2 8.65L3.15 7.65C3.11667 7.43333 3.1 7.21667 3.1 7C3.1 6.78333 3.11667 6.56667 3.15 6.35L2 5.35L3 3.65L4.45 4.1C4.63333 3.96667 4.8125 3.85417 4.9875 3.7625C5.1625 3.67083 5.35 3.58333 5.55 3.5L5.85 2H7.85L8.15 3.5C8.35 3.58333 8.5375 3.67083 8.7125 3.7625C8.8875 3.85417 9.06667 3.96667 9.25 4.1L10.7 3.65L11.7 5.35L10.55 6.35C10.5833 6.56667 10.6 6.78333 10.6 7C10.6 7.21667 10.5833 7.43333 10.55 7.65L11.7 8.65L10.7 10.35L9.25 9.9C9.06667 10.0333 8.8875 10.1458 8.7125 10.2375C8.5375 10.3292 8.35 10.4167 8.15 10.5L7.85 12H5.85ZM6.85 9C7.4 9 7.87083 8.80417 8.2625 8.4125C8.65417 8.02083 8.85 7.55 8.85 7C8.85 6.45 8.65417 5.97917 8.2625 5.5875C7.87083 5.19583 7.4 5 6.85 5C6.3 5 5.82917 5.19583 5.4375 5.5875C5.04583 5.97917 4.85 6.45 4.85 7C4.85 7.55 5.04583 8.02083 5.4375 8.4125C5.82917 8.80417 6.3 9 6.85 9ZM14.8 23L14.35 20.9C14.0667 20.8 13.8042 20.6792 13.5625 20.5375C13.3208 20.3958 13.0833 20.2333 12.85 20.05L10.85 20.7L9.45 18.3L11.05 16.9C11.0167 16.6 11 16.3 11 16C11 15.7 11.0167 15.4 11.05 15.1L9.45 13.7L10.85 11.3L12.85 11.95C13.0833 11.7667 13.3208 11.6042 13.5625 11.4625C13.8042 11.3208 14.0667 11.2 14.35 11.1L14.8 9H17.6L18.05 11.1C18.3333 11.2 18.5958 11.3208 18.8375 11.4625C19.0792 11.6042 19.3167 11.7667 19.55 11.95L21.55 11.3L22.95 13.7L21.35 15.1C21.3833 15.4 21.4 15.7 21.4 16C21.4 16.3 21.3833 16.6 21.35 16.9L22.95 18.3L21.55 20.7L19.55 20.05C19.3167 20.2333 19.0792 20.3958 18.8375 20.5375C18.5958 20.6792 18.3333 20.8 18.05 20.9L17.6 23H14.8ZM16.2 19C17.0333 19 17.7417 18.7083 18.325 18.125C18.9083 17.5417 19.2 16.8333 19.2 16C19.2 15.1667 18.9083 14.4583 18.325 13.875C17.7417 13.2917 17.0333 13 16.2 13C15.3667 13 14.6583 13.2917 14.075 13.875C13.4917 14.4583 13.2 15.1667 13.2 16C13.2 16.8333 13.4917 17.5417 14.075 18.125C14.6583 18.7083 15.3667 19 16.2 19Z" fill="white"/>\r
|
|
164
|
+
</g>\r
|
|
165
|
+
</g>`},"compare-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
166
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
167
|
+
<path fill="currentColor" d="M0 180.286c0-18.851 12.8-34.164 28.579-34.164h114.362c15.779 0 28.579 15.313 28.579 34.164v830.929c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.779 0-28.579-15.267-28.579-34.118v-830.929zM238.499 180.286c0-18.851 12.8-34.164 28.579-34.164h114.362c15.779 0 28.579 15.313 28.579 34.164v146.153c0 18.804-12.8 34.118-28.579 34.118h-114.362c-15.779 0-28.579-15.313-28.579-34.164v-146.153zM474.298 55.451c0-18.851 12.847-34.118 28.625-34.118h114.362c15.779 0 28.579 15.267 28.579 34.118v270.941c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.825 0-28.579-15.267-28.579-34.118v-270.895zM712.844 55.451c0-18.851 12.8-34.118 28.579-34.118h114.362c15.779 0 28.579 15.267 28.579 34.118v955.764c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.825 0-28.579-15.267-28.579-34.118v-955.764z"/>\r
|
|
168
|
+
</g>\r
|
|
169
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
170
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
171
|
+
<path fill="currentColor" d="M0 180.286c0-18.851 12.8-34.164 28.579-34.164h114.362c15.779 0 28.579 15.313 28.579 34.164v830.929c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.779 0-28.579-15.267-28.579-34.118v-830.929zM238.499 180.286c0-18.851 12.8-34.164 28.579-34.164h114.362c15.779 0 28.579 15.313 28.579 34.164v146.153c0 18.804-12.8 34.118-28.579 34.118h-114.362c-15.779 0-28.579-15.313-28.579-34.164v-146.153zM474.298 55.451c0-18.851 12.847-34.118 28.625-34.118h114.362c15.779 0 28.579 15.267 28.579 34.118v270.941c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.825 0-28.579-15.267-28.579-34.118v-270.895zM712.844 55.451c0-18.851 12.8-34.118 28.579-34.118h114.362c15.779 0 28.579 15.267 28.579 34.118v955.764c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.825 0-28.579-15.267-28.579-34.118v-955.764z"/>\r
|
|
172
|
+
</g>\r
|
|
173
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
174
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
175
|
+
<path fill="white" d="M0 180.286c0-18.851 12.8-34.164 28.579-34.164h114.362c15.779 0 28.579 15.313 28.579 34.164v830.929c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.779 0-28.579-15.267-28.579-34.118v-830.929zM238.499 180.286c0-18.851 12.8-34.164 28.579-34.164h114.362c15.779 0 28.579 15.313 28.579 34.164v146.153c0 18.804-12.8 34.118-28.579 34.118h-114.362c-15.779 0-28.579-15.313-28.579-34.164v-146.153zM474.298 55.451c0-18.851 12.847-34.118 28.625-34.118h114.362c15.779 0 28.579 15.267 28.579 34.118v270.941c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.825 0-28.579-15.267-28.579-34.118v-270.895zM712.844 55.451c0-18.851 12.8-34.118 28.579-34.118h114.362c15.779 0 28.579 15.267 28.579 34.118v955.764c0 18.851-12.8 34.118-28.579 34.118h-114.362c-15.825 0-28.579-15.267-28.579-34.118v-955.764z"/>\r
|
|
176
|
+
</g>\r
|
|
177
|
+
</g>`},"connector-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
178
|
+
<g>
|
|
179
|
+
<g>
|
|
180
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="miter" d="M 5.5,5.5 L 12,5.5 L 12,18.5 L 18.5,18.5"/>
|
|
181
|
+
<circle cx="5.5" cy="5.5" r="2" fill="currentColor"/>
|
|
182
|
+
<circle cx="18.5" cy="18.5" r="2" fill="currentColor"/>
|
|
183
|
+
</g>
|
|
184
|
+
</g>
|
|
185
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
186
|
+
<g>
|
|
187
|
+
<g>
|
|
188
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="miter" d="M 5.5,5.5 L 12,5.5 L 12,18.5 L 18.5,18.5"/>
|
|
189
|
+
<circle cx="5.5" cy="5.5" r="2" fill="currentColor"/>
|
|
190
|
+
<circle cx="18.5" cy="18.5" r="2" fill="currentColor"/>
|
|
191
|
+
</g>
|
|
192
|
+
</g>
|
|
193
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
194
|
+
<g>
|
|
195
|
+
<g>
|
|
196
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="miter" d="M 5.5,5.5 L 12,5.5 L 12,18.5 L 18.5,18.5"/>
|
|
197
|
+
<circle cx="5.5" cy="5.5" r="2" fill="white"/>
|
|
198
|
+
<circle cx="18.5" cy="18.5" r="2" fill="white"/>
|
|
199
|
+
</g>
|
|
200
|
+
</g>
|
|
201
|
+
</g>`},"copy-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(0.96)">
|
|
202
|
+
<mask id="mask0_4674_1460" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="25" height="25">
|
|
203
|
+
<rect x="0.428467" y="0.425079" width="24" height="24" fill="#D9D9D9"/>
|
|
204
|
+
</mask>
|
|
205
|
+
<g mask="url(#mask0_4674_1460)">
|
|
206
|
+
<path d="M18.8287 7.625H9.22867C8.34467 7.625 7.62866 8.341 7.62866 9.22501V18.8251C7.62866 19.7091 8.34467 20.4251 9.22867 20.4251H18.8287C19.7127 20.4251 20.4287 19.7091 20.4287 18.8251V9.22501C20.4287 8.341 19.7127 7.625 18.8287 7.625ZM18.8287 18.8251H9.22867V9.22501H18.8287V18.8251Z" fill="black"/>
|
|
207
|
+
<path d="M6.02848 6.02509H17.2286V4.42508H6.02848C5.14447 4.42508 4.42847 5.14108 4.42847 6.02509V17.2252H6.02848V6.02509Z" fill="black"/>
|
|
208
|
+
</g>
|
|
209
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(0.96)">
|
|
210
|
+
<mask id="mask0_4674_1460" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="25" height="25">
|
|
211
|
+
<rect x="0.428467" y="0.425079" width="24" height="24" fill="currentColor"/>
|
|
212
|
+
</mask>
|
|
213
|
+
<g mask="url(#mask0_4674_1460)">
|
|
214
|
+
<path d="M18.8287 7.625H9.22867C8.34467 7.625 7.62866 8.341 7.62866 9.22501V18.8251C7.62866 19.7091 8.34467 20.4251 9.22867 20.4251H18.8287C19.7127 20.4251 20.4287 19.7091 20.4287 18.8251V9.22501C20.4287 8.341 19.7127 7.625 18.8287 7.625ZM18.8287 18.8251H9.22867V9.22501H18.8287V18.8251Z" fill="currentColor"/>
|
|
215
|
+
<path d="M6.02848 6.02509H17.2286V4.42508H6.02848C5.14447 4.42508 4.42847 5.14108 4.42847 6.02509V17.2252H6.02848V6.02509Z" fill="currentColor"/>
|
|
216
|
+
</g>
|
|
217
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(0.96)">
|
|
218
|
+
<mask id="mask0_4674_1460" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="25" height="25">
|
|
219
|
+
<rect x="0.428467" y="0.425079" width="24" height="24" fill="white"/>
|
|
220
|
+
</mask>
|
|
221
|
+
<g mask="url(#mask0_4674_1460)">
|
|
222
|
+
<path d="M18.8287 7.625H9.22867C8.34467 7.625 7.62866 8.341 7.62866 9.22501V18.8251C7.62866 19.7091 8.34467 20.4251 9.22867 20.4251H18.8287C19.7127 20.4251 20.4287 19.7091 20.4287 18.8251V9.22501C20.4287 8.341 19.7127 7.625 18.8287 7.625ZM18.8287 18.8251H9.22867V9.22501H18.8287V18.8251Z" fill="white"/>
|
|
223
|
+
<path d="M6.02848 6.02509H17.2286V4.42508H6.02848C5.14447 4.42508 4.42847 5.14108 4.42847 6.02509V17.2252H6.02848V6.02509Z" fill="white"/>
|
|
224
|
+
</g>
|
|
225
|
+
</g>`},"cross-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
226
|
+
<path d="M122.74,107.24c7.49-1.29,14.61.05,20.27,5.25l112.63,112.44,113.89-112.9c21.65-16.71,47.16,8.8,30.45,30.45l-112.9,113.16,112.9,113.89c16.71,21.65-8.8,47.16-30.45,30.45l-113.16-112.9-113.89,112.9c-21.65,16.71-47.16-8.8-30.45-30.45l112.9-113.16-113.75-115.04c-9.23-11.37-3.29-31.53,11.57-34.09Z" fill="currentColor"/>\r
|
|
227
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
228
|
+
<path d="M122.74,107.24c7.49-1.29,14.61.05,20.27,5.25l112.63,112.44,113.89-112.9c21.65-16.71,47.16,8.8,30.45,30.45l-112.9,113.16,112.9,113.89c16.71,21.65-8.8,47.16-30.45,30.45l-113.16-112.9-113.89,112.9c-21.65,16.71-47.16-8.8-30.45-30.45l112.9-113.16-113.75-115.04c-9.23-11.37-3.29-31.53,11.57-34.09Z" fill="currentColor"/>\r
|
|
229
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(0.046875)">\r
|
|
230
|
+
<path d="M122.74,107.24c7.49-1.29,14.61.05,20.27,5.25l112.63,112.44,113.89-112.9c21.65-16.71,47.16,8.8,30.45,30.45l-112.9,113.16,112.9,113.89c16.71,21.65-8.8,47.16-30.45,30.45l-113.16-112.9-113.89,112.9c-21.65,16.71-47.16-8.8-30.45-30.45l112.9-113.16-113.75-115.04c-9.23-11.37-3.29-31.53,11.57-34.09Z" fill="white"/>\r
|
|
231
|
+
</g>`},"cube-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
232
|
+
<g>\r
|
|
233
|
+
<g>\r
|
|
234
|
+
<path fill="none" stroke="currentColor" stroke-width="1.55" stroke-linecap="round" stroke-linejoin="round" d="M 12,3.75 L 20.25,8.25 V 15.75 L 12,20.25 L 3.75,15.75 V 8.25 Z M 12,12 V 20.25 M 12,12 L 3.75,8.25 M 12,12 L 20.25,8.25"/>\r
|
|
235
|
+
</g>\r
|
|
236
|
+
</g>\r
|
|
237
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
238
|
+
<g>\r
|
|
239
|
+
<g>\r
|
|
240
|
+
<path fill="none" stroke="currentColor" stroke-width="1.55" stroke-linecap="round" stroke-linejoin="round" d="M 12,3.75 L 20.25,8.25 V 15.75 L 12,20.25 L 3.75,15.75 V 8.25 Z M 12,12 V 20.25 M 12,12 L 3.75,8.25 M 12,12 L 20.25,8.25"/>\r
|
|
241
|
+
</g>\r
|
|
242
|
+
</g>\r
|
|
243
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
244
|
+
<g>\r
|
|
245
|
+
<g>\r
|
|
246
|
+
<path fill="none" stroke="white" stroke-width="1.55" stroke-linecap="round" stroke-linejoin="round" d="M 12,3.75 L 20.25,8.25 V 15.75 L 12,20.25 L 3.75,15.75 V 8.25 Z M 12,12 V 20.25 M 12,12 L 3.75,8.25 M 12,12 L 20.25,8.25"/>\r
|
|
247
|
+
</g>\r
|
|
248
|
+
</g>\r
|
|
249
|
+
</g>`},"drop-down-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
250
|
+
<mask id="mask0_4673_16307" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
251
|
+
<rect width="24" height="24" fill="#D9D9D9"/>
|
|
252
|
+
</mask>
|
|
253
|
+
<g mask="url(#mask0_4673_16307)">
|
|
254
|
+
<path d="M5 9L12 16L19 9" stroke="black" stroke-width="2"/>
|
|
255
|
+
</g>
|
|
256
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
257
|
+
<mask id="mask0_4673_16307" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
258
|
+
<rect width="24" height="24" fill="currentColor"/>
|
|
259
|
+
</mask>
|
|
260
|
+
<g mask="url(#mask0_4673_16307)">
|
|
261
|
+
<path d="M5 9L12 16L19 9" stroke="currentColor" stroke-width="2" fill="currentColor"/>
|
|
262
|
+
</g>
|
|
263
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
264
|
+
<mask id="mask0_4673_16307" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
265
|
+
<rect width="24" height="24" fill="white"/>
|
|
266
|
+
</mask>
|
|
267
|
+
<g mask="url(#mask0_4673_16307)">
|
|
268
|
+
<path d="M5 9L12 16L19 9" stroke="white" stroke-width="2"/>
|
|
269
|
+
</g>
|
|
270
|
+
</g>`},"drop-left-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
271
|
+
<mask id="mask0_3973_6085" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
272
|
+
<rect width="24" height="24" fill="#D9D9D9"/>
|
|
273
|
+
</mask>
|
|
274
|
+
<g mask="url(#mask0_3973_6085)">
|
|
275
|
+
<path d="M15 19L8 12L15 5" stroke="black" stroke-width="2"/>
|
|
276
|
+
</g>
|
|
277
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
278
|
+
<mask id="mask0_3973_6085" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
279
|
+
<rect width="24" height="24" fill="currentColor"/>
|
|
280
|
+
</mask>
|
|
281
|
+
<g mask="url(#mask0_3973_6085)">
|
|
282
|
+
<path d="M15 19L8 12L15 5" stroke="currentColor" stroke-width="2" fill="currentColor"/>
|
|
283
|
+
</g>
|
|
284
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
285
|
+
<mask id="mask0_3973_6085" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
286
|
+
<rect width="24" height="24" fill="white"/>
|
|
287
|
+
</mask>
|
|
288
|
+
<g mask="url(#mask0_3973_6085)">
|
|
289
|
+
<path d="M15 19L8 12L15 5" stroke="white" stroke-width="2"/>
|
|
290
|
+
</g>
|
|
291
|
+
</g>`},"drop-right-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
292
|
+
<mask id="mask0_3477_6334" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
293
|
+
<rect width="24" height="24" fill="#D9D9D9"/>
|
|
294
|
+
</mask>
|
|
295
|
+
<g mask="url(#mask0_3477_6334)">
|
|
296
|
+
<path d="M8 19L15 12L8 5" stroke="black" stroke-width="2"/>
|
|
297
|
+
</g>
|
|
298
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
299
|
+
<mask id="mask0_3477_6334" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
300
|
+
<rect width="24" height="24" fill="currentColor"/>
|
|
301
|
+
</mask>
|
|
302
|
+
<g mask="url(#mask0_3477_6334)">
|
|
303
|
+
<path d="M8 19L15 12L8 5" stroke="currentColor" stroke-width="2" fill="currentColor"/>
|
|
304
|
+
</g>
|
|
305
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
306
|
+
<mask id="mask0_3477_6334" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
307
|
+
<rect width="24" height="24" fill="white"/>
|
|
308
|
+
</mask>
|
|
309
|
+
<g mask="url(#mask0_3477_6334)">
|
|
310
|
+
<path d="M8 19L15 12L8 5" stroke="white" stroke-width="2"/>
|
|
311
|
+
</g>
|
|
312
|
+
</g>`},"drop-up-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
313
|
+
<mask id="mask0_4673_16308" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
314
|
+
<rect x="24" y="24" width="24" height="24" transform="rotate(180 24 24)" fill="#D9D9D9"/>
|
|
315
|
+
</mask>
|
|
316
|
+
<g mask="url(#mask0_4673_16308)">
|
|
317
|
+
<path d="M19 15L12 8L5 15" stroke="black" stroke-width="2"/>
|
|
318
|
+
</g>
|
|
319
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
320
|
+
<mask id="mask0_4673_16308" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
321
|
+
<rect x="24" y="24" width="24" height="24" transform="rotate(180 24 24)" fill="currentColor"/>
|
|
322
|
+
</mask>
|
|
323
|
+
<g mask="url(#mask0_4673_16308)">
|
|
324
|
+
<path d="M19 15L12 8L5 15" stroke="currentColor" stroke-width="2" fill="currentColor"/>
|
|
325
|
+
</g>
|
|
326
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
327
|
+
<mask id="mask0_4673_16308" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
|
|
328
|
+
<rect x="24" y="24" width="24" height="24" transform="rotate(180 24 24)" fill="white"/>
|
|
329
|
+
</mask>
|
|
330
|
+
<g mask="url(#mask0_4673_16308)">
|
|
331
|
+
<path d="M19 15L12 8L5 15" stroke="white" stroke-width="2"/>
|
|
332
|
+
</g>
|
|
333
|
+
</g>`},"elements-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
334
|
+
<g>
|
|
335
|
+
<g>
|
|
336
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 4.5,13.25 H 7.75 Q 8.75,13.25 8.75,14.25 V 18.75 Q 8.75,19.75 7.75,19.75 H 4.5 Q 3.5,19.75 3.5,18.75 V 14.25 Q 3.5,13.25 4.5,13.25 Z M 10.375,8.75 H 13.625 Q 14.625,8.75 14.625,9.75 V 18.75 Q 14.625,19.75 13.625,19.75 H 10.375 Q 9.375,19.75 9.375,18.75 V 9.75 Q 9.375,8.75 10.375,8.75 Z M 16.25,4.25 H 19.5 Q 20.5,4.25 20.5,5.25 V 18.75 Q 20.5,19.75 19.5,19.75 H 16.25 Q 15.25,19.75 15.25,18.75 V 5.25 Q 15.25,4.25 16.25,4.25 Z"/>
|
|
337
|
+
</g>
|
|
338
|
+
</g>
|
|
339
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
340
|
+
<g>
|
|
341
|
+
<g>
|
|
342
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 4.5,13.25 H 7.75 Q 8.75,13.25 8.75,14.25 V 18.75 Q 8.75,19.75 7.75,19.75 H 4.5 Q 3.5,19.75 3.5,18.75 V 14.25 Q 3.5,13.25 4.5,13.25 Z M 10.375,8.75 H 13.625 Q 14.625,8.75 14.625,9.75 V 18.75 Q 14.625,19.75 13.625,19.75 H 10.375 Q 9.375,19.75 9.375,18.75 V 9.75 Q 9.375,8.75 10.375,8.75 Z M 16.25,4.25 H 19.5 Q 20.5,4.25 20.5,5.25 V 18.75 Q 20.5,19.75 19.5,19.75 H 16.25 Q 15.25,19.75 15.25,18.75 V 5.25 Q 15.25,4.25 16.25,4.25 Z"/>
|
|
343
|
+
</g>
|
|
344
|
+
</g>
|
|
345
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
346
|
+
<g>
|
|
347
|
+
<g>
|
|
348
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 4.5,13.25 H 7.75 Q 8.75,13.25 8.75,14.25 V 18.75 Q 8.75,19.75 7.75,19.75 H 4.5 Q 3.5,19.75 3.5,18.75 V 14.25 Q 3.5,13.25 4.5,13.25 Z M 10.375,8.75 H 13.625 Q 14.625,8.75 14.625,9.75 V 18.75 Q 14.625,19.75 13.625,19.75 H 10.375 Q 9.375,19.75 9.375,18.75 V 9.75 Q 9.375,8.75 10.375,8.75 Z M 16.25,4.25 H 19.5 Q 20.5,4.25 20.5,5.25 V 18.75 Q 20.5,19.75 19.5,19.75 H 16.25 Q 15.25,19.75 15.25,18.75 V 5.25 Q 15.25,4.25 16.25,4.25 Z"/>
|
|
349
|
+
</g>
|
|
350
|
+
</g>
|
|
351
|
+
</g>`},"filter-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
352
|
+
<g transform="scale(0.0234375)">\r
|
|
353
|
+
<path fill="currentColor" d="M846.72 170.667l-281.984 333.397c-6.272 7.381-10.069 17.024-10.069 27.563v295.339l-85.333-42.667v-252.672c0.043-9.685-3.285-19.499-10.069-27.563l-281.984-333.397zM938.667 85.333h-853.333c-23.552 0-42.667 19.115-42.667 42.667 0 10.539 3.797 20.181 10.069 27.563l331.264 391.68v263.424c0 16.597 9.472 31.019 23.595 38.144l170.667 85.333c21.077 10.539 46.72 2.005 57.259-19.072 3.072-6.229 4.523-12.843 4.48-19.072v-348.757l331.264-391.68c15.232-18.005 12.971-44.928-5.035-60.117-8.064-6.827-17.877-10.155-27.563-10.112z"/>\r
|
|
354
|
+
</g>\r
|
|
355
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
356
|
+
<g transform="scale(0.0234375)">\r
|
|
357
|
+
<path fill="currentColor" d="M846.72 170.667l-281.984 333.397c-6.272 7.381-10.069 17.024-10.069 27.563v295.339l-85.333-42.667v-252.672c0.043-9.685-3.285-19.499-10.069-27.563l-281.984-333.397zM938.667 85.333h-853.333c-23.552 0-42.667 19.115-42.667 42.667 0 10.539 3.797 20.181 10.069 27.563l331.264 391.68v263.424c0 16.597 9.472 31.019 23.595 38.144l170.667 85.333c21.077 10.539 46.72 2.005 57.259-19.072 3.072-6.229 4.523-12.843 4.48-19.072v-348.757l331.264-391.68c15.232-18.005 12.971-44.928-5.035-60.117-8.064-6.827-17.877-10.155-27.563-10.112z"/>\r
|
|
358
|
+
</g>\r
|
|
359
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
360
|
+
<g transform="scale(0.0234375)">\r
|
|
361
|
+
<path fill="white" d="M846.72 170.667l-281.984 333.397c-6.272 7.381-10.069 17.024-10.069 27.563v295.339l-85.333-42.667v-252.672c0.043-9.685-3.285-19.499-10.069-27.563l-281.984-333.397zM938.667 85.333h-853.333c-23.552 0-42.667 19.115-42.667 42.667 0 10.539 3.797 20.181 10.069 27.563l331.264 391.68v263.424c0 16.597 9.472 31.019 23.595 38.144l170.667 85.333c21.077 10.539 46.72 2.005 57.259-19.072 3.072-6.229 4.523-12.843 4.48-19.072v-348.757l331.264-391.68c15.232-18.005 12.971-44.928-5.035-60.117-8.064-6.827-17.877-10.155-27.563-10.112z"/>\r
|
|
362
|
+
</g>\r
|
|
363
|
+
</g>`},"font-size-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
364
|
+
<g>
|
|
365
|
+
<g>
|
|
366
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.5,19.25 L 12,4.75 L 18.5,19.25 M 8.35,13.5 H 15.65"/>
|
|
367
|
+
</g>
|
|
368
|
+
</g>
|
|
369
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
370
|
+
<g>
|
|
371
|
+
<g>
|
|
372
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.5,19.25 L 12,4.75 L 18.5,19.25 M 8.35,13.5 H 15.65"/>
|
|
373
|
+
</g>
|
|
374
|
+
</g>
|
|
375
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
376
|
+
<g>
|
|
377
|
+
<g>
|
|
378
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5.5,19.25 L 12,4.75 L 18.5,19.25 M 8.35,13.5 H 15.65"/>
|
|
379
|
+
</g>
|
|
380
|
+
</g>
|
|
381
|
+
</g>`},"font-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
382
|
+
<g transform="translate(12.0000, 7.6169) scale(0.01521916)">\r
|
|
383
|
+
<path fill="currentColor" d="M64 512h384v128h-128v384h-128v-384h-128zM960 256h-251.75v768h-136.5v-768h-251.75v-128h640z"/>\r
|
|
384
|
+
</g>\r
|
|
385
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
386
|
+
<g transform="translate(12.0000, 7.6169) scale(0.01521916)">\r
|
|
387
|
+
<path fill="currentColor" d="M64 512h384v128h-128v384h-128v-384h-128zM960 256h-251.75v768h-136.5v-768h-251.75v-128h640z"/>\r
|
|
388
|
+
</g>\r
|
|
389
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
390
|
+
<g transform="translate(12.0000, 7.6169) scale(0.01521916)">\r
|
|
391
|
+
<path fill="white" d="M64 512h384v128h-128v384h-128v-384h-128zM960 256h-251.75v768h-136.5v-768h-251.75v-128h640z"/>\r
|
|
392
|
+
</g>\r
|
|
393
|
+
</g>`},"function-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
394
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
395
|
+
<path fill="currentColor" d="M665.6 225.706667C618.666667 221.44 577.28 256 573.013333 303.36L562.346667 426.666667 682.666667 426.666667 682.666667 512 554.666667 512 535.893333 728.32C527.786667 822.186667 445.013333 891.733333 351.146667 883.2 295.253333 878.506667 248.32 847.36 220.586667 803.413333L284.586667 739.413333C294.826667 770.986667 322.986667 795.306667 358.4 798.293333 405.333333 802.56 446.72 768 450.986667 720.64L469.333333 512 341.333333 512 341.333333 426.666667 476.586667 426.666667 488.106667 295.68C496.213333 201.813333 578.986667 132.266667 672.853333 140.8 728.746667 145.493333 775.68 176.64 803.413333 220.586667L739.413333 284.586667C729.173333 253.013333 701.013333 228.693333 665.6 225.706667Z"/>\r
|
|
396
|
+
</g>\r
|
|
397
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
398
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
399
|
+
<path fill="currentColor" d="M665.6 225.706667C618.666667 221.44 577.28 256 573.013333 303.36L562.346667 426.666667 682.666667 426.666667 682.666667 512 554.666667 512 535.893333 728.32C527.786667 822.186667 445.013333 891.733333 351.146667 883.2 295.253333 878.506667 248.32 847.36 220.586667 803.413333L284.586667 739.413333C294.826667 770.986667 322.986667 795.306667 358.4 798.293333 405.333333 802.56 446.72 768 450.986667 720.64L469.333333 512 341.333333 512 341.333333 426.666667 476.586667 426.666667 488.106667 295.68C496.213333 201.813333 578.986667 132.266667 672.853333 140.8 728.746667 145.493333 775.68 176.64 803.413333 220.586667L739.413333 284.586667C729.173333 253.013333 701.013333 228.693333 665.6 225.706667Z"/>\r
|
|
400
|
+
</g>\r
|
|
401
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
402
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
403
|
+
<path fill="white" d="M665.6 225.706667C618.666667 221.44 577.28 256 573.013333 303.36L562.346667 426.666667 682.666667 426.666667 682.666667 512 554.666667 512 535.893333 728.32C527.786667 822.186667 445.013333 891.733333 351.146667 883.2 295.253333 878.506667 248.32 847.36 220.586667 803.413333L284.586667 739.413333C294.826667 770.986667 322.986667 795.306667 358.4 798.293333 405.333333 802.56 446.72 768 450.986667 720.64L469.333333 512 341.333333 512 341.333333 426.666667 476.586667 426.666667 488.106667 295.68C496.213333 201.813333 578.986667 132.266667 672.853333 140.8 728.746667 145.493333 775.68 176.64 803.413333 220.586667L739.413333 284.586667C729.173333 253.013333 701.013333 228.693333 665.6 225.706667Z"/>\r
|
|
404
|
+
</g>\r
|
|
405
|
+
</g>`},"gauge-horizontal-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M4 8.5C4 7.67 4.67 7 5.5 7H18.5C19.33 7 20 7.67 20 8.5V15.5C20 16.33 19.33 17 18.5 17H5.5C4.67 17 4 16.33 4 15.5V8.5ZM6 9V15H18V9H6ZM7.5 13.5C8.33 13.5 9 12.83 9 12C9 11.17 8.33 10.5 7.5 10.5C6.67 10.5 6 11.17 6 12C6 12.83 6.67 13.5 7.5 13.5Z"},"grid-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
406
|
+
<g>\r
|
|
407
|
+
<g>\r
|
|
408
|
+
<!-- 4 hollow rounded squares (2×2), outline only -->\r
|
|
409
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5,4.5 H 9 A 1.5,1.5 0 0,1 10.5,6 V 9 A 1.5,1.5 0 0,1 9,10.5 H 5 A 1.5,1.5 0 0,1 3.5,9 V 6 A 1.5,1.5 0 0,1 5,4.5 Z M 15,4.5 H 19 A 1.5,1.5 0 0,1 20.5,6 V 9 A 1.5,1.5 0 0,1 19,10.5 H 15 A 1.5,1.5 0 0,1 13.5,9 V 6 A 1.5,1.5 0 0,1 15,4.5 Z M 5,13.5 H 9 A 1.5,1.5 0 0,1 10.5,15 V 18 A 1.5,1.5 0 0,1 9,19.5 H 5 A 1.5,1.5 0 0,1 3.5,18 V 15 A 1.5,1.5 0 0,1 5,13.5 Z M 15,13.5 H 19 A 1.5,1.5 0 0,1 20.5,15 V 18 A 1.5,1.5 0 0,1 19,19.5 H 15 A 1.5,1.5 0 0,1 13.5,18 V 15 A 1.5,1.5 0 0,1 15,13.5 Z"/>\r
|
|
410
|
+
</g>\r
|
|
411
|
+
</g>\r
|
|
412
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
413
|
+
<g>\r
|
|
414
|
+
<g>\r
|
|
415
|
+
<!-- 4 hollow rounded squares (2×2), outline only -->\r
|
|
416
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5,4.5 H 9 A 1.5,1.5 0 0,1 10.5,6 V 9 A 1.5,1.5 0 0,1 9,10.5 H 5 A 1.5,1.5 0 0,1 3.5,9 V 6 A 1.5,1.5 0 0,1 5,4.5 Z M 15,4.5 H 19 A 1.5,1.5 0 0,1 20.5,6 V 9 A 1.5,1.5 0 0,1 19,10.5 H 15 A 1.5,1.5 0 0,1 13.5,9 V 6 A 1.5,1.5 0 0,1 15,4.5 Z M 5,13.5 H 9 A 1.5,1.5 0 0,1 10.5,15 V 18 A 1.5,1.5 0 0,1 9,19.5 H 5 A 1.5,1.5 0 0,1 3.5,18 V 15 A 1.5,1.5 0 0,1 5,13.5 Z M 15,13.5 H 19 A 1.5,1.5 0 0,1 20.5,15 V 18 A 1.5,1.5 0 0,1 19,19.5 H 15 A 1.5,1.5 0 0,1 13.5,18 V 15 A 1.5,1.5 0 0,1 15,13.5 Z"/>\r
|
|
417
|
+
</g>\r
|
|
418
|
+
</g>\r
|
|
419
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
420
|
+
<g>\r
|
|
421
|
+
<g>\r
|
|
422
|
+
<!-- 4 hollow rounded squares (2×2), outline only -->\r
|
|
423
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 5,4.5 H 9 A 1.5,1.5 0 0,1 10.5,6 V 9 A 1.5,1.5 0 0,1 9,10.5 H 5 A 1.5,1.5 0 0,1 3.5,9 V 6 A 1.5,1.5 0 0,1 5,4.5 Z M 15,4.5 H 19 A 1.5,1.5 0 0,1 20.5,6 V 9 A 1.5,1.5 0 0,1 19,10.5 H 15 A 1.5,1.5 0 0,1 13.5,9 V 6 A 1.5,1.5 0 0,1 15,4.5 Z M 5,13.5 H 9 A 1.5,1.5 0 0,1 10.5,15 V 18 A 1.5,1.5 0 0,1 9,19.5 H 5 A 1.5,1.5 0 0,1 3.5,18 V 15 A 1.5,1.5 0 0,1 5,13.5 Z M 15,13.5 H 19 A 1.5,1.5 0 0,1 20.5,15 V 18 A 1.5,1.5 0 0,1 19,19.5 H 15 A 1.5,1.5 0 0,1 13.5,18 V 15 A 1.5,1.5 0 0,1 15,13.5 Z"/>\r
|
|
424
|
+
</g>\r
|
|
425
|
+
</g>\r
|
|
426
|
+
</g>`},"inactive-sort-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
427
|
+
<g transform="scale(0.026 0.026)">\r
|
|
428
|
+
<path d="M682 384h172v470h-172v-470zM170 854v-342h172v342h-172zM426 854v-684h172v684h-172z"/>\r
|
|
429
|
+
</g>\r
|
|
430
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
431
|
+
<g transform="scale(0.026 0.026)">\r
|
|
432
|
+
<path d="M682 384h172v470h-172v-470zM170 854v-342h172v342h-172zM426 854v-684h172v684h-172z" fill="currentColor"/>\r
|
|
433
|
+
</g>\r
|
|
434
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
435
|
+
<g transform="scale(0.026 0.026)" fill="white" stroke="white">\r
|
|
436
|
+
<path d="M682 384h172v470h-172v-470zM170 854v-342h172v342h-172zM426 854v-684h172v684h-172z" fill="white" stroke="white"/>\r
|
|
437
|
+
</g>\r
|
|
438
|
+
</g>`},"language-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
439
|
+
<defs>
|
|
440
|
+
<mask id="datama-language-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24" style="mask-type:alpha">
|
|
441
|
+
<image width="24" height="24" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAMgCAYAAADbcAZoAAAq6UlEQVR42u3d7Y3kOq4A0BuKQ3EoDsWZOBSH4lD8Zt5W39uf1SpblkXpHKCBBXZ3fnRJFClS1f/8AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvLfv+/DnZ/rzM//5Wf78rH9+tv2j7d3P8vj5+/8Z/QYBAIDfio7xUXDk8FaUTH6zAADAW9ExZCw6fitGRr9xAADot/BY9/I2XREAAFB43FGIDD4RAABot/iY97r8LUJmnwwAALRVeAzffINVbYXI4JMCAID4xce0x6AbAgAAwYuPZY9HEQIAAAGLj3WPa/EJAgCA4kMRAgAAfCg+lr0dihAAAKi4+Jj39sw+WQAAqK/4GPd2jT5hAACop/gY9rb5OyEAAFBRAbLu7Vt90gAAcH/xMe39GH3iAABwbwGydVSAbD5xAAC4r/iY9/7MPnkAALinANk6LEB0QQAA4IbiY9r7NVkBAABQtgDZOi5AdEEAAKBg8dFz98M3YgEAQOECZFF/7IuVAAAAZQqQTf1hDAsAAEoUH6PawxgWAACUKkC8//A3QQAAoFgB4v3Hf1YrAgAAri1AvP/wDgQAAIoVIChAAACgSPExqDm+GKwMAAC4pgDxDVi+CQsAABQgChAAAGivAPEVvF9NVgYAAChAFCAAAKAAUYAAAAAKEAUIAAAoQBQgAACgAEEBAgAAChAFCAAAKEAUIAAAgAJEAQIAAAoQBQgAAChA1BsKEAAAUIAoQAAAQAGiAAEAABQgChAAAFCAKEAAAAAFiAIEAAAUIAoQAABQgChAAAAABYgCBAAAFCAKEAAAQAGiAAEAAAWIAgQAABQgChAAAEABogABAAAFiAIEAABQgChAAABAAaIAAQAABYgCBAAAUIAoQAAAQAGiAAEAABQgChAAAFCAKEAAAL5NzoY/P+PjZ/Ljp8GfRb3xxWJd+Gn05+08G5zwAPUUG/PjZ5ODAdCw7fHzVnCPMgGAskUHAChK/leQKEYALig8dDkA4HkxMssYAPIUHgCAQgTg0sJj1PEAAIUIwNWFx983HqtzAwCy+HumDjIMgJ+7HgBA/m7IJNMA+Fh8eOsBANcykgXwKD4WZwIAKEIAShQfq7MAAIpaZCCA4gMAUIQAGLsCgGYZxwK6KT48OAcARQhAkeLDV+0CQD22v2ezDAVouQBZxXoAqKsIkaEArRYfixgPAFXyKB0wegUAlOuC7EaxAKNXAEBBq4wFaKX4mMR0AAhBFwTQ/QAAdEEAUosPbz8AQBcEoFgBsojjAKALAlCqAAEAYvF3QYCwxYfH5wAQkzEswPgVAFCMMSwgZAGyid8AEJIxLCBkAQIAxGUMCwhVfHj/AQAKEIBiBcgsbgNAaLOMBohUgCziNgCE5iE6EKoA2cRtAFCAAChAAIAUvgkLUIAAAAoQgO8KEAAgOBkNoAABABQgAEawAEABAqAAAQCO8gYECFWArOI2AITma3gBBQgAUMwiowEiFSCzuA0Aoc0yGiBSATKK2wAQ2iSjASIVIIO4DQChDTIaIFoRsondABCTTAaIWICswjcAhOQBOhCyAPEOBABimmQyQMQCxDsQAAhIFgMYwwIASjF+BeiCAADFjDIYQBcEAChhlbkALRQgHqMDgO4HgC4IAKD7AbRZgHgLAgC6HwBFi5BZbAeAKvnmK6DZLsgmxgNAVTZZCmAUCwAoxegV0HwRMon1AFCFSWYC9FKEeA8CAPfy7gNQhAAARfjKXaDLAmRQhACA4gNAEQIAbTJ2BWAcCwCKmGUcAF+7IZvzAQCy+nu2jjINACNZAHA17z0AEguRSTcEAE51PSYZBcCxbohCBADSC49ZFgFwvhDREQEAhQeArggA3Fl07B6YAxTvjCx/flbnEAAdFByLogOgvqJkfPxMfvz48dPQzyL//tXc2Gf+dp4NTngAAEpfsGzqi+esEgAAyFN8jMqLXy1WCgAA5ClAjF/9brBSAAAgTwFi/Mr4FQAAFCk+JuWF8SsAAChVgBi/Mn4FAADFChCMXwEAQJHiw/iV8SsAAChWgKzqi1+NVgoAAOQpQDB+BQAARYoP41fGrwAAoFgB4m9/GL8CAIAixceotjB+BQAApQoQf/vD+BUAABQrQIxf+eODAABQpPjw+Nz4FQAAFCtAjF8ZvwIAgGIFCMavAACgSPFh/Op3m5UCAAB5ChCPz383WSkAAHC++PC3P4xfAQBAsQLE43OPzwEAoFgBgvErAAAoUnx4fG78CgAAihUgq9rC+BUAAJQoPga1hfErAAAoVYB4fJ7ASgEAgDwFiL/9YfwKAACKFB8en6cZrRYAADhfgHh8bvwKAACKFB8enxu/AgCAYgWIx+fGrwAAoFgB4vH571YrBQAAzhcfHp/72x8AAFCsAPH4PM1gtQAAwLniw+Nzj88BAKBYAeLxufErAAAoVoB4fO5vfwAAQJHiw+Nz41cAAFCsAPH43N/+AACCJnJ/H/KOjxvl+fGzfPqZH//96Nt0qGDNjuoK41cAQKyC463QOGp7FCaTG1ZuWMMen6eZrRYA4O6i46pHu9vj3x/8timwnvG3PwCAyguPUt46I6PfPhetaY/PPT4HACotPO4eU1ncwHLB2vbVu/72BwBQWYI2V5QEbebQybi2dT88PgcAKkrOhopvhzdjWWRY47561/gVAFBJYjYHSIp0QzhbYOPxOQBQQWK2uJ3FOudhtVoAgCuTsqgjKZtPjxfXOh6fAwCKj9MjWYNPkoS17vG5x+cAgOJDJ4Ri691X7xpvBAAUH5Imiqx33Y90oxUDAOROxuZGE6fZp0snBbduIgAQJhEb3d7S2Zr31bsenwMANyZjrc/Be5TO5zXvq3f97Q8AQCLmPQjF1j32DQBwQxI2dpZMjT51PD63ZwCA+xKx3h7hekyLr961XwCAm5Kw0Y0uHa573Q+PzwGAmxKx1a0u1j0/sVoAgJxJ2Nh5bjVaBdY9Hp8DAOUSsd6/gnS1Crpc97ofinQA4KZEzCNcCVZva94fHlSgAwA3JWIe4Rox6XHdL5a8x+cAgETs1sfouiBdrXs8PgcAbkrEjF/pgvS25nX97AkA4MZkDF0QRTfeRgEARRIxN8FufK15PD4HACRjN3dBBquj2TWv++HxOQBwYzLmAbouiIIbj88BAAWItyBcsN5XSzvZbMUAABIyXRCOr/XRkn7JYNUAAAoQXRCsdcU3ABA6KfMgVyLWwzrX/fDVuwBAJYmZW2HJWA/r3FsnX70LAChAJGQUW+ekm6wYAEABogvC8TWu+/ECKwYAkJzpgnBujePNEwBQUXI2y7l0QRTYPAxWDQBwdYLm24HSbVZMuPWN7gcAUFmCNsi7PNBtdG3r7unwAQCVJmrogljX3jgBABRL1HwT1mtmq6b6NT1Zpjp7AIBkrZkuiMe61a/pzTJNZ8UAAKWTNe9APNhVUOt+AAAUTdqMYb3eBRmtnCrXsu6H7gcAECBpc2vs4a51rJMHAFAscTOG5atLW1jHuh+vGawaAODO5M3fTTgwimXlVLN+dT90PwCAYAmcLohHvJHXr+6H7h0AEDCJW+RluiAB163uh/dLAEDQRE4XxDhLxHWr+6FrBwAETuZW+dnrXRAjLbetV92PF1k1AEBtCZ0uiLGWSOtV90P3AwBoIKnTBfGwN8I61f3Q/QAAGknsRqmaB+kB1qnuh7dKAEBDyZ0uyDGz1VNkfep+vG6wcgCAmhM8XZDjD9IletevT90P3Q8AoMEkTxdEslfjutT90P0AABpN9HRBPEivcV3qfiiIAYCGkz1dEA/Sa1qPs6WlGAYA2k74dEE8SK9pPfIaf58GAAiZ9OmCeJBewzrU/dD9AAA6Sfx0QdxA17AOsfYAgI6SP10Qt9B3rr/FMrLuuG3/De9+xsc30U2P/zzq9AJw5QGEB+nWnjVHH8XGfODiaXtcFkwKYAByHUy6IL4K9Y51p/vxusnK4cV9Nl6w1/4tSPyGAThzM8bxg9iNoDVXhJXDC/trLhgDZ3EQgCMHlttoj4JLrjddN90PYhceP3VFBp8EAK8cXEgOS6w1376m+0H+fVXL11n/f0fEJwJA6gGmC3Lu0HXzl7bOdD9eJ6EjWkGvEAEg6SDTBfEgvddkSfeDiPup9j/iqQgBIOlAm6R7p4xW0dP1pfuh+0Gey6JIe8k7OQB+Pdg2Od/xGz+rSHGb2WD10ECMNqYKgETRKFbxdaWwtZY4X3x4KwdAs4ecUZlzh+xoJX1YU7NlofuBuKwIAeDZYeexsFGsnOsJ3Q8UH4oQAH499HRBPB7OsY4WS0H3A7HYJQ0AqbduGMWyhnQ/uG8PtTy+6JIGgG8PP7fX56ydrx9dNN0Pju+f1kdhvZcD4NsD0A32eZPkCd0PDuyhzXs5AHo9BH0trweXR9aN7ofuB8f3T0/dZ0U3AF8OQn+c0CiWolUiRtmY65IGgO4PRAmlUaxX1ouCVfeD4/unx7d3im8Avj0UjdS45UtZJ/7ooASM4/tnEB8BwMEoybRGdD8otYcW8REAHI5GsdLXhy6ZxItze6jrLrEVAMB3h6MbbqMGP60NX7ur+8G5PeStXadfWw6AQ9KN97F1ofthLXBuD222gy4IAN8fkoNk002fojQPEQV76IvRigDgu8PSuI1RLDe3582iCY895FLnP6sVAYAD00H7bB342l3dD87vIxq8nAEg/4HpQXrno1jWgBE8suyjxXbQHQQg/eB0+93xbZ8umO4HWfaREcZv4qKVAcBPB+fg8OxzFMs7IN0Psuwjj89/NlohAEhEjRy4tXWzS959pIvY0MUMAA5Ro1jXfd5G73Q/cHmjCwLArQepx8id3I77rN3okm0vLbbEr/yhTgCeHqZmmTsYxdLtcptLtr2EkUUATh6m/kJ6vlGssdLP2MiI7gcubIwtAiBBdetX7PPdfDS6H9hL4iEAtR2suiANzj7vHp7rfuCiRgEPQKWHq0fKjR26PlPJE1n302JLxL6QAaDOA9Z8c0OjB7paEiey7ieMYQFwwQHrQXojCaxi8rRBRMB+ymK2ggBIKULIY7rxc9z8+nU/sJ90QQCIcth6uJzp4L3jJt2s+jkiAJ/2k+7HeaOVBMBvB+7gxi/m7d/um3rCdq2oNh4aSz3PN8oBIJFtdQZasmRUhOx7ijzd4NFqAiDl4DXKE+jwNTpnTAQxsGLeVgGQdPh6kB7kdl3HyogIl+wro6g6jADccAB7gBngBtDole4HYp99BkArh7C/DZLXJFEyGkKI2Cfu6TQCcHMRQr73IIPPpiqDXc6nfWWkURcEgAoOZA+cK5yFdkur+8El8W6xNew5AO4/kI1i5TW7pb2fnc0Pe4sAFzAA9FOEkG8Uazz5eWx+jfcWgTQZ57yput5kpQHwyuFsFKuC9yC6UW5huSzGKeztPwAqO5wHB3RW64HPwOjVeaPdzDd7S/fDHgSg0kNaAnzjKJBfV/mij25i22J72IcA1HtQG8W64T2I0Ss3r1wa1wgwggpAvwe1UazCM9E6T1n4ClBcqgTt/gKAhLhwcuzXc55dy5P95UKlwosXAPju0DYzXeBG0OhVFpMdyw/7y+NzI5EABDq4jWLln4seP/2OdZrO8+CVZ3FMgW9vAuD20FjCu98vblm59hIF+xOAgIe4Uay8FjezeX+XIHbZowC0d4toFCvzoexXkMVgh/IkdlFZ1xcAXjnIvVWgNrOdyZOYZXy0HpMVCcDRA9136eNWlSjxyohjPTxGB+DwgW4Ui1qMdiRPYpWOrT0LgIMd3KZSLE4ttkl1PEYH4NThbhSLOw12Ib/EKIxNAtDY4W4Ui7vMdiC/xCePz+s1WaEAnC1CwA0qtcUmlyP2MAANH/RGsShptOv4JSbpftjHADR+2P/tgqzOUwrw8JyUmLTYKvYyAH0UIXC1wW4jIR4RYAzLfgYgx6FvFIsrzXYZ4pA9DQDvD36jWBjX4O44tNkucbogViwAuYoQyG20u0iIPx6f29sASALgNH85mdTYowOruwlAx4nA4lzFiAYFY47uqy4IAJIBs9hITHDpgS4nAOUSgtG5itEMCsUbdDoBwFdicspgB5EYZ7w7i2+ykgHIlRj4al6OmO0eXogzYowuCAB8KULA6BVXxBejnu0YrWgAciYJRiSQhHBFbFlsmWZ4jA5A9kTBmAQSEHLHFYxhAcCPiYKv5kXyQc6YorPantnKBiB3wmBeG6NX5IonLjRcRABAUtLgq3kxesXZOKL74TICAJITB1/NixtPzsYRMaRdvgkPgMuKEHDbydEYQsOXEuICAFclEEYoMHrFkdix2DpiAwBIJDB6Ram4sdk+4gMAHE0kfDWv0St4JWbonIoRAJClCMF4BaTEi9X26YbH6AC41cRoBbfGCX9HSBcEANxsIqGgWIxYbB/dUgDImVx4DyKZgGcxAh1TAMieYBixkEjAd7HBmGa/JjsAgKsTjdl5a/QKPsUF3VGXFwBwWaIxeA9i9ArexQSdUVxgAFCkCHHj6fYSPD7HJQYAbj1xc0nRWAAuMgAolnh4D+LWkr5jgMfnvJntCABKJB/eg7ixpO8YYBQTMQWAW4oQSYjRK/rb+7ofiCsA3JaIeA9iVIL+9r3uJ5+tdgYAJZMR70EkCPS15+HLGJYuCABuRPlssFLJsNcXW4kf+HILAIomJd6DmM+mj71un/NjF8QOAeCOIgS3krS7xz0+x2UHANUlKN6DuJGk3f1t1JLfeGsGwC1Jihlxt5G0t6994x3iDgDVJireg9RhthpxsYCxTwB6KkIwBkE7exqMfgJQfcLiwep9BisQe5kbTXYOAHclLh6lm78m/j42UokuCABhEpe/o1irs9jsNWH3sO4HLkMACFmEuEEtwGrjgv272Fkc5C0aALcmMbogOiDE3LtweAxr9x4NADeoihB4Ye96w8VZs50EgATGoQ+p+9foJKe7IHYSACWTF385WRFC3P3r8Tm5jHYUAIoPRQj8todX24dMPEYHQPHR0/iDIoQDe3iwddAFAUDiwpkixOHPK/t4sW3SbvZ1ipL5cgwAFB+KEPhxL5Nm2r2VSY5BdhYAVyQtbgIVIcTfxxLqRC5eXi/Y7DAAFB99FiGDFYu9nG+kyMha+siaHQaAhEURAu/3si+QSDe8+73pgqQb7TQAFB+KEHjbz27yD97ki4Wvd44A4Eiy4q+cK0Joa09z8C2D7lF63LHTADiaqHioqgjBnu7SD7+/4bGfOFDAAYBERRFCf/ta8nxyhEhXWBcEgGuSFGMGEgJcKvRsePJ79Bg93WjnAaD4QBHS795eLf9z3Q+/y5f5Sl4AFB8oQjre32S6tRcrjX4CoPhAEcLz/b1Y8mle+J3qgqSZ7UAAvjtIzTQrQmh7j2+We5Lphd+pNzXiDACKDyQHSJRPGcTOe8baAFB8oAihnX1uVCjNcuB3a7QtjcfoAPxbfEhMUIS0vc+97brwlt7vVxcEALeiKEJwQ1/0hl4sva7DBIDiA0UI8fY6aaYTv2NvbMQWABQfSBSQGKc7+Xv2lq5AoQeA4oMOipDdHxCLvt83y7jMaJBRN5cbACg+UIT0vt89jk43ZPh964KkG+1QAMUHKELa2/Nu5At1P8TZ+37nACg+UIRQz74nzaTrZAwLAMUHihDO7XuPzxNl/r0Pu3c3qWY7FUDxAYqQdva+JPimJPjvv+nXqgsCoPiA/EXIaJfpfjRguOD37zF6OnEEQPEBLxUhk91m/we2+Axut9qxAJIPeLUIme266mIAN9++7x6j66YCKD5AEdJJDFgsybR1Kx6334kCwGFH2xQhdcSBzVJMMhX4LLzFqaQYBEDxgSIECe+tCn0eHqNXMA4HgOID4xSIBd2sUSNxyTxGB5BwgJGKYLHAo+cKb9t1QXRBABQfULAI2f3BwpLxwE17pTftYrXuKYDiAxQhLcYE0kw3fDbe5uicAig+oHARMtq5Etwa3PT5GMOquEAEQPFBu0XIbAdfFhc2S6zuEZ+/69+vXxcEQPEB5SlCdD/uNNz4OemCpBvtbID7E4xB8YEihB/iw2JJ1d39cIn0Ml/JC6D4AAlGxTGCILfqu69KTh7D2n15BYDiAyQZVcYI7woSiek6pQCkHVSbM4gOipDJjj8cJ8SIYMns7s1OcmywwwHKFx/QUxHitlMie6VBfA9ptNMByhxOZoRxS01KrDDKk2bx2YXlrRiA4gOKdEMG0cAtesu36GK9LgiAAwkUIdHixWKZxL5B1wWJ28ECUHyQy7R70FtbETKLDj/GDBL3dcWfoTc8ibHAjgdwCDXb4t9981iNFCFixmGVf47G6BooJAEiJhK+w7+S4uNTUqAIqa8bMogY/65RozuNjO7sRulSeYwO4OBp+1ZNEaIIqThuGNc8eLmgC+LzBFB8UPVoj8RAESJ2uDHX0dLRAmglgXDYBDnIFCGKkArjBye6m7pasfe+DALg9UNmUHzEuxndPfiViNQTQ6zFRAHPBhorLAEUH5way5D4GbGpJI5sPvY2R3V2X0ji8gHA7ZaEVRESwqz7wTcG50TTRpkFwPNDxWxvQ7flksD6bkN7SUZ2j8+b7X68+4x1yXU/ARQfWvaKECMZ1cQTGr8dd2a8dPEwyDIAJKldJae7ee3aTI3HE+stUfDP2VvBdLNMA0Cy0N14js9ZF6RgTNl8xH0Uoi6v7HmAI4fH4lzoZxRDEeJGVEJalaGBz9tj9IpiPECEg0PrvMODSRHiRlRcqcLiM++Ox+hA14WHud3Ob8UUIUZw3Ia7Dc/4uXuMrgsCIEFwGClCdEFuWVOLj7TPm3CXWv11vgDcUrn9VoQoQmuIMXTY+Xp89t7+dHjpAOBwkIAoQmKaxZi+NHrG6K53XIACSDAdPtaIcZw71pARnM5HcHYjeLogAJICxYciRDJSaO0Y70w3NHze6IKkG2UoQKsHgeJD8aEIkYy4+db9cOllLQAoPjo0B1o/ihDr49U1QyOXELphOp8Agr+brrvWkQfF1oi1kllHF2CbT7v9iwcAiYDE0nqKbQ28TiSbRm50UXVBgE6LDwFfwqEIkYhYH/UaOjqPPEZPN8pggKjBfhXDFR+SCQWI2CMeWBu6nwAlEkNBXrKhCGlA0HWBW+6f1ob3iImXD7oggOCO26znRcjmI1aAPNbD4lNrt7ulC+LSCuBzUDd3rfhQhChA7l4L1kGayVmFIhWIHtA9Nld8KEIUIBLLOIaOzyujm+lGGQ5QayDXzlZ8KELcgNbw+YtFRmtS18piGThHAMkeDg1FsXV05nP3/sytti6I9QI0Hrwd9pLG2pMLY4Ed3ZS70RYfdMzEAaDtoC2xc1AoQvowB/q8STOJDv+uGW+G0niMDtye0LkxUnwomCWrEsmgRIQvZxoKV6DyQL2JwYoPRUhXhiCfr9gkThxdO4tloQsC1BmgvfeQVChC3JaLTwpKXZC+jVYMIGlD8SFZ7X5tucEWKzKsodXysIaAem6FBOW6TVbq4bVtZKeR204fk3jhYsIYFtBOgoZkQhFi/Kr2z9Hj84Y+TxduIcxWDOBAV3wg6eg2yVBEShozriXjxrogwE0BWDKm+OixCJF4fDW4LPF5dhgLSDNaMYCbYEEft585RXl8LmY19HlaU6GsVgtwNuB6fKf4QBES7rbcxyR2OA/vG8OyrgAJlwSCfHui9zEMX73bWKJoV+uC6KwBNSVZgqzig5/3x9bjYgv0GW1CQ5LJjn55bXlbpLgFLgiuWsyKDxTpYdebBLG9grLCvY8zCsgYWI1cBblZEtirSUR62TNroM9F99aIzNVrzIhfY3EDcJuL4kPhbpTi6Gehg+t2WhfEOgMc2PSYCHaakGwSCDfTbqa72fMu7XTaADe3EgYUIb3fXgoTySY79vRa89bIxRlwIFFye6P44Jq91UphH634kBAmslOz7XUUvICuh+ID+6zXhGH31btGYuxzXRBA1wOJgj0XMikeA/6udT/SDXanLoi4ApQIkh6aKz64L0FZotxSRk0Sdo/PxZX71p6LPd184JvgqEVs/IX7i5BZcnDp7xi30C746r/gGKwY6CPp2cQ8xQdV7cm1wqRgCv57dcmSyC7sZl/XarZiQNcDt5Pc1w3ZJAPZfqcuWlxu3L0GvUFKvPCwWsBNDIoP+ixE5lZGISR+LxnsvEv3M8460PUg1FysgNx34jIVuDjYWhx/cOGSzONza7EWHqODrgfa0TRcjGyPi4mx4d8Xbp1rWY8eo1uPoOuBWyDCJ9dvBcnyKErWJ4XG+vjfzb0c7ruv3hVr6luTLgN15KD55ESgkxBAz3GQNJPVUmxNepOk+w/NBjhdj9hmqxgkeqVYLcUvB1EYQ3OBTddDwAXxUCw06lLv2jQaaBIAmglouh7xjVYyZImHHvumG6yYWy4LcS5C+IN2E6Niz7oKsuCG2Q1zV2tUh06HDsLeoDhk2yg+3EBC3viIkc8Il4cknJFWC9QTuIxbuX0Evo+PHp8nslpuv0Q0vaBQhjABS9tW8QH8HCcldUZbXCbqggCZCg+BysEPPI+Vuh/pBiumirOdNKMVA25I0EqGGuOlDrFLEGvW1ABwIij5dqvGWshucODyuInb5IhnPWln6GDFwHXByDsPxQfweuxchJo0Vkt1a9eZn2a2WuCaIGTcStsYOBY/dYyNgUZdu94uJV7mWS2QN/joepizBiRwJQxWTJU5AMYHQfGBVjEEiqNiqEuR6GvYCKGpAnDrgRsaCBJHPeJ9oQB5dIv81PejAHHGguKDY/OpAiO4OQZ08kDxgbYwtBtPgc4u+0Q+OFZ8rOKH4gM4HU89Poc+TSIgvHZgKj7aMlvVcFs83YQg0AUBnh+W/s5HQ8Fv994D7oynHp9D35zB4LDsrvgYrGq4NaYuQhF0zWN0SDgsV7GiCd57QB0xFej8MlAkhOcHpYeSbZitZhBTAecyuKmjhNFKhmpi6iYkAbog8PNB6eF58OCm+ADdD8AFIbipowTvPaC+mLoKTYCzGtzUtWi2gqHKuApgUgHc1GnnAkVi6iI8Ad/wlbzgpi70Lcpg5UK1MXUTpoDvzm8REv4xfuX2BBBTAdML4KaO781WLFQfU1ehCnjCY3QQB2K0bN2YQIh4OgpXgC4IPD8sjQq4KQHyxdRFyAISGKem68PSHx+s22yVQqiYCpA02SBi4raO6gKT9iyEi6c6ysArJpGTXg/M1f6vjpEriBlPN+EL0AUBB2Y0s1UJuh9AN0YRlB4PTSq5BRGEIHQsXYQxwNQDKEAEH0AsBWq/gBxEURyalDRbhRA+jvo2QUAuAAqQEDceoxUITcTRTUgDzuQEIikKEK5m5AraiaEenwM5uJTEzR3arEBSDF2FNcDlJDg8q2yvut2A5uLnILQBuiCgAKnRYqVBk/FzEd4A+QK8foD69hZdD+BY/ATImjeIrPRygI72+yXMckLbsdPjc+AKkwhLD4eoGeb8ZisLmo+dq1AHuMAEB+ntrdPdyBX0EDN1joErySXo4jD1DkTXA0iPmYuQB1zIY3Tc5qHrAXyImQCX5hYiLb0cqKv9/jJzmtBfrPT4HChhEnHp4VA1hqXrAfweKzchENAFgTyHqm/D0vUAdD+AerjspIvDdbHXn3Y9ZqsExEgAl56gCyIAACViJEDpy89B9MUNn64H0Gds9E4OuIM8hG66IJv9rusBfIiN4iJwy2WoCEwvB23PDy3/JhmTVQCIiUAlRpGYXg7cpcMN7i+PAt/Fw1X+A5jKgOsP3J5GsTa3C8CTWAigCwIO3mxmnzTwJA4u8h7AlAaUPXxHXQ+g4xgIUEXeIiLT2wHc2gNMXQ+gx9gHxDaJzDiI41l3f9AHSI97q3wH0AWBew/jqONYxq2AXuId0Db5DF0eytG+HWv2qQEHYt0izwEq5DE6XRchs3EroOE4B2AMCyo8oKcKuyHGrYAcsQ3AdAfohvxaeNiQQI64tslvAF0QUIgoPADdD4D/GUVs+FqIrAoPIGAMW+U1QACriA3XFyPb499RdABXxi2AEGNYuiCQVoyMj/GG5VFMbPvXWevtfbHx+LHBgBJxapHTAIH4Sl4ACF6AbPIZIFIXROQGgLjFh8fnQESjCA4AMQuQVR4DBOQxOgAELD5GOQygCwIAlCpAFvkLEJjH6AAQrAABiMxjdAAIVHx4fA60YBLRASBGAbLJWwBdEACgRPHh8TnQklFkB4C6C5BFvpJkfYyq+fFz189qGybxGB0AKi9AMFtOjL2qW2kMCwDCJzQenyeyWqhgvw6791qpZisGAOpMaCQzkhli7dnZdtQFAYCoiYzuR7rBiqGSfTvYjh6jA0DURMaDVg9asXeb/uIIqwUA6kpicItKzL3rMXriGJb9CwD1JDCL3MQcOaH3sC6IDiYAhEpePD5PM1ktVLqHveFyiQAAEpfWWC1UvI89RjdGCQBhEhejG0Y3aGMvG6X0GB0Aqk9YPF51a0o7+1kXxH4GgOoTFjembkxpa0/raOpoAkDVyQoen9PWnvamy2N0AJCoeHwOxfa1MSwXCwBQbaKyyT+MatDk3p5tW10QAKgtQdH9SDdYMQTb37ogHqMDQHUJisfnuh+0vcc9RvcFEwBQVXKC21Ha3uO+YjtxDEuXEwCuT0zMh3t8Tvv7fNAFSTZbMQBwbWLi8blvyKGPve6tl8foACAh8fgciu13j9GNWwLA7QmJkQyPz7Hn8RgdAIokIm5D3YbS3773GN2+B4DbEpFFfuEmlC73vi6IzicA3JKE4PE5fe59b788RgcACUitrBYa3P/GL11AAEDxBMQIhhEM+o4BRjCNYAJAscTDI9R0gxVDo3FAF8RjdAAolni4+dT9AJ1QsQAAiiUdmP0G3VCP0QGgSMLh8bnH5/AWD4xhuZAAgMsTjk0eYeQC3sWE2XbXBQGAqxIN3Q+Pz+FzXNAF8RgdAC5LNDw41f0AseE4X8kLAC8mGbjlhO9ig8foiWNYuqMAkJ5gLHIHc97wJEbogqSZrRYASEsuPD73TTfwLEZ4I+aSAgAkFh6fQ7E44TG6MU0AyJZYGK3w+BzECo/RAaBIQuFxqVtNEC/ECwAollB4fO5GE16JGbogOqYAcCqZwONzeCVmeDPmMToASCSuZrXAv3HDY3QXFwBwOJEwSmGUAo7EDqObRjcB4FASQZrBaoEPsUMXJHEMS/wAgP8SCONXuh9wJobooKaZrRYAkDyY4YbzMcRX8hrDAoCXkgc8PoczMWR4jBjh27AA4NfEwfiV0QnIEUtmYSLJaLUAoADB43M4H0s8RneZAQBJSYOv0PT4HHLFE+/JFCAA8GvCYG7byATkiiceo3uIDgAKEI9GoWhM0QVRgADA02QBX70LOWOKd2UuNQBAAeKrd6FYTPEYXQECAAoQj8+haFzx5RYKEABQgHh8DsXiii6IAgQAFCAeikLR2OIxugIEABQgHp9DsdjiMboCBAC+TRLcUnp8DlfEFmNY3pYBgAJEggBF48ssnIgvACBB+N1gZUCW+KILYrwTAL4kCKN8wO0kXBhjdFl9ux4AfEgO3FBKDsAlh/dlAFA0QdikBZIDuPCSQxdEhxUAPiQIkgOz2XBljPGVvGIMAHxIDoxIeHwOV8YYo55iDABIDoxGQNE403undbUKAOBjcrB4fA5cGGN677ROVgEAfEwOBjeTwMVxptsuiE8fACQHuh9QPsb02gUx4gkAkoN/bT55cNHh8TkASA50P8BFRwtmnzoAPE8OenoL4u0HuOjQYQWACpKDSfcDuPiiYxNjAID3ycEqMQBcdHh4DgAlixCjV8CVcWYRYwCA98lBizeUZrKhrouOFrutg08XAI4nCHNLxYfEAKosQlp6DzL6VAFAESIxAEWIGAMAipCinQ+JAShCFB8AoAhRfAChixAxBgAuThAiPUz3TTQQswiZAxUfg08NAMokCLXfUs4+KQgdZ2ovQvydDwC4oQiZjUMAF8eZVYwBAGpNEGafCDQZZ6ZKuq5iDABUliCskgLgwsuO+YZCZBNjAKD+JGGRFAAXxpipQJwRYwAgaJKw5k4IzF8D7+LMnDHOiDEA0FCS8P7Wck1MBNZHMjD7LQIvXHy8xZn1EUu2T7HlQ3xRcABAn8XJ4Pv0AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgFf8Hpt7X1i7BjCEAAAAASUVORK5CYII=" preserveAspectRatio="xMidYMid meet"/>
|
|
442
|
+
</mask>
|
|
443
|
+
</defs>
|
|
444
|
+
<rect width="24" height="24" fill="currentColor" mask="url(#datama-language-mask)"/>
|
|
445
|
+
</g>`},"lines-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
446
|
+
<g>\r
|
|
447
|
+
<g>\r
|
|
448
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 3.5,15.5 L 8,10.5 L 12.5,13 L 20.5,4.5"/>\r
|
|
449
|
+
</g>\r
|
|
450
|
+
</g>\r
|
|
451
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
452
|
+
<g>\r
|
|
453
|
+
<g>\r
|
|
454
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 3.5,15.5 L 8,10.5 L 12.5,13 L 20.5,4.5"/>\r
|
|
455
|
+
</g>\r
|
|
456
|
+
</g>\r
|
|
457
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
458
|
+
<g>\r
|
|
459
|
+
<g>\r
|
|
460
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 3.5,15.5 L 8,10.5 L 12.5,13 L 20.5,4.5"/>\r
|
|
461
|
+
</g>\r
|
|
462
|
+
</g>\r
|
|
463
|
+
</g>`},"lock-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0.4800000000000004, 0) scale(0.96)">\r
|
|
464
|
+
<mask id="mask0_3525_6717" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="25">\r
|
|
465
|
+
<rect y="0.425079" width="24" height="24" fill="#D9D9D9"/>\r
|
|
466
|
+
</mask>\r
|
|
467
|
+
<g mask="url(#mask0_3525_6717)">\r
|
|
468
|
+
<path d="M7.5 20.4251C7.0875 20.4251 6.73438 20.2759 6.44063 19.9775C6.14688 19.679 6 19.3203 6 18.9013V11.2822C6 10.8632 6.14688 10.5044 6.44063 10.206C6.73438 9.90762 7.0875 9.75841 7.5 9.75841H8.25V8.2346C8.25 7.18063 8.61563 6.28222 9.34688 5.53937C10.0781 4.79651 10.9625 4.42508 12 4.42508C13.0375 4.42508 13.9219 4.79651 14.6531 5.53937C15.3844 6.28222 15.75 7.18063 15.75 8.2346V9.75841H16.5C16.9125 9.75841 17.2656 9.90762 17.5594 10.206C17.8531 10.5044 18 10.8632 18 11.2822V18.9013C18 19.3203 17.8531 19.679 17.5594 19.9775C17.2656 20.2759 16.9125 20.4251 16.5 20.4251H7.5ZM12 16.6156C12.4125 16.6156 12.7656 16.4663 13.0594 16.1679C13.3531 15.8695 13.5 15.5108 13.5 15.0917C13.5 14.6727 13.3531 14.314 13.0594 14.0156C12.7656 13.7171 12.4125 13.5679 12 13.5679C11.5875 13.5679 11.2344 13.7171 10.9406 14.0156C10.6469 14.314 10.5 14.6727 10.5 15.0917C10.5 15.5108 10.6469 15.8695 10.9406 16.1679C11.2344 16.4663 11.5875 16.6156 12 16.6156ZM9.75 9.75841H14.25V8.2346C14.25 7.59968 14.0312 7.06 13.5938 6.61556C13.1562 6.17111 12.625 5.94889 12 5.94889C11.375 5.94889 10.8438 6.17111 10.4062 6.61556C9.96875 7.06 9.75 7.59968 9.75 8.2346V9.75841Z" fill="currentColor"/>\r
|
|
469
|
+
</g>\r
|
|
470
|
+
</g>`,selectiveFillContent:`<g transform="translate(0.4800000000000004, 0) scale(0.96)">\r
|
|
471
|
+
<mask id="mask0_3525_6717" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="25">\r
|
|
472
|
+
<rect y="0.425079" width="24" height="24" fill="currentColor"/>\r
|
|
473
|
+
</mask>\r
|
|
474
|
+
<g mask="url(#mask0_3525_6717)">\r
|
|
475
|
+
<path d="M7.5 20.4251C7.0875 20.4251 6.73438 20.2759 6.44063 19.9775C6.14688 19.679 6 19.3203 6 18.9013V11.2822C6 10.8632 6.14688 10.5044 6.44063 10.206C6.73438 9.90762 7.0875 9.75841 7.5 9.75841H8.25V8.2346C8.25 7.18063 8.61563 6.28222 9.34688 5.53937C10.0781 4.79651 10.9625 4.42508 12 4.42508C13.0375 4.42508 13.9219 4.79651 14.6531 5.53937C15.3844 6.28222 15.75 7.18063 15.75 8.2346V9.75841H16.5C16.9125 9.75841 17.2656 9.90762 17.5594 10.206C17.8531 10.5044 18 10.8632 18 11.2822V18.9013C18 19.3203 17.8531 19.679 17.5594 19.9775C17.2656 20.2759 16.9125 20.4251 16.5 20.4251H7.5ZM12 16.6156C12.4125 16.6156 12.7656 16.4663 13.0594 16.1679C13.3531 15.8695 13.5 15.5108 13.5 15.0917C13.5 14.6727 13.3531 14.314 13.0594 14.0156C12.7656 13.7171 12.4125 13.5679 12 13.5679C11.5875 13.5679 11.2344 13.7171 10.9406 14.0156C10.6469 14.314 10.5 14.6727 10.5 15.0917C10.5 15.5108 10.6469 15.8695 10.9406 16.1679C11.2344 16.4663 11.5875 16.6156 12 16.6156ZM9.75 9.75841H14.25V8.2346C14.25 7.59968 14.0312 7.06 13.5938 6.61556C13.1562 6.17111 12.625 5.94889 12 5.94889C11.375 5.94889 10.8438 6.17111 10.4062 6.61556C9.96875 7.06 9.75 7.59968 9.75 8.2346V9.75841Z" fill="currentColor"/>\r
|
|
476
|
+
</g>\r
|
|
477
|
+
</g>`,invertFillContent:`<g transform="translate(0.4800000000000004, 0) scale(0.96)">\r
|
|
478
|
+
<mask id="mask0_3525_6717" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="25">\r
|
|
479
|
+
<rect y="0.425079" width="24" height="24" fill="white"/>\r
|
|
480
|
+
</mask>\r
|
|
481
|
+
<g mask="url(#mask0_3525_6717)">\r
|
|
482
|
+
<path d="M7.5 20.4251C7.0875 20.4251 6.73438 20.2759 6.44063 19.9775C6.14688 19.679 6 19.3203 6 18.9013V11.2822C6 10.8632 6.14688 10.5044 6.44063 10.206C6.73438 9.90762 7.0875 9.75841 7.5 9.75841H8.25V8.2346C8.25 7.18063 8.61563 6.28222 9.34688 5.53937C10.0781 4.79651 10.9625 4.42508 12 4.42508C13.0375 4.42508 13.9219 4.79651 14.6531 5.53937C15.3844 6.28222 15.75 7.18063 15.75 8.2346V9.75841H16.5C16.9125 9.75841 17.2656 9.90762 17.5594 10.206C17.8531 10.5044 18 10.8632 18 11.2822V18.9013C18 19.3203 17.8531 19.679 17.5594 19.9775C17.2656 20.2759 16.9125 20.4251 16.5 20.4251H7.5ZM12 16.6156C12.4125 16.6156 12.7656 16.4663 13.0594 16.1679C13.3531 15.8695 13.5 15.5108 13.5 15.0917C13.5 14.6727 13.3531 14.314 13.0594 14.0156C12.7656 13.7171 12.4125 13.5679 12 13.5679C11.5875 13.5679 11.2344 13.7171 10.9406 14.0156C10.6469 14.314 10.5 14.6727 10.5 15.0917C10.5 15.5108 10.6469 15.8695 10.9406 16.1679C11.2344 16.4663 11.5875 16.6156 12 16.6156ZM9.75 9.75841H14.25V8.2346C14.25 7.59968 14.0312 7.06 13.5938 6.61556C13.1562 6.17111 12.625 5.94889 12 5.94889C11.375 5.94889 10.8438 6.17111 10.4062 6.61556C9.96875 7.06 9.75 7.59968 9.75 8.2346V9.75841Z" fill="white"/>\r
|
|
483
|
+
</g>\r
|
|
484
|
+
</g>`},"maximize-2-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
485
|
+
<g transform="translate(5.7685, 12.0000) scale(0.02086425)">\r
|
|
486
|
+
<path fill="currentColor" d="M793.003 170.667l-225.835 225.835c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0l225.835-225.835v153.003c0 23.552 19.115 42.667 42.667 42.667s42.667-19.115 42.667-42.667v-256c0-5.803-1.152-11.307-3.243-16.341s-5.163-9.728-9.216-13.781c-0.043-0.043-0.043-0.043-0.085-0.085-3.925-3.925-8.619-7.083-13.781-9.216-5.035-2.091-10.539-3.243-16.341-3.243h-256c-23.552 0-42.667 19.115-42.667 42.667s19.115 42.667 42.667 42.667zM230.997 853.333l225.835-225.835c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.835 225.835v-153.003c0-23.552-19.115-42.667-42.667-42.667s-42.667 19.115-42.667 42.667v256c0 23.552 19.115 42.667 42.667 42.667h256c23.552 0 42.667-19.115 42.667-42.667s-19.115-42.667-42.667-42.667z"/>\r
|
|
487
|
+
</g>\r
|
|
488
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
489
|
+
<g transform="translate(5.7685, 12.0000) scale(0.02086425)">\r
|
|
490
|
+
<path fill="currentColor" d="M793.003 170.667l-225.835 225.835c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0l225.835-225.835v153.003c0 23.552 19.115 42.667 42.667 42.667s42.667-19.115 42.667-42.667v-256c0-5.803-1.152-11.307-3.243-16.341s-5.163-9.728-9.216-13.781c-0.043-0.043-0.043-0.043-0.085-0.085-3.925-3.925-8.619-7.083-13.781-9.216-5.035-2.091-10.539-3.243-16.341-3.243h-256c-23.552 0-42.667 19.115-42.667 42.667s19.115 42.667 42.667 42.667zM230.997 853.333l225.835-225.835c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.835 225.835v-153.003c0-23.552-19.115-42.667-42.667-42.667s-42.667 19.115-42.667 42.667v256c0 23.552 19.115 42.667 42.667 42.667h256c23.552 0 42.667-19.115 42.667-42.667s-19.115-42.667-42.667-42.667z"/>\r
|
|
491
|
+
</g>\r
|
|
492
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
493
|
+
<g transform="translate(5.7685, 12.0000) scale(0.02086425)">\r
|
|
494
|
+
<path fill="white" d="M793.003 170.667l-225.835 225.835c-16.683 16.683-16.683 43.691 0 60.331s43.691 16.683 60.331 0l225.835-225.835v153.003c0 23.552 19.115 42.667 42.667 42.667s42.667-19.115 42.667-42.667v-256c0-5.803-1.152-11.307-3.243-16.341s-5.163-9.728-9.216-13.781c-0.043-0.043-0.043-0.043-0.085-0.085-3.925-3.925-8.619-7.083-13.781-9.216-5.035-2.091-10.539-3.243-16.341-3.243h-256c-23.552 0-42.667 19.115-42.667 42.667s19.115 42.667 42.667 42.667zM230.997 853.333l225.835-225.835c16.683-16.683 16.683-43.691 0-60.331s-43.691-16.683-60.331 0l-225.835 225.835v-153.003c0-23.552-19.115-42.667-42.667-42.667s-42.667 19.115-42.667 42.667v256c0 23.552 19.115 42.667 42.667 42.667h256c23.552 0 42.667-19.115 42.667-42.667s-19.115-42.667-42.667-42.667z"/>\r
|
|
495
|
+
</g>\r
|
|
496
|
+
</g>`},"mekko-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 3,4.5 H 9.5 V 11 H 3 Z M 3,12 H 9.5 V 19.5 H 3 Z M 10.5,4.5 H 14.5 V 14 H 10.5 Z M 10.5,15 H 14.5 V 19.5 H 10.5 Z M 15.5,4.5 H 21 V 8.5 H 15.5 Z M 15.5,9.5 H 21 V 19.5 H 15.5 Z"},"combo-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
497
|
+
<g>
|
|
498
|
+
<path fill="currentColor" d="M 4.5,14 H 9 V 19.5 H 4.5 Z M 10.25,11.5 H 14.75 V 19.5 H 10.25 Z M 16,15 H 20.5 V 19.5 H 16 Z"/>
|
|
499
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 3.5,9.5 L 12.5,4.5 L 20.5,8"/>
|
|
500
|
+
</g>
|
|
501
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
502
|
+
<g>
|
|
503
|
+
<path fill="currentColor" d="M 4.5,14 H 9 V 19.5 H 4.5 Z M 10.25,11.5 H 14.75 V 19.5 H 10.25 Z M 16,15 H 20.5 V 19.5 H 16 Z"/>
|
|
504
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 3.5,9.5 L 12.5,4.5 L 20.5,8"/>
|
|
505
|
+
</g>
|
|
506
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
507
|
+
<g>
|
|
508
|
+
<path fill="white" d="M 4.5,14 H 9 V 19.5 H 4.5 Z M 10.25,11.5 H 14.75 V 19.5 H 10.25 Z M 16,15 H 20.5 V 19.5 H 16 Z"/>
|
|
509
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 3.5,9.5 L 12.5,4.5 L 20.5,8"/>
|
|
510
|
+
</g>
|
|
511
|
+
</g>`},"moves-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 9.312,12.012 L 18.027,6.260 L 17.533,5.512 L 8.818,11.263 Z M 18.269,7.712 L 20.274,4.239 L 16.293,4.718 Z M 11.126,20.517 L 5.451,14.541 L 6.100,13.924 L 11.777,19.899 Z M 4.887,15.901 L 3.717,12.065 L 7.488,13.431 Z"},"operator-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
512
|
+
<!-- Same 2×2 layout as grid: × + − % centered in each cell -->
|
|
513
|
+
<g>
|
|
514
|
+
<g>
|
|
515
|
+
<!-- × top-left (center 7,7) -->
|
|
516
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 5.1,5.1 L 8.9,8.9 M 8.9,5.1 L 5.1,8.9"/>
|
|
517
|
+
<!-- + top-right (center 17,7) -->
|
|
518
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 17,5 V 9 M 15,7 H 19"/>
|
|
519
|
+
<!-- − bottom-left (center 7,17) -->
|
|
520
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 5,17 H 9"/>
|
|
521
|
+
<!-- % bottom-right (center 17,17): diagonal + two dots -->
|
|
522
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 15.1,19 L 18.9,15"/>
|
|
523
|
+
<path fill="currentColor" d="M 15.55,14.55 A 1.05,1.05 0 1,1 15.55,16.65 A 1.05,1.05 0 1,1 15.55,14.55 M 18.45,17.35 A 1.05,1.05 0 1,1 18.45,19.45 A 1.05,1.05 0 1,1 18.45,17.35"/>
|
|
524
|
+
</g>
|
|
525
|
+
</g>
|
|
526
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
527
|
+
<!-- Same 2×2 layout as grid: × + − % centered in each cell -->
|
|
528
|
+
<g>
|
|
529
|
+
<g>
|
|
530
|
+
<!-- × top-left (center 7,7) -->
|
|
531
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 5.1,5.1 L 8.9,8.9 M 8.9,5.1 L 5.1,8.9"/>
|
|
532
|
+
<!-- + top-right (center 17,7) -->
|
|
533
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 17,5 V 9 M 15,7 H 19"/>
|
|
534
|
+
<!-- − bottom-left (center 7,17) -->
|
|
535
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 5,17 H 9"/>
|
|
536
|
+
<!-- % bottom-right (center 17,17): diagonal + two dots -->
|
|
537
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 15.1,19 L 18.9,15"/>
|
|
538
|
+
<path fill="currentColor" d="M 15.55,14.55 A 1.05,1.05 0 1,1 15.55,16.65 A 1.05,1.05 0 1,1 15.55,14.55 M 18.45,17.35 A 1.05,1.05 0 1,1 18.45,19.45 A 1.05,1.05 0 1,1 18.45,17.35"/>
|
|
539
|
+
</g>
|
|
540
|
+
</g>
|
|
541
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
542
|
+
<!-- Same 2×2 layout as grid: × + − % centered in each cell -->
|
|
543
|
+
<g>
|
|
544
|
+
<g>
|
|
545
|
+
<!-- × top-left (center 7,7) -->
|
|
546
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" d="M 5.1,5.1 L 8.9,8.9 M 8.9,5.1 L 5.1,8.9"/>
|
|
547
|
+
<!-- + top-right (center 17,7) -->
|
|
548
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" d="M 17,5 V 9 M 15,7 H 19"/>
|
|
549
|
+
<!-- − bottom-left (center 7,17) -->
|
|
550
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" d="M 5,17 H 9"/>
|
|
551
|
+
<!-- % bottom-right (center 17,17): diagonal + two dots -->
|
|
552
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" d="M 15.1,19 L 18.9,15"/>
|
|
553
|
+
<path fill="white" d="M 15.55,14.55 A 1.05,1.05 0 1,1 15.55,16.65 A 1.05,1.05 0 1,1 15.55,14.55 M 18.45,17.35 A 1.05,1.05 0 1,1 18.45,19.45 A 1.05,1.05 0 1,1 18.45,17.35"/>
|
|
554
|
+
</g>
|
|
555
|
+
</g>
|
|
556
|
+
</g>`},"paint-brush-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37-1.34-1.34a.996.996 0 0 0-1.41 0L9 12.25 11.75 15l8.96-8.96a.996.996 0 0 0 0-1.41z"},"paint-bucket-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M20 14c-.092.064-2 2.083-2 3.5 0 1.494.949 2.448 2 2.5.906.044 2-.891 2-2.5 0-1.5-1.908-3.436-2-3.5zM9.586 20c.378.378.88.586 1.414.586s1.036-.208 1.414-.586l7-7-.707-.707L11 4.586 8.707 2.293 7.293 3.707 9.586 6 4 11.586c-.378.378-.586.88-.586 1.414s.208 1.036.586 1.414L9.586 20zM11 7.414 16.586 13H5.414L11 7.414z"},"paint-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M20.5 4.5C19.12 3.12 16.88 3.12 15.5 4.5L4.5 15.5C3.95 16.05 3.62 16.78 3.56 17.56L3.06 21.56C3.02 21.86 3.14 22.16 3.38 22.38C3.62 22.6 3.94 22.7 4.24 22.64L8.24 21.64C9.02 21.46 9.68 21.05 10.18 20.5L21.18 9.5C22.56 8.12 22.56 5.88 21.18 4.5H20.5ZM9.5 19.5C9.22 19.78 8.86 19.96 8.48 20.04L5.96 20.54L6.46 18.02C6.54 17.64 6.72 17.28 7 17L16 8L18 10L9.5 19.5ZM19.5 8.5L17.5 6.5L18.5 5.5C19.05 4.95 19.95 4.95 20.5 5.5C21.05 6.05 21.05 6.95 20.5 7.5L19.5 8.5Z"},"palette-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 12,3.5 C 7.3,3.5 3.5,7.2 3.5,11.7 C 3.5,15.9 6.6,19.5 10.7,19.5 C 11.6,19.5 12.2,18.9 12.2,18 C 12.2,17.55 12,17.15 11.7,16.85 C 11.35,16.5 11.15,16 11.15,15.45 C 11.15,14.3 12.1,13.35 13.25,13.35 H 15.4 C 18.35,13.35 20.5,11.15 20.5,8.35 C 20.5,5.65 16.7,3.5 12,3.5 Z M 8.2,8.1 A 1.05,1.05 0 1,1 8.2,10.2 A 1.05,1.05 0 1,1 8.2,8.1 M 12,6.85 A 1.05,1.05 0 1,1 12,8.95 A 1.05,1.05 0 1,1 12,6.85 M 15.85,8.35 A 1.05,1.05 0 1,1 15.85,10.45 A 1.05,1.05 0 1,1 15.85,8.35 M 8.85,12.35 A 1.05,1.05 0 1,1 8.85,14.45 A 1.05,1.05 0 1,1 8.85,12.35"},"plus-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 11,5 L 11,11 L 5,11 L 5,13 L 11,13 L 11,19 L 13,19 L 13,13 L 19,13 L 19,11 L 13,11 L 13,5 Z"},"ratio-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
557
|
+
<g>
|
|
558
|
+
<g>
|
|
559
|
+
<path fill="currentColor" d="M 12,5.25 A 1.75,1.75 0 1,1 12,8.75 A 1.75,1.75 0 1,1 12,5.25 M 12,15.25 A 1.75,1.75 0 1,1 12,18.75 A 1.75,1.75 0 1,1 12,15.25"/>
|
|
560
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 5.5,12 H 18.5"/>
|
|
561
|
+
</g>
|
|
562
|
+
</g>
|
|
563
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
564
|
+
<g>
|
|
565
|
+
<g>
|
|
566
|
+
<path fill="currentColor" d="M 12,5.25 A 1.75,1.75 0 1,1 12,8.75 A 1.75,1.75 0 1,1 12,5.25 M 12,15.25 A 1.75,1.75 0 1,1 12,18.75 A 1.75,1.75 0 1,1 12,15.25"/>
|
|
567
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" d="M 5.5,12 H 18.5"/>
|
|
568
|
+
</g>
|
|
569
|
+
</g>
|
|
570
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
571
|
+
<g>
|
|
572
|
+
<g>
|
|
573
|
+
<path fill="white" d="M 12,5.25 A 1.75,1.75 0 1,1 12,8.75 A 1.75,1.75 0 1,1 12,5.25 M 12,15.25 A 1.75,1.75 0 1,1 12,18.75 A 1.75,1.75 0 1,1 12,15.25"/>
|
|
574
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" d="M 5.5,12 H 18.5"/>
|
|
575
|
+
</g>
|
|
576
|
+
</g>
|
|
577
|
+
</g>`},"reverse-axis-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
578
|
+
<!-- Pack like other legacy glyphs (function.svg): em-square 1024 → 24. The L-axis fills the viewBox; the wide curved arrow is clipped (same as legacy DataMaIcons font rendering). -->
|
|
579
|
+
<g transform="translate(0, 0) scale(0.0234375)">
|
|
580
|
+
<path fill="currentColor" d="M69.179 487.102c0.008 246.567 0.493 452.289 1.078 457.161l1.063 8.856h902.041v-77.599h-826.599v-836.72h-77.599l0.015 448.303zM393.056 199.287c1760-624.775 1721.085-609.102 1682.165-593.437l-1799.967 639.865c-28.63 11.27-40.511 16.694-39.278 17.927 2.275 2.275 215.125 134.1 215.746 133.619 0.257-0.199 1.978-16.599 3.822-36.444s3.532-36.587 3.75-37.203c0.629-1.785 33.901 12.202 56.624 23.804 79.304 40.488 143.716 104.813 181.453 181.205 6.022 12.189 11.181 24.819 11.466 28.066l0.519 5.904-29.521 1.21c-16.237 0.666-32.357 1.426-35.822 1.687l-6.3 0.476 61.659 112.152c33.912 61.684 61.835 112.328 62.050 112.543s24.103-52.062 53.083-116.173c28.98-64.111 52.358-116.898 51.953-117.303s-18.081-0.007-39.277 0.887-39.030 1.331-39.631 0.971c-0.602-0.36-1.623-5.921-2.269-12.358-2.192-21.833-23.739-67.197-50.589-106.511-46.737-68.43-112.283-125.378-188.285-163.584-21.016-10.565-53.161-23.996-68.407-28.581l-12.054-3.626 0.682-6.215c1.419-12.91 5.715-62.45 5.715-65.888 0-1.973-0.569-3.514-1.266-3.425s-35.804 13.783-78.020 30.432z"/>
|
|
581
|
+
</g>
|
|
582
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
583
|
+
<!-- Pack like other legacy glyphs (function.svg): em-square 1024 → 24. The L-axis fills the viewBox; the wide curved arrow is clipped (same as legacy DataMaIcons font rendering). -->
|
|
584
|
+
<g transform="translate(0, 0) scale(0.0234375)">
|
|
585
|
+
<path fill="currentColor" d="M69.179 487.102c0.008 246.567 0.493 452.289 1.078 457.161l1.063 8.856h902.041v-77.599h-826.599v-836.72h-77.599l0.015 448.303zM393.056 199.287c1760-624.775 1721.085-609.102 1682.165-593.437l-1799.967 639.865c-28.63 11.27-40.511 16.694-39.278 17.927 2.275 2.275 215.125 134.1 215.746 133.619 0.257-0.199 1.978-16.599 3.822-36.444s3.532-36.587 3.75-37.203c0.629-1.785 33.901 12.202 56.624 23.804 79.304 40.488 143.716 104.813 181.453 181.205 6.022 12.189 11.181 24.819 11.466 28.066l0.519 5.904-29.521 1.21c-16.237 0.666-32.357 1.426-35.822 1.687l-6.3 0.476 61.659 112.152c33.912 61.684 61.835 112.328 62.050 112.543s24.103-52.062 53.083-116.173c28.98-64.111 52.358-116.898 51.953-117.303s-18.081-0.007-39.277 0.887-39.030 1.331-39.631 0.971c-0.602-0.36-1.623-5.921-2.269-12.358-2.192-21.833-23.739-67.197-50.589-106.511-46.737-68.43-112.283-125.378-188.285-163.584-21.016-10.565-53.161-23.996-68.407-28.581l-12.054-3.626 0.682-6.215c1.419-12.91 5.715-62.45 5.715-65.888 0-1.973-0.569-3.514-1.266-3.425s-35.804 13.783-78.020 30.432z"/>
|
|
586
|
+
</g>
|
|
587
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
588
|
+
<!-- Pack like other legacy glyphs (function.svg): em-square 1024 → 24. The L-axis fills the viewBox; the wide curved arrow is clipped (same as legacy DataMaIcons font rendering). -->
|
|
589
|
+
<g transform="translate(0, 0) scale(0.0234375)">
|
|
590
|
+
<path fill="white" d="M69.179 487.102c0.008 246.567 0.493 452.289 1.078 457.161l1.063 8.856h902.041v-77.599h-826.599v-836.72h-77.599l0.015 448.303zM393.056 199.287c1760-624.775 1721.085-609.102 1682.165-593.437l-1799.967 639.865c-28.63 11.27-40.511 16.694-39.278 17.927 2.275 2.275 215.125 134.1 215.746 133.619 0.257-0.199 1.978-16.599 3.822-36.444s3.532-36.587 3.75-37.203c0.629-1.785 33.901 12.202 56.624 23.804 79.304 40.488 143.716 104.813 181.453 181.205 6.022 12.189 11.181 24.819 11.466 28.066l0.519 5.904-29.521 1.21c-16.237 0.666-32.357 1.426-35.822 1.687l-6.3 0.476 61.659 112.152c33.912 61.684 61.835 112.328 62.050 112.543s24.103-52.062 53.083-116.173c28.98-64.111 52.358-116.898 51.953-117.303s-18.081-0.007-39.277 0.887-39.030 1.331-39.631 0.971c-0.602-0.36-1.623-5.921-2.269-12.358-2.192-21.833-23.739-67.197-50.589-106.511-46.737-68.43-112.283-125.378-188.285-163.584-21.016-10.565-53.161-23.996-68.407-28.581l-12.054-3.626 0.682-6.215c1.419-12.91 5.715-62.45 5.715-65.888 0-1.973-0.569-3.514-1.266-3.425s-35.804 13.783-78.020 30.432z"/>
|
|
591
|
+
</g>
|
|
592
|
+
</g>`},"save-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
593
|
+
<g transform="translate(12.2602, 11.2194) scale(0.01422919)">\r
|
|
594
|
+
<path fill="currentColor" d="M219.429 877.714h438.857v-219.429h-438.857v219.429zM731.429 877.714h73.143v-512c0-10.857-9.714-34.286-17.143-41.714l-160.571-160.571c-8-8-30.286-17.143-41.714-17.143v237.714c0 30.286-24.571 54.857-54.857 54.857h-329.143c-30.286 0-54.857-24.571-54.857-54.857v-237.714h-73.143v731.429h73.143v-237.714c0-30.286 24.571-54.857 54.857-54.857h475.429c30.286 0 54.857 24.571 54.857 54.857v237.714zM512 347.429v-182.857c0-9.714-8.571-18.286-18.286-18.286h-109.714c-9.714 0-18.286 8.571-18.286 18.286v182.857c0 9.714 8.571 18.286 18.286 18.286h109.714c9.714 0 18.286-8.571 18.286-18.286zM877.714 365.714v530.286c0 30.286-24.571 54.857-54.857 54.857h-768c-30.286 0-54.857-24.571-54.857-54.857v-768c0-30.286 24.571-54.857 54.857-54.857h530.286c30.286 0 72 17.143 93.714 38.857l160 160c21.714 21.714 38.857 63.429 38.857 93.714z"/>\r
|
|
595
|
+
</g>\r
|
|
596
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
597
|
+
<g transform="translate(12.2602, 11.2194) scale(0.01422919)">\r
|
|
598
|
+
<path fill="currentColor" d="M219.429 877.714h438.857v-219.429h-438.857v219.429zM731.429 877.714h73.143v-512c0-10.857-9.714-34.286-17.143-41.714l-160.571-160.571c-8-8-30.286-17.143-41.714-17.143v237.714c0 30.286-24.571 54.857-54.857 54.857h-329.143c-30.286 0-54.857-24.571-54.857-54.857v-237.714h-73.143v731.429h73.143v-237.714c0-30.286 24.571-54.857 54.857-54.857h475.429c30.286 0 54.857 24.571 54.857 54.857v237.714zM512 347.429v-182.857c0-9.714-8.571-18.286-18.286-18.286h-109.714c-9.714 0-18.286 8.571-18.286 18.286v182.857c0 9.714 8.571 18.286 18.286 18.286h109.714c9.714 0 18.286-8.571 18.286-18.286zM877.714 365.714v530.286c0 30.286-24.571 54.857-54.857 54.857h-768c-30.286 0-54.857-24.571-54.857-54.857v-768c0-30.286 24.571-54.857 54.857-54.857h530.286c30.286 0 72 17.143 93.714 38.857l160 160c21.714 21.714 38.857 63.429 38.857 93.714z"/>\r
|
|
599
|
+
</g>\r
|
|
600
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
601
|
+
<g transform="translate(12.2602, 11.2194) scale(0.01422919)">\r
|
|
602
|
+
<path fill="white" d="M219.429 877.714h438.857v-219.429h-438.857v219.429zM731.429 877.714h73.143v-512c0-10.857-9.714-34.286-17.143-41.714l-160.571-160.571c-8-8-30.286-17.143-41.714-17.143v237.714c0 30.286-24.571 54.857-54.857 54.857h-329.143c-30.286 0-54.857-24.571-54.857-54.857v-237.714h-73.143v731.429h73.143v-237.714c0-30.286 24.571-54.857 54.857-54.857h475.429c30.286 0 54.857 24.571 54.857 54.857v237.714zM512 347.429v-182.857c0-9.714-8.571-18.286-18.286-18.286h-109.714c-9.714 0-18.286 8.571-18.286 18.286v182.857c0 9.714 8.571 18.286 18.286 18.286h109.714c9.714 0 18.286-8.571 18.286-18.286zM877.714 365.714v530.286c0 30.286-24.571 54.857-54.857 54.857h-768c-30.286 0-54.857-24.571-54.857-54.857v-768c0-30.286 24.571-54.857 54.857-54.857h530.286c30.286 0 72 17.143 93.714 38.857l160 160c21.714 21.714 38.857 63.429 38.857 93.714z"/>\r
|
|
603
|
+
</g>\r
|
|
604
|
+
</g>`},"scatter-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 8.2,6.2 A 1.2,1.2 0 1,1 5.8,6.2 A 1.2,1.2 0 1,1 8.2,6.2 Z M 12.2,10.6 A 1.2,1.2 0 1,1 9.8,10.6 A 1.2,1.2 0 1,1 12.2,10.6 Z M 16.7,4.8 A 1.2,1.2 0 1,1 14.3,4.8 A 1.2,1.2 0 1,1 16.7,4.8 Z M 19.4,13 A 1.2,1.2 0 1,1 17,13 A 1.2,1.2 0 1,1 19.4,13 Z M 20.7,8 A 1.2,1.2 0 1,1 18.3,8 A 1.2,1.2 0 1,1 20.7,8 Z M 11,15.8 A 1.2,1.2 0 1,1 8.6,15.8 A 1.2,1.2 0 1,1 11,15.8 Z"},"search-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
605
|
+
<path fill="currentColor" fill-rule="evenodd" d="M 10.5,3 C 6.4,3 3,6.4 3,10.5 C 3,14.6 6.4,18 10.5,18 C 12.2,18 13.8,17.4 15.1,16.4 L 19.3,20.6 C 19.7,21 20.3,21 20.7,20.6 C 21.1,20.2 21.1,19.6 20.7,19.2 L 16.5,15 C 17.5,13.7 18.1,12.1 18.1,10.4 C 18.1,6.4 14.6,3 10.6,3 Z M 10.5,5 C 13.5,5 16,7.5 16,10.5 C 16,13.5 13.5,16 10.5,16 C 7.5,16 5,13.5 5,10.5 C 5,7.5 7.5,5 10.5,5 Z"/>\r
|
|
606
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
607
|
+
<path fill="currentColor" fill-rule="evenodd" d="M 10.5,3 C 6.4,3 3,6.4 3,10.5 C 3,14.6 6.4,18 10.5,18 C 12.2,18 13.8,17.4 15.1,16.4 L 19.3,20.6 C 19.7,21 20.3,21 20.7,20.6 C 21.1,20.2 21.1,19.6 20.7,19.2 L 16.5,15 C 17.5,13.7 18.1,12.1 18.1,10.4 C 18.1,6.4 14.6,3 10.6,3 Z M 10.5,5 C 13.5,5 16,7.5 16,10.5 C 16,13.5 13.5,16 10.5,16 C 7.5,16 5,13.5 5,10.5 C 5,7.5 7.5,5 10.5,5 Z"/>\r
|
|
608
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
609
|
+
<path fill="white" fill-rule="evenodd" d="M 10.5,3 C 6.4,3 3,6.4 3,10.5 C 3,14.6 6.4,18 10.5,18 C 12.2,18 13.8,17.4 15.1,16.4 L 19.3,20.6 C 19.7,21 20.3,21 20.7,20.6 C 21.1,20.2 21.1,19.6 20.7,19.2 L 16.5,15 C 17.5,13.7 18.1,12.1 18.1,10.4 C 18.1,6.4 14.6,3 10.6,3 Z M 10.5,5 C 13.5,5 16,7.5 16,10.5 C 16,13.5 13.5,16 10.5,16 C 7.5,16 5,13.5 5,10.5 C 5,7.5 7.5,5 10.5,5 Z"/>\r
|
|
610
|
+
</g>`},"more-vertical-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
611
|
+
<g transform="translate(4.9339, 2.1267) scale(0.02631700)">\r
|
|
612
|
+
<path fill="currentColor" d="M597.333 512c0-23.552-9.6-44.928-25.003-60.331s-36.779-25.003-60.331-25.003-44.928 9.6-60.331 25.003-25.003 36.779-25.003 60.331 9.6 44.928 25.003 60.331 36.779 25.003 60.331 25.003 44.928-9.6 60.331-25.003 25.003-36.779 25.003-60.331zM597.333 213.333c0-23.552-9.6-44.928-25.003-60.331s-36.779-25.003-60.331-25.003-44.928 9.6-60.331 25.003-25.003 36.779-25.003 60.331 9.6 44.928 25.003 60.331 36.779 25.003 60.331 25.003 44.928-9.6 60.331-25.003 25.003-36.779 25.003-60.331zM597.333 810.667c0-23.552-9.6-44.928-25.003-60.331s-36.779-25.003-60.331-25.003-44.928 9.6-60.331 25.003-25.003 36.779-25.003 60.331 9.6 44.928 25.003 60.331 36.779 25.003 60.331 25.003 44.928-9.6 60.331-25.003 25.003-36.779 25.003-60.331z"/>\r
|
|
613
|
+
</g>\r
|
|
614
|
+
</g>`},"settings-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
615
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
616
|
+
<path fill="currentColor" d="M448 128v-16c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-192v128h192v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h576v-128h-576zM256 256v-128h128v128h-128zM832 432c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-576v128h576v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h192v-128h-192v-16zM640 576v-128h128v128h-128zM448 752c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-192v128h192v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h576v-128h-576v-16zM256 896v-128h128v128h-128z"/>\r
|
|
617
|
+
</g>\r
|
|
618
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
619
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
620
|
+
<path fill="currentColor" d="M448 128v-16c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-192v128h192v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h576v-128h-576zM256 256v-128h128v128h-128zM832 432c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-576v128h576v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h192v-128h-192v-16zM640 576v-128h128v128h-128zM448 752c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-192v128h192v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h576v-128h-576v-16zM256 896v-128h128v128h-128z"/>\r
|
|
621
|
+
</g>\r
|
|
622
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
623
|
+
<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
624
|
+
<path fill="white" d="M448 128v-16c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-192v128h192v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h576v-128h-576zM256 256v-128h128v128h-128zM832 432c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-576v128h576v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h192v-128h-192v-16zM640 576v-128h128v128h-128zM448 752c0-26.4-21.6-48-48-48h-160c-26.4 0-48 21.6-48 48v16h-192v128h192v16c0 26.4 21.6 48 48 48h160c26.4 0 48-21.6 48-48v-16h576v-128h-576v-16zM256 896v-128h128v128h-128z"/>\r
|
|
625
|
+
</g>\r
|
|
626
|
+
</g>`},"slide-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M4.5 5.75C3.67 5.75 3 6.42 3 7.25V16.75C3 17.58 3.67 18.25 4.5 18.25H19.5C20.33 18.25 21 17.58 21 16.75V7.25C21 6.42 20.33 5.75 19.5 5.75H4.5ZM4.75 7.25V16.75H19.25V7.25H4.75ZM6.75 8.5H13.25C13.53 8.5 13.75 8.72 13.75 9C13.75 9.28 13.53 9.5 13.25 9.5H6.75C6.47 9.5 6.25 9.28 6.25 9C6.25 8.72 6.47 8.5 6.75 8.5Z"},"snowflake-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0.5903252254714406) scale(0.1639792292976223)">
|
|
627
|
+
<defs>
|
|
628
|
+
<style>
|
|
629
|
+
.cls-1{fill-rule:evenodd;}
|
|
630
|
+
</style>
|
|
631
|
+
</defs>
|
|
632
|
+
<path class="cls-1" fill="#29b5e8" d="M134.81,60.1l-16.47,9.49L134.81,79a8.65,8.65,0,1,1-8.67,15l-29.51-17a8.68,8.68,0,0,1-4.33-7.75,8.48,8.48,0,0,1,.31-2,8.68,8.68,0,0,1,4-5.19l29.51-16.94A8.69,8.69,0,0,1,138,48.31,8.58,8.58,0,0,1,134.81,60.1Zm-15.59,46L89.72,89.13a8.72,8.72,0,0,0-13.06,7.48v33.9a8.69,8.69,0,0,0,17.37,0v-19L110.54,121a8.66,8.66,0,1,0,8.68-15Zm-34-33.16L72.92,85.09a2.44,2.44,0,0,1-1.54.65H67.77a2.51,2.51,0,0,1-1.54-.65L54,72.9a2.45,2.45,0,0,1-.64-1.52v-3.6A2.5,2.5,0,0,1,54,66.25L66.23,54.06a2.5,2.5,0,0,1,1.54-.64h3.61a2.45,2.45,0,0,1,1.54.64L85.18,66.25a2.49,2.49,0,0,1,.63,1.53v3.6A2.44,2.44,0,0,1,85.18,72.9Zm-9.8-3.38A2.59,2.59,0,0,0,74.73,68l-3.55-3.51a2.51,2.51,0,0,0-1.54-.64h-.13a2.46,2.46,0,0,0-1.53.64L64.43,68a2.51,2.51,0,0,0-.63,1.55v.13a2.41,2.41,0,0,0,.63,1.52L68,74.7a2.48,2.48,0,0,0,1.53.64h.13a2.51,2.51,0,0,0,1.54-.64l3.55-3.53a2.49,2.49,0,0,0,.65-1.52ZM19.93,33.08,49.44,50a8.73,8.73,0,0,0,13.07-7.49V8.64a8.69,8.69,0,0,0-17.37,0v19l-16.53-9.5a8.65,8.65,0,1,0-8.68,15ZM84.69,51.16a8.64,8.64,0,0,0,5-1.13l29.5-17a8.65,8.65,0,1,0-8.68-15L94,27.61v-19a8.69,8.69,0,0,0-17.37,0v33.9A8.66,8.66,0,0,0,84.69,51.16ZM54.48,88a8.58,8.58,0,0,0-5,1.13L19.93,106.06a8.66,8.66,0,1,0,8.68,15l16.53-9.49v19a8.69,8.69,0,0,0,17.37,0V96.61A8.65,8.65,0,0,0,54.48,88Zm-8-15.87a8.61,8.61,0,0,0-4-10L13,45.14A8.69,8.69,0,0,0,1.17,48.31,8.59,8.59,0,0,0,4.35,60.1l16.47,9.49L4.35,79A8.65,8.65,0,1,0,13,94l29.48-17A8.59,8.59,0,0,0,46.47,72.13Zm93.15-56.22H138.3v1.63h1.32c.61,0,1-.28,1-.8S140.26,15.91,139.62,15.91Zm-2.94-1.5h3c1.62,0,2.7.89,2.7,2.27a2.16,2.16,0,0,1-1.08,1.9l1.17,1.68v.34h-1.69L139.62,19H138.3V20.6h-1.62Zm8.3,3.22a5.48,5.48,0,0,0-5.58-5.83c-3.31,0-5.51,2.39-5.51,5.83,0,3.28,2.2,5.82,5.51,5.82A5.47,5.47,0,0,0,145,17.63Zm1.38,0c0,3.89-2.6,7.14-7,7.14s-6.89-3.28-6.89-7.14,2.57-7.14,6.89-7.14S146.36,13.73,146.36,17.63Z">
|
|
633
|
+
</path>
|
|
634
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0.5903252254714406) scale(0.1639792292976223)">
|
|
635
|
+
<defs>
|
|
636
|
+
|
|
637
|
+
</defs>
|
|
638
|
+
<path fill="currentColor" d="M134.81,60.1l-16.47,9.49L134.81,79a8.65,8.65,0,1,1-8.67,15l-29.51-17a8.68,8.68,0,0,1-4.33-7.75,8.48,8.48,0,0,1,.31-2,8.68,8.68,0,0,1,4-5.19l29.51-16.94A8.69,8.69,0,0,1,138,48.31,8.58,8.58,0,0,1,134.81,60.1Zm-15.59,46L89.72,89.13a8.72,8.72,0,0,0-13.06,7.48v33.9a8.69,8.69,0,0,0,17.37,0v-19L110.54,121a8.66,8.66,0,1,0,8.68-15Zm-34-33.16L72.92,85.09a2.44,2.44,0,0,1-1.54.65H67.77a2.51,2.51,0,0,1-1.54-.65L54,72.9a2.45,2.45,0,0,1-.64-1.52v-3.6A2.5,2.5,0,0,1,54,66.25L66.23,54.06a2.5,2.5,0,0,1,1.54-.64h3.61a2.45,2.45,0,0,1,1.54.64L85.18,66.25a2.49,2.49,0,0,1,.63,1.53v3.6A2.44,2.44,0,0,1,85.18,72.9Zm-9.8-3.38A2.59,2.59,0,0,0,74.73,68l-3.55-3.51a2.51,2.51,0,0,0-1.54-.64h-.13a2.46,2.46,0,0,0-1.53.64L64.43,68a2.51,2.51,0,0,0-.63,1.55v.13a2.41,2.41,0,0,0,.63,1.52L68,74.7a2.48,2.48,0,0,0,1.53.64h.13a2.51,2.51,0,0,0,1.54-.64l3.55-3.53a2.49,2.49,0,0,0,.65-1.52ZM19.93,33.08,49.44,50a8.73,8.73,0,0,0,13.07-7.49V8.64a8.69,8.69,0,0,0-17.37,0v19l-16.53-9.5a8.65,8.65,0,1,0-8.68,15ZM84.69,51.16a8.64,8.64,0,0,0,5-1.13l29.5-17a8.65,8.65,0,1,0-8.68-15L94,27.61v-19a8.69,8.69,0,0,0-17.37,0v33.9A8.66,8.66,0,0,0,84.69,51.16ZM54.48,88a8.58,8.58,0,0,0-5,1.13L19.93,106.06a8.66,8.66,0,1,0,8.68,15l16.53-9.49v19a8.69,8.69,0,0,0,17.37,0V96.61A8.65,8.65,0,0,0,54.48,88Zm-8-15.87a8.61,8.61,0,0,0-4-10L13,45.14A8.69,8.69,0,0,0,1.17,48.31,8.59,8.59,0,0,0,4.35,60.1l16.47,9.49L4.35,79A8.65,8.65,0,1,0,13,94l29.48-17A8.59,8.59,0,0,0,46.47,72.13Zm93.15-56.22H138.3v1.63h1.32c.61,0,1-.28,1-.8S140.26,15.91,139.62,15.91Zm-2.94-1.5h3c1.62,0,2.7.89,2.7,2.27a2.16,2.16,0,0,1-1.08,1.9l1.17,1.68v.34h-1.69L139.62,19H138.3V20.6h-1.62Zm8.3,3.22a5.48,5.48,0,0,0-5.58-5.83c-3.31,0-5.51,2.39-5.51,5.83,0,3.28,2.2,5.82,5.51,5.82A5.47,5.47,0,0,0,145,17.63Zm1.38,0c0,3.89-2.6,7.14-7,7.14s-6.89-3.28-6.89-7.14,2.57-7.14,6.89-7.14S146.36,13.73,146.36,17.63Z">
|
|
639
|
+
</path>
|
|
640
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0.5903252254714406) scale(0.1639792292976223)">
|
|
641
|
+
<defs>
|
|
642
|
+
|
|
643
|
+
</defs>
|
|
644
|
+
<path fill="white" d="M134.81,60.1l-16.47,9.49L134.81,79a8.65,8.65,0,1,1-8.67,15l-29.51-17a8.68,8.68,0,0,1-4.33-7.75,8.48,8.48,0,0,1,.31-2,8.68,8.68,0,0,1,4-5.19l29.51-16.94A8.69,8.69,0,0,1,138,48.31,8.58,8.58,0,0,1,134.81,60.1Zm-15.59,46L89.72,89.13a8.72,8.72,0,0,0-13.06,7.48v33.9a8.69,8.69,0,0,0,17.37,0v-19L110.54,121a8.66,8.66,0,1,0,8.68-15Zm-34-33.16L72.92,85.09a2.44,2.44,0,0,1-1.54.65H67.77a2.51,2.51,0,0,1-1.54-.65L54,72.9a2.45,2.45,0,0,1-.64-1.52v-3.6A2.5,2.5,0,0,1,54,66.25L66.23,54.06a2.5,2.5,0,0,1,1.54-.64h3.61a2.45,2.45,0,0,1,1.54.64L85.18,66.25a2.49,2.49,0,0,1,.63,1.53v3.6A2.44,2.44,0,0,1,85.18,72.9Zm-9.8-3.38A2.59,2.59,0,0,0,74.73,68l-3.55-3.51a2.51,2.51,0,0,0-1.54-.64h-.13a2.46,2.46,0,0,0-1.53.64L64.43,68a2.51,2.51,0,0,0-.63,1.55v.13a2.41,2.41,0,0,0,.63,1.52L68,74.7a2.48,2.48,0,0,0,1.53.64h.13a2.51,2.51,0,0,0,1.54-.64l3.55-3.53a2.49,2.49,0,0,0,.65-1.52ZM19.93,33.08,49.44,50a8.73,8.73,0,0,0,13.07-7.49V8.64a8.69,8.69,0,0,0-17.37,0v19l-16.53-9.5a8.65,8.65,0,1,0-8.68,15ZM84.69,51.16a8.64,8.64,0,0,0,5-1.13l29.5-17a8.65,8.65,0,1,0-8.68-15L94,27.61v-19a8.69,8.69,0,0,0-17.37,0v33.9A8.66,8.66,0,0,0,84.69,51.16ZM54.48,88a8.58,8.58,0,0,0-5,1.13L19.93,106.06a8.66,8.66,0,1,0,8.68,15l16.53-9.49v19a8.69,8.69,0,0,0,17.37,0V96.61A8.65,8.65,0,0,0,54.48,88Zm-8-15.87a8.61,8.61,0,0,0-4-10L13,45.14A8.69,8.69,0,0,0,1.17,48.31,8.59,8.59,0,0,0,4.35,60.1l16.47,9.49L4.35,79A8.65,8.65,0,1,0,13,94l29.48-17A8.59,8.59,0,0,0,46.47,72.13Zm93.15-56.22H138.3v1.63h1.32c.61,0,1-.28,1-.8S140.26,15.91,139.62,15.91Zm-2.94-1.5h3c1.62,0,2.7.89,2.7,2.27a2.16,2.16,0,0,1-1.08,1.9l1.17,1.68v.34h-1.69L139.62,19H138.3V20.6h-1.62Zm8.3,3.22a5.48,5.48,0,0,0-5.58-5.83c-3.31,0-5.51,2.39-5.51,5.83,0,3.28,2.2,5.82,5.51,5.82A5.47,5.47,0,0,0,145,17.63Zm1.38,0c0,3.89-2.6,7.14-7,7.14s-6.89-3.28-6.89-7.14,2.57-7.14,6.89-7.14S146.36,13.73,146.36,17.63Z">
|
|
645
|
+
</path>
|
|
646
|
+
</g>`},"table-compact-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 5,6 L 19,6 L 19,7 L 5,7 Z M 5,17 L 19,17 L 19,18 L 5,18 Z M 5,6 L 6,6 L 6,18 L 5,18 Z M 18,6 L 19,6 L 19,18 L 18,18 Z M 12,7 L 13,7 L 13,17 L 12,17 Z M 5,11 L 19,11 L 19,12 L 5,12 Z"},"table-striped-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 4.5,4.5 H 19.5 V 8 H 4.5 Z M 4.5,10.25 H 19.5 V 13.75 H 4.5 Z M 4.5,16 H 19.5 V 19.5 H 4.5 Z"},"table-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M5 3C3.895 3 3 3.895 3 5V19C3 20.105 3.895 21 5 21H19C20.105 21 21 20.105 21 19V5C21 3.895 20.105 3 19 3H5ZM5 1H19C21.209 1 23 2.791 23 5V19C23 21.209 21.209 23 19 23H5C2.791 23 1 21.209 1 19V5C1 2.791 2.791 1 5 1ZM1 9H23V11H1V9ZM9 1H11V23H9V1Z"},"tag-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">\r
|
|
647
|
+
<g>\r
|
|
648
|
+
<g>\r
|
|
649
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 4.5,12 L 8.25,6.75 H 17.5 Q 19.25,6.75 19.25,8.5 V 15.5 Q 19.25,17.25 17.5,17.25 H 8.25 Z"/>\r
|
|
650
|
+
<path fill="currentColor" d="M 9.9,11.05 A 0.95,0.95 0 1,1 9.9,12.95 A 0.95,0.95 0 1,1 9.9,11.05"/>\r
|
|
651
|
+
</g>\r
|
|
652
|
+
</g>\r
|
|
653
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
654
|
+
<g>\r
|
|
655
|
+
<g>\r
|
|
656
|
+
<path fill="none" stroke="currentColor" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 4.5,12 L 8.25,6.75 H 17.5 Q 19.25,6.75 19.25,8.5 V 15.5 Q 19.25,17.25 17.5,17.25 H 8.25 Z"/>\r
|
|
657
|
+
<path fill="currentColor" d="M 9.9,11.05 A 0.95,0.95 0 1,1 9.9,12.95 A 0.95,0.95 0 1,1 9.9,11.05"/>\r
|
|
658
|
+
</g>\r
|
|
659
|
+
</g>\r
|
|
660
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">\r
|
|
661
|
+
<g>\r
|
|
662
|
+
<g>\r
|
|
663
|
+
<path fill="none" stroke="white" stroke-width="1.85" stroke-linecap="round" stroke-linejoin="round" d="M 4.5,12 L 8.25,6.75 H 17.5 Q 19.25,6.75 19.25,8.5 V 15.5 Q 19.25,17.25 17.5,17.25 H 8.25 Z"/>\r
|
|
664
|
+
<path fill="white" d="M 9.9,11.05 A 0.95,0.95 0 1,1 9.9,12.95 A 0.95,0.95 0 1,1 9.9,11.05"/>\r
|
|
665
|
+
</g>\r
|
|
666
|
+
</g>\r
|
|
667
|
+
</g>`},"tree-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 9.75,3 L 14.25,3 Q 15,3 15,3.75 L 15,7.25 Q 15,8 14.25,8 L 9.75,8 Q 9,8 9,7.25 L 9,3.75 Q 9,3 9.75,3 Z M 3.75,16 L 8.25,16 Q 9,16 9,16.75 L 9,20.25 Q 9,21 8.25,21 L 3.75,21 Q 3,21 3,20.25 L 3,16.75 Q 3,16 3.75,16 Z M 15.75,16 L 20.25,16 Q 21,16 21,16.75 L 21,20.25 Q 21,21 20.25,21 L 15.75,21 Q 15,21 15,20.25 L 15,16.75 Q 15,16 15.75,16 Z M 11.625,8 L 12.375,8 L 12.375,12 L 11.625,12 Z M 6,11.625 L 18,11.625 L 18,12.375 L 6,12.375 Z M 5.625,12 L 6.375,12 L 6.375,16 L 5.625,16 Z M 17.625,12 L 18.375,12 L 18.375,16 L 17.625,16 Z"},"value-by-asc-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
668
|
+
<path d="M320 768v-768h-128v768h-160l224 224 224-224h-160z"/>\r
|
|
669
|
+
<path d="M448 576h576v128h-576v-128z"/>\r
|
|
670
|
+
<path d="M448 384h448v128h-448v-128z"/>\r
|
|
671
|
+
<path d="M448 192h320v128h-320v-128z"/>\r
|
|
672
|
+
<path d="M448 0h192v128h-192v-128z"/>\r
|
|
673
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
674
|
+
<path d="M320 768v-768h-128v768h-160l224 224 224-224h-160z" fill="currentColor"/>\r
|
|
675
|
+
<path d="M448 576h576v128h-576v-128z"/>\r
|
|
676
|
+
<path d="M448 384h448v128h-448v-128z"/>\r
|
|
677
|
+
<path d="M448 192h320v128h-320v-128z"/>\r
|
|
678
|
+
<path d="M448 0h192v128h-192v-128z"/>\r
|
|
679
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
680
|
+
<path d="M320 768v-768h-128v768h-160l224 224 224-224h-160z" fill="white" stroke="white"/>\r
|
|
681
|
+
<path d="M448 576h576v128h-576v-128z" fill="white" stroke="white"/>\r
|
|
682
|
+
<path d="M448 384h448v128h-448v-128z" fill="white" stroke="white"/>\r
|
|
683
|
+
<path d="M448 192h320v128h-320v-128z" fill="white" stroke="white"/>\r
|
|
684
|
+
<path d="M448 0h192v128h-192v-128z" fill="white" stroke="white"/>\r
|
|
685
|
+
</g>`},"value-by-desc-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
686
|
+
<path d="M320 768v-768h-128v768h-160l224 224 224-224h-160z"/>\r
|
|
687
|
+
<path d="M448 0h576v128h-576v-128z"/>\r
|
|
688
|
+
<path d="M448 192h448v128h-448v-128z"/>\r
|
|
689
|
+
<path d="M448 384h320v128h-320v-128z"/>\r
|
|
690
|
+
<path d="M448 576h192v128h-192v-128z"/>\r
|
|
691
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
692
|
+
<path d="M320 768v-768h-128v768h-160l224 224 224-224h-160z" fill="currentColor"/>\r
|
|
693
|
+
<path d="M448 0h576v128h-576v-128z"/>\r
|
|
694
|
+
<path d="M448 192h448v128h-448v-128z"/>\r
|
|
695
|
+
<path d="M448 384h320v128h-320v-128z"/>\r
|
|
696
|
+
<path d="M448 576h192v128h-192v-128z"/>\r
|
|
697
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(0.0234375)">\r
|
|
698
|
+
<path d="M320 768v-768h-128v768h-160l224 224 224-224h-160z" fill="white" stroke="white"/>\r
|
|
699
|
+
<path d="M448 0h576v128h-576v-128z" fill="white" stroke="white"/>\r
|
|
700
|
+
<path d="M448 192h448v128h-448v-128z" fill="white" stroke="white"/>\r
|
|
701
|
+
<path d="M448 384h320v128h-320v-128z" fill="white" stroke="white"/>\r
|
|
702
|
+
<path d="M448 576h192v128h-192v-128z" fill="white" stroke="white"/>\r
|
|
703
|
+
</g>`},"waterfall-svg":{viewBox:"0 0 24 24",isComplex:!1,path:"M 3.25,7.15 L 5.75,7.15 Q 6.5,7.15 6.5,7.9 L 6.5,20.25 Q 6.5,21 5.75,21 L 3.25,21 Q 2.5,21 2.5,20.25 L 2.5,7.9 Q 2.5,7.15 3.25,7.15 Z M 8.3,7.15 L 10.8,7.15 Q 11.55,7.15 11.55,7.9 L 11.55,9.87 Q 11.55,10.62 10.8,10.62 L 8.3,10.62 Q 7.55,10.62 7.55,9.87 L 7.55,7.9 Q 7.55,7.15 8.3,7.15 Z M 13.35,3 L 15.85,3 Q 16.6,3 16.6,3.75 L 16.6,9.87 Q 16.6,10.62 15.85,10.62 L 13.35,10.62 Q 12.6,10.62 12.6,9.87 L 12.6,3.75 Q 12.6,3 13.35,3 Z M 18.4,3 L 20.9,3 Q 21.65,3 21.65,3.75 L 21.65,20.25 Q 21.65,21 20.9,21 L 18.4,21 Q 17.65,21 17.65,20.25 L 17.65,3.75 Q 17.65,3 18.4,3 Z"},"what-if-svg":{viewBox:"0 0 24 24",isComplex:!0,content:`<g transform="translate(0, 0) scale(1)">
|
|
704
|
+
<path fill="currentColor" fill-rule="evenodd" d="M 12,3 C 7.0,3 3,7.0 3,12 C 3,17.0 7.0,21 12,21 C 17.0,21 21,17.0 21,12 L 19,12 C 19,15.9 15.9,19 12,19 C 8.1,19 5,15.9 5,12 C 5,8.1 8.1,5 12,5 C 13.8,5 15.4,5.7 16.6,6.8 L 14,9.4 L 21,10 L 20.4,3 L 18,5.4 C 16.4,3.9 14.3,3 12,3 Z"/>
|
|
705
|
+
<path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" d="M 9.7,10.3 Q 9.7,8 12,8 Q 14.3,8 14.3,10.1 Q 14.3,11.5 12.9,12.2 Q 12,12.7 12,13.7 L 12,14.1"/>
|
|
706
|
+
<circle cx="12" cy="16.4" r="1.1" fill="currentColor" stroke="none"/>
|
|
707
|
+
</g>`,selectiveFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
708
|
+
<path fill="currentColor" fill-rule="evenodd" d="M 12,3 C 7.0,3 3,7.0 3,12 C 3,17.0 7.0,21 12,21 C 17.0,21 21,17.0 21,12 L 19,12 C 19,15.9 15.9,19 12,19 C 8.1,19 5,15.9 5,12 C 5,8.1 8.1,5 12,5 C 13.8,5 15.4,5.7 16.6,6.8 L 14,9.4 L 21,10 L 20.4,3 L 18,5.4 C 16.4,3.9 14.3,3 12,3 Z"/>
|
|
709
|
+
<path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" d="M 9.7,10.3 Q 9.7,8 12,8 Q 14.3,8 14.3,10.1 Q 14.3,11.5 12.9,12.2 Q 12,12.7 12,13.7 L 12,14.1"/>
|
|
710
|
+
<circle cx="12" cy="16.4" r="1.1" fill="currentColor" stroke="none"/>
|
|
711
|
+
</g>`,invertFillContent:`<g transform="translate(0, 0) scale(1)">
|
|
712
|
+
<path fill="white" fill-rule="evenodd" d="M 12,3 C 7.0,3 3,7.0 3,12 C 3,17.0 7.0,21 12,21 C 17.0,21 21,17.0 21,12 L 19,12 C 19,15.9 15.9,19 12,19 C 8.1,19 5,15.9 5,12 C 5,8.1 8.1,5 12,5 C 13.8,5 15.4,5.7 16.6,6.8 L 14,9.4 L 21,10 L 20.4,3 L 18,5.4 C 16.4,3.9 14.3,3 12,3 Z"/>
|
|
713
|
+
<path fill="none" stroke="white" stroke-width="1.8" stroke-linecap="round" d="M 9.7,10.3 Q 9.7,8 12,8 Q 14.3,8 14.3,10.1 Q 14.3,11.5 12.9,12.2 Q 12,12.7 12,13.7 L 12,14.1"/>
|
|
714
|
+
<circle cx="12" cy="16.4" r="1.1" fill="white" stroke="none"/>
|
|
715
|
+
</g>`}});class D{static get(t,e={}){const s=D.getIconData(t);if(!s)return null;const n=Ed(s,e);return xd(n),n}static getIconData(t){if(typeof t!="string"||t.length===0)return null;const e=Object.prototype.hasOwnProperty.call(oo,t)?oo[t]:t;return lo[e]||null}static getIconNames(){return Object.keys(lo)}}function Bs(o,t){if(!o)return o;for(;o.firstChild;)o.removeChild(o.firstChild);if(t==null||t==="")return o;const e='<svg xmlns="http://www.w3.org/2000/svg">'+t+"</svg>",s=new DOMParser().parseFromString(e,"image/svg+xml"),n=s&&s.documentElement;if(!n||n.getElementsByTagName("parsererror").length>0)return o;let i=n.firstChild;for(;i;){const r=i.nextSibling;o.appendChild(document.importNode(i,!0)),i=r}return o}function pi(o,t){return o.replace(/fill="currentColor"/g,'fill="'+t+'"').replace(/stroke="currentColor"/g,'stroke="'+t+'"')}function Ed(o,t={}){const e=t.size==null?24:t.size,s=t.width==null?e:t.width,n=t.height==null?e:t.height,i=t.fill==null?"currentColor":t.fill,r=t.stroke==null?"none":t.stroke,a=t.strokeWidth==null?0:t.strokeWidth,l=t.className||"plotter-icon",c=t.invert===!0,h=document.createElementNS(di,"svg");h.setAttribute("viewBox",o.viewBox||"0 0 24 24"),h.setAttribute("width",s),h.setAttribute("height",n),h.classList.add(l);const u=i!=="currentColor"&&i!=="original"&&i!=="none";if(o.isComplex&&o.content){h.setAttribute("fill","none");let d=o.content;return c&&o.invertFillContent?d=o.invertFillContent:u&&o.selectiveFillContent&&(d=o.selectiveFillContent),u&&(d=pi(d,i)),Bs(h,d),h}if(!o.isComplex&&o.path){if(h.setAttribute("fill",i),r!=="none"&&(h.setAttribute("stroke",r),h.setAttribute("stroke-width",a)),c&&o.invertFillContent){let p=o.invertFillContent;return u&&(p=pi(p,i)),Bs(h,p),h}if(u&&o.selectiveFillContent)return Bs(h,pi(o.selectiveFillContent,i)),h;const d=document.createElementNS(di,"path");return d.setAttribute("d",o.path),d.setAttribute("fill",i),h.appendChild(d),h}if(o.content)Bs(h,o.content);else if(o.path){const d=document.createElementNS(di,"path");d.setAttribute("d",o.path),d.setAttribute("fill",i),h.appendChild(d)}return h}function xd(o){const t=o.querySelectorAll("g");for(let e=0;e<t.length;e+=1){const s=t[e],n=s.getAttribute("transform");if(!n)continue;const i=/translate\(\s*([-\d.]+)\s*,\s*([-\d.]+)\)\s*scale\(\s*([-\d.]+)\)/.exec(n);if(!i)continue;const r=Number(i[3]);!(r>0&&r<Td)||Math.abs(r-Ld)<.001||s.setAttribute("transform",`translate(0, 0) scale(${Ad})`)}}class q{static isInput(t){return ht.isRenderable(t)&&typeof t.__parameters__.type=="string"}static isButton(t){if(!ht.isRenderable(t))return!1;const e=t.__parameters__,s=typeof e.type=="string",n=e.contents!=null,i=e.fields!=null,r=e.panels!=null,a=e.sections!=null;return!s&&!n&&!i&&!r&&!a}static isFieldSet(t){return ht.isRenderable(t)&&Array.isArray(t.__parameters__.fields)}static isUiPanel(t){if(!ht.isRenderable(t))return!1;const e=t.__parameters__,s=e.contents!=null,n=e.panels!=null||e.sections!=null;return s&&!n}static isUiPanels(t){if(!ht.isRenderable(t))return!1;const e=t.__parameters__;return e.panels!=null||e.sections!=null}static translateLabel(t,e=null){return ft(t,e)}static bindCallbacks(t,e,s){s.forEach((i,r)=>{t.removeEventListener(r,i)}),s.clear();const n=e?.callbacks;n&&Object.keys(n).forEach(i=>{const r=a=>{a.stopPropagation(),a.stopImmediatePropagation(),n[i](a,e)};s.set(i,r),t.addEventListener(i,r)})}}const fi="plotter-button",co="plotter-button-split",Sd="plotter-button-main",vd="plotter-button-caret",ho="plotter-button-split-has-actions",uo="plotter-button-split-open",Cd="plotter-button-menu",wd="plotter-button-menu-item",_i="plotter-button-icon",po="plotter-button-text",Rd="plotter-badge",fo="no-text",ke="disabled",kd=14,_o=4,Nd=8,Md="[data-datama-overlays]";class vt extends ht{static is(t){return q.isButton(t)}#t=new Map;#e=!1;#s=null;#n=null;#r=!0;render(){this.#A();const t=this.__parameters__||{};return this.#r=t.actionsVisible!==!1,this.#i().length?this.#p(t):this.#h(t)}unmount(){this.#A(),super.unmount()}setActionsVisible(t){this.#r=t!==!1,this.__parameters__.actionsVisible=this.#r,this.__nodes__.menu&&this.#c(this.__nodes__.menu),this.#C()}setPrimaryAppearance({text:t,icon:e,title:s}={}){const n=this.__parameters__;t!==void 0&&(n.text=t),e!==void 0&&(n.icon=e),s!==void 0&&(n.title=s,n.props&&typeof n.props=="object"&&(n.props.title=s));const i=this.__nodes__.main;i&&(x.clear(i),this.#y(i,n),this.#x(i,n.title),this.__node__&&this.__node__!==i&&this.#x(this.__node__,n.title))}#i(){const t=this.__parameters__?.actions;return Array.isArray(t)?t.filter(e=>!!(e&&typeof e=="object"&&!Array.isArray(e))):[]}#a(){return this.#i().filter(t=>!t.hidden)}#l(t){return(t.classList||[]).filter(e=>e)}#h(t){return this.__node__=x.getNode("button",t.id||!1,[fi,...this.#l(t)],t.target||null,{type:"button",...t.props||{}}),x.clear(this.__node__),this.#y(this.__node__,t),this.#x(this.__node__,t.title),this.#v(this.__node__,t),this.__nodes__.main=this.__node__,this.__nodes__.caret=null,this.__nodes__.menu=null,this.#f(this.__node__,t),this.__node__}#p(t){const e=this.#l(t);this.__node__=x.getNode("div",t.id||!1,[co,ho,...e],t.target||null,t.props||{}),x.clear(this.__node__),this.__node__.setAttribute("role","group");const s=x.getNode("button",t.id?`${t.id}-main`:!1,[fi,Sd,...e],this.__node__,{type:"button"});x.clear(s),this.#y(s,t),this.#x(s,t.title),this.__nodes__.main=s;const n=this.#L(t,e);return this.__node__.append(n),this.__nodes__.caret=n,this.__nodes__.menu=this.#T(t),this.#S(this.__node__,[s,n]),this.#v(this.__node__,t),this.#C(),this.#f(this.__node__,t),this.__node__.addEventListener("click",i=>{!t.disabled&&!this.__node__.classList.contains(ke)||(i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation())},!0),this.__node__}#y(t,e){t.classList.toggle(fo,!e.text),e.icon&&t.append(this.#D(!1)),e.badge&&t.append(this.#D(!0)),e.text&&t.append(this.#B())}#L(t,e){const s=q.translateLabel("More actions"),n=x.getNode("button",t.id?`${t.id}-caret`:!1,[fi,vd,fo,...e],!1,{type:"button",title:s,"aria-label":s,"aria-haspopup":"menu","aria-expanded":"false"});x.clear(n);const i=x.getNode("span",t.id?`${t.id}-caret-icon`:!1,[_i]);return x.clear(i),i.append(D.get("chevron-down-svg",{size:kd})),n.append(i),n.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),!(t.disabled||n.hidden)&&this.#m()}),n}#T(t){const e=this.#u(),s=x.getNode("ul",t.id?`${t.id}-menu`:!1,[Cd],e,{role:"menu",hidden:!0});return this.#c(s),s}#u(){const t=this.__node__?.closest('[data-app="true"]');if(t instanceof HTMLElement){const s=t.querySelector(Md);return s instanceof HTMLElement?s:t}const e=this.__node__?.closest(".plotter");return e instanceof HTMLElement?e:document.body}#c(t){x.clear(t),this.#i().forEach(e=>{const s=x.getNode("li",!1,[],t,{role:"none"}),n=Array.isArray(e.classList)?e.classList.filter(a=>a):[],i=x.getNode("button",e.id||!1,[wd,...n],s,{type:"button",role:"menuitem"});if(x.clear(i),e.icon){const a=x.getNode("span",!1,[_i],i);if(x.clear(a),typeof e.icon=="string"){const l=D.get(e.icon);l?a.append(l):a.textContent=e.icon}else(e.icon instanceof HTMLElement||e.icon instanceof SVGElement)&&a.append(e.icon.cloneNode(!0))}if(e.text){const a=x.getNode("span",!1,[po],i);a.textContent=q.translateLabel(e.text,e.vars)}e.title&&i.setAttribute("title",q.translateLabel(e.title));const r=!!e.hidden;s.hidden=r,i.hidden=r,e.disabled&&(i.disabled=!0,i.classList.add(ke)),i.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),!(e.disabled||e.hidden)&&(this.#A(),e.callbacks?.click?.(a,e))})})}#m(){if(this.#e){this.#A();return}this.#o()}#o(){const t=this.__nodes__.menu,e=this.__nodes__.caret;!t||!e||e.hidden||(this.#c(t),this.#e=!0,t.hidden=!1,this.__node__.classList.add(uo),e.setAttribute("aria-expanded","true"),this.#E(),this.#d())}#A(){this.#_(),this.#e=!1;const t=this.__nodes__.menu;t&&(t.hidden=!0),this.__node__?.classList&&this.__node__.classList.remove(uo),this.__nodes__.caret&&this.__nodes__.caret.setAttribute("aria-expanded","false")}#E(){const t=this.__nodes__.menu,e=this.__node__,s=this.#u();if(!t||!e||!(s instanceof HTMLElement))return;const n=e.getBoundingClientRect(),i=s.getBoundingClientRect(),r=s.scrollTop||0,a=s.scrollLeft||0,l=Nd;t.style.position="absolute",t.style.minWidth=`${Math.max(n.width,160)}px`,t.style.right="";const c=n.left-i.left+a;t.style.left=`${Math.round(Math.max(l,c))}px`;const h=t.offsetHeight||0,u=n.bottom-i.top+r+_o,d=i.bottom-n.bottom-l;if(n.top-i.top-l,d>=h){t.style.top=`${Math.round(u)}px`;return}t.style.top=`${Math.round(n.top-i.top+r-h-_o)}px`}#d(){this.#_(),this.#s=t=>{const e=t.target;if(!(e instanceof Node)){this.#A();return}this.__node__?.contains(e)||this.__nodes__.menu?.contains(e)||this.#A()},this.#n=t=>{t.key==="Escape"&&this.#A()},document.addEventListener("pointerdown",this.#s,!0),document.addEventListener("keydown",this.#n)}#_(){this.#s&&(document.removeEventListener("pointerdown",this.#s,!0),this.#s=null),this.#n&&(document.removeEventListener("keydown",this.#n),this.#n=null)}#C(){const t=this.__nodes__.caret;if(!t||!this.__node__?.classList?.contains(co))return;const e=this.#r&&this.#a().length>0;t.hidden=!e,this.__node__.classList.toggle(ho,e),e||this.#A()}#S(t,e){Object.defineProperty(t,"disabled",{configurable:!0,enumerable:!0,get:()=>e.some(s=>s.disabled),set:s=>{const n=!!s;this.__parameters__.disabled=n,this.#g(t,e,n)}}),this.#g(t,e,!!this.__parameters__.disabled)}#g(t,e,s){if(e.forEach(n=>{n.disabled=s}),s){t.classList.add(ke);return}t.classList.remove(ke)}#f(t,e){if(t.__datama__={class:this},e.disabled){t.classList.add(ke),t.tagName==="BUTTON"&&(t.disabled=!0),this.#t.forEach((s,n)=>{t.removeEventListener(n,s)}),this.#t.clear();return}t.classList.remove(ke),q.bindCallbacks(t,e,this.#t)}#x(t,e){e&&t.setAttribute("title",q.translateLabel(e))}#v(t,e){e.style&&t.setAttribute("style",e.style)}#D(t){const e=this.__parameters__,s=t?e.badge:e.icon,n=e.id?`${e.id}${t?"-badge":"-icon"}`:!1,i=Array.isArray(s)?s:[_i],r=x.getNode("span",n,i);if(x.clear(r),Array.isArray(s))return r;if(typeof s=="string"){const l=D.get(s);return l?r.append(l):r.innerText=s,r}const a=s;return t&&a?.classList&&a.classList.add(Rd),a&&r.append(a),r}#B(){const t=this.__parameters__,e=t.id?`${t.id}-title`:!1,s=x.getNode("span",e,[po]);return s.textContent=q.translateLabel(t.text,t.vars),s}}const is=Object.freeze([{label:"Normal",value:400},{label:"Medium",value:500},{label:"Bold",value:700}]),Ct=Object.freeze([{label:"Inter",value:"Inter, system-ui, sans-serif"},{label:"Roboto",value:"Roboto, Helvetica, Arial, sans-serif"},{label:"Source Sans 3",value:'"Source Sans 3", "Source Sans Pro", system-ui, sans-serif'},{label:"Montserrat",value:"Montserrat, system-ui, sans-serif"},{label:"Karla",value:"Karla, system-ui, sans-serif"},{label:"Roboto Slab",value:'"Roboto Slab", Georgia, serif'},{label:"Georgia",value:'Georgia, "Times New Roman", serif'},{label:"Office",value:'Aptos, Calibri, "Segoe UI", system-ui, sans-serif'},{label:"System",value:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif'}]);Ct[3].value,Ct[4].value,Ct[5].value,Ct[6].value,Ct[7].value,Ct[1].value;const Ne="#000000";function Me(o){return o==null||o===""?null:{fontFamily:String(o)}}function Id(o,t){o instanceof Element&&(o.style.fontFamily="",!(t==null||typeof t!="object")&&Object.keys(t).forEach(e=>{const s=t[e];o.style[e]=s==null?"":String(s)}))}const Ie="plotter-input",gi="plotter-input-container",Od="plotter-input-container-light",Pd="plotter-input-with-unit",Dd="plotter-input-unit",Fd="plotter-input-outer-prefix",Hd="plotter-input-outer-suffix",go="plotter-input-label",zs="plotter-input-disabled",mi="plotter-input-read-only",mo="plotter-input-select",Bd="plotter-input-select-light",me="plotter-input-select-open",zd="plotter-input-select-value",Vd="plotter-input-select-value-text",yo="plotter-input-select-dropdown",Vs="plotter-input-select-dropdown-open",$d="plotter-input-select-group",Wd="plotter-input-select-group-label",Gd="plotter-input-select-group-option",jd="plotter-input-button-group",Ud="plotter-input-button-group-buttons",Yd="plotter-input-button-group-segmented",Kd="plotter-input-button-group-segment",Xd="plotter-input-button-group-segment-toggle",Zd="plotter-input-button-group-segment-indicator",Qd="plotter-view-current",qd=6,Jd=200,tp="plotter-input-select-weighted",ep="plotter-input-select-weighted-dropdown",sp="plotter-input-select-anchor-hovered",np=["select","select-weighted"];class J extends ht{static#t=!1;static is(t){return q.isInput(t)}static closeAllSelects(){document.querySelectorAll(`.${me}`).forEach(t=>{t.classList.remove(me)}),document.querySelectorAll(`.${Vs}`).forEach(t=>{t.classList.remove(Vs);const e=t.getAttribute("data-trigger-id");document.getElementById(e)?.classList.remove(me)})}__value__=null;__dropdownNode__=null;__elValue__=null;__options__=[];__buttonGroupLocked__=!1;__buttonGroupCurrentValue__=null;#e=null;#s=null;#n=null;#r=null;render(){this.#i();const t=this.#l();return this.__node__&&(this.__node__.__datama__={class:this}),t}syncFromBoundList(){const t=this.__parameters__||{};if(!t.list||t.key==null)return;const e=t.list[t.key];if(t.type==="switch"){this.__value__=e,this.__node__?.setAttribute("data-value",String(!!e));return}if(t.type==="button-group"||this.#h()){this.syncSelectionFromBinding(e);return}if(this.__value__=e,this.__node__&&"value"in this.__node__){const s=e==null?"":String(e);this.__node__.value!==s&&(this.__node__.value=s)}}unmount(){this.#n&&(document.removeEventListener("click",this.#n),this.#n=null),this.__node__&&this.#e&&this.__node__.removeEventListener("click",this.#e),this.__node__&&this.#s&&this.__node__.removeEventListener("click",this.#s),this.__node__&&this.#r&&this.__node__.removeEventListener("input",this.#r),this.__dropdownNode__?.remove(),this.__dropdownNode__=null,super.unmount()}syncSelectionFromBinding(t){let e=t;if(e==null&&(this.__parameters__.list?e=this.__parameters__.list[this.#a()]:e=this.__parameters__.value),this.__parameters__.type==="button-group"){this.__parameters__.multiple?this.__value__=Array.isArray(e)?e.map(s=>String(s)):[]:this.__value__=e==null?null:String(e),this.#nt(),this.__node__&&this.__node__.setAttribute("data-value",this.#ft()),this.#q();return}this.#h()&&(this.__value__=e==null?null:String(e),this.__parameters__.list&&this.__parameters__.key!=null&&(this.__parameters__.list[this.__parameters__.key]=this.__value__),this.__elValue__&&this.#k(this.__elValue__))}syncCurrentValue(t){this.__buttonGroupCurrentValue__=t==null?null:String(t),this.#q()}#i(){const t=this.__parameters__||{};t.list?this.__value__=t.list[this.#a()]??(t.multiple?[]:null):this.__value__=t.multiple?[]:t.value,t.multiple&&(Array.isArray(this.__value__)||(this.__value__=this.__value__?[this.__value__]:[]),this.__value__=this.__value__.map(e=>String(e))),typeof this.__value__=="object"&&t.type==="text"&&this.__value__!=null&&(this.__value__=JSON.stringify(this.__value__)),t.type==="color"&&typeof this.__value__=="string"&&this.__value__.length===9&&(this.__value__=this.__value__.substring(0,7))}#a(){const t=this.__parameters__;return t.key!=null?t.key:t.id}#l(){const t=this.__parameters__.type;return t==="switch"?this.#p():t==="button-group"?this.#j():t==="number"?this.#T():this.#h()?this.#d():this.#u(t==="color")}#h(){return np.indexOf(this.__parameters__.type)!==-1}#p(){const t=this.__parameters__,e=x.getNode("div",t.id||!1,[Ie,`${Ie}-switch`]);this.#E(e),t.key&&e.setAttribute("data-key",t.key);const s=t.list?t.list[this.#a()]:t.value;return e.setAttribute("data-value",String(s||!1)),t.title&&e.setAttribute("title",q.translateLabel(t.title,t.vars)),!t.disabled&&!t.readOnly&&(this.#s||(this.#s=i=>this.#y(i)),e.removeEventListener("click",this.#s),e.addEventListener("click",this.#s)),this.__node__=e,t.label!=null?this.#o(e,!1,!0):e}#y(t){t.stopPropagation(),t.stopImmediatePropagation();const e=this.__parameters__;let s;if(e.list){const n=this.#a();e.list[n]=!e.list[n],s=e.list[n]}else e.value=!e.value,s=e.value;this.__value__=s,this.__node__.setAttribute("data-value",String(s)),typeof e.callbacks?.input=="function"&&e.callbacks.input(s)}#L(){const t=this.__parameters__;return t.label!=null||!!t.outerPrefix||!!t.outerSuffix}#T(){const t=this.__parameters__,e=this.#L(),s=!!t.unit&&e,n=this.#u(!1,s);if(!t.unit)return n;const i=this.#A(n);if(e){const r=this.#o(i,!1,!1);return this.__node__=n,r}return i}#u(t=!1,e=!1){const s=this.__parameters__,n=[Ie,`${Ie}-${s.type}`,s.disabled?zs:!1,s.readOnly?mi:!1].filter(a=>a),i=x.getNode("input",s.id||!1,n,!1,s.props||{});return s.type&&i.setAttribute("type",s.type),s.key&&i.setAttribute("data-key",s.key),s.min!=null&&i.setAttribute("min",s.min),s.max!=null&&i.setAttribute("max",s.max),s.step&&i.setAttribute("step",s.step),s.placeholder&&i.setAttribute("placeholder",q.translateLabel(s.placeholder,s.vars)),s.readOnly?i.setAttribute("readonly","readonly"):i.removeAttribute("readonly"),s.disabled?i.setAttribute("disabled","disabled"):i.removeAttribute("disabled"),this.__value__!=null&&(i.value=this.__value__),s.title&&i.setAttribute("title",q.translateLabel(s.title,s.vars)),!s.disabled&&!s.readOnly&&(this.#r||(this.#r=a=>this.#c(a)),i.removeEventListener("input",this.#r),i.addEventListener("input",this.#r)),this.__node__=i,e?i:this.#L()?this.#o(i,t,!1):i}#c(t){const e=this.__parameters__;this.__value__=this.#m(t.target.value,t.target);const s=typeof e.callbacks?.input=="function";!s&&e.list&&(e.list[this.#a()]=this.__value__),s&&e.callbacks.input(this.__value__,t)}#m(t,e=null){if(this.__parameters__.type!=="number"||t===""||t==null)return t;if(e instanceof HTMLInputElement&&e.type==="number"){const n=e.valueAsNumber;if(!Number.isNaN(n))return n}const s=Number(t);return Number.isNaN(s)?t:s}#o(t,e,s){const n=this.__parameters__,i=[gi];n.light&&i.push(Od),n.containerClassList&&n.containerClassList.forEach(u=>{u&&i.push(u)});const r=x.getNode("div",n.id?`${n.id}-container`:!1,i);x.clear(r);let a=null;if(n.label!=null){const u=[go];s?u.push("ml-2"):u.push(e?"ml-4":"mr-4"),a=x.getNode("label",n.id?`${n.id}-label`:!1,u),n.id&&a.setAttribute("for",n.id),a.textContent=q.translateLabel(n.label,n.vars)}let l=null;n.outerPrefix&&(l=x.getNode("span",n.id?`${n.id}-outer-prefix`:!1,[Fd]),l.textContent=String(n.outerPrefix));let c=null;n.outerSuffix&&(c=x.getNode("span",n.id?`${n.id}-outer-suffix`:!1,[Hd]),c.textContent=String(n.outerSuffix));let h;return s?h=[t,a]:e?h=[l,t,c,a]:h=[a,l,t,c],r.append(...h.filter(u=>u)),this.__node__=t,r}#A(t){const e=x.getNode("div",!1,[gi,Pd]);x.clear(e),e.append(t);const s=x.getNode("span",!1,[Dd]);return s.textContent=String(this.__parameters__.unit),t.tagName==="DIV"?t.append(s):e.append(s),e}#E(t){const e=this.__parameters__;e.readOnly?t.classList.add(mi):t.classList.remove(mi),e.disabled?t.classList.add(zs):t.classList.remove(zs)}#d(){const t=this.__parameters__,e=(t.classList||[]).filter(l=>l),s=x.getNode("div",t.id||!1,[Ie,mo],!1,t.props||{});if(t.key&&s.setAttribute("data-key",t.key),t.light&&s.classList.add(Bd),t.inline&&s.classList.add("inline"),t.weights){s.classList.add(tp);const l=c=>{this.__dropdownNode__?.classList.toggle(sp,c)};s.addEventListener("mouseenter",()=>l(!0)),s.addEventListener("mouseleave",()=>l(!1))}this.#E(s);const n=x.getNode("div",t.id?`${t.id}-text`:!1,[zd,...e]);this.__elValue__=n,this.#k(n),x.clear(s),s.append(n),!t.disabled&&!t.readOnly&&(this.#e||(this.#e=l=>this.#_(l)),s.removeEventListener("click",this.#e),s.addEventListener("click",this.#e));const r=[yo];r.push(t.dropdownLeft?"dropdown-left":"dropdown-right"),t.weights&&r.push(ep);const a=x.getNode("div",t.id?`${t.id}-dropdown`:!1,r);return a.setAttribute("data-trigger-id",t.id),this.__dropdownNode__=a,this.#D(a),this.__node__=s,this.#O(s),t.label!=null?this.#o(s,!1,!1):s}#_(t){t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation();const e=this.__node__.classList.contains(me);J.closeAllSelects(),!e&&this.#C()}#C(){this.__dropdownNode__&&this.#D(this.__dropdownNode__),this.#g(),this.#f(),this.__node__?.classList.add(me),this.__dropdownNode__?.classList.add(Vs)}#S(){this.__node__?.classList.remove(me),this.__dropdownNode__?.classList.remove(Vs)}#g(){const t=this.__dropdownNode__;if(!t)return;const e=this.#x();t.parentNode!==e&&e.append(t),t.setAttribute("data-trigger-id",this.__parameters__.id)}#f(){const t=this.__dropdownNode__,e=this.__node__;if(!t||!e)return;const s=this.#x(),n=e.getBoundingClientRect(),i=s.getBoundingClientRect(),r=s.scrollTop||0,a=s.scrollLeft||0,l=Math.max(n.width||0,Jd),c=n.left-i.left+a,h=n.right-i.left+a;t.style.position="absolute",t.style.minWidth=`${l}px`,t.style.bottom="",t.style.top=`${Math.round(n.bottom-i.top+r+qd)}px`,this.__parameters__.dropdownLeft?(t.style.left=`${Math.round(c)}px`,t.style.right=""):(t.style.left=`${Math.round(h-l)}px`,t.style.right="")}#x(){const t=this.__node__?.closest('[data-app="true"]');if(t instanceof HTMLElement){const s=t.querySelector("[data-datama-overlays]");return s instanceof HTMLElement?s:t}const e=this.__node__?.closest(".plotter");return e instanceof HTMLElement?e:document.body}#v(){const t=this.__parameters__.items;if(typeof t=="function"){const e=t();return Array.isArray(e)?e:[]}return Array.isArray(t)?t:[]}refreshSelectItems(){this.#h()&&(this.__dropdownNode__&&this.#D(this.__dropdownNode__),this.__elValue__&&this.#k(this.__elValue__))}#D(t){x.clear(t),this.__options__=[];const e=this.#v(),s=this.#B(e);s.forEach((n,i)=>{const r=x.getNode("div",this.__parameters__.id?`${this.__parameters__.id}-group-${i}`:!1,[$d]);if(x.clear(r),s.length>1&&n){r.setAttribute("data-label",n);const l=x.getNode("div",this.__parameters__.id?`${this.__parameters__.id}-group-${i}-label`:!1,[Wd]);l.textContent=n,r.append(l)}e.filter(l=>this.#$(l,n,s.length===1)).forEach((l,c)=>{const h=this.#F(l,i,c);r.append(h),this.__options__.push(h)}),t.append(r)})}#B(t){const e=[],s={};return t.forEach(i=>{if(typeof i=="object"&&i?.group){const r=String(i.group);Object.prototype.hasOwnProperty.call(s,r)||(s[r]=!0,e.push(r))}}),e.length?(t.some(i=>typeof i!="object"||!i?.group)&&e.push(null),e):[null]}#$(t,e,s){return s?!0:e==null?typeof t!="object"||!t?.group:typeof t=="object"&&String(t.group)===String(e)}#F(t,e,s){const n=x.getNode("div",this.__parameters__.id?`${this.__parameters__.id}-group-${e}-option-${s}`:!1,[Gd]),i=this.#H(t),r=this.#I(t);if(n.setAttribute("data-value",i==null?"null":String(i)),this.#M(i)&&n.setAttribute("data-selected","selected"),typeof t=="object"&&t?.classList&&t.classList.filter(a=>a).forEach(a=>{n.classList.add(a)}),typeof t=="object"&&t?.title&&n.setAttribute("title",q.translateLabel(t.title,t.titleParameters)),typeof t=="object"&&t?.active===!1&&n.classList.add("disabled"),this.__parameters__.weights)typeof this.__parameters__.callbacks?.selected=="function"&&this.__parameters__.callbacks.selected(t)&&n.setAttribute("data-selected","selected"),this.#G(n,t,s);else if(typeof t=="object"&&t?.icon instanceof Node){x.clear(n),n.append(t.icon.cloneNode(!0));const a=x.getNode("span",!1,["plotter-input-select-option-text"]);a.textContent=q.translateLabel(r),this.#N(a,t),n.append(a)}else n.textContent=q.translateLabel(r),this.#N(n,t);return n.addEventListener("click",a=>this.#R(a,t)),n}#w(t){const e=this.__parameters__.weights;if(!Array.isArray(e)||!e.length)return 0;const s=Math.min(...e),n=s<0?Math.abs(s):0,i=Math.max(...e.map(r=>r+n));return!i||t==null||Number.isNaN(t)?0:t/i*100}#G(t,e,s){const n=this.__parameters__,i=n.item_text||"text",r=n.item_value||"value";x.clear(t);const a=x.getNode("span",n.id?`${n.id}-${s}-text-container`:!1,["text-container"]),l=x.getNode("span",n.id?`${n.id}-${s}-text`:!1,["text"]);l.textContent=q.translateLabel(typeof e=="object"&&e!=null?e[i]:e),a.append(l);const c=x.getNode("div",n.id?`${n.id}-${s}-detail`:!1,["detail"]);if(typeof e=="object"&&e!=null&&e.detail)c.textContent=q.translateLabel(e.detail);else if(typeof e=="object"&&e!=null&&e.detail!==!1&&n.item_detail!==!1){const y=n.item_detail||r,b=e[y],A=String(e[i]??"");typeof b=="string"&&(c.textContent=b.replace(`.${A}`,""))}a.append(c),t.append(a);const h=x.getNode("div",n.id?`${n.id}-${s}-figure`:!1,["figure"]);typeof e=="object"&&e?.variant&&h.classList.add("variant"),typeof e=="object"&&e?.warning&&(h.classList.add("warning"),t.setAttribute("data-warning","")),typeof e=="object"&&e?.color&&(h.classList.add("custom-color"),h.style.setProperty("--custom-color",e.color),t.style.setProperty("--custom-color",e.color),t.classList.add("has-custom-color"),e.colorHover!==!1?t.classList.add("custom-color-hover-text"):t.classList.add("custom-color-no-hover-text"));const u=typeof e=="object"&&e!=null?e.interest:void 0,d=this.#w(u),p=x.getNode("span",n.id?`${n.id}-${s}-bar`:!1,["bar"]);p.style.width=`${d}%`,h.append(p);const f=x.getNode("span",n.id?`${n.id}-${s}-figure-text`:!1,["text-container"]),_=x.getNode("span",n.id?`${n.id}-${s}-figure-label`:!1,["label"]),g=typeof e=="object"&&e?.label?q.translateLabel(e.label):"Score";_.textContent=g;const m=x.getNode("span",n.id?`${n.id}-${s}-figure-value`:!1,["value"]);typeof u=="number"?m.textContent=u.toFixed(3):u!=null&&(m.textContent=String(u)),f.append(_,m),h.append(f),t.append(h),this.#N(t,e)}#N(t,e){const s=typeof e=="object"&&e!=null?typeof e.style=="function"?e.style():e.style:null;Id(t,s)}#R(t,e){t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const s=t.target.closest("[data-value]");if(!s)return;const n=s.getAttribute("data-value"),i=n==="null"?null:n;if(this.__parameters__.multiple){Array.isArray(this.__value__)||(this.__value__=[]);const r=this.__value__.map(a=>String(a)).indexOf(String(i));r===-1?(this.__value__.push(String(i)),s.setAttribute("data-selected","selected")):(this.__value__.splice(r,1),s.removeAttribute("data-selected")),this.__parameters__.list&&this.__parameters__.key&&(this.__parameters__.list[this.__parameters__.key]=[...this.__value__])}else this.__options__.forEach(r=>r.removeAttribute("data-selected")),String(i)!==String(this.__value__)?(this.__value__=i==null?null:String(i),i!=null&&s.setAttribute("data-selected","selected")):this.__parameters__.nullable&&(this.__value__=null,s.removeAttribute("data-selected")),this.__parameters__.list&&this.__parameters__.key!=null&&(this.__parameters__.list[this.__parameters__.key]=this.__value__);typeof this.__parameters__.callbacks?.input=="function"&&this.__parameters__.callbacks.input(this.__value__,e),this.__elValue__&&this.#k(this.__elValue__),this.__parameters__.multiple||this.#S()}#M(t){return this.__parameters__.multiple?Array.isArray(this.__value__)&&this.__value__.some(e=>String(e)===String(t)):t==null?this.__value__==null||this.__value__==="":String(this.__value__)===String(t)}#k(t){const e=this.#Z(),s=q.translateLabel(this.#V());x.clear(t),e?.icon instanceof Node?(t.append(e.icon.cloneNode(!0)),t.classList.add("has-icon")):t.classList.remove("has-icon");const n=x.getNode("span",!1,[Vd]);n.textContent=s==null?"":String(s),this.#N(n,e),t.append(n)}#Z(){return this.#v().find(e=>{const s=this.#H(e);return s==null?this.__value__==null||this.__value__==="":String(s)===String(this.__value__)})}#V(){const t=this.#v();if(this.__parameters__.multiple){const s=Array.isArray(this.__value__)?this.__value__:[],n=s.map(r=>{const a=t.find(l=>String(this.#H(l))===String(r));return a==null?r:this.#I(a)}).filter((r,a)=>a<3),i=s.length>3?` (+${s.length-3})`:"";return n.join(", ")+i}const e=this.#Z();return e!=null?this.#I(e):this.__value__==null?"":String(this.__value__)}#H(t){if(typeof t!="object"||t==null)return t;const e=this.__parameters__.item_value||"value";return t[e]}#I(t){if(typeof t!="object"||t==null)return String(t);const e=this.__parameters__.item_text||"text",s=t[e];return s==null?"":String(s)}#O(t){this.#n&&document.removeEventListener("click",this.#n),this.#n=e=>{if(!t.classList.contains(me))return;const s=t.contains(e.target),n=this.__dropdownNode__?.contains(e.target)??!1;!s&&!n&&this.#S()},document.addEventListener("click",this.#n),J.#t||(J.#t=!0,document.addEventListener("click",e=>{const s=e.target.closest(`.${mo}`),n=e.target.closest(`.${yo}`);!s&&!n&&J.closeAllSelects()}))}#j(){const t=this.__parameters__,e=x.getNode("div",t.id?`${t.id}-container`:!1,[gi]);if(x.clear(e),t.label!=null){const l=x.getNode("label",t.id?`${t.id}-label`:!1,[go]);l.textContent=q.translateLabel(t.label,t.vars),e.append(l)}const s=x.getNode("div",t.id||!1,[Ie,jd]),n=this.#ct();n&&s.classList.add(Yd),this.#E(s),t.title&&s.setAttribute("title",q.translateLabel(t.title,t.vars));const i=x.getNode("div",t.id?`${t.id}-group`:!1,[Ud,"d-flex"]);x.clear(i);const r=t.disabled||t.readOnly,a=t.items||[];return n?this.#lt(i,a,r):this.#J(i,a,r),x.clear(s),s.append(i),s.setAttribute("data-value",this.#ft()),e.append(s),this.__node__=s,this.#q(),e}#lt(t,e,s){const n=this.__parameters__,i=[],r=[],a=this.#b(e);let l=0;a.forEach((c,h)=>{const u=c.items.length>1,d=[Kd];u&&d.push(Xd);const p=x.getNode("div",n.id?`${n.id}-segment-${h}`:!1,d);x.clear(p);let f=null;const _=[];u&&(f=x.getNode("span",n.id?`${n.id}-segment-${h}-indicator`:!1,[Zd]),p.append(f)),c.items.forEach(g=>{const m=this.#tt(g,l,s,!0);i.push(m),_.push(m),p.append(m.node),l+=1}),u&&r.push({segmentNode:p,indicatorNode:f,entries:_}),t.append(p)}),this.__nodes__.buttonGroupButtons=i,this.__nodes__.buttonGroupSegments=r}#J(t,e,s){const n=[];e.forEach((i,r)=>{const a=this.#tt(i,r,s,!1);n.push(a),t.append(a.node)}),this.__nodes__.buttonGroupButtons=n,this.__nodes__.buttonGroupSegments=[]}#tt(t,e,s,n){const i=typeof t=="object"&&t!=null?t:{value:t,text:t},r=i.value,a=this.#U(r),l=i.disabled||i.lock||s,c=i.icon!=null?this.#ht(i.icon):void 0,h=new vt({id:`${this.__parameters__.id}-btn-${e}`,text:i.text,icon:c,title:i.title||i.text,disabled:l,classList:["transparent","p-0",...n?[]:["mr-1"],...a?["active"]:[]],callbacks:l?void 0:{click:d=>{d.stopPropagation(),d.stopImmediatePropagation(),this.#W(r,d)}}}),u=h.render();return u.setAttribute("data-value",String(r)),{value:r,node:u,instance:h,itemDisabled:!!(i.disabled||i.lock)}}#W(t,e=null){if(!(this.__parameters__.disabled||this.__parameters__.readOnly||this.__buttonGroupLocked__)){if(this.__parameters__.multiple&&this.__parameters__.multipleCtrlToggle){this.#it(t,e);return}if(this.__parameters__.multiple&&this.#ot()){this.#st(t,e);return}if(this.__parameters__.multiple){this.#Q(t);return}this.#P(t)}}#it(t,e=null){const s=e&&(e.ctrlKey||e.metaKey)?"toggle":"switch";let n;typeof this.__parameters__.callbacks?.input=="function"&&(n=this.__parameters__.callbacks.input(t,{mode:s,itemValue:t})),this.#dt(n)}#st(t,e=null){const s=this.#rt(t,e);s.changed&&(this.__value__=s.value,this.#et({clickedValue:t,mode:e&&(e.ctrlKey||e.metaKey)?"toggle":"switch"}))}#Q(t){const e=String(t),s=this.#U(t),n=Array.isArray(this.__value__)?[...this.__value__]:[];if(s){const i=n.length<=1;if(!this.__parameters__.nullable&&i)return;this.__value__=n.filter(a=>String(a)!==e)}else this.__value__=[...n,e];this.#et()}#P(t){if(this.#U(t)){if(!this.__parameters__.nullable)return;this.__value__=null}else this.__value__=String(t);this.#et()}#et(t=null){this.#q(),this.__node__&&this.__node__.setAttribute("data-value",this.#ft());let e;typeof this.__parameters__.callbacks?.input=="function"&&(e=t?this.__parameters__.callbacks.input(this.__value__,t):this.__parameters__.callbacks.input(this.__value__)),this.#nt(),this.#dt(e)}#rt(t,e=null){const s=String(t),n=this.#Y(t),i=n?.group?String(n.group):null,r=Array.isArray(this.__value__)?this.__value__.map(d=>String(d)):[];if(!this.#ot()||!i){if(r.indexOf(s)!==-1){const p=r.length<=1;return!this.__parameters__.nullable&&p?{changed:!1,value:r}:{changed:!0,value:r.filter(_=>_!==s)}}return{changed:!0,value:[...r,s]}}const a=this.#K(i);if(!!(e&&(e.ctrlKey||e.metaKey)))return r.indexOf(s)!==-1?!this.__parameters__.nullable&&r.length<=1?{changed:!1,value:r}:{changed:!0,value:r.filter(d=>d!==s)}:{changed:!0,value:this.#z(r,a,s)};const c=this.#ut(r,a,s),h=r.filter(d=>a.indexOf(d)!==-1);if(h.length===1&&h[0]===s&&c.join("|")===r.join("|")){const d=r.length<=1;return!this.__parameters__.nullable&&d?{changed:!1,value:r}:{changed:!0,value:r.filter(f=>f!==s)}}return{changed:!0,value:c}}#ut(t,e,s){const n={};e.forEach(l=>{n[String(l)]=!0});const i=String(s),r=t.findIndex(l=>Object.prototype.hasOwnProperty.call(n,String(l)));if(r<0)return[...t,i];const a=t.filter(l=>!Object.prototype.hasOwnProperty.call(n,String(l)));return a.splice(r,0,i),a}#z(t,e,s){const n={};e.forEach(l=>{n[String(l)]=!0});const i=String(s),r=t.reduce((l,c,h)=>Object.prototype.hasOwnProperty.call(n,String(c))?h:l,-1);if(r<0)return[...t,i];const a=[...t];return a.splice(r+1,0,i),a}#U(t){const e=String(t);return this.__parameters__.multiple?Array.isArray(this.__value__)&&this.__value__.some(s=>String(s)===e):this.__value__!=null&&String(this.__value__)===e}#at(){return(this.__parameters__.items||[]).some(t=>typeof t=="object"&&t?.group)}#ct(){return!!this.__parameters__.subgroupSwitch&&this.#at()}#ot(){return!this.__parameters__.multiple||!this.__parameters__.subgroupSwitch?!1:this.#at()}#Y(t){const e=this.__parameters__.item_value||"value";return(this.__parameters__.items||[]).find(s=>typeof s!="object"?String(s)===String(t):String(s[e])===String(t))}#K(t){const e=this.__parameters__.item_value||"value";return(this.__parameters__.items||[]).filter(s=>typeof s=="object"&&String(s.group)===String(t)).map(s=>String(s[e]))}#b(t){const e=[];return(t||[]).forEach(s=>{const n=typeof s=="object"&&s?.group?String(s.group):null,i=e[e.length-1];if(n&&i?.group===n){i.items.push(s);return}e.push({group:n,items:[s]})}),e}#ht(t){return t instanceof Node?t.cloneNode(!0):t}#nt(){if(this.__parameters__.list){this.__parameters__.list[this.#a()]=this.__value__;return}this.__parameters__.value=this.__value__}#q(){this.__nodes__.buttonGroupButtons&&(this.__nodes__.buttonGroupButtons.forEach(t=>{t.node.classList.toggle("active",this.#U(t.value)),t.node.classList.toggle(Qd,this.__buttonGroupCurrentValue__!=null&&String(t.value)===String(this.__buttonGroupCurrentValue__))}),this.#gt())}#gt(){const t=this.__nodes__.buttonGroupSegments;t?.length&&t.forEach(e=>{const{segmentNode:s,entries:n}=e;if(!s||!n?.length)return;n.forEach(r=>{r.node.classList.remove("plotter-input-button-group-segment-selected")});const i=n.filter(r=>r.node.classList.contains("active"));s.classList.toggle("plotter-input-button-group-segment-multi-active",i.length>1),i.forEach(r=>{r.node.classList.add("plotter-input-button-group-segment-selected")})})}#ft(){return this.__parameters__.multiple?JSON.stringify(this.__value__??[]):this.__value__==null?"":String(this.__value__)}#_t(t){this.__buttonGroupLocked__=t;const e=t||this.__parameters__.disabled||this.__parameters__.readOnly;this.__node__&&this.__node__.classList.toggle(zs,e),this.__nodes__.buttonGroupButtons&&this.__nodes__.buttonGroupButtons.forEach(s=>{const n=e||s.itemDisabled;s.node.classList.toggle("disabled",n),n?s.node.setAttribute("disabled","disabled"):s.node.removeAttribute("disabled")})}#dt(t){t==null||typeof t.then!="function"||(this.#_t(!0),t.finally(()=>{this.#_t(!1)}))}}const bo="datama-help-tooltip",ip="datama-help-tooltip-popup",Ao="data-tooltip",Lo="aria-description",yi="__plotterHelpTooltipHandlers",rp=320,$s=12,Ws=8,ap="[data-datama-overlays]";class lt{static#t=new WeakMap;static#e=null;static#s=null;static attach(t,e){if(!t||typeof e!="string"||!e)return t;lt.detach(t),t.classList.add(bo),t.setAttribute(Ao,e),t.removeAttribute("title");const s=t.getAttribute("aria-label")!==e;s&&t.setAttribute(Lo,e);const n=r=>{lt.#i(t,e,r)},i=()=>{lt.#a(t)};return t.addEventListener("mouseenter",n),t.addEventListener("mousemove",n),t.addEventListener("mouseleave",i),t.addEventListener("focusin",n),t.addEventListener("focusout",i),t.addEventListener("mousedown",i,!0),t.addEventListener("click",i,!0),t[yi]={handleShow:n,handleHide:i,ownsDescription:s},t}static detach(t){if(!t)return t;const e=t[yi];return e&&(t.removeEventListener("mouseenter",e.handleShow),t.removeEventListener("mousemove",e.handleShow),t.removeEventListener("mouseleave",e.handleHide),t.removeEventListener("focusin",e.handleShow),t.removeEventListener("focusout",e.handleHide),t.removeEventListener("mousedown",e.handleHide,!0),t.removeEventListener("click",e.handleHide,!0),e.ownsDescription&&t.removeAttribute(Lo),delete t[yi]),lt.#e===t&<.#a(t),t.classList.remove(bo),t.removeAttribute(Ao),t}static#n(t){const e=t.closest('[data-app="true"]');if(e instanceof HTMLElement){const n=e.querySelector(ap);return n instanceof HTMLElement?n:e}const s=t.closest(".plotter");return s instanceof HTMLElement?s:document.body}static#r(t){const e=lt.#n(t);let s=lt.#t.get(e);return s?.isConnected||(s=document.createElement("div"),s.className=ip,s.setAttribute("role","tooltip"),s.style.maxWidth=`${rp}px`,s.style.position="absolute",e.appendChild(s),lt.#t.set(e,s)),s}static#i(t,e,s){const n=lt.#n(t),i=lt.#r(t);i.textContent!==e&&(i.textContent=e),lt.#e=t,lt.#l(n);let r,a;const l=typeof s?.clientX=="number"&&typeof s?.clientY=="number",c=s?.type==="mousemove"||s?.type==="mouseenter";if(l&&(s.clientX!==0||s.clientY!==0||c))r=s.clientX,a=s.clientY;else{const y=t.getBoundingClientRect();r=y.left+y.width/2,a=y.bottom}i.classList.add("is-visible");const h=n.getBoundingClientRect(),u=n.scrollTop||0,d=n.scrollLeft||0,p=i.getBoundingClientRect(),f=h.width,_=h.height;let g=r-h.left+d+$s,m=a-h.top+u+$s;g+p.width>f-Ws&&(g=r-h.left+d-p.width-$s),m+p.height>_-Ws&&(m=a-h.top+u-p.height-$s),g=Math.max(Ws,g),m=Math.max(Ws,m),i.style.left=`${g}px`,i.style.top=`${m}px`}static#a(t){if(lt.#e!==t)return;lt.#e=null,lt.#s?.disconnect(),lt.#s=null;const e=t?lt.#n(t):null,s=e?lt.#t.get(e):null;s&&(s.classList.remove("is-visible"),s.textContent="")}static#l(t){lt.#s||typeof MutationObserver!="function"||(lt.#s=new MutationObserver(()=>{const e=lt.#e;e&&!e.isConnected&<.#a(e)}),lt.#s.observe(t,{childList:!0,subtree:!0}))}}const op="plotter-fieldset-wrapper",lp="plotter-fieldset-wrapper-inline",cp="plotter-fieldset",hp="plotter-fieldset-inline",up="plotter-fieldset-container",dp="plotter-fieldset-row",To="plotter-fieldset-left",pp="plotter-fieldset-right",fp="plotter-fieldset-label-container",_p="plotter-fieldset-label",gp="plotter-fieldset-legend-container",mp="plotter-fieldset-legend",yp="plotter-fieldset-title-container",bp="plotter-fieldset-title",Ap="plotter-fieldset-pin",Lp=14,Tp="Pin as shortcut: show this setting on the plot to play live with it";class bi extends ht{static is(t){return q.isFieldSet(t)}#t=[];render(){const t=this.__parameters__||{},e=t.id?`${t.id}-wrapper`:!1,s=typeof e=="string"?document.getElementById(e):null,n=s?.parentNode||null,i=s?.nextSibling||null;s?.remove();const r=t.layout==="inline",a=[op,...r?[lp]:[],...(t.wrapper?.classList||[]).filter(d=>d)],l=x.getNode("div",e,a,null,t.wrapper?.props||{});if(x.clear(l),t.title&&l.append(this.#s()),t.legend){const d=this.#n();d&&l.append(d)}const c=[cp,...r?[hp]:[],...(t.classList||[]).filter(d=>d)],h=x.getNode("div",t.id||!1,c,t.target||null,t.props||{});x.clear(h);const u=x.getNode("div",t.id?`${t.id}-container`:!1,[up]);return x.clear(u),this.#t=(t.fields||[]).map((d,p)=>{const f=this.#i(d,p);return u.append(f),{field:d,row:f}}),this.syncFieldVisibility(),h.append(u),l.append(h),this.__node__=l,n&&l.parentNode!==n&&n.insertBefore(l,i),l}syncFieldVisibility(){this.#t.forEach(({field:t,row:e})=>{e.style.display=typeof t.visible=="function"&&!t.visible()?"none":""})}#e(t){return t?.label==null?!1:typeof t.label=="string"?t.label.trim().length>0:!0}#s(){const t=this.__parameters__,e=t.title,s=typeof e=="object"&&e?.classList?e.classList.filter(r=>r):[],n=x.getNode("div",t.id?`${t.id}-title-container`:!1,[yp,...s],null,typeof e=="object"?e.props||{}:{});x.clear(n);const i=x.getNode("h3",t.id?`${t.id}-title`:!1,[bp]);return x.clear(i),this.#r(i,e),n.append(i),n}#n(){const t=this.__parameters__,e=t.legend,s=typeof e=="object"&&e?.classList?e.classList.filter(a=>a):[],n=x.getNode("div",t.id?`${t.id}-legend-container`:!1,[gp,...s],null,typeof e=="object"&&!(e instanceof HTMLElement)?e.props||{}:{});x.clear(n);const i=x.getNode("div",t.id?`${t.id}-legend`:!1,[mp]);return x.clear(i),this.#r(i,e)?(n.append(i),this.__nodes__.legend=i,n):null}#r(t,e){return typeof e=="string"?(t.textContent=q.translateLabel(e),!0):typeof e=="function"?this.#r(t,e()):e instanceof HTMLElement?(t.append(e),!0):e&&typeof e=="object"&&e.text?(t.textContent=q.translateLabel(e.text),!0):!1}#i(t,e){const s=this.__parameters__,n=s.id?`${s.id}-${e}-row`:!1,i=x.getNode("div",n,[dp]);x.clear(i);const r=this.#e(t);if(r){const l=x.getNode("div",s.id?`${s.id}-${e}-row-left`:!1,[To]);x.clear(l);const c=x.getNode("div",s.id?`${s.id}-${e}-row-label-container`:!1,[fp]);x.clear(c);const h=x.getNode("label",s.id?`${s.id}-${e}-row-label`:!1,[_p]);if(x.clear(h),h.textContent=q.translateLabel(t.label,t.vars),t.description){const u=q.translateLabel(t.description,t.vars);typeof u=="string"&&u&<.attach(c,u)}c.append(h),l.append(c),i.append(l)}const a=x.getNode("div",s.id?`${s.id}-${e}-row-right`:!1,[r?pp:To]);return x.clear(a),this.#a(a,t.input),t.pin&&a.append(this.#l(t,e)),i.append(a),i}#a(t,e){if(e){if(ht.isRenderable(e)){t.append(e.render());return}e instanceof HTMLElement&&t.append(e)}}#l(t,e){const s=this.__parameters__,n=()=>typeof t.pin.pinned=="function"?!!t.pin.pinned():!!t.pin.pinned,i=s.id?`${s.id}-${e}-row-pin`:!1,r=x.getNode("button",i,[Ap]);r.type="button",r.title=q.translateLabel(t.pin.title||Tp);const a=D.get("bookmark-svg",{size:Lp});a&&r.append(a);const l=()=>r.classList.toggle("active",n());return r.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),typeof t.pin.callback=="function"&&t.pin.callback(!n()),l()}),l(),r}}const Ep="plotter-ui-panel",Gs="plotter-ui-panel-close",xp="plotter-ui-panel-header-container",Sp="plotter-ui-panel-header-icon",vp="plotter-ui-panel-header",Cp="plotter-ui-panel-header-caret",wp="datama-panel-header-caret",Rp="plotter-ui-panel-header-trailing-actions",kp="datama-panel-header-trailing-actions",Np="plotter-ui-panel-content",js="allow-overflow",Mp=300,Ip=20,Op=14;class wt extends ht{static is(t){return q.isUiPanel(t)}__state__=!1;#t=null;#e=null;#s=null;render({parent:t,id:e}={}){const s=this.__parameters__||{},n=e||s.id||!1;this.#e=t||null,this.#s=typeof n=="string"?n:null;const i=x.getNode("div",n,[Ep]);x.clear(i);const r=!!s.open;return r?i.classList.remove(Gs):i.classList.add(Gs),this.__node__=i,i.append(this.#n(n),this.#l(n)),this.__state__=r,r?this.__nodes__.content?.classList.add(js):this.__nodes__.content?.classList.remove(js),i}open({scroll:t=!0}={}){this.__node__&&(this.__node__.classList.remove(Gs),setTimeout(()=>{this.__nodes__.content?.classList.add(js)},Mp),t&&this.#p(),this.__state__=!0)}close(){this.__nodes__.content?.classList.remove(js),this.__node__?.classList.add(Gs),this.__state__=!1}#n(t){const e=this.__parameters__,s=(e.classList||[]).filter(c=>c),n=x.getNode(e.tag||"div",t?`${t}-header-container`:!1,[xp,...s]);x.clear(n);const i=this.#a(e.icon);if(i){const c=x.getNode("div",t?`${t}-header-icon`:!1,[Sp]);x.clear(c),c.append(i),n.append(c)}const r=typeof e.title=="object"&&e.title!=null?e.title:null,a=[vp,...(r?.classList||[]).filter(c=>c)],l=x.getNode(r?.tag||"div",t?`${t}-header`:!1,a);if(l.textContent=q.translateLabel(r?.text||e.title),n.append(l),e.headerActions instanceof Node){const c=x.getNode("span",t?`${t}-header-actions`:!1,["datama-panel-header-actions","plotter-ui-panel-header-actions"]);x.clear(c),c.addEventListener("click",h=>{h.stopPropagation()}),c.append(e.headerActions),n.append(c)}if(n.append(this.#r(t)),e.headerTrailingActions instanceof Node){const c=x.getNode("span",t?`${t}-header-trailing-actions`:!1,[kp,Rp]);x.clear(c),c.addEventListener("click",h=>{h.stopPropagation()}),c.append(e.headerTrailingActions),n.append(c)}return this.#t||(this.#t=c=>this.#i(c)),n.removeEventListener("click",this.#t),n.addEventListener("click",this.#t),this.__nodes__.header=n,n}#r(t){const e=x.getNode("span",t?`${t}-header-caret`:!1,[wp,Cp]);x.clear(e),e.setAttribute("aria-hidden","true");const s=D.get("chevron-down-svg",{size:Op});return s&&e.append(s),e}#i(t){if(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.#e&&typeof this.#e.toggle=="function"&&this.#s){this.#e.toggle(this.#s);return}if(this.__state__){this.close();return}this.open({scroll:!1})}#a(t){return t instanceof HTMLElement||t instanceof SVGElement?t:typeof t=="string"&&t?D.get(t):null}#l(t){const e=x.getNode("div",t?`${t}-content`:!1,[Np]);return x.clear(e),(this.__parameters__.contents||[]).forEach(s=>{this.#h(e,s)}),this.__nodes__.content=e,e}#h(t,e){if(e!=null){if(typeof e=="string"){const s=document.createElement("div");s.textContent=q.translateLabel(e),t.append(s);return}if(e instanceof HTMLElement){t.append(e);return}if(ht.isRenderable(e)){const s=q.isUiPanel(e)&&this.#e?e.render({parent:this.#e,id:e.__parameters__?.id}):e.render();s instanceof HTMLElement&&t.append(s)}}}#p(){if(!this.__node__)return;const t=this.#y(this.__node__);if(!t)return;const e=this.__node__.getBoundingClientRect(),s=t.getBoundingClientRect(),n=t.scrollTop+(e.top-s.top)-Ip;t.scrollTo({top:Math.max(0,n),behavior:"smooth"})}#y(t){let e=t.parentElement;for(;e&&e!==document.body;){const s=window.getComputedStyle(e),n=s.overflow+s.overflowY+s.overflowX,i=n.indexOf("scroll")!==-1||n.indexOf("auto")!==-1,r=e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;if(i&&r)return e;e=e.parentElement}return document.documentElement.scrollHeight>window.innerHeight?document.documentElement:null}}const Pp="plotter-ui-panels",Dp="plotter-ui-panels-list",Fp="plotter-ui-panels-search",Hp="plotter-ui-panels-search-field",Bp="plotter-ui-panels-search-icon",Eo="plotter-ui-panels-searching",bt="plotter-ui-panel-search-hidden",zp="plotter-ui-panels-search-empty",Vp="plotter-ui-panels-search--sticky",$p="plotter-ui-panels-search-clear",xo=".plotter-fieldset-wrapper, .datama-fieldset-wrapper",So=".plotter-fieldset, .datama-fieldset",Ai=".plotter-fieldset-legend, .datama-fieldset-legend",Wp=".plotter-fieldset-row, .datama-fieldset-row",vo=".plotter-fieldset-label, .datama-fieldset-label",Gp=".plotter-input-container, .datama-input-container",Li=".plotter-ui-panel-header, .datama-panel-header",Co=[Ai,vo,Li,"legend","label","h1","h2","h3","h4","h5","h6","[aria-label]","[placeholder]","[data-search-text]",'[class*="-label"]','[class*="-legend"]','[class*="-title"]','[class*="-heading"]'].join(", "),wo="injected-dom",jp="plotter-ui-panels-scope-section",Up="plotter-ui-panels-scope-section--solo",Yp="plotter-ui-panels-scope-heading",Kp="plotter-ui-panels-scope-heading-icon",Xp="plotter-ui-panels-scope-title",Zp=" › ",Qp="Search settings...",qp="No settings found";function Ro(o){return!!(o?.classList.contains("plotter-fieldset-wrapper")||o?.classList.contains("datama-fieldset-wrapper"))}function ko(o){return!!(o?.classList.contains("plotter-fieldset")||o?.classList.contains("datama-fieldset"))}function Jp(o){return!!(o?.classList.contains("plotter-fieldset-row")||o?.classList.contains("datama-fieldset-row"))}class Oe extends ht{static is(t){return q.isUiPanels(t)}__searchQuery__="";__searchInputNode__=null;__searchEmptyNode__=null;__panelStateSnapshot__=null;__searchIndex__=[];#t=null;#e=null;render(){const t=this.__parameters__||{},e=x.getNode("div",t.id||!1,[Pp,"mb-2"]);x.clear(e);let s=e;if(t.searchable&&(e.append(this.#T()),s=x.getNode("div",t.id?`${t.id}-panels-list`:!1,[Dp]),x.clear(s),e.append(s)),this.#s())this.__searchIndex__=this.#i(t.sections),t.sections.forEach(n=>{s.append(this.#h(n))});else{const n=t.panels||[];this.__searchIndex__=this.#c(n),n.forEach((i,r)=>{s.append(this.#L(i,r))})}return this.__node__=e,t.searchable&&(this.#C(),this.#u()),e}toggle(t){if(this.__searchQuery__)return;const e=this.#j();let s=!1;e.forEach((n,i)=>{if(t===this.#y(n,i)){if(n.__state__){s=!0,n.close();return}n.open()}}),!s&&!this.__parameters__.multiple&&e.forEach((n,i)=>{t!==this.#y(n,i)&&n.close()})}focusSearch(){return!this.__parameters__.searchable||!this.__searchInputNode__?!1:(this.__searchInputNode__.focus({preventScroll:!0}),!0)}open(t){if(this.#s()&&!t)return;const e=this.#j();if(!t){e.forEach(s=>s.open?.());return}e.forEach((s,n)=>{if(t===this.#y(s,n)){s.open?.();return}this.__parameters__.multiple||s.close?.()})}openSection(t,{scroll:e=!1}={}){if(!this.#s()||!t)return!1;const s=(this.__parameters__.sections||[]).find(i=>i?.anchorId===t);return s?((s.groups?.__parameters__?.panels||[]).forEach(i=>{if(typeof i?.open=="function"&&!i.__parameters__?.panels){i.open({scroll:e});return}(i?.__parameters__?.panels||[]).forEach(r=>{r.open?.({scroll:e})})}),!0):!1}close(t=!1){const e=this.#j();if(!t){e.forEach(s=>s.close?.());return}e.forEach((s,n)=>{t===this.#y(s,n)&&s.close()})}#s(){return Array.isArray(this.__parameters__.sections)&&this.__parameters__.sections.length>0}#n(t){const e=t?.title;return typeof e=="string"?q.translateLabel(e):String(e??"")}#r(){const t=[];return(this.__parameters__.sections||[]).forEach(e=>{const s=e?.groups?.__parameters__?.panels||[];t.push(...this.#O(s))}),t}#i(t){const e=[];return(t||[]).forEach(s=>{const n=this.#n(s);e.push({type:"section",section:s,path:[n],text:n});const i=s?.groups;i?.__parameters__?.panels&&e.push(...this.#c(i.__parameters__.panels,[n],null))}),e}#a(t){return t?.groups?.__parameters__?.panels?.length??0}#l(t){return this.#a(t)<=1}#h(t){const e=[jp],s=this.#l(t);s&&e.push(Up);const n=x.getNode("section",t.anchorId||!1,e);if(x.clear(n),!s){const i=x.getNode("div",t.anchorId?`${t.anchorId}-heading`:!1,[Yp]);if(x.clear(i),t.icon){const a=x.getNode("span",t.anchorId?`${t.anchorId}-icon`:!1,[Kp]);x.clear(a),this.#p(a,t.icon),i.append(a)}const r=x.getNode("span",t.anchorId?`${t.anchorId}-title`:!1,[Xp]);if(r.textContent=this.#n(t),i.append(r),t.headerActions instanceof Node){const a=x.getNode("span",t.anchorId?`${t.anchorId}-actions`:!1,["datama-panel-header-actions","plotter-ui-panels-scope-heading-actions"]);a.append(t.headerActions),i.append(a)}n.append(i)}return t.groups&&n.append(t.groups.render()),t.__node__=n,n}#p(t,e){if(typeof e=="string"){const s=D.get(e);s&&t.append(s);return}e instanceof Node&&t.append(e)}#y(t,e){return t.__parameters__?.anchorId||`${this.__parameters__.id}-panel-${e}`}#L(t,e){const s=this.#y(t,e);let n;return t.__parameters__?.panels||t.__parameters__?.sections?n=t.render():n=t.render({parent:this,id:s}),n}#T(){const t=`${this.__parameters__.id}-search`,e=this.__parameters__.searchPlaceholder||Qp,s=[Fp];this.__parameters__.stickySearch&&s.push(Vp);const n=x.getNode("div",t,s);x.clear(n);const i=x.getNode("div",`${t}-field`,[Hp]);x.clear(i);const r=x.getNode("span",`${t}-icon`,[Bp]);x.clear(r);const a=D.get("search-svg",{size:16,className:"plotter-icon"});a&&r.append(a);const l=x.getNode("input",`${t}-input`,[],null,{type:"text",placeholder:q.translateLabel(e),autocomplete:"off",spellcheck:"false"}),c=x.getNode("button",`${t}-clear`,[$p]);c.textContent="×",c.style.display="none",i.append(r,l,c);const h=this.__parameters__.searchActions;if(h){const u=typeof h=="function"?h():h;u instanceof Node&&i.append(u)}return n.append(i),this.__searchInputNode__=l,this.__searchEmptyNode__=x.getNode("div",`${t}-empty`,[zp]),this.__searchEmptyNode__.textContent=q.translateLabel(qp),this.__searchEmptyNode__.style.display="none",n.append(this.__searchEmptyNode__),n}#u(){if(!this.__searchInputNode__)return;const t=this.__node__?.querySelector(`#${this.__parameters__.id}-search-clear`);this.#t||(this.#t=e=>{const s=e.target.value||"";t&&(t.style.display=s?"flex":"none"),this.#v(s)}),this.#e||(this.#e=e=>{e.preventDefault(),e.stopPropagation(),this.__searchInputNode__.value="",t&&(t.style.display="none"),this.#v(""),this.__searchInputNode__.focus()}),this.__searchInputNode__.removeEventListener("input",this.#t),this.__searchInputNode__.addEventListener("input",this.#t),this.__searchInputNode__.addEventListener("keydown",e=>e.stopPropagation()),this.__searchInputNode__.addEventListener("click",e=>e.stopPropagation()),t?.removeEventListener("click",this.#e),t?.addEventListener("click",this.#e)}#c(t,e=[],s=null){const n=[];return(t||[]).forEach(i=>{if(i?.__parameters__?.panels){n.push(...this.#c(i.__parameters__.panels,e,s));return}const r=this.#f(i),a=r?[...e,r]:[...e],l=s||i;n.push({type:"panel",panel:i,topLevelPanel:l,path:a,text:r}),(i.__parameters__?.contents||[]).forEach(h=>{n.push(...this.#m(h,a,i,l))})}),n}#m(t,e,s,n){const i=[];if(!t)return i;if(Array.isArray(t))return t.forEach(h=>{i.push(...this.#m(h,e,s,n))}),i;if(t.__parameters__?.panels)return i.push(...this.#c(t.__parameters__.panels,e,n)),i;if(t.__parameters__?.title!==void 0){const h=this.#f(t),u=[...e,h];return i.push({type:"panel",panel:t,topLevelPanel:n,path:u,text:h}),(t.__parameters__?.contents||[]).forEach(d=>{i.push(...this.#m(d,u,t,n))}),i}if(t.__parameters__?.fields){const h=this.#x(t.__parameters__.legend);return h&&i.push({type:"fieldset",panel:s,topLevelPanel:n,path:[...e,h],text:h}),t.__parameters__.fields.forEach(u=>{const d=this.#x(u.label),p=this.#x(u.description),f=u.input?.__parameters__?.id||u.input?.id,_=d?[...e,d]:[...e];i.push({type:"field",panel:s,topLevelPanel:n,path:_,text:`${d} ${p}`.trim(),inputId:f})}),i}if(typeof t=="string"){const h=this.#x(t);return h&&i.push({type:"field",panel:s,topLevelPanel:n,path:[...e,h],text:h}),i}if(t instanceof Node)return i.push(...this.#A(t,e,s,n)),i;const r=this.#x(t.__parameters__?.label||t.label),a=this.#o(t),l=t.__parameters__?.id||t.id,c=`${r} ${a}`.trim();return(c||l)&&i.push({type:"field",panel:s,topLevelPanel:n,path:r?[...e,r]:c?[...e,c]:[...e],text:c,inputId:l}),t.__node__ instanceof Node&&i.push(...this.#A(t.__node__,e,s,n)),i}#o(t){const e=t?.__parameters__||{};return[this.#x(e.legend),this.#x(e.description),this.#x(e.placeholder),this.#x(e.documentation?.title),this.#x(e.name)].filter(Boolean).join(" ")}#A(t,e,s,n,i=[]){const r=[],a=new Set;return this.#E(t,i,s).forEach(l=>{const c=l.toLowerCase();a.has(c)||(a.add(c),r.push({type:"field",source:wo,panel:s,topLevelPanel:n,path:[...e,l],text:l}))}),r}#E(t,e=[],s=null){const n=[];if(!(t instanceof Node))return n;if(t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){const a=(t.textContent||"").trim();return a?[a]:n}const i=t;if(typeof i.querySelectorAll!="function")return n;const r=[];return i.nodeType===Node.ELEMENT_NODE&&i.matches?.(Co)&&r.push(i),r.push(...i.querySelectorAll(Co)),r.forEach(a=>{this.#_(a,e,s)||a.closest?.("svg")||this.#d(a,n)}),n}#d(t,e){[(t.textContent||"").replace(/\s+/g," ").trim(),(t.getAttribute?.("aria-label")||"").trim(),(t.getAttribute?.("placeholder")||"").trim(),(t.getAttribute?.("data-search-text")||"").trim(),(t.getAttribute?.("title")||"").trim()].forEach(n=>{n&&e.push(n)})}#_(t,e,s){return s?.__node__?(e||[]).some(n=>n===s||!n.__node__?!1:n.__node__.contains(t)&&s.__node__.contains(n.__node__)):!1}#C(){this.__searchIndex__=(this.__searchIndex__||[]).filter(e=>e.source!==wo);const t=this.#j();t.forEach(e=>{const s=e.__nodes__?.content||e.__node__;if(!(s instanceof Node))return;const n=this.#g(e),i=this.#S(e),r=this.#f(e),a=[i,r].filter(Boolean);this.__searchIndex__.push(...this.#A(s,a,e,n,t))})}#S(t){if(!this.#s())return"";const e=(this.__parameters__.sections||[]).find(s=>(s.groups?.__parameters__?.panels||[]).some(i=>i===t||this.#O([i]).includes(t)));return e?this.#n(e):""}#g(t){if(this.#s()){for(const e of this.__parameters__.sections||[]){const s=e.groups?.__parameters__?.panels||[];for(const n of s)if(n===t||this.#O([n]).includes(t))return n}return t}for(const e of this.__parameters__.panels||[]){if(e===t)return e;if(e.__parameters__?.panels){const s=(e.__parameters__.panels||[]).find(n=>n===t||this.#O([n]).includes(t));if(s)return s}if(this.#O([e]).includes(t))return e}return t}#f(t){const e=t?.__parameters__?.title;return e?typeof e=="string"?q.translateLabel(e):e.text||"":""}#x(t){return t==null?"":typeof t=="function"?this.#x(t()):typeof t=="string"?q.translateLabel(t):typeof t=="object"&&t.text?String(t.text):String(t)}#v(t){const e=t.toLowerCase().trim();if(this.__searchQuery__=e,this.__node__?.classList.toggle(Eo,e.length>0),!e){this.#V();return}this.#C(),this.__panelStateSnapshot__||this.#k();const s=this.__searchIndex__.filter(i=>{const r=i.path.join(" ").toLowerCase(),a=(i.text||"").toLowerCase();return r.indexOf(e)!==-1||a.indexOf(e)!==-1});if(this.#s()){this.#D(e,s),this.#H(s.length===0);return}const n=this.#$(s);(this.__parameters__.panels||[]).forEach(i=>{this.#F(i,e,s,n)}),this.#H(s.length===0)}#D(t,e){const s=this.#$(e);this.__parameters__.sections.forEach(n=>{const r=this.#n(n).toLowerCase().indexOf(t)!==-1,a=n.groups?.__parameters__?.panels||[],l=a.some(h=>s.has(h)),c=r||l;n.__node__?.classList.toggle(bt,!c),c&&a.forEach(h=>{if(r){h.__node__?.classList.remove(bt),h.open?.(),this.#N(h),this.#I(h.__parameters__?.contents||[]).forEach(u=>{u.__node__?.classList.remove(bt),this.#N(u)});return}this.#F(h,t,e,s)})})}#B(t,e,s){t.open?.();const n=s.filter(l=>l.topLevelPanel===t||l.panel===t),i=this.#w(n,t);i?.path?.length>1&&this.#R(t,i.path),n.some(l=>l.type==="field"||l.type==="fieldset")?this.#G(t,e,n):this.#N(t),this.#I(t.__parameters__?.contents||[]).forEach(l=>{const c=s.filter(p=>p.panel===l),h=c.length>0;if(l.__node__?.classList.toggle(bt,!h),!h)return;l.open?.();const u=this.#w(c,l);u?.path?.length>1&&this.#R(l,u.path),c.some(p=>p.type==="field"||p.type==="fieldset")?this.#G(l,e,c):this.#N(l)})}#$(t){const e=new Set;return t.forEach(s=>{s.topLevelPanel&&e.add(s.topLevelPanel)}),e}#F(t,e,s,n){if(t.__parameters__?.panels){const r=t.__parameters__.panels.some(a=>n.has(a));t.__node__?.classList.toggle(bt,!r),r&&t.__parameters__.panels.forEach(a=>{this.#B(a,e,s)});return}const i=n.has(t);t.__node__?.classList.toggle(bt,!i),i&&this.#B(t,e,s)}#w(t,e){return t.filter(s=>s.panel===e).reduce((s,n)=>!s||n.path.length>s.path.length?n:s,null)}#G(t,e,s){if(!t.__node__)return;const n=new Set(s.filter(a=>a.inputId).map(a=>a.inputId)),i=t.__node__.querySelectorAll(xo);(i.length?i:t.__node__.querySelectorAll(So)).forEach(a=>{const c=Ro(a)?a:a.closest(xo),h=c?.querySelector(So)||(ko(a)?a:null);if(!h)return;const p=((c?.querySelector(Ai)||h.querySelector(Ai))?.textContent||"").toLowerCase().indexOf(e)!==-1;let f=!1;h.querySelectorAll(Wp).forEach(g=>{let m=p;if(!m){const y=(g.querySelector(vo)?.textContent||"").toLowerCase(),b=g.querySelector(Gp),A=b?.id?b.id.replace(/-container$/,""):"";m=y.indexOf(e)!==-1||A&&n.has(A)}g.classList.toggle(bt,!m),m&&(f=!0)});const _=f||p;c?c.classList.toggle(bt,!_):h.classList.toggle(bt,!_)})}#N(t){t.__node__?.querySelectorAll(`.${bt}`).forEach(e=>{(Ro(e)||ko(e)||Jp(e))&&e.classList.remove(bt)})}#R(t,e){const s=t.__nodes__?.header?.querySelector(Li);if(!s||!e.length)return;s.dataset.originalTitle||(s.dataset.originalTitle=s.textContent);const n=this.__parameters__.searchPathSeparator||Zp;s.textContent=e.join(n)}#M(){(this.#s()?this.#r():this.#O(this.__parameters__.panels)).forEach(e=>{const s=e.__nodes__?.header?.querySelector(Li);s?.dataset?.originalTitle&&(s.textContent=s.dataset.originalTitle,delete s.dataset.originalTitle)})}#k(){const t=this.#s()?this.#r():this.#O(this.__parameters__.panels);this.__panelStateSnapshot__=t.map(e=>({panel:e,wasOpen:!!e.__state__}))}#Z(){this.__panelStateSnapshot__?.forEach(({panel:t,wasOpen:e})=>{e?t.open?.():t.close?.()})}#V(){this.__searchQuery__="",this.__node__?.classList.remove(Eo),this.#s()?(this.__parameters__.sections.forEach(t=>{t.__node__?.classList.remove(bt),(t.groups?.__parameters__?.panels||[]).forEach(s=>{s.__node__?.classList.remove(bt),this.#N(s)})}),this.#r().forEach(t=>{t.__node__?.classList.remove(bt)})):((this.__parameters__.panels||[]).forEach(t=>{if(t.__node__?.classList.remove(bt),t.__parameters__?.panels){t.__parameters__.panels.forEach(e=>{e.__node__?.classList.remove(bt),this.#N(e)});return}this.#N(t)}),this.#O(this.__parameters__.panels).forEach(t=>{t.__node__?.classList.remove(bt)})),this.#M(),this.__panelStateSnapshot__&&(this.#Z(),this.__panelStateSnapshot__=null),this.#H(!1)}#H(t){this.__searchEmptyNode__&&(this.__searchEmptyNode__.style.display=t?"block":"none")}#I(t){const e=[];return(t||[]).forEach(s=>{if(s){if(Array.isArray(s)){e.push(...this.#I(s));return}if(s.__parameters__?.panels){s.__parameters__.panels.forEach(n=>{n.__parameters__?.title!==void 0&&(e.push(n),e.push(...this.#I(n.__parameters__?.contents||[])))});return}s.__parameters__?.title!==void 0&&(e.push(s),e.push(...this.#I(s.__parameters__?.contents||[])))}}),e}#O(t){const e=[];return(t||[]).forEach(s=>{if(s?.__parameters__?.panels){e.push(...this.#O(s.__parameters__.panels));return}s?.__parameters__?.title!==void 0&&(e.push(s),e.push(...this.#I(s.__parameters__?.contents||[])))}),e}#j(){return this.#s()?this.#r():this.__parameters__.panels||[]}}const tf=250,No=50,Mo=20,Io=Object.freeze([5,10,20,50,100]),st="__name__",ef="__depth_";function Oo(o){return`${ef}${Number(o)||0}__`}function se(o){return typeof o=="string"&&/^__depth_\d+__$/.test(o)}function rs(o){if(typeof o!="string")return null;const t=/^__depth_(\d+)__$/.exec(o);return t?Number(t[1]):null}const sf=Object.freeze(["header","footer","actions"]),Po=Object.freeze(["sum","mean","min","max","count","first","last"]),Do=Object.freeze({sum:"Sum",mean:"Mean",min:"Min",max:"Max",count:"Count",first:"First",last:"Last"}),Fo=Object.freeze([{text:"Auto",value:null},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]),nf=Object.freeze(["children","parent","prev","next","depth","open","hasChildren","_plotterPeerChildPool",st]),Us="__subtotal__",rf=Object.freeze(["single","multi"]);function af(o,t,e={}){if(Array.isArray(t?.dataset))return t.dataset;const s=e.plotCallbacks||{},n=e.rootCallbacks||{},i=s.resolveTableData||n.resolveTableData;if(typeof i=="function"){const r=i(o||[]);return Array.isArray(r)?r:o||[]}return o||[]}const Ti=Object.freeze(["progress","circular","background","gauge"]),of=Object.freeze(["left","right","top","bottom","center"]),lf=Object.freeze(["diverging","overlay"]),cf=Object.freeze(["horizontal","vertical"]),Ei=Object.freeze(["line","bar","area"]),xi=Object.freeze(["left","right"]),Si=Object.freeze(["arrow","chevron"]),vi=Object.freeze(["left","right"]);function Ho(){return{enabled:!1,type:"gauge",metricKey:null,position:"center",colorize:!0,color:null,baseline:null,variant:"diverging",orientation:"horizontal",min:null,max:null}}function Bo(){return{enabled:!1,type:"line",position:"right",colorize:!0,color:null,key:null,width:40,height:16}}function zo(){return{enabled:!1,type:"arrow",metricKey:null,position:"left",colorize:!0,color:null}}function gt(o){const t=Ho(),e=o&&typeof o=="object"?o:{},s=Ti.includes(e.type)?e.type:t.type;let n=of.includes(e.position)?e.position:t.position;return s==="progress"&&n==="center"&&(n="bottom"),(s==="gauge"||s==="background"||s==="circular")&&!["center"].includes(n)&&(n="center"),{...t,...e,enabled:e.enabled===!0,type:s,metricKey:e.metricKey??null,position:n,colorize:e.colorize!==!1,color:typeof e.color=="function"?e.color:e.color??null,baseline:e.baseline??t.baseline,variant:lf.includes(e.variant)?e.variant:t.variant,orientation:cf.includes(e.orientation)?e.orientation:t.orientation,min:e.min??null,max:e.max??null}}function mt(o){const t=Bo(),e=o&&typeof o=="object"?o:{},s=Ei.includes(e.type)?e.type:t.type;return{...t,...e,enabled:e.enabled===!0,type:s,position:xi.includes(e.position)?e.position:t.position,colorize:e.colorize!==!1,color:typeof e.color=="function"?e.color:e.color??null,key:e.key??null,width:Number(e.width)>0?Number(e.width):t.width,height:Number(e.height)>0?Number(e.height):t.height}}function At(o){const t=zo(),e=o&&typeof o=="object"?o:{},s=Si.includes(e.type)?e.type:t.type;return{...t,...e,enabled:e.enabled===!0,type:s,metricKey:e.metricKey??null,position:vi.includes(e.position)?e.position:t.position,colorize:e.colorize!==!1,color:typeof e.color=="function"?e.color:e.color??null}}function Vo(o){return["left","right","top","bottom"]}function Ci(o){return gt(o).enabled===!0}const as="custom",hf=16;function $o(o){return D.get(o,{size:hf})||void 0}function Ys(o){return JSON.parse(JSON.stringify(o))}function Ks(){return Ys({borders:{table:{enabled:!1,width:1,opacity:.12,color:null},columns:{enabled:!0,width:1,opacity:.1,color:null},rows:{enabled:!0,width:1,opacity:.1,color:null}},stripe:{enabled:!1,color:null,opacity:.04},hierarchy:{columnGroups:{bracket:{enabled:!0,width:1,opacity:.15,color:null}},rows:{treeLines:{enabled:!0,width:1,opacity:.2,color:null}}},density:{cellPaddingY:6,cellPaddingX:10},typography:{cell:{fontSize:13,fontWeight:500},header:{fontSize:13,fontWeight:600},footer:{fontSize:13,fontWeight:600}},colors:{headerBackground:null,footerBackground:null}})}const Xs=Object.freeze([{id:"standard",label:"Standard",icon:"table-svg",display:Ys({borders:{table:{enabled:!1,width:1,opacity:.12,color:null},columns:{enabled:!1,width:1,opacity:.08,color:null},rows:{enabled:!0,width:1,opacity:.08,color:null}},stripe:{enabled:!1,color:null,opacity:.04},hierarchy:{columnGroups:{bracket:{enabled:!0,width:1,opacity:.2,color:null}},rows:{treeLines:{enabled:!0,width:1,opacity:.25,color:null}}},density:{cellPaddingY:10,cellPaddingX:16},typography:{cell:{fontSize:14,fontWeight:500},header:{fontSize:14,fontWeight:600},footer:{fontSize:14,fontWeight:600}},colors:{headerBackground:null,footerBackground:null}})},{id:"alternating",label:"Alternating rows",icon:"table-striped-svg",display:Ys({borders:{table:{enabled:!1,width:1,opacity:.12,color:null},columns:{enabled:!1,width:1,opacity:.08,color:null},rows:{enabled:!1,width:1,opacity:.08,color:null}},stripe:{enabled:!0,color:null,opacity:.05},hierarchy:{columnGroups:{bracket:{enabled:!0,width:1,opacity:.18,color:null}},rows:{treeLines:{enabled:!0,width:1,opacity:.22,color:null}}},density:{cellPaddingY:12,cellPaddingX:18},typography:{cell:{fontSize:14,fontWeight:500},header:{fontSize:14,fontWeight:600},footer:{fontSize:14,fontWeight:600}},colors:{headerBackground:null,footerBackground:null}})},{id:"compact",label:"Compact",icon:"table-compact-svg",display:Ks()}]);function uf(o,t){return JSON.stringify(o??null)===JSON.stringify(t??null)}function wi(o){const t=o&&typeof o=="object"?o:Ks();return Xs.find(s=>uf(t,s.display))?.id??as}function Wo(o,t){if(t===as)return!1;const e=Xs.find(s=>s.id===t);return e?(o.display=Ys(e.display),!0):!1}function df(o){const t=wi(o),e=[];return t===as&&e.push({text:ft("Custom"),value:as,active:!1,icon:$o("paint-svg")}),Xs.forEach(s=>{e.push({text:ft(s.label),value:s.id,icon:$o(s.icon)})}),e}const Zs="custom",Qs="custom",qs="custom",Vt=Object.freeze({none:"None",backgroundFill:"Background fill",edgeBar:"Edge bar",centered:"Centered gauge"}),os=Object.freeze({none:"None",sparkline:"Sparkline"}),Js=Object.freeze({none:"None",indicator:"Indicator"}),Ri=Object.freeze([{id:"off",label:"Off",group:Vt.none,gauge:{enabled:!1,type:"gauge",position:"center",colorize:!0}},{id:"backgroundHorizontal",label:"Horizontal fill",group:Vt.backgroundFill,gauge:{enabled:!0,type:"background",position:"center",orientation:"horizontal",colorize:!0}},{id:"backgroundVertical",label:"Vertical fill",group:Vt.backgroundFill,gauge:{enabled:!0,type:"background",position:"center",orientation:"vertical",colorize:!0}},{id:"divergingImpact",label:"Diverging from zero",group:Vt.centered,gauge:{enabled:!0,type:"gauge",position:"center",variant:"diverging",baseline:"zero",colorize:!0}},{id:"overlay",label:"Overlay",group:Vt.centered,gauge:{enabled:!0,type:"gauge",position:"center",variant:"overlay",baseline:"zero",colorize:!0}},{id:"topBar",label:"Top bar",group:Vt.edgeBar,gauge:{enabled:!0,type:"progress",position:"top",colorize:!0}},{id:"bottomBar",label:"Bottom bar",group:Vt.edgeBar,gauge:{enabled:!0,type:"progress",position:"bottom",colorize:!0}},{id:"leftEdge",label:"Left edge",group:Vt.edgeBar,gauge:{enabled:!0,type:"progress",position:"left",colorize:!0}},{id:"rightEdge",label:"Right edge",group:Vt.edgeBar,gauge:{enabled:!0,type:"progress",position:"right",colorize:!0}}]),ki=Object.freeze([{id:"off",label:"Off",group:os.none,sparkline:{enabled:!1,type:"line",position:"right",colorize:!0,key:null,width:40,height:16}},{id:"line",label:"Line",group:os.sparkline,sparkline:{enabled:!0,type:"line",position:"right",colorize:!0,key:null,width:40,height:16}},{id:"bar",label:"Bar",group:os.sparkline,sparkline:{enabled:!0,type:"bar",position:"right",colorize:!0,key:null,width:40,height:16}},{id:"area",label:"Area",group:os.sparkline,sparkline:{enabled:!0,type:"area",position:"right",colorize:!0,key:null,width:40,height:16}}]),Ni=Object.freeze([{id:"off",label:"Off",group:Js.none,indicator:{enabled:!1,type:"arrow",position:"left",colorize:!0}},{id:"arrow",label:"Arrow",group:Js.indicator,indicator:{enabled:!0,type:"arrow",position:"left",colorize:!0}},{id:"chevron",label:"Chevron",group:Js.indicator,indicator:{enabled:!0,type:"chevron",position:"left",colorize:!0}}]);function pf(o,t){const e=gt(o),s=gt(t);return e.enabled!==s.enabled?!1:e.enabled?e.type===s.type&&e.position===s.position&&e.variant===s.variant&&e.orientation===s.orientation&&e.baseline===s.baseline:!0}function Go(o){return Ri.find(e=>pf(o,e.gauge))?.id??Zs}function ff(o,t){const e=Ri.find(n=>n.id===t);if(!e)return!1;const s=Lt().gauge;return o.gauge=gt({...s,...o.gauge||{},...e.gauge}),!0}function _f(o){const t=Go(o),e=[];return t===Zs&&e.push({text:ft("Custom"),value:Zs,group:ft(Vt.none),active:!1}),Ri.forEach(s=>{e.push({text:ft(s.label),value:s.id,group:ft(s.group)})}),e}function gf(o,t){const e=At(o),s=At(t.indicator);return e.enabled!==s.enabled?!1:e.enabled?e.type===s.type&&e.position===s.position&&e.colorize===s.colorize:!0}function jo(o){return Ni.find(e=>gf(o,e))?.id??Qs}function mf(o,t){const e=Ni.find(n=>n.id===t);if(!e)return!1;const s=Lt().indicator;return o.indicator=At({...s,...o.indicator||{},...e.indicator}),!0}function yf(o){const t=jo(o),e=[];return t===Qs&&e.push({text:ft("Custom"),value:Qs,group:ft(Js.none),active:!1}),Ni.forEach(s=>{e.push({text:ft(s.label),value:s.id,group:ft(s.group)})}),e}function bf(o,t){const e=mt(o),s=mt(t);return e.enabled!==s.enabled?!1:e.enabled?e.type===s.type&&e.position===s.position&&e.width===s.width&&e.height===s.height&&e.key===s.key:!0}function Uo(o){return ki.find(e=>bf(o,e.sparkline))?.id??qs}function Af(o,t){const e=ki.find(n=>n.id===t);if(!e)return!1;const s=Lt().sparkline;return o.sparkline=mt({...s,...o.sparkline||{},...e.sparkline}),!0}function Lf(o){const t=Uo(o),e=[];return t===qs&&e.push({text:ft("Custom"),value:qs,group:ft(os.none),active:!1}),ki.forEach(s=>{e.push({text:ft(s.label),value:s.id,group:ft(s.group)})}),e}function Yo(){return{enabled:!0,tooltip:!0,kpiDetail:!0,syncChart:!0,syncComment:!0,syncTableRow:!0}}function Ko(o){const t=Yo(),e=o?.hover;return!e||typeof e!="object"?{...t}:{enabled:e.enabled!==!1,tooltip:e.tooltip!==!1,kpiDetail:e.kpiDetail!==!1,syncChart:e.syncChart!==!1,syncComment:e.syncComment!==!1,syncTableRow:e.syncTableRow!==!1}}const Tf="selected";function Xo(){return{enabled:!1,selectedKey:Tf}}function Zo(o){const t=Xo(),e=o?.selection;if(!e||typeof e!="object")return{...t};const s=typeof e.selectedKey=="string"&&e.selectedKey.length?e.selectedKey:t.selectedKey,n={enabled:e.enabled===!0,selectedKey:s};return typeof e.onChange=="function"&&(n.onChange=e.onChange),n}function Ef({event:o,row:t,tableConfig:e,layer:s}){const n=Zo(e);if(n.enabled&&typeof n.onChange=="function"){o?.stopPropagation?.(),o?.stopImmediatePropagation?.(),o?.preventDefault?.();const i=n.selectedKey,r=!t?.[i];return n.onChange(t,r),"selection"}return typeof s?._handleClick=="function"?(s._handleClick(o,{data:t}),"layerClick"):null}function Lt(){return{label:null,unit:null,subtitle:null,tooltip:null,visible:!0,order:null,searchable:!0,sortable:!0,align:null,format:null,span:1,width:null,minWidth:null,maxWidth:null,frozen:!1,colorized:!1,metricKey:null,pinned:!1,renderer:null,sparkline:Bo(),gauge:Ho(),indicator:zo(),aggregate:null}}function Qo(){return{enabled:!0,label:"Table",sort:{mode:"single",columns:[]},pagination:{enabled:!0,rowsPerPage:Mo,rowsPerPageOptions:[...Io]},rows:{childrenKey:"children",groupBy:[],labelColumn:null,defaultExpanded:!0,flat:!1,excludeKeys:null,hideGroupFields:!0,totalRowKey:null,pinRowKey:null,followChartVisibility:!1,conditionalStyle:null,excludeRowMatch:null,totalRowMatch:null,subtotalRowMatch:null,subtotals:{enabled:!1},peerRowsKey:null},layout:{textMaxWidth:tf,fontFamily:null},columnGroups:[],available:null,header:{},footer:{},footerEnabled:!0,actions:{},display:Ks(),hover:Yo(),selection:Xo()}}function Mi(){return Ks()}function tn(o){const t=o&&o.rows||{},e=t.childrenKey||"children",s=Array.isArray(t.excludeKeys)?t.excludeKeys:[],n=t.peerRowsKey,i=[];return n&&i.push(n),new Set([...nf,e,...s,...i])}function Ii(o){return Array.isArray(o?.available)&&o.available.length>0}function Oi(o,t){const e=o?.available;if(!Array.isArray(e)||!e.length)return t;const s=new Set(t);return e.filter(n=>s.has(n))}function ne(o){return o?.metricKey||o?.key}function qo(o){return o?.gauge?.metricKey||ne(o)}function xf(o){return o?.indicator?.metricKey||ne(o)}function Sf(o){return o?.sparkline?.key||ne(o)}function en(o,t,e=null){const s=e||ne(t),n=o?.[s];if(typeof n=="number")return n;const i=Number(n);return Number.isNaN(i)?NaN:i}function vf(o){return o==null?!1:Array.isArray(o)?!0:typeof o=="object"}function sn(o,t,e=null,s=No){if(!Array.isArray(o)||!t)return!0;const i=(e&&e.rows||{}).childrenKey||"children";let r=0;const a=l=>{for(const c of l||[]){if(r>=s)return!1;if(r+=1,!c||typeof c!="object")continue;const h=c[t];if(h!=null&&h!==""&&vf(h)||a(c[i]))return!0}return!1};return!a(o)}function ls(o,t,e=50){if(!Array.isArray(o)||!o.length)return!1;let s=!1;const n=Math.min(o.length,e);for(let i=0;i<n;i++){const r=o[i]?.[t];if(!(r==null||r==="")&&(s=!0,typeof r!="number"&&Number.isNaN(Number(r))))return!1}return s}function Pi(o,t,e="header"){const s=sf.includes(e)?e:"header",n=tn(t),i=cs(o,t,50).filter(d=>!n.has(d)&&sn(o,d,t,50)),r=Oi(t,i),a=t&&t[s]||{},l=Object.keys(a),c=Ii(t);let h=s==="actions"?l:r;return s==="header"&&!h.length&&c&&(h=l.filter(d=>t.available.includes(d))),h.map((d,p)=>{const f=Lt(),_=a[d]||{},g=Object.prototype.hasOwnProperty.call(a,d),m={...f,..._,key:d,section:s,gauge:gt({...f.gauge,..._.gauge||{}}),indicator:At({...f.indicator,..._.indicator||{}}),sparkline:mt({...f.sparkline,..._.sparkline||{}})};m.label=m.label||d,m.order=Number.isFinite(m.order)?m.order:p,m.span=Number.isFinite(m.span)&&m.span>0?m.span:1,c&&s==="header"&&!g&&(m.visible=!1);const y=ne(m);return m.align==null&&(m.align=ls(o,y)?"right":"left"),s==="footer"&&m.aggregate==null&&g&&ls(o,y)&&(m.aggregate="sum"),m}).sort((d,p)=>d.order-p.order)}function Jo(o,t,e){if(o?.key===st||se(o?.key))return{...o,section:"footer"};const s=Lt(),n=e?.footer,i=!!(n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,o.key)),r=(t||[]).find(a=>a.key===o.key);return i&&r?{...r,section:"footer"}:{...o,section:"footer",aggregate:null,gauge:gt({...s.gauge}),indicator:At({...s.indicator}),sparkline:mt({...s.sparkline}),colorized:!1}}function tl(o,t){const e=t&&t.header||{},s=tn(t),n=cs(o,t,50).filter(h=>!s.has(h)&&sn(o,h,t,50)),i=Oi(t,n),r=Ii(t),a=Object.keys(e);return(r?i:[...new Set([...i,...a])]).map((h,u)=>{const d=Lt(),p=e[h]||{},f=Object.prototype.hasOwnProperty.call(e,h),_={...d,...p,gauge:gt({...d.gauge,...p.gauge||{}}),indicator:At({...d.indicator,...p.indicator||{}}),sparkline:mt({...d.sparkline,...p.sparkline||{}})},g=Number.isFinite(_.order)?_.order:u;let m=_.visible!==!1;r&&!f&&(m=!1);const y=gt(_.gauge),b=At(_.indicator),A=mt(_.sparkline);return{key:h,label:_.label||h,visible:m,order:g,bars:y.enabled,arrows:b.enabled,sparkline:A.enabled,colors:!!_.colorized,pinned:!!_.pinned,frozen:!!_.frozen,search:_.searchable!==!1,sort:_.sortable!==!1,disabled:!m}}).sort((h,u)=>h.order-u.order)}function Pe(o,t){return tl(o,t).filter(n=>n.visible!==!1)}function Di(o,t){return tl(o,t).map(n=>n.key)}function el(o,t){const e=sl(o,t),s=new Set(Pe(o,t).map(i=>i.key));return e.filter(i=>!s.has(i))}function sl(o,t){const e=tn(t),s=cs(o,t,50).filter(i=>!e.has(i)&&sn(o,i,t,50));return Ii(t)?Oi(t,s):s.filter(i=>i!==st)}function Cf(o,t,e){const s=sl(o,t),n=new Set(Pe(o,t).map(r=>r.key).filter(r=>r!==e)),i=[];return s.forEach(r=>{r!==e&&n.has(r)||i.push({text:ye(t,r),value:r})}),i}function wf(o,t,e){if(!t||!e||t===e||t===st||e===st)return!1;(!o.header||typeof o.header!="object")&&(o.header={});const s=o.header,n=Lt(),i=s[t]||{},r=s[e]||{};if(new Set(Object.entries(s).filter(([,h])=>h?.visible!==!1).map(([h])=>h)).has(e)&&e!==t)return!1;const c={visible:!0,order:Number.isFinite(i.order)?i.order:0,pinned:i.pinned,colorized:i.colorized,metricKey:i.metricKey,align:i.align,span:i.span,format:i.format,unit:i.unit,gauge:{...n.gauge,...i.gauge||{}},indicator:{...n.indicator,...i.indicator||{}},sparkline:{...n.sparkline,...i.sparkline||{}}};return s[e]={...n,...r,...c,label:r.label??i.label??null},s[t]={...n,...i,visible:!1,gauge:{...n.gauge,...i.gauge||{}},indicator:{...n.indicator,...i.indicator||{}},sparkline:{...n.sparkline,...i.sparkline||{}}},!0}function nl(o,t){const e=o?.columnGroups;if(!Array.isArray(e)||!t)return null;const s=(n,i)=>Array.isArray(n.columns)&&n.columns.includes(i)||Array.isArray(n.groups)&&n.groups.some(r=>s(r,i));for(let n=0;n<e.length;n+=1){const i=e[n];if(!s(i,t))continue;const r=i?.label;return r!=null&&String(r).trim()!==""?String(r).trim():null}return null}function Rf(o,t){const s=o?.header?.[t]?.label,n=s!=null&&String(s).trim()!==""?String(s).trim():t,i=nl(o,t);return i?`${i} › ${n}`:n}function ye(o,t){const s=o?.header?.[t]?.label,n=s!=null&&String(s).trim()!==""?String(s).trim():t,i=nl(o,t);if(!i)return typeof n.translate=="function"?n.translate():n;const r="{group} › {column}";if(typeof r.translate=="function"){const a=typeof i.translate=="function"?i.translate():i,l=typeof n.translate=="function"?n.translate():n;return r.translate({group:a,column:l})}return`${i} › ${n}`}function il(o,t){if(!t||t===st)return!1;(!o.header||typeof o.header!="object")&&(o.header={});const e=o.header,s=Lt(),n=e[t]||{};let i=-1;return Object.values(e).forEach(r=>{const a=Number.isFinite(r?.order)?r.order:-1;a>i&&(i=a)}),e[t]={...s,...n,visible:!0,order:i+1,gauge:{...s.gauge,...n.gauge||{}},indicator:{...s.indicator,...n.indicator||{}}},!0}function rl(o){const t=o?.header;if(!t||typeof t!="object")return;const e=Object.keys(t),s=a=>Number.isFinite(t[a]?.order)?t[a].order:Number.MAX_SAFE_INTEGER,n=e.filter(a=>t[a]?.frozen).sort((a,l)=>s(a)-s(l)),i=e.filter(a=>!t[a]?.frozen).sort((a,l)=>s(a)-s(l));let r=0;n.forEach(a=>{if(a===st){t[a].order=-1;return}t[a].order=r,r+=1}),i.forEach(a=>{t[a].order=r,r+=1})}function kf(o,t){if(!t||t===st)return!1;(!o.header||typeof o.header!="object")&&(o.header={});const e=o.header,s=Lt(),n=e[t]||{};return e[t]={...s,...n,visible:!1,gauge:{...s.gauge,...n.gauge||{}},indicator:{...s.indicator,...n.indicator||{}}},!0}function Fi(o){return!o||o.unit==null?null:String(o.unit).trim()||null}function Nf(o,t,e,s){const n=t&&typeof t=="object"?t:{key:t};if(typeof s=="function"){const l=s(o,n,e);if(l!=null)return l}if(typeof n.format=="function"){const l=n.format(o,e);if(typeof l=="string")return l;if(l&&typeof l=="object"&&typeof e=="number"&&!Number.isNaN(e)){let c=e;l.scale!=null&&(c=c*l.scale);const h={...l};delete h.scale;try{return c.format(h)}catch{return String(e)}}}if(e==null)return"";if(typeof e!="number"||Number.isNaN(e)||typeof Number.prototype.format!="function")return String(e);const i={},r=Fi(n);r&&(i.unit=r),n.format&&typeof n.format=="object"&&Object.assign(i,n.format);let a=e;i.scale!=null&&(a=a*i.scale,delete i.scale);try{return a.format(i)}catch{return String(e)}}function Hi(o,t){const e=t?.gauge?.min,s=t?.gauge?.max;let n=Number.isFinite(e)?e:1/0,i=Number.isFinite(s)?s:-1/0;if(!Number.isFinite(e)||!Number.isFinite(s)){const r=qo(t);(o||[]).forEach(a=>{const l=a?.[r],c=typeof l=="number"?l:Number(l);Number.isNaN(c)||(!Number.isFinite(e)&&c<n&&(n=c),!Number.isFinite(s)&&c>i&&(i=c))})}return Number.isFinite(n)||(n=0),Number.isFinite(i)||(i=0),{min:n,max:i}}function al(o,t){const{min:e,max:s}=t||{min:0,max:0};if(!Number.isFinite(o)||s===e)return 0;const n=(o-e)/(s-e);return n<0?0:n>1?1:n}function Bi(o,t,e=0){const{min:s,max:n}=t||{min:0,max:0},i=Number.isFinite(e)?e:0;if(!Number.isFinite(o))return 0;const r=Math.max(Math.abs(s-i),Math.abs(n-i));if(r===0)return 0;let a=(o-i)/r;return a<-1&&(a=-1),a>1&&(a=1),a}function ol(o){if(!o)return[];if(o.leaf)return[o];const t=[];return(o.children||[]).forEach(e=>{t.push(...ol(e))}),t}function ll(o,t){if(!o||o.leaf)return o;if(!!!t?.collapsed){const i=(o.children||[]).map(r=>ll(r,r.groupConfig??null)).filter(Boolean);return i.length?{...o,children:i}:null}const n=ol(o).filter(i=>i.column?.pinned);return{...o,children:n,collapsed:!0}}function Mf(o,t,e=[]){const s=Array.isArray(o)?o:[],n=t&&Array.isArray(t.columnGroups)?t.columnGroups:[],i=Array.isArray(e)?e.filter(b=>b.visible!==!1):[];if(!n.length&&!i.length)return{headerMatrix:[s.map(b=>({label:b.label,colspan:1,rowspan:1,leaf:!0,column:b}))],leafColumns:s.slice()};const r=new Map(s.map(b=>[b.key,b])),a=(b,A)=>Array.isArray(b.columns)&&b.columns.includes(A)||Array.isArray(b.groups)&&b.groups.some(L=>a(L,A)),l=(b,A)=>{const L=[];return(b.groups||[]).forEach((E,C)=>{const S=Array.isArray(b.groups)?b.groups[C]:E,w=l(E,S);w&&(w.groupConfig=S,L.push(w))}),(b.columns||[]).forEach(E=>{r.has(E)&&L.push({leaf:!0,column:r.get(E)})}),L.length?ll({group:!0,label:b.label,children:L,groupConfig:A,collapsed:!!A?.collapsed},A):null},c=new Set,h=b=>{(b.columns||[]).forEach(A=>c.add(A)),(b.groups||[]).forEach(h)};n.forEach(h);const u=[],d=new Set;s.forEach(b=>{if(!c.has(b.key)){u.push({leaf:!0,column:b});return}const A=n.findIndex(T=>a(T,b.key)),L=A>=0?n[A]:null;if(L&&!d.has(L)){d.add(L);const T=l(L,L);T&&(T.groupIndex=A,T.collapsed=!!L.collapsed,u.push(T))}}),i.length&&u.push({group:!0,label:"Actions",synthetic:!0,collapsed:!1,children:i.map(b=>({leaf:!0,column:b}))});const p=b=>{if(b.leaf)return 1;const A=(b.children||[]).reduce((L,T)=>L+p(T),0);return A===0&&b.collapsed?1:A},f=b=>b.leaf?1:1+Math.max(0,...b.children.map(f)),_=Math.max(1,...u.map(f)),g=Array.from({length:_},()=>[]),m=[],y=(b,A)=>{b.leaf?(g[A].push({label:b.column.label,colspan:1,rowspan:_-A,leaf:!0,column:b.column}),m.push(b.column)):(g[A].push({label:b.label,colspan:p(b),rowspan:1,group:!0,synthetic:!!b.synthetic,groupIndex:b.groupIndex,collapsed:!!b.collapsed}),b.children.forEach(L=>y(L,A+1)))};return u.forEach(b=>{if(b.group&&!b.synthetic){const A=[],L=T=>{if(T.leaf&&T.column){A.push(T.column);return}(T.children||[]).forEach(L)};L(b),A.length&&(A[0].__groupStart=!0,A[A.length-1].__groupEnd=!0)}y(b,0)}),{headerMatrix:g,leafColumns:m}}function cl(o,t){return(o&&Array.isArray(o[t])?o[t]:[]).length>0||o?.hasChildren===!0}function nn(o){return o?.rows?.flat===!0}function If(o,t){return!!o?.hasChildren}function be(o,t){const e=t?.rows||{};if((Array.isArray(e.groupBy)?e.groupBy.filter(Boolean):[]).length)return!0;const n=e.childrenKey||"children",i=r=>{for(const a of r||[]){if(cl(a,n))return!0;const l=a&&Array.isArray(a[n])?a[n]:[];if(i(l))return!0}return!1};return i(Array.isArray(o)?o:[])}function cs(o,t,e=No){const n=(t&&t.rows||{}).childrenKey||"children",i=[],r=new Set;let a=0;const l=c=>{for(const h of c||[]){if(a>=e)return;a+=1,!(!h||typeof h!="object")&&(Object.keys(h).forEach(u=>{u===n||r.has(u)||(r.add(u),i.push(u))}),l(h[n]))}};return l(Array.isArray(o)?o:[]),i}function zi(o){return/^Level_\d+$/i.test(o)}function hl(o,t){const e=t?.rows||{};if(e.labelColumn)return e.labelColumn;const s=cs(o,t);if(s.includes("text"))return"text";const n=Array.isArray(e.groupBy)?e.groupBy.filter(Boolean):[];if(n.length)return n[n.length-1];const i=tn(t),r=s.filter(l=>!i.has(l)&&!zi(l)&&sn(o,l,t));return r.find(l=>!ls(o,l))||r[0]||null}function Of(o,t){const e=new Set,s=t?.rows||{};(Array.isArray(s.groupBy)?s.groupBy.filter(Boolean):[]).forEach(r=>e.add(r)),s.labelColumn&&e.add(s.labelColumn);const i=hl(o,t);return i&&e.add(i),cs(o,t).forEach(r=>{(zi(r)||r==="text")&&e.add(r)}),e}function Mt(o,t){if(!o)return"";const e=t?.rows||{};if(e.labelColumn&&o[e.labelColumn]!=null&&o[e.labelColumn]!=="")return o[e.labelColumn];const s=Object.keys(o).filter(i=>zi(i)).sort((i,r)=>r.localeCompare(i));for(const i of s){const r=o[i];if(r!=null&&r!=="")return r}if(o.text!=null&&String(o.text).trim()!=="")return o.text;const n=Array.isArray(e.groupBy)?e.groupBy.filter(Boolean):[];if(n.length){const i=n[n.length-1],r=o[i];if(r!=null&&r!=="")return r}return""}function Vi(o,t){if(!o)return"";if(o.synthetic)return o.groupValue!=null?String(o.groupValue):"";const e=Mt(o.row,t);return e!=null?String(e):""}function ul(o){return o==="asc"||o==="desc"?o:o!==!1}function dl(o){const t=o?.header?.[st]||{};return{...Lt(),...t,key:st,label:t.label||"Name",order:-1,visible:t.visible!==!1,searchable:t.searchable!==!1,sortable:ul(t.sortable),align:t.align||"left",section:"header"}}function Pf(o,t){const e=Math.max(0,Number(o)||0),s=t?.rows||{},n=Array.isArray(s.groupBy)?s.groupBy.filter(Boolean):[],i=Lt(),r=[];for(let a=0;a<=e;a+=1){const l=Oo(a),c=t?.header?.[l]||{},h=n[a]||null;r.push({...i,...c,key:l,label:c.label||h||"Level {level}",labelVars:c.label||h?null:{level:a},order:Number.isFinite(c.order)?c.order:-1e3+a,visible:c.visible!==!1,searchable:c.searchable!==!1,sortable:ul(c.sortable),align:c.align||"left",section:"header",__depthIndex:a})}return r}function Df(o){let t=0;const e=(s,n)=>{(s||[]).forEach(i=>{n>t&&(t=n),i?.children?.length&&e(i.children,n+1)})};return e(o||[],0),t}function Ff(o,t){const e=o?o.id??o.unique:null;return e!=null?String(e):`#${t}`}function $i(o,t,e,s){const n=Ff(o,s),i=e?`${e}/${n}`:String(n),a=(o&&Array.isArray(o[t])?o[t]:[]).map((l,c)=>$i(l,t,i,c));return{row:o,synthetic:!1,groupField:null,groupValue:null,path:i,children:a,hasChildren:cl(o,t)}}function pl(o,t,e,s){if(!t.length)return o.map((l,c)=>$i(l,e,s,c));const[n,...i]=t,r=[],a=new Map;return o.forEach(l=>{const c=l?l[n]:void 0,h=c==null?"":String(c);a.has(h)||(a.set(h,{value:c,rows:[]}),r.push(h)),a.get(h).rows.push(l)}),r.map(l=>{const{value:c,rows:h}=a.get(l),u=s?`${s}/${n}=${l}`:`${n}=${l}`,d=pl(h,i,e,u);return{row:{[n]:c},synthetic:!0,groupField:n,groupValue:c,path:u,children:d,hasChildren:d.length>0}})}function fl(o,t){const e=Array.isArray(o)?o:[],s=t&&t.rows||{},n=s.childrenKey||"children",i=Array.isArray(s.groupBy)?s.groupBy.filter(Boolean):[];return i.length?pl(e,i,n,""):e.map((r,a)=>$i(r,n,"",a))}function Hf(o,t,e){const s=Array.isArray(t)?i=>t.every(({key:r,term:a})=>{const l=i?i[r]:null;let c=l;if(typeof e=="function"){const u=e(i,r,l);u!=null&&(c=u)}const h=String(a).trim().toLowerCase();return c!=null&&String(c).toLowerCase().includes(h)}):t,n=i=>{const r=[];return i.forEach(a=>{const l=a.children&&a.children.length?n(a.children):[];(!a.synthetic&&s(a.row)||l.length)&&r.push({...a,children:l,hasChildren:l.length>0||a.hasChildren===!0})}),r};return n(o||[])}function Bf(o,t){const e=s=>{const n=s.map(i=>({...i,children:i.children&&i.children.length?e(i.children):[]}));return n.sort((i,r)=>t(i.row,r.row)),n};return e(o||[])}function zf(o,t,e){const s=e.expanded||{};if(Object.prototype.hasOwnProperty.call(s,o.path))return!!s[o.path];if(o.row&&typeof o.row.open=="boolean")return o.row.open;const n=e.defaultExpanded;return typeof n=="number"?t<n:n!==!1}function Vf(o,t){return!t||!o||o.synthetic?!1:!!(o.row&&o.row[t]===!0)}function $f(o,t={}){const e=t.pinRowKey??null,s=t.tableConfig||{},n=t.leavesOnly===!0,i=[],r=(a,l,c)=>{a.forEach(h=>{const u=h.hasChildren===!0||!!(h.children&&h.children.length),d=u?zf(h,l,t):!1,p=Vi(h,s),f=[...c,p];(!n||!u)&&i.push({row:h.row,depth:l,path:h.path,synthetic:!!h.synthetic,groupValue:h.groupValue??null,hasChildren:u,expanded:d,depthLabels:f}),u&&(n||d)?r(h.children,l+1,f):u&&!d&&e&&h.children.forEach(_=>{Vf(_,e)&&r([_],l+1,f)})})};return r(o||[],0,[]),i}function _l(o){const t=[],e=s=>{s.forEach(n=>{!n.synthetic&&n.row&&t.push(n.row),n.children&&n.children.length&&e(n.children)})};return e(o||[]),t}function Ht(o,t){return!o||typeof o!="object"?{...t}:(Object.keys(t).forEach(e=>{o[e]===void 0&&(o[e]=t[e])}),o)}function Wi(o){const t=Mi();return!o||typeof o!="object"?JSON.parse(JSON.stringify(t)):(o.borders=o.borders||{},!o.borders.table||typeof o.borders.table!="object"?o.borders.table={...t.borders.table}:Ht(o.borders.table,t.borders.table),!o.borders.columns||typeof o.borders.columns!="object"?o.borders.columns={...t.borders.columns}:Ht(o.borders.columns,t.borders.columns),!o.borders.rows||typeof o.borders.rows!="object"?o.borders.rows={...t.borders.rows}:Ht(o.borders.rows,t.borders.rows),!o.stripe||typeof o.stripe!="object"?o.stripe={...t.stripe}:Ht(o.stripe,t.stripe),o.hierarchy=o.hierarchy||{},o.hierarchy.columnGroups=o.hierarchy.columnGroups||{},!o.hierarchy.columnGroups.bracket||typeof o.hierarchy.columnGroups.bracket!="object"?o.hierarchy.columnGroups.bracket={...t.hierarchy.columnGroups.bracket}:Ht(o.hierarchy.columnGroups.bracket,t.hierarchy.columnGroups.bracket),o.hierarchy.rows=o.hierarchy.rows||{},!o.hierarchy.rows.treeLines||typeof o.hierarchy.rows.treeLines!="object"?o.hierarchy.rows.treeLines={...t.hierarchy.rows.treeLines}:Ht(o.hierarchy.rows.treeLines,t.hierarchy.rows.treeLines),!o.density||typeof o.density!="object"?o.density={...t.density}:Ht(o.density,t.density),o.typography=o.typography||{},!o.typography.cell||typeof o.typography.cell!="object"?o.typography.cell={...t.typography.cell}:Ht(o.typography.cell,t.typography.cell),!o.typography.header||typeof o.typography.header!="object"?o.typography.header={...t.typography.header}:Ht(o.typography.header,t.typography.header),!o.typography.footer||typeof o.typography.footer!="object"?o.typography.footer={...t.typography.footer}:Ht(o.typography.footer,t.typography.footer),!o.colors||typeof o.colors!="object"?o.colors={...t.colors}:Ht(o.colors,t.colors),o)}function hs(o){const t=Mi(),e=o?.display;return!e||typeof e!="object"?t:{borders:{table:{...t.borders.table,...e.borders?.table||{}},columns:{...t.borders.columns,...e.borders?.columns||{}},rows:{...t.borders.rows,...e.borders?.rows||{}}},stripe:{...t.stripe,...e.stripe||{}},hierarchy:{columnGroups:{bracket:{...t.hierarchy.columnGroups.bracket,...e.hierarchy?.columnGroups?.bracket||{}}},rows:{treeLines:{...t.hierarchy.rows.treeLines,...e.hierarchy?.rows?.treeLines||{}}}},density:{...t.density,...e.density||{}},typography:{cell:{...t.typography.cell,...e.typography?.cell||{}},header:{...t.typography.header,...e.typography?.header||{}},footer:{...t.typography.footer,...e.typography?.footer||{}}},colors:{...t.colors,...e.colors||{}}}}function De(o,t){const e=Number.isFinite(Number(t))?Number(t):0;return o!=null&&String(o).trim()!==""?String(o):`rgba(var(--color-dark-rgb), ${e})`}function Wf(o){const t=hs(o),e=t.borders||{},s=t.stripe||{},n=t.hierarchy||{},i=t.density||{},r=t.typography||{},a=e.table||{},l=e.columns||{},c=e.rows||{},h=n.columnGroups?.bracket||{},u=n.rows?.treeLines||{},d=r.cell||{},p=r.header||{},f=r.footer||{},_=t.colors||{};return{"--plotter-table-border-table-width":`${a.width??1}px`,"--plotter-table-border-table-opacity":String(a.opacity??.12),"--plotter-table-border-table-color":De(a.color,a.opacity??.12),"--plotter-table-border-column-width":`${l.width??1}px`,"--plotter-table-border-column-opacity":String(l.opacity??.08),"--plotter-table-border-column-color":De(l.color,l.opacity??.08),"--plotter-table-border-row-width":`${c.width??1}px`,"--plotter-table-border-row-opacity":String(c.opacity??.08),"--plotter-table-border-row-color":De(c.color,c.opacity??.08),"--plotter-table-stripe-color":De(s.color,s.opacity??.04),"--plotter-table-stripe-opacity":String(s.opacity??.04),"--plotter-table-cell-padding-y":`${i.cellPaddingY??6}px`,"--plotter-table-cell-padding-x":`${i.cellPaddingX??10}px`,"--plotter-table-font-size-cell":`${d.fontSize??13}px`,"--plotter-table-font-weight-cell":String(d.fontWeight??500),"--plotter-table-font-size-header":`${p.fontSize??13}px`,"--plotter-table-font-weight-header":String(p.fontWeight??600),"--plotter-table-font-size-footer":`${f.fontSize??13}px`,"--plotter-table-font-weight-footer":String(f.fontWeight??600),"--plotter-table-tree-line-width":`${u.width??1}px`,"--plotter-table-tree-line-opacity":String(u.opacity??.2),"--plotter-table-tree-line-color":De(u.color,u.opacity??.2),"--plotter-table-group-bracket-width":`${h.width??1}px`,"--plotter-table-group-bracket-opacity":String(h.opacity??.15),"--plotter-table-group-bracket-color":De(h.color,h.opacity??.15),"--plotter-table-header-bg":_.headerBackground??"","--plotter-table-footer-bg":_.footerBackground??""}}function Gf(o){const t=hs(o),e=["plotter-table"],s=t.borders||{};return s.table?.enabled&&e.push("plotter-table--border-table"),s.columns?.enabled&&e.push("plotter-table--border-columns"),s.rows?.enabled&&e.push("plotter-table--border-rows"),t.stripe?.enabled&&e.push("plotter-table--striped"),t.hierarchy?.rows?.treeLines?.enabled&&e.push("plotter-table--tree-lines"),t.hierarchy?.columnGroups?.bracket?.enabled&&e.push("plotter-table--group-brackets"),e}function jf(o){const t=hs(o),e=Array.isArray(o?.columnGroups)&&o.columnGroups.length>0;return!!t.hierarchy?.columnGroups?.bracket?.enabled&&e}function Uf(o,t){return!hs(t).hierarchy?.rows?.treeLines?.enabled||t?.rows?.flat===!0?!1:be(o,t)}function Yf(o){const t=Array.isArray(o)?o:[];return t.map((e,s)=>{const n=e?.depth??0,i=[];for(let a=0;a<n;a+=1){let l=!1;for(let c=s+1;c<t.length;c+=1){const h=t[c]?.depth??0;if(h<=a)break;if(h===a+1){l=!0;break}}i.push(l)}let r=!0;for(let a=s+1;a<t.length;a+=1){const l=t[a]?.depth??0;if(l<n)break;if(l===n){r=!1;break}}return{depth:n,isLastSibling:r,ancestorContinues:i}})}function Kf(o){return Array.isArray(o)?o.map(t=>{if(!Array.isArray(t))return[];const e=new Set;return t.map(s=>{if(!s?.group||s.synthetic||!Number.isInteger(s.groupIndex))return s;const n=s.groupIndex,i=!e.has(n);return i&&e.add(n),{...s,groupStart:i,groupEnd:i}})}):[]}function gl(o){const t=o?.pagination?.rowsPerPageOptions;if(Array.isArray(t)&&t.length){const e=t.map(s=>Number(s)).filter(s=>Number.isFinite(s)&&s>0);if(e.length)return e}return[...Io]}function ml(o){const t=Number(o?.pagination?.rowsPerPage);return Number.isFinite(t)&&t>0?t:Mo}function Xf(o){return Math.min(...gl(o))}function Zf(o,t){return o?.pagination?.enabled===!1||t<=0?!1:t>Xf(o)}function Qf(o){return o?.footerEnabled===!1?!1:o?.rows?.totalRowKey||o?.rows?.totalRowMatch?.key?!0:yl(o)}function yl(o){const t=o?.footer;return!!(t&&typeof t=="object"&&Object.keys(t).length>0)}function rn(o){if(o==null||o===!1||o==="none")return null;const t=String(o).toLowerCase();return Po.includes(t)?t:"sum"}function bl(o,t){const e=[];return(o||[]).forEach(s=>{const n=s?s[t]:null;if(n==null||n==="")return;const i=typeof n=="number"?n:Number(n);Number.isNaN(i)||e.push(i)}),e}function Al(o,t,e="sum"){const s=rn(e);if(!s)return null;const n=bl(o,t);if(!n.length)return s==="count"?0:null;switch(s){case"sum":return n.reduce((i,r)=>i+r,0);case"mean":return n.reduce((i,r)=>i+r,0)/n.length;case"min":return Math.min(...n);case"max":return Math.max(...n);case"count":return n.length;case"first":return n[0];case"last":return n[n.length-1];default:return null}}function qf(o){const t=rn(o);return t?Do[t]||t:null}const Jf=120,t_="var(--plotter-table-color-positive, var(--datama-increase, #2f9e44))",e_="var(--plotter-table-color-negative, var(--datama-decrease, #d64545))";function an(o,t){if(!t||!o)return!1;if(Array.isArray(t))return t.some(s=>an(o,s));if(!t.key)return!1;if(o[t.key]===t.value)return!0;const e=o.data;return!!(e&&typeof e=="object"&&e[t.key]===t.value)}function on(o,t){return an(o,t?.rows?.excludeRowMatch)}function Ll(o,t){return an(o,t?.rows?.subtotalRowMatch)}function Tl(o,t){if(an(o,t?.rows?.totalRowMatch))return!0;const e=t?.rows?.totalRowKey;if(!e||!o)return!1;if(o[e])return!0;const s=o.data;return!!(s&&typeof s=="object"&&s[e])}function El(o,t){if(!o||on(o.row,t))return null;const e=(o.children||[]).map(s=>El(s,t)).filter(Boolean);return e.length===(o.children||[]).length?o:{...o,children:e,hasChildren:e.length>0}}function s_(o,t){const e=t?.rows?.excludeRowMatch;return!(e&&(Array.isArray(e)||e.key))?o||[]:(o||[]).map(n=>El(n,t)).filter(Boolean)}function Fe(o,t){return o==null||t==null?!1:o===t?!0:o.unique!=null&&t.unique!=null?o.unique===t.unique:o.id!=null&&t.id!=null?o.id===t.id:!1}function xl(o,t){if(!o||Fe(o.row,t))return null;const e=(o.children||[]).map(s=>xl(s,t)).filter(Boolean);return e.length===(o.children||[]).length?o:{...o,children:e,hasChildren:e.length>0}}function n_(o,t,e=null){if(!!!(t?.rows?.totalRowMatch?.key||t?.rows?.totalRowKey))return o||[];const n=e??Sl(o,t);return n?(o||[]).map(i=>xl(i,n)).filter(Boolean):o||[]}function i_(o){if(!o||typeof o!="object")return null;const t=o.data&&typeof o.data=="object"?o.data:null,e=o._sourceTableKey??t?._sourceTableKey??o.comparison??t?.comparison;return e==null||e===""?null:String(e)}function r_(o){const t=new Set;for(let e=0;e<o.length;e+=1){const s=i_(o[e]);if(s&&(t.add(s),t.size>1))return!0}return!1}function Sl(o,t){const e=_l(o||[]),s=[];for(let n=0;n<e.length;n+=1){const i=e[n];Tl(i,t)&&s.push(i)}return s.length!==1||r_(e)?null:s[0]}function a_(o){return(o?.children||[]).filter(t=>!t.synthetic&&t.row).map(t=>t.row)}function vl(o,t){if(!t)return null;for(const e of o||[]){if(e.path===t)return e;const s=vl(e.children,t);if(s)return s}return null}function o_(o,t,e={}){const s=o?.row;if(!s)return[];if(Object.prototype.hasOwnProperty.call(e,"footerTotalRow")?Fe(s,e.footerTotalRow):Tl(s,t))return Array.isArray(e.levelZeroBodyRows)?e.levelZeroBodyRows:[];if(!o.hasChildren)return[];const i=vl(e.pageRoots,o.path);return a_(i)}function l_(o,t,e){if(!t?.sparkline?.enabled||!o)return[];const n=Sf(t),i=o[n];if(Array.isArray(i)&&i.length)return i.map(a=>typeof a=="number"?a:Number(a)).filter(a=>!Number.isNaN(a));if(!Array.isArray(e)||!e.length)return[];const r=[];return e.forEach(a=>{const l=en(a,t,n);Number.isNaN(l)||r.push(l)}),r}function c_(o){const t=o?.sort?.mode;return rf.includes(t)?t:"single"}function Gi(o,t){const s=(Array.isArray(o?.sort?.columns)?o.sort.columns:[]).filter(i=>i&&i.key&&(i.direction==="asc"||i.direction==="desc")).map((i,r)=>({key:i.key,direction:i.direction,priority:Number.isFinite(i.priority)?i.priority:r})).sort((i,r)=>i.priority-r.priority);if(s.length)return s;const n=new Set((t||[]).map(i=>i.key));return(t||[]).filter(i=>n.has(i.key)&&(i.sortable==="asc"||i.sortable==="desc")).map((i,r)=>({key:i.key,direction:i.sortable,priority:r}))}function Cl(o){if(o==null)return 0;if(typeof o=="number")return o;const t=Number(o);return Number.isNaN(t)?o:t}function wl(o,t){const e=Cl(o),s=Cl(t);return typeof e=="number"&&typeof s=="number"&&!Number.isNaN(e)&&!Number.isNaN(s)?e-s:String(o??"").localeCompare(String(t??""))}function h_(o,t,e,s){const n=new Map((t||[]).map(r=>[r.key,r])),i=(o||[]).slice().sort((r,a)=>r.priority-a.priority);return(r,a)=>{for(const l of i){const c=n.get(l.key),h=l.direction==="desc"?-1:1,u=l.key===st,d=u?null:ne(c||{key:l.key}),p=u?Mt(r,e):r?r[d]:void 0,f=u?Mt(a,e):a?a[d]:void 0,_=u?String(p??"").localeCompare(String(f??"")):wl(p,f);if(_!==0)return _*h}return 0}}function u_(o,t,e){const s=Gi(t,e);if(!s.length)return o||[];const n=h_(s,e,t);return Bf(o||[],n)}function d_(o,t,e){const s=Array.isArray(o)?o.slice():[],n=Gi(t,e);if(!n.length)return s;const i=new Map((e||[]).map(a=>[a.key,a])),r=n.slice().sort((a,l)=>a.priority-l.priority);return s.sort((a,l)=>{for(const c of r){const h=c.direction==="desc"?-1:1,u=rs(c.key);if(u!=null){const y=a?.depthLabels?.[u]??"",b=l?.depthLabels?.[u]??"",A=String(y).localeCompare(String(b));if(A!==0)return A*h;continue}const d=i.get(c.key),p=c.key===st,f=p?null:ne(d||{key:c.key}),_=p?Mt(a?.row,t):a?.row?a.row[f]:void 0,g=p?Mt(l?.row,t):l?.row?l.row[f]:void 0,m=p?String(_??"").localeCompare(String(g??"")):wl(_,g);if(m!==0)return m*h}return 0}),s}function p_(o){const t=Number(o?.width);if(Number.isFinite(t)&&t>0)return t;const e=Number(o?.minWidth);return Number.isFinite(e)&&e>0?e:Jf}function ji(o){const t=Array.isArray(o)?o.slice():[],e=[],s=[];t.forEach(r=>{if(r?.key===st||se(r?.key)){e.push(r);return}s.push(r)}),e.sort((r,a)=>{const l=rs(r.key),c=rs(a.key);return l!=null&&c!=null?l-c:r.key===st?-1:a.key===st?1:0});const n=[],i=[];return s.forEach(r=>{if(r?.frozen){n.push(r);return}i.push(r)}),[...e,...n,...i]}function f_(o){const t={};let e=0;return(o||[]).forEach(s=>{s?.frozen&&(t[s.key]=e),e+=p_(s)}),t}function __(o){const t=[],e=s=>{s&&(!s.synthetic&&s.row&&t.push(s.row),(s.children||[]).forEach(e))};return(o?.children||[]).forEach(e),t}function g_(o,t,e){const s=__(o),n={[Us]:!0};o?.groupField&&(n[o.groupField]=o.groupValue),(t||[]).forEach(r=>{if(r.key===st||se(r.key))return;const a=ne(r);bl(s,a).length>0&&(n[r.key]=Al(s,a,"sum"))});const i=Mt(n,e);return i!=null&&String(i).trim()!==""?n.text=i:o?.groupValue!=null&&(n.text=String(o.groupValue)),n}function m_(o,t,e){const s=e.expanded||{};if(Object.prototype.hasOwnProperty.call(s,o.path))return!!s[o.path];if(o.row&&typeof o.row.open=="boolean")return o.row.open;const n=e.defaultExpanded;return typeof n=="number"?t<n:n!==!1}function y_(o,t){return!t||!o||o.synthetic?!1:!!(o.row&&o.row[t]===!0)}function Ui(o,t={},e={},s){const n={...t,tableConfig:t.tableConfig||e};if(!(!(t.leavesOnly===!0)&&e?.rows?.subtotals?.enabled===!0))return $f(o,n);const a=t.pinRowKey??e?.rows?.pinRowKey??null,l=t.leafColumns||[],c=[],h=(u,d,p)=>{(u||[]).forEach(f=>{const _=!!(f.children&&f.children.length),g=_?m_(f,d,t):!1,m=Vi(f,e),y=[...p,m];if(c.push({row:f.row,depth:d,path:f.path,synthetic:!!f.synthetic,groupValue:f.groupValue??null,hasChildren:_,expanded:g,depthLabels:y}),_&&g){h(f.children,d+1,y);const b=g_(f,l,e),A=Vi({row:b,synthetic:!1},e);c.push({row:b,depth:d+1,path:`${f.path}/${Us}`,synthetic:!1,subtotal:!0,groupValue:f.groupValue??null,hasChildren:!1,expanded:!1,depthLabels:[...y,A],__scopeRowCount:Array.isArray(s)?s.length:null})}else _&&!g&&a&&f.children.forEach(b=>{y_(b,a)&&h([b],d+1,y)})})};return h(o||[],0,[]),c}function Rl(o,t={}){const e=Array.isArray(t.columns)?t.columns.filter(l=>l&&l.visible!==!1&&l.section!=="actions"&&l.key):null,s=(o||[]).filter(l=>l&&l.row&&!l.synthetic&&!l.subtotal&&!l.row[Us]);if(!e||!e.length){const l=t.includeDepthLabels===!0;return s.map(c=>{if(!l||!Array.isArray(c.depthLabels))return c.row;const h={...c.row};return c.depthLabels.forEach((u,d)=>{h[Oo(d)]=u}),h})}const n=t.tableConfig||{},i=typeof t.formatValue=="function"?t.formatValue:null,r=new Set,a=e.map(l=>{let c=Rf(n,l.key);return r.has(c)&&(c=`${c} (${l.key})`),r.add(c),{header:c,column:l}});return s.map(l=>{const c={};return a.forEach(({header:h,column:u})=>{c[h]=b_(l,u,n,i)}),c})}function b_(o,t,e,s){const n=rs(t.key);if(t.key===st){const r=Array.isArray(o.depthLabels)?o.depthLabels.filter(l=>l!=null&&String(l).trim()!==""):[];if(r.length>1)return r.join(" › ");if(r.length===1)return String(r[0]);const a=Mt(o.row,e);return a==null?"":String(a)}if(n!=null){const r=o.depthLabels?.[n];return r==null?"":String(r)}const i=o.row?.[t.key];if(i!=null&&typeof i=="object")return"";if(s)try{return String(s(o.row,t,i)??"")}catch{return i??""}return i??""}function Yi(o){return o?t_:e_}function A_(o,t){const e=(o||[]).filter(d=>Number.isFinite(d)),s=e.length?Math.min(...e):0,n=e.length?Math.max(...e):0,i=n-s||1,r=s<0,a=n>0;let l=t,c=t/(a?n||1:Math.abs(s)||1);return r&&a?(l=t*n/i,c=t/i):r&&(l=0,c=t/(Math.abs(s)||1)),{min:s,max:n,range:i,zeroY:l,hasNegative:r,valueToY:d=>r&&a?l-d*t/i:r?Math.abs(d)*c:t-d*c,barForValue:(d,p,f)=>{const _=Math.max(1,p-1),g=f*p;if(r&&a){const y=Math.abs(d)*t/i;return d>=0?{x:g,y:l-y,width:_,height:y}:{x:g,y:l,width:_,height:y}}if(r){const y=Math.abs(d)*c;return{x:g,y:0,width:_,height:y}}const m=Math.max(0,d*c);return{x:g,y:t-m,width:_,height:m}}}}function L_(o,t){const e=t?.rows?.conditionalStyle;if(typeof e!="function")return null;try{return e(o)??null}catch{return null}}function He(o,t){const e=t?.rows?.peerRowsKey;if(!e||!o||typeof o!="object")return[];const s=o[e];if(!Array.isArray(s)||!s.length)return[];const n=[];for(let i=0;i<s.length;i+=1){const r=s[i];r&&typeof r=="object"&&r.row&&n.push(r)}return n}function T_(o){const t=o?.key;return t?t===st||se(t):!1}function E_(o,t,e){if(!o)return"";if(T_(t))return o.label!=null?String(o.label):"";const s=o.row;if(!s)return"";const n=t?.metricKey||t?.key,i=n?s[n]:void 0;if(typeof e=="function"){const r=e(s,t,i);return r==null?"":String(r)}return i==null?"":String(i)}const Ki=Object.freeze([{text:"400",value:400},{text:"500",value:500},{text:"600",value:600},{text:"700",value:700}]),ln=14,ie=20,Xi=18,cn="__off__",x_=7,kl=11,S_=Fo,v_=Object.freeze([{text:"None",value:null},...Po.map(o=>({text:Do[o],value:o}))]),Be=Object.freeze({type:"select",nullable:!1,counter:!1,light:!0,inline:!0,dropdownLeft:!1}),C_="inline",w_=["mb-0"],R_={classList:["mb-2"]};class k_{constructor({configuration:t,idPrefix:e,onChange:s,data:n}){this.configuration=t,this.idPrefix=e,this.onChange=s||(()=>{}),this.data=Array.isArray(n)?n:[],this._panels=null,this.#t=null}#t;#e=new Set;get tableConfig(){(!this.configuration.table||typeof this.configuration.table!="object")&&(this.configuration.table=Qo());const t=this.configuration.table;return(!t.header||typeof t.header!="object")&&(t.header={}),(!t.display||typeof t.display!="object")&&(t.display=Mi()),(!t.footer||typeof t.footer!="object")&&(t.footer={}),t}get displayConfig(){return Wi(this.tableConfig.display)}buildSettingsPanels(){return this._panels=new Oe({id:`${this.idPrefix}-table-settings-groups`,multiple:!0,panels:[this.#p(),this.#_(),this.#o()]}),this._panels}render(){return this.buildSettingsPanels().render()}#s(){const t=this.#n(),e=t?.parentElement;!t||!e||(this.#a(t),t.remove(),e.append(this.#C()))}#n(){return this._panels?.__node__?.querySelector(".plotter-table-settings-matrix-wrapper:not(.plotter-table-settings-footer-matrix-wrapper)")||null}#r(){return this.#n()?.querySelector("tbody.plotter-table-settings-matrix-body")||null}#i(t){t instanceof Element&&t.querySelectorAll(".plotter-input-select[id]").forEach(e=>{const s=e.id;s&&document.querySelectorAll(`.plotter-input-select-dropdown[data-trigger-id="${CSS.escape(s)}"]`).forEach(n=>n.remove())})}#a(t){t instanceof Element&&(this.#i(t),t.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),t.removeAttribute("id"))}#l(t){const e=this.#r();if(!e){this.#s();return}const s=Pe(this.data,this.tableConfig).find(r=>r.key===t);if(!s)return;const n=e.querySelector(`tr[data-column-key="${t}"]:not(.plotter-table-settings-matrix-detail-row)`);if(!(n instanceof HTMLTableRowElement)){this.#s();return}this.#a(n);const i=this.#x(s);n.replaceWith(i)}#h(t){if(!this.#e.has(t))return;const e=this.#r();if(!e){this.#s();return}const s=Pe(this.data,this.tableConfig).find(r=>r.key===t);if(!s)return;const n=e.querySelector(`tr.plotter-table-settings-matrix-detail-row[data-column-key="${t}"]`);if(n instanceof HTMLTableRowElement){this.#a(n);const r=this.#v(s);n.replaceWith(r);return}e.querySelector(`tr[data-column-key="${t}"]:not(.plotter-table-settings-matrix-detail-row)`)?.insertAdjacentElement("afterend",replacement)}#p(){return new wt({title:"Display".translate(),icon:D.get("paint-svg",{size:Xi}),open:!0,contents:[this.#y()]})}#y(){const t=document.createElement("div");t.className="plotter-table-settings-display";const e={presetId:wi(this.displayConfig)};return t.append(this.#c({suffix:"table-display-preset",legend:"Display preset",fields:[{label:"Display preset".translate(),input:new J({id:`${this.idPrefix}-table-display-preset`,type:"select",nullable:!1,light:!0,inline:!0,list:e,key:"presetId",items:df(this.displayConfig),callbacks:{input:s=>{s!==as&&(Wo(this.tableConfig,s),e.presetId=s,this.#T(),this.onChange())}}})}]}).render()),t.append(this.#L()),t}#L(){const t=document.createElement("details");t.className="plotter-table-settings-accordion";const e=document.createElement("summary");e.className="plotter-table-settings-accordion-summary",e.textContent="Advanced".translate(),t.append(e);const s=document.createElement("div");s.className="plotter-table-settings-accordion-body";const n=this.displayConfig,i=l=>this.#u(l),r=(l,c,h)=>[i({id:`${this.idPrefix}-table-display-${l}-enabled`,label:h,list:c,key:"enabled",type:"switch"}),i({id:`${this.idPrefix}-table-display-${l}-width`,label:"Border width",list:c,key:"width",type:"number",min:0,max:8,step:.5,unit:"px"}),i({id:`${this.idPrefix}-table-display-${l}-opacity`,label:"Border opacity",list:c,key:"opacity",type:"number",min:0,max:1,step:.01}),i({id:`${this.idPrefix}-table-display-${l}-color`,label:"Border color",list:c,key:"color",type:"text"})],a=(l,c,h,u,d,p)=>[i({id:`${this.idPrefix}-table-display-${l}-enabled`,label:h,list:c,key:"enabled",type:"switch"}),i({id:`${this.idPrefix}-table-display-${l}-width`,label:u,list:c,key:"width",type:"number",min:0,max:8,step:.5,unit:"px"}),i({id:`${this.idPrefix}-table-display-${l}-opacity`,label:d,list:c,key:"opacity",type:"number",min:0,max:1,step:.01}),i({id:`${this.idPrefix}-table-display-${l}-color`,label:p,list:c,key:"color",type:"text"})];return[this.#c({suffix:"table-display-borders-table",legend:"Borders",fields:r("border-table",n.borders.table,"Table border")}),this.#c({suffix:"table-display-borders-columns",legend:"Column borders",fields:r("border-columns",n.borders.columns,"Column borders")}),this.#c({suffix:"table-display-borders-rows",legend:"Row borders",fields:r("border-rows",n.borders.rows,"Row borders")}),this.#c({suffix:"table-display-stripe",legend:"Stripe",fields:[i({id:`${this.idPrefix}-table-display-stripe-enabled`,label:"Striped rows",list:n.stripe,key:"enabled",type:"switch"}),i({id:`${this.idPrefix}-table-display-stripe-opacity`,label:"Stripe opacity",list:n.stripe,key:"opacity",type:"number",min:0,max:1,step:.01}),i({id:`${this.idPrefix}-table-display-stripe-color`,label:"Stripe color",list:n.stripe,key:"color",type:"text"})]}),this.#c({suffix:"table-display-hierarchy-bracket",legend:"Hierarchy",fields:((!this.tableConfig.rows||typeof this.tableConfig.rows!="object")&&(this.tableConfig.rows={}),[...be(this.data,this.tableConfig)?[i({id:`${this.idPrefix}-table-rows-flat`,label:"Flat hierarchy",list:this.tableConfig.rows,key:"flat",type:"switch"})]:[],...a("hierarchy-bracket",n.hierarchy.columnGroups.bracket,"Column group brackets","Bracket width","Bracket opacity","Bracket color")])}),this.#c({suffix:"table-display-hierarchy-tree",legend:"Row tree lines",fields:a("hierarchy-tree",n.hierarchy.rows.treeLines,"Row tree lines","Tree line width","Tree line opacity","Tree line color")}),this.#c({suffix:"table-display-colors",legend:"Colors",fields:[i({id:`${this.idPrefix}-table-display-header-bg`,label:"Header background",list:n.colors,key:"headerBackground",type:"text"}),i({id:`${this.idPrefix}-table-display-footer-bg`,label:"Footer background",list:n.colors,key:"footerBackground",type:"text"})]}),this.#c({suffix:"table-display-density",legend:"Density",fields:[i({id:`${this.idPrefix}-table-display-padding-y`,label:"Cell padding Y",list:n.density,key:"cellPaddingY",type:"number",min:0,unit:"px"}),i({id:`${this.idPrefix}-table-display-padding-x`,label:"Cell padding X",list:n.density,key:"cellPaddingX",type:"number",min:0,unit:"px"})]}),this.#c({suffix:"table-display-typography-cell",legend:"Cell",fields:[i({id:`${this.idPrefix}-table-display-cell-font-size`,label:"Cell font size",list:n.typography.cell,key:"fontSize",type:"number",min:11,max:18,unit:"px"}),i({id:`${this.idPrefix}-table-display-cell-font-weight`,label:"Cell font weight",list:n.typography.cell,key:"fontWeight",type:"select",items:Ki})]}),this.#c({suffix:"table-display-typography-header",legend:"Header",fields:[i({id:`${this.idPrefix}-table-display-header-font-size`,label:"Header font size",list:n.typography.header,key:"fontSize",type:"number",min:11,max:18,unit:"px"}),i({id:`${this.idPrefix}-table-display-header-font-weight`,label:"Header font weight",list:n.typography.header,key:"fontWeight",type:"select",items:Ki})]}),this.#c({suffix:"table-display-typography-footer",legend:"Footer",fields:[i({id:`${this.idPrefix}-table-display-footer-font-size`,label:"Footer font size",list:n.typography.footer,key:"fontSize",type:"number",min:11,max:18,unit:"px"}),i({id:`${this.idPrefix}-table-display-footer-font-weight`,label:"Footer font weight",list:n.typography.footer,key:"fontWeight",type:"select",items:Ki})]})].forEach(l=>s.append(l.render())),t.append(s),t}#T(){const t=this._panels?.__node__?.querySelector(".plotter-table-settings-display"),e=t?.querySelector(".plotter-table-settings-accordion");!t||!e||(e.remove(),t.append(this.#L()))}#u({id:t,label:e,description:s,list:n,key:i,type:r,items:a,min:l,max:c,step:h,unit:u,valueTransform:d}){return{label:e.translate(),description:s?.translate?.()??s,input:new J({id:t,list:n,key:i,type:r,items:a,min:l,max:c,step:h,unit:u,callbacks:{input:p=>{const f=r==="number"?this.#m(p):p;n[i]=d?d(f):f,this.onChange()}}})}}#c({suffix:t,legend:e,fields:s,documentation:n}){return new bi({id:`${this.idPrefix}-${t}`,legend:e.translate(),layout:C_,classList:w_,wrapper:R_,documentation:n,fields:s})}#m(t){if(t===""||t==null||typeof t=="number")return t;const e=Number(t);return Number.isNaN(e)?t:e}#o(){return new wt({title:"Footer".translate(),icon:D.get("table-svg",{size:Xi}),open:!1,contents:[this.#A()]})}#A(){const t=document.createElement("div");t.className="plotter-table-settings-matrix-wrapper plotter-table-settings-footer-matrix-wrapper";const e=document.createElement("table");e.className="plotter-table-settings-matrix plotter-table-settings-footer-matrix",e.id=`${this.idPrefix}-table-footer-settings-matrix`;const s=document.createElement("thead"),n=document.createElement("tr");this.#S(n,"type","Column".translate()),this.#S(n,"visible","Visible in footer".translate()),this.#S(n,"aggregate","Aggregate".translate()),this.#g(n,"gauge","gauge-horizontal-svg","Choose a gauge display preset for this footer column.",ie),this.#g(n,"indicator","arrow-up-svg","Choose an indicator preset for this footer column.",ie),this.#g(n,"sparkline","lines-svg","Choose a sparkline preset for this footer column.",ie),this.#g(n,"colors","paint-svg","Colorize footer cell values by sign.",ie),s.append(n),e.append(s);const i=document.createElement("tbody");i.className="plotter-table-settings-matrix-body";const r=Di(this.data,this.tableConfig);if(r.length)r.forEach(a=>i.append(this.#E(a)));else{const a=document.createElement("tr"),l=document.createElement("td");l.colSpan=x_,l.className="plotter-table-settings-matrix-empty",l.textContent="No column available".translate(),a.append(l),i.append(a)}return e.append(i),t.append(e),t}#E(t){const e=document.createElement("tr");e.setAttribute("data-column-key",t);const s=document.createElement("td");s.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-type",s.textContent=ye(this.tableConfig,t),e.append(s);const n=this.#P(t);return e.append(this.#R(t,"footer-visible",n.visible!==!1,i=>{n.visible=i,this.onChange()})),e.append(this.#d(t,n)),e.append(this.#F(t,n,"footer")),e.append(this.#w(t,n,"footer")),e.append(this.#G(t,n,"footer")),e.append(this.#R(t,"footer-colors",!!n.colorized,i=>{n.colorized=i,this.onChange()})),e}#d(t,e){const s=document.createElement("td");s.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-preset";const n={aggregate:e.aggregate??null},i=new J({id:`${this.idPrefix}-table-footer-${t}-aggregate`,...Be,nullable:!0,list:n,key:"aggregate",classList:["plotter-table-settings-matrix-preset-input"],props:{"data-toggle":"footer-aggregate","data-column":t},items:v_.map(r=>({text:r.text.translate(),value:r.value})),callbacks:{input:r=>{e.aggregate=r||null,n.aggregate=e.aggregate,this.onChange()}}});return s.append(i.render()),s}#_(){return new wt({title:"Columns".translate(),icon:D.get("table-svg",{size:Xi}),open:!1,contents:[this.#C()]})}#C(){const t=document.createElement("div");t.className="plotter-table-settings-matrix-wrapper";const e=document.createElement("table");e.className="plotter-table-settings-matrix",e.id=`${this.idPrefix}-table-settings-matrix`;const s=document.createElement("thead"),n=document.createElement("tr");this.#S(n,"drag",""),this.#S(n,"remove",""),this.#S(n,"expand",""),this.#S(n,"type","Column".translate()),this.#g(n,"pin","lock-svg","Pin or unpin this column. Pinned columns stay visible when their group is collapsed."),this.#S(n,"frozen",""),this.#g(n,"gauge","gauge-horizontal-svg","Choose a gauge display preset for this column.",ie),this.#g(n,"indicator","arrow-up-svg","Choose an indicator preset for this column.",ie),this.#g(n,"sparkline","lines-svg","Show a sparkline next to the cell value when enabled.",ie),this.#g(n,"colors","paint-svg","Colorize numeric values by sign (green for positive, red for negative).",ie),s.append(n),e.append(s);const i=document.createElement("tbody");i.className="plotter-table-settings-matrix-body",i.addEventListener("dragover",a=>this.#Z(a)),i.addEventListener("drop",a=>this.#V(a));const r=Pe(this.data,this.tableConfig);if(r.length)r.forEach(a=>{i.append(this.#x(a)),this.#e.has(a.key)&&i.append(this.#v(a))});else{const a=document.createElement("tr"),l=document.createElement("td");l.colSpan=kl,l.className="plotter-table-settings-matrix-empty",l.textContent="No column available".translate(),a.append(l),i.append(a)}return e.append(i),t.append(e),t.append(this.#f()),t}#S(t,e,s){const n=document.createElement("th");n.className=`plotter-table-settings-matrix-th plotter-table-settings-matrix-th-${e}`,n.textContent=s,t.append(n)}#g(t,e,s,n,i=ln){const r=document.createElement("th");r.className=`plotter-table-settings-matrix-th plotter-table-settings-matrix-th-${e} plotter-table-settings-matrix-th-icon`,r.setAttribute("title",n.translate());const a=D.get(s,{size:i,className:"plotter-icon",fill:"currentColor"});a!=null&&r.append(a),t.append(r)}#f(){const t=el(this.data,this.tableConfig),e=document.createElement("div");if(e.className="plotter-table-settings-matrix-add",!t.length)return e.hidden=!0,e;const s={columnKey:null},n=[{text:"Select column…",value:null,active:!1}];t.forEach(a=>{n.push({text:ye(this.tableConfig,a),value:a})});const i=new J({id:`${this.idPrefix}-table-matrix-add-select`,...Be,nullable:!0,list:s,key:"columnKey",classList:["plotter-table-settings-matrix-preset-input","plotter-table-settings-matrix-add-select"],props:{"data-toggle":"add-column"},items:n,callbacks:{input:a=>{a&&(il(this.tableConfig,a),s.columnKey="",this.onChange(),this.#s())}}}),r=new vt({id:`${this.idPrefix}-table-matrix-add-column`,icon:D.get("plus-svg",{size:ln,className:"plotter-icon",fill:"currentColor"}),title:"Add a column from the available list".translate(),classList:["transparent","plotter-table-settings-matrix-add-button"],callbacks:{click:()=>{const a=i.__node__;a&&a.click()}}});return e.append(r.render(),i.render()),e}#x(t){const e=document.createElement("tr");e.setAttribute("data-column-key",t.key),e.draggable=!0,e.addEventListener("dragstart",r=>this.#M(r,t.key)),e.addEventListener("dragend",()=>this.#k());const s=document.createElement("td");s.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-drag";const n=document.createElement("span");n.className="plotter-table-settings-drag-handle",n.setAttribute("title","Drag to reorder".translate()),n.textContent="⋮⋮",s.append(n),e.append(s),e.append(this.#$(t.key)),e.append(this.#D(t.key)),e.append(this.#B(t.key));const i=this.#Q(t.key);return e.append(this.#R(t.key,"pinned",t.pinned,r=>{i.pinned=r,this.onChange()})),e.append(this.#R(t.key,"frozen",!!i.frozen,r=>{i.frozen=r,i.frozen&&rl(this.tableConfig),this.onChange(),this.#s()})),e.append(this.#F(t.key,i)),e.append(this.#w(t.key,i)),e.append(this.#G(t.key,i)),e.append(this.#R(t.key,"colors",t.colors,r=>{i.colorized=r,this.onChange(),this.#s()})),e}#v(t){const e=document.createElement("tr");e.className="plotter-table-settings-matrix-detail-row",e.setAttribute("data-column-key",t.key);const s=document.createElement("td");s.colSpan=kl,s.className="plotter-table-settings-matrix-detail-cell";const n=this.#Q(t.key),i=r=>this.#u(r);return s.append(this.#c({suffix:`table-matrix-${t.key}-detail`,legend:"Column settings",fields:[i({id:`${this.idPrefix}-table-matrix-${t.key}-sortable`,label:"Sortable",list:n,key:"sortable",type:"switch",valueTransform:r=>!!r}),i({id:`${this.idPrefix}-table-matrix-${t.key}-searchable`,label:"Searchable",list:n,key:"searchable",type:"switch"}),i({id:`${this.idPrefix}-table-matrix-${t.key}-label`,label:"Label",list:n,key:"label",type:"text"}),i({id:`${this.idPrefix}-table-matrix-${t.key}-unit`,label:"Unit",list:n,key:"unit",type:"text"}),i({id:`${this.idPrefix}-table-matrix-${t.key}-align`,label:"Align",list:n,key:"align",type:"select",items:S_.map(r=>({text:r.text.translate(),value:r.value}))}),i({id:`${this.idPrefix}-table-matrix-${t.key}-subtitle`,label:"Subtitle",list:n,key:"subtitle",type:"text"}),i({id:`${this.idPrefix}-table-matrix-${t.key}-tooltip`,label:"Tooltip",list:n,key:"tooltip",type:"text"})]}).render()),s.append(this.#c({suffix:`table-matrix-${t.key}-visualizations`,legend:"Cell visualizations",fields:this.#I(t.key,n)}).render()),e.append(s),e}#D(t){const e=document.createElement("td");e.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-expand";const s=this.#e.has(t),n=new vt({id:`${this.idPrefix}-table-matrix-expand-${t}`,icon:D.get(s?"drop-down-svg":"drop-right-svg",{size:ln,className:"plotter-icon",fill:"currentColor"}),title:(s?"Collapse column settings":"Expand column settings").translate(),classList:["transparent","plotter-table-settings-matrix-expand-button"],callbacks:{click:()=>{s?this.#e.delete(t):this.#e.add(t),this.#s()}}});return e.append(n.render()),e}#B(t){const e=document.createElement("td");if(e.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-type",t===st)return e.textContent=ye(this.tableConfig,t),e;const s={columnKey:t},n=new J({id:`${this.idPrefix}-table-matrix-${t}-column-key`,...Be,list:s,key:"columnKey",classList:["plotter-table-settings-matrix-preset-input","plotter-table-settings-matrix-column-input"],props:{"data-toggle":"column-key","data-column":t},items:Cf(this.data,this.tableConfig,t),callbacks:{input:i=>{!i||i===t||(wf(this.tableConfig,t,i),this.onChange(),this.#s())}}});return e.append(n.render()),e}#$(t){const e=document.createElement("td");if(e.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-remove",t===st)return e;const n=new vt({id:`${this.idPrefix}-table-matrix-remove-${t}`,icon:D.get("cross-svg",{size:ln}),title:"Remove column from the table".translate(),classList:["transparent","plotter-table-settings-matrix-remove-button"],callbacks:{click:()=>{kf(this.tableConfig,t),this.onChange(),this.#s()}}});return e.append(n.render()),e}#F(t,e,s="header"){const n=document.createElement("td");n.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-preset";const i=document.createElement("div");i.className="plotter-table-settings-matrix-preset-stack";const r={presetId:Go(e.gauge)},a=new J({id:this.#N(t,"gauge-preset",s),...Be,list:r,key:"presetId",classList:["plotter-table-settings-matrix-preset-input"],props:{"data-toggle":"gauge-preset","data-column":t},items:_f(e.gauge),callbacks:{input:l=>{l!==Zs&&(ff(e,l),r.presetId=l,this.onChange(),this.#l(t))}}});return i.append(a.render()),n.append(i),n}#w(t,e,s="header"){const n=document.createElement("td");n.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-preset";const i={presetId:jo(e.indicator)},r=new J({id:this.#N(t,"indicator-preset",s),...Be,list:i,key:"presetId",classList:["plotter-table-settings-matrix-preset-input"],props:{"data-toggle":"indicator-preset","data-column":t},items:yf(e.indicator),callbacks:{input:a=>{a!==Qs&&(mf(e,a),i.presetId=a,this.onChange(),this.#l(t))}}});return n.append(r.render()),n}#G(t,e,s="header"){const n=document.createElement("td");n.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-preset";const i={presetId:Uo(e.sparkline)},r=new J({id:this.#N(t,"sparkline-preset",s),...Be,list:i,key:"presetId",classList:["plotter-table-settings-matrix-preset-input"],props:{"data-toggle":"sparkline-preset","data-column":t},items:Lf(e.sparkline),callbacks:{input:a=>{a!==qs&&(Af(e,a),i.presetId=a,this.onChange(),this.#l(t))}}});return n.append(r.render()),n}#N(t,e,s){const n=s==="footer"?"footer-matrix":"matrix";return`${this.idPrefix}-table-${n}-${t}-${e}`}#R(t,e,s,n){const i=document.createElement("td");i.className="plotter-table-settings-matrix-cell plotter-table-settings-matrix-cell-toggle";const r=document.createElement("input");return r.type="checkbox",r.checked=s,r.setAttribute("data-toggle",e),r.setAttribute("data-column",t),r.className="plotter-table-settings-matrix-input",r.id=`${this.idPrefix}-table-matrix-${t}-${e}`,r.addEventListener("change",()=>n(r.checked)),i.append(r),i}#M(t,e){this.#t=e,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e);const s=t.currentTarget;s&&s.classList&&s.classList.add("plotter-table-settings-matrix-row--dragging")}#k(){this.#t=null,this._panels?.__node__?.querySelectorAll(".plotter-table-settings-matrix-row--dragging").forEach(t=>t.classList.remove("plotter-table-settings-matrix-row--dragging"))}#Z(t){t.preventDefault(),t.dataTransfer.dropEffect="move"}#V(t){t.preventDefault();const e=this.#t||t.dataTransfer.getData("text/plain"),s=t.target.closest("tr[data-column-key]");if(!e||!s)return;const n=s.getAttribute("data-column-key");!n||e===n||this.#H(e,n)}#H(t,e){const s=Pe(this.data,this.tableConfig),n=s.findIndex(l=>l.key===t),i=s.findIndex(l=>l.key===e);if(n<0||i<0)return;const r=s.slice(),[a]=r.splice(n,1);r.splice(i,0,a),r.forEach((l,c)=>{this.#Q(l.key).order=c}),this.onChange(),this.#s()}#I(t,e){const s=[this.#tt({columnKey:t,branchKey:"gauge",label:"Gauge type",branch:e.gauge,allowedTypes:Ti,normalize:gt}),this.#O({columnKey:t,branchKey:"gauge",label:"Gauge value column",branch:e.gauge})];return e.gauge.enabled&&e.gauge.type==="progress"&&s.push(this.#W({columnKey:t,branchKey:"gauge",label:"Gauge position",branch:e.gauge,positions:Vo(),normalize:gt})),s.push(this.#J({columnKey:t,branchKey:"gauge",branch:e.gauge}),this.#tt({columnKey:t,branchKey:"indicator",label:"Indicator type",branch:e.indicator,allowedTypes:Si,normalize:At}),this.#O({columnKey:t,branchKey:"indicator",label:"Indicator value column",branch:e.indicator})),e.indicator.enabled&&s.push(this.#W({columnKey:t,branchKey:"indicator",label:"Indicator position",branch:e.indicator,positions:vi,normalize:At})),s.push(this.#J({columnKey:t,branchKey:"indicator",branch:e.indicator}),this.#tt({columnKey:t,branchKey:"sparkline",label:"Sparkline type",branch:e.sparkline,allowedTypes:Ei,normalize:mt}),this.#O({columnKey:t,branchKey:"sparkline",label:"Sparkline value column",branch:e.sparkline,configKey:"key"})),e.sparkline.enabled&&s.push(this.#W({columnKey:t,branchKey:"sparkline",label:"Sparkline position",branch:e.sparkline,positions:xi,normalize:mt})),s.push(this.#J({columnKey:t,branchKey:"sparkline",branch:e.sparkline})),s.push(this.#j(t,e,"Value column (colorized / sort)".translate())),s}#O({columnKey:t,branchKey:e,branch:s,configKey:n="metricKey",label:i="Value column"}){const a=this.#Q(t)[e]||s,l=Di(this.data,this.tableConfig).filter(h=>ls(this.data,h)),c=[{text:"Default (column value)".translate(),value:""},...l.map(h=>({text:ye(this.tableConfig,h),value:h}))];return{label:i.translate(),input:new J({id:`${this.idPrefix}-table-matrix-${t}-${e}-metric-key`,type:"select",list:a,key:n,nullable:!0,items:c,callbacks:{input:h=>{const u=this.tableConfig?.header?.[t]?.[e];u&&(u[n]=h?String(h):null),this.onChange()}}})}}#j(t,e,s="Value column"){const n=this.#Q(t),i=Di(this.data,this.tableConfig).filter(a=>ls(this.data,a)),r=[{text:"Default (column value)".translate(),value:""},...i.map(a=>({text:ye(this.tableConfig,a),value:a}))];return{label:s.translate(),input:new J({id:`${this.idPrefix}-table-matrix-${t}-metric-key`,type:"select",list:n,key:"metricKey",nullable:!0,items:r,callbacks:{input:a=>{n.metricKey=a?String(a):null,this.onChange()}}})}}#lt(t,e){return this.tableConfig?.header?.[t]?.[e]||null}#J({columnKey:t,branchKey:e,branch:s}){return{label:"Colorize".translate(),input:new J({id:`${this.idPrefix}-table-matrix-${t}-${e}-colorize`,type:"switch",list:s,key:"colorize",callbacks:{input:n=>{const i=this.#lt(t,e);i&&(i.colorize=!!n),this.onChange()}}})}}#tt({columnKey:t,branchKey:e,label:s,branch:n,allowedTypes:i,normalize:r}){const a={visualizationType:n.enabled?n.type:cn},l=[{text:"Off".translate(),value:cn},...i.map(c=>({text:this.#it(c),value:c}))];return{label:s.translate(),input:new J({id:`${this.idPrefix}-table-matrix-${t}-${e}-type`,type:"select",nullable:!1,counter:!1,light:!0,inline:!0,list:a,key:"visualizationType",items:l,callbacks:{input:c=>{const h=this.#lt(t,e);h&&(c===cn?h.enabled=!1:(h.enabled=!0,h.type=c),Object.assign(h,r(h)),a.visualizationType=h.enabled?h.type:cn,this.onChange(),this.#h(t))}}})}}#W({columnKey:t,branchKey:e,label:s,branch:n,positions:i,normalize:r}){return{label:s.translate(),input:new J({id:`${this.idPrefix}-table-matrix-${t}-${e}-position`,type:"select",nullable:!1,counter:!1,light:!0,inline:!0,list:n,key:"position",items:i.map(a=>({text:this.#it(a),value:a})),callbacks:{input:a=>{const l=this.#lt(t,e);l&&(l.enabled=!0,l.position=a,Object.assign(l,r(l)),this.onChange())}}})}}#it(t){return t.charAt(0).toUpperCase()+t.slice(1)}#st(t){const e=Lt();return t.gauge=gt({...e.gauge,...t.gauge||{}}),t.indicator=At({...e.indicator,...t.indicator||{}}),t.sparkline=mt({...e.sparkline,...t.sparkline||{}}),t}#Q(t){const e=this.tableConfig.header;return e[t]||(e[t]=Lt()),this.#st(e[t])}#P(t){const e=this.tableConfig.footer;return(!e||typeof e!="object")&&(this.tableConfig.footer={}),this.tableConfig.footer[t]||(this.tableConfig.footer[t]=Lt()),this.#st(this.tableConfig.footer[t])}}function N_({configuration:o,idPrefix:t,onChange:e,data:s}){return new k_({configuration:o,idPrefix:t,onChange:e,data:s}).buildSettingsPanels()}const hn=0,Zi=1,Qi=2,qi=3,un=4,Rt=5,M_=5,I_=Object.freeze(["#4E79A7","#59A14F","#E15759","#4E79A7","#F28E2B","#00897B","#7A4FC4","#E0A800","#E87BA4","#2BAE66","#C0392B","#3B6FE0","#F8663C","#4DB6AC","#A78BDA","#F2C94C","#5C6B73","#8D6E63"]),O_=.618033988749895,P_=Object.freeze(["hsl(200, 70%, 50%)","hsl(150, 70%, 50%)","hsl(25, 70%, 50%)","hsl(280, 70%, 50%)","hsl(350, 70%, 50%)","hsl(170, 70%, 50%)","hsl(60, 70%, 50%)","hsl(320, 70%, 50%)"]),Nl="hsla(205, 50, 71, 0.4)",Ml="rgba(0, 0, 0, 0.2)",D_="#000000";class Q{static palette;static init(){Q.palette||Q.setPalette()}static setPalette(t){const e=Array.isArray(t)&&t.length?t:I_;Q.palette=e.slice()}static setCustomPalette(t){Q.setPalette(t)}static getContrastingInk(t,e){const s=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!s)return e;const n=[0,2,4].map(r=>parseInt(s[1].slice(r,r+2),16)/255).map(r=>r<=.03928?r/12.92:((r+.055)/1.055)**2.4);return .2126*n[0]+.7152*n[1]+.0722*n[2]>.4?e:"#FFFFFF"}static getWaterfallColors(){Q.#t();const t=Q.palette;return{net:t[hn],Up:t[Zi],Down:t[Qi]}}static getMonochromePairColors(){Q.#t();const t=Rt,e=Q.palette,s=e.slice(t);return F_(s)&&e[t+2]?{bars:e[t+2],line:e[t]}:null}static getComparisonColors(t=!1){Q.#t();const e=Q.palette;return t?{start:e[qi],end:e[un],default:Nl,other:Ml}:[e[qi],e[un],Ml,Nl]}static getAnomalyColors(){Q.#t();const t=Q.palette;return{area:t[hn],sumValueLine:t[hn],pointValueLine:t[hn],other:[t[un],t[Rt+1],t[Rt+5]],upperAnomaly:t[Zi],lowerAnomaly:t[Qi],reference:D_,denominator:t[Rt+3]}}static getAssessColors(){Q.#t();const t=Q.palette;return{firstArea:t[qi],secondArea:t[un],Up:t[Zi],Down:t[Qi]}}static generateGoldenRatioColors(t,e=!1,s=!1,n=!1){const i=P_.slice();n&&i.reverse();const r=new Map;let a=0;const l=s?60:70,c=s?80:50,h=p=>{if(r.has(p))return r.get(p);let f;return a<i.length?f=i[a]:f=`hsl(${(a*O_*360%360).toFixed(0)}, ${l}%, ${c}%)`,r.set(p,f),a+=1,f},u=t.map(h);if(!e)return u;const d={};for(let p=0;p<t.length;p+=1)d[t[p]]=u[p];return d}static getPlotColors(t,e=!1){Q.#t();const s=Q.palette.filter((h,u)=>u>=Rt),n=(h,u)=>{const d={};for(let p=0;p<h.length;p+=1)d[h[p]]=u[p];return d};if(!(t.length+Rt>Q.palette.length)){const h=s.filter((u,d)=>d<t.length);return e?n(t,h):h}const r=t.map((h,u)=>u),a=s.length/r.length,l=window.d3.scaleLinear().domain(s.map((h,u)=>u)).range(s),c=r.map(h=>window.d3.color(l(h*a)).formatHex());return e?n(t,c):c}static getRangeColors(t,e,s=.5){return window.d3.scaleLinear().domain([0,1]).range([t,e])(s)}static#t(){Q.palette||Q.setPalette()}}function F_(o){if(!Array.isArray(o)||o.length<3)return!1;const t=o.map(i=>H_(i)).filter(Boolean);if(t.length!==o.length)return!1;if(t.every(i=>i.s<=.12))return!0;const s=t.map(i=>i.h);let n=0;for(let i=0;i<s.length;i+=1)for(let r=i+1;r<s.length;r+=1){const a=Math.abs(s[i]-s[r]),l=Math.min(a,360-a);l>n&&(n=l)}return n<=28}function H_(o){const t=/^#?([0-9a-f]{6})$/i.exec(String(o||"").trim());if(!t)return null;const e=parseInt(t[1].slice(0,2),16)/255,s=parseInt(t[1].slice(2,4),16)/255,n=parseInt(t[1].slice(4,6),16)/255,i=Math.max(e,s,n),r=Math.min(e,s,n),a=(i+r)/2;if(i===r)return{h:0,s:0};const l=i-r,c=a>.5?l/(2-i-r):l/(i+r);let h;return i===e?h=(s-n)/l+(s<n?6:0):i===s?h=(n-e)/l+2:h=(e-s)/l+4,{h:h*60,s:c}}const B_=Object.freeze(["Net","Up","Down","Start","End"]),z_="#808080";class V_{constructor({idPrefix:t,getPalette:e,onPaletteChange:s}){this.idPrefix=t,this.getPalette=typeof e=="function"?e:(()=>[]),this.onPaletteChange=typeof s=="function"?s:null,this.#t=null,this.#e=null,this.#s=!1}#t;#e;#s;buildNode(){const t=document.createElement("div");return t.className="plotter-colors-swatch-preview",t.id=`${this.idPrefix}-swatches`,this.#t=t,this.#i(t),t}refresh(){this.#t&&this.#i(this.#t)}#n(){const t=this.getPalette();return Array.isArray(t)?t.slice():[]}#r(t,e){e&&this.#t&&this.#i(this.#t),this.onPaletteChange?.(t.slice())}#i(t){for(;t.firstChild;)t.removeChild(t.firstChild);const e=this.#n(),s=e.slice(0,M_),n=e.slice(Rt);t.append(this.#a("Semantic".translate(),s,0,i=>B_[i]||String(i+1),{reorderable:!1,showAddButton:!1})),t.append(this.#a("Chart".translate(),n,Rt,i=>String(i-Rt+1),{reorderable:!0,showAddButton:!0}))}#a(t,e,s,n,i){const r=i.reorderable===!0,a=i.showAddButton===!0,l=document.createElement("div");l.className="plotter-colors-swatch-preview__group";const c=document.createElement("div");c.className="plotter-colors-swatch-preview__group-label",c.textContent=t,l.append(c);const h=document.createElement("div");return h.className="plotter-colors-swatch-preview__row",r&&(h.classList.add("plotter-colors-swatch-preview__row--chart"),h.addEventListener("dragover",u=>this.#m(u)),h.addEventListener("drop",u=>this.#A(u)),h.addEventListener("dragleave",u=>this.#o(u))),e.forEach((u,d)=>{const p=s+d;h.append(this.#l(u,p,n(p),{reorderable:r}))}),a&&h.append(this.#p()),l.append(h),l}#l(t,e,s,n){const i=n.reorderable===!0,r=t||"#000000",a=document.createElement(i?"div":"label");a.className="plotter-colors-swatch",a.dataset.paletteIndex=String(e),a.title=`${s}: ${r}`;const l=document.createElement("input");l.type="color",l.className="plotter-colors-swatch__input",l.value=r.length===7?r:"#000000",l.setAttribute("aria-label","Edit color {caption}".translate({caption:s})),l.addEventListener("input",u=>{const d=u.target?.value;typeof d=="string"&&this.#y(e,d,a)});const c=document.createElement("span");c.className="plotter-colors-swatch__chip",c.style.backgroundColor=r;const h=document.createElement("span");return h.className="plotter-colors-swatch__caption",h.textContent=s,i?(a.classList.add("plotter-colors-swatch--reorderable"),a.draggable=!0,a.title=`${s}: ${r} — ${"Drag to reorder".translate()}`,l.classList.add("plotter-colors-swatch__input--programmatic"),c.addEventListener("click",u=>{if(u.preventDefault(),u.stopPropagation(),this.#s){this.#s=!1;return}if(typeof l.showPicker=="function"){l.showPicker();return}l.click()}),a.addEventListener("dragstart",u=>this.#u(u,e)),a.addEventListener("dragend",()=>this.#c()),a.append(l,c,this.#h(e),h),a):(a.append(l,c,h),a)}#h(t){const e=document.createElement("button");e.type="button",e.className="plotter-colors-swatch__remove",e.title="Remove chart color".translate(),e.setAttribute("aria-label","Remove chart color".translate()),e.addEventListener("mousedown",n=>n.stopPropagation()),e.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.#T(t)});const s=D.get("cross-svg",{size:10});return s?e.append(s):e.textContent="×",e}#p(){const t=document.createElement("button");t.type="button",t.className="plotter-colors-swatch plotter-colors-swatch--add",t.title="Add chart color".translate(),t.setAttribute("aria-label","Add chart color".translate());const e=document.createElement("span");e.className="plotter-colors-swatch__chip plotter-colors-swatch__chip--add";const s=D.get("plus-svg",{size:14});s?e.append(s):e.textContent="+";const n=document.createElement("span");return n.className="plotter-colors-swatch__caption",n.textContent="Add".translate(),t.append(e,n),t.addEventListener("click",()=>this.#L()),t}#y(t,e,s){const n=this.#n();!Number.isInteger(t)||t<0||t>=n.length||(n[t]=e,this.#E(s,e),this.#r(n,!1))}#L(){const t=this.#n(),e=t.slice(Rt),s=e[e.length-1]||t[t.length-1]||z_;t.push(s),this.#r(t,!0)}#T(t){if(!Number.isInteger(t)||t<Rt)return;const e=this.#n();t>=e.length||(e.splice(t,1),this.#r(e,!0))}#u(t,e){if(t.target.closest(".plotter-colors-swatch__remove")){t.preventDefault();return}this.#e=e,this.#s=!1,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(e));const s=t.currentTarget;s?.classList&&s.classList.add("plotter-colors-swatch--dragging")}#c(){this.#e!=null&&(this.#s=!0),this.#e=null,this.#t?.querySelectorAll(".plotter-colors-swatch--dragging").forEach(t=>t.classList.remove("plotter-colors-swatch--dragging")),this.#t?.querySelectorAll(".plotter-colors-swatch--drop-target").forEach(t=>t.classList.remove("plotter-colors-swatch--drop-target"))}#m(t){const e=t.target.closest(".plotter-colors-swatch--reorderable");e&&(t.preventDefault(),t.dataTransfer.dropEffect="move",this.#t?.querySelectorAll(".plotter-colors-swatch--drop-target").forEach(s=>s.classList.remove("plotter-colors-swatch--drop-target")),e.classList.add("plotter-colors-swatch--drop-target"))}#o(t){const e=t.currentTarget,s=t.relatedTarget;s instanceof Node&&e.contains(s)||this.#t?.querySelectorAll(".plotter-colors-swatch--drop-target").forEach(n=>n.classList.remove("plotter-colors-swatch--drop-target"))}#A(t){t.preventDefault();const e=t.target.closest(".plotter-colors-swatch--reorderable"),s=this.#e!=null?String(this.#e):t.dataTransfer.getData("text/plain"),n=Number.parseInt(s,10),i=Number.parseInt(e?.dataset?.paletteIndex,10);if(this.#c(),!Number.isInteger(n)||!Number.isInteger(i)||n<Rt||i<Rt||n===i)return;const r=this.#n();if(n>=r.length||i>=r.length)return;const[a]=r.splice(n,1);r.splice(i,0,a),this.#r(r,!0)}#E(t,e){if(!t||typeof e!="string")return;const s=t.querySelector(".plotter-colors-swatch__chip");s&&(s.style.backgroundColor=e);const n=t.querySelector(".plotter-colors-swatch__caption")?.textContent||"";t.title=n?`${n}: ${e}`:e}}function $_(o){if(typeof o!="string"||!o.startsWith("#"))return-1;Q.init();const t=o.toLowerCase();return(Q.palette||[]).findIndex(e=>String(e).toLowerCase()===t)}function W_({palette:o,paletteIndex:t,hex:e,onPaletteChange:s}){const n=Array.isArray(o)?o.slice():(Q.palette||[]).slice();return!Number.isInteger(t)||t<0||t>=n.length||typeof e!="string"?!1:(n[t]=e,Q.setPalette(n),typeof s=="function"&&s(n.slice()),!0)}class G_{constructor({idPrefix:t,getPalette:e,onPaletteChange:s,onChange:n}){this.idPrefix=t,this.onChange=n||(()=>{}),this.#t=new V_({idPrefix:`${t}-colors`,getPalette:()=>{const i=typeof e=="function"?e():null;return Array.isArray(i)&&i.length?i:(Q.init(),Q.palette||[])},onPaletteChange:i=>{Q.setPalette(i),typeof s=="function"&&s(i.slice()),this.onChange()}})}#t;refreshSwatches(){this.#t.refresh()}buildSettingsPanels(){const t=this.#t.buildNode();return new Oe({id:`${this.idPrefix}-colors-settings-groups`,multiple:!0,panels:[new wt({title:"Palette".translate(),icon:D.get("palette-svg",{size:18}),open:!0,contents:[t]})]})}}function j_(o){const t=new G_(o),e=t.buildSettingsPanels();return e.refreshPalette=()=>t.refreshSwatches(),e}const U_="inline",Y_=["mb-0"],K_={classList:["mb-2"]},dn=56,Il=28,X_=14,Z="plotter-views-layout-editor";class Z_{constructor({configuration:t,layer:e,idPrefix:s,onChange:n,onViewLayoutChange:i,getViewDefinitions:r}){this.configuration=t,this.layer=e,this.idPrefix=s,this.onChange=n||(()=>{}),this.onViewLayoutChange=i||(()=>{}),this.getViewDefinitions=r||(()=>[]),this.#t=null,this.#e=null}#t;#e;get layoutConfig(){return(!this.configuration.layout||typeof this.configuration.layout!="object")&&(this.configuration.layout=xt()),this.configuration.layout}buildFieldSet(){const t=this.render();return new bi({id:`${this.idPrefix}-settings-views-layout`,legend:"Views".translate(),layout:U_,classList:Y_,wrapper:K_,fields:[{label:"",input:t}]})}render(){this.#e?this.#e.replaceChildren():(this.#e=document.createElement("div"),this.#e.className=Z,this.#e.id=`${this.idPrefix}-views-layout-editor`),Re(this.layer);const t=this.getViewDefinitions(),e=this.layoutConfig.pinnedViews||[],s=new Set(e),n=document.createElement("div");n.className=`${Z}__section-title`,n.textContent="Layout preview".translate(),this.#e.append(n);const i=this.#s(t.filter(a=>s.has(a.value)));this.#e.append(i);const r=t.filter(a=>!s.has(a.value));if(r.length){const a=document.createElement("div");a.className=`${Z}__section-title`,a.textContent="Available views".translate(),this.#e.append(a);const l=document.createElement("div");l.className=`${Z}__pool`,r.forEach(c=>{l.append(this.#i(c,{pinned:!1}))}),this.#e.append(l)}return this.#e}#s(t){const e=document.createElement("div");e.className=`${Z}__preview`;const s=this.layoutConfig.pinnedViews||[],n=ai(s,{layout:this.layoutConfig},this.layer),i=n.rowGroups.length;e.classList.toggle(`${Z}__preview--multi-row`,i>1),e.style.setProperty("--plotter-views-editor-row-height",`${dn}px`),e.style.minHeight=`${dn*Math.max(i,1)+16}px`,i>1?e.style.gridTemplateRows=n.gridTemplateRows:e.style.removeProperty("grid-template-rows");const r=i-1;return n.rowGroups.forEach((a,l)=>{a.viewKeys.forEach((c,h)=>{const u=t.find(_=>_.value===c);if(!u)return;const d=l===r&&h===a.viewKeys.length-1,p=n.getPaneStyle(c),f=this.#i(u,{pinned:!0,resizableRight:!d});f.dataset.viewKey=c,f.style.gridColumn=p.gridColumn,f.style.gridRow=p.gridRow,e.append(f)})}),i>1&&this.#n(e,n),e.addEventListener("dragover",a=>this.#y(a)),e.addEventListener("drop",a=>this.#L(a)),e}#n(t,e){const s=e.rowGroups,n=this.layoutConfig.pinnedRowWeights||[],i=n.reduce((l,c)=>l+c,0)||s.length,r=dn*s.length,a=8;s.forEach((l,c)=>{if(c>=s.length-1)return;let h=0;for(let p=0;p<=c;p++)h+=n[p]??1;const u=a+h/i*r,d=document.createElement("div");d.className=`${Z}__resize-handle ${Z}__resize-handle--row`,d.style.top=`${u-4}px`,d.title="Resize row height".translate(),d.addEventListener("mousedown",p=>{this.#r(p,t,e,c,d)}),t.append(d)})}#r(t,e,s,n,i){t.preventDefault(),t.stopPropagation(),Re(this.layer);const r=this.layoutConfig,a=r.pinnedRowWeights,l=a[n],c=a[n+1],h=l+c,u=dn*s.rowGroups.length||1,d=t.clientY,p=l,f=parseFloat(i.style.top)||0;e.classList.add(`${Z}__preview--resizing-row`);let _=p;const g=y=>{const b=y.clientY-d,A=b/u;_=Math.max(Rs,Math.min(h-Rs,p+A*h));const L=h-_,T=[...a];T[n]=_,T[n+1]=L,e.style.gridTemplateRows=ri(rowGroups,{...r},this.layer).join(" "),i.style.top=`${f+b}px`},m=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m),e.classList.remove(`${Z}__preview--resizing-row`),_!==p&&(Zu(r,n,_,h-_),this.onChange(),this.onViewLayoutChange()),this.render()};document.addEventListener("mousemove",g),document.addEventListener("mouseup",m)}#i(t,{pinned:e,resizableRight:s=!0}){const n=document.createElement("div");n.className=`${Z}__card`,n.title=t.text,e?(n.classList.add(`${Z}__card--pinned`),n.draggable=!0,n.dataset.viewKey=t.value,n.addEventListener("dragstart",r=>this.#h(r,t.value)),n.addEventListener("dragend",()=>this.#p())):(n.classList.add(`${Z}__card--pool`),t.hostActive!==!1&&n.addEventListener("click",()=>{Sa(this.layer,t.value),this.onChange(),this.onViewLayoutChange(),this.render()}));const i=document.createElement("div");if(i.className=`${Z}__card-body`,t.icon instanceof Node){const r=document.createElement("span");r.className=`${Z}__card-icon`,r.append(t.icon.cloneNode(!0));const a=r.querySelector("svg");a&&(a.setAttribute("width",String(Il)),a.setAttribute("height",String(Il))),i.append(r)}if(n.append(i),e){const a=t.hostActive===!1||!qn(this.layer,t.value);n.append(this.#a(t.value,{disabled:a})),n.append(this.#l("left",t.value,n)),s&&n.append(this.#l("right",t.value,n))}else if(t.hostActive!==!1){const r=document.createElement("span");r.className=`${Z}__pool-add-hint`,r.setAttribute("aria-hidden","true");const a=D.get("drop-up-svg",{size:16});a&&r.append(a),n.append(r)}return n}#a(t,{disabled:e}){const s=document.createElement("button");s.type="button",s.className=`${Z}__pin-toggle`,s.title="Unpin view".translate(),s.disabled=e,s.addEventListener("mousedown",i=>i.stopPropagation()),s.addEventListener("click",i=>{i.stopPropagation(),!s.disabled&&qn(this.layer,t)&&(Sa(this.layer,t),this.onChange(),this.onViewLayoutChange(),this.render())});const n=D.get("cross-svg",{size:X_});return n&&s.append(n),s}#l(t,e,s){const n=document.createElement("div");return n.className=`${Z}__resize-handle ${Z}__resize-handle--${t}`,n.title="Resize width".translate(),n.addEventListener("mousedown",i=>{i.preventDefault(),i.stopPropagation(),t==="right"?this.#T(i,e,s,n):this.#u(i,e,s,n)}),n}#h(t,e){if(t.target.closest(`.${Z}__pin-toggle`)||t.target.closest(`.${Z}__resize-handle`)){t.preventDefault();return}this.#t=e,t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e);const s=t.currentTarget;s?.classList&&s.classList.add(`${Z}__card--dragging`)}#p(){this.#t=null,this.#e?.querySelectorAll(`.${Z}__card--dragging`).forEach(t=>t.classList.remove(`${Z}__card--dragging`)),this.#e?.querySelectorAll(`.${Z}__card--drop-target`).forEach(t=>t.classList.remove(`${Z}__card--drop-target`))}#y(t){t.preventDefault(),t.dataTransfer.dropEffect="move";const e=t.target.closest(`.${Z}__card--pinned`);this.#e?.querySelectorAll(`.${Z}__card--drop-target`).forEach(s=>s.classList.remove(`${Z}__card--drop-target`)),e&&e.classList.add(`${Z}__card--drop-target`)}#L(t){t.preventDefault();const e=this.#t||t.dataTransfer.getData("text/plain"),s=t.target.closest(`.${Z}__card--pinned`);if(!e||!s){this.#p();return}const n=s.dataset.viewKey;if(!n||e===n){this.#p();return}this.layoutConfig.pinnedViews=Mu(this.layoutConfig.pinnedViews,e,n,this.layer),ge(this.layer),this.onChange(),this.onViewLayoutChange(),this.#p(),this.render()}#T(t,e,s,n){t.preventDefault();const i=s.closest(`.${Z}__preview`);if(!i)return;const r=this.layoutConfig.pinnedViews||[],a=i.getBoundingClientRect(),l=xa(e,r,this.layoutConfig,this.layer),c=l.start,h=l.span;i.classList.add(`${Z}__preview--resizing`),s.classList.add(`${Z}__card--resize-preview`);let u=h;const d=f=>{u=Na(f.clientX,a.left,a.width,c).span,s.style.gridColumn=`${c} / span ${u}`},p=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),i.classList.remove(`${Z}__preview--resizing`),s.classList.remove(`${Z}__card--resize-preview`),u!==h&&(Ps(this.layoutConfig,e,u,this.layer),this.onChange(),this.onViewLayoutChange()),this.render()};document.addEventListener("mousemove",d),document.addEventListener("mouseup",p)}#u(t,e,s,n){t.preventDefault();const i=s.closest(`.${Z}__preview`);if(!i)return;const r=this.layoutConfig.pinnedViews||[],a=i.getBoundingClientRect(),l=xa(e,r,this.layoutConfig,this.layer),c=l.start,h=l.span;i.classList.add(`${Z}__preview--resizing`),s.classList.add(`${Z}__card--resize-preview`);let u=c,d=h;const p=_=>{const g=Ku(_.clientX,a.left,a.width,c,h);u=g.start,d=g.span,s.style.gridColumn=`${u} / span ${d}`},f=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),i.classList.remove(`${Z}__preview--resizing`),s.classList.remove(`${Z}__card--resize-preview`),(u!==c||d!==h)&&(Xu(this.layoutConfig,e,u,this.layer),this.onChange(),this.onViewLayoutChange()),this.render()};document.addEventListener("mousemove",p),document.addEventListener("mouseup",f)}}function Q_({configuration:o,layer:t,idPrefix:e,onChange:s,onViewLayoutChange:n,getViewDefinitions:i}){return new Z_({configuration:o,layer:t,idPrefix:e,onChange:s,onViewLayoutChange:n,getViewDefinitions:i}).buildFieldSet()}const Ol=Object.freeze([{text:"Auto",value:"auto"},{text:"Inside",value:"inside"},{text:"Outside",value:"outside"}]),pn=Object.freeze([{text:"Auto",value:"auto"},{text:"Never",value:"never"},{text:"Always",value:"always"}]);function us(o){return o?.display!==!0?"never":o.fit==="always"?"always":"auto"}function re(o){return o?.totals??us(o)}function fn(o){return!!o?.stacked&&!o.overlay&&!o.x?.relative&&!o.y?.relative}function Pl(o,t){o.display=t!=="never",o.fit=t==="always"?"always":"auto"}const Dl=Object.freeze([{text:"Horizontal",value:"horizontal"},{text:"Vertical",value:"vertical"}]);function Fl(){return{gradient:{display:!0,scale:"plot",orientation:"vertical",top:0,bottom:100,left:0,right:100},round:{display:!0,ratio:"auto",radius:"auto"},labels:{display:!1,position:"auto",fit:"auto",totals:null,orientation:"horizontal",size:11,weight:500,color:null,family:null},endLabels:{display:!1,size:null,weight:null,family:null}}}const Gt=Object.freeze(["x","y","x2","y2"]),Ae="override",_n=Object.freeze(["straight","dashed","dotted"]),Hl=Object.freeze(["zero","min"]),q_="#000000",J_="#000000",tg=.1,eg=1,sg=1,ng=1,ig="4,3",rg="2,3",Ji=1.5,Bl=1,zl=4,tr=.5,Vl=.1,$l=.9,er=2,Wl=4,Gl=8;function jl(o){const t=Number(o?.axis?.hierarchical?.levelGapFactor);return!Number.isFinite(t)||t<=0?Ji:Math.min(zl,Math.max(Bl,t))}function Ul(o){const t=Number(o?.axis?.hierarchical?.maxReserveRatio);return!Number.isFinite(t)||t<=0?tr:Math.min($l,Math.max(Vl,t))}function gn(o){const t=o?.axis?.hierarchical?.labels,e=Number(t?.maxLines),s=Number(t?.minSize);return{maxLines:Number.isFinite(e)&&e>=1?Math.min(Wl,Math.round(e)):er,minSize:Number.isFinite(s)&&s>=0?s:Gl,autoSize:t?.autoSize!==!1}}function jt(o,t){if(!t||typeof t!="object"||Array.isArray(t))return o;const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},n={...s},i=Object.keys(t);for(let r=0;r<i.length;r++){const a=i[r],l=t[a],c=s[a],h=c&&typeof c=="object"&&!Array.isArray(c);l&&typeof l=="object"&&!Array.isArray(l)&&h?n[a]=jt(c,l):l!==void 0&&(n[a]=l)}return n}const Yl=Object.freeze([{text:"Auto",value:"auto"},{text:"Horizontal",value:"horizontal"},{text:"Diagonal",value:"diagonal"},{text:"Vertical",value:"vertical"}]);function ae(){return{continuous:{paddingOnMaxValue:.05},title:{display:"metric",size:16,weight:500,color:"#000000",family:null,verticalPosition:"center-rotated"},ticks:{baseline:{display:!0,position:"zero",color:q_,opacity:tg,size:eg,rendering:"straight",cut:{display:!0,color:J_,opacity:sg,size:ng,rendering:"straight"}},lines:{display:!0,opacity:.33,color:"#000000",size:4},texts:{display:!0,opacity:1,size:11,color:"#000000",weight:500,family:null,orientation:"auto",format:{compact:null,decimals:null,showUnit:!0}}},trackers:{display:!0,color:"#149588",opacity:1,size:2},grid:{display:!1,color:"#D1D5DB",opacity:1,size:1,dash:"2 4"},ratioOfElementSize:.9,keepGroupPosition:!1,joinMissingValues:!1,hierarchical:{elementsThreshold:6,aggregationName:"Remaining",levelGapFactor:Ji,maxReserveRatio:tr,labels:{maxLines:er,minSize:Gl,autoSize:!0},treeLines:{render:"squared",stems:!1,color:null,opacity:.35,size:1}},groupedAxes:{enabled:!1,yDomainMode:"global",gutter:20},x:{hidden:!1,[Ae]:!1},y:{hidden:!1,[Ae]:!1}}}function oe({configuration:o,traceAxis:t,role:e}={}){const s=!!(t&&typeof t=="object"&&(t.hidden||t.hiddenWithBarLabels&&(o?.bars?.labels?.display===!0||re(o?.bars?.labels)!=="never")&&t.barLabelsFit!==!1&&o?.axis?.grid?.display!==!0));if(!e||typeof e!="string")return s;const n=o?.axis?.[e];return!!(n&&typeof n=="object"&&n.hidden)||s}function ag(o,t){if(!o||!t)return null;for(let e=0;e<Gt.length;e++){const s=Gt[e],n=o.scales?.[s];if(!n)continue;const i=typeof n.getScale=="function"?n.getScale():n;if(i===t||i?.name!=null&&t.name!=null&&i.name===t.name)return s}return null}function og(o){return!o||typeof o!="object"?!1:o.using!=null&&String(o.using).length>0}function Kl({configuration:o,trace:t,scale:e}={}){const s=ae(),n=o?.axis&&typeof o.axis=="object"?o.axis:{};let i=jt(s.ticks,n.ticks||{}),r=jt(s.title,n.title||{});const a=ag(t,e);let l=!1;if(a){const c=n[a]&&typeof n[a]=="object"?n[a]:{};i=jt(i,c.ticks||{}),r=jt(r,c.title||{});const h=t?.[a];!og(h)&&h&&typeof h=="object"&&(i=jt(i,h.ticks||{}),r=jt(r,h.title||{}),c[Ae]===!0&&(i=jt(i,c.ticks||{}),r=jt(r,c.title||{}))),l=oe({configuration:o,traceAxis:h,role:a})}return{ticks:i,title:r,hidden:l,role:a}}function sr(o,t){if(!o||typeof o!="object")throw new Error("ensurePlotterAxisRoleConfiguration requires a configuration object");const e=ae();(!o.axis||typeof o.axis!="object")&&(o.axis=JSON.parse(JSON.stringify(e)));const s=o.axis;(!s[t]||typeof s[t]!="object"||Array.isArray(s[t]))&&(s[t]={});const n=s[t],i=e[t]&&typeof e[t]=="object"?e[t]:{hidden:!1};typeof n.hidden!="boolean"&&(n.hidden=typeof i.hidden=="boolean"?i.hidden:!1),typeof n[Ae]!="boolean"&&(n[Ae]=i[Ae]===!0);const r=s.ticks&&typeof s.ticks=="object"?s.ticks:e.ticks,a=s.title&&typeof s.title=="object"?s.title:e.title;return!n.ticks||typeof n.ticks!="object"||Array.isArray(n.ticks)?n.ticks={lines:JSON.parse(JSON.stringify(r.lines||e.ticks.lines)),texts:JSON.parse(JSON.stringify(r.texts||e.ticks.texts))}:((!n.ticks.lines||typeof n.ticks.lines!="object")&&(n.ticks.lines=JSON.parse(JSON.stringify(r.lines||e.ticks.lines))),(!n.ticks.texts||typeof n.ticks.texts!="object")&&(n.ticks.texts=JSON.parse(JSON.stringify(r.texts||e.ticks.texts)))),(!n.title||typeof n.title!="object"||Array.isArray(n.title))&&(n.title=JSON.parse(JSON.stringify(a))),n.ticks.texts.format=yn(n.ticks.texts.format),n}function nr(o){if(!o||typeof o!="object")throw new Error("ensurePlotterAxisHierarchicalLabelsConfiguration requires a configuration object");const t=ae();(!o.axis||typeof o.axis!="object")&&(o.axis=JSON.parse(JSON.stringify(t))),(!o.axis.hierarchical||typeof o.axis.hierarchical!="object")&&(o.axis.hierarchical=JSON.parse(JSON.stringify(t.hierarchical)));const e=o.axis.hierarchical,s=t.hierarchical.labels;(!e.labels||typeof e.labels!="object"||Array.isArray(e.labels))&&(e.labels={...s}),Number.isFinite(Number(e.levelGapFactor))||(e.levelGapFactor=t.hierarchical.levelGapFactor),Number.isFinite(Number(e.maxReserveRatio))||(e.maxReserveRatio=t.hierarchical.maxReserveRatio);const n=e.labels;return Number.isFinite(Number(n.maxLines))||(n.maxLines=s.maxLines),Number.isFinite(Number(n.minSize))||(n.minSize=s.minSize),typeof n.autoSize!="boolean"&&(n.autoSize=s.autoSize),n}const Xl=Object.freeze(["none","curved","squared","straight"]);function ze(o){if(!o||typeof o!="object")throw new Error("ensurePlotterAxisHierarchicalTreeLinesConfiguration requires a configuration object");const t=ae();(!o.axis||typeof o.axis!="object")&&(o.axis=JSON.parse(JSON.stringify(t))),(!o.axis.hierarchical||typeof o.axis.hierarchical!="object")&&(o.axis.hierarchical=JSON.parse(JSON.stringify(t.hierarchical)));const e=o.axis.hierarchical,s=t.hierarchical.treeLines;(!e.treeLines||typeof e.treeLines!="object"||Array.isArray(e.treeLines))&&(e.treeLines={...s});const n=e.treeLines;Xl.includes(n.render)||(n.render=s.render),typeof n.stems!="boolean"&&(n.stems=s.stems),n.color===void 0&&(n.color=s.color);const i=Number(n.opacity);Number.isFinite(i)||(n.opacity=s.opacity);const r=Number(n.size);return(!Number.isFinite(r)||r<0)&&(n.size=s.size),n}function lg(o){const t=ae().hierarchical.treeLines,e=o?.axis?.hierarchical?.treeLines;if(!e||typeof e!="object")return{...t};const s=Xl.includes(e.render)?e.render:t.render,n=Number(e.opacity),i=Number(e.size);return{render:s,stems:typeof e.stems=="boolean"?e.stems:t.stems,color:e.color===void 0?t.color:e.color,opacity:Number.isFinite(n)?n:t.opacity,size:Number.isFinite(i)&&i>=0?i:t.size}}function cg(){return JSON.parse(JSON.stringify(ae().ticks.baseline))}function Zl(o){return o==="dashed"?ig:o==="dotted"?rg:""}function Ql(o,t){const e=Number(o),s=Number(t);return!Number.isFinite(e)||!Number.isFinite(s)?!0:!(e<0&&s>0)}function hg(o,t,e){return!o||typeof o!="object"||o.display===!1||o.position!=="zero"?!1:Ql(t,e)}function ug(o,t,e){const s=Number(t);return o?.position==="min"&&Number.isFinite(s)?s:0}function ql(o,t){const e=o&&typeof o=="object"?o:{},s=Number(e.opacity),n=Number(e.size),i=_n.includes(e.rendering)?e.rendering:t.rendering;return{color:typeof e.color=="string"&&e.color.length?e.color:t.color,opacity:Number.isFinite(s)?s:t.opacity,size:Number.isFinite(n)&&n>=0?n:t.size,rendering:i}}function Ve(o){const t=cg(),e=o?.axis?.ticks,s=e?.baseline&&typeof e.baseline=="object"?e.baseline:null,n=ql(s,t),i=t.cut,r=s?.cut&&typeof s.cut=="object"?s.cut:null,a=ql(r,i);let l=s?.display!==!1,c=Hl.includes(s?.position)?s.position:t.position,h=r?.display!==!1;return s?r==null&&typeof o?.axis?.allowBeautifulCut=="boolean"&&(h=o.axis.allowBeautifulCut):(e?.includeZero===!1&&(c="min"),e?.zeroLine&&typeof e.zeroLine=="object"&&(e.zeroLine.display===!1?l=!1:e.zeroLine.display===!0&&(l=!0)),typeof o?.axis?.allowBeautifulCut=="boolean"&&(h=o.axis.allowBeautifulCut)),{display:l,position:c,...n,cut:{display:h,...a}}}function dg(o){return Ve(o).cut.display!==!1}function Bt(o){if(!o||typeof o!="object")throw new Error("ensurePlotterAxisBaselineConfiguration requires a configuration object");const t=ae();(!o.axis||typeof o.axis!="object")&&(o.axis=JSON.parse(JSON.stringify(t))),(!o.axis.ticks||typeof o.axis.ticks!="object")&&(o.axis.ticks=JSON.parse(JSON.stringify(t.ticks)));const e=o.axis.ticks,s=t.ticks.baseline;if(!(e.baseline&&typeof e.baseline=="object"&&!Array.isArray(e.baseline)))e.baseline=JSON.parse(JSON.stringify(s)),e.includeZero===!1&&(e.baseline.position="min"),e.zeroLine&&typeof e.zeroLine=="object"&&(e.zeroLine.display===!1?e.baseline.display=!1:e.zeroLine.display===!0&&(e.baseline.display=!0)),typeof o.axis.allowBeautifulCut=="boolean"&&(e.baseline.cut.display=o.axis.allowBeautifulCut);else{const i=e.baseline;typeof i.display!="boolean"&&(i.display=s.display),Hl.includes(i.position)||(i.position=s.position),_n.includes(i.rendering)||(i.rendering=s.rendering),(typeof i.color!="string"||!i.color.length)&&(i.color=s.color);const r=Number(i.opacity);Number.isFinite(r)||(i.opacity=s.opacity);const a=Number(i.size);if((!Number.isFinite(a)||a<0)&&(i.size=s.size),!i.cut||typeof i.cut!="object"||Array.isArray(i.cut))i.cut=JSON.parse(JSON.stringify(s.cut)),typeof o.axis.allowBeautifulCut=="boolean"&&(i.cut.display=o.axis.allowBeautifulCut);else{const l=i.cut,c=s.cut;typeof l.display!="boolean"&&(l.display=typeof o.axis.allowBeautifulCut=="boolean"?o.axis.allowBeautifulCut:c.display),_n.includes(l.rendering)||(l.rendering=c.rendering),(typeof l.color!="string"||!l.color.length)&&(l.color=c.color);const h=Number(l.opacity);Number.isFinite(h)||(l.opacity=c.opacity);const u=Number(l.size);(!Number.isFinite(u)||u<0)&&(l.size=c.size)}}return e.baseline}const pg=Object.freeze([0,1,2]),mn="custom",ds=Object.freeze([{id:"auto",label:"Auto",format:{compact:null,decimals:null,showUnit:!0}},{id:"compact",label:"Compact (K/M/B)",format:{compact:!0,decimals:null,showUnit:!0}},{id:"full",label:"Full",format:{compact:!1,decimals:null,showUnit:!0}},{id:"decimals-0",label:"0 decimals",format:{compact:null,decimals:0,showUnit:!0}},{id:"decimals-1",label:"1 decimal",format:{compact:null,decimals:1,showUnit:!0}},{id:"decimals-2",label:"2 decimals",format:{compact:null,decimals:2,showUnit:!0}}]);function yn(o){const t=o&&typeof o=="object"&&!Array.isArray(o)?o:{},e=t.decimals==null?Number.NaN:Math.trunc(Number(t.decimals)),s=Number.isFinite(e)&&pg.includes(e);return{compact:typeof t.compact=="boolean"?t.compact:null,decimals:s?e:null,showUnit:t.showUnit!==!1}}function Jl(o){const t=yn(o);for(let e=0;e<ds.length;e++){const s=ds[e],n=s.format.compact===t.compact,i=s.format.decimals===t.decimals,r=s.format.showUnit===t.showUnit;if(n&&i&&r)return s.id}return null}function fg(o,t){const e=ds.find(n=>n.id===t),s=o&&typeof o=="object"&&!Array.isArray(o);return!e||!s?null:(o.compact=e.format.compact,o.decimals=e.format.decimals,o.showUnit=e.format.showUnit,o)}function Ut(o,{unit:t="",format:e=null,sign:s=!1}={}){const n=Number(o);if(!Number.isFinite(n))return String(o??"");const i=yn(e),r={sign:s===!0};return i.showUnit&&t&&(r.unit=t),i.compact!=null&&(r.compact=i.compact),i.decimals!=null&&(r.minDecimals=i.decimals,r.maxDecimals=i.decimals),n.format(r)}function tc(o){return!o||o._isDate?!1:!(!!o.dimension&&(o._valueType!=="continuous"||!!o.texts||!!o._isCompositeDimensionSplit))}const ec=20,sc=14,_g=400,gg=300,mg=8,nc=Object.freeze(["left","center","right"]),ic=Object.freeze(["top","bottom"]);function ir(){return{display:!0,align:"left",position:"top",font:{italic:!1,size:ec,weight:_g,family:null}}}function rr(){return{display:!0,align:"left",position:"top",font:{italic:!1,size:sc,weight:gg,family:null}}}function rc(o,t,e){const s=e();if(!o||typeof o!="object"||Array.isArray(o))return s;if(!o[t]||typeof o[t]!="object"||Array.isArray(o[t]))return o[t]=JSON.parse(JSON.stringify(s)),o[t];const n=o[t];return typeof n.display!="boolean"&&(n.display=s.display),(n.align==null||nc.indexOf(n.align)===-1)&&(n.align=s.align),(n.position==null||ic.indexOf(n.position)===-1)&&(n.position=s.position),!n.font||typeof n.font!="object"||Array.isArray(n.font)?(n.font=JSON.parse(JSON.stringify(s.font)),n):(typeof n.font.italic!="boolean"&&(n.font.italic=s.font.italic),(n.font.size==null||!Number.isFinite(Number(n.font.size)))&&(n.font.size=s.font.size),(n.font.weight==null||!Number.isFinite(Number(n.font.weight)))&&(n.font.weight=s.font.weight),Object.prototype.hasOwnProperty.call(n.font,"family")||(n.font.family=s.font.family),n)}function ar(o){return rc(o,"title",ir)}function or(o){return rc(o,"subtitle",rr)}function lr(o,t){if(!t||typeof t!="object"||Array.isArray(t))return o;const e={...o},s=Object.keys(t);for(let n=0;n<s.length;n++){const i=s[n];if(i==="template")continue;const r=t[i],a=o[i],l=a&&typeof a=="object"&&!Array.isArray(a);r&&typeof r=="object"&&!Array.isArray(r)&&l?e[i]=lr(a,r):r!==void 0&&(e[i]=r)}return e}function yg(o,t){const e=nc.indexOf(o?.align)!==-1?o.align:t.align,s=ic.indexOf(o?.position)!==-1?o.position:t.position,n=o?.font&&typeof o.font=="object"&&!Array.isArray(o.font)?o.font:{},i=Number(n.size),r=Number(n.weight);return{display:o?.display!==!1,align:e,position:s,font:{italic:n.italic===!0,size:Number.isFinite(i)&&i>0?i:t.font.size,weight:Number.isFinite(r)&&r>0?r:t.font.weight,family:n.family!=null&&n.family!==""?n.family:null}}}function ac(o,t,e,s){const n=s(),i=o?.[e],r=t?.[e],a=lr(lr(n,i),r),l=yg(a,n),c=typeof r?.template=="function"?r.template:null;return{...l,template:c}}function bg(o,t){return ac(o,t,"title",ir)}function Ag(o,t){return ac(o,t,"subtitle",rr)}function Lg(o,t){const e=Array.isArray(o)?o:[];for(let s=0;s<e.length;s++){const n=e[s];if(typeof n?.[t]?.template=="function")return n}return null}function oc(o,t){if(o?.display===!1||typeof o?.template!="function")return 0;const e=Number(o.font?.size);return(Number.isFinite(e)&&e>0?e:t)+mg}function Tg(o){return oc(o,ec)}function Eg(o){return oc(o,sc)}function lc(o,t,e,s,n){const i=Lg(t,e);if(!i)return{trace:null,band:null,reservedTop:0,reservedBottom:0};const r=s(o,i);if(typeof r.template!="function"||r.display===!1)return{trace:null,band:null,reservedTop:0,reservedBottom:0};const a=n(r),l=r.position!=="bottom";return{trace:i,band:r,reservedTop:l?a:0,reservedBottom:l?0:a}}function xg(o,t){const e=lc(o,t,"title",bg,Tg);return{trace:e.trace,title:e.band,reservedTop:e.reservedTop,reservedBottom:e.reservedBottom}}function Sg(o,t){const e=lc(o,t,"subtitle",Ag,Eg);return{trace:e.trace,subtitle:e.band,reservedTop:e.reservedTop,reservedBottom:e.reservedBottom}}function cc(o,t){const e=xg(o,t),s=Sg(o,t);return{title:e,subtitle:s,reservedTop:e.reservedTop+s.reservedTop,reservedBottom:e.reservedBottom+s.reservedBottom}}function vg({plotLeft:o,plotRight:t}={}){const e=Number.isFinite(Number(o))?Number(o):0,s=Number.isFinite(Number(t))?Number(t):e;return e>s?{contentLeft:s,contentRight:e}:{contentLeft:e,contentRight:s}}function Cg(o){return o==null?[]:o instanceof Node?[o]:Array.isArray(o)?o.filter(t=>t instanceof Node):typeof o=="string"&&o.length?[document.createTextNode(o)]:[]}function wg(o){return!o||typeof o!="object"||Array.isArray(o)?!1:typeof o._type=="string"&&Object.prototype.hasOwnProperty.call(o,"_value")}function ps(o){const t=o?.configuration?.default;return!t||typeof t!="object"||Array.isArray(t)?null:t}function cr(o){return!o||typeof o!="object"||Array.isArray(o)?{}:((!o.customViews||typeof o.customViews!="object"||Array.isArray(o.customViews))&&(o.customViews={}),o.customViews)}function fs(o,t=""){if(!o||typeof o!="object"||Array.isArray(o))return[];const e=[],s=Object.keys(o);for(let n=0;n<s.length;n++){const i=s[n],r=o[i],a=t?`${t}.${i}`:i;if(wg(r)){e.push({path:a,leaf:r});continue}if(r&&typeof r=="object"&&!Array.isArray(r)){const l=fs(r,a);for(let c=0;c<l.length;c++)e.push(l[c])}}return e}function Rg(o,t){if(!o||typeof o!="object")return;const e=String(t).split(".");let s=o;for(let n=0;n<e.length;n++){if(!s||typeof s!="object"||Array.isArray(s))return;s=s[e[n]]}return s}function hc(o,t,e){const s=String(t).split(".");let n=o;for(let i=0;i<s.length-1;i++){const r=s[i];(!n[r]||typeof n[r]!="object"||Array.isArray(n[r]))&&(n[r]={}),n=n[r]}n[s[s.length-1]]=e}function uc(o){const t=o?._type,e=o?._value;if(t==="boolean")return e===!0;if(t==="int"){const s=Number(e);if(!Number.isFinite(s))return 0;let n=Math.round(s);return o._min!=null&&Number.isFinite(Number(o._min))&&(n=Math.max(Number(o._min),n)),o._max!=null&&Number.isFinite(Number(o._max))&&(n=Math.min(Number(o._max),n)),n}return(t==="select"||t==="color"||t==="string")&&e===void 0?null:e}function dc(o){const t={},e=fs(o);for(let s=0;s<e.length;s++){const{path:n,leaf:i}=e[s];hc(t,n,uc(i))}return t}function hr(o,t){if(!t||typeof t!="object"||Array.isArray(t))return o;const e={...o},s=Object.keys(t);for(let n=0;n<s.length;n++){const i=s[n],r=t[i],a=o[i],l=a&&typeof a=="object"&&!Array.isArray(a);r&&typeof r=="object"&&!Array.isArray(r)&&l?e[i]=hr(a,r):r!==void 0&&(e[i]=r)}return e}function bn(o){const t=o?.configuration,e=cr(t||{}),s=o?.traces;if(!s||typeof s!="object"||Array.isArray(s))return e;const n=Object.keys(s);for(let i=0;i<n.length;i++){const r=n[i],a=ps(s[r]);if(!a)continue;const l=dc(a),c=e[r];if(!c||typeof c!="object"||Array.isArray(c)){e[r]=l;continue}e[r]=hr(l,c)}return e}function ur(o,t){const e=ps(o?.traces?.[t]);if(!e)return{};const s=dc(e),n=o?.configuration?.customViews?.[t];return hr(s,n)}function Yt(o,t,e,s){bn(o);const n=cr(o.configuration);(!n[t]||typeof n[t]!="object")&&(n[t]={});const i=ps(o?.traces?.[t]),a=fs(i||{}).find(c=>c.path===e);let l=s;return a?.leaf?._type==="int"?l=uc({...a.leaf,_value:s}):a?.leaf?._type==="boolean"&&(l=s===!0),hc(n[t],e,l),l}function kg(o,t){if(!(o instanceof HTMLElement))return;const e=t?.display!==!1;o.style.display=e?"":"none";const s=t?.font&&typeof t.font=="object"?t.font:{};s.size!=null&&Number.isFinite(Number(s.size))&&(o.style.fontSize=`${Number(s.size)}px`),s.weight!=null&&Number.isFinite(Number(s.weight))&&(o.style.fontWeight=String(s.weight)),o.style.fontStyle=s.italic===!0?"italic":"normal",o.style.fontFamily=s.family!=null&&s.family!==""?String(s.family):"",s.color!=null&&s.color!==""?o.style.color=String(s.color):o.style.color="";const n=t?.align;(n==="center"||n==="right"||n==="left")&&(o.style.textAlign=n)}function pc(o){const t=String(o).split(".").pop()||o;return t.length?t.charAt(0).toUpperCase()+t.slice(1):o}function An(o,t){return Rg(o,t)}const kt=1;function $e(o,t=kt){const e=Number(o);return Number.isFinite(e)?Math.max(kt,e):t}function Ng(){return{padding:{top:25,right:50,bottom:25,left:50}}}function Mg({displayShortcutsOnHover:o}={}){return{transitionDuration:1e3,highlightElementByPrimaryDimension:!0,highlightElementBySecondaryDimension:!0,displayShortcutsOnHover:o,disableMouseWheelZoom:!0}}function Ig(o){return o?.behaviors?.disableMouseWheelZoom!==!1}function Og(){return{display:!0,position:"right",size:.15}}const fc=Object.freeze([{text:"Default",value:"default"},{text:"Linear",value:"linear"},{text:"Linear closed",value:"linear-closed"},{text:"Step",value:"step"},{text:"Step before",value:"step-before"},{text:"Step after",value:"step-after"},{text:"Natural",value:"natural"},{text:"Cardinal",value:"cardinal"}]),dr=Object.freeze([{text:"Solid",value:"solid",dasharray:null},{text:"Dashed",value:"dashed",dasharray:"6 4"},{text:"Dotted",value:"dotted",dasharray:"1 3"}]),Pg=Object.freeze([1,2,3,4]);function Le(o,t){const e=t?.name!=null?o?.lines?.styles?.[t.name]:null,s=dr.find(r=>r.value===e?.dash),n=t?.dashWidth&&t?.dashGap?`${t.dashWidth} ${t.dashGap}`:null,i=Number(e?.width);return{dasharray:s?s.dasharray:n,width:Number.isFinite(i)&&i>0?i:null}}function Dg(){return{curve:"default",endLabels:{display:!1,value:!0,size:11,weight:500,family:null},styles:{}}}const Fg=11,Hg=4;function Ln(o,t){const e=o?.bars?.labels,s=t?.stacked?fn(t)&&re(e)!=="never":e?.display===!0;if(t?.type!=="bars"||t.overlay||!s||e.position==="inside"&&!t.stacked)return 0;const n=Number(e.size)||Fg;return(e.orientation==="vertical"&&t.barLabelTextWidth||n)+Hg}const _s=0,gs=100,pr=12,ms=11,fr=2,Bg=1.6;function zg(o){if(o==null||!Object.prototype.hasOwnProperty.call(o,"maxDepth"))return fr;const t=o.maxDepth;if(t==null||t==="")return null;const e=Number(t);return!Number.isFinite(e)||e<0?fr:Math.floor(e)}function Tn(o,t){const e=Number.isFinite(Number(t))&&Number(t)>=0?Number(t):pr;if(o==null||o==="")return Math.min(gs,Math.max(_s,e));const s=Number(o);return Number.isFinite(s)?Math.min(gs,Math.max(_s,s)):Math.min(gs,Math.max(_s,e))}function _c(){return{labels:{display:!0,color:"black",opacity:1,position:"value",weight:500,size:pr,family:null,maxDepth:fr,autoHide:!0},topLine:{display:!0,color:null,opacity:1,position:"top-line",weight:500,size:ms,family:Ct[0].value},links:{display:!0,color:"rgba(0,0,0,0.3)",opacity:.5,width:1,dasharray:null,rendering:"full"},bars:{rounded:kt,opacity:1}}}const gc=Object.freeze([{value:"Impact_disp",label:"Impact in volume"},{value:"Pts_gap_disp",label:"Impact in points (pts)"},{value:"Top_Line_Label",label:"Percent change"},{value:"RatioStart_disp",label:"Start"},{value:"RatioEnd_disp",label:"End"},{value:"RatioDelta_disp",label:"Delta"}]),_r=Object.freeze(gc.map(o=>o.value)),gr="Top_Line_Label";function mc(o,t="Impact"){return typeof o=="string"&&_r.includes(o)?o:`${t==="Pts_gap"?"Pts_gap":"Impact"}_disp`}function yc(o){return typeof o=="string"&&_r.includes(o)?o:gr}function Vg(o){const t=gr;return t!==o?t:_r.find(s=>s!==o)??t}function $g(o){return gc.filter(t=>t.value!==o).map(t=>({text:t.label,value:t.value}))}function bc(o){if(!o||typeof o!="object")return;const t=o.waterfallMeasure==="Pts_gap"?"Pts_gap":"Impact",e=mc(o.waterfallLabelColumn,t),s=yc(o.waterfallTopLineColumn);if(e!==s){o.waterfallLabelColumn=e,o.waterfallTopLineColumn=s;return}o.waterfallLabelColumn=e,o.waterfallTopLineColumn=Vg(e)}const Wg="inline",Gg=["mb-0"],jg={classList:["mb-2"]},Ac="lastNet",mr="first";function Lc(o){return o===mr?mr:Ac}function Ug(){return[{value:Ac,text:"Last net pillar".translate()},{value:mr,text:"First pillar".translate()}]}const It=o=>o===""?null:o;function Tc(o,t=Ne){if(typeof o=="string"&&/^#[0-9A-Fa-f]{6}$/.test(o))return o;if(typeof o=="string"&&/^#[0-9A-Fa-f]{3}$/.test(o)){const r=o.slice(1);return`#${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`}if(typeof o!="string"||!o.length||typeof document>"u")return t;const e=document.createElement("div");e.style.color=o;const s=e.style.color,n=/^rgba?\((\d+),\s*(\d+),\s*(\d+)/i.exec(s);if(!n)return t;const i=r=>Number(r).toString(16).padStart(2,"0");return`#${i(n[1])}${i(n[2])}${i(n[3])}`}function En({id:o,label:t,list:e,colorKey:s,onChange:n,semanticBinding:i="nullable",flagKey:r=null,solidDefault:a=Ne}){const l=()=>i==="flag"?e[r]===!0:e[s]==null,c=()=>Tc(e[s],a),h=document.createElement("div");h.className="plotter-settings-semantic-color",h.dataset.semantic=l()?"true":"false";const u=document.createElement("label");u.className="plotter-colors-swatch plotter-settings-semantic-color__swatch",u.title="Color".translate();const d=document.createElement("input");d.type="color",d.id=`${o}-swatch`,d.className="plotter-colors-swatch__input",d.value=c(),d.setAttribute("aria-label","Color".translate());const p=document.createElement("span");p.className="plotter-colors-swatch__chip plotter-settings-semantic-color__chip";const f={semantic:l()};let _=null;const g=()=>{const L=l();if(f.semantic=L,h.dataset.semantic=L?"true":"false",d.disabled=!1,d.removeAttribute("disabled"),p.classList.toggle("plotter-settings-semantic-color__chip--semantic",L),_?.setAttribute("data-value",String(L)),L){p.style.backgroundColor="";return}const T=c();d.value=T,p.style.backgroundColor=typeof e[s]=="string"&&e[s].length?e[s]:T},m=L=>{l()&&(L.preventDefault(),L.stopPropagation())};d.addEventListener("click",m),d.addEventListener("mousedown",m),d.addEventListener("input",L=>{const T=L.target?.value;typeof T!="string"||!T.length||(i==="flag"&&(e[r]=!1),e[s]=T,g(),n?.())}),u.append(d,p),_=new J({id:`${o}-semantic`,type:"switch",list:f,key:"semantic",callbacks:{input:L=>{const T=L===!0;i==="flag"?(e[r]=T,!T&&(e[s]==null||e[s]==="")&&(e[s]=a)):e[s]=T?null:c(),g(),n?.()}}}).render();const b=document.createElement("div");b.className="plotter-settings-semantic-color__toggle";const A=document.createElement("span");return A.className="plotter-settings-semantic-color__toggle-label",A.textContent="Conditional".translate(),b.append(A,_),h.append(u,b),g(),{label:t.translate(),input:h}}const Ec=[{text:"Straight",value:"straight"},{text:"Dashed",value:"dashed"},{text:"Dotted",value:"dotted"}];function le(){return[{text:ft("Inherit"),value:""},...Ct.map(({label:o,value:t})=>({text:ft(o),value:t,style:Me(t)}))]}const xc=[{type:"bars",title:"Bars",chartIcon:"bars-svg",suffix:"group-module-bars",buildContents:gm},{type:"lines",title:"Lines",chartIcon:"lines-svg",suffix:"group-module-lines",buildContents:mm},{type:"tree",title:"Tree",chartIcon:"tree-svg",suffix:"group-module-tree",buildContents:bm},{type:"waterfall",title:"Waterfall",chartIcon:"waterfall-svg",suffix:"group-module-waterfall",buildContents:wm}],yr=new Set(xc.map(o=>o.type)),ut=Object.freeze({CHART:"chart",MODULE:"module",CALENDAR:"calendar",ANALYSIS:"analysis",TABLE:"table",LAYOUT:"layout",COLORS:"colors"}),Yg=new Set([ut.CHART,ut.MODULE,ut.CALENDAR,ut.ANALYSIS,ut.TABLE,ut.LAYOUT,ut.COLORS,...yr]),Kg=[{text:"Metric",value:"metric"},{text:"Dimension",value:"dimension"},{text:"Both",value:"both"},{text:"None",value:"none"}],Xg=[{text:"Center rotated",value:"center-rotated"},{text:"Top left overlay",value:"top-left-overlay"}],Zg=[{text:"Auto",value:"auto"},{text:"Never",value:"never"},{text:"Always",value:"always"}],Qg=[{text:"Curved",value:"curved"},{text:"Straight",value:"straight"},{text:"Hidden",value:"false"}],qg=[{text:"None",value:"none"},{text:"Curved",value:"curved"},{text:"Squared",value:"squared"},{text:"Straight",value:"straight"}];function Jg(o,t=[]){const e=[],s=n=>{if(Array.isArray(n))for(let i=0;i<n.length;i+=1)e.push(n[i])};if(s(t),Array.isArray(o?.traces))s(o.traces);else if(o?.traces&&typeof o.traces=="object"){const n=Object.keys(o.traces);for(let i=0;i<n.length;i+=1)s(o.traces[n[i]]?.traces)}return e}function tm(o,t=[]){const e=Jg(o,t);for(let s=0;s<e.length;s+=1){const n=e[s];if(n?.x?.hierarchy===!0||n?.y?.hierarchy===!0||n?.type==="waterfall"||n?.type==="tree")return!0}return!1}function em(o){const t=new Set;if(!o)return t;const e=s=>{(Array.isArray(s)?s:[]).forEach(n=>{n?.type&&t.add(n.type)})};return Array.isArray(o.traces)?(e(o.traces),t):(!o.traces||typeof o.traces!="object"||we(o).forEach(s=>{e(o.traces[s]?.traces)}),t)}function sm(o,t,e,{hasAnalysisSettings:s=!1,analysisScopes:n=[]}={}){const i=e instanceof Set?e:new Set(e||[]),r=[...yr].some(c=>i.has(c)),a=Array.isArray(n)?n.filter(Boolean):[],l={analysis:!!(s||a.length),chart:!0,colors:!0,module:r,calendar:!1,bars:i.has("bars"),lines:i.has("lines"),tree:i.has("tree"),waterfall:i.has("waterfall"),table:!!t?.table?.enabled};return a.forEach(c=>{l[c]=!0}),l}function br(o){return typeof o=="string"&&o.length>0&&!Yg.has(o)}function nm(o,{analysisScopes:t=[],layerScopes:e=[]}={}){return[...Array.isArray(t)?t.filter(Boolean):[],ut.CHART,ut.COLORS,...Array.isArray(e)?e.filter(Boolean):[],ut.TABLE].find(i=>o?.[i])??ut.CHART}function im(o,t=null){return o&&typeof o.render=="function"&&o.__parameters__?.panels?o:o instanceof Node?t?.__parameters__?.panels?{__parameters__:t.__parameters__,render(){return o}}:{render(){return o}}:null}function rm(o){return(Array.isArray(o)?o:[]).filter(e=>br(e?.scope)).map(e=>({scope:e.scope,title:e.title||e.scope,icon:Tr(e,{size:18})}))}function Sc(o){return`${o.title} settings`}function vc(o){const t=o instanceof Set?o:new Set(o||[]);return xc.filter(e=>t.has(e.type))}function Ar(o){return vc(o).map(t=>({scope:t.type,title:Sc(t),icon:Lr(t.chartIcon,{size:18})}))}function Lr(o,t={}){return D.get(o,t)}function xn(o,t,e={}){const s=[];if(o&&s.push(o),t&&t!==o){const n=t.endsWith("-svg")?t:`${t}-svg`;s.push(n)}for(const n of s){const i=D.get(n,e);if(i)return i}return null}function Tr(o,t={size:18}){const e=typeof o?.iconKey=="string"?o.iconKey:null;if(e){const s=D.get(e,t);if(s)return s}return o?.icon instanceof Node?o.icon.cloneNode(!0):D.get("cog-svg",t)}function Sn(o){return o?.trace!=null&&o?.traces!=null&&!Array.isArray(o.traces)}function Cc(o){const t=Sn(o)?Object.keys(o.traces).filter(e=>Qn(o,e)).map(e=>Er(o,e)):[];return t.length&&o?.configuration?.table?.enabled&&Qn(o,$)&&t.push(Er(o,$)),t}function Er(o,t){if(t===$){const n={value:$,text:(o.configuration.table.label||"Table").translate(),group:"",hostActive:!0},i=D.get("table-svg",{size:20});return i instanceof Node&&(n.icon=i),n}const e=o.traces[t],s={value:t,text:(e.label||"Default").translate(),group:e.group||"",hostActive:e.active!==!1};return e.icon instanceof Node&&(s.icon=e.icon),e.disabled===!0&&(s.disabled=!0,s.title=e.disabledTitle||e.label||"Default"),s}function am(o){return Sn(o)?we(o).map(t=>Er(o,t)):[]}function om(o,t,e){const s=Cc(o);return s.length?tt({idPrefix:t,suffix:"settings-views-active",legend:"Active view",fields:[{label:"Active view".translate(),description:"Switch plotter view".translate(),input:new J({id:`${t}-view-selector`,key:"trace",type:"select",nullable:!1,counter:!1,dropdownLeft:!1,list:o,items:s,callbacks:{input:n=>e?.(n)}})}]}):null}function lm(o,t,e,{layer:s,onViewChange:n,onViewLayoutChange:i}={}){if(!Sn(s))return null;const r=[];if(o.layout||(o.layout=xt()),ee(s?.configuration)==="pin")r.push(Q_({configuration:o,layer:s,idPrefix:t,onChange:e,onViewLayoutChange:i,getViewDefinitions:()=>am(s)}));else{const a=om(s,t,n);a&&r.push(a)}return Te({idPrefix:t,suffix:"group-views",title:"Views",targetIcon:"grid-svg",fallbackIcon:"cog-svg",open:!0,contents:r})}function cm(o){if(o===""||o==null||typeof o=="number")return o;const t=Number(o);return Number.isNaN(t)?o:t}function yt({id:o,label:t,description:e,list:s,key:n,type:i,items:r,min:a,max:l,step:c,unit:h,outerSuffix:u,disabled:d,onChange:p,afterChange:f,valueTransform:_}){return{label:t.translate(),description:e?.translate?.()??e,input:new J({id:o,list:s,key:n,type:i,items:r,min:a,max:l,step:c,unit:h,outerSuffix:u,disabled:d,callbacks:{input:g=>{const m=i==="number"?cm(g):g;s[n]=_?_(m):m,p?.(),f?.(m)}}})}}function tt({idPrefix:o,suffix:t,legend:e,fields:s,documentation:n}){return new bi({id:`${o}-${t}`,legend:e.translate(),layout:Wg,classList:Gg,wrapper:jg,documentation:n,fields:s})}function Te({idPrefix:o,suffix:t,title:e,targetIcon:s,fallbackIcon:n,chartIcon:i,iconNode:r,open:a=!1,contents:l}){let c;return r instanceof Node?c=r:i?c=Lr(i,{size:18}):c=xn(s,n,{size:18}),new wt({title:e.translate(),icon:c,open:a,contents:l})}function hm(o,t,e,s){const n=s?.traces;if(!n||typeof n!="object"||Array.isArray(n))return[];bn(s),cr(o);const i=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const l=r[a];if(!qt(s,l))continue;const c=n[l],h=ps(c);if(!h)continue;const u=fs(h);if(!u.length)continue;const d=ur(s,l),p=u.map(({path:g,leaf:m})=>{const y=pc(g).translate(),b=`${t}-custom-${l}-${g.replace(/\./g,"-")}`,A=m._type,L=g.split(".").reduce((T,E)=>T?.[E],d);if(A==="boolean")return{label:y,input:new J({id:b,type:"switch",nullable:!1,counter:!1,value:L===!0,callbacks:{input:T=>{Yt(s,l,g,T===!0),e?.()}}})};if(A==="int")return{label:y,input:new J({id:b,type:"number",nullable:!1,counter:!1,min:m._min,max:m._max,value:L,callbacks:{input:T=>{Yt(s,l,g,T),e?.()}}})};if(A==="select"){const T=Array.isArray(m._items)?m._items.map(E=>({text:String(E.name??E.text??E.value).translate(),value:E.value})):[];return{label:y,input:new J({id:b,type:"select",nullable:!0,counter:!1,dropdownLeft:!1,items:T,value:L,callbacks:{input:E=>{Yt(s,l,g,E),e?.()}}})}}return A==="color"?{label:y,input:new J({id:b,type:"color",nullable:!0,counter:!1,value:L,callbacks:{input:T=>{Yt(s,l,g,T),e?.()}}})}:{label:y,input:new J({id:b,type:"text",nullable:!0,counter:!1,value:L==null?"":String(L),callbacks:{input:T=>{Yt(s,l,g,T),e?.()}}})}}),f=c.label||l,_=c.icon instanceof Node?c.icon.cloneNode(!0):null;i.push(Te({idPrefix:t,suffix:`group-custom-view-${l}`,title:typeof f=="string"?f:String(l),targetIcon:"font-svg",fallbackIcon:"cog-svg",iconNode:_,open:!1,contents:[tt({idPrefix:t,suffix:`settings-custom-view-${l}`,legend:"Style",fields:p})]}))}return i}function um(o,t,e,{layer:s,traces:n=[],onViewChange:i,onReverseAxisChange:r,onViewLayoutChange:a,moduleInputs:l,solutionKey:c,onModuleInputsChange:h,onBaselinePositionChange:u}={}){const d=k=>yt({...k,onChange:e}),p=lm(o,t,e,{layer:s,onViewChange:i,onViewLayoutChange:a}),f=Lm(s,n),_=f.has("waterfall")||f.has("tree")?Rc(l):null,g=c==="detect"?Tm(l):null,m=h||e,y=k=>yt({...k,onChange:m}),b=[tt({idPrefix:t,suffix:"settings-general-plot",legend:"Plot",fields:[yt({id:`${t}-reverse`,label:"Reverse axis",description:"Reverse axis orientation",list:o,key:"reverse",type:"switch",afterChange:k=>r?.(k)})]}),tt({idPrefix:t,suffix:"settings-plot-padding",legend:"Plot padding",fields:["top","right","bottom","left"].map(k=>d({id:`${t}-padding-${k}`,label:k.charAt(0).toUpperCase()+k.slice(1),list:o.plot.padding,key:k,type:"number",min:0,unit:"px"}))}),tt({idPrefix:t,suffix:"settings-general-behaviors",legend:"Behaviors",fields:[d({id:`${t}-transition-duration`,label:"Transition duration",list:o.behaviors,key:"transitionDuration",type:"number",min:0,unit:"ms"}),d({id:`${t}-shortcuts-on-hover`,label:"Shortcuts on hover",description:"Display shortcuts on hover only",list:o.behaviors,key:"displayShortcutsOnHover",type:"switch"}),d({id:`${t}-disable-mouse-wheel-zoom`,label:"Disable mouse wheel zoom",description:"Ignore mouse wheel zoom on traces",list:o.behaviors,key:"disableMouseWheelZoom",type:"switch"})]})];_&&f.has("waterfall")&&b.push(tt({idPrefix:t,suffix:"settings-general-compare",legend:"Compare",fields:[y({id:`${t}-waterfall-measure`,label:"Waterfall measure",list:_,key:"waterfallMeasure",type:"select",items:[{text:"Impact".translate(),value:"Impact"},{text:"Impact in points".translate(),value:"Pts_gap"}]}),y({id:`${t}-waterfall-secondary-comparison`,label:"Secondary comparison",list:xm(_),key:"secondaryComparison",type:"select",items:[{text:"Above".translate(),value:"vertical"},{text:"On right".translate(),value:"horizontal"},{text:"Overlay".translate(),value:"overlay"}]}),y({id:`${t}-waterfall-open-bar-by-default`,label:"Expand first driver",list:_,key:"waterfallOpenBarByDefault",type:"switch"}),y({id:`${t}-waterfall-expand-depth`,label:"Expansion depth",description:"When a step is expanded, reveal only its direct children (one level) or also their children (two levels).",list:_,key:"waterfallExpandDepth",type:"select",items:[{text:"One level for mix, two for perf".translate(),value:3},{text:"One level".translate(),value:1},{text:"Two levels".translate(),value:2}]}),d({id:`${t}-hierarchical-elements-threshold`,label:"Number of bars displayed before remaining",description:"Decide how many segments are displayed before going into remaining bucket",list:o.axis.hierarchical,key:"elementsThreshold",type:"number",min:1,max:50}),y({id:`${t}-waterfall-group-equation-steps`,label:"Also group steps remaining",description:"Also group the market equation steps inside the remaining bar",list:_,key:"waterfallGroupEquationSteps",type:"switch"})]})),_&&f.has("tree")&&b.push(tt({idPrefix:t,suffix:"settings-general-tree",legend:"Tree",fields:[y({id:`${t}-waterfall-exploration-method`,label:"Exploration method",list:_,key:"hierarchyExplorationMethod",type:"select",items:[{text:"Hierarchy".translate(),value:"hierarchy"},{text:"Top N".translate(),value:"top"}]}),y({id:`${t}-waterfall-hierarchy-top-leaves`,label:"Top exploration leaf count",list:_,key:"hierarchyTopLeaves",type:"number",min:1,max:20})]})),g&&b.push(tt({idPrefix:t,suffix:"settings-general-detect",legend:"Detect",fields:[y({id:`${t}-detect-segment-chart-mode`,label:"Segments",list:g,key:"segmentChartMode",type:"select",items:[{text:"Merged".translate(),value:"overlay"},{text:"Split".translate(),value:"split"}]})]}));const A=Te({idPrefix:t,suffix:"group-general",title:"General",targetIcon:"cog-svg",fallbackIcon:"settings-svg",open:!1,contents:b}),L=qe(o),T=(k,I)=>tt({idPrefix:t,suffix:`settings-header-${k}`,legend:I,fields:[d({id:`${t}-header-${k}-display`,label:"Display",description:k==="title"?"Display smart title".translate():"Display subtitle".translate(),list:L[k],key:"display",type:"switch"}),d({id:`${t}-header-${k}-size`,label:"Size",list:L[k],key:"size",type:"number",min:8,max:48,unit:"px"}),d({id:`${t}-header-${k}-weight`,label:"Weight",list:L[k],key:"weight",type:"number",min:100,max:900,step:100}),d({id:`${t}-header-${k}-family`,label:"Font",list:L[k],key:"family",type:"select",items:le(),valueTransform:It}),d({id:`${t}-header-${k}-color`,label:"Color",list:L[k],key:"color",type:"color"})]}),E=Te({idPrefix:t,suffix:"group-header",title:"Slide title",targetIcon:"slide-svg",fallbackIcon:"font-svg",open:!p,contents:[T("title","Title"),T("subtitle","Subtitle")]}),C=(k,I,O)=>tt({idPrefix:t,suffix:`settings-chart-${k}`,legend:I,fields:[d({id:`${t}-chart-${k}-display`,label:"Display",description:k==="title"?"Display the chart title band":"Display the chart subtitle band",list:O,key:"display",type:"switch"}),d({id:`${t}-chart-${k}-position`,label:"Position",description:"Place the band above or below the chart",list:O,key:"position",type:"select",items:[{text:"Top".translate(),value:"top"},{text:"Bottom".translate(),value:"bottom"}]}),d({id:`${t}-chart-${k}-align`,label:"Align",description:"Horizontal alignment of the band content",list:O,key:"align",type:"select",items:[{text:"Left".translate(),value:"left"},{text:"Center".translate(),value:"center"},{text:"Right".translate(),value:"right"}]}),d({id:`${t}-chart-${k}-italic`,label:"Italic",list:O.font,key:"italic",type:"switch"}),d({id:`${t}-chart-${k}-size`,label:"Size",list:O.font,key:"size",type:"number",min:8,max:48,unit:"px"}),d({id:`${t}-chart-${k}-weight`,label:"Weight",list:O.font,key:"weight",type:"number",min:100,max:900,step:100}),d({id:`${t}-chart-${k}-family`,label:"Font",list:O.font,key:"family",type:"select",items:le(),valueTransform:It})]}),S=ar(o),w=or(o),N=Te({idPrefix:t,suffix:"group-chart-title",title:"Chart title",targetIcon:"font-svg",fallbackIcon:"annotate-svg",open:!1,contents:[C("title","Title",S),C("subtitle","Subtitle",w)]}),R=Te({idPrefix:t,suffix:"group-axis",title:"Axis",targetIcon:"axis-svg",fallbackIcon:"areas-svg",open:!1,contents:[tt({idPrefix:t,suffix:"settings-axis-baseline",legend:"Baseline",fields:[d({id:`${t}-baseline-display`,label:"Display",description:"Show the measure axis baseline line",list:Bt(o),key:"display",type:"switch"}),yt({id:`${t}-baseline-position`,label:"Position",description:"Zero forces the scale to include 0 on mono-sign data; Min draws at the domain minimum",list:Bt(o),key:"position",type:"select",items:[{text:"Zero".translate(),value:"zero"},{text:"Min".translate(),value:"min"}],onChange:()=>{if(typeof u=="function"){u();return}e?.()}}),d({id:`${t}-baseline-rendering`,label:"Rendering",list:Bt(o),key:"rendering",type:"select",items:Ec.map(k=>({text:k.text.translate(),value:k.value}))}),d({id:`${t}-baseline-color`,label:"Color",list:Bt(o),key:"color",type:"color"}),d({id:`${t}-baseline-opacity`,label:"Opacity",list:Bt(o),key:"opacity",type:"number",min:0,max:1,step:.01}),d({id:`${t}-baseline-size`,label:"Size",list:Bt(o),key:"size",type:"number",min:0,max:8,step:.5,unit:"px"}),d({id:`${t}-baseline-cut-display`,label:"Cut",description:"Allow date axis to be cut on missing data",list:Bt(o).cut,key:"display",type:"switch"}),d({id:`${t}-baseline-cut-rendering`,label:"Cut rendering",list:Bt(o).cut,key:"rendering",type:"select",items:Ec.map(k=>({text:k.text.translate(),value:k.value}))}),d({id:`${t}-baseline-cut-color`,label:"Cut color",list:Bt(o).cut,key:"color",type:"color"}),d({id:`${t}-baseline-cut-opacity`,label:"Cut opacity",list:Bt(o).cut,key:"opacity",type:"number",min:0,max:1,step:.01}),d({id:`${t}-baseline-cut-size`,label:"Cut size",list:Bt(o).cut,key:"size",type:"number",min:0,max:8,step:.5,unit:"px"})]}),tt({idPrefix:t,suffix:"settings-comparison-scales",legend:"Comparison scales",fields:[yt({id:`${t}-share-scales`,label:"Share scales between primary and secondary comparison",description:"Enable this option to share the scales between the primary and secondary comparison",list:Em(o),key:"shareScales",type:"switch",onChange:e})]}),tt({idPrefix:t,suffix:"settings-scale",legend:"Scale",fields:[d({id:`${t}-continuous-padding-on-max`,label:"Padding on max",list:o.axis.continuous,key:"paddingOnMaxValue",type:"number",min:0,max:1,step:.01}),d({id:`${t}-ratio-of-element-size`,label:"Ratio of element size",list:o.axis,key:"ratioOfElementSize",type:"number",min:0,max:1,step:.01}),d({id:`${t}-hierarchical-aggregation-name`,label:"Aggregation name",list:o.axis.hierarchical,key:"aggregationName",type:"text"})]}),...tm(s,n)?[tt({idPrefix:t,suffix:"settings-hierarchy-tree-lines",legend:"Hierarchy lines",fields:[d({id:`${t}-hierarchy-tree-lines-render`,label:"Render mode",description:"Parent-child guides between hierarchical axis ticks",list:ze(o),key:"render",type:"select",items:qg.map(k=>({text:k.text.translate(),value:k.value}))}),d({id:`${t}-hierarchy-tree-lines-color`,label:"Color",list:ze(o),key:"color",type:"color"}),d({id:`${t}-hierarchy-tree-lines-opacity`,label:"Opacity",list:ze(o),key:"opacity",type:"number",min:0,max:1,step:.01}),d({id:`${t}-hierarchy-tree-lines-size`,label:"Size",list:ze(o),key:"size",type:"number",min:0,max:8,step:.5,unit:"px"}),d({id:`${t}-hierarchy-tree-lines-stems`,label:"Vertical ticks",description:"Draw perpendicular stubs around the bracket spine",list:ze(o),key:"stems",type:"switch"})]}),tt({idPrefix:t,suffix:"settings-hierarchy-labels",legend:"Hierarchy labels",fields:[d({id:`${t}-hierarchy-level-gap-factor`,label:"Level spacing",description:"Height of one hierarchy level, as a multiple of the tick font size",list:o.axis.hierarchical,key:"levelGapFactor",type:"number",min:Bl,max:zl,step:.1}),d({id:`${t}-hierarchy-max-reserve-ratio`,label:"Max axis height share",description:"Largest share of the plot the dimension axis may take before labels are shortened",list:o.axis.hierarchical,key:"maxReserveRatio",type:"number",min:Vl,max:$l,step:.05}),d({id:`${t}-hierarchy-labels-max-lines`,label:"Max label lines",description:"Lines a label may wrap over before being cut with an ellipsis",list:nr(o),key:"maxLines",type:"number",min:1,max:Wl,step:1}),d({id:`${t}-hierarchy-labels-auto-size`,label:"Shrink to fit",description:"Reduce the font size of labels that do not fit their slot",list:nr(o),key:"autoSize",type:"switch"}),d({id:`${t}-hierarchy-labels-min-size`,label:"Min label size",description:"Labels that would need a smaller font are hidden instead",list:nr(o),key:"minSize",type:"number",min:4,max:24,step:1,unit:"px"})]})]:[]]}),M=Te({idPrefix:t,suffix:"group-legends",title:"Legends",targetIcon:"tag-svg",fallbackIcon:"annotate-svg",open:!1,contents:[tt({idPrefix:t,suffix:"settings-legends",legend:"Legends",fields:[d({id:`${t}-legends-display`,label:"Display",description:"Display plot legends",list:o.legends,key:"display",type:"switch"}),d({id:`${t}-legends-position`,label:"Position",description:"Choose legend position",list:o.legends,key:"position",type:"select",items:[{text:"Left".translate(),value:"left"},{text:"Right".translate(),value:"right"},{text:"Top".translate(),value:"top"},{text:"Bottom".translate(),value:"bottom"}]})]})]});return new Oe({id:`${t}-global-settings-groups`,multiple:!0,searchable:!0,panels:[A,...p?[p]:[],E,N,...hm(o,t,e,s),R,M]})}const xr=Object.freeze([{text:"Auto",value:"auto",compact:null},{text:"On",value:"on",compact:!0},{text:"Off",value:"off",compact:!1}]),Sr=Object.freeze([{text:"Auto",value:"auto",decimals:null},{text:"0",value:"0",decimals:0},{text:"1",value:"1",decimals:1},{text:"2",value:"2",decimals:2}]);function dm(o,t,e,s){const n=o.ticks.texts.format,i={presetId:mn},r={mode:"auto"},a={mode:"auto"};let l=null;const c=()=>{i.presetId=Jl(n)??mn;const p=xr.find(_=>_.compact===n.compact);r.mode=p?.value??"auto";const f=Sr.find(_=>_.decimals===n.decimals);a.mode=f?.value??"auto"},h=()=>{c(),l&&(l.__parameters__.fields=d(),l.render())},u=()=>{const p=ds.map(f=>({text:f.label.translate(),value:f.id}));return i.presetId===mn&&p.unshift({text:"Custom".translate(),value:mn}),p},d=()=>[yt({id:`${t}-axis-${e}-tick-format-preset`,label:"Preset",description:"Shortcut applying a number format to measure axis tick labels",list:i,key:"presetId",type:"select",items:u(),onChange:()=>{fg(n,i.presetId),s?.(),h()}}),yt({id:`${t}-axis-${e}-tick-format-compact`,label:"Compact",description:"Shorten large values with K / M / B suffixes",list:r,key:"mode",type:"select",items:xr.map(p=>({text:p.text.translate(),value:p.value})),onChange:()=>{const p=xr.find(f=>f.value===r.mode);n.compact=p?p.compact:null,s?.(),h()}}),yt({id:`${t}-axis-${e}-tick-format-decimals`,label:"Decimals",description:"Fixed number of decimals, or Auto for significant digits",list:a,key:"mode",type:"select",items:Sr.map(p=>({text:p.text.translate(),value:p.value})),onChange:()=>{const p=Sr.find(f=>f.value===a.mode);n.decimals=p?p.decimals:null,s?.(),h()}}),yt({id:`${t}-axis-${e}-tick-format-show-unit`,label:"Show unit",list:n,key:"showUnit",type:"switch",onChange:()=>{s?.(),h()}})];return c(),l=tt({idPrefix:t,suffix:`settings-module-axis-${e}-format`,legend:"Format",fields:d()}),l}function wc(o,t,e,s){const n=l=>yt({...l,onChange:e}),i=sr(o,s),r=s==="y"?"Y":"X",a=String(s).toLowerCase();return new wt({title:"Axis {role}".translate({role:r}),open:!1,contents:[tt({idPrefix:t,suffix:`settings-module-axis-${a}-visibility`,legend:"Visibility",fields:[n({id:`${t}-axis-${a}-hidden`,label:"Hidden",list:i,key:"hidden",type:"switch"}),n({id:`${t}-axis-${a}-override`,label:"Override chart defaults",description:"Apply these axis settings even when the chart hides this axis by design",list:i,key:Ae,type:"switch"})]}),tt({idPrefix:t,suffix:`settings-module-axis-${a}-title`,legend:"Title",fields:[n({id:`${t}-axis-${a}-title-display`,label:"Display",list:i.title,key:"display",type:"select",items:Kg.map(l=>({text:l.text.translate(),value:l.value}))}),n({id:`${t}-axis-${a}-title-size`,label:"Size",list:i.title,key:"size",type:"number",min:8,max:32,unit:"px"}),n({id:`${t}-axis-${a}-title-weight`,label:"Weight",list:i.title,key:"weight",type:"number",min:100,max:900,step:100}),n({id:`${t}-axis-${a}-title-family`,label:"Font",list:i.title,key:"family",type:"select",items:le(),valueTransform:It}),n({id:`${t}-axis-${a}-title-color`,label:"Color",list:i.title,key:"color",type:"color"}),n({id:`${t}-axis-${a}-title-vertical-position`,label:"Vertical position",list:i.title,key:"verticalPosition",type:"select",items:Xg.map(l=>({text:l.text.translate(),value:l.value}))})]}),tt({idPrefix:t,suffix:`settings-module-axis-${a}-labels`,legend:"Texts",fields:[n({id:`${t}-axis-${a}-tick-texts-display`,label:"Display",list:i.ticks.texts,key:"display",type:"switch"}),n({id:`${t}-axis-${a}-tick-texts-opacity`,label:"Opacity",list:i.ticks.texts,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-axis-${a}-tick-texts-size`,label:"Size",list:i.ticks.texts,key:"size",type:"number",min:8,max:20,unit:"px"}),n({id:`${t}-axis-${a}-tick-texts-color`,label:"Color",list:i.ticks.texts,key:"color",type:"color"}),n({id:`${t}-axis-${a}-tick-texts-weight`,label:"Weight",list:i.ticks.texts,key:"weight",type:"number",min:100,max:900,step:100}),n({id:`${t}-axis-${a}-tick-texts-family`,label:"Font",list:i.ticks.texts,key:"family",type:"select",items:le(),valueTransform:It}),n({id:`${t}-axis-${a}-tick-texts-orientation`,label:"Orientation",list:i.ticks.texts,key:"orientation",type:"select",items:Yl.map(l=>({text:l.text.translate(),value:l.value}))})]}),dm(i,t,a,e),tt({idPrefix:t,suffix:`settings-module-axis-${a}-lines`,legend:"Markers",fields:[n({id:`${t}-axis-${a}-tick-lines-display`,label:"Display",list:i.ticks.lines,key:"display",type:"switch"}),n({id:`${t}-axis-${a}-tick-lines-opacity`,label:"Opacity",list:i.ticks.lines,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-axis-${a}-tick-lines-color`,label:"Color",list:i.ticks.lines,key:"color",type:"color"}),n({id:`${t}-axis-${a}-tick-lines-size`,label:"Size",list:i.ticks.lines,key:"size",type:"number",min:1,max:20,unit:"px"})]})]})}function vr(o,t,e,s){return[...o||[],wc(t,e,s,"x"),wc(t,e,s,"y")]}function pm(o,t,e){const s=n=>yt({...n,onChange:e});return tt({idPrefix:t,suffix:"settings-module-bars-gradient",legend:"Gradient",fields:[s({id:`${t}-bars-gradient-display`,label:"Display",list:o.bars.gradient,key:"display",type:"switch"}),s({id:`${t}-bars-gradient-scale`,label:"Scale",list:o.bars.gradient,key:"scale",type:"select",items:[{text:"Plot".translate(),value:"plot"},{text:"Element".translate(),value:"element"}]}),s({id:`${t}-bars-gradient-orientation`,label:"Orientation",list:o.bars.gradient,key:"orientation",type:"select",items:[{text:"Vertical".translate(),value:"vertical"},{text:"Horizontal".translate(),value:"horizontal"}]}),s({id:`${t}-bars-gradient-top`,label:"Top",list:o.bars.gradient,key:"top",type:"number",min:0,max:100,unit:"%"}),s({id:`${t}-bars-gradient-bottom`,label:"Bottom",list:o.bars.gradient,key:"bottom",type:"number",min:0,max:100,unit:"%"}),s({id:`${t}-bars-gradient-left`,label:"Left",list:o.bars.gradient,key:"left",type:"number",min:0,max:100,unit:"%"}),s({id:`${t}-bars-gradient-right`,label:"Right",list:o.bars.gradient,key:"right",type:"number",min:0,max:100,unit:"%"})]})}function fm(o,t,e){const s=n=>yt({...n,onChange:e});return tt({idPrefix:t,suffix:"settings-module-bars-round",legend:"Rounded bars",fields:[s({id:`${t}-bars-round-display`,label:"Display",list:o.bars.round,key:"display",type:"switch"}),s({id:`${t}-bars-round-radius`,label:"Radius",list:o.bars.round,key:"radius",type:"text"})]})}function _m(o,t,e,s={}){const n=o.bars.labels,i=o.bars.endLabels;let r=null;const a=()=>{e?.(),r?.syncFieldVisibility()},l=(s.traces||[]).filter(_=>_?.type==="bars"),c=l.some(_=>_.stacked&&!_.overlay),h=l.some(fn),u=()=>n.display===!0||h&&re(n)!=="never",d=()=>i.display===!0,p=({visible:_,...g})=>({...yt({...g,onChange:a}),visible:_}),f={get values(){return us(n)},set values(_){Pl(n,_)},get totals(){return re(n)},set totals(_){n.totals=_}};return r=tt({idPrefix:t,suffix:"settings-module-bars-labels",legend:"Labels",fields:[p({id:`${t}-bars-labels-values`,label:"Display",list:f,key:"values",type:"select",items:pn.map(_=>({text:_.text.translate(),value:_.value}))}),p({id:`${t}-bars-labels-totals`,label:"Totals",list:f,key:"totals",type:"select",visible:()=>h,items:pn.map(_=>({text:_.text.translate(),value:_.value}))}),p({id:`${t}-bars-labels-position`,visible:u,label:"Position",list:n,key:"position",type:"select",items:Ol.map(_=>({text:_.text.translate(),value:_.value}))}),p({id:`${t}-bars-labels-orientation`,visible:u,label:"Orientation",list:n,key:"orientation",type:"select",items:Dl.map(_=>({text:_.text.translate(),value:_.value}))}),p({visible:u,id:`${t}-bars-labels-size`,label:"Size",list:n,key:"size",type:"number",min:8,max:24,unit:"px"}),p({visible:u,id:`${t}-bars-labels-weight`,label:"Weight",list:n,key:"weight",type:"number",min:100,max:900,step:100}),p({visible:u,id:`${t}-bars-labels-color`,label:"Color",list:n,key:"color",type:"color"}),p({id:`${t}-bars-labels-family`,visible:u,label:"Font",list:n,key:"family",type:"select",items:le(),valueTransform:It}),p({visible:()=>c,id:`${t}-bars-end-labels-display`,label:"End labels",list:o.bars.endLabels,key:"display",type:"switch"}),p({visible:()=>c&&d(),id:`${t}-bars-end-labels-size`,label:"Size",list:i,key:"size",type:"number",min:8,max:24,unit:"px"}),p({visible:()=>c&&d(),id:`${t}-bars-end-labels-weight`,label:"Weight",list:i,key:"weight",type:"number",min:100,max:900,step:100}),p({visible:()=>c&&d(),id:`${t}-bars-end-labels-family`,label:"Font",list:i,key:"family",type:"select",items:le(),valueTransform:It})]}),r}function gm(o,t,e,s={}){return vr([pm(o,t,e),fm(o,t,e),_m(o,t,e,s)],o,t,e)}function mm(o,t,e){const s=n=>yt({...n,onChange:e});return vr([tt({idPrefix:t,suffix:"settings-module-lines-style",legend:"Style",fields:[s({id:`${t}-lines-curve`,label:"Curve",list:o.lines,key:"curve",type:"select",items:fc.map(n=>({text:n.text.translate(),value:n.value}))})]}),tt({idPrefix:t,suffix:"settings-module-lines-end-labels",legend:"End labels",fields:[s({id:`${t}-lines-end-labels-display`,label:"Display",list:o.lines.endLabels,key:"display",type:"switch"}),s({id:`${t}-lines-end-labels-value`,label:"Value",list:o.lines.endLabels,key:"value",type:"switch"}),s({id:`${t}-lines-end-labels-size`,label:"Size",list:o.lines.endLabels,key:"size",type:"number",min:8,max:24,unit:"px"})]})],o,t,e)}function ym(o,{idPrefix:t,moduleSettings:e,onChange:s}){const n=e?.appendTreeCardContents;if(typeof n!="function")return;const i=n({idPrefix:t,moduleInputs:e.moduleInputs,onModuleInputsChange:e.onModuleInputsChange||s,createFieldSet:tt,buildField:r=>yt(r)});if(Array.isArray(i)){i.forEach(r=>{r&&o.push(r)});return}i&&o.push(i)}function bm(o,t,e,s={}){const n=r=>yt({...r,onChange:e}),i=[tt({idPrefix:t,suffix:"settings-module-tree-cards",legend:"Style",fields:[n({id:`${t}-tree-cards-radius`,label:"Radius",list:o.tree.cards,key:"radius",type:"number",min:kt,valueTransform:$e,unit:"px"}),n({id:`${t}-tree-border-width`,label:"Border width",list:o.tree.cards.border,key:"width",type:"number",min:0,unit:"px"}),En({id:`${t}-tree-border-color`,label:"Border color",list:o.tree.cards.border,colorKey:"color",onChange:e,semanticBinding:"nullable"}),n({id:`${t}-tree-border-opacity`,label:"Border opacity",list:o.tree.cards.border,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-tree-border-dasharray`,label:"Border dash array",list:o.tree.cards.border,key:"dasharray",type:"text",valueTransform:It}),n({id:`${t}-tree-connector-render`,label:"Render mode",list:o.tree.cards.connector,key:"render",type:"select",items:Qg.map(r=>({text:r.text.translate(),value:r.value})),valueTransform:r=>r==="false"?!1:r}),En({id:`${t}-tree-connector-neutral-stroke`,label:"Neutral stroke",list:o.tree.cards.connector,colorKey:"neutralStroke",flagKey:"color",onChange:e,semanticBinding:"flag",solidDefault:Tc(o.tree.cards.connector.neutralStroke,Ne)}),n({id:`${t}-tree-connector-size`,label:"Size",list:o.tree.cards.connector,key:"size",type:"number",min:0,unit:"px"}),n({id:`${t}-tree-connector-opacity`,label:"Opacity",list:o.tree.cards.connector,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-tree-connector-dasharray`,label:"Dash array",list:o.tree.cards.connector,key:"dasharray",type:"text",valueTransform:It})]})];return ym(i,{idPrefix:t,moduleSettings:s,onChange:e}),[new wt({title:"Cards".translate(),icon:D.get("cards-svg",{size:18}),open:!1,contents:i}),new wt({title:"Operators".translate(),icon:D.get("operator-svg",{size:18}),open:!1,contents:[tt({idPrefix:t,suffix:"settings-module-tree-operators",legend:"Decoration",fields:[n({id:`${t}-tree-operators-decoration-mode`,label:"Decoration mode",list:o.tree.operators,key:"decorationMode",type:"select",items:Zg.map(r=>({text:r.text.translate(),value:r.value}))})]})]})]}function Am(o){return o?(Array.isArray(o.waterfallCustomPillars)||(o.waterfallCustomPillars=[]),o.waterfallCustomPillars):null}function Lm(o,t){const e=new Set,s=i=>{typeof i=="string"&&i.length&&e.add(i)};(Array.isArray(t)?t:[]).forEach(i=>s(i?.type));const n=o?.traces;return n&&typeof n=="object"&&Object.keys(n).forEach(i=>{const r=n[i];s(r?.type),(Array.isArray(r?.traces)?r.traces:[]).forEach(a=>s(a?.type))}),e}function Tm(o){return!o||typeof o!="object"?null:(o.segmentChartMode!=="overlay"&&o.segmentChartMode!=="split"&&(o.segmentChartMode="overlay"),o)}function Rc(o){return!o||typeof o!="object"?null:(o.waterfallMeasure==null&&(o.waterfallMeasure="Impact"),o.waterfallLabelColumn==null&&(o.waterfallLabelColumn=o.waterfallMeasure==="Pts_gap"?"Pts_gap_disp":"Impact_disp"),o.waterfallLabelArrows==null&&(o.waterfallLabelArrows=!1),o.waterfallTopLineColumn==null&&(o.waterfallTopLineColumn=gr),bc(o),o.splitOrientation==null&&(o.splitOrientation="horizontal"),o.splitDisplayMode==null&&(o.splitDisplayMode="grouped"),o.waterfallOpenBarByDefault==null&&(o.waterfallOpenBarByDefault=!0),o.waterfallExpandDepth==null&&(o.waterfallExpandDepth=3),o.waterfallGroupEquationSteps==null&&(o.waterfallGroupEquationSteps=!1),o.hierarchyExplorationMethod==null&&(o.hierarchyExplorationMethod="hierarchy"),o.hierarchyTopLeaves==null&&(o.hierarchyTopLeaves=4),o)}function Em(o){o.axis||(o.axis={}),(!o.axis.groupedAxes||typeof o.axis.groupedAxes!="object")&&(o.axis.groupedAxes={enabled:!1,yDomainMode:"group",gutter:20});const t={};return Object.defineProperty(t,"shareScales",{enumerable:!0,configurable:!0,get(){return o.axis.groupedAxes.yDomainMode!=="group"},set(e){o.axis.groupedAxes.yDomainMode=e?"global":"group"}}),t}function xm(o){const t={};return Object.defineProperty(t,"secondaryComparison",{enumerable:!0,configurable:!0,get(){return o.splitDisplayMode==="overlay"?"overlay":o.splitOrientation==="vertical"?"vertical":"horizontal"},set(e){if(e==="overlay"){o.splitDisplayMode="overlay";return}o.splitOrientation=e==="vertical"?"vertical":"horizontal",o.splitDisplayMode="grouped"}}),t}function Sm(o,t,e){const s=document.createElement("div");s.className="plotter-waterfall-pillars-list";const n=()=>{if(s.replaceChildren(),!o.length){const i=document.createElement("p");i.className="plotter-waterfall-pillars-empty",i.textContent="No custom pillars".translate(),s.append(i);return}o.forEach((i,r)=>{const a=document.createElement("div");a.className="plotter-waterfall-pillars-row",a.dataset.pillarId=i.id??String(r),i.labelReference=Lc(i.labelReference);const l=new J({id:`${t}-waterfall-pillar-label-${i.id??r}`,label:"Label".translate(),type:"text",list:i,key:"label",callbacks:{input:u=>{i.label=String(u??"").trim(),e?.()}}}),c=new J({id:`${t}-waterfall-pillar-label-reference-${i.id??r}`,label:"Calculate labels from".translate(),type:"select",list:i,key:"labelReference",items:Ug(),callbacks:{input:u=>{i.labelReference=Lc(u),e?.()}}}),h=new vt({id:`${t}-waterfall-pillar-delete-${i.id??r}`,icon:D.get("cross-svg",{size:16}),title:"Remove pillar".translate(),classList:["transparent","plotter-waterfall-pillars-delete"],callbacks:{click:()=>{const u=i.id,d=o.filter(p=>p?.id!==u);d.length!==o.length&&(o.length=0,o.push(...d),e?.(),n())}}});a.append(l.render(),c.render(),h.render()),s.append(a)})};return n(),s}function vm(o,t,e){const s=Am(o);return s?tt({idPrefix:t,suffix:"settings-module-waterfall-pillars",legend:"Pillars",fields:[{input:Sm(s,t,e)}]}):null}function kc(o){return $g(o).map(t=>({text:t.text.translate(),value:t.value}))}function Cm(o,t,e){if(!o)return{labelIndicatorFields:[],topLineIndicatorField:null,syncIndicatorSelects:()=>{}};let s=null,n=null;const i=()=>{bc(o),s?.refreshSelectItems?.(),n?.refreshSelectItems?.(),s?.syncSelectionFromBinding?.(),n?.syncSelectionFromBinding?.()},r=c=>yt({...c,onChange:e,afterChange:()=>{i()}}),a=r({id:`${t}-waterfall-label-column`,label:"Indicator",description:"Choose which metric text is painted on waterfall value labels",list:o,key:"waterfallLabelColumn",type:"select",items:()=>kc(yc(o.waterfallTopLineColumn))});s=a.input;const l=r({id:`${t}-waterfall-topline-column`,label:"Indicator",description:"Choose which metric text is painted on waterfall top-line labels",list:o,key:"waterfallTopLineColumn",type:"select",items:()=>kc(mc(o.waterfallLabelColumn,o.waterfallMeasure))});return n=l.input,{labelIndicatorFields:[a,r({id:`${t}-waterfall-label-arrows`,label:"Arrows",description:"Append in/out arrows next to waterfall value labels",list:o,key:"waterfallLabelArrows",type:"switch"})],topLineIndicatorField:l,syncIndicatorSelects:i}}function wm(o,t,e,s={}){const n=f=>yt({...f,onChange:e}),i=s.onModuleInputsChange||e,r=Rc(s.moduleInputs),{labelIndicatorFields:a,topLineIndicatorField:l,syncIndicatorSelects:c}=Cm(r,t,i);c();const h=vm(s.moduleInputs,t,i),u=[tt({idPrefix:t,suffix:"settings-module-waterfall-labels-values",legend:"Values",fields:[n({id:`${t}-waterfall-labels-display`,label:"Display",list:o.waterfall.labels,key:"display",type:"switch"}),...a,n({id:`${t}-waterfall-labels-size`,label:"Size",list:o.waterfall.labels,key:"size",type:"number",min:_s,max:gs,unit:"px"}),En({id:`${t}-waterfall-labels-color`,label:"Color",list:o.waterfall.labels,colorKey:"color",onChange:e,semanticBinding:"nullable"}),n({id:`${t}-waterfall-labels-opacity`,label:"Opacity",list:o.waterfall.labels,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-waterfall-labels-weight`,label:"Weight",list:o.waterfall.labels,key:"weight",type:"number",min:100,max:900,step:100}),n({id:`${t}-waterfall-labels-family`,label:"Font",list:o.waterfall.labels,key:"family",type:"select",items:le(),valueTransform:It}),n({id:`${t}-waterfall-labels-position`,label:"Position",list:o.waterfall.labels,key:"position",type:"select",items:[{text:"Value".translate(),value:"value"},{text:"Top".translate(),value:"top"},{text:"Bottom".translate(),value:"bottom"},{text:"Middle".translate(),value:"middle"}]}),n({id:`${t}-waterfall-labels-max-depth`,label:"Deepest labelled level",description:"Hierarchy level after which bar values stop being labelled (empty = all levels)",list:o.waterfall.labels,key:"maxDepth",type:"number",min:0,max:10,step:1,valueTransform:It}),n({id:`${t}-waterfall-labels-auto-hide`,label:"Hide when it does not fit",description:"Drop values wider than their bar instead of overlapping neighbours",list:o.waterfall.labels,key:"autoHide",type:"switch"})]}),tt({idPrefix:t,suffix:"settings-module-waterfall-topline",legend:"Top line",fields:[n({id:`${t}-waterfall-topline-display`,label:"Display",list:o.waterfall.topLine,key:"display",type:"switch"}),...l?[l]:[],n({id:`${t}-waterfall-topline-size`,label:"Size",list:o.waterfall.topLine,key:"size",type:"number",min:_s,max:gs,unit:"px"}),En({id:`${t}-waterfall-topline-color`,label:"Color",list:o.waterfall.topLine,colorKey:"color",onChange:e,semanticBinding:"nullable"}),n({id:`${t}-waterfall-topline-opacity`,label:"Opacity",list:o.waterfall.topLine,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-waterfall-topline-weight`,label:"Weight",list:o.waterfall.topLine,key:"weight",type:"number",min:100,max:900,step:100}),n({id:`${t}-waterfall-topline-family`,label:"Font",list:o.waterfall.topLine,key:"family",type:"select",items:le(),valueTransform:It}),n({id:`${t}-waterfall-topline-position`,label:"Position",list:o.waterfall.topLine,key:"position",type:"select",items:[{text:"Top line".translate(),value:"top-line"},{text:"Bottom line".translate(),value:"bottom-line"}]})]})],d=[tt({idPrefix:t,suffix:"settings-module-waterfall-bars",legend:"Bars",fields:[n({id:`${t}-waterfall-bars-rounded`,label:"Rounded radius",list:o.waterfall.bars,key:"rounded",type:"number",min:kt,valueTransform:$e,unit:"px"}),n({id:`${t}-waterfall-bars-opacity`,label:"Opacity",list:o.waterfall.bars,key:"opacity",type:"number",min:0,max:1,step:.01})]}),tt({idPrefix:t,suffix:"settings-module-waterfall-links",legend:"Links",fields:[n({id:`${t}-waterfall-links-display`,label:"Display",list:o.waterfall.links,key:"display",type:"switch"}),n({id:`${t}-waterfall-links-color`,label:"Color",list:o.waterfall.links,key:"color",type:"color"}),n({id:`${t}-waterfall-links-opacity`,label:"Opacity",list:o.waterfall.links,key:"opacity",type:"number",min:0,max:1,step:.01}),n({id:`${t}-waterfall-links-width`,label:"Width",list:o.waterfall.links,key:"width",type:"number",min:0,unit:"px"}),n({id:`${t}-waterfall-links-rendering`,label:"Rendering",list:o.waterfall.links,key:"rendering",type:"select",items:[{text:"Full".translate(),value:"full"},{text:"Dashed".translate(),value:"dashed"},{text:"Dotted".translate(),value:"dotted"}]}),n({id:`${t}-waterfall-links-dasharray`,label:"Dash array",description:"Optional SVG dash pattern; overrides Rendering when set",list:o.waterfall.links,key:"dasharray",type:"text",valueTransform:It})]})];h&&d.push(h);const p=[new wt({title:"Labels".translate(),icon:D.get("tag-svg",{size:18}),open:!1,contents:u}),new wt({title:"Elements".translate(),icon:D.get("elements-svg",{size:18}),open:!1,contents:d})];return vr(p,o,t,e)}function Rm(o,t,e,s,n={}){const i=s.buildContents(o,t,e,n);if(!i?.length)return null;const r=i.map((a,l)=>wt.is(a)?(a.__parameters__.open==null&&(a.__parameters__.open=l===0),a):new wt({title:a.__parameters__?.legend||s.title,open:l===0,contents:[a]}));return new Oe({id:`${t}-${s.type}-settings-groups`,multiple:!0,searchable:!1,panels:r})}function Ee(o,t){return`${o}-settings-scope-${t}`}function vn(o){o?.__parameters__&&(o.__parameters__.searchable=!1)}function Cr(o){const t=[];return(o||[]).forEach(e=>{if(e?.__parameters__?.panels){t.push(...ys(e));return}if(e?.__parameters__?.title!==void 0){t.push(e),t.push(...Cr(e.__parameters__?.contents||[]));return}Array.isArray(e?.contents)&&t.push(...Cr(e.contents))}),t}function km(o){const t=[];return(o||[]).forEach(e=>{if(e?.__parameters__?.panels){t.push(...ys(e));return}e?.__parameters__?.title!==void 0&&(t.push(e),t.push(...Cr(e.__parameters__?.contents||[])))}),t}function ys(o){if(!o?.__parameters__)return[];if(Array.isArray(o.__parameters__.sections)&&o.__parameters__.sections.length){const t=[];return o.__parameters__.sections.forEach(e=>{t.push(...ys(e?.groups))}),t}return km(o.__parameters__.panels||[])}function Nm(o){ys(o).forEach((e,s)=>{e.__parameters__.open=s===0})}function bs({title:o,icon:t,anchorId:e,groups:s,headerActions:n}){return s?{title:o,icon:t,anchorId:e,groups:s,headerActions:n}:null}function Mm({section:o,idPrefix:t,headerActions:e=null}){const s=o?.scope;if(!br(s))return null;if(o?.panels?.__parameters__?.panels)return im(o?.node,o?.panels);if(!(o?.node instanceof Node))return null;const n=t&&s?`${t}-analysis-${s}-panel`:!1,i=Tr(o,{size:18}),r=e instanceof Node?e:null,a=new wt({id:n||void 0,anchorId:n||void 0,title:o.title||s,icon:i,open:!0,headerActions:r,contents:[o.node]});return new Oe({id:t?`${t}-analysis-${s}-groups`:!1,multiple:!0,searchable:!1,panels:[a]})}function Im({configuration:o,idPrefix:t,onChange:e,activeLayerTypes:s,traces:n=[],layer:i,onViewChange:r,onReverseAxisChange:a,onViewLayoutChange:l,moduleInputs:c,onModuleInputsChange:h,onBaselinePositionChange:u,hostConfiguration:d,onHostConfigurationChange:p,data:f,getPalette:_,onPaletteChange:g,analysisSections:m,searchActions:y,appendTreeCardContents:b,createAnalysisStoryPinAction:A,solutionKey:L}){Bn.ensureFallbacks();const T={traces:n,moduleInputs:c,onModuleInputsChange:h,hostConfiguration:d,onHostConfigurationChange:p,appendTreeCardContents:b},E=s instanceof Set?s:new Set((s||[]).filter(I=>yr.has(I))),C=[];(Array.isArray(m)?m:[]).forEach(I=>{const O=I?.scope;if(!br(O))return;const F=typeof A=="function"?A(O,L):null,P=!!I?.panels?.__parameters__?.panels,B=P&&F instanceof Node?F:null,V=!P&&F instanceof Node?F:null,H=Mm({section:I,idPrefix:t,headerActions:V});vn(H);const U=bs({title:I.title||O,icon:Tr(I,{size:18}),anchorId:Ee(t,O),groups:H,headerActions:B});U&&C.push(U)});const w=um(o,t,e,{layer:i,traces:n,onViewChange:r,onReverseAxisChange:a,onViewLayoutChange:l,moduleInputs:c,solutionKey:L,onModuleInputsChange:h,onBaselinePositionChange:u});vn(w);const N=bs({title:"Chart settings",icon:xn("paint-svg","settings-svg",{size:18}),anchorId:Ee(t,ut.CHART),groups:w});N&&C.push(N);const R=j_({getPalette:_,onPaletteChange:g,idPrefix:t,onChange:e});vn(R);const M=bs({title:"Colors",icon:xn("paint-bucket-svg","paint-svg",{size:18}),anchorId:Ee(t,ut.COLORS),groups:R});if(M&&C.push(M),vc(E).forEach(I=>{const O=Rm(o,t,e,I,T);vn(O);const F=bs({title:Sc(I),icon:Lr(I.chartIcon,{size:18}),anchorId:Ee(t,I.type),groups:O});F&&C.push(F)}),o?.table?.enabled){const I=N_({configuration:o,idPrefix:t,onChange:e,data:f}),O=bs({title:"Table settings",icon:xn("table-svg","cogs-svg",{size:18}),anchorId:Ee(t,ut.TABLE),groups:I});O&&C.push(O)}const k=new Oe({id:`${t}-settings-unified`,multiple:!0,searchable:!0,stickySearch:!0,searchPlaceholder:"Search settings...",searchActions:y,sections:C});return Nm(k),typeof R?.refreshPalette=="function"&&(k.refreshPalette=()=>R.refreshPalette()),k}const Om="plotter-shortcuts",Nc="plotter-shortcuts-hover-only",Pm="plotter-shortcuts-content",Dm="plotter-shortcuts-main",Fm="plotter-shortcuts-button-group",Hm="plotter-shortcuts-separator",Bm="plotter-table-view-toggle",zm="plotter-shortcuts-more";class Vm extends ht{#t=null;#e=null;get logger(){try{return this.__parameters__?.parent?.logger}catch{return}}#s(){return[]}#n(t){return t?.length?t.every(e=>e.icon instanceof Node):!1}#r(t){const e=this.__parameters__.parent?.__parameters__?.collectModuleFilterShortcuts?.();Array.isArray(e)&&e.forEach(s=>{s instanceof HTMLElement&&t.push(s)})}#i(t){return t.__parameters__.type==="button-group"?"button":(t.__parameters__.type==="select"||t.__parameters__.type==="select-weighted","select")}syncViewSelection(t){const e=this.__parameters__.parent?.layer,s=t??e?.trace;if(s==null)return;const n=this.#t;if(!n)return;if(n.__parameters__.multiple){e.configuration.layout||(e.configuration.layout=xt()),n.syncSelectionFromBinding(e.configuration.layout.pinnedViews),n.syncCurrentValue(s);return}if(Gn(e?.configuration)&&!e?.configuration?.layout?.pinnedViews?.length){const r=e.trace;e.trace=null,n.syncSelectionFromBinding(),r!=null&&(e.trace=r);return}n.syncSelectionFromBinding(s)}#a(){const t=this.__parameters__.parent?.__parameters__?.id;return t?`${t}-plotter-shortcuts-reverse-axis`:null}#l(){if(this.#e?.__node__ instanceof HTMLButtonElement)return this.#e.__node__;const t=this.#a();if(!t)return null;const e=document.getElementById(t);return e instanceof HTMLButtonElement?e:null}syncReverseAxisSelection(t){const e=t??!!this.__parameters__.parent?.layer?.configuration?.reverse;this.#l()?.classList.toggle("active",e)}toggleReverseAxis(){const t=this.__parameters__.parent?.layer?.configuration;!t||!this.__parameters__.parent?.__instance__?.plot||(t.reverse=!t.reverse,this.__parameters__.parent?.markSettingsPersistDirty?.(),this.applyReverseAxisFromSettings(t.reverse))}applyReverseAxisFromSettings(t){const e=this.__parameters__.parent?.__instance__?.plot;e&&(e.reverseAxis(),e._update(1),this.syncReverseAxisSelection(t))}init(){const t=[...this.#s()];return this.__node__=x.getNode("div",this.__parameters__.id,[Om],this.__parameters__.parent.getChromeRegionNode("shortcut"),{style:`order: ${Xn("shortcut")}`}),this?.__parameters__?.parent?.layer?.configuration?.behaviors?.displayShortcutsOnHover?this.__node__.classList.add(Nc):this.__node__.classList.remove(Nc),new Promise((e,s)=>{Promise.all(t).then(()=>{}).then(()=>{e(this.__node__)}).catch(n=>{s(n)})})}render(){return new Promise((t,e)=>{try{this.__node__.replaceChildren();let s=[];if(s.push(this.#e=new vt({id:this.__parameters__.parent.__parameters__.id+"-plotter-shortcuts-reverse-axis",icon:D.get("reverse-axis-svg",{size:20}),title:"Reverse axis".translate(),classList:["transparent","p-0","mr-1",this?.__parameters__?.parent?.layer?.configuration?.reverse?"active":null],callbacks:{click:()=>this.toggleReverseAxis()}})),Sn(this.__parameters__.parent.layer)){const p=this.__parameters__.parent.layer;p.trace||(p.trace=Object.keys(p.traces)[0]);const f=Cc(p),_=this.#n(f),g=ee(p?.configuration)==="pin",m=_&&g,y=_&&f.some(T=>T.group),b=y&&!g,A=m||b,L=Gn(p?.configuration);_&&(p.configuration.layout||(p.configuration.layout=xt()),A&&!p.configuration.layout.pinnedViews?.length&&p.trace&&!L&&(p.configuration.layout.pinnedViews=[p.trace]),!L&&!g&&!b&&p.trace?ti(p,p.trace):!L&&b&&p.trace&&Jn(p),s.push({divider:!0,id:this.__parameters__.id+"-divider-views-reverse"})),s.push(this.#t=new J({id:"plotter-shortcuts-views-"+this.__parameters__.parent.__parameters__.id,key:A?"pinnedViews":"trace",type:_?"button-group":"select",multiple:A,subgroupSwitch:y,nullable:!0,dropdownLeft:!1,counter:!1,list:A?p.configuration.layout:p,items:_?f.map(T=>({value:T.value,icon:T.icon,title:T.title||T.text,group:T.group||void 0,disabled:T.disabled===!0})):f,callbacks:{input:(T,E)=>{this.__parameters__.parent?.markSettingsPersistDirty?.();const C=this.__parameters__.parent.__instance__.plot;if(A){const S=p.configuration.layout,w=[...S.pinnedViews||[]];S.pinnedViews=et(Array.isArray(T)?T:S.pinnedViews,p);const N=S.pinnedViews.filter(I=>I!==$).length,R=E?.clickedValue!=null?String(E.clickedValue):null,M=E?.mode==="switch"&&R&&R!==$,k=b&&M&&N===1;if(E?.mode==="switch"&&R){if(R!==$){const I=Jt(p,R);if(I){const O=Pu(p,I),F=w.find(P=>O.includes(P)&&P!==R)??(S.pinnedViewColSpans?.[R]==null?O.find(P=>S.pinnedViewColSpans?.[P]!=null):null);F&&ei(S,F,R)}k||(p.trace=R)}}else S.pinnedViews.length&&!S.pinnedViews.includes(p.trace)&&(p.trace=S.pinnedViews.find(I=>I!==$)||S.pinnedViews[0]);if(S.pinnedViews=Nu(S,w,R),b?k||Jn(p):Fu(p),Je(S),this.#t?.syncSelectionFromBinding(S.pinnedViews),k){this.#t?.syncCurrentValue(p.trace);const I=C.changeView(R),O=()=>{Jn(p),Je(S),this.#t?.syncSelectionFromBinding(S.pinnedViews),this.#t?.syncCurrentValue(p.trace)};return I?.then?I.then(()=>O()):(O(),I)}return this.#t?.syncCurrentValue(p.trace),C.updatePinnedViewsLayout()}if(_&&!g){if(T==null)return p.configuration.layout||(p.configuration.layout=xt()),p.configuration.layout.pinnedViews=[],Je(p.configuration.layout),this.#t?.syncSelectionFromBinding(null),C.updatePinnedViewsLayout();const S=String(T);if(S===$)return ti(p,S),Je(p.configuration.layout),this.#t?.syncSelectionFromBinding(p.trace),y&&this.#t?.syncCurrentValue(p.trace),C.updatePinnedViewsLayout();const w=C.changeView(S),N=()=>{Je(p.configuration.layout),this.#t?.syncSelectionFromBinding(p.trace),y&&this.#t?.syncCurrentValue(p.trace)};return w?.then?w.then(()=>N()):(N(),w)}if(T!=null)return C.changeView(String(T))}}}))}const n=new vt({id:this.__parameters__.parent.__parameters__.id+"-shortcut-toggle-inputs",icon:D.get("settings-svg",{size:18}),title:"Settings".translate(),classList:[Bm,"transparent","p-0","ml-1","mr-1",this.__parameters__.parent.__instance__?.panel?.isCollapsed()?null:"active"],callbacks:{click:()=>{this.__parameters__.parent?.__instance__?.panel&&this.__parameters__.parent.__instance__.panel.__toggleCollapse()}}}).render(),i=new vt({id:this.__parameters__.parent.__parameters__.id+"-shortcut-more",icon:D.get("more-vertical-svg",{size:18}),title:"More controls".translate(),classList:[zm,"transparent","p-0","no-text"],callbacks:{click:()=>this.__parameters__.parent.toggleShortcutsExpanded()}}).render(),r=x.getNode("div",this.__parameters__.id+"-content",[Pm],null),a=[],l=[];if((this.__parameters__.parent.layer.shortcuts||[]).forEach((p,f)=>{if(p instanceof HTMLElement)l.push(p);else if(p.divider)a.push(x.divider("span",!0,this.__parameters__.id+"-divider-"+f));else if(ht.isRenderable(p)){if((p.__parameters__.type==="select"||p.__parameters__.type==="select-weighted")&&(p.__parameters__.counter=!1),J.is(p)){const g=p.__parameters__.callbacks?.input;typeof g=="function"&&(p.__parameters__.callbacks.input=(...m)=>{g(...m),this.__parameters__.parent.__instance__.header.init()})}else if(vt.is(p)){let g=p.__parameters__.callbacks.click;p.__parameters__.callbacks.click=(...m)=>{g(...m),this.__parameters__.parent.__instance__.header.init()}}const _=p.render();J.is(p)&&this.#i(p)==="button"?l.push(_):a.push(_)}else l.push(p.render())}),this.#r(a),s.forEach((p,f)=>{if(p.divider){l.push(x.divider("span",!0,p.id||this.__parameters__.id+"-divider-"+f));return}J.is(p)&&(p.__parameters__.type==="select"||p.__parameters__.type==="select-weighted")?(p.__parameters__.counter=!1,a.push(p.render())):(J.is(p)&&p.__parameters__.type,l.push(p.render()))}),this.#t?.__parameters__?.type==="button-group"){const p=this.__parameters__.parent.layer,f=Gn(p?.configuration),_=p?.configuration?.layout?.pinnedViews;if(this.#t.__parameters__.multiple)this.#t.syncSelectionFromBinding(_),this.#t.syncCurrentValue(p.trace);else if(f&&!_?.length){const m=p.trace;p.trace=null,this.#t.syncSelectionFromBinding(),m!=null&&(p.trace=m)}else this.#t.syncSelectionFromBinding(p.trace)}const c=x.getNode("div",this.__parameters__.id+"-button-group",[Fm],null);c.append(...l);const h=x.getNode("div",this.__parameters__.id+"-main",[Dm],null),u=x.divider("span",!0,this.__parameters__.id+"-divider-table");let d=null;a.length>0&&(d=x.getNode("div",this.__parameters__.id+"-separator-selects-buttons",[Hm],null)),d?h.append(...a,d,c):h.append(...a,c),r.append(h,u,i,n),this.__nodes__.content=r,this.__node__.append(r),t(this.__node__)}catch(s){this.logger?.error(s),e(s)}})}}const wr="plotter-nearest-point",Mc="plotter-nearest-point-active",$m=24,Wm=14,Gm=[`.plotter-trace-element-path:not(.${wr})`,".plotter-axis",".plotter-line-end-label",".plotter-bar-label"].join(", ");function jm(o,t,e){const s=o.getScreenCTM();if(!s)return null;const n=({x:l,y:c})=>e?{along:s.b*l+s.d*c+s.f,across:s.a*l+s.c*c+s.e}:{along:s.a*l+s.c*c+s.e,across:s.b*l+s.d*c+s.f};let i=0,r=o.getTotalLength();const a=n(o.getPointAtLength(r)).along>=n(o.getPointAtLength(0)).along;for(let l=0;l<Wm;l+=1){const c=(i+r)/2;n(o.getPointAtLength(c)).along<t===a?i=c:r=c}return n(o.getPointAtLength(i)).across}function Ic(o,t,e){const s=e?t.clientY:t.clientX,n=e?t.clientX:t.clientY,i=c=>{const h=c.getBoundingClientRect();return e?h.top+h.height/2:h.left+h.width/2},r=new Map;o.querySelectorAll(`.${wr}`).forEach(c=>{const h=c.closest(".plotter-trace-group")||c.parentNode;r.set(h,[...r.get(h)||[],c])});let a=null;return r.forEach((c,h)=>{const u=h.querySelector("path.plotter-area-line")||h.querySelector("path.plotter-trace-group-path"),d=u?jm(u,s,e):null;if(d==null)return;const p=Math.abs(d-n);(!a||p<a.distance)&&(a={nodes:c,distance:p})}),a?{node:a.nodes.reduce((c,h)=>Math.abs(i(h)-s)<Math.abs(i(c)-s)?h:c),distance:a.distance}:null}function ce(o,t,e){o.dispatchEvent(new MouseEvent(t,{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY,button:e.button}))}function Um(o,t){if(!o||o.dataset.plotterNearestPointBound==="true")return;o.dataset.plotterNearestPointBound="true";let e=null,s=null,n=null;const i=l=>{if(!e)return;const c=e;e=null,c.classList.remove(Mc),c.isConnected&&ce(c,"mouseout",l)},r=l=>l.isTrusted&&l.target instanceof Element&&!l.target.closest(Gm),a=l=>{const c=r(l)?Ic(o,l,t()):null;c?.node!==e&&i(l),c&&(e=c.node,e.style.setProperty("--plotter-nearest-point-color",e.getAttribute("data-point-color")),e.classList.add(Mc),ce(e,"mousemove",l))};o.addEventListener("mousemove",l=>{l.isTrusted&&(n=l,s??=requestAnimationFrame(()=>{s=null,a(n)}))}),o.addEventListener("mouseleave",l=>{cancelAnimationFrame(s),s=null,i(l)}),o.addEventListener("click",l=>{e&&r(l)&&ce(e,"click",l)}),o.addEventListener("contextmenu",l=>{const c=r(l)?Ic(o,l,t()):null;c&&c.distance<=$m&&(l.preventDefault(),l.stopPropagation(),ce(c.node,"contextmenu",l))},!0)}const Rr="plotter-testing-text",Ym="position:absolute !important;visibility:hidden !important;height:auto;width:auto;white-space:nowrap;z-index:-1;top:0;left:0;";class rt{static computeRenderWidth(t,e){const s=document.getElementById(Rr),n=s||document.createElement("DIV");s==null&&(n.id=Rr,n.className=Rr,document.body.append(n));const i=e?.size,r=e?.family,a=e?.weight;return n.setAttribute("style",Ym+"font-size:"+i+"px !important;font-family: "+r+" !important;font-weight: "+a+" !important;"),n.innerText=t,n.clientWidth}}const Km="plotter-copy-to-clipboard";class Kt{static toCsv(t){if(!Array.isArray(t)||!t.length)return"";const e=Object.keys(t[0]),s=e.map(i=>Kt.#t(i)).join(","),n=t.map(i=>e.map(r=>Kt.#t(i[r])).join(","));return[s,...n].join(`
|
|
716
|
+
`)}static copyToClipboard(t){const e=typeof t=="string"?t:JSON.stringify(t);if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"){navigator.clipboard.writeText(e).catch(()=>{Kt.#e(e)});return}Kt.#e(e)}static#t(t){return typeof t=="number"&&Number.isFinite(t)?String(t):`"${String(t??"").replace(/"/g,'""')}"`}static#e(t){const e=x.getNode("textarea",Km,[],document.body);e.setAttribute("readonly",""),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.border="none",e.style.outline="none",e.style.boxShadow="none",e.style.background="transparent",e.value=t,e.focus(),e.select(),e.setSelectionRange(0,t.length),document.execCommand("copy"),e.remove()}}const Xm="datama-lite";function Oc(o){return!!o?.closest?.(`.${Xm}`)}const Zm=10,Qm="rgba(71, 85, 105, 0.85)",qm=2,Jm=1.5;function Pc(){return{cards:{radius:Zm,connector:{render:"curved",color:!1,neutralStroke:Qm,size:qm,opacity:.33,dasharray:null},border:{width:Jm,color:null,opacity:1,dasharray:null}},layout:{maxScaleUp:3.25,preserveAspectRatio:!1},operators:{prefixField:"prefix",suffixField:"suffix",decorationMode:"auto"}}}class Ot{#t={vertical:[],horizontal:[]};#e=null;#s=1e3;get transition(){return Oc(this.root?.node?.())?this.#s*.5:this.#s}set transition(t){this.#s=t}get logger(){try{return this.plot?.logger}catch{return}}constructor(t,e,s,n,i,r){this.data=t,this.trace=e,this.root=s,this.callbacks=n,this.hooks=i,this.plot=r,this.transition=this.plot.layer.configuration?.behaviors?.transitionDuration??1e3,!this.containers&&(this.containers={}),!this.computed&&(this.computed={}),this._configurationKey=null,this._traceName=null}_deepMergeConfiguration(t,e){if(!e||typeof e!="object"||Array.isArray(e))return t;const n={...t},i=Object.keys(e);for(let r=0;r<i.length;r++){const a=i[r],l=e[a],c=t[a],h=c&&typeof c=="object"&&!Array.isArray(c);l&&typeof l=="object"&&!Array.isArray(l)&&h?n[a]=this._deepMergeConfiguration(c,l):l!==void 0&&(n[a]=l)}return n}_getConfigurationDefaultsResolver(t){const e={bars:Fl,tree:Pc,waterfall:_c},s=t!=null?String(t):"";return e[s]||null}getConfiguration(t=this._configurationKey,e=null,s=null){const n=t!=null?String(t):"";if(!n.length)return{};const i=this._getConfigurationDefaultsResolver(n),r=e??(typeof i=="function"?i():{}),a=r&&typeof r=="object"?r:{},c=(this.plot?.layer?.configuration||{})[n],h=this._traceName!=null?String(this._traceName):n,u=s??(this.trace?.[h]||{}),d=this._deepMergeConfiguration(a,c||{});return this._deepMergeConfiguration(d,u||{})}static roundedRectangleShape(t,e,s,n,i={both:!1,top:!1,bottom:!1,topLeft:!1,topRight:!1,bottomLeft:!1,bottomRight:!1},r={both:!1,top:!1,bottom:!1,topLeft:!1,topRight:!1,bottomLeft:!1,bottomRight:!1}){const a=i?.both??i?.top??i?.topLeft??!1,l=i?.both??i?.top??i?.topRight??!1,c=i?.both??i?.bottom??i?.bottomRight??!1,h=i?.both??i?.bottom??i?.bottomLeft??!1;let u=r?.both??r?.top??r?.topLeft??0,d=r?.both??r?.top??r?.topRight??0,p=r?.both??r?.bottom??r?.bottomRight??0,f=r?.both??r?.bottom??r?.bottomLeft??0;n<0&&(n=Math.abs(n),e=e-n),u=a?Math.min(u,s/2,n/2):0,d=l?Math.min(d,s/2,n/2):0,p=c?Math.min(p,s/2,n/2):0,f=h?Math.min(f,s/2,n/2):0;let g=[];return g.push(`M${t+u},${e}`),g.push(`H${t+s-d}`),d&&g.push(`A${d},${d} 0 0 1 ${t+s},${e+d}`),g.push(`V${e+n-p}`),p&&g.push(`A${p},${p} 0 0 1 ${t+s-p},${e+n}`),g.push(`H${t+f}`),f&&g.push(`A${f},${f} 0 0 1 ${t},${e+n-f}`),g.push(`V${e+u}`),u&&g.push(`A${u},${u} 0 0 1 ${t+u},${e}`),g.push("Z"),g.join(" ")}_getPoints(t){return t||this.computed.data}_layer(){const t=`${this.trace.id}-layer`;if(!this.containers.layerContainer?.node?.()?.isConnected){this.containers.layerContainer=null;const n=this.root?.node?.();n&&typeof n.querySelectorAll=="function"&&n.querySelectorAll(`#${t}`).forEach((a,l)=>{l>0&&a.remove()});const i=this.root.select(`#${t}`);this.containers.layerContainer=i.empty()?this.root.append("g"):i}const s=this.containers.layerContainer.attr("data-trace");return s&&s!==this.trace.type&&this.containers.layerContainer.selectAll(".plotter-layer-decoration").remove(),this.containers.layerContainer.attr("id",t).attr("class","plotter-traces").attr("data-trace",this.trace.type).attr("data-id",this.trace.id),this.containers.layerContainer}_handleClipPathRect(t){let e=this._getHorizontalScale()[0],s=this._getVerticalScale()[0];return t.attr("width",Math.abs(e.baseRange[1]-e.baseRange[0])+(e?._stackElementSize||0)/2).attr("height",s.baseRange[0]-s.baseRange[1]).attr("transform",()=>`translate(${e.baseRange[0]}, ${s.baseRange[1]})`)}_handleClipPath(t){return t.selectAll("path").data(e=>e).join(e=>this._handleClipPathRect(e.append("rect")),e=>this._handleClipPathRect(e),e=>e.remove()),t.attr("id",`${this.trace.id}-frame`)}_clipPath(t=!0){if(!t)return!0;let e=`${this.trace.id}-frame`;return this.containers.clipPath=this.plot.__nodes__.defs.selectAll(`clipPath#${e}`).data([["rect"]]).join(s=>this._handleClipPath(s.append("clipPath")),s=>this._handleClipPath(s),s=>s.remove()),this.containers.layerContainer.attr("clip-path",`url(#${e})`),this.containers.clipPath}_masks(t){return!0}_gradients(t){return!0}_join(t=0){return new Promise(e=>{const s=this._getPoints();this.#i(s),this.containers.layerContainer.selectAll("g.plotter-trace-group").data(s,(n,i)=>n?.key||n?.[0]?.group||n?.[0]?.data?.id||`trace-group-${i}`).join(n=>this._handleTrace(n.append("g").attr("class","plotter-trace-group")),n=>this._handleTrace(n),n=>n.remove()).order(),setTimeout(()=>{e()},this.transition)})}_supportsDimensionBrush(){return!0}_handleBrush(t,e="opacity"){return new Promise(s=>{if(t.selection){const n=this._getDimensionAxis(),i=n.value,[r,a]=[Math.min(t.selection[0],t.selection[1]),Math.max(t.selection[0],t.selection[1])];this._brushElements=[],this.containers.layerContainer.selectAll(`g#${this.trace.id}-layer .plotter-trace-element-path`).attr(e,c=>{const h=this.#r(n,i,c);return h&&h.end>=r&&h.start<=a?(this._brushElements.push(c),.75):.25})}s()})}#n(t,e){if(!e||typeof t.size!="function")return 0;const s=t.size(e,1);return Number.isFinite(s)&&s>0?s/2:0}#r(t,e,s){if(!s)return null;if(typeof s.x=="number"){if(typeof s.width=="number"&&Number.isFinite(s.width)&&s.width!==0){const i=s.x+s.width;return{start:Math.min(s.x,i),end:Math.max(s.x,i)}}const n=this.#n(t,s.data);return{start:s.x-n,end:s.x+n}}if(s.data){const n=t.for(s.data,e),i=this.#n(t,s.data);return{start:n-i,end:n+i}}return null}_handleBrushEnd(){let t=this._brushElements.filter(e=>e).map(({data:e})=>e);return t.length?(this.computed.zoomData=t,this.logger?.info("Plotter - Brush : applying new data to scales"),Object.values(this.trace.scales).forEach(e=>{e.brushData=t;let s=e.getScale();s.init(),this.plot.__axis__[s.name]&&(this.plot.__axis__[s.name].setScale(s),this.plot.__axis__[s.name].update())}),this.logger?.info("Plotter - Brush : updating traces"),this.plot.instances?.differences?.hide(),this.update(1).then(()=>{this.plot.instances?.differences?.update()})):(this.logger?.info("Plotter - Brush : ignored because selection has no data points"),this.update(1))}update(t=0){return new Promise((e,s)=>{try{return this.#h(this.computed),this._computeTracesProperties(),this._join(t).finally(()=>e())}catch(n){this.logger?.error(n),s(n)}})}from(t){return new Promise((e,s)=>{try{let n;this.containers=t.containers,this.computed=t.computed;const i=this.plot.__parameters__.parent.getLAYERS(),r=t instanceof i.BARS,a=t instanceof i.LINES,l=t instanceof i.AREAS,c=t instanceof i.SCATTER,h=t instanceof i.MEKKO,u=t instanceof i.EVENTS,d=t instanceof i.WATERFALL,p=i.TREE?t instanceof i.TREE:!1,f=t instanceof i.ABSTRACT;if(r)this.trace.id=this.trace.id.replace("bars",this.trace.type),n=this._fromBars();else if(a)this.trace.id=this.trace.id.replace("lines",this.trace.type),n=this._fromLines();else if(l)this.trace.id=this.trace.id.replace("areas",this.trace.type),n=this._fromAreas();else if(c)this.trace.id=this.trace.id.replace("scatter",this.trace.type),n=this._fromScatter();else if(h)this.trace.id=this.trace.id.replace("mekko",this.trace.type),n=this._fromMekko();else if(u)this.trace.id=this.trace.id.replace("events",this.trace.type),n=this._fromEvents();else if(d)this.trace.id=this.trace.id.replace("waterfall",this.trace.type),n=this._fromWaterfall();else if(p)this.trace.id=this.trace.id.replace("tree",this.trace.type),n=this._fromTree();else if(f)n=new Promise(_=>_());else{s(new Error("Cannot migrate something else PlotterLayerAbstract instance"));return}return n.then(()=>e()).catch(_=>{this.logger?.error(_)})}catch(n){this.logger?.error(n),s(n)}})}unmount(){Object.keys(this.containers).forEach(e=>{try{this.containers[e]?.remove?this.containers[e].remove():Object.keys(this.containers[e]||{}).forEach(n=>{(this.containers[e]||{})[n]?.remove&&this.containers[e][n].remove()})}catch(s){this.logger?.info(s)}})}_computeTracesProperties(){const t=this._getDimensionAxis();this.computed.data.forEach((e,s)=>{e.forEach((n,i)=>{if(!n)return;const{data:r}=n;let a=e,l,c;if(this.trace.stacked&&(a=this.computed.data.map(d=>d[i]).filter(d=>d),l=a[s-1],c=a[s+1]),this.trace.type!=="events"){const d=this.computed.data.map(g=>g.filter(m=>m?.data[t.value]===r[t.value])).flat(),p=d.filter(g=>g).map(g=>g?.data?.id).indexOf(r.id),f=this.computed.data.map(g=>g.filter(m=>m?.data[t.value]===r[t.value])).flat(),_=this.computed.data.map(g=>g.filter(m=>m?.data[t.stack]===r[t.stack])).flat();r.plotter={groups:this.computed.data,group:a,neighbors:d,neighborsIndex:p,groupIndex:s,rowIndex:i,sharingSameValue:f,sharingSameStack:_,prev:l,next:c}}})})}_opacity(t,e=1){if(this.trace._opacity!=null)return this.trace._opacity;let n;const i=typeof this.trace.opacity=="function",r=typeof this.trace.opacity=="number",a=this.trace.opacity===!1;if(i){if(!t)return;n=this.trace.opacity(t)}else r?n=this.trace.opacity:a?n=0:n=1;if(e===0)return n*.75;if(e===1)return n;if(e===2)return n*.25}_getScalePosition(){return this.#t.horizontal=[],this.#t.vertical=[],Object.values(this.trace.scales).forEach(t=>{const e=t.getScale();["left","right"].includes(e.position)?this.#t.vertical.push(e):this.#t.horizontal.push(e)}),this.#t}_getHorizontalScale(){return this._getScalePosition().horizontal}_getVerticalScale(){return this._getScalePosition().vertical}_getDimensionAxis(){return this.trace.scales.x.getScale()}_getMetricAxis(){return this.trace.scales.y.getScale()}_getSecondMetricAxis(){return this.trace.scales.y2.getScale()}_getMetaOfTrace(t){return{x:t.attributes["data-x"]?.value,xStack:t.attributes["data-x-stack"]?.value,y:t.attributes["data-y"]?.value,yStack:t.attributes["data-y-stack"]?.value,color:t.attributes["data-color"]?.value,stroke:t.attributes["data-stroke"]?.value}}_mouseMoveHighlight(t,e){if(this instanceof window.layers.HIERARCHY)return;const{x:s,xStack:n,y:i,yStack:r,stroke:a}=this._getMetaOfTrace(t.target);let l,c;const h=this._getDimensionAxis(),u=this._getMetricAxis();if(h._valueType!=="continuous"||h._isDate)if(this.plot.layer.configuration.behaviors.highlightElementByPrimaryDimension&&this.plot.layer.configuration.behaviors.highlightElementBySecondaryDimension)n&&n!=="undefined"?(l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-x="'+s+'"][data-x-stack="'+n+'"], g .lock',c='g .plotter-trace-element-path:not([data-x="'+s+'"]):not([data-x-stack="'+n+'"]):not(.lock)'):(l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-x="'+s+'"], g .lock',c='g .plotter-trace-element-path:not([data-x="'+s+'"]):not(.lock)');else if(this.plot.layer.configuration.behaviors.highlightElementByPrimaryDimension)l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-x="'+s+'"], g .lock',c='g .plotter-trace-element-path:not([data-x="'+s+'"]):not(.lock)';else if(this.plot.layer.configuration.behaviors.highlightElementBySecondaryDimension)l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-x-stack="'+n+'"], g .lock',c='g .plotter-trace-element-path:not([data-x-stack="'+n+'"]):not(.lock)';else return;else if(u._valueType!=="continuous"||u._isDate)this.plot.layer.configuration.behaviors.highlightElementByPrimaryDimension&&this.plot.layer.configuration.behaviors.highlightElementBySecondaryDimension&&(r&&r!=="undefined"?(l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-y="'+i+'"][data-y-stack="'+r+'"], g .lock',c='g .plotter-trace-element-path:not([data-y="'+i+'"]):not([data-y-stack="'+r+'"]):not(.lock)'):(l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-y="'+i+'"], g .lock',c='g .plotter-trace-element-path:not([data-y="'+i+'"]):not(.lock)'));else if(this.plot.layer.configuration.behaviors.highlightElementByPrimaryDimension)l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-x="'+s+'"], g .lock',c='g .plotter-trace-element-path:not([data-x="'+s+'"]):not(.lock)';else if(this.plot.layer.configuration.behaviors.highlightElementBySecondaryDimension)if(n&&n!=="undefined")l='g[data-id="'+this.trace.id+'"] .plotter-trace-element-path[data-x-stack="'+n+'"], g .lock',c='g .plotter-trace-element-path:not([data-x-stack="'+n+'"]):not(.lock)';else return;if(!l||!c)return;const d=`${this.trace.id}|${s??""}|${n??""}|${i??""}|${r??""}|${l}|${c}`;if(d===this.#e)return;this.#e=d;const p=this.root.selectAll(l),f=y=>y?.parentNode?.classList?.contains("plotter-trace-element")?y.parentNode:y,_=new Set(p.nodes().map(f)),g=this.root.selectAll(c).nodes().map(f).filter(y=>!_.has(y));g.length&&window.d3.selectAll(g).attr("data-hover","out"),(this.plot.layer.configuration.behaviors.highlightElementByPrimaryDimension||this.plot.layer.configuration.behaviors.highlightElementBySecondaryDimension)&&p?._groups[0]?.length&&(p.attr("data-stroke",p.attr("stroke")),p.attr("data-hover","in").attr("stroke",a))}_mouseMoveSummary(t,e,s){this.plot.instances?.hover?.show(t,e,s)}_mouseOutSummary(t,e){this.plot.instances?.hover?.hide(t,e)}_mouseOutHighlight(t,e){this.#e=null;const s=this.root.selectAll('*[data-hover="out"]'),n=this.root.selectAll('*[data-hover="in"]');s.nodes().length&&s.attr("data-hover",null),n.nodes().length&&n.attr("data-hover",null).attr("stroke",n.attr("data-stroke"))}_mouseMove(t,e){const s=this.plot.instances?.differences;!!s?.isPicking?.()?s.preview(t,e,this):typeof this.callbacks?.onMouseMove=="function"&&setTimeout(()=>{try{this.callbacks.onMouseMove(t,e)}catch(i){this.logger?.error(i)}}),this.trace.dots?.nearest||this._mouseMoveHighlight(t,e),this._mouseMoveSummary(t,e,this)}_mouseOut(t,e){typeof this.callbacks?.onMouseOut=="function"&&setTimeout(()=>{try{this.callbacks.onMouseOut(t,e)}catch(s){this.logger?.error(s)}}),this._mouseOutSummary(t,e),this.trace.dots?.nearest||this._mouseOutHighlight(t,e)}_handleClick(t,e){const s=this.plot.instances?.differences;if(!!s?.isPicking?.())return s.pick(t,e,this);if(typeof this.callbacks?.onClick=="function"&&setTimeout(()=>{try{this.callbacks.onClick(t,e)}catch(i){this.logger?.error(i)}}),this.trace.click)return this.trace.click(t,e);t.target.classList.toggle("plotter-lock"),this.plot.instances?.hover?.lock(t,e),this._mouseMoveSummary(t,e,this)}_handleContextMenu(t,e){return typeof this.callbacks?.onContextMenu=="function"&&setTimeout(()=>{try{this.callbacks.onContextMenu(t,e)}catch(s){this.logger?.error(s)}}),this.plot.__parameters__.parent.__instance__.contextMenu.render(t,e?.data||e,this)}_computeTextRenderingWidth(t,e){return rt.computeRenderWidth(t||"",e)}_handleTrace(t){return t.each((e,s,n)=>{const i=window.d3.select(n[s]),r=e.filter(a=>a);i.selectAll("g.plotter-trace-element").data(r,a=>a?.id||a?.data?.id||a?.groupId||`${a?.x}-${a?.y}`).join(a=>this._handlePaths(a.append("g").attr("class","plotter-trace-element")),a=>this._handlePaths(a),a=>a.remove())}),t}_handlePaths(t){return t.selectAll("path.plotter-trace-element-path").data(e=>[e]).join(e=>this._handlePath(e.append("path").attr("class","plotter-trace-element-path")),e=>this._handlePath(e),e=>e.remove()),t}_handlePath(){throw new Error("_handlePath method not implemented")}_fromScatter(){return this.update()}_fromBars(){return this.update()}_fromLines(){return this.update()}_fromAreas(){return this.update()}_fromMekko(){return this.update()}_fromEvents(){return this.update()}_fromWaterfall(){return this.update()}_fromTree(){return this.update()}_elementCenter(t,e){return t.size(e,this.plot.layer?.configuration?.axis?.ratioOfElementSize??.9)/2}_getTraceColors(){const t=this._getDimensionAxis();let e=t._uniqueStack||t._uniqueValue,s=!1,n;return this.trace.colors?n=this.trace.colors:n=Q.generateGoldenRatioColors(e,!0,!0),typeof this.trace.color=="function"&&(this.trace.type==="events"?e=this.computed.data.map(l=>{const c=l.filter(h=>h)[0]?.data;return this.trace.color(c,0,l,this.trace)}).unique():e=this.plot.__parameters__.parent.__parameters__.data.map((l,c,h)=>this.trace.color(l,c,h,this.trace)).unique(),n=this.trace?.colors||Q.generateGoldenRatioColors(e,!0,!0),s=e.some(l=>String(l).indexOf("#")===0)),{colors:n,colorsIsAlreadyMapped:s}}_getTraceColor(t,e,s,n){if(!t)return;let i,r=t?.data||t;const a=this._getDimensionAxis();Array.isArray(r)&&(r=r.filter(g=>g)[0]?.data||r[0]);const c=this.trace.opacity===0,h=typeof this.trace.color=="function",u=typeof this.trace.color=="object"&&this.trace.color,d=Array.isArray(this.trace.color),p=typeof this.trace.color=="string",f=Array.isArray(t);return c?i="transparent":h?s?i=n||this.trace.color(r,r?.plotter?.rowIndex??0,r?.plotter?.group,this.trace):i=n||e[this.trace.color(r,r?.plotter?.rowIndex??0,r?.plotter?.group,this.trace)]:u?i=n||this.trace.color[a.stack||a.value]:d?i=n||this.trace.color[0]:p?i=n||this.trace.color:f?i=n||e[t[0].group]:i=n||e[r[a.stack||a.value]],i==null&&this.trace.legend===!1&&(i=n||"grey"),i}_setTraceColor(t,e="fill",s=!1,n=!1){const{colors:i,colorsIsAlreadyMapped:r}=this._getTraceColors();return t.attr(e,a=>this._getTraceColor(n||a,i,r,s)).attr("data-"+e,a=>this._getTraceColor(n||a,i,r,s))}_markNearestPoints(t,e=()=>!0){if(!this.trace.dots?.nearest)return;const{colors:s,colorsIsAlreadyMapped:n}=this._getTraceColors();t.filter(e).classed(wr,!0).attr("data-point-color",i=>this._getTraceColor(i,s,n))}_axisMeta(t){Object.values(this.trace.scales).forEach(e=>{const s=e.getScale(),n=typeof s.texts=="string";t.attr(`data-${s.key}-axis`,s.name).attr(`data-${s.key}-axis-value`,s.value).attr(`data-${s.key}-axis-texts`,n?s.texts:null).attr(`data-${s.key}`,r=>{if(r!=null)return String(r.data[s.value])}).attr(`data-${s.key}-text`,r=>{if(r!=null&&n)return String(r.data[s.texts])}),s.stack&&t.attr(`data-${s.key}-axis-stack`,s.stack).attr(`data-${s.key}-stack`,r=>{if(r!=null)return String(r.data[s.stack])})})}_transition(t,{transition:e=this.transition,fn:s=window.d3.easeExp,sceneDurationRatio:n=1,elementDelayDurationRatio:i=.25}={}){return t.transition().delay(r=>{if(!r||Array.isArray(r)&&!r.length)return;let l=0;const{data:c}=Array.isArray(r)?r.filter(h=>h)[0]:r;if(c){const{plotter:h}=c,u=this.trace.transition?.by==="row",d=this.trace.transition?.by==="group";return u?l=i/h?.group?.length*h?.rowIndex:d&&(l=i/h?.group?.length*h?.groupIndex),l}return 0}).duration(e/n).ease(s)}_events(t){const e=t.on("mousemove",(...n)=>this._mouseMove(...n)).on("mouseout",(...n)=>this._mouseOut(...n)).on("click",(...n)=>this._handleClick(...n)).on("contextmenu",(...n)=>this._handleContextMenu(...n));return Oc(this.root?.node?.())||Ig(this.plot?.layer?.configuration)?e.on(".zoom",null):e.call(this.plot.zoom)}_getAnnotationBaseClass(){let{annotations:t}=this.plot.layer.configuration;this.trace.annotations&&(t={...t,...this.trace.annotations});const{position:e}=t,s=[];switch(e){case"top-trace":s.push("plotter-annotation-top-trace");break;case"bottom-trace":s.push("plotter-annotation-bottom-trace");break;case"top":s.push("plotter-annotation-top");break;case"bottom":s.push("plotter-annotation-bottom");break;case"value":s.push("plotter-annotation-value");break;default:s.push("plotter-annotation-center");break}return s}#i(t){this._layer(),this._clipPath(),this._gradients(t),this._masks(t)}#a(t){if(!Array.isArray(t)||t.length===0)return[];const e=Math.max(...t.flat().filter(s=>s!=null));return t.map(s=>{if(!Array.isArray(s)||s.length===0)return Array(e+1).fill(null);const n=Array(e+1).fill(null),i={};return s.forEach(r=>{if(r==null)return;const a=String(r);i[a]||(i[a]=[]),i[a].push(r)}),Object.keys(i).forEach(r=>{const a=parseInt(r,10),l=i[r];isNaN(a)||a<0||a>=n.length||(l.length===1?n[a]=l[0]:n[a]=[...l])}),n.flat()})}#l(t,e){const s=["left","right"].includes(e.position),n=this.trace.curve||this.plot.layer.configuration.lines.curve;let i;switch(n){case"cardinal":i=window.d3.curveCardinal.tension(this.trace.tension||1);break;case"linear":i=window.d3.curveLinear;break;case"linear-closed":i=window.d3.curveLinearClosed;break;case"step":i=window.d3.curveStep;break;case"step-before":i=s?window.d3.curveStepAfter:window.d3.curveStepBefore;break;case"step-after":i=s?window.d3.curveStepBefore:window.d3.curveStepAfter;break;case"natural":i=window.d3.curveNatural;break;default:i=s?window.d3.curveMonotoneY:window.d3.curveMonotoneX;break}t.fLine=window.d3.line().defined(a=>a&&Number.isFinite(a.x)&&Number.isFinite(a.y)).x(a=>a.x).y(a=>a.y).curve(i);const r=this.trace.line?i:window.d3.curveCatmullRom.alpha(.5);s?t.fArea=window.d3.area().defined(a=>a).x0(a=>a.x0).x1(a=>a.x1).y(a=>a.y).curve(r):t.fArea=window.d3.area().defined(a=>a).x(a=>a.x).y0(a=>a.y0).y1(a=>a.y1).curve(r)}#h(t){const e=this._getDimensionAxis();this.#l(t,e);const s=this._getDimensionAxis(),n=this.trace.type==="events";if(n){const a=!!this.computed.zoomData;let l=[];a&&(l=this.computed.zoomData.map(_=>_[this.trace.calendar.on]).unique());const h=this.trace.calendar.events.filter((_,g,m)=>(this.trace?.if||(()=>!0))(_,g,m)&&(this.trace._if||(()=>!0))(_,g,m)&&(!a||l.includes(_[this.trace.calendar.on]))).map((_,g)=>{const m=this.plot.__parameters__.parent.__parameters__.data.find(y=>{const b=y[e.value]===_[e.value];let A=!0;return _[e.stack]!=null&&(A=y[e.stack]===_[e.stack]),b&&A});return{..._,refer:m,id:_.id||`plotter-element-${g}`,__plotter_default_group:"default"}});t.data=h.filter(_=>_.refer);const u=s.stack||"__plotter_default_group";t.base=t.data;const d=t.data.map(_=>_[u]).unique(),f=e?._stackType==="discrete"&&Array.isArray(e?.stackDomain)?e.stackDomain.filter(_=>d.includes(_)):d;t.groups=[...f].reverse(),t.data=d3.stack().keys(t.groups)(t.data).map(_=>_.filter(g=>g.data[u]===_.key).map(g=>({...g,group:_.key})))}else{let a=this.plot.__parameters__.parent.__parameters__.data;this.computed.zoomData&&(a=this.computed.zoomData),t.data=a.filter((d,p,f)=>(this.trace?.if||(()=>!0))(d,p,f)&&(this.trace._if||(()=>!0))(d,p,f)).map(d=>({...d,id:d.id||`plotter-element-${String(d[s.value]).hash()}${s.stack?`-${String(d[s.stack]).hash()}`:""}`,__plotter_default_group:"default"}));const c=t.data.map(d=>d[e.stack||"__plotter_default_group"]).unique(),u=e?._stackType==="discrete"&&Array.isArray(e?.stackDomain)?e.stackDomain.filter(d=>c.includes(d)):c;t.groups=[...u].reverse(),t.data=d3.stack().keys(t.groups)(t.data).map(d=>d.filter(p=>p.data[e.stack||"__plotter_default_group"]===d.key).map(p=>({...p,group:d.key})))}const i=t.data.map(a=>a.map(l=>(e._isDate||e._valueType==="continuous"?e._uniqueValue:e.domain).indexOf(l.data[e.value]))),r=this.#a(i);n?t.data=r.map((a,l)=>{let c=0;const h=a.map(u=>{if(typeof u=="number"){const d=t.data[l][c];return c++,d}});return e._uniqueValue.map(u=>{const d=h.filter(f=>f?.data[e.value]===u);return d.length>0?d:u})}):t.data=r.map((a,l)=>a.map(c=>typeof c=="number"?t.data[l][a.filter(u=>typeof u=="number").indexOf(c)]:c))}}const t1=2e3,As=12,e1=12,Dc=31,s1=0,n1=11,kr=1;class W{static handledFormat(){return[{regex:/^(\d{4})-(\d{2})-(\d{2})$/,format:"YYYY-MM-DD",year:1,month:2,day:3},{regex:/^(\d{2})-(\d{2})-(\d{4})$/,format:"DD-MM-YYYY",year:3,month:2,day:1},{regex:/^(\d{2})-(\d{2})-(\d{4})$/,format:"MM-DD-YYYY",year:3,month:1,day:2},{regex:/^(\d{2})-(\d{2})-(\d{2})$/,format:"DD-MM-YY",year:3,month:2,day:1},{regex:/^(\d{1,2})-(\d{1,2})-(\d{4})$/,format:"M-D-YYYY",year:3,month:1,day:2},{regex:/^(\d{4})-(\d{2})-(\d{2})\s(\d{1,2}):(\d{1,2})$/,format:"YYYY-MM-DD HH:mm",year:1,month:2,day:3,hours:4,minutes:5},{regex:/^(\d{4})-(\d{2})-(\d{2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"YYYY-MM-DD HH:mm:ss",year:1,month:2,day:3,hours:4,minutes:5,seconds:6},{regex:/^(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{1,2})$/,format:"YYYY-MM-DDTHH:mm",year:1,month:2,day:3,hours:4,minutes:5},{regex:/^(\d{4})-(\d{2})-(\d{2})T(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"YYYY-MM-DDTHH:mm:ss",year:1,month:2,day:3,hours:4,minutes:5,seconds:6},{regex:/^(\d{2})-(\d{2})-(\d{4})\s(\d{1,2}):(\d{1,2})$/,format:"DD-MM-YYYY HH:mm",year:3,month:2,day:1,hours:4,minutes:5},{regex:/^(\d{2})-(\d{2})-(\d{4})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"DD-MM-YYYY HH:mm:ss",year:3,month:2,day:1,hours:4,minutes:5,seconds:6},{regex:/^(\d{2})-(\d{2})-(\d{4})\s(\d{1,2}):(\d{1,2})$/,format:"MM-DD-YYYY HH:mm",year:3,month:1,day:2,hours:4,minutes:5},{regex:/^(\d{2})-(\d{2})-(\d{4})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"MM-DD-YYYY HH:mm:ss",year:3,month:1,day:2,hours:4,minutes:5,seconds:6},{regex:/^(\d{2})-(\d{2})-(\d{2})\s(\d{1,2}):(\d{1,2})$/,format:"DD-MM-YY HH:mm",year:3,month:2,day:1,hours:4,minutes:5},{regex:/^(\d{2})-(\d{2})-(\d{2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"DD-MM-YY HH:mm:ss",year:3,month:2,day:1,hours:4,minutes:5,seconds:6},{regex:/^(\d{1,2})-(\d{1,2})-(\d{2})\s(\d{1,2}):(\d{1,2})$/,format:"M-D-YY HH:mm",year:3,month:1,day:2,hours:4,minutes:5},{regex:/^(\d{1,2})-(\d{1,2})-(\d{2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"M-D-YY HH:mm:ss",year:3,month:1,day:2,hours:4,minutes:5,seconds:6},{regex:/^(\d{4})\/(\d{2})\/(\d{2})$/,format:"YYYY/MM/DD",year:1,month:2,day:3},{regex:/^(\d{2})\/(\d{2})\/(\d{4})$/,format:"DD/MM/YYYY",year:3,month:2,day:1},{regex:/^(\d{2})\/(\d{2})\/(\d{4})$/,format:"MM/DD/YYYY",year:3,month:1,day:2},{regex:/^(\d{2})\/(\d{2})\/(\d{2})$/,format:"DD/MM/YY",year:3,month:2,day:1},{regex:/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/,format:"M/D/YYYY",year:3,month:1,day:2},{regex:/^(\d{4})\/(\d{2})\/(\d{2})\s(\d{1,2}):(\d{1,2})$/,format:"YYYY/MM/DD HH:mm",year:1,month:2,day:3,hours:4,minutes:5},{regex:/^(\d{4})\/(\d{2})\/(\d{2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"YYYY/MM/DD HH:mm:ss",year:1,month:2,day:3,hours:4,minutes:5,seconds:6},{regex:/^(\d{2})\/(\d{2})\/(\d{4})\s(\d{1,2}):(\d{1,2})$/,format:"DD/MM/YYYY HH:mm",year:3,month:2,day:1,hours:4,minutes:5},{regex:/^(\d{2})\/(\d{2})\/(\d{4})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"DD/MM/YYYY HH:mm:ss",year:3,month:2,day:1,hours:4,minutes:5,seconds:6},{regex:/^(\d{2})\/(\d{2})\/(\d{4})\s(\d{1,2}):(\d{1,2})$/,format:"MM/DD/YYYY HH:mm",year:3,month:1,day:2,hours:4,minutes:5},{regex:/^(\d{2})\/(\d{2})\/(\d{4})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"MM/DD/YYYY HH:mm:ss",year:3,month:1,day:2,hours:4,minutes:5,seconds:6},{regex:/^(\d{2})\/(\d{2})\/(\d{2})\s(\d{1,2}):(\d{1,2})$/,format:"DD/MM/YY HH:mm",year:3,month:2,day:1,hours:4,minutes:5},{regex:/^(\d{2})\/(\d{2})\/(\d{2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"DD/MM/YY HH:mm:ss",year:3,month:2,day:1,hours:4,minutes:5,seconds:6},{regex:/^(\d{1,2})\/(\d{1,2})\/(\d{2})\s(\d{1,2}):(\d{1,2})$/,format:"M/D/YY HH:mm",year:3,month:1,day:2,hours:4,minutes:5},{regex:/^(\d{1,2})\/(\d{1,2})\/(\d{2})\s(\d{1,2}):(\d{1,2}):(\d{1,2})$/,format:"M/D/YY HH:mm:ss",year:3,month:1,day:2,hours:4,minutes:5,seconds:6}]}static selectDateFormat(t){const e=W.handledFormat().reverse();for(const s of e)if(t.includes(s.format))return s.format}static detectDateFormat(t){const e=W.handledFormat();for(const s of e){const n=String(t).match(s.regex);if(n){parseInt(n[s.year],10);const i=parseInt(n[s.month],10),r=parseInt(n[s.day],10),a=i>=kr&&i<=e1,l=r>=kr&&r<=Dc;if(a&&l)return s.format}}return!1}static toFormat(t,e){const s=t.getFullYear(),i=t.getMonth()+1,r=String(i).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),l=String(t.getHours()).padStart(2,"0"),c=String(t.getMinutes()).padStart(2,"0"),h=String(t.getSeconds()).padStart(2,"0"),u=String(t.getMilliseconds()).padStart(3,"0");return e.replace("YYYY",s).replace("MM",r).replace("M",String(parseInt(r,10))).replace("DD",a).replace("D",String(parseInt(a,10))).replace("HH",l).replace("mm",c).replace("ss",h).replace("SSS",u)}static fromFormat(t,e){if(typeof t=="number")return new W(t);const n=e||W.detectDateFormat(t);let i=" ";typeof n=="string"&&n.includes("T")&&(i="T");const[r,a]=t.split(i),[l,c]=n.split(i);let h,u,d,p=0,f=0,_=0;if(l!=null){const E=r.split(/[-/.\s]/),C=l.split(/[-/.\s]/);let S=0;C.forEach(w=>{const N=parseInt(E[S],10);switch(w){case"yyyy":case"YYYY":h=N,S++;break;case"yy":h=t1+N,S++;break;case"MM":case"M":u=N-1,S++;break;case"DD":case"D":d=N,S++;break}})}if(c!=null&&a!=null){const E=a.split(/[:\s]/),C=c.split(/[:\s]/);let S=!1;C.forEach((M,k)=>{const I=parseInt(E[k],10);switch(M){case"HH":p=I;break;case"hh":p=I;break;case"mm":f=I;break;case"ss":_=I;break;case"a":S=E[k].toLowerCase()==="pm";break}});const w=c.includes("hh"),N=S&&p<As,R=!S&&p===As;w&&N&&(p+=As),w&&R&&(p=0)}const y=typeof h=="number"&&!isNaN(h),b=typeof u=="number"&&!isNaN(u)&&u>=s1&&u<=n1,A=typeof d=="number"&&!isNaN(d)&&d>=kr&&d<=Dc;if(!y||!b||!A)throw new Error("Invalid date format");const L=new W;if(L.__date__=new Date(h,u,d,p,f,_),!!isNaN(L.__date__.getTime()))throw new Error("Invalid date format");return L}__date__;constructor(t){typeof t=="string"?this.__date__=new Date(t):typeof t=="number"?(this.__date__=new Date,this.__date__.setTime(t)):t instanceof Date?this.__date__=t:typeof t=="object"&&t!==null?this.__date__=t:this.__date__=new Date(NaN)}getTimestamp(){return this.__date__.getTime()}to(t){return W.toFormat(this.__date__,t)}static resolveAxisTimestamp(t,e){if(typeof t=="number"&&Number.isFinite(t))return t<1e12?t*1e3:t;if(typeof t=="string"){const s=t.trim();if(/^\d{10,13}$/.test(s)){const n=Number(s);if(Number.isFinite(n))return n<1e12?n*1e3:n}}return W.fromFormat(t,e).getTimestamp()}static#t="yyyy-MM-dd";static#e="iso";static setUserDisplayPattern(t,e){typeof t=="string"&&t.length&&(W.#t=t),typeof e=="string"&&e.length&&(W.#e=e)}static#s(t){const e=W.#t;if(W.#e==="custom")return e;const s=e.replace(/'[^']*'/g,"");if(/[HhmsS]/.test(s)||typeof t!="string"||!/[Hh]/.test(t))return e;const n=t.includes("ss")?" HH:mm:ss":" HH:mm";return e+n}static#n=new Map;static setUserDisplayPattern(t){typeof t=="string"&&t.length&&(W.#t=t)}static toCldr(t){return!(t instanceof Date)||Number.isNaN(t.getTime())?"":W.#r(t,W.#t)}static formatAxisTickLabel(t,e){const s=typeof e=="string"&&e.length?e:"YYYY-MM-DD",n=W.resolveAxisTimestamp(t,s);return Number.isFinite(n)?W.#r(new Date(n),W.#s(s)):String(t??"")}static#r(t,e){let s=W.#n.get(e);return s||(s=W.#i(e),W.#n.set(e,s)),s(t)}static#i(t){const e=W.#a(t);return s=>{let n="";for(const i of e){if(i.type==="literal"){n+=i.value;continue}const r=i.repeat??1;switch(i.symbol){case"y":n+=W.#l(s,r);break;case"M":n+=W.#h(s,r);break;case"d":n+=W.#p(s,r);break;case"H":n+=W.#y(s,r);break;case"h":n+=W.#L(s,r);break;case"m":n+=W.#T(s,r);break;case"s":n+=W.#u(s,r);break;case"S":n+=W.#c(s,r);break;default:n+=i.value}}return n}}static#a(t){const e=[];let s=0;for(;s<t.length;){const n=t[s];if(n==="'"){let r="";for(s+=1;s<t.length;){if(t[s]==="'"&&t[s+1]==="'"){r+="'",s+=2;continue}if(t[s]==="'"){s+=1;break}r+=t[s],s+=1}e.push({type:"literal",value:r});continue}if("yMdHhmsS".includes(n)){let r=1;for(;s+r<t.length&&t[s+r]===n;)r+=1;e.push({type:"field",value:n.repeat(r),symbol:n,repeat:r}),s+=r;continue}let i=n;for(s+=1;s<t.length;){const r=t[s];if(r==="'"||"yMdHhmsS".includes(r))break;i+=r,s+=1}e.push({type:"literal",value:i})}return e}static#l(t,e){const s=t.getFullYear();if(e<=2){const n=s%100,i=String(n).padStart(2,"0");return e===1?String(n):i}return String(s).padStart(e,"0")}static#h(t,e){const s=t.getMonth()+1;return e===1?String(s):String(s).padStart(e,"0")}static#p(t,e){const s=t.getDate();return e===1?String(s):String(s).padStart(e,"0")}static#y(t,e){const s=t.getHours();return e===1?String(s):String(s).padStart(e,"0")}static#L(t,e){let s=t.getHours()%As;return s===0&&(s=As),e===1?String(s):String(s).padStart(e,"0")}static#T(t,e){const s=t.getMinutes();return e===1?String(s):String(s).padStart(e,"0")}static#u(t,e){const s=t.getSeconds();return e===1?String(s):String(s).padStart(e,"0")}static#c(t,e){const s=t.getMilliseconds(),n=10**e,i=Math.floor(s*n/1e3);return String(i).padStart(e,"0")}}class ct extends Ot{#t(){const t=this._getDimensionAxis(),e=t?._uniqueValue;if(!t?._isDate||!Array.isArray(e)||e.length<2)return null;const s=e.map(n=>typeof n=="number"?n:W.fromFormat(n,t.format).getTimestamp());return s.some(n=>!Number.isFinite(n))?null:e.map((n,i)=>i).sort((n,i)=>s[n]-s[i])}#e(t,e){const s=t.filter(r=>r);if(this.trace.arrows)return s;s.sort((r,a)=>{if(e){const l=r.y,c=a.y;return Number(l)-Number(c)}else{const l=r.x,c=a.x;return Number(l)-Number(c)}});const n=[];let i=0;return t.forEach(r=>{if(!r){n.push(r);return}n.push(s[i]),i++}),n}_computeTracesProperties(){const{dimensionAxis:t}=this.#A();this.computed.data.forEach((e,s)=>{e.forEach((n,i)=>{if(!n)return;const{data:r}=n,a=e,l=a[i-1],c=a[i+1],h=this.trace.scales.y2;let u=this.computed.data.map(_=>_.filter(g=>g?.data[t.value]===r[t.value])).flat();h&&(u=a);const f=u.filter(_=>_).map(_=>_?.data?.id).indexOf(r.id);r.plotter={groups:this.computed.data,group:a,neighbors:u,neighborsIndex:f,groupIndex:s,rowIndex:i,prev:l,next:c}})})}_getPoints(t=null){const e=[],{metricAxis:s}=this.#A(),n=["top","bottom"].includes(s.position),i=this.#t();return this.computed.data.forEach(r=>{const a=[];(i?.length===r.length?i.map(c=>r[c]):r).forEach((c,h)=>{if(!c){a.push(c);return}let u=this.trace.id+"-"+String(c.group).hash(),d=this.#d(c?.data),p=this.#_(c?.data);if(!this.trace.overlay&&this.trace.stacked){let _=c?.data.plotter?.neighborsIndex-1;if(c?.data.plotter?.neighbors[_]){let m=0;for(;c?.data.plotter?.neighbors[_];){const y=c?.data.plotter?.neighbors[_]?.data;n?m+=s.range[0]-this.#d(y):m+=s.range[0]-this.#_(y),_--}n?d-=m:p-=m}}this._getDimensionAxis()._dateHolesAfterID?.includes(h)&&a.push(null),a.push({x:d,y:p,groupId:u,id:u+"-"+h,data:c.data,group:r,label:c.group})}),e.push(this.#e(a,n))}),e}_handlePath(t){const{dimensionAxis:e,metricAxis:s}=this.#A();return t.attr("d",(n,i)=>{if(!n)return;const r=window.d3.path(),{x:a,y:l,group:c}=n;let h;const u=typeof this.trace.width=="function",d=typeof this.trace.width=="object"&&this.trace.width,p=Array.isArray(this.trace.width);return u?h=this.trace.width(c[i]):d?h=this.trace.width[c]:p?h=this.trace.width[i]:h=this.trace.width||4,h<0&&(h=2),h*=this.trace.dots?.sizingRatio??1.66,r.arc(a,l,h/2,0,2*Math.PI),r}).attr("data-x-axis",e.name).attr("data-y-axis",s.name).attr("data-x",n=>n?.data[e.value]).attr("data-y",n=>n?.data[s.value]).attr("data-x-stack",n=>{const i=n?.data[e.stack||"__plotter_default_group"];if(i!=="default")return i}).attr("data-y-stack",n=>{const i=n?.data[s.stack||"__plotter_default_group"];if(i!=="default")return i}).attr("opacity",this.trace.dots?.opacity??0),this._axisMeta(t),this._setTraceColor(t,"fill",this.trace.dots?.color??"transparent"),this._markNearestPoints(t),this._events(t),t}_handleLines(t){return t.attr("id",e=>e.find(s=>!!s).groupId).attr("d",(e,s,n)=>{let i=n[s].getAttribute("d");return i||this.computed.fLine(e)}).attr("stroke-dasharray",(e,s,n)=>{let i=n[s].getAttribute("stroke-dasharray");if(i)return i;const{dasharray:a}=Le(this.plot.layer?.configuration,this.trace);return a||"0 "+n[s].getTotalLength()}).attr("stroke-dashoffset",(e,s,n)=>{let i=n[s].getAttribute("stroke-dashoffset");return i||0}).style("stroke-width",(e,s)=>{const{width:n}=Le(this.plot.layer?.configuration,this.trace);if(n)return n;const i=typeof this.trace.width=="function",r=typeof this.trace.width=="object"&&this.trace.width,a=Array.isArray(this.trace.width);return i?this.trace.width(e):r?this.trace.width[e.group]:a?this.trace.width[s]:this.trace.width||2}).attr("opacity",e=>this._opacity(e?.data)).attr("marker-end",e=>this.trace.arrows?`url(#${"marker-"+String(e?.filter(n=>n)[0]?.label||"null").hash()})`:null).style("pointer-events","none"),this._setTraceColor(t,"stroke"),this._setTraceColor(t,"fill","none"),this._transition(t).attr("d",e=>this.computed.fLine(e)).attr("stroke-dasharray",(e,s,n)=>{const{dasharray:i}=Le(this.plot.layer?.configuration,this.trace);return i||`${n[s].getTotalLength()} 0`}).attr("stroke-dashoffset","0")}_join(t=0){const e=super._join(t);return this.#h(),this.#l(),e}_handleClipPathRect(t){const e=super._handleClipPathRect(t);if(ct.isEndLabelsEnabled(this.plot.layer?.configuration,this.trace)){const s=ct.resolveEndLabelReserve(this.#n(),this.trace)+this.#s();e.attr("width",function(){return(Number(this.getAttribute("width"))||0)+s})}return e}#s(){return(this.plot.getCurrentTraces?.()||[]).some(n=>n?.y?.position==="right"&&n.y.hidden!==!0)?(Number(this.plot.layer?.configuration?.axis?.ticks?.texts?.size)||12)*ct.#y:0}#n(){return{configuration:this.plot.layer?.configuration,data:this.plot.__parameters__?.parent?.__parameters__?.data||[]}}static isEndLabelsEnabled(t,e){return t?.lines?.endLabels?.display===!0&&e?.type==="lines"&&!e.arrows&&t?.reverse!==!0}static resolveEndLabelReserve(t,e){const s=ct.#a(t?.configuration),n=ct.#i(t,e);return Math.max(0,...n.map(r=>rt.computeRenderWidth(`${r} 00.0K`,s)))+ct.#L*ct.#r(t?.configuration,e)}static#r(t,e){return Le(t,e).dasharray?6:3}static#i(t,e){const s=e?.x?.stack,n=Array.isArray(t?.data)?t.data:[];return s&&n.length?[...new Set(n.map(i=>i?.[s]).filter(i=>i!=null).map(String))]:[String(e?.name??e?.y?.label??"")]}static#a(t){const e=t?.lines?.endLabels||{};return{size:Number(e.size)||11,weight:e.weight||500,family:e.family||t?.axis?.ticks?.texts?.family||null}}#l(){const t=this.containers.layerContainer;if(!t)return;const e=this.plot.layer?.configuration?.lines?.endLabels?.display===!0?this.trace.arrowLabel:null,s=typeof e=="function"?t.selectAll("g.plotter-trace-group").data():[],{colors:n,colorsIsAlreadyMapped:i}=this._getTraceColors(),r=ct.#a(this.plot.layer?.configuration),a=Math.max(...s.flat().map(c=>Number(c?.x)).filter(Number.isFinite)),l=s.flatMap(c=>{const h=(c||[]).filter(p=>Number.isFinite(p?.x)&&Number.isFinite(p?.y)),u=h[h.length-1];if(!u)return[];const d=u.x>=a;return[{key:u.groupId,name:String(e(u.data??u)),x:u.x+(d?-ct.#u:ct.#u),y:u.y,anchor:d?"end":"start",color:this._getTraceColor(u,n,i)||ct.#c}]});t.selectAll("text.plotter-arrow-label").data(l,c=>c.key).join("text").attr("class","plotter-arrow-label").attr("x",c=>c.x).attr("y",c=>c.y-ct.#u).attr("text-anchor",c=>c.anchor).attr("fill",c=>c.color).attr("font-size",r.size).attr("font-weight",r.weight).attr("font-family",r.family).style("pointer-events","none").text(c=>c.name)}#h(){const t=this.containers.layerContainer;if(!t)return;const e=this.plot.layer?.configuration,s=ct.isEndLabelsEnabled(e,this.trace),n=ct.#a(e),{metricAxis:i}=this.#A(),{colors:r,colorsIsAlreadyMapped:a}=this._getTraceColors(),c=(s?t.selectAll("g.plotter-trace-group").data():[]).map(m=>{const y=[...m||[]].reverse().find(T=>T&&Number.isFinite(T.x)&&Number.isFinite(T.y));if(!y)return null;const b=typeof this.trace.color=="function"?this.trace.color(y.data??y):null,A=b!=null&&!String(b).startsWith("#")?String(b):String(this.trace.name??i.label??i.value??""),L=e?.lines?.endLabels?.value===!1?"":Ut(y.data?.[i.value],{unit:i.unit,sign:i.signed,format:{compact:!0,showUnit:e?.axis?.ticks?.texts?.format?.showUnit!==!1}});return{key:y.groupId,name:A,value:L,x:y.x,y:y.y,color:this._getTraceColor(y,r,a)||ct.#c}}).filter(Boolean),h=ct.#L,u=ct.#r(e,this.trace),d=Le(e,this.trace).dasharray,p=this.#s(),f=p?Math.max(...this.plot._getRanges?.().horizontal||[0]):0;c.forEach(m=>{m.labelY=m.y,m.anchorX=p?Math.max(m.x+h*u,f+p):m.x+h*u});const _=t.selectAll("g.plotter-line-end-labels").data(s?[null]:[]).join("g").attr("class","plotter-line-end-labels").selectAll("g.plotter-line-end-label").data(c,m=>m.key).join(m=>{const y=m.append("g").attr("class","plotter-line-end-label");y.append("line");const b=y.append("text");return b.append("tspan").attr("class","plotter-line-end-label-name"),b.append("tspan").attr("class","plotter-line-end-label-value"),y}).on("contextmenu",(m,y)=>this._handleContextMenu(m,{__lineEndLabel:!0,seriesKey:y.name,seriesColor:y.color}));_.select("line").style("pointer-events","none"),_.select("line").attr("x1",m=>m.x+h).attr("x2",m=>m.anchorX-h/2).attr("y1",m=>m.labelY).attr("y2",m=>m.labelY).attr("stroke",m=>m.color).attr("stroke-dasharray",d).attr("stroke-width",m=>m.anchorX-m.x>h*(u+1)?1:2).attr("stroke-opacity",m=>m.anchorX-m.x>h*(u+1)?.5:1);const g=_.select("text").attr("x",m=>m.anchorX).attr("y",m=>m.labelY).attr("dominant-baseline","central").attr("font-size",n.size).attr("font-family",n.family);g.select("tspan.plotter-line-end-label-name").attr("font-weight",n.weight).attr("fill",ct.#c).text(m=>m.name),g.select("tspan.plotter-line-end-label-value").attr("dx",4).attr("font-weight",400).attr("fill",ct.#m).text(m=>m.value),this.#p(n.size+3)}#p(t){const e=this.plot.__nodes__?.svg;if(!e)return;const s=e.selectAll("g.plotter-line-end-label"),n=s.data().filter(Boolean).sort((i,r)=>i.y-r.y);n.forEach((i,r)=>{i.labelY=r===0?i.y:Math.max(i.y,n[r-1].labelY+t)}),s.select("line").attr("y1",i=>i.labelY).attr("y2",i=>i.labelY),s.select("text").attr("y",i=>i.labelY)}static#y=4;static#L=4;static#T=16;static#u=6;static#c="#1F2937";static#m="#6B7280";_handleTrace(t){this.trace.dots?.hidden||(t=super._handleTrace(t));const e=t.selectAll("path.plotter-trace-group-path").data(s=>[s]).join(s=>this._handleLines(s.append("path").attr("class","plotter-trace-group-path")),s=>this._handleLines(s),s=>s.remove());return this.#o(t),e}#o(t){const e=n=>{const i=n.parentNode.querySelectorAll(".plotter-trace-element-path");return i[i.length-1]},s=(n,i)=>{n.parentNode.classList.toggle("plotter-arrow-active",i),n.closest(".plotter-traces")?.classList.toggle("plotter-arrows-focus",i)};t.selectAll("path.plotter-arrow-hit").data(n=>this.trace.arrows?[n]:[]).join("path").attr("class","plotter-arrow-hit").attr("d",n=>this.computed.fLine(n)).attr("fill","none").attr("stroke","transparent").attr("stroke-width",ct.#T).style("pointer-events","stroke").style("cursor","pointer").on("mousemove",n=>{s(n.currentTarget,!0),ce(e(n.currentTarget),"mousemove",n)}).on("mouseleave",n=>{s(n.currentTarget,!1),ce(e(n.currentTarget),"mouseout",n)}).on("click",n=>ce(e(n.currentTarget),"click",n)).on("contextmenu",n=>{n.preventDefault(),n.stopPropagation(),ce(e(n.currentTarget),"contextmenu",n)})}_masks(t){if(this.trace.arrows){const n=this.computed.data.map(i=>i.filter(r=>r)).map(i=>i[0]);return this.containers.masks=this.plot.__nodes__.defs.selectAll("marker").data(n).join(i=>this.#E(i.append("svg:marker")),i=>this.#E(i),i=>i.remove()),this.containers.masks}return!0}#A(){const t=this.trace.scales.x.getScale(),e=this.trace.scales.y.getScale(),s=this.plot.layer?.dimensions||[],n=s.includes(t.value),i=s.includes(e.value);if(n&&!i)return{dimensionAxis:t,metricAxis:e};if(i&&!n)return{dimensionAxis:e,metricAxis:t};const r=t.type==="discrete"||t.isDate,a=e.type==="discrete"||e.isDate;return r&&!a?{dimensionAxis:t,metricAxis:e}:a&&!r?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#E(t){t.attr("id",({group:s})=>"marker-"+String(s||"null").hash()).attr("markerUnits","strokeWidth").attr("markerWidth",12).attr("markerHeight",12).attr("viewBox","0 0 12 12").attr("refX",5).attr("refY",3).attr("orient","auto");const e=t.selectAll("path").data(s=>[s]).join(s=>s.append("path").attr("d","M0,0 L6,3 L0,6 Z"),s=>s,s=>s.remove());return this._setTraceColor(e,"fill"),t}#d(t){if(!t)return;const{dimensionAxis:e,metricAxis:s}=this.#A();if(["top","bottom"].includes(s.position)){const r=this.trace.scales.y.getScale();let a=r.for(t,r.value);return r.dimension&&(a+=this._elementCenter(r,t)),a}if(this.trace.scales.y2){const r=this.trace.scales.y2.getScale();let a=r.for(t);return r.dimension&&(a+=this._elementCenter(r,t)),a}let i=e.for(t,e.value);return e.dimension&&(i+=this._elementCenter(e,t)),i}#_(t){if(!t)return;const{dimensionAxis:e,metricAxis:s}=this.#A();if(["top","bottom"].includes(s.position)){if(this.trace.scales.y2){const r=this.trace.scales.y2.getScale();let a=r.for(t);return r.dimension&&(a+=this._elementCenter(r,t)),a}let i=e.for(t,e.value);return e.dimension&&(i+=this._elementCenter(e,t)),i}return s.for(t,s.value)}}class Ls extends Ot{static#t(t,e){const s=e?.value;if(typeof s!="string"||!s.length)return!1;const n=t?.[s];return n==null||n===""||typeof n=="number"&&!Number.isFinite(n)}_getPoints(t=null){const{metricAxis:e}=this.#e(),s=["top","bottom"].includes(e.position),n=[];return this.computed.data.forEach(i=>{const r=[],a=`g-${String(i?.[0]?.group).hash()}-t-${this.trace.id}-element`;i.filter(c=>c&&!Ls.#t(c.data,e)).forEach((c,h)=>{let u=this.#n(c.data),d=this.#r(c.data);const p=this.#i(c.data,this.plot.layer.configuration.axis.ratioOfElementSize),f=this.#a(c.data),_=this._icon(c.data),g=a+"-scatter-"+h;if(!this.trace.overlay&&this.trace.stacked){let y=c.data.plotter.prev;if(y){let b=0;for(;y;){const A=s?this.#n(y.data):this.#r(y.data);b+=e.range[0]-A,y=y.data.plotter.prev}s?u-=b:d-=b}}r.push({x:u,y:d,width:p,height:f,icon:_,id:g,data:c.data})}),n.push(r)}),n}_handlePath(t){const{dimensionAxis:e}=this.#e(),s=["left","right"].includes(e.position),n=this.#s();return t.attr("id",({id:i})=>i+"-path").attr("d",(i,r,a)=>{const l=window.d3.path();if(n==="icons"){const g=layers.getIcon(i.icon,i.width);return typeof g=="function"?g():g}let h=window.d3.select(a[r]),u=parseFloat(h.attr("data-position-x")),d=parseFloat(h.attr("data-position-y")),p=parseFloat(h.attr("data-position-width")),f=parseFloat(h.attr("data-position-height"));if(isNaN(u)&&(u=i.x),isNaN(d)&&(d=0),isNaN(p)&&(p=i.width),isNaN(f)&&(f=i.height),n==="line-h"||n==="line-v")l.rect(u,d,p,f);else{const g=p<0?2:p;s?l.arc(u,d+g/2,g/2,0,2*Math.PI):l.arc(u+g/2,d,g/2,0,2*Math.PI)}return l}).attr("transform",({x:i,y:r,icon:a})=>n==="icons"?(a!=="plus"&&(i+=30/4,r+=30/4),`translate(${i}, ${r})`):"translate(0, 0)").attr("stroke-width",i=>n==="icons"?2:typeof this.trace.strokeSize=="function"?this.trace.strokeSize(i):this.trace.strokeSize||0).attr("stroke-opacity",i=>typeof this.trace.strokeOpacity=="function"?this.trace.strokeOpacity(i):this.trace.strokeOpacity||1).attr("opacity",i=>this._opacity(i?.data,0)).attr("data-position-height",({height:i})=>i).attr("data-position-width",({width:i})=>i).attr("data-position-x",({x:i})=>i).attr("data-position-y",({y:i})=>i),this._axisMeta(t),this._setTraceColor(t,"stroke"),this._setTraceColor(t),this._events(t),this._transition(t).attr("opacity",i=>this._opacity(i?.data)).attr("d",({x:i,y:r,width:a,height:l,icon:c})=>{const h=window.d3.path();if(n==="icons"){const p=layers.getIcon(c,a);return typeof p=="function"?p():p}if(n==="line-h"||n==="line-v")h.rect(i,r,a,l);else{const p=a<0?2:a;s?h.arc(i,r+p/2,p/2,0,2*Math.PI):h.arc(i+p/2,r,p/2,0,2*Math.PI)}return h})}_icon(t){if(this.trace.as==="icons")return layers.ICONS[t?.plotter?.rowIndex]}_fromAreas(t){return this.containers.layerContainer.selectAll("path.plotter-trace-group-path").remove(),this.update()}_fromLines(t){return this.containers.layerContainer.selectAll("path.plotter-trace-group-path").remove(),this.update()}#e(){const t=this.trace.scales.x.getScale(),e=this.trace.scales.y.getScale(),s=this.plot.layer?.dimensions||[],n=s.includes(t.value),i=s.includes(e.value);return n&&!i?{dimensionAxis:t,metricAxis:e}:i&&!n?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#s(){const{dimensionAxis:t}=this.#e();return["left","right"].includes(t.position)?this.trace.as==="line-h"?"line-v":this.trace.as==="line-v"?"line-h":this.trace.as:this.trace.as}#n(t){if(!t)return;const{dimensionAxis:e,metricAxis:s}=this.#e();return["left","right"].includes(e.position)?s.for(t):e.for(t,e.value)}#r(t){if(!t)return;const{dimensionAxis:e,metricAxis:s}=this.#e();return["left","right"].includes(e.position)?e.for(t,e.value):s.for(t)}#i(t,e=1){const{dimensionAxis:s}=this.#e(),n=this.#s(),i=s._uniqueValue.indexOf(t[s.value]),r=layers.ICONS[i],a=n==="icons",l=["circle","line-h","square","dot"].includes(n);return a?r==="plus"?100:30:l?Math.abs(s.size(t,e)):2}#a(t){const{dimensionAxis:e}=this.#e(),s=this.#s(),n=Math.abs(e.size(t,this.plot.layer.configuration.axis.ratioOfElementSize)),a=s==="dot"?n/2:s==="square"||s==="circle"?n:2;return s==="icons"?30:s==="line-h"?this.trace.height||4:s==="line-v"?n:a}}class Cn extends Ot{static#t=[{offset:"0%",opacity:.35},{offset:"100%",opacity:.02}];#e(t,e){const s=t.filter(r=>r);s.sort((r,a)=>{if(e){const l=r.y,c=a.y;return Number(l)-Number(c)}else{const l=r.x,c=a.x;return Number(l)-Number(c)}});const n=[];let i=0;return t.forEach(r=>{if(!r){n.push(r);return}n.push(s[i]),i++}),n}_computeTracesProperties(){const{dimensionAxis:t}=this.#n();this.computed.data.forEach((e,s)=>{e.forEach((n,i)=>{if(!n)return;const{data:r}=n,a=e,l=a[i-1],c=a[i+1],h=this.computed.data.map(f=>f.filter(_=>_?.data[t.stack]===r[t.stack])).flat(),p=h.filter(f=>f).map(f=>f?.data?.id).indexOf(r.id);r.plotter={groups:this.computed.data,group:a,neighbors:h,neighborsIndex:p,groupIndex:s,rowIndex:i,prev:l,next:c}})})}_getPoints(t=null){const{dimensionAxis:e,metricAxis:s}=this.#n(),n=["top","bottom"].includes(s.position);return(t||this.computed.data).map((i,r)=>{const a=[];return i.forEach((l,c)=>{if(!l)return l;let h=this.#i(l.data),u=this.#a(l.data);const d=this.#r(l.data);let p=this.#l(i,c);if(!this.trace.overlay&&this.trace.stacked){let A=0;for(let L=l.data.plotter?.groupIndex-1;L>=0;L--){const T=l.data.plotter?.groups[L]?.[l.data.plotter?.rowIndex];T&&(A+=s.range[0]-this.#a(T.data))}h-=A,u-=A}if(n){const A=h,L=u,T=(A+L)/2,E=d,C=[{x:A,y:E,mean:T,data:l.data,index:c,size:p,type:"lower"},{x:T,y:E,mean:T,data:l.data,index:c,size:p,type:"mean"},{x:L,y:E,mean:T,data:l.data,index:c,size:p,type:"upper"}];this._getDimensionAxis()._dateHolesAfterID?.includes(c)&&a.push(null),a.push({data:l.data,points:C,index:c,groupIndex:r,x:T,y:E,x0:A,x1:L});return}const _=h,g=u,m=(_+g)/2,y=d,b=[{x:y,y:_,mean:m,data:l.data,index:c,size:p,type:"lower"},{x:y,y:m,mean:m,data:l.data,index:c,size:p,type:"mean"},{x:y,y:g,mean:m,data:l.data,index:c,size:p,type:"upper"}];this._getDimensionAxis()._dateHolesAfterID?.includes(c)&&a.push(null),a.push({data:l.data,points:b,index:c,groupIndex:r,x:y,y:m,y0:_,y1:g})}),this.#e(a,n)})}_handlePath(t){const{dimensionAxis:e,metricAxis:s}=this.#n();return t.attr("d",n=>{if(!n)return;const i=window.d3.path(),{x:r,y:a,mean:l,size:c}=n;return i.arc(r,l??a,c/2,0,2*Math.PI),i}).attr("data-type",n=>n.type).attr("data-x-axis",e.name).attr("data-y-axis",s.name).attr("data-x",n=>n?.data[e.value]).attr("data-y",n=>n?.data[s.value]).attr("data-x-stack",n=>{const i=n?.data[e.stack||"__plotter_default_group"];if(i!=="default")return i}).attr("data-y-stack",n=>{const i=n?.data[s.stack||"__plotter_default_group"];if(i!=="default")return i}).attr("opacity",this.trace.dots?.opacity??0),this._axisMeta(t),this._setTraceColor(t,"fill",this.trace.dots?.color??"transparent"),this._markNearestPoints(t,n=>n.type==="upper"),this._events(t),this._transition(t).attr("d",n=>{if(!n)return;const i=window.d3.path(),{x:r,y:a,size:l}=n;return i.arc(r,a,l/2,0,2*Math.PI),i}).attr("opacity",this.trace.dots?.opacity??0)}_handlePaths(t){return t.each((e,s,n)=>{window.d3.select(n[s]).selectAll("path.plotter-trace-element-path").data(e).join(r=>this._handlePath(r.append("path").attr("class","plotter-trace-element-path")),r=>this._handlePath(r),r=>r.remove())}),t}#s(){return`${this.trace.id}-area-fill`}_gradients(t){if(!this.trace.fillGradient)return!0;const e=t.flat().find(Boolean),{colors:s,colorsIsAlreadyMapped:n}=this._getTraceColors(),i=e?this._getTraceColor(e,s,n):null;return this.containers.gradients=this.plot.__nodes__.defs.selectAll(`linearGradient.plotter-area-fill-${this.trace.id}`).data(i?[i]:[]).join("linearGradient").attr("class",`plotter-area-fill-${this.trace.id}`).attr("id",this.#s()).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%"),this.containers.gradients.selectAll("stop").data(Cn.#t).join("stop").attr("offset",({offset:r})=>r).attr("stop-color",i).attr("stop-opacity",({opacity:r})=>r),this.containers.gradients}_handleAreas(t){const{dimensionAxis:e}=this.#n(),s=["left","right"].includes(e.position);return t.attr("id",n=>n.find(i=>!!i).groupId).attr("d",(n,i,r)=>{let a=r[i].getAttribute("d");if(a)return a;const c=s?n.map(h=>h&&{y:h.y,x0:h.x,x1:h.x}):n.map(h=>h&&{x:h.x,y0:h.y,y1:h.y});return this.computed.fArea(c)}).attr("opacity",n=>this._opacity(n?.data,0)),this.trace.dots?.hidden||t.style("pointer-events","none"),this._setTraceColor(t,"fill"),this.trace.fillGradient&&t.attr("fill",`url(#${this.#s()})`),this._transition(t).attr("d",n=>this.computed.fArea(n)).attr("opacity",n=>this._opacity(n?.data))}_handleAreaLines(t){if(!this.trace.line)return t;const{dimensionAxis:e}=this.#n(),s=["left","right"].includes(e.position),n=s?this.computed.fArea.lineX1():this.computed.fArea.lineY1(),i=Le(this.plot.layer?.configuration,this.trace);return t.attr("d",(r,a,l)=>l[a].getAttribute("d")||n(r.map(c=>c&&(s?{...c,x1:c.x}:{...c,y1:c.y})))).attr("fill","none").attr("stroke-width",i.width??this.trace.line.width??2).attr("stroke-dasharray",i.dasharray).style("pointer-events","none"),this._setTraceColor(t,"stroke"),this._transition(t).attr("d",r=>n(r))}_handleTrace(t){return t.selectAll("path.plotter-trace-group-path").data(e=>[e]).join(e=>this._handleAreas(e.append("path").attr("class","plotter-trace-group-path")),e=>this._handleAreas(e),e=>e.remove()),t.selectAll("path.plotter-area-line").data(e=>this.trace.line?[e]:[]).join(e=>this._handleAreaLines(e.append("path").attr("class","plotter-area-line")),e=>this._handleAreaLines(e),e=>e.remove()),this.trace.dots?.hidden||t.each((e,s,n)=>{const i=window.d3.select(n[s]),a=e.filter(l=>l).map(l=>l.points);i.selectAll("g.plotter-trace-element").data(a).join(l=>this._handlePaths(l.append("g").attr("class","plotter-trace-element")),l=>this._handlePaths(l),l=>l.remove())}),t}#n(){const t=this.trace.scales.x.getScale(),e=this.trace.scales.y.getScale(),s=this.plot.layer?.dimensions||[],n=s.includes(t.value),i=s.includes(e.value);return n&&!i?{dimensionAxis:t,metricAxis:e}:i&&!n?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#r(t){if(!t)return;const{dimensionAxis:e}=this.#n();let s=e.for(t,e.value);return e.dimension&&(s+=this._elementCenter(e,t)),s}#i(t){if(!t)return;const{metricAxis:e}=this.#n();return e.lower?e.for(t,e.lower):e.for(t,e.value,{forceValue:e.domain[0]})}#a(t){if(!t)return;const{metricAxis:e}=this.#n();return e.for(t,e.upper??e.value)}#l(t,e){let s;const n=typeof this.trace.width=="function",i=typeof this.trace.width=="object"&&this.trace.width,r=Array.isArray(this.trace.width);return n?s=this.trace.width(t[e]):i?s=this.trace.width[t]:r?s=this.trace.width[e]:s=this.trace.width||4,s<0&&(s=2),s*(this.trace.dots?.sizingRatio??1.66)}}class Nr extends Ot{_computeTracesProperties(){const{dimensionAxis:t}=this.#e();this.computed.data.forEach((e,s)=>{e.forEach((n,i)=>{if(!n)return;const{data:r}=n,a=e;let l,c,h=i;this.trace.stacked&&(l=a[s-1],c=a[s+1],h=s);const d=this.computed.data.map(m=>m.filter(y=>y?.data[t.value]===r[t.value])).flat(),p=this.computed.data.map(m=>m.filter(y=>y?.data[t.stack]===r[t.stack])).flat(),g=d.filter(m=>m).map(m=>m?.data?.id).indexOf(r.id);r.plotter={groups:this.computed.data,group:a,sharingSameValue:d,sharingSameStack:p,neighbors:d,neighborsIndex:g,groupIndex:s,rowIndex:h,prev:l,next:c}})})}_getPoints(t=null){return this.computed.data.map(e=>e.filter(n=>n).map(n=>{const i=this.#s(n.data),r=this.#r(n.data),a=this.#n(n.data),l=this.#i(n.data);return{x:i,y:r,width:a,height:l,data:n.data,group:n.group}}))}_handlePath(t){return t.attr("d",e=>{const s=window.d3.path();return s.rect(e.x,e.y+e.height,e.width,0),s}).attr("opacity",e=>this._opacity(e?.data,0)),this._axisMeta(t),this._setTraceColor(t),this._events(t),this._transition(t).attr("d",e=>{const s=window.d3.path();return s.rect(e.x,e.y,e.width,e.height),s}).attr("opacity",e=>this._opacity(e?.data))}_fromAreas(t){return this.containers.layerContainer.selectAll("path.plotter-trace-group-path").remove(),this.update()}_fromLines(t){return this.containers.layerContainer.selectAll("path.plotter-trace-group-path").remove(),this.update()}#t(){const{dimensionAxis:t}=this.#e();return t?["top","bottom"].includes(t.position):!1}#e(){const t=this.trace.scales.x?.getScale(),e=this.trace.scales.y?.getScale(),s=this.trace.scales.y2?.getScale(),n=[t,e,s].filter(d=>d!=null),i=this.plot?.layer?.dimensions||[],r=d=>["top","bottom"].includes(d.position),a=d=>["left","right"].includes(d.position);let l=n.find(d=>i.includes(d.value))||n.find(d=>d.type==="discrete"||d.isDate)||t;const c=n.filter(d=>d!==l),h=c.find(r),u=c.find(a);return{dimensionAxis:l,widthMetricAxis:h,heightMetricAxis:u}}#s(t){if(!t)return;const{widthMetricAxis:e}=this.#e();if(!e)return 0;const s=Math.min(...e.range),n=e.getSplitLag(t);if(this.#t())return s+n;let i=s+n;const r=t.plotter?.neighbors||[],a=t.plotter?.neighborsIndex??0;let l=0;for(;l<a;){const c=r[l]?.data;if(!c){l++;continue}if(this.#a(e,t,c)){const u=e.for(c)-s-e.getSplitLag(c);i+=u}l++}return i}#n(t){if(!t)return;const{widthMetricAxis:e}=this.#e();if(!e)return 0;const s=Math.min(...e.range),n=e.getSplitLag(t);return e.for(t)-s-n}#r(t){if(!t)return;const{heightMetricAxis:e}=this.#e();if(!e)return 0;if(!this.#t())return e.for(t);const s=e.getSplitLag(t);let n=Math.min(...e.range)+s;const i=t.plotter?.neighbors||[],r=t.plotter?.neighborsIndex??0;let a=0;for(;a<r;){const l=i[a]?.data;if(!l){a++;continue}this.#a(e,t,l)&&(n+=e.height(l)),a++}return n}#i(t){if(!t)return;const{heightMetricAxis:e}=this.#e();return e?e.height(t):0}#a(t,e,s){return t?.split?e?.[t.split]===s?.[t.split]:!0}}const We=2,wn=1,i1=16,Fc=20,Mr=22,r1=48,a1=.28,Rn=8,o1=.22,xe="#1F2937",Hc="plotter-layer-decoration",l1=6,Bc="plotter-mekko-zero-line";class zc extends Nr{_getPoints(t=null){const e=this.#i();return this.computed.mekko100=e,this.computed.data.map(s=>s.filter(Boolean).map(n=>({x:0,y:0,width:0,height:0,...e.cells.get(n),data:n.data,group:n.group})))}_join(t=0){const e=super._join(t);return this.#y(),e}#t(t,e,s){if(this.plot.layer?.configuration?.bars?.endLabels?.display!==!0||!t.length)return 0;const n=Math.max(...t.map(i=>this._computeTextRenderingWidth(i,s)));return Math.min(n+Rn,e*o1)}#e(){const t=this.plot.layer?.configuration,e=t?.bars?.labels||{};return{size:Number(e.size)||11,weight:e.weight||500,family:e.family||t?.axis?.ticks?.texts?.family||null}}#s(){return this.plot.layer?.configuration?.reverse===!0}#n(){return this.trace.scales?.y2?.getScale?.()||null}#r(t,e,s){return t.for(e,t.value,{forceValue:s})}#i(){const t=this._getDimensionAxis(),e=this._getMetricAxis().value,s=M=>Math.max(0,Number(M.data[e])||0),n=this.computed.data.flat().filter(Boolean),{horizontal:i,vertical:r}=this.plot._getRanges(),a=this.trace.height,l=a?this.#n():null,c=this.#s(),h=this.#e(),d=!!a&&n.some(M=>Number(M.data[a.value])<0)?h.size+l1:0,p=a?0:i1,f=this.computed.data.map(M=>M.find(Boolean)?.data[t.stack]).filter(M=>M!=null),_=new Map;n.forEach(M=>{const k=M.data[t.value];_.set(k,[..._.get(k)||[],M])});const g=(t._uniqueValue||[..._.keys()]).filter(M=>_.has(M)),m=g.map(M=>_.get(M).reduce((k,I)=>k+s(I),0)),y=m.reduce((M,k)=>M+k,0),b=m.filter(M=>M>0).length;if(c)return this.#h({byColumn:_,order:g,totals:m,grandTotal:y,shown:b,stacks:f,value:s,rows:n,horizontal:i,vertical:r,side:p,heightMeasure:a,heightAxis:l,font:h,negativeBand:d});const A=Math.min(...i)+p,L=Math.max(...i)-p-A,T=Math.min(...r)+Fc,E=Math.max(...r)-Mr-d,C=this.#t(f.map(String),L,h),S={columns:[],cells:new Map,left:A,right:A+L-C,top:T,bottom:E,seriesBand:C,reversed:!1,footerOffset:d,zeroY:null,zeroX:null},w=S.right-A-We*Math.max(b-1,0),N=E-T;if(y<=0||w<=0||N<=0)return S;if(a)return this.#a({layout:S,byColumn:_,order:g,totals:m,grandTotal:y,left:A,top:T,bottom:E,width:w,height:N,heightMeasure:a,heightAxis:l,font:h,rows:n}),S;let R=A;return g.forEach((M,k)=>{const I=m[k];if(I<=0)return;const O=I/y*w,F=f.map(V=>_.get(M).find(H=>H.data[t.stack]===V)).filter(V=>V&&s(V)>0),P=N-wn*Math.max(F.length-1,0);let B=E;F.forEach(V=>{const H=s(V)/I,U=H*P;B-=U,S.cells.set(V,{x:R,y:B,width:O,height:U,share:H}),B-=wn}),S.columns.push({key:M,x:R,width:O,share:I/y,top:T,bottom:E}),R+=O+We}),S}#a({layout:t,byColumn:e,order:s,totals:n,grandTotal:i,left:r,top:a,bottom:l,width:c,height:h,heightMeasure:u,heightAxis:d,font:p,rows:f}){const _=L=>Number(L.data[u.value])||0;let g,m,y,b;if(d)g=f.map(T=>this.#r(d,T.data,0))[0]??l,t.zeroY=f.some(T=>_(T)<0)?g:null;else{const L=f.map(_);y=Math.max(0,...L),b=Math.min(0,...L),m=y-b,g=m>0?a+y/m*h:l,t.zeroY=b<0?g:null}let A=r;s.forEach((L,T)=>{const E=n[T];if(E<=0)return;const C=E/i*c,[S]=e.get(L),w=_(S);let N,R;if(d){const k=this.#r(d,S.data,w);N=Math.min(g,k),R=Math.abs(k-g)}else R=m>0?Math.abs(w)/m*h:0,N=w<0?g:g-R;const M=E/i;t.cells.set(S,{x:A,y:N,width:C,height:R,share:M}),t.columns.push({key:L,x:A,y:N,width:C,height:R,share:M,top:N,bottom:l,value:S.data[u.value],labelY:w<0?N+R+p.size+2:N-6,labelX:A+C/2}),A+=C+We})}#l(t,e,s){const n=Math.max(r1,...t.map(i=>this._computeTextRenderingWidth(String(i),s)+10));return Math.min(n,e*a1)}#h({byColumn:t,order:e,totals:s,grandTotal:n,shown:i,stacks:r,value:a,rows:l,horizontal:c,vertical:h,side:u,heightMeasure:d,heightAxis:p,font:f,negativeBand:_}){const g=this._getDimensionAxis(),m=Math.min(...c)+u,y=Math.max(...c)-u-(d&&!p?_:0),b=Math.max(0,y-m),A=this.#l(e,b,f),L=m+A,T=y,E=Math.min(...h)+u+Fc,C=Math.max(...h)-u-E,S=this.#t(r.map(String),C,f),w={columns:[],cells:new Map,left:L,right:T,top:E,bottom:E+C-S,seriesBand:S,reversed:!0,footerOffset:0,nameBand:A,nameLeft:m,zeroY:null,zeroX:null},N=w.bottom-E-We*Math.max(i-1,0),R=T-L;if(n<=0||N<=0||R<=0)return w;if(d){const k=V=>Number(V.data[d.value])||0;let I,O,F,P;if(p)I=l.map(H=>this.#r(p,H.data,0))[0]??L,w.zeroX=l.some(H=>k(H)<0)?I:null;else{const V=l.map(k);F=Math.max(0,...V),P=Math.min(0,...V),O=F-P,I=O>0?L+(0-P)/O*R:L,w.zeroX=P<0?I:null}let B=E;return e.forEach((V,H)=>{const U=s[H];if(U<=0)return;const j=U/n*N,[z]=t.get(V),Y=k(z);let dt,pt;if(p){const vs=this.#r(p,z.data,Y);dt=Math.min(I,vs),pt=Math.abs(vs-I)}else pt=O>0?Math.abs(Y)/O*R:0,dt=Y<0?I-pt:I;const Wt=U/n;w.cells.set(z,{x:dt,y:B,width:pt,height:j,share:Wt});const Ze=Y<0?Math.max(L+4,dt-4):dt+pt+4;w.columns.push({key:V,x:dt,y:B,width:pt,height:j,share:Wt,top:B,bottom:B+j,left:L,right:T,value:z.data[d.value],labelX:Ze,labelY:B+j/2,labelAnchor:(Y<0,"start"),nameX:L-8,nameY:B+j/2}),B+=j+We}),w}let M=E;return e.forEach((k,I)=>{const O=s[I];if(O<=0)return;const F=O/n*N,P=r.map(H=>t.get(k).find(U=>U.data[g.stack]===H)).filter(H=>H&&a(H)>0),B=R-wn*Math.max(P.length-1,0);let V=L;P.forEach(H=>{const U=a(H)/O,j=U*B;w.cells.set(H,{x:V,y:M,width:j,height:F,share:U}),V+=j+wn}),w.columns.push({key:k,x:L,y:M,width:R,height:F,share:O/n,top:M,bottom:M+F,left:L,right:T,nameX:L-8,nameY:M+F/2}),M+=F+We}),w}#p(t,e,s){if(this._computeTextRenderingWidth(t,s)<=e)return t;for(let n=t.length-1;n>0;n-=1){const i=`${t.slice(0,n).trimEnd()}…`;if(this._computeTextRenderingWidth(i,s)<=e)return i}return""}#y(){const t=this.computed.mekko100,e=this.containers.layerContainer;if(!e||!t)return;const s=this.plot.layer?.configuration,n=this.#e(),i=us(s?.bars?.labels),{colors:r,colorsIsAlreadyMapped:a}=this._getTraceColors(),l=this._getDimensionAxis(),c=y=>`${Math.round(y*100)}%`,h=this.trace.height,u={...s?.axis?.ticks?.texts?.format||{},compact:!0},d=y=>h?Ut(y.value,{unit:h.unit,format:u}):c(y.share),p=t.reversed===!0,f=t.columns.flatMap(y=>p?[{key:`name-${y.key}`,text:this.#p(String(y.key),(t.nameBand||Mr)-4,n),x:y.nameX??t.left-6,y:y.nameY??y.y+y.height/2,anchor:"end",baseline:"central",color:xe},{key:`weight-${y.key}`,text:this.#p(d(y),h?80:y.height,{...n,weight:600}),x:y.labelX??y.x+y.width/2,y:y.labelY??y.y+y.height/2,anchor:y.labelAnchor||"middle",baseline:"central",weight:600,color:xe}]:[{key:`name-${y.key}`,text:this.#p(String(y.key),y.width-2,n),x:y.x+y.width/2,y:y.bottom+(t.footerOffset||0)+Mr-6,color:xe},{key:`weight-${y.key}`,text:this.#p(d(y),y.width,{...n,weight:600}),x:y.labelX??y.x+y.width/2,y:y.labelY??y.top-6,weight:600,color:xe}]),_=t.columns[t.columns.length-1];t.cells.forEach((y,b)=>{const A=c(y.share),L=this._computeTextRenderingWidth(A,n)+4<=y.width&&n.size+2<=y.height;i!=="never"&&(L||i==="always")&&f.push({key:`cell-${b.data[l.value]}-${b.data[l.stack]}`,text:A,x:y.x+y.width/2,y:y.y+y.height/2,baseline:"central",color:Q.getContrastingInk(this._getTraceColor(b,r,a),xe)});const T=p?y.y===_?.y:y.x===_?.x;l.stack&&s?.bars?.endLabels?.display===!0&&T&&f.push({key:`series-${b.data[l.stack]}`,text:this.#p(String(b.data[l.stack]),t.seriesBand-Rn,n),x:p?y.x+y.width/2:t.right+Rn,y:p?t.bottom+Rn:y.y+y.height/2,anchor:p?"middle":"start",baseline:p?"hanging":"central",color:xe})}),e.selectAll(`text.${Hc}`).data(f.filter(y=>y.text),y=>y.key).join("text").attr("class",Hc).attr("x",y=>y.x).attr("y",y=>y.y).attr("text-anchor",y=>y.anchor||"middle").attr("dominant-baseline",y=>y.baseline||null).attr("fill",y=>y.color).attr("font-size",n.size).attr("font-weight",y=>y.weight||n.weight).attr("font-family",n.family).style("pointer-events","none").text(y=>y.text);const g=t.zeroY!=null,m=t.zeroX!=null;e.selectAll(`line.${Bc}`).data(g||m?[0]:[]).join("line").attr("class",Bc).attr("x1",()=>m?t.zeroX:t.left).attr("x2",()=>m?t.zeroX:t.right).attr("y1",()=>g?t.zeroY:t.top).attr("y2",()=>g?t.zeroY:t.bottom).attr("stroke",xe).attr("stroke-opacity",.35).style("pointer-events","none")}}const Ir=Object.freeze(["symbolSquare","symbolCircle","symbolDiamond","symbolTriangle","symbolStar","symbolWye"]);function Vc(o,t=!1){return o.length<2||o.length>Ir.length?[]:t?[...o].reverse():o}function $c(o,t){return window.d3.symbol().type(window.d3[o]).size(Math.PI*t*t)()}const c1=8,h1=4,u1=.08,Wc="plotter-layer-decoration",d1="#1F2937";class Gc extends Ls{_getPoints(t=null){const e=[this.trace.scales.y.getScale(),this.trace.scales.y2.getScale()],s=e.find(g=>["top","bottom"].includes(g.position))??e[1],n=e.find(g=>g!==s),i=typeof this.trace.bubbleSize=="function"?g=>Math.abs(Number(this.trace.bubbleSize(g)))||0:null,r=g=>e.every(m=>Number.isFinite(Number(g?.data?.[m.value]))),a=this.computed.data.flat().filter(r),l=i?Math.max(0,...a.map(g=>i(g.data))):0,{horizontal:c,vertical:h}=this.plot._getRanges(),d=Math.min(Math.abs(c[1]-c[0]),Math.abs(h[1]-h[0]))*u1,p=g=>l>0?Math.max(h1,Math.sqrt(i(g)/l)*d):c1,{values:f,symbolOf:_}=this.#t(a);return this.computed.bubbleShapeValues=f,this.computed.data.map(g=>{const m=`g-${String(g?.[0]?.group).hash()}-t-${this.trace.id}-element`;return g.filter(r).map((y,b)=>{const A=p(y.data);return{x:s.for(y.data),y:n.for(y.data),width:A*2,height:A*2,symbol:_(y.data),id:`${m}-scatter-${b}`,data:y.data}})})}_handlePath(t){return t.attr("id",({id:e})=>`${e}-path`).attr("d",({symbol:e,width:s})=>$c(e,s/2)).attr("transform",({x:e,y:s})=>`translate(${e}, ${s})`).attr("opacity",e=>this._opacity(e?.data,0)).attr("data-position-height",({height:e})=>e).attr("data-position-width",({width:e})=>e).attr("data-position-x",({x:e})=>e).attr("data-position-y",({y:e})=>e),this._axisMeta(t),this._setTraceColor(t),this._events(t),this._transition(t).attr("opacity",e=>this._opacity(e?.data))}_join(t=0){const e=super._join(t);return this.#s(),e}#t(t){const e=this._getDimensionAxis().value,s=new Set(t.map(l=>l.data[e])),i=(this._getDimensionAxis()._uniqueValue||[...s]).filter(l=>s.has(l)),r=this.plot.layer?.configuration?.reverse===!0,a=this.trace.bubbleShapes?Vc(i,r):[];return a.length?{values:a,symbolOf:l=>Ir[a.indexOf(l[e])]}:{values:[],symbolOf:()=>"symbolCircle"}}#e(){const t=this.plot.layer?.configuration,e=t?.bars?.labels||{};return{size:Number(e.size)||11,weight:e.weight||500,family:e.family||t?.axis?.ticks?.texts?.family||null}}#s(){const t=this.containers.layerContainer,e=this.computed.bubbleShapeValues||[],n=this.plot.layer?.configuration?.lines?.endLabels?.display===!0||!e.length?this.trace.bubbleLabel:null;if(!t)return;const i=this.#e(),r=this._getDimensionAxis().value,a=this.trace.bubbleLabelOnLastShape?e[e.length-1]:void 0,c=(typeof n=="function"?this._getPoints().flat().filter(h=>a===void 0||h.data[r]===a):[]).map(h=>{const u=String(n(h.data)),d=this._computeTextRenderingWidth(u,i)+4<=h.width;return{key:h.id,text:u,x:d?h.x:h.x+h.width/2+4,y:h.y,anchor:d?"middle":"start",ink:d?"#FFFFFF":d1}});t.selectAll(`text.${Wc}`).data(c,h=>h.key).join("text").attr("class",Wc).attr("x",h=>h.x).attr("y",h=>h.y).attr("text-anchor",h=>h.anchor).attr("dominant-baseline","central").attr("fill",h=>h.ink).attr("font-size",i.size).attr("font-weight",i.weight).attr("font-family",i.family).style("pointer-events","none").text(h=>h.text)}}class at extends Ot{_configurationKey="bars";_traceName="bars";static#t=30;static#e=11;static#s=4;static#n="#374151";static#r="#FFFFFF";static#i={topLeft:!0,topRight:!0,bottomLeft:!0,bottomRight:!0};#a(){return!(!!this.trace.stacked&&!this.trace.overlay)&&this.getConfiguration().gradient?.display!==!1}_gradients(t){return this.#a()?(t=t.flat(),this.containers.gradients=this.plot.__nodes__.defs.selectAll(`linearGradient.plotter-bar-gradient-${this.trace.id}`).data(t).join(e=>this.#C(e.append("linearGradient")),e=>this.#C(e),e=>e.remove()),this.containers.gradients):!0}_getPoints(t=null){const e=[],{dimensionAxis:s,metricAxis:n}=this.#w(),i=["top","bottom"].includes(n.position),r=this.plot.layer.configuration.axis.ratioOfElementSize,a=!!n.upper,l=!!n.lower,c=a||l;if((t||this.computed.data).forEach((u,d)=>{const p=[];u.filter(_=>_).forEach((_,g)=>{let m=this.#g(_.data),y=this.#f(_.data),b=this.#v(_.data,r),A=this.#D(_.data,r);const L=this.#x(_.data);L<1&&(i?(y+=A*(1-L)/2,A*=L):(m+=b*(1-L)/2,b*=L));const T=`${this.trace.id}-${_.data.id}`,E=!this.trace.overlay&&this.trace.stacked;if(E){let w=_?.data.plotter?.neighborsIndex-1;if(_?.data.plotter?.neighbors[w]){let R=0;for(;_?.data.plotter?.neighbors[w];){const M=_?.data.plotter?.neighbors[w]?.data;R+=this.#F(M),w--}i?m-=R:y-=R}}const C=this.#l(b);let S;if(c)S=this.#N(n.position,C,a,l);else{const w=this.#R(_,E),N=this.#F(_.data);S=w?this.#G(n.position,C,N):{topLeft:kt,topRight:kt,bottomLeft:kt,bottomRight:kt}}[m,y,b,A].every(Number.isFinite)&&p.push({x:m,y,width:b,height:A,id:T,groupIndex:d,index:g,data:_.data,style:{round:at.#i,radius:S},labelValue:this.#h(_.data,n)})}),e.push(p)}),this.trace.stacked&&!this.trace.overlay&&this.#p(e,i,!!n.relative),this.trace.overlay&&this.trace.overlayWidthRatio!=null){const u=d=>this.#x(d[0]?.data);e.sort((d,p)=>u(p)-u(d))}return e}#l(t){const e=this.getConfiguration()?.round;if(e?.display===!1)return kt;const s=Number(e?.radius);return Number.isFinite(s)&&s>=0?Math.min(t/2,Math.max(s,kt)):Math.min(t/2,at.#t)}#h(t,e){const s=Number(t?.[e.value]);return Number.isFinite(s)?s:null}#p(t,e,s=!1){const n=new Map;t.flat().forEach(i=>{const r=Math.round(e?i.y:i.x+i.width/2);n.has(r)||n.set(r,[]),n.get(r).push(i)}),n.forEach(i=>{const r=i.reduce((l,c)=>l+(c.labelValue||0),0);s&&r&&i.forEach(l=>{l.labelShare=(l.labelValue||0)/r*100});const a=i.reduce((l,c)=>l?e?c.x+c.width>l.x+l.width?c:l:Math.min(c.y,c.y+c.height)<Math.min(l.y,l.y+l.height)?c:l:c,null);a&&(a.stackTotal=r)})}_handleClipPathRect(t){const e=super._handleClipPathRect(t),s=this.plot.layer?.configuration?.reverse===!0?0:Ln(this.plot.layer?.configuration,this.trace);if(at.isEndLabelsEnabled(this.plot.layer?.configuration,this.trace)){const n=at.resolveEndLabelReserve({configuration:this.plot.layer?.configuration,data:this.plot.__parameters__?.parent?.__parameters__?.data},this.trace);t.attr("width",function(){return(Number(this.getAttribute("width"))||0)+n})}if(s>0){const n=this._getHorizontalScale()[0],i=this._getVerticalScale()[0];t.attr("height",i.baseRange[0]-i.baseRange[1]+s).attr("transform",`translate(${n.baseRange[0]}, ${i.baseRange[1]-s})`)}return e}_handlePaths(t){super._handlePaths(t);const e=this.getConfiguration()?.labels||{},s=this.trace.stacked&&!this.trace.overlay,n=!this.trace.overlay&&(e.display===!0||s&&re(e)!=="never"),i=Number(this.plot.layer?.configuration?.behaviors?.transitionDuration)||0,r=n?this.containers.layerContainer.selectAll("g.plotter-trace-group").data().flat().filter(Boolean).flatMap(l=>this.#A(l,e)):[],a=at.#c(r);return t.selectAll("text.plotter-bar-label").data(l=>n?this.#A(l,e).map(c=>at.#m(c,a)):[],l=>l.key).join(l=>l.append("text").attr("class","plotter-bar-label").attr("opacity",0),l=>l,l=>l.remove()).attr("x",l=>l.x).attr("y",l=>l.y).attr("text-anchor",l=>l.anchor).attr("dominant-baseline",l=>l.baseline).attr("font-size",l=>l.font.size).attr("font-weight",l=>l.font.weight).attr("font-family",l=>l.font.family||null).attr("fill",l=>l.color).attr("stroke",l=>l.halo?at.#r:null).attr("stroke-width",l=>l.halo?3:null).attr("stroke-linejoin","round").attr("transform",l=>l.vertical?`rotate(-90 ${l.x} ${l.y})`:null).style("paint-order","stroke").style("pointer-events","visiblePainted").on("contextmenu",(l,c)=>this._handleContextMenu(l,c.data)).text(l=>l.text).transition().delay(i*.6).duration(i*.4).attr("opacity",1),t.filter(function(){return!!this.querySelector("text.plotter-bar-label")}).raise(),this.#L(),t}static isEndLabelsEnabled(t,e){return t?.bars?.endLabels?.display===!0&&e?.type==="bars"&&!!e.stacked&&!e.overlay&&!!e.x?.stack&&t?.reverse!==!0}static resolveEndLabelReserve(t,e){const s=at.#y(t?.configuration),n=Array.isArray(t?.data)?t.data:[],i=[...new Set(n.filter((r,a,l)=>typeof e.if=="function"?e.if(r,a,l):!0).map(r=>r?.[e.x?.stack]).filter(r=>r!=null).map(String))];return Math.max(0,...i.map(r=>rt.computeRenderWidth(r,s)))+at.#T*3}static#y(t){const e=t?.bars?.labels||{},s=t?.bars?.endLabels||{};return{size:Number(s.size)||Number(e.size)||at.#e,weight:s.weight||e.weight||500,family:s.family||e.family||t?.axis?.ticks?.texts?.family||null}}#L(){const t=this.containers.layerContainer;if(!t)return;const e=t.selectAll("g.plotter-trace-group").data().flat().filter(Boolean);if(!e.length)return;const s=this.plot.layer?.configuration,n=at.isEndLabelsEnabled(s,this.trace),i=at.#y(s),r=Math.max(...e.map(f=>Math.max(f.x,f.x+f.width))),{colors:a,colorsIsAlreadyMapped:l}=this._getTraceColors(),c=i.size+3,h=new Map;e.filter(f=>n&&f.height).forEach(f=>{const _=String(f.data?.[this.trace.x.stack]);(!h.has(_)||f.x>=h.get(_).x)&&h.set(_,f)});const u=[...h].map(([f,_])=>({key:f,name:f,y:Math.min(_.y,_.y+_.height)+Math.abs(_.height)/2,color:this._getTraceColor(_,a,l)})).sort((f,_)=>f.y-_.y);u.forEach((f,_)=>{f.labelY=_===0?f.y:Math.max(f.y,u[_-1].labelY+c)});const d=at.#T,p=t.selectAll("g.plotter-bar-end-labels").data(n?[null]:[]).join("g").attr("class","plotter-bar-end-labels").selectAll("g.plotter-bar-end-label").data(u,f=>f.key).join(f=>{const _=f.append("g").attr("class","plotter-bar-end-label");return _.append("line"),_.append("text"),_});p.select("line").attr("x1",r+d/2).attr("x2",r+d*2).attr("y1",f=>f.labelY).attr("y2",f=>f.labelY).attr("stroke",f=>f.color).attr("stroke-width",2),p.select("text").attr("x",r+d*3).attr("y",f=>f.labelY).attr("dominant-baseline","central").attr("font-size",i.size).attr("font-weight",i.weight).attr("font-family",i.family).attr("fill",at.#u).text(f=>f.name)}static#T=4;static#u="#1F2937";static#c(t){const e=new Map;return t.forEach(s=>{const n=at.#o(s.text);if(n){const i=`${s.key}|${n.suffix}`;e.set(i,Math.max(e.get(i)??0,n.decimals.length))}}),e}static#m(t,e){const s=at.#o(t.text),n=s?e?.get(`${t.key}|${s.suffix}`)??0:0;if(!s||n<=s.decimals.length)return t;const i=s.decimals.padEnd(n,"0");return{...t,text:`${s.integer}${s.separator||"."}${i}${s.suffix}`}}static#o(t){const e=/^([^\d]*\d[\d\s]*)(?:([.,])(\d+))?(.*)$/.exec(String(t));return e?{integer:e[1],separator:e[2]??"",decimals:e[3]??"",suffix:e[4]}:null}#A(t,e){if(t?.labelValue==null||!t.width||t.height==null)return[];const{metricAxis:s}=this.#w(),n=["top","bottom"].includes(s.position),i=this.plot.layer?.configuration?.axis?.ticks?.texts||{},r={size:Number(e.size)||at.#e,weight:e.weight||500,family:e.family||i.family||null},a={...i.format||{},compact:!0},l=s.relative?"%":s.unit,c=s.relative?`${Math.round(t.labelShare??0)}%`:Ut(t.labelValue,{unit:l,format:a,sign:s.signed}),h=rt.computeRenderWidth(c,r),u=e.color||i.color||at.#n,d=Math.min(t.x,t.x+t.width),p=Math.min(t.y,t.y+t.height),f=Math.abs(t.width),_=Math.abs(t.height),g=t.labelValue<0,m=[],y=this.trace.stacked&&!this.trace.overlay,b=e.position||"auto",A=e.display===!0,L=e.fit==="always",T=e.orientation==="vertical"&&!n,E=(w,N=L)=>N?!0:n?r.size<=_+2:T?r.size<=f+2:rt.computeRenderWidth(w,r)<=f+6,C=L||(n?h+6<=f&&r.size+2<=_:h+4<=f&&r.size+4<=_),S=(w,N,R,M)=>({...this.#E(w,N,t,{left:d,top:p,width:f,height:_},n,R,M,u),...T?{vertical:!0,anchor:R?"end":"start",baseline:"central"}:{}});if(y){A&&C&&b!=="outside"&&m.push({key:"value",data:t.data,text:c,x:d+f/2,y:p+_/2,anchor:"middle",baseline:"central",font:r,color:this.#_(t)});const w=re(e);if(w!=="never"&&t.stackTotal!=null&&!s.relative){const N=Ut(t.stackTotal,{unit:l,format:a,sign:s.signed});E(N,w==="always")&&m.push(S("total",N,t.stackTotal<0,{...r,weight:600}))}return m}return b==="inside"?(C&&m.push(this.#d(c,t,{left:d,top:p,width:f,height:_},n,g,r)),m):(E(c)&&m.push(S("value",c,g,r)),m)}#E(t,e,s,n,i,r,a,l){const c=at.#s;return i?{key:t,data:s.data,text:e,halo:!0,x:r?n.left-c:n.left+n.width+c,y:n.top+n.height/2,anchor:r?"end":"start",baseline:"central",font:a,color:l}:{key:t,data:s.data,text:e,halo:!0,x:n.left+n.width/2,y:r?n.top+n.height+c:n.top-c,anchor:"middle",baseline:r?"hanging":"auto",font:a,color:l}}#d(t,e,s,n,i,r){const a=at.#s,l=this.#_(e);return n?{key:"value",data:e.data,text:t,x:i?s.left+a:s.left+s.width-a,y:s.top+s.height/2,anchor:i?"start":"end",baseline:"central",font:r,color:l}:{key:"value",data:e.data,text:t,x:s.left+s.width/2,y:i?s.top+s.height-a:s.top+a,anchor:"middle",baseline:i?"auto":"hanging",font:r,color:l}}#_(t){const{colors:e,colorsIsAlreadyMapped:s}=this._getTraceColors();return Q.getContrastingInk(this._getTraceColor(t,e,s),at.#n)}_handlePath(t){return t.attr("id",({id:e})=>`${e}-path`),this.#a()?t.attr("fill",({id:e})=>`url(#${e}-gradient)`):this._setTraceColor(t,"fill"),t.attr("d",(e,s,n)=>{let i=window.d3.select(n[s]),r=parseFloat(i.attr("data-position-x")),a=parseFloat(i.attr("data-position-y")),l=parseFloat(i.attr("data-position-width")),c=parseFloat(i.attr("data-position-height"));isNaN(r)&&(r=e.x),isNaN(a)&&(a=e.y+e.height),isNaN(l)&&(l=e.width),isNaN(c)&&(c=2);const h=this.#M(i,e.style.radius);return Ot.roundedRectangleShape(r,a,l,c,e.style.round,h)}).attr("opacity",e=>this._opacity(e?.data,0)).attr("data-position-height",({height:e})=>e).attr("data-position-width",({width:e})=>e).attr("data-position-x",({x:e})=>e).attr("data-position-y",({y:e})=>e),this._axisMeta(t),this._events(t),this._transition(t).attr("d",({x:e,y:s,width:n,height:i,style:r})=>Ot.roundedRectangleShape(e,s,n,i,r.round,r.radius)).attr("opacity",e=>this._opacity(e?.data)).on("end",(e,s,n)=>{const i=window.d3.select(n[s]);this.#k(i,e.style.radius)})}_fromAreas(t){return this.containers.layerContainer.selectAll("path.plotter-trace-group-path").remove(),this.update()}_fromLines(t){return this.containers.layerContainer.selectAll("path.plotter-trace-group-path").remove(),this.update()}#C(t){const s=this.getConfiguration().gradient||{},n=s?.orientation==="horizontal",i=s?.orientation==="vertical",r=s?.scale==="plot",a=this._getMetricAxis(),{colors:l,colorsIsAlreadyMapped:c}=this._getTraceColors();return t=t.attr("class",`plotter-bar-gradient-${this.trace.id}`).attr("id",({id:h})=>`${h}-gradient`).attr("x1",(n?s?.left:"0")+"%").attr("x2",(n?s?.right:"0")+"%").attr("y1",(i?s?.top:"0")+"%").attr("y2",(i?s?.bottom:"0")+"%").attr("gradientUnits",r?"userSpaceOnUse":"objectBoundingBox").each((h,u,d)=>{const p=window.d3.select(d[u]),f=[{className:"start",offset:0,color:_=>this._getTraceColor(_,l,c),opacity:({data:_})=>_[a.value]<0?.5:1,data:h},{className:"end",offset:100,color:_=>this._getTraceColor(_,l,c),opacity:({data:_})=>_[a.value]<0?1:.5,data:h}];p.selectAll("stop").data(f).join(_=>this.#S(_.append("stop")),_=>this.#S(_),_=>_.remove())}),t}#S(t){return t.attr("class",({className:e})=>e).attr("offset",({offset:e})=>e+"%").attr("stop-color",e=>e.color(e.data)).attr("stop-opacity",e=>e.opacity(e.data))}#g(t){if(!t)return;const{dimensionAxis:e,metricAxis:s}=this.#w();if(["top","bottom"].includes(s.position)){const i=this.#B(t),r=this.#$(t);return Math.min(i,r)}return e.for(t,e.value)}#f(t){if(!t)return;const{dimensionAxis:e,metricAxis:s}=this.#w();return["top","bottom"].includes(s.position)?e.for(t,e.value):this.#B(t)}#x(t){const e=this.trace.overlayWidthRatio;if(!this.trace.overlay||e==null)return 1;const s=Number(typeof e=="function"?e(t):e);return Number.isFinite(s)&&s>0&&s<1?s:1}#v(t,e=1){if(!t)return;const{dimensionAxis:s,metricAxis:n}=this.#w();return["top","bottom"].includes(n.position)?Math.abs(this.#F(t)):s.size(t,e)}#D(t,e=1){if(!t)return;const{dimensionAxis:s,metricAxis:n}=this.#w();return["top","bottom"].includes(n.position)?s.size(t,e):this.#F(t)}#B(t){const{metricAxis:e}=this.#w();return e.for(t,e.upper||e.value)}#$(t){const{metricAxis:e}=this.#w(),s=!e.lower;let n;if(s)if(e.start!=null){const r=t[e.value]>e.start,a=t[e.value]<0,l=e.start<0,c=t[e.value]>0,h=e.start>=0;if(r){const u=l&&c,d=l&&e.start<t[e.value];u||d?n=0:h&&(n=e.start)}else a&&(n=0)}else if(t[e.value]<0)n=0;else{const a=Math.min(...e.domain);a<0?n=0:n=a}return e.for(t,e.lower,{forceValue:n})}#F(t){const e=this.#B(t);return this.#$(t)-e}#w(){const t=this.trace.scales.x.getScale(),e=this.trace.scales.y.getScale(),s=this.plot.layer?.dimensions||[],n=s.includes(t.value),i=s.includes(e.value);if(n&&!i)return{dimensionAxis:t,metricAxis:e};if(i&&!n)return{dimensionAxis:e,metricAxis:t};const r=t.type==="discrete"||t.isDate,a=e.type==="discrete"||e.isDate;return r&&!a?{dimensionAxis:t,metricAxis:e}:a&&!r?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#G(t,e,s){const n=kt,i=["left","right"].includes(t);return s===0?{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n}:i?s>0?{topLeft:e,topRight:e,bottomLeft:n,bottomRight:n}:{topLeft:n,topRight:n,bottomLeft:e,bottomRight:e}:s<0?{topLeft:n,topRight:e,bottomLeft:n,bottomRight:e}:{topLeft:e,topRight:n,bottomLeft:e,bottomRight:n}}#N(t,e,s,n){const i=kt,r={topLeft:i,topRight:i,bottomLeft:i,bottomRight:i},a=["left","right"].includes(t);return s&&(a?(r.topLeft=e,r.topRight=e):(r.topRight=e,r.bottomRight=e)),n&&(a?(r.bottomLeft=e,r.bottomRight=e):(r.topLeft=e,r.bottomLeft=e)),r}#R(t,e){if(!e)return!0;const s=t?.data?.plotter?.neighbors,n=t?.data?.plotter?.neighborsIndex;if(s==null||n==null)return!0;const i=s.filter(r=>r).length;return n===i-1}#M(t,e){const s=parseFloat(t.attr("data-radius-tl")),n=parseFloat(t.attr("data-radius-tr")),i=parseFloat(t.attr("data-radius-bl")),r=parseFloat(t.attr("data-radius-br"));return isNaN(s)?e:{topLeft:s,topRight:n,bottomLeft:i,bottomRight:r}}#k(t,e){t.attr("data-radius-tl",e.topLeft).attr("data-radius-tr",e.topRight).attr("data-radius-bl",e.bottomLeft).attr("data-radius-br",e.bottomRight)}}class jc extends Ot{_getPoints(){return this.#h(this.computed.data,this.trace.calendar.on,this.trace.calendar.type).map((e,s)=>e.map((n,i)=>n.map((r,a)=>r.map(l=>{const c=this.#n(l),h=this.#i(l),u=this.#r(l),d=this.#s(),p=this.computed.data.flat(2).filter(f=>f?.data&&f.data[this.trace.calendar.on]===l.data[this.trace.calendar.on]);return{...l,meta:{eventsOneSameDay:p},marker:{dimensionCoord:c,metricCoord:h,dimensionSize:d},cursor:{dimensionCoord:c,metricBase:u,metricEnd:h},position:{x:s,y:i,z:a}}}))))}_computeLineGradientData(){const t=this.trace.scales.x.getScale(),e=t._valueType==="continuous"?t.value:t.stack;return this.computed.data.map((s,n)=>{const i=s.filter(a=>{if(t.stack){const l=t._getDistribution();let c;return n<t.stackDomain.length?c=t.stackDomain[n]:c=t.stackDomain[t.stackDomain.length-1],Array.isArray(a)?a.every(u=>{const d=u.data[e];return l[d]?.includes(c)}):l[a].includes(c)}return!0}),r=i.flatMap(a=>Array.isArray(a)?a.map(l=>l.data[e]):a).unique();return i.flatMap(a=>{let l;if(Array.isArray(a)){const{colors:c,colorsIsAlreadyMapped:h}=this._getTraceColors();a.forEach(u=>{l=this._getTraceColor(a,c,h),u[this.trace.calendar.on]=u.data[this.trace.calendar.on],u.color=l,u.position=t.for(u),u.index=r.indexOf(u.data[e]),u.unique=r,u.percentage=u.index/(u.unique.length-1)*100})}else{const c=this.trace.refer.length>1?this.trace.refer[n]:this.trace.refer[0],h=this.plot.instances[c.id],u=h.computed.data.length<=n?0:n,p="g-"+(h.computed.data[u].filter(_=>_)[0].group||"default").hash()+`-t-${h.trace.id}-element-path`,f=d3.select("#"+p);f?.node()&&(l=f.attr("stroke")),a={[this.trace.calendar.on]:a,color:l,percentage:r.indexOf(a)/(r.length-1)*100},a.position=t.for(a),a.color=l}return a}).flatMap((a,l,c)=>{let h=c[l-1];return Array.isArray(h)&&(h=h[h.length-1]),l>0&&h.color!==a.color?[{...h,position:a.position,percentage:a.percentage},a]:a})})}_clipPath(t=!1){return super._clipPath(t)}_gradients(t){if(this.trace.gradients?.display){const e=this.trace.scales.x.getScale(),s=this._computeLineGradientData(),n=this.computed.data.map((i,r)=>{const a=this.trace.refer.length>1?this.trace.refer[r]:this.trace.refer[0],l=this.plot.instances[a.id],c=`linear-gradient-${this.trace.id}-${r}`;let h=r;r>l.computed.groups.length-1&&(h=l.computed.groups.length-1);const u=l.computed.data[h].filter(p=>p)[0],d=l.computed.data[h].slice().reverse().find(p=>p);return{layer:l,row:u,firstRow:u,lastRow:d,id:c,x1:e.for(u.data),x2:e.for(d.data)}});return this.containers.gradients=this.plot.__nodes__.defs.selectAll(".plotter-event-gradient").data(this.computed.data,(i,r)=>r+"-"+i.length).join(i=>this.#y(i,{referringRowForGroups:n,stopsData:s}),i=>this.#L(i,{referringRowForGroups:n,stopsData:s}),i=>this.#T(i)),this.containers.gradients}}_handleBrushEnd(){const t=this._brushElements.filter(s=>s&&typeof s!="string"&&s.data);if(!t.length)return this.logger?.info("Plotter - Brush : ignored because selection only contains holes"),Promise.resolve();let e=t.map(s=>s.data);return this.computed.zoomData=e,this.logger?.info("Plotter - Brush : applying new data to scales"),Object.values(this.trace.scales).forEach(s=>{s.brushData=e;let n=s.getScale();n.init(),this.plot.__axis__[n.name]&&(this.plot.__axis__[n.name].setScale(n),this.plot.__axis__[n.name].update())}),this.logger?.info("Plotter - Brush : updating traces"),this.update(1)}_handleBrush(t,e="opacity"){return new Promise(s=>{if(this.trace.type!=="areas"){if(t.selection){const n=this._getDimensionAxis();this._brushElements=this.computed.data.flatMap(i=>i.filter(r=>{let a;Array.isArray(r)?a=r[0]:a={data:{[this.trace.calendar.on]:r}};const l=n.for(a.data);return l>t.selection[0]&&l<t.selection[1]}).flat())}s()}})}_handlePath(t){return t.selectAll("path.plotter-trace-element-path").data(e=>e).join(e=>this.#a(e.append("path")),e=>this.#a(e),e=>e.remove()),this.trace.cursors?.display&&t.selectAll("path.plotter-trace-element-cursor").data(e=>e).join(e=>this.#l(e.append("path")),e=>this.#l(e),e=>e.remove()),t}_handlePaths(t){return t.selectAll("g.plotter-trace-element-type").data(e=>e).join(e=>this._handlePath(e.append("g").attr("class","plotter-trace-element-type")),e=>this._handlePath(e),e=>e.remove())}_handleTrace(t){return t.selectAll("g.plotter-trace-element-date").data(e=>[e]).join(e=>this._handlePaths(e.append("g").attr("class","plotter-trace-element-date")),e=>this._handlePaths(e),e=>e.remove())}#t(){const t=this.trace.scales.x.getScale(),e=this.trace.scales.y.getScale(),s=this.trace.calendar?.on;return e.value===s&&t.value!==s?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#e(){const{dimensionAxis:t}=this.#t();return["left","right"].includes(t.position)}#s(){const{dimensionAxis:t}=this.#t();return this.trace.calendar.on===t.stack?t._elementSize:t._stackElementSize||t._elementSize}#n(t){const{dimensionAxis:e}=this.#t();return e.for(t.data)}#r(t){const{metricAxis:e}=this.#t(),s=this.trace.area?.mode||this.plot.layer.configuration?.events?.area?.mode||"full",n=this.trace.area?.position||this.plot.layer.configuration?.events?.area?.position;return s==="value"&&n==="top"?e.for(t.data):e.range[0]}#i(t){if(!t)return;const{metricAxis:e}=this.#t(),s=this.trace.area?.display||this.plot.layer.configuration?.events?.area?.display,n=this.trace.line?.display||this.plot.layer.configuration?.events?.line?.display;if(s){const i=this.trace.area?.mode||this.plot.layer.configuration?.events?.area?.mode,r=this.trace.area?.position||this.plot.layer.configuration?.events?.area?.position;if(i==="value")return r==="top"?e.range[e.range.length-1]:e.for(t.data);if(i==="full")return e.range[e.range.length-1]}else if(n){const i=this.trace.line?.mode||this.plot.layer.configuration?.events?.line?.mode,r=this.trace.line?.position||this.plot.layer.configuration?.events?.line?.position,a=this.trace.line?.size||this.plot.layer.configuration?.events?.line?.size||1;return i==="value"?e.for(t.data):r==="top"?Math.min(...e.range)+a:Math.max(...e.range)-a}}#a(t){const{dimensionAxis:e}=this.#t(),s=this.#e(),n=this.trace?.marker?.size||this.plot.layer.configuration?.events?.marker?.size||e._elementSize;return t.attr("class","plotter-trace-element-path").attr("id",i=>`marker-${String(i[0].data[this.trace.calendar.on]).hash()}-${String(i[0].data[this.trace.calendar.type]).hash()}`).attr("d",i=>{const r=i[0],a=1-this.plot.layer.configuration.axis.ratioOfElementSize,l=(n+n/3)*r.position.z,c=e._elementSize*a,{dimensionCoord:h,metricCoord:u,dimensionSize:d}=r.marker;return s?Ot.roundedRectangleShape(u+l,h-c,n,d):Ot.roundedRectangleShape(h-c,u+l,d,n)}).attr("stroke",0).attr("opacity",()=>this.trace.marker?.opacity||this.plot.layer.configuration?.events?.marker?.opacity),this._setTraceColor(t,"stroke"),this._setTraceColor(t,"fill"),this._events(t),t}#l(t){const{dimensionAxis:e}=this.#t(),s=this.#e(),n=this.trace?.marker?.size||this.plot.layer.configuration?.events?.marker?.size||e._elementSize;return t.attr("class","plotter-trace-element-cursor").attr("d",i=>{const r=i[0],a=(n+n/2)*r.position.z,{dimensionCoord:l,metricBase:c,metricEnd:h}=r.cursor;return s?this.computed.fLine([{x:c,y:l},{x:h+a,y:l}]):this.computed.fLine([{x:l,y:c},{x:l,y:h+a}])}).attr("opacity",()=>this.trace.line?.opacity||this.plot.layer.configuration?.events?.line?.opacity),this._setTraceColor(t,"stroke"),this._setTraceColor(t,"fill"),t}#h(t,e,s){if(!Array.isArray(t)||t.length===0)return[];const n=r=>{const a={};for(const l of r){const c=l?.data[s],h=c!=null?String(c):"";a[h]||(a[h]=[]),a[h].push(l)}return a},i=r=>{if(!Array.isArray(r))return[];const a=new Map;for(const u of r){const d=typeof u=="string",p=Array.isArray(u)&&u.length>0&&typeof u[0]=="object";if(!d&&p){const _=u[0]?.data[e];if(_==null)continue;const g=String(_),m=n(u);if(Object.keys(m).length===0)continue;a.has(g)||a.set(g,{});const y=a.get(g);for(const[b,A]of Object.entries(m))y[b]||(y[b]=[]),y[b].push(...A)}}if(a.size===0)return[];const l=Array.from(a.keys()).sort();let c=[];return l.map(u=>{const d=a.get(u),p=Object.keys(d),f=new Set(p),_=[],g=new Set;for(const m of c)f.has(m)&&(_.push(m),g.add(m));for(const m of p)g.has(m)||_.push(m);return c=_,_.map(m=>d[m])})};return t.map(r=>i(r))}#p({linearGradient:t,stops:e},{referringRowForGroups:s,groupIndex:n}){const i=s[n],r=this.plot.layer.configuration?.events?.line?.mode;if(r==="value"||r==="both"){const c="g-"+(i.row.group||"default").hash()+`-t-${i.layer.trace.id}-element-path`,h=d3.select("#"+c);h?.node()&&h.style("stroke",()=>`url(#${i.id})`)}let l=i.id;t.attr("id",()=>l).attr("x1",(c,h)=>s[h].x1+"px").attr("x2",(c,h)=>s[h].x2+"px").attr("gradientUnits","userSpaceOnUse").attr("class","plotter-event-gradient"),e.attr("id",(c,h)=>l+"-stop-"+h).attr("class","plotter-events-gradient-break").attr("offset",c=>`${c.percentage}%`).attr("stop-color",c=>c.color)}#y(t,{referringRowForGroups:e,stopsData:s}){const n=t.append("linearGradient");return n.each((i,r,a)=>{const l=d3.select(a[r]),c=l.selectAll("stop").data(s[r],(h,u)=>r+"-"+u+"-"+(Array.isArray(h)?h[0]?.data?.id||h[0]?.id:h)).enter().append("stop");this.#p({linearGradient:l,stops:c},{referringRowForGroups:e,groupIndex:r})}),n}#L(t,{referringRowForGroups:e,stopsData:s}){return t.each((n,i,r)=>{const a=d3.select(r[i]),l=a.selectAll("stop").data(s[i],(c,h)=>i+"-"+h+"-"+(Array.isArray(c)?c[0]?.data?.id||c[0]?.id:c));this.#p({linearGradient:a,stops:l},{referringRowForGroups:e,groupIndex:i})}),t}#T(t){return t.remove()}}class Ts extends Ot{_supportsDimensionBrush(){return!1}_handleBrush(){return Promise.resolve()}_handleBrushEnd(){return Promise.resolve()}_flattenHierarchyRows(t){const e=[],s=Array.isArray(t)?t:[],n=i=>{if(!i)return;e.push(i);const r=Array.isArray(i.children)?i.children:[];for(let a=0;a<r.length;a++)n(r[a])};for(let i=0;i<s.length;i++)n(s[i]);return e}_filterVisibleRows(t){const e=Array.isArray(t)?t:[],s=[];for(let n=0;n<e.length;n++){const i=e[n],r=(this.trace?.if||(()=>!0))(i,n,e),a=(this.trace._if||(()=>!0))(i,n,e);r&&a&&s.push(i)}return s}_getHierarchyStableRowIdentifier(t,e){if(!t)return`hierarchy-row-${e}`;const s=t.id??t.unique??t.branchKey??t.hierarchyPath??t.path??t.key;if(s!=null)return String(s);const n=[],i=[t.Level_00,t.Level_01,t.Level_02,t.Filter,t.Type,t.text];for(let r=0;r<i.length;r++){const a=i[r];a!=null&&n.push(String(a))}return n.length?n.join("|"):`hierarchy-row-${e}`}_getHierarchyTransitionTraceId(t=null){return String(t||this.trace?.id||"plotter-hierarchy").replace(/waterfall|tree/g,"hierarchy")}_getHierarchyRowInteractionKey(t,e=0){if(!t)return null;const s=this.trace?.identify;if(typeof s=="function"){const n=s(t);if(n!=null&&n!=="")return String(n)}return this._getHierarchyStableRowIdentifier(t,e)}_isElementDatumForHierarchyRow(t,e){if(!t||!e)return!1;const s=t.data??t;if(s===e)return!0;const n=this._getHierarchyRowInteractionKey(e,0),i=this._getHierarchyRowInteractionKey(s,0);return n==null||i==null?!1:n===i}_resolveElementDatumForHierarchyRow(t){if(!t||!this.containers?.layerContainer)return null;const e=this.containers.layerContainer.selectAll("path.plotter-trace-element-path");if(!e||typeof e.each!="function"||e.empty?.())return null;let s=null;return e.each(n=>{s||this._isElementDatumForHierarchyRow(n,t)&&(s=n)}),s}}const p1=6,f1="rgb(120, 120, 120)",_1=1,g1="6,4",Uc=.2,Yc=.48,m1=5,he=8,y1=2,kn="#1f2937",b1=1.5,A1=3,L1=1.25,Kc=3,Nt=8,Nn=6,Mn=1,T1="4,3",E1="0,0",x1="2,3",Xc=10;class Ge extends Ts{_configurationKey="waterfall";_traceName="waterfall";_overlayHideNonReferenceGroups=!1;update(t=0){return this._join(t)}_join(t=0){return new Promise(e=>{const s=this._getPoints();this._layer(),this.containers.layerContainer.attr("clip-path",null),this.containers.layerContainer.selectAll("line.plotter-tree-connector, path.plotter-tree-connector").remove(),this.containers.layerContainer.selectAll("text.plotter-tree-prefix, text.plotter-tree-suffix").remove(),this._gradients(s),this._masks(s),this.containers.layerContainer.selectAll("g.plotter-trace-group").data(s).join(n=>this._handleTrace(n.append("g").attr("class","plotter-trace-group")),n=>this._handleTrace(n),n=>n.remove()),setTimeout(()=>e(),this.transition)})}_getPoints(t=null){const e=this._getMetricAxis(),s=this.#Rt(e),n=this.#_();this._parentBorderDepthRange=this.#h(n);const i=this._filterVisibleRows(n);this.#A(i);const r=this.#V(i,e,s);this.#H(r);const a=e.getWaterfallSplitTopPaddingMap?.()??null,l=this.#V(i,e,s,a);this.#o(l);const c=this.#H(l);let h=c;if(this.#c()){const d=this.#m();d.splitKey&&d.referenceValue!=null&&(h=c.filter(f=>f?.data?.[d.splitKey]===d.referenceValue))}l.valueLabels=this.#et(h);let u=l;if(this.#c()){const d=this.#m();d.splitKey&&d.referenceValue!=null&&(u=l.filter(f=>f?.data?.[d.splitKey]===d.referenceValue))}return l.topLineLabels=this.#gt(u,l,l.valueLabels),[l]}_handleTrace(t){return t.each((e,s,n)=>{const i=window.d3.select(n[s]),r=[];for(let a=0;a<e.length;a++)e[a]&&r.push(e[a]);r.valueLabels=Array.isArray(e?.valueLabels)?e.valueLabels:[],r.topLineLabels=Array.isArray(e?.topLineLabels)?e.topLineLabels:[],i.selectAll("g.plotter-trace-element").data(r,a=>a.id).join(a=>this._handlePaths(a.append("g").attr("class","plotter-trace-element")),a=>this._handlePaths(a),a=>a.remove()),this.#c()&&i.selectAll("g.plotter-trace-element").sort((a,l)=>{const c=a?.overlayGroupIndex??0;return(l?.overlayGroupIndex??0)-c}),this.#At(i,r),this.#Mt(i,r),this.#wt(i,r)}),t}_handlePath(t){return t.each((e,s,n)=>{const i=window.d3.select(n[s]),r=i.attr("d"),a=this.#Ft(i);n[s].__plotterMorphStartD=a&&r?r:null,n[s].__plotterHadPreviousVisualState=a}),t.attr("id",({id:e})=>`${e}-path`).attr("fill",(e,s,n)=>this.#kt(n[s],"fill",this.#mt(e.data).fill)).attr("fill-opacity",(e,s,n)=>this.#Pt(n[s],"fill-opacity",this.#mt(e.data).fillOpacity)).attr("stroke",(e,s,n)=>this.#kt(n[s],"stroke",this.#mt(e.data).stroke)).attr("stroke-opacity",(e,s,n)=>this.#Pt(n[s],"stroke-opacity",this.#mt(e.data).strokeOpacity)).attr("stroke-width",(e,s,n)=>this.#Pt(n[s],"stroke-width",this.#mt(e.data).strokeWidth)).attr("stroke-dasharray",(e,s,n)=>this.#kt(n[s],"stroke-dasharray",this.#mt(e.data).strokeDasharray)).attr("d",(e,s,n)=>{if(n[s].__plotterMorphStartD)return n[s].__plotterMorphStartD;const i=window.d3.select(n[s]),r=this.#Zt(i,e),a=i.attr("data-style-key")||e.style.key,l=parseFloat(i.attr("data-style-radius")),c=$e(Number.isFinite(l)?l:e.style.radius);return Ge.roundedRectangleShape(r.x,r.y,r.width,r.height,{[a]:!0},{[a]:c})}).attr("opacity",e=>this._opacity(e?.data,0)*this.#E(e?.data)).attr("data-position-height",({height:e})=>e).attr("data-position-width",({width:e})=>e).attr("data-position-x",({x:e})=>e).attr("data-position-y",({y:e})=>e).attr("data-style-radius",({style:e})=>e.radius).attr("data-style-key",({style:e})=>e.key).attr("data-step",e=>e?.data?.Level_00??null).attr("data-segment",e=>{const s=e?.data,n=s?.Segment??s?.Level_02??s?.Level_01;return n!=null&&String(n).length>0?String(n):null}).attr("data-row-id",e=>e?.data?.unique??e?.data?.id??null).attr("data-comparison",e=>e?.data?._sourceTableKey??null).each((e,s,n)=>{const i=window.d3.select(n[s]),r=!n[s].__plotterHadPreviousVisualState;i.attr("data-plotter-waterfall-entering",r?"1":"0").attr("opacity",r?0:this._opacity(e?.data,0)*this.#E(e?.data)),delete n[s].__plotterMorphStartD,delete n[s].__plotterHadPreviousVisualState}),this._axisMeta(t),this._events(t),this._transition(t).attr("fill",e=>this.#mt(e.data).fill).attr("fill-opacity",e=>this.#mt(e.data).fillOpacity).attr("stroke",e=>this.#mt(e.data).stroke).attr("stroke-opacity",e=>this.#mt(e.data).strokeOpacity).attr("stroke-width",e=>this.#mt(e.data).strokeWidth).attr("stroke-dasharray",e=>this.#mt(e.data).strokeDasharray).attr("d",({x:e,y:s,width:n,height:i,style:r})=>Ge.roundedRectangleShape(e,s,n,i,{[r.key]:!0},{[r.key]:$e(r.radius)})).attr("opacity",e=>this._opacity(e?.data)*this.#E(e?.data)).on("end",(e,s,n)=>{window.d3.select(n[s]).attr("data-plotter-waterfall-entered","1").attr("data-plotter-waterfall-entering","0")})}_transition(t,{transition:e=this.transition,fn:s=window.d3.easeExp,sceneDurationRatio:n=1,elementDelayDurationRatio:i=.25}={}){return t.transition().delay((function(r,a,l){if(!r||Array.isArray(r)&&!r.length)return 0;let h=0;const d=(Array.isArray(r)?r.filter(_=>_)[0]:r)?.data,f=l?.[a]?.getAttribute("data-plotter-waterfall-entering")==="1";if(d){const{plotter:_}=d,g=this.trace.transition?.by==="row",m=this.trace.transition?.by==="group";if(g?h=i/_?.group?.length*_?.rowIndex:m&&(h=i/_?.group?.length*_?.groupIndex),f){const y=d.tick?.hierarchyDepth??d.hierarchyDepth??d.depth??0,b=Number.isFinite(y)?Math.max(0,y):0,A=e/2*b;h+=A}}return h}).bind(this)).duration(e/n).ease(s)}_gradients(t){return!0}_fromAreas(t){return this.#Vt(),this.update()}_fromLines(t){return this.#Vt(),this.update()}_fromTree(){return this.containers?.layerContainer?.selectAll("path.plotter-tree-connector").remove(),this.containers?.layerContainer?.selectAll("foreignObject.plotter-tree-card-label-fo").remove(),this.containers?.layerContainer?.selectAll("text.plotter-tree-prefix, text.plotter-tree-suffix").remove(),this.update()}_handleClick(t,e){const s=e?.data;if(s?.__plotterAggregationPreCutTail===!0){super._handleClick(t,e);return}if(this.#x(s)){const n=this.#N(s);n&&n.__plotterAggregationExpanded!==!0&&this.#R(s)}this.#k(),super._handleClick(t,e)}_getDimensionAxis(){return this.#t().dimensionAxis}_getMetricAxis(){return this.#t().metricAxis}#t(){const t=this.trace.scales.x?.getScale(),e=this.trace.scales.y?.getScale();if(!t||!e)return{dimensionAxis:t||e,metricAxis:e||t};if(t.hierarchy&&!e.hierarchy)return{dimensionAxis:t,metricAxis:e};if(e.hierarchy&&!t.hierarchy)return{dimensionAxis:e,metricAxis:t};const s=this.plot?.layer?.dimensions||[],n=s.includes(t.value),i=s.includes(e.value);if(n&&!i)return{dimensionAxis:t,metricAxis:e};if(i&&!n)return{dimensionAxis:e,metricAxis:t};const r=t.type==="discrete"||t.isDate,a=e.type==="discrete"||e.isDate;return r&&!a?{dimensionAxis:t,metricAxis:e}:a&&!r?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#e(){const{dimensionAxis:t}=this.#t();return t?["left","right"].includes(t.position):!1}#s(){return this.#t().dimensionAxis}#n(){const{dimensionAxis:t}=this.#t();return t?this.trace.scales.x?.getScale?.()===t?this.trace.scales.x:this.trace.scales.y:this.trace.scales.x}#r(t){return!!(t?.hasChildren||t?.children?.length)}#i(t){return this.#r(t)&&t?.open!==!1}#a(t){return this.#r(t)?!(t.children||[]).some(e=>this.#r(e)):!1}#l(t){const e=(t?.children?.length??0)>1;return this.#i(t)&&this.#a(t)===!1&&e}#h(t){const e=Array.isArray(t)?t:[];let s=null,n=null;for(let i=0;i<e.length;i++){const r=e[i];if(!this.#l(r))continue;const a=this.#u(r);(s==null||a<s)&&(s=a),(n==null||a>n)&&(n=a)}return{minDepth:s??0,maxDepth:n??0}}#p(t){const e=this.#u(t),s=this._parentBorderDepthRange??{minDepth:0,maxDepth:0},{minDepth:n,maxDepth:i}=s;if(i<=n)return Yc;const r=(e-n)/(i-n);return Uc+r*(Yc-Uc)}#y(t){return t?this._flattenHierarchyRows([t]):[]}#L(t,e,s){const n=Array.isArray(t)?t:[],i=[];for(let a=0;a<n.length;a++){const l=n[a],c=l?.Type||l?.color;c!=="net"&&c!=="net_OoS"&&i.push(l)}if(!i.length)return null;const r=[];for(let a=0;a<i.length;a++){const l=i[a],c=l?.[e],h=l?.previousValue??l?.lower??s;c!=null&&r.push(c),h!=null&&r.push(h)}return r.length?{upper:Math.max(...r),lower:Math.min(...r)}:null}#T(t){const e=Array.isArray(t)?t:[];if(!e.length)return null;let s=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i++){const r=e[i],a=this.#xt(r),l=this.#Et(r,a),c=this.#St(r,a),h=l+c;l<s&&(s=l),h>n&&(n=h)}return!Number.isFinite(s)||!Number.isFinite(n)?null:{start:s,end:n}}#u(t){const e=Number(t?.depth);if(Number.isFinite(e)&&e>=0)return e;let s=0,n=t;for(;n?.parent;)s+=1,n=n.parent;return s}#c(){return this.plot?.layer?.configuration?.axis?.groupedAxes?.mode==="overlay"}#m(){const t=this._getMetricAxis(),e=this._getDimensionAxis(),s=t?.split||e?.split||null;if(!s)return{splitKey:null,referenceValue:null,splitValues:[]};const n=this.trace.scales.x?.getScale?.()===t?this.trace.scales.x:this.trace.scales.y,i=this.trace.scales.x?.getScale?.()===e?this.trace.scales.x:this.trace.scales.y,r=Array.isArray(n?._uniqueSplit)&&n._uniqueSplit.length?n._uniqueSplit:Array.isArray(i?._uniqueSplit)?i._uniqueSplit:[];return{splitKey:s,referenceValue:r.length?r[0]:null,splitValues:r}}#o(t){const e=this.#rt(t);if(!(e instanceof Map))return;const s=this.#m(),n=Array.isArray(t)?t:[],i=this.#e();for(let r=0;r<n.length;r++){const a=n[r],l=a?.data?.[s.splitKey],c=e.get(l)??0,h=c/Xc;a.overlayGroupIndex=h,i?(a.y+=c,a.dimensionStart+=c,Number.isFinite(a.dimensionSlotStart)&&(a.dimensionSlotStart+=c)):(a.x+=c,a.dimensionStart+=c,Number.isFinite(a.dimensionSlotStart)&&(a.dimensionSlotStart+=c))}}#A(t){if(!this.#c()){this._overlayHideNonReferenceGroups=!1;return}const e=this.#m(),s=e?.splitKey,n=e?.referenceValue;if(!s||n==null){this._overlayHideNonReferenceGroups=!1;return}const i=Array.isArray(t)?t:[];this._overlayHideNonReferenceGroups=i.some(r=>{const a=r?.[s]===n,l=this.#i(r);return a&&l})}#E(t){if(!this.#c())return 1;const e=this.#m(),s=e?.splitKey,n=Array.isArray(e?.splitValues)?e.splitValues:[];if(!s||!n.length)return 1;const i=n.indexOf(t?.[s]);return i<0?1:this._overlayHideNonReferenceGroups&&i>0?0:Math.max(1-i*.33,.2)}#d(t,e,s,n){const i=Array.isArray(t)?t:[],r=new Set((Array.isArray(e)?e:[]).map(h=>h?.id||h)),a=s+n;let l=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY;for(let h=0;h<i.length;h++){const u=i[h],d=u?.id||u;if(r.has(d))continue;const p=this.#xt(u),f=this.#Et(u,p),_=this.#St(u,p),g=f+_;if(g<=s){l=Math.min(l,Math.max(s-g,0));continue}f>=a&&(c=Math.min(c,Math.max(f-a,0)))}return{previousGap:l,nextGap:c}}#_(){const t=this._getMetricAxis().value,e=this.#C(),s=this.#F(e,t);return this.#g(s),this.#S(s)}#C(){const t=this.plot?.__parameters__?.parent?.__parameters__?.data;if(Array.isArray(t))return t;if(Array.isArray(this.data))return this.data;const e=this._getDimensionAxis();return Array.isArray(e?.data)?e.data:[]}#S(t){const e=[],s=i=>{if(!i)return;e.push(i);const r=Array.isArray(i.children)?i.children:[];for(let a=0;a<r.length;a++)s(r[a])},n=Array.isArray(t)?t:[];for(let i=0;i<n.length;i++)s(n[i]);return e}#g(t){const e=this.#n();if(!e?.hierarchy)return;e._sourceData=t,e.init();const s=e.getScale(),n=this.trace?.axis?.[s?.name];n?.setScale&&(n.setScale(s),n.update())}#f(){const t=this.plot?.layer?.configuration?.axis?.hierarchical||{},e=Number(t.elementsThreshold),n=Number.isFinite(e)&&e>0?Math.floor(e):p1,i=t.aggregationName??"Remaining";return{elementsThreshold:n,aggregationName:i}}#x(t){return!!t?.__plotterAggregationRow}#v(t,e=0){const s=this.trace?.identify;if(typeof s=="function"){const i=s(t);if(i!=null&&String(i).length>0)return String(i)}return this._getHierarchyStableRowIdentifier(t,e)}#D(t,e){if(!t||this.#x(t)||(Array.isArray(t.children)?t.children:[]).length>0)return!1;const n=this.trace?.aggregable;return typeof n=="function"?n(t)!==!1:e>0}#B(t,e){const s=Number(t?.[e]),n=Number(t?.previousValue??t?.lower??0);return!Number.isFinite(s)||!Number.isFinite(n)?0:Math.abs(s-n)}#$(t,e,s,n,i,r){const a=Array.isArray(e)?e:[],l=Number(r?.depth),c=r?Number.isFinite(l)?l+1:1:0,h=Ge.resolveAggregationLayout(a.map(d=>({aggregable:this.#D(d,c),weight:this.#B(d,s)})),i);if(h==null)return a;const u=[];for(let d=0;d<h.length;d++){const p=h[d];if(p.type==="row"){u.push(a[p.indexes[0]]);continue}const f=u[u.length-1]??null;u.push(this.#w(r,f,p.indexes.map(_=>a[_]),s,n,t))}return u}static resolveAggregationLayout(t,e){const s=Array.isArray(t)?t:[],n=[];for(let h=0;h<s.length;h++)s[h]?.aggregable&&n.push(h);if(n.length<=e)return null;const i=[...n].sort((h,u)=>{const d=(s[u].weight||0)-(s[h].weight||0);return d!==0?d:h-u}),r=new Set(i.slice(0,Math.max(e,0))),a=[];let l=[];const c=()=>{l.length&&(a.push({type:l.length>1?"group":"row",indexes:l}),l=[])};for(let h=0;h<s.length;h++){if(s[h]?.aggregable&&!r.has(h)){l.push(h);continue}c(),a.push({type:"row",indexes:[h]})}return c(),a}#F(t,e){const{elementsThreshold:s,aggregationName:n}=this.#f(),i=Array.isArray(t)?t:[],r=u=>{const d=u.children??[];if(!(d.length>0)||u.__plotterAggregationPreCut===!0)return;let f=!1;for(let g=0;g<d.length;g++){const m=d[g],b=(Array.isArray(m?.children)?m.children:[]).length>0,A=this.#x(m);if(b&&!A){f=!0;break}}if(f){for(let g=0;g<d.length;g++)r(d[g]);return}const _=Array.isArray(u.__plotterAggregationSourceChildren)?u.__plotterAggregationSourceChildren:d.filter(g=>!this.#x(g));if(u.__plotterAggregationSourceChildren=_,u.__plotterAggregationExpanded===!0){u.children=_;return}u.children=this.#$(u,_,e,n,s,u)};i.forEach(u=>r(u));const a=Array.isArray(i.__plotterAggregationSourceChildren)?i.__plotterAggregationSourceChildren:i.filter(u=>!this.#x(u));if(i.__plotterAggregationSourceChildren=a,i.__plotterAggregationExpanded===!0)return a;const l=this.trace?.x?.split??this.trace?.y?.split??null;if(!l)return this.#$(i,a,e,n,s,null);const c=new Map;for(let u=0;u<a.length;u++){const d=a[u],p=String(d?.[l]??"");c.has(p)||c.set(p,[]),c.get(p).push(d)}const h=[];return c.forEach(u=>{h.push(...this.#$(i,u,e,n,s,null))}),h}#w(t,e,s,n,i,r=t){const a=s[0]||{},l=s[s.length-1]||{},c=a.previousValue??a.lower??a[n]??0,h=l[n]??c,u=h-c,d=u>0?"in":u<0?"out":"net",f=`${t?this.#v(t,0):"root"}|remaining|${this.#v(a,0)}`,_=s.find(b=>b.Level_02)?.Level_02;if(s.length===1)return s[0];const g=this.trace?.remain;let m=e;if(g){const b=g(s);b!=null&&(m=b)}const y=this.#G(t,e,s);return{...m,depth:y,id:f,unique:f,text:i,Level_02:_?.length?i:e?.Level_02??a.Level_02,previousValue:c,[n]:h,Type:d,color:d,children:[],hasChildren:!1,parent:t,__plotterAggregationRow:!0,__plotterAggregationHolder:r,__plotterAggregationChildren:s}}#G(t,e,s){const n=[e?.depth,s[0]?.depth,s[s.length-1]?.depth];for(let r=0;r<n.length;r++){const a=Number(n[r]);if(Number.isFinite(a))return Math.max(a,0)}const i=Number(t?.depth);return Number.isFinite(i)?Math.max(i+1,0):0}#N(t){return t?t.__plotterAggregationHolder??t.parent??this.#C():null}#R(t){const e=this.#N(t),s=e?.__plotterAggregationSourceChildren;return s?.length?(e.__plotterAggregationExpanded=!0,Array.isArray(e)||(e.children=s),!0):!1}#M(t){const e=this.#C();for(let s=t;s;s=s.parent){const n=s.parent??e;if(n?.__plotterAggregationExpanded===!0)return n}return null}canRegroupAggregation(t){return this.#M(t)!=null}regroupAggregation(t){const e=this.#M(t);return e?(e.__plotterAggregationExpanded=!1,this.#k(),!0):!1}#k(){if(typeof this.plot?._update=="function"){this.plot._update();return}this.update()}#Z(t,e,s,n,i,r=null){const{upper:a,lower:l,endValue:c,isNet:h}=this.#O(t,n,i),u=this.#xt(t),d=this.#e(),p=this.#y(t);let f=this.#Et(t,u),_=this.#St(t,u);const g=f,m=_;let y=n.for(t,n.value,{forceValue:a}),b=n.for(t,n.value,{forceValue:l});y=this.#I(y,t,n,r,d),b=this.#I(b,t,n,r,d);let A=n.for(t,n.value,{forceValue:c});A=this.#I(A,t,n,r,d);let L=Math.min(y,b),T=Math.max(y,b);if(this.#i(t)){const V=p.filter(pt=>pt!==t),H=V.filter(pt=>this.#It(pt)),U=H.length?H:V,j=this.#T(U);let z=null;j&&(f=j.start,_=Math.max(j.end-j.start,.5),z=this.#d(s,[t,...V],f,_));const Y=this.#j(t,f,_,u,j!=null,z),dt=!(d&&n?.split!=null&&n?.split!=="");f-=Y,_+=Y*2,dt&&(L-=Y,T+=Y)}const E=Math.max(_,.5),C=Math.max(T-L,.5),S=d?L:f,w=d?f:L,N=d?C:E,R=d?E:C,M=this.#i(t),k=this.getConfiguration(),I=$e(k?.bars?.rounded),O={key:"both",radius:M?10:I},F=this._getHierarchyTransitionTraceId(this.trace.id),P=this.#v(t,e),B={...t,id:P};return{x:S,y:w,width:N,height:R,id:`${F}-0-${P}`,groupIndex:0,index:e,data:B,style:O,upper:a,lower:l,endValue:c,isNet:h,connectorLength:u,reverse:d,dimensionStart:f,dimensionSpan:E,dimensionSlotStart:g,dimensionSlotSpan:m,metricStart:L,metricEnd:T,endMetricCoordinate:A}}#V(t,e,s,n=null){const i=[];for(let r=0;r<t.length;r++)i.push(this.#Z(t[r],r,t,e,s,n));return i}#H(t){const e=[];for(let s=0;s<t.length;s++){const n=t[s];this.#It(n?.data)&&e.push(n)}return e}#I(t,e,s,n,i){if(!(n instanceof Map)||n.size===0)return t;const r=s?.split,a=r!=null?e?.[r]:null;return typeof s.applyWaterfallSplitMetricPadding=="function"?s.applyWaterfallSplitMetricPadding(t,a,i):t}#O(t,e,s){const n=t.Type||t.color,i=n==="net"||n==="net_OoS",r=t[e.value],a=this.#y(t),l=this.#L(a,e.value,s);if((t.children||[]).length>0&&l)return{upper:l.upper,lower:l.lower,endValue:r,isNet:i};if(i){const u=this.#Bt(s);return{upper:Math.max(r,u),lower:Math.min(r,u),endValue:r,isNet:i}}const h=t.previousValue??t.lower??s;return{upper:Math.max(r,h),lower:Math.min(r,h),endValue:r,isNet:i}}#j(t,e,s,n,i=!1,r=null){const a=this.#u(t),l=this.#s(),c=Number(l?._hierarchyMaxDepth),h=Number.isFinite(c)?Math.max(c,a):a+1,u=Math.max(0,h-a),d=Math.max(m1,1),p=Math.max(d*.35,1),f=d+u*p,_=r?.previousGap??this.#lt(t.prev,e),g=r?.nextGap??this.#J(t.next,e,s),m=[];Number.isFinite(_)&&m.push(_),Number.isFinite(g)&&m.push(g);const y=m.length?Math.max(Math.min(...m)/2,0):Number.POSITIVE_INFINITY,b=i?Math.max(n*2,3):Math.max(n/2-.5,0),A=Math.min(y,b);return Math.min(f,A)}#lt(t,e){if(!t)return Number.POSITIVE_INFINITY;const s=this.#xt(t),n=this.#Et(t,s),i=this.#St(t,s);return Math.max(e-(n+i),0)}#J(t,e,s){if(!t)return Number.POSITIVE_INFINITY;const n=this.#xt(t),i=this.#Et(t,n);return Math.max(i-(e+s),0)}#tt(t){return Math.ceil(t*b1*A1)}#W(t={}){return Tn(t.size,pr)}#it(t={}){return Tn(t.size,ms)}#st(t,e,s){const n=this._computeTextRenderingWidth(String(t),{size:s,weight:e||500});return Math.ceil(n*L1)}#Q(t,e,s){const n=String(t);let i=null,r=1/0;for(let a=0;a<n.length;a++){if(n[a]!==" ")continue;const l=n.slice(0,a).trim(),c=n.slice(a+1).trim();if(!l||!c)continue;const h=this.#st(l,e,s),u=this.#st(c,e,s),d=Math.max(h,u);d>=r||(r=d,i=[l,c])}return i?{lines:i,widerWidth:r}:null}#P(t,e,s,n,i,r,a){const l=[],c=!s&&Number.isFinite(e.width)&&e.width>0;for(let h=0;h<t.length;h++){const u=t[h];if(u==null||String(u).length===0)continue;if(!c){l.push(String(u));continue}const d=e.width*Bg;if(this.#st(u,r,a)<=d){l.push(String(u));continue}const f=this.#Q(u,r,a);if(f&&(f.widerWidth<=d||n)){l.push(...f.lines);continue}i&&!n||l.push(String(u))}return l}#et(t){const s=this.getConfiguration().labels||{};if(s.display===!1)return[];const n=s.color,i=Number(s.weight)||500,r=this.#W(s),a=this.#tt(r),l=s.position,c=["value","top","bottom","middle"].includes(l)?l:"value",{colors:h,colorsIsAlreadyMapped:u}=this._getTraceColors(),d=this.#e(),p=zg(s),f=s.autoHide!==!1,_=[];for(let g=0;g<t.length;g++){const m=t[g];if(p!=null&&this.#u(m.data)>p)continue;const b=this.#Ot(m)>=0,A=m.data?.Type||m.data?.color,L=A==="net"||A==="net_OoS",T=this.#Ut(m,b,c),E=this.#zt(m.data,h,u),C=n??E,S=this.#Xt(m),w=this.#P(S,m,d,L,f,i,r),N=r+y1;for(let R=0;R<w.length;R++){const M=w[R],k=b?(w.length-R-1)*N:R*N,I=d?b?T+k:T-k:b?T-k:T+k,O=R===0,F=N+8,P=this.#st(M,i,r);let B,V,H,U,j,z;if(d){const Y=Math.max(O?m.width:F,P);U=Math.max(m.height,a),V=m.y+m.height/2-U/2,B=I-Y/2,H=Y,j=I,z=m.y+m.height/2}else{const Y=Math.max(m.height,a);H=Math.max(m.width,P),B=m.x+m.width/2-H/2,V=O?I-Y/2:I-F/2,U=O?Y:F,j=m.x+m.width/2,z=I}_.push({id:`${m.id}-value-label-${R}`,x:j,y:z,text:M,color:C,data:m.data,isPositive:b,foX:B,foY:V,foWidth:H,foHeight:U})}}return _}#rt(t){if(!this.#c())return null;const e=Array.isArray(t)?t:[];if(!e.length)return null;const s=this.#m();if(!s.splitKey)return null;const n=Array.isArray(s.splitValues)&&s.splitValues.length?s.splitValues:[];if(!n.length)for(let r=0;r<e.length;r++){const a=e[r]?.data?.[s.splitKey];n.includes(a)||n.push(a)}const i=new Map;for(let r=0;r<n.length;r++)i.set(n[r],r*Xc);return i}#ut(t,e){if(!(e instanceof Map))return 0;const s=this.#m(),n=t?.[s.splitKey];return e.get(n)??0}#z(t){const e=new Map,s=Array.isArray(t)?t:[];for(let n=0;n<s.length;n++){const i=s[n],r=this.#v(i?.data,i?.index??n);e.set(r,i)}return e}#U(t,e,s){const n=this.#e(),i=this.#v(t,0);let r=e.get(i);if(!r&&t?.unique!=null&&String(t.unique).length>0&&(r=e.get(String(t.unique))),r){const d=r.dimensionSlotStart,p=r.dimensionSlotSpan;return Number.isFinite(d)&&Number.isFinite(p)?d+p/2:n?r.y+r.height/2:r.x+r.width/2}const a=this.#xt(t),l=this.#Et(t,a),c=this.#St(t,a),h=this.#ut(t,s),u=Number(l)+Number(c)/2+h;return Number.isFinite(u)?u:0}#at(t,e,s){const n=t??{},i=Math.max(0,s-1-e);let r=n;for(let a=0;a<i;a+=1){const l=r?.parent;if(l==null)return n;r=l}return r}#ct(t,e=ms){if(t<0)return 0;const n=Tn(e,ms)+Kc;return n+t*Mn*n+Nt+Nn}#ot(t,e,s,n,i){const r=new Map,a=this.#e(),c={size:this.#it(i),weight:Number(i.weight)||600},h=this.#z(e),u=f=>(r.has(f)||r.set(f,{maxDepth:0,spanByDepth:new Map,textWidthByDepth:new Map}),r.get(f)),d=(f,_,g)=>{const m=u(f);m.maxDepth=Math.max(m.maxDepth,_);const y=Number.isFinite(g)&&g>0?g:0,b=m.spanByDepth.get(_)??0;m.spanByDepth.set(_,Math.max(b,y))},p=(f,_,g)=>{const m=u(f);m.maxDepth=Math.max(m.maxDepth,_);const y=g!=null?String(g):"";if(!y.length)return;const b=rt.computeRenderWidth(y,c),A=Number.isFinite(b)&&b>0?b:0,L=m.textWidthByDepth.get(_)??0;m.textWidthByDepth.set(_,Math.max(L,A))};for(let f=0;f<e.length;f++){const _=e[f],g=n?_?.data?.[s]:"__all__",m=this.#u(_.data),y=a?_.dimensionSlotSpan??_.height:_.dimensionSlotSpan??_.width;d(g,m,y)}for(let f=0;f<t.length;f++){const _=t[f],g=n?_?.data?.[s]:"__all__",m=this.#Ht(_);for(let y=0;y<m.length;y++){const b=m[y];if(!(b!=null&&String(b).length>0))continue;const L=this.#at(_.data,y,m.length),T=this.#u(L);p(g,T,b);const E=this.#v(L,0);let C=h.get(E);if(!C&&L?.unique!=null&&String(L.unique).length>0&&(C=h.get(String(L.unique))),C){const N=a?C.dimensionSlotSpan??C.height:C.dimensionSlotSpan??C.width;d(g,T,N);continue}const S=this.#xt(L),w=this.#St(L,S);d(g,T,w)}}return r.forEach((f,_)=>{const g=this.#b(e,_,s,n);f.maxDepth=Math.max(f.maxDepth,g)}),r}#Y(t,e,s){const n=e?.get(t),i=Number.isFinite(n)&&n>0?n:0;return Math.max(i,s)}#K(t,e,s,n){const i=Math.max(Number(t)||0,0),r=Math.max(Number(e)||0,i);let a=0;for(let l=i+1;l<=r;l+=1){const c=this.#Y(l,s,n);a+=c*Mn}return a}#b(t,e,s,n){const i=Array.isArray(t)?t:[];let r=0;for(let a=0;a<i.length;a+=1){const l=i[a],c=n?l?.data?.[s]:"__all__";if(n&&c!==e)continue;const h=this.#u(l?.data);r=Math.max(r,h)}return r}#ht(t,e){if(!t)return 0;const s=Math.max(Number(t.maxDepth)||0,0);let n=0;for(let i=0;i<=s;i+=1){const r=this.#Y(i,t.textWidthByDepth,e);n+=r*Mn}return n+Nt+Nn}#nt(t,e,s=-1){const n=this.#ft(t,e)??this.#yt(e,t);if(this.#_t(t,e)>0)return n;let r=this.plot?.getWaterfallTopLineReservedSpace?.()??0;if(r<=0&&s>=0){const a=this.#it(this.getConfiguration()?.topLine);r=this.#ct(s,a)}return r>0?n-r:n}#q(t,e,s){const n=t*e*Mn;return s+Nt+n}#gt(t,e,s){const i=this.getConfiguration().topLine||{};if(i.display===!1)return[];const r=i.color,a=this.#it(i),{colors:l,colorsIsAlreadyMapped:c}=this._getTraceColors(),u=i.position==="bottom-line"?"bottom-line":"top-line",d=this.#e(),p=this._getMetricAxis(),f=p?.split,_=f!=null&&f!=="",g=this.#rt(e),m=this.#z(e),y=new Map;for(let E=0;E<t.length;E++){const C=t[E],S=this.#Ht(C),w=_?C?.data?.[f]:"__all__";for(let N=0;N<S.length;N++){const R=S[N];if(!(R!=null&&String(R).length>0))continue;const k=this.#at(C.data,N,S.length),I=this.#u(k),O=y.get(w)??0;I>O&&y.set(w,I)}}const b=new Map;for(let E=0;E<e.length;E++){const C=e[E],S=_?C?.data?.[f]:"__all__",w=d?C.x+C.width:C.y,N=d?C.x:C.y+C.height,R=b.get(S);if(!R){b.set(S,{barMaxSideAnchor:w,barMinSideAnchor:N});continue}R.barMaxSideAnchor=d?Math.max(R.barMaxSideAnchor,w):Math.min(R.barMaxSideAnchor,w),R.barMinSideAnchor=d?Math.min(R.barMinSideAnchor,N):Math.max(R.barMinSideAnchor,N)}for(let E=0;E<s.length;E++){const C=s[E],S=_?C?.data?.[f]:"__all__",w=b.get(S)||b.get("__all__");if(!w)continue;const N=d?C.foX+C.foWidth:C.foY;w.labelsMaxSideAnchor=w.labelsMaxSideAnchor==null?N:d?Math.max(w.labelsMaxSideAnchor,N):Math.min(w.labelsMaxSideAnchor,N)}b.forEach(E=>{const C=E.labelsMaxSideAnchor??E.barMaxSideAnchor??0;E.topAnchor=d?C+Nn:C-Nn,E.barMinSideAnchor=E.barMinSideAnchor??0});const A=u==="top-line"&&d,L=A?this.#ot(t,e,f,_,i):null,T=[];for(let E=0;E<t.length;E++){const C=t[E],S=_?C?.data?.[f]:"__all__",w=b.get(S)||b.get("__all__")||{topAnchor:0,barMinSideAnchor:0},N=this.#Ht(C),R=N.length,M=a+Kc,k=u==="top-line"&&!d,O=(A?L?.get(S)??L?.get("__all__")??null:null)?.textWidthByDepth??new Map,F=Math.max(y.get(S)??0,this.#b(e,S,f,_));for(let P=0;P<N.length;P++){const B=N[P];if(!(B!=null&&String(B).length>0))continue;const H=this.#at(C.data,P,R),U=this.#u(H),j=A?this.#K(U,F,O,M):((y.get(S)??U)-U)*M;let z=0;if(k){const pe=this.#nt(C,p,F);z=this.#q(U,M,pe)}else{let pe=0;u==="top-line"&&d?pe=this.#dt(p,C,"max")+Nt:pe=u==="bottom-line"?d?w.barMinSideAnchor-Nt:w.barMinSideAnchor+Nt:d?w.topAnchor+Nt:w.topAnchor-Nt;const Cs=u==="bottom-line"?d?pe-j:pe+j:d?pe+j:pe-j,Jh=this.#ft(C,p),q0=this.#_t(C,p),J0=this.#yt(p,C);if(z=Cs,u==="top-line"&&!d)if(q0>0&&Jh!=null)z=Jh+Nt+j;else{const fe=J0+Nt;z=Math.max(Cs,fe)}else if(u==="top-line"&&d){const fe=this.#dt(p,C,"max"),tb=this.plot?.getWaterfallTopLineReservedSpace?.()??0,eb=fe+Math.max(tb,0)-Nt;z=Math.min(Cs,eb)}else if(u==="bottom-line"&&!d){const fe=this.#dt(p,C,"max");z=Math.min(Cs,fe-Nt)}else if(u==="bottom-line"&&d){const fe=this.#dt(p,C,"min");z=Math.max(Cs,fe+Nt)}}const Y=this.#U(H,m,g);let dt;r!=null?dt=r:typeof this.trace?.topLineColor=="function"?dt=this.#Kt(C.data,l,c):dt=this.#zt(H,l,c);const pt=d?z:Y,Wt=d?Y:z;let Ze="middle",vs="baseline";d&&(Ze=u==="bottom-line"?"end":"start",vs="middle"),T.push({id:`${C.id}-top-line-${P}`,x:pt,y:Wt,text:B,color:dt,data:C.data,textAnchor:Ze,alignmentBaseline:vs})}}return T}#ft(t,e){const s=t?.data??t,n=e?.split;let i=0;n!=null&&n!==""&&s?.[n]!=null&&(i=e.getSplitLag({[n]:s[n]}));const r=Array.isArray(e?.range)?e.range:[];if(!r.length)return null;const a=(r[0]??0)+i,l=(r[1]??0)+i;return Math.min(a,l)}#_t(t,e){const s=e?.getWaterfallSplitTopPaddingMap?.();if(!(s instanceof Map))return 0;const n=t?.data??t,i=e?.split;return i==null||i===""?0:s.get(n?.[i])??0}#dt(t,e,s="min"){const n=this.#e(),i=this.#ft(e,t);if(s==="min"&&i!=null)return i;const r=this.plot?._getRanges?.(),a=n?r?.horizontal:r?.vertical;if(Array.isArray(a))return s==="max"?Math.max(a[0],a[1]):Math.min(a[0],a[1]);const l=Array.isArray(t?.range)?t.range:[];return l.length?s==="max"?Math.max(l[0],l[1]):Math.min(l[0],l[1]):0}#yt(t,e){return this.#dt(t,e,"min")}#At(t,e){const n=this.getConfiguration().links||{};if(n.display===!1){t.selectAll("line.plotter-waterfall-connector").remove();return}const i=this._getMetricAxis(),r=this._getDimensionAxis(),a=i?.split||r?.split,l=this.#e(),c=[];for(let u=0;u<e.length;u++){const d=e[u],p=e[u+1],f=p!=null,_=d.data.Type!=="net_OoS",g=d.dimensionStart+d.dimensionSpan,m=f?p.dimensionStart:Number.NaN,y=f?m>g:!1,b=f?p.data?.parent===d.data||d.data?.parent===p.data:!1,A=a?d?.data?.[a]===p?.data?.[a]:!0;f&&_&&y&&b===!1&&A&&c.push({id:`${this.trace.id}-waterfall-connector-${u}`,start:g,end:m,crossAxis:d.endMetricCoordinate,reverse:l,source:d,overlayGroupIndex:d?.overlayGroupIndex??0,overlayOpacityFactor:this.#E(d?.data),color:n.color||"rgba(0,0,0,0.3)",opacity:Number.isFinite(Number(n.opacity))?Number(n.opacity):.5,width:Number.isFinite(Number(n.width))?Math.max(0,Number(n.width)):1,dasharray:this.#Yt(n.rendering)})}const h=t.selectAll("line.plotter-waterfall-connector").data(c,u=>u.id).join(u=>this.#vt(u.append("line").attr("class","plotter-waterfall-connector")),u=>this.#Ct(u),u=>u.transition().duration(this.transition/2).attr("opacity",0).remove());this.#c()&&h.sort((u,d)=>{const p=u?.overlayGroupIndex??0;return(d?.overlayGroupIndex??0)-p}).lower()}#vt(t){return t.attr("x1",e=>e.reverse?e.crossAxis:e.start).attr("x2",e=>e.reverse?e.crossAxis:e.start).attr("y1",e=>e.reverse?e.start:e.crossAxis).attr("y2",e=>e.reverse?e.start:e.crossAxis).attr("shape-rendering","crispEdges").attr("stroke",e=>e.color).attr("stroke-width",e=>e.width).attr("stroke-dasharray",e=>e.dasharray).attr("opacity",0),t.transition().duration(this.transition).ease(window.d3.easeExp).attr("x2",e=>e.reverse?e.crossAxis:e.end).attr("y2",e=>e.reverse?e.end:e.crossAxis).attr("opacity",e=>e.opacity*(e.overlayOpacityFactor??1))}#Ct(t){return t.transition().duration(this.transition).ease(window.d3.easeExp).attr("x1",e=>e.reverse?e.crossAxis:e.start).attr("x2",e=>e.reverse?e.crossAxis:e.end).attr("y1",e=>e.reverse?e.start:e.crossAxis).attr("y2",e=>e.reverse?e.end:e.crossAxis).attr("stroke",e=>e.color).attr("stroke-width",e=>e.width).attr("stroke-dasharray",e=>e.dasharray).attr("opacity",e=>e.opacity*(e.overlayOpacityFactor??1))}#Mt(t,e){const n=this.getConfiguration().labels||{},i=Number(n.opacity),r=Number.isFinite(i)?Math.max(0,Math.min(1,i)):1,a=this.#W(n),l=Array.isArray(e?.valueLabels)?e.valueLabels:[];t.selectAll("text.plotter-waterfall-value-label").remove(),t.selectAll("foreignObject.plotter-tree-card-label-fo").data(l,c=>c.id).join(c=>c.append("foreignObject").attr("class","plotter-tree-card-label-fo plotter-waterfall-value-label-fo").attr("x",h=>h.foX).attr("y",h=>h.foY).attr("width",h=>h.foWidth).attr("height",h=>h.foHeight).style("pointer-events","none").attr("opacity",0).each((h,u,d)=>{const p=window.d3.select(d[u]);this.#Lt(p,h,a,n),this.#Tt(p)}).call(h=>this._transition(h).attr("opacity",r)),c=>this._transition(c.attr("x",h=>h.foX).attr("y",h=>h.foY).attr("width",h=>h.foWidth).attr("height",h=>h.foHeight).each((h,u,d)=>{const p=window.d3.select(d[u]);this.#Lt(p,h,a,n),this.#Tt(p)})).attr("opacity",r),c=>c.remove())}#Lt(t,e,s,n){let i=t.select("div.plotter-tree-card-label-html");i.empty()&&(i=t.append("xhtml:div").attr("class","plotter-tree-card-label-html").style("width","100%").style("height","100%").style("display","flex").style("align-items","center").style("justify-content","center").style("text-align","center").style("line-height","1.2").style("overflow-wrap","anywhere").style("word-break","break-word").style("pointer-events","none")),i.style("font-size",`${s}px`).style("font-weight",Number(n.weight)||500).style("font-family",n.family||null).style("color",e.color||kn);let r=i.select("span.plotter-waterfall-value-label");r.empty()&&(r=i.append("xhtml:span").attr("class","plotter-waterfall-value-label").style("pointer-events","all")),r.text(e.text)}_resolveWaterfallLabelInteractionDatum(t){const e=t?.data??null;return e?this._resolveElementDatumForHierarchyRow(e)??{data:e}:null}#Tt(t){return t.each((e,s,n)=>{const i=window.d3.select(n[s]),a=n[s]?.classList?.contains("plotter-waterfall-value-label-fo")||n[s]?.tagName==="foreignObject"?i.select("span.plotter-waterfall-value-label"):i;a.empty()||a.style("cursor","pointer").on("click",l=>{l.preventDefault(),l.stopPropagation();const c=this._resolveWaterfallLabelInteractionDatum(e);c&&this._handleClick(l,c)}).on("contextmenu",l=>{l.preventDefault(),l.stopPropagation();const c=this._resolveWaterfallLabelInteractionDatum(e);c&&this._handleContextMenu(l,c)}).on("pointerdown",l=>{l.stopPropagation()})}),t}#wt(t,e){const n=this.getConfiguration().topLine||{},i=Number(n.opacity),r=Number.isFinite(i)?Math.max(0,Math.min(1,i)):1,a=this.#it(n),l=Array.isArray(e?.topLineLabels)?e.topLineLabels:[];t.selectAll("text.plotter-waterfall-top-line-label").data(l,c=>c.id).join(c=>c.append("text").attr("class","plotter-waterfall-top-line-label").attr("x",h=>h.x).attr("y",h=>h.y).attr("text-anchor",h=>h.textAnchor||"middle").attr("alignment-baseline",h=>h.alignmentBaseline||"baseline").attr("fill",h=>h.color).style("font-size",`${a}px`).style("font-weight",Number(n.weight)||600).style("font-family",n.family||null).style("pointer-events","all").attr("opacity",0).text(h=>h.text).call(h=>this.#Tt(h)).call(h=>this._transition(h).attr("opacity",r)),c=>(this.#Tt(c),this._transition(c.attr("x",h=>h.x).attr("y",h=>h.y).attr("text-anchor",h=>h.textAnchor||"middle").attr("alignment-baseline",h=>h.alignmentBaseline||"baseline").attr("fill",h=>h.color).style("font-size",`${a}px`).style("font-weight",Number(n.weight)||600).style("font-family",n.family||null).style("pointer-events","all").text(h=>h.text)).attr("opacity",r)),c=>c.remove())}#Et(t,e=0){const s=this.#n();return s.for(t,s.value)+e/2}#xt(t){const e=this.#n(),s=e.getScale(),n=e.size(t,1),i=(s?._elementSize??n)/3;return Math.max(0,Math.min(i,n-2))}#St(t,e=0){const s=this.#n();return Math.max(s.size(t,1)-e,2)}#It(t){return(t.children??[]).length===0}#Ot(t){const e=t?.data||{},s=e.Type||e.color,n=this._getMetricAxis(),i=this.#Rt(n),a=s==="net"||s==="net_OoS"?this.#Bt(i):e.previousValue??e.lower??i;return(e[n.value]??a)-a}#Rt(t){return t?.start!=null?Number(t.start):Math.min(...t.domain)}#Bt(t){return 0>=t?0:t}#Ut(t,e,s){return t.reverse?s==="top"?t.x+t.width+he:s==="bottom"?t.x-he:s==="middle"?t.x+t.width/2:e?t.x+t.width+he:t.x-he:s==="top"?t.y-he:s==="bottom"?t.y+t.height+he:s==="middle"?t.y+t.height/2:e?t.y-he:t.y+t.height+he}#Yt(t){const s=(this.getConfiguration()?.links||{}).dasharray;return s!=null&&String(s).length>0?String(s):t==="full"?E1:t==="dotted"?x1:T1}#zt(t,e,s){const n=this._getTraceColor(t,e,s);return n!=null&&String(n).length>0?n:kn}#Kt(t,e,s){const n=this.trace?.topLineColor;if(typeof n!="function")return kn;const i=t?.data||t,r=n(i,i?.plotter?.rowIndex??0,i?.plotter?.group,this.trace);if(!(r!=null&&String(r).length>0))return kn;if(s||String(r).indexOf("#")===0)return r;const l=e?.[r];return l!=null&&String(l).length>0?l:r}#Xt(t){const e=this.trace?.label;if(!(typeof e=="function"))return[];const n=e(t);return this.#$t(n)}#Ht(t){const e=this.trace?.topLine;if(!(typeof e=="function"))return[];const n=e(t);return this.#$t(n)}#mt(t){const e=this.#i(t),s=this.#a(t),n=this.#l(t),r=this.getConfiguration().bars||{},a=Number(r.opacity),l=Number.isFinite(a)?Math.max(0,Math.min(1,a)):1;let c;return!e||s?(c=this.trace.colors[t?.Type],typeof this.trace.color=="function"&&(c=this.trace.color(t))):c="transparent",{fill:c,fillOpacity:e&&s?l*.5:l,stroke:n?f1:"transparent",strokeOpacity:n?this.#p(t):0,strokeWidth:n?_1:0,strokeDasharray:n?g1:"0,0"}}#Vt(){this.containers.layerContainer?.selectAll("path.plotter-trace-group-path").remove()}#kt(t,e,s){const n=window.d3.select(t);return this.#Ft(n)?n.attr(e)??s:s}#Pt(t,e,s){const n=window.d3.select(t);if(!this.#Ft(n))return s;const r=parseFloat(n.attr(e));return Number.isFinite(r)?r:s}#Ft(t){if(t.attr("data-plotter-waterfall-entered")==="1"||t.attr("data-plotter-tree-entered")==="1")return!0;const e=parseFloat(t.attr("data-position-x")),s=parseFloat(t.attr("data-position-y")),n=parseFloat(t.attr("data-position-width")),i=parseFloat(t.attr("data-position-height"));return Number.isFinite(e)&&Number.isFinite(s)&&Number.isFinite(n)&&Number.isFinite(i)}#Zt(t,e){let s=parseFloat(t.attr("data-position-x")),n=parseFloat(t.attr("data-position-y")),i=parseFloat(t.attr("data-position-width")),r=parseFloat(t.attr("data-position-height"));return!!e.reverse?(Number.isNaN(s)&&(s=e.x-e.style.radius/2),Number.isNaN(n)&&(n=e.y),Number.isNaN(i)&&(i=e.style.radius*2),Number.isNaN(r)&&(r=e.height)):(Number.isNaN(s)&&(s=e.x),Number.isNaN(n)&&(n=e.y+e.height-e.style.radius/2),Number.isNaN(i)&&(i=e.width),Number.isNaN(r)&&(r=e.style.radius*2)),{x:s,y:n,width:i,height:r}}#$t(t){const e=Array.isArray(t)?t:[],s=[];for(let n=0;n<e.length;n++){const i=e[n],r=i!=null?String(i):"";r.length>0&&s.push(r)}return s}}const Se=76,Or=280,Pr=40,Zc=108,Qc=4,qc=4,ue=20,de=20,S1=0,Jc=12,th=.45,Dr=340,eh=210,v1=3.25,C1=.85,w1=10,R1=1.5,k1="#94a3b8",N1="#ffffff",sh="#0f172a",M1="rgba(71, 85, 105, 0.85)",I1=2,In=14,nh=700,Es=6,ih=4,O1=new Set(["auto","never","always"]),rh=.56,Fr=.88,ah=.76,P1=.45,D1=.55,F1="__plotter-tree-single-group__";function oh(o){const t=Array.isArray(o)?o:[],e=[];for(let s=0;s<t.length;s++){const n=t[s];n?.extremum||n?.customPillar||e.push(n)}return e}function H1(o,t){const e=[],s=new Set,n=(i,r)=>{for(let a=0;a<i.length;a++){const l=i[a],c=l?.id??l?.unique??l?.branchKey??`${r}-${a}`;s.has(c)||(s.add(c),e.push(l))}};return n(oh(o?.children),"end-child"),n(t,"root-child"),e}function B1(o){const t=Array.isArray(o)?o:[],e=[],s=new Map;for(let r=0;r<t.length;r++){const a=t[r],l=a?._sourceTableKey??a?.comparison??F1;let c=s.get(l);if(c||(c={ends:[],steps:[]},s.set(l,c),e.push(l)),a?.extremum==="End"){c.ends.push(a);continue}a?.extremum||a?.customPillar||c.steps.push(a)}const n=[],i=new Map;for(let r=0;r<e.length;r++){const a=s.get(e[r]);if(!a.ends.length){for(let c=0;c<a.steps.length;c++)n.push(a.steps[c]);continue}for(let c=0;c<a.ends.length;c++)n.push(a.ends[c]);const l=a.ends[0];i.set(l,H1(l,a.steps))}return{entryRoots:n,childrenByRoot:i}}class ve extends Ts{static evaluateInterCardDecorationFit(t,e,s){const n=Array.isArray(t)?t:[];for(let i=0;i<n.length;i++){const r=n[i]?.previous,a=n[i]?.current;if(!r||!a)continue;const l=ve.#t(r,a,s),c=(r.suffix||"").trim(),h=(a.prefix||"").trim();if(!c.length&&!h.length)continue;if((c.length>0&&h.length>0?e(c)+e(h)+Es*2+ih:e(c||h)+ih)>l)return!1}return!0}static#t(t,e,s){return s?e.y-(t.y+t.height):e.x-e.width/2-(t.x+t.width/2)}static resolveInterCardGapCenter(t,e,s){if(s)return{x:e.x,y:(t.y+t.height+e.y)/2,textAnchor:"middle"};const n=t.x+t.width/2,i=e.x-e.width/2;return{x:(n+i)/2,y:e.y+e.height/2,textAnchor:"middle"}}_configurationKey="tree";_traceName="tree";update(t=0){return this._join(t)}_getDimensionAxis(){return this.#e().dimensionAxis}_getMetricAxis(){return this.#e().metricAxis}#e(){const t=this.trace.scales.x?.getScale?.(),e=this.trace.scales.y?.getScale?.();if(!t||!e)return{dimensionAxis:t||e,metricAxis:e||t};if(t.hierarchy&&!e.hierarchy)return{dimensionAxis:t,metricAxis:e};if(e.hierarchy&&!t.hierarchy)return{dimensionAxis:e,metricAxis:t};const s=this.plot?.layer?.dimensions||[],n=s.includes(t.value),i=s.includes(e.value);if(n&&!i)return{dimensionAxis:t,metricAxis:e};if(i&&!n)return{dimensionAxis:e,metricAxis:t};const r=t.type==="discrete"||t.isDate,a=e.type==="discrete"||e.isDate;return r&&!a?{dimensionAxis:t,metricAxis:e}:a&&!r?{dimensionAxis:e,metricAxis:t}:{dimensionAxis:t,metricAxis:e}}#s(){const{dimensionAxis:t}=this.#e();return t?["left","right"].includes(t.position):!1}#n(){return this.plot?.layer?.configuration?.axis?.groupedAxes?.mode==="overlay"}#r(){if(this.#n())return null;const t=this._getMetricAxis(),e=t?.split!=null&&t.split!==""?t.split:null;if(!e||t.dimension)return null;let s=[];return Array.isArray(t._uniqueSplit)&&t._uniqueSplit.length?s=t._uniqueSplit.slice():s=this.#i(e),s.length?{splitKey:e,splitScale:t,segmentValues:s}:null}#i(t){const e=this.#g(),s=this._flattenHierarchyRows(e),n=[],i=new Set;for(let r=0;r<s.length;r++){const a=s[r]?.[t];a!=null&&(i.has(a)||(i.add(a),n.push(a)))}return n}#a(t,e){const s=this.#g(),n=[];for(let i=0;i<s.length;i++){const r=s[i];r?.[t]===e&&n.push(r)}return n}#l(){const t=this.plot;if(!t||typeof t._getRanges!="function"){const l=this.#A();return{left:0,top:0,width:Math.max(1,l.width),height:Math.max(1,l.height)}}const{horizontal:e,vertical:s}=t._getRanges(),n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]),r=Math.min(s[0],s[1]),a=Math.max(s[0],s[1]);return{left:n,top:r,width:Math.max(1,i-n),height:Math.max(1,a-r)}}#h(t,e){return{[t]:e}}#p(t,e,s){const n=this.#h(e,s),i=t.getSplitLag(n),r=(t.range?.[0]??0)+i,a=(t.range?.[1]??0)+i;return{segMin:Math.min(r,a),segMax:Math.max(r,a)}}#y(t,e,s,n){const{segMin:i,segMax:r}=this.#p(e,s,n),a=e.position||"left";if(["left","right"].includes(a)){const p=t.left+de,f=i+ue,_=Math.max(1,t.width-de*2),g=Math.max(1,r-i-ue*2);return{left:p,top:f,availableWidth:_,availableHeight:g}}const c=i+de,h=t.top+ue,u=Math.max(1,r-i-de*2),d=Math.max(1,t.height-ue*2);return{left:c,top:h,availableWidth:u,availableHeight:d}}#L(t,e,s,n){const{segMin:i,segMax:r}=this.#p(e,s,n),a=e.position||"left";return["left","right"].includes(a)?{layoutCanvasWidth:t.width,layoutCanvasHeight:Math.max(1,r-i)}:{layoutCanvasWidth:Math.max(1,r-i),layoutCanvasHeight:t.height}}#T(t){return{left:t.left+de,top:t.top+ue,availableWidth:Math.max(1,t.width-de*2),availableHeight:Math.max(1,t.height-ue*2)}}#u(t,e,s){return t?.split?e?.[t.split]===s?.[t.split]:!0}#c(t,e,s,n,i,r){const a=this.#f(t),l=a.descendants(),c=[];for(let m=0;m<l.length;m++){const y=l[m];y.depth>0&&c.push(y)}if(!c.length)return[];const h=this.#ot(c,s.layoutCanvasWidth,s.layoutCanvasHeight),u=this.#x(h);h.cardWidthByDepth=u,this.#v(a,h,u);const d=a._subtreeW;this.#D(a,d/2,h),this.#B(a);const p=this.#$(c,h),f=this.#F(p,e,h),_=this.#w(p,e,h,f),g=[];for(let m=0;m<c.length;m++){const y=this.#G(c[m],r+m,h,_,e,n,i);g.push(y)}return g}_join(t=0){return new Promise(e=>{const s=this._getPoints();this._layer(),this.containers.layerContainer.attr("clip-path",null),this._gradients(s),this._masks(s),this.#d(),this.containers.layerContainer.selectAll("g.plotter-trace-group").data(s).join(n=>this._handleTrace(n.append("g").attr("class","plotter-trace-group")),n=>this._handleTrace(n),n=>n.remove()),setTimeout(()=>e(),this.transition)})}_getPoints(){const t=this.#l(),e=this.#r();if(e==null){const l=this.#g(),c=this.#T(t),h={layoutCanvasWidth:t.width,layoutCanvasHeight:t.height},u=this.#c(l,c,h,null,null,0);return u.length?[u]:[[]]}const s=e.splitKey,n=e.splitScale,i=e.segmentValues,r=[];let a=0;for(let l=0;l<i.length;l++){const c=i[l],h=this.#a(s,c);if(!h.length)continue;const u=this.#y(t,n,s,c),d=this.#L(t,n,s,c),p=this.#c(h,u,d,s,c,a);a+=p.length;for(let f=0;f<p.length;f++)r.push(p[f])}return r.length?[r]:[[]]}_handleTrace(t){return t.each((e,s,n)=>{const i=window.d3.select(n[s]),r=this.#_(e);this.#C(i,r),this.#S(i,r),this.#Q(i,r),this.#J(i,r)}),t}#m(){const t=Number(this.transition);return(Number.isFinite(t)&&t>0?t:0)*P1}#o(t){const e=1/D1;return this._transition(t,{sceneDurationRatio:e,elementDelayDurationRatio:0}).delay(this.#m())}#A(){const e=this.plot?.__nodes__?.svg?.node?.(),s=e?.getBoundingClientRect?.(),n=Number(s?.width)||0,i=Number(s?.height)||0,r=Number(e?.getAttribute?.("width"))||0,a=Number(e?.getAttribute?.("height"))||0,l=Number(this.plot?.layer?.width)||0,c=Number(this.plot?.layer?.height)||0,h=n>0?n:r>0?r:l,u=i>0?i:a>0?a:c;return{width:h,height:u}}#E(t,e=0){const s=this.trace?.identify;if(typeof s=="function"){const i=s(t);if(i!=null&&String(i).length>0)return String(i)}return this._getHierarchyStableRowIdentifier(t,e)}_handlePath(t){const e=this.getConfiguration(),s=(e.cards||{}).border||{},n=s.dasharray!=null&&String(s.dasharray).length>0?s.dasharray:null;return t.each((i,r,a)=>{const l=window.d3.select(a[r]),c=l.attr("d"),h=this.#V(l);a[r].__plotterMorphStartD=h&&c?c:null,a[r].__plotterHadPreviousVisualState=h}),t.attr("id",({id:i})=>`${i}-path`).attr("fill",(i,r,a)=>this.#M(i,a[r])).attr("fill-opacity",(i,r,a)=>a[r].__plotterHadPreviousVisualState?1:0).attr("stroke",(i,r,a)=>this.#k(a[r])).attr("stroke-opacity",(i,r,a)=>a[r].__plotterHadPreviousVisualState?s.opacity??1:0).attr("stroke-width",(i,r,a)=>this.#Z(a[r],e)).attr("stroke-dasharray",n).attr("d",(i,r,a)=>a[r].__plotterMorphStartD?a[r].__plotterMorphStartD:this.#I(i,a[r],e)).attr("opacity",i=>this._opacity(i?.data,0)).attr("data-position-height",({height:i})=>i).attr("data-position-width",({width:i})=>i).attr("data-position-x",({x:i,width:r})=>i-r/2).attr("data-position-y",({y:i})=>i).each((i,r,a)=>{const l=window.d3.select(a[r]),c=a[r].__plotterHadPreviousVisualState?"0":"1";l.attr("data-plotter-tree-entering",c),delete a[r].__plotterMorphStartD,delete a[r].__plotterHadPreviousVisualState}),this._axisMeta(t),this._events(t),this._transition(t).delay((i,r,a)=>window.d3.select(a[r]).attr("data-plotter-tree-entering")==="1"?this.#m():0).attr("fill",i=>this.#R(i)).attr("fill-opacity",1).attr("stroke",i=>this.#ht(i?.data,e).border).attr("stroke-opacity",s.opacity).attr("stroke-width",s.width).attr("stroke-dasharray",n).attr("d",i=>this.#O(i,e)).attr("opacity",i=>this._opacity(i?.data)).on("end",(i,r,a)=>{window.d3.select(a[r]).attr("data-plotter-tree-entered","1").attr("data-plotter-tree-entering","0")})}_fromWaterfall(){return this.containers?.layerContainer?.selectAll("text.plotter-waterfall-top-line-label").remove(),this.containers?.layerContainer?.selectAll("foreignObject.plotter-waterfall-value-label-fo").remove(),this.#d(),this.update()}#d(){this.containers.layerContainer.selectAll("line.plotter-waterfall-connector").remove()}#_(t){const e=Array.isArray(t)?t:[],s=[];for(let n=0;n<e.length;n++)e[n]&&s.push(e[n]);return s}#C(t,e){t.selectAll("g.plotter-trace-element").data(e,s=>s.id).join(s=>this._handlePaths(s.append("g").attr("class","plotter-trace-element")),s=>this._handlePaths(s),s=>s.remove())}#S(t,e){t.selectAll("foreignObject.plotter-tree-card-label-fo").data(e,s=>`${s.id}-value-label-0`).join(s=>s.append("foreignObject").attr("class","plotter-tree-card-label-fo").attr("x",n=>n.x-n.width/2).attr("y",n=>n.y).attr("width",n=>n.width).attr("height",n=>n.height).attr("opacity",0).each((n,i,r)=>{this.#q(window.d3.select(r[i]),n)}).call(n=>this._events(n.style("pointer-events","none"))).call(n=>this.#o(n).attr("opacity",1)),s=>(this._events(s.style("pointer-events","none")),this._transition(s).attr("x",n=>n.x-n.width/2).attr("y",n=>n.y).attr("width",n=>n.width).attr("height",n=>n.height).attr("opacity",1),s.each((n,i,r)=>{const a=window.d3.select(r[i]);this.#q(a,n)}),s),s=>s.remove())}#g(){const t=this.plot?.__parameters__?.parent?.__parameters__?.data,e=this._filterVisibleRows(t),s=[];for(let n=0;n<e.length;n++){const i=e[n];i?.extremum==="Start"||i?.customPillar||s.push(i)}return s}#f(t){const{entryRoots:e,childrenByRoot:s}=B1(t),n={id:`${this.trace.id}-tree-root`,children:e};return window.d3.hierarchy(n,i=>{if(i===n)return e;const r=s.get(i);return r||oh(i.children)})}#x(t){const e=new Map,s=t.levelSizes instanceof Map?t.levelSizes:new Map,n=t.layoutAvailableWidth,i=t.breadthSizeOptions;return s.forEach((r,a)=>{const l=this.#Y(n,r,i);e.set(a,l)}),e}#v(t,e,s){const n=t.children||[],i=e.horizontalGap;if(t.depth===0){if(!n.length)return t._subtreeW=0,0;let c=0;for(let h=0;h<n.length;h++)c+=this.#v(n[h],e,s),h<n.length-1&&(c+=i);return t._subtreeW=c,c}const r=Math.max(0,t.depth-1),a=s.get(r)??Se;if(!n.length)return t._subtreeW=a,a;let l=0;for(let c=0;c<n.length;c++)l+=this.#v(n[c],e,s),c<n.length-1&&(l+=i);return t._subtreeW=Math.max(a,l),t._subtreeW}#D(t,e,s){const n=s.nodeHeight+s.verticalGap;t.x=e,t.y=Math.max(0,t.depth-1)*n;const i=t.children||[];if(!i.length)return;const r=s.horizontalGap;let a=0;for(let c=0;c<i.length;c++)a+=i[c]._subtreeW,c<i.length-1&&(a+=r);let l=e-a/2;for(let c=0;c<i.length;c++){const h=i[c],u=h._subtreeW;this.#D(h,l+u/2,s),l+=u+r}}#B(t){if(!t)return;const e=[t];for(;e.length>0;){const s=e.pop(),n=s.children||[];for(let i=0;i<n.length;i++)e.push(n[i]);Object.prototype.hasOwnProperty.call(s,"_subtreeW")&&delete s._subtreeW}}#$(t,e){const s=e.cardWidthByDepth instanceof Map?e.cardWidthByDepth:new Map,n=t[0],i=Math.max(0,n.depth-1),r=(s.get(i)??e.maxNodeWidthLayout??Se)/2;let a=n.x-r,l=n.x+r,c=n.y,h=n.y+e.nodeHeight;for(let p=1;p<t.length;p++){const f=t[p],_=Math.max(0,f.depth-1),g=(s.get(_)??e.maxNodeWidthLayout??Se)/2;a=Math.min(a,f.x-g),l=Math.max(l,f.x+g),c=Math.min(c,f.y),h=Math.max(h,f.y+e.nodeHeight)}const u=Math.max(l-a,1),d=Math.max(h-c,1);return{minLeft:a,maxRight:l,minTop:c,maxBottom:h,width:u,height:d}}#F(t,e,s){const n=!!s?.reverse,i=Math.max(t.width,1),r=Math.max(t.height,1),a=n?e.availableHeight:e.availableWidth,l=n?e.availableWidth:e.availableHeight,c=this.getConfiguration(),h=c.layout?.maxScaleUp??v1;let u=Math.min(a/i,h),d=Math.min(l/r,h);if(c.layout?.preserveAspectRatio){const p=Math.min(u,d);u=p,d=p}return{scaleBreadth:u,scaleDepth:d}}#w(t,e,s,n){const i=!!s?.reverse,r=n.scaleBreadth,a=n.scaleDepth,l=s.nodeWidth*r,c=s.nodeHeight*a,h=t.width*r,u=t.height*a,d=i?u:h,p=i?h:u,f=e.left+(e.availableWidth-d)/2,_=e.top+(e.availableHeight-p)/2;return{scaleBreadth:r,scaleDepth:a,scaledNodeWidth:l,scaledNodeHeight:c,offsetX:f,offsetY:_,minLeft:t.minLeft,minTop:t.minTop,reverse:i}}#G(t,e,s,n,i,r=null,a=null){const l=this.getConfiguration(),c=this.#E(t.data,e),h=this.#N(t),u=t.parent&&t.parent.depth>0?this.#N(t.parent):null,d=t.data||{},p=l.operators.prefixField??"prefix",f=l.operators.suffixField??"suffix",_=this._getHierarchyTransitionTraceId(this.trace.id),g=!!n?.reverse,m=Math.max(0,(t.depth||1)-1),y=s.levelSizes instanceof Map?s.levelSizes:new Map,b=Math.max(1,y.get(m)||1),A=s.cardWidthByDepth instanceof Map?s.cardWidthByDepth:new Map,L=s.layoutAvailableWidth!=null?s.layoutAvailableWidth:g?i.availableHeight:i.availableWidth,T=A.get(m)??this.#Y(L,b,s.breadthSizeOptions),E=T*n.scaleBreadth,C=n.scaledNodeHeight;let S,w;if(g){const O=(t.y-n.minTop)*n.scaleDepth+n.offsetX,F=(t.x-n.minLeft)*n.scaleBreadth+n.offsetY;S=O+C/2,w=F-E/2}else{const O=t.x-T/2,F=t.y;S=(O-n.minLeft)*n.scaleBreadth+n.offsetX+E/2,w=(F-n.minTop)*n.scaleDepth+n.offsetY}const N=g?C:E,R=g?E:C;let M=N,k=R;if(b===1)if(g){const O=i.availableHeight*rh;k=Math.min(k,O)}else{const O=i.availableWidth*rh;M=Math.min(M,O)}const I=(g?Pr:Se)*n.scaleBreadth*C1;return g?k=Math.max(k,I):M=Math.max(M,I),{id:`${_}-0-${c}`,hierarchyKey:h,parentHierarchyKey:u,depth:t.depth-1,x:S,y:w,width:M,height:k,prefix:d?.[p]!=null?String(d[p]):"",suffix:d?.[f]!=null?String(d[f]):"",reverse:g,treeSplitKey:r,treeSplitSegment:a,data:d}}#N(t){const e=t?.ancestors?t.ancestors().reverse():[],s=[];for(let n=1;n<e.length;n++){const i=e[n]?.data||{};s.push(this.#E(i,n))}return s.join(">")}#R(t){const e=this.getConfiguration();return this.#ht(t?.data,e).fill}#M(t,e){const s=window.d3.select(e);return this.#V(s)?s.attr("fill")??this.#R(t):this.#R(t)}#k(t){const e=window.d3.select(t),s=e.datum(),n=s?.data!=null?s.data:s,i=this.getConfiguration(),r=this.#ht(n,i);if(this.#V(e)){const l=e.attr("stroke");if(l!=null&&l!==""&&l!=="none")return l}return r.border}#Z(t,e){const s=window.d3.select(t),n=this.#V(s),i=e?.cards?.border?.width??R1;if(n){const r=parseFloat(s.attr("stroke-width"));if(Number.isFinite(r))return r}return i}#V(t){if(t.attr("data-plotter-tree-entered")==="1"||t.attr("data-plotter-waterfall-entered")==="1")return!0;const n=parseFloat(t.attr("data-position-x")),i=parseFloat(t.attr("data-position-y")),r=parseFloat(t.attr("data-position-width")),a=parseFloat(t.attr("data-position-height"));return Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(r)&&Number.isFinite(a)}#H(t){return $e(t?.cards?.radius,w1)}#I(t,e,s){const n=window.d3.select(e),i=this.#lt(n),a=i!=null?i:this.#j(t),l=this.#H(s);return Ts.roundedRectangleShape(a.x,a.y,a.width,a.height,{both:!0},{both:l})}#O(t,e){const s=this.#j(t),n=this.#H(e);return Ts.roundedRectangleShape(s.x,s.y,s.width,s.height,{both:!0},{both:n})}#j(t){return{x:t.x-t.width/2,y:t.y,width:t.width,height:t.height}}#lt(t){const e=parseFloat(t.attr("data-position-x")),s=parseFloat(t.attr("data-position-y")),n=parseFloat(t.attr("data-position-width")),i=parseFloat(t.attr("data-position-height"));return Number.isFinite(e)&&Number.isFinite(s)&&Number.isFinite(n)&&Number.isFinite(i)?{x:e,y:s,width:n,height:i}:null}#J(t,e){const s=this.getConfiguration(),i=(s.cards||{}).connector||{},r=i.render,l=r!==!1&&r!=null?this.#P(e):[],c=Number(i.size)||I1,h=i.dasharray!=null&&String(i.dasharray).length>0?i.dasharray:null,u=Number.isFinite(Number(i.opacity))?Number(i.opacity):1,d=t.selectAll("path.plotter-tree-connector").data(l,p=>p.id).join(p=>p.append("path").attr("class","plotter-tree-connector").attr("data-plotter-tree-entering","1").attr("fill","none").attr("stroke",f=>this.#tt(f,s)).attr("stroke-width",c).attr("stroke-dasharray",h).attr("stroke-linecap","round").attr("d",f=>this.#W({...f,x2:f.x1,y2:f.y1},r)).attr("opacity",S1),p=>p,p=>p.remove());d.lower(),this._transition(d).delay((p,f,_)=>window.d3.select(_[f]).attr("data-plotter-tree-entering")==="1"?this.#m():0).attr("d",p=>this.#W(p,r)).attr("stroke",p=>this.#tt(p,s)).attr("stroke-width",c).attr("stroke-dasharray",h).attr("opacity",u).on("end",(p,f,_)=>{window.d3.select(_[f]).attr("data-plotter-tree-entering","0")})}#tt(t,e){const s=e.cards||{},n=s?.connector?.color===!0,i=s?.connector?.neutralStroke,r=typeof i=="string"&&i.length>0?i:M1;if(!n)return r;const a=t.targetRowData,l=this.#b(a,this.trace?.colors||{});return l!=null&&l!==""?l:r}#W(t,e){return e==="straight"?this.#it(t):this.#st(t)}#it(t){const e=t.x1,s=t.y1,n=t.x2,i=t.y2;if(t.orientation==="horizontal"){const a=(e+n)/2;return`M ${e},${s} L ${a},${s} L ${a},${i} L ${n},${i}`}const r=(s+i)/2;return`M ${e},${s} L ${e},${r} L ${n},${r} L ${n},${i}`}#st(t){const e=t.x1,s=t.y1,n=t.x2,i=t.y2;if(t.orientation==="horizontal"){const h=n-e,u=Math.max(Jc,Math.abs(h)*th),d=e+u,p=n-u;return`M ${e},${s} C ${d},${s} ${p},${i} ${n},${i}`}const r=i-s,a=Math.max(Jc,Math.abs(r)*th),l=s+a,c=i-a;return`M ${e},${s} C ${e},${l} ${n},${c} ${n},${i}`}#Q(t,e){const s=this.#ct(e);t.selectAll("text.plotter-tree-prefix, text.plotter-tree-suffix").data(s,n=>n.id).join(n=>n.append("text").attr("class",i=>i.kind==="prefix"?"plotter-tree-prefix":"plotter-tree-suffix").attr("data-plotter-tree-entering","1").attr("text-anchor",i=>i.textAnchor).attr("dominant-baseline","middle").attr("x",i=>i.x).attr("y",i=>i.y).attr("font-size",`${In}px`).attr("font-weight",nh).attr("fill",i=>i.color).attr("opacity",0).text(i=>i.text).call(i=>this.#o(i).attr("opacity",1).on("end",(r,a,l)=>{window.d3.select(l[a]).attr("data-plotter-tree-entering","0")})),n=>(n.attr("class",i=>i.kind==="prefix"?"plotter-tree-prefix":"plotter-tree-suffix").attr("text-anchor",i=>i.textAnchor).text(i=>i.text),this._transition(n).attr("x",i=>i.x).attr("y",i=>i.y).attr("font-size",`${In}px`).attr("fill",i=>i.color).attr("opacity",1),n),n=>this._transition(n.attr("x",i=>i.x).attr("y",i=>i.y).attr("font-size",`${In}px`).attr("fill",i=>i.color)).attr("opacity",0).remove())}#P(t){const e=Array.isArray(t)?t:[],s=new Map;for(let l=0;l<e.length;l++)s.set(e[l].hierarchyKey,e[l]);const n=this.#s(),i=n?"horizontal":"vertical",r=this._getMetricAxis(),a=[];for(let l=0;l<e.length;l++){const c=e[l],h=c?.parentHierarchyKey;if(!(h!=null))continue;const d=s.get(h);if(!(d!=null)||!this.#u(r,d.data,c.data))continue;const _=n?{x1:d.x+d.width/2,y1:d.y+d.height/2,x2:c.x-c.width/2,y2:c.y+c.height/2}:{x1:d.x,y1:d.y+d.height,x2:c.x,y2:c.y};a.push({id:`${d.hierarchyKey}->${c.hierarchyKey}`,..._,orientation:i,targetRowData:c.data})}return a}#et(){const t=this.getConfiguration()?.operators?.decorationMode??"auto";return O1.has(t)?t:"auto"}#rt(){return{size:In,weight:nh}}#ut(t){const e=(t||"").trim();return e.length?this._computeTextRenderingWidth(e,this.#rt()):0}#z(t){const e=Array.isArray(t)?t:[],s=new Map;for(let a=0;a<e.length;a++){const l=e[a],c=l?.parentHierarchyKey;c!=null&&(s.has(c)||s.set(c,[]),s.get(c).push(l))}const n=this.#s(),i=this._getMetricAxis(),r=new Map;return s.forEach(a=>{const l=a.slice();l.sort((c,h)=>n?c.y-h.y:c.x-h.x);for(let c=0;c<l.length;c++){const h=l[c];let u=null,d=null;for(let p=c-1;p>=0;p--)if(this.#u(i,l[p].data,h.data)){u=l[p];break}for(let p=c+1;p<l.length;p++)if(this.#u(i,h.data,l[p].data)){d=l[p];break}r.set(h.hierarchyKey,{previous:u,next:d})}}),r}#U(t){const e=Array.isArray(t)?t:[],s=this.#z(e),n=[];for(let i=0;i<e.length;i++){const r=e[i],a=s.get(r.hierarchyKey)?.next;a&&n.push({previous:r,current:a})}return n}#at(t){return ve.evaluateInterCardDecorationFit(this.#U(t),e=>this.#ut(e),this.#s())}#ct(t){const e=Array.isArray(t)?t:[],s=this.#et();if(s==="never")return[];if(s==="auto"&&!this.#at(e))return[];const n=this.#s(),i=this.#z(e),r=[];for(let a=0;a<e.length;a++){const l=e[a],{previous:c,next:h}=i.get(l.hierarchyKey)||{},u=(l?.prefix||"").trim(),d=(l?.suffix||"").trim(),p=sh,f=l.y+l.height/2,_=(c?.suffix||"").trim(),g=(h?.prefix||"").trim(),m=!!c&&!_.length,y=!!h&&!g.length;if(u.length>0){const b=m?ve.resolveInterCardGapCenter(c,l,n):n?{x:l.x,y:l.y-Es,textAnchor:"middle"}:{x:l.x-l.width/2-Es,y:f,textAnchor:"end"};r.push({id:`${l.hierarchyKey}:prefix`,kind:"prefix",text:u,x:b.x,y:b.y,textAnchor:b.textAnchor,color:p})}if(d.length>0){const b=y?ve.resolveInterCardGapCenter(l,h,n):n?{x:l.x,y:l.y+l.height+Es,textAnchor:"middle"}:{x:l.x+l.width/2+Es,y:f,textAnchor:"start"};r.push({id:`${l.hierarchyKey}:suffix`,kind:"suffix",text:d,x:b.x,y:b.y,textAnchor:b.textAnchor,color:p})}}return r}#ot(t,e=null,s=null){const n=new Map;let i=0;for(let U=0;U<t.length;U++){const j=Math.max(0,(t[U].depth||1)-1);i=Math.max(i,j);const z=n.get(j)||0;n.set(j,z+1)}let r=1;n.forEach(U=>{r=Math.max(r,U)});const a=this.#s(),l=a?Pr:Se,c=a?Zc:Or,h=a?eh:Dr,u=a?qc:Qc,d=a?ah:Fr,p=a?Se:Pr,f=a?Or:Zc,_=a?Dr:eh,g=a?Qc:qc,m=a?Fr:ah,y=this.#A(),b=Number.isFinite(Number(e))&&e>0?e:y.width,A=Number.isFinite(Number(s))&&s>0?s:y.height,L=a?A:b,T=a?b:A,E=a?ue:de,C=a?de:ue,S=Math.max(L-E*2,l),w=Math.max(T-C*2,p),N={sizeMin:l,sizeMax:c,stepMax:h,stepRatio:d};let R=l;n.forEach(U=>{const j=this.#Y(S,U,N);R=Math.max(R,j)});const M=r>1?S/(r-1):S,k=Math.min(M,h),I=Math.max(l,Math.min(c,k*d)),O=Math.max(u,k-I),F=i+1,P=F>1?w/(F-1):w,B=Math.min(P,_),V=Math.max(p,Math.min(f,B*m)),H=Math.max(g,B-V);return{nodeWidth:I,nodeHeight:V,horizontalGap:O,verticalGap:H,levelSizes:n,layoutAvailableWidth:S,layoutAvailableHeight:w,maxNodeWidthLayout:R,reverse:a,breadthSizeOptions:N}}#Y(t,e,s={}){const n=s.sizeMin??Se,i=s.sizeMax??Or,r=s.stepMax??Dr,a=s.stepRatio??Fr,l=Math.max(t,1),c=Math.max(1,e),h=c>1?l/(c-1):l,u=Math.min(h,r);return Math.max(n,Math.min(i,u*a))}#K(t){const e=t?.cards?.border?.color;return e==null||String(e).length===0}#b(t,e){const s=this.trace?.color;if(!(typeof s=="function"))return null;const i=t||{},r=s(i,i?.plotter?.rowIndex??0,i?.plotter?.group,this.trace);if(r==null||r==="")return null;const a=String(r),c=(e&&typeof e=="object"?e:{})[a];return c!=null&&c!==""?String(c):a}#ht(t,e){const s=e.cards||{},n=N1;if(!this.#K(e))return{border:String(s.border.color),fill:n};const r=this.#b(t,this.trace?.colors||{});return r!=null&&r!==""?{border:r,fill:n}:{border:k1,fill:n}}#nt(t){const e=this.#b(t,this.trace?.colors||{});return e!=null&&e!==""?e:sh}#q(t,e){const s=this.getConfiguration(),n=this.#nt(e.data),r=`${this.#H(s)}px`;t.selectAll("*").remove(),t.style("overflow","hidden").style("border-radius",r).style("color",n);const a=t.append("xhtml:div").attr("class","plotter-tree-card-label-html").style("width","100%").style("height","100%").style("box-sizing","border-box").style("overflow","hidden").style("border-radius",r).style("font-family","system-ui, -apple-system, 'Segoe UI', sans-serif"),l=this.trace?.template;typeof l=="function"&&l(a.node(),{...e})}}const z1=14,V1=20,$1=16,W1=48,G1="button, input, select, textarea, a, label, .plotter-table-icon-button",Pt=Object.freeze({sortNone:"inactive-sort-svg",sortAsc:"value-by-asc-svg",sortDesc:"value-by-desc-svg",search:"search-svg",collapse:"drop-left-svg",expand:"drop-right-svg",rowCollapsed:"drop-right-svg",rowExpanded:"drop-down-svg",pagePrev:"drop-left-svg",pageNext:"drop-right-svg",arrowUp:"arrow-up-svg",arrowDown:"arrow-down-svg",chevronUp:"chevron-up-svg",chevronDown:"chevron-down-svg"});class Xt{constructor(t,e,s,n={}){this.data=Array.isArray(t)?t:[],this.config=e||{},this.container=s,this.options=n,this.id=n.id||"plotter",this.followChartVisibility=n.followChartVisibility??this.config?.rows?.followChartVisibility===!0,this.root=null,this._scrollSelection=null,this._tableSelection=null,this._leafColumns=[],this._footerColumns=[],this._treeRoots=[],this._pageRoots=[],this._levelZeroBodyRows=[],this._footerTotalRow=null,this._flatDisplayRows=[],this._frozenOffsets={},this._showTreeLines=!1,this._showGroupBrackets=!1,this._displayStripeEnabled=!1,this._labelColumnKey=null,this._hierarchyNameField=null,this._exportDisplayRows=[],this._hasActiveFilters=!1,this._hasNoSourceData=!1,this._columnResizeState=null,this._highlightedRowId=null,this._hoveredRow=null,this._pointerLeaveHandler=null,this.state={page:0,search:{},searchOpen:{},expanded:{}}}static get VIEW_KEY(){return $}setHighlightedRowId(t){const e=t==null?null:String(t);if(String(this._highlightedRowId??"")===e||(this._highlightedRowId=e,!this.root))return;const s=window.d3.select(this.root);s.selectAll(".plotter-table-body .plotter-table-row[data-row-id]").classed("plotter-table-row--highlighted",!1),e!=null&&s.selectAll(`.plotter-table-body .plotter-table-row[data-row-id="${Xt.#ht(e)}"]`).classed("plotter-table-row--highlighted",!0)}#t(){this._pointerLeaveHandler||typeof document>"u"||(this._pointerLeaveHandler=()=>this.#s(),document.documentElement.addEventListener("mouseleave",this._pointerLeaveHandler),typeof window<"u"&&window.addEventListener("blur",this._pointerLeaveHandler))}#e(){this._pointerLeaveHandler&&(document.documentElement.removeEventListener("mouseleave",this._pointerLeaveHandler),typeof window<"u"&&window.removeEventListener("blur",this._pointerLeaveHandler),this._pointerLeaveHandler=null)}#s(){const t=this._hoveredRow;this._hoveredRow=null,this.root&&window.d3.select(this.root).selectAll(".plotter-table-body .plotter-table-row--hover").classed("plotter-table-row--hover",!1),this.setHighlightedRowId(null),typeof this.options.onHoverClear=="function"&&this.options.onHoverClear(),t&&typeof this.options.onRowMouseOut=="function"&&this.options.onRowMouseOut({type:"pointerleave"},t)}#n(t,e){t.classed("plotter-table-row--hover",e===!0)}clearTransientHoverState(){this.#s()}render(){const t=window.d3;if(this.root=this.container.querySelector(`#${this.id}-table-view`),!this.root){const e=t.select(this.container).append("div").attr("id",`${this.id}-table-view`).attr("class","plotter-table-view");this.root=e.node()}return this.#r(),this.#a(),this.#t(),this.root}update(t,e={}){if(e.config&&typeof e.config=="object"&&(this.config=e.config),Array.isArray(t)&&(this.data=t),e.followChartVisibility!=null&&(this.followChartVisibility=e.followChartVisibility),e.tableOptions&&typeof e.tableOptions=="object"&&Object.assign(this.options,e.tableOptions),!this.root){this.render();return}this.#r(),this.#a(),this.#t()}unmount(){this.#e(),this.root&&this.root.parentNode&&this.root.parentNode.removeChild(this.root),this.root=null,this._hoveredRow=null}collectExportRows(){const t=(this._leafColumns||[]).filter(n=>n.visible!==!1&&n.section!=="actions"),e=this._exportDisplayRows&&this._exportDisplayRows.length?this._exportDisplayRows:this._flatDisplayRows,s=Rl(e,{columns:t,tableConfig:this.config,includeDepthLabels:nn(this.config)});return s.length?s:Rl(e,{includeDepthLabels:nn(this.config)})}#r(){if(!this.root)return;const t=this.config?.layout?.fontFamily;t?this.root.style.fontFamily=t:this.root.style.removeProperty("font-family");const e=Number(this.config?.layout?.textMaxWidth);Number.isFinite(e)&&e>0?this.root.style.setProperty("--plotter-table-column-max-width",`${e}px`):this.root.style.removeProperty("--plotter-table-column-max-width")}#i(){if(!this.root)return;const t=Wf(this.config);Object.entries(t).forEach(([e,s])=>{this.root.style.setProperty(e,s)})}#a(){this.clearTransientHoverState();const t=window.d3,e=this.#l(),s=Pi(this.data,this.config,"actions").filter(d=>d.visible!==!1),{headerMatrix:n,leafColumns:i}=Mf(e,this.config,s);this._showTreeLines=Uf(this.data,this.config),this._showGroupBrackets=jf(this.config),this._displayStripeEnabled=!!hs(this.config).stripe?.enabled;const r=Kf(n);this._leafColumns=i,this._footerColumns=this.#h("footer"),this._labelColumnKey=this.#p(i),this._frozenOffsets=f_(i),this._treeRoots=fl(this.data,this.config);const a=this.#T(),l=this.#y(),c=t.select(this.root);c.selectAll(".plotter-table-scroll, .plotter-table-pagination").remove();const h=c.append("div").attr("class","plotter-table-scroll");this._scrollSelection=h,h.on("mouseleave",d=>{const p=d?.relatedTarget;p instanceof Node&&this.root?.contains(p)||this.clearTransientHoverState()});const u=h.append("table").attr("class",Gf(this.config).join(" "));this._tableSelection=u,this.#i(),this.#A(u),this.#E(u,r),this.#c(),this.#L(l),this.#u(a),typeof this.options.onAfterDraw=="function"&&this.options.onAfterDraw()}#l(){let t=Pi(this.data,this.config,"header").filter(r=>r.visible!==!1);const e=this.config?.rows||{},s=Array.isArray(e.groupBy)?e.groupBy.filter(Boolean):[];if(s.length&&e.hideGroupFields!==!1){const r=new Set(s);t=t.filter(a=>!r.has(a.key))}if(!be(this.data,this.config))return this._hierarchyNameField=null,ji(t);this._hierarchyNameField=hl(this.data,this.config);const n=Of(this.data,this.config);if(t=t.filter(r=>!n.has(r.key)),nn(this.config)){const r=fl(this.data,this.config),a=Df(r),l=Pf(a,this.config).filter(c=>c.visible!==!1);return ji([...l,...t].filter(c=>c.visible!==!1))}const i=dl(this.config);return i.visible=!0,ji([i,...t].filter(r=>r.visible!==!1))}#h(t){const e=Pi(this.data,this.config,t).filter(r=>r.visible!==!1);if(t!=="header")return e;const s=this.config?.rows||{},n=Array.isArray(s.groupBy)?s.groupBy.filter(Boolean):[];if(!n.length||s.hideGroupFields===!1)return e;const i=new Set(n);return e.filter(r=>!i.has(r.key))}#p(t){if(!be(this.data,this.config)||t.some(s=>se(s.key)&&s.visible!==!1))return null;if(t.some(s=>s.key===st&&s.visible!==!1))return st;const e=this.config?.rows?.labelColumn;return e&&t.some(s=>s.key===e)?e:t.length?t[0].key:null}#y(){const t=this._scrollSelection?.node?.();return t instanceof HTMLElement?{scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}:null}#L(t){if(!t)return;const e=this._scrollSelection?.node?.();e instanceof HTMLElement&&(e.scrollTop=t.scrollTop,e.scrollLeft=t.scrollLeft)}#T(){const t=typeof document<"u"?document.activeElement:null;return t&&t.classList?.contains("plotter-table-search")&&this.root?.contains(t)?{key:t.getAttribute("data-column"),start:t.selectionStart,end:t.selectionEnd}:null}#u(t){if(!t||!this.root)return;const e=Xt.#ht(t.key),s=this.root.querySelector(`.plotter-table-search[data-column="${e}"]`);if(s){s.focus();try{const n=t.end??s.value.length;s.setSelectionRange(t.start??n,n)}catch{}}}#c(){const t=this._leafColumns||[],e=this.#it(this._treeRoots,t),s=nn(this.config)&&be(this.data,this.config),n=s?e:u_(e,this.config,t),i=s_(n,this.config),r=Sl(i,this.config);this._footerTotalRow=r;const a=n_(i,this.config,r);this._levelZeroBodyRows=a.filter(m=>!m.synthetic&&m.row).map(m=>m.row);const l=_l(a),c=this.config?.rows?.pinRowKey??null,h={expanded:this.followChartVisibility?{}:this.state.expanded,defaultExpanded:this.followChartVisibility?!0:this.config?.rows?.defaultExpanded,pinRowKey:c,tableConfig:this.config,leafColumns:t,leavesOnly:s};let u,d,p,f;if(s){const y=Ui(a,h,this.config,l).filter(L=>!(L.row&&on(L.row,this.config)||L.row&&Fe(L.row,r)||L.row&&Ll(L.row,this.config)||L.subtotal)),b=d_(y,this.config,t);this._exportDisplayRows=this.#m(b,r);const A=this.#st(b);u=A.pageItems,d=A.pageCount,p=A.page,f=b.length,this._pageRoots=a}else{const{pageRoots:m,pageCount:y,page:b}=this.#Q(a);this.state.page=b,this._pageRoots=m,d=y,p=b,f=a.length;const L=Ui(a,h,this.config,l).filter(E=>!(E.row&&on(E.row,this.config)||E.row&&Fe(E.row,r)));this._exportDisplayRows=this.#m(L,r),u=Ui(m,h,this.config,l).filter(E=>!(E.row&&on(E.row,this.config)||E.row&&Fe(E.row,r)))}this.state.page=p,this._flatDisplayRows=u,this._treeGuides=!s&&this._showTreeLines?Yf(u):[];const _=this._tableSelection,g=window.d3.select(this.root);_&&(_.select("tbody.plotter-table-body").remove(),_.select("tfoot.plotter-table-foot").remove(),g.select(".plotter-table-pagination").remove(),this.#D(_,t,u,l,a.length===0&&this.data.length>0),this.#w(_,t,l,u,r),this.#W(g,{pageCount:d,page:p,total:f}))}#m(t,e){const s=Array.isArray(t)?t.slice():[];if(!e)return s;const n=Mt(e,this.config);return s.push({row:e,depth:0,path:"__plotter-table-total-export__",synthetic:!1,subtotal:!1,hasChildren:!1,expanded:!1,depthLabels:[n==null?"":String(n)]}),s}#o(t,e,s="",n=z1){const i=t.node();if(!i)return;const r=D.get(e,{size:n});r!=null?i.append(r):s&&t.text(s)}#A(t){const e=t.append("colgroup");(this._leafColumns||[]).forEach(()=>{e.append("col")})}#E(t,e){const s=t.append("thead").attr("class","plotter-table-head");(e||[]).forEach((n,i)=>{const r=s.append("tr").attr("class",`plotter-table-head-row plotter-table-head-row-${i}`);n.forEach(a=>{if(a.group){this.#d(r,a);return}this.#_(r,a)})})}#d(t,e){let s="plotter-table-th plotter-table-th-group";this._showGroupBrackets&&e.groupStart&&(s+=" plotter-table-th-group-bracket-start"),this._showGroupBrackets&&e.groupEnd&&(s+=" plotter-table-th-group-bracket-end");const i=t.append("th").attr("class",s).attr("colspan",e.colspan).attr("rowspan",e.rowspan).attr("scope","colgroup").append("div").attr("class","plotter-table-th-content");if(i.append("span").attr("class","plotter-table-th-group-label").text(this.#b(e.label)),!e.synthetic&&Number.isInteger(e.groupIndex)){const l=i.append("div").attr("class","plotter-table-th-actions").append("button").attr("type","button").attr("class","plotter-table-icon-button plotter-table-group-collapse").attr("data-group-index",e.groupIndex).attr("title",this.#b(e.collapsed?"Expand column group":"Collapse column group")).on("click",c=>{c.stopPropagation(),this.#ut(e.groupIndex)});this.#o(l,e.collapsed?Pt.expand:Pt.collapse,e.collapsed?"+":"-")}}#_(t,e){const s=e.column;let n=this.#C(s);this._showGroupBrackets&&s.__groupStart&&(n+=" plotter-table-th-group-start"),this._showGroupBrackets&&s.__groupEnd&&(n+=" plotter-table-th-group-end");const i=t.append("th").attr("class",n).attr("rowspan",e.rowspan).attr("scope","col").attr("data-column",s.key).attr("data-align",s.align||"left").style("text-align",s.align);this._frozenOffsets[s.key]!=null&&(i.classed("plotter-table-th-frozen",!0),i.style("left",`${this._frozenOffsets[s.key]}px`));const r=Number(s.width);Number.isFinite(r)&&r>0&&(i.style("width",`${r}px`),i.style("max-width",`${r}px`));const a=i.append("div").attr("class","plotter-table-th-content"),l=!!s.searchable,c=l&&this.#S(s.key),h=Fi(s),u=Gi(this.config,this._leafColumns||[]),d=u.find(m=>m.key===s.key),p=s.sortable!==!1,f=a.append("span").attr("class","plotter-table-th-label-host").classed("plotter-table-th-label-host--hidden",c),_=f.append("span").attr("class","plotter-table-th-label-stack"),g=_.append("span").attr("class","plotter-table-th-label").classed("plotter-table-th-label--sortable",p).text(this.#b(s.label,s.labelVars||null));if(s.tooltip&&g.attr("title",this.#b(s.tooltip)),s.subtitle&&_.append("span").attr("class","plotter-table-th-subtitle").text(this.#b(s.subtitle)),h&&f.append("span").attr("class","plotter-table-th-unit").text(this.#b(h)),p){const m=s.sortable==="asc"||s.sortable==="desc"?s.sortable:d?.direction||null;g.attr("title",this.#b("Sort column")).attr("data-sort",m||"none").classed("plotter-table-th-label--sorted-asc",m==="asc").classed("plotter-table-th-label--sorted-desc",m==="desc").on("click",y=>{y.stopPropagation(),this.#et(s.key,y.shiftKey)}),d&&u.length>1&&g.append("span").attr("class","plotter-table-sort-priority").text(String((d.priority??0)+1))}if(l){const y=f.append("div").attr("class","plotter-table-th-actions").append("button").attr("type","button").attr("class","plotter-table-icon-button plotter-table-search-trigger").attr("data-column",s.key).attr("title",this.#b("Search")).on("click",b=>{b.stopPropagation(),this.#f(s.key)});this.#o(y,Pt.search,"⌕"),this.#g(a,s,c)}i.on("contextmenu",m=>{typeof this.options.onRowContextMenu=="function"&&(m.preventDefault(),this.options.onRowContextMenu(m,null))}),i.append("span").attr("class","plotter-table-col-resizer").on("mousedown",m=>{m.preventDefault(),m.stopPropagation(),this.#rt(m,s.key,i.node())})}#C(t){let e="plotter-table-th plotter-table-th-leaf";return t.section==="actions"&&(e+=" plotter-table-th-actions-col"),e}#S(t){const e=(this.state.search[t]||"").trim()!=="";return!!this.state.searchOpen[t]||e}#g(t,e,s){const n=e.key,r=t.append("div").attr("class",`plotter-table-search-wrapper${s?" open":""}`).attr("data-column",n).append("div").attr("class","plotter-table-search-field"),a=r.append("span").attr("class","plotter-table-search-icon");this.#o(a,Pt.search,"⌕"),r.append("input").attr("type","search").attr("class","plotter-table-search").attr("data-column",n).attr("placeholder",this.#b("Search")).property("value",this.state.search[n]||"").on("input",l=>{this.state.search[n]=l.target.value,this.state.page=0,this.#c()}).on("keydown",l=>{l.key==="Escape"&&(l.preventDefault(),this.#x(n))}).on("blur",()=>{(this.state.search[n]||"").trim()||this.#x(n)})}#f(t){this.state.searchOpen[t]=!0,this.#v(t);const e=Xt.#ht(t);this.root.querySelector(`.plotter-table-search-wrapper[data-column="${e}"] input`)?.focus()}#x(t){(this.state.search[t]||"").trim()===""&&(this.state.searchOpen[t]=!1,this.#v(t))}#v(t){const e=this.#S(t),s=window.d3.select(this.root),n=Xt.#ht(t);s.select(`.plotter-table-search-wrapper[data-column="${n}"]`).classed("open",e),s.select(`.plotter-table-th[data-column="${n}"] .plotter-table-th-label-host`).classed("plotter-table-th-label-host--hidden",e)}#D(t,e,s,n,i=!1){const r=t.append("tbody").attr("class","plotter-table-body"),a={};if(e.forEach(l=>{Ci(l.gauge)&&(a[l.key]=Hi(n,l))}),!s.length){const l=i?"No matching rows":(this.data.length,"No data");r.append("tr").attr("class","plotter-table-row plotter-table-empty-row").append("td").attr("colspan",Math.max(e.length,1)).attr("class","plotter-table-empty").text(this.#b(l));return}s.forEach((l,c)=>{const h=this._treeGuides?.[c]||null;this.#B(r,e,l,a,"plotter-table-row",c,h)})}#B(t,e,s,n,i,r=0,a=null,l="body"){const c=l==="foot"||Fe(s.row,this._footerTotalRow),h=l==="foot"||c,u={levelZeroBodyRows:this._levelZeroBodyRows,pageRoots:this._pageRoots,footerTotalRow:this._footerTotalRow},d=o_(s,this.config,u);let p=i;(s.synthetic||s.hasChildren)&&(p+=" plotter-table-group-row plotter-table-accordion-row"),c&&(p+=" plotter-table-total-row"),(s.subtotal||s.row&&s.row[Us]||Ll(s.row,this.config))&&(p+=" plotter-table-subtotal-row"),this._displayStripeEnabled&&r%2===1&&(p+=" plotter-table-row--striped");const f=t.append("tr").attr("class",p);if(!s.synthetic&&s.row){this.#$(f,s.row,s.depth);const _=L_(s.row,this.config);_?.className&&f.classed(_.className,!0),_?.style&&typeof _.style=="object"&&Object.entries(_.style).forEach(([g,m])=>{f.style(g,m)})}e.forEach(_=>{const g=rs(_.key),m=g!=null,y=!m&&_.key===this._labelColumnKey;let b="plotter-table-td";(y||m&&g===s.depth)&&(b+=" plotter-table-td-label"),_.section==="actions"&&(b+=" plotter-table-td-actions"),this._frozenOffsets[_.key]!=null&&(b+=" plotter-table-td-frozen"),this._showGroupBrackets&&_.__groupStart&&(b+=" plotter-table-td-group-start"),this._showGroupBrackets&&_.__groupEnd&&(b+=" plotter-table-td-group-end"),l==="foot"&&(b+=" plotter-table-td-foot");const A=f.append("td").attr("class",b).attr("data-column",_.key).style("text-align",_.align);this._frozenOffsets[_.key]!=null&&A.style("left",`${this._frozenOffsets[_.key]}px`);const L=Number(_.width);if(Number.isFinite(L)&&L>0&&(A.style("width",`${L}px`),A.style("max-width",`${L}px`)),m){this.#G(A,s,g);return}if(y){this.#N(A,_,s,a);return}if(!(s.synthetic&&!s.subtotal)&&(this.#I(A,_,s.row,n[_.key],{bodyParity:h,sparklineSourceRows:d,showFooterLabels:!1}),typeof _.renderer=="function"&&s.row))try{_.renderer(s.row,_,A.node())}catch{}})}#$(t,e,s=0){const n=c=>{const h=c?.target;return h instanceof Element?!!h.closest(G1):!1},i=Zo(this.config),r=i.selectedKey,a=e?.unique??e?.id??null;a!=null&&(t.attr("data-row-id",String(a)),t.attr("id",`${this.options.id}-row-${Xt.#ht(String(a))}`)),t.attr("data-depth",String(s??0)),e?.Level_00!=null&&String(e.Level_00).length&&t.attr("data-step",String(e.Level_00)),e?.Segment!=null&&String(e.Segment).length&&t.attr("data-segment",String(e.Segment)),e?._sourceTableKey!=null&&String(e._sourceTableKey).length&&t.attr("data-comparison",String(e._sourceTableKey)),i.enabled&&t.classed("plotter-table-row--selectable",!0),e&&r&&e[r]&&t.classed("plotter-table-row--active",!0);const l=this._highlightedRowId??(typeof this.options.getHighlightedRowId=="function"?this.options.getHighlightedRowId():null);l!=null&&a!=null&&String(l)===String(a)&&t.classed("plotter-table-row--highlighted",!0),t.on("mouseenter",()=>{this._hoveredRow=e,this.#n(t,!0)}),t.on("mousemove",c=>{if(this._hoveredRow=e,typeof this.options.onRowMouseMove!="function")return;const h=c?.target,u=h instanceof Element?h.closest("td[data-kpi]"):null,d=u?.getAttribute?.("data-kpi")||null;this.options.onRowMouseMove(c,e,{kpi:d,cell:u instanceof HTMLElement?u:null})}),t.on("mouseleave",c=>{this.#n(t,!1),this._hoveredRow===e&&(this._hoveredRow=null),typeof this.options.onRowMouseOut=="function"&&this.options.onRowMouseOut(c,e)}),t.on("click",c=>{n(c)||(c?.stopPropagation?.(),typeof this.options.onRowClick=="function"&&this.options.onRowClick(c,e))}),t.on("contextmenu",c=>{n(c)||typeof this.options.onRowContextMenu=="function"&&this.options.onRowContextMenu(c,e)})}#F(t){return(t||[]).map(e=>({...e,section:"footer",aggregate:null}))}#w(t,e,s,n,i=null){if(!Qf(this.config))return;const r=(this._footerColumns||[]).filter(f=>f.visible!==!1),a=this.config?.rows?.totalRowKey,l=i??(a?n.find(f=>f.row&&f.row[a])?.row||s.find(f=>f&&f[a]):null),c=yl(this.config),h=!!l;if(!c&&!h)return;if(h&&l){const f={},_=this.#F(e);_.forEach(y=>{Ci(y.gauge)&&(f[y.key]=Hi(s,y))});const g=t.append("tfoot").attr("class","plotter-table-foot"),m={row:l,depth:0,path:"__plotter-table-total__",synthetic:!1,hasChildren:!1,expanded:!1,depthLabels:[String(Mt(l,this.config)??"")]};this.#B(g,_,m,f,"plotter-table-row plotter-table-foot-row plotter-table-total-row",0,null,"foot");return}if(!c)return;const u={};r.forEach(f=>{Ci(f.gauge)&&(u[f.key]=Hi(s,f))});const p=t.append("tfoot").attr("class","plotter-table-foot").append("tr").attr("class","plotter-table-row plotter-table-foot-row plotter-table-total-row");l&&this.#$(p,l,0),e.forEach(f=>{const _=r.find(b=>b.key===f.key),m=p.append("td").attr("class","plotter-table-td plotter-table-td-foot").attr("data-column",f.key).style("text-align",f.align);if(_){const b=Jo(f,r,this.config),A=l?l[f.key]:Al(s,f.key,b.aggregate),L=l||{[f.key]:A};this.#I(m,b,L,u[f.key],{bodyParity:!0,showFooterLabels:!!rn(b.aggregate),sparklineSourceRows:null});return}if(!h||!l)return;if(f.key===this._labelColumnKey){m.append("span").attr("class","plotter-table-cell-text").text(this.#V(l,f.key,this.#R(l,f)));return}const y=Jo(f,r,this.config);this.#I(m,y,l,null,{bodyParity:!0,sparklineSourceRows:null})})}#G(t,e,s){const n=t.append("span").attr("class","plotter-table-label-content"),i=Array.isArray(e.depthLabels)?e.depthLabels:[],r=s<=(e.depth??0)?String(i[s]??""):"";if(s===e.depth){this.#M(n,e),He(e.row,this.config).length&&n.classed("plotter-table-label-content--peers",!0),this.#J(n,r,{key:st},e.row);return}n.append("span").attr("class","plotter-table-cell-text").text(r)}#N(t,e,s,n=null){const i=t.append("span").attr("class","plotter-table-label-content");if(this._showTreeLines&&n){const l=i.append("span").attr("class","plotter-table-tree-cell"),c=l.append("span").attr("class","plotter-table-tree-indent");(n.ancestorContinues||[]).forEach(u=>{c.append("span").attr("class",`plotter-table-tree-guide${u?" plotter-table-tree-guide-continue":""}`)}),((n.depth??0)>0||s.hasChildren)&&c.append("span").attr("class",`plotter-table-tree-branch${n.isLastSibling?" plotter-table-tree-branch-last":""}`),this.#M(l,s);const h=s.synthetic?String(s.groupValue??""):this.#V(s.row,e.key,this.#R(s.row,e));He(s.row,this.config).length&&i.classed("plotter-table-label-content--peers",!0),this.#J(l,h,e,s.row);return}i.style("padding-left",`${s.depth*$1}px`),this.#M(i,s);const a=s.synthetic?String(s.groupValue??""):this.#V(s.row,e.key,this.#R(s.row,e));He(s.row,this.config).length&&i.classed("plotter-table-label-content--peers",!0),this.#J(i,a,e,s.row)}#R(t,e){const s=Mt(t,this.config);return s!=null&&String(s).trim()!==""?s:t?.[e.key]}#M(t,e){if(If(e,this.config)){const s=t.append("button").attr("type","button").attr("class",`plotter-table-icon-button plotter-table-row-toggle${e.expanded?" expanded":""}`).attr("data-path",e.path).attr("title",this.#b(e.expanded?"Collapse row":"Expand row")).on("click",n=>{n.stopPropagation(),this.#H(e.path,e.expanded,e.row,n)});this.#o(s,e.expanded?Pt.rowExpanded:Pt.rowCollapsed,e.expanded?"▾":"▸");return}be(this.data,this.config)&&t.append("span").attr("class","plotter-table-row-toggle-spacer")}#k(t){return t?.key===st&&this._hierarchyNameField?this._hierarchyNameField:t?.key}#Z(t){if(t&&typeof t=="object")return t;const e=t==null?"":String(t);return this._leafColumns?.find(s=>s.key===e)||{key:e}}#V(t,e,s){const n=this.#Z(e);if(n.key===st||se(n.key)){const i=Mt(t,this.config);return this.#K(t,n,i)}return this.#K(t,n,s)}#H(t,e,s=null,n=null){if(this.followChartVisibility){typeof this.options.onRowClick=="function"&&s&&this.options.onRowClick(n||{currentTarget:null,target:null},s);return}this.state.expanded[t]=!e,this.#c()}#I(t,e,s,n,i=!1){const r=i===!0?{isFooter:!0}:i||{},a=r.isFooter===!0,l=r.bodyParity===!0,c=r.showFooterLabels===!0,h=l||!a,u=r.sparklineSourceRows||null;Ko(this.config).kpiDetail&&e.key!==st&&!se(e.key)&&h&&t.attr("data-kpi",e.key);const p=this.#k(e),f=s?.[p],_=en(s,e),g=en(s,e,qo(e)),m=en(s,e,xf(e)),y=!Number.isNaN(_),b=!Number.isNaN(m),A=gt(e.gauge);if(A.enabled){const C=A.baseline==="zero"||A.baseline==null?0:Number(A.baseline);if(A.type==="gauge"&&A.variant==="overlay"){const S=Bi(g,n,C),w=S>=0;t.classed("plotter-table-td-gauge",!0),t.classed("plotter-table-td-gauge-overlay",!0),t.attr("data-gauge","overlay");const R=t.append("div").attr("class","plotter-table-gauge plotter-table-gauge-overlay").append("div").attr("class",`plotter-table-gauge-fill plotter-table-gauge-fill-${w?"positive":"negative"}`).style("width",`${(Math.abs(S)*50).toFixed(2)}%`);this.#ct(R,A,s,w),S<0?R.style("right","50%"):R.style("left","50%")}else if(A.type==="gauge"){const S=Bi(g,n,C),w=S>=0;t.classed("plotter-table-td-gauge",!0),t.attr("data-gauge","diverging");const R=t.append("div").attr("class","plotter-table-gauge plotter-table-gauge-diverging").append("div").attr("class",`plotter-table-gauge-fill plotter-table-gauge-fill-${w?"positive":"negative"}`).style("width",`${(Math.abs(S)*50).toFixed(2)}%`);this.#ct(R,A,s,w),S<0?R.style("right","50%"):R.style("left","50%")}else if(A.type==="background"){const S=Bi(g,n,C),w=S>=0;t.classed("plotter-table-td-gauge",!0),t.attr("data-gauge","background");const R=t.append("div").attr("class","plotter-table-gauge plotter-table-gauge-background plotter-table-gauge-background-diverging").append("div").attr("class",`plotter-table-gauge-fill plotter-table-gauge-fill-${w?"positive":"negative"}`).style("width",`${(Math.abs(S)*50).toFixed(2)}%`);this.#ct(R,A,s,w),S<0?R.style("right","50%"):R.style("left","50%")}else if(A.type==="circular"){const S=Math.max(0,Math.min(al(Math.abs(g),n),1)),w=g>=0;t.classed("plotter-table-td-gauge",!0),t.classed("plotter-table-td-gauge-circular",!0),t.attr("data-gauge","circular");const R=t.append("div").attr("class","plotter-table-gauge plotter-table-gauge-circular").append("svg").attr("class","plotter-table-gauge-circular-svg").attr("width",20).attr("height",20).attr("viewBox","0 0 20 20"),M=7,k=10,I=2*Math.PI*M,O=R.append("g").attr("class","plotter-table-gauge-circular-rings");O.append("circle").attr("class","plotter-table-gauge-circular-track").attr("cx",k).attr("cy",k).attr("r",M);const F=O.append("circle").attr("class",`plotter-table-gauge-circular-progress plotter-table-gauge-fill-${w?"positive":"negative"}`).attr("cx",k).attr("cy",k).attr("r",M).attr("stroke-dasharray",I.toFixed(2)).attr("stroke-dashoffset",(I*(1-S)).toFixed(2)).attr("transform",`rotate(-90 ${k} ${k})`);this.#ot(F,A,s,w)}else{const S=al(g,n),w=g>=0,N=A.position;t.classed("plotter-table-td-gauge",!0),t.attr("data-gauge",N);const R=t.append("div").attr("class",`plotter-table-gauge plotter-table-gauge-edge plotter-table-gauge-${N}`),M=N==="left"||N==="right",k=R.append("div").attr("class",`plotter-table-gauge-fill plotter-table-gauge-fill-${w?"positive":"negative"}`);M?k.style("height",`${(S*100).toFixed(2)}%`):k.style("width",`${(S*100).toFixed(2)}%`),this.#ct(k,A,s,w)}}const L=At(e.indicator),T=mt(e.sparkline),E=this.#lt(t,e,s,f,_,y,c||a&&!l);T.enabled&&T.position==="left"&&this.#j(t,e,s,u,T,"before",E),L.enabled&&b&&h&&this.#O(E,L,s,e,m,L.position==="left"?"prepend":"append"),T.enabled&&T.position!=="left"&&this.#j(t,e,s,u,T,"after",E)}#O(t,e,s,n,i,r="append"){const a=i>=0,l=e.colorize===!1?"currentColor":Yi(a),c=typeof e.color=="function"?this.#Y({indicator:e},"indicator",s,l):l,u=e.type==="chevron"?a?Pt.chevronUp:Pt.chevronDown:a?Pt.arrowUp:Pt.arrowDown,p=(r==="prepend"?t.insert("span",":first-child"):t.append("span")).attr("class",`plotter-table-indicator plotter-table-indicator-${e.type} plotter-table-indicator-${a?"positive":"negative"}`).style("color",c);this.#o(p,u,"",V1)}#j(t,e,s,n=null,i=null,r="after",a=null){const l=i||mt(e?.sparkline);if(!l.enabled)return;const c=l_(s,e,n);if(!c.length)return;const h=Number(l.width)>0?Number(l.width):40,u=Number(l.height)>0?Number(l.height):16,d=l.type||"line",p=A_(c,u),f=b=>{if(l.colorize===!1)return"rgba(var(--color-dark-rgb), 0.65)";if(typeof l.color=="function")try{const A=l.color({value:b,row:s});if(A)return A}catch{}return Yi(b>=0)},_=r==="before"&&a?.node?.()?t.insert("svg",()=>a.node()):t.append("svg");if(_.attr("class",`plotter-table-sparkline plotter-table-sparkline-${d}`).attr("width",h).attr("height",u).attr("viewBox",`0 0 ${h} ${u}`),p.hasNegative&&_.append("line").attr("class","plotter-table-sparkline-zero-line").attr("x1",0).attr("x2",h).attr("y1",p.zeroY.toFixed(2)).attr("y2",p.zeroY.toFixed(2)),d==="bar"){const b=h/c.length;c.forEach((A,L)=>{const T=p.barForValue(A,b,L);_.append("rect").attr("class","plotter-table-sparkline-bar").attr("x",T.x.toFixed(2)).attr("y",T.y.toFixed(2)).attr("width",T.width.toFixed(2)).attr("height",Math.max(0,T.height).toFixed(2)).style("fill",f(A))});return}const g=c.map((b,A)=>{const L=c.length===1?h/2:A/(c.length-1)*h,T=p.valueToY(b);return`${L.toFixed(2)},${T.toFixed(2)}`}).join(" "),m=c[c.length-1],y=f(m);if(d==="area"){const b=p.hasNegative?p.zeroY:u,A=`0,${b.toFixed(2)} ${g} ${h.toFixed(2)},${b.toFixed(2)}`;_.append("polygon").attr("class","plotter-table-sparkline-area-fill").style("fill",y).style("opacity",.2).attr("points",A)}_.append("polyline").attr("class","plotter-table-sparkline-line").attr("fill","none").attr("stroke",y).attr("stroke-width",1.5).attr("points",g)}#lt(t,e,s,n,i,r,a){const l=a?rn(e.aggregate):null,c=!!l&&(r||n!=null&&n!==""),u=(a?[]:He(s,this.config)).length>0;let d=t;if(c||u){const f=t.append("div").attr("class",c?"plotter-table-kpi-footer":"plotter-table-peer-stack"),_=e.align==="right"?"flex-end":e.align==="center"?"center":"flex-start";f.style("align-items",_),d=f}const p=d.append("span").attr("class","plotter-table-value");if(e.colorized&&r&&(p.classed("plotter-table-value-colorized",!0),p.classed("plotter-table-value-positive",i>=0),p.classed("plotter-table-value-negative",i<0)),p.append("span").attr("class","plotter-table-cell-text").text(this.#V(s,e,n)),c){const f=qf(l);f&&d.append("span").attr("class","plotter-table-kpi-footer-label").text(this.#b(f))}return u&&this.#tt(d,e,s),p}#J(t,e,s,n){const r=He(n,this.config).length?t.append("span").attr("class","plotter-table-peer-stack"):t;r.append("span").attr("class","plotter-table-cell-text").text(e),this.#tt(r,s,n)}#tt(t,e,s){He(s,this.config).forEach(i=>{const r=E_(i,e,(a,l,c)=>this.#K(a,l,c));t.append("span").attr("class","plotter-table-cell-peer-text").text(r)})}#W(t,{pageCount:e,page:s,total:n}){if(!Zf(this.config,n))return;const i=ml(this.config),r=n===0?0:s*i+1,a=Math.min((s+1)*i,n),l=t.append("div").attr("class","plotter-table-pagination"),c=gl(this.config),h=l.append("label").attr("class","plotter-table-pagination-per-page");h.append("span").attr("class","plotter-table-pagination-label").text(this.#b("Rows per page"));const u=h.append("select").attr("class","plotter-table-pagination-select").on("change",f=>{const _=Number(f.target.value)||i;this.config.pagination||(this.config.pagination={}),this.config.pagination.rowsPerPage=_,this.state.page=0,this.#nt(),this.#c()});c.forEach(f=>{u.append("option").attr("value",f).property("selected",Number(f)===i).text(String(f))}),l.append("span").attr("class","plotter-table-page-info").text(this.#b("{from}-{to} of {total}",{from:r,to:a,total:n}));const d=l.append("button").attr("type","button").attr("class","plotter-table-icon-button plotter-table-page-prev").attr("disabled",s<=0?!0:null).attr("title",this.#b("Previous")).on("click",()=>{this.state.page>0&&(this.state.page-=1,this.#c())});this.#o(d,Pt.pagePrev,"‹");const p=l.append("button").attr("type","button").attr("class","plotter-table-icon-button plotter-table-page-next").attr("disabled",s>=e-1?!0:null).attr("title",this.#b("Next")).on("click",()=>{this.state.page<e-1&&(this.state.page+=1,this.#c())});this.#o(p,Pt.pageNext,"›")}#it(t,e){let s=t;const n=e.filter(i=>i.searchable&&(this.state.search[i.key]||"").trim()!=="").map(i=>({key:i.key,term:this.state.search[i.key].trim()}));return n.length&&(s=Hf(s,n.map(({key:i,term:r})=>({key:i===st||se(i)?"text":i,term:r})),(i,r,a)=>r==="text"||r===this._hierarchyNameField?String(Mt(i,this.config)??""):this.#V(i,r,a))),s}#st(t){const e=Array.isArray(t)?t:[];if(!this.#P())return{pageItems:e,pageCount:1,page:0};const s=ml(this.config),n=Math.max(1,Math.ceil(e.length/s)),i=Math.min(Math.max(0,this.state.page),n-1),r=i*s;return{pageItems:e.slice(r,r+s),pageCount:n,page:i}}#Q(t){const{pageItems:e,pageCount:s,page:n}=this.#st(t);return{pageRoots:e,pageCount:s,page:n}}#P(){return this.config?.pagination?.enabled!==!1}#et(t,e=!1){const s=this.#z("header");if(e||c_(this.config)==="multi"){(!this.config.sort||typeof this.config.sort!="object")&&(this.config.sort={mode:"multi",columns:[]}),this.config.sort.mode="multi";const i=Array.isArray(this.config.sort.columns)?[...this.config.sort.columns]:[],r=i.findIndex(a=>a.key===t);r>=0?i[r].direction==="asc"?i[r]={key:t,direction:"desc"}:i.splice(r,1):i.push({key:t,direction:"asc"}),this.config.sort.columns=i,Object.keys(s).forEach(a=>{const l=i.find(c=>c.key===a);l?s[a].sortable=l.direction:(s[a].sortable==="asc"||s[a].sortable==="desc")&&(s[a].sortable=!0)})}else{const i=s[t]?s[t].sortable:!0;let r;i==="asc"?r="desc":i==="desc"?r=!0:r="asc",Object.keys(s).forEach(a=>{a!==t&&(s[a].sortable==="asc"||s[a].sortable==="desc")&&(s[a].sortable=!0)}),this.#U("header",t).sortable=r,this.config.sort&&(this.config.sort.mode="single",this.config.sort.columns=[])}this.state.page=0,this.#nt(),this.#a()}#rt(t,e,s){const n=t.clientX,i=s.getBoundingClientRect().width,r=l=>{const c=Math.max(W1,Math.round(i+(l.clientX-n)));this.#U("header",e).width=c,s.style.width=`${c}px`,s.style.maxWidth=`${c}px`},a=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a),this.#nt(),this.#a()};document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)}#ut(t){if(!Array.isArray(this.config.columnGroups)||!this.config.columnGroups[t])return;const e=this.config.columnGroups[t];e.collapsed=!e.collapsed,this.#nt(),this.#a()}#z(t){return(!this.config[t]||typeof this.config[t]!="object")&&(this.config[t]={}),this.config[t]}#U(t,e){const s=this.#z(t);return s[e]||(s[e]=Lt()),s[e]}#at(t){return Yi(t)}#ct(t,e,s,n){if(typeof e?.color=="function"){t.style("background",this.#Y({gauge:e},"gauge",s,this.#at(n)));return}if(e?.colorize===!1){t.classed("plotter-table-gauge-fill-positive",!1),t.classed("plotter-table-gauge-fill-negative",!1);return}t.classed("plotter-table-gauge-fill-positive",n),t.classed("plotter-table-gauge-fill-negative",!n)}#ot(t,e,s,n){if(typeof e?.color=="function"){t.style("stroke",this.#Y({gauge:e},"gauge",s,this.#at(n)));return}if(e?.colorize===!1){t.classed("plotter-table-gauge-fill-positive",!1),t.classed("plotter-table-gauge-fill-negative",!1),t.style("stroke","currentColor");return}t.classed("plotter-table-gauge-fill-positive",n),t.classed("plotter-table-gauge-fill-negative",!n)}#Y(t,e,s,n){const i=t?.[e]?.color;if(typeof i=="function")try{const r=i(s);if(r)return r}catch{}else if(typeof i=="string"&&i)return i;return n}#K(t,e,s){return Nf(t,e,s,this.options.formatValue)}#b(t,e=null){return typeof t=="string"&&typeof String.prototype.translate=="function"?t.translate(e):t}static#ht(t){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(String(t)):String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}#nt(){typeof this.options.onConfigChange=="function"&&this.options.onConfigChange()}}const Hr={ABSTRACT:Ot,HIERARCHY:Ts,BARS:at,LINES:ct,SCATTER:Ls,AREAS:Cn,MEKKO:Nr,MEKKO100:zc,BUBBLE:Gc,EVENTS:jc,WATERFALL:Ge,TREE:ve,TABLE:Xt,bars:(o,t,e,s,n,i)=>new at(o,t,e,s,n,i),lines:(o,t,e,s,n,i)=>new ct(o,t,e,s,n,i),scatter:(o,t,e,s,n,i)=>new Ls(o,t,e,s,n,i),areas:(o,t,e,s,n,i)=>new Cn(o,t,e,s,n,i),mekko:(o,t,e,s,n,i)=>new Nr(o,t,e,s,n,i),mekko100:(o,t,e,s,n,i)=>new zc(o,t,e,s,n,i),bubble:(o,t,e,s,n,i)=>new Gc(o,t,e,s,n,i),events:(o,t,e,s,n,i)=>new jc(o,t,e,s,n,i),waterfall:(o,t,e,s,n,i)=>new Ge(o,t,e,s,n,i),tree:(o,t,e,s,n,i)=>new ve(o,t,e,s,n,i),table:(o,t,e,s)=>new Xt(o,t,e,s),ICONS:["square","plus","triangle","circle","star","rectangle","dot"],translate(o,t,e){return new Promise((s,n)=>{try{if(o.type==="translate")throw new Error("Bad argument");let i,r,a,l,c,h=!1;if(t)i=t.data,r=t.trace,a=t.root,l=t.callbacks,c=t.hooks;else{const p=o.scales?.x;if(!p?.getScale)throw new Error("Cannot translate trace without a dimension scale");let f=p.getScale();i=e.__parameters__.parent.__parameters__.data.map((_,g)=>({..._,id:_.id||`plotter-element-${String(_[f.value]).hash()}${f.stack?`-${String(_[f.stack]).hash()}`:""}`,__plotter_default_group:"default"})).filter((_,g,m)=>(o?.if||(()=>!0))(_,g,m)&&o._if(_,g,m)),a=e.__nodes__.svg,r=o,l=e.__parameters__.callbacks,c=e.__parameters__.hooks,h=!0}if(r={...r,...o,newInstance:h},t){const p=o?.scales,f=o?.axis;delete r.scales,delete r.axis,p&&(r.scales=p),f&&(r.axis=f)}let u=this[o?.type||"bars"](i,r,a,l,c,t?.plot||e),d=new Promise(p=>p());return t&&(d=u.from(t)),d.then(()=>{s(u)})}catch(i){n(i)}})},getIcon(o,t){let e=window.d3.path();switch(o){case"square":return e.rect(0,0,t,t),e;case"rectangle":return e.rect(0,0,t/2,t),e;case"star":return window.d3.symbol().type(window.d3.symbolStar).size(t);case"plus":return window.d3.symbol().type(window.d3.symbolPlus).size(t*2);case"triangle":return window.d3.symbol().type(window.d3.symbolTriangle2).size(t);case"dot":return e.arc(t/4,t/4,t/4,0,2*Math.PI),e;default:return e.arc(t/2,t/2,t/2,0,2*Math.PI),e}}};window.layers=Hr;const Br="data-menu-target-mode",zr="data-menu-target";function j1(o){switch(o){case K.BAR:case K.LINE:case K.POINT:case K.LEGEND:return"series";case K.BAR_LABEL:return"labels";case K.LINE_END_LABEL:return"endLabels";case K.AXIS:case K.AXIS_TITLE:return"axis";default:return null}}function lh(o,t){const e=String(t).toLowerCase(),s=i=>i!=null&&String(i).toLowerCase()===e,n=[];return o.querySelectorAll("path.plotter-trace-element-path").forEach(i=>{s(i.getAttribute("data-fill")||i.getAttribute("fill"))&&n.push(i.closest(".plotter-trace-element")||i)}),o.querySelectorAll("path.plotter-trace-group-path").forEach(i=>{(s(i.getAttribute("stroke"))||s(i.getAttribute("data-fill")))&&n.push(i)}),o.querySelectorAll("path.plotter-area-line").forEach(i=>{s(i.getAttribute("stroke"))&&n.push(i,i.parentNode.querySelector("path.plotter-trace-group-path"))}),o.querySelectorAll(".plotter-line-end-label, .plotter-legend").forEach(i=>{s(i.__data__?.color)&&n.push(i)}),n}function U1(o,t,{event:e,color:s}){if(t==="series")return s?lh(o,s):[];if(t==="labels")return[...o.querySelectorAll("text.plotter-bar-label")];if(t==="endLabels")return[...o.querySelectorAll(".plotter-line-end-label")];const n=e?.target instanceof Element?e.target.closest("g.plotter-axis"):null;return n?[n]:[]}function Y1({plotterParent:o,hit:t,event:e,color:s=null}){const n=()=>{};if(o?.__parameters__?.isSettingsEditMode?.()===!1)return n;const i=j1(t),r=ch(o);return!i||!r?n:hh(r,i,U1(r,i,{event:e,color:s}))}function K1(o,t){const e=ch(o);if(!e||e.hasAttribute(Br))return()=>{};const s=t.shape?[...e.querySelectorAll("path.plotter-trace-element-path")].filter(n=>n.getAttribute("data-x")===String(t.shapeValue)).map(n=>n.closest(".plotter-trace-element")||n):lh(e,t.color);return hh(e,"series",s)}function ch(o){const t=o?.__node__;return t instanceof Element?t.closest(".plotter")||t.querySelector(".plotter"):null}function hh(o,t,e){return e.length?(e.forEach(s=>s.setAttribute(zr,"")),o.setAttribute(Br,t),()=>{o.removeAttribute(Br),o.querySelectorAll(`[${zr}]`).forEach(s=>{s.removeAttribute(zr)})}):()=>{}}const X={ITEM_HEIGHT:20,GAP_BETWEEN_SECTIONS:10,ICON_SIZE_DEFAULT:16,SHAPE_INK:"#1F2937",ICON_SIZE_LARGE:30,ICON_SIZE_EXTRA_LARGE:50,LEGEND_WIDTH_DEFAULT:16,LEGEND_HEIGHT_THICK:16,LEGEND_HEIGHT_THIN:2,VIEWBOX_SIZE:24,VIEWBOX_OFFSET:-2,CIRCLE_RADIUS:8,LINE_WIDTH:2,FONT_SIZE_BREAKPOINTS:{WIDE:{min:200,size:14},MEDIUM:{min:150,size:13},NARROW:{min:100,size:12},SMALL:{min:80,size:11},MINIMUM:{min:0,size:10}}},X1="http://www.w3.org/2000/svg",Z1="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",Q1="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";function uh(o){if(!o)return!1;let t=!!(o._hidden||o.trace?.filteredGraphElements?.includes(o.name));return o.name===o.trace?.scales?.y?.value&&o.trace?._metricHidden&&(t=!0),t}function dh(o,t){if(!o)return o;o.setAttribute("width",String(X.ICON_SIZE_DEFAULT)),o.setAttribute("height",String(X.ICON_SIZE_DEFAULT)),o.setAttribute("viewBox",`0 0 ${X.VIEWBOX_SIZE} ${X.VIEWBOX_SIZE}`),o.setAttribute("fill","currentColor"),o.setAttribute("aria-hidden","true"),x.clear(o);const e=document.createElementNS(X1,"path");return e.setAttribute("d",t?Z1:Q1),o.appendChild(e),o}class ph extends ht{#t=()=>{};#e=null;get logger(){try{return this.__parameters__?.plot?.logger}catch{return}}constructor(...t){super(...t)}update(){return new Promise((t,e)=>{try{let s={width:this.__parameters__.plot.layer.configuration.legends.size*this.__parameters__.plot.layer.width,height:this.__parameters__.plot.layer.height-20};const n=Ce(this.__parameters__.plot.layer.configuration),i=n==="top"||n==="bottom",r=["plotter-legends"];i&&r.push("plotter-legends-horizontal"),this.__nodes__.legends=x.getNode("div",this.__parameters__.id,r,null,{style:i?`width: 100%;height: auto;max-height: ${Math.max(Math.round(s.height*.25),48)}px;overflow: auto;box-sizing: border-box;`:`width: ${s.width}px;height: ${s.height-20}px;overflow-y: auto;box-sizing: border-box;`});const a=this.__parameters__.plot.__parameters__.parent,l=this.__parameters__.plot.__nodes__?.svg?.node?.(),c=i?a.getChromeRegionNode("legend"):l?.parentNode;if(!c){t();return}n==="left"?c.prepend(this.__nodes__.legends):c.append(this.__nodes__.legends),this.__node__=this.__nodes__.legends,this.#a(this.__nodes__.legends,a),this.#e=this.#h();const h=d3.select(this.__node__).selectAll("div.plotter-legends-layout").data([null]).join("div").attr("class","plotter-legends-layout"),u=h.selectAll("div.plotter-legends-list").data([null]).join("div").attr("class","plotter-legends-list");h.selectAll("div.plotter-legends-actions").data([null]).join("div").attr("class","plotter-legends-actions"),this.#A(),this.data=this._prepareLegendData(),this.__nodes__.legend=u.selectAll("div.plotter-legend").data(this.data,d=>d?.name+d?.color).join(d=>this._handleEnter(d),d=>this._handleUpdate(d),d=>d.remove()),requestAnimationFrame(()=>{this.#A()}),t()}catch(s){e(s)}})}getData(){return this.data||[]}refresh(){return this.data=this._prepareLegendData(),this.update()}_prepareLegendData(){const t=[],e=[],s=[],n=[],i=this.__parameters__.plot.getCurrentTraces(),r=this.#L(this.#e);let a,l;return Array.isArray(i)?(i.forEach(c=>{if(c.legend!==!1&&c.opacity!==0){const h=c.scales?.x,u=c.scales?.y;if(!h?.baseRange||!u?.baseRange)return;if(a||(this.__parameters__.plot.layer.configuration.legends.position==="left"?a=0:this.__parameters__.plot.layer.configuration.legends.position==="right"&&(a=Math.max(...h.baseRange))),l||(l=Math.min(...u.baseRange)),c.type==="events"){const d=c.calendar?.type||"Event_type";let p=(c.events??[]).filter(y=>y?.[d]),f=[],_=new Set;p.forEach(y=>{const b=y[d];_.has(b)||(_.add(b),f.push({type:b}))});const g=[..._],m=c.colors??Q.generateGoldenRatioColors(g,!0,!0);f.forEach(y=>{e.some(b=>b.name===y.type)||(l+=20,e.push({name:y.type,color:m[y.type],trace:c,x:a,y:l,_hidden:!1}))})}if(typeof c.color=="function"){const d=this.__parameters__.plot.__parameters__.parent.__parameters__.data.filter((g,m,y)=>c.if?c.if(g,m,y):!0).map((g,m,y)=>c.color(g,m,y,c)).filter(g=>g!=null).unique();let p;c.x.texts&&c.x.textsAsLegend!==!1&&(p=this.__parameters__.plot.__parameters__.parent.__parameters__.data.filter((g,m,y)=>c.if?c.if(g,m,y):!0).map((g,m,y)=>Array.isArray(c.x.texts)?c.x.texts[m]:typeof c.x.texts=="function"?c.x.texts(g,m,y):g[c.x.texts]).filter(g=>g).unique());let f;const _=d.some(g=>String(g).indexOf("#")===0);c.colors?f=c.colors:f=Q.generateGoldenRatioColors(d,!0,!0),d.forEach((g,m)=>{const y=_?c.name:p?p[m]:g,b=_?g:f[g];if(!t.some(A=>A.name===y||A.color===b)){l+=X.ITEM_HEIGHT;let A={name:y,color:b,trace:c,secondDimensionKey:c?.scales?.x?.stack||null,x:a,y:l,_hidden:!1};_&&(A.id=y,A.dimension=!0),t.push(A)}})}else c.name&&(t.some(d=>d.name===c.name)||(l+=X.ITEM_HEIGHT,t.push({id:c.name+"-legend",name:c.name,color:c.color,trace:c,x:a,y:l,_hidden:!1})))}}),this.#e&&t.sort((c,h)=>{const u=this.#m(c?.name,h?.name);return r==="desc"?-u:u}),t.length&&(l+=X.GAP_BETWEEN_SECTIONS),i.forEach(c=>{const h=c.scales?.x,u=c.scales?.y;if(!(!h||!u)){if(c.type==="bubble"){if(c.bubbleShapes){const d=this.__parameters__.plot.layer.configuration.reverse===!0;Vc(h._uniqueValue||[],d).forEach((p,f)=>{l+=X.ITEM_HEIGHT,s.push({name:String(typeof c.bubbleShapeLabel=="function"?c.bubbleShapeLabel(p):p),id:`bubble-shape-${p}`,color:X.SHAPE_INK,shape:Ir[f],shapeValue:p,trace:c,x:a,y:l,_hidden:!1})})}return}if(c.type==="scatter"&&c.as==="icons"&&c.legend!==!1){const d=h._uniqueValue;if(!Array.isArray(d))return;d.forEach((p,f)=>{s.some(_=>_.icon&&_.id===p)||(l+=X.ITEM_HEIGHT,s.push({name:p,id:p,color:"grey",icon:Hr.ICONS[f],trace:c,x:a,y:l,_hidden:!1}))})}else if(!c.scales?.y2&&u.legend!==!1&&c.legend!==!1){const d=c.type+(u.label||u.value);c.opacity!==0&&!s.some(p=>p.id===d)&&(l+=X.ITEM_HEIGHT,s.push({name:u.label||u.value,id:d,color:"grey",trace:c,x:a,y:l,_hidden:!1}))}}}),n.push(...t,...e,...s),n.forEach(c=>{const h=this.__parameters__.plot.layer.filters;if(h){const u=c?.trace?.scales?.x?.stack||c?.trace?.scales?.x?.value,d=Array.isArray(h.traces)?h.traces:[],p=Array.isArray(h.metrics)?h.metrics:[],f=h.dimensions&&typeof h.dimensions=="object"?h.dimensions:{};c.id!=null?c.dimension?d.includes(c.name)?(c._hidden=!0,c.trace._opacity=0):(c._hidden=!1,delete c.trace._opacity):p.includes(c?.trace?.scales?.y?.value)?(c._hidden=!0,c.trace._opacity=0):(c._hidden=!1,delete c.trace._opacity):f[u]&&f[u].includes(c.name)?c._hidden=!0:c._hidden=!1}}),n.map(c=>{const h=this.data?.find(u=>c.id!=null?u.id===c.id:u.name===c.name);return h?Object.assign(h,c):c})):n}_handleEnter(t){try{const e=t.append("div");return e.attr("class",r=>r._hidden?"plotter-legend legend-disabled":"plotter-legend").style("opacity",r=>r._hidden?.3:1).style("cursor",r=>r.shape?"default":"pointer").on("click",(r,a)=>{r.stopPropagation(),this.#s(r,a)}).on("mouseenter",(r,a)=>{d3.select(r.currentTarget).select(".plotter-legend-eye").style("display",a.shape?"none":"inline-block"),this.#t(),a._hidden||(this.#t=K1(this.__parameters__.plot.__parameters__.parent,a))}).on("mouseleave",r=>{d3.select(r.currentTarget).select(".plotter-legend-eye").style("display","none"),this.#t(),this.#t=()=>{}}),e.append("svg").attr("viewBox",`${X.VIEWBOX_OFFSET} ${X.VIEWBOX_OFFSET} ${X.VIEWBOX_SIZE} ${X.VIEWBOX_SIZE}`).append("path").attr("d",this.#i).attr("transform",r=>r.shape?`translate(${X.CIRCLE_RADIUS}, ${X.CIRCLE_RADIUS})`:null).attr("opacity",r=>r.trace.opacity!=null?r.trace.opacity:1).attr("stroke",r=>r.color).attr("stroke-width",r=>["plus","triangle","star"].includes(r.icon)?2:1).attr("fill",r=>r.trace?.dashWidth?"transparent":r.color).attr("stroke-dasharray",r=>{if(!r.trace?.dashWidth)return null;let a,l;return typeof r.trace.dashWidth=="function"?a=r.trace.dashWidth(r):typeof r.trace.dashWidth=="object"&&r.trace.dashWidth?a=r.trace.dashWidth[r.group]:Array.isArray(r.trace.dashWidth)?a=r.trace.dashWidth[0]:a=r.trace.dashWidth||X.LEGEND_WIDTH_DEFAULT,typeof r.trace.dashGap=="function"?l=r.trace.dashGap(r):typeof r.trace.dashGap=="object"&&r.trace.dashGap?l=r.trace.dashGap[r.group]:Array.isArray(r.trace.dashGap)?l=r.trace.dashGap[0]:l=r.trace.dashGap||X.LEGEND_WIDTH_DEFAULT,`${a/2} ${l/2}`}).attr("stroke-dashoffset",r=>r.trace?.dashWidth?r.trace?.dashWidth||r.trace?.dashGap?0:X.LEGEND_WIDTH_DEFAULT:null).style("filter",r=>r._hidden?"grayscale(100%)":null),e.append("span").each((r,a,l)=>l[a].replaceChildren(pa(r.name))),e.append("svg").attr("class","plotter-legend-eye").style("display","none").each(function(r){dh(this,uh(r))}).on("click",(r,a)=>{r.stopPropagation(),this.#s(r,a)}),e}catch(e){this.logger?.error(e)}}_handleUpdate(t){try{return t.attr("class",i=>i._hidden?"plotter-legend legend-disabled":"plotter-legend").style("opacity",i=>i._hidden?.3:1).style("cursor","pointer"),t.select("svg path").attr("d",this.#i).attr("transform",i=>i.shape?`translate(${X.CIRCLE_RADIUS}, ${X.CIRCLE_RADIUS})`:null).attr("opacity",i=>i.trace.opacity!=null?i.trace.opacity:1).attr("stroke",i=>i.color).attr("stroke-width",i=>["plus","triangle","star"].includes(i.icon)?2:1).attr("fill",i=>i.trace?.dashWidth?"transparent":i.color).attr("stroke-dasharray",i=>{if(!i.trace?.dashWidth)return null;let r,a;return typeof i.trace.dashWidth=="function"?r=i.trace.dashWidth(i):typeof i.trace.dashWidth=="object"&&i.trace.dashWidth?r=i.trace.dashWidth[i.group]:Array.isArray(i.trace.dashWidth)?r=i.trace.dashWidth[0]:r=i.trace.dashWidth||X.LEGEND_WIDTH_DEFAULT,typeof i.trace.dashGap=="function"?a=i.trace.dashGap(i):typeof i.trace.dashGap=="object"&&i.trace.dashGap?a=i.trace.dashGap[i.group]:Array.isArray(i.trace.dashGap)?a=i.trace.dashGap[0]:a=i.trace.dashGap||X.LEGEND_WIDTH_DEFAULT,`${r/2} ${a/2}`}).attr("stroke-dashoffset",i=>i.trace?.dashWidth?i.trace?.dashWidth||i.trace?.dashGap?0:X.LEGEND_WIDTH_DEFAULT:null).style("filter",i=>i._hidden?"grayscale(100%)":null),t.select("span").attr("text-anchor","start").attr("alignment-baseline","hanging").attr("font-size",()=>{const r=this.__parameters__.plot.layer.configuration.legends.size*this.__parameters__.plot.layer.width;return this.#l(r)}).attr("title",i=>i.name).each((i,r,a)=>a[r].replaceChildren(pa(i.name))),t.select(".plotter-legend-eye").attr("title",i=>i._hidden?"Show":"Hide").each(function(i){dh(this,uh(i))}),t}catch(e){this.logger?.error(e)}}#s(t,e){try{return!e||e.shape?void 0:(this.#r(e),this.#n(e,t),this.__parameters__.plot._update())}catch(s){this.logger?.error(s)}}toggleEntry(t){return this.#s(null,t)}isolateEntry(t){try{return t?(this.getData().forEach(e=>{const s=e===t||e?.name===t.name&&e?.trace===t.trace;!!e?._hidden!=!s&&(this.#r(e),this.#n(e,null))}),this.__parameters__.plot._update()):void 0}catch(e){this.logger?.error(e)}}#n(t,e){typeof this.__parameters__.plot.__parameters__.callbacks?.onToggleLegendElement=="function"&&this.__parameters__.plot.__parameters__.callbacks.onToggleLegendElement(t,t?.trace?.scales?.x?.stack||t?.trace?.scales?.x?.value,this.__parameters__.plot.layer.filters,e)}#r(t){t._hidden=!t._hidden,t.id!=null&&(t._hidden?t.trace._opacity=0:delete t.trace._opacity);let e=this.__parameters__.plot.layer.filters||{};if((!e.dimensions||typeof e.dimensions!="object")&&(e.dimensions={}),Array.isArray(e.metrics)||(e.metrics=[]),Array.isArray(e.traces)||(e.traces=[]),t.id==null){const s=t.name;let n;if(t.trace.type==="events"?n=t.trace.calendar.type:n=t?.trace?.scales?.x?.stack||t?.trace?.scales?.x?.value,e.dimensions[n])if(!e.dimensions[n].includes(s))e.dimensions[n].push(s);else{const i=e.dimensions[n].indexOf(s);e.dimensions[n].splice(i,1)}else e.dimensions[n]=[s]}else if(t.dimension)if(!e.traces.includes(t.name))e.traces.push(t.name);else{const s=e.traces.indexOf(t.name);e.traces.splice(s,1)}else{const s=t?.trace?.scales?.y?.value;if(!e.metrics.includes(s))e.metrics.push(s);else{const n=e.metrics.indexOf(s);e.metrics.splice(n,1)}}this.__parameters__.plot.layer.filters=e}#i(t){if(t.shape)return $c(t.shape,X.CIRCLE_RADIUS);const e=window.d3.path();if(!t.group){let[s,n]=[X.LEGEND_WIDTH_DEFAULT,["bars","mekko","mekko100","areas","bubble"].includes(t.trace.type)?X.LEGEND_HEIGHT_THICK:X.LEGEND_HEIGHT_THIN];if(t.trace.type==="scatter")if(t.trace.as==="icons"){let i=X.ICON_SIZE_DEFAULT;["plus"].includes(t.icon)&&(i=X.ICON_SIZE_LARGE),["triangle","star"].includes(t.icon)&&(i=X.ICON_SIZE_EXTRA_LARGE);const r=Hr.getIcon(t.icon,i);return typeof r=="function"?r():r}else!t.trace.as||t.trace.as==="circle"||t.trace.as==="dot"?e.arc(X.CIRCLE_RADIUS,X.CIRCLE_RADIUS,X.CIRCLE_RADIUS,0,3.14*2):t.trace.as==="line-h"?e.rect(0,7,X.LEGEND_WIDTH_DEFAULT,t.trace.height/2||X.LEGEND_HEIGHT_THIN):t.trace.as==="line-v"&&e.rect(7,0,X.LINE_WIDTH,X.LEGEND_WIDTH_DEFAULT);else t.trace?.dashWidth&&(n=0),e.rect(s===X.LINE_WIDTH?9:0,n===X.LEGEND_HEIGHT_THIN?9:0,s,n);return e}}#a(t,e){!(t instanceof HTMLElement)||t.dataset.plotterLegendContextMenuBound==="true"||(t.dataset.plotterLegendContextMenuBound="true",t.addEventListener("contextmenu",s=>{const n=e?.__instance__?.contextMenu;if(!n)return;s.preventDefault(),s.stopPropagation();const i=s.target instanceof Element?s.target.closest("div.plotter-legend"):null;n.render(s,{[Va]:!0,legendEntry:i?.__data__??null},null)}))}#l(t){const e=X.FONT_SIZE_BREAKPOINTS;return t>e.WIDE.min?e.WIDE.size:t>e.MEDIUM.min?e.MEDIUM.size:t>e.NARROW.min?e.NARROW.size:t>e.SMALL.min?e.SMALL.size:e.MINIMUM.size}#h(){const t=this.__parameters__.plot.getCurrentTraces();for(const e of t){const s=e?.scales?.x?.stack||null;if(s)return s}return null}#p(t){if(!t)return!1;const e=this.__parameters__.plot.getCurrentTraces();for(const s of e){if(s?.scales?.x?.stack!==t)continue;const i=s?.scales?.x?._stackDistribution||{};if(Object.values(i).some(a=>a.length>1))return!0}return!1}#y(t){if(!t)return!1;const s=this.__parameters__.plot.getCurrentTraces().filter(n=>n?.scales?.x?.stack===t);return s.length?s.every(n=>n?.scales?.x?.stackSortable!==!1):!1}#L(t){if(!t||!this.#y(t))return null;const e=this.__parameters__.plot.layer.configuration.sort.stack;return e.name!==t?"asc":e.direction||"asc"}#T(t){if(!this.#y(t))return;const s=this.#L(t)==="asc"?"desc":"asc";this.__parameters__.plot.layer.configuration.sort.stack={name:t,direction:s},this.__parameters__.plot.__parameters__?.parent?.markSettingsPersistDirty?.(),typeof this.__parameters__.plot.__parameters__?.callbacks?.onSort=="function"&&this.__parameters__.plot.__parameters__.callbacks.onSort({source:"legend",scale:t,direction:s}),this.update().then(()=>new Promise(n=>requestAnimationFrame(n))).finally(()=>{this.__parameters__.plot._update()})}#u(t){if(!this.#y(t))return null;const e=this.__parameters__.plot.layer.configuration.sort.stack;return!t||e?.name!==t?null:e.direction}#c(t){return`value-by-${t==="desc"?"desc":"asc"}-svg`}#m(t,e){const s=this.#o(t),n=this.#o(e);return s!=null&&n!=null?s-n:String(t??"").localeCompare(String(e??""))}#o(t){if(t==null)return null;const e=W.detectDateFormat(t);if(!e)return null;try{const s=W.fromFormat(t,e).getTimestamp();return Number.isNaN(s)?null:s}catch{return null}}#A(){const t=this.#e,e=this.#y(t),s=this.#p(t),n=t&&s&&e?[{key:t,visualDirection:this.#u(t)}]:[];d3.select(this.__node__).select(".plotter-legends-actions").selectAll("button.plotter-legend-sort-control").data(n,r=>r.key).join(r=>r.append("button").attr("type","button").attr("class","plotter-legend-sort-control").on("click",(a,l)=>{a.preventDefault(),a.stopPropagation(),this.#T(l.key)}),r=>r,r=>r.remove()).attr("title","Click to sort segments".translate()).attr("aria-label","Click to sort segments".translate()).each((r,a,l)=>{const c=this.#c(r.visualDirection),h=D.get(c,{size:16,fill:"#000000"}),u=l[a];u.replaceChildren(),h&&u.appendChild(h.cloneNode(!0))})}}const fh=12,_h=.45,q1=.5,J1=3,ty=.5,ey=1,je=1;class v{static#t=20;static#e=9.6;static#s=3.6;static#n=2.2;static#r=.8;static#i=3;static#a=4;static HIERARCHY_LEVEL_GAP_FACTOR=Ji;static#l(t){const e=t.map(i=>Number(i.tick?.width)||0),s=t[0]?.tick?.font,n=s?rt.computeRenderWidth("0",s):0;return Math.max(0,...e)*2+n}static isTitleShownForAxis(t,e){return t==="none"||t===!1?!1:t==="metric"?!e?.dimension:t==="dimension"?!!e?.dimension:!0}static resolveThinnedLabelStep(t,e,s){const n=Math.max(0,...t.map(r=>rt.computeRenderWidth(String(r??""),s))),i=e/Math.max(t.length,1);return i>0?Math.max(1,Math.ceil(n*v.THINNED_LABEL_SLOT_EM/i)):1}static resolveFlatDimensionLabelLayout(t,e,s,n="auto"){const i=p=>rt.computeRenderWidth(p,s),r=(Array.isArray(t)?t:[]).map(p=>String(p??"")),a=p=>({mode:"rotate",lines:1,angle:p,maxLength:Math.min(Math.max(0,...r.map(i)),(Number(s?.size)||12)*v.FLAT_LABEL_ROTATED_MAX_EM)});if(n==="horizontal")return{mode:"single",lines:1,maxLength:Math.max(0,e/v.FLAT_LABEL_SLACK)};if(n==="diagonal")return a(v.FLAT_LABEL_ROTATION_DEG);if(n==="vertical")return a(90);const l=r.map(p=>p.split(`
|
|
717
|
+
`)),c=Math.max(1,...l.map(p=>p.length)),h=p=>i(p)*v.FLAT_LABEL_SLACK<=e;if(l.every(p=>p.every(h)))return{mode:"single",lines:c,maxLength:0};const u=p=>{const f=p.split(/\s+/).filter(Boolean);if(f.some(m=>!h(m)))return 1/0;let _=1,g="";return f.forEach(m=>{const y=g?`${g} ${m}`:m;g&&!h(y)?(_+=1,g=m):g=y}),_},d=Math.max(...r.map(u));return c===1&&d<=v.FLAT_LABEL_MAX_LINES?{mode:"wrap",lines:d,maxLength:0}:a(v.FLAT_LABEL_ROTATION_DEG)}static truncateFlatDimensionLabel(t,e,s){const n=String(t??"");if(!(e>0)||rt.computeRenderWidth(n,s)<=e)return n;let i=n.length;for(;i>1&&rt.computeRenderWidth(`${n.slice(0,i).trimEnd()}…`,s)>e;)i-=1;return`${n.slice(0,i).trimEnd()}…`}static resolveFlatLabelExtent(t){return Math.max(0,...(Array.isArray(t)?t:[]).map(({tick:e}={})=>{const s=Number(e?.font?.size)||12;if(e?.rotated&&e?.fullText!=null){const n=(e.rotationDeg??v.FLAT_LABEL_ROTATION_DEG)*Math.PI/180;return(Number(e.font?.width)||0)*Math.sin(n)+s}return e?.hierarchyDepth==null&&Number(e?.hierarchyLabelMaxLines)>1?e.hierarchyLabelMaxLines*s*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR:0}))}static FLAT_LABEL_SLACK=1.1;static FLAT_LABEL_MAX_LINES=2;static THINNED_LABEL_SLOT_EM=1.25;static FLAT_LABEL_MID_LINE_EM=.65;static FLAT_LABEL_ROTATION_DEG=45;static FLAT_LABEL_ROTATED_MAX_EM=11;static SIDE_LABEL_MAX_WIDTH_RATIO=.25;static resolveSideLabelMaxWidth(t){return Math.max(0,Math.round((Number(t)||0)*v.SIDE_LABEL_MAX_WIDTH_RATIO))}static MEASURE_TICK_SPACING_PX=90;static HIERARCHY_LEAF_COLUMN_MIN_FACTOR=5;static HIERARCHY_LABEL_LINE_HEIGHT_FACTOR=1.3;static HIERARCHY_LABEL_MIN_SLOT_FACTOR=2.5;static HIERARCHY_TREE_LINE_BAND_FACTOR=.9;static HIERARCHY_LABEL_WIDTH_SLACK=2;static#h=null;static#p=null;static resolveHierarchyTextFontFamily(){if(v.#p)return v.#p;let t="";try{const e=document.querySelector(".plotter-tick-text");e instanceof Element&&(t=window.getComputedStyle(e).fontFamily||"")}catch{t=""}return t&&(v.#p=t),t}static measureHierarchyTextWidth(t,e={}){const s=t==null?"":String(t);if(!s.length)return 0;const n=Number(e?.size),i=Number.isFinite(n)&&n>0?n:10,r=e?.weight!=null&&e.weight!==""?e.weight:400;try{v.#h==null&&(v.#h=document.createElement("canvas").getContext("2d"));const l=v.#h;if(l&&typeof l.measureText=="function"){const c=e?.family||v.resolveHierarchyTextFontFamily();l.font=`${r} ${i}px ${c||"sans-serif"}`;const h=l.measureText(s).width;if(Number.isFinite(h)&&h>0)return h}}catch{}const a=rt.computeRenderWidth(s,{...e,size:i});return Number.isFinite(a)&&a>=0?a:0}static fitHierarchyLabelFont(t={}){const e=t.font||{},s=Number(e.size),n=Number.isFinite(s)&&s>0?s:10,i=t.text==null?"":String(t.text),r=Math.max(Number(t.availableWidth)||0,0),a=Number(t.maxLines),l=Number.isFinite(a)&&a>=1?Math.round(a):2,c=Number(t.minSize),h=Number.isFinite(c)&&c>0?c:8,u=t.autoSize!==!1,d=typeof t.measureText=="function"?t.measureText:v.measureHierarchyTextWidth,p=A=>{const L=d(i,{...e,size:A});return Number.isFinite(L)&&L>=0?L:0};let f=p(n);if(!i.length||r<=0)return{size:n,width:f,lines:1,hidden:!1,requiredSize:n};let _=n,g=n;const m=l*r;f>m&&f>0&&(g=n*(m/f),u&&(_=Math.max(h,Math.min(n,Math.floor(g))),_!==n&&(f=p(_))));const y=r<_*v.HIERARCHY_LABEL_MIN_SLOT_FACTOR,b=Math.min(l,Math.max(1,Math.ceil(f/r)));return{size:_,width:f,lines:b,hidden:y,requiredSize:g}}static resolveHierarchyRowPlan(t={}){const e=Array.isArray(t.ticks)?t.ticks:[],s=Math.max(Number(t.maxDepth)||0,0),n=t.font||{},i=Number(n.size),r=Number.isFinite(i)&&i>0?i:10,a=t.axisPosition??"bottom",l=t.isReverse===!0,c=t.labelRules||{},h=Number(c.maxLines),u=Number.isFinite(h)&&h>=1?Math.round(h):2,d=Number(c.minSize),p=Number.isFinite(d)&&d>0?d:8,f=c.autoSize!==!1,_=typeof t.measureText=="function"?t.measureText:v.measureHierarchyTextWidth,g=new Map;for(let m=0;m<=s;m+=1){if(v.shouldRotateWaterfallLastLevelTick(m,s,a,l)){g.set(m,{size:r,lines:1,hidden:!1,rotated:!0});continue}let b=r,A=1,L=0,T=0;for(let E=0;E<e.length;E+=1){const C=e[E]?.tick;if(!C||Math.max(Number(C.hierarchyDepth)||0,0)!==m)continue;T+=1;const S=v.fitHierarchyLabelFont({text:C.text,font:{...n,size:r},availableWidth:C.availableSpace,maxLines:u,minSize:p,autoSize:f,measureText:_});S.requiredSize<p&&(L+=1),b=Math.min(b,S.size),A=Math.max(A,S.lines)}g.set(m,{size:T?Math.max(b,p):r,lines:Math.min(u,A),hidden:T>0&&L*2>T,rotated:!1})}for(let m=1;m<=s;m+=1){const y=g.get(m),b=g.get(m-1);!y||!b||(y.size=Math.min(y.size,b.size),b.hidden&&(y.hidden=!0))}return g}static HIERARCHY_AXIS_RESERVE_MARGIN=4;static BOTTOM_AXIS_TEXT_BASE_MULTIPLIER=1.5;static HIERARCHY_HORIZONTAL_ROW_HEIGHT_FACTOR=2.6;static HIERARCHY_REVERSE_LANE_MIN_FACTOR=6;static HIERARCHY_REVERSE_LANE_MAX_FACTOR=10;static HIERARCHY_REVERSE_LANE_LINE_CLAMP=2;static HIERARCHY_REVERSE_RESERVED_LEVEL_COUNT=1;static#y=4;static resolveWaterfallTopLineReserveForTitle({plot:t,scale:e,splitValue:s}={}){let n=0;if(typeof t?.getWaterfallTopLineReservedSpace=="function"&&(n=Math.max(0,t.getWaterfallTopLineReservedSpace())),n>0)return n;const i=typeof e?.getWaterfallSplitTopPaddingMap=="function"?e.getWaterfallSplitTopPaddingMap():null;return!(i instanceof Map)||i.size===0?0:s!=null&&i.has(s)?Math.max(0,i.get(s)??0):Math.max(0,...i.values())}static resolveTopLeftOverlayTitleY({topOfAxis:t,topLineReserve:e=0,paddingTop:s=0,titleFontSize:n=0}={}){const i=v.#y,r=Number.isFinite(t)?t:0,a=Math.max(0,Number(e)||0),l=Math.max(0,Number(s)||0),c=Math.max(0,Number(n)||0),h=i+c;return a>0?r-a-h:Math.min(r-h,l+i-c)}static resolveTopLeftOverlayTitleX({plotLeft:t,axisOriginX:e}={}){const s=Number.isFinite(t)?t:0,n=Number.isFinite(e)?e:0;return s-n}static formatMeasureValue(t,e="",{relative:s=!1,format:n=null}={}){const i=e==="%"&&!s?t*100:t;return Ut(i,{unit:e,format:n})}static estimateWaterfallBottomTickExtent(t,e,s,n=0,i={}){const r=Math.max(Number(t)||0,0),a=Number.isFinite(Number(e))&&e>0?Number(e):10,l=Number.isFinite(Number(s))&&s>0?Number(s):v.HIERARCHY_LEVEL_GAP_FACTOR,c=i.axisPosition??"bottom",h=i.isReverse===!0,u=Number(i.maxLines),d=Number.isFinite(u)&&u>=1?Math.round(u):er,p=Number(i.usedLines),f=Number.isFinite(p)&&p>=1?Math.min(d,Math.round(p)):1,_=v.shouldRotateWaterfallLastLevelTick(r,r,c,h),g=v.resolveHierarchyDepthStep(a,l,_,f),m=_?1:r+1,y=a*f*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR;return m>0?(m-1)*g+y:y}static resolveHierarchyDepthStep(t,e,s,n){const i=Number(t),r=Number.isFinite(i)&&i>0?i:10,a=Number(e),l=Number.isFinite(a)&&a>0?a:v.HIERARCHY_LEVEL_GAP_FACTOR,c=Number(n),u=(Number.isFinite(c)&&c>=1?c:1)*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR;return r*Math.max(l,u+v.HIERARCHY_TREE_LINE_BAND_FACTOR)}static resolveWaterfallBottomTickLayout(t={}){const e=Number(t.tickFontSize),s=Number.isFinite(e)&&e>0?e:10,n=Number(t.gapFactor),i=Number.isFinite(n)&&n>0?n:v.HIERARCHY_LEVEL_GAP_FACTOR,r=Math.max(Number(t.maxDepth)||0,0),a=Math.max(Number(t.maxLeafLabelWidth)||0,0),l=Math.max(Number(t.availableHeight)||0,0),c=Number(t.maxReserveRatio),h=Number.isFinite(c)&&c>0?c:tr,u=Math.max(Number(t.paddingBottom)||0,0),d=Math.max(Number(t.reservedTop)||0,0),p=Number(t.maxLines),f=Number.isFinite(p)&&p>=1?Math.round(p):2,_=Number(t.usedLines),g=Number.isFinite(_)&&_>=1?Math.min(f,Math.round(_)):1,m=s*v.HIERARCHY_TREE_LINE_BAND_FACTOR,y=v.shouldRotateWaterfallLastLevelTick(r,r,"bottom",t.isReverse===!0),b=v.resolveHierarchyDepthStep(s,i,y,g),A=y?r:r+1,L=y?1:A,T=s*g*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR,E=z=>u+m+(z>0?(z-1)*b+T:0),C=l>0?l*h:Number.POSITIVE_INFINITY;let S=L;for(;S>1&&E(S)>C;)S-=1;const w=E(S),N=z=>Math.max(z*b-m,0),R=z=>z>1?N(z-1)+m:0,M=s*v.HIERARCHY_LEAF_COLUMN_MIN_FACTOR,k=l>0?Math.max(l-w-d,0):Number.POSITIVE_INFINITY,I=k*h;let O=y?r:S-1,F=0,P=0,B=!1;if(y){let z=r-1;for(;z>0&&N(z)>I;)z-=1;if(z<r-1)O=z;else{const Y=Math.max(a+v.HIERARCHY_LABEL_WIDTH_SLACK,M),dt=R(r),pt=Math.max(k-dt,0)*h;pt<M?(O=r-1,B=!0):(P=dt,F=Math.min(Y,pt),B=F<Y)}}const V=!y||O<r,H=Math.min(O,A-1)+1,U=H<A,j=V?N(O):P+F;return{leafColumn:F,leafBase:P,depthStep:b,rowHeight:T,base:m,rowCount:A,visibleRowCount:H,truncated:U,belowAxis:w-u,overlay:j,vertical:w,clamped:B,leafHidden:V}}static resolveWaterfallSideTickLaneSize(t,e=0){const s=Number.isFinite(Number(t))&&t>0?Number(t):10,n=Math.max(Number(e)||0,0),i=s*v.HIERARCHY_REVERSE_LANE_MIN_FACTOR,r=s*v.HIERARCHY_REVERSE_LANE_MAX_FACTOR;return n<=0?i:Math.min(Math.max(n,i),r)}static resolveWaterfallReverseOverlayLevelCount(t){const s=Math.max(Number(t)||0,0)+1;return Math.max(s-v.HIERARCHY_REVERSE_RESERVED_LEVEL_COUNT,0)}static estimateWaterfallSideTickExtent(t,e,s,n,i=!1){const r=Math.max(Number(t)||0,0),a=Number.isFinite(Number(e))&&e>0?Number(e):10,l=Math.max(Number(n)||0,0),c=v.HIERARCHY_AXIS_RESERVE_MARGIN;if(i){const p=v.resolveWaterfallSideTickLaneSize(a,l),f=r+1,_=v.resolveWaterfallReverseOverlayLevelCount(r);return Math.max(0,f-_)*p+c}const h=Number.isFinite(Number(s))&&s>0?Number(s):v.HIERARCHY_LEVEL_GAP_FACTOR,u=Math.max(l,a*v.HIERARCHY_HORIZONTAL_ROW_HEIGHT_FACTOR);let d=u;for(let p=0;p<=r;p+=1){const f=(r-p)*a*h;d=Math.max(d,f+u+c)}return d}static shouldOverlayWaterfallLastLevelSideTick(t,e,s=!1){if(s!==!0)return!1;const n=Math.max(Number(t)||0,0),i=Math.max(Number(e)||0,0),r=v.resolveWaterfallReverseOverlayLevelCount(i);if(r<=0)return!1;const a=Math.max(0,i-(r-1));return n>=a}static resolveHierarchyTreeLineOrientation(t){return t==="left"||t==="right"?"horizontal":"vertical"}static resolveHierarchyTreeLineLabelMetrics(t){if(!t?.container)return null;const e=t.tick?.treeLineLocal||{x:0,y:0},s=Number(t.container.x)+Number(e.x||0),n=Number(t.container.y)+Number(e.y||0);if(![s,n].every(p=>Number.isFinite(p)))return null;const i=Number(t.tick?.font?.size),r=Number.isFinite(i)&&i>0?i:10,a=Number(t.tick?.font?.width??t.tick?.width),l=Number.isFinite(a)&&a>0?a:r*4,c=Number(t.tick?.hierarchyLaneSize),h=Number.isFinite(c)&&c>0?c:l,u=Number(t.tick?.hierarchyRowTextHeight),d=Number.isFinite(u)&&u>0?u:r*ey;return{x:s,y:n,fontSize:r,textWidth:l,textHeight:d,laneSize:h}}static resolveHierarchyTreeLineConnectorPoint(t,e,s){const n=v.resolveHierarchyTreeLineLabelMetrics(t);if(!n)return null;const i=Math.max(J1,n.fontSize*ty),r=s==="towardDeeper",a=v.resolveHierarchyTreeLineOrientation(e),l=t.tick?.hierarchyRotatedLastLevel===!0;if(a==="horizontal"){const h=Math.min(n.textWidth,n.laneSize);return{x:r?n.x+h+i:n.x-i,y:n.y}}if(e==="top"){if(l){const u=r?n.y+i:n.y-n.textWidth-i;return{x:n.x,y:u}}const h=r?n.y+n.textHeight+i:n.y-i;return{x:n.x,y:h}}if(l){const h=v.resolveHierarchyRotatedLabelLength(t.tick),u=r?n.y-h-i:n.y+i;return{x:n.x,y:u}}const c=r?n.y-i:n.y+n.textHeight+i;return{x:n.x,y:c}}static resolveHierarchyTreeLineAnchors(t,e,s){const n=v.resolveHierarchyTreeLineConnectorPoint(t,s,"towardDeeper"),i=v.resolveHierarchyTreeLineConnectorPoint(e,s,"towardShallower");return!n||!i?null:{x1:n.x,y1:n.y,x2:i.x,y2:i.y,orientation:v.resolveHierarchyTreeLineOrientation(s)}}static buildHierarchyTreeLineSegmentKey(t,e,s,n){const i=[t,e,s,n].map(u=>Number(u));if(!i.every(u=>Number.isFinite(u)))return null;const r=i.map(u=>Math.round(u*10)/10),a=r[2]-r[0],l=r[3]-r[1];if(Math.abs(a)<.05&&Math.abs(l)<.05)return null;const c=`${r[0]},${r[1]}`,h=`${r[2]},${r[3]}`;return c<h?`${c}|${h}`:`${h}|${c}`}static buildHierarchyTreeLinePath(t,e){if(!t||e==="none"||e==null||e==="squared")return"";const s=Number(t.x1),n=Number(t.y1),i=Number(t.x2),r=Number(t.y2);if(![s,n,i,r].every(d=>Number.isFinite(d)))return"";if(e==="straight")return`M ${s},${n} L ${i},${r}`;if(t.orientation==="horizontal"){const d=i-s,p=Math.max(fh,Math.abs(d)*_h),f=s+p,_=i-p;return`M ${s},${n} C ${f},${n} ${_},${r} ${i},${r}`}const l=r-n,c=Math.max(fh,Math.abs(l)*_h),h=n+c,u=r-c;return`M ${s},${n} C ${s},${h} ${i},${u} ${i},${r}`}static buildHierarchyTreeLineBracketPaths(t,e,s,n=!0){if(!t||!Array.isArray(e)||e.length===0)return[];const i=s==="horizontal";let r=e[0],a=e[0];for(let I=0;I<e.length;I+=1){const O=e[I],F=i?O.y:O.x;F<(i?r.y:r.x)&&(r=O),F>(i?a.y:a.x)&&(a=O)}if(e.length===1||r===a){const I=v.buildHierarchyTreeLinePath({x1:t.x,y1:t.y,x2:e[0].x,y2:e[0].y,orientation:s},"curved");return I?[I]:[]}if(n===!1)return[`M ${r.x},${r.y} L ${a.x},${a.y}`];const l=r.x,c=r.y,h=a.x,u=a.y,d=l-h,p=c-u,f=Math.sqrt(d*d+p*p)||1,_=d/f,g=p/f,m=(l+h)/2,y=(c+u)/2,b=(t.x-m)*g-(t.y-y)*_,A=q1,L=l+A*b*g,T=c-A*b*_,E=l-.25*f*_+(1-A)*b*g,C=c-.25*f*g-(1-A)*b*_,S=l-.5*f*_+b*g,w=c-.5*f*g-b*_,N=h+A*b*g,R=u-A*b*_,M=l-.75*f*_+(1-A)*b*g,k=c-.75*f*g-(1-A)*b*_;return[`M ${l},${c} Q ${L},${T} ${E},${C} T ${S},${w} M ${h},${u} Q ${N},${R} ${M},${k} T ${S},${w}`]}static addHierarchyTreeLineSquaredSegments(t,e,s,n,i=!0){if(!t||!Array.isArray(e)||e.length===0||!n)return;const r=(b,A,L,T)=>{const E=v.buildHierarchyTreeLineSegmentKey(b,A,L,T);!E||n.has(E)||n.set(E,{x1:b,y1:A,x2:L,y2:T})},a=i!==!1;if(s==="horizontal"){if(e.length===1&&Math.abs(e[0].y-t.y)<je){r(t.x,t.y,e[0].x,e[0].y);return}let b=0;for(let R=0;R<e.length;R+=1)b+=e[R].x;b/=e.length;let A=(t.x+b)/2,L=e[0].x,T=e[0].x;for(let R=0;R<e.length;R+=1)L=Math.min(L,e[R].x),T=Math.max(T,e[R].x);const E=Math.min(t.x,L),C=Math.max(t.x,T);C-E>1&&(A=Math.min(Math.max(A,E+.5),C-.5));let S=t.y,w=t.y;for(let R=0;R<e.length;R+=1){const M=e[R];S=Math.min(S,M.y),w=Math.max(w,M.y)}if(!a){r(A,S,A,w);return}r(t.x,t.y,A,t.y);const N=[];for(let R=0;R<e.length;R+=1){const M=e[R],k=Math.abs(M.y-S)<je,I=Math.abs(M.y-w)<je;(k||I)&&N.push(M)}for(let R=0;R<N.length;R+=1){const M=N[R];r(A,M.y,M.x,M.y)}r(A,S,A,w);return}if(e.length===1&&Math.abs(e[0].x-t.x)<je){r(t.x,t.y,e[0].x,e[0].y);return}let l=0;for(let b=0;b<e.length;b+=1)l+=e[b].y;l/=e.length;let c=(t.y+l)/2,h=e[0].y,u=e[0].y;for(let b=0;b<e.length;b+=1)h=Math.min(h,e[b].y),u=Math.max(u,e[b].y);const d=Math.min(t.y,h),p=Math.max(t.y,u);p-d>1&&(c=Math.min(Math.max(c,d+.5),p-.5));let f=e[0].x,_=e[0].x;for(let b=0;b<e.length;b+=1){const A=e[b];f=Math.min(f,A.x),_=Math.max(_,A.x)}if(!a){r(Math.min(f,t.x),c,Math.max(_,t.x),c);return}r(t.x,t.y,t.x,c);const g=[];for(let b=0;b<e.length;b+=1){const A=e[b],L=Math.abs(A.x-f)<je,T=Math.abs(A.x-_)<je;(L||T)&&g.push(A)}for(let b=0;b<g.length;b+=1){const A=g[b];r(A.x,c,A.x,A.y)}const m=Math.min(f,t.x),y=Math.max(_,t.x);r(m,c,y,c)}static collectHierarchyTreeLineLinks(t,e,s="squared",n=!0){if(s==="none")return[];const i=Array.isArray(t)?t:[],r=new Map,a=new Map;for(let h=0;h<i.length;h+=1){const u=i[h];if(u?.tick?.hierarchyLabelHidden===!0)continue;const d=u?.sourceRow;d!=null&&r.set(d,u);const p=d?.parent;p!=null&&(a.has(p)||a.set(p,[]),a.get(p).push(u))}if(s==="squared"){const h=new Map,u=v.resolveHierarchyTreeLineOrientation(e);a.forEach((f,_)=>{const g=r.get(_);if(!g)return;const m=v.resolveHierarchyTreeLineConnectorPoint(g,e,"towardDeeper");if(!m)return;const y=[];for(let b=0;b<f.length;b+=1){const A=v.resolveHierarchyTreeLineConnectorPoint(f[b],e,"towardShallower");A&&y.push(A)}v.addHierarchyTreeLineSquaredSegments(m,y,u,h,n)});const d=[];let p=0;return h.forEach(f=>{d.push({id:`hierarchy-tree-line-seg-${p}`,path:`M ${f.x1},${f.y1} L ${f.x2},${f.y2}`}),p+=1}),d}if(s==="curved"){const h=v.resolveHierarchyTreeLineOrientation(e),u=[];let d=0;return a.forEach((p,f)=>{const _=r.get(f);if(!_)return;const g=v.resolveHierarchyTreeLineConnectorPoint(_,e,"towardDeeper");if(!g)return;const m=[];for(let b=0;b<p.length;b+=1){const A=v.resolveHierarchyTreeLineConnectorPoint(p[b],e,"towardShallower");A&&m.push(A)}const y=v.buildHierarchyTreeLineBracketPaths(g,m,h,n);for(let b=0;b<y.length;b+=1)u.push({id:`hierarchy-tree-line-bracket-${d}-${b}`,path:y[b]});d+=1}),u}const l=[];let c=0;return a.forEach((h,u)=>{const d=r.get(u);if(d)for(let p=0;p<h.length;p+=1){const f=h[p],_=v.resolveHierarchyTreeLineAnchors(d,f,e);if(!_)continue;const g=v.buildHierarchyTreeLinePath(_,s);if(!g)continue;const m=f?.sourceRow?.id??f?.sourceRow?.unique??f?.sourceRow?.hierarchyPath??c;l.push({id:`hierarchy-tree-line-${m}`,path:g}),c+=1}}),l}static usesWaterfallScreenLeftHierarchyTicks(t,e,s=!1){return s===!0&&e==="waterfall"&&t?.hierarchy===!0&&t?.dimension===!0&&t?.position==="left"}static resolveWaterfallSideTickDepthOffset(t,e,s,n,i=!1){const r=Math.max(Number(t)||0,0),a=Math.max(Number(e)||0,r),l=Number.isFinite(Number(s))&&s>0?Number(s):0;return n==="left"?i?r*l:-((a-r)*l):n==="right"&&i?-((a-r)*l):n==="right"?(a-r)*l:0}static shouldRotateWaterfallLastLevelTick(t,e,s,n=!1){if(n)return!1;const i=Math.max(Number(t)||0,0),r=Math.max(Number(e)||0,0);return i===r&&i>0&&s==="bottom"}static computeHierarchyAxisReserve(t={}){const e=Math.max(Number(t.maxDepth)||0,0),s=Number(t.tickFontSize),n=Number.isFinite(s)&&s>0?s:10,i=Number(t.gapFactor),r=Number.isFinite(i)&&i>0?i:v.HIERARCHY_LEVEL_GAP_FACTOR,a=Math.max(Number(t.maxLeafLabelWidth)||0,0),l=t.axisPosition??"bottom",c=t.isReverse===!0,h=Math.max(Number(t.paddingBottom)||0,0);Math.max(Number(t.paddingLeft)||0,0),v.HIERARCHY_AXIS_RESERVE_MARGIN;const u=["left","right"].includes(l);if(c&&u){const p=v.estimateWaterfallSideTickExtent(e,n,r,a,!0);return{vertical:0,horizontal:n*v.BOTTOM_AXIS_TEXT_BASE_MULTIPLIER+p,layout:null}}if(l==="bottom"){const p=v.resolveWaterfallBottomTickLayout({maxDepth:e,tickFontSize:n,gapFactor:r,maxLeafLabelWidth:a,availableHeight:Math.max(Number(t.availableHeight)||0,0),maxReserveRatio:t.maxReserveRatio,maxLines:t.maxLines,usedLines:t.usedLines,paddingBottom:h,reservedTop:t.reservedTop,isReverse:c});return{vertical:p.vertical,horizontal:0,layout:p}}const d=Math.max(e,1);return{vertical:h+d*n*r,horizontal:0,layout:null}}static#L=1.2;static#T=2.6;static#u(t,e){const s=t.length;if(s===1)return 0;let n=0,i=s-1;for(;n<i;){const p=Math.floor((n+i)/2);t[p]<e?n=p+1:i=p}const r=n,a=r>0?r-1:0,l=t[r],c=t[a],h=Math.abs(l-e);return Math.abs(c-e)<=h?a:r}static#c(t,e){const s=[],n=t.length;if(n===0)return s;if(n===1)return s.push(t[0]),s;const i=t[0],r=t[n-1];for(let a=0;a<e;a+=1){const l=e===1?i:i+(r-i)*a/(e-1),c=v.#u(t,l),h=t[c];(s.length>0?s[s.length-1]:null)!==h&&s.push(h)}return s}static#m(t,e){const s=t.length-1;if(s<0)return[];const n=[];for(let i=0;i<e;i+=1){const r=e===1?0:Math.round(s*i/(e-1)),a=t[r];n[n.length-1]!==a&&n.push(a)}return n}scale=null;#o;#A={};#E=null;constructor(t){this.#o=t,this.#A={},this.scale=t.scale}setScale(t){this.#o.scale=t,this.scale=t}chain(t,e=!1){return t.map((s,n,i)=>({...s,prev:e?i[n-1]??i[i.length-1]:i[n-1],next:e?i[n+1]??i[0]:i[n+1]}))}update(t=null){try{const e=this.#o.scale,s=this.#o.plot;this.#E=Kl({configuration:s?.layer?.configuration,trace:this.#o.trace,scale:e});const n=t||s.__nodes__?.svg;if(!n?.node?.())return;let i=this.#x();this.#A.container=n.selectAll(`g.plotter-axis-${e.name}`).data(i,r=>r.id).join(r=>this.#At(r.append("g")),r=>this.#At(r),r=>(this.#d(r),r.remove()))}catch(e){console.error(e)}}unmount(){return this.#d(this.#A.container),this.#A.container.remove()}#d(t){t?.each?.((e,s,n)=>{const i=e?.scale?.name,r=n[s]?.parentNode;i&&r&&window.d3.select(r).selectAll(`:scope > g.plotter-grid-${i}`).remove()})}#_(t){const s=this.#o.plot.layer,n=this.#C(),i=t._uniqueValue.map(a=>t._isDate?W.fromFormat(a,t.format).getTimestamp():a),r=t._isDate?[...new Set(i)].sort((a,l)=>a-l):i;return t._dateHolesAfter.map(a=>{const l=r.indexOf(a);if(l<0||l>=r.length-1)return null;const c=r[l+1];let h={},u={};switch(t.position){case"left":case"right":h.x=0,h.y=t.for(a,!1,{forceValue:a}),h.y-=t._elementSize-t._elementSize*((1-s.configuration.axis.ratioOfElementSize)/2),u.width=s.width,t.position==="right"?u.width=-(s.width-(n.left+n.right)):u.width=s.width-(n.left+n.right),u.height=0;break;case"top":case"bottom":h.x=t.for(a,!1,{forceValue:a}),h.x+=t._elementSize-t._elementSize*((1-s.configuration.axis.ratioOfElementSize)/2),h.y=0,u.width=0,t.position==="top"?u.height=-(s.height-(n.top+n.bottom)):u.height=s.height-(n.top+n.bottom);break}const d=a;let p,f;switch(t.position){case"left":case"right":p=Math.min(h.y,t.for(c,!1,{forceValue:c})),f=Math.max(h.y,t.for(c,!1,{forceValue:c}));break;case"top":case"bottom":p=Math.min(h.x,t.for(c,!1,{forceValue:c})),f=Math.max(h.x,t.for(c,!1,{forceValue:c}));break;default:p=0,f=0}return{line:u,container:h,breakRange:{start:p,end:f},data:{from:d,to:c}}}).filter(Boolean)}#C(){const t=this.#o?.plot?.layer?.configuration?.plot?.padding;return typeof t=="number"?{top:t,right:t,bottom:t,left:t}:{top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0,left:t?.left??0}}#S(t,e,s,n,i){let r=0,a=0,l=0,c=null;if(s&&i!=null){r=t.refer?.getSplitLag?.({[n]:i})??0;const h=Array.isArray(t.refer?.range)?t.refer.range:null;return Array.isArray(h)&&h.length===2&&(c=[h[0]+r,h[1]+r]),["left","right"].includes(t.refer?.position)?l=r:a=r,{splitLagX:a,splitLagY:l,groupedSegmentRange:c}}if(t.split&&!t.dimension){const h=Array.isArray(t._uniqueSplit)?t._uniqueSplit:[],u=t.splitValue??h[e];r=u!=null?t.getSplitLag({[t.split]:u}):0,["left","right"].includes(t.position)?l=r:a=r}return{splitLagX:a,splitLagY:l,groupedSegmentRange:c}}#g(t,e){return!t?.split||t.dimension?null:t.splitValue!=null?t.splitValue:(Array.isArray(t._uniqueSplit)?t._uniqueSplit:[])[e]??null}#f(t,e,s,n){const i=typeof t.getScale=="function"?t.getScale():t;let r=i._scale(e);return typeof i.applyWaterfallSplitMetricPadding=="function"&&(r=i.applyWaterfallSplitMetricPadding(r,s,n,{coordinateIncludesSplitLag:!1})),r}#x(){const t=this.#o.scale,e=this.#o.plot,s=e.layer;if(t.hidden)return[];const n=s?.configuration?.axis?.groupedAxes?.mode==="overlay"&&this.#o?.trace?.type==="waterfall";let i=[`plotter-axis-${t.name}`],r=[];const a=typeof t.getGroupedHierarchySplitKey=="function"?t.getGroupedHierarchySplitKey():null,l=!!(t.dimension&&t.hierarchy&&a);return l?(r=typeof t.getGroupedSplitValues=="function"?t.getGroupedSplitValues():[],r.length&&(i=r.map(c=>`plotter-axis-${t.name}-${String(c).hash()}`))):t.split&&!t.dimension&&t.splitValue!=null?i=[`plotter-axis-${t.name}-${String(t.splitValue).hash()}`]:t.split&&!t.dimension&&(i=t._uniqueSplit.map(c=>`plotter-axis-${t.name}-${c.hash()}`)),n&&i.length>1&&(i=[i[0]],r.length>1&&(r=[r[0]])),i.map((c,h)=>{const u=l?r[h]:null,d=this.#g(t,h),p=u??d,f=this.#Z(t.getScale(),h,i.length-1,p),_=this.#_(t.getScale()),g=this.#C(),m=t.split&&!t.dimension&&["left","right"].includes(t.position),y=s?.configuration?.reverse!==!0,b=h===i.length-1,A=this.#k().title,L=A.color;let T={size:A.size,weight:A.weight,color:L??"currentColor",family:A.family};const E=Number(T.size)*1.5||15,S=this.#z(t)?E/2+4:0,w=A.verticalPosition||"center-rotated";let N;const{splitLagX:R,splitLagY:M,groupedSegmentRange:k}=this.#S(t,h,l,a,p),I=s?.configuration?.reverse===!0;let O,F,P,B,V,H;switch(t.position){case"left":case"right":if(t.position==="left"){if(v.usesWaterfallScreenLeftHierarchyTicks(t,this.#o?.trace?.type,I))F=`translate(${R}, ${M})`,V=0;else if(F=`translate(${e._getRanges().horizontal[0]+R}, ${M})`,t.hierarchy){const z=this.#k().ticks.texts.size,Y=this.#o?.trace?.type==="waterfall";V=-v.estimateWaterfallSideTickExtent(t._hierarchyMaxDepth,z,v.HIERARCHY_LEVEL_GAP_FACTOR,f.reduce((dt,pt)=>{const Wt=Number(pt.tick?.font?.width??pt.tick?.width),Ze=Number.isFinite(Wt)&&Wt>=0?Wt:0;return Math.max(dt,Ze)},0),I&&Y)}else V=-v.#l(f);if(H=Math.min(...t.baseRange)+(Math.max(...t.baseRange)-Math.min(...t.baseRange))/2,B="middle",t.showZeroLine){const z=Number.isFinite(Number(t.baselineValue))?Number(t.baselineValue):0;let Y=this.#f(t,z,d,I);N={x1:-10,x2:t.refer.getScale().range[1]-20,y1:Y,y2:Y}}}else{let j;if(j=e._getRanges().horizontal[1],t.hierarchy){const z=this.#k().ticks.texts.size;V=v.estimateWaterfallSideTickExtent(t._hierarchyMaxDepth,z,v.HIERARCHY_LEVEL_GAP_FACTOR,f.reduce((Y,dt)=>{const pt=Number(dt.tick?.font?.width??dt.tick?.width),Wt=Number.isFinite(pt)&&pt>=0?pt:0;return Math.max(Y,Wt)},0))}else f.some(z=>z.tick.rotated)?V=Math.max(...f.map(z=>z.tick.width))/1.5:V=v.#l(f);if(H=Math.min(...t.baseRange)+(Math.max(...t.baseRange)-Math.min(...t.baseRange))/2,B="middle",t.showZeroLine&&!t.hidden){const z=Number.isFinite(Number(t.baselineValue))?Number(t.baselineValue):0;let Y=this.#f(t,z,d,I);N={x1:-(t.refer.getScale().range[1]-20),x2:10,y1:Y,y2:Y}}F=`translate(${j+R}, ${M})`}const U=Math.min(...t.baseRange);if(w==="top-left-overlay"){P="",B="start",O="hanging";const j=e._getRanges().horizontal,z=j[0];let Y;t.position==="left"?Y=v.usesWaterfallScreenLeftHierarchyTicks(t,this.#o?.trace?.type,I)?R:j[0]+R:Y=j[1]+R,V=v.resolveTopLeftOverlayTitleX({plotLeft:z,axisOriginX:Y}),t.position==="right"&&(V=0,B="end");const dt=Math.max(v.resolveWaterfallTopLineReserveForTitle({plot:e,scale:t,splitValue:p}),Ln(s?.configuration,this.#o?.trace));H=v.resolveTopLeftOverlayTitleY({topOfAxis:U,topLineReserve:dt,paddingTop:g.top,titleFontSize:T.size})}else P="rotate(-90)",m&&y&&(P="",B="start",O="hanging",t.position==="left"?V=4:V=e._getRanges().horizontal[0]-e._getRanges().horizontal[1]+4,H=U+4);break;case"top":case"bottom":if(t.position==="top"){const j=k?Math.min(...k):e._getRanges().vertical[1]+M;F=`translate(${R}, ${j})`,V=(e._getRanges().horizontal[0]+e._getRanges().horizontal[1])/2,f.some(z=>z.tick.rotated)?H=-g.top-S:H=-(T.size*2.5)-S,t.hierarchy&&(H-=(t._hierarchyMaxDepth+1)*(T.size*this.#D())),O="hanging"}else{const j=k?Math.max(...k):e._getRanges().vertical[0]+M;F=`translate(${R}, ${j})`,V=(e._getRanges().horizontal[0]+e._getRanges().horizontal[1])/2,O="hanging";const z=v.resolveFlatLabelExtent(f);if(f.some(Y=>Y.tick.rotated)?H=Math.max(T.size*3,z+T.size*.5)+S:H=Math.max(T.size*1.5,z+T.size*.5)+S,t.hierarchy){const Y=this.#F(t,f,T.size,t._hierarchyMaxDepth);H+=Number.isFinite(Number(Y.belowAxis))?Number(Y.belowAxis):(t._hierarchyMaxDepth+1)*Y.depthStep}}B="middle";break}return{zeroLine:N?[N]:[],ticks:f,holes:_,scale:t,transform:F,label:{id:t.name,display:v.isTitleShownForAxis(A.display,t)&&t.label!==!1&&(!m||!y||b),font:T,x:V,y:H,textAnchor:B,alignmentBaseline:O,text:t.label,transform:P||""},id:c}})}#v(t){const e=this.#o?.scale,s=Number(e?._hierarchyMaxDepth),n=Number(t?._hierarchyMaxDepth),i=Number.isFinite(s)&&s>=0?s:0,r=Number.isFinite(n)&&n>=0?n:0;return Math.max(i,r)}#D(){return jl(this.#o?.plot?.layer?.configuration)}#B=new WeakMap;#$(t,e,s,n,i){if(!Array.isArray(e)||!e.length)return null;const r=this.#B.get(e);if(r)return r;const a=v.resolveHierarchyRowPlan({ticks:e,maxDepth:n,font:s,axisPosition:t?.position,isReverse:i,labelRules:gn(this.#o?.plot?.layer?.configuration)});return this.#B.set(e,a),a}#F(t,e,s,n,i=!1){const r=typeof this.#o?.plot?.getHierarchyTickLayout=="function"?this.#o.plot.getHierarchyTickLayout():null;if(r&&r.maxDepth===n&&r.isReverse===(i===!0))return r;const a=Array.isArray(e)?e:[];let l=0;for(let h=0;h<a.length;h+=1){const u=a[h]?.tick;if(Math.max(Number(u?.hierarchyDepth)||0,0)!==n)continue;const p=v.measureHierarchyTextWidth(u?.text,{...u?.font||{},size:s});Number.isFinite(p)&&p>l&&(l=p)}const c=this.#o?.plot?.layer?.configuration;return v.resolveWaterfallBottomTickLayout({maxDepth:n,tickFontSize:s,gapFactor:this.#D(),maxLeafLabelWidth:l,availableHeight:Number(this.#o?.plot?.layer?.height)||0,maxReserveRatio:Ul(c),maxLines:gn(c).maxLines,isReverse:i})}#w(t,e){if(!t.dimension||t.hierarchy||!["top","bottom"].includes(t.position)||!Array.isArray(e)||e.length===0)return null;const s=(Math.max(...t.range)-Math.min(...t.range))/e.length;return{...v.resolveFlatDimensionLabelLayout(e.map(i=>i.tick.text),s,e[0].tick.font,this.#k().ticks?.texts?.orientation),slot:s}}#G(t,e){if(!t._trace?.x?.thinTicks||t.hierarchy||!["top","bottom"].includes(t.position))return e;const s=Math.min(...t.range),n=Math.max(...t.range),i=e.filter(a=>{const l=a.container[a.tick.orientation];return l>=s-t._elementSize&&l<=n+t._elementSize}),r=v.resolveThinnedLabelStep(i.map(a=>a.tick.text),n-s,i[0]?.tick.font);return i.filter((a,l)=>l%r===0)}#N(t,e,s,n=null){let i;e.tick.availableSpace!=null?i=e.tick.availableSpace:s?i=(Math.max(...t.range)-Math.min(...t.range))/s.length:i=t._elementSize;let r=e.tick.font;const a=Number(r.size),l=Number.isFinite(a)&&a>0?a:10,c=Math.max(e.tick.hierarchyDepth??0,0),h=this.#v(t),u=t.hierarchy&&t.dimension&&this.#o?.trace?.type==="waterfall",d=this.#o.plot?.layer?.configuration?.reverse===!0,p=v.shouldRotateWaterfallLastLevelTick(c,h,t.position,d),f=d&&u,g=t.hierarchy&&["top","bottom"].includes(t.position)?this.#$(t,s,r,h,d):null,m=g?g.get(c):null;if(m&&(r.size=m.size),r.width=t.hierarchy?v.measureHierarchyTextWidth(e.tick.text,r):rt.computeRenderWidth(e.tick.text,r),m&&!p){const T=gn(this.#o?.plot?.layer?.configuration),E=v.fitHierarchyLabelFont({text:e.tick.text,font:r,availableWidth:i,maxLines:m.lines,minSize:T.minSize,autoSize:!1});e.tick.hierarchyLabelMaxLines=E.lines,e.tick.hierarchyLabelHidden=m.hidden||i<r.size*v.HIERARCHY_LABEL_MIN_SLOT_FACTOR,e.tick.hierarchyRowTextHeight=r.size*m.lines*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR}if(["top","bottom"].includes(t.position)){if(e.tick.orientation="x",e.tick.textAnchor="middle",t.position==="top"?(e.tick.lineDirection="y1",e.tick.alignmentBaseline="baseline"):(e.tick.lineDirection="y2",e.tick.alignmentBaseline="hanging"),t.dimension&&!t.hierarchy&&n?.mode==="wrap"&&(e.tick.availableSpace=n.slot,e.tick.hierarchyLabelMaxLines=n.lines),t.dimension&&!t.hierarchy&&n?.mode==="single"&&n.maxLength>0&&(e.tick.fullText=e.tick.text,e.tick.text=v.truncateFlatDimensionLabel(e.tick.text,n.maxLength,r),r.width=rt.computeRenderWidth(e.tick.text,r)),t.dimension&&!t.hierarchy&&n?.mode==="rotate"){const T=n.angle??v.FLAT_LABEL_ROTATION_DEG;e.tick.transform.push(`rotate(${-T})`),e.tick.rotationDeg=T,e.tick.rotated=!0,e.tick.textAnchor=t.position==="top"?"start":"end",e.tick.fullText=e.tick.text,e.tick.text=v.truncateFlatDimensionLabel(e.tick.text,n.maxLength,r),r.width=rt.computeRenderWidth(e.tick.text,r)}}else{e.tick.orientation="y",e.tick.alignmentBaseline="middle",t.position==="left"?f?(e.tick.lineDirection="x2",e.tick.textAnchor="start"):(e.tick.lineDirection="x1",e.tick.textAnchor="end"):(e.tick.lineDirection="x2",e.tick.textAnchor="start");const T=d&&t.dimension&&!t.hierarchy;T&&(e.tick.fullText=e.tick.text,e.tick.text=v.truncateFlatDimensionLabel(e.tick.text,v.resolveSideLabelMaxWidth(this.#o.plot?.layer?.width),r),r.width=rt.computeRenderWidth(e.tick.text,r)),t.dimension&&!u&&t.ticks?.rotate!==0&&!T&&(e.tick.rotated=!0,e.tick.transform.push("rotate(-90)"),e.tick.textAnchor="middle",e.tick.alignmentBaseline=t.position==="left"?"baseline":"hanging")}p&&(e.tick.rotated=!0,e.tick.hierarchyRotatedLastLevel=!0,e.tick.textAnchor="middle",e.tick.alignmentBaseline="baseline");let y=0,b=0;switch(e.tick.lineDirection){case"x1":e.tick.rotated?(y=0,b=r.size*-2):(y=e.tick.line.size*-1.5,b=0);break;case"x2":f?(y=0,b=0):(y=e.tick.line.size*1.5,e.tick.rotated?(y=0,b=r.size*2):b=0);break;case"y1":e.tick.rotated?(y=e.tick.line.size*-.5,b=r.size*-1):(y=0,b=e.tick.line.size*-1.5);break;default:case"y2":if(e.tick.hierarchyRotatedLastLevel)y=0,b=0;else if(e.tick.rotationDeg!=null){const T=e.tick.rotationDeg*Math.PI/180;y=-r.size*Math.sin(T),b=r.size*(Math.cos(T)-v.FLAT_LABEL_MID_LINE_EM)}else e.tick.rotated?(y=e.tick.line.size,b=r.size*1):(y=0,b=e.tick.size*1.5);break}if(t.hierarchy&&["top","bottom"].includes(t.position)){const T=t.position==="bottom"?this.#F(t,s,l,h,d):null,E=v.shouldRotateWaterfallLastLevelTick(h,h,t.position,d),C=Number.isFinite(Number(T?.depthStep))?Number(T.depthStep):v.resolveHierarchyDepthStep(l,this.#D(),E,1),S=E?h:h+1,w=Number.isFinite(Number(T?.visibleRowCount))?Number(T.visibleRowCount):S,N=Math.max(w-1,0),R=E&&t.position==="bottom";let M;if(e.tick.hierarchyRotatedLastLevel?M=-Math.max(Number(T?.leafBase)||0,0):R?M=-c*C:M=Math.max(N-c,0)*C,!e.tick.hierarchyRotatedLastLevel&&t.position==="bottom"){const k=Number(T?.base);Number.isFinite(k)&&k>0&&(b=k),c>N&&(e.tick.hierarchyLabelHidden=!0)}T&&h>0&&c>=h&&(e.tick.hierarchyLeafColumn=T.leafColumn,e.tick.hierarchyLabelHidden=T.leafHidden===!0),t.position==="top"?b-=M:b+=M}else if(t.hierarchy&&(t.position==="left"||t.position==="right")){let T=r.size*this.#D();if(f){const C=Array.isArray(s)?s:[];let S=0;for(let w=0;w<C.length;w+=1){const N=Number(C[w]?.tick?.font?.width??C[w]?.tick?.width);Number.isFinite(N)&&N>S&&(S=N)}T=v.resolveWaterfallSideTickLaneSize(r.size,S),e.tick.hierarchyLaneSize=T,e.tick.hierarchySideLaneClamped=!0,e.tick.hierarchyOverlaysPlot=v.shouldOverlayWaterfallLastLevelSideTick(c,h,!0)}const E=v.resolveWaterfallSideTickDepthOffset(c,h,T,t.position,f);y+=E}const A=Number.isFinite(Number(y))?Number(y):0,L=Number.isFinite(Number(b))?Number(b):0;return t.hierarchy&&(e.tick.treeLineLocal={x:A,y:L}),e.tick.transform.push(`translate(${A}, ${L})`),e}#R(t){const e=Array.isArray(t)?t:[],s=[];for(let n=0;n<e.length;n++){const i=e[n],r=i!=null?String(i):"";if(!/^translate\(/.test(r)){r.length&&s.push(r);continue}const l=r.match(/^translate\(([^,]+),\s*([^)]+)\)$/);if(!(l!=null))continue;const h=Number(l[1]),u=Number(l[2]);Number.isFinite(h)&&Number.isFinite(u)&&s.push(`translate(${h}, ${u})`)}return s.join(" ")}#M(t){const e=this.#k().ticks,s=e.texts.color,n=e.lines.color,i=Number(e.lines.size);return{value:t,size:Number.isFinite(i)&&i>0?i:4,width:1,opacity:1,transform:[],line:{size:Number.isFinite(i)&&i>0?i:4,width:e.lines.width,color:n??"currentColor",opacity:e.lines.opacity},font:{size:e.texts.size,weight:e.texts.weight,color:s??"currentColor",opacity:e.texts.opacity,family:e.texts.family}}}#k(){return this.#E?this.#E:(this.#E=Kl({configuration:this.#o.plot?.layer?.configuration,trace:this.#o.trace,scale:this.#o.scale}),this.#E)}#Z(t,e=0,s=0,n=null){const r=this.#o.plot?.layer?.configuration?.reverse===!0;return tc(t)?this.#H(t,e,s,n,r):this.#V(t,e,n)}#V(t,e=0,s=null){let n={},i=t.data;const r=typeof t.getGroupedHierarchySplitKey=="function"?t.getGroupedHierarchySplitKey():null;if(r&&s!=null&&t.hierarchy&&(i=(Array.isArray(i)?i:[]).filter(h=>h?.[r]===s)),t._isDate&&t._uniqueValue?.length){const c=new Set(t._uniqueValue.map(String)),h=i.filter(u=>c.has(String(u?.[t.value])));i=h.length?h:i}if(t._isDate&&t.data.length>30){const h=i.map(p=>W.fromFormat(p[t.value],t.format).getTimestamp()),u=[...new Set(h)].sort((p,f)=>p-f);i=(t._dateHolesAfter?.length?v.#m(u,10):v.#c(u,10)).map(p=>{const f={};return f[t.value]=new W(p).to(t.format),f})}else if(t._isDate)i=i.map(c=>{const h=c?.[t.value],u=W.fromFormat(h,t.format).getTimestamp();return Number.isFinite(u)?{...c,[t.value]:new W(u).to(t.format)}:c});else if(t._valueType==="continuous"&&!t._isDate&&!t.texts?.length&&!t._isCompositeDimensionSplit){const c=h=>h.format({unit:t.unit,sign:!1});i=[{[t.value]:c(t.domain[0])},{[t.value]:c(Math.min(...t.domain)+(Math.max(...t.domain)-Math.min(...t.domain))/2)},{[t.value]:c(t.domain[1])}]}i.forEach((c,h)=>{let u=c[t.value];t._isDate&&(u=W.fromFormat(u,t.format).getTimestamp());const d=typeof t.getDomainValue=="function"?t.getDomainValue(c,u):u,p=t.hierarchy?`${t.name}-${h}-${s??"all"}`:d;let f=n[p]={index:h,container:{x:0,y:0},tick:this.#M(u),sourceRow:t.hierarchy?c:null};if(f.tick.hideLine=!t.hierarchy,["top","bottom"].includes(t.position)?f.tick.orientation="x":f.tick.orientation="y",Array.isArray(t.texts)&&t?.texts?.length)f.tick.text=t.texts[h];else if(typeof t.texts=="string")f.tick.text=c?.[t.texts]??this.#o.plot.__parameters__.parent.__parameters__.data[h]?.[t.texts];else if(typeof t.texts=="function")f.tick.text=t.texts(u,h,t,t._uniqueValue);else{const g=(typeof t.getCompositeDimensionLabel=="function"?t.getCompositeDimensionLabel(c):null)??c[t.value];f.tick.text=t._isDate?W.formatAxisTickLabel(g,t.format):g}if(t.hierarchy&&(f.tick.hierarchyDepth=typeof t.getHierarchyRowDepth=="function"?t.getHierarchyRowDepth(c):Math.max(Number(c.depth)||0,0),f.tick.availableSpace=t.size(c,1)),f.tick.width=rt.computeRenderWidth(f.tick.text,f.tick.font),t.hierarchy){const _=t.size(c,1),g=t.for(c,t.value);["top","bottom"].includes(t.position)?f.container[f.tick.orientation]=g+_/2-1:f.container[f.tick.orientation]=g+_/2}else t._valueType==="continuous"&&!t._isDate?f.container[f.tick.orientation]=t._scale(d):["top","bottom"].includes(t.position)?f.container[f.tick.orientation]=t._scale(d)+t._elementSize/2-1:f.container[f.tick.orientation]=t._scale(d)+t._elementSize/2;return f}),n=this.chain(this.#G(t,Object.values(n)));const l=this.#w(t,n);return n.map(c=>this.#N(t,c,n,l))}#H(t,e,s,n=null,i=!1){const[r,a]=t.domain,l=Math.min(r,a),c=Math.max(r,a),h=Array.isArray(t.range)?t.range:[0,0],u=Math.abs(Number(h[1])-Number(h[0]))||0,d=Math.max(2,Math.min(6,Math.round(u/v.MEASURE_TICK_SPACING_PX)));let p=Number.isFinite(l)&&Number.isFinite(c)&&c>l?window.d3.ticks(l,c,d):[l,c].filter(Number.isFinite);const f=this.#k().ticks?.texts?.format??null,_=b=>b.map(A=>Ut(A,{unit:t.unit,format:f}));for(let b=d-1;b>=2&&new Set(_(p)).size<p.length;b-=1)p=window.d3.ticks(l,c,b);if(p.length<2&&Number.isFinite(l)&&Number.isFinite(c)&&(p=[...new Set([l,c])]),t.showZeroLine&&!t.hidden){const b=Number.isFinite(Number(t.baselineValue))?Number(t.baselineValue):0;p.includes(b)||p.push(b)}p.sort((b,A)=>b-A);const m=t?._configuration?.axis?.groupedAxes?.enabled===!0&&(t?.hierarchy||t?.refer?.hierarchy);e<s&&!m&&(p=p.filter((b,A)=>A!==0));const y=this.#o.scale;return p=this.chain(p.map(b=>{let A={container:{x:0,y:0},tick:this.#M(b)};return A.tick.text=b?Ut(b,{unit:t.unit,format:f}):"0",A.tick.width=rt.computeRenderWidth(A.tick.text,A.tick.font),["top","bottom"].includes(t.position)?A.tick.orientation="x":A.tick.orientation="y",A.container[A.tick.orientation]=this.#f(y,A.tick.value,n,i),A})),p.map(b=>this.#N(t,b))}#I(t){const e=this.#k().ticks?.lines?.display!==!1;return t.style("display",({tick:s})=>e&&!s?.hideLine?null:"none").attr("class","plotter-tick-line").attr("x1",({tick:s})=>s.lineDirection==="x1"?s.size:0).attr("x2",({tick:s})=>s.lineDirection==="x2"?s.size:0).attr("y1",({tick:s})=>s.lineDirection==="y1"?s.size:0).attr("y2",({tick:s})=>s.lineDirection==="y2"?s.size:0).attr("stroke",({tick:s})=>s.line.color).attr("stroke-width",({tick:s})=>(s.strokeWidth??1)/2).attr("opacity",({tick:s})=>s.line.opacity)}#O(t){return v.resolveAxisTickForeignObjectBox(t)}static resolveHierarchyRotatedLabelLength(t){const e=Number(t?.font?.size),s=Number.isFinite(e)&&e>0?e:10,n=Number(t?.font?.width),r=(Number.isFinite(n)&&n>0?n:s)+v.HIERARCHY_LABEL_WIDTH_SLACK,a=Number(t?.hierarchyLeafColumn);return Number.isFinite(a)?a<=0?0:Math.max(Math.min(r,a),s):Math.max(r,s)}static resolveAxisTickHitboxBox(t){const e=Number(t?.font?.size),s=Number.isFinite(e)&&e>0?e:10,n=Number(t?.font?.width),i=Number.isFinite(n)&&n>=0?n:0,r=Number(t?.line?.size),a=Number.isFinite(r)&&r>=0?r:0,l=Number(t?.availableSpace),c=Number.isFinite(l)&&l>0?l:0,h=t?.hierarchyDepth!=null,u=h&&t?.orientation==="y"&&t?.hierarchyRotatedLastLevel!==!0&&t?.rotated!==!0,d=h&&t?.orientation==="x"&&t?.hierarchyRotatedLastLevel!==!0;let p,f;if(t?.hierarchyRotatedLastLevel)p=Math.max(s,1),f=v.resolveHierarchyRotatedLabelLength(t);else if(u){const _=Number(t?.hierarchyLaneSize);t?.hierarchySideLaneClamped===!0&&Number.isFinite(_)&&_>0?p=_:p=Math.max(i*v.#L,s*v.HIERARCHY_LEVEL_GAP_FACTOR*2),f=s*v.HIERARCHY_HORIZONTAL_ROW_HEIGHT_FACTOR}else if(d){let _=Math.max(i*v.#L,s*2);c>0&&(_=Math.min(_,c)),p=_,f=v.#j(t,s,a)}else return v.resolveAxisTickForeignObjectBox(t);return v.#lt(t,p,f,s)}static resolveAxisTickForeignObjectBox(t){const e=Number(t?.font?.size),s=Number.isFinite(e)&&e>0?e:10,n=Number(t?.font?.width),i=Number.isFinite(n)&&n>=0?n:0,r=Number(t?.line?.size),a=Number.isFinite(r)&&r>=0?r:0,l=Number(t?.availableSpace),c=Number.isFinite(l)&&l>0?l:0;let h,u;const d=t?.hierarchyDepth!=null&&t?.orientation==="y"&&!t?.hierarchyRotatedLastLevel&&!t?.rotated;if(t?.hierarchyRotatedLastLevel)h=Math.max(s,1),u=v.resolveHierarchyRotatedLabelLength(t);else if(d){const p=c>0?c:s*v.HIERARCHY_HORIZONTAL_ROW_HEIGHT_FACTOR,f=Number(t?.hierarchyLaneSize);t?.hierarchySideLaneClamped===!0&&Number.isFinite(f)&&f>0?h=f:h=Math.max(i*v.#L,s*v.HIERARCHY_LEVEL_GAP_FACTOR*2),u=p}else{const p=c>0?c:i*v.#L;h=Math.max(p,s*2),u=v.#j(t,s,a)}return v.#lt(t,h,u,s)}static#j(t,e,s){const n=Number(t?.hierarchyLabelMaxLines),r=Number.isFinite(n)&&n>=1?e*n*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR:e*v.#T;return Math.max(r,e+s)}static#lt(t,e,s,n){let i=0;t?.textAnchor==="middle"?i=-(e/2):t?.textAnchor==="end"&&(i=-e);let r=0;t?.alignmentBaseline==="middle"?r=-(s/2):t?.alignmentBaseline==="baseline"&&(r=-s);const a=Number.isFinite(e)?e:n*2,l=Number.isFinite(s)?s:n*v.#T,c=Number.isFinite(i)?i:0,h=Number.isFinite(r)?r:0;return{width:a,height:l,x:c,y:h}}#J(t){const e=this.#k().ticks?.texts?.display!==!1,s=v.HIERARCHY_REVERSE_LANE_LINE_CLAMP;return t.style("display",({tick:n})=>e&&n?.hierarchyLabelHidden!==!0?null:"none").attr("class","plotter-tick-text-foreign-object").style("transform-box","view-box").style("transform-origin","0px 0px").attr("transform",({tick:n})=>this.#R(n?.transform)).attr("width",({tick:n})=>this.#O(n).width).attr("height",({tick:n})=>this.#O(n).height).attr("x",({tick:n})=>this.#O(n).x).attr("y",({tick:n})=>this.#O(n).y).style("overflow",({tick:n})=>n?.hierarchySideLaneClamped===!0||n?.hierarchyRotatedLastLevel===!0||Number(n?.hierarchyLabelMaxLines)>=1?"hidden":"visible").style("pointer-events","none").each((n,i,r)=>{const a=n.tick,l=a?.hierarchySideLaneClamped===!0&&a?.orientation==="y"&&a?.hierarchyRotatedLastLevel!==!0,h=window.d3.select(r[i]).selectAll("div.plotter-tick-text").data([a]).join(p=>p.append("xhtml:div").attr("class","plotter-tick-text"),p=>p).style("display",p=>p.orientation==="y"||p.hierarchyRotatedLastLevel?"flex":"block").style("width","100%").style("height","100%").style("align-items",p=>p.orientation==="y"||p.hierarchyRotatedLastLevel?"center":"flex-start").style("justify-content",p=>p.textAnchor==="middle"?"center":p.textAnchor==="end"?"flex-end":"flex-start").style("color",p=>p.font.color).style("font-size",p=>p.font.size+"px").style("line-height",p=>p.orientation==="y"?"normal":Number(p.hierarchyLabelMaxLines)>=1?`${p.font.size*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR}px`:p.font.size+"px").style("font-family",p=>p.font.family).style("font-weight",p=>p.font.weight).style("text-align",p=>p.textAnchor==="middle"?"center":p.textAnchor==="end"?"right":"left");if(l){h.style("white-space",null).style("overflow-wrap",null).style("word-break",null).text(null),h.selectAll("div.plotter-tick-text-label").data([a]).join(p=>p.append("xhtml:div").attr("class","plotter-tick-text-label"),p=>p).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("-webkit-line-clamp",String(s)).style("overflow","hidden").style("text-overflow","ellipsis").style("overflow-wrap","break-word").style("word-break","normal").style("white-space","normal").style("width","100%").style("max-width","100%").style("text-align","inherit").text(p=>p.text);return}if(h.selectAll("div.plotter-tick-text-label").remove(),a?.hierarchyRotatedLastLevel===!0){const p=Number(a?.font?.size),f=Number.isFinite(p)&&p>0?p:10,_=v.resolveHierarchyRotatedLabelLength(a);h.style("position","relative").style("display","block").style("width","100%").style("height","100%").style("white-space","nowrap").style("overflow-wrap","normal").style("word-break","normal").text(null),h.selectAll("div.plotter-tick-text-rotated").data([a]).join(g=>g.append("xhtml:div").attr("class","plotter-tick-text-rotated"),g=>g).style("position","absolute").style("left","50%").style("top","50%").style("bottom",null).style("width",`${_}px`).style("height",`${f}px`).style("line-height",`${f}px`).style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis").style("text-align","left").style("transform","translate(-50%, -50%) rotate(-90deg)").style("transform-origin","center center").attr("title",g=>g.text).text(g=>g.text);return}h.selectAll("div.plotter-tick-text-rotated").remove();const d=Number(a?.hierarchyLabelMaxLines);if(Number.isFinite(d)&&d>=1){h.style("position",null).style("white-space",null).style("overflow-wrap",null).style("word-break",null).text(null),h.selectAll("div.plotter-tick-text-label").data([a]).join(p=>p.append("xhtml:div").attr("class","plotter-tick-text-label"),p=>p).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("-webkit-line-clamp",String(Math.round(d))).style("overflow","hidden").style("text-overflow","ellipsis").style("overflow-wrap","break-word").style("word-break","normal").style("white-space","normal").style("width","100%").style("max-width","100%").style("text-align","inherit").text(p=>p.text);return}h.selectAll("div.plotter-tick-text-label").remove(),h.style("position",null).style("white-space","pre-line").style("overflow-wrap","normal").style("word-break","normal").text(p=>p.text)}),t}#tt(t){const e=Ve(this.#o?.plot?.layer?.configuration),s=typeof e.color=="string"&&e.color.length?e.color:"#000000",n=Number.isFinite(Number(e.size))?Number(e.size):1,i=Number.isFinite(Number(e.opacity))?Number(e.opacity):.1,r=Zl(e.rendering);return t.attr("class","plotter-axis-zero-line plotter-axis-baseline").attr("x1",a=>a.x1+10).attr("x2",a=>a.x2-10).attr("y1",a=>a.y1).attr("y2",a=>a.y2).attr("stroke",s).attr("stroke-opacity",i).attr("stroke-width",n).attr("stroke-dasharray",r||null)}#W(t,e){return t.scale.showZeroLine&&!t.scale.hidden?e.selectAll("line.plotter-axis-zero-line").data(t.zeroLine).join(s=>this.#tt(s.append("line")),s=>this.#tt(s),s=>s.remove()):e.selectAll("line.plotter-axis-zero-line").remove()}#it(t,e=!0){const s=t.attr("class","plotter-axis-label").style("transform-origin","center").style("transform-box","fill-box").attr("transform",n=>n.transform||"").attr("fill",n=>n.font?.color??"currentColor").style("alignment-baseline",n=>n.alignmentBaseline).style("text-anchor",n=>n.textAnchor).style("font-size",n=>n.font.size+"px").style("font-weight",n=>n.font.weight).style("font-family",n=>n.font?.family||null).text(n=>n.text);return e&&s.append("title").text(n=>"Click to sort {field}".translate({field:n.text})),s}#st(t,e,s,n){return e.selectAll("g.plotter-axis-header").data([t],i=>i.label.id).join(i=>{const r=i.append("g").attr("class","plotter-axis-header");return r.append("rect").attr("class","plotter-axis-header-hitbox").attr("fill","transparent").attr("stroke","none").style("pointer-events","all"),r.append("text"),r.append("g").attr("class","plotter-axis-sort-icon").style("pointer-events","none"),r},i=>i,i=>i.remove()).attr("transform",i=>`translate(${i.label.x}, ${i.label.y})`).style("cursor",s?"pointer":null).on("click",s?i=>{i.preventDefault(),i.stopPropagation(),this.#at(n)}:null)}#Q(t,e,s,n){const i=e||{x:0,y:0,width:0,height:n},r=s.iconX,a=s.iconY,l=s.iconX+n,c=s.iconY+n,h=Math.min(i.x,r),u=Math.min(i.y,a),d=Math.max(i.x+i.width,l),p=Math.max(i.y+i.height,c);t.style("display",null).attr("x",h).attr("y",u).attr("width",Math.max(1,d-h)).attr("height",Math.max(1,p-u))}#P(t,e,s,n){const i=t?.getBBox?.(),r=t?.getComputedTextLength?.()||i.width,a=n?r/2+s:-(e/2),l=n?i.y+(i.height-e)/2:-(r/2)-s-e;return{iconX:a,iconY:l,textBox:i}}#et(t,e,s,n,i){t.style("display",null).attr("transform",`translate(${i.iconX}, ${i.iconY})`).classed("is-active-sort",!!s);const r=this.#ut(e,s),a=D.get(r,{size:n,fill:"#000000"});t.selectAll("*").remove(),t.node().appendChild(a.cloneNode(!0))}#rt(t,e){const s=this.#z(t.scale),n=this.#U(t.scale),i=Number(t?.label?.font?.size)*1.5||15,r=5,a=["top","bottom"].includes(t.scale.position),l=this.#st(t,e,s,t.scale),c=l.select("text").datum(t.label);this.#it(c,s);const h=c.node(),u=this.#P(h,i,r,a),d=l.select("rect.plotter-axis-header-hitbox");this.#Q(d,u.textBox,u,i);const p=l.select("g.plotter-axis-sort-icon");if(!s){p.style("display","none"),d.style("display","none");return}this.#et(p,t.scale,n,i,u)}#ut(t,e){if(!e)return"inactive-sort-svg";const s=e==="desc"?"desc":"asc";if(t?._isDate||t?._valueType==="continuous"){const n=`date-by-${s}-svg`;return D.getIconData(n)?n:`value-by-${s}-svg`}return t?.dimension?`string-by-${s}-svg`:`value-by-${s}-svg`}#z(t){return!t.hidden&&t.sortable!==!1}#U(t){if(!this.#z(t))return null;const e=this.#o.plot.layer?.configuration?.sort?.scale;return!e?.name||!e?.direction?null:e.name===t?.value?e.direction:null}#at(t){const e=this.#o.plot,s=this.#U(t);let n="asc";s==="asc"?n="desc":s==="desc"&&(n=null),e.layer.configuration.sort.scale={name:t.value,direction:n},e.__parameters__?.parent?.markSettingsPersistDirty?.(),typeof e.__parameters__?.callbacks?.onSort=="function"&&e.__parameters__.callbacks.onSort({source:"axis",scale:t?.value,direction:n}),e._update()}#ct(t){const s=Ve(this.#o?.plot?.layer?.configuration).cut||{},n=t.ticks.find(h=>h?.tick?.line?.color!=null),i=t.ticks.find(h=>h?.tick?.strokeWidth!=null),r=typeof s.color=="string"&&s.color.length?s.color:n?.tick?.line?.color??"#000000",a=Number.isFinite(Number(s.size))?Number(s.size):i?.tick?.strokeWidth??1,l=Number.isFinite(Number(s.opacity))?Number(s.opacity):1,c=Zl(s.rendering);return{stroke:r,strokeWidth:a,strokeOpacity:l,dasharray:c}}#ot(t,e,s,n,i,r=1,a=""){const l=t.append("g").attr("class","plotter-axis-break-symbol"),c=v.#e;[e-i,e+i].forEach(h=>{l.append("line").attr("class","plotter-axis-break-symbol-shape").attr("x1",h).attr("y1",-c).attr("x2",h).attr("y2",c).attr("stroke",s).attr("stroke-opacity",r).attr("stroke-width",n).attr("stroke-dasharray",a||null).attr("stroke-linecap","square")})}#Y(t,e,s,n,i,r=1,a=""){const l=t.append("g").attr("class","plotter-axis-break-symbol"),c=v.#e;[e-i,e+i].forEach(h=>{l.append("line").attr("class","plotter-axis-break-symbol-shape").attr("x1",-c).attr("y1",h).attr("x2",c).attr("y2",h).attr("stroke",s).attr("stroke-opacity",r).attr("stroke-width",n).attr("stroke-dasharray",a||null).attr("stroke-linecap","square")})}#K(t,e){t.selectAll("*").remove();const{ticks:s,holes:n,scale:i}=e;if(!n.length||!s.length)return;const{stroke:r,strokeWidth:a,strokeOpacity:l,dasharray:c}=this.#ct(e),h=(p,f,_,g)=>{t.append("line").attr("class","plotter-axis-break-spine").attr("x1",p).attr("y1",f).attr("x2",_).attr("y2",g).attr("stroke",r).attr("stroke-opacity",l).attr("stroke-width",a).attr("stroke-dasharray",c||null).attr("stroke-linecap","square")},u=p=>{if(p.length<2)return v.#e*4;const f=[...p].sort((g,m)=>g-m),_=[];for(let g=1;g<f.length;g+=1){const m=f[g]-f[g-1];m>0&&_.push(m)}return _.length?(_.sort((g,m)=>g-m),_[Math.floor(_.length/2)]):v.#e*4},d=n.map(p=>({start:p.breakRange.start,end:p.breakRange.end})).sort((p,f)=>p.start-f.start);if(i.position==="bottom"||i.position==="top"){const p=s.map(b=>b.container.x),f=i.range?.length?Math.min(...i.range):Math.min(...p),_=i.range?.length?Math.max(...i.range):Math.max(...p),g=u(p),m=Math.min(g*v.#r/2,v.#i);let y=f;d.forEach(b=>{const A=(b.start+b.end)/2,L=A-m,T=A+m;L>y&&h(y,0,L,0),this.#ot(t,A,r,a,m,l,c),y=Math.max(y,T)}),y<_&&h(y,0,_,0)}else if(i.position==="left"||i.position==="right"){const p=s.map(b=>b.container.y),f=i.range?.length?Math.min(...i.range):Math.min(...p),_=i.range?.length?Math.max(...i.range):Math.max(...p),g=u(p),m=Math.min(g*v.#r/2,v.#i);let y=f;d.forEach(b=>{const A=(b.start+b.end)/2,L=A-m,T=A+m;L>y&&h(0,y,0,L),this.#Y(t,A,r,a,m,l,c),y=Math.max(y,T)}),y<_&&h(0,y,0,_)}}#b(t,e){e.selectAll("g.plotter-axis-hole").remove();const i=typeof(typeof t.scale?.getScale=="function"?t.scale.getScale():t.scale)?._scale?.bandwidth=="function";return e.selectAll("g.plotter-axis-discontinuities").data(t.holes.length>0&&i?[t]:[]).join(r=>{const a=r.append("g").attr("class","plotter-axis-discontinuities");return this.#K(a,t),a},r=>(this.#K(r,t),r),r=>r.remove())}#ht(t,e){const s=e.selectAll("g.plotter-axis-tick").data(t.ticks).join(n=>(n=n.append("g").attr("class","plotter-axis-tick").style("transform-box","view-box").style("transform-origin","0px 0px").attr("transform",({container:i})=>`translate(${i.x}, ${i.y})`),this.#gt(n),this.#J(n.append("foreignObject")),this.#I(n.append("line")),this.#_t(n,t),n),n=>(n=n.style("transform-box","view-box").style("transform-origin","0px 0px").attr("transform",({container:i})=>`translate(${i.x}, ${i.y})`),this.#gt(n),n.each((i,r,a)=>{const l=window.d3.select(a[r]),c=l.select(".plotter-tick-line"),h=l.select(".plotter-tick-text-foreign-object");this.#I(c),this.#J(h)}),this.#_t(n,t),n),n=>n.remove());return this.#nt(t,e),s}#nt(t,e){const s=t?.scale,n=e?.node?.()?.parentNode;if(!s?.name||!n)return;const i=this.#o.plot?.layer?.configuration?.axis?.grid||{},r=i.display===!0&&!s.dimension&&s.position==="left"&&!s.hidden,a=r?this.#o.plot._getRanges():null,l=a?Math.abs(a.horizontal[1]-a.horizontal[0]):0,c=`plotter-grid-${s.name}`;window.d3.select(n).selectAll(`:scope > g.plotter-grid.${c}`).data(r?[t]:[]).join(u=>u.insert("g",":first-child").attr("class",`plotter-grid ${c}`)).attr("transform",t.transform).style("pointer-events","none").selectAll("line.plotter-grid-line").data(t.ticks||[]).join("line").attr("class","plotter-grid-line").attr("x1",({container:u})=>u.x).attr("x2",({container:u})=>u.x+l).attr("y1",({container:u})=>u.y).attr("y2",({container:u})=>u.y).attr("stroke",i.color||"#D1D5DB").attr("stroke-opacity",i.opacity??1).attr("stroke-width",i.size??1).attr("stroke-dasharray",i.dash||"2 4")}#q(){const t=this.#o.plot,e=this.#o.trace;return e?.id?t?.instances?.[e.id]??null:null}#gt(t){return t.attr("data-step",e=>{const s=e?.sourceRow?.Level_00;return s!=null&&String(s).length>0?String(s):null}).attr("data-segment",e=>{const s=e?.sourceRow,n=s?.Segment??s?.Level_02??s?.Level_01;return n!=null&&String(n).length>0?String(n):null}).attr("data-row-id",e=>{const s=e?.sourceRow?.unique??e?.sourceRow?.id;return s!=null&&String(s).length>0?String(s):null}).attr("data-comparison",e=>{const s=e?.sourceRow?._sourceTableKey;return s!=null&&String(s).length>0?String(s):null})}#ft(t,e,s=null){const n=t?.scale?.hierarchy===!0,i=e?.sourceRow;if(!n||!i)return null;const r=s??this.#q();return typeof r?._resolveElementDatumForHierarchyRow!="function"?null:r._resolveElementDatumForHierarchyRow(i)}_resolveHierarchyTickInteractionDatum(t,e,s=null){const n=this.#ft(t,e,s);if(n)return n;const i=t?.scale?.hierarchy===!0,r=e?.sourceRow??null;return i&&r?{data:r}:null}#_t(t,e){const s=e?.scale?.hierarchy===!0;t.each((n,i,r)=>{const a=window.d3.select(r[i]),l=v.resolveAxisTickHitboxBox(n.tick),c=this.#R(n.tick?.transform),h=v.#a,u=s&&!!n?.sourceRow;a.selectAll("rect.plotter-axis-tick-hitbox").data([n]).join("rect").attr("class","plotter-axis-tick-hitbox").attr("fill","transparent").attr("stroke","none").attr("transform",c||null).style("pointer-events","all").style("cursor",u?"pointer":"context-menu").attr("x",l.x-h).attr("y",l.y-h).attr("width",Math.max(1,l.width+h*2)).attr("height",Math.max(1,l.height+h*2)).on("click",p=>{u&&(p.preventDefault(),p.stopPropagation(),this.#dt(p,e,n))}).on("mousemove",p=>{u&&this._handleHierarchyAxisTickMouseMove(p,e,n)}).on("mouseout",p=>{u&&this._handleHierarchyAxisTickMouseOut(p,e,n)}).on("contextmenu",p=>{p.preventDefault(),p.stopPropagation(),this.#yt(p,e,n)}).on("pointerdown",p=>{p.stopPropagation()}).selectAll("title").data([n]).join("title").text(p=>p?.tick?.text==null?"":String(p.tick.text))})}#dt(t,e,s){const n=this.#q();if(!n||typeof n._handleClick!="function")return;const i=this._resolveHierarchyTickInteractionDatum(e,s,n);i&&n._handleClick(t,i)}_handleHierarchyAxisTickMouseMove(t,e,s){const n=this.#q();if(!n||typeof n._mouseMove!="function")return;const i=this._resolveHierarchyTickInteractionDatum(e,s,n);i&&n._mouseMove(t,i)}_handleHierarchyAxisTickMouseOut(t,e,s){const n=this.#q();if(!n||typeof n._mouseOut!="function")return;const i=this._resolveHierarchyTickInteractionDatum(e,s,n);i&&n._mouseOut(t,i)}#yt(t,e,s){const n=this.#o.plot,i=this.#q(),r=n?.__parameters__?.parent?.__instance__?.contextMenu;if(!i||!r)return;const a=e?.scale??this.#o.scale,l=a?.name,c=s?.tick?.value??s?.value,h={[oi]:!0,[$a]:tc(a),scaleName:l,axisRole:a?.key??null,tickValue:c},u=e?.scale?.hierarchy===!0,d=this.#ft(e,s,i),p=d?.data??(u?s?.sourceRow:null)??null,f=p?{...p,...h}:h,_=d??(p?{data:p}:f);typeof i.callbacks?.onContextMenu=="function"&&setTimeout(()=>{try{i.callbacks.onContextMenu(t,_)}catch{}}),r.render(t,f,i)}#At(t){return t.attr("id",e=>e.id).attr("class",e=>`plotter-axis plotter-axis-${e.scale.name}`).attr("data-id",e=>e.scale.name).attr("opacity",e=>e.scale.hidden?0:1).attr("transform",e=>e.transform).each((e,s,n)=>{const i=window.d3.select(n[s]);return this.#W(e,i),e.label.display&&this.#rt(e,i),this.#b(e,i),this.#ht(e,i),this.#vt(e,i),i})}#vt(t,e){const s=t?.scale?.hierarchy===!0,n=lg(this.#o?.plot?.layer?.configuration),i=n.render,r=s&&i!=="none",a=r?v.collectHierarchyTreeLineLinks(t.ticks,t.scale.position,i,n.stems):[],l=n.color==null||n.color===""?"currentColor":n.color,c=e.selectAll("g.plotter-axis-hierarchy-tree-lines").data(r?[t.scale.name]:[]).join(h=>h.append("g").attr("class","plotter-axis-hierarchy-tree-lines").style("pointer-events","none"),h=>h,h=>h.remove());c.selectAll("path.plotter-axis-hierarchy-tree-line").data(a,h=>h.id).join(h=>h.append("path").attr("class","plotter-axis-hierarchy-tree-line").attr("fill","none").attr("d",u=>u.path).attr("stroke",l).attr("stroke-width",n.size).attr("stroke-opacity",n.opacity).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").style("pointer-events","none"),h=>h.attr("d",u=>u.path).attr("stroke",l).attr("stroke-width",n.size).attr("stroke-opacity",n.opacity).attr("stroke-linecap","butt").attr("stroke-linejoin","miter"),h=>h.remove()),r&&c.lower()}}const nt={RELATIVE_MULTIPLIER:100,DEFAULT_MIN_SIZE:10,DEFAULT_MAX_SIZE_MULTIPLIER:25,SPLIT_AXIS_GUTTER:20,SPLIT_BAND_SPACE_ABOVE_TITLE:20,SPLIT_BAND_TITLE_SIZE:12,SPLIT_BAND_TITLE_GAP:4,SPLIT_OVERLAY_LAG:10,HIERARCHY_AXIS_LEVEL_GAP_FACTOR:1.75,WATERFALL_TOP_LINE_FONT_SIZE:10,WATERFALL_TOP_LINE_GAP:3,WATERFALL_TOP_LINE_BAR_OFFSET:8,WATERFALL_TOP_LINE_VALUE_LABEL_CLEARANCE:6,WATERFALL_TOP_LINE_DEPTH_ROW_GAP_FACTOR:1,WATERFALL_LABEL_FONT_SIZE:11,WATERFALL_LABEL_LINE_GAP:2,WATERFALL_LABEL_VERTICAL_OFFSET:8,WATERFALL_GROUP_TOPLINE_AXIS_GUTTER:20,MILLISECONDS_PER_DAY:864e5,DAY_WITH_EXTRA_HOUR:9e7};class On{baseRange=[];range=[];domain=[];scale=[];stackRange=[];stackDomain=[];texts=[];start=null;end=null;name="";key="";value="";unit="";stack="";split="";splitValue=null;splitValues=null;signed=!1;label="";position="";format="";stackFormat="";upper="";lower="";hidden=!1;scalePadding=!1;legend=!0;sortable=!0;stackSortable=!0;showZeroLine=!1;baselineValue=0;_waterfallSplitTopPaddingMap=null;dimension=!1;relative=!1;hierarchy=!1;ignoreStackPosition=!1;mainValueOnly=!1;joinMissingValues=!1;refer=null;data=null;_sourceData=null;brushData=[];group="";isUsing=!1;holesSkipped=!1;_trace=null;_configuration=null;_filters=!1;_isDate=!1;_isStackDate=!1;_valueType="";_stackType="";_uniqueValue=null;_scale=t=>t;_traceSize=null;_traceSizeRange=null;_stackScale=t=>t;_elementSize=0;_stackElementSize=0;_d3=null;_uniqueSplit=null;_isCompositeDimensionSplit=!1;_compositeDimensionEntries=[];_stackDistribution;_traceSizeScale=null;_traceSizeDomain=null;_dateHolesAfter=[];_hierarchyRows=[];_hierarchyMaxDepth=0;#t=new Map;#e=new Map;#s=null;#n=null;#r=null;#i=null;#a=new WeakMap;#l=new WeakMap;#h=new WeakMap;constructor(t,e,{domain:s=[],brushData:n=[],texts:i=[],scale:r=[],start:a=null,end:l=null,value:c="",stack:h="",split:u="",splitValue:d=null,splitValues:p=null,signed:f=!1,label:_="",position:g="",format:m="",upper:y="",lower:b="",hidden:A=!1,legend:L=!0,relative:T=!1,ignoreStackPosition:E=!1,mainValueOnly:C=!1,scalePadding:S=!0,unit:w="",ticks:N=!1,sortable:R=!0,stackSortable:M=!0,hierarchy:k=!1}={},{baseRange:I=[],name:O="",key:F="",using:P=null,joinMissingValues:B=!1,traceCondition:V=null,legendCondition:H=null,filters:U=null,trace:j=null,dimension:z=!1,configuration:Y=null}={}){this.data=e,this._sourceData=e,this.brushData=n,this.dimension=z||k,this.name=O,this.key=F,this.hierarchy=k,this.baseRange=I,this.domain=s,this.scale=r,this.texts=i,this.start=a,this.end=l,this.unit=w,this.value=c,this.stack=h,this.split=u,this.splitValue=d,this.splitValues=Array.isArray(p)?p:null,this.signed=f===!0,this.label=_!==!1?_||c:!1,this.position=g,this.ticks=N,this.group=h,this.format=m,typeof m=="string"&&m.length&&(this.#s=m),this.upper=y,this.lower=b,this.scalePadding=S,this.hidden=A,this.legend=L,this.sortable=R,this.stackSortable=M,this.relative=T,this.ignoreStackPosition=E,this.mainValueOnly=C,this.joinMissingValues=B,this.traceCondition=V,this.legendCondition=H,this.isUsing=!!P,this.#r=P,this._d3=t,this._trace=j,this._configuration=Y,this._filters=U}setReference(t){this.refer=t}getScale(){return this.#r??this}getHierarchyRowDepth(t){const e=this.#v(t);if(e!=null){const n=Number(e.depth);if(Number.isFinite(n)&&n>=0)return n}const s=Number(t?.depth);return Number.isFinite(s)&&s>=0?s:0}#p(t,e,{forceValue:s=!1}){let n=this.#r.for(t,e||this.#r.value,{forceValue:s});return this._traceSizeScale&&(n+=this.#r.size(t,1)/2,n-=this.size(t,1)/2),n}#y(t,e,s){const n=this.#Q(e,!1,t),i=s/n*nt.RELATIVE_MULTIPLIER;return t.plotter&&!t.plotter?.relativeValue&&(t.plotter[this.key+"RelativeValue"]=i),i}#L(t){const e=this._stackDistribution[t[this.value]],s=[...this.stackRange],i=Math.abs(s[1]-s[0])/e.length,r=e.indexOf(t[this.stack]);return Math.min(...s)+r*i}for(t,e,{forceValue:s=!1}={}){if(this.#r)return this.#p(t,e,{forceValue:s});let n=0,i=0,r,a,l=e||this.value,c=s!==!1?s:t[l];if(r=c,this.dimension&&s===!1&&(r=this.getDomainValue(t,r)),this.relative&&!this._isDate?r=this.#y(t,l,r):this._isDate&&(r=W.resolveAxisTimestamp(r,this.format)),n=this._scale(r),this.hierarchy&&this.dimension){const u=this.getGroupedSplitValue(t),p=(u!=null?this._groupedHierarchyBySplit.get(u):null)?.scale,f=p?p(r):null;f!=null&&(n=f)}const h=this.stack&&!this.ignoreStackPosition&&s===!1&&(typeof this._stackScale?.bandwidth=="function"||!this._isStackDate);return this.dimension&&!h&&!this.hierarchy&&(n+=this._elementSize*((1-this._configuration.axis.ratioOfElementSize)/2)),this.stack&&!this.ignoreStackPosition&&s===!1&&(a=t[this.stack],this.relative&&!this._isStackDate?a=this.#y(t,this.stack,a):this._isStackDate&&(a=W.fromFormat(a,this.stackFormat).getTimestamp()),this._stackDistribution[c]&&this._stackDistribution[c].length!==this.#U().length?i=this.#L(t):(i=this._stackScale(a),h?i+=this._stackElementSize*((1-this._configuration.axis.ratioOfElementSize)/2):i-=this._stackElementSize*(1-this._configuration.axis.ratioOfElementSize))),n+=this.getSplitLag(t),this._valueType==="continuous"&&this.dimension&&(!this._isDate||!this.joinMissingValues)&&(n-=this._elementSize/2),n+i}height(t,e,{forceValue:s=!1}={}){return Math.max(...this.range)+this.getSplitLag(t)-this.for(t,e,{forceValue:s})}getSplitLag(t){if(!this.split||this.dimension||t==null&&this.splitValue==null)return 0;const e=this.#Y(),s=this.splitValue??t[this.split],n=e.indexOf(s);if(n===-1||this.#T())return 0;const i=this.#E(e.length);return this.baseRange[1]>this.baseRange[0]?n*i:(e.length-1-n)*i}#T(){return this._trace?.type==="waterfall"&&this._configuration?.axis?.groupedAxes?.mode==="overlay"&&this.split!=null&&this.split!==""}#u(){if(this.splitValues?.length){const c=Number(this._configuration?.axis?.title?.size)||nt.SPLIT_BAND_TITLE_SIZE;return nt.SPLIT_BAND_SPACE_ABOVE_TITLE+c+nt.SPLIT_BAND_TITLE_GAP+Ln(this._configuration,{type:"bars"})}const t=this._configuration?.axis?.groupedAxes?.enabled===!0,e=this.hierarchy||this.refer?.hierarchy,s=this._trace?.type==="waterfall"&&this.split!=null&&this.split!==""&&this.refer?.hierarchy===!0&&this.refer?.split!=null&&this.refer?.split!=="";if(!t||!(e||s))return 0;const i=Number(this._configuration?.axis?.groupedAxes?.gutter),a=Number.isFinite(i)&&i>=0?i:nt.SPLIT_AXIS_GUTTER,l=this.#A();return Math.max(a,l)}#c(){const t=Number(this._configuration?.axis?.ticks?.texts?.size)||10,e=Number(this.refer?._hierarchyMaxDepth),s=Number.isFinite(e)?Math.max(e,0):0,n=nt.HIERARCHY_AXIS_LEVEL_GAP_FACTOR,i=this.refer?.position??"bottom",r=this._configuration?.reverse===!0,a=["left","right"].includes(i);return r&&a?v.estimateWaterfallSideTickExtent(s,t,n,0,!0):v.estimateWaterfallBottomTickExtent(s,t,n,0,{axisPosition:i,isReverse:r})}#m(){if(this._trace?.type!=="waterfall")return 0;const t=this._trace?.topLine,e=Array.isArray(this.refer?._sourceData)?this.refer._sourceData:this._sourceData,n=[...Array.isArray(e)?e:[]];let i=-1;for(;n.length;){const l=n.pop();if(!l)continue;let c;if(typeof t=="function"?c=t({data:l}):c=[l?.Top_Line_Label],Array.isArray(c)&&c.some(d=>d!=null&&String(d).length>0)){let d=0,p=l;for(;p?.parent;)d+=1,p=p.parent;d>i&&(i=d)}const u=Array.isArray(l.children)?l.children:[];for(let d=0;d<u.length;d+=1)n.push(u[d])}if(!(i<0?0:i+1))return 0;const a=nt.WATERFALL_TOP_LINE_FONT_SIZE+nt.WATERFALL_TOP_LINE_GAP;return a+i*nt.WATERFALL_TOP_LINE_DEPTH_ROW_GAP_FACTOR*a+nt.WATERFALL_TOP_LINE_BAR_OFFSET+nt.WATERFALL_TOP_LINE_VALUE_LABEL_CLEARANCE}#o(){if(this._trace?.type!=="waterfall")return 0;const t=this._trace?.label;if(typeof t!="function")return 0;const e=Array.isArray(this.refer?._sourceData)?this.refer._sourceData:this._sourceData,n=[...Array.isArray(e)?e:[]];let i=0;for(;n.length;){const a=n.pop();if(!a)continue;const l=Array.isArray(a.children)?a.children:[];if(l.length){for(let u=0;u<l.length;u+=1)n.push(l[u]);continue}const c=t({data:a}),h=Array.isArray(c)?c.filter(u=>u!=null&&String(u).length>0).length:0;h>i&&(i=h)}if(!i)return 0;const r=nt.WATERFALL_LABEL_FONT_SIZE+nt.WATERFALL_LABEL_LINE_GAP;return(i-1)*r+nt.WATERFALL_LABEL_VERTICAL_OFFSET}#A(){const t=this.#c(),e=this.#m(),s=this.#o(),n=4,i=Number(this._configuration?.axis?.ticks?.texts?.size)||10,a=this._trace?.type==="waterfall"&&this._configuration?.reverse===!0?i*1.5:0,c=this._trace?.type==="waterfall"&&this.refer?.hierarchy===!0&&this.refer?.split!=null&&this.refer?.split!==""?nt.WATERFALL_GROUP_TOPLINE_AXIS_GUTTER:0;return Math.max(0,t+e+s+n+a+c)}#E(t){return this.#d(t).pitch}#d(t){const e=Math.max(Number(t)||0,1),s=Math.max(...this.baseRange)-Math.min(...this.baseRange);if(e===1)return{pitch:s,bandSize:s,gutter:0};if(this.#T())return{pitch:nt.SPLIT_OVERLAY_LAG,bandSize:s,gutter:0};const n=Math.max(0,Number(this.#u())||0),i=Math.max(0,(s-e)/(e-1)),r=Math.min(n,i),a=(s-r*(e-1))/e;return{pitch:a+r,bandSize:a,gutter:r}}size(t,e=1){if(this._traceSizeScale)return this.#ht(t)*e;if(this.#r)return this.#r.size(t,e);if(this.hierarchy&&this.dimension){const n=this.#v(t)?.span??1,i=this.getGroupedSplitValue(t);return((i!=null?this._groupedHierarchyBySplit.get(i):null)?.elementSize??this._elementSize)*n}if(this.stack&&!this.ignoreStackPosition){const s=t[this.value];if(this._stackDistribution[s]&&this._stackDistribution[s].length!==this.#U().length){const n=this._stackDistribution[s],i=[...this.stackRange];return Math.abs(i[1]-i[0])/n.length*e}else return this._stackElementSize*e}return this._elementSize*e}clearCaches(){this.#t.clear(),this.#e.clear(),this.#s=null,this.#n=null,this.format="",this.stackFormat="",this._uniqueValue=[],this._uniqueSplit=[],this._isCompositeDimensionSplit=!1,this._compositeDimensionEntries=[],this.#h=new WeakMap,this._groupedHierarchyBySplit=new Map,this._groupedHierarchyRowSplit=new WeakMap}updateData(t){this.data=t,this._sourceData=t,this.clearCaches(),this.init()}setTraceSize(t,e=null){this._traceSize=t,this._traceSizeRange=e,this.#b()}#_(){this.data=this._sourceData,this._uniqueValue=[],this._uniqueSplit=[],this._isCompositeDimensionSplit=!1,this._compositeDimensionEntries=[],this.domain=[],this.stackDomain=[],this._hierarchyRows=[],this._hierarchyMaxDepth=0,this.#a=new WeakMap,this.#l=new WeakMap,this.#h=new WeakMap,this._groupedHierarchyBySplit=new Map,this._groupedHierarchyRowSplit=new WeakMap,this._waterfallSplitTopPaddingMap=null}getWaterfallSplitTopPaddingMap(){return this._waterfallSplitTopPaddingMap}applyWaterfallSplitMetricPadding(t,e,s=!1,{coordinateIncludesSplitLag:n=!0}={}){const i=this._waterfallSplitTopPaddingMap;if(!(i instanceof Map)||i.size===0)return t;const r=this.split,a=["left","right","top","bottom"].includes(this.position);if(!r||!a)return t;const l=i.get(e)??0;if(l<=0)return t;const c=e!=null?{[r]:e}:null,h=n&&c?this.getSplitLag(c):0,u=(this.range?.[0]??0)+h,d=(this.range?.[1]??0)+h,p=Math.min(u,d),f=Math.max(u,d),_=Math.max(f-p,1),g=["top","bottom"].includes(this.position),m=s&&g,y=m?p:Math.min(p+l,f-1),b=m?Math.max(f-l,p+1):f,A=Math.max(b-y,1),L=(t-p)/_;return y+L*A}isGroupedAxesEnabled(){return this._configuration?.axis?.groupedAxes?.enabled===!0}getGroupedHierarchySplitKey(){return!this.isGroupedAxesEnabled()||!this.hierarchy||!this.dimension?null:this.refer?.split||null}getGroupedSplitValues(){return Array.from(this._groupedHierarchyBySplit.keys())}getGroupedSplitValue(t){return t?this._groupedHierarchyRowSplit.get(t)??null:null}#C(){return!!(this.dimension&&this.split)}#S(){Array.isArray(this.#i)||this.#P(this.value);const t=Array.isArray(this.#i)&&this.#i.length?this.#i:Array.isArray(this.data)?this.data:[],e=[],s=new Map;for(let n=0;n<t.length;n+=1){const i=t[n];if(!i)continue;const r=i[this.value],a=i[this.split],l=JSON.stringify([r,a]);let c=s.get(l);c||(c={key:l,dimensionValue:r,splitValue:a},s.set(l,c),e.push(c)),this.#h.set(i,c)}return this._compositeDimensionEntries=e,this._isCompositeDimensionSplit=e.length>0,e}getDomainValue(t,e=null){if(this.hierarchy&&this.dimension)return this.#v(t)?.firstLeafKey??this.#x(t)??e;if(this._isCompositeDimensionSplit&&this.dimension){const s=this.#h.get(t);if(s)return s.key}return e}getCompositeDimensionLabel(t){if(!this.dimension||!this.split||!t)return null;if(this._isCompositeDimensionSplit){const e=this.#h.get(t);return e?`${e.dimensionValue} / ${e.splitValue}`:null}return`${t[this.value]} / ${t[this.split]}`}#g(t,e,s){const n=t?.id??t?.unique??t?.hierarchyPath??t?.[this.value]??`row-${s}`;return`${e}/${n}-${s}`}#f(t=[]){const e=[],s=Array.isArray(t)?t:[],n=(i,r,a)=>{if(!i)return;const l=this.#g(i,r,a);this.#a.set(i,l),e.push(i),(Array.isArray(i.children)?i.children:[]).forEach((h,u)=>n(h,l,u))};return s.forEach((i,r)=>n(i,"root",r)),e}#x(t){if(t)return this.#a.get(t)}#v(t){if(t)return this.#l.get(t)}#D(t=[]){const e=[],s=Array.isArray(t)?t:[],n=(i,r=0)=>{if(!i)return null;const a=Array.isArray(i.children)?i.children:[],l=this.#x(i),c=r;if(c>this._hierarchyMaxDepth&&(this._hierarchyMaxDepth=c),!a.length){e.push(l);const d={depth:c,span:1,firstLeafKey:l,lastLeafKey:l,isLeaf:!0};return this.#l.set(i,d),d}const h=a.map(d=>n(d,r+1)).filter(d=>d!=null);if(!h.length){e.push(l);const d={depth:c,span:1,firstLeafKey:l,lastLeafKey:l,isLeaf:!0};return this.#l.set(i,d),d}const u={depth:c,span:h.reduce((d,p)=>d+p.span,0),firstLeafKey:h[0].firstLeafKey,lastLeafKey:h[h.length-1].lastLeafKey,isLeaf:!1};return this.#l.set(i,u),u};return s.forEach(i=>n(i,0)),e}_makeHierarchy(){const t=[...this.baseRange],e=this.brushData.length?this.brushData:this._sourceData,s=this.#f(e),n=this.#D(e),r=this.dimension&&["left","right"].includes(this.position)?[...n].reverse():n,a=Math.max(n.length,1);this._valueType="discrete",this._isDate=!1,this._hierarchyRows=s,this.data=s,this._uniqueValue=n,this.domain=r,this.range=t,this._elementSize=Math.abs(t[1]-t[0])/a,this._scale=window.d3.scaleBand().domain(this.domain).range(t),this.#B()}#B(){const t=this.getGroupedHierarchySplitKey();if(!t)return;const e=new Map;for(let s=0;s<this._hierarchyRows.length;s+=1){const n=this._hierarchyRows[s],i=n?.[t];i!=null&&(e.has(i)||e.set(i,[]),e.get(i).push(n),this._groupedHierarchyRowSplit.set(n,i))}e.forEach((s,n)=>{const i=[],r=new Set;for(let d=0;d<s.length;d+=1){const p=s[d],f=this.#v(p);f?.isLeaf&&(r.has(f.firstLeafKey)||(i.push(f.firstLeafKey),r.add(f.firstLeafKey)))}const a=i.length?i:this.domain,c=this.dimension&&["left","right"].includes(this.position)?[...a].reverse():a,h=window.d3.scaleBand().domain(c).range(this.range),u=Math.abs(this.range[1]-this.range[0])/Math.max(c.length,1);this._groupedHierarchyBySplit.set(n,{scale:h,leafKeys:r,elementSize:u})})}init(){if(this.#_(),this.hierarchy)this._makeHierarchy();else if(!this.#r){if(this._valueType=this._getType(),this._valueType==="continuous"?this._makeContinuous():this._makeDiscrete(),this.stack)switch(this._stackType=this._getType(!0),this._stackDistribution=this._getDistribution(),this._stackType){case"continuous":this._makeContinuous(!0);break;case"discrete":this._makeDiscrete(!0);break}this.#st(),this.#$()}}#$(){if(this._waterfallSplitTopPaddingMap=null,this._trace?.type!=="waterfall"||this.dimension)return;const t=this.split;if(t==null||t===""||!["left","right","top","bottom"].includes(this.position))return;const e=this.#F();if(!Array.from(e.values()).some(r=>r>=0))return;const n=nt.WATERFALL_TOP_LINE_FONT_SIZE+nt.WATERFALL_TOP_LINE_GAP,i=new Map;e.forEach((r,a)=>{if(r<0){i.set(a,0);return}const l=n+r*nt.WATERFALL_TOP_LINE_DEPTH_ROW_GAP_FACTOR*n+nt.WATERFALL_TOP_LINE_BAR_OFFSET+nt.WATERFALL_TOP_LINE_VALUE_LABEL_CLEARANCE;i.set(a,l)}),this._waterfallSplitTopPaddingMap=i}#F(){const t=new Map,e=this.split,s=this._trace?.topLine,n=Array.isArray(this.refer?._sourceData)?this.refer._sourceData:this._sourceData,r=[...Array.isArray(n)?n:[]];for(;r.length;){const a=r.pop();if(!a)continue;const l=Array.isArray(a.children)?a.children:[],c=a?.[e];let h;if(typeof s=="function"?h=s({data:a}):h=[a?.Top_Line_Label],Array.isArray(h)&&h.some(d=>d!=null&&String(d).length>0)){let d=0,p=a;for(;p?.parent;)d+=1,p=p.parent;const f=t.get(c)??-1;t.set(c,Math.max(f,d))}if(l.length)for(let d=0;d<l.length;d+=1)r.push(l[d])}return t}_getDistribution(t=!1){const e={},s={},n=this.#U();return this.#z().forEach(r=>{const a=this.#i.filter(h=>h[this.value]===r),l=new Set(a.map(h=>h[this.stack]).filter(h=>h!=null)),c=n.filter(h=>l.has(h));e[r]=c,s[r]=a}),t?s:e}_getType(t=!1){let e=t?this.#U():this.#z(),s=!1,n=t?this.#n:this.#s;if(!n&&!t&&typeof this.format=="string"&&this.format.length&&(n=this.format,this.#s=this.format),!n&&t&&typeof this.stackFormat=="string"&&this.stackFormat.length&&(n=this.stackFormat,this.#n=this.stackFormat),n)s=!0,t?this.stackFormat=n:this.format=n;else{const r=e.filter(l=>l!=null&&l!=="");let a=r.map(l=>W.detectDateFormat(l)).filter(l=>l);if(s=a.length>0&&a.length===r.length,s){const l=W.selectDateFormat(a);t?(this.stackFormat=l,this.#n=l):(this.format=l,this.#s=l)}}if(t?this._isStackDate=s:this._isDate=s,s)return"continuous";const i=e.filter(r=>r!=null&&r!=="");return i.length&&i.every(r=>typeof r=="number")?"continuous":"discrete"}#w(t,e){let s=!e&&this.start!=null?W.fromFormat(this.start,this.format).getTimestamp():t[0],n=!e&&this.end!=null?W.fromFormat(this.end,this.format).getTimestamp():t[t.length-1];return{min:s,max:n}}#G(t){const e=t?this.#U():this.#z(),s=t?this.stackFormat:this.format,n=[],i=e.map(u=>W.resolveAxisTimestamp(u,s)).filter(u=>!Number.isNaN(u));let r=i;if(!t)r=[...i].sort((u,d)=>u-d);else{const u=this.#ct();u&&(r=[...i].sort((d,p)=>d-p),u==="desc"&&r.reverse())}const a=[];this._dateHolesAfterID=[];for(let u=0;u<r.length;u+=1){if(u>0){const d=Math.abs(r[u]-r[u-1]);d>nt.MILLISECONDS_PER_DAY&&d!==nt.DAY_WITH_EXTRA_HOUR&&(this._dateHolesAfterID.push(u),n.push(r[u-1]),a.push(r[u]-nt.DAY_WITH_EXTRA_HOUR))}a.push(r[u])}const l=dg(this._configuration);n.length<r.length-1&&l?(this._dateHolesAfter=n,this.holesSkipped=!1):(this._dateHolesAfter=[],this._dateHolesAfterID=[],n.length&&(this.holesSkipped=!0));const{min:c,max:h}=this.#w(a,t);if(t){let u=this._elementSize/a.length;this._stackElementSize=u*this._configuration.axis.ratioOfElementSize,this.stackRange=[0,this._elementSize],this.joinMissingValues?(this.stackDomain=a,this._stackScale=this._d3.scaleBand().domain(this.stackDomain).range(this.stackRange)):(this.stackDomain=[c,h],this._stackScale=this._d3.scaleTime().domain(this.stackDomain).range(this.stackRange))}else{if(this.#C()){const p=this.#S();this.range=[...this.baseRange],this.domain=p.map(_=>_.key),this._uniqueValue=[...this.domain];const f=Math.max(this.domain.length,1);this._elementSize=Math.abs(this.baseRange[this.baseRange.length-1]-this.baseRange[0])/f*this._configuration.axis.ratioOfElementSize,this._scale=this._d3.scaleBand().domain(this.domain).range(this.range);return}if(this.split){let p=this.#Y();if(this.#T())this.range=[...this.baseRange];else{const f=this.#d(p.length);this.range=this.#K(f.bandSize)}}else this.range=[...this.baseRange];const u=Math.abs((this.baseRange[this.baseRange.length-1]-this.baseRange[0])/a.length);if(this._elementSize=this.joinMissingValues?u:u*this._configuration.axis.ratioOfElementSize,this.dimension&&!this.joinMissingValues){const p=Math.sign(this.range[1]-this.range[0]);this.range[0]+=p*(this._elementSize/2),this.range[1]-=p*(this._elementSize/2)}const d=["left","right"].includes(this.position);if(this.joinMissingValues)this.domain=d?a.reverse():a,this._scale=this._d3.scaleBand().domain(this.domain).range(this.range);else{let p=d?[h,c]:[c,h];this.domain=this.scale?.length?this.scale:p,this._scale=this._d3.scaleTime().domain(this.domain).range(this.range)}}}#N(t){let e=this.refer._getDistribution(!0),s=Object.values(e).map(i=>i.reduce((r,a)=>r+(a[t]||0),0));return Object.values(e).map((i,r)=>i.map(a=>a[t]/s[r]*100)).flat()}#R(t,e,s){const n=this.#Q(s,e);return t.map(i=>i/n*nt.RELATIVE_MULTIPLIER)}#M(){const t=this.refer.#z(),e={};return t.forEach(s=>{e[s]=this.data.filter(n=>n[this.refer.value]===s).reduce((n,i)=>n+Number(i[this.value]||0),0)}),Object.values(e)}getAutoContinuousDomain(t={}){if(!(!this.hierarchy&&this._valueType==="continuous"&&!this._isDate))return null;let i=(t.includeBounds!==!1?this.#ut(t):this.#P(this.value)).map(c=>Number(c));if(this.relative){const c=this.value;this.refer?i=this.#N(c):i=this.#R(i,!1,c)}i.sort((c,h)=>c-h);const{min:r,max:a}=this.#k(i,!1,t);return Number.isFinite(r)&&Number.isFinite(a)?{min:r,max:a}:null}#k(t,e,s={}){let n=t.filter(h=>!isNaN(h)&&isFinite(h)),i=!e&&this.start!=null?Number(this.start):n[0],r=!e&&this.end!=null?Number(this.end):n[n.length-1];if(this.mainValueOnly&&!this.dimension){let h=this.#M();i=!e&&this.start!=null?Number(this.start):Math.min(...h),r=!e&&this.end!=null?Number(this.end):Math.max(...h)}const a=r-i,l=i,c=r;if(!e){const h=s.applyPadding!==!1;if(this.start==null){const p=this._configuration.axis.continuous.paddingOnMinValue||this._configuration.axis.continuous.padding||.1;i=i-(h&&this.scalePadding?a*p:0)}if(this.end==null){const p=this._configuration.axis.continuous.paddingOnMaxValue||this._configuration.axis.continuous.padding||.1;r=r+(h&&this.scalePadding?a*p:0)}const u=Ve(this._configuration),d=s.includeZero??hg(u,l,c);d&&(i>0&&this.start==null&&(i=0),r<0&&this.end==null&&(r=0)),this._trace?.type==="waterfall"&&((d||l===0)&&this.start==null&&l>=0&&i<0&&(i=0),(d||c===0)&&this.end==null&&c<=0&&r>0&&(r=0))}return{min:i,max:r}}#Z(t,e,s){if(this.showZeroLine=!1,this.baselineValue=0,this.dimension||s)return;const n=Ve(this._configuration);n.display!==!1&&(this.showZeroLine=!0,this.baselineValue=ug(n,t))}#V(t){let s=(t?this.#U():this.#ut()).map(r=>Number(r));if(this.relative){const r=t?this.stack:this.value;this.refer?s=this.#N(r):s=this.#R(s,r,t)}s.sort((r,a)=>r-a);const{min:n,max:i}=this.#k(s,t);if(this.#Z(n,i,t),t){let r=this._elementSize/s.length;this._stackElementSize=r*this._configuration.axis.ratioOfElementSize,this.stackDomain=[n-.5,i+.5],this.stackRange=[0,this._elementSize-this._stackElementSize],this._stackScale=this._d3.scaleLinear().domain(this.stackDomain).range(this.stackRange)}else{if(this.#C()){const a=this.#S();this.range=[...this.baseRange],this.domain=a.map(c=>c.key),this._uniqueValue=[...this.domain];const l=Math.max(this.domain.length,1);this._elementSize=Math.abs(this.baseRange[this.baseRange.length-1]-this.baseRange[0])/l*this._configuration.axis.ratioOfElementSize,this._scale=this._d3.scaleBand().domain(this.domain).range(this.range);return}if(this.dimension&&["left","right"].includes(this.position)?this.domain=this.scale?.length?this.scale:[i,n]:this.domain=this.scale?.length?this.scale:[n,i],this.split){let a=this.#Y();if(this.#T())this.range=[...this.baseRange];else{const l=this.#d(a.length);this.range=this.#K(l.bandSize)}}else this.range=[...this.baseRange];if(this.dimension){if(this.domain.every(a=>a%1===0)){const a=Math.sign(this.domain[1]-this.domain[0])||1;this.domain[0]-=a*.5,this.domain[1]+=a*.5}this._elementSize=(this.baseRange[this.baseRange.length-1]-this.baseRange[0])/(s.length-.5)*this._configuration.axis.ratioOfElementSize}else this._elementSize=(this.baseRange[this.baseRange.length-1]-this.baseRange[0])/s.length*this._configuration.axis.ratioOfElementSize;this._scale=this._d3.scaleLinear().domain(this.domain).range(this.range)}}_makeContinuous(t=!1){return this._isDate||t&&this._isStackDate?this.#G(t):this.#V(t)}_makeDiscrete(t=!1){if(t){this.stackDomain=this.#U();let e=this._elementSize*((1-this._configuration.axis.ratioOfElementSize)/2);const s=this._elementSize*this._configuration.axis.ratioOfElementSize,n=this.stackDomain.length;this._stackElementSize=s/n,this.stackRange=[e,s+e],this._stackScale=this._d3.scaleBand().domain(this.stackDomain).range(this.stackRange)}else{if(this.#C()){const r=this.#S();this.domain=r.map(c=>c.key),this._uniqueValue=[...this.domain];const a=Math.abs(this.baseRange[1]-this.baseRange[0]),l=Math.max(this.domain.length,1);this._elementSize=a/l,this.range=[...this.baseRange],this._scale=this._d3.scaleBand().domain(this.domain).range(this.range);return}const e=this.#z().sort((r,a)=>String(r).localeCompare(String(a))),s=this.dimension&&["left","right"].includes(this.position);this.domain=s?e.reverse():e;const n=Math.abs(this.baseRange[1]-this.baseRange[0]),i=this.domain.length;this._elementSize=n/i,this.range=[...this.baseRange],this._scale=this._d3.scaleBand().domain(this.domain).range(this.range)}}#H(t){const e=[],s=[];for(let n=0;n<t.length;n+=1){const i=t[n];if(n>0){const r=t[n-1],a=i-r,l=Math.abs(a);l>nt.MILLISECONDS_PER_DAY&&l!==nt.DAY_WITH_EXTRA_HOUR&&(e.push(r),s.push(r+a/2))}s.push(i)}return{holes:e,expandedDomain:s}}#I(){if(this.sortable===!1)return null;const t=this._configuration?.sort?.scale;return!t?.name||!t?.direction?null:t.name===this.value||this.dimension?t.direction:null}#O(t,e){return[...new Set(t.map(s=>s?.[e]).filter(s=>s!=null))]}#j(t,e){const s=[...t].sort((n,i)=>{if(this._isDate){const r=typeof n=="number"?n:W.fromFormat(n,this.format).getTimestamp(),a=typeof i=="number"?i:W.fromFormat(i,this.format).getTimestamp();if(!Number.isNaN(r)&&!Number.isNaN(a))return r-a}return typeof n=="number"&&typeof i=="number"?n-i:String(n).localeCompare(String(i))});return e==="desc"&&s.reverse(),s}#lt(t){if(!this.dimension||!this.value||t!=="asc"&&t!=="desc")return null;const e=this.#z();if(!e.length)return null;const s=this.#O(this.#i,this.value);return s.length?this.#j(s,t).filter(n=>e.includes(n)):null}#J(t){return this.#i.filter(e=>{const s=e?.[t];return s==null||s===""?!1:!Number.isNaN(Number(s))})}#tt(t,e,s,n){const i={};return e.forEach(r=>{i[r]=0}),t.forEach(r=>{const a=r?.[s];a==null||!(a in i)||(i[a]+=Number(r?.[n]||0))}),i}#W(t,e){if(!t||e!=="asc"&&e!=="desc")return null;const s=this.#J(t),n=this.#O(s,this.value);if(!n.length)return null;const i=this.#tt(s,n,this.value,t);return n.sort((r,a)=>{const l=i[r]-i[a];return l!==0?e==="desc"?-l:l:String(r).localeCompare(String(a))})}#it(t){return!this.dimension||t!=="asc"&&t!=="desc"?null:this._configuration?.sort?.scale?.name===this.value?this.#lt(t):this._configuration?.sort?.scale?.name?this.#W(this._configuration.sort.scale.name,t):null}#st(){if(this.sortable===!1)return;const t=this.#I(),e=this.#it(t),s=["left","right"].includes(this.position);if(Array.isArray(e)&&e.length)if(this._isDate){const n=e.map(i=>typeof i=="number"?i:W.fromFormat(i,this.format).getTimestamp()).filter(i=>!Number.isNaN(i));if(n.length){const i=this.#H(n);this._uniqueValue=[...e];const r=this._configuration?.sort?.scale?.name===this.value,a=r?i.expandedDomain:n;this.domain=s?a.reverse():a,this._dateHolesAfter=r?i.holes:[],this._scale=this._d3.scaleBand().domain(a).range(this.range)}}else this._valueType==="discrete"&&(this.domain=s?[...e].reverse():[...e],this._uniqueValue=[...e],typeof this._scale?.domain=="function"&&this._scale.domain(this.domain))}#Q(t,e=!1,s=!1){return this.#i.filter(n=>s?n[this.refer.value]===s[this.refer.value]:!0).reduce((n,i)=>n+Number(i[t]||0),0)}#P(t){let e=this.data;this.brushData.length&&(e=this.brushData),this.#i=e.filter((n,i,r)=>{let a=!0;return this.traceCondition&&(a=(this.traceCondition||(()=>!0))(n,i,r)),this.legendCondition&&(a=a&&(this.legendCondition||(()=>!0))(n,i,r)),a});const s=this.#i.map(n=>n[t]);return[...new Set(s)]}#et(t={}){if(!(this._trace?.type==="waterfall")||!this.lower||t.includeZero===!0)return!1;if(t.includeZero===!1)return!0;const s=Ve(this._configuration);return s.display===!1||s.position!=="zero"}#rt(t){const e=t?.Type||t?.color;return e==="net"||e==="net_OoS"}#ut(t={}){this.refer?.hierarchy&&(this.data=this.refer.data);const e=[...this.#P(this.value)],s=this.#et(t);if(this.lower)if(s){const n=this.#i.filter(i=>{const r=Number(i?.[this.lower]);return!(this.#rt(i)&&r===0)&&i?.[this.lower]!=null}).map(i=>i[this.lower]);e.push(...new Set(n))}else e.push(...this.#P(this.lower));return this.upper&&e.push(...this.#P(this.upper)),e}#z(){if(this._uniqueValue?.length>0)return this._uniqueValue;this.refer?.hierarchy&&(this.data=this.refer.data);const t=[...this.#P(this.value),...this.lower?this.#P(this.lower):[],...this.upper?this.#P(this.upper):[]];return this._uniqueValue=t,this._uniqueValue}#U(){return this.refer?.hierarchy&&(this.data=this.refer.data),this.#at(this.#P(this.stack))}#at(t){if(!Array.isArray(t)||t.length<=1||!this.stack||this.stackSortable===!1)return t;const e=this.#ct();if(!e)return t;const s=e==="desc"?-1:1;return[...t].sort((n,i)=>{const r=n==null,a=i==null;if(r&&a)return 0;if(r)return 1;if(a)return-1;const l=!Number.isNaN(Number(n)),c=!Number.isNaN(Number(i));if(l&&c)return s*(Number(n)-Number(i));const h=this.#ot(n),u=this.#ot(i);if(h!=null&&u!=null)return s*(h-u);const d=String(n).localeCompare(String(i));return s*d})}#ct(){if(this.stackSortable===!1)return null;const t=this._configuration?.sort?.stack||{};return t.name===this.stack?t.direction==="desc"?"desc":"asc":null}#ot(t){if(t==null)return null;const e=W.detectDateFormat(t);if(!e)return null;try{const s=W.fromFormat(t,e).getTimestamp();return Number.isNaN(s)?null:s}catch{return null}}#Y(){return this._uniqueSplit?.length>0?this._uniqueSplit:this.splitValues?.length?(this._uniqueSplit=[...this.splitValues],this._uniqueSplit):(this.refer?.hierarchy&&(this.data=this.refer.data),this._uniqueSplit=this.#P(this.split),this._uniqueSplit)}#K(t){const e=Math.min(...this.baseRange),s=Math.max(1,Number(t)||0);return this.baseRange[1]>this.baseRange[0]?[e,e+s]:[s+e,e]}#b(){if(typeof this._traceSize==="function"){let t=this.data.map(e=>this._traceSize(e)).sort();return this._traceSizeDomain=[Math.min(...t),Math.max(...t)],this._traceSizeRange=this._traceSizeRange||[nt.DEFAULT_MIN_SIZE,Math.max(this.#r?._elementSize||this._elementSize,nt.DEFAULT_MAX_SIZE_MULTIPLIER)],this._traceSizeScale=this._d3.scaleLinear().domain(this._traceSizeDomain).range(this._traceSizeRange),this._traceSizeScale}else return"PlotterScale: #makeTraceSize: custom sizing is static"}#ht(t){let e;return typeof this._traceSize==="function"?e=this._traceSizeScale(this._traceSize(t)):e=this._traceSize,e}}const Vr="plotter-hover",sy="plotter-hover-header",Ue="plotter-hover-element",ny="plotter-hover-element-main",iy="plotter-plot",ry="plotter-tree-card-label-fo",gh="plotter-trace-element-path",ay="plotter-table-row",oy="plotter-table-active",xs="plotter-lock",ly=0;class cy extends ht{#t=null;#e=null;#s=null;#n=null;#r=t=>{this.lock(t)};constructor(t){if(super(t),t.htmlHost instanceof HTMLElement){this.bindHtmlHost(t.htmlHost);return}this.__nodes__.svg=window.d3.select(this.__nodes__.svg),this.__nodes__.container=this.__parameters__.target.selectAll("#"+this.__parameters__.id).data([{id:"hover"}],e=>e.id).join(e=>e.append("foreignObject").attr("id",this.__parameters__.id).attr("class",Vr),e=>e,e=>e.remove()),this.__node__=this.__nodes__.container.node()}#i(){if(this.#t)return;const t=this.__parameters__.target?.node?.()??this.__parameters__.target?.nodes?.()?.[0],e=this.__nodes__.container?.node?.();!t||!e||e===t||e.contains?.(t)||t.lastElementChild!==e&&t.appendChild(e)}update(){if(this.#t instanceof HTMLElement)return this.#f();this.#i();const e=this.__parameters__.target?.node?.(),s=Number(e?.getAttribute?.("width"))||0,n=Number(e?.getAttribute?.("height"))||0,i=e?.getBoundingClientRect?.(),r=s>0?s:i?.width||0,a=n>0?n:i?.height||0;return r>0&&a>0&&this.__nodes__.container.attr("x",0).attr("y",0).attr("width",r).attr("height",a),this.__node__}bindHtmlHost(t){if(!(t instanceof HTMLElement))return null;this.#t=t,this.__parameters__.target?.node?.()?.querySelector?.(`#${CSS.escape(this.__parameters__.id)}`)?.remove();let s=t.querySelector(`#${this.__parameters__.id}`);return s instanceof HTMLElement?s.parentElement!==t&&t.prepend(s):(s=document.createElement("div"),s.id=this.__parameters__.id,s.className=Vr,t.prepend(s)),this.__nodes__.container=window.d3.select(s),this.__node__=s,this.#f()}rebindSvgTarget(t){this.#t=null,this.rebindTarget(t)}rebindTarget(t){this.#t||(this.__parameters__.target=t,this.__nodes__.container=t.selectAll("#"+this.__parameters__.id).data([{id:"hover"}],e=>e.id).join(e=>e.append("foreignObject").attr("id",this.__parameters__.id).attr("class",Vr),e=>e,e=>e.remove()),this.__node__=this.__nodes__.container.node())}hide(t,e){this.#y(this.getIdentifier(t))}hideUnlocked(){this.#p(),this.#n=null,this.#l()}unmount(){this.#p(),this.#n=null,super.unmount()}show(t,e,s){return this.#p(),this.#d(t?.sourceEvent??t),this.#i(),new Promise(n=>{if(s.trace.hover===!1){n();return}if(!t.target||!this.__node__){n();return}const i=this.getIdentifier(t);if(this.__nodes__[i]?.classList?.contains(xs)){n(this.__nodes__[i]);return}const{node:r,isNew:a}=this.#u(i);if(r.classList.contains(xs)){n(r);return}if(e){this.#g(t,i);const l=this.#c(i,e,s,t);(a||this.#n!==l)&&(this.#n=l,this.#m(i,e,s,t))}n(r)})}getIdentifier(t){const e=t?.sourceEvent??t;let s=e.currentTarget?.id;if(s||(s=e.target?.closest?.(`tr.${ay}[id]`)?.id),s||(s=this.#S(e.target)?.id),!s){let n=e.target;for(;n&&!s;)n=n.parentElement,s=n?.id}return`${s||"plotter-hover"}-hover`}lock(t,e){let s=this.getIdentifier(t);t.target.closest("."+Ue)?(t.target.closest("."+Ue).classList.contains("plotter-lock")&&t.target.closest("."+Ue).classList.add("hide"),t.target.closest("."+Ue).classList.toggle("plotter-lock")):this.__nodes__[s].classList.toggle("plotter-lock")}#a(t,e){const s=this.__parameters__.parent,n={};return s.getCurrentTraces().forEach(i=>Object.values(i.scales).forEach(r=>{let a=r.getScale();a.hidden||(n[a.name]=a)})),{layer:e,scales:n,row:t}}#l(){this.#h(null)}#h(t){this.__node__&&Array.from(this.__node__.children).forEach(e=>{e!==t&&(e.classList.contains(xs)||(delete this.__nodes__[e.id],e.remove()))})}#p(){this.#e!=null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(this.#e),this.#e=null),this.#s!=null&&(clearTimeout(this.#s),this.#s=null)}#y(t){this.#p();const e=()=>{this.#e=null,this.#s=null,this.#L(t)};if(typeof requestAnimationFrame=="function"){this.#e=requestAnimationFrame(e);return}this.#s=setTimeout(e,ly)}#L(t){const e=this.__nodes__[t];!e||e.classList.contains(xs)||(e.remove(),delete this.__nodes__[t],this.#n&&this.#n.indexOf(`${t}|`)===0&&(this.#n=null))}#T(){if(!this.__node__)return null;const t=this.__node__.children;for(let e=0;e<t.length;e++){const s=t[e],n=s.classList.contains(Ue),i=s.classList.contains(xs);if(n&&!i)return s}return null}#u(t){const e=this.#T();if(e)return e.id!==t&&(delete this.__nodes__[e.id],e.id=t),this.__nodes__[t]=e,this.#h(e),{node:e,isNew:!1};this.#l();const s=x.getNode("div",t,[Ue,"hide"],this.__node__);return this.__nodes__[t]=s,s.addEventListener("click",this.#r),{node:s,isNew:!0}}#c(t,e,s,n){const r=(n?.sourceEvent??n)?.target?.closest?.("[data-kpi]")?.getAttribute?.("data-kpi")??"",a=e?.data??e??{},l=a.unique??a.id??a.Label??"",c=typeof s?.trace?.hover=="function"?"custom":"default";return`${t}|${c}|${l}|${r}`}#m(t,e,s,n){const i=this.__nodes__[t];if(!i)return;i.replaceChildren(),delete this.__nodes__[t+"-header"],delete this.__nodes__[t+"-main"],delete this.__nodes__[t+"-footer"];let r;if(typeof s.trace.hover=="function"&&(r=s.trace.hover(e,s,n)),!r){const a=this.#a(e,s);this.__nodes__[t+"-header"]=this.#o(t,a),this.__nodes__[t+"-main"]=this.#A(t,a),this.__nodes__[t+"-footer"]=this.#E(t,a);return}i.append(r)}#o(t,e){const s=x.getNode("header",t+"-header",[sy],this.__nodes__[t]);let n=Object.values(e.scales).filter(i=>i.dimension);if(!n.length){const i=e.layer?.trace?.scales?.x;i&&(n=[i])}return n.map(i=>{let r="[bold]{dimension.key}: {dimension.value}[/bold]";const a=i._isDate?W.formatAxisTickLabel(e.row.data[i.value],i.format):e.row.data[i.value],l=i.stack&&i._isStackDate?W.formatAxisTickLabel(e.row.data[i.stack],i.stackFormat||i.format):i.stack?e.row.data[i.stack]:void 0;let c={dimension:{key:i.label||i.value,value:a}};if(i.stack){c.dimension.stack={key:i.stack,value:l};let h=x.getNode("div",t+`-color-container-${e.layer.trace.colors?.[c.dimension.stack.value]}`,["d-flex"],!1,{});return h.append(x.getNode("span",t+`-color-${e.layer.trace.colors?.[c.dimension.stack.value]}`,["mr-1"],!1,{style:`width: 14px; height: 14px; aspect-ratio: 1; border-radius: 3px;margin-top: 2px;margin-bottom: -2px; display: inline-block;background-color: ${e.layer.trace.colors?.[c.dimension.stack.value]??"transparent"};`}),"{dimension.stack.value}".translate(c,"node")),["[bold]{dimension.key}: {dimension.value}[/bold]".translate(c,"node","div"),h]}return r.translate(c,"node")}).forEach(i=>(Array.isArray(i)?i:[i]).forEach(r=>s.append(r))),s}#A(t,e){const s=x.getNode("main",t+"-main",[ny],this.__nodes__[t]);return this.__nodes__[t+"-main"]=s,Object.values(e.scales).map(n=>{if(!n.dimension){let i="{measure.key}: {measure.value}",r=e.row.data[n.value];if(n.relative&&(r=e.row.data.plotter[n.key+"RelativeValue"]),r==null||typeof r.format!="function")return;let a=r.format({unit:n.unit,sign:!1}),l={measure:{key:n.label||n.value,value:a}};return n.name!==e.layer.trace.scales.y.getScale().name&&(i="({measure.key} {measure.value})"),i.translate(l,"node","div")}}).filter(n=>n).forEach(n=>(Array.isArray(n)?n:[n]).forEach(i=>s.append(i))),s}#E(t,e){return!!t&&!!e}#d(t){const e=t?.target;if(!(e instanceof Element)||this.#t instanceof HTMLElement&&this.#t.contains(e))return;const s=e.closest(".plotter-visualization");s instanceof HTMLElement&&(this.bindHtmlHost(s),this.update())}#_(){const t=this.#t;return t instanceof HTMLElement?t.classList.contains("plotter-table-view")||t.querySelector(".plotter-table-active")!=null:!1}#C(t){if(this.#t){const i=this.#t.getBoundingClientRect?.()??{left:0,top:0};return{x:t.clientX-i.left,y:t.clientY-i.top}}const e=this.__node__,s=this.__parameters__.target?.node?.();if(s?.createSVGPoint&&e?.getScreenCTM){const i=e.getScreenCTM();if(i){const r=s.createSVGPoint();r.x=t.clientX,r.y=t.clientY;const a=r.matrixTransform(i.inverse());return{x:a.x,y:a.y}}}const n=e?.getBoundingClientRect?.()??{left:0,top:0};return{x:t.clientX-n.left,y:t.clientY-n.top}}#S(t){if(!t?.closest)return null;const e=t.closest(`.${ry}`);return e?e.closest(".plotter-trace-element")?.querySelector?.(`.${gh}`)??null:t.closest?.(`.${gh}`)??null}#g(t,e){return new Promise(s=>{const n=t?.sourceEvent??t,r=(this.#t??this.__parameters__.parent?.__nodes__?.svg?.node?.()??n.target?.closest?.(`.${oy}`)??n.target?.closest?.("."+iy))?.getBoundingClientRect?.(),a=n.clientX,l=n.clientY,c=this.#_(),{x:h,y:u}=c?{x:a,y:l}:this.#C(n),d=this.__nodes__[e];r&&a>r.left+r.width/2?(d.classList.remove("left"),d.classList.add("right")):(d.classList.remove("right"),d.classList.add("left")),r&&l<r.top+r.height/2?(d.classList.remove("top"),d.classList.add("bottom")):(d.classList.remove("bottom"),d.classList.add("top")),d.style.position=c?"fixed":"absolute",d.style.left=`${h}px`,d.style.top=`${u}px`,c?d.style.zIndex="1001":d.style.removeProperty("z-index"),d.classList.remove("hide"),s()})}#f(){const t=this.#t,e=this.__node__;return!(t instanceof HTMLElement)||!(e instanceof HTMLElement)?null:(e.style.position="absolute",e.style.inset="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="none",e.style.overflow="visible",e.style.zIndex="1000",e)}}const $r="plotter-differences",mh="plotter-difference",hy="__plotter-difference-preview__",yh="plotter-difference-picking",bh="plotter-difference-picking-muted",Wr="plotter-difference-picking-from",uy="plotter-difference-tooltip",dy=["bars","waterfall","lines","scatter","areas"],Gr=["percent","absolute","both"],Pn=["to","from","both"],Ah=["level","total","cagr"],py=" p.a.",Lh=365.25*24*60*60*1e3,Th="#334155",fy=1.5,Eh="4,3",_y=.55,xh=7,gy=11,Sh=4,Dn=8,my=14,jr=.5,yy=[-.5,1.5],Zt=1,vh=18,Ch=28,wh=[0,1],by=250,Ay=12,Ur=12,Ly="",Ty=["path.plotter-difference-line-hit","path.plotter-difference-head","rect.plotter-difference-label-bubble","text.plotter-difference-label-text"].join(", "),Ey="foreignObject.plotter-waterfall-value-label-fo",xy="div.plotter-tree-card-label-html",Sy="text.plotter-bar-label",vy=1.2,Cy=11,wy=500,Ry=.6,ky=3;class G extends ht{static anchorKeyFromRow(t){const e=t?.id;return e!=null&&String(e).length>0?String(e):null}static traceKeyOf(t){const e=t?.name;return e!=null&&String(e).length>0?String(e):[t?.type,t?.x?.value,t?.y?.value].map(s=>s!=null?String(s):"").join(":")}static computeDifference(t,e,s="to"){const n=Number(t),i=Number(e),r=s==="from",a=r?n-i:i-n,l=r?i:n,h=Number.isFinite(l)&&l!==0?a/Math.abs(l):null;return s==="both"?{delta:Math.abs(a),ratio:h!=null?Math.abs(h):null}:{delta:a,ratio:h}}static resolveArrowKind(t,e,s=[]){const n=Number(t),i=Number(e);if(!Number.isFinite(n)||!Number.isFinite(i)||Math.abs(i-n)<=Zt)return"level";const a=Math.min(n,i)+Zt,l=Math.max(n,i)-Zt;return s.some(h=>{const u=Number(h);return Number.isFinite(u)&&u>a&&u<l})?"total":"level"}static computeTotalLanePixel({metricVertical:t,obstaclePixels:e,lift:s=0,extent:n=1/0}){const i=(e||[]).map(d=>d==null?NaN:Number(d)).filter(Number.isFinite);if(!i.length)return null;const[r,a]=wh,l=Math.min(a,Math.max(r,Number(s)||0)),c=Number.isFinite(n)?l*n:0;if(t){const d=Math.min(...i)-vh-c;return Math.max(d,Ch)}const h=Math.max(...i)+vh+c,u=Number.isFinite(n)?n-Ch:h;return Math.min(h,u)}static buildValueLabelBox(t,e){const s=t?.x==null?NaN:Number(t.x),n=t?.y==null?NaN:Number(t.y),i=t?.text==null?"":String(t.text);if(!(Number.isFinite(s)&&Number.isFinite(n)&&i.length>0))return null;const a=Number(e)>0?Number(e):Cy,l={size:a,weight:wy},h=rt.computeRenderWidth(i,l)||i.length*a*Ry,u=a*vy;return{x:s-h/2,y:n-u/2,width:h,height:u}}static mergeBoxes(t,e){if(!t)return e;const s=Math.min(t.x,e.x),n=Math.min(t.y,e.y),i=Math.max(t.x+t.width,e.x+e.width),r=Math.max(t.y+t.height,e.y+e.height);return{x:s,y:n,width:i-s,height:r-n}}static escapeLabelBox(t,e,s,n=0){if(!s)return t;const i=e.x-t.x,r=e.y-t.y,a=[{origin:t.x,delta:i,min:s.x-n,max:s.x+s.width+n},{origin:t.y,delta:r,min:s.y-n,max:s.y+s.height+n}];let l=0,c=1;for(const u of a){if(u.delta===0){if(u.origin<u.min||u.origin>u.max)return t;continue}const d=[(u.min-u.origin)/u.delta,(u.max-u.origin)/u.delta];l=Math.max(l,Math.min(...d)),c=Math.min(c,Math.max(...d))}return l<=c?{x:t.x+i*c,y:t.y+r*c}:t}static labelBoxOuterPixel(t,e){return t?e?t.y:t.x+t.width:null}static computePeriodCount({fromValue:t,toValue:e,isDate:s=!1,slotDistance:n=null}){if(s){const r=new Date(t).getTime(),a=new Date(e).getTime();if(Number.isFinite(r)&&Number.isFinite(a)){const c=Math.abs(a-r)/Lh;if(c>0)return c}}const i=Number(n);return Number.isFinite(i)&&i>0?i:null}static resolveTraceScales(t){const e=t?.scales?.x?.getScale?.(),s=t?.scales?.y?.getScale?.();if(!e||!s)return null;const n=!!e.dimension||e._valueType!=="continuous"||e._isDate;return(!!s.dimension||s._valueType!=="continuous"||s._isDate)&&!n?{dimensionScale:s,metricScale:e}:{dimensionScale:e,metricScale:s}}static isCagrEligible(t,e=!1){const s=(t||[]).filter(r=>r!=null&&String(r).trim()!=="");if(s.length<2)return!1;if(s.every(r=>/^\d{4}$/.test(String(r).trim())))return new Set(s.map(r=>String(r).trim())).size>1;if(!e)return!1;const i=s.map(r=>new Date(r).getTime()).filter(Number.isFinite);return i.length<2?!1:Math.max(...i)-Math.min(...i)>=Lh}static computeCagr(t,e,s,n="to"){const i=Number(t),r=Number(e),a=Number(s);if(!(Number.isFinite(i)&&i>0&&Number.isFinite(r)&&r>0&&Number.isFinite(a)&&a>0))return null;const h=Math.pow(n==="from"?i/r:r/i,1/a)-1;return n==="both"?Math.abs(h):h}static formatCagrLabel(t,{signed:e=!0}={}){return t==null||!Number.isFinite(Number(t))?"-":`${G.#t(Number(t)*100,{percent:!0,sign:e})}${py}`}static normalizeUnit(t){const e=t!=null&&typeof t=="object",s=String((e?t.unit:t)??""),n=s==="%",i=n?100:1,r=e?Number(t.scale):NaN,a=Number.isFinite(r)&&r!==0?r:i,l=n?"pts":s,c=e?t.deltaUnit:null,h=c!=null?String(c):l;return{unit:s,scale:a,deltaUnit:h}}static formatDifferenceLabel(t,e="percent",{unit:s="",signed:n=!0}={}){const{delta:i,ratio:r}=t||{},a=G.normalizeUnit(s),c=r!=null&&Number.isFinite(r)?G.#t(r*100,{percent:!0,sign:n}):null,h=G.#t(Number(i)*a.scale,{unit:a.deltaUnit,sign:n});return e==="percent"||e==null?c??h:e==="absolute"||c==null?h:`${h} (${c})`}static formatAnchorValue(t,e=""){const s=G.normalizeUnit(e);return G.#t(Number(t)*s.scale,{unit:s.unit,sign:!1})}static#t(t,e){const s=Number(t);if(!Number.isFinite(s))return"-";if(typeof s.format=="function")return s.format(e);const i=Math.round(s*10)/10,a=e?.sign!==!1&&i>0?"+":"",l=e?.percent?"%":e?.unit||"";return`${a}${i}${l}`}update(){const t=this.#p();if(!t)return;const{anchorIndex:e,fallbackIndex:s}=this.#o(),n=this.#y(),i=this.#e?.preview,r=[...n,...i?[i]:[]].map(a=>this.#f(a,e,s)).filter(a=>a!=null);this.#D(t,r),this.#B()}hide(){this.#r=!0,this.#R(),this.#n?.interrupt().attr("opacity",0)}isPicking(){return this.#e!=null}startPicking(t,e,{kind:s=null}={}){const n=G.anchorKeyFromRow(t);if(n==null)return;this.cancelPicking();const i=e?.trace?G.traceKeyOf(e.trace):null,r=Ah.includes(s)?s:null;this.#e={from:{key:n},traceKey:i,forcedKind:r,preview:null},this.#p()?.classed(yh,!0),this.#T(),this.#s=a=>{a.key==="Escape"&&this.cancelPicking()},document.addEventListener("keydown",this.#s)}cancelPicking(){const t=this.#e!=null;this.#e=null,this.#s&&(document.removeEventListener("keydown",this.#s),this.#s=null),this.#p()?.classed(yh,!1),this.#u(),t&&this.update()}pick(t,e,s){t?.stopPropagation?.();const n=this.#e;if(n==null||!this.#L(s))return;const r=G.anchorKeyFromRow(e?.data||e);if(r==null||r===n.from.key){this.cancelPicking();return}const l=this.#y(!0);l.push({id:`difference-${Date.now().toString(36)}-${l.length}`,trace:n.traceKey,from:{key:n.from.key},to:{key:r},kind:n.forcedKind??this.#g(n.traceKey,n.from.key,r),mode:"percent",direction:"to",position:jr,lift:0}),this.#l(),this.cancelPicking(),this.update()}preview(t,e,s){const n=this.#e;if(n==null)return;const i=G.anchorKeyFromRow(e?.data||e),a=!this.#L(s)||i==null||i===n.from.key,l=n.preview?.to?.key;a?n.preview=null:n.preview={id:hy,trace:n.traceKey,from:{key:n.from.key},to:{key:i},kind:n.forcedKind??this.#g(n.traceKey,n.from.key,i),mode:"percent",direction:"to",position:jr,lift:0,preview:!0},l!==n.preview?.to?.key&&this.update()}unmount(){this.cancelPicking(),this.#R(),this.#i?.remove(),this.#i=null,this.#n?.remove(),this.#n=null,super.unmount()}#e=null;#s=null;#n=null;#r=!1;#i=null;#a(){return this.__parameters__.plot}#l(){this.#a()?.__parameters__?.parent?.markSettingsPersistDirty?.()}#h(){this.#l(),this.update()}#p(){return this.#a()?.__nodes__?.svg||null}#y(t=!1){const e=this.#a()?.layer?.configuration;if(!e)return[];if(!e.annotations){if(!t)return[];e.annotations={}}if(!Array.isArray(e.annotations.differences)){if(!t)return e.annotations.differences||[];e.annotations.differences=[]}return e.annotations.differences||[]}#L(t){const e=this.#e?.traceKey;if(e==null)return!0;const s=t?.trace;return s?G.traceKeyOf(s)===e:!0}#T(){const t=this.#e;if(t?.traceKey==null)return;const e=t.from.key;this.#c((s,n)=>{const i=G.traceKeyOf(n)===t.traceKey;s.classed(bh,!i),i&&s.selectAll("path.plotter-trace-element-path").classed(Wr,r=>G.anchorKeyFromRow(r?.data||r)===e)})}#u(){this.#c(t=>{t.classed(bh,!1),t.selectAll(`path.${Wr}`).classed(Wr,!1)})}#c(t){const e=this.#a(),s=typeof e?.getCurrentTraces=="function"?e.getCurrentTraces():[];(Array.isArray(s)?s:[]).forEach(i=>{const r=e.instances?.[i?.id]?.containers?.layerContainer;r&&t(r,i)})}#m(t){return G.resolveTraceScales(t)}#o(){const t=this.#a(),e=new Map,s=new Map,n=typeof t?.getCurrentTraces=="function"?t.getCurrentTraces():[];return(Array.isArray(n)?n:[]).forEach(r=>{const a=dy.includes(r?.type),c=t.instances?.[r?.id]?.containers?.layerContainer;if(!a||!c)return;const h=this.#m(r);if(!h)return;const u=G.traceKeyOf(r),d=this.#A(c),p=this;c.selectAll("path.plotter-trace-element-path").each(function(f){const _=p.#d(f,h,r,u,d);_&&(e.set(G.#E(u,_.key),_),s.has(_.key)||s.set(_.key,_))})}),{anchorIndex:e,fallbackIndex:s}}#A(t){const e=new Map;return(this.#y().length>0||this.#e!=null)&&(t.selectAll(Ey).each(function(n){const i=G.anchorKeyFromRow(n?.data);if(i==null)return;const r=this.querySelector(xy),a=parseFloat(r?.style?.fontSize),l=G.buildValueLabelBox(n,a);l&&e.set(i,G.mergeBoxes(e.get(i),l))}),t.selectAll(Sy).each(function(){const n=G.anchorKeyFromRow(this.parentNode?.__data__?.data),i=n!=null&&typeof this.getBBox=="function"?this.getBBox():null;if(!i?.width)return;const r={x:i.x,y:i.y,width:i.width,height:i.height};e.set(n,G.mergeBoxes(e.get(n),r))})),e}static#E(t,e){return`${t}${Ly}${e}`}#d(t,e,s,n,i){const r=t?.data,a=G.anchorKeyFromRow(r);if(a==null)return null;const{dimensionScale:l,metricScale:c}=e,h=i?.get(a)||null,u=this.#_(r,l),d=this.#C(r,s),p=r?.[l?.value],f=!!l?._isDate;if(t.endMetricCoordinate!=null&&t.dimensionStart!=null){const E=Number(t.dimensionSpan)||0;return{key:a,traceKey:n,value:Number(t.endValue??r[c.value]),text:u,unit:d,dimensionValue:p,dimensionIsDate:f,metricVertical:t.reverse!==!0,dimensionPixel:Number(t.dimensionStart)+E/2,metricPixel:Number(t.endMetricCoordinate),halfExtent:E/2,labelBox:h}}const g=["left","right"].includes(c.position),m=Number(t.width),y=Number(t.height);let b,A,L;return g?(L=Number.isFinite(m)?Math.abs(m)/2:0,b=Number(t.x)+L,A=Number(t.y)):(L=Number.isFinite(y)?Math.abs(y)/2:0,b=Number(t.y)+L,A=c.for(r,c.value)),Number.isFinite(b)&&Number.isFinite(A)?{key:a,traceKey:n,value:Number(r[c.value]),text:u,unit:d,dimensionValue:p,dimensionIsDate:f,metricVertical:g,dimensionPixel:b,metricPixel:A,halfExtent:L,labelBox:h}:null}#_(t,e){const s=typeof e?.texts=="string"?e.texts:null,n=(s!=null?t?.[s]:null)??t?.[e?.value];return n!=null?String(n):""}#C(t,e){const s=e?.difference?.unit;if(typeof s!="function")return G.normalizeUnit("");try{return G.normalizeUnit(s(t))}catch{return G.normalizeUnit("")}}#S(t,e,s,n){const i=t?.key;return i==null?null:e!=null?s.get(G.#E(e,i))||null:n.get(i)||null}#g(t,e,s){const{anchorIndex:n,fallbackIndex:i}=this.#o(),r=this.#S({key:e},t,n,i),a=this.#S({key:s},t,n,i);if(!r||!a)return"level";const l=t??r.traceKey,c=[...n.values()].filter(h=>h.traceKey===l&&h.key!==e&&h.key!==s).map(h=>h.dimensionPixel);return G.resolveArrowKind(r.dimensionPixel,a.dimensionPixel,c)}#f(t,e,s){const n=t?.trace??null,i=this.#S(t?.from,n,e,s),r=this.#S(t?.to,n,e,s);if(!i||!r)return null;n==null&&t.preview!==!0&&(t.trace=i.traceKey);const l=Pn.includes(t.direction)?t.direction:"to",c=G.computeDifference(i.value,r.value,l),u=i.unit.unit===r.unit.unit&&i.unit.scale===r.unit.scale&&i.unit.deltaUnit===r.unit.deltaUnit?i.unit:G.normalizeUnit(""),d=l!=="both",p=i.metricVertical&&r.metricVertical,f=Number.isFinite(Number(t.position))?Number(t.position):jr,_=i.dimensionPixel,g=r.dimensionPixel,m=Math.abs(g-_)<=Zt,y=Ah.includes(t.kind)?t.kind:"level",b=y!=="level"&&!m?y:"level";let A=null,L=null,T,E;b==="cagr"?(A=G.computePeriodCount({fromValue:i.dimensionValue,toValue:r.dimensionValue,isDate:i.dimensionIsDate&&r.dimensionIsDate,slotDistance:this.#x(i,r,e)}),L=G.computeCagr(i.value,r.value,A,l),T=G.formatCagrLabel(L,{signed:d}),E=this.#v(d?L??0:0)):(T=G.formatDifferenceLabel(c,t.mode,{unit:u,signed:d}),E=this.#v(d?c.delta:0));let C;if(m){const N=Math.max(i.halfExtent,r.halfExtent)+my;C=_+N}else C=_+(g-_)*f;let S=null,w=null;if(b==="total"){const N=this.#a()?.layer;w=Number(p?N?.height:N?.width);const R=Math.min(_,g)-Zt,M=Math.max(_,g)+Zt,k=i.traceKey,O=[...[...e.values()].filter(P=>P.traceKey===k&&P.dimensionPixel>=R&&P.dimensionPixel<=M),i,r],F=[];O.forEach(P=>{F.push(P.metricPixel);const B=G.labelBoxOuterPixel(P.labelBox,p);B!=null&&F.push(B)}),S=G.computeTotalLanePixel({metricVertical:p,obstaclePixels:F,lift:Number(t.lift)||0,extent:Number.isFinite(w)?w:1/0})}return{annotation:t,difference:c,direction:l,unit:u,signed:d,label:T,color:E,metricVertical:p,fromAnchor:i,toAnchor:r,arrowAxisPixel:C,kind:b,lanePixel:S,metricExtent:w,periods:A,cagrRate:L,isPreview:t.preview===!0}}#x(t,e,s){const n=Math.min(t.dimensionPixel,e.dimensionPixel)+Zt,i=Math.max(t.dimensionPixel,e.dimensionPixel)-Zt,r=new Set;return s.forEach(a=>{a.traceKey===t.traceKey&&a.dimensionPixel>n&&a.dimensionPixel<i&&r.add(Math.round(a.dimensionPixel))}),r.size+1}#v(t){try{const e=Q.getWaterfallColors();if(t>0&&e?.Up)return e.Up;if(t<0&&e?.Down)return e.Down}catch{return Th}return Th}#D(t,e){this.#n=t.selectAll(`g.${$r}`).data([$r],n=>n).join("g").attr("id",this.__parameters__.id).attr("class",$r),this.#n.raise();const s=this;this.#n.selectAll(`g.${mh}`).data(e,n=>n.annotation.id).join("g").attr("class",n=>[mh,...n.isPreview?["plotter-difference-preview"]:[]].join(" ")).attr("data-difference-id",n=>n.annotation.id).attr("data-difference-kind",n=>n.kind).attr("pointer-events","none").each(function(n){s.#$(window.d3.select(this),n)})}#B(){this.#n&&(this.#r?(this.#r=!1,this.#n.interrupt().attr("opacity",0).transition().duration(by).attr("opacity",1)):this.#n.attr("opacity",1))}#$(t,e){const{fromAnchor:s,toAnchor:n,metricVertical:i,arrowAxisPixel:r,color:a,direction:l,kind:c,lanePixel:h}=e,u=(P,B)=>i?{x:P,y:B}:{x:B,y:P},d=c==="total",p=c==="cagr";let f,_,g,m,y,b;const A=u(s.dimensionPixel,s.metricPixel),L=u(n.dimensionPixel,n.metricPixel),T=(P,B,V)=>G.escapeLabelBox(P,B,V.labelBox,ky);if(p)f=T(A,L,s),_=T(L,A,n),g=[],m=[f,_],y={x:(f.x+_.x)/2,y:(f.y+_.y)/2},b={atTo:f,atFrom:_};else if(d){const P=u(s.dimensionPixel,h),B=u(n.dimensionPixel,h);f=T(A,P,s),_=T(L,B,n),g=[],m=[f,P,B,_],y=u((s.dimensionPixel+n.dimensionPixel)/2,h),b={atTo:B,atFrom:P}}else _=u(r,n.metricPixel),f=u(r,s.metricPixel),g=[{source:T(A,f,s),target:f},{source:T(L,_,n),target:_}],m=[f,_],y={x:(f.x+_.x)/2,y:(f.y+_.y)/2},b={atTo:f,atFrom:_};t.selectAll("line.plotter-difference-extension").data(g).join("line").attr("class","plotter-difference-extension").attr("x1",P=>P.source.x).attr("y1",P=>P.source.y).attr("x2",P=>P.target.x).attr("y2",P=>P.target.y).attr("stroke",a).attr("stroke-width",1).attr("stroke-dasharray",Eh).attr("opacity",_y).attr("pointer-events","none");const E=m.map((P,B)=>`${B===0?"M":"L"}${P.x},${P.y}`).join(" "),C=t.selectAll("path.plotter-difference-line").data([E]).join("path").attr("class","plotter-difference-line").attr("d",P=>P).attr("fill","none").attr("stroke",a).attr("stroke-width",fy).attr("stroke-dasharray",e.isPreview?Eh:null).attr("pointer-events","none"),S=t.selectAll("path.plotter-difference-line-hit").data([E]).join("path").attr("class","plotter-difference-line-hit").attr("d",P=>P).attr("fill","none").attr("stroke","transparent").attr("stroke-width",Ay).attr("pointer-events","stroke"),w=[],N=l==="to"||l==="both",R=l==="from"||l==="both";N&&w.push({point:_,origin:b.atTo}),R&&w.push({point:f,origin:b.atFrom});const M=t.selectAll("path.plotter-difference-head").data(w).join("path").attr("class","plotter-difference-head").attr("d",P=>p?this.#G(P.point,P.origin):this.#w(P.point,P.origin,i)).attr("fill",a).attr("pointer-events","visiblePainted");this.#F(t,e,y);const k=t.selectAll("rect.plotter-difference-label-bubble, text.plotter-difference-label-text"),I=t.selectAll(Ty),O=t.node(),F=!e.isPreview;if(I.style("pointer-events",F?null:"none"),t.on("mousemove",null).on("mouseleave",null).on("contextmenu",null).on(".drag",null),F){const P=H=>{H.stopPropagation(),this.#V(e.annotation)},B=H=>{H.stopPropagation(),this.#H(e.annotation)},V=H=>{const U=H.relatedTarget;U!=null&&typeof O?.contains=="function"&&O.contains(U)||this.#R()};C.on("click",null),S.on("click",P),M.on("click",P),k.on("click",p?null:B),I.on("mousemove",H=>this.#N(H,e)).on("mouseleave",V).on("contextmenu",H=>{this.#R(),this.#O(H,e.annotation)}),p?I.on(".drag",null):I.call(this.#k(e))}else C.on("click",null),S.on("click",null),M.on("click",null),k.on("click",null),I.on("mousemove",null).on("mouseleave",null).on("contextmenu",null).on(".drag",null)}#F(t,e,s){const{label:n,color:i,metricVertical:r,kind:a}=e,l={size:gy,weight:600},h=(rt.computeRenderWidth(n,l)||n.length*l.size*.6)+Sh*2,u=l.size+Sh*2,d=s,p=this.#a()?.layer?.width||1/0,f=a==="level"?r:!r;let _,g;f?(_=d.x+Dn+h>p?d.x-Dn-h:d.x+Dn,g=d.y-u/2):(_=d.x-h/2,g=d.y-Dn-u),t.selectAll("rect.plotter-difference-label-bubble").data([n]).join("rect").attr("class","plotter-difference-label-bubble").attr("x",_).attr("y",g).attr("width",h).attr("height",u).attr("rx",4).attr("fill","#ffffff").attr("fill-opacity",.9).attr("stroke",i).attr("stroke-width",1).attr("pointer-events","visiblePainted"),t.selectAll("text.plotter-difference-label-text").data([n]).join("text").attr("class","plotter-difference-label-text").attr("x",_+h/2).attr("y",g+u/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",l.size).attr("font-weight",l.weight).attr("fill",i).attr("pointer-events","visiblePainted").text(n)}#w(t,e,s){const n=xh;if(s){const l=t.y<=e.y?1:-1;return`M${t.x},${t.y} l${-n/2},${l*n} l${n},0 Z`}const r=t.x>=e.x?-1:1;return`M${t.x},${t.y} l${r*n},${-n/2} l0,${n} Z`}#G(t,e){const s=xh,n=t.x-e.x,i=t.y-e.y,r=Math.hypot(n,i)||1,a={x:n/r,y:i/r},l={x:t.x-a.x*s,y:t.y-a.y*s},c={x:-a.y*(s/2),y:a.x*(s/2)};return`M${t.x},${t.y} L${l.x+c.x},${l.y+c.y} L${l.x-c.x},${l.y-c.y} Z`}#N(t,e){const s=this.#a()?.__parameters__?.parent?.__node__;if(!s)return;const n=this.#M(s),{fromAnchor:i,toAnchor:r,unit:a,signed:l}=e,c=[`${i.text}: ${G.formatAnchorValue(i.value,i.unit)}`,`${r.text}: ${G.formatAnchorValue(r.value,r.unit)}`];if(e.kind==="cagr"){const f=Number.isFinite(Number(e.periods))?Math.round(Number(e.periods)*100)/100:"-";c.push(`CAGR (n=${f}): ${G.formatCagrLabel(e.cagrRate,{signed:l})}`)}else{const f=G.computeDifference(i.value,r.value,e.direction);c.push(`Δ ${G.formatDifferenceLabel(f,"both",{unit:a,signed:l})}`)}n.replaceChildren(...c.map((f,_)=>{const g=document.createElement("div");return g.classList.add("plotter-difference-tooltip-row"),_===c.length-1&&g.classList.add("plotter-difference-tooltip-delta"),g.textContent=f,g}));const h=s.getBoundingClientRect(),u=t.clientX-h.left+Ur,d=t.clientY-h.top+Ur,p=Math.max(0,h.width-n.offsetWidth-Ur);n.style.left=`${Math.min(u,p)}px`,n.style.top=`${d}px`,n.classList.add("show")}#R(){this.#i?.classList?.remove("show")}#M(t){const e=this.#i&&!this.#i.isConnected;return(!this.#i||e)&&(this.#i=x.getNode("div",`${this.__parameters__.id}-tooltip`,[uy],t)),this.#i}#k(t){if(t.kind==="total")return this.#Z(t);const{fromAnchor:e,toAnchor:s,metricVertical:n}=t,i=e.dimensionPixel,a=s.dimensionPixel-i,[l,c]=yy;return window.d3.drag().on("start",()=>{this.#l()}).on("drag",h=>{if(Math.abs(a)<=Zt)return;this.#R();const p=((n?h.x:h.y)-i)/a;t.annotation.position=Math.min(c,Math.max(l,p)),this.update()})}#Z(t){const{metricVertical:e,lanePixel:s,metricExtent:n}=t,[i,r]=wh,a=Number.isFinite(n)&&n>0?n:null,l=a!=null&&Number.isFinite(s),c=Math.min(r,Math.max(i,Number(t.annotation.lift)||0)),h=e?s+c*(a||0):s-c*(a||0);return window.d3.drag().on("start",()=>{this.#l()}).on("drag",u=>{if(!l)return;this.#R();const d=e?u.y:u.x,p=e?(h-d)/a:(d-h)/a;t.annotation.lift=Math.min(r,Math.max(i,p)),this.update()})}#V(t){const e=Pn.indexOf(t.direction);t.direction=Pn[(e+1)%Pn.length],this.#h()}#H(t){const e=Gr.indexOf(t.mode);t.mode=Gr[(e+1)%Gr.length],this.#h()}#I(t){const e=this.#y(),s=e.indexOf(t);s!==-1&&e.splice(s,1),this.#h()}#O(t,e){t.preventDefault(),t.stopPropagation();const s=this.#a()?.__parameters__?.parent?.__instance__?.contextMenu;if(!s?.__node__)return;const n=e.kind==="cagr",i=(n?"CAGR arrow":"Difference arrow").translate(),r=(l,c,h,u=null)=>({text:h.translate(),...u?{title:u.translate()}:{},classList:()=>e[l]===c?["selected"]:[],click:()=>{e[l]=c,this.#h()}}),a=[{group:i,text:"Arrow type".translate(),items:[r("kind","level","Level difference","Straight arrow between the two values, beside the elements"),r("kind","total","Total difference","Bracket arrow passing over the elements standing between the two anchors"),r("kind","cagr","CAGR","Diagonal arrow labeled with the compound growth rate per period")]},...n?[]:[{group:i,text:"Difference label".translate(),items:[r("mode","percent","Relative (%)"),r("mode","absolute","Absolute"),r("mode","both","Both")]}],{group:i,text:"Arrow direction".translate(),items:[r("direction","to","Toward target"),r("direction","from","Toward source"),r("direction","both","Both ends")]},{group:i,groupTail:!0,separatorBefore:!0,danger:!0,text:(n?"Remove CAGR arrow":"Remove difference arrow").translate(),title:"Delete this arrow".translate(),icon:()=>D.get("cross-svg",{size:16}),click:()=>this.#I(e)}];s.renderAnnotationMenu?.(t,e,a)}}const Yr="plotter-value-lines",Rh="plotter-value-line",Ny=["bars","lines","areas","scatter"],My=["value","average"],kh="#334155",Iy=1.5,Oy="5,4",Py=10,Fn=11,Kr=4,Dy=3,Nh=600,Fy=250;class zt extends ht{static computeAverage(t,e=!1){const s=(t||[]).filter(r=>Number.isFinite(r?.value));if(!s.length)return null;if(!e)return s.reduce((r,a)=>r+a.value,0)/s.length;const n=new Map;s.forEach(r=>{n.set(r.slot,(n.get(r.slot)||0)+r.value)});const i=[...n.values()];return i.reduce((r,a)=>r+a,0)/i.length}static resolveLabelReserve({configuration:t,traces:e,measureExtreme:s}){const n=t?.annotations?.valueLines;if(!Array.isArray(n)||!n.length||t?.reverse===!0)return 0;const i={size:Fn,weight:Nh,family:t?.axis?.ticks?.texts?.family};return Math.max(0,...(e||[]).map(r=>{const a=n.filter(h=>h.trace===G.traceKeyOf(r));if(!a.length)return 0;const c=!!(r.y?.relative||r.relative)?"100%":G.formatAnchorValue(s(r),"");return Math.max(...a.map(h=>{const u=h.kind==="average"?zt.#y(h,c):c;return Math.ceil(rt.computeRenderWidth(u,i))+Kr*2}))}))}static spreadLabels(t,e=Fn+2,s=[]){let n=-1/0;[...t].sort((i,r)=>i.metricPixel-r.metricPixel).forEach(i=>{let r=Math.max(i.metricPixel,n+e);[...s].sort((a,l)=>a-l).forEach(a=>{Math.abs(r-a)<e&&(r=a+e)}),i.labelPixel=r,n=r})}update(){const t=this.#n();if(!t)return;const e=this.#a(),s=this.#i().map(r=>this.#h(r,e)).filter(r=>r!=null);new Set(s.map(r=>r.annotation.trace)).size>1&&s.filter(r=>r.color===kh&&r.traceColor).forEach(r=>{r.color=r.traceColor});const i=t.selectAll("g.plotter-line-end-label, g.plotter-bar-end-label").data().map(r=>r?.labelY).filter(Number.isFinite);zt.spreadLabels(s.filter(r=>r.metricVertical),void 0,i),this.#T(t,s),this.#u()}hide(){this.#e=!0,this.#t?.interrupt().attr("opacity",0)}supports(t){return Ny.includes(t?.type)}add(t,e,s=null){if(!My.includes(e)||!this.supports(t))return!1;const n=e==="value"?G.anchorKeyFromRow(s):null;if(e==="value"&&n==null)return!1;const i=t.x?.stack||t.y?.stack,r=!!t.stacked&&!t.overlay,a=e==="average"&&i&&!r?s?.[i]:null,l=a!=null?String(a):null,c=G.traceKeyOf(t),h=this.#i(!0);return h.some(d=>d.trace===c&&d.kind===e&&(d.key??null)===n&&(d.series??null)===l)?!1:(h.push({id:`value-line-${Date.now().toString(36)}-${h.length}`,trace:c,kind:e,...n!=null?{key:n}:{},...l!=null?{series:l}:{}}),this.#r(),!0)}clear(){const t=this.#i();t.splice(0,t.length),this.#r()}list(){return this.#i()}unmount(){this.#t?.remove(),this.#t=null,super.unmount?.()}#t=null;#e=!1;#s(){return this.__parameters__.plot}#n(){return this.#s()?.__nodes__?.svg||null}#r(){const t=this.#s()?.__parameters__?.parent;t?.markSettingsPersistDirty?.(),typeof t?.update=="function"?t.update(null,null,{skipSettingsPanel:!0}):this.update()}#i(t=!1){const e=this.#s()?.layer?.configuration;if(!e)return[];if(!e.annotations){if(!t)return[];e.annotations={}}if(!Array.isArray(e.annotations.valueLines)){if(!t)return[];e.annotations.valueLines=[]}return e.annotations.valueLines}#a(){const t=this.#s(),e=new Map,s=typeof t?.getCurrentTraces=="function"?t.getCurrentTraces():[];return(Array.isArray(s)?s:[]).forEach(n=>{const i=t.instances?.[n?.id]?.containers?.layerContainer;if(!this.supports(n)||!i)return;const r=this.#l(n);if(!r)return;const{dimensionScale:a,metricScale:l}=r,c=["left","right"].includes(l.position),h=[],u=new Map,d=new Map,p=new Map;let f=null;i.selectAll("path.plotter-trace-element-path").each(function(_){const g=_?.data,m=Number(g?.[l.value]);if(!g||!Number.isFinite(m))return;const y=a.stack?g[a.stack]:null;if(h.push({slot:g[a.value],series:y!=null?String(y):null,value:m}),f==null&&(f=zt.#p(this)),y!=null&&!d.has(String(y))){const T=zt.#p(this);T&&d.set(String(y),T)}const b=G.anchorKeyFromRow(g),A=m<0,L=c?Number(_.y)+(A&&Number(_.height)||0):Number(_.x)+(A?0:Number(_.width)||0);b!=null&&Number.isFinite(L)&&(u.set(b,L),y!=null&&p.set(b,d.get(String(y))??null))}),e.set(G.traceKeyOf(n),{trace:n,dimensionScale:a,metricScale:l,metricVertical:c,points:h,anchors:u,seriesColors:d,anchorColors:p,traceColor:f})}),e}#l(t){const e=t?.scales?.x?.getScale?.(),s=t?.scales?.y?.getScale?.();if(!e||!s)return null;const n=!!e.dimension||e._valueType!=="continuous"||e._isDate;return(!!s.dimension||s._valueType!=="continuous"||s._isDate)&&!n?{dimensionScale:s,metricScale:e}:{dimensionScale:e,metricScale:s}}#h(t,e){const s=e.get(t?.trace);if(!s||typeof s.metricScale?._scale!="function")return null;const{trace:n,metricScale:i,dimensionScale:r,metricVertical:a}=s,l=!!n.stacked&&!n.overlay,c=!!i.relative;let h,u;if(t.kind==="average"){if(c)return null;const m=t.series!=null?s.points.filter(y=>y.series===t.series):s.points;h=zt.computeAverage(m,l),u=h!=null?i._scale(h):null}else u=s.anchors.get(t.key),h=Number.isFinite(u)&&typeof i._scale.invert=="function"?i._scale.invert(u):null;const d=(r.range||[]).map(Number).filter(Number.isFinite);if(!(Number.isFinite(u)&&Number.isFinite(h)&&d.length===2))return null;const f=G.formatAnchorValue(h,c?"%":""),_=t.kind==="average"?zt.#y(t,f):f,g=t.series!=null&&s.seriesColors.get(t.series)||s.anchorColors.get(t.key)||kh;return{annotation:t,metricVertical:a,metricPixel:u,labelPixel:u,range:[Math.min(...d),Math.max(...d)],label:_,color:g,traceColor:s.traceColor}}static#p(t){const e=i=>i&&!["transparent","none"].includes(i)&&!i.startsWith("url("),s=t.closest?.("g.plotter-trace-group")?.querySelector("path.plotter-trace-group-path");return[t.getAttribute("data-color"),t.getAttribute("fill"),s?.getAttribute("stroke")].find(e)||null}static#y(t,e){return[zt.#L("Average"),t.series??t.trace,e].filter(s=>s!=null).join(" ")}static#L(t){return typeof t.translate=="function"?t.translate():t}#T(t,e){this.#t=t.selectAll(`g.${Yr}`).data([Yr],a=>a).join("g").attr("id",this.__parameters__.id).attr("class",Yr),this.#t.raise(),t.select("g.plotter-differences").raise();const s=this.#t.selectAll(`g.${Rh}`).data(e,a=>a.annotation.id).join(a=>{const l=a.append("g").attr("class",Rh);return l.append("line").attr("class","plotter-value-line-stroke"),l.append("line").attr("class","plotter-value-line-hit"),l.append("text").attr("class","plotter-value-line-label"),l}).attr("data-value-line-id",a=>a.annotation.id).attr("data-value-line-kind",a=>a.annotation.kind),n=a=>{const[l,c]=a.range;return a.metricVertical?{x1:l,x2:c,y1:a.metricPixel,y2:a.metricPixel}:{x1:a.metricPixel,x2:a.metricPixel,y1:l,y2:c}},i=a=>a.attr("x1",l=>n(l).x1).attr("x2",l=>n(l).x2).attr("y1",l=>n(l).y1).attr("y2",l=>n(l).y2);s.select("line.plotter-value-line-stroke").call(i).attr("stroke",a=>a.color).attr("stroke-width",Iy).attr("stroke-dasharray",Oy).attr("stroke-linecap","round").attr("pointer-events","none"),s.select("line.plotter-value-line-hit").call(i).attr("stroke","transparent").attr("stroke-width",Py).style("cursor","context-menu").on("contextmenu",(a,l)=>this.#c(a,l.annotation));const r=Number(this.#s()?.valueLineLabelOffset)||0;s.select("text.plotter-value-line-label").text(a=>a.label).attr("x",a=>a.metricVertical?a.range[1]+r+Kr:a.metricPixel+Kr).attr("y",a=>a.metricVertical?a.labelPixel:a.range[0]+Fn).attr("dominant-baseline",a=>a.metricVertical?"middle":"auto").attr("text-anchor","start").attr("font-size",Fn).attr("font-weight",Nh).attr("fill",a=>a.color).attr("stroke","var(--plotter-background, #fff)").attr("stroke-width",Dy).attr("stroke-linejoin","round").attr("paint-order","stroke").attr("pointer-events","none")}#u(){this.#t&&(this.#e?(this.#e=!1,this.#t.interrupt().attr("opacity",0).transition().duration(Fy).attr("opacity",1)):this.#t.attr("opacity",1))}#c(t,e){t.preventDefault(),t.stopPropagation();const s=this.#s()?.__parameters__?.parent?.__instance__?.contextMenu;if(!s?.__node__)return;const n=e?.kind==="average",i=[{group:(n?"Average line":"Value line").translate(),danger:!0,text:(n?"Remove average line":"Remove value line").translate(),title:"Delete this reference line".translate(),icon:()=>D.get("cross-svg",{size:16}),click:()=>{const r=this.#i(),a=r.indexOf(e);a!==-1&&r.splice(a,1),this.#r()}}];s.renderAnnotationMenu?.(t,e,i)}}function Hy(){return(o,t,e)=>{if(typeof e!="number"||Number.isNaN(e))return null;if(typeof Number.prototype.format!="function")return String(e);const s=t&&typeof t=="object"?t:{key:t};if(typeof s.format=="function"){const a=s.format(o,e);return typeof a=="string"?a:a==null?null:String(a)}const n={},i=Fi(s);i&&(n.unit=i),s.format&&typeof s.format=="object"&&Object.assign(n,s.format);let r=e;n.scale!=null&&(r=r*n.scale,delete n.scale);try{return r.format(n)}catch{return String(e)}}}class By{constructor({viewKey:t,paneNode:e,plot:s,surfaceId:n,isFocus:i=!1}){this.viewKey=t,this.paneNode=e,this.plot=s,this.surfaceId=n,this.isFocus=i,this.__nodes__={},this.instances={},this.__axis__={},this.width=0,this.height=0,this._brush=null}#t=null;isTableView(){return this.viewKey===$&&this.plot.layer?.configuration?.table?.enabled!==!1}isCustomView(){return qt(this.plot.layer,this.viewKey)}isSyntheticDefaultView(){return this.viewKey===jn}getTableInstance(){return this.#t}setTableInstance(t){this.#t=t}unmount(){this.#t&&(this.#t.unmount(),this.#t=null),Object.keys(this.instances).forEach(t=>{typeof this.instances[t]?.unmount=="function"&&this.instances[t].unmount(),delete this.instances[t]}),this.__nodes__.visualization&&this.__nodes__.visualization.remove(),this.__nodes__={},this.instances={},this.__axis__={},this.paneNode?.remove()}}class zy{#t=new Map;#e=null;#s=null;constructor({plot:t}){this.#s=t}sync(t,e,s,n,i){this.#e=t,this.clear();const r=e?.rowGroups;if(!t||!r||r.length===0||s.length<1)return;Re(this.#s?.layer);const a=t.getBoundingClientRect(),l=r.length-1;r.forEach((c,h)=>{if(c.viewKeys.forEach((u,d)=>{const p=h===l&&d===c.viewKeys.length-1,f=n.get(u)?.paneNode;f&&!p&&this.#n({splitRoot:t,hostRect:a,viewKeys:s,rowViewKeys:c.viewKeys,viewKey:u,pane:f,onComplete:i})}),h<r.length-1){const u=c.viewKeys.map(p=>n.get(p)?.paneNode).filter(Boolean),d=r[h+1].viewKeys.map(p=>n.get(p)?.paneNode).filter(Boolean);u.length&&d.length&&this.#r({splitRoot:t,hostRect:a,topRowIndex:h,topPanes:u,bottomPanes:d,onComplete:i})}})}clear(){this.#t.forEach(t=>t.remove()),this.#t.clear()}#n({splitRoot:t,hostRect:e,viewKeys:s,rowViewKeys:n,viewKey:i,pane:r,onComplete:a}){const l=r.getBoundingClientRect(),c=l.right-e.left,h=document.createElement("div");h.className="plotter-pane-resize-handle plotter-pane-resize-handle-col",h.title="Resize pane width".translate(),h.style.left=`${c-Is/2}px`,h.style.top=`${l.top-e.top}px`,h.style.height=`${l.height}px`,h.dataset.viewKey=i,t.append(h),h.addEventListener("mousedown",u=>{this.#i(u,h,t,s,n,i,r,a)}),this.#t.set(`col:${i}`,h)}#r({splitRoot:t,hostRect:e,topRowIndex:s,topPanes:n,bottomPanes:i,onComplete:r}){const a=Math.max(...n.map(u=>u.getBoundingClientRect().bottom)),l=Math.min(...i.map(u=>u.getBoundingClientRect().top)),c=(a+l)/2-e.top,h=document.createElement("div");h.className="plotter-pane-resize-handle plotter-pane-resize-handle-row",h.title="Resize row height".translate(),h.style.top=`${c-Is/2}px`,h.dataset.topRowIndex=String(s),t.append(h),h.addEventListener("mousedown",u=>{this.#a(u,h,s,e,t,r)}),this.#t.set(`row:${s}`,h)}#i(t,e,s,n,i,r,a,l){t.preventDefault(),t.stopPropagation();const c=this.#s.layer,h=c.configuration.layout,u=s.getBoundingClientRect(),d=Os(i,h,c,n),p=d[r]?.start??1,f=d[r]?.span??si(r,h,c,n),_=a.getBoundingClientRect(),g=_.top-u.top,m=_.height,y=this.#s.__parameters__.parent.__node__;y?.classList.add("plotter-pinned-resizing");let b=f;const A=T=>{const E=Na(T.clientX,u.left,u.width,p);b=E.span,e.style.left=`${E.boundaryLeftPx}px`,e.style.top=`${g}px`,e.style.height=`${m}px`},L=()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",L),y?.classList.remove("plotter-pinned-resizing"),b!==f&&(Ps(h,r,b,c),this.#s.__parameters__?.parent?.markSettingsPersistDirty?.(),this.#s.updatePinnedViewsLayout(0)),l?.()};document.addEventListener("mousemove",A),document.addEventListener("mouseup",L)}#a(t,e,s,n,i,r){t.preventDefault(),t.stopPropagation(),Re(this.#s.layer);const a=this.#s.layer.configuration.layout,l=this.#s.__parameters__.parent,h=l?.getLayoutRegionNode?.("center")?.clientHeight||n.height||1,u=ai(te(this.#s.layer),this.#s.layer.configuration,this.#s.layer,{containerHeightPx:h}).rowGroups,d=u.length;if(s+1>=d)return;const p=u.map((C,S)=>ii(S,d,a,h));a.pinnedRowHeightsPx=[...p];const f=a.pinnedRowHeightsPx[s],_=a.pinnedRowHeightsPx[s+1],g=St*2,m=t.clientY,y=parseFloat(e.style.top)||0,b=l?.__node__;b?.classList.add("plotter-pinned-resizing");let A=f;const L=C=>{const S=[...a.pinnedRowHeightsPx];S[s]=C,S[s+1]=f+_-C,i.style.gridTemplateRows=S.slice(0,d).map(N=>`${N}px`).join(" ");const w=S.slice(0,d).reduce((N,R)=>N+R,0)+Yn*(d-1);i.style.minHeight=`${w}px`},T=C=>{const S=C.clientY-m;A=Math.max(St,Math.min(f+_-St,f+S)),f+_<g&&(A=Pa(h,s,d)),L(A),e.style.top=`${y+S}px`},E=()=>{if(document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",E),b?.classList.remove("plotter-pinned-resizing"),A!==f){Ju(a,s,A,f+_-A),this.#s.__parameters__?.parent?.markSettingsPersistDirty?.(),this.#s.commitPinnedLayoutRowResize().finally(()=>{r?.()});return}i.style.gridTemplateRows=ri(u,a,this.#s.layer,{containerHeightPx:h}).join(" "),r?.()};document.addEventListener("mousemove",T),document.addEventListener("mouseup",E)}}const Mh=Object.freeze(["full","focusFirst","scoped"]),Vy=50,$y=500;function Wy(o={}){const t=o&&typeof o=="object"?o:{},e=Mh.includes(t.mode)?t.mode:"focusFirst",s=Number(t.debounceMs);return{mode:e,state:t.state??1,backgroundState:t.backgroundState??0,surfaceKeys:Array.isArray(t.surfaceKeys)?t.surfaceKeys.filter(Boolean):null,origin:typeof t.origin=="string"?t.origin:"unknown",debounceMs:Number.isFinite(s)&&s>=0?s:0,skipBackgroundCustomOnDrill:t.skipBackgroundCustomOnDrill!==!1}}function Xr(o,t={},e=1){const s=Wy(t),n=t?.state??o??s.state;return e<=1?{...s,mode:"full",state:n,backgroundState:n}:t?.mode&&Mh.includes(t.mode)?{...s,state:n}:{...s,mode:s.mode==="focusFirst"?"focusFirst":s.mode,state:n}}function Ih(o,t){return!o||typeof o.isCustomView!="function"||!o.isCustomView()||t.skipBackgroundCustomOnDrill===!1?!1:t.origin==="drill"&&!o.isFocus}function Gy(o){return o.debounceMs>0?o.debounceMs:o.origin==="drill"?Vy:0}const jy=.85,Uy=6,Yy=10,Oh=18,Ky="datama-story-module-plot",Xy="datama-story-module-table",Zy="datama-story-module-comment",Ye=Object.freeze({size:Oh,className:"plotter-icon"}),Qy=4,qy=2.5;class ot extends ht{static#t=50;static#e=3;static#s=5;static#n=.2;static#r={left:"bottom",bottom:"left",right:"top",top:"right"};static#i=3;static#a=8;static#l=6;static#h=1;static#p=Object.freeze(["legends","differences","valueLines","hover","tableInteractionAdapter"]);static#y=Object.freeze(["waterfall-default","tree-default"]);dataUpdated=!1;get logger(){try{return this.__parameters__?.parent?.logger}catch{return}}#L=null;#T={};#u=null;#c=0;#m=null;#o=null;#A=null;#E=null;#d=new Map;#_=null;#C=0;#S=!1;#g="";#f="";#x=null;#v={};#D;#B;#$;_hover;constructor(t){super(t),Bn.ensureFallbacks(),this.#T={},this.#v={},this.#D=t.header,this.#B=t.shortcut,this.#$=t.inputs}toggleFilterOnThis(t){let e=this.getCurrentTraces(),s=t.target.attributes["data-x-axis"]?.value,n=t.target.attributes["data-x"]?.value,i=e.filter(l=>l.x.name===s)[0].x.stack,r=t.target.attributes["data-x-stack"]?.value;s=e.filter(l=>l.x.name===s)[0].x.value;let a;i?a=l=>l[i]===r:a=l=>l[s]===n,e=e.map(l=>l?.if?.toString()===a.toString()?(delete l.if,l):{...l,if:a}),e.map((l,c)=>(this.#Gt(this.#X()),this.instances[l.id].update()))}reverseAxis(){const t=this.layer?.configuration?.reverse===!0,e=s=>{Array.isArray(s)&&s.forEach(n=>{!!n._reverseApplied!==t&&(n._reverseApplied=t,n.x.position=this.#nt(n.x.position),n.y.position=this.#nt(n.y.position),n.x2&&(n.x2.position=this.#nt(n.x2.position)),n.y2&&(n.y2.position=this.#nt(n.y2.position)))})};this.layer.traces&&!Array.isArray(this.layer.traces)?Object.keys(this.layer.traces).forEach(s=>{s===$||qt(this.layer,s)||e(this.layer.traces[s]?.traces)}):e(this.getCurrentTraces())}toggleStack(){let t=this.getCurrentTraces();t=t.map(s=>(s.stacked=!s.stacked,s));let e=x.getNode("button","plotter-shortcuts-stack-unstack-"+this.__parameters__.parent.__parameters__.id);if(e.querySelectorAll(".plotter-icon")[0]&&e.querySelectorAll(".plotter-icon")[0].remove(),e.classList.toggle("active"),e.classList.contains("active")){const s=D.get("stacked-svg",Ye);s&&e.append(s)}else{const s=D.get("unstacked-svg",Ye);s&&e.append(s)}this._update()}toggleOverlay(){let t=this.getCurrentTraces();t=t.map(s=>(s.overlay=!s.overlay,s));let e=x.getNode("button","plotter-shortcuts-overlay-"+this.__parameters__.parent.__parameters__.id);if(e.querySelectorAll(".plotter-icon")[0]&&e.querySelectorAll(".plotter-icon")[0].remove(),e.classList.toggle("active"),e.classList.contains("active")){const s=D.get("check-svg",Ye);s&&e.append(s)}else{const s=D.get("close-svg",Ye);s&&e.append(s)}this._update()}toggleRelative(){let t=this.getCurrentTraces();t=t.map(s=>(s.relative=!s.relative,s));let e=x.getNode("button","plotter-shortcuts-relative-"+this.__parameters__.parent.__parameters__.id);if(e.querySelectorAll(".plotter-icon")[0]&&e.querySelectorAll(".plotter-icon")[0].remove(),e.classList.toggle("active"),e.classList.contains("active")){const s=D.get("check-svg",Ye);s&&e.append(s)}else{const s=D.get("close-svg",Ye);s&&e.append(s)}this._update()}#F(t){return Array.isArray(t)?t:t&&typeof t=="object"&&t.type?[t]:[]}getCurrentTraces(t=null){!t&&this.layer.traces&&!Array.isArray(this.layer.traces)&&(this.layer.trace||(this.layer.trace=Object.keys(this.layer.traces)[0]));const e=t??this.layer.trace;if(e===$||qt(this.layer,e))return[];if(e===jn)return this.#F(this.layer.traces);if(!t&&Array.isArray(this.layer.traces))return this.layer.traces;if(this.layer.traces&&!Array.isArray(this.layer.traces)){const s=this.layer.traces[e];return this.#F(s?.traces??s)}return this.#F(this.layer.traces)}isTableView(t=null){return(t??this.layer.trace)===$&&this.layer?.configuration?.table?.enabled!==!1}isCustomView(t=null){const e=t??this.layer.trace;return qt(this.layer,e)}#w(t=this.#X()){if(!t)return null;if(!t.__nodes__.container){const e=document.createElement("div");e.setAttribute("id",`${t.surfaceId}-container`),e.classList.add("plotter-visualization"),e.style.display="flex",e.style.flex="1 1 auto",e.style.minHeight="0",e.style.height="100%",e.style.width="100%",e.style.position="relative",t.paneNode.append(e),t.__nodes__.visualization=e,t.__nodes__.container=window.d3.select(`#${t.surfaceId}-container`)}return t.__nodes__.visualization}#G(){return Hy()}#N(t){const e=this.layer.configuration.table,s=Ko(e);return{id:t.surfaceId,formatValue:this.#G(),followChartVisibility:e?.rows?.followChartVisibility===!0,onConfigChange:()=>{this.__parameters__.parent?.markSettingsPersistDirty?.()},onAfterDraw:()=>{this.#k(t)},onRowMouseMove:(n,i,r)=>{if(!s.enabled)return;const a=this.#I(),l={data:i},c=i?.unique??i?.id??null,h=this.#k(t);if(h&&(h._highlightedRowId=c),this.#R(n,i,!0,s),s.tooltip&&a?.trace?.hover!==!1){const u=n.currentTarget instanceof HTMLElement?n.currentTarget:n.target,d=s.kpiDetail&&r?.cell instanceof HTMLElement?r.cell:u,p={sourceEvent:n,target:d,currentTarget:n.currentTarget??d},f=typeof e?.rowHover=="function"?e.rowHover:null,_=f?{...a,trace:{...a.trace||{},hover:g=>f(g?.data??g)}}:a;h?.show(p,l,_)}},onRowMouseOut:(n,i)=>{if(!s.enabled)return;const r=t.instances?.hover;r&&(r._highlightedRowId=null),t.getTableInstance?.()?.setHighlightedRowId?.(null),this.#R(n,i,!1,s),s.tooltip&&(!!(n?.target||n?.currentTarget||n?.sourceEvent?.target||n?.sourceEvent?.currentTarget)?r?.hide(n,{data:i}):r?.hideUnlocked?.())},onHoverClear:()=>{const n=t.instances?.hover;n&&(n._highlightedRowId=null),n?.hideUnlocked?.()},onRowClick:(n,i)=>{Ef({event:n,row:i,tableConfig:this.layer.configuration.table,layer:this.#I()})==="selection"&&(t.instances?.hover?.hideUnlocked?.(),this.instances.hover?.hideUnlocked?.())},onRowContextMenu:(n,i)=>{n.preventDefault(),this.#V(n,i)},getHighlightedRowId:()=>t.instances?.hover?._highlightedRowId??this.instances?.hover?._highlightedRowId??null}}#R(t,e,s,n){if(!n.syncChart&&!n.syncComment&&!n.syncTableRow)return;const i={syncChart:n.syncChart!==!1,syncComment:n.syncComment!==!1,syncTable:n.syncTableRow!==!1},r=s?this.__parameters__.callbacks?.onTableRowMouseMove:this.__parameters__.callbacks?.onTableRowMouseOut;if(typeof r=="function"){r(t,e,i);return}const a={data:e};if(s&&typeof this.__parameters__.callbacks?.onMouseMove=="function"){this.__parameters__.callbacks.onMouseMove(t,a);return}!s&&typeof this.__parameters__.callbacks?.onMouseOut=="function"&&this.__parameters__.callbacks.onMouseOut(t,a)}#M(t){return t instanceof HTMLElement?t.querySelector(".plotter-table-view")??t:null}clearUnlockedHovers(){this.instances?.hover&&(this.instances.hover._highlightedRowId=null,this.instances.hover.hideUnlocked?.());for(const t of this.#d.values())t.instances?.hover?.hideUnlocked?.(),t.getTableInstance?.()?.clearTransientHoverState?.(),t.getTableInstance?.()?.setHighlightedRowId?.(null);this.#E?.clearTransientHoverState?.(),this.#E?.setHighlightedRowId?.(null)}#k(t){const e=t?.__nodes__?.visualization,s=t?.getTableInstance?.()?.root??null,n=s instanceof HTMLElement?s:this.#M(e);return!(n instanceof HTMLElement)||!t?null:this.#ct(t,n)}#Z(){const e=this.#ee($)?.instances?.hover??this.instances?.hover;e&&(e._highlightedRowId=null,e.hideUnlocked?.())}#V(t,e){const s=this.#I();if(s?._handleContextMenu){s._handleContextMenu(t,{data:e});return}this.__parameters__.parent?.__instance__?.contextMenu?.render(t,e,s)}#H(){const t=this.layer?.traces;if(!t||Array.isArray(t))return null;const e=new Set,s=[...ot.#y,...Object.keys(t)];for(const n of s){if(e.has(n)||(e.add(n),n===$||qt(this.layer,n)))continue;const i=t[n],r=this.#F(i?.traces??i),a=r.find(l=>l?.type==="waterfall"||l?.type==="tree")??r[0];if(a)return a}return null}#I(){const t=this.#Lt();if(t)return t;const e=this.#H(),s=this.instances.tableInteractionAdapter;if(s&&s.trace===e)return s;const n=this,i={plot:n,trace:e||{type:"table",hover:!1}};return i._handleContextMenu=(r,a)=>n.__parameters__.parent.__instance__.contextMenu.render(r,a?.data??a,i),i._handleClick=(r,a)=>{if(typeof e?.click=="function")return e.click(r,a)},this.instances.tableInteractionAdapter=i,i}#O(){for(const t of this.#d.values())if(!t.isTableView?.()&&!t.isCustomView?.()&&t.__nodes__?.svg)return t;return null}#j(){if(this.#E&&typeof this.#E.collectExportRows=="function")return this.#E;const t=this.#X()?.getTableInstance?.()??null;if(t&&typeof t.collectExportRows=="function")return t;for(const e of this.#d.values()){const s=e.getTableInstance?.()??null;if(s&&typeof s.collectExportRows=="function")return s}return null}#lt(){const t=this.#j();if(!t||typeof t.collectExportRows!="function")return;let e=[];try{e=t.collectExportRows()||[]}catch(n){console.error("Plotter table CSV export failed",n);return}const s=Kt.toCsv(e);s&&Kt.copyToClipboard(s)}#J(t,e){let s=e.querySelector(".plotter-table-view-toolbar");if(s)return;s=document.createElement("div"),s.className="plotter-table-view-toolbar";const n=new vt({id:`${t.surfaceId}-table-export-csv`,icon:D.get("copy-svg",{size:Oh}),title:"Copy table data as CSV".translate(),classList:["transparent","plotter-table-view-export-csv","quick-action-copy-as-csv"],callbacks:{click:()=>this.#lt()}});s.append(n.render()),e.prepend(s)}#tt(t){t?.querySelector(".plotter-table-view-toolbar")?.remove()}#W(t=this.#ee($)||this.#X()){return new Promise(e=>{if(!t){e();return}const s=this.#w(t);s.classList.add("plotter-table-active"),this.#Q(t),t.__nodes__.svg&&t.__nodes__.svg.style("display","none");const n=this.layer.configuration.table,i=af(this.__parameters__.parent.__parameters__.data||[],n,{plotCallbacks:this.__parameters__.callbacks,rootCallbacks:this.__parameters__.parent.__parameters__.callbacks}),r=this.#N(t);this.#J(t,s);let a=t.getTableInstance();a?(Object.assign(a.options,r),a.update(i,{followChartVisibility:r.followChartVisibility,config:n,tableOptions:r})):(a=new Xt(i,n,s,r),t.setTableInstance(a),a.render()),t.isFocus&&(this.#E=a),this.#pt(t),this.#k(t),e()})}#it(t=this.#X()){return new Promise(e=>{if(!t){e();return}const s=Vn(this.layer,t.viewKey);if(!s||typeof s.template!="function"){e();return}bn(this.layer);let n=t.__nodes__.customView;n instanceof HTMLElement?n.dataset.plotterCommentContextMenuBound!=="true"&&this.#_t(n):(n=document.createElement("div"),n.className="plotter-custom-view",n.dataset.viewKey=t.viewKey,t.paneNode.replaceChildren(n),t.__nodes__.customView=n,this.#_t(n)),n.replaceChildren();const i=mu(this.layer,t.viewKey,{data:this.__parameters__.parent.__parameters__.data}),r=s.template(i);r instanceof Node?n.append(r):Array.isArray(r)&&n.append(...r.filter(a=>a instanceof Node)),kg(n,ur(this.layer,t.viewKey)),this.#pt(t),e()})}#st(t=this.#ee($)||this.#X()){if(!t)return;const e=t.getTableInstance();e&&(this.#Z(),e.unmount(),t.setTableInstance(null)),this.#E===e&&(this.#E=null),t.__nodes__.visualization&&(t.__nodes__.visualization.classList.remove("plotter-table-active"),this.#tt(t.__nodes__.visualization)),t.__nodes__.svg&&t.__nodes__.svg.style("display",null)}#Q(t){const e=t?.__nodes__?.traceTitle;e&&(e.remove(),delete t.__nodes__.traceTitle);const s=t?.__nodes__?.traceSubtitle;s&&(s.remove(),delete t.__nodes__.traceSubtitle)}#P(t,e){const s=e?.__nodes__?.svg,n=typeof s?.node=="function"?s.node():null;return!(t instanceof HTMLElement)||!(n instanceof Element)?0:n.getBoundingClientRect().left-t.getBoundingClientRect().left}#et(t=this.#X()){if(!t)return;const e=t.__nodes__?.visualization,s=t.isTableView?.()||t.isCustomView?.();if(!e||s){this.#Q(t);return}const n=this.getCurrentTraces(t.viewKey),i=cc(this.layer?.configuration,n);if(!i.title.title&&!i.subtitle.subtitle){this.#Q(t);return}const r=this._getRanges(t),a=Math.min(r.horizontal[0],r.horizontal[1]),l=Math.max(r.horizontal[0],r.horizontal[1]),c=vg({plotLeft:a,plotRight:l}),h=this.#P(e,t),u=e.clientWidth||Number(t.width)||0;this.#rt({surface:t,visualization:e,role:"title",className:"plotter-trace-title",nodeKey:"traceTitle",bandResult:i.title,siblingReservedTop:0,siblingReservedBottom:i.subtitle.reservedBottom,edges:c,plotLeft:a,plotRight:l,svgOffsetLeft:h,vizWidth:u,contextMenuPayloadKey:Ds}),this.#rt({surface:t,visualization:e,role:"subtitle",className:"plotter-trace-subtitle",nodeKey:"traceSubtitle",bandResult:i.subtitle,siblingReservedTop:i.title.reservedTop,siblingReservedBottom:0,edges:c,plotLeft:a,plotRight:l,svgOffsetLeft:h,vizWidth:u,contextMenuPayloadKey:Ha})}#rt({surface:t,visualization:e,role:s,className:n,nodeKey:i,bandResult:r,siblingReservedTop:a,siblingReservedBottom:l,edges:c,plotLeft:h,plotRight:u,svgOffsetLeft:d,vizWidth:p,contextMenuPayloadKey:f}){const _=s==="title"?r?.title:r?.subtitle;if(!_){const E=t.__nodes__?.[i];E&&(E.remove(),delete t.__nodes__[i]);return}let g=t.__nodes__[i];g?g.dataset.plotterTitleContextMenuBound!=="true"&&this.#dt(g,f):(g=document.createElement("div"),g.className=n,e.append(g),t.__nodes__[i]=g,this.#dt(g,f));const m=r.reservedTop||r.reservedBottom,y=_.align;let b=d+c.contentLeft,A=d+c.contentRight;y==="left"?(b=d+c.contentLeft,A=d+u):y==="right"&&(b=d+h,A=d+c.contentRight);const L=Math.max(0,p-A);g.style.height=`${m}px`,r.reservedTop>0?(g.style.top=`${Math.max(0,Number(a)||0)}px`,g.style.bottom=""):(g.style.bottom=`${Math.max(0,Number(l)||0)}px`,g.style.top=""),g.style.left=`${Math.max(0,b)}px`,g.style.right=`${L}px`,g.dataset.align=y,g.dataset.position=_.position,g.style.fontSize=`${_.font.size}px`,g.style.fontWeight=String(_.font.weight),g.style.fontStyle=_.font.italic?"italic":"normal",g.style.fontFamily=_.font.family||"",g.style.textAlign=y,g.style.justifyContent=y==="center"?"center":y==="right"?"flex-end":"flex-start";let T=[];try{T=Cg(_.template())}catch(E){this.logger?.error(E)}g.replaceChildren(...T)}hasAxisDateHoles(){return Object.values(this.instances||{}).some(e=>{const s=e.trace?.scales?.x,n=!!s?._dateHolesAfter?.length,i=!!s?.holesSkipped;return n||i})}isViewChangeInProgress(){return this.#u!=null}changeView(t){if(this.#u)return this.#u;const e=this.layer.trace;if(e===t)return Promise.resolve();const s=this.getCurrentTraces(e);if(Iu(this.layer,t),te(this.layer).length>=2){this.#z(t);const l=this._update(0,{mode:"full",origin:"pin",state:0}).finally(()=>{this.#u===l&&(this.#u=null,this.#z(this.layer.trace))});return this.#u=l,l}if(t===$||this.isTableView(t)||this.isCustomView(t)||this.isCustomView(e))return this.#z(t),te(this.layer).length>=2?this._update(0,{mode:"full",origin:"pin",state:0}):t===$?this.#W():this.isCustomView(t)?this._update(0,{mode:"full",origin:"pin",state:0}):(this.#st(),this._update(0));this.instances?.differences?.hide(),this.instances?.valueLines?.hide(),this._cleanZoomData();const n=this.getCurrentTraces();let i=new Promise(l=>l(!0));typeof this.__parameters__.hooks?.onViewChange=="function"&&(i=new Promise((l,c)=>{try{let h=this.__parameters__.hooks.onViewChange(t,e,{from:s,to:n});h?.then?h.then(u=>{l(u)}):l(h)}catch(h){this.logger?.error(h),c(h)}}));let r;this.dataUpdated?(this.dataUpdated=!1,r=this._update(0).then(()=>{this.getCurrentTraces().forEach(l=>{this.instances[l.id]?._join(1)})})):r=i.then(l=>{if(l===!1){this.layer.trace=e;return}return typeof this.__parameters__.callbacks?.sort=="function"&&this.__parameters__.callbacks.sort(this.__parameters__.parent.__parameters__.data),ga(this.layer,e,t)?this.#ut(e,t):this._update(0)});const a=r.finally(()=>{this.#u===a&&(this.#u=null,this.#z(this.layer.trace))});return this.#u=a,a}#ut(t,e){this.#z(e),this.#Dt();const s=this.#d.get(e);if(!s)return this._update(0);if(s.needsHierarchyMorph=!0,!this.#oe(s.instances,this.getCurrentTraces(e))){const n=this.#d.get(t);if(n&&n!==s)return this._update(0)}return this.#pt(s),this.#ae(0,s,{mode:"full",origin:"viewMorph",state:0})}#z(t){t!=null&&this.__parameters__.parent?.__instance__?.shortcut?.syncViewSelection?.(t)}updatePinnedViewsLayout(t=0){if(this.#u)return this.#u.then(()=>this.updatePinnedViewsLayout(t));this.#z(this.layer.trace),this.#Dt();const e=Array.from(this.#d.values()).some(n=>n?.needsHierarchyMorph),s=this.#b(async()=>{this.__parameters__.hooks?.beforePinnedLayoutChange?.(this.layer),await this.#U(e?1:t,{mode:"full",origin:"pin",state:e?1:t}),typeof this.__parameters__.hooks?.onPinnedLayoutChange=="function"&&await Promise.resolve(this.__parameters__.hooks.onPinnedLayoutChange(this.layer))}).finally(()=>{this.#u===s&&(this.#u=null,this.#z(this.layer.trace))});return this.#u=s,s}commitPinnedLayoutRowResize(){if(this.#u)return this.#u;Re(this.layer),this.#Dt();const t=this.#b(()=>this.#ht(1)).finally(()=>{this.#u===t&&(this.#u=null)});return this.#u=t,t}replaceFocusedPinnedView(t){return Hu(this.layer,t)?(this.__parameters__.parent?.markSettingsPersistDirty?.(),this.updatePinnedViewsLayout(0)):Promise.resolve()}to(t){this.instance=this.__parameters__.parent.getLAYERS.translate(t,this.instances)}render(t=null){if(typeof this.__parameters__.hooks?.preRender=="function")try{this.__parameters__.hooks.preRender()}catch(e){this.logger?.error(e)}if(t){this.layer=t;const e=this.__parameters__.parent;if(typeof e.getLaidOutHostBox=="function"){const i=e.getLaidOutHostBox();i.width>0&&(e.__parameters__.width=i.width),i.height>0&&(e.__parameters__.height=i.height)}this.layer.width=e.__parameters__.width;const s=this.#Y();return this.layer.height=s.plotSvgHeight,this.#T?.init&&this.logger?.info("Plotter : Waiting for initialization end..."),(this.#T?.init||Promise.resolve()).then(()=>(this.logger?.info("Plotter : Rendering start..."),this.#Ee(t).then(()=>{if(this.logger?.info("Plotter : Rendering end"),typeof this.__parameters__.hooks?.postRender=="function")try{this.__parameters__.hooks.postRender()}catch(i){this.logger?.error(i)}})))}else throw Error("Plotter : Error : your layer is not defined")}init(t){return this.layer=t,this.#T.init=new Promise((e,s)=>{delete this.#T.init;try{typeof this.__parameters__.hooks?.preInit=="function"&&this.__parameters__.hooks.preInit(),typeof this.__parameters__.callbacks?.sort=="function"&&this.__parameters__?.callbacks?.sort(this.__parameters__.parent.__parameters__.data),e()}catch(n){this.logger?.error(n),s(n)}}),this.#T.init.then(()=>(this.#Dt(),this.#b(()=>{try{this.#Wt(),Array.from(this.#d.values()).forEach(e=>{this.#pt(e),!e.isTableView()&&!e.isCustomView()&&this.#gt(e)}),this.#pt(this.#X())}catch(e){this.logger?.error(e)}return this.__node__}))).finally(()=>{typeof this.__parameters__.hooks?.postInit=="function"&&this.__parameters__.hooks.postInit()})}unmount(){return this.observer&&this.observer.disconnect(),this.observer=null,this.#f="",this.#g="",this.#S=!1,Array.from(this.#d.values()).forEach(t=>t.unmount()),this.#d.clear(),this.#_?.remove(),this.#_=null,Promise.resolve()}static getSquaredBracketShape(t,e,s=!0,n=!0,i=!0){let r=n?`M 0 ${e} L 0 0`:"",a=i?`M ${t} ${e} L ${t} 0`:"",l=s?`M 0 ${e} L ${t} ${e}`:"";return`${r} ${l} ${a}`}static getCurlyBraceShape(t,e,s,n,i,r=.5){let a=t-s,l=e-n,c=Math.sqrt(a*a+l*l);a=a/c,l=l/c;let h=t+r*i*l,u=e-r*i*a,d=t-.25*c*a+(1-r)*i*l,p=e-.25*c*l-(1-r)*i*a,f=t-.5*c*a+i*l,_=e-.5*c*l-i*a,g=s+r*i*l,m=n-r*i*a,y=t-.75*c*a+(1-r)*i*l,b=e-.75*c*l-(1-r)*i*a;return"M "+t+" "+e+" Q "+h+" "+u+" "+d+" "+p+" T "+f+" "+_+" M "+s+" "+n+" Q "+g+" "+m+" "+y+" "+b+" T "+f+" "+_}_update(t=1,e=null){return this.#Dt(),this.#U(t,e)}#U(t=1,e=null){this.reverseAxis(),this.#Wt();const s=Array.from(this.#d.values());if(!s.length)return Promise.resolve();const n=Xr(t,e,s.length);if(s.length===1)return this.#Nt(s[0],n.state,n).then(()=>{this.#pt(s[0]),this.#bt(s[0])});switch(n.mode){case"scoped":return this.#Re(n);case"full":return this.#Me(n);default:return this.#ke(n)}}#at(t=this.#X()){if(t?.isTableView?.()){this.#k(t);return}if(!t?.__nodes__?.svg)return;this.#pt(t);const e=this.#w(t);e instanceof HTMLElement&&this.#ct(t,e)}#ct(t,e){if(!t||!(e instanceof HTMLElement))return null;const s=`${t.surfaceId}-hover`;return t.instances.hover?t.instances.hover.bindHtmlHost(e):t.instances.hover=new cy({parent:this,id:s,htmlHost:e}),t.instances.hover.update(),t.instances.hover}static#ot(t){return parseFloat(String(t||"").replace("px",""))||0}#Y(){const t=this.__parameters__.parent,e=t.__parameters__.height,s=t.__instance__,n=this.layer?.configuration||{},i=s.header?.__node__,r=s.shortcut?.__node__,a=s.plot?.instances?.legends?.__nodes__?.legends||s.plot?.instances?.legends?.__node__;let l=0,c=0;if(Zn("header",n)&&(l+=i?.clientHeight||0,i)){const p=i.currentStyle||window.getComputedStyle(i);c+=ot.#ot(p.marginBottom)+ot.#ot(p.paddingBottom)}if(Zn("shortcut",n)&&(l+=r?.clientHeight||0,r)){const p=r.currentStyle||window.getComputedStyle(r);c+=ot.#ot(p.marginBottom)+ot.#ot(p.paddingBottom)}Zn("legend",n)&&(l+=a?.clientHeight||0);const h=l+c,u=e-h;let d=u;return(!Number.isFinite(d)||d<0)&&(d=0),{plotSvgHeight:d,bodyRemainingHeight:u}}#K(t){const e=t?.paneNode?.clientHeight||0;if(e>0)return e;const s=t?.__nodes__?.visualization?.clientHeight||0;return s>0?s:this.#Y().plotSvgHeight}#b(t){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{Promise.resolve(t()).then(e)})})})}async#ht(t=1){const e=Xr(t,{mode:"full",origin:"resize",state:t},this.#d.size),s=Array.from(this.#d.values()).filter(i=>!i.isTableView()&&!i.isCustomView());if(!s.length)return;for(const i of s)await this.#Nt(i,e.state,e);const n=this.#X();n&&(this.#pt(n),this.#bt(n))}#nt(t){return typeof t!="string"?t:ot.#r[t]||t}#q(t){return!!t?.node?.()}#gt(t=this.#X()){if(!t)return;this.#pt(t);let e=this.getCurrentTraces(t.viewKey);this.layer.configuration.legends.size>1&&(this.layer.configuration.legends.size=this.layer.configuration.legends.size/1e3);const s=this.#Qt(),n=t.paneNode?.clientWidth||0,i=this.__parameters__.parent.__parameters__.width-s;t.width=n>0?n:i,this.#bt(t),this.#w(t),t._brush=window.d3.brushX().filter(l=>Qa(l)||!l.target?.matches?.(".overlay, .selection, .handle")?!1:this.#Ae(t)).on("brush",l=>{if(!l.selection)return;this.getCurrentTraces(t.viewKey).forEach(h=>{const u=t.instances[h.id];u?._supportsDimensionBrush?.()&&u._handleBrush(l)})}).on("end",l=>{if(!l.selection)return;this.__nodes__.svg.call(t._brush.move,null),this.getCurrentTraces(t.viewKey).forEach(h=>{const u=t.instances[h.id];u?._supportsDimensionBrush?.()&&u._handleBrushEnd(l)})}),this._brush=t._brush;const r=this.__nodes__.container.selectAll(`svg#${t.surfaceId}-svg.plotter-plot`).data([{id:"svg"}],l=>l.id).join(l=>l.append("svg").attr("xmlns","https://www.w3.org/2000/svg").attr("id",`${t.surfaceId}-svg`).attr("class","plotter-plot").style("order",0),l=>l);r.attr("width",()=>{const c=document.getElementById(`${t.surfaceId}-container`)?.clientWidth||0;return c-this.#kt(c)}).attr("height",()=>e.length===0?0:this.#K(t)).call(this._brush),this.__nodes__.svg=r,this.__nodes__.svg.selectAll("defs").remove(),this.__nodes__.defs=this.__nodes__.svg.append("defs");const a=this.__nodes__.svg.node();a&&!a.dataset.plotDblClickBound&&(a.dataset.plotDblClickBound="true",a.addEventListener("dblclick",async()=>{this._cleanZoomData(t),await this._update(1)})),this.#ft(a),Object.keys(this.__parameters__?.callbacks?.root||{}).forEach(l=>{this.__node__.removeEventListener(l,this.__parameters__.callbacks?.root[l]),this.__node__.addEventListener(l,this.__parameters__.callbacks?.root[l])})}#ft(t){!t||t.dataset.plotBackgroundContextMenuBound==="true"||(t.dataset.plotBackgroundContextMenuBound="true",t.addEventListener("contextmenu",this.#At),Um(t,()=>this.layer?.configuration?.reverse===!0))}#_t(t){!(t instanceof HTMLElement)||t.dataset.plotterCommentContextMenuBound==="true"||(t.dataset.plotterCommentContextMenuBound="true",t.addEventListener("contextmenu",this.#vt))}#dt(t,e){!(t instanceof HTMLElement)||t.dataset.plotterTitleContextMenuBound==="true"||(t.dataset.plotterTitleContextMenuBound="true",t.addEventListener("contextmenu",s=>{this.#Ct(s,e)}))}#yt(t){this.#dt(t,Ds)}#At=t=>{if(!(t.target instanceof Element)||Qa(t))return;const s=this.#X()?.isTableView?.()?this.#I():this.#Lt(),n=this.__parameters__.parent?.__instance__?.contextMenu;!s||!n||n.render(t,{[Da]:!0},s)};#vt=t=>{t.preventDefault(),t.stopPropagation();let e=t.target;if(e instanceof Element||(e=e?.parentElement),!(e instanceof Element))return;const s=this.__parameters__.parent?.__instance__?.contextMenu;if(!s)return;const n=this.#Lt(),i=t.currentTarget?.dataset?.viewKey||this.#X()?.viewKey||null;s.render(t,{[Fa]:!0,viewKey:i},n)};#Ct(t,e){t.preventDefault(),t.stopPropagation();let s=t.target;if(s instanceof Element||(s=s?.parentElement),!(s instanceof Element))return;const n=this.__parameters__.parent?.__instance__?.contextMenu;if(!n)return;const i=this.#Lt();n.render(t,{[e]:!0},i)}#Mt=t=>{this.#Ct(t,Ds)};#Lt(){const t=n=>{if(!n||n.isTableView?.()||n.isCustomView?.())return null;const r=this.getCurrentTraces(n.viewKey)[0];return r?.id?n.instances?.[r.id]??null:null},e=this.#X(),s=t(e);if(s)return s;for(const n of this.#d.values()){const i=t(n);if(i)return i}for(const n of this.#d.values()){const i=n.instances||{},r=Object.values(i).find(a=>a?.trace?.type==="waterfall"||a?.trace?.type==="tree");if(r)return r}return null}#Tt(t=[]){const e=Array.isArray(t)?t:[],s=(n,i=0)=>n.reduce((r,a)=>{if(!a)return r;const l=a.depth??0,c=Array.isArray(a.children)?a.children:[],h=c.length?s(c,l):l;return Math.max(r,h,i)},i);return s(e)}#wt(t){if(t?.type!=="waterfall")return null;const e=[t?.x,t?.y].filter(Boolean);for(let s=0;s<e.length;s+=1){const n=e[s];if(n?.hierarchy===!0)return n}return null}#Et(t=[]){if(this.layer.configuration.reverse!==!0)return!1;const e=Array.isArray(t)?t:[];for(let s=0;s<e.length;s+=1)if(this.#wt(e[s])?.position==="left")return!0;return!1}#xt(t,e,s){const n=this.#Kt(t);return n.length?n.reduce((i,r)=>{let a="";typeof e=="function"?a=e(r?.text,0,null,null):typeof e=="string"?a=r?.[e]??"":a=r?.text??"";const l=a!=null?String(a):"",c=v.measureHierarchyTextWidth(l,s),h=Number.isFinite(c)&&c>=0?c:0;return Math.max(i,h)},0):0}#St(t){const e=this.layer?.configuration?.axis||{},s={...e.title||{},...e.x?.title||{}},n=(a,l)=>a?.position==="bottom"&&a.label!=null&&a.label!==!1&&a.label!==""&&v.isTitleShownForAxis(s.display,{dimension:l});return t.some(a=>n(a?.x,!0)||n(a?.y,!1)||n(a?.y2,!1))?(Number(s.size)||16)*qy:0}#It(t,e,s){const n=Array.isArray(t)?t:[],i=Number.isFinite(s)&&s>0?s:0,r=Number.isFinite(e)&&e>0?e:0;let a=0,l=!1,c=!1;for(let h=0;h<n.length;h+=1){const u=n[h];if(!(u?.x?.position==="bottom"&&u?.x?.hierarchy))continue;if(oe({configuration:this.layer?.configuration,traceAxis:u.x,role:"x"})){c=!0;continue}l=!0;const f=this.#Tt(this.__parameters__.parent.__parameters__.data);a=Math.max(a,f)}return!l&&c?i:l?i+r*v.BOTTOM_AXIS_TEXT_BASE_MULTIPLIER+a*r*v.HIERARCHY_LEVEL_GAP_FACTOR:i+r*v.BOTTOM_AXIS_TEXT_BASE_MULTIPLIER+this.#St(n)}#Ot(t=[],e=0,s=0){const n=this.layer.configuration.axis.ticks.texts.size,i=this.#Pt(),r=Array.isArray(t)?t:[],a=Array.isArray(this.__parameters__.parent.__parameters__.data)?this.__parameters__.parent.__parameters__.data:[],l=this.layer.configuration.reverse===!0,c={size:n,weight:this.layer.configuration.axis.ticks.texts.weight};let h=null,u=0;for(let _=0;_<r.length;_+=1){const g=r[_],m=this.#wt(g);if(!m)continue;const y=m===g?.y?"y":m===g?.x2?"x2":m===g?.y2?"y2":"x";oe({configuration:this.layer?.configuration,traceAxis:m,role:y})||(h=m,u=Math.max(u,this.#Tt(a)))}if(!h)return this.#L=null,{vertical:this.#It(t,n,i.bottom),horizontal:0,layout:null};const d=h.texts??"text",p=this.#xt(a,d,c),f=v.computeHierarchyAxisReserve({maxDepth:u,tickFontSize:n,gapFactor:jl(this.layer.configuration),maxLeafLabelWidth:p,axisPosition:h.position,isReverse:l,paddingBottom:i.bottom,paddingLeft:i.left,availableHeight:e,reservedTop:s,maxReserveRatio:Ul(this.layer.configuration),maxLines:gn(this.layer.configuration).maxLines});return f.layout?this.#L={...f.layout,maxDepth:u,maxLeafLabelWidth:p,isReverse:l}:this.#L=null,f}getHierarchyTickLayout(){return this.#L}#Rt(t=[]){const e=Array.isArray(t)?t:[],s=Array.isArray(this.__parameters__.parent.__parameters__.data)?this.__parameters__.parent.__parameters__.data:[],i=(this.layer?.configuration?.axis?.groupedAxes||{}).enabled===!0,r=e.some(_=>{if(_?.type!=="waterfall")return!1;const g=_?.x?.hierarchy===!0,m=_?.y?.hierarchy===!0,y=g?_?.y?.split:m?_?.x?.split:null;return y!=null&&y!==""});if(i&&r)return 0;const a=this.#mt(e,s);if(!a)return 0;const c=this.#Ft()+ot.#i;if(!(this.layer.configuration.reverse===!0)){const _=a-1;return c+_*ot.#h*c+ot.#a+ot.#l}const u=this.#Pt(),d=this.#Ot(e,this.layer.height),p=Math.max(0,this.layer.height-d.vertical-u.top),f=this.#Ut(e,s,p);return this.#zt(f,c)}#Bt(t){const e=[],s=Array.isArray(t)?t:[],n=(r,a)=>{if(!r)return 0;const l=Array.isArray(r.children)?r.children:[];if(!l.length)return e.push({row:r,depth:a,span:1}),1;let c=0;for(let h=0;h<l.length;h+=1)c+=n(l[h],a+1);return e.push({row:r,depth:a,span:c}),c};let i=0;for(let r=0;r<s.length;r+=1)i+=n(s[r],0);return{entries:e,leafCount:Math.max(i,1)}}#Ut(t,e,s){const n={maxDepth:0,spanByDepth:new Map,textWidthByDepth:new Map},a=(Array.isArray(t)?t:[]).find(f=>f?.type==="waterfall")?.topLine,{entries:l,leafCount:c}=this.#Bt(e),h=Number.isFinite(s)&&s>0?s:0,u=h>0?h/c:0,d=Number(this.layer.configuration.axis.ticks.texts.size)||10,p={size:this.#Ft(),weight:Number(this.layer.configuration.axis.ticks.texts.weight)||600};for(let f=0;f<l.length;f+=1){const _=l[f],g=_.depth;n.maxDepth=Math.max(n.maxDepth,g);let m;if(typeof a=="function"?m=a({data:_.row}):m=[_.row?.Top_Line_Label],!(Array.isArray(m)&&m.some(L=>L!=null&&String(L).length>0)))continue;const b=u>0?u*Math.max(Number(_.span)||1,1):d*v.HIERARCHY_LEVEL_GAP_FACTOR,A=n.spanByDepth.get(g)??0;n.spanByDepth.set(g,Math.max(A,b));for(let L=0;L<m.length;L+=1){const T=m[L]!=null?String(m[L]):"";if(!T.length)continue;const E=rt.computeRenderWidth(T,p),C=Number.isFinite(E)&&E>0?E:0,S=n.textWidthByDepth.get(g)??0;n.textWidthByDepth.set(g,Math.max(S,C))}}return n}#Yt(t,e,s){const n=e?.get(t),i=Number.isFinite(n)&&n>0?n:0;return Math.max(i,s)}#zt(t,e){const s=Math.max(Number(t?.maxDepth)||0,0);let n=0;for(let i=0;i<=s;i+=1){const r=this.#Yt(i,t.textWidthByDepth,e);n+=r*ot.#h}return n+ot.#a+ot.#l}#Kt(t){const e=Array.isArray(t)?t:[],s=[],n=[...e];for(;n.length;){const i=n.pop();if(!i)continue;const r=Array.isArray(i.children)?i.children:[];if(r.length){for(let a=0;a<r.length;a+=1)n.push(r[a]);continue}s.push(i)}return s}#Xt(t){const e=Array.isArray(t)?t:[],s=[],n=[...e];for(;n.length;){const i=n.pop();if(!i)continue;s.push(i);const r=Array.isArray(i.children)?i.children:[];for(let a=0;a<r.length;a+=1)n.push(r[a])}return s}#Ht(t){const e=Number(t?.depth);if(Number.isFinite(e)&&e>=0)return e;let s=0,n=t;for(;n?.parent;)s+=1,n=n.parent;return s}#mt(t,e){const s=Array.isArray(t)?t:[],n=this.#Xt(e);return s.reduce((i,r)=>{if(r?.type!=="waterfall")return i;const a=r?.topLine,l=n.reduce((h,u)=>{let d;if(typeof a=="function"?d=a({data:u}):d=[u?.Top_Line_Label],!(Array.isArray(d)&&d.some(_=>_!=null&&String(_).length>0)))return h;const f=this.#Ht(u);return Math.max(h,f)},-1),c=l<0?0:l+1;return Math.max(i,c)},0)}#Vt(){const t=this.layer?.configuration?.legends||{};if(!(t.display===!0))return 0;const s=Number(t.size);return Number.isFinite(s)&&s>=0?s:0}#kt(t){const e=Number(t);if(!(Number.isFinite(e)&&e>=0))return 0;const n=Ce(this.layer?.configuration||{});return n!=="left"&&n!=="right"?0:e*this.#Vt()}#Pt(){const t=this.layer?.configuration?.plot?.padding;return typeof t=="number"?{top:t,right:t,bottom:t,left:t}:{top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0,left:t?.left??0}}#Ft(){return Tn(this.layer?.configuration?.waterfall?.topLine?.size,ms)}getWaterfallTopLineReservedSpace(){return this.#Rt(this.getCurrentTraces())}#Zt(t){if(!Array.isArray(t))return{left:0,right:0};const e=this.layer?.configuration?.reverse===!0?this.#$t(t):{left:0,right:0},s=this.layer?.configuration?.axis?.ticks?.texts||{},n=Number(s.size)||12,i={size:n,weight:s.weight,family:s.family},r=Math.round(n*Qy),a=this.__parameters__.parent.__parameters__.data||[];return t.forEach(l=>{["y","y2"].forEach(c=>{const h=l?.[c];if(!h||h.hidden===!0||!["left","right"].includes(h.position))return;if(h.ticks?.texts?.display===!1){const f=Math.round(n*2.5);e[h.position]=Math.max(e[h.position],f);return}const u=this.#se(l,h,a),d=h.relative?"100%":Ut(u,{unit:h.unit,format:s.format}),p=rt.computeRenderWidth(d,i)+n*1.5;e[h.position]=Math.max(e[h.position],r,Math.round(p))})}),e}#$t(t){const e={left:0,right:0},s=this.layer?.configuration?.axis?.ticks?.texts||{};if(s.display===!1)return e;const n=Number(s.size)||12,i={size:n,weight:s.weight,family:s.family},r=v.resolveSideLabelMaxWidth(this.layer?.width),a=this.__parameters__.parent.__parameters__.data||[];return t.forEach(l=>{const c=l?.x;if(!c||c.hidden===!0||c.hierarchy||!["left","right"].includes(c.position))return;const h=a.filter((p,f,_)=>typeof l.if=="function"?l.if(p,f,_):!0),d=[...new Set(h.map(p=>p?.[c.value]))].filter(p=>p!=null).reduce((p,f,_)=>{const g=typeof c.texts=="function"?c.texts(f,_):String(f);return Math.max(p,rt.computeRenderWidth(String(g??""),i))},0);if(d>0){const p=Math.round(Math.min(d,r)+n*1.5);e[c.position]=Math.max(e[c.position],p)}}),e}#le(t,e){const s=this.layer?.dimensions||[],n=(Array.isArray(t)?t:[]).find(f=>f?.x?.position==="bottom"&&!f.x.hierarchy&&f.x.hidden!==!0&&s.includes(f.x.value));if(!n)return null;const i=(this.__parameters__.parent.__parameters__.data||[]).filter((f,_,g)=>typeof n.if=="function"?n.if(f,_,g):!0),r=[...new Set(i.map(f=>f?.[n.x.value]))].filter(f=>f!=null);if(!r.length)return null;let a=typeof n.x.texts=="function"?r.map((f,_)=>n.x.texts(f,_)):r.map(String);const l=this.layer.configuration.axis||{},c={...l.ticks?.texts||{},...l.x?.ticks?.texts||{}},h={size:Number(c.size)||12,weight:c.weight,family:c.family},u=Math.abs(e[1]-e[0]);if(n.x.thinTicks){const f=v.resolveThinnedLabelStep(a,u,h);a=a.filter((_,g)=>g%f===0)}const d=u/a.length;return{layout:v.resolveFlatDimensionLabelLayout(a,d,h,c.orientation),slot:d,font:h}}#ce(t){if(!t)return 0;const{layout:e,font:s}=t,n=s.size*v.HIERARCHY_LABEL_LINE_HEIGHT_FACTOR;if(e.mode==="rotate"){const i=(e.angle??v.FLAT_LABEL_ROTATION_DEG)*Math.PI/180;return Math.max(0,e.maxLength*Math.sin(i)+s.size-n)}return Math.max(0,(e.lines-1)*n)}#he(t){if(t?.layout?.mode!=="rotate")return 0;const e=(t.layout.angle??v.FLAT_LABEL_ROTATION_DEG)*Math.PI/180;return Math.max(0,t.layout.maxLength*Math.cos(e)-t.slot/2)}#se(t,e,s){const n=e.value;if(t.stacked&&!t.overlay){const i=new Map;return s.forEach(r=>{const a=Number(r?.[n]);if(Number.isFinite(a)){const l=String(r?.[t.x?.value]);i.set(l,(i.get(l)||0)+Math.abs(a))}}),Math.max(0,...i.values())}return Math.max(0,...s.map(i=>Math.abs(Number(i?.[n]))).filter(Number.isFinite))}#ue(t){const e={configuration:this.layer?.configuration,data:this.__parameters__.parent.__parameters__.data};return Math.max(0,...(Array.isArray(t)?t:[]).map(s=>ct.isEndLabelsEnabled(this.layer?.configuration,s)?ct.resolveEndLabelReserve(e,s):at.isEndLabelsEnabled(this.layer?.configuration,s)?at.resolveEndLabelReserve(e,s):0))}#de(t,e){const s=this.#ue(t);return this.valueLineLabelOffset=e,Math.max(s,this.#pe(t))}#pe(t){const e=this.__parameters__.parent.__parameters__.data||[];return zt.resolveLabelReserve({configuration:this.layer?.configuration,traces:t,measureExtreme:s=>this.#se(s,s.y||{},e)})}#fe(t){const e=(Array.isArray(t)?t:[]).find(a=>a?.x?.position==="right"&&a.x.hidden!==!0);if(!e||Ce(this.layer.configuration)==="right")return 0;const s=this.layer.configuration.axis?.ticks?.texts||{},n={size:Number(s.size)||12,weight:s.weight,family:s.family},i=this.__parameters__.parent.__parameters__.data||[],r=[...new Set(i.map(a=>a?.[e.x.value]))].filter(a=>a!=null).map(a=>rt.computeRenderWidth(String(a),n));return Math.max(0,...r)+n.size}#_e(t,e){const s=this.layer.configuration,n=s.bars?.labels;(Array.isArray(t)?t:[]).filter(i=>i?.type==="bars").forEach(i=>{const r=i.y?.value,a=(this.__parameters__.parent.__parameters__.data||[]).filter((y,b,A)=>(typeof i.if=="function"?i.if(y,b,A):!0)&&Number.isFinite(Number(y?.[r]))),l=new Map;a.forEach(y=>{const b=y[i.x?.value],A=Math.abs(Number(y[r]));l.set(b,i.stacked?(l.get(b)??0)+A:Math.max(l.get(b)??0,A))});const h=i.stacked||i.overlay||!i.x?.stack?1:new Set(a.map(y=>y[i.x.stack])).size,u=e*jy/Math.max(l.size*h,1)*(s.axis?.ratioOfElementSize??1),d=s.axis?.ticks?.texts||{},p={size:Number(n?.size)||11,weight:n?.weight||500,family:n?.family||d.family},f=Ut(Math.max(0,...l.values()),{unit:i.y?.unit,format:{...d.format||{},compact:!0}});i.barLabelTextWidth=rt.computeRenderWidth(f,p);const _=h>1?0:Uy,g=fn(i)?re(n):us(n),m=n?.orientation==="vertical"?p.size<=u:i.barLabelTextWidth<=u+_;i.barLabelsFit=g==="always"||g==="auto"&&m,i.y&&(i.y.barLabelsFit=i.barLabelsFit)})}#ge(t){const e=this.layer?.trace;return t||e!==$&&!qt(this.layer,e)?t:Array.from(this.#d.values()).find(s=>!s.isTableView()&&!s.isCustomView())||null}_getRanges(t=null){const e=this.#ge(t),s=this.#Pt(),n=e?.viewKey??null,i=this.getCurrentTraces(n),r=Number(e?.width??this.layer.width)||0;this.#_e(i,r);const a=Number(e?.height??this.layer.height)||0,l=this.#Et(i),c=this.#Zt(i);let h=l?0:Math.max(s.left*(this.layer.configuration.reverse?1:1.5),c.left),u=r-Math.max(s.right*(this.layer.configuration.reverse?1:1.5),c.right)-this.#de(i,c.right)-this.#fe(i);if(this.layer.configuration.legends.display){let R=this.#kt(r);u-=R}const d=cc(this.layer?.configuration,i),p=d.reservedTop,f=d.reservedBottom,_=this.layer.configuration.reverse===!0,g=_?0:Math.max(0,...i.map(R=>Ln(this.layer?.configuration,R))),m=Math.max(this.#Rt(i),g),y=this.#Ot(i,a,s.top+p+(_?0:m));let b=[h+y.horizontal,u-(_?m:0)];const A=this.layer.configuration,L=A.legends.display!==!1&&Ce(A)==="top",E=i.some(R=>!oe({configuration:A,traceAxis:R.y,role:"y"}))?Yy:-18,C=Math.max(0,s.top+(L?E:0)),S=_?null:this.#le(i,b),w=this.#ce(S);return b[0]=Math.max(b[0],this.#he(S)),{vertical:[a-y.vertical-f-w,C+p+(_?0:m)],horizontal:b}}#me(t,e,s=null){const n=s?.viewKey??null;let i=this.getCurrentTraces(n),{horizontal:r,vertical:a}=this._getRanges(s);const l=this.layer?.dimensions||[];t.x.relative=!!(t.relative||t.x.relative),t.y.relative=!!(t.relative||t.y.relative),t.y.ignoreStackPosition=t.overlay||t.stacked,t.x.ignoreStackPosition=t.overlay||t.stacked,t.y.mainValueOnly=t.stacked,t.x.mainValueOnly=t.stacked;let c=i.find(d=>d?.scales?.x&&t.x.using&&d.scales.x.name===t.x.using),h=i.find(d=>d?.scales?.y&&t.y.using&&d.scales.y.name===t.y.using);const u=this.layer.configuration;return t.scales={x:new On(window.d3,this.__parameters__.parent.__parameters__.data,{...t.x,hidden:oe({configuration:u,traceAxis:t.x,role:"x"})},{baseRange:["left","right"].includes(t.x.position||"bottom")?a:r,name:`x${e}`,key:"x",using:c?.scales?.x,joinMissingValues:t.joinMissingValues,traceCondition:t.if,legendCondition:t._if,trace:t,configuration:this.layer.configuration,dimension:l.includes(t?.x?.value)||t?.x?.hierarchy}),y:new On(window.d3,this.__parameters__.parent.__parameters__.data,{...t.y,hidden:oe({configuration:u,traceAxis:t.y,role:"y"})},{baseRange:["left","right"].includes(t.y.position||"left")?a:r,name:`y${e}`,key:"y",using:h?.scales?.y,joinMissingValues:t.joinMissingValues,traceCondition:t.if,legendCondition:t._if,configuration:this.layer.configuration,trace:t,dimension:l.includes(t?.y?.value)||t?.y?.hierarchy})},t.x2&&(t.x2.relative=!!(t.relative||t.x2.relative),t.scales.x2=new On(window.d3,this.__parameters__.parent.__parameters__.data,{...t.x2,hidden:oe({configuration:u,traceAxis:t.x2,role:"x2"})},{baseRange:["left","right"].includes(t.x2.position||"bottom")?a:r,name:`x2-${e}`,key:"x2",joinMissingValues:t.joinMissingValues,traceCondition:t.if,legendCondition:t._if,trace:t,configuration:this.layer.configuration,dimension:l.includes(t?.x2?.value)||t?.x2?.hierarchy})),t.y2&&(t.y2.relative=!!(t.relative||t.y2.relative),t.scales.y2=new On(window.d3,this.__parameters__.parent.__parameters__.data,{...t.y2,hidden:oe({configuration:u,traceAxis:t.y2,role:"y2"})},{baseRange:["left","right"].includes(t.y2.position||"bottom")?a:r,name:`y2-${e}`,key:"y2",joinMissingValues:t.joinMissingValues,traceCondition:t.if,legendCondition:t._if,trace:t,configuration:this.layer.configuration,dimension:l.includes(t?.y2?.value)||t?.y2?.hierarchy})),t.scales.x2&&(t.scales.x2.setReference(t.scales.y2||t.scales.y),t.scales.x2.init()),t.scales.y2&&(t.scales.y2.setReference(t.scales.x2||t.scales.x),t.scales.y2.init()),t.scales.x.setReference(t.scales.y),t.scales.y.setReference(t.scales.x),t.scales.x.init(),t.scales.y.init(),t.size&&(t.scales.x.setTraceSize(t.size,t.sizeRange),t.scales.y.setTraceSize(t.size,t.sizeRange)),t}#Qt(){return 0}#qt(){const e=this.__parameters__.parent.__parameters__.parent?.clientWidth||0;if(e>0)return e;if(typeof this.__parameters__.parent.getLaidOutHostBox=="function"){const s=this.__parameters__.parent.getLaidOutHostBox().width;if(s>0)return s}return this.__parameters__.parent.__parameters__.width||0}#Wt(){this.#_&&(this.#_.offsetHeight,this.#_.getBoundingClientRect().width);const t=this.#Qt(),e=this.#qt();for(const n of this.#d.values()){const i=n.paneNode;if(!i)continue;const r=i.clientWidth,a=i.clientHeight;r>0?n.width=r:this.#d.size===1&&e>0&&(n.width=Math.max(0,e-t)),a>0&&(n.height=a)}const s=this.#X();s&&this.#bt(s)}#bt(t){t&&(Number.isFinite(t.width)&&t.width>0&&(this.layer.width=t.width),Number.isFinite(t.height)&&t.height>0&&(this.layer.height=t.height))}#Gt(t=null){const e=t||this.#X();if(!e)return;this.layer.containers||(this.layer.containers={}),e.__axis__||(e.__axis__={}),this.#bt(e);const s=e.width||this.layer.width,n=e.__nodes__;n?.svg&&n.svg.attr("width",s-this.#kt(s)),this.#Le(e),this.#ye(e)}#ye(t=null){const e=t||this.#X(),s=e?.viewKey??null;let n=this.getCurrentTraces(s);const i=e.__axis__,r=e?.__nodes__?.svg;let a=Object.keys(i);n.forEach((l,c)=>{if(l.id||(l.id=this.__parameters__.parent.__parameters__.id+l.type+c),this.#me(l,c,e),l?.type==="tree")return;Object.values(l.scales).forEach(u=>{let d=u.getScale();l.axis||(l.axis={}),!l.axis[d.name]||l.axis[d.name]==null?l.axis[d.name]=new v({plot:this,trace:l,scale:d}):l.axis[d.name].setScale(d),a.indexOf(d.name)!==-1&&a.splice(a.indexOf(d.name),1),l.axis[d.name].update(r),i[d.name]=l.axis[d.name]})}),a.forEach(l=>{i[l].unmount(),delete i[l]}),this.#jt(e)}#be(t){return!t||t.type==="waterfall"||t.type==="tree"?!1:![t.x,t.y,t.x2,t.y2].filter(Boolean).some(i=>i.hierarchy===!0)}#Ae(t){return this.getCurrentTraces(t?.viewKey).some(s=>this.#be(s))}#jt(t=null){const s=(t||this.#X())?.__nodes__?.svg;s&&s.selectAll("g.plotter-axis").raise()}_isMeasureZoomScale(t){if(!t)return!1;const e=t._valueType==="continuous",s=!t._isDate,n=!t.dimension;return e&&s&&n}_computeMeasureZoomDomain(t,e){if(!t||!e)return null;const s=t._scale;if(!(s&&typeof s.domain=="function"))return null;t._zoomBaseDomain||(t._zoomBaseDomain=[...s.domain()]);const i=t._zoomBaseDomain;if(!Array.isArray(i)||i.length<2)return null;const r=Number(i[0]),a=Number(i[1]);if(!Number.isFinite(r)||!Number.isFinite(a))return[...i];const l=r<=a,c=l?r:a,h=l?a:r,u=Number(e.k);if(!Number.isFinite(u)||u<=0)return[...i];if(h-c===0)return[...i];const p=(Math.min(u,ot.#s)-1)/(ot.#s-1),f=(1-Math.max(u,ot.#n))/(1-ot.#n),_=typeof t.getAutoContinuousDomain=="function"?t.getAutoContinuousDomain({includeZero:!1,applyPadding:!1,includeBounds:!1}):null,g=Math.max(Number.isFinite(_?.min)?_.min:c,0),m=Number.isFinite(_?.max)?_.max:h;let y=0;return u>=1?y=c+(g-c)*p:y=c+(0-c)*f,y=Math.max(y,0),y>g&&(y=g),y>m&&(y=m),l?[y,m]:[m,y]}_mirrorMeasureZoomDomain(t,e,s){if(!t||!e||!Array.isArray(s))return;const n=t[e.key];n&&(n.scale=[...s])}_applyMeasureZoom(t,e,s=null){if(!t?.scales||!e)return;const n=new Set;Object.values(t.scales).forEach(i=>{if(!i||typeof i.getScale!="function")return;const r=i.getScale();if(!this._isMeasureZoomScale(r)||n.has(r))return;const a=this._computeMeasureZoomDomain(r,e);if(!a?.length)return;n.add(r),r.scale=[...a],this._mirrorMeasureZoomDomain(t,r,a),r.init();const l=s?.[r.name];l&&(l.setScale(r),l.update())})}#Le(t=null){const e=t||this.#X(),s=e?.viewKey??null,n=e?.instances??this.instances;this.zoom=window.d3.zoom().scaleExtent([ot.#n,ot.#s]).on("zoom",i=>{const r=this.getCurrentTraces(s),a=e?.__axis__||this.__axis__;r.forEach(l=>{this._applyMeasureZoom(l,i.transform,a),n[l.id]?.update(1)}),this.#jt(e),n?.valueLines?.update(),n?.differences?.update()})}#Jt(t,e){if(!e)return"";let n=(t?.paneNode||e)?.clientWidth??0;n<=0&&(n=this.#qt());let i=t?.paneNode?.clientHeight??0;if(i<=0&&t&&(i=Number(t.height)||0),n<=0&&i<=0)return"";const r=this.#_?.clientWidth??0,a=this.#_?.clientHeight??0;return`${n}|${i}|${r}|${a}`}async#Te(t){if(this.#S)return;const e=this.__parameters__.parent.__parameters__.id,s=document.getElementById(e);if(!s){await this.unmount(),t&&typeof t.disconnect=="function"&&t.disconnect();return}const n=this.#X(),i=this.#Jt(n,s);if(i&&i!==this.#g){this.#S=!0,this.#g=i;try{if(n){this.#pt(n),this.#Wt();let c=(n.paneNode||s).clientWidth;if(c<=0&&(c=this.#qt()),c<=0)return;n.width=c,this.layer.width=c;const h=n.__nodes__?.svg;h&&h.attr("width",c-this.#kt(c))}const r=this.#d.size>1?{mode:"full",origin:"resize",state:1}:{state:1};if(!!!(n?.instances&&Object.keys(n.instances).some(l=>ot.#p.indexOf(l)===-1))){const l=n&&Number(n.width)||0;n&&l>0&&await this.#te();return}await this._update(1,r)}finally{requestAnimationFrame(()=>{const r=document.getElementById(e);this.#g=this.#Jt(this.#X(),r),this.#S=!1})}}}#ne(t){const e=this.__parameters__.parent.__parameters__.id,s=t?.paneNode,n=s?.id||s?.dataset?.surfaceId||String(s?.className||""),i=this.#_?"split":"nosplit",r=`${e}|${n}|${i}`;if(this.observer&&this.#f===r)return;if(this.#f=r,this.observer)this.observer.disconnect();else{let l;this.observer=new ResizeObserver(()=>{this.#S||(clearTimeout(l),l=setTimeout(async()=>{if(!this.#S)try{await this.#Te(this.observer)}catch(c){this.logger?.error(c)}},ot.#t))})}const a=document.getElementById(e);a&&this.observer.observe(a),s&&this.observer.observe(s),this.#_&&this.observer.observe(this.#_)}#Ee(){return this.#Dt(),this.#b(()=>this.#te())}#te(){this.#Wt();const t=this.#X();if(!t)return Promise.resolve();const e=Number(t.width??this.layer.width)||0,s=Number(t.height??this.layer.height)||0;if(e<=0||s<=0)return this.#C<ot.#e?(this.#C+=1,this.#b(()=>this.#te())):(this.#ne(t),Promise.resolve());if(this.#C=0,(!t.instances||!Object.keys(t.instances).length)&&(t.instances={}),this.#pt(t),t.isTableView())return this.#W(t);this.#q(this.__nodes__.svg)||this.#gt(t);let n=this.getCurrentTraces(t.viewKey);this.layer.filters||(this.layer.filters={dimensions:{},metrics:[],traces:[]}),n.forEach((l,c)=>{l.id=`${t.surfaceId}-${l.type}${c}`});const i=t.instances,r=n.map(l=>l.id),a=ot.#p;return Object.keys(i).filter(l=>r.indexOf(l)===-1&&!a.includes(l)).forEach(l=>{i[l].unmount(),delete i[l]}),n.forEach(l=>{l._if=(h=>{let u;return l.type==="events"?u=l.calendar.type:u=l?.x?.stack||l?.x?.value,!this.layer.filters.dimensions[u]?.includes(h[u])});const c=this.__parameters__.parent.__parameters__.data.filter((h,u,d)=>(l?.if||(()=>!0))(h,u,d)&&l._if(h,u,d));i[l.id]?(i[l.id].trace=l,i[l.id].data=c):i[l.id]=window.layers[l.type](c,l,this.__nodes__.svg,this.__parameters__.callbacks,this.__parameters__.hooks,this)}),this.__parameters__.parent.layer.configuration.reverse&&this.reverseAxis(),this.#bt(t),this.#Gt(t),this.#at(),this.layer.configuration.legends.display?(this.instances.legends||(this.instances.legends=new ph({plot:this,id:`${t.surfaceId}-legends`})),this.instances.legends.update()):this.instances.legends?.unmount(),this.#ne(t),this.instances.differences||(this.instances.differences=new G({plot:this,id:`${t.surfaceId}-differences`})),this.instances.valueLines||(this.instances.valueLines=new zt({plot:this,id:`${t.surfaceId}-value-lines`})),this.#et(t),Promise.all(n.map((l,c)=>this.instances[l.id].update())).then(()=>{if(this.#jt(t),this.instances.valueLines?.update(),this.instances.differences?.update(),this.#at(t),this.instances.hover?.update(),this.#d.size>1){const l=Array.from(this.#d.values()).filter(c=>c!==t);return this.#re(l,{mode:"full",origin:"draw",state:1,backgroundState:1})}})}_cleanZoomData(t=null){(t?[t]:this.#d.size>0?Array.from(this.#d.values()):[this.#X()].filter(Boolean)).forEach(s=>{const n=this.getCurrentTraces(s.viewKey),i=s.instances||{};n.forEach(r=>{const a=i[r.id];a&&(delete a.computed?.zoomData,delete a._brushElements,Object.values(a.trace?.scales||{}).forEach(l=>{const c=typeof l?.getScale=="function"?l.getScale():l;c&&(c.brushData=[],c.scale=[],delete c._zoomBaseDomain,delete c._zoomBaseScale)})),[r.x,r.y,r.x2,r.y2].filter(Boolean).forEach(l=>{l.brushData=[],l.scale=[],delete l.temp})})})}#xe(t=null){const e=[];for(const s of this.#d.values())s===t||!s?.surfaceId||e.push(s.surfaceId);return e}#ie(t,e=null){const s=this.__parameters__.parent?.__parameters__?.id||"plotter";return Au(s,t,this.#xe(e))}#Se(t,e){if(!t||!e||t.surfaceId===e)return;const s=t.surfaceId,n=(l,c,h)=>{l&&l.id===c&&(l.id=h)},i=t.__nodes__?.container?.node?.()||document.getElementById(`${s}-container`);n(i,`${s}-container`,`${e}-container`);const r=t.__nodes__?.svg?.node?.()||document.getElementById(`${s}-svg`);n(r,`${s}-svg`,`${e}-svg`);const a=Object.keys(t.instances||{});for(let l=0;l<a.length;l++){const c=a[l],h=t.instances[c];if(!h)continue;let u=c;c.indexOf(s)===0&&(u=`${e}${c.slice(s.length)}`),(h.trace?.id===c||h.trace?.id?.indexOf(s)===0)&&(h.trace.id=u);const d=h.containers?.layerContainer?.node?.();n(d,`${c}-layer`,`${u}-layer`),u!==c&&(t.instances[u]=h,delete t.instances[c])}t.surfaceId=e}#ve(t){const s=Array.from(this.#d.keys()).filter(r=>!t.includes(r)),n=t.filter(r=>!this.#d.has(r)),i=Lu(this.layer,s,n,Jt);for(let r=0;r<i.length;r++){const{fromKey:a,toKey:l}=i[r],c=this.#d.get(a);c&&(c.viewKey=l,c.paneNode&&(c.paneNode.dataset.viewKey=l),this.#Se(c,this.#ie(l,c)),c.needsHierarchyMorph=!0,this.#d.delete(a),this.#d.set(l,c))}}#Dt(){Ou(this.layer);const e=this.__parameters__.parent.getLayoutRegionNode?.("center");if(!e)return;const s=te(this.layer);Re(this.layer);const n=e.clientHeight||0,i=ai(s,this.layer?.configuration,this.layer,{containerHeightPx:n});this.#_?.isConnected||(this.#_=null,e.replaceChildren()),this.#_||(this.#_=document.createElement("div"),this.#_.className="plotter-split-root plotter-split-grid",e.append(this.#_)),this.#_.classList.add("plotter-split-grid"),this.#_.classList.toggle("plotter-split-grid-intrinsic",!!i.usesIntrinsicRowHeights),this.#_.classList.toggle("plotter-split-grid-stack",i.rowGroups.length>1),e.classList.toggle("plotter-region-center-scrollable",!!i.scrollableRowStack),this.#_.style.gridTemplateColumns=i.gridTemplateColumns,this.#_.style.gridTemplateRows=i.gridTemplateRows,this.#_.style.gridAutoFlow="row",i.rowGroups.length===1?(this.#_.style.height="100%",this.#_.style.minHeight=""):i.totalGridHeightPx>0?(this.#_.style.height="auto",this.#_.style.minHeight=`${i.totalGridHeightPx}px`):(this.#_.style.height="100%",this.#_.style.minHeight=""),this.#ve(s);for(const[r,a]of this.#d)s.includes(r)||(a.unmount(),this.#d.delete(r));for(s.forEach((r,a)=>{let l=this.#d.get(r);if(!l){const f=document.createElement("div");f.className="plotter-pane",f.dataset.viewKey=r;const _=this.#_.children[a]||null;this.#_.insertBefore(f,_),l=new By({viewKey:r,paneNode:f,plot:this,surfaceId:this.#ie(r),isFocus:r===this.layer.trace}),this.#d.set(r,l)}l.isFocus=r===this.layer.trace,l.paneNode.style.flex="",l.paneNode.classList.remove("plotter-pane-span-row");const c=l.isCustomView(),h=l.isTableView(),u=!c&&!h;l.paneNode.classList.toggle("plotter-pane-custom",c),l.paneNode.classList.toggle("plotter-pane-table",h),l.paneNode.classList.toggle("plotter-pane-chart",u),l.paneNode.classList.toggle(Zy,c),l.paneNode.classList.toggle(Xy,h),l.paneNode.classList.toggle(Ky,u);const d=i.getPaneStyle(r);l.paneNode.style.gridColumn=d.gridColumn||"",l.paneNode.style.gridRow=d.gridRow||"",l.paneNode.onclick=null;const p=this.#_.children[a];p!==l.paneNode&&this.#_.insertBefore(l.paneNode,p||null)}),this.#x?.clear();this.#_.childElementCount>s.length;)this.#_.lastElementChild?.remove();this.#x||(this.#x=new zy({plot:this})),this.#x.sync(this.#_,i,s,this.#d,()=>this.#Ce()),this.#pt(this.#X())}#Ce(){const e=this.__parameters__.parent?.__parameters__?.callbacks?.plot?.onPinnedLayoutResize;typeof e=="function"&&e(this.layer.configuration.layout)}#X(){const t=this.layer?.trace;return t&&this.#d.has(t)?this.#d.get(t):this.#d.values().next().value||null}#ee(t){return this.#d.get(t)||null}#pt(t){if(t&&(this.__nodes__=t.__nodes__,this.instances=t.instances,this.__axis__=t.__axis__,t.isFocus)){const e=t.getTableInstance();e&&(this.#E=e)}}#we(t){return(t.surfaceKeys||[]).map(s=>this.#d.get(s)).filter(Boolean)}async#Re(t){const e=this.#we(t);for(const n of e)await this.#Nt(n,t.state,t);const s=this.#X();s&&(this.#pt(s),this.#bt(s))}async#ke(t){const e=this.#X(),s=Array.from(this.#d.values()).filter(n=>n!==e);e&&(await this.#Nt(e,t.state,t),this.#pt(e),this.#bt(e)),s.length&&this.#Ne(s,t)}#Ne(t,e){this.#c+=1;const s=this.#c;this.#o={surfaces:t,options:e,generation:s},this.#m&&(clearTimeout(this.#m),this.#m=null);const n=Gy(e),i=()=>{this.#m=null;const a=this.#o;!a||a.generation!==s||(this.#o=null,this.#A=this.#re(a.surfaces,a.options).finally(()=>{this.#A&&(this.#A=null)}))},r=()=>{if(typeof requestIdleCallback=="function"&&e.origin==="drill"){requestIdleCallback(()=>i(),{timeout:$y});return}i()};if(n>0){this.#m=setTimeout(r,n);return}queueMicrotask(r)}async#re(t,e){const s=e.backgroundState??0;for(const i of t)Ih(i,e)||await this.#Nt(i,s,e);const n=this.#X();n&&(this.#pt(n),this.#bt(n))}async#Me(t=1){const e=typeof t=="number"?Xr(t,{mode:"full"},this.#d.size):t;this.#Dt();const s=Array.from(this.#d.values());if(s.length>1&&e.mode==="full")await Promise.all(s.map(i=>this.#Nt(i,e.state,e)));else for(const i of s)await this.#Nt(i,e.state,e);const n=this.#X();n&&(this.#pt(n),this.#bt(n))}#Nt(t,e=1,s={}){return Ih(t,s)?Promise.resolve():t.isTableView()?this.#W(t):t.isCustomView()?this.#it(t):this.#ae(e,t,s)}#Pe(t,e=1,s={}){return this.#pt(t),this.#Nt(t,e,s)}async#ae(t,e,s={}){this.#pt(e);const n=e.instances,i=e.__nodes__;e.isFocus&&(n?.differences?.hide(),n?.valueLines?.hide()),this.__parameters__.parent.__parameters__.width=this.__parameters__.parent.__parameters__.parent.clientWidth;const r=this.#Qt(),a=e.paneNode?.clientWidth||0,l=this.__parameters__.parent.__parameters__.width-r;e.width=a>0?a:l,this.#bt(e);const c=this.getCurrentTraces(e.viewKey);if(c.forEach((_,g)=>{_.id||(_.id=`${e.surfaceId}-${_.type}${g}`)}),this.layer.filters?((!this.layer.filters.dimensions||typeof this.layer.filters.dimensions!="object")&&(this.layer.filters.dimensions={}),Array.isArray(this.layer.filters.metrics)||(this.layer.filters.metrics=[]),Array.isArray(this.layer.filters.traces)||(this.layer.filters.traces=[])):this.layer.filters={dimensions:{},metrics:[],traces:[]},!this.#q(i.svg))this.#gt(e);else{const _=e.width;_>0&&i.svg.attr("width",_-this.#kt(_));const g=this.#K(e);e.height=g,this.#bt(e),g>0&&i.svg.attr("height",g)}let h=c.map(_=>_.id);const u=ot.#p,d=this.#Ie(e,c,n,u);if(Object.keys(n).filter(_=>h.indexOf(_)===-1).forEach(_=>{u.includes(_)||Array.from(d.values()).some(m=>m.key===_)||(n[_].unmount(),delete n[_])}),!n.legends&&e.isFocus&&(n.legends=new ph({plot:this,id:`${e.surfaceId}-legends`})),e.isFocus&&this.#at(e),n.differences||(n.differences=new G({plot:this,id:`${e.surfaceId}-differences`})),n.valueLines||(n.valueLines=new zt({plot:this,id:`${e.surfaceId}-value-lines`})),this.#Gt(e),e.isFocus){this.layer?.configuration?.legends?.display?n.legends?.update():n.legends?.unmount();const _=this.#K(e);_>0&&_!==e.height&&(e.height=_,this.#bt(e),i.svg.attr("height",_),this.#Gt(e)),this.#g=this.#Jt(e,document.getElementById(this.__parameters__.parent.__parameters__.id))}let f=[];if(c?.length)for(let _=0;_<c.length;_++){const g=c[_];g.id=`${e.surfaceId}-${g.type}${_}`,g._if=y=>{let b;return g.type==="events"?b=g.calendar.type:b=g?.x?.stack||g?.x?.value,!this.layer.filters.dimensions[b]?.includes(y[b])};const m=d.get(g.id);if(m&&typeof window.layers?.translate=="function"){const y=await window.layers.translate(g,m.instance,this);y.trace.id=g.id,y.trace.scales=g.scales,g.axis&&(y.trace.axis=g.axis),m.key!==g.id&&delete n[m.key],n[g.id]=y;continue}n[g.id]?n[g.id].trace=g:n[g.id]=window.layers[g.type](this.__parameters__.parent.__parameters__.data.filter((y,b,A)=>(g?.if||(()=>!0))(y,b,A)&&(g?._if||(()=>!0))(y,b,A)),g,i.svg,this.__parameters__.callbacks,this.__parameters__.hooks,this),f.push(n[g.id].update(t))}e.needsHierarchyMorph=!1,this.#et(e);try{await Promise.all(f)}finally{this.#jt(e),e.isFocus&&(n.hover?.update(),n.valueLines?.update(),n.differences?.update())}}#Ie(t,e,s,n){const i=new Map;if(!t?.needsHierarchyMorph&&!this.#oe(s,e))return i;for(let r=0;r<e.length;r++){const a=e[r],l=`${t.surfaceId}-${a.type}${r}`,c=this.#Oe(a,s,n);c&&i.set(l,c)}return i}#oe(t,e){const s=new Set((e||[]).map(n=>n?.type).filter(n=>ws(n)));return s.size?Object.keys(t||{}).some(n=>{const i=t[n]?.trace?.type;return ws(i)&&!s.has(i)}):!1}#Oe(t,e,s){if(!ws(t?.type))return null;const n=Object.keys(e||{});for(let i=0;i<n.length;i++){const r=n[i];if(s.includes(r))continue;const a=e[r],l=a?.trace?.type;if(!(!ws(l)||l===t.type))return{key:r,instance:a}}return null}}const Jy=Object.freeze(["auto",2,4,8,16]),t0=8,e0=24,s0=120,n0="#374151";function Qt(o,t){let e=o;return t.forEach(s=>{(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))&&(e[s]={}),e=e[s]}),e}function Hn(o,t){return o.map(e=>({...e,if:()=>t()}))}function $t(o,t,e){return o.map(({text:s,value:n,style:i})=>({text:typeof s=="string"?s.translate():s,style:i,classList:()=>t()===n?["selected"]:[],click:()=>e(n)}))}function Zr(o,t,e){const s=n=>i=>{o()[n]=i,t()};return[{text:"Size".translate(),numericInput:{min:t0,max:e0,value:()=>Number(o().size)||e,onChange:s("size")}},{text:"Weight".translate(),items:$t(is.map(({label:n,value:i})=>({text:n,value:i})),()=>Number(o().weight)||500,s("weight"))},{text:"Font".translate(),items:$t(Ct.map(({label:n,value:i})=>({text:n,value:i,style:Me(i)})),()=>o().family??null,s("family"))}]}function Qr({hit:o,data:t,layer:e}){if(o===K.LEGEND){const a=t?.legendEntry;return a?{name:String(a.name??""),color:a.color??null,trace:a.trace??null,legendEntry:a}:null}const s=e?.trace??null;if(!s)return null;if(t?.[Ka]===!0)return{name:String(t.seriesKey??s.name??""),color:t.seriesColor??null,trace:s,legendEntry:null};let n=null,i=null;try{if(typeof s.color=="function")n=s.color(t,t?.plotter?.rowIndex??0,t?.plotter?.group,s);else{const c=e._getDimensionAxis?.();n=c?.stack?t?.[c.stack]:null}const{colors:a,colorsIsAlreadyMapped:l}=e._getTraceColors();i=e._getTraceColor(t,a,l)??null}catch{}return{name:n!=null&&n!==""&&!String(n).startsWith("#")?String(n):String(s.name??""),color:i,trace:s,legendEntry:null}}function Ph(o,t,{mark:e=null}={}){if(!t)return[];const s=Dh(t),n=[i0(o,t)];return e==="bar"&&n.push(...r0(o)),e==="line"&&n.push(...a0(o,t)),t.legendEntry&&n.push(...o0(o,t.legendEntry)),n.map(i=>({...i,group:s}))}function Dh(o){return"Series {name}".translate({name:o?.name??""})}function i0(o,t){const e=o.plotterParent?.__parameters__||{},s=$_(t.color);let n=null;if(s<0?n="This color is set by the chart, not by the palette":typeof e.onPaletteChange!="function"&&(n="This chart has no editable palette"),n)return{text:"Color".translate(),title:n.translate(),classList:["disabled"],colorSwatch:t.color||"transparent"};let i=t.color,r=0;const a=()=>{clearTimeout(r),r=setTimeout(()=>{o.refresh()},s0)};return{text:"Color".translate(),title:"Changes this palette color on every chart that uses it".translate(),colorSwatch:{value:()=>i,onChange:l=>{W_({palette:e.palette||Q.palette,paletteIndex:s,hex:l,onPaletteChange:e.onPaletteChange})&&(i=l,a())}}}}function r0(o){const t=()=>Qt(o.plotterParent.layer.configuration,["bars","round"]),e=()=>t().display!==!1;return[{text:"Rounded bars".translate(),switchInput:{checked:e,onChange:s=>{t().display=s===!0,o.refresh()}}},...Hn([{text:"Radius".translate(),items:$t(Jy.map(s=>({text:s==="auto"?"Auto":`${s} px`,value:s})),()=>t().radius===void 0||t().radius===null?"auto":t().radius,s=>{t().radius=s,o.refresh()})}],e)]}function a0(o,t){const e=()=>o.plotterParent.layer.configuration,s=t.trace?.name,n=[];if(s!=null){const i=()=>{const l=Qt(e(),["lines","styles"]);return(!l[s]||typeof l[s]!="object")&&(l[s]={}),l[s]},r=()=>Le(e(),t.trace),a=String(s)!==t.name?"Applies to every line of {name}".translate({name:s}):void 0;n.push({text:"Line style".translate(),title:a,items:$t(dr,()=>dr.find(l=>l.dasharray===r().dasharray)?.value??(r().dasharray?"dashed":"solid"),l=>{i().dash=l,o.refresh()})},{text:"Width".translate(),title:a,items:$t(Pg.map(l=>({text:`${l} px`,value:l})),()=>r().width??(Number(t.trace?.width)||2),l=>{i().width=l,o.refresh()})})}return n.push({text:"Curve".translate(),title:"Applies to every line of the chart".translate(),items:$t(fc,()=>e().lines?.curve??"default",i=>{Qt(e(),["lines"]).curve=i,o.refresh()})}),n}function o0(o,t){const e=()=>o.plotterParent?.__instance__?.plot?.instances?.legends;return[{text:()=>(t._hidden?"Show series":"Hide series").translate(),click:()=>e()?.toggleEntry(t)},{text:"Isolate series".translate(),title:"Hide every other series".translate(),click:()=>e()?.isolateEntry(t)}]}function Fh(o){const t="Labels".translate(),e=()=>Qt(o.plotterParent.layer.configuration,["bars","labels"]),s=()=>re(e()),n=()=>Qt(o.plotterParent.layer.configuration,["bars","endLabels"]),i=()=>(o.plotterParent.__instance__?.plot?.getCurrentTraces?.()||[]).filter(d=>d?.type==="bars"&&d.stacked&&!d.overlay),r=()=>(o.plotterParent.__instance__?.plot?.getCurrentTraces?.()||[]).some(d=>d?.type==="mekko100"&&d.x?.stack),a=()=>i().length>0||r(),l=()=>i().some(fn),c=()=>e().display===!0||l()&&s()!=="never",h=[{text:"Position".translate(),items:$t(Ol,()=>e().position||"auto",d=>{e().position=d,o.refresh()})},{text:"Orientation".translate(),items:$t(Dl,()=>e().orientation||"horizontal",d=>{e().orientation=d,o.refresh()})},{text:"Color".translate(),title:"Labels outside the bars; inside, the ink follows the bar color".translate(),colorSwatch:{value:()=>e().color||n0,onChange:d=>{e().color=d,o.refresh()}}},...Zr(e,o.refresh,11)],u=()=>n().display===!0;return[{text:"Value labels".translate(),items:[{text:"Display".translate(),items:$t(pn,()=>us(e()),d=>{Pl(e(),d),o.refresh()})},{text:"Totals".translate(),if:l,items:$t(pn,s,d=>{e().totals=d,o.refresh()})},...Hn(h,c).map(d=>({...d,groupTail:!0}))]},{text:"End labels".translate(),if:a,title:"Series names past the last stack".translate(),items:[{text:"Display".translate(),switchInput:{checked:u,onChange:d=>{n().display=d===!0,o.refresh()}}},...Hn(Zr(n,o.refresh,11),u)]}].map(d=>({...d,group:t}))}function Hh(o){const t="End labels".translate(),e=()=>Qt(o.plotterParent.layer.configuration,["lines","endLabels"]),s=()=>e().display===!0,n=[{text:"Value".translate(),title:"Last value next to the series name".translate(),switchInput:{checked:()=>e().value!==!1,onChange:i=>{e().value=i===!0,o.refresh()}}},...Zr(e,o.refresh,11)];return[{text:"Display".translate(),title:"Series name at the end of each line, in place of the legend".translate(),switchInput:{checked:s,onChange:i=>{e().display=i===!0,o.refresh()}}},...Hn(n,s)].map(i=>({...i,group:t}))}function l0(o){const t=()=>Qt(o.plotterParent.layer.configuration,["lines","endLabels"]);return[{group:"Labels".translate(),text:"Display".translate(),title:"Name of each point in the chart".translate(),switchInput:{checked:()=>t().display===!0,onChange:e=>{t().display=e===!0,o.refresh()}}}]}function c0(o){const t=()=>o.plotterParent.layer.configuration;return[{group:"Legend".translate(),text:"Display".translate(),switchInput:{checked:()=>t().legends?.display===!0,onChange:e=>{Qt(t(),["legends"]).display=e===!0,o.refresh()}}},Bh(o)]}function Bh(o){const t=()=>o.plotterParent.layer.configuration;return{group:"Grid".translate(),text:"Display".translate(),title:"Light lines across the chart at the value axis ticks".translate(),switchInput:{checked:()=>t().axis?.grid?.display===!0,onChange:e=>{Qt(t(),["axis","grid"]).display=e===!0,o.refresh()}}}}const Dt=16,h0=".plotter-table",u0="tr.plotter-table-row",d0=".plotter-table-foot, tfoot";function Ss({group:o,text:t,icon:e,isChecked:s,onCheckedChange:n}){return{group:o,text:typeof t=="function"?t:()=>String(t).translate(),icon:e,switchInput:{checked:s,onChange:n}}}function p0(){return new Set([_t.traceAction(),_t.plotAction(),_t.layerAction("Waterfall"),_t.layerAction("Tree")])}function qr(o){return!!o?.target?.closest?.(h0)}function f0(o){return o?.target?.closest?.("[data-column]")?.getAttribute?.("data-column")||null}function _0(o){const t={type:"table",columnKey:null,kpi:null};if(!qr(o))return t;const e=o?.target;if(!(e instanceof Element))return t;const s=e.closest(u0),n=e.closest(d0),i=e.closest("td[data-kpi]");if(i instanceof HTMLElement&&s)return{type:n?"footer":"cell",columnKey:i.getAttribute("data-column"),kpi:i.getAttribute("data-kpi")};const r=e.closest("[data-column]"),a=r?.getAttribute?.("data-column")||null;return r?.closest(".plotter-table-head")&&a?{type:"column",columnKey:a,kpi:null}:r&&n&&a?{type:"footer",columnKey:a,kpi:null}:r&&s&&a?{type:"cell",columnKey:a,kpi:null}:s?{type:"row",columnKey:a,kpi:null}:t}function g0(o){const t=_t.row(),e=_t.calendar();return(o||[]).filter(s=>!p0().has(s?.group)).map(s=>s?.group===e?s:{...s,group:t})}function m0(o,t){if(!t)return null;(!o.header||typeof o.header!="object")&&(o.header={});const e=Lt();if(t===st){const n=o.header[t]||{};return o.header[t]={...dl(o),...n},o.header[t]}const s=o.header[t]||{};return o.header[t]={...e,...s,gauge:gt({...e.gauge,...s.gauge||{}}),indicator:At({...e.indicator,...s.indicator||{}}),sparkline:mt({...e.sparkline,...s.sparkline||{}})},o.header[t]}function y0(o,t){if(!t||t===st)return null;(!o.footer||typeof o.footer!="object")&&(o.footer={});const e=Lt(),s=o.footer[t]||{};return o.footer[t]={...e,...s,gauge:gt({...e.gauge,...s.gauge||{}}),indicator:At({...e.indicator,...s.indicator||{}}),sparkline:mt({...e.sparkline,...s.sparkline||{}})},o.footer[t]}function b0(o,t){return Fo.map(e=>({text:()=>String(e.text).translate(),classList:()=>(o.align??null)===e.value?["selected"]:[],click:()=>{o.align=e.value,t()}}))}function A0(o,t){return o.sparkline=mt(o.sparkline),[{text:"Off".translate(),classList:()=>o.sparkline.enabled?[]:["selected"],click:()=>{o.sparkline.enabled=!1,o.sparkline=mt(o.sparkline),t()}},{text:"Type".translate(),items:Ei.map(e=>({text:()=>e.charAt(0).toUpperCase()+e.slice(1),classList:()=>o.sparkline.enabled&&o.sparkline.type===e?["selected"]:[],click:()=>{o.sparkline.enabled=!0,o.sparkline.type=e,o.sparkline=mt(o.sparkline),t()}}))},{text:"Position".translate(),items:xi.map(e=>({text:()=>e.charAt(0).toUpperCase()+e.slice(1),classList:()=>o.sparkline.enabled&&o.sparkline.position===e?["selected"]:[],click:()=>{o.sparkline.enabled=!0,o.sparkline.position=e,o.sparkline=mt(o.sparkline),t()}}))},{text:"Colorize".translate(),switchInput:{checked:()=>o.sparkline.colorize,onChange:e=>{o.sparkline.colorize=e,t()}}}]}function L0(o,t){return o.gauge=gt(o.gauge),[{text:"Off".translate(),classList:()=>o.gauge.enabled?[]:["selected"],click:()=>{o.gauge.enabled=!1,o.gauge=gt(o.gauge),t()}},{text:"Type".translate(),items:Ti.map(e=>({text:()=>e.charAt(0).toUpperCase()+e.slice(1),classList:()=>o.gauge.enabled&&o.gauge.type===e?["selected"]:[],click:()=>{o.gauge.enabled=!0,o.gauge.type=e,o.gauge=gt(o.gauge),t()}}))},...o.gauge.enabled&&o.gauge.type==="progress"?[{text:"Position".translate(),items:Vo().map(e=>({text:()=>e.charAt(0).toUpperCase()+e.slice(1),classList:()=>o.gauge.position===e?["selected"]:[],click:()=>{o.gauge.position=e,o.gauge=gt(o.gauge),t()}}))}]:[],{text:"Colorize".translate(),switchInput:{checked:()=>o.gauge.colorize,onChange:e=>{o.gauge.colorize=e,t()}}}]}function T0(o,t){return o.indicator=At(o.indicator),[{text:"Off".translate(),classList:()=>o.indicator.enabled?[]:["selected"],click:()=>{o.indicator.enabled=!1,o.indicator=At(o.indicator),t()}},{text:"Type".translate(),items:Si.map(e=>({text:()=>e.charAt(0).toUpperCase()+e.slice(1),classList:()=>o.indicator.enabled&&o.indicator.type===e?["selected"]:[],click:()=>{o.indicator.enabled=!0,o.indicator.type=e,o.indicator=At(o.indicator),t()}}))},{text:"Position".translate(),items:vi.map(e=>({text:()=>e.charAt(0).toUpperCase()+e.slice(1),classList:()=>o.indicator.enabled&&o.indicator.position===e?["selected"]:[],click:()=>{o.indicator.enabled=!0,o.indicator.position=e,o.indicator=At(o.indicator),t()}}))},{text:"Colorize".translate(),switchInput:{checked:()=>o.indicator.colorize,onChange:e=>{o.indicator.colorize=e,t()}}}]}function E0({tableGroup:o,tableConfig:t,display:e,data:s,refreshTable:n}){const i=wi(e),r=[{group:o,text:"Preset".translate(),icon:()=>D.get("settings-svg",{size:Dt}),items:Xs.map(l=>({text:()=>l.label.translate(),icon:()=>D.get(l.icon,{size:Dt}),classList:()=>i===l.id?["selected"]:[],click:()=>{Wo(t,l.id),n()}}))},Ss({group:o,text:"Striped rows",icon:()=>D.get("table-striped-svg",{size:Dt}),isChecked:()=>e.stripe?.enabled,onCheckedChange:l=>{e.stripe.enabled=l,n()}}),...be(s,t)?[Ss({group:o,text:"Flat hierarchy",icon:()=>D.get("table-compact-svg",{size:Dt}),isChecked:()=>t.rows?.flat===!0,onCheckedChange:l=>{(!t.rows||typeof t.rows!="object")&&(t.rows={}),t.rows.flat=l,n()}})]:[],{group:o,text:"Borders".translate(),icon:()=>D.get("table-compact-svg",{size:Dt}),items:[{text:"Table border".translate(),switchInput:{checked:()=>e.borders?.table?.enabled,onChange:l=>{e.borders.table.enabled=l,n()}}},{text:"Column borders".translate(),switchInput:{checked:()=>e.borders?.columns?.enabled,onChange:l=>{e.borders.columns.enabled=l,n()}}},{text:"Row borders".translate(),switchInput:{checked:()=>e.borders?.rows?.enabled,onChange:l=>{e.borders.rows.enabled=l,n()}}}]}],a=el(s,t);return a.length&&r.push({group:o,text:"Add column".translate(),action:!0,icon:()=>D.get("plus-svg",{size:Dt}),items:a.map(l=>({text:()=>ye(t,l),click:()=>{il(t,l),n()}}))}),r}function x0({columnGroup:o,columnConfig:t,tableConfig:e,refreshTable:s,includeColumnLayout:n=!0}){if(!t)return[];const i=[{group:o,text:"Text alignment".translate(),icon:()=>D.get("font-size-svg",{size:Dt}),items:b0(t,s)},{group:o,text:"Gauge".translate(),icon:()=>D.get("gauge-horizontal-svg",{size:Dt}),items:L0(t,s)},{group:o,text:"Indicator".translate(),icon:()=>D.get("arrow-up-svg",{size:Dt}),items:T0(t,s)},{group:o,text:"Sparkline".translate(),icon:()=>D.get("lines-svg",{size:Dt}),items:A0(t,s)},Ss({group:o,text:"Colorized values",icon:()=>D.get("paint-svg",{size:Dt}),isChecked:()=>t.colorized,onCheckedChange:r=>{t.colorized=r,s()}})];return n&&i.push(Ss({group:o,text:()=>t.pinned?"Unpin column".translate():"Pin column".translate(),icon:()=>D.get("lock-svg",{size:Dt}),isChecked:()=>t.pinned,onCheckedChange:r=>{t.pinned=r,s()}}),Ss({group:o,text:()=>t.frozen?"Unstick column".translate():"Sticky column".translate(),isChecked:()=>t.frozen,onCheckedChange:r=>{t.frozen=r,r&&rl(e),s()}})),i}function S0({plotterParent:o,event:t,refreshTable:e}){if(!qr(t))return[];const s=o?.layer?.configuration?.table;if(!s||s.enabled===!1)return[];!s.display||typeof s.display!="object"?s.display=Wi(null):Wi(s.display);const n=s.display,i=_t.table(),r=_t.column(),a=_t.footer(),l=_0(t),c=l.type==="footer",h=l.columnKey||f0(t),u=h?c?y0(s,h):m0(s,h):null,d=o?.__parameters__?.data||[],p=E0({tableGroup:i,tableConfig:s,display:n,data:d,refreshTable:e}),f=c?a:r,_=l.type==="column"||l.type==="cell"||l.type==="footer"?x0({columnGroup:f,columnConfig:u,tableConfig:s,refreshTable:e,includeColumnLayout:!c}):[];return[...p,..._]}const v0=Object.freeze([{value:"right",label:"Right"},{value:"bottom",label:"Bottom"},{value:"left",label:"Left"},{value:"top",label:"Top"}]),C0=Object.freeze([{value:.1,label:"Small"},{value:.15,label:"Medium"},{value:.2,label:"Large"}]),w0="order: 9",R0="plotter-context-menu",k0=["shift","R"],zh=16,N0=["bars","waterfall","lines","scatter","areas"],Jr=8,Vh=20,ta=8,$h=32,M0="metric",Wh=1,Gh=20,I0=4,O0=0,P0=8,jh=0,Uh=100,D0=[{label:"Straight",value:"straight"},{label:"Dashed",value:"dashed"},{label:"Dotted",value:"dotted"}],F0=[{label:"None",value:"none"},{label:"Curved",value:"curved"},{label:"Squared",value:"squared"},{label:"Straight",value:"straight"}],H0=0,B0=8,Yh=0,Kh=100,ea=0,sa=100,z0=.33,V0=1,$0=[{label:"Auto",value:null},{label:"On",value:!0},{label:"Off",value:!1}],W0=[{label:"Auto",value:null},{label:"0",value:0},{label:"1",value:1},{label:"2",value:2}],G0={"Center rotated":"center-rotated","Top left overlay":"top-left-overlay"},na={Top:"top",Bottom:"bottom",Center:"center","Top of trace":"top-trace","Bottom of trace":"bottom-trace",Value:"value"};class j0 extends ht{#t=!1;#e=null;#s=null;#n=()=>{};#r=null;init(){return this.__node__=x.getNode("div",this.__parameters__.id,[R0],this.__parameters__.parent.__node__,{style:w0}),this.#At(),this.__node__}unmount(){this.#vt(),this.#r?.disconnect(),this.#n()}#i(t){return D.get(t,{size:zh})}#a(t){const e=t?.traces;return e!=null&&!Array.isArray(e)?t:t?.plot?.layer??this.__parameters__.parent?.layer??null}#l(t){const e=this.#a(t),s=e?.traces;if(!s||Array.isArray(s))return[];const n=this.__parameters__.parent;return Bu(e).map(i=>{const r=i===$?{label:e.configuration?.table?.label||"Table",icon:D.get("table-svg",{size:zh})}:s[i];return{text:()=>String(r?.label??i).translate(),icon:()=>r?.icon??this.#i("cog-svg"),shortcut:r?.shortcut,click:()=>{this.#m(n),n?.__instance__?.plot?.replaceFocusedPinnedView?.(i)}}})}#h(t){return t?.layer?.configuration?.axis??null}#p(t){const e=t?.layer?.configuration;return e?(e.axis||(e.axis={}),e.axis):null}#y(t){if(Gt.includes(t?.axisRole))return t.axisRole;const e=t?.scaleName;if(Gt.includes(e))return e;if(typeof e!="string"||!e)return null;const s=[...Gt].sort((n,i)=>i.length-n.length);for(let n=0;n<s.length;n++){const i=s[n];if(!e.startsWith(i))continue;const r=e.slice(i.length);if(r!==""&&/^\d+$/.test(r))return i}return null}#L(t,e={}){const s=t?.layer?.configuration,n=this.#p(t);if(!n)return[];const i=e.mirrorExistingRoleClones===!0,r=this.#s,a=Gt.includes(r);if(a&&(sr(s,r),!i))return[n[r]];const l=a?[n,n[r]]:[n];return Gt.forEach(c=>{if(a&&c===r)return;const h=n[c];h&&typeof h=="object"&&!Array.isArray(h)&&h.ticks&&typeof h.ticks=="object"&&!Array.isArray(h.ticks)&&(sr(s,c),l.push(n[c]))}),l}#T(t,e){let s=t;for(let n=0;n<e.length;n++){const i=e[n];if(s==null||!Object.prototype.hasOwnProperty.call(s,i))return{found:!1,value:void 0};if(n===e.length-1)return{found:!0,value:s[i]};s=s[i]}return{found:!1,value:void 0}}#u(t,e,s){if(!t||!e.length)return;let n=t;for(let l=0;l<e.length-1;l++){const c=e[l],h=n[c];(h==null||typeof h!="object"||Array.isArray(h))&&(n[c]={}),n=n[c]}const i=e[e.length-1],r=n[i];if(r&&typeof r=="object"&&!Array.isArray(r)&&s&&typeof s=="object"&&!Array.isArray(s)){Object.assign(r,s);return}n[i]=s}#c(t){return t?.getDefaultConfiguration?.()?.axis??{}}#m(t){t?.markSettingsPersistDirty?.()}#o(t){this.#m(t),t?.update?.()}#A(t,{text:e,title:s,iconKey:n,path:i,defaultValue:r=!0}){return{text:e.translate(),title:s?.translate?.()??s,icon:()=>this.#i(n),switchInput:{checked:()=>this.#C(t,i,r),onChange:a=>{this.#f(t,i,a)}}}}#E(t,{text:e,title:s,iconKey:n,key:i,defaultValue:r=!1}){return{text:e.translate(),title:s?.translate?.()??s,icon:()=>this.#i(n),switchInput:{checked:()=>this.#_(t,i,r),onChange:a=>{const l=this.#p(t);l&&(l[i]=a,this.#o(t))}}}}#d(t,e){const s=t?.layer?.configuration,n=t?.__instance__?.plot,i=t?.__instance__?.shortcut;if(!(!s||s.reverse===e)){if(s.reverse=e,this.#m(t),typeof i?.applyReverseAxisFromSettings=="function"){i.applyReverseAxisFromSettings(e);return}n&&(n.reverseAxis(),n._update(1)),i?.syncReverseAxisSelection?.(e)}}#_(t,e,s=!1){const n=this.#h(t);return!n||!Object.prototype.hasOwnProperty.call(n,e)?s:n[e]===!0}#C(t,e,s=!0){const n=this.#g(t,e);return n==null?s!==!1:n!==!1}#S(t,e,s=!1){const n=this.#p(t);n&&(n[e]=!this.#_(t,e,s),this.#o(t))}#g(t,e){const s=this.#h(t),n=this.#s;if(Gt.includes(n)&&s?.[n]){const a=this.#T(s[n],e);if(a.found)return a.value}const i=this.#T(s,e);if(i.found)return i.value;let r=this.#c(t);return e.forEach(a=>{r=r?.[a]}),r}#f(t,e,s,n={}){this.#v(t,e,s,n),this.#x(e)&&t?.__instance__?.plot?._cleanZoomData?.(),this.#o(t)}#x(t){return!Array.isArray(t)||t.length<3?!1:t[0]==="ticks"&&t[1]==="baseline"&&t[2]==="position"}#v(t,e,s,n={}){if(!e.length)return;this.#L(t,n).forEach(r=>{this.#u(r,e,s)})}#D(t,e,s=!0){const n=!this.#C(t,e,s);this.#f(t,e,n)}#B(t,e,s){return{text:"Opacity".translate(),numericInput:{min:ea,max:sa,value:()=>{const n=Number(this.#g(t,e)),i=Number.isFinite(n)?n:s;return Math.min(sa,Math.max(ea,Math.round(i*100)))},onChange:n=>{const i=Math.min(sa,Math.max(ea,n));this.#f(t,e,i/100)}}}}#$(t,e,s){return e.map(({label:n,value:i})=>({text:n.translate(),classList:()=>Number(this.#g(t,s))===i?["selected"]:[],click:()=>this.#f(t,s,i)}))}#F(t){const e=Object.values(t?.__instance__?.plot?.instances||{});let s=1/0,n=-1/0;for(let i=0;i<e.length;i+=1){const r=e[i]?.trace?.scales?.y?.getScale?.()||e[i]?.trace?.scales?.y;if(!r||r.dimension)continue;let a,l;if(typeof r.getAutoContinuousDomain=="function"){const c=r.getAutoContinuousDomain({applyPadding:!1,includeZero:!1});c&&Number.isFinite(c.min)&&Number.isFinite(c.max)&&(a=c.min,l=c.max)}if(!Number.isFinite(a)||!Number.isFinite(l)){if(!Array.isArray(r.domain)||r.domain.length<2)continue;a=Math.min(...r.domain.map(Number).filter(Number.isFinite)),l=Math.max(...r.domain.map(Number).filter(Number.isFinite))}!Number.isFinite(a)||!Number.isFinite(l)||(s=Math.min(s,a),n=Math.max(n,l))}return!Number.isFinite(s)||!Number.isFinite(n)?null:{min:s,max:n}}#w(t,e,{includeRowIcons:s=!0}={}){const n=[...e,"rendering"],i=[...e,"opacity"],r=[...e,"size"],a=[...e,"color"],l=(c,h)=>s?{...c,icon:()=>this.#i(h)}:c;return[l({text:"Rendering".translate(),items:D0.map(({label:c,value:h,iconKey:u})=>({text:c.translate(),icon:()=>this.#i(u),classList:()=>this.#g(t,n)===h||!_n.includes(this.#g(t,n))&&h==="straight"?["selected"]:[],click:()=>this.#f(t,n,h)}))},"connector-svg"),{text:"Opacity".translate(),numericInput:{min:jh,max:Uh,value:()=>{const c=Number(this.#g(t,i)),h=Number.isFinite(c)?c:.1;return Math.min(Uh,Math.max(jh,Math.round(h*100)))},onChange:c=>{const h=Number(c);Number.isFinite(h)&&this.#f(t,i,h/100)}}},l({text:"Size".translate(),numericInput:{min:O0,max:P0,value:()=>{const c=Number(this.#g(t,r));return Number.isFinite(c)?c:1},onChange:c=>{this.#f(t,r,c)}}},"lines-svg"),{text:"Color".translate(),colorSwatch:{value:()=>{const c=this.#g(t,a);return typeof c=="string"&&c.length?c:Ne},onChange:c=>{this.#f(t,a,c)}}}]}#G(t){if(!t?.layer?.configuration||typeof t.layer.configuration!="object")return[];const e="Baseline".translate(),s=["ticks","baseline"],n=[...s,"position"],i=this.#F(t),r=!i||Ql(i.min,i.max),a=[];r&&a.push({text:"Zero".translate(),classList:()=>this.#g(t,n)!=="min"?["selected"]:[],click:()=>this.#f(t,n,"zero")}),a.push({text:"Min".translate(),classList:()=>this.#g(t,n)==="min"?["selected"]:[],click:()=>this.#f(t,n,"min")});const l=h=>h.map(u=>({...u,group:e})),c=()=>this.#C(t,[...s,"display"],!0);return[{group:e,text:"Display".translate(),title:"Measure axis baseline line".translate(),icon:()=>this.#i("axis-svg"),switchInput:{checked:()=>c(),onChange:h=>{this.#f(t,[...s,"display"],h)}}},...l(this.#W([{text:"Position".translate(),items:a},...this.#w(t,s,{includeRowIcons:!1})],c))]}#N(t){if(!t?.__instance__?.plot?.hasAxisDateHoles?.())return null;const s=["ticks","baseline","cut"];return{text:"Cut".translate(),title:"Allow date axis to be cut on missing data".translate(),icon:()=>this.#i("axis-cut-svg"),switchInput:{checked:()=>this.#C(t,[...s,"display"],!0),onChange:n=>{this.#f(t,[...s,"display"],n)}},items:this.#w(t,s)}}#R(t){const e=this.#g(t,["title","display"]),s=this.#k(t);return s?v.isTitleShownForAxis(e,s):e!=="none"}#M(t,e){const s=e?.target?.closest?.("g.plotter-axis")?.getAttribute?.("data-id");if(!s)return null;const n=t?.__instance__?.plot?.getCurrentTraces?.()||[];for(let i=0;i<n.length;i+=1){const r=n[i]?.scales||{},a=Object.values(r).find(l=>l?.name===s);if(a)return typeof a.getScale=="function"?a.getScale():a}return null}#k(t){const e=this.#s;if(!Gt.includes(e))return null;const s=t?.__instance__?.plot?.getCurrentTraces?.()||[];for(let n=0;n<s.length;n+=1){const i=s[n]?.scales?.[e];if(i)return typeof i.getScale=="function"?i.getScale():i}return null}#Z(t,e){if(this.#k(t)){this.#f(t,["title","display"],e?"both":"none");return}if(!e){this.#f(t,["title","display"],"none");return}const s=this.#g(t,["title","display"]);(s==="none"||s==null)&&this.#f(t,["title","display"],M0)}#V(t){const e="Title".translate(),s=n=>n.map(i=>({...i,group:e}));return[{group:e,text:"Display".translate(),icon:()=>this.#i("tag-svg"),switchInput:{checked:()=>this.#R(t),onChange:n=>{this.#Z(t,n===!0)}}},...s(this.#W(this.#H(t),()=>this.#R(t)))]}#H(t){const e=["title","size"],s=["title","color"],n=["title","weight"],i=["title","family"];return[{text:"Size".translate(),numericInput:{min:ta,max:$h,value:()=>{const r=Number(this.#g(t,e));return Number.isFinite(r)?Math.min($h,Math.max(ta,r)):ta},onChange:r=>{this.#f(t,e,r)}}},this.#P(t,s),{text:"Weight".translate(),items:this.#$(t,is,n)},{text:"Font".translate(),items:Ct.map(({label:r,value:a})=>({text:r.translate(),style:Me(a),classList:()=>this.#g(t,i)===a?["selected"]:[],click:()=>this.#f(t,i,a)}))},{text:"Position".translate(),items:Object.entries(G0).map(([r,a])=>({text:r.translate(),classList:()=>this.#g(t,["title","verticalPosition"])===a?["selected"]:[],click:()=>this.#f(t,["title","verticalPosition"],a)}))}]}#I(t){const e=["ticks","texts","size"],s=["ticks","texts","color"],n=["ticks","texts","opacity"],i=["ticks","texts","weight"],r=["ticks","texts","family"];return[{text:"Size".translate(),numericInput:{min:Jr,max:Vh,value:()=>{const a=Number(this.#g(t,e));return Number.isFinite(a)?Math.min(Vh,Math.max(Jr,a)):Jr},onChange:a=>{this.#f(t,e,a)}}},this.#P(t,s),this.#B(t,n,V0),{text:"Weight".translate(),items:this.#$(t,is,i)},{text:"Font".translate(),items:Ct.map(({label:a,value:l})=>({text:a.translate(),style:Me(l),classList:()=>this.#g(t,r)===l?["selected"]:[],click:()=>this.#f(t,r,l)}))}]}#O(t){const e=["ticks","lines","size"],s=["ticks","lines","color"];return[{text:"Size".translate(),numericInput:{min:Wh,max:Gh,value:()=>{const n=Number(this.#g(t,e));return Number.isFinite(n)?Math.min(Gh,Math.max(Wh,n)):I0},onChange:n=>{this.#f(t,e,n)}}},this.#P(t,s),this.#B(t,["ticks","lines","opacity"],z0)]}#j(t){return yn(this.#g(t,["ticks","texts","format"]))}#lt(t){const e=["ticks","texts","format","compact"],s=["ticks","texts","format","decimals"],n=["ticks","texts","format","showUnit"],i={mirrorExistingRoleClones:!0},r=ds.map(({id:a,label:l,format:c})=>({text:l.translate(),classList:()=>Jl(this.#j(t))===a?["selected"]:[],click:()=>this.#f(t,["ticks","texts","format"],{...c},i)}));return{text:"Format".translate(),title:"Number format of measure axis tick labels".translate(),icon:()=>this.#i("ratio-svg"),items:[...r,{text:"Compact".translate(),items:$0.map(({label:a,value:l})=>({text:a.translate(),classList:()=>this.#j(t).compact===l?["selected"]:[],click:()=>this.#f(t,e,l,i)}))},{text:"Decimals".translate(),items:W0.map(({label:a,value:l})=>({text:a.translate(),classList:()=>this.#j(t).decimals===l?["selected"]:[],click:()=>this.#f(t,s,l,i)}))},{text:"Show unit".translate(),switchInput:{checked:()=>this.#j(t).showUnit,onChange:a=>{this.#f(t,n,a===!0,i)}}}]}}#J(t,{isMeasureAxis:e=!0}={}){const s=["ticks","texts","display"],n=["ticks","lines","display"],i="Texts".translate(),r="Markers".translate(),a=this.#I(t);e?a.push(this.#lt(t)):a.push(this.#tt(t));const l=(u,d)=>u.map(p=>({...p,group:d,settingsFocus:ns})),c=()=>this.#C(t,s,!0),h=()=>this.#C(t,n,!0);return[{group:i,text:"Display".translate(),icon:()=>this.#i("font-size-svg"),settingsFocus:ns,switchInput:{checked:()=>c(),onChange:u=>{this.#f(t,s,u)}}},...l(this.#W(a,c),i),{group:r,text:"Display".translate(),settingsFocus:ns,switchInput:{checked:()=>h(),onChange:u=>{this.#f(t,n,u)}}},...l(this.#W(this.#O(t),h),r)]}#tt(t){const e=["ticks","texts","orientation"],s=this.#k(t);return!!s&&["top","bottom"].includes(s.position)&&!s.hierarchy?{text:"Orientation".translate(),items:Yl.map(({text:i,value:r})=>({text:i.translate(),classList:()=>(this.#g(t,e)||"auto")===r?["selected"]:[],click:()=>this.#f(t,e,r)}))}:{text:"Orientation".translate(),title:"Only category labels below or above the chart can be turned".translate(),classList:["disabled"],items:[]}}#W(t,e){return!Array.isArray(t)||typeof e!="function"?t||[]:t.map(s=>{const n=s?.if;return{...s,if:i=>e()?typeof n=="function"?n(i)!==!1:!0:!1}})}#it(t){const e=t?.__instance__?.plot,s=typeof e?.getCurrentTraces=="function"?e.getCurrentTraces():null,n=[],i=a=>{if(Array.isArray(a))for(let l=0;l<a.length;l+=1)n.push(a[l])};i(s);const r=t?.layer?.traces;if(Array.isArray(r))i(r);else if(r&&typeof r=="object"){const a=Object.keys(r);for(let l=0;l<a.length;l+=1)i(r[a[l]]?.traces)}return n}#st(t){const e=this.#it(t);for(let s=0;s<e.length;s+=1){const n=e[s];if(n?.x?.hierarchy===!0||n?.y?.hierarchy===!0||n?.type==="waterfall"||n?.type==="tree")return!0}return!1}#Q(t){if(!this.#st(t))return[];ze(t.layer.configuration);const e="Hierarchy lines".translate(),s=["hierarchical","treeLines","render"],n=["hierarchical","treeLines","opacity"],i=["hierarchical","treeLines","size"],r=["hierarchical","treeLines","color"],a=F0.map(({label:c,value:h})=>({text:c.translate(),classList:()=>this.#g(t,s)===h?["selected"]:[],click:()=>this.#f(t,s,h)}));return(c=>c.map(h=>({...h,group:e})))([{text:"Render mode".translate(),icon:()=>this.#i("connector-svg"),items:a},{text:"Opacity".translate(),numericInput:{min:Yh,max:Kh,value:()=>{const c=Number(this.#g(t,n)),h=Number.isFinite(c)?c:.35;return Math.min(Kh,Math.max(Yh,Math.round(h*100)))},onChange:c=>{const h=Number(c);Number.isFinite(h)&&this.#f(t,n,h/100)}}},{text:"Size".translate(),icon:()=>this.#i("lines-svg"),numericInput:{min:H0,max:B0,value:()=>{const c=Number(this.#g(t,i));return Number.isFinite(c)?c:1},onChange:c=>{this.#f(t,i,c)}}},this.#P(t,r)])}#P(t,e){return{text:"Color".translate(),colorSwatch:{value:()=>{const s=this.#g(t,e);return typeof s=="string"&&s.length?s:Ne},onChange:s=>{this.#f(t,e,s)}}}}#et(t){return{text:"Reverse axis".translate(),title:"Toggle reverse axis mode for current trace".translate(),icon:()=>this.#i("reverse-axis-svg"),shortcut:k0,switchInput:{checked:()=>t?.layer?.configuration?.reverse===!0,onChange:e=>{this.#d(t,e)}}}}#rt(t,e,s=[],n=null){const i=this.__parameters__.parent,r=this.#V(i),a=this.#et(i),l=n||this.#k(i),c=l?!l.dimension:e?.[$a]!==!1,h=c?"measure":"dimension",u=s.filter(f=>f.hitTarget===K.AXIS&&(f.axis==null||f.axis===h)&&(f.axisValue==null||[n?.value,n?.label].includes(f.axisValue)));if(t===K.AXIS_TITLE)return[...u,...r,a];const d=[...u,...this.#J(i,{isMeasureAxis:c}),...r,...this.#G(i),...this.#Q(i)];c&&d.push(Bh(this.#ut())),d.push(a);const p=this.#N(i);return p&&d.push({text:"More properties".translate(),icon:()=>this.#i("settings-svg"),items:[p]}),d}#ut(){const t=this.__parameters__.parent;return{plotterParent:t,refresh:()=>this.#o(t)}}#z(t,e){const s=_t.plotAction(),n=this.__parameters__.parent,i=[...this.#K(t),{...this.#et(n),group:s,groupTail:!0}],r=e===K.BACKGROUND?[]:this.#ot(t);return r.length&&i.push({group:s,text:"Annotate".translate(),icon:()=>this.#i("annotate-svg"),items:r}),i}#U(t,e,s,n){const i=this.#ut(),r=[K.BAR,K.LINE,K.POINT,K.LINE_END_LABEL].includes(t)?Qr({hit:t,data:e,layer:s}):null,a=l=>{const c=Dh(r);return[...Ph(i,r,{mark:l}),...r?n.filter(h=>h.hitTarget===t).map(h=>({...h,group:c})):[]]};switch(t){case K.BAR:return[...a(s?.trace?.type==="bars"?"bar":null),...Fh(i)];case K.POINT:return[...a(null),...l0(i)];case K.BAR_LABEL:return Fh(i);case K.LINE:return[...a("line"),...s?.trace?.type==="lines"?this.#at(i):[]];case K.LINE_END_LABEL:return[...Hh(i),...a("line")];case K.BACKGROUND:return c0(i);default:return[]}}#at(t){return this.__parameters__.parent?.layer?.configuration?.reverse===!0?[]:Hh(t)}#ct(t,e){if(!["bars","lines","areas","scatter"].includes(t?.trace?.type))return!0;const s=G.resolveTraceScales(t.trace)?.dimensionScale;if(!s)return!0;const i=(e?.__parameters__?.data||[]).map(r=>r?.[s.value]);return G.isCagrEligible(i,!!s._isDate)}#ot(t){const e=this.__parameters__.parent,s=e?.__instance__?.plot?.instances?.differences,n=!!s&&N0.includes(t?.trace?.type),i=[];if(n){const a=e.layer?.configuration?.annotations?.differences||[];i.push({text:"Difference arrow".translate(),title:"Draw a difference arrow from this element: click a second element to set the target (non-adjacent elements connect with a total arrow over the top; Escape to cancel)".translate(),click:(l,c)=>{s.startPicking(c,t)}}),this.#ct(t,e)&&i.push({text:"CAGR arrow".translate(),title:"Draw a compound growth rate arrow from this element: click a second element to set the target (Escape to cancel)".translate(),click:(l,c)=>{s.startPicking(c,t,{kind:"cagr"})}}),a.length&&i.push({text:"Remove all differences".translate(),icon:()=>this.#i("cross-svg"),danger:!0,separatorBefore:!0,groupTail:!0,title:"Delete every difference arrow of this plot".translate(),click:()=>{a.splice(0,a.length),this.#m(e),s.update()}})}const r=e?.__instance__?.plot?.instances?.valueLines;if(r?.supports(t?.trace)){const a=!!(t.trace.y?.relative||t.trace.x?.relative);i.push({text:"Value line".translate(),title:"Draw a dotted reference line at the value of this element".translate(),click:(l,c)=>r.add(t.trace,"value",c)}),a||i.push({text:"Average line".translate(),title:"Draw a dotted reference line at the average of this series (stack totals when stacked)".translate(),click:(l,c)=>r.add(t.trace,"average",c)}),r.list().length&&i.push({text:"Remove all value lines".translate(),icon:()=>this.#i("cross-svg"),danger:!0,separatorBefore:!0,groupTail:!0,title:"Delete every value line of this plot".translate(),click:()=>r.clear()})}return e?.layer?.configuration?.beta&&i.push({text:"Annotations".translate(),items:[{text:"Position".translate(),items:Object.keys(na).map(a=>({text:a.translate(),title:"Move the annotation of the selected trace to {position} of the plot".translate({position:a.translate()}),click:()=>{let{trace:l}=t;l.annotations?l.annotations.position=na[a]:l.annotations={position:na[a],rotation:0,font:e.getDefaultConfiguration().annotations.font},this.#m(e),e.update()}}))},{text:"Rotate".translate(),items:[{text:"None".translate(),click:()=>this.#Y(t,e,0)},{text:"Forwards".translate(),click:()=>this.#Y(t,e,90)},{text:"Backwards".translate(),click:()=>this.#Y(t,e,-90)}]}]}),i.filter(a=>a.danger).forEach((a,l)=>{a.separatorBefore=l===0}),i}#Y(t,e,s){let{trace:n}=t;const i=e.getDefaultConfiguration();n.annotations?n.annotations.rotation=s:n.annotations={position:i.annotations.position,rotation:s,font:i.annotations.font},this.#m(e),e?.update?.()}#K(t){const e=this.#l(t);return e.length===0?[]:[{group:_t.plotAction(),groupHead:!0,text:"Chart type".translate(),icon:()=>this.#i("bars-svg"),items:e}]}#b(t){this.#m(t),t?.update?.()}#ht(t,e){const s=t?.layer?.configuration;return s?e==="subtitle"?or(s):ar(s):e==="subtitle"?or({}):ar({})}#nt(t,e){const s=this.#ht(t,e),n=e==="subtitle"?"Subtitle".translate():"Title".translate(),i=e==="subtitle"?Ga:Wa,r=()=>s.display!==!1,a=[{text:"Position".translate(),items:[{text:"Top".translate(),classList:()=>s.position==="top"?["selected"]:[],click:()=>{s.position="top",this.#b(t)}},{text:"Bottom".translate(),classList:()=>s.position==="bottom"?["selected"]:[],click:()=>{s.position="bottom",this.#b(t)}}]},{text:"Align".translate(),items:[{text:"Left".translate(),classList:()=>s.align==="left"?["selected"]:[],click:()=>{s.align="left",this.#b(t)}},{text:"Center".translate(),classList:()=>s.align==="center"?["selected"]:[],click:()=>{s.align="center",this.#b(t)}},{text:"Right".translate(),classList:()=>s.align==="right"?["selected"]:[],click:()=>{s.align="right",this.#b(t)}}]},{text:"Size".translate(),numericInput:{min:8,max:48,value:()=>{const c=Number(s.font?.size);return Number.isFinite(c)?c:14},onChange:c=>{s.font||(s.font={}),s.font.size=c,this.#b(t)}}},{text:"Weight".translate(),items:is.map(({label:c,value:h})=>({text:c.translate(),classList:()=>Number(s.font?.weight)===h?["selected"]:[],click:()=>{s.font||(s.font={}),s.font.weight=h,this.#b(t)}}))},{text:"Italic".translate(),switchInput:{checked:()=>s.font?.italic===!0,onChange:c=>{s.font||(s.font={}),s.font.italic=c===!0,this.#b(t)}}},{text:"Font".translate(),items:[{text:"Inherit".translate(),classList:()=>s.font?.family==null||s.font?.family===""?["selected"]:[],click:()=>{s.font||(s.font={}),s.font.family=null,this.#b(t)}},...Ct.map(({label:c,value:h})=>({text:c.translate(),style:Me(h),classList:()=>s.font?.family===h?["selected"]:[],click:()=>{s.font||(s.font={}),s.font.family=h,this.#b(t)}}))]}],l=c=>c.map(h=>({...h,group:n,settingsFocus:i}));return[{group:n,settingsFocus:i,text:"Display".translate(),icon:()=>this.#i("font-size-svg"),switchInput:{checked:()=>r(),onChange:c=>{s.display=c===!0,this.#b(t)}}},...l(this.#W(a,r))]}#q(t,e){const s=t?.layer?.configuration,i=qe(s||{})[e],r=e==="subtitle"?"Subtitle".translate():"Title".translate(),a=e==="subtitle"?Ua:ja,l=()=>i.display!==!1,c=[{text:"Size".translate(),numericInput:{min:8,max:48,value:()=>{const u=Number(i.size);return Number.isFinite(u)?u:ma},onChange:u=>{i.size=u,this.#b(t)}}},{text:"Weight".translate(),items:is.map(({label:u,value:d})=>({text:u.translate(),selected:()=>Number(i.weight)===d,click:()=>{i.weight=d,this.#b(t)}}))},{text:"Font".translate(),items:[{text:"Inherit".translate(),selected:()=>i.family==null||i.family==="",click:()=>{i.family=null,this.#b(t)}},...Ct.map(({label:u,value:d})=>({text:u.translate(),style:Me(d),selected:()=>i.family===d,click:()=>{i.family=d,this.#b(t)}}))]},{text:"Color".translate(),colorSwatch:{value:()=>typeof i.color=="string"&&i.color.length?i.color:Ne,onChange:u=>{i.color=u,this.#b(t)}}}],h=u=>u.map(d=>({...d,group:r,settingsFocus:a}));return[{group:r,settingsFocus:a,text:"Display".translate(),icon:()=>this.#i("font-size-svg"),switchInput:{checked:()=>l(),onChange:u=>{i.display=u===!0,this.#b(t)}}},...h(this.#W(c,l))]}#gt(t,e){const s=t?.layer;if(!s||!e)return[];bn(s);const n=ps(s.traces?.[e]);if(!n)return[];const i=fs(n),r=String(s.traces?.[e]?.label||e),a=()=>ur(s,e);return i.map(({path:l,leaf:c})=>{const h=pc(l).translate(),u=typeof c._icon=="string"&&c._icon.length>0?c._icon:null,d={group:r,settingsFocus:Ya,text:h};if(u&&(d.icon=()=>this.#i(u)),c._type==="boolean")return{...d,switchInput:{checked:()=>An(a(),l)===!0,onChange:p=>{Yt(s,e,l,p===!0),this.#b(t)}}};if(c._type==="int")return{...d,numericInput:{min:c._min,max:c._max,value:()=>{const p=Number(An(a(),l));return Number.isFinite(p)?p:Number(c._value)||0},onChange:p=>{Yt(s,e,l,p),this.#b(t)}}};if(c._type==="select"){const p=Array.isArray(c._items)?c._items:[];return{...d,items:p.map(f=>({text:String(f.name??f.text??f.value).translate(),classList:()=>An(a(),l)===f.value?["selected"]:[],click:()=>{Yt(s,e,l,f.value),this.#b(t)}}))}}return c._type==="color"?{...d,colorSwatch:{value:()=>An(a(),l),onChange:p=>{Yt(s,e,l,p),this.#b(t)}}}:d})}#ft(t,e=null,s=null){const n=_t.plotAction(),i=to(e)?[]:[...this.#K(t)],r=this.__parameters__.parent;li(e)&&i.push(...this.#nt(r,"title")),ci(e)&&i.push(...this.#nt(r,"subtitle")),hi(e)&&i.push(...this.#q(r,"title")),ui(e)&&i.push(...this.#q(r,"subtitle"));const a=Za(s,e),l=Ja(e)||a?[]:this.#ot(t);return l.length&&i.push({group:n,text:"Annotate".translate(),icon:()=>this.#i("annotate-svg"),items:l}),i}#_t(t){this.#m(t),t?.__instance__?.plot?._update?.(0,{mode:"focusFirst",origin:"table-context-menu"})}#dt(t){const e=this.__parameters__.parent;return S0({plotterParent:e,event:t,refreshTable:()=>this.#_t(e)})}#yt(){const t=this.__parameters__.parent;this.#m(t);const e=t?.__instance__?.shortcut;if(typeof e?.toggleReverseAxis=="function"){e.toggleReverseAxis();return}const s=t?.layer?.configuration,n=t?.__instance__?.plot;if(!(!s||!n)){if(s.reverse=!s.reverse,typeof e?.applyReverseAxisFromSettings=="function"){e.applyReverseAxisFromSettings(s.reverse);return}n.reverseAxis(),n._update(1),e?.syncReverseAxisSelection?.(s.reverse)}}#At(){this.#t||(this.#e=t=>this.#Ct(t),document.addEventListener("keydown",this.#e),this.#t=!0)}#vt(){this.#t&&(document.removeEventListener("keydown",this.#e),this.#e=null,this.#t=!1)}#Ct(t){this.#Mt(t)&&(this.#Lt(t.target)||this.#Tt(t)&&(t.preventDefault(),this.#yt()))}#Mt(t){const e=String(t.key||"").toLowerCase();return t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&e==="r"}#Lt(t){if(!(t instanceof Element))return!1;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"?!0:t.closest('[contenteditable="true"]')!=null}#Tt(t){const e=this.__parameters__.parent?.__node__;if(!e?.isConnected)return!1;const s=t.target;if(s instanceof Element&&e.contains(s))return!0;const n=document.activeElement;return n instanceof Element&&e.contains(n)?!0:e.matches(":hover")}#wt(){const t=this.__parameters__.parent?.__parameters__?.solutionKey;return typeof t!="string"||t.length===0?null:hd(t)}#Et(t){const e=typeof String.prototype.translate=="function",s=globalThis.DataMaTranslate?.editPattern;if(!e||!(typeof s=="function"))return null;let i=t?.target;if(i&&!(i instanceof Element)&&i.parentElement&&(i=i.parentElement),!(i instanceof Element))return null;const r=i.closest(".datama-translated.editable");return!(r instanceof Element)||!r.closest('[data-app="true"]')?.classList?.contains("configurable")?null:{group:_t.translation(),groupHead:!0,text:"Edit pattern".translate(),icon:()=>this.#i("language-svg"),click:()=>{s(r)}}}#xt(){const e=this.__parameters__.parent?.__parameters__||{};if(typeof e.canExportAsHtml!="function"||!e.canExportAsHtml())return null;const s=typeof e.isExportAsHtmlBlocked=="function"&&e.isExportAsHtmlBlocked(),r={group:this.#wt()||_t.plotAction(),text:"Download as HTML".translate(),click:()=>{typeof e.exportAsHtml=="function"&&e.exportAsHtml()}};return s&&(r.classList=["disabled"],r.title="Downloading as HTML is not available in demo mode. Upgrade to unlock this feature.".translate()),r}#St(t){const e=t?.layer?.configuration?.legends;if(!e)return[];const s="Legend".translate(),n=(i,r)=>r.map(({value:a,label:l})=>({text:l.translate(),classList:()=>e[i]===a?["selected"]:[],click:()=>this.#It(t,i,a)}));return[{group:s,text:"Position".translate(),items:n("position",v0)},{group:s,text:"Size".translate(),items:n("size",C0)},{group:s,text:"Hide legend".translate(),click:()=>this.#It(t,"display",!1)}]}#It(t,e,s){t.layer.configuration.legends[e]=s,this.#o(t)}#Ot(t,e,s){this.#n(),this.#n=()=>{},this.#r?.disconnect();const n=this.__contextMenu__?.__node__;if(!(n instanceof Element)||!n.classList.contains("show"))return;const i=Y1({plotterParent:this.__parameters__.parent,hit:t,event:e,color:s});this.#n=i,this.#r=new MutationObserver(()=>{n.classList.contains("show")||(this.#n(),this.#n=()=>{},this.#r?.disconnect())}),this.#r.observe(n,{attributes:!0,attributeFilter:["class"]})}#Rt(t,e,s){if(!s.length)return!1;const n=md(s),i=this.__node__;return this.__contextMenu__?this.__contextMenu__.update({event:t,data:e,target:i,items:n}):(this.__contextMenu__=(window.getContextMenuInstance||(()=>!1))({event:t,data:e,target:i,items:n}),this.__contextMenu__&&this.__contextMenu__.render()),this.__contextMenu__}renderAnnotationMenu(t,e,s){return this.#Rt(t,e,Array.isArray(s)?s:[])}render(t,e,s){const n=this.__parameters__.parent,i=ld(t,e,s);if(i===K.LEGEND){const a=this.#Et(t),l=Qr({hit:i,data:e,layer:s}),c=(n.layer?.contextMenu||[]).filter(u=>u?.hitTarget===K.LEGEND),h=this.#Rt(t,e,[...a?[a]:[],...c,...Ph(this.#ut(),l),...this.#St(n)]);return this.#Ot(i,t,l?.color),h}this.#s=this.#y(e)??this.#y({scaleName:t?.target?.closest?.("g.plotter-axis")?.getAttribute?.("data-id")});const r=qr(t);if(e!=null||r){this.__node__;const a=s||null,l=i===K.AXIS||i===K.AXIS_TITLE,c=nd.includes(i),h=n.layer?.contextMenu||[],u=h.filter(M=>M?.hitTarget!=null),d=_t.plotAction(),p=c||i==null&&!to(e),f=h.filter(M=>M?.hitTarget==null&&(M?.group!==d||p)),_=r?g0(f):f,g=a&&!r&&l?this.#rt(i,e,u,this.#M(n,t)):[],m=a&&!r&&!l?this.#U(i,e,a,u):[];let y=[];a&&!r&&c?y=this.#z(a,i):a&&!r&&i==null&&(y=this.#ft(a,e,t));const b=Fs(e)&&(e?.viewKey||n?.__instance__?.plot?.layer?.trace)||null,A=Fs(e)?this.#gt(n,b||"comment-default"):[],L=r?this.#K(a??n?.layer):[],T=this.#dt(t),E=this.#Et(t),C=this.#xt(),S=r?[...E?[E]:[],...C?[C]:[],...T,...eo(_,L)]:[...E?[E]:[],...g,...m,...A,...T,...eo(_,y),...C?[C]:[]],w=pd(S,ud(t,e),{solutionGroupLabel:this.#wt()}),N=this.#Rt(t,e,w),R=[K.BAR,K.LINE,K.POINT].includes(i)?Qr({hit:i,data:e,layer:a}):null;return this.#Ot(i,t,R?.color),N}}}const ia=18,U0="s",Y0=350;class Ke extends ht{#t=null;#e=null;#s=null;#n=null;#r=!1;#i=null;#a=!1;#l=!1;#h=null;#p=null;#y=null;#L=null;#T=null;#u=0;#c=[];#m=!1;get logger(){try{return this.__parameters__?.parent?.logger}catch{return}}static getDefaultConfig(t=60,e=280){return{isCollapsed:!0,widthPercent:t,minWidthPx:e}}static getConfigurationDiff(t,{widthPercent:e=60,minWidthPx:s=280}={}){if(!t||typeof t!="object")return null;const{isCollapsed:n,...i}=t,r=Ke.getDefaultConfig(e,s),{isCollapsed:a,...l}=r,c=(u,d)=>{if(d==null)return u==null?void 0:d;if(Array.isArray(d))return Array.isArray(u)&&JSON.stringify(u)===JSON.stringify(d)?void 0:d;if(typeof d=="object"&&typeof u=="object"&&u!=null){const p={};let f=!1;return Object.keys(d).forEach(_=>{const g=d[_],m=u[_];if(!(_ in u))p[_]=g,f=!0;else{const y=c(m,g);y!==void 0&&(p[_]=y,f=!0)}}),f?p:void 0}return u!==d?d:void 0},h=c(l,i);return h&&Object.keys(h).length>0?h:null}init(){return new Promise((t,e)=>{try{this.__initializeConfig(),this.__prepareDOMElements(),t(this.__node__)}catch(s){e(s)}t()})}unmount(){this.__shortcutsObserver__&&this.__shortcutsObserver__.disconnect(),this.__moduleResizeObserver__&&(this.__moduleResizeObserver__.disconnect(),this.__moduleResizeObserver__=null),this.#E(),this.#et(),this.#Mt();const t=this.#h;return this.#h=null,this.#M("unregisterSettingsActionsHost")?.(t),this.#M("unregisterSettingsActionsHost")?.(this),this.__clearWindowResizeListener(),this.__node__&&this.__node__.parentNode&&this.__node__.parentNode.removeChild(this.__node__),this.__node__=null,this.__nodes__.quickActionToggle=null,super.unmount()}openAndFocusSearch(){return this.__isCollapsed__?(this.#m=!0,this.__toggleCollapse(),this.#o(),!0):this.#s?.focusSearch?.()===!0}#o(){const t=this.__node__;if(!(t instanceof Element)){this.#s?.focusSearch?.();return}let e=!1;const s=()=>{e||(e=!0,t.removeEventListener("transitionend",n),this.#s&&(this.#s.focusSearch?.(),this.#m=!1))},n=i=>{i.target!==t||i.propertyName!=="transform"||s()};t.addEventListener("transitionend",n),setTimeout(s,Y0)}#A(){this.#r||(this.#n=t=>this.#d(t),document.addEventListener("keydown",this.#n),this.#r=!0)}#E(){this.#r&&(document.removeEventListener("keydown",this.#n),this.#n=null,this.#r=!1)}#d(t){this.#_(t)&&(this.#C(t.target)||this.#S(t)&&(t.preventDefault(),this.openAndFocusSearch()))}#_(t){const e=String(t.key||"").toLowerCase();return t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&e===U0}#C(t){if(!(t instanceof Element))return!1;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"?!0:t.closest('[contenteditable="true"]')!=null}#S(t){const e=this.__parameters__.parent?.__node__;if(!e?.isConnected)return!1;const s=t.target;if(s instanceof Element&&e.contains(s))return!0;const n=document.activeElement;return n instanceof Element&&e.contains(n)?!0:e.matches(":hover")}#g(){const t=this.__parameters__.parent;return t?.layer?.configuration?t.layer.configuration:typeof t?.getDefaultConfiguration=="function"?t.getDefaultConfiguration():{}}#f(){const t=this.__parameters__.parent.__instance__?.plot,e=t?.layer??this.__parameters__.parent?.layer,s=em(e);if(s.size>0)return s;const n=t?.getCurrentTraces?.()??[],i=Array.isArray(n)?n:[];return new Set(i.map(r=>r?.type).filter(Boolean))}#x(){return[...this.#f()].sort().join("|")}syncSettingsScopeState(){if(this.#q())return;const t=this.#x(),e=this.#i!==t;this.#i=t,this.#p=null,e&&this.discardCollapsedSettings(),this.#dt();const s=this.#w(),n=this.#e==null||!s[this.#e];if(!this.__isCollapsed__&&(e||n)){n&&(this.#e=this.#G(s)),this.#yt();return}this.#b()}#v(t={}){const e=this.__parameters__.parent,s=e?.__instance__?.plot;t.cleanMeasureZoom&&s?._cleanZoomData?.(),this.#H(),s?._update(0,{mode:"full",origin:"settings"}),e?.__instance__?.header?.init?.()}#D(){const e=this.__parameters__.parent?.__parameters__?.hooks?.onModuleInputsChange;return typeof e=="function"?(this.#H(),e()):this.#v()}refreshPanes(){this.#v()}setHostPalette(t){if(!Array.isArray(t)||!t.length)return;const e=this.#R();e.palette=t.slice(),Q.setPalette(t),this.#y?.()}syncSettingsInputs(){const t=this.__nodes__?.activeSettingsPage||this.__node__;t instanceof Element&&t.querySelectorAll(".plotter-input").forEach(e=>{const s=e.__datama__?.class;typeof s?.syncFromBoundList=="function"&&s.syncFromBoundList()})}#B(){const t=this.__parameters__.parent,e=t?.__instance__?.plot,s=t?.__instance__?.shortcut;this.#H();const n=e?._update?.(0),i=()=>{s?.render?.(),this.syncSettingsScopeState()};if(n?.then){n.then(i).catch(i);return}i()}#$(t){const e=this.__parameters__.parent,s=e?.__instance__?.shortcut;if(this.#H(),typeof s?.applyReverseAxisFromSettings=="function"){s.applyReverseAxisFromSettings(t);return}const n=e?.__instance__?.plot;n&&(n.reverseAxis(),n._update(1))}#F(t){const e=this.__parameters__.parent.__instance__?.plot,s=()=>{this.#b();const i=this.#w();this.#N(i),this.#yt()};this.#H();const n=e?.changeView?.(t);if(n?.then){n.then(s).catch(()=>s());return}s()}#w(){const t=this.__parameters__.parent.__instance__?.plot?.getCurrentTraces?.()??[],e=this.#Z().map(s=>s.scope);return sm(t,this.#g(),this.#f(),{hasAnalysisSettings:e.length>0,analysisScopes:e})}#G(t=this.#w()){const e=this.#Z().map(n=>n.scope),s=Ar(this.#f()).map(n=>n.scope);return nm(t,{analysisScopes:e,layerScopes:s})}#N(t=this.#w()){this.#e!=null&&t[this.#e]||(this.#e=this.#G(t))}#R(){return this.__parameters__.parent?.__parameters__??{}}#M(t){const e=this.#R()[t];return typeof e=="function"?e:null}#k(){if(!this.#p){const t=this.#M("getAnalysisSettingsSections"),s=t?t({refreshPanes:()=>this.refreshPanes(),syncSettingsInputs:()=>this.syncSettingsInputs(),setHostPalette:n=>this.setHostPalette(n)}):[];this.#p=Array.isArray(s)?s.filter(n=>n&&typeof n.scope=="string"&&n.node instanceof Node):[]}return this.#p}#Z(){return rm(this.#k())}#V(){const t=this.#M("isAnalysisSettingsDirty");return t?!!t():this.#a}applySettingsChangeFlags(t={}){t.analysis&&(this.#a=!0),t.persist&&(this.#l=!0),this.#I()}#H(){this.__parameters__.parent?.notifySettingsChange?.({persist:!0})}getPendingLanguageChanged(){return!!this.#M("getPendingLanguageChanged")?.()}clearPendingLanguageChanged(){this.#M("clearPendingLanguageChanged")?.()}syncSettingsActionButtons(){const t=this.#M("isAnalysisSettingsDirty");t&&(this.#a=!!t());const e=this.#M("isPersistSettingsDirty");e&&(this.#l=!!e()),this.#I()}rebuildAnalysisSettingsPanels(){this.#st()}#I(){this.#h?.syncSettingsActionButtons?.()}#O(){const t=this.#h;t&&(this.#M("unregisterSettingsActionsHost")?.(t),this.#h=null);const e=this.#M("searchActions");if(!e)return null;const s=e({idPrefix:this.#P()});return s instanceof Node?(this.#h=null,s):!s||typeof s!="object"||!(s.node instanceof Node)?(this.#h=null,null):(this.#h=s,this.#M("registerSettingsActionsHost")?.(s),s.node)}#j(){if(!this.#V())return;if(typeof this.#h?.applyAnalysisSettings=="function"){this.#h.applyAnalysisSettings();return}const t=this.#M("onSettingsApply");t&&t({languageChanged:this.getPendingLanguageChanged()})}#lt(){const t=this.#rt(),e=this.__nodes__.activeSettingsPage,s=[];if(e instanceof HTMLElement){const n=e.querySelectorAll(".plotter-ui-panel:not(.plotter-ui-panel-close), .datama-panel:not(.datama-panel-close)");for(let i=0;i<n.length;i+=1){const r=n[i].id;r&&s.push(r)}}return{scrollTop:t?.scrollTop??0,openPanelIds:s}}#J(t,e){if(!t?.__parameters__)return;const s=t.__parameters__.sections;if(Array.isArray(s)&&s.length>0){s.forEach(i=>{this.#J(i?.groups,e)});return}e(t),(t.__parameters__.panels||[]).forEach(i=>{i?.__parameters__?.panels&&this.#J(i,e)})}#tt(t,e){if(!e?.length)return;const s=new Set(e);this.#J(t,n=>{(n.__parameters__.panels||[]).forEach((r,a)=>{if(r?.__parameters__?.panels||r?.__parameters__?.title===void 0)return;const l=r.__parameters__?.anchorId||`${n.__parameters__.id}-panel-${a}`;r.__parameters__.open=s.has(l)})})}#W(t){const e=this.#rt();e instanceof HTMLElement&&(e.scrollTop=t)}#it(t){const e=new Set(t?.openPanelIds??[]),s=this.__nodes__.activeSettingsPage;if(s instanceof HTMLElement&&e.size>0){const i=s.querySelectorAll(".plotter-ui-panel, .datama-panel");for(let r=0;r<i.length;r+=1){const a=i[r],l=a.classList.contains("plotter-ui-panel")?"plotter-ui-panel-close":"datama-panel-close";e.has(a.id)?a.classList.remove(l):a.classList.add(l)}}ys(this.#s).forEach(i=>{const r=i.__node__?.id,a=r?e.has(r):!!i.__parameters__?.open;i.__parameters__.open=a,a?i.open?.({scroll:!1}):i.close?.()}),this.#W(t?.scrollTop??0),setTimeout(()=>this.#W(t?.scrollTop??0),0)}#st(){const t=this.__nodes__.activeSettingsPage,e=this.#lt(),s=this.#a,n=this.#l;this.#p=null;const i=this.#Q();t&&(this.#tt(i,e.openPanelIds),t.replaceChildren(i.render()),this.#s=i,this.#it(e)),this.#a=s,this.#l=n,this.syncSettingsActionButtons(),this.#b()}#Q(){const t=`${this.__parameters__.parent.__parameters__.id}-plotter`,e=this.#g(),s=this.__parameters__.parent.__instance__?.plot?.getCurrentTraces?.()??[],n=this.__parameters__.parent,i=this.#k();this.#M("registerSettingsActionsHost")?.(this);const r=Im({configuration:e,idPrefix:t,onChange:()=>this.#v(),activeLayerTypes:this.#f(),traces:s,layer:n?.layer,onViewChange:a=>this.#F(a),onReverseAxisChange:a=>this.#$(a),onViewLayoutChange:()=>this.#B(),moduleInputs:n?.layer?.settingsInputs,onModuleInputsChange:()=>this.#D(),onBaselinePositionChange:()=>this.#v({cleanMeasureZoom:!0}),hostConfiguration:n?.layer?.settingsConfiguration,onHostConfigurationChange:()=>this.#v(),data:n?.__parameters__?.data,getPalette:()=>(Q.init(),Q.palette||[]),onPaletteChange:a=>{n.__parameters__.palette=a.slice();const l=this.#M("onPaletteChange");l&&l(a.slice())},analysisSections:i,appendTreeCardContents:n?.layer?.appendTreeCardContents,searchActions:()=>this.#O(),createAnalysisStoryPinAction:a=>{const l=this.#M("createAnalysisStoryPinAction");return typeof l=="function"?l(a):null},solutionKey:this.#R().solutionKey});return this.#y=typeof r.refreshPalette=="function"?()=>r.refreshPalette():null,r}#P(){return`${this.__parameters__.parent.__parameters__.id}-plotter`}#et(){const t=this.#rt();t&&this.#L&&t.removeEventListener("scroll",this.#L),this.#L=null,this.#T!==null&&(cancelAnimationFrame(this.#T),this.#T=null)}#rt(){return this.__nodes__.content instanceof HTMLElement?this.__nodes__.content:null}#ut(t){const e=this.__nodes__.activeSettingsPage,s=t.getBoundingClientRect();if(!(e instanceof HTMLElement))return s.top+s.height/2;const r=e.querySelector(".plotter-ui-panels-search--sticky, .datama-panels-search--sticky")?.getBoundingClientRect?.()?.bottom??s.top;return r+Math.max(0,(s.bottom-r)/2)}#z(t){const e=this.__nodes__.activeSettingsPage;if(!(t instanceof HTMLElement)||!(e instanceof HTMLElement))return null;const s=this.#ut(t),n=[...e.querySelectorAll(".plotter-ui-panels-scope-section, .datama-panels-scope-section")];if(n.length<1)return null;let i=null,r=Number.POSITIVE_INFINITY;for(let a=0;a<n.length;a+=1){const l=n[a],c=l.getBoundingClientRect();if(c.height<=0&&c.bottom===c.top)continue;const u=l.id?.replace(`${this.#P()}-settings-scope-`,"");if(!u)continue;if(c.top<=s&&c.bottom>s)return u;const p=c.top+c.height/2,f=Math.abs(p-s);f<r&&(r=f,i=u)}return i}#U(){if(this.__isCollapsed__)return;const t=this.#rt(),e=this.#z(t);!e||e===this.#e||(this.#e=e,this.#b())}#at(){const t=this.#rt();t instanceof HTMLElement&&(this.#et(),this.#L=()=>{this.#T===null&&(this.#T=requestAnimationFrame(()=>{this.#T=null,this.#U()}))},t.addEventListener("scroll",this.#L,{passive:!0}),this.#U())}#ct(t){this.#et();const e=this.#P(),s=x.getNode("div",`${e}-settings-page`,["plotter-settings-page"],this.__nodes__.content),n=t.render();s.append(n),this.#s=t,this.__nodes__.activeSettingsPage=s,this.#at()}#ot(t){if(!this.#w()[t])return;this.__isCollapsed__&&this.__toggleCollapse(),this.#e=t;const s=Ee(this.#P(),t);this.#s?.openSection?.(s,{scroll:!1});const n=document.getElementById(s);requestAnimationFrame(()=>{n?.scrollIntoView({behavior:"auto",block:"nearest"})}),this.#b()}#Y(t,e){if(!(t instanceof HTMLElement)||e==null||e==="")return;const s=String(e),n=typeof s.translate=="function"?s.translate():s;n&&(t.setAttribute("title",n),t.setAttribute("aria-label",n))}#K({scope:t,icon:e,title:s,disabled:n}){const i=this.__parameters__.parent.__parameters__.id,r=Ee(this.#P(),t),a=x.getNode("a",`${i}-settings-nav-${t}`,["plotter-button","transparent","no-text","plotter-settings-scope-anchor",!this.__isCollapsed__&&this.#e===t?"active":null],this.__nodes__.nav,{href:`#${r}`});this.#Y(a,s),n?(a.classList.add("disabled"),a.setAttribute("aria-disabled","true"),a.tabIndex=-1):a.addEventListener("click",c=>{c.preventDefault(),this.#ot(t)});const l=x.getNode("span",`${i}-settings-nav-${t}-icon`,["plotter-button-icon"]);return this.clearChild(l),typeof e=="string"?l.innerText=e:e instanceof Node&&l.append(e),a.append(l),a}#b(){const t=this.__isCollapsed__,e=this.#w();[...Object.entries(this.__nodes__.buttons?.analysisSettings||{}).map(([a,l])=>({key:a,node:l})),{key:ut.CHART,node:this.__nodes__.buttons?.chartSettings},{key:ut.COLORS,node:this.__nodes__.buttons?.colorsSettings},...Object.entries(this.__nodes__.buttons?.layerSettings||{}).map(([a,l])=>({key:a,node:l})),{key:ut.TABLE,node:this.__nodes__.buttons?.tableSettings}].forEach(({key:a,node:l})=>{l&&(l.classList.toggle("active",!t&&this.#e===a),l.setAttribute("aria-current",!t&&this.#e===a?"true":"false"),l.classList.toggle("disabled",!e[a]),e[a]?(l.removeAttribute("aria-disabled"),l.tabIndex=0):(l.setAttribute("aria-disabled","true"),l.tabIndex=-1))});const n=this.__nodes__.buttons?.collapse?.__node__;n&&n.classList.toggle("active",!t);const i=this.__nodes__.buttons?.fullscreen?.__node__;i&&(i.classList.toggle("active",this.__isFullscreen__),i.classList.toggle("disabled",t),t?(i.setAttribute("aria-disabled","true"),i.tabIndex=-1):(i.removeAttribute("aria-disabled"),i.tabIndex=0));const r=this.__nodes__.buttons?.copyAsCsv?.__node__;r&&r.classList.toggle("active",!t)}#ht(t){const e=this.__parameters__.parent.__parameters__.id,s=x.divider("span",!1,`${e}-panel-nav-divider-${t}`,["plotter-panel-actions-divider"]);return this.__nodes__.nav.append(s),s}#nt(){return this.__nodes__.buttons?.fullscreen?.__node__??this.__nodes__.quickActionFullscreen??null}#q(){return(this.__parameters__.contents?.length??0)>0}#gt(){let t=this.__parameters__.parent.__parameters__.data;typeof this.__parameters__.parent.__parameters__?.callbacks?.panel.beforeCopyAsCSV=="function"&&(t=this.__parameters__.parent.__parameters__?.callbacks?.panel.beforeCopyAsCSV(t));const e=Kt.toCsv(t);Kt.copyToClipboard(e),typeof this.__parameters__.parent.__parameters__?.callbacks?.panel.onCopyAsCSV=="function"&&this.__parameters__.parent.__parameters__?.callbacks?.panel.onCopyAsCSV(t,e)}#ft(){(this.__parameters__.contents||[]).forEach(t=>{if(t instanceof HTMLElement){this.__nodes__.content.append(t);return}if(typeof t?.render=="function"){this.__nodes__.content.append(t.render());return}throw Error("Plotter - Panel content is invalid, it must be a HTML element OR an object with render() who provide function")})}#_t(){this.__nodes__.buttons||(this.__nodes__.buttons={});const t=this.#w(),e=this.__parameters__.parent.__parameters__.id;if(this.__nodes__.buttons.collapse=new vt({id:`${e}-quick-action-collapse`,icon:D.get("chevron-right-svg",{size:ia}),title:"Toggle panel",classList:["quick-action-toggle","transparent",this.__isCollapsed__?null:"active"],callbacks:{click:()=>{this.__toggleCollapse(),this.#b()}},target:this.__nodes__.nav}),this.__nodes__.buttons.collapse.render(),this.#Y(this.__nodes__.buttons.collapse.__node__,"Toggle panel"),this.#q()||(this.__nodes__.buttons.fullscreen=new vt({id:`${e}-quick-action-fullscreen`,icon:D.get("maximize-2-svg",{size:ia}),title:"Toggle panel full width",classList:["quick-action-fullscreen","transparent",this.__isFullscreen__?"active":null],callbacks:{click:()=>{this.__isCollapsed__&&this.__toggleCollapse(),this.__toggleFullscreen(),this.#b()}},target:this.__nodes__.nav}),this.__nodes__.buttons.fullscreen.render(),this.#Y(this.__nodes__.buttons.fullscreen.__node__,"Toggle panel full width"),this.#ht("settings-scopes")),this.#q()){this.__nodes__.buttons.copyAsCsv=new vt({id:`${e}-quick-action-copy-as-csv`,icon:D.get("copy-svg",{size:ia}),title:"Copy data used in plot as CSV",classList:["quick-action-copy-as-csv","transparent",this.__isCollapsed__?null:"active"],callbacks:{click:()=>this.#gt()},target:this.__nodes__.nav}),this.__nodes__.buttons.copyAsCsv.render(),this.#Y(this.__nodes__.buttons.copyAsCsv.__node__,"Copy data used in plot as CSV");return}this.__nodes__.buttons.analysisSettings={},this.#Z().forEach(n=>{this.__nodes__.buttons.analysisSettings[n.scope]=this.#K({scope:n.scope,icon:n.icon,title:n.title,disabled:!t[n.scope]})}),this.__nodes__.buttons.chartSettings=this.#K({scope:ut.CHART,icon:D.get("paint-svg",{size:18}),title:"Chart settings",disabled:!t.chart}),this.__nodes__.buttons.colorsSettings=this.#K({scope:ut.COLORS,icon:D.get("paint-bucket-svg",{size:18}),title:"Colors",disabled:!t.colors}),this.__nodes__.buttons.layerSettings={},Ar(this.#f()).forEach(n=>{this.__nodes__.buttons.layerSettings[n.scope]=this.#K({scope:n.scope,icon:n.icon,title:n.title,disabled:!t[n.scope]})}),t[ut.TABLE]&&(this.__nodes__.buttons.tableSettings=this.#K({scope:ut.TABLE,icon:D.get("table-svg",{size:18}),title:"Table settings",disabled:!t[ut.TABLE]}))}#dt(){for(this.__nodes__.nav=x.getNode("div",this.__parameters__.parent.__parameters__.id+"-actions",["plotter-panel-actions"],this.__node__);this.__nodes__.nav.firstChild;)this.__nodes__.nav.removeChild(this.__nodes__.nav.firstChild);this.#_t()}#yt(){for(this.__nodes__.content=x.getNode("div",this.__parameters__.parent.__parameters__.id+"-content",["plotter-panel-content"],this.__node__);this.__nodes__.content.firstChild;)this.__nodes__.content.removeChild(this.__nodes__.content.firstChild);if(this.__isCollapsed__){this.#s=null;return}if(this.#q()){this.#ft();return}const t=this.#w();if(this.#e===ut.ANALYSIS){const s=this.#Z();this.#e=s[0]?.scope??this.#G(t)}else if(this.#e===ut.MODULE){const s=Ar(this.#f());this.#e=s[0]?.scope??this.#G(t)}else this.#N(t);const e=this.#Q();this.#ct(e),this.#i=this.#x()}render(){this.#p=null,this.__isCollapsed__||this.#N(this.#w()),this.#dt(),this.#yt()}update(t){return t&&(this.__parameters__.inputs=t),this.render()}isCollapsed(){return this.__isCollapsed__}collapseIfExpanded(){this.__isCollapsed__||this.__toggleCollapse()}getWidth(){return this.__isCollapsed__?0:this.__node__&&this.__node__.clientWidth-30||280}getWidthPercent(){if(this.__isCollapsed__)return 0;const t=this.__getConfig()?.widthPercent||60;return this.__node__ instanceof Element&&parseInt(window.getComputedStyle(this.__node__).width,10)/window.innerWidth*100||t}__clearDOMElementsIfExist(){if(this.__node__)for(;this.__node__.firstChild;)this.__node__.removeChild(this.__node__.firstChild);this.__nodes__.quickActionToggle&&(this.__nodes__.quickActionToggle.remove(),delete this.__nodes__.quickActionToggle)}__prepareDOMElements(){this.__clearDOMElementsIfExist(),this.__node__=x.getNode("div",this.__parameters__.id,["plotter-panel"],this.__parameters__.parent.__node__),this.__node__.addEventListener("mouseenter",()=>{this.#At()}),this.__applyInitialConfiguration(),this.#A()}#At(){this.__parameters__.parent?.__instance__?.plot?.clearUnlockedHovers?.()}__initializeConfig(){this.__isCollapsed__==null&&(this.__isCollapsed__=!0),this.__isFullscreen__=!1}__toggleCollapse(){this.__isCollapsed__=!this.__isCollapsed__;const t=this.__isCollapsed__&&this.#V();this.__isCollapsed__&&(this.#Mt(),this.#j()),typeof this.__parameters__.parent.__parameters__?.callbacks?.panel?.onPanelToggle=="function"&&this.__parameters__.parent.__parameters__.callbacks.panel.onPanelToggle(this.__isCollapsed__);const e=this.__parameters__.parent.__instance__.shortcut.__node__.querySelector(".plotter-table-view-toggle");if(e&&(this.__isCollapsed__?e.classList.remove("active"):e.classList.add("active")),this.__isCollapsed__)this.__isFullscreen__&&(this.__isFullscreen__=!1,this.__exitFullscreen()),this.__node__.classList.add("collapsed"),this.__parameters__.parent.__node__.classList.remove("panel-open"),this.__parameters__.parent.__node__.classList.add("panel-closed"),this.__showShortcutInputs();else{this.#At(),this.__hideShortcutInputs(),this.__updatePlotSize(),this.#N(this.#w()),this.#vt()||this.#wt(),this.#b(),this.__node__.offsetWidth,this.__node__.classList.remove("collapsed"),this.__parameters__.parent.__node__.classList.add("panel-open"),this.__parameters__.parent.__node__.classList.remove("panel-closed");return}this.__updatePlotSize(),J.closeAllSelects(),t&&this.discardCollapsedSettings(),this.#b()}#vt(){const t=this.__nodes__.content;return!this.#s||!(t instanceof HTMLElement)||!t.firstChild||t.querySelector(".plotter-settings-skeleton")||this.#q()?!1:this.#i===this.#x()}#Ct(){for(const t of this.#c)cancelAnimationFrame(t);this.#c=[]}#Mt(){this.#u+=1,this.#Ct(),this.#m=!1,this.#Lt()}#Lt(){if(this.#s)return;const t=this.__nodes__.content;t instanceof HTMLElement&&t.querySelector(".plotter-settings-skeleton")&&t.replaceChildren()}#Tt(){this.#et(),this.#s=null,this.__nodes__.activeSettingsPage=null;const t=this.__parameters__.parent.__parameters__.id,e=x.getNode("div",`${t}-content`,["plotter-panel-content"],this.__node__);e.replaceChildren();const s=x.getNode("div",`${this.#P()}-settings-skeleton`,["plotter-settings-skeleton"],e);["72%","88%","64%","80%","56%"].forEach((i,r)=>{const a=document.createElement("div");a.className="plotter-settings-skeleton__bar",a.style.width=i,r===0&&a.classList.add("plotter-settings-skeleton__bar--title"),s.append(a)}),this.__nodes__.content=e}#wt(){this.#Ct();const t=++this.#u;this.#Tt();const e=s=>{const n=requestAnimationFrame(s);this.#c.push(n)};e(()=>{t!==this.#u||this.__isCollapsed__||e(()=>{t!==this.#u||this.__isCollapsed__||(this.#c=[],this.#yt(),this.#b(),this.#m&&(this.#m=!1,this.#s?.focusSearch?.()))})})}discardCollapsedSettings(){this.__isCollapsed__&&(this.#et(),this.#yt())}__showShortcutInputs(){this.__parameters__.parent.__instance__.shortcut?.__node__&&Object.values(this.__parameters__.parent.__instance__.shortcut.__nodes__).forEach(e=>{e.style.display=""})}__hideShortcutInputs(){this.__parameters__.parent.__instance__.shortcut?.__node__&&this.__parameters__?.hideShortcuts!==!1&&Object.values(this.__parameters__.parent.__instance__.shortcut.__nodes__).forEach(e=>{e.style.display="none"})}__applyInitialConfiguration(){const t=this.__parameters__.parent?.layer?.configuration?.behaviors?.hidePlotterInputs;let s=this.__getConfig()?.widthPercent??Ke.getDefaultConfig().widthPercent;this.__node__&&(this.__node__.style.width=`${s}%`),document.documentElement.style.setProperty("--plotter-panel-width",`${s}%`),t?(this.__isCollapsed__=!0,this.__node__.classList.add("collapsed"),this.__parameters__.parent.__node__.classList.add("panel-closed")):this.__isCollapsed__?(this.__node__.classList.add("collapsed"),this.__parameters__.parent.__node__.classList.add("panel-closed")):this.__parameters__.parent.__node__.classList.add("panel-open"),this.__setupShortcutsObserver(),this.__setupResizeHandling(),this.__ensureWindowResizeListener()}__clearWindowResizeListener(){this.__resizeTimeoutId__!=null&&(clearTimeout(this.__resizeTimeoutId__),this.__resizeTimeoutId__=null),this.__resizeHandler__&&(window.removeEventListener("resize",this.__resizeHandler__),this.__resizeHandler__=null)}__ensureWindowResizeListener(){this.__clearWindowResizeListener(),this.__setupWindowResizeListener()}__toggleFullscreen(){this.__isFullscreen__=!this.__isFullscreen__,this.__isFullscreen__?this.__enterFullscreen():this.__exitFullscreen()}__enterFullscreen(){this.__node__&&(this.__node__.dataset.originalStyle=this.__node__.getAttribute("style")||"",this.__node__.dataset.prevPanelWidthVar=getComputedStyle(document.documentElement).getPropertyValue("--plotter-panel-width")||"",document.documentElement.style.setProperty("--plotter-panel-width","100%"),this.__node__.setAttribute("style","position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 9999; background: var(--datama-background-color, #fff); overflow: hidden; display: flex; flex-direction: row; align-items: stretch; width: 100%; height: 100%; max-height: 100%;"),this.__node__.classList.add("fullscreen"),this.#nt()?.classList.add("active"),this.__escHandler__=t=>{t.key==="Escape"&&this.__toggleFullscreen()},window.addEventListener("keydown",this.__escHandler__))}__exitFullscreen(){if(!this.__node__)return;const t=this.__node__.dataset.originalStyle||"";t?this.__node__.setAttribute("style",t):this.__node__.removeAttribute("style");const e=this.__node__.dataset.prevPanelWidthVar||"";e&&document.documentElement.style.setProperty("--plotter-panel-width",e.trim()),this.__node__.classList.remove("fullscreen"),this.#nt()?.classList.remove("active"),this.__escHandler__&&(window.removeEventListener("keydown",this.__escHandler__),this.__escHandler__=null),this.__updatePlotSize()}__setupShortcutsObserver(){const t=this.__parameters__.parent.__instance__.shortcut?.__node__;t&&(this.__shortcutsObserver__=new MutationObserver(e=>{this.__isCollapsed__?this.__showShortcutInputs():this.__hideShortcutInputs()}),this.__shortcutsObserver__.observe(t,{childList:!0,subtree:!0,attributes:!0}))}__setupResizeHandling(){let t,e;const s=a=>{if(this.__isFullscreen__)return;const l=this.__node__.getBoundingClientRect();a.clientX>l.left+15||(a.preventDefault(),a.stopPropagation(),t=a.clientX,e=parseInt(document.defaultView.getComputedStyle(this.__node__).width,10),this.__parameters__.parent.__node__.classList.add("resizing"),this.__nodes__.quickActionToggle&&this.__nodes__.quickActionToggle.classList.add("resizing"),document.removeEventListener("mousemove",i),document.addEventListener("mousemove",i),document.removeEventListener("mouseup",r),document.addEventListener("mouseup",r))};let n;const i=a=>{n&&clearTimeout(n),n=setTimeout(()=>{const c=Math.max(this.__getConfig().minWidthPx||280,e-(a.clientX-t))/window.innerWidth*100,h=(this.__getConfig().minWidthPx||280)/window.innerWidth*100,u=Math.max(h,c);this.__node__.style.width=`${u}%`,document.documentElement.style.setProperty("--plotter-panel-width",`${u}%`),this.__updateConfig({widthPercent:u}),this.__updatePlotSize()},50)},r=a=>{setTimeout(()=>{const c=Math.max(this.__getConfig().minWidthPx||280,e-(a.clientX-t))/window.innerWidth*100,h=(this.__getConfig().minWidthPx||280)/window.innerWidth*100,u=Math.max(h,c);this.__updateConfig({widthPercent:u}),typeof this.__parameters__.parent.__parameters__?.callbacks?.panel?.onPanelResize=="function"&&this.__parameters__.parent.__parameters__.callbacks.panel.onPanelResize(u)}),setTimeout(()=>{this.__parameters__.parent.__node__.classList.remove("resizing"),this.__nodes__.quickActionToggle&&this.__nodes__.quickActionToggle.classList.remove("resizing"),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",r)})};this.__node__.removeEventListener("mousedown",s),this.__node__.addEventListener("mousedown",s)}__updatePlotSize(){if(!(this.__node__ instanceof Element))return;const t=this.__parameters__.parent?.__instance__;t&&(t.header?.__node__&&(t.header.__node__.style.width=""),t.shortcut?.__node__&&(t.shortcut.__node__.style.width=""))}__setupWindowResizeListener(){const e=()=>{this.__resizeTimeoutId__!=null&&clearTimeout(this.__resizeTimeoutId__),this.__resizeTimeoutId__=setTimeout(()=>{this.__resizeTimeoutId__=null,!this.__isCollapsed__&&this.__node__ instanceof Element&&this.__updatePlotSize()},100)};window.addEventListener("resize",e),this.__resizeHandler__=e}__getConfig(){return this.__parameters__?.parent?.layer?.configuration?.panel}__updateConfig(t){return this.__parameters__.parent.layer.configuration.panel={...this.__parameters__.parent.layer.configuration.panel,...t},this.__parameters__.parent?.markSettingsPersistDirty?.(),this}}const K0=100,Xh="plotter-shortcuts-over-title",ra="plotter-shortcuts-compact",Zh="plotter-shortcuts-has-more",aa="plotter-shortcuts-expanded",Xe="plotter-shortcut-out-of-row",X0=16,Z0=".plotter-title";function Qh(o,t,e=.5){return!o||!t?!1:o.left<t.right-e&&o.right>t.left+e&&o.top<t.bottom-e&&o.bottom>t.top+e}function oa(o){if(!(o instanceof HTMLElement))return[];if(typeof document.createRange!="function")return[];const t=[],e=i=>{i&&i.width>0&&i.height>0&&t.push(i)},s=typeof document.createTreeWalker=="function"?document.createTreeWalker(o,NodeFilter.SHOW_TEXT):null;if(s){let i=s.nextNode();for(;i;){if(String(i.textContent||"").trim()){const r=document.createRange();r.selectNodeContents(i),Array.from(r.getClientRects()).forEach(e)}i=s.nextNode()}}else{const i=document.createRange();i.selectNodeContents(o),Array.from(i.getClientRects()).forEach(e)}const n=[".datama-input-container",".plotter-input-container",".datama-input-select",".plotter-input-select","select","button"].join(",");return o.querySelectorAll(n).forEach(i=>{e(i.getBoundingClientRect())}),t}function qh(o,t){if(!(o instanceof HTMLElement)||!(t instanceof HTMLElement))return!1;const e=o.getBoundingClientRect();return!(e.width>0)||!(e.height>0)?!1:oa(t).some(n=>Qh(e,n))}const Q0={instance:!0,instances:!0,__instance__:!0};class Tt extends ht{static LAYERS=window.layers;static logger=new Et;#t=null;#e=null;#s=null;#n="";#r=!1;__unmounted__=!1;get logger(){try{return Tt.logger}catch{return}}getDefaultConfiguration(...t){return Tt.defaultConfiguration(...t)}static defaultConfiguration({widthPercent:t=60,minWidthPx:e=280,displayShortcutsOnHover:s}={}){return{reverse:!1,beta:!1,plot:Ng(),behaviors:Mg({displayShortcutsOnHover:s}),legends:Og(),sort:{scale:{name:null,direction:null},stack:{name:null,direction:null}},axis:ae(),annotations:{position:"value",font:{size:20},rotation:0,differences:[],valueLines:[]},bars:Fl(),events:{display:!0,area:{display:!0,opacity:.5,strokeSize:1,mode:"full",position:"bottom"},line:{mode:"both",position:"top",display:!0,opacity:.5},marker:{display:!0,position:"top",size:10,opacity:1},labels:{display:!0,position:"top"}},lines:Dg(),panel:Ke.getDefaultConfig(t,e),tree:Pc(),waterfall:_c(),table:Qo(),header:Aa(),title:ir(),subtitle:rr(),customViews:{},layout:xt()}}static deepMerge(t,e){if(!e||typeof e!="object"||Array.isArray(e))return e!==void 0?e:t;if(!t||typeof t!="object"||Array.isArray(t))return e;const s=JSON.parse(JSON.stringify(e));return Object.keys(t).forEach(n=>{n in s?typeof t[n]=="object"&&t[n]!==null&&!Array.isArray(t[n])&&typeof s[n]=="object"&&s[n]!==null&&!Array.isArray(s[n])&&(s[n]=Tt.deepMerge(t[n],s[n])):s[n]=JSON.parse(JSON.stringify(t[n]))}),s}static deepDiff(t,e,{specialKeyHandler:s}={}){if(e==null)return t==null?void 0:e;if(Array.isArray(e))return Array.isArray(t)&&JSON.stringify(t)===JSON.stringify(e)?void 0:e;if(typeof e=="object"&&typeof t=="object"&&t!=null){const n={};let i=!1;return Object.keys(e).forEach(r=>{if(Object.prototype.hasOwnProperty.call(Q0,r))return;const a=e[r],l=t[r];if(s&&typeof s=="function"){const c=s(r,l,a);if(c!==void 0){c!==null&&(n[r]=c,i=!0);return}}if(!(r in t))n[r]=a,i=!0;else{const c=Tt.deepDiff(l,a,{specialKeyHandler:s});c!==void 0&&(n[r]=c,i=!0)}}),i?n:void 0}return t!==e?e:void 0}static getConfigurationDiff(t,{widthPercent:e=60,minWidthPx:s=280,displayShortcutsOnHover:n}={}){if(!t||typeof t!="object")return null;const i=Tt.defaultConfiguration({widthPercent:e,minWidthPx:s,displayShortcutsOnHover:n}),r=(l,c,h)=>{if(l==="panel")return Ke.getConfigurationDiff(h,{widthPercent:e,minWidthPx:s})},a=Tt.deepDiff(i,t,{specialKeyHandler:r});return a&&Object.keys(a).length>0?a:null}static loadConfiguration(t,{widthPercent:e=60,displayShortcutsOnHover:s=!1}={}){if(!t||typeof t!="object")return Tt.defaultConfiguration({widthPercent:e,displayShortcutsOnHover:s});t?.bars?.round?.ratio&&(t.bars.round.ratio="auto"),t.panel&&Object.prototype.hasOwnProperty.call(t.panel,"isCollapsed")&&delete t.panel.isCollapsed;const n=Tt.defaultConfiguration({widthPercent:e,displayShortcutsOnHover:s});t=Tt.normalizeConfigurationPadding(t,n),t=Tt.normalizeConfigurationLayout(t,n);const i=Tt.deepMerge(n,t);return Tt.normalizeConfigurationLayout(i,n)}static normalizeConfigurationLayout(t,e){return Ru(t,e)}static normalizeConfigurationPadding(t,e){if(!t||typeof t!="object")return t;const s=JSON.parse(JSON.stringify(t)),n=e?.plot?.padding||{},i=s?.plot?.padding;return typeof i=="number"?(s.plot.padding={top:i,right:i,bottom:i,left:i},s):(i&&typeof i=="object"&&!Array.isArray(i)&&(s.plot.padding={top:i.top!=null?i.top:n.top,right:i.right!=null?i.right:n.right,bottom:i.bottom!=null?i.bottom:n.bottom,left:i.left!=null?i.left:n.left}),s)}constructor(t){super(t),Bn.ensureFallbacks();const e=this.__parameters__.palette;Array.isArray(e)&&e.length&&Q.setPalette(e),this.#p(),this.__parameters__.target instanceof String?this.__nodes__.parent=document.getElementById(t.target):this.__parameters__.target instanceof Node&&(this.__nodes__.parent=t.target),this.__node__=x.getNode("div",this.__parameters__.id,["datama-plot",...this.__parameters__?.classList||[]],this.__nodes__.parent),this.#i()}getLAYERS(){return window.layers}getLaidOutHostBox(){return this.#h()}unmount(){return new Promise(t=>(this.__unmounted__=!0,this.#u(),Object.keys(this.__nodes__||{}).forEach(e=>{const s=this.__nodes__[e];s&&typeof s.remove=="function"&&s.remove()}),this.__node__&&typeof this.__node__.remove=="function"&&this.__node__.remove(),Promise.all(Object.keys(this.__instance__||{}).map(e=>typeof this.__instance__[e]?.unmount=="function"?this.__instance__[e].unmount():this.__instance__[e]?.unmount&&typeof this.__instance__[e]=="object"?Promise.all(Object.keys(this.__instance__[e]).map(async s=>typeof this.__instance__[e][s]?.unmount=="function"?this.__instance__[e][s].unmount():new Promise(n=>n()))).then(()=>{t()}):new Promise(s=>s()))).then(()=>t())))}init(t){this.layer=t,this.__unmounted__=!1,this.layer.configuration||(this.layer.configuration=Tt.defaultConfiguration({displayShortcutsOnHover:!!this.layer?.title?.content})),this.__node__=x.getNode("div",this.__parameters__.id,["plotter","plotter-layout-root","w-100","h-100"],this.__parameters__.parent),this.#c(),this.__setupRootEventListeners(),this.__instance__=this.__createComponentInstances();const e=Object.values(this.__instance__).map(s=>s.init(this.layer)||Promise.resolve());return this._initializationPromise=Promise.all(e).then(()=>(this.applyLayoutConfiguration(),this.#a(),this.__node__)).catch(s=>{throw console.error("Error initializing Plotter:",s),s}),this._initializationPromise}render(t){if(this.__unmounted__)return Promise.resolve(this);const e=t||this.layer;return["header"].forEach(n=>this.__instance__[n].render()),(this._initializationPromise||Promise.resolve()).finally(()=>{this.applyLayoutConfiguration(),this.#p();const n=this.__instance__.plot.render(e);return this.__instance__.shortcut.render(),this.__instance__.panel.render(),n})}setView(t,e=null,s=null){return this.setData(e),this.setLayer(s),this.__instance__.plot.changeView(t)}setTitle(t){this.__instance__.header.setTitle(t)}setSubtitle(t){this.__instance__.header.setSubtitle(t)}setData(t){this.__parameters__.data=t||this.__parameters__.data,t&&this.__instance__?.plot&&(this.__instance__.plot.dataUpdated=!0)}setLayer(t){this.layer={...this.layer,...this.__instance__.plot.layer,...t||{},containers:this.__instance__.plot.layer.containers},this.__instance__.plot.layer=this.layer}update(t,e,s=null){if(this.__unmounted__)return Promise.resolve(this);if(this.setData(t),!this.__instance__?.plot)return Promise.resolve(this);this.setLayer(e);const n=s?.state??1,i=s?.skipSettingsPanel===!0;return(s?.skipDraw===!0?Promise.resolve():this.__instance__.plot._update(n,s)).then(()=>this.__unmounted__?this:(this.applyLayoutConfiguration(),i?this.__instance__.panel?.discardCollapsedSettings?.():this.runInBackground((()=>this.__instance__.panel.init().then(()=>this.__instance__.panel.render()))),this.runInBackground(this.__instance__.shortcut.render.bind(this.__instance__.shortcut)),this.__instance__.header.init()))}runInBackground(t,...e){return setTimeout(()=>{t(...e)})}#i(){this.#t=new ResizeObserver(()=>{this.#L()}),this.#y(this.__parameters__.parent),this.#s=()=>this.#L(),window.addEventListener("resize",this.#s)}#a(){const t=["header","shortcut"];for(const e of t)this.#y(this.__instance__?.[e]?.__node__);this.#y(this.getLayoutRegionNode("center")),this.#n=this.#l()}#l(){const t=this.#h(),e=this.__instance__;return[t.width,t.height,e?.header?.__node__?.offsetHeight??0,e?.shortcut?.__node__?.offsetHeight??0].join(":")}#h(){let t=0,e=0,s=this.__parameters__.parent;for(;s;){const n=s.clientWidth||0,i=s.clientHeight||0;if(t<=0&&n>0&&(t=n),e<=0&&i>0&&(e=i),t>0&&e>0)return{width:t,height:e};s=s.parentElement}return{width:t,height:e}}#p(){const t=this.#h();t.width>0&&(this.__parameters__.width=t.width),t.height>0&&(this.__parameters__.height=t.height)}#y(t){t&&this.#t&&this.#t.observe(t)}#L(){this.#r||(this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>this.#T(),K0))}#T(){if(!this.__node__){this.#u();return}if(!this.__instance__?.plot)return;const t=this.#h(),e=t.width,s=t.height;if(e<=0||s<=0)return;const n=this.#l();n!==this.#n&&(this.#r=!0,this.#n=n,this.__parameters__.width=e,this.__parameters__.height=s,this.__instance__.plot._update(0,{mode:"full",origin:"resize",state:0,backgroundState:0}),requestAnimationFrame(()=>{this.#n=this.#l(),this.#r=!1}))}#u(){this.#t?.disconnect(),this.#t=null,this.#m?.disconnect(),this.#m=null,this.#A?.disconnect(),this.#A=null,this.#E?.abort(),this.#E=null,this.#s&&(window.removeEventListener("resize",this.#s),this.#s=null),this.#e&&(clearTimeout(this.#e),this.#e=null)}checkCallback(t){let e=t.split("."),s=!1,n=this.__parameters__.callbacks,i=0;for(;i<e.length&&n;)n=n[e[i]],i++;return n&&(s=!0),s}runCallback(t,...e){let s=t.split("."),n=this.__parameters__.callbacks,i=0;for(;i<s.length&&n;)n=n[s[i]],i++;return n?n(...e):!1}__setupRootEventListeners(){const t=this.__parameters__?.callbacks?.root||{};Object.entries(t).forEach(([e,s])=>{this.__node__.removeEventListener(e,s),this.__node__.addEventListener(e,s)})}#c(){this.__nodes__||(this.__nodes__={}),Ta.forEach(t=>{const e=`plotter-region-${t}`,s=`${this.__parameters__.id}-region-${t}`;let n=this.__nodes__[t];if(!this.ownsNode(n)){const i=document.getElementById(s);n=this.ownsNode(i)?i:x.getNode("div",!1,["plotter-region",e],this.__node__),n.id=s,this.__nodes__[t]=n}}),this.#v()}ownsNode(t){return!(t instanceof HTMLElement)||!(this.__node__ instanceof HTMLElement)?!1:t===this.__node__||this.__node__.contains(t)}applyLayoutConfiguration(){this.__unmounted__||(this.#c(),this.#v(),this.#x(),this.#D(),this.#_())}#m=null;#o=null;#A=null;#E=null;#d=0;#_(){const t=this.__instance__?.shortcut?.__node__,e=t?.parentNode;if(!t||!e||typeof ResizeObserver!="function")return;const s=(l,c)=>{e.style.getPropertyValue(l)!==c&&e.style.setProperty(l,c)},n=()=>{if(t.querySelectorAll(`.${Xe}`).forEach(p=>{p.classList.remove(Xe)}),t.classList.remove(Zh),t.classList.contains(aa))return;const l=this.layer?.configuration?.behaviors?.displayShortcutsOnHover===!0,c=this.__instance__?.header?.__nodes__?.title||e.querySelector(Z0);this.#f(t,e),this.#g(t,l?c:null);const h=t.offsetWidth,u=!l&&Number.isFinite(h)&&h>0?Math.ceil(h):0;s("--plotter-shortcuts-width",`${u}px`),s("--plotter-shortcuts-reserve-height",u>0?"40px":"0px"),e.offsetWidth;const d=qh(t,c);t.classList.contains(Xh)!==d&&t.classList.toggle(Xh,d)};let i=null;const r=()=>{if(typeof requestAnimationFrame!="function"){n();return}i==null&&(i=requestAnimationFrame(()=>{i=null,n()}))};this.#o=r,this.#m?.disconnect(),this.#A?.disconnect(),this.#m=new ResizeObserver(r),this.#m.observe(t),this.#m.observe(e);const a=this.__instance__?.header?.__node__;a instanceof HTMLElement&&(this.#m.observe(a),this.#A=new MutationObserver(r),this.#A.observe(a,{childList:!0,subtree:!0,characterData:!0})),n(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(n)}toggleShortcutsExpanded(){const t=this.__instance__?.shortcut?.__node__;if(!t)return;if(this.#E?.abort(),this.#E=null,t.classList.toggle(aa)){const s=new AbortController;this.#E=s;const n=()=>{s.abort(),t.classList.remove(aa),this.#o?.()};document.addEventListener("pointerdown",i=>{i.target?.closest?.(".plotter-shortcuts, .plotter-input-select-dropdown")||n()},{signal:s.signal}),document.addEventListener("keydown",i=>{i.key==="Escape"&&n()},{signal:s.signal})}this.#o?.()}#C(t){return[...t.children].flatMap(e=>e.classList.contains("plotter-shortcuts-button-group")||getComputedStyle(e).display==="contents"?this.#C(e):e.getBoundingClientRect().width>0?[e]:[])}#S(t){const e=this.#C(t),s=Number.parseFloat(getComputedStyle(t).columnGap)||0;return e.reduce((i,r)=>i+r.getBoundingClientRect().width,0)+s*Math.max(0,e.length-1)-t.clientWidth}#g(t,e){const s=t.querySelector(".plotter-shortcuts-main");if(!(s instanceof HTMLElement))return;const n=t.getBoundingClientRect(),i=e?Math.max(0,...oa(e).filter(p=>p.top<n.bottom&&p.bottom>n.top).map(p=>p.right)):0,r=()=>this.#S(s)>1||i>0&&t.getBoundingClientRect().left<i+X0;if(!r())return;t.classList.add(Zh);const a=this.#C(s),l=p=>p?.matches?.(".plotter-divider, .datama-divider, .plotter-shortcuts-separator"),c=p=>p?.parentNode===s?p.matches("button"):l(p);for(let p=0;p<a.length&&r();p+=1)for(a[p].classList.add(Xe);c(a[p+1]);)p+=1,a[p].classList.add(Xe);const h=a.filter(p=>!p.classList.contains(Xe)),u=h.slice(0,Math.max(0,h.findIndex(p=>!l(p))));(h.every(l)?[...h,t.querySelector(".plotter-shortcuts-content > .plotter-divider")]:u).forEach(p=>p?.classList.add(Xe))}#f(t,e){const s=t.querySelector(".plotter-shortcuts-main");if(!(s instanceof HTMLElement))return;const n=t.classList.contains(ra),i=this.#S(s);!n&&i>1?(this.#d=t.offsetWidth+i,t.classList.add(ra)):n&&e.clientWidth>=this.#d&&t.classList.remove(ra)}#x(){const t=this.layer?.configuration||{},e={header:this.__instance__?.header,shortcut:this.__instance__?.shortcut};Object.entries(e).forEach(([i,r])=>{const a=r?.__node__,l=this.getLayoutRegionNode(Kn(i,t));a&&this.ownsNode(l)&&a.parentNode!==l&&l.append(a)});const s=this.__instance__?.plot?.instances?.legends?.__nodes__?.legends||this.__instance__?.plot?.instances?.legends?.__node__,n=Kn("legend",t);if(s&&(n==="top"||n==="bottom")){const i=this.getLayoutRegionNode(n);this.ownsNode(i)&&s.parentNode!==i&&i.append(s)}}getLayoutRegionNode(t){return this.#c(),this.__nodes__?.[t]||null}getChromeRegionNode(t){const e=this.layer?.configuration||{},s=Kn(t,e);return this.getLayoutRegionNode(s)||this.__node__}collapseSettingsPanel(){this.__instance__?.panel?.collapseIfExpanded?.()}notifySettingsChange(t={}){const e=!!t.persist,s=!!t.analysis,n=this.__parameters__?.onSettingsChange;try{typeof n=="function"&&n({persist:e,analysis:s})}finally{this.__instance__?.panel?.applySettingsChangeFlags?.({persist:e,analysis:s})}}markSettingsPersistDirty(){this.notifySettingsChange({persist:!0})}rebuildAnalysisSettingsPanels(){this.__instance__?.panel?.rebuildAnalysisSettingsPanels?.()}#v(){const t={top:1,left:2,center:3,right:4,bottom:5};Ta.forEach(e=>{const s=this.__nodes__?.[e];s&&(s.style.order=String(t[e]))})}#D(){const t={header:this.__instance__?.header,shortcut:this.__instance__?.shortcut,legend:this.__instance__?.plot?.instances?.legends};Object.entries(t).forEach(([e,s])=>{const n=s?.__node__||s?.__nodes__?.legends;n&&(n.style.order=String(Xn(e)))})}__createComponentInstances(){return{header:new bd({parent:this,id:this.__parameters__.id+"-header"}),shortcut:new Vm({parent:this,id:this.__parameters__.id+"-shortcut"}),plot:new ot({id:this.__parameters__.id+"-plot",parent:this,callbacks:this.__parameters__.callbacks?.plot||{},hooks:this.__parameters__.hooks}),panel:new Ke({id:this.__parameters__.id+"-panel",parent:this,contents:this.layer?.panel||[],hideShortcuts:this.__parameters__.hideShortcuts??!0}),contextMenu:new j0({parent:this,id:this.__parameters__.id+"-contextMenu"})}}}Qe.Plotter=Tt,Qe.doPlotterRectsOverlap=Qh,Qe.doesPlotterShortcutCoverTitle=qh,Qe.getPlotterTitleContentClientRects=oa,Object.defineProperty(Qe,Symbol.toStringTag,{value:"Module"})})(this.Plotter=this.Plotter||{});
|