semiotic 3.13.0 → 3.13.1

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 (160) hide show
  1. package/README.md +53 -41
  2. package/ai/artifact-surface-inventory.json +1 -1
  3. package/ai/dist/mcp-server.js +132 -106
  4. package/ai/reference.md +12 -4
  5. package/ai/schema.json +16 -2
  6. package/ai/surface-manifest.json +1 -1
  7. package/ai/task-packets/compare-category-totals.json +5 -5
  8. package/ai/task-packets/compare-category-totals.md +2 -2
  9. package/ai/task-packets/correct-published-chart.json +5 -5
  10. package/ai/task-packets/correct-published-chart.md +2 -2
  11. package/ai/task-packets/index.json +6 -6
  12. package/ai/task-packets/update-live-chart.json +5 -5
  13. package/ai/task-packets/update-live-chart.md +2 -2
  14. package/dist/{c-CRKR5M42.min.js → c-2M2OPWVA.min.js} +37 -37
  15. package/dist/c-3GIPT46Z.min.js +1 -0
  16. package/dist/c-3UXQGCQT.min.js +1 -0
  17. package/dist/{c-MHNU6KYQ.min.js → c-4P2EM44G.min.js} +3 -3
  18. package/dist/c-4RVDKSMQ.min.js +1 -0
  19. package/dist/{c-6MEEA5VY.min.js → c-4YPPVFZH.min.js} +1 -1
  20. package/dist/{c-6MPP6QF5.min.js → c-62JIVHK5.min.js} +1 -1
  21. package/dist/{c-KYRH3XKJ.min.js → c-6QCSRJSC.min.js} +1 -1
  22. package/dist/c-6WJKNYIG.min.js +1 -0
  23. package/dist/c-7BVQDXFU.min.js +1 -0
  24. package/dist/c-7UN2WUMI.min.js +1 -0
  25. package/dist/c-AQUX6L2O.min.js +1 -0
  26. package/dist/c-BR5QDUCR.min.js +1 -0
  27. package/dist/c-C3YQVUB6.min.js +1 -0
  28. package/dist/{c-RQ2XZHWY.min.js → c-COP4OISO.min.js} +1 -1
  29. package/dist/c-ENRZPF5E.min.js +1 -0
  30. package/dist/c-HBLICBM6.min.js +1 -0
  31. package/dist/{c-EQVM754Z.min.js → c-HGWITEJI.min.js} +1 -1
  32. package/dist/{c-3K2FJDLE.min.js → c-I54V24WG.min.js} +1 -1
  33. package/dist/c-IDCFMBA4.min.js +2 -0
  34. package/dist/{c-TPL7X32J.min.js → c-ISHYKYII.min.js} +1 -1
  35. package/dist/c-KSSS3HSA.min.js +1 -0
  36. package/dist/c-LEICSI5V.min.js +1 -0
  37. package/dist/c-LJ4XY3Z3.min.js +1 -0
  38. package/dist/c-MBE6PPHN.min.js +1 -0
  39. package/dist/c-MOK4RWNO.min.js +1 -0
  40. package/dist/c-N2TVSOYL.min.js +2 -0
  41. package/dist/{c-EAAKQIUZ.min.js → c-NHZ2E3CI.min.js} +1 -1
  42. package/dist/{c-MDY3ULP6.min.js → c-OBA7XSLH.min.js} +1 -1
  43. package/dist/c-OIJL2WZH.min.js +1 -0
  44. package/dist/c-ONOWKUUZ.min.js +1 -0
  45. package/dist/{c-CPJR4LHF.min.js → c-OSLNYZ3Q.min.js} +17 -17
  46. package/dist/c-PBFRYNKM.min.js +1 -0
  47. package/dist/c-QUAEYF34.min.js +1 -0
  48. package/dist/c-RDFFLRKC.min.js +1 -0
  49. package/dist/c-SDGGMIYI.min.js +1 -0
  50. package/dist/c-SQQZPFVY.min.js +1 -0
  51. package/dist/c-SU6Z75M2.min.js +1 -0
  52. package/dist/{c-BWM7MU2Y.min.js → c-SX4TPG3Z.min.js} +1 -1
  53. package/dist/{c-DTYG34WG.min.js → c-VGHU2LTF.min.js} +2 -2
  54. package/dist/c-VLWWXOM5.min.js +1 -0
  55. package/dist/c-VZNIIKL6.min.js +1 -0
  56. package/dist/{c-GBO32OML.min.js → c-W5ATXREF.min.js} +1 -1
  57. package/dist/c-WSWMQDFZ.min.js +1 -0
  58. package/dist/{c-3SDC7AQQ.min.js → c-XM76UG3P.min.js} +1 -1
  59. package/dist/c-XORVM6C5.min.js +1 -0
  60. package/dist/{c-MYRI7NF2.min.js → c-XZJWL7UL.min.js} +1 -1
  61. package/dist/c-Y43GTKGR.min.js +1 -0
  62. package/dist/c-YGTMWEEF.min.js +1 -0
  63. package/dist/c-ZFIURPZA.min.js +1 -0
  64. package/dist/c-ZWJDTDEV.min.js +1 -0
  65. package/dist/c-ZYMXDR42.min.js +1 -0
  66. package/dist/components/ai/chartClinic.d.ts +4 -0
  67. package/dist/components/ai/evaluateChart.d.ts +3 -1
  68. package/dist/components/ai/generativeChart.d.ts +13 -0
  69. package/dist/components/ai/renderEvidenceMemoKey.d.ts +9 -0
  70. package/dist/components/ai/reportRenderError.d.ts +2 -0
  71. package/dist/components/charts/physics/eventDropSources.d.ts +1 -1
  72. package/dist/components/evidence/claimReferences.d.ts +9 -0
  73. package/dist/components/realtime/BinAccumulator.d.ts +5 -0
  74. package/dist/components/recipes/atlas/dependencyEvidence.d.ts +5 -0
  75. package/dist/components/recipes/atlas/support.d.ts +5 -0
  76. package/dist/components/server/staticXYAxisTicks.d.ts +1 -1
  77. package/dist/components/stream/MarginalGraphics.d.ts +4 -2
  78. package/dist/components/stream/PipelineStore.d.ts +6 -18
  79. package/dist/components/stream/axisTickUtils.d.ts +1 -1
  80. package/dist/components/stream/countNoun.d.ts +2 -0
  81. package/dist/components/stream/heatmapBandTicks.d.ts +68 -0
  82. package/dist/components/stream/pipelineDomainResolution.d.ts +52 -3
  83. package/dist/components/stream/renderers/canvasRenderHelpers.d.ts +8 -0
  84. package/dist/components/stream/uniqueRegionLabel.d.ts +6 -0
  85. package/dist/components/stream/xyAxisTicks.d.ts +8 -1
  86. package/dist/components/stream/xyFrameAxisTypes.d.ts +4 -2
  87. package/dist/components/stream/xySceneBuilders/types.d.ts +6 -0
  88. package/dist/geo.min.js +152 -152
  89. package/dist/geo.module.min.js +1 -1
  90. package/dist/network.module.min.js +1 -1
  91. package/dist/ordinal.module.min.js +1 -1
  92. package/dist/physics.module.min.js +1 -1
  93. package/dist/physicsWorker.js +1 -1
  94. package/dist/processSankeyLayoutWorker.js +1 -1
  95. package/dist/semiotic-access.module.min.js +2 -2
  96. package/dist/semiotic-ai-core.min.js +5 -5
  97. package/dist/semiotic-ai-core.module.min.js +4 -4
  98. package/dist/semiotic-ai.module.min.js +2 -2
  99. package/dist/semiotic-artifact.min.js +6 -6
  100. package/dist/semiotic-artifact.module.min.js +2 -2
  101. package/dist/semiotic-atlas-core.min.js +1 -1
  102. package/dist/semiotic-atlas-core.module.min.js +1 -1
  103. package/dist/semiotic-atlas-selection.module.min.js +1 -1
  104. package/dist/semiotic-client-cjs-shared.min.js +1023 -1023
  105. package/dist/semiotic-evidence.min.js +4 -4
  106. package/dist/semiotic-evidence.module.min.js +3 -3
  107. package/dist/semiotic-experimental-auxiliary.module.min.js +1 -1
  108. package/dist/semiotic-experimental-node-auxiliary.module.min.js +1 -1
  109. package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
  110. package/dist/semiotic-experimental-vacp.min.js +1 -1
  111. package/dist/semiotic-experimental-vacp.module.min.js +1 -1
  112. package/dist/semiotic-line.module.min.js +1 -1
  113. package/dist/semiotic-realtime-core.module.min.js +1 -1
  114. package/dist/semiotic-recipes-core-cjs-base.min.js +101 -101
  115. package/dist/semiotic-recipes-core.module.min.js +1 -1
  116. package/dist/semiotic-server-edge-node.module.min.js +3 -3
  117. package/dist/semiotic-server-edge.min.js +397 -397
  118. package/dist/semiotic-server-edge.module.min.js +3 -3
  119. package/dist/semiotic-server-node.min.js +397 -397
  120. package/dist/semiotic-utils-core.min.js +11 -11
  121. package/dist/semiotic-utils-core.module.min.js +3 -3
  122. package/dist/semiotic.module.min.js +1 -1
  123. package/dist/server.min.js +397 -397
  124. package/dist/server.module.min.js +3 -3
  125. package/dist/xy.module.min.js +1 -1
  126. package/package.json +2 -2
  127. package/dist/c-3OBJLOXI.min.js +0 -1
  128. package/dist/c-4VFGNUWG.min.js +0 -1
  129. package/dist/c-5BN7GWJH.min.js +0 -1
  130. package/dist/c-65GMYND6.min.js +0 -1
  131. package/dist/c-AGRMJIUH.min.js +0 -1
  132. package/dist/c-BJKGYOPX.min.js +0 -1
  133. package/dist/c-C332PFY6.min.js +0 -1
  134. package/dist/c-DDZ5TZ7P.min.js +0 -1
  135. package/dist/c-F4DZ3NMI.min.js +0 -1
  136. package/dist/c-GZJ2XEQ5.min.js +0 -1
  137. package/dist/c-HFQ3Z65X.min.js +0 -1
  138. package/dist/c-HNW73MXJ.min.js +0 -1
  139. package/dist/c-HWFZB7SD.min.js +0 -1
  140. package/dist/c-IIV4DB7T.min.js +0 -1
  141. package/dist/c-J2QH3PEI.min.js +0 -1
  142. package/dist/c-JZNWRFVJ.min.js +0 -2
  143. package/dist/c-KHLBCSIO.min.js +0 -1
  144. package/dist/c-L7FQHKGH.min.js +0 -1
  145. package/dist/c-LYPOBMKC.min.js +0 -1
  146. package/dist/c-NGMMPKNJ.min.js +0 -1
  147. package/dist/c-NOME4L5M.min.js +0 -1
  148. package/dist/c-OKIJBK5K.min.js +0 -2
  149. package/dist/c-OXV4W7YX.min.js +0 -1
  150. package/dist/c-P73SQZEP.min.js +0 -1
  151. package/dist/c-PD5EZI24.min.js +0 -1
  152. package/dist/c-RAL7HCTV.min.js +0 -1
  153. package/dist/c-S4OGXAVO.min.js +0 -1
  154. package/dist/c-UWE3VZEO.min.js +0 -1
  155. package/dist/c-VP7WX6QI.min.js +0 -1
  156. package/dist/c-VW7ZSLDC.min.js +0 -1
  157. package/dist/c-WDVYLMCM.min.js +0 -1
  158. package/dist/c-XEACLH4B.min.js +0 -1
  159. package/dist/c-YJDGSPNB.min.js +0 -1
  160. package/dist/c-ZYBEKQCT.min.js +0 -1
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function t(e){return"default"in e?e.default:e}async function o(e){try{switch(e){case"world-110m":return{topology:t(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:t(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:t(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:t(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){let i=t instanceof Error?t.message:String(t);throw/Cannot find module|Failed to resolve|world-atlas/i.test(i)?new Error(`resolveReferenceGeography("${e}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:t}):t}}async function r(e){let t=qe.get(e);if(t)return t;let{topology:i,objectName:r}=await o(e);if(!i||!i.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof i} with keys: ${i?Object.keys(i).join(", "):"none"}`);let n=Ze(i,i.objects[r]),a="features"in n?n.features:[n];return qe.set(e,a),a}function n(e){let t=Oe(()=>Array.isArray(e)?e:void 0,[e]),[i,o]=De(null);return Te(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return o(null),r(e).then(e=>{t||o(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),o(null)}else o(null)},[e]),void 0!==t?t:i}function u(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function m(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,u=l>0?(c-n)/l:0;return o+Math.max(0,Math.min(1,u))*(r-o)}function h(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:l}=e,s=Ae(t);return ge(e=>({stroke:r(e),strokeWidth:m(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),l,e=>({value:s(e)}))}function p({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};return Ue("g",m?{children:[Ke("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),Ke("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);return Ue("g",{children:[Ke("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&Ue("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?` ${t}`:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;return Ue("g",{children:[Ke("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&Ue("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?` ${t}`:""]})]},e)}),c&&Ue("g",{transform:"translate(24, 24)",children:[Ke("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Ke("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Ke("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),Ke("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ke("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ke("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function g(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function f(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(o<t&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function v(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function x(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=Ne(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=g(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=g(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));n*a<i.length&&(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=f(i.map(e=>e.x)),s=f(i.map(e=>e.y)),c=i.map(e=>({...e,desiredColumn:v(e.x,l)*Math.max(0,n-1),desiredRow:v(e.y,s)*Math.max(0,a-1)})),u=(n-1)/2,d=(a-1)/2;c.sort((e,t)=>{let i=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-i||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});let m=new Set;for(let e=0;e<a;e+=1)for(let t=0;t<n;t+=1)m.add(e*n+t);let h=[];for(let e of c){let t=-1,i=1/0;for(let o of m){let r=Math.floor(o/n),a=(o%n-e.desiredColumn)**2+(r-e.desiredRow)**2;(a<i||a===i&&o<t)&&(t=o,i=a)}t<0||(m.delete(t),h.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return h.sort((e,t)=>e.index-t.index),h.map(({index:e,...t})=>t)}function S(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 M(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??`area-${t}`;return{...i,id:String(o)}}function C(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function A(e,t,i){return C([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function R(e,t,i){let o=[];for(let r=0;r<6;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return C(o)}function N(e){return e.areas.map((t,i)=>{let o=M(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 L(e){return e.points.map(t=>{let i=Number(S(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(S(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 F(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(S(e,t.columnAccessor)),y:Number(S(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 P({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=se();return Ke("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return Ke("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 H(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function I(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function W(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function O(e,t){let i=W(e);return String(e.id??i.id??i.name??`feature-${t}`)}function D(e,t){if(0===e.length)return null;let i={type:"FeatureCollection",features:e},o=t.bounds(i);return Number.isFinite(o[0][0])&&Number.isFinite(o[0][1])&&Number.isFinite(o[1][0])&&Number.isFinite(o[1][1])?o:null}function T(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function B(e){if(!e)return 0;let t=ct.get(e);if(t)return t;let i=ut;return ut+=1,ct.set(e,i),i}function E(e){return e.map((e,t)=>{if(st.has(e))return{feature:e,index:t,bounds:st.get(e)??null};try{let i=Ve(e);return st.set(e,i),{feature:e,index:t,bounds:i}}catch{return st.set(e,null),{feature:e,index:t,bounds:null}}})}function G(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(i=e[0],(o=t[0][0])<=(r=t[1][0])?i>=o&&i<=r:i>=o||i<=r);var i,o,r}function $(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&G(t,i.bounds))try{if(Je(e,t))return{feature:e,index:o}}catch{}}return null}function Z(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=D(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[Ne(n[0][0],a,Math.max(a,i.width-a)),Ne(n[0][1],a,Math.max(a,i.height-a))],[Ne(n[1][0],a,Math.max(a,i.width-a)),Ne(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=H(o.columns),d=Math.max(2,u?s/u:H(o.cellSize)??10),m=Math.max(100,Math.round(H(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,g=o.gridOrigin?.[1]??0,[f,y]=T(l[0][0],l[1][0],p,d),[b,v]=T(l[0][1],l[1][1],g,d),x=[],S=E(r);for(let e=b;e<=v;e+=1){let i=g+(e+.5)*d;for(let r=f;r<=y;r+=1){let n=p+(r+.5)*d,a=t.invertedPoint(n,i);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;let l=$(S,a);if(!l)continue;let s={...W(l.feature),featureId:O(l.feature,l.index),featureIndex:l.index,gridRow:e,gridColumn:r,longitude:a[0],latitude:a[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(s,x.length)||x.push(s)}}return{dots:x,cellSize:d,features:r}}function U(e){return Math.round(1e4*e)/1e4}function K(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${U(Number(e[0]))},${U(Number(e[1]))}`:"null"}function _(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function V(e){return"number"==typeof e&&Number.isFinite(e)?String(U(e)):null===e?"null":"unavailable"}function J(e){let t=e.scales.projection;return[V(_(t,"scale")),K(_(t,"translate")),K(_(t,"center")),(i=_(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>U(Number(e))).join(","):"unavailable"),V(_(t,"clipAngle")),V(_(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>K(e.scales.projectedPoint(t,i)))].join("|");var i}function q(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??"",B(t.featureFilter),B(t.dotFilter),J(e)].join("::")}function Q(e){let t=lt.get(e.areas);t||(t=new Map,lt.set(e.areas,t));let i=q(e),o=t.get(i);if(o)return o;let r=Z(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 X(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function Y(e,t,i){return X([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function ee(e,t,i){return X(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 te(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=String(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 String(i??"")};return e.map(e=>{let t=a(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}export{a as DEFAULT_HIT_RADIUS,d as geoAreaHitTarget,c as geoHitTarget,b as hitTargetPoint}from"./c-7NMCUG5N.min.js";import{a as ie}from"./c-JZNWRFVJ.min.js";export{b as GeoCustomChart,a as StreamGeoFrame}from"./c-JZNWRFVJ.min.js";import{a as oe,c as re,b as ne}from"./c-F4DZ3NMI.min.js";import{S as ae,Q as le}from"./c-GBO32OML.min.js";import{b as se}from"./c-363Q2L4Z.min.js";import{aX as ce,bH as ue,bB as de,b as me,bz as he,bF as pe,bO as ge,bo as fe,bx as ye,ba as be,a_ as ve,aY as xe,aR as Se,a$ as ke,a as we,bK as Me,bb as Ce,bI as Ae,bh as Re,O as Ne}from"./c-VW7ZSLDC.min.js";export{aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches}from"./c-VW7ZSLDC.min.js";import{f as Le,c as Fe}from"./c-KLJDKRD5.min.js";import{d as Pe,n as je,u as He,r as Ie}from"./c-WPL6PGP3.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-BJKGYOPX.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";import{o as ze}from"./c-TC47SNSI.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";import{a as We}from"./c-GRTKU3C7.min.js";import{useMemo as Oe,useState as De,useEffect as Te,forwardRef as Be,useRef as Ee,useCallback as Ge}from"react";import{scaleSequential as $e}from"d3-scale";import{feature as Ze}from"topojson-client";import{jsxs as Ue,jsx as Ke,Fragment as _e}from"react/jsx-runtime";import{geoBounds as Ve,geoContains as Je}from"d3-geo";var qe=/*#__PURE__*/new Map,Qe=/*#__PURE__*/ce(function(e){let t=ue(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=de(),{areas:o,valueAccessor:r,styleRules:a,colorScheme:l,projection:s="equalEarth",graticule:c,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:g,tileURL:f,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:S,legendInteraction:k,legendPosition:w,margin:M,className:C,selection:A,linkedHover:R,onObservation:N,onClick:L,chartId:F,loading:P,loadingContent:j,emptyContent:H,frameProps:I={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!f,T=n(o),B=Oe(()=>T&&me(T),[T]),E=Oe(()=>"function"==typeof r?r:e=>e?.properties?.[r]??e?.[r],[r]),G=l??i??"blues",$=Oe(()=>{if(!B)return $e(Pe(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)||(o<e&&(e=o),o>t&&(t=o))}let i=Pe(G);return $e(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,G]),Z=Oe(()=>{let e=$.domain();return[e[0]??0,e[1]??1]},[$]),U=he(k,E,Z),{activeSelectionHook:K,hoverSelectionHook:_,customHoverBehavior:V,customClickBehavior:J}=pe({selection:A,linkedHover:R,onObservation:N,onClick:L,chartType:"ChoroplethMap",chartId:F,mobileInteraction:t.mobileInteraction}),q=oe(A),Q=_||U.legendSelectionHook||K,X=Oe(()=>{let e=ge(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?$(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},a,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=ae(e,{stroke:z,strokeWidth:W,opacity:O});return Q?Le(t,Q,q,u):t},[E,$,Q,q,x,z,W,O,a]),Y=Oe(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);return Ue("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ke("div",{style:{fontWeight:600},children:t}),null!=i&&Ke("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):String(o??""))})]});var o},[E]),ee=fe(t),te=Oe(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>$(e),domain:Z,label:"string"==typeof r?r:"value"}},[$,t.showLegend,r,Z]),{legend:re,margin:ne,legendPosition:se,legendMarginReserved:ce}=ye({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:M,defaults:ee,additionalLegend:te,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),we=be(P,t.width,t.height,j,e)||(B?null:be(!0,t.width,t.height,j,e)),Me=we?null:ve(B,t.width,t.height,H,e);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)return Ke(xe,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Ce={projection:s,areas:B,areaStyle:X,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ne,enableHover:t.enableHover,...re&&{legend:re,legendPosition:se},...ce&&{__legendMarginReservedFor:re},legendHoverBehavior:U.onLegendHover,legendClickBehavior:U.onLegendClick,legendHighlightedCategory:U.highlightedCategory,legendIsolatedCategories:"isolate"===k?U.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?Y:Se(v)||Y,...null!=c&&{graticule:c},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=g&&{dragRotate:g},...f&&{tileURL:f},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...le({linkedHover:R,selection:A,onObservation:N,onClick:L,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:J,linkedHoverInClickPredicate:!1}),...S&&S.length>0&&{annotations:S},...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},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...I};return we||Me||Ke(ke,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ke(ie,{...Ce})})},"ChoroplethMap"),Xe={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},Ye=[3,30],et=[1,4],tt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=Ee(null);re(t,{variant:"geo-points",frameRef:i});let o=ue(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:r,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:S,tileCacheSize:k,areas:w,areaStyle:M=Xe,tooltip:C,annotations:A,margin:R,className:N,selection:L,linkedHover:F,onObservation:P,onClick:j,chartId:H,loading:I,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:B,strokeWidth:E,opacity:G}=e,$=c??("sparkline"===o.mode?et:Ye),Z="sparkline"===o.mode?1.5:6,U=f??!!x,K=n(w),_=ne({responsive:e,data:r??we,rawData:r,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:L,linkedHover:F,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:P,onClick:j,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:H,showLegend:o.showLegend,userMargin:R,marginDefaults:fe(o),loading:I,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title}),V=_.data,J=Oe(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=V.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?We(t):void 0},[V,s]),q=Oe(()=>{let e=ge(e=>({fill:u?Ie(e,u,_.colorScale):je,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?He(e,s,$,J):Z}),d,Me(u,s)),t=ae(e,{stroke:B,strokeWidth:E,opacity:G});return _.effectiveSelectionHook?Le(t,_.effectiveSelectionHook,_.resolvedSelection):t},[u,_.colorScale,_.effectiveSelectionHook,_.resolvedSelection,s,$,J,Z,B,E,G,d]),Q=Oe(()=>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}):String(e??""),n="string"==typeof u?u:null,a=n?e?.[n]:null;return Ue("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&Ke("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&Ue("div",{children:[Ue("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&Ue("div",{children:[Ue("span",{style:{opacity:.7},children:[n,": "]}),String(a)]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>Ue("div",{children:[Ue("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(_.earlyReturn)return _.earlyReturn;Ce("ProportionalSymbolMap",V,"xAccessor",a),Ce("ProportionalSymbolMap",V,"yAccessor",l);let X={projection:h,...null!=r&&{points:V},xAccessor:a,yAccessor:l,pointStyle:q,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...K&&{areas:K,areaStyle:M},...null!=p&&{graticule:p},...null!=g&&{fitPadding:g},...U&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...S&&{tileAttribution:S},...k&&{tileCacheSize:k},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:_.margin,enableHover:o.enableHover,tooltipContent:!1===C?()=>null:Se(C)||Q,..._.legendBehaviorProps,...le({linkedHover:F,selection:L,onObservation:P,onClick:j,mobileInteraction:_.mobileInteraction,customHoverBehavior:_.customHoverBehavior,customClickBehavior:_.customClickBehavior,linkedHoverInClickPredicate:!1}),...A&&A.length>0&&{annotations:A},...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},...T};return Ke(ke,{componentName:"ProportionalSymbolMap",width:o.width,height:o.height,children:Ke(ie,{ref:i,...X})})}),"ProportionalSymbolMap"),it="__semiotic_x",ot="__semiotic_y",rt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=ue(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:r,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:s="lat",valueAccessor:c="value",projection:u="equalEarth",graticule:d,fitPadding:m,zoomable:p,zoomExtent:g,onZoom:f,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:S="geo",flowStyle:k="basic",areas:w,areaStyle:M=Xe,edgeColorBy:C,edgeOpacity:A=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:L="round",colorScheme:F,styleRules:P,showParticles:j,particleStyle:H,tooltip:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:B,onClick:E,chartId:G,loading:$,loadingContent:Z,emptyContent:U,frameProps:K={},legendInteraction:_,legendPosition:V,stroke:J,strokeWidth:q,opacity:Q,lineIdAccessor:X}=e,Y=p??!!b,ee=n(w),te=Oe(()=>me(r),[r]),oe=ne({responsive:e,data:o??we,rawData:o,colorBy:C,colorScheme:F,legendInteraction:_,legendPosition:V,frameLegend:K,selection:D,linkedHover:T,fallbackFields:C?["string"==typeof C?C:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:G,showLegend:i.showLegend,userMargin:W,marginDefaults:fe(i),loading:$,loadingContent:Z,emptyContent:U,width:i.width,height:i.height,hasTitle:!!i.title}),se=oe.data,ce=Fe(T),de=Re({name:ce?.name||"hover",fields:ce?.fields||[]}),he=ze(e=>e.pushObservation),pe=Oe(()=>{let e=new Map;for(let t of te)e.set(String(t[a]),t);return e},[te,a]),ge=Ee(null),ye=Ee(pe);ye.current=pe;let be=Ee(l);be.current=l;let ve=Ee(s);ve.current=s;let xe=Ge(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=ye.current,i=t.get(String(e.source)),o=t.get(String(e.target));if(!i||!o)return null;let r="function"==typeof be.current?be.current:e=>e[be.current],n="function"==typeof ve.current?ve.current:e=>e[ve.current];return{...e,coordinates:[{[it]:r(i),[ot]:n(i)},{[it]:r(o),[ot]:n(o)}]}},[]);re(t,{variant:"geo-lines",frameRef:ge,overrides:{push:e=>{let t=xe(e);t&&ge.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=xe(i);e&&t.push(e)}t.length>0&&ge.current?.pushManyLines(t)}}});let Me=Oe(()=>{let e=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]),Ce=Ge(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=String(t[a]),i=Me.get(e);i&&de.onHover(i)}else de.onHover(t)}else de.onHover(null);if(B||he){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),he&&he(o)}else{let e={...t,type:"hover-end"};B&&B(e),he&&he(e)}}},[T,de,a,Me,B,G,he]),Ae=oe.customClickBehavior,Ne=Oe(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof s?s:e=>e[s];return se.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=pe.get(String(i.source)),r=pe.get(String(i.target));return o&&r?{...i,coordinates:[{[it]:e(o),[ot]:t(o)},{[it]:e(r),[ot]:t(r)}]}:null}).filter(Boolean)},[se,pe,l,s]),Pe=Oe(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&it in t?t[it]:e(t)},[l]),He=Oe(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&ot in t?t[ot]:e(t)},[s]),De=Oe(()=>{let e=se.filter(e=>e&&"object"==typeof e).map(e=>Number(e[c]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return We(e)},[se,c]),Te=Oe(()=>h({valueAccessor:c,valueDomain:De,edgeWidthRange:R,resolveStroke:e=>C?Ie(e,C,oe.colorScale):je,edgeOpacity:A,edgeLinecap:L,styleRules:P}),[c,De,R,C,oe.colorScale,A,L,P]),Be=Oe(()=>{let e=ae(Te,{stroke:J,strokeWidth:q,opacity:Q});if(!oe.effectiveSelectionHook)return e;let t={...oe.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Le(e,oe.effectiveSelectionHook,{...oe.resolvedSelection||{},unselectedStyle:t})},[Te,oe.effectiveSelectionHook,oe.resolvedSelection,J,q,Q]),$e=N??("sparkline"===i.mode?1.5:5),Ze=Oe(()=>ae(()=>({fill:"#333",r:$e,fillOpacity:.8}),{stroke:J,strokeWidth:q,opacity:Q}),[$e,J,q,Q]),_e=Oe(()=>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)return Ke("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Ke("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[c];return Ue("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ue("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&Ke("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?Ke("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Ke("div",{style:{fontWeight:600},children:t})}):null},[c,a]);if(oe.earlyReturn)return oe.earlyReturn;let Ve={projection:u,...null!=o&&{lines:Ne},points:te,xAccessor:Pe,yAccessor:He,lineDataAccessor:"coordinates",...null!=X&&{lineIdAccessor:X},lineType:S,flowStyle:k,lineStyle:Be,pointStyle:Ze,...ee&&{areas:ee,areaStyle:M},...null!=d&&{graticule:d},...null!=m&&{fitPadding:m},...Y&&{zoomable:!0},...g&&{zoomExtent:g},...f&&{onZoom:f},...null!=y&&{dragRotate:y},...j&&{showParticles:j},...H&&{particleStyle:H},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:oe.margin,enableHover:i.enableHover,tooltipContent:!1===I?()=>null:Se(I)||_e,...oe.legendBehaviorProps,...le({linkedHover:T,selection:D,onObservation:B,onClick:E,mobileInteraction:oe.mobileInteraction,customHoverBehavior:Ce,customClickBehavior:Ae,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},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...K};return Ke(ke,{componentName:"FlowMap",width:i.width,height:i.height,children:Ke(ie,{ref:ge,...Ve})})}),"FlowMap"),nt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=ue(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:c,strength:u=1,lineMode:d="straight",projection:m="mercator",graticule:h,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:S,tileCacheSize:k,transition:w,colorBy:M,styleRules:C,colorScheme:A,pointRadius:R,tooltip:N,showRings:L,showRingLabels:F,ringStyle:P,showNorth:j,costLabel:H,cartogramLayout:I,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:B,onClick:E,chartId:G,loading:$,loadingContent:Z,emptyContent:U,legendPosition:K,frameProps:_={},stroke:V,strokeWidth:J,opacity:q}=e,Q="sparkline"===i.mode,X=I??(Q?"strip":"radial"),Y=R??(Q?1.5:5),ee=L??!0,te=F??("strip"!==X&&!i.compactMode),oe=j??("strip"!==X&&!Q),se=f??!!x,ce=Oe(()=>me(o),[o]),de=ne({responsive:e,data:ce,rawData:o,colorBy:M,colorScheme:A,legendInteraction:void 0,legendPosition:K,frameLegend:_,selection:D,linkedHover:T,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:fe(i),loading:$,loadingContent:Z,emptyContent:U,width:i.width,height:i.height,hasTitle:!!i.title}),he=Oe(()=>{let e=ge(e=>{let t=e?.[l],i=null!=t&&String(t)===String(s);return{fill:M?Ie(e,M,de.colorScale):je,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*Y:Y}},C,Me(M)),t=ae(e,{stroke:V,strokeWidth:J,opacity:q});return de.effectiveSelectionHook?Le(t,de.effectiveSelectionHook,de.resolvedSelection):t},[M,de.colorScale,de.effectiveSelectionHook,de.resolvedSelection,Y,V,J,q,C,s,l]),pe=Oe(()=>({center:s,centerAccessor:l,costAccessor:c,strength:u,lineMode:d,layout:X}),[s,l,c,u,d,X]),ye=Oe(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=new Map;for(let e of ce)i.set(String(e[l]),e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(String(o.source)),l=i.get(String(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]),be=Oe(()=>e=>{let t=("function"==typeof c?c:e=>e[c])(e),i=e[l]||e.name||e.id||"Point";return Ue("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ke("div",{style:{fontWeight:600},children:i}),null!=t&&Ue("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,l]),ve=Ee(null);re(t,{variant:"geo-points",frameRef:ve});let[xe,we]=De(null),Ae=Ge(()=>{let e=ve.current?.getCartogramLayout?.();e&&we(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"})},[]);Te(()=>{let e=requestAnimationFrame(Ae);return()=>cancelAnimationFrame(e)},[Ae,u,s,i.width,i.height,ce,X]);let Re=Oe(()=>{if(!ee||!xe)return[];let{maxCost:e}=xe;if(e<=0)return[];if(Array.isArray(ee))return ee.filter(t=>t>0&&t<=e);let t="strip"===xe.layout?3:5,i="number"==typeof ee?ee:Math.min(t,Math.max(2,Math.ceil(e/5))),o=e/i,r=[];for(let e=1;e<=i;e++)r.push(Math.round(o*e*10)/10);return r},[ee,xe]),Ne=Oe(()=>{if(!xe)return _.foregroundGraphics||null;let e=Ke(p,{bottomMargin:de.margin.bottom,costLabel:H,layout:xe,ringStyle:P,ringValues:Re,showNorth:oe,showRingLabels:te,showRings:ee}),t=_.foregroundGraphics;return"function"==typeof t?i=>Ue(_e,{children:[e,t(i)]}):Ue(_e,{children:[e,t]})},[xe,Re,ee,te,oe,H,P,de.margin.bottom,_.foregroundGraphics]);if(de.earlyReturn)return de.earlyReturn;Ce("DistanceCartogram",ce,"xAccessor",n),Ce("DistanceCartogram",ce,"yAccessor",a);let Fe={projection:m,...null!=o&&{points:ce},...ye&&{lines:ye,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:he,projectionTransform:pe,...w&&{transition:{duration:w}},...null!=h&&{graticule:h},...null!=g&&{fitPadding:g},...se&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...S&&{tileAttribution:S},...k&&{tileCacheSize:k},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:de.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:Se(N)||be,...de.legendBehaviorProps,...le({linkedHover:T,selection:D,onObservation:B,onClick:E,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.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},...O&&{className:O},...null!=e.animate&&{animate:e.animate},..._,foregroundGraphics:Ne};return Ke(ke,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:Ke(ie,{ref:ve,...Fe})})}),"DistanceCartogram"),at=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?N(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=F(r.map(e=>e.datum),t),a=o?r:L({...e,points:r.map(e=>e.datum)}),l=n??x(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=f(l.map(e=>e.row)),c=f(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),m=Math.max(0,t.layoutPadding??8),h=Math.max(1,e.dimensions.width-2*m),p=Math.max(1,e.dimensions.height-2*m),g=h/d,y=p/u,b=g*d,k=y*u,w=(e.dimensions.width-b)/2,M=(e.dimensions.height-k)/2,C=Ne(t.cellPadding??.12,0,.8),j=Math.max(1,.5*Math.min(g,y)*(1-C)),H=t.sizeAccessor?l.map(e=>Number(S(e.datum,t.sizeAccessor))):[],I=t.sizeDomain??f(H),z=t.sizeRange??[.36,1],W=Ne(Math.min(z[0],z[1]),.05,1),O=Ne(Math.max(z[0],z[1]),W,1),D=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=String(S(r,t.idAccessor,["id","key","name"])??`grid-${o}`),a=String(S(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,d=S(r,t.categoryAccessor),m=null==d?void 0:String(d),h=S(r,t.fillAccessor),p=null!=h?String(h):m?e.resolveColor(m):e.theme.categorical[0]??"#4f86c6",f=t.sizeAccessor?Number(S(r,t.sizeAccessor)):NaN,b=t.sizeAccessor&&Number.isFinite(f)?Math.sqrt(Ne(v(f,I),0,1)):1,x=j*(W+b*(O-W)),k="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:m,row:i.row,column:i.column,x:w+(i.column-c[0]+.5)*g,y:M+(i.row-s[0]+.5)*y,radius:x,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...k}}}),T=t.shape??"circle";return{nodes:D.map(e=>"circle"===T?{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"===T?R(e.x,e.y,e.radius):A(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"===T?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:Ke(P,{marks:D,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??Ne(.23*Math.min(g,y),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}}},lt=/*#__PURE__*/new WeakMap,st=/*#__PURE__*/new WeakMap,ct=/*#__PURE__*/new WeakMap,ut=1,dt=e=>{let t=Q(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,H(i.dotRadius)??t.cellSize*Ne(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=I(l,i.categoryAccessor),m=I(l,i.fillAccessor),h={fill:null!=m?String(m):null!=d?e.resolveColor(String(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?ee(c,u,r):Y(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?Ke("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?Ke("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"},O(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{Qe as ChoroplethMap,nt as DistanceCartogram,rt as FlowMap,tt as ProportionalSymbolMap,dt as geographicDotGridLayout,at as geographicGridLayout,x as gridifyGeographicPoints,te as mergeData,r as resolveReferenceGeography,Z as sampleGeographicDotGrid};
2
+ function t(e){return"default"in e?e.default:e}async function o(e){try{switch(e){case"world-110m":return{topology:t(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:t(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:t(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:t(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){let i=t instanceof Error?t.message:String(t);throw/Cannot find module|Failed to resolve|world-atlas/i.test(i)?new Error(`resolveReferenceGeography("${e}"): Install the optional peer dependency \`world-atlas\` (\`npm install world-atlas\`) to use built-in reference geographies, or pass GeoJSON Feature[] to \`areas\`.`,{cause:t}):t}}async function r(e){let t=Qe.get(e);if(t)return t;let{topology:i,objectName:r}=await o(e);if(!i||!i.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof i} with keys: ${i?Object.keys(i).join(", "):"none"}`);let n=Ue(i,i.objects[r]),a="features"in n?n.features:[n];return Qe.set(e,a),a}function n(e){let t=Oe(()=>Array.isArray(e)?e:void 0,[e]),[i,o]=De(null);return Te(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return o(null),r(e).then(e=>{t||o(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),o(null)}else o(null)},[e]),void 0!==t?t:i}function u(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function m(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,u=l>0?(c-n)/l:0;return o+Math.max(0,Math.min(1,u))*(r-o)}function h(e){let{valueAccessor:t,valueDomain:i,edgeWidthRange:o,resolveStroke:r,edgeOpacity:n,edgeLinecap:a,styleRules:l}=e,s=Ae(t);return ge(e=>({stroke:r(e),strokeWidth:m(e[t],i,o),strokeLinecap:a,opacity:n,fillOpacity:0}),l,e=>({value:s(e)}))}function p({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};return Ze("g",m?{children:[Ve("line",{x1:i,y1:o,x2:i+n,y2:o,stroke:h.stroke,strokeWidth:h.strokeWidth,strokeLinecap:"round",opacity:.85}),Ve("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);return Ze("g",{children:[Ve("line",{x1:l,y1:o-2.5,x2:l,y2:o+2.5,stroke:h.stroke,strokeWidth:.9,opacity:.65}),u&&Ze("text",{x:l,y:o+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?` ${t}`:""]})]},a)})]}:{children:[s.map(e=>{let a=e/r*n;return Ze("g",{children:[Ve("circle",{cx:i,cy:o,r:a,fill:"none",stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray,opacity:.5}),u&&Ze("text",{x:i+a+3,y:o-2,fontSize:h.labelSize,fill:h.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?` ${t}`:""]})]},e)}),c&&Ze("g",{transform:"translate(24, 24)",children:[Ve("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),Ve("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),Ve("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),Ve("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ve("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),Ve("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function g(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function f(e){let t=1/0,i=-1/0;for(let o of e)Number.isFinite(o)&&(o<t&&(t=o),o>i&&(i=o));return t===1/0?[0,0]:[t,i]}function v(e,t){let i=t[1]-t[0];return 0===i?.5:(e-t[0])/i}function x(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=Ne(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=g(t.columns)??Math.max(1,Math.ceil(Math.sqrt(i.length*r/o))),a=g(t.rows)??Math.max(1,Math.ceil(i.length/(n*o)));n*a<i.length&&(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=f(i.map(e=>e.x)),s=f(i.map(e=>e.y)),c=i.map(e=>({...e,desiredColumn:v(e.x,l)*Math.max(0,n-1),desiredRow:v(e.y,s)*Math.max(0,a-1)})),u=(n-1)/2,d=(a-1)/2;c.sort((e,t)=>{let i=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-i||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});let m=new Set;for(let e=0;e<a;e+=1)for(let t=0;t<n;t+=1)m.add(e*n+t);let h=[];for(let e of c){let t=-1,i=1/0;for(let o of m){let r=Math.floor(o/n),a=(o%n-e.desiredColumn)**2+(r-e.desiredRow)**2;(a<i||a===i&&o<t)&&(t=o,i=a)}t<0||(m.delete(t),h.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/n),column:t%n,index:e.index}))}return h.sort((e,t)=>e.index-t.index),h.map(({index:e,...t})=>t)}function S(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 M(e,t){let i=e.properties&&"object"==typeof e.properties?e.properties:{},o=e.id??i.id??i.name??`area-${t}`;return{...i,id:String(o)}}function C(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function A(e,t,i){return C([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function R(e,t,i){let o=[];for(let r=0;r<6;r+=1){let n=-Math.PI/2+r*(Math.PI/3);o.push([e+Math.cos(n)*i,t+Math.sin(n)*i])}return C(o)}function N(e){return e.areas.map((t,i)=>{let o=M(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 F(e){return e.points.map(t=>{let i=Number(S(t,e.config.longitudeAccessor,["lon","longitude"])),o=Number(S(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 P(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;let i=e.map(e=>({datum:e,x:Number(S(e,t.columnAccessor)),y:Number(S(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 L({marks:e,color:t,fontSize:i,fontFamily:o,fontWeight:r}){let n=se();return Ve("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{let a=!n.isActive||n.predicate(e.datum);return Ve("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 I(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function H(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function W(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function O(e,t){let i=W(e);return String(e.id??i.id??i.name??`feature-${t}`)}function D(e,t){if(0===e.length)return null;let i={type:"FeatureCollection",features:e},o=t.bounds(i);return Number.isFinite(o[0][0])&&Number.isFinite(o[0][1])&&Number.isFinite(o[1][0])&&Number.isFinite(o[1][1])?o:null}function T(e,t,i,o){return[Math.ceil((e-i)/o-.5),Math.floor((t-i)/o-.5)]}function B(e){if(!e)return 0;let t=ct.get(e);if(t)return t;let i=ut;return ut+=1,ct.set(e,i),i}function E(e){return e.map((e,t)=>{if(st.has(e))return{feature:e,index:t,bounds:st.get(e)??null};try{let i=Ke(e);return st.set(e,i),{feature:e,index:t,bounds:i}}catch{return st.set(e,null),{feature:e,index:t,bounds:null}}})}function $(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(i=e[0],(o=t[0][0])<=(r=t[1][0])?i>=o&&i<=r:i>=o||i<=r);var i,o,r}function G(e,t){for(let i of e){let{feature:e,index:o}=i;if(e.geometry&&$(t,i.bounds))try{if(qe(e,t))return{feature:e,index:o}}catch{}}return null}function U(e,t,i,o={}){let r=e.filter((e,t)=>e.geometry&&(!o.featureFilter||o.featureFilter(e,t))),n=D(r,t.geoPath);if(!n)return{dots:[],cellSize:10,features:r};let a=Math.max(0,o.layoutPadding??0),l=[[Ne(n[0][0],a,Math.max(a,i.width-a)),Ne(n[0][1],a,Math.max(a,i.height-a))],[Ne(n[1][0],a,Math.max(a,i.width-a)),Ne(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=I(o.columns),d=Math.max(2,u?s/u:I(o.cellSize)??10),m=Math.max(100,Math.round(I(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,g=o.gridOrigin?.[1]??0,[f,y]=T(l[0][0],l[1][0],p,d),[b,v]=T(l[0][1],l[1][1],g,d),x=[],S=E(r);for(let e=b;e<=v;e+=1){let i=g+(e+.5)*d;for(let r=f;r<=y;r+=1){let n=p+(r+.5)*d,a=t.invertedPoint(n,i);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;let l=G(S,a);if(!l)continue;let s={...W(l.feature),featureId:O(l.feature,l.index),featureIndex:l.index,gridRow:e,gridColumn:r,longitude:a[0],latitude:a[1],dotIndex:x.length};o.dotFilter&&!o.dotFilter(s,x.length)||x.push(s)}}return{dots:x,cellSize:d,features:r}}function Z(e){return Math.round(1e4*e)/1e4}function V(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${Z(Number(e[0]))},${Z(Number(e[1]))}`:"null"}function _(e,t){let i=e[t];return"function"==typeof i?i.call(e):void 0}function K(e){return"number"==typeof e&&Number.isFinite(e)?String(Z(e)):null===e?"null":"unavailable"}function q(e){let t=e.scales.projection;return[K(_(t,"scale")),V(_(t,"translate")),V(_(t,"center")),(i=_(t,"rotate"),Array.isArray(i)&&i.every(Number.isFinite)?i.map(e=>Z(Number(e))).join(","):"unavailable"),K(_(t,"clipAngle")),K(_(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,i])=>V(e.scales.projectedPoint(t,i)))].join("|");var i}function Q(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??"",B(t.featureFilter),B(t.dotFilter),q(e)].join("::")}function X(e){let t=lt.get(e.areas);t||(t=new Map,lt.set(e.areas,t));let i=Q(e),o=t.get(i);if(o)return o;let r=U(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 J(e){return`${e.map(([e,t],i)=>`${0===i?"M":"L"}${e},${t}`).join("")}Z`}function Y(e,t,i){return J([[e-i,t-i],[e+i,t-i],[e+i,t+i],[e-i,t+i]])}function ee(e,t,i){return J(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 te(e,t,i){let{featureKey:o,dataKey:r}=i,n=new Map;for(let e of t){let t=String(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 String(i??"")};return e.map(e=>{let t=a(e),i=n.get(t);return i?{...e,properties:{...e.properties,...i}}:e})}export{a as DEFAULT_HIT_RADIUS,d as geoAreaHitTarget,c as geoHitTarget,b as hitTargetPoint}from"./c-7NMCUG5N.min.js";import{a as ie}from"./c-IDCFMBA4.min.js";export{b as GeoCustomChart,a as StreamGeoFrame}from"./c-IDCFMBA4.min.js";import{a as oe,c as re,b as ne}from"./c-C3YQVUB6.min.js";import{S as ae,Q as le}from"./c-W5ATXREF.min.js";import{b as se}from"./c-363Q2L4Z.min.js";import{aX as ce,bH as ue,bB as de,b as me,bz as he,bF as pe,bO as ge,bo as fe,bx as ye,ba as be,a_ as ve,aY as xe,aR as Se,a$ as ke,a as we,bK as Me,bb as Ce,bI as Ae,bh as Re,O as Ne}from"./c-SU6Z75M2.min.js";export{aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches}from"./c-SU6Z75M2.min.js";import{f as Fe,c as Pe}from"./c-KLJDKRD5.min.js";import{d as Le,n as Ie,u as je,r as He}from"./c-WPL6PGP3.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-VZNIIKL6.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";import{o as ze}from"./c-TC47SNSI.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";import{a as We}from"./c-GRTKU3C7.min.js";import{useMemo as Oe,useState as De,useEffect as Te,forwardRef as Be,useRef as Ee,useCallback as $e}from"react";import{scaleSequential as Ge}from"d3-scale";import{feature as Ue}from"topojson-client";import{jsxs as Ze,jsx as Ve,Fragment as _e}from"react/jsx-runtime";import{geoBounds as Ke,geoContains as qe}from"d3-geo";var Qe=/*#__PURE__*/new Map,Xe=/*#__PURE__*/ce(function(e){let t=ue(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=de(),{areas:o,valueAccessor:r,styleRules:a,colorScheme:l,projection:s="equalEarth",graticule:c,fitPadding:d,zoomable:m,zoomExtent:h,onZoom:p,dragRotate:g,tileURL:f,tileAttribution:y,tileCacheSize:b,tooltip:v,areaOpacity:x=1,annotations:S,legendInteraction:k,legendPosition:w,margin:M,className:C,selection:A,linkedHover:R,onObservation:N,onClick:F,chartId:P,loading:L,loadingContent:I,emptyContent:j,frameProps:H={},stroke:z,strokeWidth:W,opacity:O}=e,D=m??!!f,T=n(o),B=Oe(()=>T&&me(T),[T]),E=Oe(()=>"function"==typeof r?r:e=>e?.properties?.[r]??e?.[r],[r]),$=l??i??"blues",G=Oe(()=>{if(!B)return Ge(Le(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)||(o<e&&(e=o),o>t&&(t=o))}let i=Le($);return Ge(i).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[B,E,$]),U=Oe(()=>{let e=G.domain();return[e[0]??0,e[1]??1]},[G]),Z=he(k,E,U),{activeSelectionHook:V,hoverSelectionHook:_,customHoverBehavior:K,customClickBehavior:q}=pe({selection:A,linkedHover:R,onObservation:N,onClick:F,chartType:"ChoroplethMap",chartId:P,mobileInteraction:t.mobileInteraction}),Q=oe(A),X=_||Z.legendSelectionHook||V,J=Oe(()=>{let e=ge(e=>{let t=E(e);return{fill:null!=t&&isFinite(t)?G(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:x}},a,e=>({value:E(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),t=ae(e,{stroke:z,strokeWidth:W,opacity:O});return X?Fe(t,X,Q,u):t},[E,G,X,Q,x,z,W,O,a]),Y=Oe(()=>e=>{let t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",i=E(e);return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ve("div",{style:{fontWeight:600},children:t}),null!=i&&Ve("div",{style:{opacity:.7},children:(o=i,"number"==typeof o&&isFinite(o)?Number.isInteger(o)?o.toLocaleString():o.toLocaleString(void 0,{maximumFractionDigits:2}):String(o??""))})]});var o},[E]),ee=fe(t),te=Oe(()=>!1===t.showLegend?void 0:{gradient:{colorFn:e=>G(e),domain:U,label:"string"==typeof r?r:"value"}},[G,t.showLegend,r,U]),{legend:re,margin:ne,legendPosition:se,legendMarginReserved:ce}=ye({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:M,defaults:ee,additionalLegend:te,chartWidth:t.width,chartHeight:t.height,legendLayout:H.legendLayout,frameLegend:H,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),we=be(L,t.width,t.height,I,e)||(B?null:be(!0,t.width,t.height,I,e)),Me=we?null:ve(B,t.width,t.height,j,e);if(Array.isArray(B)&&B.length>0){let e=B[0];if(!e||"object"!=typeof e||!e.geometry)return Ve(xe,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}let Ce={projection:s,areas:B,areaStyle:J,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ne,enableHover:t.enableHover,...re&&{legend:re,legendPosition:se},...ce&&{__legendMarginReservedFor:re},legendHoverBehavior:Z.onLegendHover,legendClickBehavior:Z.onLegendClick,legendHighlightedCategory:Z.highlightedCategory,legendIsolatedCategories:"isolate"===k?Z.isolatedCategories:void 0,tooltipContent:!1===v?()=>null:!0===v?Y:Se(v)||Y,...null!=c&&{graticule:c},...null!=d&&{fitPadding:d},...D&&{zoomable:!0},...h&&{zoomExtent:h},...p&&{onZoom:p},...null!=g&&{dragRotate:g},...f&&{tileURL:f},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},...le({linkedHover:R,selection:A,onObservation:N,onClick:F,mobileInteraction:t.mobileInteraction,customHoverBehavior:K,customClickBehavior:q,linkedHoverInClickPredicate:!1}),...S&&S.length>0&&{annotations:S},...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},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...H};return we||Me||Ve(ke,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:Ve(ie,{...Ce})})},"ChoroplethMap"),Je={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},Ye=[3,30],et=[1,4],tt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=Ee(null);re(t,{variant:"geo-points",frameRef:i});let o=ue(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:r,xAccessor:a="lon",yAccessor:l="lat",sizeBy:s,sizeRange:c,colorBy:u,styleRules:d,colorScheme:m,projection:h="equalEarth",graticule:p,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:S,tileCacheSize:k,areas:w,areaStyle:M=Je,tooltip:C,annotations:A,margin:R,className:N,selection:F,linkedHover:P,onObservation:L,onClick:I,chartId:j,loading:H,loadingContent:z,emptyContent:W,legendInteraction:O,legendPosition:D,frameProps:T={},stroke:B,strokeWidth:E,opacity:$}=e,G=c??("sparkline"===o.mode?et:Ye),U="sparkline"===o.mode?1.5:6,Z=f??!!x,V=n(w),_=ne({responsive:e,data:r??we,rawData:r,colorBy:u,colorScheme:m,legendInteraction:O,legendPosition:D,frameLegend:T,selection:F,linkedHover:P,fallbackFields:u?["string"==typeof u?u:""]:[],unwrapData:!1,onObservation:L,onClick:I,mobileInteraction:o.mobileInteraction,mobileSemantics:o.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:j,showLegend:o.showLegend,userMargin:R,marginDefaults:fe(o),loading:H,loadingContent:z,emptyContent:W,width:o.width,height:o.height,hasTitle:!!o.title}),K=_.data,q=Oe(()=>{if(!s)return;let e="function"==typeof s?s:e=>e?.[s],t=K.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?We(t):void 0},[K,s]),Q=Oe(()=>{let e=ge(e=>({fill:u?He(e,u,_.colorScale):Ie,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?je(e,s,G,q):U}),d,Me(u,s)),t=ae(e,{stroke:B,strokeWidth:E,opacity:$});return _.effectiveSelectionHook?Fe(t,_.effectiveSelectionHook,_.resolvedSelection):t},[u,_.colorScale,_.effectiveSelectionHook,_.resolvedSelection,s,G,q,U,B,E,$,d]),X=Oe(()=>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}):String(e??""),n="string"==typeof u?u:null,a=n?e?.[n]:null;return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&Ve("div",{style:{fontWeight:600,marginBottom:2},children:t}),i&&null!=o&&Ze("div",{children:[Ze("span",{style:{opacity:.7},children:[i,": "]}),r(o)]}),n&&null!=a&&Ze("div",{children:[Ze("span",{style:{opacity:.7},children:[n,": "]}),String(a)]}),!t&&!i&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>Ze("div",{children:[Ze("span",{style:{opacity:.7},children:[e,": "]}),r(t)]},e))]})},[s,u]);if(_.earlyReturn)return _.earlyReturn;Ce("ProportionalSymbolMap",K,"xAccessor",a),Ce("ProportionalSymbolMap",K,"yAccessor",l);let J={projection:h,...null!=r&&{points:K},xAccessor:a,yAccessor:l,pointStyle:Q,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...V&&{areas:V,areaStyle:M},...null!=p&&{graticule:p},...null!=g&&{fitPadding:g},...Z&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...S&&{tileAttribution:S},...k&&{tileCacheSize:k},size:[o.width,o.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:_.margin,enableHover:o.enableHover,tooltipContent:!1===C?()=>null:Se(C)||X,..._.legendBehaviorProps,...le({linkedHover:P,selection:F,onObservation:L,onClick:I,mobileInteraction:_.mobileInteraction,customHoverBehavior:_.customHoverBehavior,customClickBehavior:_.customClickBehavior,linkedHoverInClickPredicate:!1}),...A&&A.length>0&&{annotations:A},...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},...T};return Ve(ke,{componentName:"ProportionalSymbolMap",width:o.width,height:o.height,children:Ve(ie,{ref:i,...J})})}),"ProportionalSymbolMap"),it="__semiotic_x",ot="__semiotic_y",rt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=ue(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:r,nodeIdAccessor:a="id",xAccessor:l="lon",yAccessor:s="lat",valueAccessor:c="value",projection:u="equalEarth",graticule:d,fitPadding:m,zoomable:p,zoomExtent:g,onZoom:f,dragRotate:y,tileURL:b,tileAttribution:v,tileCacheSize:x,lineType:S="geo",flowStyle:k="basic",areas:w,areaStyle:M=Je,edgeColorBy:C,edgeOpacity:A=.6,edgeWidthRange:R=[1,8],pointRadius:N,edgeLinecap:F="round",colorScheme:P,styleRules:L,showParticles:I,particleStyle:j,tooltip:H,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:B,onClick:E,chartId:$,loading:G,loadingContent:U,emptyContent:Z,frameProps:V={},legendInteraction:_,legendPosition:K,stroke:q,strokeWidth:Q,opacity:X,lineIdAccessor:J}=e,Y=p??!!b,ee=n(w),te=Oe(()=>me(r),[r]),oe=ne({responsive:e,data:o??we,rawData:o,colorBy:C,colorScheme:P,legendInteraction:_,legendPosition:K,frameLegend:V,selection:D,linkedHover:T,fallbackFields:C?["string"==typeof C?C:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"FlowMap",chartId:$,showLegend:i.showLegend,userMargin:W,marginDefaults:fe(i),loading:G,loadingContent:U,emptyContent:Z,width:i.width,height:i.height,hasTitle:!!i.title}),se=oe.data,ce=Pe(T),de=Re({name:ce?.name||"hover",fields:ce?.fields||[]}),he=ze(e=>e.pushObservation),pe=Oe(()=>{let e=new Map;for(let t of te)e.set(String(t[a]),t);return e},[te,a]),ge=Ee(null),ye=Ee(pe);ye.current=pe;let be=Ee(l);be.current=l;let ve=Ee(s);ve.current=s;let xe=$e(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;let t=ye.current,i=t.get(String(e.source)),o=t.get(String(e.target));if(!i||!o)return null;let r="function"==typeof be.current?be.current:e=>e[be.current],n="function"==typeof ve.current?ve.current:e=>e[ve.current];return{...e,coordinates:[{[it]:r(i),[ot]:n(i)},{[it]:r(o),[ot]:n(o)}]}},[]);re(t,{variant:"geo-lines",frameRef:ge,overrides:{push:e=>{let t=xe(e);t&&ge.current?.pushLine(t)},pushMany:e=>{let t=[];for(let i of e){let e=xe(i);e&&t.push(e)}t.length>0&&ge.current?.pushManyLines(t)}}});let Me=Oe(()=>{let e=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]),Ce=$e(e=>{if(T)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){let e=String(t[a]),i=Me.get(e);i&&de.onHover(i)}else de.onHover(t)}else de.onHover(null);if(B||he){let t={timestamp:Date.now(),chartType:"FlowMap",chartId:$};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),he&&he(o)}else{let e={...t,type:"hover-end"};B&&B(e),he&&he(e)}}},[T,de,a,Me,B,$,he]),Ae=oe.customClickBehavior,Ne=Oe(()=>{let e="function"==typeof l?l:e=>e[l],t="function"==typeof s?s:e=>e[s];return se.map(i=>{if(!i||"object"!=typeof i||null==i.source||null==i.target)return null;let o=pe.get(String(i.source)),r=pe.get(String(i.target));return o&&r?{...i,coordinates:[{[it]:e(o),[ot]:t(o)},{[it]:e(r),[ot]:t(r)}]}:null}).filter(Boolean)},[se,pe,l,s]),Le=Oe(()=>{let e="function"==typeof l?l:e=>e[l];return t=>null!=t&&"object"==typeof t&&it in t?t[it]:e(t)},[l]),je=Oe(()=>{let e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&ot in t?t[ot]:e(t)},[s]),De=Oe(()=>{let e=se.filter(e=>e&&"object"==typeof e).map(e=>Number(e[c]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return We(e)},[se,c]),Te=Oe(()=>h({valueAccessor:c,valueDomain:De,edgeWidthRange:R,resolveStroke:e=>C?He(e,C,oe.colorScale):Ie,edgeOpacity:A,edgeLinecap:F,styleRules:L}),[c,De,R,C,oe.colorScale,A,F,L]),Be=Oe(()=>{let e=ae(Te,{stroke:q,strokeWidth:Q,opacity:X});if(!oe.effectiveSelectionHook)return e;let t={...oe.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Fe(e,oe.effectiveSelectionHook,{...oe.resolvedSelection||{},unselectedStyle:t})},[Te,oe.effectiveSelectionHook,oe.resolvedSelection,q,Q,X]),Ge=N??("sparkline"===i.mode?1.5:5),Ue=Oe(()=>ae(()=>({fill:"#333",r:Ge,fillOpacity:.8}),{stroke:q,strokeWidth:Q,opacity:X}),[Ge,q,Q,X]),_e=Oe(()=>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)return Ve("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Ve("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){let t=e[c];return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ze("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&Ve("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}let t=e?.name||e?.label||e?.[a];return null!=t?Ve("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:Ve("div",{style:{fontWeight:600},children:t})}):null},[c,a]);if(oe.earlyReturn)return oe.earlyReturn;let Ke={projection:u,...null!=o&&{lines:Ne},points:te,xAccessor:Le,yAccessor:je,lineDataAccessor:"coordinates",...null!=J&&{lineIdAccessor:J},lineType:S,flowStyle:k,lineStyle:Be,pointStyle:Ue,...ee&&{areas:ee,areaStyle:M},...null!=d&&{graticule:d},...null!=m&&{fitPadding:m},...Y&&{zoomable:!0},...g&&{zoomExtent:g},...f&&{onZoom:f},...null!=y&&{dragRotate:y},...I&&{showParticles:I},...j&&{particleStyle:j},...b&&{tileURL:b},...v&&{tileAttribution:v},...x&&{tileCacheSize:x},size:[i.width,i.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:oe.margin,enableHover:i.enableHover,tooltipContent:!1===H?()=>null:Se(H)||_e,...oe.legendBehaviorProps,...le({linkedHover:T,selection:D,onObservation:B,onClick:E,mobileInteraction:oe.mobileInteraction,customHoverBehavior:Ce,customClickBehavior:Ae,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},...O&&{className:O},...null!=e.animate&&{animate:e.animate},...V};return Ve(ke,{componentName:"FlowMap",width:i.width,height:i.height,children:Ve(ie,{ref:ge,...Ke})})}),"FlowMap"),nt=/*#__PURE__*/ce(/*#__PURE__*/Be(function(e,t){let i=ue(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:c,strength:u=1,lineMode:d="straight",projection:m="mercator",graticule:h,fitPadding:g,zoomable:f,zoomExtent:y,onZoom:b,dragRotate:v,tileURL:x,tileAttribution:S,tileCacheSize:k,transition:w,colorBy:M,styleRules:C,colorScheme:A,pointRadius:R,tooltip:N,showRings:F,showRingLabels:P,ringStyle:L,showNorth:I,costLabel:j,cartogramLayout:H,annotations:z,margin:W,className:O,selection:D,linkedHover:T,onObservation:B,onClick:E,chartId:$,loading:G,loadingContent:U,emptyContent:Z,legendPosition:V,frameProps:_={},stroke:K,strokeWidth:q,opacity:Q}=e,X="sparkline"===i.mode,J=H??(X?"strip":"radial"),Y=R??(X?1.5:5),ee=F??!0,te=P??("strip"!==J&&!i.compactMode),oe=I??("strip"!==J&&!X),se=f??!!x,ce=Oe(()=>me(o),[o]),de=ne({responsive:e,data:ce,rawData:o,colorBy:M,colorScheme:A,legendInteraction:void 0,legendPosition:V,frameLegend:_,selection:D,linkedHover:T,fallbackFields:M?["string"==typeof M?M:""]:[],unwrapData:!1,onObservation:B,onClick:E,mobileInteraction:i.mobileInteraction,mobileSemantics:i.mobileSemantics,chartType:"DistanceCartogram",chartId:$,showLegend:i.showLegend,userMargin:W,marginDefaults:fe(i),loading:G,loadingContent:U,emptyContent:Z,width:i.width,height:i.height,hasTitle:!!i.title}),he=Oe(()=>{let e=ge(e=>{let t=e?.[l],i=null!=t&&String(t)===String(s);return{fill:M?He(e,M,de.colorScale):Ie,fillOpacity:i?1:.8,stroke:i?"var(--semiotic-text, #222)":"#fff",strokeWidth:i?1.25:1,r:i?1.35*Y:Y}},C,Me(M)),t=ae(e,{stroke:K,strokeWidth:q,opacity:Q});return de.effectiveSelectionHook?Fe(t,de.effectiveSelectionHook,de.resolvedSelection):t},[M,de.colorScale,de.effectiveSelectionHook,de.resolvedSelection,Y,K,q,Q,C,s,l]),pe=Oe(()=>({center:s,centerAccessor:l,costAccessor:c,strength:u,lineMode:d,layout:J}),[s,l,c,u,d,J]),ye=Oe(()=>{if(!r)return;let e="function"==typeof n?n:e=>e[n],t="function"==typeof a?a:e=>e[a],i=new Map;for(let e of ce)i.set(String(e[l]),e);return r.map(o=>{if(o.coordinates)return o;let r=i.get(String(o.source)),l=i.get(String(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]),be=Oe(()=>e=>{let t=("function"==typeof c?c:e=>e[c])(e),i=e[l]||e.name||e.id||"Point";return Ze("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[Ve("div",{style:{fontWeight:600},children:i}),null!=t&&Ze("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,l]),ve=Ee(null);re(t,{variant:"geo-points",frameRef:ve});let[xe,we]=De(null),Ae=$e(()=>{let e=ve.current?.getCartogramLayout?.();e&&we(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"})},[]);Te(()=>{let e=requestAnimationFrame(Ae);return()=>cancelAnimationFrame(e)},[Ae,u,s,i.width,i.height,ce,J]);let Re=Oe(()=>{if(!ee||!xe)return[];let{maxCost:e}=xe;if(e<=0)return[];if(Array.isArray(ee))return ee.filter(t=>t>0&&t<=e);let t="strip"===xe.layout?3:5,i="number"==typeof ee?ee:Math.min(t,Math.max(2,Math.ceil(e/5))),o=e/i,r=[];for(let e=1;e<=i;e++)r.push(Math.round(o*e*10)/10);return r},[ee,xe]),Ne=Oe(()=>{if(!xe)return _.foregroundGraphics||null;let e=Ve(p,{bottomMargin:de.margin.bottom,costLabel:j,layout:xe,ringStyle:L,ringValues:Re,showNorth:oe,showRingLabels:te,showRings:ee}),t=_.foregroundGraphics;return"function"==typeof t?i=>Ze(_e,{children:[e,t(i)]}):Ze(_e,{children:[e,t]})},[xe,Re,ee,te,oe,j,L,de.margin.bottom,_.foregroundGraphics]);if(de.earlyReturn)return de.earlyReturn;Ce("DistanceCartogram",ce,"xAccessor",n),Ce("DistanceCartogram",ce,"yAccessor",a);let Pe={projection:m,...null!=o&&{points:ce},...ye&&{lines:ye,lineDataAccessor:"coordinates"},xAccessor:n,yAccessor:a,pointIdAccessor:l,pointStyle:he,projectionTransform:pe,...w&&{transition:{duration:w}},...null!=h&&{graticule:h},...null!=g&&{fitPadding:g},...se&&{zoomable:!0},...y&&{zoomExtent:y},...b&&{onZoom:b},...null!=v&&{dragRotate:v},...x&&{tileURL:x},...S&&{tileAttribution:S},...k&&{tileCacheSize:k},size:[i.width,i.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:de.margin,enableHover:i.enableHover,tooltipContent:!1===N?()=>null:Se(N)||be,...de.legendBehaviorProps,...le({linkedHover:T,selection:D,onObservation:B,onClick:E,mobileInteraction:de.mobileInteraction,customHoverBehavior:de.customHoverBehavior,customClickBehavior:de.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},...O&&{className:O},...null!=e.animate&&{animate:e.animate},..._,foregroundGraphics:Ne};return Ve(ke,{componentName:"DistanceCartogram",width:i.width,height:i.height,children:Ve(ie,{ref:ve,...Pe})})}),"DistanceCartogram"),at=e=>{let t=e.config,i=t.source??"auto",o="areas"===i||"auto"===i&&e.areas.length>0,r=(o?N(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,i)=>!t.filter||t.filter(e.datum,i)),n=P(r.map(e=>e.datum),t),a=o?r:F({...e,points:r.map(e=>e.datum)}),l=n??x(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=f(l.map(e=>e.row)),c=f(l.map(e=>e.column)),u=Math.max(1,Math.round(s[1]-s[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),m=Math.max(0,t.layoutPadding??8),h=Math.max(1,e.dimensions.width-2*m),p=Math.max(1,e.dimensions.height-2*m),g=h/d,y=p/u,b=g*d,k=y*u,w=(e.dimensions.width-b)/2,M=(e.dimensions.height-k)/2,C=Ne(t.cellPadding??.12,0,.8),I=Math.max(1,.5*Math.min(g,y)*(1-C)),j=t.sizeAccessor?l.map(e=>Number(S(e.datum,t.sizeAccessor))):[],H=t.sizeDomain??f(j),z=t.sizeRange??[.36,1],W=Ne(Math.min(z[0],z[1]),.05,1),O=Ne(Math.max(z[0],z[1]),W,1),D=l.map((i,o)=>{let r={...i.datum,gridRow:i.row,gridColumn:i.column},n=String(S(r,t.idAccessor,["id","key","name"])??`grid-${o}`),a=String(S(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,d=S(r,t.categoryAccessor),m=null==d?void 0:String(d),h=S(r,t.fillAccessor),p=null!=h?String(h):m?e.resolveColor(m):e.theme.categorical[0]??"#4f86c6",f=t.sizeAccessor?Number(S(r,t.sizeAccessor)):NaN,b=t.sizeAccessor&&Number.isFinite(f)?Math.sqrt(Ne(v(f,H),0,1)):1,x=I*(W+b*(O-W)),k="function"==typeof t.markStyle?t.markStyle(r,o):t.markStyle;return{datum:r,id:n,label:u,category:m,row:i.row,column:i.column,x:w+(i.column-c[0]+.5)*g,y:M+(i.row-s[0]+.5)*y,radius:x,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...k}}}),T=t.shape??"circle";return{nodes:D.map(e=>"circle"===T?{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"===T?R(e.x,e.y,e.radius):A(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"===T?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:Ve(L,{marks:D,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??Ne(.23*Math.min(g,y),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}}},lt=/*#__PURE__*/new WeakMap,st=/*#__PURE__*/new WeakMap,ct=/*#__PURE__*/new WeakMap,ut=1,dt=e=>{let t=X(e),i=e.config,o=i.shape??"circle",r=Math.max(.5,I(i.dotRadius)??t.cellSize*Ne(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=H(l,i.categoryAccessor),m=H(l,i.fillAccessor),h={fill:null!=m?String(m):null!=d?e.resolveColor(String(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?ee(c,u,r):Y(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?Ve("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,o)=>{let r=e.scales.geoPath(t);return r?Ve("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"},O(t,o)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};export{Xe as ChoroplethMap,nt as DistanceCartogram,rt as FlowMap,tt as ProportionalSymbolMap,dt as geographicDotGridLayout,at as geographicGridLayout,x as gridifyGeographicPoints,te as mergeData,r as resolveReferenceGeography,U as sampleGeographicDotGrid};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{a as registerBuiltInNetworkLayouts}from"./c-RTU5425Z.min.js";export{a as useForceLayout}from"./c-MYRI7NF2.min.js";export{a as DEFAULT_HIT_RADIUS,g as networkEdgeHitTarget,f as networkHitTarget}from"./c-7NMCUG5N.min.js";export{b as ChordDiagram,n as CirclePack,a as ForceDirectedGraph,p as NetworkCustomChart,o as OrbitDiagram,k as ProcessSankey,c as SankeyDiagram,l as TreeDiagram,m as Treemap,f as diagnoseProcessSankeyLayout,h as diagnoseProcessSankeyProps,g as explainProcessSankeyLayout,e as formatProcessSankeyIssue,i as inventoryAtTime,j as toProcessSankeyTime,d as validateProcessSankey}from"./c-4VFGNUWG.min.js";export{d as createNetworkPerspectiveFrame,m as projectNetworkScene,a as resolveNetworkPerspective}from"./c-MI27MBCH.min.js";export{b as StreamNetworkFrame,a as useNetworkPerspective}from"./c-XEACLH4B.min.js";export{f as preloadNetworkPerspectiveExtras}from"./c-PTFHNN34.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches,bg as useSelectionActions}from"./c-VW7ZSLDC.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-BJKGYOPX.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";export{NetworkPerspectiveBillboard,NetworkPerspectiveGround}from"./semiotic-network-placement.module.min.js";
2
+ export{a as registerBuiltInNetworkLayouts}from"./c-RTU5425Z.min.js";export{a as useForceLayout}from"./c-XZJWL7UL.min.js";export{a as DEFAULT_HIT_RADIUS,g as networkEdgeHitTarget,f as networkHitTarget}from"./c-7NMCUG5N.min.js";export{b as ChordDiagram,n as CirclePack,a as ForceDirectedGraph,p as NetworkCustomChart,o as OrbitDiagram,k as ProcessSankey,c as SankeyDiagram,l as TreeDiagram,m as Treemap,f as diagnoseProcessSankeyLayout,h as diagnoseProcessSankeyProps,g as explainProcessSankeyLayout,e as formatProcessSankeyIssue,i as inventoryAtTime,j as toProcessSankeyTime,d as validateProcessSankey}from"./c-OIJL2WZH.min.js";export{d as createNetworkPerspectiveFrame,m as projectNetworkScene,a as resolveNetworkPerspective}from"./c-MI27MBCH.min.js";export{b as StreamNetworkFrame,a as useNetworkPerspective}from"./c-WSWMQDFZ.min.js";export{f as preloadNetworkPerspectiveExtras}from"./c-PTFHNN34.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches,bg as useSelectionActions}from"./c-SU6Z75M2.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-VZNIIKL6.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";export{NetworkPerspectiveBillboard,NetworkPerspectiveGround}from"./semiotic-network-placement.module.min.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- export{a as DEFAULT_HIT_RADIUS,b as hitTargetPoint,e as hitTargetRect}from"./c-7NMCUG5N.min.js";export{b as BarChart,f as BoxPlot,l as DonutChart,j as DotPlot,o as FunnelChart,m as GaugeChart,n as GroupedBarChart,g as Histogram,d as LikertChart,r as OrdinalCustomChart,k as PieChart,p as RadarChart,i as RidgelinePlot,c as StackedBarChart,a as StreamOrdinalFrame,e as SwarmPlot,q as SwimlaneChart,h as ViolinPlot}from"./c-P73SQZEP.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{C as AnnotationLabel,aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,B as estimateLabelWidth,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bP as makeStyleRuleStyleFn,bJ as makeXYRuleContext,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches}from"./c-VW7ZSLDC.min.js";export{h as createHatchPattern,j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-BJKGYOPX.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";
2
+ export{a as DEFAULT_HIT_RADIUS,b as hitTargetPoint,e as hitTargetRect}from"./c-7NMCUG5N.min.js";export{b as BarChart,f as BoxPlot,l as DonutChart,j as DotPlot,o as FunnelChart,m as GaugeChart,n as GroupedBarChart,g as Histogram,d as LikertChart,r as OrdinalCustomChart,k as PieChart,p as RadarChart,i as RidgelinePlot,c as StackedBarChart,a as StreamOrdinalFrame,e as SwarmPlot,q as SwimlaneChart,h as ViolinPlot}from"./c-BR5QDUCR.min.js";export{b as useCustomLayoutSelection}from"./c-363Q2L4Z.min.js";export{C as AnnotationLabel,aL as MultiLineTooltip,aK as Tooltip,bO as composeStyleRules,B as estimateLabelWidth,bK as makeNodeRuleContext,bI as makeRuleValueResolver,bP as makeStyleRuleStyleFn,bJ as makeXYRuleContext,bL as matchesThreshold,bl as resolveResponsiveRules,bN as resolveStyleRules,bk as responsiveRuleMatches,bM as ruleMatches}from"./c-SU6Z75M2.min.js";export{h as createHatchPattern,j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-VZNIIKL6.min.js";export{e as glyphExtent,d as glyphPlacement}from"./c-ELGOCAEY.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- function m(e,t,i){let[n]=ot(()=>We(t,i.seed,{durationMs:i.durationMs,maxEvents:i.maxEvents})),[a,r]=ot(n.isComplete),s=lt({target:e,options:i});s.current={target:e,options:i};let o=lt(void 0),l=lt(!1),u=ut(e=>{let{target:t,options:i}=s.current,a=t.current;if(!a||l.current)return 0;l.current=!0;try{let t=n.advance(e,i);return t.length&&a.pushMany(t.map(i.mapArrival)),n.isComplete()&&r(!0),t.length}finally{l.current=!1}},[n]),c=ut((e,t)=>{let i=o.current;o.current=e.elapsedSeconds,!l.current&&void 0!==i&&!s.current.options.manual&&u(1e3*Math.max(0,e.elapsedSeconds-i)),s.current.options.onTick?.(e,t)},[u]);return{frameProps:{continuous:!i.paused&&!i.manual&&!a,onTick:c},advance:u,getTime:n.getTime,getEmittedCount:n.getEmittedCount,isComplete:n.isComplete,snapshot:n.snapshot,restore:e=>{n.restore(e),o.current=void 0,r(n.isComplete())}}}function ee(e){let{data:t,encoding:i,defaults:n={},scales:a}=e,r=it({data:t,encoding:i}),s=[],o=new Map,l=[],u=[],c=new Map;return r.rows.forEach((e,t)=>{let{id:r,datum:d}=e,p=Math.max(0,nt(i.appearance?.size,d,t)??n.size??6),h=nt(i.appearance?.shape,d,t)??n.shape??{type:"circle",radius:p},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,y=a?.x?a.x(m):m,g=a?.y?a.y(f):f,b=nt(i.appearance?.color,d,t)??n.color,v=nt(i.appearance?.opacity,d,t)??n.opacity,w=nt(i.appearance?.stroke,d,t)??n.stroke,x=nt(i.appearance?.strokeWidth,d,t)??n.strokeWidth,S=nt(i.time?.spawnAt,d,t)??e.time.arrival,I=e.kinematics.velocityX,A=e.kinematics.velocityY,P=nt(i.dynamics?.mass,d,t)??n.mass??1,C=nt(i.dynamics?.friction,d,t),M=nt(i.dynamics?.restitution,d,t),E=nt(i.dynamics?.bodyCollisions,d,t),R={id:r,x:y,y:g,mass:P,shape:{...h},datum:d,...null!=S&&{spawnAt:S},...null!=I&&{vx:I},...null!=A&&{vy:A},...null!=C&&{friction:C},...null!=M&&{restitution:M},...null!=E&&{bodyCollisions:E}},T={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=w&&{stroke:w},...null!=x&&{strokeWidth:x}},j={id:r,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:w,strokeWidth:x},placement:{x:y,y:g,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:S,spawnAt:S,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:A,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:E,friction:C,mass:P,restitution:M},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:R};s.push(j),o.set(r,j),l.push(R),c.set(r,T),u.push({id:r,bodyId:r,label:e.accessible.label,description:e.accessible.description,datum:d,x:y,y:g,group:e.accessible.group})}),{rows:s,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function te(e){return t=>{let i=ee({data:t.data,encoding:e.encoding,defaults:e.defaults,scales:t.scales}),n=e.extend?.(t,i)??{};return{...n,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...n.semanticItems??[]]}}}function ie(e,t){let{layout:i,positiveProperties:n,negativeProperties:a,viability:r,outcome:s}=t,o=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(i),l=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),u=e;for(let e of l){let t=e.gateId?o.get(e.gateId):void 0,l=e.effects??[],c={...qe(e,l),appliedAt:e.time},d=Je(u,c);if(d!==u){u=d;for(let i of l){let r={event:e,gate:t,negativeProperties:a,positiveProperties:n,project:u};i.when&&!i.when(r)||(u=Ve(u,i,r))}u={...u,viability:r?.(u,{negativeProperties:a,positiveProperties:n})??_e(u,n,a)},e.final&&(u={...u,outcome:e.outcome??s?.(u,{layout:i,negativeProperties:a,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function ne(e){return e.projects.map(t=>ie(t,e))}function ae(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),i=new Map(t.map(e=>[e.bodyId,e])),n=new Map,a=new Map,r=e.assignmentForce??.45,s=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let r=t.find(e=>!a.has(e.id));if(!r)return null;let s={resourceId:r.id,resourceBodyId:r.bodyId,caseBodyId:e,assignedAt:c};return n.set(e,s),a.set(r.id,s),d+=1,s},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),a.delete(t.resourceId),d+=1,!0)},getAssignment:e=>n.get(e),tick:e=>{c=Math.max(c,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),a.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-a.size,assigned:a.size,assignments:Array.from(n.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=a.get(t.id),n=i?u.get(i.caseBodyId):void 0,o=n?n.x+(l.x??0):t.home.x,c=n?n.y+(l.y??0):t.home.y,d=i?r:s;return{x:(o-e.body.x)*d,y:(c-e.body.y)*d}}let c=n.get(e.body.id);if(!c||o<=0)return null;let d=u.get(c.resourceBodyId);return d?{x:(d.x-e.body.x)*o,y:(d.y-e.body.y)*o}:null}}}function re(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):ze(e.datum,t.deadlineAccessor)??ze(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function se(e){function t(t){n.set(t.bodyId,t),r+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:a,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,a=0,r=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let i=n.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(t({...i,state:"protected",protectedAt:a}),0))},complete:i,getCase:e=>n.get(e),tick:r=>{a=Math.max(a,r.elapsed);for(let s of r.controls.readBodies()){if(!Xe(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=re(s,e);t({bodyId:s.id,openedAt:a,deadlineAt:a+i,state:"waiting"})}let o=n.get(s.id);o&&null==o.completedAt&&(e.completionRegionId&&r.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===o.state&&a>=o.deadlineAt&&t({...o,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(n.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:a,metricRevision:r}}}}function oe(e){let t=new Set,i=0,n=0,a=0,r=!1;return{id:e.id??`dependency-gate:${e.regionId}`,continuous:!0,tick:s=>{i=Math.max(i,s.elapsed);let o=r;var l;l=i,r=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=s.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let i of u)!s.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!Xe(i,e.bodyFilter)||!r&&!t.has(i.id)&&(t.add(i.id),a+=1,e.onHeld?.(i));if(r&&!o){for(let i of t){let t=c.get(i);t&&(s.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),a+=1}for(let e of t)c.has(e)||(t.delete(e),a+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:t.size,released:n,simulatedAt:i,metricRevision:a}),bodyForce:i=>{if(r||!t.has(i.body.id))return null;let n=i.regions?.find(t=>t.id===e.regionId)?.shape;if(!n||"aabb"!==n.type)return{x:.8*-i.body.vx,y:.8*-i.body.vy};let a=e.holdForce??.4;return{x:(n.x-i.body.x)*a-.45*i.body.vx,y:(n.y-i.body.y)*a-.45*i.body.vy}}}}function le(e,t,i={}){let n=i.random??Math.random,a=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],r=rt(i.along??.5,.05,.95),s=i.jitterX??0,o=i.padY??20,l=a.x0+(a.x1-a.x0)*r+(2*n()-1)*s,u=Math.min(1,a.width/2),c=rt(l,a.x0+u,a.x1-u),d=e.boundaryY(c,"top")+o,p=e.boundaryY(c,"bottom")-o;return{x:c,y:p<=d?e.midY:d+n()*Math.max(1,p-d)}}function ue(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function ce(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function de(e,t,i,n,a){return"function"==typeof n?n(e,t,i):function(e,t){let i=e;for(let e of t.split(".")){if(null==i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}(e,n??a)}function pe(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function he(e,t,i,n){let a=e.flatMap((e,a)=>{let r=ce(de(e,a,t,i,"time")),s=ce(de(e,a,t,n,"value"));return null==r||null==s?[]:[{time:pe(r),value:s,index:a}]});a.sort((e,t)=>e.time-t.time||e.index-t.index);let r=[];for(let e of a){let t=r[r.length-1];t?.time===e.time?t.value=e.value:r.push({time:e.time,value:e.value})}return r}function me(e,t,i,n){if(!e.length)return null;let a=e[0],r=e[e.length-1];if(t<a.time)return"clamp"===n?a.value:null;if(t>r.time)return"clamp"===n?r.value:null;let s=function(e,t){let i=0,n=e.length;for(;i<n;){let a=i+n>>>1;e[a].time<t?i=a+1:n=a}return i}(e,t),o=e[s];if(o?.time===t)return o.value;let l=e[Math.max(0,s-1)];if("step"===i||!o||o.time===l.time)return l.value;let u=(t-l.time)/(o.time-l.time);return l.value+(o.value-l.value)*u}function fe(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),a=Math.ceil(i);if(n===a)return e[n];let r=i-n;return e[n]+(e[a]-e[n])*r}function ye(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ct).map(e=>{let t=ce(e);if(null==t||t<0||t>1)throw new RangeError(`physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received ${String(e)}`);return pe(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),a=function(e){if(Array.isArray(e)){if(e.length>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(ce).filter(e=>null!=e).map(pe))).sort((e,t)=>e-t)}let t=e,i=ce(t.start),n=ce(t.end),a=ce(t.step);if(null==i||null==n||null==a||a<=0||n<i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let r=Math.floor((n-i)/a)+1;if(r>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let s=[],o=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;e<r;e+=1){let t=i+e*a;if(t>n+o)break;s.push(pe(Math.min(t,n)))}if((!s.length||Math.abs(s[s.length-1]-n)>o)&&s.push(pe(n)),s.length>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(s)).sort((e,t)=>e-t)}(e.sampleAt),r=e.runs.map(t=>he(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:a.map(e=>{let a=r.map(n=>me(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),s={};for(let e of n)s[e]=a.length?fe(a,e):null;return{time:e,count:a.length,min:a.length?a[0]:null,max:a.length?a[a.length-1]:null,median:a.length?fe(a,.5):null,quantiles:s}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function ge(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function be(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=ce(t);if(null==i||i<0||i>1)throw new RangeError(`comparePhysicsTrace quantile selectors must be from 0 to 1; received ${String(t)}`);let n=pe(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw new Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function ve(e,t,i){return e<t?"below":e>i?"above":"inside"}function we(e,t){let i=Math.max(0,t.time-e.time);if(!(i>0)||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let n=e.value-e.lower,a=t.value-t.lower,r=e.value-e.upper,s=t.value-t.upper,o=[0,1];for(let[e,t]of[[n,a],[r,s]])(e<0&&t>0||e>0&&t<0)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let n=0;n<o.length-1;n+=1){let a=o[n],r=o[n+1];if(!(r>a))continue;let s=(a+r)/2,d=(r-a)*i,p=ve(e.value+(t.value-e.value)*s,e.lower+(t.lower-e.lower)*s,e.upper+(t.upper-e.upper)*s);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:i}}function xe(e,t,i={}){let n=i.interpolation??t.interpolation,a=i.outsideDomain??t.outsideDomain,r=he(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),s=i.lower??ge(t,"lower"),o=i.upper??ge(t,"upper"),l=t.points.map(e=>{let t=me(r,e.time,n,a),i=be(e,s),l=be(e,o);if(null!=i&&null!=l&&i>l)throw new RangeError(`comparePhysicsTrace lower band exceeds upper band at time ${e.time}`);return{time:e.time,value:t,lower:i,upper:l,status:null==t||null==i||null==l?"unobserved":ve(t,i,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,f=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?c+=1:"above"===e.status&&(d+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),i=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),i>m&&(m=i,f=e.time)}let y=0,g=0,b=0,v=0;for(let e=0;e<l.length-1;e+=1){let t=l[e],i=l[e+1],a=Math.max(0,i.time-t.time);if(a>0){if("linear"===n){let e=we(t,i);y+=e.below,g+=e.inside,b+=e.above,v+=e.observed;continue}"unobserved"!==t.status&&(v+=a,"below"===t.status?y+=a:"above"===t.status?b+=a:g+=a)}}let w=l[0]?.time,x=l[l.length-1]?.time,S=null==w||null==x?0:Math.max(0,x-w),I=u+c+d;return{points:l,sampleCount:l.length,observedSamples:I,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:S,observedDuration:v,unobservedDuration:Math.max(0,S-v),belowDuration:y,insideDuration:g,aboveDuration:b,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:f}}function Se(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Ie(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ae(e){return!!Ie(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&Ie(e.visitsByStage)&&Ie(e.firstEnteredAt)&&Ie(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function Pe(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function Ce(e){let t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,Pe(e)]))}}function Me(e,t,i={}){if("region-enter"!==t.type)return e;let n=function(e,t){let i=t.stageId?.(e);if(i)return i;let n=e.region.metadata;if(n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,"stageId")){let e=n.stageId;if("string"==typeof e)return e}return e.region.id}(t,i),a=e.stages.findIndex(e=>e.id===n);if(a<0)return e;let r=i.entityId?.(t)??t.bodyId;if(!r)return e;let s=Se(e.entities,r),o=Ae(s)?s:Pe(r),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(n),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=Se(o.visitsByStage,n),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:n,furthestStageId:a>o.furthestStageIndex?n:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,a),visitedStageIds:u?[...o.visitedStageIds,n]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[n]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[n]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[n]:d},regressionCount:l>=0&&a<l?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(r)?e.bodyIds:[...e.bodyIds,r],entities:{...e.entities,[r]:m}}}function Ee(e){let t=e.bodyIds.map(t=>{let i=Se(e.entities,t);return Ae(i)?i:Pe(t)}),i=t.length,n=i;return e.stages.map((e,a)=>{let r=t.filter(e=>e.furthestStageIndex>=a).length,s=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,i)=>{let n=Se(i.visitsByStage,e.id);return t+("number"==typeof n&&Number.isFinite(n)?n:0)},0),l={id:e.id,label:e.label??e.id,reached:r,entered:s,total:i,conversion:i>0?r/i:0,fromPrevious:n>0?r/n:0,dropoff:Math.max(0,n-r),visits:o,repeatVisits:Math.max(0,o-s)};return n=r,l})}function Re(e){let[t,i]=e.size,n=e.flow??"down",a=null==(x=e.padding)?{top:24,right:24,bottom:24,left:24}:"number"==typeof x?{top:x,right:x,bottom:x,left:x}:{top:x.top??0,right:x.right??0,bottom:x.bottom??0,left:x.left??0},r=Math.max(.05,Math.min(1,e.channelRatio??1)),s={x:a.left,y:a.top,width:Math.max(1,t-a.left-a.right),height:Math.max(1,i-a.top-a.bottom)},o="down"===n?s.height:s.width,l=o*Math.max(0,e.chargeExtent??.12),u=o*Math.max(0,e.projectionExtent??0),c=o*Math.max(0,e.destinationExtent??.55),d=Math.max(0,o-l-c-u),p=function(e){if("number"==typeof e){let t=Math.max(1,Math.round(e));return Array.from({length:t},(e,t)=>({id:`bin-${t}`,label:String(t)}))}return 0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??String(t)}))}(e.destinations),h=("down"===n?s.width:s.height)/p.length,m="down"===n?(e,t)=>({x:s.x,y:s.y+e,width:s.width,height:t}):(e,t)=>({x:s.x+e,y:s.y,width:t,height:s.height}),f=m(0,l),y=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),w=p.map((e,t)=>{let i=t*h,a=h*r,o=(h-a)/2;if("down"===n){let n=s.x+i+o;return{id:e.id,label:e.label,order:t,x:n,y:b.y,width:a,height:b.height,centerX:s.x+(t+.5)*h,centerY:b.y+b.height/2}}let l=s.y+i+o;return{id:e.id,label:e.label,order:t,x:b.x,y:l,width:b.width,height:a,centerX:b.x+b.width/2,centerY:s.y+(t+.5)*h}});var x;return{width:t,height:i,flow:n,charge:f,apparatus:y,destinations:w,projection:v}}function Te(e,t){return e.destinations.find(e=>e.id===t)}function je(e,t,i){let{charge:n,flow:a}=e,r=Math.max(1,i),s=(t%r+.5)/r;return"down"===a?{x:n.x+n.width*s,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*s}}function Be(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:a,flow:r,width:s,height:o}=e,l=[];if(a.length>0){let t=a[0];if("down"===r){let r=t.y+t.height;l.push({id:`${n}-floor`,shape:{type:"segment",x1:e.charge.x,y1:r,x2:e.charge.x+e.charge.width,y2:r,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerX-(a[e].centerX-a[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:s,y1:t.y,x2:s,y2:r,thickness:i}})}}else{let r=t.x+t.width;l.push({id:`${n}-floor`,shape:{type:"segment",x1:r,y1:e.charge.y,x2:r,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerY-(a[e].centerY-a[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:s,x2:r,y2:s,thickness:i}})}}}return!1!==t.walls&&l.push({id:`${n}-wall-left`,shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:i}},{id:`${n}-wall-right`,shape:{type:"segment",x1:s-1,y1:0,x2:s-1,y2:o,thickness:i}}),l}function ke(e,t={}){let i=t.charge??"bodies",n=t.apparatus??"the apparatus",a=t.destination??"destinations",r=e.destinations.length,s="down"===e.flow?"downward":"left to right";return`${i} enter at the ${"down"===e.flow?"top":"left"}, travel ${s} through ${n}, and come to rest in ${r} ${a}: ${e.destinations.map(e=>e.label).join(", ")}.`}function Fe(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function Le(e,t,i,n){let a="function"==typeof e?e(t,i):e;return Number.isFinite(a)?Number(a):n}function De(e,t,i){return Fe(e[t])??i}function $e(e,t){return"number"==typeof e?e:e?.[t]??0}function Oe(e){let{band:t,idPrefix:i,plot:n,projection:a}=e,{includeBoundaryWalls:r=!0,includeInteriorWalls:s=!0,wallThickness:o=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let a=e.scale(n);Number.isFinite(a)&&(i.add(Number(a)),i.add(Number(a)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(l.length<2)return[];let u=r?0:1,c=r?l.length-1:l.length-2,d=[];for(let e=u;e<=c;e+=1){if(!s&&e>0&&e<l.length-1)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===a?{type:"aabb",x:t,y:n.y+n.height/2,width:o,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:o}})}return d}function Ne(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:a,xBands:r,yBands:s}=e,o=[];if(!1!==n&&o.push(...He(t,{idPrefix:i,...n})),a){let{idPrefix:e,yTop:n,yBottom:r,...s}=a;o.push(...Qe({...s,idPrefix:e??`${i}-xbin`,yTop:n??t.y,yBottom:r??t.y+t.height}))}return r&&o.push(...Oe({band:r,idPrefix:r.idPrefix??`${i}-xband`,plot:t,projection:"x"})),s&&o.push(...Oe({band:s,idPrefix:s.idPrefix??`${i}-yband`,plot:t,projection:"y"})),o}function Ye(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:a=3,idPrefix:r="galton-peg",yStart:s=t.y+.18*t.height,yEnd:o=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:c=.04}=e,d=Math.max(0,Math.floor(i)),p=Math.max(1,Math.floor(n));if(0===d)return[];let h=d<=1?0:(o-s)/(d-1),m=t.width/p,f=[];for(let e=0;e<d;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;n<p;n+=1){let o=t.x+m*(n+.5)+i;o<t.x+a||o>t.x+t.width-a||f.push({id:`${r}-${e}-${n}`,shape:{type:"aabb",x:o,y:s+e*h,width:2*a,height:2*a},restitution:u,friction:c})}}return f}function Ge(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:a,mass:r,vx:s,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=tt(u),h=$e(c,"x"),m=$e(c,"y");return e.map((e,u)=>{let c=Le(t.x,e,u,De(e,"x",0)),f=Le(t.y,e,u,De(e,"y",0)),y=Le(n,e,u,5),g="function"==typeof a?a(e,u):a??{type:"circle",radius:y};return{id:`${i}-${e.index??u}`,x:c+(p()-.5)*h,y:f+(p()-.5)*m,vx:Le(s,e,u,0),vy:Le(o,e,u,0),mass:Le(r,e,u,1),spawnAt:Le(l,e,u,void 0),shape:g,datum:d?d(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...i}=e;return i})}function Ke(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:a=1,restitution:r=.05,friction:s=.2,...o}=t,l=Ze(e,o),u=n?l.filter(e=>e.height>0).map(e=>({id:`${i}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+a/2,width:e.width,height:a},restitution:r,friction:s})):[];return{columns:l,colliders:u}}function Ue(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:a=0,rebase:r=!0,sort:s=!0}=t,o=e.map((e,t)=>({spawn:e,time:function(e,t,i){return Fe("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=o.length?st(o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:a+(r?t-l:t)})).sort((e,t)=>s?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:a,timeAccessor:"spawnAt",timeScale:n}}}import{R as We,af as qe,ag as Je,ae as Ve,ab as _e,e as ze,f as Xe,l as He,m as Qe,j as Ze,s as et}from"./c-OKIJBK5K.min.js";export{g as BuiltInPhysicsEngineAdapter,aU as ChainReactionChart,Y as CollisionSwarmChart,aO as CrucibleChart,av as DEFAULT_CRUCIBLE_HEIGHT,ax as DEFAULT_CRUCIBLE_OUTLETS,aw as DEFAULT_CRUCIBLE_SIZE,au as DEFAULT_CRUCIBLE_WIDTH,U as EventDropChart,P as GaltonBoardChart,ah as GauntletChart,ai as GuantletChart,aj as PacketFlowChart,ak as PhysicalFlowChart,X as PhysicsCustomChart,W as PhysicsPileChart,n as PhysicsPipelineStore,d as PhysicsSVGOverlay,i as PhysicsSedimentAccumulator,am as ProcessFlowChart,r as StreamPhysicsFrame,V as UnitPileChart,Q as WATERMARK_LONG_TAIL_JITTER,K as absorbRegion,z as aggregateRegionCounts,ap as applyCrucibleEvent,a as bodiesToAnnotationAnchors,M as bodyGroupSpec,x as buildCollisionSwarmPhysics,at as buildCrucibleEvidence,aF as buildCrucibleInitialSpawns,az as buildCrucibleLayout,aB as buildCruciblePhysicsConfig,aN as buildCrucibleProductEvents,aq as buildCrucibleProjection,aG as buildCrucibleStateSpawns,aH as buildCrucibleTerminalSpawns,u as buildEventDropPhysics,t as buildGaltonBoardPhysics,y as buildPhysicalFlowPhysics,b as buildPhysicsAnnotationContext,w as buildPhysicsPile,O as buildProcessFlowPhysics,aT as calculateBlockerAmplification,I as capacitatedRegion,F as chargeGateRegion,an as cloneCrucibleState,aM as compileCruciblePlan,aP as compileDependencyMachine,p as composePhysicsControllers,o as createCapacityQueueController,h as createDefaultPhysicsEngineAdapter,ay as createInitialCrucibleState,aR as createLogicalJoin,q as createPortalController,R as createSyntheticEmitter,aE as crucibleBondId,aA as crucibleBoundaryColliders,aC as crucibleComponentBodyId,aD as crucibleProductBodyId,ar as crucibleProjectionRows,aI as crucibleSemanticKey,as as evaluateCrucibleConservation,k as evaluatePhysicsBodyBudget,L as forceFieldRegion,B as groupCompletionRows,E as membraneRegion,c as normalizePhysicsAnnotations,Z as physicsProcessBoundaryColliders,aa as physicsProcessGroupSemanticItems,$ as physicsProcessRegionSemanticItem,_ as physicsProcessStageSemanticItems,ac as planGauntletPropertyWork,J as portalRegion,H as pressureFieldRegion,al as processChrome,N as processLaneWalls,C as processStageLayout,D as processStageRegions,v as readEventDropOccupancy,A as regionCountsToProjectionRows,T as registerPhysicsLivePrograms,ad as replaceGauntletNegative,aL as replayCruciblePlan,aS as replayStateTransitions,ao as resolveCrucibleSelector,aK as resolveCrucibleSnapshotAt,aJ as resolveCrucibleTime,aQ as routeDependencyTracks,G as routeSurfaceRegion,j as sedimentHeightfield,S as syntheticArrivals}from"./c-OKIJBK5K.min.js";export{p as EventDropLedger}from"./c-EQVM754Z.min.js";import{a as tt}from"./c-RI7UJTEY.min.js";import{f as it,e as nt,O as rt}from"./c-VW7ZSLDC.min.js";export{aL as MultiLineTooltip,aK as Tooltip,f as compileMotionEncoding,bO as composeStyleRules,j as deriveMotionVector,bI as makeRuleValueResolver,bL as matchesThreshold,h as opacityFromAge,e as resolveMotionAccessor,g as resolveMotionAge,i as resolveMotionVector,bN as resolveStyleRules,bM as ruleMatches}from"./c-VW7ZSLDC.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-BJKGYOPX.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";import{b as st}from"./c-GRTKU3C7.min.js";import{useState as ot,useRef as lt,useCallback as ut}from"react";var ct=[.1,.5,.9],dt=1e6,pt=et;export{Ue as arrivalReplay,Ne as collidersFromScales,xe as comparePhysicsTrace,ee as compilePhysicsEncoding,oe as createDependencyGateController,te as createPhysicsEncodingLayout,Ce as createProcessJourneyLedger,se as createServiceLevelController,ae as createServiceResourcePoolController,pt as default,ke as describePhysicsStageGeography,Ye as galtonPegs,je as physicsChargePoint,Te as physicsDestination,ye as physicsReferenceEnvelope,Be as physicsStageColliders,Re as physicsStageGeography,Ee as processJourneyRows,ue as processVolumePolygons,ie as resolveGauntletTerminalState,ne as resolveGauntletTerminalStates,Ke as sedimentBake,Ge as spawnFromTokens,le as stageTargetInVolume,Me as updateProcessJourney,m as useEmitters};
2
+ function m(e,t,i){let[n]=ot(()=>qe(t,i.seed,{durationMs:i.durationMs,maxEvents:i.maxEvents})),[a,r]=ot(n.isComplete),s=lt({target:e,options:i});s.current={target:e,options:i};let o=lt(void 0),l=lt(!1),u=ut(e=>{let{target:t,options:i}=s.current,a=t.current;if(!a||l.current)return 0;l.current=!0;try{let t=n.advance(e,i);return t.length&&a.pushMany(t.map(i.mapArrival)),n.isComplete()&&r(!0),t.length}finally{l.current=!1}},[n]),c=ut((e,t)=>{let i=o.current;o.current=e.elapsedSeconds,!l.current&&void 0!==i&&!s.current.options.manual&&u(1e3*Math.max(0,e.elapsedSeconds-i)),s.current.options.onTick?.(e,t)},[u]);return{frameProps:{continuous:!i.paused&&!i.manual&&!a,onTick:c},advance:u,getTime:n.getTime,getEmittedCount:n.getEmittedCount,isComplete:n.isComplete,snapshot:n.snapshot,restore:e=>{n.restore(e),o.current=void 0,r(n.isComplete())}}}function ee(e){let{data:t,encoding:i,defaults:n={},scales:a}=e,r=it({data:t,encoding:i}),s=[],o=new Map,l=[],u=[],c=new Map;return r.rows.forEach((e,t)=>{let{id:r,datum:d}=e,p=Math.max(0,nt(i.appearance?.size,d,t)??n.size??6),h=nt(i.appearance?.shape,d,t)??n.shape??{type:"circle",radius:p},m=e.placement.x??n.x??0,f=e.placement.y??n.y??0,y=a?.x?a.x(m):m,g=a?.y?a.y(f):f,b=nt(i.appearance?.color,d,t)??n.color,v=nt(i.appearance?.opacity,d,t)??n.opacity,w=nt(i.appearance?.stroke,d,t)??n.stroke,x=nt(i.appearance?.strokeWidth,d,t)??n.strokeWidth,S=nt(i.time?.spawnAt,d,t)??e.time.arrival,I=e.kinematics.velocityX,A=e.kinematics.velocityY,P=nt(i.dynamics?.mass,d,t)??n.mass??1,C=nt(i.dynamics?.friction,d,t),M=nt(i.dynamics?.restitution,d,t),E=nt(i.dynamics?.bodyCollisions,d,t),R={id:r,x:y,y:g,mass:P,shape:{...h},datum:d,...null!=S&&{spawnAt:S},...null!=I&&{vx:I},...null!=A&&{vy:A},...null!=C&&{friction:C},...null!=M&&{restitution:M},...null!=E&&{bodyCollisions:E}},T={...null!=b&&{fill:b},...null!=v&&{opacity:v},...null!=w&&{stroke:w},...null!=x&&{strokeWidth:x}},j={id:r,datum:d,appearance:{color:b,opacity:v,shape:h,size:p,stroke:w,strokeWidth:x},placement:{x:y,y:g,lane:e.placement.lane,space:i.placement?.space??"world"},time:{arrival:S,spawnAt:S,basis:i.time?.basis??"simulation",unit:i.time?.unit},kinematics:{velocityX:I,velocityY:A,space:i.kinematics?.space??"world"},dynamics:{bodyCollisions:E,friction:C,mass:P,restitution:M},process:e.process,evidence:e.evidence,accessible:e.accessible,spawn:R};s.push(j),o.set(r,j),l.push(R),c.set(r,T),u.push({id:r,bodyId:r,label:e.accessible.label,description:e.accessible.description,datum:d,x:y,y:g,group:e.accessible.group})}),{rows:s,byId:o,spawns:l,semanticItems:u,bodyStyle:e=>c.get(e.id)??{}}}function te(e){return t=>{let i=ee({data:t.data,encoding:e.encoding,defaults:e.defaults,scales:t.scales}),n=e.extend?.(t,i)??{};return{...n,initialSpawns:i.spawns,bodyStyle:i.bodyStyle,semanticItems:[...i.semanticItems,...n.semanticItems??[]]}}}function ie(e,t){let{layout:i,positiveProperties:n,negativeProperties:a,viability:r,outcome:s}=t,o=function(e){return new Map(e.gates.map(e=>[e.id,e]))}(i),l=[...("function"==typeof t.events?t.events(e,i):t.events)??[]].sort((e,t)=>e.time-t.time),u=e;for(let e of l){let t=e.gateId?o.get(e.gateId):void 0,l=e.effects??[],c={...Ve(e,l),appliedAt:e.time},d=_e(u,c);if(d!==u){u=d;for(let i of l){let r={event:e,gate:t,negativeProperties:a,positiveProperties:n,project:u};i.when&&!i.when(r)||(u=Je(u,i,r))}u={...u,viability:r?.(u,{negativeProperties:a,positiveProperties:n})??ze(u,n,a)},e.final&&(u={...u,outcome:e.outcome??s?.(u,{layout:i,negativeProperties:a,positiveProperties:n})??(u.viability>20?"built":"approved_not_built")})}}return u}function ne(e){return e.projects.map(t=>ie(t,e))}function ae(e){let t=e.resources.map(e=>({...e,bodyId:e.bodyId??e.id})),i=new Map(t.map(e=>[e.bodyId,e])),n=new Map,a=new Map,r=e.assignmentForce??.45,s=e.returnForce??.35,o=e.caseAttraction??.08,l=e.assignmentOffset??{x:0,y:0},u=new Map,c=0,d=0;return{id:e.id??"service-resource-pool",continuous:!0,assign:e=>{let i=n.get(e);if(i)return i;let r=t.find(e=>!a.has(e.id));if(!r)return null;let s={resourceId:r.id,resourceBodyId:r.bodyId,caseBodyId:e,assignedAt:c};return n.set(e,s),a.set(r.id,s),d+=1,s},release:e=>{let t=n.get(e);return!!t&&(n.delete(e),a.delete(t.resourceId),d+=1,!0)},getAssignment:e=>n.get(e),tick:e=>{c=Math.max(c,e.elapsed),u=new Map(e.controls.readBodies().map(e=>[e.id,e]));for(let[e,t]of n)u.has(e)&&u.has(t.resourceBodyId)||(n.delete(e),a.delete(t.resourceId),d+=1)},getSnapshot:()=>({total:t.length,available:t.length-a.size,assigned:a.size,assignments:Array.from(n.values()),simulatedAt:c,metricRevision:d}),bodyForce:e=>{let t=i.get(e.body.id);if(t){let i=a.get(t.id),n=i?u.get(i.caseBodyId):void 0,o=n?n.x+(l.x??0):t.home.x,c=n?n.y+(l.y??0):t.home.y,d=i?r:s;return{x:(o-e.body.x)*d,y:(c-e.body.y)*d}}let c=n.get(e.body.id);if(!c||o<=0)return null;let d=u.get(c.resourceBodyId);return d?{x:(d.x-e.body.x)*o,y:(d.y-e.body.y)*o}:null}}}function re(e,t){let i="function"==typeof t.deadlineAccessor?t.deadlineAccessor(e):He(e.datum,t.deadlineAccessor)??He(e,t.deadlineAccessor);return Number.isFinite(Number(i))?Math.max(0,Number(i)):0}function se(e){function t(t){n.set(t.bodyId,t),r+=1,e.onStateChange?.({...t})}function i(e){let i=n.get(e);return!(!i||null!=i.completedAt||(t({...i,completedAt:a,state:"unhappy"===i.state?"resolved-unhappy":"resolved"}),0))}let n=new Map,a=0,r=0;return{id:e.id??"service-level",continuous:!0,protect:e=>{let i=n.get(e);return!(!i||null!=i.completedAt||"unhappy"===i.state||(t({...i,state:"protected",protectedAt:a}),0))},complete:i,getCase:e=>n.get(e),tick:r=>{a=Math.max(a,r.elapsed);for(let s of r.controls.readBodies()){if(!Ke(s,e.bodyFilter))continue;if(!n.has(s.id)){let i=re(s,e);t({bodyId:s.id,openedAt:a,deadlineAt:a+i,state:"waiting"})}let o=n.get(s.id);o&&null==o.completedAt&&(e.completionRegionId&&r.getRegionState(s.id)?.activeRegionIds.includes(e.completionRegionId)?i(s.id):"waiting"===o.state&&a>=o.deadlineAt&&t({...o,state:"unhappy"}))}},getSnapshot:()=>{let e=Array.from(n.values()),t=t=>e.filter(e=>e.state===t).length;return{total:e.length,waiting:t("waiting"),protected:t("protected"),unhappy:t("unhappy"),resolved:t("resolved"),resolvedUnhappy:t("resolved-unhappy"),simulatedAt:a,metricRevision:r}}}}function oe(e){let t=new Set,i=0,n=0,a=0,r=!1;return{id:e.id??`dependency-gate:${e.regionId}`,continuous:!0,tick:s=>{i=Math.max(i,s.elapsed);let o=r;var l;l=i,r=e.isOpen?e.isOpen(l):null!=e.opensAt&&l>=e.opensAt;let u=s.controls.readBodies(),c=new Map(u.map(e=>[e.id,e]));for(let i of u)!s.getRegionState(i.id)?.activeRegionIds.includes(e.regionId)||!Ke(i,e.bodyFilter)||!r&&!t.has(i.id)&&(t.add(i.id),a+=1,e.onHeld?.(i));if(r&&!o){for(let i of t){let t=c.get(i);t&&(s.controls.applyImpulse(i,e.releaseImpulse?.x??86,e.releaseImpulse?.y??0),n+=1,e.onReleased?.(t))}t.clear(),a+=1}for(let e of t)c.has(e)||(t.delete(e),a+=1)},getSnapshot:()=>({regionId:e.regionId,isOpen:r,blocked:t.size,released:n,simulatedAt:i,metricRevision:a}),bodyForce:i=>{if(r||!t.has(i.body.id))return null;let n=i.regions?.find(t=>t.id===e.regionId)?.shape;if(!n||"aabb"!==n.type)return{x:.8*-i.body.vx,y:.8*-i.body.vy};let a=e.holdForce??.4;return{x:(n.x-i.body.x)*a-.45*i.body.vx,y:(n.y-i.body.y)*a-.45*i.body.vy}}}}function le(e,t,i={}){let n=i.random??Math.random,a=e.stages.find(e=>e.id===t)??e.stages[e.stages.length-1],r=rt(i.along??.5,.05,.95),s=i.jitterX??0,o=i.padY??20,l=a.x0+(a.x1-a.x0)*r+(2*n()-1)*s,u=Math.min(1,a.width/2),c=rt(l,a.x0+u,a.x1-u),d=e.boundaryY(c,"top")+o,p=e.boundaryY(c,"bottom")-o;return{x:c,y:p<=d?e.midY:d+n()*Math.max(1,p-d)}}function ue(e){return"bowtie"===e.shape?[{id:"incoming",role:"incoming",points:[[e.left,e.topY],[e.centerLeft,e.pinchTop],[e.centerLeft,e.pinchBottom],[e.left,e.bottomY]]},{id:"center",role:"center",points:[[e.centerLeft,e.pinchTop],[e.centerRight,e.pinchTop],[e.centerRight,e.pinchBottom],[e.centerLeft,e.pinchBottom]]},{id:"outgoing",role:"outgoing",points:[[e.centerRight,e.pinchTop],[e.right,e.topY],[e.right,e.bottomY],[e.centerRight,e.pinchBottom]]}]:[{id:"volume",role:"volume",points:[[e.left,e.topY],[e.right,"funnel"===e.shape?e.pinchTop:e.topY],[e.right,"funnel"===e.shape?e.pinchBottom:e.bottomY],[e.left,e.bottomY]]}]}function ce(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function de(e,t,i,n,a){return"function"==typeof n?n(e,t,i):function(e,t){let i=e;for(let e of t.split(".")){if(null==i||"object"!=typeof i||!Object.prototype.hasOwnProperty.call(i,e))return;i=i[e]}return i}(e,n??a)}function pe(e){let t=Number(e.toFixed(12));return Object.is(t,-0)?0:t}function he(e,t,i,n){let a=e.flatMap((e,a)=>{let r=ce(de(e,a,t,i,"time")),s=ce(de(e,a,t,n,"value"));return null==r||null==s?[]:[{time:pe(r),value:s,index:a}]});a.sort((e,t)=>e.time-t.time||e.index-t.index);let r=[];for(let e of a){let t=r[r.length-1];t?.time===e.time?t.value=e.value:r.push({time:e.time,value:e.value})}return r}function me(e,t,i,n){if(!e.length)return null;let a=e[0],r=e[e.length-1];if(t<a.time)return"clamp"===n?a.value:null;if(t>r.time)return"clamp"===n?r.value:null;let s=function(e,t){let i=0,n=e.length;for(;i<n;){let a=i+n>>>1;e[a].time<t?i=a+1:n=a}return i}(e,t),o=e[s];if(o?.time===t)return o.value;let l=e[Math.max(0,s-1)];if("step"===i||!o||o.time===l.time)return l.value;let u=(t-l.time)/(o.time-l.time);return l.value+(o.value-l.value)*u}function fe(e,t){if(1===e.length)return e[0];let i=(e.length-1)*t,n=Math.floor(i),a=Math.ceil(i);if(n===a)return e[n];let r=i-n;return e[n]+(e[a]-e[n])*r}function ye(e){let t=e.interpolation??"step",i=e.outsideDomain??"omit",n=function(e){let t=(e??ct).map(e=>{let t=ce(e);if(null==t||t<0||t>1)throw new RangeError(`physicsReferenceEnvelope quantiles must be finite values from 0 to 1; received ${String(e)}`);return pe(t)});return Array.from(new Set(t)).sort((e,t)=>e-t)}(e.quantiles),a=function(e){if(Array.isArray(e)){if(e.length>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(e.map(ce).filter(e=>null!=e).map(pe))).sort((e,t)=>e-t)}let t=e,i=ce(t.start),n=ce(t.end),a=ce(t.step);if(null==i||null==n||null==a||a<=0||n<i)throw new RangeError("physicsReferenceEnvelope sampleAt requires finite start/end values with end >= start and step > 0");let r=Math.floor((n-i)/a)+1;if(r>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");let s=[],o=1e-10*Math.max(1,Math.abs(n),Math.abs(i));for(let e=0;e<r;e+=1){let t=i+e*a;if(t>n+o)break;s.push(pe(Math.min(t,n)))}if((!s.length||Math.abs(s[s.length-1]-n)>o)&&s.push(pe(n)),s.length>dt)throw new RangeError("physicsReferenceEnvelope sampleAt exceeds 1000000 points");return Array.from(new Set(s)).sort((e,t)=>e-t)}(e.sampleAt),r=e.runs.map(t=>he(t.samples,t.id,e.timeAccessor,e.valueAccessor));return{points:a.map(e=>{let a=r.map(n=>me(n,e,t,i)).filter(e=>null!=e).sort((e,t)=>e-t),s={};for(let e of n)s[e]=a.length?fe(a,e):null;return{time:e,count:a.length,min:a.length?a[0]:null,max:a.length?a[a.length-1]:null,median:a.length?fe(a,.5):null,quantiles:s}}),quantiles:n,interpolation:t,outsideDomain:i,runCount:e.runs.length}}function ge(e,t){return e.quantiles.length?"lower"===t?e.quantiles[0]:e.quantiles[e.quantiles.length-1]:"lower"===t?"min":"max"}function be(e,t){if("min"===t||"median"===t||"max"===t)return e[t];let i=ce(t);if(null==i||i<0||i>1)throw new RangeError(`comparePhysicsTrace quantile selectors must be from 0 to 1; received ${String(t)}`);let n=pe(i);if(!Object.prototype.hasOwnProperty.call(e.quantiles,n))throw new Error(`comparePhysicsTrace could not find quantile ${n} in the reference envelope`);return e.quantiles[n]??null}function ve(e,t,i){return e<t?"below":e>i?"above":"inside"}function we(e,t){let i=Math.max(0,t.time-e.time);if(!(i>0)||null==e.value||null==e.lower||null==e.upper||null==t.value||null==t.lower||null==t.upper)return{below:0,inside:0,above:0,observed:0};let n=e.value-e.lower,a=t.value-t.lower,r=e.value-e.upper,s=t.value-t.upper,o=[0,1];for(let[e,t]of[[n,a],[r,s]])(e<0&&t>0||e>0&&t<0)&&o.push(-e/(t-e));o.sort((e,t)=>e-t);let l=0,u=0,c=0;for(let n=0;n<o.length-1;n+=1){let a=o[n],r=o[n+1];if(!(r>a))continue;let s=(a+r)/2,d=(r-a)*i,p=ve(e.value+(t.value-e.value)*s,e.lower+(t.lower-e.lower)*s,e.upper+(t.upper-e.upper)*s);"below"===p?l+=d:"above"===p?c+=d:u+=d}return{below:l,inside:u,above:c,observed:i}}function xe(e,t,i={}){let n=i.interpolation??t.interpolation,a=i.outsideDomain??t.outsideDomain,r=he(e,i.traceId??"trace",i.timeAccessor,i.valueAccessor),s=i.lower??ge(t,"lower"),o=i.upper??ge(t,"upper"),l=t.points.map(e=>{let t=me(r,e.time,n,a),i=be(e,s),l=be(e,o);if(null!=i&&null!=l&&i>l)throw new RangeError(`comparePhysicsTrace lower band exceeds upper band at time ${e.time}`);return{time:e.time,value:t,lower:i,upper:l,status:null==t||null==i||null==l?"unobserved":ve(t,i,l)}}),u=0,c=0,d=0,p=0,h=null,m=0,f=null;for(let e of l){if("below"===e.status?u+=1:"inside"===e.status?c+=1:"above"===e.status&&(d+=1),null==e.value||null==e.lower||null==e.upper)continue;let t=Math.max(0,e.value-e.upper),i=Math.max(0,e.lower-e.value);t>p&&(p=t,h=e.time),i>m&&(m=i,f=e.time)}let y=0,g=0,b=0,v=0;for(let e=0;e<l.length-1;e+=1){let t=l[e],i=l[e+1],a=Math.max(0,i.time-t.time);if(a>0){if("linear"===n){let e=we(t,i);y+=e.below,g+=e.inside,b+=e.above,v+=e.observed;continue}"unobserved"!==t.status&&(v+=a,"below"===t.status?y+=a:"above"===t.status?b+=a:g+=a)}}let w=l[0]?.time,x=l[l.length-1]?.time,S=null==w||null==x?0:Math.max(0,x-w),I=u+c+d;return{points:l,sampleCount:l.length,observedSamples:I,belowSamples:u,insideSamples:c,aboveSamples:d,totalDuration:S,observedDuration:v,unobservedDuration:Math.max(0,S-v),belowDuration:y,insideDuration:g,aboveDuration:b,peakExcess:p,peakExcessAt:h,peakDeficit:m,peakDeficitAt:f}}function Se(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Ie(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ae(e){return!!Ie(e)&&"string"==typeof e.id&&"number"==typeof e.furthestStageIndex&&Number.isFinite(e.furthestStageIndex)&&Array.isArray(e.visitedStageIds)&&e.visitedStageIds.every(e=>"string"==typeof e)&&Ie(e.visitsByStage)&&Ie(e.firstEnteredAt)&&Ie(e.lastEnteredAt)&&"number"==typeof e.regressionCount&&Number.isFinite(e.regressionCount)}function Pe(e){return{id:e,furthestStageIndex:-1,visitedStageIds:[],visitsByStage:{},firstEnteredAt:{},lastEnteredAt:{},regressionCount:0}}function Ce(e){let t=Array.from(new Set(e.bodyIds??[]));return{stages:e.stages.map(e=>({...e})),bodyIds:t,entities:Object.fromEntries(t.map(e=>[e,Pe(e)]))}}function Me(e,t,i={}){if("region-enter"!==t.type)return e;let n=function(e,t){let i=t.stageId?.(e);if(i)return i;let n=e.region.metadata;if(n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,"stageId")){let e=n.stageId;if("string"==typeof e)return e}return e.region.id}(t,i),a=e.stages.findIndex(e=>e.id===n);if(a<0)return e;let r=i.entityId?.(t)??t.bodyId;if(!r)return e;let s=Se(e.entities,r),o=Ae(s)?s:Pe(r),l=o.currentStageId?e.stages.findIndex(e=>e.id===o.currentStageId):-1,u=!o.visitedStageIds.includes(n),c=Number(t.observation.timestamp),d=Number.isFinite(c)?c:0,p=Se(o.visitsByStage,n),h="number"==typeof p&&Number.isFinite(p)?p:0,m={...o,currentStageId:n,furthestStageId:a>o.furthestStageIndex?n:o.furthestStageId,furthestStageIndex:Math.max(o.furthestStageIndex,a),visitedStageIds:u?[...o.visitedStageIds,n]:o.visitedStageIds,visitsByStage:{...o.visitsByStage,[n]:h+1},firstEnteredAt:u?{...o.firstEnteredAt,[n]:d}:o.firstEnteredAt,lastEnteredAt:{...o.lastEnteredAt,[n]:d},regressionCount:l>=0&&a<l?o.regressionCount+1:o.regressionCount};return{...e,bodyIds:e.bodyIds.includes(r)?e.bodyIds:[...e.bodyIds,r],entities:{...e.entities,[r]:m}}}function Ee(e){let t=e.bodyIds.map(t=>{let i=Se(e.entities,t);return Ae(i)?i:Pe(t)}),i=t.length,n=i;return e.stages.map((e,a)=>{let r=t.filter(e=>e.furthestStageIndex>=a).length,s=t.filter(t=>t.visitedStageIds.includes(e.id)).length,o=t.reduce((t,i)=>{let n=Se(i.visitsByStage,e.id);return t+("number"==typeof n&&Number.isFinite(n)?n:0)},0),l={id:e.id,label:e.label??e.id,reached:r,entered:s,total:i,conversion:i>0?r/i:0,fromPrevious:n>0?r/n:0,dropoff:Math.max(0,n-r),visits:o,repeatVisits:Math.max(0,o-s)};return n=r,l})}function Re(e){let[t,i]=e.size,n=e.flow??"down",a=null==(x=e.padding)?{top:24,right:24,bottom:24,left:24}:"number"==typeof x?{top:x,right:x,bottom:x,left:x}:{top:x.top??0,right:x.right??0,bottom:x.bottom??0,left:x.left??0},r=Math.max(.05,Math.min(1,e.channelRatio??1)),s={x:a.left,y:a.top,width:Math.max(1,t-a.left-a.right),height:Math.max(1,i-a.top-a.bottom)},o="down"===n?s.height:s.width,l=o*Math.max(0,e.chargeExtent??.12),u=o*Math.max(0,e.projectionExtent??0),c=o*Math.max(0,e.destinationExtent??.55),d=Math.max(0,o-l-c-u),p=function(e){if("number"==typeof e){let t=Math.max(1,Math.round(e));return Array.from({length:t},(e,t)=>({id:`bin-${t}`,label:String(t)}))}return 0===e.length?[{id:"bin-0",label:"0"}]:e.map((e,t)=>({id:e.id,label:e.label??e.id??String(t)}))}(e.destinations),h=("down"===n?s.width:s.height)/p.length,m="down"===n?(e,t)=>({x:s.x,y:s.y+e,width:s.width,height:t}):(e,t)=>({x:s.x+e,y:s.y,width:t,height:s.height}),f=m(0,l),y=m(l,d),g=l+d,b=m(g,c),v=m(g+c,u),w=p.map((e,t)=>{let i=t*h,a=h*r,o=(h-a)/2;if("down"===n){let n=s.x+i+o;return{id:e.id,label:e.label,order:t,x:n,y:b.y,width:a,height:b.height,centerX:s.x+(t+.5)*h,centerY:b.y+b.height/2}}let l=s.y+i+o;return{id:e.id,label:e.label,order:t,x:b.x,y:l,width:b.width,height:a,centerX:b.x+b.width/2,centerY:s.y+(t+.5)*h}});var x;return{width:t,height:i,flow:n,charge:f,apparatus:y,destinations:w,projection:v}}function Te(e,t){return e.destinations.find(e=>e.id===t)}function je(e,t,i){let{charge:n,flow:a}=e,r=Math.max(1,i),s=(t%r+.5)/r;return"down"===a?{x:n.x+n.width*s,y:n.y+n.height/2}:{x:n.x+n.width/2,y:n.y+n.height*s}}function ke(e,t={}){let i=t.thickness??4,n=t.idPrefix??"stage",{destinations:a,flow:r,width:s,height:o}=e,l=[];if(a.length>0){let t=a[0];if("down"===r){let r=t.y+t.height;l.push({id:`${n}-floor`,shape:{type:"segment",x1:e.charge.x,y1:r,x2:e.charge.x+e.charge.width,y2:r,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerX-(a[e].centerX-a[e-1].centerX)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:s,y1:t.y,x2:s,y2:r,thickness:i}})}}else{let r=t.x+t.width;l.push({id:`${n}-floor`,shape:{type:"segment",x1:r,y1:e.charge.y,x2:r,y2:e.charge.y+e.charge.height,thickness:i}});for(let e=1;e<a.length;e+=1){let s=a[e].centerY-(a[e].centerY-a[e-1].centerY)/2;l.push({id:`${n}-divider-${e}`,shape:{type:"segment",x1:t.x,y1:s,x2:r,y2:s,thickness:i}})}}}return!1!==t.walls&&l.push({id:`${n}-wall-left`,shape:{type:"segment",x1:1,y1:0,x2:1,y2:o,thickness:i}},{id:`${n}-wall-right`,shape:{type:"segment",x1:s-1,y1:0,x2:s-1,y2:o,thickness:i}}),l}function Be(e,t={}){let i=t.charge??"bodies",n=t.apparatus??"the apparatus",a=t.destination??"destinations",r=e.destinations.length,s="down"===e.flow?"downward":"left to right";return`${i} enter at the ${"down"===e.flow?"top":"left"}, travel ${s} through ${n}, and come to rest in ${r} ${a}: ${e.destinations.map(e=>e.label).join(", ")}.`}function Fe(e){let t="number"==typeof e?e:"string"==typeof e&&e.trim()?Number(e):NaN;return Number.isFinite(t)?t:null}function Le(e,t,i,n){let a="function"==typeof e?e(t,i):e;return Number.isFinite(a)?Number(a):n}function Ne(e,t,i){return Fe(e[t])??i}function $e(e,t){return"number"==typeof e?e:e?.[t]??0}function De(e){let{band:t,idPrefix:i,plot:n,projection:a}=e,{includeBoundaryWalls:r=!0,includeInteriorWalls:s=!0,wallThickness:o=4}=t,l=function(e){let t=e.bandwidth??e.scale.bandwidth?.()??0,i=new Set;for(let n of e.values){let a=e.scale(n);Number.isFinite(a)&&(i.add(Number(a)),i.add(Number(a)+t))}return Array.from(i).sort((e,t)=>e-t)}(t);if(l.length<2)return[];let u=r?0:1,c=r?l.length-1:l.length-2,d=[];for(let e=u;e<=c;e+=1){if(!s&&e>0&&e<l.length-1)continue;let t=l[e];d.push({id:`${i}-wall-${e}`,shape:"x"===a?{type:"aabb",x:t,y:n.y+n.height/2,width:o,height:n.height}:{type:"aabb",x:n.x+n.width/2,y:t,width:n.width,height:o}})}return d}function Oe(e){let{plot:t,idPrefix:i="physics-scale",bounds:n={},xBins:a,xBands:r,yBands:s}=e,o=[];if(!1!==n&&o.push(...Xe(t,{idPrefix:i,...n})),a){let{idPrefix:e,yTop:n,yBottom:r,...s}=a;o.push(...Qe({...s,idPrefix:e??`${i}-xbin`,yTop:n??t.y,yBottom:r??t.y+t.height}))}return r&&o.push(...De({band:r,idPrefix:r.idPrefix??`${i}-xband`,plot:t,projection:"x"})),s&&o.push(...De({band:s,idPrefix:s.idPrefix??`${i}-yband`,plot:t,projection:"y"})),o}function Ye(e){let{plot:t,rows:i,columns:n=i+1,pegRadius:a=3,idPrefix:r="galton-peg",yStart:s=t.y+.18*t.height,yEnd:o=t.y+.58*t.height,stagger:l=!0,restitution:u=.2,friction:c=.04}=e,d=Math.max(0,Math.floor(i)),p=Math.max(1,Math.floor(n));if(0===d)return[];let h=d<=1?0:(o-s)/(d-1),m=t.width/p,f=[];for(let e=0;e<d;e+=1){let i=l&&e%2==1?m/2:0;for(let n=0;n<p;n+=1){let o=t.x+m*(n+.5)+i;o<t.x+a||o>t.x+t.width-a||f.push({id:`${r}-${e}-${n}`,shape:{type:"aabb",x:o,y:s+e*h,width:2*a,height:2*a},restitution:u,friction:c})}}return f}function Ge(e,t={}){let{idPrefix:i="physics-token",radius:n=5,shape:a,mass:r,vx:s,vy:o,spawnAt:l,seed:u=1,jitter:c,datum:d}=t,p=tt(u),h=$e(c,"x"),m=$e(c,"y");return e.map((e,u)=>{let c=Le(t.x,e,u,Ne(e,"x",0)),f=Le(t.y,e,u,Ne(e,"y",0)),y=Le(n,e,u,5),g="function"==typeof a?a(e,u):a??{type:"circle",radius:y};return{id:`${i}-${e.index??u}`,x:c+(p()-.5)*h,y:f+(p()-.5)*m,vx:Le(s,e,u,0),vy:Le(o,e,u,0),mass:Le(r,e,u,1),spawnAt:Le(l,e,u,void 0),shape:g,datum:d?d(e,u):e.datum??e}}).map(e=>{if(Number.isFinite(e.spawnAt))return e;let{spawnAt:t,...i}=e;return i})}function Ue(e,t={}){let{idPrefix:i="sediment",collider:n=!0,colliderThickness:a=1,restitution:r=.05,friction:s=.2,...o}=t,l=Ze(e,o),u=n?l.filter(e=>e.height>0).map(e=>({id:`${i}-${e.binId}`,shape:{type:"aabb",x:e.x+e.width/2,y:e.y+a/2,width:e.width,height:a},restitution:r,friction:s})):[];return{columns:l,colliders:u}}function We(e,t={}){let{timeAccessor:i="arrivalTime",timeScale:n=1,startAt:a=0,rebase:r=!0,sort:s=!0}=t,o=e.map((e,t)=>({spawn:e,time:function(e,t,i){return Fe("function"==typeof i?i(e,t):e[i]??e.datum?.[i])}(e,t,i)??e.spawnAt??t})),l=o.length?st(o.map(e=>e.time)):0;return{initialSpawns:o.map(({spawn:e,time:t})=>({...e,spawnAt:a+(r?t-l:t)})).sort((e,t)=>s?(e.spawnAt??0)-(t.spawnAt??0):0),initialSpawnPacing:{pacing:"arrival",startAt:a,timeAccessor:"spawnAt",timeScale:n}}}import{R as qe,af as Ve,ag as _e,ae as Je,ab as ze,e as He,f as Ke,l as Xe,m as Qe,j as Ze,s as et}from"./c-N2TVSOYL.min.js";export{g as BuiltInPhysicsEngineAdapter,aU as ChainReactionChart,Y as CollisionSwarmChart,aO as CrucibleChart,av as DEFAULT_CRUCIBLE_HEIGHT,ax as DEFAULT_CRUCIBLE_OUTLETS,aw as DEFAULT_CRUCIBLE_SIZE,au as DEFAULT_CRUCIBLE_WIDTH,U as EventDropChart,P as GaltonBoardChart,ah as GauntletChart,ai as GuantletChart,aj as PacketFlowChart,ak as PhysicalFlowChart,X as PhysicsCustomChart,W as PhysicsPileChart,n as PhysicsPipelineStore,d as PhysicsSVGOverlay,i as PhysicsSedimentAccumulator,am as ProcessFlowChart,r as StreamPhysicsFrame,V as UnitPileChart,Q as WATERMARK_LONG_TAIL_JITTER,K as absorbRegion,z as aggregateRegionCounts,ap as applyCrucibleEvent,a as bodiesToAnnotationAnchors,M as bodyGroupSpec,x as buildCollisionSwarmPhysics,at as buildCrucibleEvidence,aF as buildCrucibleInitialSpawns,az as buildCrucibleLayout,aB as buildCruciblePhysicsConfig,aN as buildCrucibleProductEvents,aq as buildCrucibleProjection,aG as buildCrucibleStateSpawns,aH as buildCrucibleTerminalSpawns,u as buildEventDropPhysics,t as buildGaltonBoardPhysics,y as buildPhysicalFlowPhysics,b as buildPhysicsAnnotationContext,w as buildPhysicsPile,O as buildProcessFlowPhysics,aT as calculateBlockerAmplification,I as capacitatedRegion,F as chargeGateRegion,an as cloneCrucibleState,aM as compileCruciblePlan,aP as compileDependencyMachine,p as composePhysicsControllers,o as createCapacityQueueController,h as createDefaultPhysicsEngineAdapter,ay as createInitialCrucibleState,aR as createLogicalJoin,q as createPortalController,R as createSyntheticEmitter,aE as crucibleBondId,aA as crucibleBoundaryColliders,aC as crucibleComponentBodyId,aD as crucibleProductBodyId,ar as crucibleProjectionRows,aI as crucibleSemanticKey,as as evaluateCrucibleConservation,k as evaluatePhysicsBodyBudget,L as forceFieldRegion,B as groupCompletionRows,E as membraneRegion,c as normalizePhysicsAnnotations,Z as physicsProcessBoundaryColliders,aa as physicsProcessGroupSemanticItems,$ as physicsProcessRegionSemanticItem,_ as physicsProcessStageSemanticItems,ac as planGauntletPropertyWork,J as portalRegion,H as pressureFieldRegion,al as processChrome,N as processLaneWalls,C as processStageLayout,D as processStageRegions,v as readEventDropOccupancy,A as regionCountsToProjectionRows,T as registerPhysicsLivePrograms,ad as replaceGauntletNegative,aL as replayCruciblePlan,aS as replayStateTransitions,ao as resolveCrucibleSelector,aK as resolveCrucibleSnapshotAt,aJ as resolveCrucibleTime,aQ as routeDependencyTracks,G as routeSurfaceRegion,j as sedimentHeightfield,S as syntheticArrivals}from"./c-N2TVSOYL.min.js";export{p as EventDropLedger}from"./c-HGWITEJI.min.js";import{a as tt}from"./c-RI7UJTEY.min.js";import{f as it,e as nt,O as rt}from"./c-SU6Z75M2.min.js";export{aL as MultiLineTooltip,aK as Tooltip,f as compileMotionEncoding,bO as composeStyleRules,j as deriveMotionVector,bI as makeRuleValueResolver,bL as matchesThreshold,h as opacityFromAge,e as resolveMotionAccessor,g as resolveMotionAge,i as resolveMotionVector,bN as resolveStyleRules,bM as ruleMatches}from"./c-SU6Z75M2.min.js";export{j as hatchFillId,k as hatchPatternDef,i as isHatchFill,l as resolveSvgFill}from"./c-VZNIIKL6.min.js";export{w as TooltipRoot,z as hasOwnTooltipChrome,s as hasTooltipContent,y as markTooltipChrome}from"./c-TC47SNSI.min.js";import{b as st}from"./c-GRTKU3C7.min.js";import{useState as ot,useRef as lt,useCallback as ut}from"react";var ct=[.1,.5,.9],dt=1e6,pt=et;export{We as arrivalReplay,Oe as collidersFromScales,xe as comparePhysicsTrace,ee as compilePhysicsEncoding,oe as createDependencyGateController,te as createPhysicsEncodingLayout,Ce as createProcessJourneyLedger,se as createServiceLevelController,ae as createServiceResourcePoolController,pt as default,Be as describePhysicsStageGeography,Ye as galtonPegs,je as physicsChargePoint,Te as physicsDestination,ye as physicsReferenceEnvelope,ke as physicsStageColliders,Re as physicsStageGeography,Ee as processJourneyRows,ue as processVolumePolygons,ie as resolveGauntletTerminalState,ne as resolveGauntletTerminalStates,Ue as sedimentBake,Ge as spawnFromTokens,le as stageTargetInVolume,Me as updateProcessJourney,m as useEmitters};