semiotic 3.10.2 → 3.10.4

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.
Files changed (118) hide show
  1. package/README.md +21 -26
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/behaviorContracts.cjs +15 -5
  4. package/ai/behaviorContracts.d.cts +3 -0
  5. package/ai/cli.js +17 -166
  6. package/ai/componentMetadata.cjs +68 -15
  7. package/ai/componentMetadata.d.cts +3 -0
  8. package/ai/dist/diagnose-operation.js +3 -0
  9. package/ai/dist/mcp-server.js +59 -59
  10. package/ai/reference.md +6 -6
  11. package/ai/schema.json +1 -1
  12. package/ai/surface-manifest.json +1 -1
  13. package/ai/system-prompt.md +2 -2
  14. package/ai/task-packets/compare-category-totals.json +7 -7
  15. package/ai/task-packets/compare-category-totals.md +3 -3
  16. package/ai/task-packets/correct-published-chart.json +7 -7
  17. package/ai/task-packets/correct-published-chart.md +3 -3
  18. package/ai/task-packets/index.json +6 -6
  19. package/ai/task-packets/update-live-chart.json +7 -7
  20. package/ai/task-packets/update-live-chart.md +3 -3
  21. package/dist/c-2MHSD3TN.min.js +209 -0
  22. package/dist/{c-PZ3NEGNG.min.js → c-6XGGN5OS.min.js} +1 -1
  23. package/dist/{c-FDUQDCBC.min.js → c-CO4NDAD6.min.js} +23 -23
  24. package/dist/c-EK6XI2U7.min.js +26 -0
  25. package/dist/c-FMCUQ6JX.min.js +1 -0
  26. package/dist/{c-C4KIXUWU.min.js → c-GK263BF4.min.js} +1 -1
  27. package/dist/{c-TTKWXGAI.min.js → c-HNHKIMIV.min.js} +3 -3
  28. package/dist/c-IJCZGUG6.min.js +31 -0
  29. package/dist/{c-4XLHPQTP.min.js → c-JBWPJNTJ.min.js} +1 -1
  30. package/dist/{c-4MD53L2J.min.js → c-JC76YAHB.min.js} +28 -28
  31. package/dist/{c-VXIYF7V2.min.js → c-JOPGDP6N.min.js} +1 -1
  32. package/dist/c-KWP4QTCM.min.js +4 -0
  33. package/dist/c-LRV7PO45.min.js +393 -0
  34. package/dist/c-LVHJJUOF.min.js +1 -0
  35. package/dist/c-M43PK7K4.min.js +1 -0
  36. package/dist/c-NUBZ63VU.min.js +1 -0
  37. package/dist/{c-7ASK4WBF.min.js → c-PITYSOPK.min.js} +1 -1
  38. package/dist/{c-2TW5H5PD.min.js → c-QPO24R7Q.min.js} +1 -1
  39. package/dist/{c-SG2Y7EBY.min.js → c-RWHLEUX6.min.js} +1 -1
  40. package/dist/{c-4JKDJUYD.min.js → c-S746GRV4.min.js} +1 -1
  41. package/dist/{c-KGROWFT2.min.js → c-SAP5KY6R.min.js} +2 -2
  42. package/dist/c-UMGHCBH5.min.js +114 -0
  43. package/dist/c-UQBWSYKI.min.js +41 -0
  44. package/dist/{c-6ZU3QVLB.min.js → c-VEMCBQZZ.min.js} +33 -33
  45. package/dist/{c-IPYGNVN6.min.js → c-WD2RL76M.min.js} +45 -45
  46. package/dist/{c-PQOZPM4G.min.js → c-YL7HJL5J.min.js} +1 -1
  47. package/dist/c-Z6GRGS53.min.js +1 -0
  48. package/dist/components/CategoryColors.d.ts +7 -0
  49. package/dist/components/LinkedCharts.d.ts +2 -1
  50. package/dist/components/ai/chartClinic.d.ts +1 -1
  51. package/dist/components/ai/chartClinicMetadata.generated.d.ts +2 -2
  52. package/dist/components/charts/shared/{chartDefinitionPilot.d.ts → chartDefinition.d.ts} +30 -34
  53. package/dist/components/charts/shared/chartDefinitions.d.ts +10 -0
  54. package/dist/components/charts/shared/chartDefinitionsNetwork.d.ts +17 -0
  55. package/dist/components/charts/shared/chartDefinitionsOrdinal.d.ts +23 -0
  56. package/dist/components/charts/shared/chartDefinitionsPhysics.d.ts +17 -0
  57. package/dist/components/charts/shared/chartDefinitionsRealtime.d.ts +12 -0
  58. package/dist/components/charts/shared/chartDefinitionsXY.d.ts +26 -0
  59. package/dist/components/charts/shared/useChartSetup.d.ts +1 -1
  60. package/dist/components/charts/shared/useNetworkChartSetup.d.ts +1 -1
  61. package/dist/components/data/transforms.d.ts +1 -0
  62. package/dist/components/server/serverChartConfigs.d.ts +36 -36
  63. package/dist/components/server/serverChartConfigsNetwork.generated.d.ts +17 -0
  64. package/dist/components/server/serverChartConfigsOrdinal.generated.d.ts +23 -0
  65. package/dist/components/server/serverChartConfigsPhysics.generated.d.ts +17 -0
  66. package/dist/components/server/serverChartConfigsRealtime.generated.d.ts +13 -0
  67. package/dist/components/server/serverChartConfigsXY.generated.d.ts +22 -0
  68. package/dist/components/stream/physics/PhysicsOptionalEngineAdapters.d.ts +5 -0
  69. package/dist/geo.min.js +3 -3
  70. package/dist/geo.module.min.js +10 -10
  71. package/dist/network.module.min.js +1 -1
  72. package/dist/ordinal.module.min.js +1 -1
  73. package/dist/physics-matter.min.js +4 -1
  74. package/dist/physics-matter.module.min.js +1 -1
  75. package/dist/physics-rapier.min.js +4 -1
  76. package/dist/physics-rapier.module.min.js +1 -1
  77. package/dist/physics.module.min.js +1 -1
  78. package/dist/physicsWorker.js +1 -1
  79. package/dist/semiotic-ai-core.min.js +3 -3
  80. package/dist/semiotic-ai-core.module.min.js +3 -3
  81. package/dist/semiotic-ai.module.min.js +7 -7
  82. package/dist/semiotic-artifact.min.js +1 -1
  83. package/dist/semiotic-artifact.module.min.js +1 -1
  84. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  85. package/dist/semiotic-client-cjs-shared.min.js +903 -902
  86. package/dist/semiotic-data.min.js +1 -1
  87. package/dist/semiotic-data.module.min.js +1 -1
  88. package/dist/semiotic-experimental-auxiliary.module.min.js +3 -3
  89. package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
  90. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  91. package/dist/semiotic-line.module.min.js +1 -1
  92. package/dist/semiotic-realtime-core.module.min.js +1 -1
  93. package/dist/semiotic-recipes-core-cjs-base.min.js +1 -1
  94. package/dist/semiotic-recipes-core.module.min.js +13 -13
  95. package/dist/semiotic-server-edge-node.module.min.js +393 -391
  96. package/dist/semiotic-server-edge.min.js +393 -391
  97. package/dist/semiotic-server-edge.module.min.js +374 -372
  98. package/dist/semiotic-server-node.min.js +393 -391
  99. package/dist/semiotic-server-node.module.min.js +1 -1
  100. package/dist/semiotic-utils-core.min.js +1 -1
  101. package/dist/semiotic-utils-core.module.min.js +1 -1
  102. package/dist/semiotic.module.min.js +10 -10
  103. package/dist/server.min.js +393 -391
  104. package/dist/server.module.min.js +1 -1
  105. package/dist/xy.module.min.js +1 -1
  106. package/package.json +12 -8
  107. package/dist/c-3OFVBWQY.min.js +0 -1
  108. package/dist/c-6IVBV5NO.min.js +0 -1
  109. package/dist/c-72CBVNYX.min.js +0 -209
  110. package/dist/c-7LY46QUI.min.js +0 -41
  111. package/dist/c-AKLBQMQF.min.js +0 -391
  112. package/dist/c-F2GGJB2S.min.js +0 -31
  113. package/dist/c-G53AVC42.min.js +0 -113
  114. package/dist/c-HQ27AHMC.min.js +0 -1
  115. package/dist/c-IHWZ2C6D.min.js +0 -26
  116. package/dist/c-MOP2NGLH.min.js +0 -1
  117. package/dist/c-PKY4JFY5.min.js +0 -1
  118. package/dist/c-UBHICVSC.min.js +0 -1
