@toclocoinc/lattice-grid 1.88.2 → 1.88.3
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/angular/fesm2022/toclocoinc-lattice-grid-angular.mjs +6 -2
- package/angular/package.json +1 -1
- package/angular/types/toclocoinc-lattice-grid-angular.d.ts +3 -1
- package/docs/API.html +62 -6
- package/docs/api/adapters.html +1 -1
- package/docs/api/ai.html +1 -1
- package/docs/api/alarms.html +1 -1
- package/docs/api/calendar.html +1 -1
- package/docs/api/charts.html +1 -1
- package/docs/api/dashboard.html +1 -1
- package/docs/api/data-router.html +1 -1
- package/docs/api/deckgl.html +1 -1
- package/docs/api/gantt.html +58 -2
- package/docs/api/geometry.html +1 -1
- package/docs/api/grid.html +2 -2
- package/docs/api/index.html +2 -2
- package/docs/api/kanban.html +1 -1
- package/docs/api/kpi.html +1 -1
- package/docs/api/layout.html +1 -1
- package/docs/api/leaflet.html +1 -1
- package/docs/api/list.html +1 -1
- package/docs/api/mapview.html +1 -1
- package/docs/api/mock-socket.html +1 -1
- package/docs/api/presets.html +1 -1
- package/docs/api/tabs.html +1 -1
- package/docs/api/types.html +2 -2
- package/docs/api-detail.html +4 -4
- package/docs/warnings.json +1 -1
- package/lattice-grid.d.ts +1 -1
- package/lattice-grid.esm.min.js +3 -3
- package/lattice-grid.min.cjs +3 -3
- package/lattice-grid.min.js +3 -3
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +2 -2
- package/modules/ai.min.cjs +2 -2
- package/modules/ai.min.js +2 -2
- package/modules/alarms.d.ts +1 -1
- package/modules/alarms.esm.min.js +2 -2
- package/modules/alarms.min.cjs +2 -2
- package/modules/alarms.min.js +2 -2
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/calendar.d.ts +1 -1
- package/modules/calendar.esm.min.js +2 -2
- package/modules/calendar.min.cjs +2 -2
- package/modules/calendar.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-barrace.d.ts +1 -1
- package/modules/chart-barrace.esm.min.js +1 -1
- package/modules/chart-barrace.min.cjs +1 -1
- package/modules/chart-barrace.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bubblemap.min.cjs +1 -1
- package/modules/chart-bubblemap.min.js +1 -1
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-choropleth.d.ts +1 -1
- package/modules/chart-choropleth.esm.min.js +1 -1
- package/modules/chart-choropleth.min.cjs +1 -1
- package/modules/chart-choropleth.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-forcetree.d.ts +1 -1
- package/modules/chart-forcetree.esm.min.js +1 -1
- package/modules/chart-forcetree.min.cjs +1 -1
- package/modules/chart-forcetree.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-hexmap.min.cjs +1 -1
- package/modules/chart-hexmap.min.js +1 -1
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-markermap.d.ts +1 -1
- package/modules/chart-markermap.esm.min.js +1 -1
- package/modules/chart-markermap.min.cjs +1 -1
- package/modules/chart-markermap.min.js +1 -1
- package/modules/chart-motion.d.ts +1 -1
- package/modules/chart-motion.esm.min.js +1 -1
- package/modules/chart-motion.min.cjs +1 -1
- package/modules/chart-motion.min.js +1 -1
- package/modules/chart-pack.d.ts +1 -1
- package/modules/chart-pack.esm.min.js +1 -1
- package/modules/chart-pack.min.cjs +1 -1
- package/modules/chart-pack.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-pictorial.d.ts +1 -1
- package/modules/chart-pictorial.esm.min.js +1 -1
- package/modules/chart-pictorial.min.cjs +1 -1
- package/modules/chart-pictorial.min.js +1 -1
- package/modules/chart-polararea.d.ts +1 -1
- package/modules/chart-polararea.esm.min.js +1 -1
- package/modules/chart-polararea.min.cjs +1 -1
- package/modules/chart-polararea.min.js +1 -1
- package/modules/chart-polarscatter.d.ts +1 -1
- package/modules/chart-polarscatter.esm.min.js +1 -1
- package/modules/chart-polarscatter.min.cjs +1 -1
- package/modules/chart-polarscatter.min.js +1 -1
- package/modules/chart-pyramid.d.ts +1 -1
- package/modules/chart-pyramid.esm.min.js +1 -1
- package/modules/chart-pyramid.min.cjs +1 -1
- package/modules/chart-pyramid.min.js +1 -1
- package/modules/chart-radialbar.d.ts +1 -1
- package/modules/chart-radialbar.esm.min.js +1 -1
- package/modules/chart-radialbar.min.cjs +1 -1
- package/modules/chart-radialbar.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-serpentine.d.ts +1 -1
- package/modules/chart-serpentine.esm.min.js +1 -1
- package/modules/chart-serpentine.min.cjs +1 -1
- package/modules/chart-serpentine.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-spiral.d.ts +1 -1
- package/modules/chart-spiral.esm.min.js +1 -1
- package/modules/chart-spiral.min.cjs +1 -1
- package/modules/chart-spiral.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-tree.d.ts +1 -1
- package/modules/chart-tree.esm.min.js +1 -1
- package/modules/chart-tree.min.cjs +1 -1
- package/modules/chart-tree.min.js +1 -1
- package/modules/chart-venn.d.ts +1 -1
- package/modules/chart-venn.esm.min.js +1 -1
- package/modules/chart-venn.min.cjs +1 -1
- package/modules/chart-venn.min.js +1 -1
- package/modules/chart-voronoi.d.ts +1 -1
- package/modules/chart-voronoi.esm.min.js +1 -1
- package/modules/chart-voronoi.min.cjs +1 -1
- package/modules/chart-voronoi.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/chart-wordcloud.d.ts +1 -1
- package/modules/chart-wordcloud.esm.min.js +1 -1
- package/modules/chart-wordcloud.min.cjs +1 -1
- package/modules/chart-wordcloud.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +2 -2
- package/modules/charts.min.cjs +2 -2
- package/modules/charts.min.js +2 -2
- package/modules/dashboard.d.ts +1 -1
- package/modules/dashboard.esm.min.js +2 -2
- package/modules/dashboard.min.cjs +2 -2
- package/modules/dashboard.min.js +2 -2
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +2 -2
- package/modules/data-router.min.cjs +2 -2
- package/modules/data-router.min.js +2 -2
- package/modules/deckgl.d.ts +1 -1
- package/modules/deckgl.esm.min.js +2 -2
- package/modules/deckgl.min.cjs +2 -2
- package/modules/deckgl.min.js +2 -2
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +1 -1
- package/modules/devtools.min.cjs +1 -1
- package/modules/devtools.min.js +1 -1
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +2 -2
- package/modules/dhtmlx-compat.min.cjs +2 -2
- package/modules/dhtmlx-compat.min.js +2 -2
- package/modules/gantt.d.ts +58 -3
- package/modules/gantt.esm.min.js +223 -217
- package/modules/gantt.esm.min.js.map +2 -2
- package/modules/gantt.min.cjs +222 -216
- package/modules/gantt.min.js +222 -216
- package/modules/gantt.min.js.map +2 -2
- package/modules/geo-europe-nuts.d.ts +1 -1
- package/modules/geo-europe-nuts.esm.min.js +1 -1
- package/modules/geo-europe-nuts.min.cjs +1 -1
- package/modules/geo-europe-nuts.min.js +1 -1
- package/modules/geo-uk.d.ts +1 -1
- package/modules/geo-uk.esm.min.js +1 -1
- package/modules/geo-uk.min.cjs +1 -1
- package/modules/geo-uk.min.js +1 -1
- package/modules/geo-us-states.d.ts +1 -1
- package/modules/geo-us-states.esm.min.js +1 -1
- package/modules/geo-us-states.min.cjs +1 -1
- package/modules/geo-us-states.min.js +1 -1
- package/modules/geo-world-110m.d.ts +1 -1
- package/modules/geo-world-110m.esm.min.js +1 -1
- package/modules/geo-world-110m.min.cjs +1 -1
- package/modules/geo-world-110m.min.js +1 -1
- package/modules/geo-world-50m.d.ts +1 -1
- package/modules/geo-world-50m.esm.min.js +1 -1
- package/modules/geo-world-50m.min.cjs +1 -1
- package/modules/geo-world-50m.min.js +1 -1
- package/modules/geometry.d.ts +1 -1
- package/modules/geometry.esm.min.js +2 -2
- package/modules/geometry.min.cjs +2 -2
- package/modules/geometry.min.js +2 -2
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +3 -3
- package/modules/htmx.min.cjs +3 -3
- package/modules/htmx.min.js +3 -3
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +2 -2
- package/modules/kanban.min.cjs +2 -2
- package/modules/kanban.min.js +2 -2
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +2 -2
- package/modules/kpi.min.cjs +2 -2
- package/modules/kpi.min.js +2 -2
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +2 -2
- package/modules/layout.min.cjs +2 -2
- package/modules/layout.min.js +2 -2
- package/modules/leaflet.d.ts +1 -1
- package/modules/leaflet.esm.min.js +2 -2
- package/modules/leaflet.min.cjs +2 -2
- package/modules/leaflet.min.js +2 -2
- package/modules/list.d.ts +1 -1
- package/modules/list.esm.min.js +2 -2
- package/modules/list.min.cjs +2 -2
- package/modules/list.min.js +2 -2
- package/modules/mapview.d.ts +1 -1
- package/modules/mapview.esm.min.js +2 -2
- package/modules/mapview.min.cjs +2 -2
- package/modules/mapview.min.js +2 -2
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +1 -1
- package/modules/mock-socket.min.cjs +1 -1
- package/modules/mock-socket.min.js +1 -1
- package/modules/presets.d.ts +1 -1
- package/modules/presets.esm.min.js +2 -2
- package/modules/presets.min.cjs +2 -2
- package/modules/presets.min.js +2 -2
- package/modules/react.d.ts +1 -1
- package/modules/react.esm.min.js +2 -2
- package/modules/react.esm.min.js.map +1 -1
- package/modules/react.min.cjs +2 -2
- package/modules/react.min.js +2 -2
- package/modules/react.min.js.map +1 -1
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +3 -3
- package/modules/svelte.esm.min.js.map +1 -1
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/svelte.min.js.map +1 -1
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +2 -2
- package/modules/tabs.min.cjs +2 -2
- package/modules/tabs.min.js +2 -2
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.esm.min.js.map +1 -1
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/vue.min.js.map +1 -1
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +4 -4
- package/modules/webcomponent.esm.min.js.map +1 -1
- package/modules/webcomponent.min.cjs +4 -4
- package/modules/webcomponent.min.js +4 -4
- package/modules/webcomponent.min.js.map +1 -1
- package/package.json +1 -1
package/modules/charts.min.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.88.
|
|
2
|
+
* Lattice Grid 1.88.3, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,ie){Dr[r]=ie}function Gr(r){var ie=Br[r];if(ie)return ie;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,ie){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return V}});const Oe="http://www.w3.org/2000/svg";function ue(Y){const k=Y.indexOf(")");return k<0?Y:Y.slice(k+1).trim()||"#0072b2"}function j(Y,k,g){const u=Y.createElement(k);return g&&u.setAttribute("class",g),u}function Se(Y,k,g){const u=Y.createElementNS(Oe,k);if(g)for(const y of Object.keys(g))u.setAttribute(y,String(g[y]));return u}function Ae(Y,k,g){if(!Y)return;if(g==null){Y.removeAttribute(k);return}let u=String(g);u.startsWith("url(#")&&(k==="stroke"||k==="fill"&&Y.localName==="text")&&(u=ue(u)),Y.setAttribute(k,u)}function he(Y,k){if(Y)for(const g of Object.keys(k))Ae(Y,g,k[g])}function se(Y,k){Y&&(Y.textContent=k==null?"":String(k))}function J(Y){if(Y)for(;Y.firstChild;)Y.removeChild(Y.firstChild)}function ae(Y,k){for(const g of k)g&&Y.appendChild(g);return Y}function _(Y){return Y.join(" ")}function v(Y){if(!Y||Y.length<2)return"";const k=["M",Y[0].x,Y[0].upper];for(let g=1;g<Y.length;g++)k.push("L",Y[g].x,Y[g].upper);for(let g=Y.length-1;g>=0;g--)k.push("L",Y[g].x,Y[g].lower);return k.push("Z"),_(k)}function C(Y){return Math.round(Y*100)/100}function h(Y){const k=[];let g=[];const u=String(Y||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let y="",N=[];const ee=()=>{if(!y||!N.length){N=[];return}if(y==="M"||y==="L")for(let p=0;p+1<N.length;p+=2)g.push([N[p],N[p+1]]);else y!=="Z"&&N.length>=2&&g.push([N[N.length-2],N[N.length-1]]);N=[]};for(const p of u){if(/[A-Za-z]/.test(p)){if(ee(),p==="Z"||p==="z"){g.length>2&&k.push(g),g=[],y="";continue}p==="M"&&g.length>2&&(k.push(g),g=[]),y=p;continue}N.push(Number(p))}return ee(),g.length>2&&k.push(g),k}function V(Y,k,g){let u=!1;for(const y of Y)for(let N=0,ee=y.length-1;N<y.length;ee=N++){const[p,I]=y[N],[a,A]=y[ee];I>g!=A>g&&k<(a-p)*(g-I)/(A-I||1e-12)+p&&(u=!u)}return u}}),at("packages/modules/charts/typography.js",function(r,ie){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ae}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Se(_){const v=_&&_.font,C=typeof v=="number"?{size:v}:v||{},h=Ae(C.size,Oe);return{family:C.family||ue,size:h,small:Ae(C.small??C.tickSize,Math.max(9,h-1)),title:Ae(C.title,Math.round(h*1.15)),axisTitle:Ae(C.axisTitle,Math.max(10,h-1)),weight:C.weight||"inherit"}}function Ae(_,v){const C=Number(_);return Number.isFinite(C)&&C>0?C:v}function he(_,v){return String(_??"").length*v*j}function se(_,v){let C=0;for(const h of _||[]){const V=he(h,v);V>C&&(C=V)}return C}function J(_,v,C){const h=String(_??""),V=Math.floor(v/(C*j));return V<=0?"":h.length<=V?h:V===1?"…":`${h.slice(0,V-1)}…`}function ae(_,v){!_||!Number.isFinite(v)||(_.style?_.style.fontSize=`${v}px`:_.setAttribute("style",`font-size:${v}px`))}}),at("packages/modules/charts/frame.js",function(r,ie){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return C}});const ue=ie("packages/modules/charts/svg.js").SVG_NS,j=ie("packages/modules/charts/typography.js"),Se=j.textWidth,Ae=j.widestLabel,he=8,se=6,J=.4;function ae(h,V){const Y=typeof h=="number"?h:V,k=h&&typeof h=="object"?h:{},g=u=>Number.isFinite(u)&&u>=0?Number(u):Y;return{base:Y,top:g(k.top),right:g(k.right),bottom:g(k.bottom),left:g(k.left)}}function _(h){const V=ae(h.margin,typeof h.padding=="number"?h.padding:8),Y=V.base,k=h.fontSize||12,g=h.yLabels||[],u=h.xLabels||[],y=h.ySide==="right"?"right":"left",N=y==="right"?"left":"right",ee=h.titles||{},p=h.titleSize||k,I=te=>te?p+se:0,a=Ae(g,k),A=g.length?Math.min(h.width*J,V[y]+a+se):Math.max(he,V[y]),E=V[N]+(h.rightGutter||0),m=(y==="left"?A:E)+I(ee.left),f=Ae(u.map(te=>String(te).slice(0,14)),k),L=(u.length?h.rotated?Math.min(h.height*J,se+f):k+se+V.bottom:Math.max(he,V.bottom))+I(ee.bottom),q=(y==="right"?A:E)+I(ee.right),Q=V.top+(h.topGutter||0),pe=Math.max(0,h.width-m-q),ce=Math.max(0,h.height-Q-L);return{left:m,top:Q,width:pe,height:ce,right:m+pe,bottom:Q+ce,gutter:{left:m,bottom:L,right:q,top:Q}}}function v(h,V,Y,k){if(!h.length||V<=0)return!1;const g=Number.isFinite(k)&&k>0?Number(k):1;return Ae(h,Y)>V*g-4}class C{#r;#n=0;static#i="data-pool-key";constructor(V,Y=0){this.#r=V,this.#n=Y>0?Y:0}next(V,Y,k){if(k!=null)return this.#e(V,Y,String(k));const g=this.#r.childNodes[this.#n],u=g&&g.tagName,y=/(^|\s)\S*__axis-title(\s|$)/,N=u&&y.test(String(g.getAttribute("class")||"")),ee=!!Y&&y.test(String(Y));if(u&&(!N||ee)&&String(u).toLowerCase()===V.toLowerCase())return Y&&g.setAttribute("class",Y),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,V);return Y&&p.setAttribute("class",Y),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(V,Y,k){const g=V.toLowerCase();for(let N=this.#n;N<this.#r.childNodes.length;N++){const ee=this.#r.childNodes[N],p=ee&&ee.tagName;if(p&&String(p).toLowerCase()===g&&ee.getAttribute(C.#i)===k)return N!==this.#n&&this.#r.insertBefore(ee,this.#r.childNodes[this.#n]),Y&&ee.setAttribute("class",Y),this.#n++,ee}const u=this.#r.ownerDocument.createElementNS(ue,V);u.setAttribute(C.#i,k),Y&&u.setAttribute("class",Y);const y=this.#r.childNodes[this.#n];return y?this.#r.insertBefore(u,y):this.#r.appendChild(u),this.#n++,u}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,ie){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return A}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return q}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return l}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return T}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return U}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return le}});const Oe="1.88.2";async function ue(){return Oe}const j="1.88.2",Se=new Set,Ae=2e3;function he($){if(Se.add($),Se.size>Ae){const B=Se.values().next().value;B!==void 0&&Se.delete(B)}}const se=[],J=500;function ae($,B,oe){se.push({key:$,level:B,message:oe.map(i=>typeof i=="string"?i:_(i)).join(" "),at:Date.now()}),se.length>J&&se.shift()}function _($){if($ instanceof Error)return $.message;try{return JSON.stringify($)}catch{return String($)}}function v(){return se.map($=>({...$}))}function C($){if($.length===0||typeof $[0]!="string")return $;const B=$[0].replace(/^\[lattice\]\s*/,"");return B===$[0]?$:[B,...$.slice(1)]}function h($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"warn",oe),console.warn("[lattice]",...oe)}function V($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"info",oe),console.info("[lattice]",...oe)}function Y(){Se.clear(),se.length=0}function k($,B){const oe=new Error(`[lattice] ${$}`);throw B!==void 0&&(oe.cause=B),oe}function g($,B){$||k(B)}const u=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function y($){return $!==null&&typeof $=="object"&&!Array.isArray($)}function N($){return typeof $=="function"}function ee($){return $==null}function p($){return $==null||$===""}function I($){return typeof $!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call($))?!0:!!($.prototype&&Object.getOwnPropertyNames($.prototype).length>1)}const a=new Map;function A($){let B=a.get($);if(B)return B;if(!$.includes("."))B=oe=>oe?.[$];else{const oe=$.split("."),i=oe.length;B=s=>{let n=s;for(let M=0;M<i;M++){if(n==null)return;n=n[oe[M]]}return n}}return a.set($,B),B}const E=new Map;function m($){let B=E.get($);if(B)return B;if(!$.includes("."))B=(oe,i)=>{oe!=null&&(oe[$]=i)};else{const oe=$.split("."),i=oe.length-1;B=(s,n)=>{let M=s;for(let o=0;o<i;o++){if(M==null)return;const x=oe[o];M[x]==null&&(M[x]={}),M=M[x]}M!=null&&(M[oe[i]]=n)}}return E.set($,B),B}function f($,B){return A(B)($)}function L($,B,oe){m(B)($,oe)}function q($){return $?($.includes(".")?$.slice($.lastIndexOf(".")+1):$).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,oe=>oe.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function pe($){const B=$==null?"":String($);return/[&<>"']/.test(B)?B.replace(/[&<>"']/g,oe=>Q[oe]):B}function ce($){return String($).replace(/\w\S*/g,B=>B[0].toUpperCase()+B.slice(1).toLowerCase())}function te($,B,oe){if($!==void 0)return $===!0?{enabled:!0,...oe}:$===!1?{enabled:!1}:y($)?$:{[B]:$,enabled:!0}}function H($){return $==null?[]:Array.isArray($)?$:[$]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function l($,B){if(!y($))return y(B)?{...B}:B;if(!y(B))return B===void 0?$:B;const oe={...$};for(const i of Object.keys(B)){if(D.has(i))continue;const s=B[i];s!==void 0&&(oe[i]=y(s)&&y(oe[i])?l(oe[i],s):s)}return oe}function t($,B){if(!y($)||!y(B)||$===B)return B;const oe=Object.create(Object.getPrototypeOf($));return Object.assign(oe,$,B),oe}class e{#r;#n=new Map;#i;constructor(B=256,oe=null){this.#r=B,this.#i=oe}get size(){return this.#n.size}get max(){return this.#r}set max(B){this.#r=B,this.#e()}has(B){return this.#n.has(B)}get(B){const oe=this.#n;if(!oe.has(B))return;const i=oe.get(B);return oe.delete(B),oe.set(B,i),i}peek(B){return this.#n.get(B)}set(B,oe){const i=this.#n;return i.has(B)&&i.delete(B),i.set(B,oe),this.#e(),oe}delete(B){const oe=this.#n.get(B);return this.#n.delete(B)&&this.#i&&this.#i(oe,B),oe}clear(){if(this.#i)for(const[B,oe]of this.#n)this.#i(oe,B);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const B=this.#n;for(;B.size>this.#r;){const oe=B.keys().next().value,i=B.get(oe);B.delete(oe),this.#i&&this.#i(i,oe)}}}const d=new Map;function P($,B){const oe=`${$||""}|${B?JSON.stringify(B):""}`;let i=d.get(oe);return i||(i=new Intl.Collator($||void 0,{numeric:!0,sensitivity:"variant",...B}),d.set(oe,i)),i}function O($,B){if($===B)return 0;if($==null)return 1;if(B==null)return-1;if(typeof $=="number"&&typeof B=="number")return Number.isNaN($)?Number.isNaN(B)?0:1:Number.isNaN(B)||$<B?-1:$>B?1:0;const oe=String($),i=String(B);return oe<i?-1:oe>i?1:0}function T(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function R($){return W?requestAnimationFrame($):setTimeout(()=>$(T()),16)}function b($){$!=null&&(W?cancelAnimationFrame($):clearTimeout($))}function U($){let B=null,oe=null;const i=()=>{B=null;const n=oe;oe=null,$(...n||[])},s=(...n)=>{oe=n,B===null&&(B=R(i))};return s.cancel=()=>{b(B),B=null,oe=null},s.flush=()=>{B!==null&&(b(B),i())},s}function re($,B){let oe=null,i=null;const s=()=>{if(oe=null,i===null)return;const o=i;i=null,$(...o),n()},n=()=>{oe=setTimeout(s,B),typeof oe?.unref=="function"&&oe.unref()},M=(...o)=>{oe===null?($(...o),n()):(i=o,clearTimeout(oe),n())};return M.flush=()=>{if(oe!==null&&clearTimeout(oe),oe=null,i===null)return;const o=i;i=null,$(...o)},M.cancel=()=>{oe!==null&&clearTimeout(oe),oe=null,i=null},M.pending=()=>oe!==null||i!==null,M}function ne($,B=50){return typeof requestIdleCallback=="function"?requestIdleCallback($,{timeout:B}):setTimeout(()=>$({timeRemaining:()=>0,didTimeout:!0}),1)}let G=0;function le($="l"){return`${$}${(++G).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,ie){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return ee}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Se=Object.freeze(["linear","radial"]),Ae=8,he="#0072b2";let se=0;const J=new Map;function ae(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function _(p){return typeof p=="string"&&p.startsWith("url(#")}function v(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const I=p.indexOf(")");return(I<0?"":p.slice(I+1).trim())||he}function C(p,I){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${I} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function h(p,I){if(!ae(p))return null;const a=I||he;if(typeof p.gradient=="string"){if(!Se.includes(p.gradient))return C("gradient",`the gradient "${p.gradient}" is not one of ${Se.join(", ")}.`),null;const f=Array.isArray(p.stops)?p.stops:[],L=[];for(const Q of f){const pe=Array.isArray(Q)?Number(Q[0]):Number(Q&&Q.offset),ce=Array.isArray(Q)?Q[1]:Q&&Q.colour;!Number.isFinite(pe)||typeof ce!="string"||!ce||L.push({offset:Math.min(1,Math.max(0,pe)),colour:ce})}if(L.length<2)return C("stops","a gradient needs at least two [offset, colour] stops."),null;L.sort((Q,pe)=>Q.offset-pe.offset);const q=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:q,stops:L,solid:L[0].colour}}if(!j.includes(p.pattern))return C("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const A=Number(p.size),E=Number(p.angle),m=typeof p.colour=="string"&&p.colour?p.colour:a;return{kind:"pattern",pattern:p.pattern,colour:m,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(A)&&A>=2?A:Ae,angle:Number.isFinite(E)?E:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:m}}function V(p){if(p.kind==="pattern"){const a=p.colour,A=p.size,E=Math.max(1,A/5),m=p.background||"transparent",f=L=>`repeating-linear-gradient(${L+90}deg,${a} 0 ${E}px,transparent ${E}px ${A}px)`;return p.pattern==="hatch"?`${f(p.angle)},${m}`:p.pattern==="crosshatch"?`${f(p.angle)},${f(p.angle+90)},${m}`:p.pattern==="grid"?`${f(p.angle)},${f(p.angle+90)},${m}`:`radial-gradient(circle at 50% 50%,${a} ${A/6}px,transparent ${A/6+.5}px) 0 0/${A}px ${A}px,${m}`}const I=p.stops.map(a=>`${a.colour} ${Math.round(a.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${I})`:`linear-gradient(${p.angle}deg,${I})`}function Y(p){if(!_(p))return typeof p=="string"?p:"";const I=String(p).indexOf(")"),a=String(p).slice(5,I),A=J.get(a);return A?V(A):v(p)}function k(p){const I=`lattice-fill-${++se}`;let a=new Map,A=0;const E=(f,L)=>{const q=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",f);for(const Q of Object.keys(L))q.setAttribute(Q,String(L[Q]));return q},m=(f,L)=>{if(L.kind==="pattern"){const Q=L.size,pe=Math.max(1,Q/5),ce=E("pattern",{id:f,width:Q,height:Q,patternUnits:"userSpaceOnUse"});L.angle&&ce.setAttribute("patternTransform",`rotate(${L.angle})`),L.background&&ce.appendChild(E("rect",{width:Q,height:Q,fill:L.background}));const te={stroke:L.colour,"stroke-width":pe};L.pattern==="dots"?ce.appendChild(E("circle",{cx:Q/2,cy:Q/2,r:Math.max(1,Q/6),fill:L.colour})):(ce.appendChild(E("line",{x1:Q/2,y1:0,x2:Q/2,y2:Q,...te})),L.pattern!=="hatch"&&ce.appendChild(E("line",{x1:0,y1:Q/2,x2:Q,y2:Q/2,...te}))),p.appendChild(ce);return}let q;if(L.kind==="radial")q=E("radialGradient",{id:f,cx:.5,cy:.5,r:.5});else{const Q=L.angle*Math.PI/180,pe=Math.sin(Q)/2,ce=-Math.cos(Q)/2;q=E("linearGradient",{id:f,x1:+(.5-pe).toFixed(4),y1:+(.5-ce).toFixed(4),x2:+(.5+pe).toFixed(4),y2:+(.5+ce).toFixed(4)})}for(const Q of L.stops)q.appendChild(E("stop",{offset:Q.offset,"stop-color":Q.colour}));p.appendChild(q)};return{prefix:I,paint(f,L){const q=h(f,L);if(!q)return L||he;if(!p||!p.ownerDocument)return q.solid;const Q=JSON.stringify(q);let pe=a.get(Q);if(!pe){const ce=`${I}-${A++}`;m(ce,q),J.set(ce,q),pe=`url(#${ce}) ${q.solid}`,a.set(Q,pe)}return pe},reset(){for(const f of a.values())J.delete(f.slice(5,f.indexOf(")")));if(a=new Map,A=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...a.values()].map(f=>f.slice(5,f.indexOf(")")))}}}function g(p,I,a){if(p==null||p==="")return null;const A=v(a);if(ae(p))return I?I.paint(p,A):(h(p,A)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const E={pattern:p,colour:A};return I?I.paint(E,A):A}return p}return null}function u(p){const I=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((a,A)=>({...I[A%I.length],colour:a,background:"var(--lattice-background, #fff)"}))}function y(p){return _(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function N(p,I){const a=p.fill;if(ae(a))return(E,m)=>g(a,I.fills,y(m));if(typeof a=="function")return(E,m)=>{let f=null;try{f=a({label:E.label,x:E.x,y:E.y,rowKey:E.rowKey})}catch{f=null}return g(f,I.fills,y(m))};const A=typeof a=="string"?a:a&&typeof a=="object"&&typeof a.col=="string"?a.col:null;return A?(E,m)=>E.rowKey===void 0||E.rowKey===null?null:g(p.grid.rows.value(E.rowKey,A),I.fills,y(m)):null}function ee(p,I,a){return p&&p({label:I.label,x:I.value,y:I.total,rowKey:I.rowKey},a)||a}}),at("packages/modules/charts/scheme.js",function(r,ie){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return I}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=ie("packages/modules/charts/fills.js"),Se=j.isFill,Ae=j.patternSeries,he=j.rowPaint,se=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),J=Object.freeze({default:{series:se,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Ae(se),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ae=new Map;let _="default";function v(a,A){!a||!A||ae.set(String(a),A)}function C(a){if(typeof a=="string"){_=a;return}a&&typeof a=="object"&&(ae.set("__default__",a),_="__default__")}function h(){return[...Object.keys(J),...ae.keys()].filter(a=>!a.startsWith("__"))}function V(a){return ae.has(a)?ae.get(a):J[a]||null}const Y=["series","sequential","diverging","positive","negative"];function k(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!Y.some(A=>A in a)}function g(a,A){const E=A&&A.fills||null,m=V(_)||J.default,f=a&&a.scheme,L=k(f)?f:null,q=Array.isArray(f)&&f.length?f:null,Q=typeof f=="string"?V(f):L||Array.isArray(f)?null:f||null,pe=(a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null)||q;L&&pe&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const ce=L?null:pe,te={...J.default,...m,...Q||{}};ce&&(te.series=ce);const H=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,D=H?H.colours:a&&a.ramp,l=Array.isArray(D)&&D.length>=2?D:null;l&&(te.sequential=l);const t=H?N(H.scale):null,e=!!(Q||ce||L),d=te.series&&te.series.length?te.series:se,P=new Map;let O=0;return{...te,series:(W,R)=>{if(L&&R!==void 0&&R!==null){const b=String(R);return Object.prototype.hasOwnProperty.call(L,b)?u(L[b],E,W):(P.has(b)||P.set(b,O++),u(ee(d,P.get(b),!0),E,P.get(b)))}return u(ee(d,W,e),E,W)},explicit:e,nameMap:!!L,rampScale:t,fills:E}}function u(a,A,E){if(!Se(a))return a;const m=se[(E%se.length+se.length)%se.length];return he(a,A,m)||m}const y=Object.freeze(["linear","log","quantile"]);function N(a){return a==null?null:y.includes(a)?a:(ue(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function ee(a,A,E){const m=(A%a.length+a.length)%a.length;return E||typeof a[m]!="string"?a[m]:`var(--lattice-chart-${m+1}, ${a[m]})`}function p(a){if(typeof a!="string")return null;const A=a.trim(),E=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(A);if(E){const L=E[1];return L.length===3?[0,1,2].map(q=>parseInt(L[q]+L[q],16)):[0,2,4].map(q=>parseInt(L.slice(q,q+2),16))}const m=/^rgba?\(([^)]+)\)$/i.exec(A);if(!m)return null;const f=m[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return f.length===3&&f.every(L=>Number.isFinite(L))?f:null}function I(a,A){const E=A?a.diverging:a.sequential,m=A?J.default.diverging:J.default.sequential,f=(Array.isArray(E)?E:m).map((L,q)=>p(L)||p(m[q])||[0,0,0]);return f.length>=2?f:m.map(L=>p(L))}}),at("packages/modules/charts/styles.js",function(r,ie){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return se}});const ue=ie("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Se="data-lattice-chartview";function Ae(J){const ae=(J%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ae+1}, ${ue[ae]})`}function he(){return`
|
|
6
|
+
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,ie){Dr[r]=ie}function Gr(r){var ie=Br[r];if(ie)return ie;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,ie){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return V}});const Oe="http://www.w3.org/2000/svg";function ue(Y){const k=Y.indexOf(")");return k<0?Y:Y.slice(k+1).trim()||"#0072b2"}function j(Y,k,g){const u=Y.createElement(k);return g&&u.setAttribute("class",g),u}function Se(Y,k,g){const u=Y.createElementNS(Oe,k);if(g)for(const y of Object.keys(g))u.setAttribute(y,String(g[y]));return u}function Ae(Y,k,g){if(!Y)return;if(g==null){Y.removeAttribute(k);return}let u=String(g);u.startsWith("url(#")&&(k==="stroke"||k==="fill"&&Y.localName==="text")&&(u=ue(u)),Y.setAttribute(k,u)}function he(Y,k){if(Y)for(const g of Object.keys(k))Ae(Y,g,k[g])}function se(Y,k){Y&&(Y.textContent=k==null?"":String(k))}function J(Y){if(Y)for(;Y.firstChild;)Y.removeChild(Y.firstChild)}function ae(Y,k){for(const g of k)g&&Y.appendChild(g);return Y}function _(Y){return Y.join(" ")}function v(Y){if(!Y||Y.length<2)return"";const k=["M",Y[0].x,Y[0].upper];for(let g=1;g<Y.length;g++)k.push("L",Y[g].x,Y[g].upper);for(let g=Y.length-1;g>=0;g--)k.push("L",Y[g].x,Y[g].lower);return k.push("Z"),_(k)}function C(Y){return Math.round(Y*100)/100}function h(Y){const k=[];let g=[];const u=String(Y||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let y="",N=[];const ee=()=>{if(!y||!N.length){N=[];return}if(y==="M"||y==="L")for(let p=0;p+1<N.length;p+=2)g.push([N[p],N[p+1]]);else y!=="Z"&&N.length>=2&&g.push([N[N.length-2],N[N.length-1]]);N=[]};for(const p of u){if(/[A-Za-z]/.test(p)){if(ee(),p==="Z"||p==="z"){g.length>2&&k.push(g),g=[],y="";continue}p==="M"&&g.length>2&&(k.push(g),g=[]),y=p;continue}N.push(Number(p))}return ee(),g.length>2&&k.push(g),k}function V(Y,k,g){let u=!1;for(const y of Y)for(let N=0,ee=y.length-1;N<y.length;ee=N++){const[p,I]=y[N],[a,A]=y[ee];I>g!=A>g&&k<(a-p)*(g-I)/(A-I||1e-12)+p&&(u=!u)}return u}}),at("packages/modules/charts/typography.js",function(r,ie){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ae}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Se(_){const v=_&&_.font,C=typeof v=="number"?{size:v}:v||{},h=Ae(C.size,Oe);return{family:C.family||ue,size:h,small:Ae(C.small??C.tickSize,Math.max(9,h-1)),title:Ae(C.title,Math.round(h*1.15)),axisTitle:Ae(C.axisTitle,Math.max(10,h-1)),weight:C.weight||"inherit"}}function Ae(_,v){const C=Number(_);return Number.isFinite(C)&&C>0?C:v}function he(_,v){return String(_??"").length*v*j}function se(_,v){let C=0;for(const h of _||[]){const V=he(h,v);V>C&&(C=V)}return C}function J(_,v,C){const h=String(_??""),V=Math.floor(v/(C*j));return V<=0?"":h.length<=V?h:V===1?"…":`${h.slice(0,V-1)}…`}function ae(_,v){!_||!Number.isFinite(v)||(_.style?_.style.fontSize=`${v}px`:_.setAttribute("style",`font-size:${v}px`))}}),at("packages/modules/charts/frame.js",function(r,ie){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return C}});const ue=ie("packages/modules/charts/svg.js").SVG_NS,j=ie("packages/modules/charts/typography.js"),Se=j.textWidth,Ae=j.widestLabel,he=8,se=6,J=.4;function ae(h,V){const Y=typeof h=="number"?h:V,k=h&&typeof h=="object"?h:{},g=u=>Number.isFinite(u)&&u>=0?Number(u):Y;return{base:Y,top:g(k.top),right:g(k.right),bottom:g(k.bottom),left:g(k.left)}}function _(h){const V=ae(h.margin,typeof h.padding=="number"?h.padding:8),Y=V.base,k=h.fontSize||12,g=h.yLabels||[],u=h.xLabels||[],y=h.ySide==="right"?"right":"left",N=y==="right"?"left":"right",ee=h.titles||{},p=h.titleSize||k,I=te=>te?p+se:0,a=Ae(g,k),A=g.length?Math.min(h.width*J,V[y]+a+se):Math.max(he,V[y]),E=V[N]+(h.rightGutter||0),m=(y==="left"?A:E)+I(ee.left),f=Ae(u.map(te=>String(te).slice(0,14)),k),L=(u.length?h.rotated?Math.min(h.height*J,se+f):k+se+V.bottom:Math.max(he,V.bottom))+I(ee.bottom),q=(y==="right"?A:E)+I(ee.right),Q=V.top+(h.topGutter||0),pe=Math.max(0,h.width-m-q),ce=Math.max(0,h.height-Q-L);return{left:m,top:Q,width:pe,height:ce,right:m+pe,bottom:Q+ce,gutter:{left:m,bottom:L,right:q,top:Q}}}function v(h,V,Y,k){if(!h.length||V<=0)return!1;const g=Number.isFinite(k)&&k>0?Number(k):1;return Ae(h,Y)>V*g-4}class C{#r;#n=0;static#i="data-pool-key";constructor(V,Y=0){this.#r=V,this.#n=Y>0?Y:0}next(V,Y,k){if(k!=null)return this.#e(V,Y,String(k));const g=this.#r.childNodes[this.#n],u=g&&g.tagName,y=/(^|\s)\S*__axis-title(\s|$)/,N=u&&y.test(String(g.getAttribute("class")||"")),ee=!!Y&&y.test(String(Y));if(u&&(!N||ee)&&String(u).toLowerCase()===V.toLowerCase())return Y&&g.setAttribute("class",Y),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,V);return Y&&p.setAttribute("class",Y),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(V,Y,k){const g=V.toLowerCase();for(let N=this.#n;N<this.#r.childNodes.length;N++){const ee=this.#r.childNodes[N],p=ee&&ee.tagName;if(p&&String(p).toLowerCase()===g&&ee.getAttribute(C.#i)===k)return N!==this.#n&&this.#r.insertBefore(ee,this.#r.childNodes[this.#n]),Y&&ee.setAttribute("class",Y),this.#n++,ee}const u=this.#r.ownerDocument.createElementNS(ue,V);u.setAttribute(C.#i,k),Y&&u.setAttribute("class",Y);const y=this.#r.childNodes[this.#n];return y?this.#r.insertBefore(u,y):this.#r.appendChild(u),this.#n++,u}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,ie){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return A}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return q}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return l}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return T}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return U}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return le}});const Oe="1.88.3";async function ue(){return Oe}const j="1.88.3",Se=new Set,Ae=2e3;function he($){if(Se.add($),Se.size>Ae){const B=Se.values().next().value;B!==void 0&&Se.delete(B)}}const se=[],J=500;function ae($,B,oe){se.push({key:$,level:B,message:oe.map(i=>typeof i=="string"?i:_(i)).join(" "),at:Date.now()}),se.length>J&&se.shift()}function _($){if($ instanceof Error)return $.message;try{return JSON.stringify($)}catch{return String($)}}function v(){return se.map($=>({...$}))}function C($){if($.length===0||typeof $[0]!="string")return $;const B=$[0].replace(/^\[lattice\]\s*/,"");return B===$[0]?$:[B,...$.slice(1)]}function h($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"warn",oe),console.warn("[lattice]",...oe)}function V($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"info",oe),console.info("[lattice]",...oe)}function Y(){Se.clear(),se.length=0}function k($,B){const oe=new Error(`[lattice] ${$}`);throw B!==void 0&&(oe.cause=B),oe}function g($,B){$||k(B)}const u=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function y($){return $!==null&&typeof $=="object"&&!Array.isArray($)}function N($){return typeof $=="function"}function ee($){return $==null}function p($){return $==null||$===""}function I($){return typeof $!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call($))?!0:!!($.prototype&&Object.getOwnPropertyNames($.prototype).length>1)}const a=new Map;function A($){let B=a.get($);if(B)return B;if(!$.includes("."))B=oe=>oe?.[$];else{const oe=$.split("."),i=oe.length;B=s=>{let n=s;for(let M=0;M<i;M++){if(n==null)return;n=n[oe[M]]}return n}}return a.set($,B),B}const E=new Map;function m($){let B=E.get($);if(B)return B;if(!$.includes("."))B=(oe,i)=>{oe!=null&&(oe[$]=i)};else{const oe=$.split("."),i=oe.length-1;B=(s,n)=>{let M=s;for(let o=0;o<i;o++){if(M==null)return;const x=oe[o];M[x]==null&&(M[x]={}),M=M[x]}M!=null&&(M[oe[i]]=n)}}return E.set($,B),B}function f($,B){return A(B)($)}function L($,B,oe){m(B)($,oe)}function q($){return $?($.includes(".")?$.slice($.lastIndexOf(".")+1):$).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,oe=>oe.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function pe($){const B=$==null?"":String($);return/[&<>"']/.test(B)?B.replace(/[&<>"']/g,oe=>Q[oe]):B}function ce($){return String($).replace(/\w\S*/g,B=>B[0].toUpperCase()+B.slice(1).toLowerCase())}function te($,B,oe){if($!==void 0)return $===!0?{enabled:!0,...oe}:$===!1?{enabled:!1}:y($)?$:{[B]:$,enabled:!0}}function H($){return $==null?[]:Array.isArray($)?$:[$]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function l($,B){if(!y($))return y(B)?{...B}:B;if(!y(B))return B===void 0?$:B;const oe={...$};for(const i of Object.keys(B)){if(D.has(i))continue;const s=B[i];s!==void 0&&(oe[i]=y(s)&&y(oe[i])?l(oe[i],s):s)}return oe}function t($,B){if(!y($)||!y(B)||$===B)return B;const oe=Object.create(Object.getPrototypeOf($));return Object.assign(oe,$,B),oe}class e{#r;#n=new Map;#i;constructor(B=256,oe=null){this.#r=B,this.#i=oe}get size(){return this.#n.size}get max(){return this.#r}set max(B){this.#r=B,this.#e()}has(B){return this.#n.has(B)}get(B){const oe=this.#n;if(!oe.has(B))return;const i=oe.get(B);return oe.delete(B),oe.set(B,i),i}peek(B){return this.#n.get(B)}set(B,oe){const i=this.#n;return i.has(B)&&i.delete(B),i.set(B,oe),this.#e(),oe}delete(B){const oe=this.#n.get(B);return this.#n.delete(B)&&this.#i&&this.#i(oe,B),oe}clear(){if(this.#i)for(const[B,oe]of this.#n)this.#i(oe,B);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const B=this.#n;for(;B.size>this.#r;){const oe=B.keys().next().value,i=B.get(oe);B.delete(oe),this.#i&&this.#i(i,oe)}}}const d=new Map;function P($,B){const oe=`${$||""}|${B?JSON.stringify(B):""}`;let i=d.get(oe);return i||(i=new Intl.Collator($||void 0,{numeric:!0,sensitivity:"variant",...B}),d.set(oe,i)),i}function O($,B){if($===B)return 0;if($==null)return 1;if(B==null)return-1;if(typeof $=="number"&&typeof B=="number")return Number.isNaN($)?Number.isNaN(B)?0:1:Number.isNaN(B)||$<B?-1:$>B?1:0;const oe=String($),i=String(B);return oe<i?-1:oe>i?1:0}function T(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function R($){return W?requestAnimationFrame($):setTimeout(()=>$(T()),16)}function b($){$!=null&&(W?cancelAnimationFrame($):clearTimeout($))}function U($){let B=null,oe=null;const i=()=>{B=null;const n=oe;oe=null,$(...n||[])},s=(...n)=>{oe=n,B===null&&(B=R(i))};return s.cancel=()=>{b(B),B=null,oe=null},s.flush=()=>{B!==null&&(b(B),i())},s}function re($,B){let oe=null,i=null;const s=()=>{if(oe=null,i===null)return;const o=i;i=null,$(...o),n()},n=()=>{oe=setTimeout(s,B),typeof oe?.unref=="function"&&oe.unref()},M=(...o)=>{oe===null?($(...o),n()):(i=o,clearTimeout(oe),n())};return M.flush=()=>{if(oe!==null&&clearTimeout(oe),oe=null,i===null)return;const o=i;i=null,$(...o)},M.cancel=()=>{oe!==null&&clearTimeout(oe),oe=null,i=null},M.pending=()=>oe!==null||i!==null,M}function ne($,B=50){return typeof requestIdleCallback=="function"?requestIdleCallback($,{timeout:B}):setTimeout(()=>$({timeRemaining:()=>0,didTimeout:!0}),1)}let G=0;function le($="l"){return`${$}${(++G).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,ie){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return ee}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Se=Object.freeze(["linear","radial"]),Ae=8,he="#0072b2";let se=0;const J=new Map;function ae(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function _(p){return typeof p=="string"&&p.startsWith("url(#")}function v(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const I=p.indexOf(")");return(I<0?"":p.slice(I+1).trim())||he}function C(p,I){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${I} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function h(p,I){if(!ae(p))return null;const a=I||he;if(typeof p.gradient=="string"){if(!Se.includes(p.gradient))return C("gradient",`the gradient "${p.gradient}" is not one of ${Se.join(", ")}.`),null;const f=Array.isArray(p.stops)?p.stops:[],L=[];for(const Q of f){const pe=Array.isArray(Q)?Number(Q[0]):Number(Q&&Q.offset),ce=Array.isArray(Q)?Q[1]:Q&&Q.colour;!Number.isFinite(pe)||typeof ce!="string"||!ce||L.push({offset:Math.min(1,Math.max(0,pe)),colour:ce})}if(L.length<2)return C("stops","a gradient needs at least two [offset, colour] stops."),null;L.sort((Q,pe)=>Q.offset-pe.offset);const q=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:q,stops:L,solid:L[0].colour}}if(!j.includes(p.pattern))return C("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const A=Number(p.size),E=Number(p.angle),m=typeof p.colour=="string"&&p.colour?p.colour:a;return{kind:"pattern",pattern:p.pattern,colour:m,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(A)&&A>=2?A:Ae,angle:Number.isFinite(E)?E:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:m}}function V(p){if(p.kind==="pattern"){const a=p.colour,A=p.size,E=Math.max(1,A/5),m=p.background||"transparent",f=L=>`repeating-linear-gradient(${L+90}deg,${a} 0 ${E}px,transparent ${E}px ${A}px)`;return p.pattern==="hatch"?`${f(p.angle)},${m}`:p.pattern==="crosshatch"?`${f(p.angle)},${f(p.angle+90)},${m}`:p.pattern==="grid"?`${f(p.angle)},${f(p.angle+90)},${m}`:`radial-gradient(circle at 50% 50%,${a} ${A/6}px,transparent ${A/6+.5}px) 0 0/${A}px ${A}px,${m}`}const I=p.stops.map(a=>`${a.colour} ${Math.round(a.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${I})`:`linear-gradient(${p.angle}deg,${I})`}function Y(p){if(!_(p))return typeof p=="string"?p:"";const I=String(p).indexOf(")"),a=String(p).slice(5,I),A=J.get(a);return A?V(A):v(p)}function k(p){const I=`lattice-fill-${++se}`;let a=new Map,A=0;const E=(f,L)=>{const q=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",f);for(const Q of Object.keys(L))q.setAttribute(Q,String(L[Q]));return q},m=(f,L)=>{if(L.kind==="pattern"){const Q=L.size,pe=Math.max(1,Q/5),ce=E("pattern",{id:f,width:Q,height:Q,patternUnits:"userSpaceOnUse"});L.angle&&ce.setAttribute("patternTransform",`rotate(${L.angle})`),L.background&&ce.appendChild(E("rect",{width:Q,height:Q,fill:L.background}));const te={stroke:L.colour,"stroke-width":pe};L.pattern==="dots"?ce.appendChild(E("circle",{cx:Q/2,cy:Q/2,r:Math.max(1,Q/6),fill:L.colour})):(ce.appendChild(E("line",{x1:Q/2,y1:0,x2:Q/2,y2:Q,...te})),L.pattern!=="hatch"&&ce.appendChild(E("line",{x1:0,y1:Q/2,x2:Q,y2:Q/2,...te}))),p.appendChild(ce);return}let q;if(L.kind==="radial")q=E("radialGradient",{id:f,cx:.5,cy:.5,r:.5});else{const Q=L.angle*Math.PI/180,pe=Math.sin(Q)/2,ce=-Math.cos(Q)/2;q=E("linearGradient",{id:f,x1:+(.5-pe).toFixed(4),y1:+(.5-ce).toFixed(4),x2:+(.5+pe).toFixed(4),y2:+(.5+ce).toFixed(4)})}for(const Q of L.stops)q.appendChild(E("stop",{offset:Q.offset,"stop-color":Q.colour}));p.appendChild(q)};return{prefix:I,paint(f,L){const q=h(f,L);if(!q)return L||he;if(!p||!p.ownerDocument)return q.solid;const Q=JSON.stringify(q);let pe=a.get(Q);if(!pe){const ce=`${I}-${A++}`;m(ce,q),J.set(ce,q),pe=`url(#${ce}) ${q.solid}`,a.set(Q,pe)}return pe},reset(){for(const f of a.values())J.delete(f.slice(5,f.indexOf(")")));if(a=new Map,A=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...a.values()].map(f=>f.slice(5,f.indexOf(")")))}}}function g(p,I,a){if(p==null||p==="")return null;const A=v(a);if(ae(p))return I?I.paint(p,A):(h(p,A)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const E={pattern:p,colour:A};return I?I.paint(E,A):A}return p}return null}function u(p){const I=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((a,A)=>({...I[A%I.length],colour:a,background:"var(--lattice-background, #fff)"}))}function y(p){return _(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function N(p,I){const a=p.fill;if(ae(a))return(E,m)=>g(a,I.fills,y(m));if(typeof a=="function")return(E,m)=>{let f=null;try{f=a({label:E.label,x:E.x,y:E.y,rowKey:E.rowKey})}catch{f=null}return g(f,I.fills,y(m))};const A=typeof a=="string"?a:a&&typeof a=="object"&&typeof a.col=="string"?a.col:null;return A?(E,m)=>E.rowKey===void 0||E.rowKey===null?null:g(p.grid.rows.value(E.rowKey,A),I.fills,y(m)):null}function ee(p,I,a){return p&&p({label:I.label,x:I.value,y:I.total,rowKey:I.rowKey},a)||a}}),at("packages/modules/charts/scheme.js",function(r,ie){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return I}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=ie("packages/modules/charts/fills.js"),Se=j.isFill,Ae=j.patternSeries,he=j.rowPaint,se=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),J=Object.freeze({default:{series:se,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Ae(se),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ae=new Map;let _="default";function v(a,A){!a||!A||ae.set(String(a),A)}function C(a){if(typeof a=="string"){_=a;return}a&&typeof a=="object"&&(ae.set("__default__",a),_="__default__")}function h(){return[...Object.keys(J),...ae.keys()].filter(a=>!a.startsWith("__"))}function V(a){return ae.has(a)?ae.get(a):J[a]||null}const Y=["series","sequential","diverging","positive","negative"];function k(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!Y.some(A=>A in a)}function g(a,A){const E=A&&A.fills||null,m=V(_)||J.default,f=a&&a.scheme,L=k(f)?f:null,q=Array.isArray(f)&&f.length?f:null,Q=typeof f=="string"?V(f):L||Array.isArray(f)?null:f||null,pe=(a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null)||q;L&&pe&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const ce=L?null:pe,te={...J.default,...m,...Q||{}};ce&&(te.series=ce);const H=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,D=H?H.colours:a&&a.ramp,l=Array.isArray(D)&&D.length>=2?D:null;l&&(te.sequential=l);const t=H?N(H.scale):null,e=!!(Q||ce||L),d=te.series&&te.series.length?te.series:se,P=new Map;let O=0;return{...te,series:(W,R)=>{if(L&&R!==void 0&&R!==null){const b=String(R);return Object.prototype.hasOwnProperty.call(L,b)?u(L[b],E,W):(P.has(b)||P.set(b,O++),u(ee(d,P.get(b),!0),E,P.get(b)))}return u(ee(d,W,e),E,W)},explicit:e,nameMap:!!L,rampScale:t,fills:E}}function u(a,A,E){if(!Se(a))return a;const m=se[(E%se.length+se.length)%se.length];return he(a,A,m)||m}const y=Object.freeze(["linear","log","quantile"]);function N(a){return a==null?null:y.includes(a)?a:(ue(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function ee(a,A,E){const m=(A%a.length+a.length)%a.length;return E||typeof a[m]!="string"?a[m]:`var(--lattice-chart-${m+1}, ${a[m]})`}function p(a){if(typeof a!="string")return null;const A=a.trim(),E=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(A);if(E){const L=E[1];return L.length===3?[0,1,2].map(q=>parseInt(L[q]+L[q],16)):[0,2,4].map(q=>parseInt(L.slice(q,q+2),16))}const m=/^rgba?\(([^)]+)\)$/i.exec(A);if(!m)return null;const f=m[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return f.length===3&&f.every(L=>Number.isFinite(L))?f:null}function I(a,A){const E=A?a.diverging:a.sequential,m=A?J.default.diverging:J.default.sequential,f=(Array.isArray(E)?E:m).map((L,q)=>p(L)||p(m[q])||[0,0,0]);return f.length>=2?f:m.map(L=>p(L))}}),at("packages/modules/charts/styles.js",function(r,ie){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return se}});const ue=ie("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Se="data-lattice-chartview";function Ae(J){const ae=(J%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ae+1}, ${ue[ae]})`}function he(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/charts.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.88.
|
|
2
|
+
* Lattice Grid 1.88.3, charts module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,ie){Dr[r]=ie}function Gr(r){var ie=Br[r];if(ie)return ie;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,ie){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return V}});const Oe="http://www.w3.org/2000/svg";function ue(Y){const k=Y.indexOf(")");return k<0?Y:Y.slice(k+1).trim()||"#0072b2"}function j(Y,k,g){const u=Y.createElement(k);return g&&u.setAttribute("class",g),u}function Se(Y,k,g){const u=Y.createElementNS(Oe,k);if(g)for(const y of Object.keys(g))u.setAttribute(y,String(g[y]));return u}function Ae(Y,k,g){if(!Y)return;if(g==null){Y.removeAttribute(k);return}let u=String(g);u.startsWith("url(#")&&(k==="stroke"||k==="fill"&&Y.localName==="text")&&(u=ue(u)),Y.setAttribute(k,u)}function he(Y,k){if(Y)for(const g of Object.keys(k))Ae(Y,g,k[g])}function se(Y,k){Y&&(Y.textContent=k==null?"":String(k))}function J(Y){if(Y)for(;Y.firstChild;)Y.removeChild(Y.firstChild)}function ae(Y,k){for(const g of k)g&&Y.appendChild(g);return Y}function _(Y){return Y.join(" ")}function v(Y){if(!Y||Y.length<2)return"";const k=["M",Y[0].x,Y[0].upper];for(let g=1;g<Y.length;g++)k.push("L",Y[g].x,Y[g].upper);for(let g=Y.length-1;g>=0;g--)k.push("L",Y[g].x,Y[g].lower);return k.push("Z"),_(k)}function C(Y){return Math.round(Y*100)/100}function h(Y){const k=[];let g=[];const u=String(Y||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let y="",N=[];const ee=()=>{if(!y||!N.length){N=[];return}if(y==="M"||y==="L")for(let p=0;p+1<N.length;p+=2)g.push([N[p],N[p+1]]);else y!=="Z"&&N.length>=2&&g.push([N[N.length-2],N[N.length-1]]);N=[]};for(const p of u){if(/[A-Za-z]/.test(p)){if(ee(),p==="Z"||p==="z"){g.length>2&&k.push(g),g=[],y="";continue}p==="M"&&g.length>2&&(k.push(g),g=[]),y=p;continue}N.push(Number(p))}return ee(),g.length>2&&k.push(g),k}function V(Y,k,g){let u=!1;for(const y of Y)for(let N=0,ee=y.length-1;N<y.length;ee=N++){const[p,I]=y[N],[a,A]=y[ee];I>g!=A>g&&k<(a-p)*(g-I)/(A-I||1e-12)+p&&(u=!u)}return u}}),at("packages/modules/charts/typography.js",function(r,ie){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ae}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Se(_){const v=_&&_.font,C=typeof v=="number"?{size:v}:v||{},h=Ae(C.size,Oe);return{family:C.family||ue,size:h,small:Ae(C.small??C.tickSize,Math.max(9,h-1)),title:Ae(C.title,Math.round(h*1.15)),axisTitle:Ae(C.axisTitle,Math.max(10,h-1)),weight:C.weight||"inherit"}}function Ae(_,v){const C=Number(_);return Number.isFinite(C)&&C>0?C:v}function he(_,v){return String(_??"").length*v*j}function se(_,v){let C=0;for(const h of _||[]){const V=he(h,v);V>C&&(C=V)}return C}function J(_,v,C){const h=String(_??""),V=Math.floor(v/(C*j));return V<=0?"":h.length<=V?h:V===1?"…":`${h.slice(0,V-1)}…`}function ae(_,v){!_||!Number.isFinite(v)||(_.style?_.style.fontSize=`${v}px`:_.setAttribute("style",`font-size:${v}px`))}}),at("packages/modules/charts/frame.js",function(r,ie){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return C}});const ue=ie("packages/modules/charts/svg.js").SVG_NS,j=ie("packages/modules/charts/typography.js"),Se=j.textWidth,Ae=j.widestLabel,he=8,se=6,J=.4;function ae(h,V){const Y=typeof h=="number"?h:V,k=h&&typeof h=="object"?h:{},g=u=>Number.isFinite(u)&&u>=0?Number(u):Y;return{base:Y,top:g(k.top),right:g(k.right),bottom:g(k.bottom),left:g(k.left)}}function _(h){const V=ae(h.margin,typeof h.padding=="number"?h.padding:8),Y=V.base,k=h.fontSize||12,g=h.yLabels||[],u=h.xLabels||[],y=h.ySide==="right"?"right":"left",N=y==="right"?"left":"right",ee=h.titles||{},p=h.titleSize||k,I=te=>te?p+se:0,a=Ae(g,k),A=g.length?Math.min(h.width*J,V[y]+a+se):Math.max(he,V[y]),E=V[N]+(h.rightGutter||0),m=(y==="left"?A:E)+I(ee.left),f=Ae(u.map(te=>String(te).slice(0,14)),k),L=(u.length?h.rotated?Math.min(h.height*J,se+f):k+se+V.bottom:Math.max(he,V.bottom))+I(ee.bottom),q=(y==="right"?A:E)+I(ee.right),Q=V.top+(h.topGutter||0),pe=Math.max(0,h.width-m-q),ce=Math.max(0,h.height-Q-L);return{left:m,top:Q,width:pe,height:ce,right:m+pe,bottom:Q+ce,gutter:{left:m,bottom:L,right:q,top:Q}}}function v(h,V,Y,k){if(!h.length||V<=0)return!1;const g=Number.isFinite(k)&&k>0?Number(k):1;return Ae(h,Y)>V*g-4}class C{#r;#n=0;static#i="data-pool-key";constructor(V,Y=0){this.#r=V,this.#n=Y>0?Y:0}next(V,Y,k){if(k!=null)return this.#e(V,Y,String(k));const g=this.#r.childNodes[this.#n],u=g&&g.tagName,y=/(^|\s)\S*__axis-title(\s|$)/,N=u&&y.test(String(g.getAttribute("class")||"")),ee=!!Y&&y.test(String(Y));if(u&&(!N||ee)&&String(u).toLowerCase()===V.toLowerCase())return Y&&g.setAttribute("class",Y),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,V);return Y&&p.setAttribute("class",Y),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(V,Y,k){const g=V.toLowerCase();for(let N=this.#n;N<this.#r.childNodes.length;N++){const ee=this.#r.childNodes[N],p=ee&&ee.tagName;if(p&&String(p).toLowerCase()===g&&ee.getAttribute(C.#i)===k)return N!==this.#n&&this.#r.insertBefore(ee,this.#r.childNodes[this.#n]),Y&&ee.setAttribute("class",Y),this.#n++,ee}const u=this.#r.ownerDocument.createElementNS(ue,V);u.setAttribute(C.#i,k),Y&&u.setAttribute("class",Y);const y=this.#r.childNodes[this.#n];return y?this.#r.insertBefore(u,y):this.#r.appendChild(u),this.#n++,u}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,ie){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return A}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return q}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return l}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return T}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return U}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return le}});const Oe="1.88.2";async function ue(){return Oe}const j="1.88.2",Se=new Set,Ae=2e3;function he($){if(Se.add($),Se.size>Ae){const B=Se.values().next().value;B!==void 0&&Se.delete(B)}}const se=[],J=500;function ae($,B,oe){se.push({key:$,level:B,message:oe.map(i=>typeof i=="string"?i:_(i)).join(" "),at:Date.now()}),se.length>J&&se.shift()}function _($){if($ instanceof Error)return $.message;try{return JSON.stringify($)}catch{return String($)}}function v(){return se.map($=>({...$}))}function C($){if($.length===0||typeof $[0]!="string")return $;const B=$[0].replace(/^\[lattice\]\s*/,"");return B===$[0]?$:[B,...$.slice(1)]}function h($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"warn",oe),console.warn("[lattice]",...oe)}function V($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"info",oe),console.info("[lattice]",...oe)}function Y(){Se.clear(),se.length=0}function k($,B){const oe=new Error(`[lattice] ${$}`);throw B!==void 0&&(oe.cause=B),oe}function g($,B){$||k(B)}const u=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function y($){return $!==null&&typeof $=="object"&&!Array.isArray($)}function N($){return typeof $=="function"}function ee($){return $==null}function p($){return $==null||$===""}function I($){return typeof $!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call($))?!0:!!($.prototype&&Object.getOwnPropertyNames($.prototype).length>1)}const a=new Map;function A($){let B=a.get($);if(B)return B;if(!$.includes("."))B=oe=>oe?.[$];else{const oe=$.split("."),i=oe.length;B=s=>{let n=s;for(let M=0;M<i;M++){if(n==null)return;n=n[oe[M]]}return n}}return a.set($,B),B}const E=new Map;function m($){let B=E.get($);if(B)return B;if(!$.includes("."))B=(oe,i)=>{oe!=null&&(oe[$]=i)};else{const oe=$.split("."),i=oe.length-1;B=(s,n)=>{let M=s;for(let o=0;o<i;o++){if(M==null)return;const x=oe[o];M[x]==null&&(M[x]={}),M=M[x]}M!=null&&(M[oe[i]]=n)}}return E.set($,B),B}function f($,B){return A(B)($)}function L($,B,oe){m(B)($,oe)}function q($){return $?($.includes(".")?$.slice($.lastIndexOf(".")+1):$).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,oe=>oe.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function pe($){const B=$==null?"":String($);return/[&<>"']/.test(B)?B.replace(/[&<>"']/g,oe=>Q[oe]):B}function ce($){return String($).replace(/\w\S*/g,B=>B[0].toUpperCase()+B.slice(1).toLowerCase())}function te($,B,oe){if($!==void 0)return $===!0?{enabled:!0,...oe}:$===!1?{enabled:!1}:y($)?$:{[B]:$,enabled:!0}}function H($){return $==null?[]:Array.isArray($)?$:[$]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function l($,B){if(!y($))return y(B)?{...B}:B;if(!y(B))return B===void 0?$:B;const oe={...$};for(const i of Object.keys(B)){if(D.has(i))continue;const s=B[i];s!==void 0&&(oe[i]=y(s)&&y(oe[i])?l(oe[i],s):s)}return oe}function t($,B){if(!y($)||!y(B)||$===B)return B;const oe=Object.create(Object.getPrototypeOf($));return Object.assign(oe,$,B),oe}class e{#r;#n=new Map;#i;constructor(B=256,oe=null){this.#r=B,this.#i=oe}get size(){return this.#n.size}get max(){return this.#r}set max(B){this.#r=B,this.#e()}has(B){return this.#n.has(B)}get(B){const oe=this.#n;if(!oe.has(B))return;const i=oe.get(B);return oe.delete(B),oe.set(B,i),i}peek(B){return this.#n.get(B)}set(B,oe){const i=this.#n;return i.has(B)&&i.delete(B),i.set(B,oe),this.#e(),oe}delete(B){const oe=this.#n.get(B);return this.#n.delete(B)&&this.#i&&this.#i(oe,B),oe}clear(){if(this.#i)for(const[B,oe]of this.#n)this.#i(oe,B);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const B=this.#n;for(;B.size>this.#r;){const oe=B.keys().next().value,i=B.get(oe);B.delete(oe),this.#i&&this.#i(i,oe)}}}const d=new Map;function P($,B){const oe=`${$||""}|${B?JSON.stringify(B):""}`;let i=d.get(oe);return i||(i=new Intl.Collator($||void 0,{numeric:!0,sensitivity:"variant",...B}),d.set(oe,i)),i}function O($,B){if($===B)return 0;if($==null)return 1;if(B==null)return-1;if(typeof $=="number"&&typeof B=="number")return Number.isNaN($)?Number.isNaN(B)?0:1:Number.isNaN(B)||$<B?-1:$>B?1:0;const oe=String($),i=String(B);return oe<i?-1:oe>i?1:0}function T(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function R($){return W?requestAnimationFrame($):setTimeout(()=>$(T()),16)}function b($){$!=null&&(W?cancelAnimationFrame($):clearTimeout($))}function U($){let B=null,oe=null;const i=()=>{B=null;const n=oe;oe=null,$(...n||[])},s=(...n)=>{oe=n,B===null&&(B=R(i))};return s.cancel=()=>{b(B),B=null,oe=null},s.flush=()=>{B!==null&&(b(B),i())},s}function re($,B){let oe=null,i=null;const s=()=>{if(oe=null,i===null)return;const o=i;i=null,$(...o),n()},n=()=>{oe=setTimeout(s,B),typeof oe?.unref=="function"&&oe.unref()},M=(...o)=>{oe===null?($(...o),n()):(i=o,clearTimeout(oe),n())};return M.flush=()=>{if(oe!==null&&clearTimeout(oe),oe=null,i===null)return;const o=i;i=null,$(...o)},M.cancel=()=>{oe!==null&&clearTimeout(oe),oe=null,i=null},M.pending=()=>oe!==null||i!==null,M}function ne($,B=50){return typeof requestIdleCallback=="function"?requestIdleCallback($,{timeout:B}):setTimeout(()=>$({timeRemaining:()=>0,didTimeout:!0}),1)}let G=0;function le($="l"){return`${$}${(++G).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,ie){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return ee}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Se=Object.freeze(["linear","radial"]),Ae=8,he="#0072b2";let se=0;const J=new Map;function ae(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function _(p){return typeof p=="string"&&p.startsWith("url(#")}function v(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const I=p.indexOf(")");return(I<0?"":p.slice(I+1).trim())||he}function C(p,I){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${I} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function h(p,I){if(!ae(p))return null;const a=I||he;if(typeof p.gradient=="string"){if(!Se.includes(p.gradient))return C("gradient",`the gradient "${p.gradient}" is not one of ${Se.join(", ")}.`),null;const f=Array.isArray(p.stops)?p.stops:[],L=[];for(const Q of f){const pe=Array.isArray(Q)?Number(Q[0]):Number(Q&&Q.offset),ce=Array.isArray(Q)?Q[1]:Q&&Q.colour;!Number.isFinite(pe)||typeof ce!="string"||!ce||L.push({offset:Math.min(1,Math.max(0,pe)),colour:ce})}if(L.length<2)return C("stops","a gradient needs at least two [offset, colour] stops."),null;L.sort((Q,pe)=>Q.offset-pe.offset);const q=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:q,stops:L,solid:L[0].colour}}if(!j.includes(p.pattern))return C("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const A=Number(p.size),E=Number(p.angle),m=typeof p.colour=="string"&&p.colour?p.colour:a;return{kind:"pattern",pattern:p.pattern,colour:m,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(A)&&A>=2?A:Ae,angle:Number.isFinite(E)?E:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:m}}function V(p){if(p.kind==="pattern"){const a=p.colour,A=p.size,E=Math.max(1,A/5),m=p.background||"transparent",f=L=>`repeating-linear-gradient(${L+90}deg,${a} 0 ${E}px,transparent ${E}px ${A}px)`;return p.pattern==="hatch"?`${f(p.angle)},${m}`:p.pattern==="crosshatch"?`${f(p.angle)},${f(p.angle+90)},${m}`:p.pattern==="grid"?`${f(p.angle)},${f(p.angle+90)},${m}`:`radial-gradient(circle at 50% 50%,${a} ${A/6}px,transparent ${A/6+.5}px) 0 0/${A}px ${A}px,${m}`}const I=p.stops.map(a=>`${a.colour} ${Math.round(a.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${I})`:`linear-gradient(${p.angle}deg,${I})`}function Y(p){if(!_(p))return typeof p=="string"?p:"";const I=String(p).indexOf(")"),a=String(p).slice(5,I),A=J.get(a);return A?V(A):v(p)}function k(p){const I=`lattice-fill-${++se}`;let a=new Map,A=0;const E=(f,L)=>{const q=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",f);for(const Q of Object.keys(L))q.setAttribute(Q,String(L[Q]));return q},m=(f,L)=>{if(L.kind==="pattern"){const Q=L.size,pe=Math.max(1,Q/5),ce=E("pattern",{id:f,width:Q,height:Q,patternUnits:"userSpaceOnUse"});L.angle&&ce.setAttribute("patternTransform",`rotate(${L.angle})`),L.background&&ce.appendChild(E("rect",{width:Q,height:Q,fill:L.background}));const te={stroke:L.colour,"stroke-width":pe};L.pattern==="dots"?ce.appendChild(E("circle",{cx:Q/2,cy:Q/2,r:Math.max(1,Q/6),fill:L.colour})):(ce.appendChild(E("line",{x1:Q/2,y1:0,x2:Q/2,y2:Q,...te})),L.pattern!=="hatch"&&ce.appendChild(E("line",{x1:0,y1:Q/2,x2:Q,y2:Q/2,...te}))),p.appendChild(ce);return}let q;if(L.kind==="radial")q=E("radialGradient",{id:f,cx:.5,cy:.5,r:.5});else{const Q=L.angle*Math.PI/180,pe=Math.sin(Q)/2,ce=-Math.cos(Q)/2;q=E("linearGradient",{id:f,x1:+(.5-pe).toFixed(4),y1:+(.5-ce).toFixed(4),x2:+(.5+pe).toFixed(4),y2:+(.5+ce).toFixed(4)})}for(const Q of L.stops)q.appendChild(E("stop",{offset:Q.offset,"stop-color":Q.colour}));p.appendChild(q)};return{prefix:I,paint(f,L){const q=h(f,L);if(!q)return L||he;if(!p||!p.ownerDocument)return q.solid;const Q=JSON.stringify(q);let pe=a.get(Q);if(!pe){const ce=`${I}-${A++}`;m(ce,q),J.set(ce,q),pe=`url(#${ce}) ${q.solid}`,a.set(Q,pe)}return pe},reset(){for(const f of a.values())J.delete(f.slice(5,f.indexOf(")")));if(a=new Map,A=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...a.values()].map(f=>f.slice(5,f.indexOf(")")))}}}function g(p,I,a){if(p==null||p==="")return null;const A=v(a);if(ae(p))return I?I.paint(p,A):(h(p,A)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const E={pattern:p,colour:A};return I?I.paint(E,A):A}return p}return null}function u(p){const I=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((a,A)=>({...I[A%I.length],colour:a,background:"var(--lattice-background, #fff)"}))}function y(p){return _(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function N(p,I){const a=p.fill;if(ae(a))return(E,m)=>g(a,I.fills,y(m));if(typeof a=="function")return(E,m)=>{let f=null;try{f=a({label:E.label,x:E.x,y:E.y,rowKey:E.rowKey})}catch{f=null}return g(f,I.fills,y(m))};const A=typeof a=="string"?a:a&&typeof a=="object"&&typeof a.col=="string"?a.col:null;return A?(E,m)=>E.rowKey===void 0||E.rowKey===null?null:g(p.grid.rows.value(E.rowKey,A),I.fills,y(m)):null}function ee(p,I,a){return p&&p({label:I.label,x:I.value,y:I.total,rowKey:I.rowKey},a)||a}}),at("packages/modules/charts/scheme.js",function(r,ie){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return I}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=ie("packages/modules/charts/fills.js"),Se=j.isFill,Ae=j.patternSeries,he=j.rowPaint,se=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),J=Object.freeze({default:{series:se,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Ae(se),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ae=new Map;let _="default";function v(a,A){!a||!A||ae.set(String(a),A)}function C(a){if(typeof a=="string"){_=a;return}a&&typeof a=="object"&&(ae.set("__default__",a),_="__default__")}function h(){return[...Object.keys(J),...ae.keys()].filter(a=>!a.startsWith("__"))}function V(a){return ae.has(a)?ae.get(a):J[a]||null}const Y=["series","sequential","diverging","positive","negative"];function k(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!Y.some(A=>A in a)}function g(a,A){const E=A&&A.fills||null,m=V(_)||J.default,f=a&&a.scheme,L=k(f)?f:null,q=Array.isArray(f)&&f.length?f:null,Q=typeof f=="string"?V(f):L||Array.isArray(f)?null:f||null,pe=(a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null)||q;L&&pe&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const ce=L?null:pe,te={...J.default,...m,...Q||{}};ce&&(te.series=ce);const H=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,D=H?H.colours:a&&a.ramp,l=Array.isArray(D)&&D.length>=2?D:null;l&&(te.sequential=l);const t=H?N(H.scale):null,e=!!(Q||ce||L),d=te.series&&te.series.length?te.series:se,P=new Map;let O=0;return{...te,series:(W,R)=>{if(L&&R!==void 0&&R!==null){const b=String(R);return Object.prototype.hasOwnProperty.call(L,b)?u(L[b],E,W):(P.has(b)||P.set(b,O++),u(ee(d,P.get(b),!0),E,P.get(b)))}return u(ee(d,W,e),E,W)},explicit:e,nameMap:!!L,rampScale:t,fills:E}}function u(a,A,E){if(!Se(a))return a;const m=se[(E%se.length+se.length)%se.length];return he(a,A,m)||m}const y=Object.freeze(["linear","log","quantile"]);function N(a){return a==null?null:y.includes(a)?a:(ue(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function ee(a,A,E){const m=(A%a.length+a.length)%a.length;return E||typeof a[m]!="string"?a[m]:`var(--lattice-chart-${m+1}, ${a[m]})`}function p(a){if(typeof a!="string")return null;const A=a.trim(),E=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(A);if(E){const L=E[1];return L.length===3?[0,1,2].map(q=>parseInt(L[q]+L[q],16)):[0,2,4].map(q=>parseInt(L.slice(q,q+2),16))}const m=/^rgba?\(([^)]+)\)$/i.exec(A);if(!m)return null;const f=m[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return f.length===3&&f.every(L=>Number.isFinite(L))?f:null}function I(a,A){const E=A?a.diverging:a.sequential,m=A?J.default.diverging:J.default.sequential,f=(Array.isArray(E)?E:m).map((L,q)=>p(L)||p(m[q])||[0,0,0]);return f.length>=2?f:m.map(L=>p(L))}}),at("packages/modules/charts/styles.js",function(r,ie){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return se}});const ue=ie("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Se="data-lattice-chartview";function Ae(J){const ae=(J%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ae+1}, ${ue[ae]})`}function he(){return`
|
|
6
|
+
(function(Ir){"use strict";var Dr=Object.create(null),Br=Object.create(null);function at(r,ie){Dr[r]=ie}function Gr(r){var ie=Br[r];if(ie)return ie;var Oe=Object.create(null);Br[r]=Oe;var ue=Dr[r];if(!ue)throw new Error("[lattice] missing module: "+r);return ue(Oe,Gr),Oe}at("packages/modules/charts/svg.js",function(r,ie){"use strict";Object.defineProperty(r,"SVG_NS",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"el",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"svg",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"attr",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"attrs",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"setText",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"clear",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"append",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"path",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"ribbonPath",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"round",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"pathRings",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"insideRings",{enumerable:!0,get:function(){return V}});const Oe="http://www.w3.org/2000/svg";function ue(Y){const k=Y.indexOf(")");return k<0?Y:Y.slice(k+1).trim()||"#0072b2"}function j(Y,k,g){const u=Y.createElement(k);return g&&u.setAttribute("class",g),u}function Se(Y,k,g){const u=Y.createElementNS(Oe,k);if(g)for(const y of Object.keys(g))u.setAttribute(y,String(g[y]));return u}function Ae(Y,k,g){if(!Y)return;if(g==null){Y.removeAttribute(k);return}let u=String(g);u.startsWith("url(#")&&(k==="stroke"||k==="fill"&&Y.localName==="text")&&(u=ue(u)),Y.setAttribute(k,u)}function he(Y,k){if(Y)for(const g of Object.keys(k))Ae(Y,g,k[g])}function se(Y,k){Y&&(Y.textContent=k==null?"":String(k))}function J(Y){if(Y)for(;Y.firstChild;)Y.removeChild(Y.firstChild)}function ae(Y,k){for(const g of k)g&&Y.appendChild(g);return Y}function _(Y){return Y.join(" ")}function v(Y){if(!Y||Y.length<2)return"";const k=["M",Y[0].x,Y[0].upper];for(let g=1;g<Y.length;g++)k.push("L",Y[g].x,Y[g].upper);for(let g=Y.length-1;g>=0;g--)k.push("L",Y[g].x,Y[g].lower);return k.push("Z"),_(k)}function C(Y){return Math.round(Y*100)/100}function h(Y){const k=[];let g=[];const u=String(Y||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let y="",N=[];const ee=()=>{if(!y||!N.length){N=[];return}if(y==="M"||y==="L")for(let p=0;p+1<N.length;p+=2)g.push([N[p],N[p+1]]);else y!=="Z"&&N.length>=2&&g.push([N[N.length-2],N[N.length-1]]);N=[]};for(const p of u){if(/[A-Za-z]/.test(p)){if(ee(),p==="Z"||p==="z"){g.length>2&&k.push(g),g=[],y="";continue}p==="M"&&g.length>2&&(k.push(g),g=[]),y=p;continue}N.push(Number(p))}return ee(),g.length>2&&k.push(g),k}function V(Y,k,g){let u=!1;for(const y of Y)for(let N=0,ee=y.length-1;N<y.length;ee=N++){const[p,I]=y[N],[a,A]=y[ee];I>g!=A>g&&k<(a-p)*(g-I)/(A-I||1e-12)+p&&(u=!u)}return u}}),at("packages/modules/charts/typography.js",function(r,ie){"use strict";Object.defineProperty(r,"BASE_SIZE",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(r,"BASE_FAMILY",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(r,"CHAR_RATIO",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"resolveType",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"textWidth",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"widestLabel",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"truncateTo",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"applySize",{enumerable:!0,get:function(){return ae}});const Oe=12,ue="var(--lattice-font-family, system-ui, -apple-system, sans-serif)",j=.62;function Se(_){const v=_&&_.font,C=typeof v=="number"?{size:v}:v||{},h=Ae(C.size,Oe);return{family:C.family||ue,size:h,small:Ae(C.small??C.tickSize,Math.max(9,h-1)),title:Ae(C.title,Math.round(h*1.15)),axisTitle:Ae(C.axisTitle,Math.max(10,h-1)),weight:C.weight||"inherit"}}function Ae(_,v){const C=Number(_);return Number.isFinite(C)&&C>0?C:v}function he(_,v){return String(_??"").length*v*j}function se(_,v){let C=0;for(const h of _||[]){const V=he(h,v);V>C&&(C=V)}return C}function J(_,v,C){const h=String(_??""),V=Math.floor(v/(C*j));return V<=0?"":h.length<=V?h:V===1?"…":`${h.slice(0,V-1)}…`}function ae(_,v){!_||!Number.isFinite(v)||(_.style?_.style.fontSize=`${v}px`:_.setAttribute("style",`font-size:${v}px`))}}),at("packages/modules/charts/frame.js",function(r,ie){"use strict";Object.defineProperty(r,"LABEL_GAP",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"LABEL_GUTTER_SHARE",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"resolveMargin",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"plotRect",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"shouldRotate",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return C}});const ue=ie("packages/modules/charts/svg.js").SVG_NS,j=ie("packages/modules/charts/typography.js"),Se=j.textWidth,Ae=j.widestLabel,he=8,se=6,J=.4;function ae(h,V){const Y=typeof h=="number"?h:V,k=h&&typeof h=="object"?h:{},g=u=>Number.isFinite(u)&&u>=0?Number(u):Y;return{base:Y,top:g(k.top),right:g(k.right),bottom:g(k.bottom),left:g(k.left)}}function _(h){const V=ae(h.margin,typeof h.padding=="number"?h.padding:8),Y=V.base,k=h.fontSize||12,g=h.yLabels||[],u=h.xLabels||[],y=h.ySide==="right"?"right":"left",N=y==="right"?"left":"right",ee=h.titles||{},p=h.titleSize||k,I=te=>te?p+se:0,a=Ae(g,k),A=g.length?Math.min(h.width*J,V[y]+a+se):Math.max(he,V[y]),E=V[N]+(h.rightGutter||0),m=(y==="left"?A:E)+I(ee.left),f=Ae(u.map(te=>String(te).slice(0,14)),k),L=(u.length?h.rotated?Math.min(h.height*J,se+f):k+se+V.bottom:Math.max(he,V.bottom))+I(ee.bottom),q=(y==="right"?A:E)+I(ee.right),Q=V.top+(h.topGutter||0),pe=Math.max(0,h.width-m-q),ce=Math.max(0,h.height-Q-L);return{left:m,top:Q,width:pe,height:ce,right:m+pe,bottom:Q+ce,gutter:{left:m,bottom:L,right:q,top:Q}}}function v(h,V,Y,k){if(!h.length||V<=0)return!1;const g=Number.isFinite(k)&&k>0?Number(k):1;return Ae(h,Y)>V*g-4}class C{#r;#n=0;static#i="data-pool-key";constructor(V,Y=0){this.#r=V,this.#n=Y>0?Y:0}next(V,Y,k){if(k!=null)return this.#e(V,Y,String(k));const g=this.#r.childNodes[this.#n],u=g&&g.tagName,y=/(^|\s)\S*__axis-title(\s|$)/,N=u&&y.test(String(g.getAttribute("class")||"")),ee=!!Y&&y.test(String(Y));if(u&&(!N||ee)&&String(u).toLowerCase()===V.toLowerCase())return Y&&g.setAttribute("class",Y),this.#n++,g;const p=this.#r.ownerDocument.createElementNS(ue,V);return Y&&p.setAttribute("class",Y),g?this.#r.insertBefore(p,g):this.#r.appendChild(p),this.#n++,p}#e(V,Y,k){const g=V.toLowerCase();for(let N=this.#n;N<this.#r.childNodes.length;N++){const ee=this.#r.childNodes[N],p=ee&&ee.tagName;if(p&&String(p).toLowerCase()===g&&ee.getAttribute(C.#i)===k)return N!==this.#n&&this.#r.insertBefore(ee,this.#r.childNodes[this.#n]),Y&&ee.setAttribute("class",Y),this.#n++,ee}const u=this.#r.ownerDocument.createElementNS(ue,V);u.setAttribute(C.#i,k),Y&&u.setAttribute("class",Y);const y=this.#r.childNodes[this.#n];return y?this.#r.insertBefore(u,y):this.#r.appendChild(u),this.#n++,u}finish(){for(;this.#r.childNodes.length>this.#n;)this.#r.removeChild(this.#r.lastChild);this.#n=0}}}),at("packages/core/src/internal/util.js",function(r,ie){"use strict";Object.defineProperty(r,"VERSION",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"reportedWarnings",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"infoOnce",{enumerable:!0,get:function(){return V}}),Object.defineProperty(r,"resetWarnings",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"fail",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"invariant",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"DEV",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"isObject",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"isFunction",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"isNil",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(r,"isBlank",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"isCtor",{enumerable:!0,get:function(){return I}}),Object.defineProperty(r,"pathGetter",{enumerable:!0,get:function(){return A}}),Object.defineProperty(r,"pathSetter",{enumerable:!0,get:function(){return m}}),Object.defineProperty(r,"getPath",{enumerable:!0,get:function(){return f}}),Object.defineProperty(r,"setPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(r,"humanise",{enumerable:!0,get:function(){return q}}),Object.defineProperty(r,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(r,"titleCase",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(r,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(r,"toArray",{enumerable:!0,get:function(){return H}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return l}}),Object.defineProperty(r,"mergeRow",{enumerable:!0,get:function(){return t}}),Object.defineProperty(r,"Lru",{enumerable:!0,get:function(){return e}}),Object.defineProperty(r,"collator",{enumerable:!0,get:function(){return P}}),Object.defineProperty(r,"defaultCompare",{enumerable:!0,get:function(){return O}}),Object.defineProperty(r,"now",{enumerable:!0,get:function(){return T}}),Object.defineProperty(r,"nextFrame",{enumerable:!0,get:function(){return R}}),Object.defineProperty(r,"cancelFrame",{enumerable:!0,get:function(){return b}}),Object.defineProperty(r,"frameBatched",{enumerable:!0,get:function(){return U}}),Object.defineProperty(r,"settleDebounce",{enumerable:!0,get:function(){return re}}),Object.defineProperty(r,"whenIdle",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(r,"uid",{enumerable:!0,get:function(){return le}});const Oe="1.88.3";async function ue(){return Oe}const j="1.88.3",Se=new Set,Ae=2e3;function he($){if(Se.add($),Se.size>Ae){const B=Se.values().next().value;B!==void 0&&Se.delete(B)}}const se=[],J=500;function ae($,B,oe){se.push({key:$,level:B,message:oe.map(i=>typeof i=="string"?i:_(i)).join(" "),at:Date.now()}),se.length>J&&se.shift()}function _($){if($ instanceof Error)return $.message;try{return JSON.stringify($)}catch{return String($)}}function v(){return se.map($=>({...$}))}function C($){if($.length===0||typeof $[0]!="string")return $;const B=$[0].replace(/^\[lattice\]\s*/,"");return B===$[0]?$:[B,...$.slice(1)]}function h($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"warn",oe),console.warn("[lattice]",...oe)}function V($,...B){if(Se.has($))return;he($);const oe=C(B);ae($,"info",oe),console.info("[lattice]",...oe)}function Y(){Se.clear(),se.length=0}function k($,B){const oe=new Error(`[lattice] ${$}`);throw B!==void 0&&(oe.cause=B),oe}function g($,B){$||k(B)}const u=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function y($){return $!==null&&typeof $=="object"&&!Array.isArray($)}function N($){return typeof $=="function"}function ee($){return $==null}function p($){return $==null||$===""}function I($){return typeof $!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call($))?!0:!!($.prototype&&Object.getOwnPropertyNames($.prototype).length>1)}const a=new Map;function A($){let B=a.get($);if(B)return B;if(!$.includes("."))B=oe=>oe?.[$];else{const oe=$.split("."),i=oe.length;B=s=>{let n=s;for(let M=0;M<i;M++){if(n==null)return;n=n[oe[M]]}return n}}return a.set($,B),B}const E=new Map;function m($){let B=E.get($);if(B)return B;if(!$.includes("."))B=(oe,i)=>{oe!=null&&(oe[$]=i)};else{const oe=$.split("."),i=oe.length-1;B=(s,n)=>{let M=s;for(let o=0;o<i;o++){if(M==null)return;const x=oe[o];M[x]==null&&(M[x]={}),M=M[x]}M!=null&&(M[oe[i]]=n)}}return E.set($,B),B}function f($,B){return A(B)($)}function L($,B,oe){m(B)($,oe)}function q($){return $?($.includes(".")?$.slice($.lastIndexOf(".")+1):$).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,oe=>oe.toUpperCase()):""}const Q={"&":"&","<":"<",">":">",'"':""","'":"'"};function pe($){const B=$==null?"":String($);return/[&<>"']/.test(B)?B.replace(/[&<>"']/g,oe=>Q[oe]):B}function ce($){return String($).replace(/\w\S*/g,B=>B[0].toUpperCase()+B.slice(1).toLowerCase())}function te($,B,oe){if($!==void 0)return $===!0?{enabled:!0,...oe}:$===!1?{enabled:!1}:y($)?$:{[B]:$,enabled:!0}}function H($){return $==null?[]:Array.isArray($)?$:[$]}const D=Object.freeze(new Set(["__proto__","constructor","prototype"]));function l($,B){if(!y($))return y(B)?{...B}:B;if(!y(B))return B===void 0?$:B;const oe={...$};for(const i of Object.keys(B)){if(D.has(i))continue;const s=B[i];s!==void 0&&(oe[i]=y(s)&&y(oe[i])?l(oe[i],s):s)}return oe}function t($,B){if(!y($)||!y(B)||$===B)return B;const oe=Object.create(Object.getPrototypeOf($));return Object.assign(oe,$,B),oe}class e{#r;#n=new Map;#i;constructor(B=256,oe=null){this.#r=B,this.#i=oe}get size(){return this.#n.size}get max(){return this.#r}set max(B){this.#r=B,this.#e()}has(B){return this.#n.has(B)}get(B){const oe=this.#n;if(!oe.has(B))return;const i=oe.get(B);return oe.delete(B),oe.set(B,i),i}peek(B){return this.#n.get(B)}set(B,oe){const i=this.#n;return i.has(B)&&i.delete(B),i.set(B,oe),this.#e(),oe}delete(B){const oe=this.#n.get(B);return this.#n.delete(B)&&this.#i&&this.#i(oe,B),oe}clear(){if(this.#i)for(const[B,oe]of this.#n)this.#i(oe,B);this.#n.clear()}keys(){return this.#n.keys()}values(){return this.#n.values()}#e(){const B=this.#n;for(;B.size>this.#r;){const oe=B.keys().next().value,i=B.get(oe);B.delete(oe),this.#i&&this.#i(i,oe)}}}const d=new Map;function P($,B){const oe=`${$||""}|${B?JSON.stringify(B):""}`;let i=d.get(oe);return i||(i=new Intl.Collator($||void 0,{numeric:!0,sensitivity:"variant",...B}),d.set(oe,i)),i}function O($,B){if($===B)return 0;if($==null)return 1;if(B==null)return-1;if(typeof $=="number"&&typeof B=="number")return Number.isNaN($)?Number.isNaN(B)?0:1:Number.isNaN(B)||$<B?-1:$>B?1:0;const oe=String($),i=String(B);return oe<i?-1:oe>i?1:0}function T(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function R($){return W?requestAnimationFrame($):setTimeout(()=>$(T()),16)}function b($){$!=null&&(W?cancelAnimationFrame($):clearTimeout($))}function U($){let B=null,oe=null;const i=()=>{B=null;const n=oe;oe=null,$(...n||[])},s=(...n)=>{oe=n,B===null&&(B=R(i))};return s.cancel=()=>{b(B),B=null,oe=null},s.flush=()=>{B!==null&&(b(B),i())},s}function re($,B){let oe=null,i=null;const s=()=>{if(oe=null,i===null)return;const o=i;i=null,$(...o),n()},n=()=>{oe=setTimeout(s,B),typeof oe?.unref=="function"&&oe.unref()},M=(...o)=>{oe===null?($(...o),n()):(i=o,clearTimeout(oe),n())};return M.flush=()=>{if(oe!==null&&clearTimeout(oe),oe=null,i===null)return;const o=i;i=null,$(...o)},M.cancel=()=>{oe!==null&&clearTimeout(oe),oe=null,i=null},M.pending=()=>oe!==null||i!==null,M}function ne($,B=50){return typeof requestIdleCallback=="function"?requestIdleCallback($,{timeout:B}):setTimeout(()=>$({timeRemaining:()=>0,didTimeout:!0}),1)}let G=0;function le($="l"){return`${$}${(++G).toString(36)}`}}),at("packages/modules/charts/fills.js",function(r,ie){"use strict";Object.defineProperty(r,"PATTERNS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"GRADIENTS",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(r,"isFill",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(r,"isPaintRef",{enumerable:!0,get:function(){return _}}),Object.defineProperty(r,"paintFallback",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"normaliseFill",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"swatchCss",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(r,"createFillRegistry",{enumerable:!0,get:function(){return k}}),Object.defineProperty(r,"rowPaint",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"patternSeries",{enumerable:!0,get:function(){return u}}),Object.defineProperty(r,"paintSolid",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"rowFillSource",{enumerable:!0,get:function(){return N}}),Object.defineProperty(r,"nodePaint",{enumerable:!0,get:function(){return ee}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=Object.freeze(["hatch","crosshatch","dots","grid"]),Se=Object.freeze(["linear","radial"]),Ae=8,he="#0072b2";let se=0;const J=new Map;function ae(p){return!!p&&typeof p=="object"&&!Array.isArray(p)&&(typeof p.gradient=="string"||typeof p.pattern=="string")}function _(p){return typeof p=="string"&&p.startsWith("url(#")}function v(p){if(typeof p!="string")return p==null?"":String(p);if(!p.startsWith("url("))return p;const I=p.indexOf(")");return(I<0?"":p.slice(I+1).trim())||he}function C(p,I){ue(`chart:fill:invalid:${p}`,`a chart fill object was ignored: ${I} The mark was drawn in a solid colour instead. A fill is a gradient object (gradient: "linear" or "radial", with stops of [offset, colour]) or a pattern object (pattern: "hatch", "crosshatch", "dots" or "grid", with a colour).`)}function h(p,I){if(!ae(p))return null;const a=I||he;if(typeof p.gradient=="string"){if(!Se.includes(p.gradient))return C("gradient",`the gradient "${p.gradient}" is not one of ${Se.join(", ")}.`),null;const f=Array.isArray(p.stops)?p.stops:[],L=[];for(const Q of f){const pe=Array.isArray(Q)?Number(Q[0]):Number(Q&&Q.offset),ce=Array.isArray(Q)?Q[1]:Q&&Q.colour;!Number.isFinite(pe)||typeof ce!="string"||!ce||L.push({offset:Math.min(1,Math.max(0,pe)),colour:ce})}if(L.length<2)return C("stops","a gradient needs at least two [offset, colour] stops."),null;L.sort((Q,pe)=>Q.offset-pe.offset);const q=Number.isFinite(Number(p.angle))?Number(p.angle):180;return{kind:p.gradient,angle:q,stops:L,solid:L[0].colour}}if(!j.includes(p.pattern))return C("pattern",`the pattern "${p.pattern}" is not one of ${j.join(", ")}.`),null;const A=Number(p.size),E=Number(p.angle),m=typeof p.colour=="string"&&p.colour?p.colour:a;return{kind:"pattern",pattern:p.pattern,colour:m,background:typeof p.background=="string"&&p.background?p.background:null,size:Number.isFinite(A)&&A>=2?A:Ae,angle:Number.isFinite(E)?E:p.pattern==="grid"||p.pattern==="dots"?0:45,solid:m}}function V(p){if(p.kind==="pattern"){const a=p.colour,A=p.size,E=Math.max(1,A/5),m=p.background||"transparent",f=L=>`repeating-linear-gradient(${L+90}deg,${a} 0 ${E}px,transparent ${E}px ${A}px)`;return p.pattern==="hatch"?`${f(p.angle)},${m}`:p.pattern==="crosshatch"?`${f(p.angle)},${f(p.angle+90)},${m}`:p.pattern==="grid"?`${f(p.angle)},${f(p.angle+90)},${m}`:`radial-gradient(circle at 50% 50%,${a} ${A/6}px,transparent ${A/6+.5}px) 0 0/${A}px ${A}px,${m}`}const I=p.stops.map(a=>`${a.colour} ${Math.round(a.offset*100)}%`).join(",");return p.kind==="radial"?`radial-gradient(circle,${I})`:`linear-gradient(${p.angle}deg,${I})`}function Y(p){if(!_(p))return typeof p=="string"?p:"";const I=String(p).indexOf(")"),a=String(p).slice(5,I),A=J.get(a);return A?V(A):v(p)}function k(p){const I=`lattice-fill-${++se}`;let a=new Map,A=0;const E=(f,L)=>{const q=p.ownerDocument.createElementNS("http://www.w3.org/2000/svg",f);for(const Q of Object.keys(L))q.setAttribute(Q,String(L[Q]));return q},m=(f,L)=>{if(L.kind==="pattern"){const Q=L.size,pe=Math.max(1,Q/5),ce=E("pattern",{id:f,width:Q,height:Q,patternUnits:"userSpaceOnUse"});L.angle&&ce.setAttribute("patternTransform",`rotate(${L.angle})`),L.background&&ce.appendChild(E("rect",{width:Q,height:Q,fill:L.background}));const te={stroke:L.colour,"stroke-width":pe};L.pattern==="dots"?ce.appendChild(E("circle",{cx:Q/2,cy:Q/2,r:Math.max(1,Q/6),fill:L.colour})):(ce.appendChild(E("line",{x1:Q/2,y1:0,x2:Q/2,y2:Q,...te})),L.pattern!=="hatch"&&ce.appendChild(E("line",{x1:0,y1:Q/2,x2:Q,y2:Q/2,...te}))),p.appendChild(ce);return}let q;if(L.kind==="radial")q=E("radialGradient",{id:f,cx:.5,cy:.5,r:.5});else{const Q=L.angle*Math.PI/180,pe=Math.sin(Q)/2,ce=-Math.cos(Q)/2;q=E("linearGradient",{id:f,x1:+(.5-pe).toFixed(4),y1:+(.5-ce).toFixed(4),x2:+(.5+pe).toFixed(4),y2:+(.5+ce).toFixed(4)})}for(const Q of L.stops)q.appendChild(E("stop",{offset:Q.offset,"stop-color":Q.colour}));p.appendChild(q)};return{prefix:I,paint(f,L){const q=h(f,L);if(!q)return L||he;if(!p||!p.ownerDocument)return q.solid;const Q=JSON.stringify(q);let pe=a.get(Q);if(!pe){const ce=`${I}-${A++}`;m(ce,q),J.set(ce,q),pe=`url(#${ce}) ${q.solid}`,a.set(Q,pe)}return pe},reset(){for(const f of a.values())J.delete(f.slice(5,f.indexOf(")")));if(a=new Map,A=0,p)for(;p.firstChild;)p.removeChild(p.firstChild)},ids(){return[...a.values()].map(f=>f.slice(5,f.indexOf(")")))}}}function g(p,I,a){if(p==null||p==="")return null;const A=v(a);if(ae(p))return I?I.paint(p,A):(h(p,A)||{}).solid||null;if(typeof p=="string"){if(j.includes(p)){const E={pattern:p,colour:A};return I?I.paint(E,A):A}return p}return null}function u(p){const I=[{pattern:"hatch",angle:45},{pattern:"dots"},{pattern:"crosshatch",angle:45},{pattern:"hatch",angle:135},{pattern:"grid"},{pattern:"dots",size:5},{pattern:"hatch",angle:0},{pattern:"crosshatch",angle:0,size:6}];return p.map((a,A)=>({...I[A%I.length],colour:a,background:"var(--lattice-background, #fff)"}))}function y(p){return _(p)?String(p).replace(/^url\([^)]*\)\s*/,""):p}function N(p,I){const a=p.fill;if(ae(a))return(E,m)=>g(a,I.fills,y(m));if(typeof a=="function")return(E,m)=>{let f=null;try{f=a({label:E.label,x:E.x,y:E.y,rowKey:E.rowKey})}catch{f=null}return g(f,I.fills,y(m))};const A=typeof a=="string"?a:a&&typeof a=="object"&&typeof a.col=="string"?a.col:null;return A?(E,m)=>E.rowKey===void 0||E.rowKey===null?null:g(p.grid.rows.value(E.rowKey,A),I.fills,y(m)):null}function ee(p,I,a){return p&&p({label:I.label,x:I.value,y:I.total,rowKey:I.rowKey},a)||a}}),at("packages/modules/charts/scheme.js",function(r,ie){"use strict";Object.defineProperty(r,"PALETTE",{enumerable:!0,get:function(){return se}}),Object.defineProperty(r,"SCHEMES",{enumerable:!0,get:function(){return J}}),Object.defineProperty(r,"registerScheme",{enumerable:!0,get:function(){return v}}),Object.defineProperty(r,"setDefaultScheme",{enumerable:!0,get:function(){return C}}),Object.defineProperty(r,"schemeNames",{enumerable:!0,get:function(){return h}}),Object.defineProperty(r,"resolveScheme",{enumerable:!0,get:function(){return g}}),Object.defineProperty(r,"RAMP_SCALES",{enumerable:!0,get:function(){return y}}),Object.defineProperty(r,"toRgb",{enumerable:!0,get:function(){return p}}),Object.defineProperty(r,"rampStops",{enumerable:!0,get:function(){return I}});const ue=ie("packages/core/src/internal/util.js").warnOnce,j=ie("packages/modules/charts/fills.js"),Se=j.isFill,Ae=j.patternSeries,he=j.rowPaint,se=Object.freeze(["#0072b2","#e69f00","#009e73","#cc79a7","#56b4e9","#d55e00","#7a5195","#6b7d8c"]),J=Object.freeze({default:{series:se,sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"},bright:{series:["#1f77d0","#ff7f0e","#2ca02c","#d62728","#9467bd","#17becf","#e377c2","#7f7f7f"],sequential:["#eef4fb","#1f77d0"],diverging:["#d62728","#f7f7f7","#1f77d0"],positive:"#2ca02c",negative:"#d62728"},earth:{series:["#5b7c6f","#c08b52","#7a6a53","#a4553f","#4e6a83","#8f8259","#6d5566","#8c9196"],sequential:["#f2efe9","#4e6a83"],diverging:["#a4553f","#f2efe9","#4e6a83"],positive:"#5b7c6f",negative:"#a4553f"},mono:{series:["#0b2a3d","#17475f","#2c6480","#4a82a0","#6da0bd","#94bcd6","#bcd7e9","#dfecf5"],sequential:["#eef3f7","#0b2a3d"],diverging:["#7a5c00","#f5f5f5","#0b2a3d"],positive:"#17475f",negative:"#7a5c00"},patterns:{series:Ae(se),sequential:["#ecf3f9","#005280"],diverging:["#b04a00","#f7f7f7","#005280"],positive:"#009e73",negative:"#d55e00"}}),ae=new Map;let _="default";function v(a,A){!a||!A||ae.set(String(a),A)}function C(a){if(typeof a=="string"){_=a;return}a&&typeof a=="object"&&(ae.set("__default__",a),_="__default__")}function h(){return[...Object.keys(J),...ae.keys()].filter(a=>!a.startsWith("__"))}function V(a){return ae.has(a)?ae.get(a):J[a]||null}const Y=["series","sequential","diverging","positive","negative"];function k(a){return!a||typeof a!="object"||Array.isArray(a)?!1:!Y.some(A=>A in a)}function g(a,A){const E=A&&A.fills||null,m=V(_)||J.default,f=a&&a.scheme,L=k(f)?f:null,q=Array.isArray(f)&&f.length?f:null,Q=typeof f=="string"?V(f):L||Array.isArray(f)?null:f||null,pe=(a&&Array.isArray(a.palette)&&a.palette.length?a.palette:null)||q;L&&pe&&ue("chart:scheme:array-and-map",'chart "scheme" was given as a name map together with a "palette" array; the two do not combine. Colours came from the map and the array was ignored. Pass one or the other.');const ce=L?null:pe,te={...J.default,...m,...Q||{}};ce&&(te.series=ce);const H=a&&a.ramp&&typeof a.ramp=="object"&&!Array.isArray(a.ramp)?a.ramp:null,D=H?H.colours:a&&a.ramp,l=Array.isArray(D)&&D.length>=2?D:null;l&&(te.sequential=l);const t=H?N(H.scale):null,e=!!(Q||ce||L),d=te.series&&te.series.length?te.series:se,P=new Map;let O=0;return{...te,series:(W,R)=>{if(L&&R!==void 0&&R!==null){const b=String(R);return Object.prototype.hasOwnProperty.call(L,b)?u(L[b],E,W):(P.has(b)||P.set(b,O++),u(ee(d,P.get(b),!0),E,P.get(b)))}return u(ee(d,W,e),E,W)},explicit:e,nameMap:!!L,rampScale:t,fills:E}}function u(a,A,E){if(!Se(a))return a;const m=se[(E%se.length+se.length)%se.length];return he(a,A,m)||m}const y=Object.freeze(["linear","log","quantile"]);function N(a){return a==null?null:y.includes(a)?a:(ue(`chart:ramp:scale:${String(a)}`,`chart "ramp.scale" was "${String(a)}", which is not a ramp scale; the chart chose one from its values instead. Use "linear", "log" or "quantile".`),null)}function ee(a,A,E){const m=(A%a.length+a.length)%a.length;return E||typeof a[m]!="string"?a[m]:`var(--lattice-chart-${m+1}, ${a[m]})`}function p(a){if(typeof a!="string")return null;const A=a.trim(),E=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(A);if(E){const L=E[1];return L.length===3?[0,1,2].map(q=>parseInt(L[q]+L[q],16)):[0,2,4].map(q=>parseInt(L.slice(q,q+2),16))}const m=/^rgba?\(([^)]+)\)$/i.exec(A);if(!m)return null;const f=m[1].split(/[\s,/]+/).filter(Boolean).slice(0,3).map(Number);return f.length===3&&f.every(L=>Number.isFinite(L))?f:null}function I(a,A){const E=A?a.diverging:a.sequential,m=A?J.default.diverging:J.default.sequential,f=(Array.isArray(E)?E:m).map((L,q)=>p(L)||p(m[q])||[0,0,0]);return f.length>=2?f:m.map(L=>p(L))}}),at("packages/modules/charts/styles.js",function(r,ie){"use strict";Object.defineProperty(r,"NS",{enumerable:!0,get:function(){return j}}),Object.defineProperty(r,"seriesColour",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(r,"css",{enumerable:!0,get:function(){return he}}),Object.defineProperty(r,"injectStyles",{enumerable:!0,get:function(){return se}});const ue=ie("packages/modules/charts/scheme.js").PALETTE,j="lat-chartview",Se="data-lattice-chartview";function Ae(J){const ae=(J%ue.length+ue.length)%ue.length;return`var(--lattice-chart-${ae+1}, ${ue[ae]})`}function he(){return`
|
|
7
7
|
.${j}{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
|
|
8
8
|
width:100%;height:100%;box-sizing:border-box;
|
|
9
9
|
font-family:var(--lattice-font-family,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif);
|
package/modules/dashboard.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.88.
|
|
2
|
+
* Lattice Grid 1.88.3, dashboard module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
var Le=Object.create(null),De=Object.create(null);function Pe(h,x){Le[h]=x}function Me(h){var x=De[h];if(x)return x;var W=Object.create(null);De[h]=W;var K=Le[h];if(!K)throw new Error("[lattice] missing module: "+h);return K(W,Me),W}Pe("packages/core/src/internal/util.js",function(h,x){"use strict";Object.defineProperty(h,"VERSION",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"reportedWarnings",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"warnOnce",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"infoOnce",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"resetWarnings",{enumerable:!0,get:function(){return $}}),Object.defineProperty(h,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(h,"invariant",{enumerable:!0,get:function(){return p}}),Object.defineProperty(h,"DEV",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"isObject",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"isFunction",{enumerable:!0,get:function(){return O}}),Object.defineProperty(h,"isNil",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"isBlank",{enumerable:!0,get:function(){return M}}),Object.defineProperty(h,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(h,"pathSetter",{enumerable:!0,get:function(){return o}}),Object.defineProperty(h,"getPath",{enumerable:!0,get:function(){return d}}),Object.defineProperty(h,"setPath",{enumerable:!0,get:function(){return s}}),Object.defineProperty(h,"humanise",{enumerable:!0,get:function(){return a}}),Object.defineProperty(h,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(h,"titleCase",{enumerable:!0,get:function(){return F}}),Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(h,"mergeRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(h,"Lru",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"collator",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(h,"defaultCompare",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(h,"now",{enumerable:!0,get:function(){return he}}),Object.defineProperty(h,"nextFrame",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(h,"cancelFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(h,"frameBatched",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(h,"settleDebounce",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(h,"whenIdle",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(h,"uid",{enumerable:!0,get:function(){return Re}});const W="1.88.2";async function K(){return W}const P="1.88.2",T=new Set,de=2e3;function _(t){if(T.add(t),T.size>de){const n=T.values().next().value;n!==void 0&&T.delete(n)}}const H=[],ie=500;function v(t,n,i){H.push({key:t,level:n,message:i.map(k=>typeof k=="string"?k:ee(k)).join(" "),at:Date.now()}),H.length>ie&&H.shift()}function ee(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function ue(){return H.map(t=>({...t}))}function re(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function L(t,...n){if(T.has(t))return;_(t);const i=re(n);v(t,"warn",i),console.warn("[lattice]",...i)}function b(t,...n){if(T.has(t))return;_(t);const i=re(n);v(t,"info",i),console.info("[lattice]",...i)}function $(){T.clear(),H.length=0}function c(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function p(t,n){t||c(n)}const q=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function D(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function O(t){return typeof t=="function"}function B(t){return t==null}function M(t){return t==null||t===""}function R(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const S=new Map;function N(t){let n=S.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),k=i.length;n=V=>{let U=V;for(let Y=0;Y<k;Y++){if(U==null)return;U=U[i[Y]]}return U}}return S.set(t,n),n}const E=new Map;function o(t){let n=E.get(t);if(n)return n;if(!t.includes("."))n=(i,k)=>{i!=null&&(i[t]=k)};else{const i=t.split("."),k=i.length-1;n=(V,U)=>{let Y=V;for(let Q=0;Q<k;Q++){if(Y==null)return;const me=i[Q];Y[me]==null&&(Y[me]={}),Y=Y[me]}Y!=null&&(Y[i[k]]=U)}}return E.set(t,n),n}function d(t,n){return N(n)(t)}function s(t,n,i){o(n)(t,i)}function a(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const m={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>m[i]):n}function F(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function te(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:D(t)?t:{[n]:t,enabled:!0}}function oe(t){return t==null?[]:Array.isArray(t)?t:[t]}const ke=Object.freeze(new Set(["__proto__","constructor","prototype"]));function pe(t,n){if(!D(t))return D(n)?{...n}:n;if(!D(n))return n===void 0?t:n;const i={...t};for(const k of Object.keys(n)){if(ke.has(k))continue;const V=n[k];V!==void 0&&(i[k]=D(V)&&D(i[k])?pe(i[k],V):V)}return i}function we(t,n){if(!D(t)||!D(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class J{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const k=i.get(n);return i.delete(n),i.set(n,k),k}peek(n){return this.#e.get(n)}set(n,i){const k=this.#e;return k.has(n)&&k.delete(n),k.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,k=n.get(i);n.delete(i),this.#t&&this.#t(k,i)}}}const ce=new Map;function Ae(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let k=ce.get(i);return k||(k=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),ce.set(i,k)),k}function ne(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),k=String(n);return i<k?-1:i>k?1:0}function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const $e=typeof requestAnimationFrame=="function";function ge(t){return $e?requestAnimationFrame(t):setTimeout(()=>t(he()),16)}function le(t){t!=null&&($e?cancelAnimationFrame(t):clearTimeout(t))}function ve(t){let n=null,i=null;const k=()=>{n=null;const U=i;i=null,t(...U||[])},V=(...U)=>{i=U,n===null&&(n=ge(k))};return V.cancel=()=>{le(n),n=null,i=null},V.flush=()=>{n!==null&&(le(n),k())},V}function Oe(t,n){let i=null,k=null;const V=()=>{if(i=null,k===null)return;const Q=k;k=null,t(...Q),U()},U=()=>{i=setTimeout(V,n),typeof i?.unref=="function"&&i.unref()},Y=(...Q)=>{i===null?(t(...Q),U()):(k=Q,clearTimeout(i),U())};return Y.flush=()=>{if(i!==null&&clearTimeout(i),i=null,k===null)return;const Q=k;k=null,t(...Q)},Y.cancel=()=>{i!==null&&clearTimeout(i),i=null,k=null},Y.pending=()=>i!==null||k!==null,Y}function Ne(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let je=0;function Re(t="l"){return`${t}${(++je).toString(36)}`}}),Pe("packages/modules/dashboard/spec.js",function(h,x){"use strict";Object.defineProperty(h,"PANEL_KINDS",{enumerable:!0,get:function(){return W}}),Object.defineProperty(h,"SOURCE_KINDS",{enumerable:!0,get:function(){return K}}),Object.defineProperty(h,"MAP_BINDINGS",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"GRID_REF",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"isPlain",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"copySpec",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(h,"sameSpec",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"parseSourceRef",{enumerable:!0,get:function(){return re}}),Object.defineProperty(h,"readRelation",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"inspectSpec",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"validateDashboardSpec",{enumerable:!0,get:function(){return $}});const W=Object.freeze(["grid","chart","kpi","calendar","map","html"]),K=Object.freeze(["rows","pushdown","router","grid"]),P=Object.freeze(["chart","leaflet","deckgl"]),T=Object.freeze(["layout","panels","sources","links"]),de=Object.freeze(["id","kind","title","source","options","binding"]),_=Object.freeze(["from","to","on"]),H=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ie="grid:";function v(c){if(!c||typeof c!="object"||Array.isArray(c))return!1;const p=Object.getPrototypeOf(c);return p===Object.prototype||p===null}function ee(c,p){if(p==="rows"&&Array.isArray(c))return c;if(Array.isArray(c))return c.map(D=>ee(D));if(!v(c)||Object.values(c).some(D=>typeof D=="function"))return c;const q={};for(const[D,O]of Object.entries(c))O!==void 0&&(q[D]=ee(O,D));return q}function ue(c,p){if(c===p)return!0;if(Array.isArray(c)||Array.isArray(p))return!Array.isArray(c)||!Array.isArray(p)||c.length!==p.length?!1:c.every((O,B)=>ue(O,p[B]));if(!v(c)||!v(p))return!1;const q=Object.keys(c).filter(O=>c[O]!==void 0),D=Object.keys(p).filter(O=>p[O]!==void 0);return q.length!==D.length?!1:q.every(O=>ue(c[O],p[O]))}function re(c){return typeof c!="string"||c===""?null:c.startsWith(ie)?{kind:"grid",of:c.slice(ie.length)}:{kind:"named",id:c}}function L(c){return typeof c=="string"&&c!==""?{from:c,to:c}:typeof c=="function"?c:v(c)&&typeof c.from=="string"&&c.from!==""&&typeof c.to=="string"&&c.to!==""?{from:c.from,to:c.to}:null}function b(c){const p=[],q=new Set,D=new Set,O=new Set,B=new Set,M={fatal:null,problems:p,badPanels:q,badSources:D,badLinks:O,badWindows:B};if(!v(c))return M.fatal="the spec is not an object",p.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),M;const R=c;if(!Array.isArray(R.panels))return M.fatal="spec.panels is not an array",p.push({path:"panels",message:"is not an array of panels"}),M;for(const o of Object.keys(R))T.includes(o)||p.push({path:o,message:`is not a dashboard spec key (${T.join(", ")})`});const S=new Map;R.panels.forEach((o,d)=>{const s=`panels[${d}]`;if(!v(o)){q.add(d),p.push({path:s,message:"is not an object"});return}if(typeof o.id!="string"||o.id===""){q.add(d),p.push({path:`${s}.id`,message:"is missing: every panel needs a unique string id"});return}if(S.has(o.id)){q.add(d),p.push({path:`${s}.id`,panel:o.id,message:`repeats "${o.id}", which panels[${S.get(o.id).index}] already uses`});return}S.set(o.id,{index:d,kind:o.kind})});const N=R.sources===void 0?{}:R.sources;if(!v(N))p.push({path:"sources",message:"is not an object of named sources"});else for(const[o,d]of Object.entries(N)){const s=`sources.${o}`,a=(w,F)=>{D.add(o),p.push({path:w,message:F})};if(!v(d)){a(s,"is not an object");continue}if(!K.includes(d.kind)){a(`${s}.kind`,`names no source kind (${K.join(", ")})`);continue}const m=H[d.kind];if(m)for(const w of Object.keys(d))m.includes(w)||p.push({path:`${s}.${w}`,message:`is not a key of a ${d.kind} source (${m.join(", ")})`});if(d.columns!==void 0&&!Array.isArray(d.columns)&&a(`${s}.columns`,"is not an array of columns"),d.kind==="rows"&&!Array.isArray(d.rows)&&a(`${s}.rows`,"is not an array of rows"),d.kind==="pushdown"&&!(d.adapter&&typeof d.adapter.execute=="function")&&a(`${s}.adapter`,"is not a pushdown adapter (an object with execute())"),d.kind==="router"&&(d.router&&typeof d.router.attach=="function"||a(`${s}.router`,"is not a Data Router (an object with attach())"),d.predicate===void 0&&a(`${s}.predicate`,"is missing: name the partition value or predicate the route matches")),d.kind==="grid"){const w=typeof d.of=="string"?S.get(d.of):void 0;w?w.kind!=="grid"&&a(`${s}.of`,`names "${d.of}", a ${w.kind} panel: only a grid panel has a grid to view`):a(`${s}.of`,"names no panel")}}const E=new Map;R.panels.forEach((o,d)=>{if(q.has(d))return;const s=`panels[${d}]`,a=(F,te)=>{q.add(d),p.push({path:F,panel:o.id,message:te})};for(const F of Object.keys(o))de.includes(F)||p.push({path:`${s}.${F}`,panel:o.id,message:`is not a panel key (${de.join(", ")}); a viewer's own settings go in options`});if(!W.includes(o.kind)){a(`${s}.kind`,`names no panel kind (${W.join(", ")})`);return}if(o.title!==void 0&&typeof o.title!="string"&&p.push({path:`${s}.title`,panel:o.id,message:"is not a string"}),o.options!==void 0&&!v(o.options)){a(`${s}.options`,"is not an object");return}if(o.binding!==void 0&&(o.kind!=="map"?a(`${s}.binding`,`is only read on a map panel, and this is a ${o.kind} panel`):P.includes(o.binding)||a(`${s}.binding`,`names no map binding (${P.join(", ")})`)),o.source===void 0){(o.kind==="chart"||o.kind==="map"||o.kind==="calendar")&&a(`${s}.source`,`is missing: a ${o.kind} panel draws a source's rows`);return}if(o.kind==="html"){a(`${s}.source`,"is set on an html panel, which reads no rows");return}const m=re(o.source);if(!m){a(`${s}.source`,"is not a source id");return}let w=null;if(m.kind==="grid")w=m.of;else if(!v(N)||!Object.hasOwn(N,m.id)){a(`${s}.source`,`names "${m.id}", which is not in sources`);return}else if(D.has(m.id)){a(`${s}.source`,`names "${m.id}", a source that is not usable`);return}else N[m.id].kind==="grid"&&(w=N[m.id].of);if(w!==null){const F=S.get(w);if(!F){a(`${s}.source`,`views the grid of "${w}", which is not a panel`);return}if(F.kind!=="grid"){a(`${s}.source`,`views the grid of "${w}", a ${F.kind} panel`);return}if(w===o.id){a(`${s}.source`,"views its own grid");return}E.set(o.id,w)}});for(let o=!0;o;)o=!1,R.panels.forEach((d,s)=>{if(q.has(s)||!E.has(d.id))return;const a=new Set([d.id]);let m=E.get(d.id);for(;m!==void 0;){const w=S.get(m);if(a.has(m)){q.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`is part of a cycle of panels viewing each other's grids (${[...a,m].join(" -> ")})`}),o=!0;return}if(!w||q.has(w.index)){q.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`views the grid of "${m}", a panel that was not built`}),o=!0;return}a.add(m),m=E.get(m)}});if(R.links!==void 0&&!Array.isArray(R.links)?p.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((o,d)=>{const s=`links[${d}]`,a=(m,w)=>{O.add(d),p.push({path:m,link:d,message:w})};if(!v(o)){a(s,"is not an object");return}for(const m of Object.keys(o))_.includes(m)||p.push({path:`${s}.${m}`,link:d,message:`is not a link key (${_.join(", ")})`});if(typeof o.from!="string"||!S.has(o.from)){a(`${s}.from`,"names no panel");return}if(typeof o.to!="string"||!S.has(o.to)){a(`${s}.to`,"names no panel");return}if(o.from===o.to){a(`${s}.to`,"is the panel the link starts from");return}L(o.on)||a(`${s}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!v(R.layout))p.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))p.push({path:"layout.windows",message:"is not an array of windows"});else{const o=new Set;R.layout.windows.forEach((d,s)=>{const a=`layout.windows[${s}]`;!v(d)||typeof d.id!="string"?(B.add(s),p.push({path:a,message:"is not a window with a string id"})):S.has(d.id)?o.has(d.id)?(B.add(s),p.push({path:`${a}.id`,message:`places "${d.id}" a second time`})):o.add(d.id):(B.add(s),p.push({path:`${a}.id`,message:`names "${d.id}", which is not a panel`}))})}}return M}function $(c){const{problems:p}=b(c);return{ok:p.length===0,problems:p.map(({path:q,message:D})=>({path:q,message:D}))}}}),Pe("packages/modules/dashboard/propose.js",function(h,x){"use strict";Object.defineProperty(h,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(h,"columnRefs",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"proposalRequest",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"parseProposal",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"checkProposal",{enumerable:!0,get:function(){return re}});const W=x("packages/modules/dashboard/spec.js"),K=W.inspectSpec,P=W.isPlain,T=W.copySpec,de=W.parseSourceRef,_=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),H=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ie(L){const b=new Set,$=P(L.options)?L.options:{},c=p=>{typeof p=="string"&&p!==""&&b.add(p)};if(L.kind==="grid")for(const p of Array.isArray($.columns)?$.columns:[])P(p)&&c(p.field);else if(L.kind==="kpi"){for(const p of Array.isArray($.tiles)?$.tiles:[])P(p)&&c(p.field);for(const p of Array.isArray($.fields)?$.fields:[])c(p)}else if(L.kind==="chart"||L.kind==="map"&&(L.binding||"chart")==="chart")for(const p of H)c($[p]);else L.kind==="map"&&P($.position)&&(c($.position.lon),c($.position.lat),c($.position.geometry));return[...b]}function v(L,b){const $={source:b.source,columns:b.columns,kinds:b.kinds};let c=`${L}
|
|
6
|
+
var Le=Object.create(null),De=Object.create(null);function Pe(h,x){Le[h]=x}function Me(h){var x=De[h];if(x)return x;var W=Object.create(null);De[h]=W;var K=Le[h];if(!K)throw new Error("[lattice] missing module: "+h);return K(W,Me),W}Pe("packages/core/src/internal/util.js",function(h,x){"use strict";Object.defineProperty(h,"VERSION",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"reportedWarnings",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"warnOnce",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"infoOnce",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"resetWarnings",{enumerable:!0,get:function(){return $}}),Object.defineProperty(h,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(h,"invariant",{enumerable:!0,get:function(){return p}}),Object.defineProperty(h,"DEV",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"isObject",{enumerable:!0,get:function(){return D}}),Object.defineProperty(h,"isFunction",{enumerable:!0,get:function(){return O}}),Object.defineProperty(h,"isNil",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"isBlank",{enumerable:!0,get:function(){return M}}),Object.defineProperty(h,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(h,"pathSetter",{enumerable:!0,get:function(){return o}}),Object.defineProperty(h,"getPath",{enumerable:!0,get:function(){return d}}),Object.defineProperty(h,"setPath",{enumerable:!0,get:function(){return s}}),Object.defineProperty(h,"humanise",{enumerable:!0,get:function(){return a}}),Object.defineProperty(h,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(h,"titleCase",{enumerable:!0,get:function(){return F}}),Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(h,"mergeRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(h,"Lru",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"collator",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(h,"defaultCompare",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(h,"now",{enumerable:!0,get:function(){return he}}),Object.defineProperty(h,"nextFrame",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(h,"cancelFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(h,"frameBatched",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(h,"settleDebounce",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(h,"whenIdle",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(h,"uid",{enumerable:!0,get:function(){return Re}});const W="1.88.3";async function K(){return W}const P="1.88.3",T=new Set,de=2e3;function _(t){if(T.add(t),T.size>de){const n=T.values().next().value;n!==void 0&&T.delete(n)}}const H=[],ie=500;function v(t,n,i){H.push({key:t,level:n,message:i.map(k=>typeof k=="string"?k:ee(k)).join(" "),at:Date.now()}),H.length>ie&&H.shift()}function ee(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function ue(){return H.map(t=>({...t}))}function re(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function L(t,...n){if(T.has(t))return;_(t);const i=re(n);v(t,"warn",i),console.warn("[lattice]",...i)}function b(t,...n){if(T.has(t))return;_(t);const i=re(n);v(t,"info",i),console.info("[lattice]",...i)}function $(){T.clear(),H.length=0}function c(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function p(t,n){t||c(n)}const q=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function D(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function O(t){return typeof t=="function"}function B(t){return t==null}function M(t){return t==null||t===""}function R(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const S=new Map;function N(t){let n=S.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),k=i.length;n=V=>{let U=V;for(let Y=0;Y<k;Y++){if(U==null)return;U=U[i[Y]]}return U}}return S.set(t,n),n}const E=new Map;function o(t){let n=E.get(t);if(n)return n;if(!t.includes("."))n=(i,k)=>{i!=null&&(i[t]=k)};else{const i=t.split("."),k=i.length-1;n=(V,U)=>{let Y=V;for(let Q=0;Q<k;Q++){if(Y==null)return;const me=i[Q];Y[me]==null&&(Y[me]={}),Y=Y[me]}Y!=null&&(Y[i[k]]=U)}}return E.set(t,n),n}function d(t,n){return N(n)(t)}function s(t,n,i){o(n)(t,i)}function a(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const m={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>m[i]):n}function F(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function te(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:D(t)?t:{[n]:t,enabled:!0}}function oe(t){return t==null?[]:Array.isArray(t)?t:[t]}const ke=Object.freeze(new Set(["__proto__","constructor","prototype"]));function pe(t,n){if(!D(t))return D(n)?{...n}:n;if(!D(n))return n===void 0?t:n;const i={...t};for(const k of Object.keys(n)){if(ke.has(k))continue;const V=n[k];V!==void 0&&(i[k]=D(V)&&D(i[k])?pe(i[k],V):V)}return i}function we(t,n){if(!D(t)||!D(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class J{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const k=i.get(n);return i.delete(n),i.set(n,k),k}peek(n){return this.#e.get(n)}set(n,i){const k=this.#e;return k.has(n)&&k.delete(n),k.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,k=n.get(i);n.delete(i),this.#t&&this.#t(k,i)}}}const ce=new Map;function Ae(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let k=ce.get(i);return k||(k=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),ce.set(i,k)),k}function ne(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),k=String(n);return i<k?-1:i>k?1:0}function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const $e=typeof requestAnimationFrame=="function";function ge(t){return $e?requestAnimationFrame(t):setTimeout(()=>t(he()),16)}function le(t){t!=null&&($e?cancelAnimationFrame(t):clearTimeout(t))}function ve(t){let n=null,i=null;const k=()=>{n=null;const U=i;i=null,t(...U||[])},V=(...U)=>{i=U,n===null&&(n=ge(k))};return V.cancel=()=>{le(n),n=null,i=null},V.flush=()=>{n!==null&&(le(n),k())},V}function Oe(t,n){let i=null,k=null;const V=()=>{if(i=null,k===null)return;const Q=k;k=null,t(...Q),U()},U=()=>{i=setTimeout(V,n),typeof i?.unref=="function"&&i.unref()},Y=(...Q)=>{i===null?(t(...Q),U()):(k=Q,clearTimeout(i),U())};return Y.flush=()=>{if(i!==null&&clearTimeout(i),i=null,k===null)return;const Q=k;k=null,t(...Q)},Y.cancel=()=>{i!==null&&clearTimeout(i),i=null,k=null},Y.pending=()=>i!==null||k!==null,Y}function Ne(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let je=0;function Re(t="l"){return`${t}${(++je).toString(36)}`}}),Pe("packages/modules/dashboard/spec.js",function(h,x){"use strict";Object.defineProperty(h,"PANEL_KINDS",{enumerable:!0,get:function(){return W}}),Object.defineProperty(h,"SOURCE_KINDS",{enumerable:!0,get:function(){return K}}),Object.defineProperty(h,"MAP_BINDINGS",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"GRID_REF",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"isPlain",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"copySpec",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(h,"sameSpec",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"parseSourceRef",{enumerable:!0,get:function(){return re}}),Object.defineProperty(h,"readRelation",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"inspectSpec",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"validateDashboardSpec",{enumerable:!0,get:function(){return $}});const W=Object.freeze(["grid","chart","kpi","calendar","map","html"]),K=Object.freeze(["rows","pushdown","router","grid"]),P=Object.freeze(["chart","leaflet","deckgl"]),T=Object.freeze(["layout","panels","sources","links"]),de=Object.freeze(["id","kind","title","source","options","binding"]),_=Object.freeze(["from","to","on"]),H=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ie="grid:";function v(c){if(!c||typeof c!="object"||Array.isArray(c))return!1;const p=Object.getPrototypeOf(c);return p===Object.prototype||p===null}function ee(c,p){if(p==="rows"&&Array.isArray(c))return c;if(Array.isArray(c))return c.map(D=>ee(D));if(!v(c)||Object.values(c).some(D=>typeof D=="function"))return c;const q={};for(const[D,O]of Object.entries(c))O!==void 0&&(q[D]=ee(O,D));return q}function ue(c,p){if(c===p)return!0;if(Array.isArray(c)||Array.isArray(p))return!Array.isArray(c)||!Array.isArray(p)||c.length!==p.length?!1:c.every((O,B)=>ue(O,p[B]));if(!v(c)||!v(p))return!1;const q=Object.keys(c).filter(O=>c[O]!==void 0),D=Object.keys(p).filter(O=>p[O]!==void 0);return q.length!==D.length?!1:q.every(O=>ue(c[O],p[O]))}function re(c){return typeof c!="string"||c===""?null:c.startsWith(ie)?{kind:"grid",of:c.slice(ie.length)}:{kind:"named",id:c}}function L(c){return typeof c=="string"&&c!==""?{from:c,to:c}:typeof c=="function"?c:v(c)&&typeof c.from=="string"&&c.from!==""&&typeof c.to=="string"&&c.to!==""?{from:c.from,to:c.to}:null}function b(c){const p=[],q=new Set,D=new Set,O=new Set,B=new Set,M={fatal:null,problems:p,badPanels:q,badSources:D,badLinks:O,badWindows:B};if(!v(c))return M.fatal="the spec is not an object",p.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),M;const R=c;if(!Array.isArray(R.panels))return M.fatal="spec.panels is not an array",p.push({path:"panels",message:"is not an array of panels"}),M;for(const o of Object.keys(R))T.includes(o)||p.push({path:o,message:`is not a dashboard spec key (${T.join(", ")})`});const S=new Map;R.panels.forEach((o,d)=>{const s=`panels[${d}]`;if(!v(o)){q.add(d),p.push({path:s,message:"is not an object"});return}if(typeof o.id!="string"||o.id===""){q.add(d),p.push({path:`${s}.id`,message:"is missing: every panel needs a unique string id"});return}if(S.has(o.id)){q.add(d),p.push({path:`${s}.id`,panel:o.id,message:`repeats "${o.id}", which panels[${S.get(o.id).index}] already uses`});return}S.set(o.id,{index:d,kind:o.kind})});const N=R.sources===void 0?{}:R.sources;if(!v(N))p.push({path:"sources",message:"is not an object of named sources"});else for(const[o,d]of Object.entries(N)){const s=`sources.${o}`,a=(w,F)=>{D.add(o),p.push({path:w,message:F})};if(!v(d)){a(s,"is not an object");continue}if(!K.includes(d.kind)){a(`${s}.kind`,`names no source kind (${K.join(", ")})`);continue}const m=H[d.kind];if(m)for(const w of Object.keys(d))m.includes(w)||p.push({path:`${s}.${w}`,message:`is not a key of a ${d.kind} source (${m.join(", ")})`});if(d.columns!==void 0&&!Array.isArray(d.columns)&&a(`${s}.columns`,"is not an array of columns"),d.kind==="rows"&&!Array.isArray(d.rows)&&a(`${s}.rows`,"is not an array of rows"),d.kind==="pushdown"&&!(d.adapter&&typeof d.adapter.execute=="function")&&a(`${s}.adapter`,"is not a pushdown adapter (an object with execute())"),d.kind==="router"&&(d.router&&typeof d.router.attach=="function"||a(`${s}.router`,"is not a Data Router (an object with attach())"),d.predicate===void 0&&a(`${s}.predicate`,"is missing: name the partition value or predicate the route matches")),d.kind==="grid"){const w=typeof d.of=="string"?S.get(d.of):void 0;w?w.kind!=="grid"&&a(`${s}.of`,`names "${d.of}", a ${w.kind} panel: only a grid panel has a grid to view`):a(`${s}.of`,"names no panel")}}const E=new Map;R.panels.forEach((o,d)=>{if(q.has(d))return;const s=`panels[${d}]`,a=(F,te)=>{q.add(d),p.push({path:F,panel:o.id,message:te})};for(const F of Object.keys(o))de.includes(F)||p.push({path:`${s}.${F}`,panel:o.id,message:`is not a panel key (${de.join(", ")}); a viewer's own settings go in options`});if(!W.includes(o.kind)){a(`${s}.kind`,`names no panel kind (${W.join(", ")})`);return}if(o.title!==void 0&&typeof o.title!="string"&&p.push({path:`${s}.title`,panel:o.id,message:"is not a string"}),o.options!==void 0&&!v(o.options)){a(`${s}.options`,"is not an object");return}if(o.binding!==void 0&&(o.kind!=="map"?a(`${s}.binding`,`is only read on a map panel, and this is a ${o.kind} panel`):P.includes(o.binding)||a(`${s}.binding`,`names no map binding (${P.join(", ")})`)),o.source===void 0){(o.kind==="chart"||o.kind==="map"||o.kind==="calendar")&&a(`${s}.source`,`is missing: a ${o.kind} panel draws a source's rows`);return}if(o.kind==="html"){a(`${s}.source`,"is set on an html panel, which reads no rows");return}const m=re(o.source);if(!m){a(`${s}.source`,"is not a source id");return}let w=null;if(m.kind==="grid")w=m.of;else if(!v(N)||!Object.hasOwn(N,m.id)){a(`${s}.source`,`names "${m.id}", which is not in sources`);return}else if(D.has(m.id)){a(`${s}.source`,`names "${m.id}", a source that is not usable`);return}else N[m.id].kind==="grid"&&(w=N[m.id].of);if(w!==null){const F=S.get(w);if(!F){a(`${s}.source`,`views the grid of "${w}", which is not a panel`);return}if(F.kind!=="grid"){a(`${s}.source`,`views the grid of "${w}", a ${F.kind} panel`);return}if(w===o.id){a(`${s}.source`,"views its own grid");return}E.set(o.id,w)}});for(let o=!0;o;)o=!1,R.panels.forEach((d,s)=>{if(q.has(s)||!E.has(d.id))return;const a=new Set([d.id]);let m=E.get(d.id);for(;m!==void 0;){const w=S.get(m);if(a.has(m)){q.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`is part of a cycle of panels viewing each other's grids (${[...a,m].join(" -> ")})`}),o=!0;return}if(!w||q.has(w.index)){q.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`views the grid of "${m}", a panel that was not built`}),o=!0;return}a.add(m),m=E.get(m)}});if(R.links!==void 0&&!Array.isArray(R.links)?p.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((o,d)=>{const s=`links[${d}]`,a=(m,w)=>{O.add(d),p.push({path:m,link:d,message:w})};if(!v(o)){a(s,"is not an object");return}for(const m of Object.keys(o))_.includes(m)||p.push({path:`${s}.${m}`,link:d,message:`is not a link key (${_.join(", ")})`});if(typeof o.from!="string"||!S.has(o.from)){a(`${s}.from`,"names no panel");return}if(typeof o.to!="string"||!S.has(o.to)){a(`${s}.to`,"names no panel");return}if(o.from===o.to){a(`${s}.to`,"is the panel the link starts from");return}L(o.on)||a(`${s}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!v(R.layout))p.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))p.push({path:"layout.windows",message:"is not an array of windows"});else{const o=new Set;R.layout.windows.forEach((d,s)=>{const a=`layout.windows[${s}]`;!v(d)||typeof d.id!="string"?(B.add(s),p.push({path:a,message:"is not a window with a string id"})):S.has(d.id)?o.has(d.id)?(B.add(s),p.push({path:`${a}.id`,message:`places "${d.id}" a second time`})):o.add(d.id):(B.add(s),p.push({path:`${a}.id`,message:`names "${d.id}", which is not a panel`}))})}}return M}function $(c){const{problems:p}=b(c);return{ok:p.length===0,problems:p.map(({path:q,message:D})=>({path:q,message:D}))}}}),Pe("packages/modules/dashboard/propose.js",function(h,x){"use strict";Object.defineProperty(h,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(h,"columnRefs",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"proposalRequest",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"parseProposal",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"checkProposal",{enumerable:!0,get:function(){return re}});const W=x("packages/modules/dashboard/spec.js"),K=W.inspectSpec,P=W.isPlain,T=W.copySpec,de=W.parseSourceRef,_=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),H=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ie(L){const b=new Set,$=P(L.options)?L.options:{},c=p=>{typeof p=="string"&&p!==""&&b.add(p)};if(L.kind==="grid")for(const p of Array.isArray($.columns)?$.columns:[])P(p)&&c(p.field);else if(L.kind==="kpi"){for(const p of Array.isArray($.tiles)?$.tiles:[])P(p)&&c(p.field);for(const p of Array.isArray($.fields)?$.fields:[])c(p)}else if(L.kind==="chart"||L.kind==="map"&&(L.binding||"chart")==="chart")for(const p of H)c($[p]);else L.kind==="map"&&P($.position)&&(c($.position.lon),c($.position.lat),c($.position.geometry));return[...b]}function v(L,b){const $={source:b.source,columns:b.columns,kinds:b.kinds};let c=`${L}
|
|
7
7
|
|
|
8
8
|
SCHEMA
|
|
9
9
|
${JSON.stringify($)}`;b.rows&&(c+=`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.88.
|
|
2
|
+
* Lattice Grid 1.88.3, dashboard module
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
|
-
(function(De){"use strict";var Le=Object.create(null),Me=Object.create(null);function Oe(h,x){Le[h]=x}function Ce(h){var x=Me[h];if(x)return x;var W=Object.create(null);Me[h]=W;var K=Le[h];if(!K)throw new Error("[lattice] missing module: "+h);return K(W,Ce),W}Oe("packages/core/src/internal/util.js",function(h,x){"use strict";Object.defineProperty(h,"VERSION",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"reportedWarnings",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"warnOnce",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"infoOnce",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"resetWarnings",{enumerable:!0,get:function(){return $}}),Object.defineProperty(h,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(h,"invariant",{enumerable:!0,get:function(){return p}}),Object.defineProperty(h,"DEV",{enumerable:!0,get:function(){return T}}),Object.defineProperty(h,"isObject",{enumerable:!0,get:function(){return M}}),Object.defineProperty(h,"isFunction",{enumerable:!0,get:function(){return O}}),Object.defineProperty(h,"isNil",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"isBlank",{enumerable:!0,get:function(){return C}}),Object.defineProperty(h,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(h,"pathSetter",{enumerable:!0,get:function(){return o}}),Object.defineProperty(h,"getPath",{enumerable:!0,get:function(){return d}}),Object.defineProperty(h,"setPath",{enumerable:!0,get:function(){return s}}),Object.defineProperty(h,"humanise",{enumerable:!0,get:function(){return a}}),Object.defineProperty(h,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(h,"titleCase",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(h,"mergeRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(h,"Lru",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"collator",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(h,"defaultCompare",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(h,"now",{enumerable:!0,get:function(){return he}}),Object.defineProperty(h,"nextFrame",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(h,"cancelFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(h,"frameBatched",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(h,"settleDebounce",{enumerable:!0,get:function(){return je}}),Object.defineProperty(h,"whenIdle",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(h,"uid",{enumerable:!0,get:function(){return Ee}});const W="1.88.2";async function K(){return W}const P="1.88.2",F=new Set,de=2e3;function _(t){if(F.add(t),F.size>de){const n=F.values().next().value;n!==void 0&&F.delete(n)}}const H=[],ie=500;function v(t,n,i){H.push({key:t,level:n,message:i.map(k=>typeof k=="string"?k:ee(k)).join(" "),at:Date.now()}),H.length>ie&&H.shift()}function ee(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function ue(){return H.map(t=>({...t}))}function re(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function L(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"warn",i),console.warn("[lattice]",...i)}function b(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"info",i),console.info("[lattice]",...i)}function $(){F.clear(),H.length=0}function c(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function p(t,n){t||c(n)}const T=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function M(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function O(t){return typeof t=="function"}function B(t){return t==null}function C(t){return t==null||t===""}function R(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const S=new Map;function N(t){let n=S.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),k=i.length;n=V=>{let U=V;for(let Y=0;Y<k;Y++){if(U==null)return;U=U[i[Y]]}return U}}return S.set(t,n),n}const E=new Map;function o(t){let n=E.get(t);if(n)return n;if(!t.includes("."))n=(i,k)=>{i!=null&&(i[t]=k)};else{const i=t.split("."),k=i.length-1;n=(V,U)=>{let Y=V;for(let Q=0;Q<k;Q++){if(Y==null)return;const me=i[Q];Y[me]==null&&(Y[me]={}),Y=Y[me]}Y!=null&&(Y[i[k]]=U)}}return E.set(t,n),n}function d(t,n){return N(n)(t)}function s(t,n,i){o(n)(t,i)}function a(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const m={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>m[i]):n}function q(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function te(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:M(t)?t:{[n]:t,enabled:!0}}function oe(t){return t==null?[]:Array.isArray(t)?t:[t]}const ke=Object.freeze(new Set(["__proto__","constructor","prototype"]));function pe(t,n){if(!M(t))return M(n)?{...n}:n;if(!M(n))return n===void 0?t:n;const i={...t};for(const k of Object.keys(n)){if(ke.has(k))continue;const V=n[k];V!==void 0&&(i[k]=M(V)&&M(i[k])?pe(i[k],V):V)}return i}function we(t,n){if(!M(t)||!M(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class J{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const k=i.get(n);return i.delete(n),i.set(n,k),k}peek(n){return this.#e.get(n)}set(n,i){const k=this.#e;return k.has(n)&&k.delete(n),k.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,k=n.get(i);n.delete(i),this.#t&&this.#t(k,i)}}}const ce=new Map;function ve(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let k=ce.get(i);return k||(k=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),ce.set(i,k)),k}function ne(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),k=String(n);return i<k?-1:i>k?1:0}function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const $e=typeof requestAnimationFrame=="function";function ge(t){return $e?requestAnimationFrame(t):setTimeout(()=>t(he()),16)}function le(t){t!=null&&($e?cancelAnimationFrame(t):clearTimeout(t))}function Ne(t){let n=null,i=null;const k=()=>{n=null;const U=i;i=null,t(...U||[])},V=(...U)=>{i=U,n===null&&(n=ge(k))};return V.cancel=()=>{le(n),n=null,i=null},V.flush=()=>{n!==null&&(le(n),k())},V}function je(t,n){let i=null,k=null;const V=()=>{if(i=null,k===null)return;const Q=k;k=null,t(...Q),U()},U=()=>{i=setTimeout(V,n),typeof i?.unref=="function"&&i.unref()},Y=(...Q)=>{i===null?(t(...Q),U()):(k=Q,clearTimeout(i),U())};return Y.flush=()=>{if(i!==null&&clearTimeout(i),i=null,k===null)return;const Q=k;k=null,t(...Q)},Y.cancel=()=>{i!==null&&clearTimeout(i),i=null,k=null},Y.pending=()=>i!==null||k!==null,Y}function Re(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let Se=0;function Ee(t="l"){return`${t}${(++Se).toString(36)}`}}),Oe("packages/modules/dashboard/spec.js",function(h,x){"use strict";Object.defineProperty(h,"PANEL_KINDS",{enumerable:!0,get:function(){return W}}),Object.defineProperty(h,"SOURCE_KINDS",{enumerable:!0,get:function(){return K}}),Object.defineProperty(h,"MAP_BINDINGS",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"GRID_REF",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"isPlain",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"copySpec",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(h,"sameSpec",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"parseSourceRef",{enumerable:!0,get:function(){return re}}),Object.defineProperty(h,"readRelation",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"inspectSpec",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"validateDashboardSpec",{enumerable:!0,get:function(){return $}});const W=Object.freeze(["grid","chart","kpi","calendar","map","html"]),K=Object.freeze(["rows","pushdown","router","grid"]),P=Object.freeze(["chart","leaflet","deckgl"]),F=Object.freeze(["layout","panels","sources","links"]),de=Object.freeze(["id","kind","title","source","options","binding"]),_=Object.freeze(["from","to","on"]),H=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ie="grid:";function v(c){if(!c||typeof c!="object"||Array.isArray(c))return!1;const p=Object.getPrototypeOf(c);return p===Object.prototype||p===null}function ee(c,p){if(p==="rows"&&Array.isArray(c))return c;if(Array.isArray(c))return c.map(M=>ee(M));if(!v(c)||Object.values(c).some(M=>typeof M=="function"))return c;const T={};for(const[M,O]of Object.entries(c))O!==void 0&&(T[M]=ee(O,M));return T}function ue(c,p){if(c===p)return!0;if(Array.isArray(c)||Array.isArray(p))return!Array.isArray(c)||!Array.isArray(p)||c.length!==p.length?!1:c.every((O,B)=>ue(O,p[B]));if(!v(c)||!v(p))return!1;const T=Object.keys(c).filter(O=>c[O]!==void 0),M=Object.keys(p).filter(O=>p[O]!==void 0);return T.length!==M.length?!1:T.every(O=>ue(c[O],p[O]))}function re(c){return typeof c!="string"||c===""?null:c.startsWith(ie)?{kind:"grid",of:c.slice(ie.length)}:{kind:"named",id:c}}function L(c){return typeof c=="string"&&c!==""?{from:c,to:c}:typeof c=="function"?c:v(c)&&typeof c.from=="string"&&c.from!==""&&typeof c.to=="string"&&c.to!==""?{from:c.from,to:c.to}:null}function b(c){const p=[],T=new Set,M=new Set,O=new Set,B=new Set,C={fatal:null,problems:p,badPanels:T,badSources:M,badLinks:O,badWindows:B};if(!v(c))return C.fatal="the spec is not an object",p.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),C;const R=c;if(!Array.isArray(R.panels))return C.fatal="spec.panels is not an array",p.push({path:"panels",message:"is not an array of panels"}),C;for(const o of Object.keys(R))F.includes(o)||p.push({path:o,message:`is not a dashboard spec key (${F.join(", ")})`});const S=new Map;R.panels.forEach((o,d)=>{const s=`panels[${d}]`;if(!v(o)){T.add(d),p.push({path:s,message:"is not an object"});return}if(typeof o.id!="string"||o.id===""){T.add(d),p.push({path:`${s}.id`,message:"is missing: every panel needs a unique string id"});return}if(S.has(o.id)){T.add(d),p.push({path:`${s}.id`,panel:o.id,message:`repeats "${o.id}", which panels[${S.get(o.id).index}] already uses`});return}S.set(o.id,{index:d,kind:o.kind})});const N=R.sources===void 0?{}:R.sources;if(!v(N))p.push({path:"sources",message:"is not an object of named sources"});else for(const[o,d]of Object.entries(N)){const s=`sources.${o}`,a=(w,q)=>{M.add(o),p.push({path:w,message:q})};if(!v(d)){a(s,"is not an object");continue}if(!K.includes(d.kind)){a(`${s}.kind`,`names no source kind (${K.join(", ")})`);continue}const m=H[d.kind];if(m)for(const w of Object.keys(d))m.includes(w)||p.push({path:`${s}.${w}`,message:`is not a key of a ${d.kind} source (${m.join(", ")})`});if(d.columns!==void 0&&!Array.isArray(d.columns)&&a(`${s}.columns`,"is not an array of columns"),d.kind==="rows"&&!Array.isArray(d.rows)&&a(`${s}.rows`,"is not an array of rows"),d.kind==="pushdown"&&!(d.adapter&&typeof d.adapter.execute=="function")&&a(`${s}.adapter`,"is not a pushdown adapter (an object with execute())"),d.kind==="router"&&(d.router&&typeof d.router.attach=="function"||a(`${s}.router`,"is not a Data Router (an object with attach())"),d.predicate===void 0&&a(`${s}.predicate`,"is missing: name the partition value or predicate the route matches")),d.kind==="grid"){const w=typeof d.of=="string"?S.get(d.of):void 0;w?w.kind!=="grid"&&a(`${s}.of`,`names "${d.of}", a ${w.kind} panel: only a grid panel has a grid to view`):a(`${s}.of`,"names no panel")}}const E=new Map;R.panels.forEach((o,d)=>{if(T.has(d))return;const s=`panels[${d}]`,a=(q,te)=>{T.add(d),p.push({path:q,panel:o.id,message:te})};for(const q of Object.keys(o))de.includes(q)||p.push({path:`${s}.${q}`,panel:o.id,message:`is not a panel key (${de.join(", ")}); a viewer's own settings go in options`});if(!W.includes(o.kind)){a(`${s}.kind`,`names no panel kind (${W.join(", ")})`);return}if(o.title!==void 0&&typeof o.title!="string"&&p.push({path:`${s}.title`,panel:o.id,message:"is not a string"}),o.options!==void 0&&!v(o.options)){a(`${s}.options`,"is not an object");return}if(o.binding!==void 0&&(o.kind!=="map"?a(`${s}.binding`,`is only read on a map panel, and this is a ${o.kind} panel`):P.includes(o.binding)||a(`${s}.binding`,`names no map binding (${P.join(", ")})`)),o.source===void 0){(o.kind==="chart"||o.kind==="map"||o.kind==="calendar")&&a(`${s}.source`,`is missing: a ${o.kind} panel draws a source's rows`);return}if(o.kind==="html"){a(`${s}.source`,"is set on an html panel, which reads no rows");return}const m=re(o.source);if(!m){a(`${s}.source`,"is not a source id");return}let w=null;if(m.kind==="grid")w=m.of;else if(!v(N)||!Object.hasOwn(N,m.id)){a(`${s}.source`,`names "${m.id}", which is not in sources`);return}else if(M.has(m.id)){a(`${s}.source`,`names "${m.id}", a source that is not usable`);return}else N[m.id].kind==="grid"&&(w=N[m.id].of);if(w!==null){const q=S.get(w);if(!q){a(`${s}.source`,`views the grid of "${w}", which is not a panel`);return}if(q.kind!=="grid"){a(`${s}.source`,`views the grid of "${w}", a ${q.kind} panel`);return}if(w===o.id){a(`${s}.source`,"views its own grid");return}E.set(o.id,w)}});for(let o=!0;o;)o=!1,R.panels.forEach((d,s)=>{if(T.has(s)||!E.has(d.id))return;const a=new Set([d.id]);let m=E.get(d.id);for(;m!==void 0;){const w=S.get(m);if(a.has(m)){T.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`is part of a cycle of panels viewing each other's grids (${[...a,m].join(" -> ")})`}),o=!0;return}if(!w||T.has(w.index)){T.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`views the grid of "${m}", a panel that was not built`}),o=!0;return}a.add(m),m=E.get(m)}});if(R.links!==void 0&&!Array.isArray(R.links)?p.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((o,d)=>{const s=`links[${d}]`,a=(m,w)=>{O.add(d),p.push({path:m,link:d,message:w})};if(!v(o)){a(s,"is not an object");return}for(const m of Object.keys(o))_.includes(m)||p.push({path:`${s}.${m}`,link:d,message:`is not a link key (${_.join(", ")})`});if(typeof o.from!="string"||!S.has(o.from)){a(`${s}.from`,"names no panel");return}if(typeof o.to!="string"||!S.has(o.to)){a(`${s}.to`,"names no panel");return}if(o.from===o.to){a(`${s}.to`,"is the panel the link starts from");return}L(o.on)||a(`${s}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!v(R.layout))p.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))p.push({path:"layout.windows",message:"is not an array of windows"});else{const o=new Set;R.layout.windows.forEach((d,s)=>{const a=`layout.windows[${s}]`;!v(d)||typeof d.id!="string"?(B.add(s),p.push({path:a,message:"is not a window with a string id"})):S.has(d.id)?o.has(d.id)?(B.add(s),p.push({path:`${a}.id`,message:`places "${d.id}" a second time`})):o.add(d.id):(B.add(s),p.push({path:`${a}.id`,message:`names "${d.id}", which is not a panel`}))})}}return C}function $(c){const{problems:p}=b(c);return{ok:p.length===0,problems:p.map(({path:T,message:M})=>({path:T,message:M}))}}}),Oe("packages/modules/dashboard/propose.js",function(h,x){"use strict";Object.defineProperty(h,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(h,"columnRefs",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"proposalRequest",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"parseProposal",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"checkProposal",{enumerable:!0,get:function(){return re}});const W=x("packages/modules/dashboard/spec.js"),K=W.inspectSpec,P=W.isPlain,F=W.copySpec,de=W.parseSourceRef,_=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),H=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ie(L){const b=new Set,$=P(L.options)?L.options:{},c=p=>{typeof p=="string"&&p!==""&&b.add(p)};if(L.kind==="grid")for(const p of Array.isArray($.columns)?$.columns:[])P(p)&&c(p.field);else if(L.kind==="kpi"){for(const p of Array.isArray($.tiles)?$.tiles:[])P(p)&&c(p.field);for(const p of Array.isArray($.fields)?$.fields:[])c(p)}else if(L.kind==="chart"||L.kind==="map"&&(L.binding||"chart")==="chart")for(const p of H)c($[p]);else L.kind==="map"&&P($.position)&&(c($.position.lon),c($.position.lat),c($.position.geometry));return[...b]}function v(L,b){const $={source:b.source,columns:b.columns,kinds:b.kinds};let c=`${L}
|
|
6
|
+
(function(De){"use strict";var Le=Object.create(null),Me=Object.create(null);function Oe(h,x){Le[h]=x}function Ce(h){var x=Me[h];if(x)return x;var W=Object.create(null);Me[h]=W;var K=Le[h];if(!K)throw new Error("[lattice] missing module: "+h);return K(W,Ce),W}Oe("packages/core/src/internal/util.js",function(h,x){"use strict";Object.defineProperty(h,"VERSION",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"reportedWarnings",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"warnOnce",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"infoOnce",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"resetWarnings",{enumerable:!0,get:function(){return $}}),Object.defineProperty(h,"fail",{enumerable:!0,get:function(){return c}}),Object.defineProperty(h,"invariant",{enumerable:!0,get:function(){return p}}),Object.defineProperty(h,"DEV",{enumerable:!0,get:function(){return T}}),Object.defineProperty(h,"isObject",{enumerable:!0,get:function(){return M}}),Object.defineProperty(h,"isFunction",{enumerable:!0,get:function(){return O}}),Object.defineProperty(h,"isNil",{enumerable:!0,get:function(){return B}}),Object.defineProperty(h,"isBlank",{enumerable:!0,get:function(){return C}}),Object.defineProperty(h,"isCtor",{enumerable:!0,get:function(){return R}}),Object.defineProperty(h,"pathGetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(h,"pathSetter",{enumerable:!0,get:function(){return o}}),Object.defineProperty(h,"getPath",{enumerable:!0,get:function(){return d}}),Object.defineProperty(h,"setPath",{enumerable:!0,get:function(){return s}}),Object.defineProperty(h,"humanise",{enumerable:!0,get:function(){return a}}),Object.defineProperty(h,"escapeHtml",{enumerable:!0,get:function(){return w}}),Object.defineProperty(h,"titleCase",{enumerable:!0,get:function(){return q}}),Object.defineProperty(h,"expand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(h,"toArray",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(h,"merge",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(h,"mergeRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(h,"Lru",{enumerable:!0,get:function(){return J}}),Object.defineProperty(h,"collator",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(h,"defaultCompare",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(h,"now",{enumerable:!0,get:function(){return he}}),Object.defineProperty(h,"nextFrame",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(h,"cancelFrame",{enumerable:!0,get:function(){return le}}),Object.defineProperty(h,"frameBatched",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(h,"settleDebounce",{enumerable:!0,get:function(){return je}}),Object.defineProperty(h,"whenIdle",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(h,"uid",{enumerable:!0,get:function(){return Ee}});const W="1.88.3";async function K(){return W}const P="1.88.3",F=new Set,de=2e3;function _(t){if(F.add(t),F.size>de){const n=F.values().next().value;n!==void 0&&F.delete(n)}}const H=[],ie=500;function v(t,n,i){H.push({key:t,level:n,message:i.map(k=>typeof k=="string"?k:ee(k)).join(" "),at:Date.now()}),H.length>ie&&H.shift()}function ee(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch{return String(t)}}function ue(){return H.map(t=>({...t}))}function re(t){if(t.length===0||typeof t[0]!="string")return t;const n=t[0].replace(/^\[lattice\]\s*/,"");return n===t[0]?t:[n,...t.slice(1)]}function L(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"warn",i),console.warn("[lattice]",...i)}function b(t,...n){if(F.has(t))return;_(t);const i=re(n);v(t,"info",i),console.info("[lattice]",...i)}function $(){F.clear(),H.length=0}function c(t,n){const i=new Error(`[lattice] ${t}`);throw n!==void 0&&(i.cause=n),i}function p(t,n){t||c(n)}const T=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function M(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function O(t){return typeof t=="function"}function B(t){return t==null}function C(t){return t==null||t===""}function R(t){return typeof t!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(t))?!0:!!(t.prototype&&Object.getOwnPropertyNames(t.prototype).length>1)}const S=new Map;function N(t){let n=S.get(t);if(n)return n;if(!t.includes("."))n=i=>i?.[t];else{const i=t.split("."),k=i.length;n=V=>{let U=V;for(let Y=0;Y<k;Y++){if(U==null)return;U=U[i[Y]]}return U}}return S.set(t,n),n}const E=new Map;function o(t){let n=E.get(t);if(n)return n;if(!t.includes("."))n=(i,k)=>{i!=null&&(i[t]=k)};else{const i=t.split("."),k=i.length-1;n=(V,U)=>{let Y=V;for(let Q=0;Q<k;Q++){if(Y==null)return;const me=i[Q];Y[me]==null&&(Y[me]={}),Y=Y[me]}Y!=null&&(Y[i[k]]=U)}}return E.set(t,n),n}function d(t,n){return N(n)(t)}function s(t,n,i){o(n)(t,i)}function a(t){return t?(t.includes(".")?t.slice(t.lastIndexOf(".")+1):t).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,i=>i.toUpperCase()):""}const m={"&":"&","<":"<",">":">",'"':""","'":"'"};function w(t){const n=t==null?"":String(t);return/[&<>"']/.test(n)?n.replace(/[&<>"']/g,i=>m[i]):n}function q(t){return String(t).replace(/\w\S*/g,n=>n[0].toUpperCase()+n.slice(1).toLowerCase())}function te(t,n,i){if(t!==void 0)return t===!0?{enabled:!0,...i}:t===!1?{enabled:!1}:M(t)?t:{[n]:t,enabled:!0}}function oe(t){return t==null?[]:Array.isArray(t)?t:[t]}const ke=Object.freeze(new Set(["__proto__","constructor","prototype"]));function pe(t,n){if(!M(t))return M(n)?{...n}:n;if(!M(n))return n===void 0?t:n;const i={...t};for(const k of Object.keys(n)){if(ke.has(k))continue;const V=n[k];V!==void 0&&(i[k]=M(V)&&M(i[k])?pe(i[k],V):V)}return i}function we(t,n){if(!M(t)||!M(n)||t===n)return n;const i=Object.create(Object.getPrototypeOf(t));return Object.assign(i,t,n),i}class J{#n;#e=new Map;#t;constructor(n=256,i=null){this.#n=n,this.#t=i}get size(){return this.#e.size}get max(){return this.#n}set max(n){this.#n=n,this.#r()}has(n){return this.#e.has(n)}get(n){const i=this.#e;if(!i.has(n))return;const k=i.get(n);return i.delete(n),i.set(n,k),k}peek(n){return this.#e.get(n)}set(n,i){const k=this.#e;return k.has(n)&&k.delete(n),k.set(n,i),this.#r(),i}delete(n){const i=this.#e.get(n);return this.#e.delete(n)&&this.#t&&this.#t(i,n),i}clear(){if(this.#t)for(const[n,i]of this.#e)this.#t(i,n);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const n=this.#e;for(;n.size>this.#n;){const i=n.keys().next().value,k=n.get(i);n.delete(i),this.#t&&this.#t(k,i)}}}const ce=new Map;function ve(t,n){const i=`${t||""}|${n?JSON.stringify(n):""}`;let k=ce.get(i);return k||(k=new Intl.Collator(t||void 0,{numeric:!0,sensitivity:"variant",...n}),ce.set(i,k)),k}function ne(t,n){if(t===n)return 0;if(t==null)return 1;if(n==null)return-1;if(typeof t=="number"&&typeof n=="number")return Number.isNaN(t)?Number.isNaN(n)?0:1:Number.isNaN(n)||t<n?-1:t>n?1:0;const i=String(t),k=String(n);return i<k?-1:i>k?1:0}function he(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const $e=typeof requestAnimationFrame=="function";function ge(t){return $e?requestAnimationFrame(t):setTimeout(()=>t(he()),16)}function le(t){t!=null&&($e?cancelAnimationFrame(t):clearTimeout(t))}function Ne(t){let n=null,i=null;const k=()=>{n=null;const U=i;i=null,t(...U||[])},V=(...U)=>{i=U,n===null&&(n=ge(k))};return V.cancel=()=>{le(n),n=null,i=null},V.flush=()=>{n!==null&&(le(n),k())},V}function je(t,n){let i=null,k=null;const V=()=>{if(i=null,k===null)return;const Q=k;k=null,t(...Q),U()},U=()=>{i=setTimeout(V,n),typeof i?.unref=="function"&&i.unref()},Y=(...Q)=>{i===null?(t(...Q),U()):(k=Q,clearTimeout(i),U())};return Y.flush=()=>{if(i!==null&&clearTimeout(i),i=null,k===null)return;const Q=k;k=null,t(...Q)},Y.cancel=()=>{i!==null&&clearTimeout(i),i=null,k=null},Y.pending=()=>i!==null||k!==null,Y}function Re(t,n=50){return typeof requestIdleCallback=="function"?requestIdleCallback(t,{timeout:n}):setTimeout(()=>t({timeRemaining:()=>0,didTimeout:!0}),1)}let Se=0;function Ee(t="l"){return`${t}${(++Se).toString(36)}`}}),Oe("packages/modules/dashboard/spec.js",function(h,x){"use strict";Object.defineProperty(h,"PANEL_KINDS",{enumerable:!0,get:function(){return W}}),Object.defineProperty(h,"SOURCE_KINDS",{enumerable:!0,get:function(){return K}}),Object.defineProperty(h,"MAP_BINDINGS",{enumerable:!0,get:function(){return P}}),Object.defineProperty(h,"GRID_REF",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"isPlain",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"copySpec",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(h,"sameSpec",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"parseSourceRef",{enumerable:!0,get:function(){return re}}),Object.defineProperty(h,"readRelation",{enumerable:!0,get:function(){return L}}),Object.defineProperty(h,"inspectSpec",{enumerable:!0,get:function(){return b}}),Object.defineProperty(h,"validateDashboardSpec",{enumerable:!0,get:function(){return $}});const W=Object.freeze(["grid","chart","kpi","calendar","map","html"]),K=Object.freeze(["rows","pushdown","router","grid"]),P=Object.freeze(["chart","leaflet","deckgl"]),F=Object.freeze(["layout","panels","sources","links"]),de=Object.freeze(["id","kind","title","source","options","binding"]),_=Object.freeze(["from","to","on"]),H=Object.freeze({rows:["kind","rows","columns","rowKey"],router:["kind","router","predicate","route","columns","rowKey"],grid:["kind","of"]}),ie="grid:";function v(c){if(!c||typeof c!="object"||Array.isArray(c))return!1;const p=Object.getPrototypeOf(c);return p===Object.prototype||p===null}function ee(c,p){if(p==="rows"&&Array.isArray(c))return c;if(Array.isArray(c))return c.map(M=>ee(M));if(!v(c)||Object.values(c).some(M=>typeof M=="function"))return c;const T={};for(const[M,O]of Object.entries(c))O!==void 0&&(T[M]=ee(O,M));return T}function ue(c,p){if(c===p)return!0;if(Array.isArray(c)||Array.isArray(p))return!Array.isArray(c)||!Array.isArray(p)||c.length!==p.length?!1:c.every((O,B)=>ue(O,p[B]));if(!v(c)||!v(p))return!1;const T=Object.keys(c).filter(O=>c[O]!==void 0),M=Object.keys(p).filter(O=>p[O]!==void 0);return T.length!==M.length?!1:T.every(O=>ue(c[O],p[O]))}function re(c){return typeof c!="string"||c===""?null:c.startsWith(ie)?{kind:"grid",of:c.slice(ie.length)}:{kind:"named",id:c}}function L(c){return typeof c=="string"&&c!==""?{from:c,to:c}:typeof c=="function"?c:v(c)&&typeof c.from=="string"&&c.from!==""&&typeof c.to=="string"&&c.to!==""?{from:c.from,to:c.to}:null}function b(c){const p=[],T=new Set,M=new Set,O=new Set,B=new Set,C={fatal:null,problems:p,badPanels:T,badSources:M,badLinks:O,badWindows:B};if(!v(c))return C.fatal="the spec is not an object",p.push({path:"",message:"is not an object: a spec is { layout, panels, sources, links }"}),C;const R=c;if(!Array.isArray(R.panels))return C.fatal="spec.panels is not an array",p.push({path:"panels",message:"is not an array of panels"}),C;for(const o of Object.keys(R))F.includes(o)||p.push({path:o,message:`is not a dashboard spec key (${F.join(", ")})`});const S=new Map;R.panels.forEach((o,d)=>{const s=`panels[${d}]`;if(!v(o)){T.add(d),p.push({path:s,message:"is not an object"});return}if(typeof o.id!="string"||o.id===""){T.add(d),p.push({path:`${s}.id`,message:"is missing: every panel needs a unique string id"});return}if(S.has(o.id)){T.add(d),p.push({path:`${s}.id`,panel:o.id,message:`repeats "${o.id}", which panels[${S.get(o.id).index}] already uses`});return}S.set(o.id,{index:d,kind:o.kind})});const N=R.sources===void 0?{}:R.sources;if(!v(N))p.push({path:"sources",message:"is not an object of named sources"});else for(const[o,d]of Object.entries(N)){const s=`sources.${o}`,a=(w,q)=>{M.add(o),p.push({path:w,message:q})};if(!v(d)){a(s,"is not an object");continue}if(!K.includes(d.kind)){a(`${s}.kind`,`names no source kind (${K.join(", ")})`);continue}const m=H[d.kind];if(m)for(const w of Object.keys(d))m.includes(w)||p.push({path:`${s}.${w}`,message:`is not a key of a ${d.kind} source (${m.join(", ")})`});if(d.columns!==void 0&&!Array.isArray(d.columns)&&a(`${s}.columns`,"is not an array of columns"),d.kind==="rows"&&!Array.isArray(d.rows)&&a(`${s}.rows`,"is not an array of rows"),d.kind==="pushdown"&&!(d.adapter&&typeof d.adapter.execute=="function")&&a(`${s}.adapter`,"is not a pushdown adapter (an object with execute())"),d.kind==="router"&&(d.router&&typeof d.router.attach=="function"||a(`${s}.router`,"is not a Data Router (an object with attach())"),d.predicate===void 0&&a(`${s}.predicate`,"is missing: name the partition value or predicate the route matches")),d.kind==="grid"){const w=typeof d.of=="string"?S.get(d.of):void 0;w?w.kind!=="grid"&&a(`${s}.of`,`names "${d.of}", a ${w.kind} panel: only a grid panel has a grid to view`):a(`${s}.of`,"names no panel")}}const E=new Map;R.panels.forEach((o,d)=>{if(T.has(d))return;const s=`panels[${d}]`,a=(q,te)=>{T.add(d),p.push({path:q,panel:o.id,message:te})};for(const q of Object.keys(o))de.includes(q)||p.push({path:`${s}.${q}`,panel:o.id,message:`is not a panel key (${de.join(", ")}); a viewer's own settings go in options`});if(!W.includes(o.kind)){a(`${s}.kind`,`names no panel kind (${W.join(", ")})`);return}if(o.title!==void 0&&typeof o.title!="string"&&p.push({path:`${s}.title`,panel:o.id,message:"is not a string"}),o.options!==void 0&&!v(o.options)){a(`${s}.options`,"is not an object");return}if(o.binding!==void 0&&(o.kind!=="map"?a(`${s}.binding`,`is only read on a map panel, and this is a ${o.kind} panel`):P.includes(o.binding)||a(`${s}.binding`,`names no map binding (${P.join(", ")})`)),o.source===void 0){(o.kind==="chart"||o.kind==="map"||o.kind==="calendar")&&a(`${s}.source`,`is missing: a ${o.kind} panel draws a source's rows`);return}if(o.kind==="html"){a(`${s}.source`,"is set on an html panel, which reads no rows");return}const m=re(o.source);if(!m){a(`${s}.source`,"is not a source id");return}let w=null;if(m.kind==="grid")w=m.of;else if(!v(N)||!Object.hasOwn(N,m.id)){a(`${s}.source`,`names "${m.id}", which is not in sources`);return}else if(M.has(m.id)){a(`${s}.source`,`names "${m.id}", a source that is not usable`);return}else N[m.id].kind==="grid"&&(w=N[m.id].of);if(w!==null){const q=S.get(w);if(!q){a(`${s}.source`,`views the grid of "${w}", which is not a panel`);return}if(q.kind!=="grid"){a(`${s}.source`,`views the grid of "${w}", a ${q.kind} panel`);return}if(w===o.id){a(`${s}.source`,"views its own grid");return}E.set(o.id,w)}});for(let o=!0;o;)o=!1,R.panels.forEach((d,s)=>{if(T.has(s)||!E.has(d.id))return;const a=new Set([d.id]);let m=E.get(d.id);for(;m!==void 0;){const w=S.get(m);if(a.has(m)){T.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`is part of a cycle of panels viewing each other's grids (${[...a,m].join(" -> ")})`}),o=!0;return}if(!w||T.has(w.index)){T.add(s),p.push({path:`panels[${s}].source`,panel:d.id,message:`views the grid of "${m}", a panel that was not built`}),o=!0;return}a.add(m),m=E.get(m)}});if(R.links!==void 0&&!Array.isArray(R.links)?p.push({path:"links",message:"is not an array of links"}):(R.links||[]).forEach((o,d)=>{const s=`links[${d}]`,a=(m,w)=>{O.add(d),p.push({path:m,link:d,message:w})};if(!v(o)){a(s,"is not an object");return}for(const m of Object.keys(o))_.includes(m)||p.push({path:`${s}.${m}`,link:d,message:`is not a link key (${_.join(", ")})`});if(typeof o.from!="string"||!S.has(o.from)){a(`${s}.from`,"names no panel");return}if(typeof o.to!="string"||!S.has(o.to)){a(`${s}.to`,"names no panel");return}if(o.from===o.to){a(`${s}.to`,"is the panel the link starts from");return}L(o.on)||a(`${s}.on`,"is not a column name, a { from, to } pair of column names, or a relation function")}),R.layout!==void 0){if(!v(R.layout))p.push({path:"layout",message:"is not an object"});else if(R.layout.windows!==void 0)if(!Array.isArray(R.layout.windows))p.push({path:"layout.windows",message:"is not an array of windows"});else{const o=new Set;R.layout.windows.forEach((d,s)=>{const a=`layout.windows[${s}]`;!v(d)||typeof d.id!="string"?(B.add(s),p.push({path:a,message:"is not a window with a string id"})):S.has(d.id)?o.has(d.id)?(B.add(s),p.push({path:`${a}.id`,message:`places "${d.id}" a second time`})):o.add(d.id):(B.add(s),p.push({path:`${a}.id`,message:`names "${d.id}", which is not a panel`}))})}}return C}function $(c){const{problems:p}=b(c);return{ok:p.length===0,problems:p.map(({path:T,message:M})=>({path:T,message:M}))}}}),Oe("packages/modules/dashboard/propose.js",function(h,x){"use strict";Object.defineProperty(h,"PROPOSE_SYSTEM",{enumerable:!0,get:function(){return _}}),Object.defineProperty(h,"columnRefs",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(h,"proposalRequest",{enumerable:!0,get:function(){return v}}),Object.defineProperty(h,"parseProposal",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(h,"checkProposal",{enumerable:!0,get:function(){return re}});const W=x("packages/modules/dashboard/spec.js"),K=W.inspectSpec,P=W.isPlain,F=W.copySpec,de=W.parseSourceRef,_=["You design dashboards for a data grid. Return ONLY a JSON object of the form",'{ "layout": { "columns": <n>, "rows": <n> }, "panels": [ { "id": "<id>", "kind": "<kind>",','"title": "<title>", "source": "<source id>", "binding": "chart", "options": { ... } } ],','"links": [ { "from": "<grid panel id>", "to": "<panel id>", "on": "<column>" } ] }.',"Use only the panel kinds and the columns listed in SCHEMA, and only the source it names.","A chart panel's options are a chart spec (type, x, y, series); a kpi panel's are",'{ tiles: [ { id, field, aggregation } ] }; a map panel with binding "chart" takes a map chart',`spec (type "markermap", lon, lat); a grid panel's are { columns: [ { field } ] }.`,"A person reviews the proposal before anything is built."].join(" "),H=Object.freeze(["x","y","series","measure","size","value","volume","lon","lat","geometry","label","start","end","source","target","multiples"]);function ie(L){const b=new Set,$=P(L.options)?L.options:{},c=p=>{typeof p=="string"&&p!==""&&b.add(p)};if(L.kind==="grid")for(const p of Array.isArray($.columns)?$.columns:[])P(p)&&c(p.field);else if(L.kind==="kpi"){for(const p of Array.isArray($.tiles)?$.tiles:[])P(p)&&c(p.field);for(const p of Array.isArray($.fields)?$.fields:[])c(p)}else if(L.kind==="chart"||L.kind==="map"&&(L.binding||"chart")==="chart")for(const p of H)c($[p]);else L.kind==="map"&&P($.position)&&(c($.position.lon),c($.position.lat),c($.position.geometry));return[...b]}function v(L,b){const $={source:b.source,columns:b.columns,kinds:b.kinds};let c=`${L}
|
|
7
7
|
|
|
8
8
|
SCHEMA
|
|
9
9
|
${JSON.stringify($)}`;b.rows&&(c+=`
|