package/dist/geo.min.js CHANGED
@@ -125,8 +125,8 @@ return(0,om.jsx)("div",{className:"semiotic-tooltip",style:zp,children:/* @__PUR
125
125
  /* @__PURE__ */
126
126
  /* @__PURE__ */(0,om.jsxs)("span",{style:{opacity:.7},children:[e.key,": "]}),
127
127
  /* @__PURE__ */
128
- /* @__PURE__ */(0,om.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+"")})]},e.key);var t})]})}function Ea(){if(null!==sm)return sm;if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return sm=e||t||n}function Ia(){return Ea()?12:30}function Ta(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function Da(e){return e?e.getContext("2d"):null}function za(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>n||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=Da(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};const i=wn(e.scene,t,n,fa(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,fa(6,e.pointer.pointerType));if(!i)return{kind:"miss"};const{node:o}=i,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,l="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,c="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:n;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}function _a(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function Oa(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function Fa(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}function Wa({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=!(!e&&!n),a=!(!t&&!n),s=(0,cm.useCallback)((t,o)=>{e?.(t,o),Oa({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:r,context:o})},[r,i,e,n]),l=(0,cm.useCallback)((e,o)=>{t?.(e,o),Fa({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:r,context:o})},[r,i,t,n]);return{customHoverBehavior:o?s:void 0,customClickBehavior:a?l:void 0,hasClickBehavior:a}}function Ba(e){const t=[];for(const n of e)if("point"===n.type&&null!=n.x&&!1!==n.interactive)t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const e=bn(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&t.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function Ha(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return n-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function $a(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function qa({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a}){const s=(0,um.useRef)(-1),l=(0,um.useRef)(null),c=(0,um.useCallback)(c=>{if(_a(c))return;const u=e.current;if(!u)return;const d=()=>{s.current=-1,l.current=null,t.current=null,n&&(n.current=null),r(null),i?.(null),a()};if(0===u.scene.length)return void(0>s.current||d());const h=Ba(u.scene);if(0===h.length)return void(0>s.current||d());let f=s.current;if(h.length>f||(d(),f=-1),("Enter"===c.key||" "===c.key)&&f>=0)return c.preventDefault(),void o?.($a(h[f]),{type:"activate",inputType:"keyboard"});const p=Ha(c.key,0>f?-1:f,h.length);if(null===p)return;if(c.preventDefault(),0>p)return void d();const m=0>f?0:p;s.current=m;const g=h[m];l.current=g;const y=$a(g);t.current=y,r(y),i?.(y,{type:"focus",inputType:"keyboard"}),a()},[o,i,t,n,a,r,e]);return{kbFocusIndexRef:s,focusedNavPointRef:l,onKeyDown:c}}function Ga(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function Va({foregroundGraphics:e,backgroundGraphics:t,size:n,margin:r,scales:i,background:o,themeBackgroundColor:a,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${a})`;return{resolvedForeground:s||"function"!=typeof e?Ga(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?Ga(t,n,r,i):null,themeBackground:l,surfaceBackground:wo({background:o,hasBackgroundGraphics:!!t,themeBackground:l})}}function Ua(e){const t=/* @__PURE__ */new Set;let n=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>n,sync(e){if(e!==r){r=e,n+=1;for(const e of t)e()}}}}function Ya({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,fm.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),hm.createElement(hm.Fragment,null,Ga(e,t,n,r()))}function Xa({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?hm.createElement(Ya,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...Va({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function Za(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function Ka(e){var t,n,r;n=e.pointer,r=t=>{const n=za({pointer:t,canvasRect:e.canvas.getBoundingClientRect(),margin:e.margin,width:e.width,height:e.height,scene:e.store.scene,pointQuadtree:e.geometryMoved?null:e.store.quadtree,maxPointRadius:e.store.maxPointRadius,hitCanvasRef:e.hitCanvasRef});return"hit"===n.kind?Qi(n.node):void 0},(t=e.canvas)&&(n.inside&&"touch"!==n.pointerType?eo(t,r(n)):eo(t))}function Qa(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function Ja(e,t,n,r){if(!t)return e;const i=(i,...o)=>{const a={...e(i,...o)};if(t.isActive)if(t.predicate(r?r(i):i))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??xm;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return o=i,a=[i],a?.length?(Object.defineProperty(o,dm,{configurable:!0,enumerable:!1,value:a}),o):o;var o,a}function es(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ts(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}function ns(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}function rs(e,t){const{when:n}=e,r=t.width,i=t.height,o=ns(t),a=ts(t);return!("number"==typeof n.minWidth&&n.minWidth>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||n.minHeight>i)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||n.minAspectRatio>o)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function is(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])es(e[r])&&es(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function os(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>rs(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>is(e,t.rule.transform),e),matches:r}}function as(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return Am;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??jm,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??jm,standardControls:s.standardControls??!1}}function ss(e,t,n){const r=Cm[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=os({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=Cm[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width;return{mode:s,width:a.width??u,height:a.height??("primary"===s&&n?.height?n.height:l.height),showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:cs(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:as(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function ls(e){return e.compactMode?e.marginDefaults:Rm}function cs(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}function us(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function ds(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function hs(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function fs(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function ps(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function ms(e){const t=(0,Pm.useContext)(Em),n=(0,Pm.useId)(),r=fs(e),i=(0,Pm.useRef)([]);ps(i.current,r)||(i.current=r);const o=i.current;Im(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),Im(()=>{t&&t.registerCategories(n,o)},[t,n,o])}function gs({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a=e.find("function"==typeof t?e=>t(e)===i:e=>e[t]===i),s=a?r(a,t,n):n?n(i):Bd[o%Bd.length];return{label:i+"",color:s,__semioticCategory:!0}}),label:""}]}}function ys(e,t){if(!t)return[];const n=/* @__PURE__ */new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(e+"")}return Array.from(n)}function vs(e,t){return null!=e&&Object.hasOwn(e,t)}function bs(e,t,n){const r=vs(n,"legendPosition"),i=vs(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function xs({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:p}){const{legendPosition:m,legendLayout:g}=bs(i,d,h),y=vs(h,"legend"),v=(0,Pm.useContext)(Nm),b=null!==(0,Pm.useContext)(Em),x=void 0!==r?r:!v&&!!t,w=!!t&&(x||b),k=(0,Lm.useMemo)(()=>w?void 0!==s?s:ys(e,t):[],[s,t,e,w]);ms(b&&t?k:[]);const S=(0,Lm.useMemo)(()=>{if(!x||!t)return;const r=gs({data:e,colorBy:t,colorScale:n,getColor:wt,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,Lm.useMemo)(()=>y?h?.legend:_n(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:P}=p??{},N=void 0!==R,E=void 0!==L,I=void 0!==P,{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}=R??{},{hasAxis:_,hasAxisLabel:O}=L??{},{hasAxis:F,hasAxisLabel:W}=P??{},B=(0,Lm.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=Jn(a,h?.axes,f),n=n=>{const r=e[n];return"number"==typeof r?r:t[n]},r={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},i={...r};return M&&(Xn(r,{legend:M,position:m,size:[c??600,u??400],hasTitle:f,legendLayout:g,minimumMargin:"bottom"===m?80:"top"===m?50:0,axisChrome:void 0===j?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:N?{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}:void 0,leftAxis:E?{hasAxis:_,hasAxisLabel:O}:void 0,rightAxis:I?{hasAxis:F,hasAxisLabel:W}:void 0}}),null!=c&&null!=u&&Wn(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,N,T,D,z,E,_,O,I,F,W]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!vs(h,"margin"),hasAutomaticLegend:void 0!==S}}function ws(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function ks(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Ss(e,t,n,r=!0,i=!1){const[o,a]=(0,Lm.useState)(null),[s,l]=(0,Lm.useState)(
129
- /* @__PURE__ */new Set),c=(0,Lm.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,Lm.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,Lm.useMemo)(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);(0,Lm.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,Lm.useEffect)(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);const f=(0,Lm.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,Lm.useCallback)(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,r,e,i]),m=(0,Lm.useMemo)(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:p,legendSelectionHook:m}}function Ms(e,t,n,r=5){const[i,o]=n,[a,s]=(0,Lm.useState)(null),[l,c]=(0,Lm.useState)(/* @__PURE__ */new Map),u=(0,Lm.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,Lm.useEffect)(()=>{s(null),c(/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,Lm.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=ws(t);n&&s({key:ks(t,n),range:n})},[e]),h=(0,Lm.useCallback)(t=>{if("isolate"!==e)return;const n=ws(t);n&&c(e=>{const i=new Map(e),o=ks(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,Lm.useMemo)(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&Math.max(e,t)>=r)}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function js(){const e=(0,Mm.useTheme)(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function As(){const e=(0,Mm.useTheme)();return e?.colors?.sequential||void 0}function Cs(e,t,n){const r=(0,bm.useCategoryColors)(),i=js();return(0,vm.useMemo)(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(o&&hs(o)){const e=St(n.map(e=>({_cat:e})),"_cat",a);return t=>kt(o,t)??e(t)}return St(n.map(e=>({_cat:e})),"_cat",a)}if(o&&hs(o)){const n=St(e,t,a);return e=>kt(o,e)??n(e)}return St(e,t,a)}if(o&&hs(o)){const e=St([{_:"a"}],"_",a);return t=>kt(o,t)??e(t)}},[e,t,n,r,i])}function Rs({selection:e,linkedHover:t,fallbackFields:n=Tm,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,colorByField:c,mobileInteraction:u,emitObservations:d=!0}){const h=(0,vm.useId)(),f=(0,vm.useMemo)(()=>Qa(t,n),[t,n]),p=(0,vm.useMemo)(()=>"series"===f?.mode?[f.seriesField||c||n[0]].filter(e=>!!e):f?.fields||n,[f,c,n]),m=(0,wm.useSelection)({name:e?.name||"__unused__",fields:p}),g=(0,wm.useLinkedHover)({name:f?.name||"hover",fields:p}),y=(0,Sm.useObservationSelector)(e=>e.pushObservation),v=(0,vm.useCallback)(e=>{i?.(e),y?.(e)},[i,y]),b=e?{isActive:m.isActive,predicate:m.predicate}:null,[x,w]=(0,vm.useState)(null),k=(0,vm.useRef)(!1),S=c||n[0],M=(0,vm.useMemo)(()=>{if(!l||null==x||!S)return null;const e=x,t=S;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[l,x,S]),j=(0,vm.useCallback)((e,n)=>{const r=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){const n=us(e,t,f.xField);null!=n&&(0,km.setCrosshairPosition)(f.name||"hover",n,h)}"x-position"!==f?.mode&&g.onHover(t)}else"x-position"!==f?.mode||r||(0,km.clearCrosshairPosition)(f.name||"hover",h),"x-position"===f?.mode||r||g.onHover(null);if(l&&S)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[S];w(null!=n?n+"":null)}else r||w(null);d&&(i||y)&&Oa({onObservation:v,datum:e?ds(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,g,f,h,i,o,a,y,v,d,l,S,u]),A=(0,vm.useCallback)((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&g.onHover(null),e&&u?.tapToSelect&&m.clear(),n&&l&&w(null),"x-position"===f?.mode&&((0,km.unlockCrosshair)(f.name||"hover",h),(0,km.clearCrosshairPosition)(f.name||"hover",h))},[t,f,g,e,u,m,l,h]),C=(0,vm.useCallback)((n,r)=>{const c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),b=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=us(n,e,f.xField);null!=t&&(0,km.toggleCrosshairLock)(f.name||"hover",t,h)}if(c)if(n){k.current=!0;const r=ds(n);if(t&&"x-position"!==f?.mode&&g.onHover(r),e&&u?.tapToSelect&&p.length>0){const e={};for(const t of p){const n=r[t];void 0!==n&&(e[t]=[n])}hs(e)&&m.selectPoints(e)}if(l&&S){const e=r?.[S];w(null!=e?e+"":null)}}else b&&A();if(n||b){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}d&&(i||y)&&Fa({onObservation:v,datum:n?ds(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,d,i,y,v,o,a,f,h,u,t,g,e,m,p,l,S,A]);return(0,vm.useEffect)(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,A]),(0,vm.useEffect)(()=>()=>{k.current&&A(!1)},[A]),(0,vm.useEffect)(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{(0,km.unlockCrosshair)(e,h),(0,km.clearCrosshairPosition)(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:b,hoverSelectionHook:M,customHoverBehavior:j,customClickBehavior:C,crosshairSourceId:h}}function Ls(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function Ps(e,t,n){return ss(e,t,n)}function Ns(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function Es(e,t){if(!Ns(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function Is(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>Ds(t(e))}function Ts(e,t){const n=Is(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Ds(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function zs(e,t,n){const r=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const i=Ds(r);if(void 0===i)return!1;if(void 0!==e.gt&&e.gt>=i)return!1;if(void 0!==e.gte&&e.gte>i)return!1;if(void 0!==e.lt&&i>=e.lt)return!1;if(void 0!==e.lte&&i>e.lte)return!1;if(void 0!==e.within){const[t,n]=e.within;if(t>i||i>n)return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(i>=t&&n>=i)return!1}return!0}function _s(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):zs(r,t,n))}function Os(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!_s(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function Fs(e,t,n,r=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const a=r(e),s={...i(e,o)};return Object.assign(s,Os(a,t,n(a,o))),s}:i}function Ws({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){/* @__PURE__ */ /* @__PURE__ */
128
+ /* @__PURE__ */(0,om.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+"")})]},e.key);var t})]})}function Ea(){if(null!==sm)return sm;if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return sm=e||t||n}function Ia(){return Ea()?12:30}function Ta(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function Da(e){return e?e.getContext("2d"):null}function za(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>n||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=Da(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};const i=wn(e.scene,t,n,fa(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,fa(6,e.pointer.pointerType));if(!i)return{kind:"miss"};const{node:o}=i,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,l="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,c="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:n;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}function _a(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function Oa(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function Fa(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}function Wa({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=!(!e&&!n),a=!(!t&&!n),s=(0,cm.useCallback)((t,o)=>{e?.(t,o),Oa({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:r,context:o})},[r,i,e,n]),l=(0,cm.useCallback)((e,o)=>{t?.(e,o),Fa({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:r,context:o})},[r,i,t,n]);return{customHoverBehavior:o?s:void 0,customClickBehavior:a?l:void 0,hasClickBehavior:a}}function Ba(e){const t=[];for(const n of e)if("point"===n.type&&null!=n.x&&!1!==n.interactive)t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const e=bn(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&t.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function Ha(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return n-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function $a(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function qa({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a}){const s=(0,um.useRef)(-1),l=(0,um.useRef)(null),c=(0,um.useCallback)(c=>{if(_a(c))return;const u=e.current;if(!u)return;const d=()=>{s.current=-1,l.current=null,t.current=null,n&&(n.current=null),r(null),i?.(null),a()};if(0===u.scene.length)return void(0>s.current||d());const h=Ba(u.scene);if(0===h.length)return void(0>s.current||d());let f=s.current;if(h.length>f||(d(),f=-1),("Enter"===c.key||" "===c.key)&&f>=0)return c.preventDefault(),void o?.($a(h[f]),{type:"activate",inputType:"keyboard"});const p=Ha(c.key,0>f?-1:f,h.length);if(null===p)return;if(c.preventDefault(),0>p)return void d();const m=0>f?0:p;s.current=m;const g=h[m];l.current=g;const y=$a(g);t.current=y,r(y),i?.(y,{type:"focus",inputType:"keyboard"}),a()},[o,i,t,n,a,r,e]);return{kbFocusIndexRef:s,focusedNavPointRef:l,onKeyDown:c}}function Ga(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function Va({foregroundGraphics:e,backgroundGraphics:t,size:n,margin:r,scales:i,background:o,themeBackgroundColor:a,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${a})`;return{resolvedForeground:s||"function"!=typeof e?Ga(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?Ga(t,n,r,i):null,themeBackground:l,surfaceBackground:wo({background:o,hasBackgroundGraphics:!!t,themeBackground:l})}}function Ua(e){const t=/* @__PURE__ */new Set;let n=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>n,sync(e){if(e!==r){r=e,n+=1;for(const e of t)e()}}}}function Ya({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,fm.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),hm.createElement(hm.Fragment,null,Ga(e,t,n,r()))}function Xa({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?hm.createElement(Ya,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...Va({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function Za(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function Ka(e){var t,n,r;n=e.pointer,r=t=>{const n=za({pointer:t,canvasRect:e.canvas.getBoundingClientRect(),margin:e.margin,width:e.width,height:e.height,scene:e.store.scene,pointQuadtree:e.geometryMoved?null:e.store.quadtree,maxPointRadius:e.store.maxPointRadius,hitCanvasRef:e.hitCanvasRef});return"hit"===n.kind?Qi(n.node):void 0},(t=e.canvas)&&(n.inside&&"touch"!==n.pointerType?eo(t,r(n)):eo(t))}function Qa(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function Ja(e,t,n,r){if(!t)return e;const i=(i,...o)=>{const a={...e(i,...o)};if(t.isActive)if(t.predicate(r?r(i):i))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??xm;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return o=i,a=[i],a?.length?(Object.defineProperty(o,dm,{configurable:!0,enumerable:!1,value:a}),o):o;var o,a}function es(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ts(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}function ns(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}function rs(e,t){const{when:n}=e,r=t.width,i=t.height,o=ns(t),a=ts(t);return!("number"==typeof n.minWidth&&n.minWidth>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||n.minHeight>i)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||n.minAspectRatio>o)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function is(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])es(e[r])&&es(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function os(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>rs(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>is(e,t.rule.transform),e),matches:r}}function as(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return Am;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??jm,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??jm,standardControls:s.standardControls??!1}}function ss(e,t,n){const r=Cm[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=os({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=Cm[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width;return{mode:s,width:a.width??u,height:a.height??("primary"===s&&n?.height?n.height:l.height),showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:cs(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:as(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function ls(e){return e.compactMode?e.marginDefaults:Rm}function cs(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}function us(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function ds(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function hs(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function fs(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function ps(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function ms(e,t){const n=(0,Pm.useContext)(Em),r=(0,Pm.useId)(),i=fs(e),o=i.map(e=>t?.(e)),a=(0,Pm.useRef)({categories:[],colors:[]});ps(a.current.categories,i)&&ps(a.current.colors,o)||(a.current={categories:i,colors:o});const s=a.current;Im(()=>{if(n)return()=>n.unregisterCategories(r)},[n,r]),Im(()=>{n&&n.registerCategories(r,s)},[n,r,s])}function gs({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a=e.find("function"==typeof t?e=>t(e)===i:e=>e[t]===i),s=a?r(a,t,n):n?n(i):Bd[o%Bd.length];return{label:i+"",color:s,__semioticCategory:!0}}),label:""}]}}function ys(e,t){if(!t)return[];const n=/* @__PURE__ */new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(e+"")}return Array.from(n)}function vs(e,t){return null!=e&&Object.hasOwn(e,t)}function bs(e,t,n){const r=vs(n,"legendPosition"),i=vs(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function xs({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:p}){const{legendPosition:m,legendLayout:g}=bs(i,d,h),y=vs(h,"legend"),v=(0,Pm.useContext)(Nm),b=null!==(0,Pm.useContext)(Em),x=void 0!==r?r:!v&&!!t,w=!!t&&(x||b),k=(0,Lm.useMemo)(()=>w?void 0!==s?s:ys(e,t):[],[s,t,e,w]);ms(b&&t?k:[],n);const S=(0,Lm.useMemo)(()=>{if(!x||!t)return;const r=gs({data:e,colorBy:t,colorScale:n,getColor:wt,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,Lm.useMemo)(()=>y?h?.legend:_n(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:P}=p??{},N=void 0!==R,E=void 0!==L,I=void 0!==P,{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}=R??{},{hasAxis:_,hasAxisLabel:O}=L??{},{hasAxis:F,hasAxisLabel:W}=P??{},B=(0,Lm.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=Jn(a,h?.axes,f),n=n=>{const r=e[n];return"number"==typeof r?r:t[n]},r={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},i={...r};return M&&(Xn(r,{legend:M,position:m,size:[c??600,u??400],hasTitle:f,legendLayout:g,minimumMargin:"bottom"===m?80:"top"===m?50:0,axisChrome:void 0===j?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:N?{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}:void 0,leftAxis:E?{hasAxis:_,hasAxisLabel:O}:void 0,rightAxis:I?{hasAxis:F,hasAxisLabel:W}:void 0}}),null!=c&&null!=u&&Wn(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,N,T,D,z,E,_,O,I,F,W]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!vs(h,"margin"),hasAutomaticLegend:void 0!==S}}function ws(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function ks(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Ss(e,t,n,r=!0,i=!1){const[o,a]=(0,Lm.useState)(null),[s,l]=(0,Lm.useState)(
129
+ /* @__PURE__ */new Set),c=(0,Lm.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,Lm.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,Lm.useMemo)(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);(0,Lm.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,Lm.useEffect)(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);const f=(0,Lm.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,Lm.useCallback)(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,r,e,i]),m=(0,Lm.useMemo)(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:p,legendSelectionHook:m}}function Ms(e,t,n,r=5){const[i,o]=n,[a,s]=(0,Lm.useState)(null),[l,c]=(0,Lm.useState)(/* @__PURE__ */new Map),u=(0,Lm.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,Lm.useEffect)(()=>{s(null),c(/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,Lm.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=ws(t);n&&s({key:ks(t,n),range:n})},[e]),h=(0,Lm.useCallback)(t=>{if("isolate"!==e)return;const n=ws(t);n&&c(e=>{const i=new Map(e),o=ks(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,Lm.useMemo)(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&Math.max(e,t)>=r)}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function js(){const e=(0,Mm.useTheme)(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function As(){const e=(0,Mm.useTheme)();return e?.colors?.sequential||void 0}function Cs(e,t,n){const r=(0,bm.useChartCategoryColors)(null!=n),i=js();return(0,vm.useMemo)(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(o&&hs(o)){const e=St(n.map(e=>({_cat:e})),"_cat",a);return t=>kt(o,t)??e(t)}return St(n.map(e=>({_cat:e})),"_cat",a)}if(o&&hs(o)){const n=St(e,t,a);return e=>kt(o,e)??n(e)}return St(e,t,a)}if(o&&hs(o)){const e=St([{_:"a"}],"_",a);return t=>kt(o,t)??e(t)}},[e,t,n,r,i])}function Rs({selection:e,linkedHover:t,fallbackFields:n=Tm,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,colorByField:c,mobileInteraction:u,emitObservations:d=!0}){const h=(0,vm.useId)(),f=(0,vm.useMemo)(()=>Qa(t,n),[t,n]),p=(0,vm.useMemo)(()=>"series"===f?.mode?[f.seriesField||c||n[0]].filter(e=>!!e):f?.fields||n,[f,c,n]),m=(0,wm.useSelection)({name:e?.name||"__unused__",fields:p}),g=(0,wm.useLinkedHover)({name:f?.name||"hover",fields:p}),y=(0,Sm.useObservationSelector)(e=>e.pushObservation),v=(0,vm.useCallback)(e=>{i?.(e),y?.(e)},[i,y]),b=e?{isActive:m.isActive,predicate:m.predicate}:null,[x,w]=(0,vm.useState)(null),k=(0,vm.useRef)(!1),S=c||n[0],M=(0,vm.useMemo)(()=>{if(!l||null==x||!S)return null;const e=x,t=S;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[l,x,S]),j=(0,vm.useCallback)((e,n)=>{const r=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){const n=us(e,t,f.xField);null!=n&&(0,km.setCrosshairPosition)(f.name||"hover",n,h)}"x-position"!==f?.mode&&g.onHover(t)}else"x-position"!==f?.mode||r||(0,km.clearCrosshairPosition)(f.name||"hover",h),"x-position"===f?.mode||r||g.onHover(null);if(l&&S)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[S];w(null!=n?n+"":null)}else r||w(null);d&&(i||y)&&Oa({onObservation:v,datum:e?ds(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,g,f,h,i,o,a,y,v,d,l,S,u]),A=(0,vm.useCallback)((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&g.onHover(null),e&&u?.tapToSelect&&m.clear(),n&&l&&w(null),"x-position"===f?.mode&&((0,km.unlockCrosshair)(f.name||"hover",h),(0,km.clearCrosshairPosition)(f.name||"hover",h))},[t,f,g,e,u,m,l,h]),C=(0,vm.useCallback)((n,r)=>{const c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),b=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=us(n,e,f.xField);null!=t&&(0,km.toggleCrosshairLock)(f.name||"hover",t,h)}if(c)if(n){k.current=!0;const r=ds(n);if(t&&"x-position"!==f?.mode&&g.onHover(r),e&&u?.tapToSelect&&p.length>0){const e={};for(const t of p){const n=r[t];void 0!==n&&(e[t]=[n])}hs(e)&&m.selectPoints(e)}if(l&&S){const e=r?.[S];w(null!=e?e+"":null)}}else b&&A();if(n||b){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}d&&(i||y)&&Fa({onObservation:v,datum:n?ds(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,d,i,y,v,o,a,f,h,u,t,g,e,m,p,l,S,A]);return(0,vm.useEffect)(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,A]),(0,vm.useEffect)(()=>()=>{k.current&&A(!1)},[A]),(0,vm.useEffect)(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{(0,km.unlockCrosshair)(e,h),(0,km.clearCrosshairPosition)(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:b,hoverSelectionHook:M,customHoverBehavior:j,customClickBehavior:C,crosshairSourceId:h}}function Ls(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function Ps(e,t,n){return ss(e,t,n)}function Ns(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function Es(e,t){if(!Ns(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function Is(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>Ds(t(e))}function Ts(e,t){const n=Is(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Ds(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function zs(e,t,n){const r=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const i=Ds(r);if(void 0===i)return!1;if(void 0!==e.gt&&e.gt>=i)return!1;if(void 0!==e.gte&&e.gte>i)return!1;if(void 0!==e.lt&&i>=e.lt)return!1;if(void 0!==e.lte&&i>e.lte)return!1;if(void 0!==e.within){const[t,n]=e.within;if(t>i||i>n)return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(i>=t&&n>=i)return!1}return!0}function _s(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):zs(r,t,n))}function Os(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!_s(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function Fs(e,t,n,r=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const a=r(e),s={...i(e,o)};return Object.assign(s,Os(a,t,n(a,o))),s}:i}function Ws({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){/* @__PURE__ */ /* @__PURE__ */
130
130
  return(0,Dm.jsx)("div",{role:"alert",style:{width:r,height:Math.max(i,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */ /* @__PURE__ */(0,Dm.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[
131
131
  /* @__PURE__ */
132
132
  /* @__PURE__ */(0,Dm.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
@@ -138,7 +138,7 @@ return(0,Fm.jsx)("div",{style:{width:t,height:n,position:"relative",overflow:"hi
138
138
  return(0,Zm.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
139
139
  /* @__PURE__ */
140
140
  /* @__PURE__ */(0,Zm.jsx)("div",{style:{fontWeight:600},children:t}),null!=n&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("div",{style:{opacity:.7},children:(r=n,"number"==typeof r&&isFinite(r)?Number.isInteger(r)?r.toLocaleString():r.toLocaleString(void 0,{maximumFractionDigits:2}):(r??"")+"")})]});var r},[F]),Q=ls(t),J=(0,ym.useMemo)(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>B(e),domain:H,label:"string"==typeof i?i:"value"}}},[B,t.showLegend,i,H]),{legend:ee,margin:te,legendPosition:ne,legendMarginReserved:re}=xs({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:k,defaults:Q,additionalLegend:J,chartWidth:t.width,chartHeight:t.height,legendLayout:E.legendLayout,frameLegend:E,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),ie=$s(L,t.width,t.height,P)||(O?null:$s(!0,t.width,t.height,P)),oe=ie?null:Hs(O,t.width,t.height,N);if(Array.isArray(O)&&O.length>0){const e=O[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */ /* @__PURE__ */
141
- return(0,Zm.jsx)(Ws,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ae={projection:s,areas:O,areaStyle:Z,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:te,enableHover:t.enableHover,...ee&&{legend:ee,legendPosition:ne},...re&&{__legendMarginReservedFor:ee},legendHoverBehavior:$.onLegendHover,legendClickBehavior:$.onLegendClick,legendHighlightedCategory:$.highlightedCategory,legendIsolatedCategories:"isolate"===x?$.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:Pa(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...z&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Ks({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:U,linkedHoverInClickPredicate:!1}),...b&&b.length>0&&{annotations:b},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...S&&{className:S},...null!=e.animate&&{animate:e.animate},...E};return ie||oe||/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(Bs,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(gm,{...ae})})}function el(e){const{data:t,rawData:n,colorBy:r,colorScheme:i,legendInteraction:o,legendPosition:a,selection:s,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:d,chartType:h,chartId:f,showLegend:p,legend:m,legendLayout:g,frameLegend:y,userMargin:v,marginDefaults:b,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:P}=e,N=void 0===n,E=(0,Qm.useMemo)(()=>on(t),[t]),[I,T]=(0,Qm.useState)([]),D=(0,Qm.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),z="string"==typeof r?r:void 0,_=(0,Qm.useMemo)(()=>as(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:O,hoverSelectionHook:F,customHoverBehavior:W,customClickBehavior:B,crosshairSourceId:H}=Rs({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:z,mobileInteraction:_}),$=Ls(l,H),q=Cs(E,r,i),G=(0,Qm.useMemo)(()=>ys(E,r),[E,r]),V=(0,Qm.useMemo)(()=>N&&I.length>0?I:G,[N,I,G]),U=Ss(o,r,V),Y=(0,Qm.useMemo)(()=>F||(U.legendSelectionHook?U.legendSelectionHook:O),[F,U.legendSelectionHook,O]),X=Gs(s),Z=js(),K=(0,Jm.useCategoryColors)(),Q=(0,Qm.useMemo)(()=>{if(q)return q;if(!r||0===V.length)return;const e=Array.isArray(i)&&i.length>0||"string"==typeof i&&i.length>0?i:Z&&Z.length>0?Z:Bd,t="__streamCat",n=St(V.map(e=>({[t]:e})),t,e);return e=>(K?kt(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?kt(i,e):void 0)??n(e)??"#999"},[q,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=xs({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:v,defaults:b,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:P}),ie=(0,Qm.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=U.onLegendHover,e.legendClickBehavior=U.onLegendClick,e.legendHighlightedCategory=U.highlightedCategory,e.legendIsolatedCategories=U.isolatedCategories),N&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=D),e},[J,te,ne,re,o,U.onLegendHover,U.onLegendClick,U.highlightedCategory,U.isolatedCategories,N,r,D]),oe=Array.isArray(n)?on(n):n,ae=$s(M,C,R,j),se=ae?null:Hs(oe,C,R,A);return{data:E,colorScale:q,categoryColorScale:Q,allCategories:V,legendState:U,effectiveSelectionHook:Y,activeSelectionHook:O,customHoverBehavior:W,customClickBehavior:B,mobileInteraction:_,legend:J,margin:ee,legendPosition:te,earlyReturn:ae||se||null,legendBehaviorProps:ie,crosshairProps:$,resolvedSelection:X}}function tl(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,eg.useRef)(i);o.current=i,(0,eg.useImperativeHandle)(e,()=>{const e=nl(n,r);return new Proxy(e,{get(e,t,n){if("string"==typeof t){const e=o.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,n)},has:(e,t)=>!("string"!=typeof t||!o.current||!(t in o.current))||Reflect.has(e,t)})},[])}function nl(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,n)=>e.current?.update(t,n)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const n=Array.isArray(t)?t:[t],r=e.current?.getTopology()?.nodes??[],i=[];for(const t of n){const n=r.find(e=>e.id===t);n&&i.push({...n.data??{},id:t}),e.current?.removeNode(t)}return i},update:(t,n)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const r=e.current?.updateNode(t,n);return r?[{...r,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,n)=>{const r=e.current?.removePoint(t)??[];for(const t of r)e.current?.push(n(t));return r},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const r=n.current?.removeLine(e)??[];for(const e of r)n.current?.pushLine(t(e));return r},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}function rl(e,t,n){const[r,i]=n;if(!t)return r;const[o,a]=t,s=a>o?a-o:0,l=Number(e),c=Number.isFinite(l)?l:o;return r+Math.max(0,Math.min(1,s>0?(c-o)/s:0))*(i-r)}function il(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=Is(t);return Fs(e=>({stroke:i(e),strokeWidth:rl(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function ol({bottomMargin:e,costLabel:t,layout:{cx:n,cy:r,maxCost:i,availableRadius:o,layout:a},ringStyle:s,ringValues:l,showNorth:c,showRingLabels:u,showRings:d}){const h="strip"===a,f={stroke:h?"var(--semiotic-border, #999)":"#999",strokeWidth:h?1:.8,strokeDasharray:h?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:h?8:10,...s};/* @__PURE__ */ /* @__PURE__ */
141
+ return(0,Zm.jsx)(Ws,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ae={projection:s,areas:O,areaStyle:Z,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:te,enableHover:t.enableHover,...ee&&{legend:ee,legendPosition:ne},...re&&{__legendMarginReservedFor:ee},legendHoverBehavior:$.onLegendHover,legendClickBehavior:$.onLegendClick,legendHighlightedCategory:$.highlightedCategory,legendIsolatedCategories:"isolate"===x?$.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:Pa(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...z&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Ks({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:U,linkedHoverInClickPredicate:!1}),...b&&b.length>0&&{annotations:b},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...S&&{className:S},...null!=e.animate&&{animate:e.animate},...E};return ie||oe||/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(Bs,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(gm,{...ae})})}function el(e){const{data:t,rawData:n,colorBy:r,colorScheme:i,legendInteraction:o,legendPosition:a,selection:s,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:d,chartType:h,chartId:f,showLegend:p,legend:m,legendLayout:g,frameLegend:y,userMargin:v,marginDefaults:b,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:P}=e,N=void 0===n,E=(0,Qm.useMemo)(()=>on(t),[t]),[I,T]=(0,Qm.useState)([]),D=(0,Qm.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),z="string"==typeof r?r:void 0,_=(0,Qm.useMemo)(()=>as(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:O,hoverSelectionHook:F,customHoverBehavior:W,customClickBehavior:B,crosshairSourceId:H}=Rs({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:z,mobileInteraction:_}),$=Ls(l,H),q=Cs(E,r,i),G=(0,Qm.useMemo)(()=>ys(E,r),[E,r]),V=(0,Qm.useMemo)(()=>N&&I.length>0?I:G,[N,I,G]),U=Ss(o,r,V),Y=(0,Qm.useMemo)(()=>F||(U.legendSelectionHook?U.legendSelectionHook:O),[F,U.legendSelectionHook,O]),X=Gs(s),Z=js(),K=(0,Jm.useChartCategoryColors)(null!=i),Q=(0,Qm.useMemo)(()=>{if(q&&(!N||0===V.length))return q;if(!r||0===V.length)return;const e=Array.isArray(i)&&i.length>0||"string"==typeof i&&i.length>0?i:Z&&Z.length>0?Z:Bd,t="__streamCat",n=St(V.map(e=>({[t]:e})),t,e);return e=>(K?kt(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?kt(i,e):void 0)??n(e)??"#999"},[q,N,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=xs({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:v,defaults:b,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:P}),ie=(0,Qm.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=U.onLegendHover,e.legendClickBehavior=U.onLegendClick,e.legendHighlightedCategory=U.highlightedCategory,e.legendIsolatedCategories=U.isolatedCategories),N&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=D),e},[J,te,ne,re,o,U.onLegendHover,U.onLegendClick,U.highlightedCategory,U.isolatedCategories,N,r,D]),oe=Array.isArray(n)?on(n):n,ae=$s(M,C,R,j),se=ae?null:Hs(oe,C,R,A);return{data:E,colorScale:Q,categoryColorScale:Q,allCategories:V,legendState:U,effectiveSelectionHook:Y,activeSelectionHook:O,customHoverBehavior:W,customClickBehavior:B,mobileInteraction:_,legend:J,margin:ee,legendPosition:te,earlyReturn:ae||se||null,legendBehaviorProps:ie,crosshairProps:$,resolvedSelection:X}}function tl(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,eg.useRef)(i);o.current=i,(0,eg.useImperativeHandle)(e,()=>{const e=nl(n,r);return new Proxy(e,{get(e,t,n){if("string"==typeof t){const e=o.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,n)},has:(e,t)=>!("string"!=typeof t||!o.current||!(t in o.current))||Reflect.has(e,t)})},[])}function nl(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,n)=>e.current?.update(t,n)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const n=Array.isArray(t)?t:[t],r=e.current?.getTopology()?.nodes??[],i=[];for(const t of n){const n=r.find(e=>e.id===t);n&&i.push({...n.data??{},id:t}),e.current?.removeNode(t)}return i},update:(t,n)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const r=e.current?.updateNode(t,n);return r?[{...r,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,n)=>{const r=e.current?.removePoint(t)??[];for(const t of r)e.current?.push(n(t));return r},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const r=n.current?.removeLine(e)??[];for(const e of r)n.current?.pushLine(t(e));return r},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}function rl(e,t,n){const[r,i]=n;if(!t)return r;const[o,a]=t,s=a>o?a-o:0,l=Number(e),c=Number.isFinite(l)?l:o;return r+Math.max(0,Math.min(1,s>0?(c-o)/s:0))*(i-r)}function il(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=Is(t);return Fs(e=>({stroke:i(e),strokeWidth:rl(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function ol({bottomMargin:e,costLabel:t,layout:{cx:n,cy:r,maxCost:i,availableRadius:o,layout:a},ringStyle:s,ringValues:l,showNorth:c,showRingLabels:u,showRings:d}){const h="strip"===a,f={stroke:h?"var(--semiotic-border, #999)":"#999",strokeWidth:h?1:.8,strokeDasharray:h?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:h?8:10,...s};/* @__PURE__ */ /* @__PURE__ */
142
142
  return(0,pg.jsxs)("g",h?{children:[
143
143
  /* @__PURE__ */
144
144
  /* @__PURE__ */(0,pg.jsx)("line",{x1:n,y1:r,x2:n+o,y2:r,stroke:f.stroke,strokeWidth:f.strokeWidth,strokeLinecap:"round",opacity:.85}),
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- function e(e){return"default"in e?e.default:e}async function t(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}async function i(e){let i=et.get(e);if(i)return i;let{topology:o,objectName:r}=await t(e);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Qe(o,o.objects[r]),a="features"in n?n.features:[n];return et.set(e,a),a}function o(e){return"string"==typeof e&&["world-110m","world-50m","land-110m","land-50m"].includes(e)}function r(e){let t=Ye(()=>Array.isArray(e)?e:void 0,[e]),[r,n]=Je(null);return Xe(()=>{if(e&&!Array.isArray(e)){if(o(e)){let t=!1;return n(null),i(e).then(e=>{t||n(e)}),()=>{t=!0}}"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),n(null)}else n(null)},[e]),void 0!==t?t:r}function n(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function a(e){let t=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ue(),{areas:o,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:R,onObservation:N,onClick:F,chartId:j,loading:P,loadingContent:H,emptyContent:L,frameProps:I={},stroke:z,strokeWidth:W,opacity:D}=e,T=m??!!g,O=r(o),B=qe(()=>O&&Ae(O),[O]),E=qe(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),G=s??i??"blues",$=qe(()=>{if(!B)return Ke(We(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of B){let o=E(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=We(G);return Ke(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,G]),Z=qe(()=>{let e=$.domain();return[e[0]??0,e[1]??1]},[$]),_=ce(w,E,Z),{activeSelectionHook:V,hoverSelectionHook:U,customHoverBehavior:q,customClickBehavior:K}=de({selection:C,linkedHover:R,onObservation:N,onClick:F,chartType:"ChoroplethMap",chartId:j,mobileInteraction:t.mobileInteraction}),J=te(C),X=U||_.legendSelectionHook||V,Y=qe(()=>{let e=xe(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?$(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=ne(e,{stroke:z,strokeWidth:W,opacity:D});return X?je(t,X,J,n):t},[E,$,X,J,x,z,W,D,l]),ee=qe(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);/* @__PURE__ */
2
+ function e(e){return"default"in e?e.default:e}async function t(t){try{switch(t){case"world-110m":return{topology:e(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:e(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:e(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:e(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${t}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(e){throw/Cannot find module|Failed to resolve|world-atlas/i.test(e instanceof Error?e.message:e+"")?Error(`resolveReferenceGeography("${t}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:e}):e}}async function i(e){let i=et.get(e);if(i)return i;let{topology:o,objectName:r}=await t(e);if(!o||!o.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof o} with keys: ${o?Object.keys(o).join(", "):"none"}`);let n=Qe(o,o.objects[r]),a="features"in n?n.features:[n];return et.set(e,a),a}function o(e){return"string"==typeof e&&["world-110m","world-50m","land-110m","land-50m"].includes(e)}function r(e){let t=Ye(()=>Array.isArray(e)?e:void 0,[e]),[r,n]=Ke(null);return Xe(()=>{if(e&&!Array.isArray(e)){if(o(e)){let t=!1;return n(null),i(e).then(e=>{t||n(e)}),()=>{t=!0}}"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),n(null)}else n(null)},[e]),void 0!==t?t:r}function n(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function a(e){let t=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),i=ue(),{areas:o,valueAccessor:a,styleRules:l,colorScheme:s,projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:f,tileURL:g,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:k,legendInteraction:w,legendPosition:S,margin:M,className:A,selection:C,linkedHover:R,onObservation:N,onClick:F,chartId:j,loading:P,loadingContent:H,emptyContent:L,frameProps:I={},stroke:z,strokeWidth:W,opacity:D}=e,T=m??!!g,O=r(o),B=qe(()=>O&&Ae(O),[O]),E=qe(()=>"function"==typeof a?a:e=>e?.properties?.[a]??e?.[a],[a]),G=s??i??"blues",U=qe(()=>{if(!B)return Ve(We(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(let i of B){let o=E(i);null==o||!isFinite(o)||(e>o&&(e=o),o>t&&(t=o))}let i=We(G);return Ve(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,G]),$=qe(()=>{let e=U.domain();return[e[0]??0,e[1]??1]},[U]),_=ce(w,E,$),{activeSelectionHook:Z,hoverSelectionHook:J,customHoverBehavior:q,customClickBehavior:V}=de({selection:C,linkedHover:R,onObservation:N,onClick:F,chartType:"ChoroplethMap",chartId:j,mobileInteraction:t.mobileInteraction}),K=te(C),X=J||_.legendSelectionHook||Z,Y=qe(()=>{let e=xe(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?U(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},l,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=ne(e,{stroke:z,strokeWidth:W,opacity:D});return X?je(t,X,K,n):t},[E,U,X,K,x,z,W,D,l]),ee=qe(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);/* @__PURE__ */
3
3
  return it("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
4
- /* @__PURE__ */tt("div",{style:{fontWeight:600},children:t}),null!=i&&/* @__PURE__ */tt("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[E]),ie=Ie(t),oe=qe(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>$(e),domain:Z,label:"string"==typeof a?a:"value"}},[$,t.showLegend,a,Z]),{legend:ae,margin:le,legendPosition:he,legendMarginReserved:pe}=se({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:ie,additionalLegend:oe,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),fe=Re(P,t.width,t.height,H)||(B?null:Re(!0,t.width,t.height,H)),ge=fe?null:Ce(B,t.width,t.height,L);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */
5
- return tt(we,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let ye={projection:c,areas:B,areaStyle:Y,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:le,enableHover:t.enableHover,...ae&&{legend:ae,legendPosition:he},...pe&&{__legendMarginReservedFor:ae},legendHoverBehavior:_.onLegendHover,legendClickBehavior:_.onLegendClick,legendHighlightedCategory:_.highlightedCategory,legendIsolatedCategories:"isolate"===w?_.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?ee:ke(v)||ee,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...T&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...re({linkedHover:R,selection:C,onObservation:N,onClick:F,mobileInteraction:t.mobileInteraction,customHoverBehavior:q,customClickBehavior:K,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return fe||ge||/* @__PURE__ */tt(Me,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */tt(Q,{...ye})})}function l(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function s(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:s}=e,c=he(t);return xe(e=>({stroke:r(e),strokeWidth:l(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),s,e=>({value:c(e)}))}function c({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};/* @__PURE__ */
4
+ /* @__PURE__ */tt("div",{style:{fontWeight:600},children:t}),null!=i&&/* @__PURE__ */tt("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):(o??"")+"")})]});var o},[E]),ie=Ie(t),oe=qe(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>U(e),domain:$,label:"string"==typeof a?a:"value"}},[U,t.showLegend,a,$]),{legend:ae,margin:le,legendPosition:he,legendMarginReserved:pe}=se({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:S,userMargin:M,defaults:ie,additionalLegend:oe,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),fe=Re(P,t.width,t.height,H)||(B?null:Re(!0,t.width,t.height,H)),ge=fe?null:Ce(B,t.width,t.height,L);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */
5
+ return tt(we,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let ye={projection:c,areas:B,areaStyle:Y,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:le,enableHover:t.enableHover,...ae&&{legend:ae,legendPosition:he},...pe&&{__legendMarginReservedFor:ae},legendHoverBehavior:_.onLegendHover,legendClickBehavior:_.onLegendClick,legendHighlightedCategory:_.highlightedCategory,legendIsolatedCategories:"isolate"===w?_.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?ee:ke(v)||ee,...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...T&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=f&&{dragRotate:f},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...re({linkedHover:R,selection:C,onObservation:N,onClick:F,mobileInteraction:t.mobileInteraction,customHoverBehavior:q,customClickBehavior:V,linkedHoverInClickPredicate:!1}),...k&&k.length>0&&{annotations:k},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...A&&{className:A},...null!=e.animate&&{animate:e.animate},...I};return fe||ge||/* @__PURE__ */tt(Me,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */tt(Q,{...ye})})}function l(e,t,i){let[o,r]=i;if(!t)return o;let[n,a]=t,l=a>n?a-n:0,s=Number(e),c=Number.isFinite(s)?s:n;return o+Math.max(0,Math.min(1,l>0?(c-n)/l:0))*(r-o)}function s(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:s}=e,c=pe(t);return xe(e=>({stroke:r(e),strokeWidth:l(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),s,e=>({value:c(e)}))}function c({bottomMargin:e,costLabel:t,layout:{cx:i,cy:o,maxCost:r,availableRadius:n,layout:a},ringStyle:l,ringValues:s,showNorth:c,showRingLabels:u,showRings:d}){let m="strip"===a,h={stroke:m?"var(--semiotic-border, #999)":"#999",strokeWidth:m?1:.8,strokeDasharray:m?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:m?8:10,...l};/* @__PURE__ */
6
6
  return Nt("g",m?{children:[
7
7
  /* @__PURE__ */Rt("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),
8
8
  /* @__PURE__ */Rt("line",{x1:i,y1:o-3.5,x2:i,y2:o+3.5,stroke:h.stroke,strokeWidth:h.strokeWidth,opacity:.9}),d&&s.map(a=>{let l=i+(r>0?a/r*n:0);/* @__PURE__ */
@@ -17,16 +17,16 @@ return Nt("g",{children:[
17
17
  /* @__PURE__ */Rt("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),
18
18
  /* @__PURE__ */Rt("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function u(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function d(e,t,i){return Math.max(t,Math.min(i,e))}function m(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(t>o&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function h(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function p(e,t={}){let i=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===i.length)return[];let o=d(Number.isFinite(t.occupancy)?Number(t.occupancy):.72,.2,1),r=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):1.8,n=u(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=u(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));i.length>n*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(i.length/n):null!=t.rows&&null==t.columns?n=Math.ceil(i.length/a):a=Math.ceil(i.length/n));let l=m(i.map(e=>e.x)),s=m(i.map(e=>e.y)),c=i.map(e=>({...e,desiredColumn:h(e.x,l)*Math.max(0,n-1),desiredRow:h(e.y,s)*Math.max(0,a-1)})),p=(n-1)/2,f=(a-1)/2;c.sort((e,t)=>(t.desiredColumn-p)**2+(t.desiredRow-f)**2-((e.desiredColumn-p)**2+(e.desiredRow-f)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);let g=/* @__PURE__ */new Set;for(let e=0;a>e;e+=1)for(let t=0;n>t;t+=1)g.add(e*n+t);let y=[];for(let e of c){let t=-1,i=1/0;for(let o of g){let r=(o%n-e.desiredColumn)**2+(Math.floor(o/n)-e.desiredRow)**2;(i>r||r===i&&t>o)&&(t=o,i=r)}0>t||(g.delete(t),y.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return y.sort((e,t)=>e.index-t.index),y.map(({index:e,...t})=>t)}function f(e,t,i=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(let t of i)if(null!=e[t])return e[t]}function g(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??"area-"+t;return{...i,id:o+""}}function y(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function b(e,t,i){return y([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function v(e,t,i){let o=[];for(let r=0;6>r;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return y(o)}function x(e){return e.areas.map((t,i)=>{let o=g(t,i),r=e.scales.geoPath.centroid(t),n=Number.isFinite(r[0])&&Number.isFinite(r[1])?e.scales.invertedPoint(r[0],r[1]):null;return{datum:{...o,gridLongitude:n?.[0],gridLatitude:n?.[1]},x:r[0],y:r[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function k(e){return e.points.map(t=>{let i=Number(f(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(f(t,e.config.latitudeAccessor,["lat","latitude"])),r=Number.isFinite(i)&&Number.isFinite(o)?e.scales.projectedPoint(i,o):null;return{datum:t,x:r?.[0]??NaN,y:r?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function w(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(f(e,t.columnAccessor)),y:Number(f(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return i.length!==e.length?null:i.map(e=>({...e,row:e.y,column:e.x}))}function S({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=ae();/* @__PURE__ */
19
19
  return Lt("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);/* @__PURE__ */
20
- return Lt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function M(e,t,i){return Math.max(t,Math.min(i,e))}function A(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function C(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function R(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function N(e,t){let i=R(e);return(e.id??i.id??i.name??"feature-"+t)+""}function F(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}function j(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function P(e){if(!e)return 0;let t=Bt.get(e);if(t)return t;let i=Et;return Et+=1,Bt.set(e,i),i}function H(e){return e.map((e,t)=>{if(Ot.has(e))return{feature:e,index:t,bounds:Ot.get(e)??null};try{let i=zt(e);return Ot.set(e,i),{feature:e,index:t,bounds:i}}catch{return Ot.set(e,null),{feature:e,index:t,bounds:null}}})}function L(e,t,i){return t>i?e>=t||i>=e:e>=t&&i>=e}function I(e,t){return!t||e[1]>=t[0][1]&&t[1][1]>=e[1]&&L(e[0],t[0][0],t[1][0])}function z(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&I(t,i.bounds))try{if(Wt(e,t))return{feature:e,index:o}}catch{}}return null}function W(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=F(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[M(n[0][0],a,Math.max(a,i.width-a)),M(n[0][1],a,Math.max(a,i.height-a))],[M(n[1][0],a,Math.max(a,i.width-a)),M(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=A(o.columns),d=Math.max(2,u?s/u:A(o.cellSize)??10),m=Math.max(100,Math.round(A(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[g,y]=j(l[0][0],l[1][0],p,d),[b,v]=j(l[0][1],l[1][1],f,d),x=[],k=H(r);for(let e=b;v>=e;e+=1){let i=f+(e+.5)*d;for(let r=g;y>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=z(k,n);if(!a)continue;let l={...R(a.feature),featureId:N(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:r}}function D(e){return Math.round(1e4*e)/1e4}function T(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${D(Number(e[0]))},${D(Number(e[1]))}`:"null"}function O(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function B(e){return"number"==typeof e&&Number.isFinite(e)?D(e)+"":null===e?"null":"unavailable"}function E(e){return Array.isArray(e)&&e.every(Number.isFinite)?e.map(e=>D(Number(e))).join(","):"unavailable"}function G(e){let t=e.scales.projection;return[B(O(t,"scale")),T(O(t,"translate")),T(O(t,"center")),E(O(t,"rotate")),B(O(t,"clipAngle")),B(O(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>T(e.scales.projectedPoint(t,i)))].join("|")}function $(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",P(t.featureFilter),P(t.dotFilter),G(e)].join("::")}function Z(e){let t=Tt.get(e.areas);t||(t=/* @__PURE__ */new Map,Tt.set(e.areas,t));let i=$(e),o=t.get(i);if(o)return o;let r=W(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}function _(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function V(e,t,i){return _([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function U(e,t,i){return _(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function q(e,t,i){let{featureKey:o,dataKey:r}=i,n=/* @__PURE__ */new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}let a=e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""};return e.map(e=>{let t=a(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{a as K,b as J,c as X,d as Y}from"./c-GSCO3FWL.min.js";import{a as Q,b as ee}from"./c-4MD53L2J.min.js";import"./c-PQOZPM4G.min.js";import{a as te,b as ie,c as oe}from"./c-HQ27AHMC.min.js";import"./c-7FKPPCGN.min.js";import"./c-STHZWF3D.min.js";import"./c-VXIYF7V2.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-BYJJ7EMG.min.js";import"./c-3AGX252H.min.js";import{Y as re,_ as ne}from"./c-KGROWFT2.min.js";import"./c-V5KFJWQQ.min.js";import{b as ae}from"./c-CLLCX3PT.min.js";import"./c-N5WT7TXG.min.js";import{Aa as le,Bb as se,Db as ce,Fb as ue,Kb as de,Mb as me,Nb as he,Oa as pe,Pa as fe,Pb as ge,Qb as ye,Rb as be,Sb as ve,Tb as xe,Va as ke,_a as we,a as Se,ab as Me,b as Ae,bb as Ce,cb as Re,db as Ne,gb as Fe,jb as je,mb as Pe,pb as He,qb as Le,sb as Ie,za as ze}from"./c-G53AVC42.min.js";import{d as We,n as De,r as Te,u as Oe}from"./c-Y342FJ6K.min.js";import{d as Be,e as Ee,r as Ge,s as $e,t as Ze,u as _e}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import{j as Ve}from"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import{a as Ue}from"./c-3PFVJFBK.min.js";import{useMemo as qe}from"react";import{scaleSequential as Ke}from"d3-scale";import{useState as Je,useEffect as Xe,useMemo as Ye}from"react";import{feature as Qe}from"topojson-client";var et=/* @__PURE__ */new Map;import{jsx as tt,jsxs as it}from"react/jsx-runtime";a.displayName="ChoroplethMap";import{useMemo as ot,useRef as rt,forwardRef as nt}from"react";var at={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as lt,jsxs as st}from"react/jsx-runtime";var ct=[3,30],ut=[1,4],dt=nt(function(e,t){let i=rt(null);oe(t,{variant:"geo-points",frameRef:i});let o=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=at,tooltip:A,annotations:C,margin:R,className:N,selection:F,linkedHover:j,onObservation:P,onClick:H,chartId:L,loading:I,loadingContent:z,emptyContent:W,legendInteraction:D,legendPosition:T,frameProps:O={},stroke:B,strokeWidth:E,opacity:G}=e,$=c??("sparkline"===o.mode?ut:ct),Z="sparkline"===o.mode?1.5:6,_=g??!!x,V=r(S),U=ie({data:n??Se,rawData:n,colorBy:u,colorScheme:m,legendInteraction:D,legendPosition:T,frameLegend:O,selection:F,linkedHover:j,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:H,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:L,showLegend:o.showLegend,userMargin:R,marginDefaults:Ie(o),loading:I,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title}),q=U.data,K=ot(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=q.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Ue(t):void 0},[q,s]),J=ot(()=>{let e=xe(e=>({fill:u?Te(e,u,U.colorScale):De,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Oe(e,s,$,K):Z}),d,ge(u,s)),t=ne(e,{stroke:B,strokeWidth:E,opacity:G});return U.effectiveSelectionHook?je(t,U.effectiveSelectionHook,U.resolvedSelection):t},[u,U.colorScale,U.effectiveSelectionHook,U.resolvedSelection,s,$,K,Z,B,E,G,d]),X=ot(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;/* @__PURE__ */
20
+ return Lt("text",{x:e.x,y:e.y,fill:t,fontFamily:o,fontSize:i,fontWeight:r,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function M(e,t,i){return Math.max(t,Math.min(i,e))}function A(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function C(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function R(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function N(e,t){let i=R(e);return(e.id??i.id??i.name??"feature-"+t)+""}function F(e,t){if(0===e.length)return null;let i=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(i[0][0])&&Number.isFinite(i[0][1])&&Number.isFinite(i[1][0])&&Number.isFinite(i[1][1])?i:null}function j(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function P(e){if(!e)return 0;let t=Bt.get(e);if(t)return t;let i=Et;return Et+=1,Bt.set(e,i),i}function H(e){return e.map((e,t)=>{if(Ot.has(e))return{feature:e,index:t,bounds:Ot.get(e)??null};try{let i=zt(e);return Ot.set(e,i),{feature:e,index:t,bounds:i}}catch{return Ot.set(e,null),{feature:e,index:t,bounds:null}}})}function L(e,t,i){return t>i?e>=t||i>=e:e>=t&&i>=e}function I(e,t){return!t||e[1]>=t[0][1]&&t[1][1]>=e[1]&&L(e[0],t[0][0],t[1][0])}function z(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&I(t,i.bounds))try{if(Wt(e,t))return{feature:e,index:o}}catch{}}return null}function W(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=F(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[M(n[0][0],a,Math.max(a,i.width-a)),M(n[0][1],a,Math.max(a,i.height-a))],[M(n[1][0],a,Math.max(a,i.width-a)),M(n[1][1],a,Math.max(a,i.height-a))]],s=Math.max(0,l[1][0]-l[0][0]),c=Math.max(0,l[1][1]-l[0][1]);if(0===s||0===c)return{dots:[],cellSize:10,features:r};let u=A(o.columns),d=Math.max(2,u?s/u:A(o.cellSize)??10),m=Math.max(100,Math.round(A(o.maxSamples)??25e3)),h=Math.ceil(s/d)*Math.ceil(c/d);h>m&&(d*=Math.sqrt(h/m));let p=o.gridOrigin?.[0]??0,f=o.gridOrigin?.[1]??0,[g,y]=j(l[0][0],l[1][0],p,d),[b,v]=j(l[0][1],l[1][1],f,d),x=[],k=H(r);for(let e=b;v>=e;e+=1){let i=f+(e+.5)*d;for(let r=g;y>=r;r+=1){let n=t.invertedPoint(p+(r+.5)*d,i);if(!n||!Number.isFinite(n[0])||!Number.isFinite(n[1]))continue;let a=z(k,n);if(!a)continue;let l={...R(a.feature),featureId:N(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:r,longitude:n[0],latitude:n[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:r}}function D(e){return Math.round(1e4*e)/1e4}function T(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${D(Number(e[0]))},${D(Number(e[1]))}`:"null"}function O(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function B(e){return"number"==typeof e&&Number.isFinite(e)?D(e)+"":null===e?"null":"unavailable"}function E(e){return Array.isArray(e)&&e.every(Number.isFinite)?e.map(e=>D(Number(e))).join(","):"unavailable"}function G(e){let t=e.scales.projection;return[B(O(t,"scale")),T(O(t,"translate")),T(O(t,"center")),E(O(t,"rotate")),B(O(t,"clipAngle")),B(O(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>T(e.scales.projectedPoint(t,i)))].join("|")}function U(e){let t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",P(t.featureFilter),P(t.dotFilter),G(e)].join("::")}function $(e){let t=Tt.get(e.areas);t||(t=/* @__PURE__ */new Map,Tt.set(e.areas,t));let i=U(e),o=t.get(i);if(o)return o;let r=W(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){let e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(i,r),r}function _(e){return e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")+"Z"}function Z(e,t,i){return _([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function J(e,t,i){return _(Array.from({length:6},(o,r)=>{let n=-Math.PI/2+r*(Math.PI/3);return[e+Math.cos(n)*i,t+Math.sin(n)*i]}))}function q(e,t,i){let{featureKey:o,dataKey:r}=i,n=/* @__PURE__ */new Map;for(let e of t){let t=(Object.prototype.hasOwnProperty.call(e,r)?e[r]:void 0)+"";n.set(t,e)}let a=e=>{let t=o.split("."),i=e;for(let e of t)i=null!==i&&"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;return(i??"")+""};return e.map(e=>{let t=a(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}import{a as V,b as K,c as X,d as Y}from"./c-GSCO3FWL.min.js";import{a as Q,b as ee}from"./c-JC76YAHB.min.js";import"./c-YL7HJL5J.min.js";import{a as te,b as ie,c as oe}from"./c-FMCUQ6JX.min.js";import"./c-7FKPPCGN.min.js";import"./c-STHZWF3D.min.js";import"./c-JOPGDP6N.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-BYJJ7EMG.min.js";import"./c-3AGX252H.min.js";import{Y as re,_ as ne}from"./c-SAP5KY6R.min.js";import"./c-V5KFJWQQ.min.js";import{b as ae}from"./c-CLLCX3PT.min.js";import"./c-N5WT7TXG.min.js";import{Aa as le,Cb as se,Eb as ce,Gb as ue,Lb as de,Nb as me,Oa as he,Ob as pe,Pa as fe,Qb as ge,Rb as ye,Sb as be,Tb as ve,Ub as xe,Va as ke,_a as we,a as Se,ab as Me,b as Ae,bb as Ce,cb as Re,db as Ne,hb as Fe,kb as je,nb as Pe,qb as He,rb as Le,tb as Ie,za as ze}from"./c-UMGHCBH5.min.js";import{d as We,n as De,r as Te,u as Oe}from"./c-Y342FJ6K.min.js";import{d as Be,e as Ee,r as Ge,s as Ue,t as $e,u as _e}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import{j as Ze}from"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import{a as Je}from"./c-3PFVJFBK.min.js";import{useMemo as qe}from"react";import{scaleSequential as Ve}from"d3-scale";import{useState as Ke,useEffect as Xe,useMemo as Ye}from"react";import{feature as Qe}from"topojson-client";var et=/* @__PURE__ */new Map;import{jsx as tt,jsxs as it}from"react/jsx-runtime";a.displayName="ChoroplethMap";import{useMemo as ot,useRef as rt,forwardRef as nt}from"react";var at={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5};import{jsx as lt,jsxs as st}from"react/jsx-runtime";var ct=[3,30],ut=[1,4],dt=nt(function(e,t){let i=rt(null);oe(t,{variant:"geo-points",frameRef:i});let o=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:n,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,areas:S,areaStyle:M=at,tooltip:A,annotations:C,margin:R,className:N,selection:F,linkedHover:j,onObservation:P,onClick:H,chartId:L,loading:I,loadingContent:z,emptyContent:W,legendInteraction:D,legendPosition:T,frameProps:O={},stroke:B,strokeWidth:E,opacity:G}=e,U=c??("sparkline"===o.mode?ut:ct),$="sparkline"===o.mode?1.5:6,_=g??!!x,Z=r(S),J=ie({data:n??Se,rawData:n,colorBy:u,colorScheme:m,legendInteraction:D,legendPosition:T,frameLegend:O,selection:F,linkedHover:j,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:H,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:L,showLegend:o.showLegend,userMargin:R,marginDefaults:Ie(o),loading:I,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title}),q=J.data,V=ot(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=q.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?Je(t):void 0},[q,s]),K=ot(()=>{let e=xe(e=>({fill:u?Te(e,u,J.colorScale):De,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Oe(e,s,U,V):$}),d,ge(u,s)),t=ne(e,{stroke:B,strokeWidth:E,opacity:G});return J.effectiveSelectionHook?je(t,J.effectiveSelectionHook,J.resolvedSelection):t},[u,J.colorScale,J.effectiveSelectionHook,J.resolvedSelection,s,U,V,$,B,E,G,d]),X=ot(()=>e=>{let t=e?.name||e?.label||e?.NAME||e?.id,i="string"==typeof s?s:null,o=("function"==typeof s?s:e=>e[s])(e),r=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",n="string"==typeof u?u:null,a=n?e?.[n]:null;/* @__PURE__ */
21
21
  return st("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */lt("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&/* @__PURE__ */st("div",{children:[
22
22
  /* @__PURE__ */st("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&/* @__PURE__ */st("div",{children:[
23
23
  /* @__PURE__ */st("span",{style:{opacity:.7},children:[n,": "]}),a+""]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>/* @__PURE__ */st("div",{children:[
24
- /* @__PURE__ */st("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(U.earlyReturn)return U.earlyReturn;Ne("ProportionalSymbolMap",q,"xAccessor",a),Ne("ProportionalSymbolMap",q,"yAccessor",l);let Y={projection:h,...null!=n&&{points:q},xAccessor:a,yAccessor:l,pointStyle:J,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...V&&{areas:V,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},..._&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:U.margin,enableHover:o.enableHover,tooltipContent:!1===A?()=>null:ke(A)||X,...U.legendBehaviorProps,...re({linkedHover:j,selection:F,onObservation:P,onClick:H,mobileInteraction:U.mobileInteraction,customHoverBehavior:U.customHoverBehavior,customClickBehavior:U.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...N&&{className:N},...null!=e.animate&&{animate:e.animate},...O};/* @__PURE__ */
25
- return lt(Me,{componentName:"ProportionalSymbolMap",width:o.width,height:o.height,children:/* @__PURE__ */lt(Q,{ref:i,...Y})})});dt.displayName="ProportionalSymbolMap";import{useMemo as mt,useCallback as ht,useRef as pt,forwardRef as ft}from"react";import{jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt="__semiotic_x",vt="__semiotic_y",xt=ft(function(e,t){let i=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:o,nodes:n,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=at,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:F="round",colorScheme:j,styleRules:P,showParticles:H,particleStyle:L,tooltip:I,annotations:z,margin:W,className:D,selection:T,linkedHover:O,onObservation:B,onClick:E,chartId:G,loading:$,loadingContent:Z,emptyContent:_,frameProps:V={},legendInteraction:U,legendPosition:q,stroke:K,strokeWidth:J,opacity:X,lineIdAccessor:Y}=e,ee=p??!!b,te=r(S),ae=mt(()=>Ae(n),[n]),le=ie({data:o??Se,rawData:o,colorBy:A,colorScheme:j,legendInteraction:U,legendPosition:q,frameLegend:V,selection:T,linkedHover:O,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:Ie(i),loading:$,loadingContent:Z,emptyContent:_,width:i.width,height:i.height,hasTitle:!!i.title}),se=le.data,ce=Fe(O),ue=Pe({name:ce?.name||"hover",fields:ce?.fields||[]}),de=Ve(e=>e.pushObservation),he=mt(()=>{let e=/* @__PURE__ */new Map;for(let t of ae)e.set(t[a]+"",t);return e},[ae,a]),pe=pt(null),fe=pt(he);fe.current=he;let ge=pt(l);ge.current=l;let ye=pt(c);ye.current=c;let be=ht(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=fe.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof ge.current?ge.current:e=>e[ge.current],n="function"==typeof ye.current?ye.current:e=>e[ye.current];return{...e,coordinates:[{[bt]:r(i),[vt]:n(i)},{[bt]:r(o),[vt]:n(o)}]}},[]);oe(t,{variant:"geo-lines",frameRef:pe,overrides:{push:e=>{let t=be(e);t&&pe.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=be(i);e&&t.push(e)}t.length>0&&pe.current?.pushManyLines(t)}}});let ve=mt(()=>{let e=/* @__PURE__ */new Map;for(let t of se)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[se]),xe=ht(e=>{if(O)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=ve.get(t[a]+"");e&&ue.onHover(e)}else ue.onHover(t)}else ue.onHover(null);if(B||de){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:G};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};B&&B(o),de&&de(o)}else{let e={...t,type:"hover-end"};B&&B(e),de&&de(e)}}},[O,ue,a,ve,B,G,de]),we=le.customClickBehavior,Ce=mt(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof c?c:e=>e[c];return se.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=he.get(i.source+""),r=he.get(i.target+"");return o&&r?{...i,coordinates:[{[bt]:e(o),[vt]:t(o)},{[bt]:e(r),[vt]:t(r)}]}:null}).filter(Boolean)},[se,he,l,c]),Re=mt(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&bt in t?t[bt]:e(t)},[l]),Ne=mt(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&vt in t?t[vt]:e(t)},[c]),He=mt(()=>{let e=se.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Ue(e)},[se,u]),Le=mt(()=>s({valueAccessor:u,valueDomain:He,edgeWidthRange:R,resolveStroke:e=>A?Te(e,A,le.colorScale):De,edgeOpacity:C,edgeLinecap:F,styleRules:P}),[u,He,R,A,le.colorScale,C,F,P]),ze=mt(()=>{let e=ne(Le,{stroke:K,strokeWidth:J,opacity:X});if(!le.effectiveSelectionHook)return e;let t={...le.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return je(e,le.effectiveSelectionHook,{...le.resolvedSelection||{},unselectedStyle:t})},[Le,le.effectiveSelectionHook,le.resolvedSelection,K,J,X]),We=N??("sparkline"===i.mode?1.5:5),Oe=mt(()=>ne(()=>({fill:"#333",r:We,fillOpacity:.8}),{stroke:K,strokeWidth:J,opacity:X}),[We,K,J,X]),Be=mt(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)/* @__PURE__ */
24
+ /* @__PURE__ */st("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(J.earlyReturn)return J.earlyReturn;Ne("ProportionalSymbolMap",q,"xAccessor",a),Ne("ProportionalSymbolMap",q,"yAccessor",l);let Y={projection:h,...null!=n&&{points:q},xAccessor:a,yAccessor:l,pointStyle:K,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...Z&&{areas:Z,areaStyle:M},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},..._&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:J.margin,enableHover:o.enableHover,tooltipContent:!1===A?()=>null:ke(A)||X,...J.legendBehaviorProps,...re({linkedHover:j,selection:F,onObservation:P,onClick:H,mobileInteraction:J.mobileInteraction,customHoverBehavior:J.customHoverBehavior,customClickBehavior:J.customClickBehavior,linkedHoverInClickPredicate:!1}),...C&&C.length>0&&{annotations:C},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...o.title&&{title:o.title},...o.description&&{description:o.description},...o.summary&&{summary:o.summary},...void 0!==o.accessibleTable&&{accessibleTable:o.accessibleTable},...N&&{className:N},...null!=e.animate&&{animate:e.animate},...O};/* @__PURE__ */
25
+ return lt(Me,{componentName:"ProportionalSymbolMap",width:o.width,height:o.height,children:/* @__PURE__ */lt(Q,{ref:i,...Y})})});dt.displayName="ProportionalSymbolMap";import{useMemo as mt,useCallback as ht,useRef as pt,forwardRef as ft}from"react";import{jsx as gt,jsxs as yt}from"react/jsx-runtime";var bt="__semiotic_x",vt="__semiotic_y",xt=ft(function(e,t){let i=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:o,nodes:n,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:c="lat",valueAccessor:u="value",projection:d="equalEarth",graticule:m,fitPadding:h,zoomable:p,zoomExtent:f,onZoom:g,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:k="geo",flowStyle:w="basic",areas:S,areaStyle:M=at,edgeColorBy:A,edgeOpacity:C=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:F="round",colorScheme:j,styleRules:P,showParticles:H,particleStyle:L,tooltip:I,annotations:z,margin:W,className:D,selection:T,linkedHover:O,onObservation:B,onClick:E,chartId:G,loading:U,loadingContent:$,emptyContent:_,frameProps:Z={},legendInteraction:J,legendPosition:q,stroke:V,strokeWidth:K,opacity:X,lineIdAccessor:Y}=e,ee=p??!!b,te=r(S),ae=mt(()=>Ae(n),[n]),le=ie({data:o??Se,rawData:o,colorBy:A,colorScheme:j,legendInteraction:J,legendPosition:q,frameLegend:Z,selection:T,linkedHover:O,fallbackFields:A?["string"==typeof A?A:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:Ie(i),loading:U,loadingContent:$,emptyContent:_,width:i.width,height:i.height,hasTitle:!!i.title}),se=le.data,ce=Fe(O),ue=Pe({name:ce?.name||"hover",fields:ce?.fields||[]}),de=Ze(e=>e.pushObservation),he=mt(()=>{let e=/* @__PURE__ */new Map;for(let t of ae)e.set(t[a]+"",t);return e},[ae,a]),pe=pt(null),fe=pt(he);fe.current=he;let ge=pt(l);ge.current=l;let ye=pt(c);ye.current=c;let be=ht(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=fe.current,i=t.get(e.source+""),o=t.get(e.target+"");if(!i||!o)return null;let r="function"==typeof ge.current?ge.current:e=>e[ge.current],n="function"==typeof ye.current?ye.current:e=>e[ye.current];return{...e,coordinates:[{[bt]:r(i),[vt]:n(i)},{[bt]:r(o),[vt]:n(o)}]}},[]);oe(t,{variant:"geo-lines",frameRef:pe,overrides:{push:e=>{let t=be(e);t&&pe.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=be(i);e&&t.push(e)}t.length>0&&pe.current?.pushManyLines(t)}}});let ve=mt(()=>{let e=/* @__PURE__ */new Map;for(let t of se)!t||"object"!=typeof t||(null!=t.source&&!e.has(t.source)&&e.set(t.source,t),null!=t.target&&!e.has(t.target)&&e.set(t.target,t));return e},[se]),xe=ht(e=>{if(O)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=ve.get(t[a]+"");e&&ue.onHover(e)}else ue.onHover(t)}else ue.onHover(null);if(B||de){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:G};if(e){let i=e.data||e.datum||e;Array.isArray(i)&&(i=i[0]);let o={...t,type:"hover",datum:i||{},x:e.x??0,y:e.y??0};B&&B(o),de&&de(o)}else{let e={...t,type:"hover-end"};B&&B(e),de&&de(e)}}},[O,ue,a,ve,B,G,de]),we=le.customClickBehavior,Ce=mt(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof c?c:e=>e[c];return se.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=he.get(i.source+""),r=he.get(i.target+"");return o&&r?{...i,coordinates:[{[bt]:e(o),[vt]:t(o)},{[bt]:e(r),[vt]:t(r)}]}:null}).filter(Boolean)},[se,he,l,c]),Re=mt(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&bt in t?t[bt]:e(t)},[l]),Ne=mt(()=>{let e="function"==typeof c?c:e=>e[c];return t=>null!=t&&"object"==typeof t&&vt in t?t[vt]:e(t)},[c]),He=mt(()=>{let e=se.filter(e=>e&&"object"==typeof e).map(e=>Number(e[u]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return Je(e)},[se,u]),Le=mt(()=>s({valueAccessor:u,valueDomain:He,edgeWidthRange:R,resolveStroke:e=>A?Te(e,A,le.colorScale):De,edgeOpacity:C,edgeLinecap:F,styleRules:P}),[u,He,R,A,le.colorScale,C,F,P]),ze=mt(()=>{let e=ne(Le,{stroke:V,strokeWidth:K,opacity:X});if(!le.effectiveSelectionHook)return e;let t={...le.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return je(e,le.effectiveSelectionHook,{...le.resolvedSelection||{},unselectedStyle:t})},[Le,le.effectiveSelectionHook,le.resolvedSelection,V,K,X]),We=N??("sparkline"===i.mode?1.5:5),Oe=mt(()=>ne(()=>({fill:"#333",r:We,fillOpacity:.8}),{stroke:V,strokeWidth:K,opacity:X}),[We,V,K,X]),Be=mt(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)/* @__PURE__ */
26
26
  return gt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */gt("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[u];/* @__PURE__ */
27
27
  return yt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
28
- /* @__PURE__ */yt("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */gt("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?/* @__PURE__ */gt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */gt("div",{style:{fontWeight:600},children:t})}):null},[u,a]);if(le.earlyReturn)return le.earlyReturn;let Ee={projection:d,...null!=o&&{lines:Ce},points:ae,xAccessor:Re,yAccessor:Ne,lineDataAccessor:"coordinates",...null!=Y&&{lineIdAccessor:Y},lineType:k,flowStyle:w,lineStyle:ze,pointStyle:Oe,...te&&{areas:te,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...ee&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...H&&{showParticles:H},...L&&{particleStyle:L},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:le.margin,enableHover:i.enableHover,tooltipContent:!1===I?()=>null:ke(I)||Be,...le.legendBehaviorProps,...re({linkedHover:O,selection:T,onObservation:B,onClick:E,mobileInteraction:le.mobileInteraction,customHoverBehavior:xe,customClickBehavior:we,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...V};/* @__PURE__ */
29
- return gt(Me,{componentName:"FlowMap",width:i.width,height:i.height,children:/* @__PURE__ */gt(Q,{ref:pe,...Ee})})});xt.displayName="FlowMap";import{useMemo as kt,useRef as wt,useState as St,useEffect as Mt,useCallback as At,forwardRef as Ct}from"react";import{jsx as Rt,jsxs as Nt}from"react/jsx-runtime";import{Fragment as Ft,jsx as jt,jsxs as Pt}from"react/jsx-runtime";var Ht=Ct(function(e,t){let i=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:a="lat",nodeIdAccessor:l="id",center:s,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:R,tooltip:N,showRings:F,showRingLabels:j,ringStyle:P,showNorth:H,costLabel:L,cartogramLayout:I,annotations:z,margin:W,className:D,selection:T,linkedHover:O,onObservation:B,onClick:E,chartId:G,loading:$,loadingContent:Z,emptyContent:_,legendPosition:V,frameProps:U={},stroke:q,strokeWidth:K,opacity:J}=e,X="sparkline"===i.mode,Y=I??(X?"strip":"radial"),ee=R??(X?1.5:5),te=F??!0,ae=j??("strip"!==Y&&!i.compactMode),le=H??("strip"!==Y&&!X),se=g??!!x,ce=kt(()=>Ae(o),[o]),ue=ie({data:ce,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:V,frameLegend:U,selection:T,linkedHover:O,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:Ie(i),loading:$,loadingContent:Z,emptyContent:_,width:i.width,height:i.height,hasTitle:!!i.title}),de=kt(()=>{let e=xe(e=>{let t=e?.[l],i=null!=t&&t+""==s+"";return{fill:M?Te(e,M,ue.colorScale):De,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ee:ee}},A,ge(M)),t=ne(e,{stroke:q,strokeWidth:K,opacity:J});return ue.effectiveSelectionHook?je(t,ue.effectiveSelectionHook,ue.resolvedSelection):t},[M,ue.colorScale,ue.effectiveSelectionHook,ue.resolvedSelection,ee,q,K,J,A,s,l]),he=kt(()=>({center:s,centerAccessor:l,costAccessor:u,strength:d,lineMode:m,layout:Y}),[s,l,u,d,m,Y]),pe=kt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=/* @__PURE__ */new Map;for(let e of ce)i.set(e[l]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),l=i.get(o.target+"");return r&&l?{...o,coordinates:[{[n]:e(r),[a]:t(r)},{[n]:e(l),[a]:t(l)}]}:null}).filter(Boolean)},[r,ce,n,a,l]),fe=kt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);/* @__PURE__ */
28
+ /* @__PURE__ */yt("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */gt("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?/* @__PURE__ */gt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */gt("div",{style:{fontWeight:600},children:t})}):null},[u,a]);if(le.earlyReturn)return le.earlyReturn;let Ee={projection:d,...null!=o&&{lines:Ce},points:ae,xAccessor:Re,yAccessor:Ne,lineDataAccessor:"coordinates",...null!=Y&&{lineIdAccessor:Y},lineType:k,flowStyle:w,lineStyle:ze,pointStyle:Oe,...te&&{areas:te,areaStyle:M},...null!=m&&{graticule:m},...null!=h&&{fitPadding:h},...ee&&{zoomable:!0},...f&&{zoomExtent:f},...g&&{onZoom:g},...null!=y&&{dragRotate:y},...H&&{showParticles:H},...L&&{particleStyle:L},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:le.margin,enableHover:i.enableHover,tooltipContent:!1===I?()=>null:ke(I)||Be,...le.legendBehaviorProps,...re({linkedHover:O,selection:T,onObservation:B,onClick:E,mobileInteraction:le.mobileInteraction,customHoverBehavior:xe,customClickBehavior:we,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...Z};/* @__PURE__ */
29
+ return gt(Me,{componentName:"FlowMap",width:i.width,height:i.height,children:/* @__PURE__ */gt(Q,{ref:pe,...Ee})})});xt.displayName="FlowMap";import{useMemo as kt,useRef as wt,useState as St,useEffect as Mt,useCallback as At,forwardRef as Ct}from"react";import{jsx as Rt,jsxs as Nt}from"react/jsx-runtime";import{Fragment as Ft,jsx as jt,jsxs as Pt}from"react/jsx-runtime";var Ht=Ct(function(e,t){let i=me(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:o,lines:r,xAccessor:n="lon",yAccessor:a="lat",nodeIdAccessor:l="id",center:s,costAccessor:u,strength:d=1,lineMode:m="straight",projection:h="mercator",graticule:p,fitPadding:f,zoomable:g,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:k,tileCacheSize:w,transition:S,colorBy:M,styleRules:A,colorScheme:C,pointRadius:R,tooltip:N,showRings:F,showRingLabels:j,ringStyle:P,showNorth:H,costLabel:L,cartogramLayout:I,annotations:z,margin:W,className:D,selection:T,linkedHover:O,onObservation:B,onClick:E,chartId:G,loading:U,loadingContent:$,emptyContent:_,legendPosition:Z,frameProps:J={},stroke:q,strokeWidth:V,opacity:K}=e,X="sparkline"===i.mode,Y=I??(X?"strip":"radial"),ee=R??(X?1.5:5),te=F??!0,ae=j??("strip"!==Y&&!i.compactMode),le=H??("strip"!==Y&&!X),se=g??!!x,ce=kt(()=>Ae(o),[o]),ue=ie({data:ce,rawData:o,colorBy:M,colorScheme:C,legendInteraction:void 0,legendPosition:Z,frameLegend:J,selection:T,linkedHover:O,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:Ie(i),loading:U,loadingContent:$,emptyContent:_,width:i.width,height:i.height,hasTitle:!!i.title}),de=kt(()=>{let e=xe(e=>{let t=e?.[l],i=null!=t&&t+""==s+"";return{fill:M?Te(e,M,ue.colorScale):De,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*ee:ee}},A,ge(M)),t=ne(e,{stroke:q,strokeWidth:V,opacity:K});return ue.effectiveSelectionHook?je(t,ue.effectiveSelectionHook,ue.resolvedSelection):t},[M,ue.colorScale,ue.effectiveSelectionHook,ue.resolvedSelection,ee,q,V,K,A,s,l]),he=kt(()=>({center:s,centerAccessor:l,costAccessor:u,strength:d,lineMode:m,layout:Y}),[s,l,u,d,m,Y]),pe=kt(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=/* @__PURE__ */new Map;for(let e of ce)i.set(e[l]+"",e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(o.source+""),l=i.get(o.target+"");return r&&l?{...o,coordinates:[{[n]:e(r),[a]:t(r)},{[n]:e(l),[a]:t(l)}]}:null}).filter(Boolean)},[r,ce,n,a,l]),fe=kt(()=>e=>{let t=("function"==typeof u?u:e=>e[u])(e);/* @__PURE__ */
30
30
  return Pt("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
31
- /* @__PURE__ */jt("div",{style:{fontWeight:600},children:e[l]||e.name||e.id||"Point"}),null!=t&&/* @__PURE__ */Pt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,l]),ye=wt(null);oe(t,{variant:"geo-points",frameRef:ye});let[be,ve]=St(null),we=At(()=>{let e=ye.current?.getCartogramLayout?.();e&&ve(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);Mt(()=>{let e=requestAnimationFrame(we);return()=>cancelAnimationFrame(e)},[we,d,s,i.width,i.height,ce,Y]);let Se=kt(()=>{if(!te||!be)return[];let{maxCost:e}=be;if(0>=e)return[];if(Array.isArray(te))return te.filter(t=>t>0&&e>=t);let t="number"==typeof te?te:Math.min("strip"===be.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[te,be]),Ce=kt(()=>{if(!be)return U.foregroundGraphics||null;let e=/* @__PURE__ */jt(c,{bottomMargin:ue.margin.bottom,costLabel:L,layout:be,ringStyle:P,ringValues:Se,showNorth:le,showRingLabels:ae,showRings:te}),t=U.foregroundGraphics;return"function"==typeof t?i=>/* @__PURE__ */Pt(Ft,{children:[e,t(i)]}):/* @__PURE__ */Pt(Ft,{children:[e,t]})},[be,Se,te,ae,le,L,P,ue.margin.bottom,U.foregroundGraphics]);if(ue.earlyReturn)return ue.earlyReturn;Ne("DistanceCartogram",ce,"xAccessor",n),Ne("DistanceCartogram",ce,"yAccessor",a);let Re={projection:h,...null!=o&&{points:ce},...pe&&{lines:pe,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:de,projectionTransform:he,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...se&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ue.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:ke(N)||fe,...ue.legendBehaviorProps,...re({linkedHover:O,selection:T,onObservation:B,onClick:E,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...U,foregroundGraphics:Ce};/* @__PURE__ */
32
- return jt(Me,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:/* @__PURE__ */jt(Q,{ref:ye,...Re})})});Ht.displayName="DistanceCartogram";import{jsx as Lt}from"react/jsx-runtime";var It=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?x(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=w(r.map(e=>e.datum),t),a=o?r:k({...e,points:r.map(e=>e.datum)}),l=n??p(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let s=m(l.map(e=>e.row)),c=m(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),g=Math.max(1,Math.round(c[1]-c[0])+1),y=Math.max(0,t.layoutPadding??8),M=Math.max(1,e.dimensions.width-2*y)/g,A=Math.max(1,e.dimensions.height-2*y)/u,C=(e.dimensions.width-M*g)/2,R=(e.dimensions.height-A*u)/2,N=d(t.cellPadding??.12,0,.8),F=Math.max(1,.5*Math.min(M,A)*(1-N)),j=t.sizeAccessor?l.map(e=>Number(f(e.datum,t.sizeAccessor))):[],P=t.sizeDomain??m(j),H=t.sizeRange??[.36,1],L=d(Math.min(H[0],H[1]),.05,1),I=d(Math.max(H[0],H[1]),L,1),z=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(f(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(f(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),u=a.length>l?a.slice(0,l):a,m=f(r,t.categoryAccessor),p=null==m?void 0:m+"",g=f(r,t.fillAccessor),y=null!=g?g+"":p?e.resolveColor(p):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(f(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(d(h(b,P),0,1)):1,x=F*(L+v*(I-L)),k="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:p,row:i.row,column:i.column,x:C+(i.column-c[0]+.5)*M,y:R+(i.row-s[0]+.5)*A,radius:x,style:{fill:y,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...k}}}),W=t.shape??"circle";return{nodes:z.map(e=>"circle"===W?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===W?v(e.x,e.y,e.radius):b(e.x,e.y,e.radius),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===W?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0}),overlays:!1===t.showLabels?null:/* @__PURE__ */Lt(S,{marks:z,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??d(.23*Math.min(M,A),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as zt,geoContains as Wt}from"d3-geo";import{jsx as Dt}from"react/jsx-runtime";var Tt=/* @__PURE__ */new WeakMap,Ot=/* @__PURE__ */new WeakMap,Bt=/* @__PURE__ */new WeakMap,Et=1,Gt=e=>{let t=Z(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,A(i.dotRadius)??t.cellSize*M(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=C(l,i.categoryAccessor),m=C(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?U(c,u,r):V(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?/* @__PURE__ */Dt("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?/* @__PURE__ */Dt("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},N(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{a as ChoroplethMap,K as DEFAULT_HIT_RADIUS,Ht as DistanceCartogram,xt as FlowMap,ee as GeoCustomChart,fe as MultiLineTooltip,dt as ProportionalSymbolMap,Q as StreamGeoFrame,pe as Tooltip,ze as TooltipRoot,xe as composeStyleRules,Y as geoAreaHitTarget,X as geoHitTarget,Gt as geographicDotGridLayout,It as geographicGridLayout,Ee as glyphExtent,Be as glyphPlacement,p as gridifyGeographicPoints,$e as hatchFillId,Ze as hatchPatternDef,J as hitTargetPoint,Ge as isHatchFill,ge as makeNodeRuleContext,he as makeRuleValueResolver,le as markTooltipChrome,ye as matchesThreshold,q as mergeData,i as resolveReferenceGeography,Le as resolveResponsiveRules,ve as resolveStyleRules,_e as resolveSvgFill,He as responsiveRuleMatches,be as ruleMatches,W as sampleGeographicDotGrid};
31
+ /* @__PURE__ */jt("div",{style:{fontWeight:600},children:e[l]||e.name||e.id||"Point"}),null!=t&&/* @__PURE__ */Pt("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[u,l]),ye=wt(null);oe(t,{variant:"geo-points",frameRef:ye});let[be,ve]=St(null),we=At(()=>{let e=ye.current?.getCartogramLayout?.();e&&ve(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);Mt(()=>{let e=requestAnimationFrame(we);return()=>cancelAnimationFrame(e)},[we,d,s,i.width,i.height,ce,Y]);let Se=kt(()=>{if(!te||!be)return[];let{maxCost:e}=be;if(0>=e)return[];if(Array.isArray(te))return te.filter(t=>t>0&&e>=t);let t="number"==typeof te?te:Math.min("strip"===be.layout?3:5,Math.max(2,Math.ceil(e/5))),i=e/t,o=[];for(let e=1;t>=e;e++)o.push(Math.round(i*e*10)/10);return o},[te,be]),Ce=kt(()=>{if(!be)return J.foregroundGraphics||null;let e=/* @__PURE__ */jt(c,{bottomMargin:ue.margin.bottom,costLabel:L,layout:be,ringStyle:P,ringValues:Se,showNorth:le,showRingLabels:ae,showRings:te}),t=J.foregroundGraphics;return"function"==typeof t?i=>/* @__PURE__ */Pt(Ft,{children:[e,t(i)]}):/* @__PURE__ */Pt(Ft,{children:[e,t]})},[be,Se,te,ae,le,L,P,ue.margin.bottom,J.foregroundGraphics]);if(ue.earlyReturn)return ue.earlyReturn;Ne("DistanceCartogram",ce,"xAccessor",n),Ne("DistanceCartogram",ce,"yAccessor",a);let Re={projection:h,...null!=o&&{points:ce},...pe&&{lines:pe,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:de,projectionTransform:he,...S&&{transition:{duration:S}},...null!=p&&{graticule:p},...null!=f&&{fitPadding:f},...se&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...k&&{tileAttribution:k},...w&&{tileCacheSize:w},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ue.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:ke(N)||fe,...ue.legendBehaviorProps,...re({linkedHover:O,selection:T,onObservation:B,onClick:E,mobileInteraction:ue.mobileInteraction,customHoverBehavior:ue.customHoverBehavior,customClickBehavior:ue.customClickBehavior,linkedHoverInClickPredicate:!1}),...z&&z.length>0&&{annotations:z},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...i.title&&{title:i.title},...i.description&&{description:i.description},...i.summary&&{summary:i.summary},...void 0!==i.accessibleTable&&{accessibleTable:i.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...J,foregroundGraphics:Ce};/* @__PURE__ */
32
+ return jt(Me,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:/* @__PURE__ */jt(Q,{ref:ye,...Re})})});Ht.displayName="DistanceCartogram";import{jsx as Lt}from"react/jsx-runtime";var It=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?x(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=w(r.map(e=>e.datum),t),a=o?r:k({...e,points:r.map(e=>e.datum)}),l=n??p(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};let s=m(l.map(e=>e.row)),c=m(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),g=Math.max(1,Math.round(c[1]-c[0])+1),y=Math.max(0,t.layoutPadding??8),M=Math.max(1,e.dimensions.width-2*y)/g,A=Math.max(1,e.dimensions.height-2*y)/u,C=(e.dimensions.width-M*g)/2,R=(e.dimensions.height-A*u)/2,N=d(t.cellPadding??.12,0,.8),F=Math.max(1,.5*Math.min(M,A)*(1-N)),j=t.sizeAccessor?l.map(e=>Number(f(e.datum,t.sizeAccessor))):[],P=t.sizeDomain??m(j),H=t.sizeRange??[.36,1],L=d(Math.min(H[0],H[1]),.05,1),I=d(Math.max(H[0],H[1]),L,1),z=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=(f(r,t.idAccessor,["id","key","name"])??"grid-"+o)+"",a=(f(r,t.labelAccessor,["abbr","code","label","name","id"])??n)+"",l=Math.max(1,t.maxLabelLength??4),u=a.length>l?a.slice(0,l):a,m=f(r,t.categoryAccessor),p=null==m?void 0:m+"",g=f(r,t.fillAccessor),y=null!=g?g+"":p?e.resolveColor(p):e.theme.categorical[0]??"#4f86c6",b=t.sizeAccessor?Number(f(r,t.sizeAccessor)):NaN,v=t.sizeAccessor&&Number.isFinite(b)?Math.sqrt(d(h(b,P),0,1)):1,x=F*(L+v*(I-L)),k="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:p,row:i.row,column:i.column,x:C+(i.column-c[0]+.5)*M,y:R+(i.row-s[0]+.5)*A,radius:x,style:{fill:y,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...k}}}),W=t.shape??"circle";return{nodes:z.map(e=>"circle"===W?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===W?v(e.x,e.y,e.radius):b(e.x,e.y,e.radius),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===W?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0}),overlays:!1===t.showLabels?null:/* @__PURE__ */Lt(S,{marks:z,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??d(.23*Math.min(M,A),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}};import{geoBounds as zt,geoContains as Wt}from"d3-geo";import{jsx as Dt}from"react/jsx-runtime";var Tt=/* @__PURE__ */new WeakMap,Ot=/* @__PURE__ */new WeakMap,Bt=/* @__PURE__ */new WeakMap,Et=1,Gt=e=>{let t=$(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,A(i.dotRadius)??t.cellSize*M(i.radiusRatio??.24,.05,.5)),n=i.gridOrigin?.[0]??0,a=i.gridOrigin?.[1]??0;return{nodes:t.dots.map((l,s)=>{let c=n+(l.gridColumn+.5)*t.cellSize,u=a+(l.gridRow+.5)*t.cellSize,d=C(l,i.categoryAccessor),m=C(l,i.fillAccessor),h={fill:null!=m?m+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof i.markStyle?i.markStyle(l,s):i.markStyle},p=`dot-${l.gridRow}-${l.gridColumn}`;return"circle"===o?{type:"point",x:c,y:u,r:r,style:h,datum:l,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===o?J(c,u,r):Z(c,u,r),centroid:[c,u],bounds:[[c-r,u-r],[c+r,u+r]],screenArea:"hexagon"===o?3*Math.sqrt(3)*r*r/2:(2*r)**2,style:h,datum:l,group:l.featureId,interactive:!1}}),overlays:i.showOutline?/* @__PURE__ */Dt("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?/* @__PURE__ */Dt("path",{d:r,fill:"none",stroke:i.outlineStyle?.stroke??"currentColor",strokeOpacity:i.outlineStyle?.opacity??i.outlineStyle?.fillOpacity??.22,strokeWidth:i.outlineStyle?.strokeWidth??.7,strokeDasharray:i.outlineStyle?.strokeDasharray,strokeLinecap:i.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},N(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{a as ChoroplethMap,V as DEFAULT_HIT_RADIUS,Ht as DistanceCartogram,xt as FlowMap,ee as GeoCustomChart,fe as MultiLineTooltip,dt as ProportionalSymbolMap,Q as StreamGeoFrame,he as Tooltip,ze as TooltipRoot,xe as composeStyleRules,Y as geoAreaHitTarget,X as geoHitTarget,Gt as geographicDotGridLayout,It as geographicGridLayout,Ee as glyphExtent,Be as glyphPlacement,p as gridifyGeographicPoints,Ue as hatchFillId,$e as hatchPatternDef,K as hitTargetPoint,Ge as isHatchFill,ge as makeNodeRuleContext,pe as makeRuleValueResolver,le as markTooltipChrome,ye as matchesThreshold,q as mergeData,i as resolveReferenceGeography,Le as resolveResponsiveRules,ve as resolveStyleRules,_e as resolveSvgFill,He as responsiveRuleMatches,be as ruleMatches,W as sampleGeographicDotGrid};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function s(){N("sankey",n),N("force",r),N("chord",m),N("tree",P),N("cluster",P),N("treemap",P),N("circlepack",P),N("partition",P),N("orbit",g)}import{a}from"./c-PZ3NEGNG.min.js";import"./c-6IVBV5NO.min.js";import{a as e,f as i,g as o}from"./c-GSCO3FWL.min.js";import{a as r,b as t,c as m,d as c,e as n,f as p,g as l,h as j,i as u,j as T,k as S,l as k,m as y,n as h,o as P,p as C,q as F,r as L,s as g,t as b,u as G}from"./c-7LY46QUI.min.js";import"./c-HLGTD5SJ.min.js";import"./c-PQOZPM4G.min.js";import"./c-IBRLFKWA.min.js";import"./c-HQ27AHMC.min.js";import{a as N,b as R}from"./c-SG2Y7EBY.min.js";import"./c-YMFUIO54.min.js";import"./c-BYJJ7EMG.min.js";import"./c-TIDKVMMZ.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-QXLDCATV.min.js";import"./c-U5XVLSHN.min.js";import"./c-KGROWFT2.min.js";import"./c-V5KFJWQQ.min.js";import{b as V}from"./c-CLLCX3PT.min.js";import"./c-RHDOOQ4X.min.js";import"./c-UBHICVSC.min.js";import"./c-N5WT7TXG.min.js";import{Aa as f,Nb as D,Oa as I,Pa as d,Pb as H,Qb as M,Rb as O,Sb as A,Tb as X,lb as v,pb as B,qb as Y,za as Q}from"./c-G53AVC42.min.js";import"./c-Y342FJ6K.min.js";import{d as J,e as U,r as E,s as K,t as w,u as W}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";export{c as ChordDiagram,L as CirclePack,e as DEFAULT_HIT_RADIUS,t as ForceDirectedGraph,d as MultiLineTooltip,G as NetworkCustomChart,b as OrbitDiagram,h as ProcessSankey,p as SankeyDiagram,R as StreamNetworkFrame,I as Tooltip,Q as TooltipRoot,C as TreeDiagram,F as Treemap,X as composeStyleRules,u as diagnoseProcessSankeyLayout,S as diagnoseProcessSankeyProps,T as explainProcessSankeyLayout,j as formatProcessSankeyIssue,U as glyphExtent,J as glyphPlacement,K as hatchFillId,w as hatchPatternDef,k as inventoryAtTime,E as isHatchFill,H as makeNodeRuleContext,D as makeRuleValueResolver,f as markTooltipChrome,M as matchesThreshold,o as networkEdgeHitTarget,i as networkHitTarget,s as registerBuiltInNetworkLayouts,Y as resolveResponsiveRules,A as resolveStyleRules,W as resolveSvgFill,B as responsiveRuleMatches,O as ruleMatches,y as toProcessSankeyTime,V as useCustomLayoutSelection,a as useForceLayout,v as useSelectionActions,l as validateProcessSankey};
2
+ function s(){f("sankey",n),f("force",r),f("chord",m),f("tree",h),f("cluster",h),f("treemap",h),f("circlepack",h),f("partition",h),f("orbit",R)}import{a}from"./c-6XGGN5OS.min.js";import"./c-NUBZ63VU.min.js";import{a as e,f as i,g as o}from"./c-GSCO3FWL.min.js";import{a as r,b as t,c as m,d as c,e as n,f as p,g as l,h as j,i as u,j as S,k as T,l as k,m as y,n as L,o as h,p as F,q as g,r as P,s as R,t as b,u as C}from"./c-UQBWSYKI.min.js";import"./c-HLGTD5SJ.min.js";import"./c-YL7HJL5J.min.js";import"./c-IBRLFKWA.min.js";import"./c-FMCUQ6JX.min.js";import{a as f,b as D}from"./c-RWHLEUX6.min.js";import"./c-YMFUIO54.min.js";import"./c-BYJJ7EMG.min.js";import"./c-TIDKVMMZ.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-QXLDCATV.min.js";import"./c-U5XVLSHN.min.js";import"./c-SAP5KY6R.min.js";import"./c-V5KFJWQQ.min.js";import{b as H}from"./c-CLLCX3PT.min.js";import"./c-RHDOOQ4X.min.js";import"./c-LVHJJUOF.min.js";import"./c-N5WT7TXG.min.js";import{Aa as U,Oa as X,Ob as d,Pa as J,Qb as N,Rb as V,Sb as G,Tb as I,Ub as M,mb as O,qb as v,rb as A,za as B}from"./c-UMGHCBH5.min.js";import"./c-Y342FJ6K.min.js";import{d as Y,e as K,r as Q,s as W,t as w,u as E}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";export{c as ChordDiagram,P as CirclePack,e as DEFAULT_HIT_RADIUS,t as ForceDirectedGraph,J as MultiLineTooltip,C as NetworkCustomChart,b as OrbitDiagram,L as ProcessSankey,p as SankeyDiagram,D as StreamNetworkFrame,X as Tooltip,B as TooltipRoot,F as TreeDiagram,g as Treemap,M as composeStyleRules,u as diagnoseProcessSankeyLayout,T as diagnoseProcessSankeyProps,S as explainProcessSankeyLayout,j as formatProcessSankeyIssue,K as glyphExtent,Y as glyphPlacement,W as hatchFillId,w as hatchPatternDef,k as inventoryAtTime,Q as isHatchFill,N as makeNodeRuleContext,d as makeRuleValueResolver,U as markTooltipChrome,V as matchesThreshold,o as networkEdgeHitTarget,i as networkHitTarget,s as registerBuiltInNetworkLayouts,A as resolveResponsiveRules,I as resolveStyleRules,E as resolveSvgFill,v as responsiveRuleMatches,G as ruleMatches,y as toProcessSankeyTime,H as useCustomLayoutSelection,a as useForceLayout,O as useSelectionActions,l as validateProcessSankey};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a,b as s,e as t}from"./c-GSCO3FWL.min.js";import{a as i,b as m,c as o,d as e,e as r,f as n,g as l,h as c,i as p,j as h,k as j,l as C,m as P,n as u,o as T,p as R,q as F,r as S}from"./c-IPYGNVN6.min.js";import"./c-PDQHLOKU.min.js";import"./c-PQOZPM4G.min.js";import"./c-IBRLFKWA.min.js";import"./c-HQ27AHMC.min.js";import"./c-PKY4JFY5.min.js";import"./c-SQNEVNWT.min.js";import"./c-2TW5H5PD.min.js";import"./c-HK4OSLZA.min.js";import"./c-VXIYF7V2.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-QXLDCATV.min.js";import"./c-U5XVLSHN.min.js";import"./c-KGROWFT2.min.js";import"./c-V5KFJWQQ.min.js";import{b}from"./c-CLLCX3PT.min.js";import"./c-N5WT7TXG.min.js";import{Aa as L,E as V,F as N,Nb as d,Oa as H,Ob as X,Pa as A,Pb as G,Qb as O,Rb as W,Sb as g,Tb as D,Ub as I,pb as Q,qb as Y,za as k}from"./c-G53AVC42.min.js";import"./c-Y342FJ6K.min.js";import{d as B,e as K,q as M,r as f,s as v,t as y,u as U}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";export{N as AnnotationLabel,m as BarChart,n as BoxPlot,a as DEFAULT_HIT_RADIUS,C as DonutChart,h as DotPlot,T as FunnelChart,P as GaugeChart,u as GroupedBarChart,l as Histogram,e as LikertChart,A as MultiLineTooltip,S as OrdinalCustomChart,j as PieChart,R as RadarChart,p as RidgelinePlot,o as StackedBarChart,i as StreamOrdinalFrame,r as SwarmPlot,F as SwimlaneChart,H as Tooltip,k as TooltipRoot,c as ViolinPlot,D as composeStyleRules,M as createHatchPattern,V as estimateLabelWidth,K as glyphExtent,B as glyphPlacement,v as hatchFillId,y as hatchPatternDef,s as hitTargetPoint,t as hitTargetRect,f as isHatchFill,G as makeNodeRuleContext,d as makeRuleValueResolver,I as makeStyleRuleStyleFn,X as makeXYRuleContext,L as markTooltipChrome,O as matchesThreshold,Y as resolveResponsiveRules,g as resolveStyleRules,U as resolveSvgFill,Q as responsiveRuleMatches,W as ruleMatches,b as useCustomLayoutSelection};
2
+ import{a,b as s,e as t}from"./c-GSCO3FWL.min.js";import{a as i,b as m,c as o,d as r,e,f as n,g as l,h as c,i as p,j as h,k as j,l as C,m as R,n as u,o as P,p as L,q as S,r as T}from"./c-WD2RL76M.min.js";import"./c-PDQHLOKU.min.js";import"./c-YL7HJL5J.min.js";import"./c-IBRLFKWA.min.js";import"./c-FMCUQ6JX.min.js";import"./c-Z6GRGS53.min.js";import"./c-SQNEVNWT.min.js";import"./c-QPO24R7Q.min.js";import"./c-HK4OSLZA.min.js";import"./c-JOPGDP6N.min.js";import"./c-NATWERHZ.min.js";import"./c-P5NXQWIM.min.js";import"./c-TIMGODBG.min.js";import"./c-3AGX252H.min.js";import"./c-QXLDCATV.min.js";import"./c-U5XVLSHN.min.js";import"./c-SAP5KY6R.min.js";import"./c-V5KFJWQQ.min.js";import{b as F}from"./c-CLLCX3PT.min.js";import"./c-N5WT7TXG.min.js";import{Aa as b,E as d,F as H,Oa as N,Ob as V,Pa as X,Pb as G,Qb as O,Rb as A,Sb as D,Tb as Q,Ub as g,Vb as B,qb as M,rb as W,za as k}from"./c-UMGHCBH5.min.js";import"./c-Y342FJ6K.min.js";import{d as J,e as U,q as f,r as v,s as y,t as I,u as K}from"./c-3BYZXCX3.min.js";import"./c-JXVYIXTV.min.js";import"./c-5NYONM6V.min.js";import"./c-U6NLVFN4.min.js";import"./c-3PFVJFBK.min.js";export{H as AnnotationLabel,m as BarChart,n as BoxPlot,a as DEFAULT_HIT_RADIUS,C as DonutChart,h as DotPlot,P as FunnelChart,R as GaugeChart,u as GroupedBarChart,l as Histogram,r as LikertChart,X as MultiLineTooltip,T as OrdinalCustomChart,j as PieChart,L as RadarChart,p as RidgelinePlot,o as StackedBarChart,i as StreamOrdinalFrame,e as SwarmPlot,S as SwimlaneChart,N as Tooltip,k as TooltipRoot,c as ViolinPlot,g as composeStyleRules,f as createHatchPattern,d as estimateLabelWidth,U as glyphExtent,J as glyphPlacement,y as hatchFillId,I as hatchPatternDef,s as hitTargetPoint,t as hitTargetRect,v as isHatchFill,O as makeNodeRuleContext,V as makeRuleValueResolver,B as makeStyleRuleStyleFn,G as makeXYRuleContext,b as markTooltipChrome,A as matchesThreshold,W as resolveResponsiveRules,Q as resolveStyleRules,K as resolveSvgFill,M as responsiveRuleMatches,D as ruleMatches,F as useCustomLayoutSelection};
@@ -1 +1,4 @@
1
- function e(e,t){return new g(e,t)}async function t(t){try{return await(import(t.packageName))}catch(n){throw e(t,n)}}function n(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function i(e,t,n){const i=e.plugin?.id;return(i??e.label??e.id??`${n}-${t}`)+""}function r(e,t){const i=n(e.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};const r=e.bounds;return r?{type:"aabb",width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"circle",radius:t}}function a(e,t){const i=e.position??{x:0,y:0},r=n(e.circleRadius);if(null!=r&&r>0)return{type:"aabb",x:i.x,y:i.y,width:2*r,height:2*r};const a=e.bounds;return a?{type:"aabb",x:(a.min.x+a.max.x)/2,y:(a.min.y+a.max.y)/2,width:Math.max(1,a.max.x-a.min.x),height:Math.max(1,a.max.y-a.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*t,height:2*t}}function o(e,t){return t?e.plugin?.[t]:e.plugin}function s(e,t=0,a={}){const s=a.fallbackRadius??4,c=e.position??{x:0,y:0},u=e.velocity??{x:0,y:0};return{id:i(e,t,a.idPrefix??"matter-body"),x:c.x,y:c.y,vx:u.x,vy:u.y,angle:e.angle,mass:n(e.mass)??1,shape:r(e,s),datum:o(e,a.datumFromPlugin)}}function c(e,t=0,n={}){const r=n.fallbackRadius??4;return{id:i(e,t,n.idPrefix??"matter-collider"),sensor:!!e.isSensor,shape:a(e,r)}}function u(e,t={}){return e.map((e,n)=>s(e,n,t))}function l(e,t={}){return e.map((e,n)=>c(e,n,t))}async function m(){const e=await t(E);return e.default??e}function y(t){return e(E,t)}var d,p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,f={};((e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})})(f,{MATTER_PHYSICS_CAPABILITIES:()=>S,MATTER_PHYSICS_IMPORT_PATH:()=>T,MATTER_PHYSICS_INSTALL:()=>E,MATTER_PHYSICS_PACKAGE:()=>b,PhysicsOptionalEngineDependencyError:()=>g,loadMatterPhysicsPeer:()=>m,loadOptionalPhysicsPeer:()=>t,matterBodiesToPhysicsColliders:()=>l,matterBodiesToPhysicsSpawns:()=>u,matterBodyToPhysicsBodySpec:()=>s,matterBodyToPhysicsColliderSpec:()=>c,matterPhysicsDependencyError:()=>y,optionalEngineDependencyError:()=>e}),module.exports=(d=f,((e,t,n,i)=>{if(t)for(let n of x(t))P.call(e,n)||void 0===n||p(e,n,{get:()=>t[n],enumerable:!(i=h(t,n))||i.enumerable});return e})(p({},"__esModule",{value:!0}),d));var g=class extends Error{constructor(e,t){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,t&&(this.cause=t)}},b="matter-js",T="semiotic/physics/matter",S={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},E={engine:"Matter.js",importPath:T,packageName:b,installCommand:"npm install "+b};
1
+ function e(e,t){return new g(e,t)}async function t(t){try{return await(import(
2
+ /* webpackIgnore: true */
3
+ /* @vite-ignore */
4
+ t.packageName))}catch(n){throw e(t,n)}}function n(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function i(e,t,n){const i=e.plugin?.id;return(i??e.label??e.id??`${n}-${t}`)+""}function r(e,t){const i=n(e.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};const r=e.bounds;return r?{type:"aabb",width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"circle",radius:t}}function a(e,t){const i=e.position??{x:0,y:0},r=n(e.circleRadius);if(null!=r&&r>0)return{type:"aabb",x:i.x,y:i.y,width:2*r,height:2*r};const a=e.bounds;return a?{type:"aabb",x:(a.min.x+a.max.x)/2,y:(a.min.y+a.max.y)/2,width:Math.max(1,a.max.x-a.min.x),height:Math.max(1,a.max.y-a.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*t,height:2*t}}function o(e,t){return t?e.plugin?.[t]:e.plugin}function s(e,t=0,a={}){const s=a.fallbackRadius??4,c=e.position??{x:0,y:0},m=e.velocity??{x:0,y:0};return{id:i(e,t,a.idPrefix??"matter-body"),x:c.x,y:c.y,vx:m.x,vy:m.y,angle:e.angle,mass:n(e.mass)??1,shape:r(e,s),datum:o(e,a.datumFromPlugin)}}function c(e,t=0,n={}){const r=n.fallbackRadius??4;return{id:i(e,t,n.idPrefix??"matter-collider"),sensor:!!e.isSensor,shape:a(e,r)}}function m(e,t={}){return e.map((e,n)=>s(e,n,t))}function u(e,t={}){return e.map((e,n)=>c(e,n,t))}async function l(){const t=await import("matter-js").catch(t=>{throw e(w,t)});return t.default??t}function y(t){return e(w,t)}var d,p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,P=Object.prototype.hasOwnProperty,f={};((e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})})(f,{MATTER_PHYSICS_CAPABILITIES:()=>S,MATTER_PHYSICS_IMPORT_PATH:()=>T,MATTER_PHYSICS_INSTALL:()=>w,MATTER_PHYSICS_PACKAGE:()=>b,PhysicsOptionalEngineDependencyError:()=>g,loadMatterPhysicsPeer:()=>l,loadOptionalPhysicsPeer:()=>t,matterBodiesToPhysicsColliders:()=>u,matterBodiesToPhysicsSpawns:()=>m,matterBodyToPhysicsBodySpec:()=>s,matterBodyToPhysicsColliderSpec:()=>c,matterPhysicsDependencyError:()=>y,optionalEngineDependencyError:()=>e}),module.exports=(d=f,((e,t,n,i)=>{if(t)for(let n of x(t))P.call(e,n)||void 0===n||p(e,n,{get:()=>t[n],enumerable:!(i=h(t,n))||i.enumerable});return e})(p({},"__esModule",{value:!0}),d));var g=class extends Error{constructor(e,t){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,t&&(this.cause=t)}},b="matter-js",T="semiotic/physics/matter",S={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},w={engine:"Matter.js",importPath:T,packageName:b,installCommand:"npm install "+b};
@@ -1 +1 @@
1
- function e(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function t(e,t,a){let i=e.plugin?.id;return(i??e.label??e.id??`${a}-${t}`)+""}function a(t,a){let i=e(t.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};let n=t.bounds;return n?{type:"aabb",width:Math.max(1,n.max.x-n.min.x),height:Math.max(1,n.max.y-n.min.y)}:{type:"circle",radius:a}}function i(t,a){let i=t.position??{x:0,y:0},n=e(t.circleRadius);if(null!=n&&n>0)return{type:"aabb",x:i.x,y:i.y,width:2*n,height:2*n};let r=t.bounds;return r?{type:"aabb",x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*a,height:2*a}}function n(e,t){return t?e.plugin?.[t]:e.plugin}function r(i,r=0,s={}){let o=s.fallbackRadius??4,l=i.position??{x:0,y:0},m=i.velocity??{x:0,y:0};return{id:t(i,r,s.idPrefix??"matter-body"),x:l.x,y:l.y,vx:m.x,vy:m.y,angle:i.angle,mass:e(i.mass)??1,shape:a(i,o),datum:n(i,s.datumFromPlugin)}}function s(e,a=0,n={}){let r=n.fallbackRadius??4;return{id:t(e,a,n.idPrefix??"matter-collider"),sensor:!!e.isSensor,shape:i(e,r)}}function o(e,t={}){return e.map((e,a)=>r(e,a,t))}function l(e,t={}){return e.map((e,a)=>s(e,a,t))}async function m(){let e=await d(P);return e.default??e}function c(e){return y(P,e)}import{a as u,b as y,c as d}from"./c-3OFVBWQY.min.js";var x="matter-js",p="semiotic/physics/matter",h={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},P={engine:"Matter.js",importPath:p,packageName:x,installCommand:"npm install "+x};export{h as MATTER_PHYSICS_CAPABILITIES,p as MATTER_PHYSICS_IMPORT_PATH,P as MATTER_PHYSICS_INSTALL,x as MATTER_PHYSICS_PACKAGE,u as PhysicsOptionalEngineDependencyError,m as loadMatterPhysicsPeer,d as loadOptionalPhysicsPeer,l as matterBodiesToPhysicsColliders,o as matterBodiesToPhysicsSpawns,r as matterBodyToPhysicsBodySpec,s as matterBodyToPhysicsColliderSpec,c as matterPhysicsDependencyError,y as optionalEngineDependencyError};
1
+ function t(t){return"number"==typeof t&&Number.isFinite(t)?t:null}function e(t,e,a){let i=t.plugin?.id;return(i??t.label??t.id??`${a}-${e}`)+""}function a(e,a){let i=t(e.circleRadius);if(null!=i&&i>0)return{type:"circle",radius:i};let n=e.bounds;return n?{type:"aabb",width:Math.max(1,n.max.x-n.min.x),height:Math.max(1,n.max.y-n.min.y)}:{type:"circle",radius:a}}function i(e,a){let i=e.position??{x:0,y:0},n=t(e.circleRadius);if(null!=n&&n>0)return{type:"aabb",x:i.x,y:i.y,width:2*n,height:2*n};let r=e.bounds;return r?{type:"aabb",x:(r.min.x+r.max.x)/2,y:(r.min.y+r.max.y)/2,width:Math.max(1,r.max.x-r.min.x),height:Math.max(1,r.max.y-r.min.y)}:{type:"aabb",x:i.x,y:i.y,width:2*a,height:2*a}}function n(t,e){return e?t.plugin?.[e]:t.plugin}function r(i,r=0,s={}){let o=s.fallbackRadius??4,m=i.position??{x:0,y:0},l=i.velocity??{x:0,y:0};return{id:e(i,r,s.idPrefix??"matter-body"),x:m.x,y:m.y,vx:l.x,vy:l.y,angle:i.angle,mass:t(i.mass)??1,shape:a(i,o),datum:n(i,s.datumFromPlugin)}}function s(t,a=0,n={}){let r=n.fallbackRadius??4;return{id:e(t,a,n.idPrefix??"matter-collider"),sensor:!!t.isSensor,shape:i(t,r)}}function o(t,e={}){return t.map((t,a)=>r(t,a,e))}function m(t,e={}){return t.map((t,a)=>s(t,a,e))}async function l(){let t=await import("matter-js").catch(t=>{throw y(P,t)});return t.default??t}function c(t){return y(P,t)}import{a as u,b as y,c as d}from"./c-KWP4QTCM.min.js";var p="matter-js",x="semiotic/physics/matter",h={engine:"matter-js",determinism:"tolerance",sensors:!0,joints:!0,ccd:!1,maxBodiesHint:5e3,worker:!1},P={engine:"Matter.js",importPath:x,packageName:p,installCommand:"npm install "+p};export{h as MATTER_PHYSICS_CAPABILITIES,x as MATTER_PHYSICS_IMPORT_PATH,P as MATTER_PHYSICS_INSTALL,p as MATTER_PHYSICS_PACKAGE,u as PhysicsOptionalEngineDependencyError,l as loadMatterPhysicsPeer,d as loadOptionalPhysicsPeer,m as matterBodiesToPhysicsColliders,o as matterBodiesToPhysicsSpawns,r as matterBodyToPhysicsBodySpec,s as matterBodyToPhysicsColliderSpec,c as matterPhysicsDependencyError,y as optionalEngineDependencyError};
@@ -1 +1,4 @@
1
- function e(e,r){return new l(e,r)}async function r(r){try{return await(import(r.packageName))}catch(t){throw e(r,t)}}async function t(){const e=await r(h),t=e.default??e;return await(t.init?.()),t}function a(r){return e(h,r)}var i,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,p={};((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})})(p,{PhysicsOptionalEngineDependencyError:()=>l,RAPIER_PHYSICS_CAPABILITIES:()=>u,RAPIER_PHYSICS_ENGINE_DECISION:()=>P,RAPIER_PHYSICS_IMPORT_PATH:()=>m,RAPIER_PHYSICS_INSTALL:()=>h,RAPIER_PHYSICS_PACKAGE:()=>d,loadOptionalPhysicsPeer:()=>r,loadRapierPhysicsPeer:()=>t,optionalEngineDependencyError:()=>e,rapierPhysicsDependencyError:()=>a}),module.exports=(i=p,((e,r,t,a)=>{if(r)for(let t of s(r))c.call(e,t)||void 0===t||n(e,t,{get:()=>r[t],enumerable:!(a=o(r,t))||a.enumerable});return e})(n({},"__esModule",{value:!0}),i));var l=class extends Error{constructor(e,r){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,r&&(this.cause=r)}},d="@dimforge/rapier2d-compat",m="semiotic/physics/rapier",P={selectedPackage:d,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},u={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},h={engine:"Rapier 2D",importPath:m,packageName:d,installCommand:"npm install "+d};
1
+ function e(e,r){return new d(e,r)}async function r(r){try{return await(import(
2
+ /* webpackIgnore: true */
3
+ /* @vite-ignore */
4
+ r.packageName))}catch(t){throw e(r,t)}}async function t(){const r=await import("@dimforge/rapier2d-compat").catch(r=>{throw e(h,r)}),t=r.default??r;return await(t.init?.()),t}function a(r){return e(h,r)}var i,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,p={};((e,r)=>{for(var t in r)n(e,t,{get:r[t],enumerable:!0})})(p,{PhysicsOptionalEngineDependencyError:()=>d,RAPIER_PHYSICS_CAPABILITIES:()=>u,RAPIER_PHYSICS_ENGINE_DECISION:()=>P,RAPIER_PHYSICS_IMPORT_PATH:()=>m,RAPIER_PHYSICS_INSTALL:()=>h,RAPIER_PHYSICS_PACKAGE:()=>l,loadOptionalPhysicsPeer:()=>r,loadRapierPhysicsPeer:()=>t,optionalEngineDependencyError:()=>e,rapierPhysicsDependencyError:()=>a}),module.exports=(i=p,((e,r,t,a)=>{if(r)for(let t of s(r))c.call(e,t)||void 0===t||n(e,t,{get:()=>r[t],enumerable:!(a=o(r,t))||a.enumerable});return e})(n({},"__esModule",{value:!0}),i));var d=class extends Error{constructor(e,r){super(`${e.engine} is an optional Semiotic physics engine. Install ${e.packageName} to use ${e.importPath}: ${e.installCommand}`),this.name="PhysicsOptionalEngineDependencyError",this.details=e,r&&(this.cause=r)}},l="@dimforge/rapier2d-compat",m="semiotic/physics/rapier",P={selectedPackage:l,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},u={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},h={engine:"Rapier 2D",importPath:m,packageName:l,installCommand:"npm install "+l};
@@ -1 +1 @@
1
- async function e(){let e=await n(p),a=e.default??e;return await(a.init?.()),a}function a(e){return r(p,e)}import{a as i,b as r,c as n}from"./c-3OFVBWQY.min.js";var t="@dimforge/rapier2d-compat",s="semiotic/physics/rapier",o={selectedPackage:t,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},c={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},p={engine:"Rapier 2D",importPath:s,packageName:t,installCommand:"npm install "+t};export{i as PhysicsOptionalEngineDependencyError,c as RAPIER_PHYSICS_CAPABILITIES,o as RAPIER_PHYSICS_ENGINE_DECISION,s as RAPIER_PHYSICS_IMPORT_PATH,p as RAPIER_PHYSICS_INSTALL,t as RAPIER_PHYSICS_PACKAGE,n as loadOptionalPhysicsPeer,e as loadRapierPhysicsPeer,r as optionalEngineDependencyError,a as rapierPhysicsDependencyError};
1
+ async function e(){let e=await import("@dimforge/rapier2d-compat").catch(e=>{throw r(p,e)}),a=e.default??e;return await(a.init?.()),a}function a(e){return r(p,e)}import{a as i,b as r,c as t}from"./c-KWP4QTCM.min.js";var n="@dimforge/rapier2d-compat",s="semiotic/physics/rapier",o={selectedPackage:n,rejectedPackage:"@dimforge/rapier2d-deterministic",determinism:"tolerance",reason:"Use @dimforge/rapier2d-compat for the optional browser adapter path because it is the maintained npm/WASM package with standard bundler behavior. Treat Rapier visual/position conformance as tolerance-classed; keep the built-in kernel as the strict deterministic default."},c={engine:"rapier2d-compat",determinism:"tolerance",sensors:!0,joints:!0,ccd:!0,maxBodiesHint:2e4,worker:!0},p={engine:"Rapier 2D",importPath:s,packageName:n,installCommand:"npm install "+n};export{i as PhysicsOptionalEngineDependencyError,c as RAPIER_PHYSICS_CAPABILITIES,o as RAPIER_PHYSICS_ENGINE_DECISION,s as RAPIER_PHYSICS_IMPORT_PATH,p as RAPIER_PHYSICS_INSTALL,n as RAPIER_PHYSICS_PACKAGE,t as loadOptionalPhysicsPeer,e as loadRapierPhysicsPeer,r as optionalEngineDependencyError,a as rapierPhysicsDependencyError};