@kineviz/gl 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3815 @@
1
+ "use strict";var zs=Object.create;var nn=Object.defineProperty;var Ds=Object.getOwnPropertyDescriptor;var Fs=Object.getOwnPropertyNames;var Ns=Object.getPrototypeOf,Ls=Object.prototype.hasOwnProperty;var Lo=(n,e)=>()=>(n&&(e=n(n=0)),e);var Os=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Oo=(n,e)=>{for(var t in e)nn(n,t,{get:e[t],enumerable:!0})},Go=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Fs(e))!Ls.call(n,r)&&r!==t&&nn(n,r,{get:()=>e[r],enumerable:!(o=Ds(e,r))||o.enumerable});return n};var te=(n,e,t)=>(t=n!=null?zs(Ns(n)):{},Go(e||!n||!n.__esModule?nn(t,"default",{value:n,enumerable:!0}):t,n)),Gs=n=>Go(nn({},"__esModule",{value:!0}),n);var rr=Os((qc,Ws)=>{Ws.exports={rings:[[61.21,35.65,62.23,35.27,62.98,35.4,63.19,35.86,63.98,36.01,64.55,36.31,64.75,37.11,65.59,37.31,65.75,37.66,66.22,37.39,66.52,37.36,67.08,37.36,67.83,37.14,68.14,37.02,68.86,37.34,69.2,37.15,69.52,37.61,70.12,37.59,70.27,37.74,70.38,38.14,70.81,38.49,71.35,38.26,71.24,37.95,71.54,37.91,71.45,37.07,71.84,36.74,72.19,36.95,72.64,37.05,73.26,37.5,73.95,37.42,74.98,37.42,75.16,37.13,74.58,37.02,74.07,36.84,72.92,36.72,71.85,36.51,71.26,36.07,71.5,35.65,71.61,35.15,71.12,34.73,71.16,34.35,70.88,33.99,69.93,34.02,70.32,33.36,69.69,33.11,69.26,32.5,69.32,31.9,68.93,31.62,68.56,31.71,67.79,31.58,67.68,31.3,66.94,31.3,66.38,30.74,66.35,29.89,65.05,29.47,64.35,29.56,64.15,29.34,63.55,29.47,62.55,29.32,60.87,29.83,61.78,30.74,61.7,31.38,60.94,31.55,60.86,32.18,60.54,32.98,60.96,33.53,60.53,33.68,60.8,34.4,61.21,35.65],[16.33,-5.88,16.57,-6.62,16.86,-7.22,17.09,-7.55,17.47,-8.07,18.13,-7.99,18.46,-7.85,19.02,-7.99,19.17,-7.74,19.42,-7.16,20.04,-7.12,20.09,-6.94,20.6,-6.94,20.51,-7.3,21.73,-7.29,21.75,-7.92,21.95,-8.31,21.8,-8.91,21.88,-9.52,22.21,-9.89,22.16,-11.08,22.4,-10.99,22.84,-11.02,23.46,-10.87,23.91,-10.93,24.02,-11.24,23.9,-11.72,24.08,-12.19,23.93,-12.57,24.02,-12.91,21.93,-12.9,21.89,-16.08,22.56,-16.9,23.22,-17.52,21.38,-17.93,18.96,-17.79,18.26,-17.31,14.21,-17.35,14.06,-17.42,13.46,-16.97,12.81,-16.94,12.22,-17.11,11.73,-17.3,11.64,-16.67,11.78,-15.79,12.12,-14.88,12.18,-14.45,12.5,-13.55,12.74,-13.14,13.31,-12.48,13.63,-12.04,13.74,-11.3,13.69,-10.73,13.39,-10.37,13.12,-9.77,12.88,-9.17,12.93,-8.96,13.24,-8.56,12.93,-7.6,12.73,-6.93,12.23,-6.29,12.32,-6.1,12.74,-5.97,13.02,-5.98,13.38,-5.86,16.33,-5.88],[12.44,-5.68,12.18,-5.79,11.91,-5.04,12.32,-4.61,12.62,-4.44,13,-4.78,12.63,-4.99,12.47,-5.25,12.44,-5.68],[20.59,41.86,20.46,41.52,20.61,41.09,21.02,40.84,21,40.58,20.67,40.44,20.62,40.11,20.15,39.62,19.98,39.69,19.96,39.92,19.41,40.25,19.32,40.73,19.4,41.41,19.54,41.72,19.37,41.88,19.3,42.2,19.74,42.69,19.8,42.5,20.07,42.59,20.28,42.32,20.52,42.22,20.59,41.86],[51.58,24.25,51.76,24.29,51.79,24.02,52.58,24.18,53.4,24.15,54.01,24.12,54.69,24.8,55.44,25.44,56.07,26.06,56.26,25.71,56.4,24.92,55.89,24.92,55.8,24.27,55.98,24.13,55.53,23.93,55.53,23.52,55.23,23.11,55.21,22.71,55.01,22.5,52,23,51.62,24.01,51.58,24.25],[-65.5,-55.2,-66.45,-55.25,-66.96,-54.9,-67.56,-54.87,-68.63,-54.87,-68.63,-52.64,-68.25,-53.1,-67.75,-53.85,-66.45,-54.45,-65.05,-54.7,-65.5,-55.2],[-64.96,-22.08,-64.38,-22.8,-63.99,-21.99,-62.85,-22.03,-62.69,-22.25,-60.85,-23.88,-60.03,-24.03,-58.81,-24.77,-57.78,-25.16,-57.63,-25.6,-58.62,-27.12,-57.61,-27.4,-56.49,-27.55,-55.7,-27.39,-54.79,-26.62,-54.63,-25.74,-54.13,-25.55,-53.63,-26.12,-53.65,-26.92,-54.49,-27.47,-55.16,-27.88,-56.29,-28.85,-57.63,-30.22,-57.87,-31.02,-58.14,-32.04,-58.13,-33.04,-58.35,-33.26,-58.43,-33.91,-58.5,-34.43,-57.23,-35.29,-57.36,-35.98,-56.74,-36.41,-56.79,-36.9,-57.75,-38.18,-59.23,-38.72,-61.24,-38.93,-62.34,-38.83,-62.13,-39.42,-62.33,-40.17,-62.15,-40.68,-62.75,-41.03,-63.77,-41.17,-64.73,-40.8,-65.12,-41.06,-64.98,-42.06,-64.3,-42.36,-63.76,-42.04,-63.46,-42.56,-64.38,-42.87,-65.18,-43.5,-65.33,-44.5,-65.57,-45.04,-66.51,-45.04,-67.29,-45.55,-67.58,-46.3,-66.6,-47.03,-65.64,-47.24,-65.99,-48.13,-67.17,-48.7,-67.82,-49.87,-68.73,-50.26,-69.14,-50.73,-68.82,-51.77,-68.15,-52.35,-68.57,-52.3,-69.5,-52.14,-71.91,-52.01,-72.33,-51.43,-72.31,-50.68,-72.98,-50.74,-73.33,-50.38,-73.42,-49.32,-72.65,-48.88,-72.33,-48.24,-72.45,-47.74,-71.92,-46.88,-71.55,-45.56,-71.66,-44.97,-71.22,-44.78,-71.33,-44.41,-71.79,-44.21,-71.46,-43.79,-71.92,-43.41,-72.15,-42.25,-71.75,-42.05,-71.92,-40.83,-71.68,-39.81,-71.41,-38.92,-70.81,-38.55,-71.12,-37.58,-71.12,-36.66,-70.36,-36.01,-70.39,-35.17,-69.82,-34.19,-69.81,-33.27,-70.07,-33.09,-70.54,-31.37,-69.92,-30.34,-70.01,-29.37,-69.66,-28.46,-69,-27.52,-68.3,-26.9,-68.59,-26.51,-68.39,-26.19,-68.42,-24.52,-67.33,-24.03,-66.99,-22.99,-67.11,-22.74,-66.27,-21.83,-64.96,-22.08],[43.58,41.09,44.97,41.25,45.18,40.99,45.56,40.81,45.36,40.56,45.89,40.22,45.61,39.9,46.03,39.63,46.48,39.46,46.51,38.77,46.14,38.74,45.74,39.32,45.74,39.47,45.3,39.47,45,39.74,44.79,39.71,44.4,40.01,43.66,40.25,43.75,40.74,43.58,41.09],[-59.57,-80.04,-59.87,-80.55,-60.16,-81,-62.26,-80.86,-64.49,-80.92,-65.74,-80.59,-65.74,-80.55,-66.29,-80.26,-64.04,-80.29,-61.88,-80.39,-61.14,-79.98,-60.61,-79.63,-59.57,-80.04],[-159.21,-79.5,-161.13,-79.63,-162.44,-79.28,-163.03,-78.93,-163.07,-78.87,-163.71,-78.6,-163.11,-78.22,-161.25,-78.38,-160.25,-78.69,-159.48,-79.05,-159.21,-79.5],[-45.15,-78.05,-43.92,-78.48,-43.49,-79.09,-43.37,-79.52,-43.33,-80.03,-44.88,-80.34,-46.51,-80.59,-48.39,-80.83,-50.48,-81.03,-52.85,-80.97,-54.16,-80.63,-53.99,-80.22,-51.85,-79.95,-50.99,-79.61,-50.36,-79.18,-49.91,-78.81,-49.31,-78.46,-48.66,-78.05,-48.15,-78.05,-46.66,-77.83,-45.15,-78.05],[-121.21,-73.5,-119.92,-73.66,-118.72,-73.48,-119.29,-73.83,-120.23,-74.09,-121.62,-74.01,-122.62,-73.66,-122.41,-73.32,-121.21,-73.5],[-125.56,-73.48,-124.03,-73.87,-124.62,-73.83,-125.91,-73.74,-127.28,-73.46,-126.56,-73.25,-125.56,-73.48],[-98.98,-71.93,-97.88,-72.07,-96.79,-71.95,-96.2,-72.52,-96.98,-72.44,-98.2,-72.48,-99.43,-72.44,-100.78,-72.5,-101.8,-72.31,-102.33,-71.89,-101.7,-71.72,-100.43,-71.85,-98.98,-71.93],[-68.45,-70.96,-68.33,-71.41,-68.51,-71.8,-68.78,-72.17,-69.96,-72.31,-71.08,-72.5,-72.39,-72.48,-71.9,-72.09,-73.07,-72.23,-74.19,-72.37,-74.95,-72.07,-75.01,-71.66,-73.92,-71.27,-73.23,-71.15,-72.07,-71.19,-71.78,-70.68,-71.72,-70.31,-71.74,-69.51,-71.17,-69.04,-70.25,-68.88,-69.72,-69.25,-69.49,-69.62,-69.06,-70.07,-68.73,-70.51,-68.45,-70.96],[-58.61,-64.15,-59.05,-64.37,-59.79,-64.21,-60.61,-64.31,-61.3,-64.54,-62.02,-64.8,-62.51,-65.09,-62.65,-65.48,-62.59,-65.86,-62.12,-66.19,-62.81,-66.43,-63.75,-66.5,-64.29,-66.84,-64.88,-67.15,-65.51,-67.58,-65.67,-67.95,-65.31,-68.37,-64.78,-68.68,-63.96,-68.91,-63.2,-69.23,-62.79,-69.62,-62.57,-69.99,-62.28,-70.38,-61.81,-70.72,-61.51,-71.09,-61.38,-72.01,-61.08,-72.38,-61,-72.77,-60.69,-73.17,-60.83,-73.7,-61.38,-74.11,-61.96,-74.44,-63.3,-74.58,-63.75,-74.93,-64.35,-75.26,-65.86,-75.64,-67.19,-75.79,-68.45,-76.01,-69.8,-76.22,-70.6,-76.63,-72.21,-76.67,-73.97,-76.63,-75.56,-76.71,-77.24,-76.71,-76.93,-77.1,-75.4,-77.28,-74.28,-77.56,-73.66,-77.91,-74.77,-78.22,-76.5,-78.12,-77.93,-78.38,-77.98,-78.79,-78.02,-79.18,-76.85,-79.51,-76.63,-79.89,-75.36,-80.26,-73.24,-80.42,-71.44,-80.69,-70.01,-81,-68.19,-81.32,-65.7,-81.47,-63.26,-81.75,-61.55,-82.04,-59.69,-82.38,-58.71,-82.85,-58.22,-83.22,-57.01,-82.87,-55.36,-82.57,-53.62,-82.26,-51.54,-82,-49.76,-81.73,-47.27,-81.71,-44.83,-81.85,-42.81,-82.08,-42.16,-81.65,-40.77,-81.36,-38.24,-81.34,-36.27,-81.12,-34.39,-80.91,-32.31,-80.77,-30.1,-80.59,-28.55,-80.34,-29.25,-79.99,-29.69,-79.63,-29.69,-79.26,-31.62,-79.3,-33.68,-79.46,-35.64,-79.46,-35.91,-79.08,-35.78,-78.34,-35.33,-78.12,-33.9,-77.89,-32.21,-77.65,-31,-77.36,-29.78,-77.07,-28.88,-76.67,-27.51,-76.5,-26.16,-76.36,-25.47,-76.28,-23.93,-76.24,-22.46,-76.11,-21.22,-75.91,-20.01,-75.67,-18.91,-75.44,-17.52,-75.13,-16.64,-74.79,-15.7,-74.5,-15.41,-74.11,-16.47,-73.87,-16.11,-73.46,-15.45,-73.15,-14.41,-72.95,-13.31,-72.72,-12.29,-72.4,-11.51,-72.01,-11.02,-71.54,-10.3,-71.27,-9.1,-71.32,-8.61,-71.66,-7.42,-71.7,-7.38,-71.32,-6.87,-70.93,-5.79,-71.03,-5.54,-71.4,-4.34,-71.46,-3.05,-71.29,-1.8,-71.17,-.66,-71.23,-.23,-71.64,.87,-71.3,1.89,-71.13,3.02,-70.99,4.14,-70.85,5.16,-70.62,6.27,-70.46,7.14,-70.25,7.74,-69.89,8.49,-70.15,9.53,-70.01,10.25,-70.48,10.82,-70.83,11.95,-70.64,12.4,-70.25,13.42,-69.97,14.73,-70.03,15.13,-70.4,15.95,-70.03,17.03,-69.91,18.2,-69.87,19.26,-69.89,20.38,-70.01,21.45,-70.07,21.92,-70.4,22.57,-70.7,23.67,-70.52,24.84,-70.48,25.98,-70.48,27.09,-70.46,28.09,-70.32,29.15,-70.21,30.03,-69.93,30.97,-69.76,31.99,-69.66,32.75,-69.38,33.3,-68.84,33.87,-68.5,34.91,-68.66,35.3,-69.01,36.16,-69.25,37.2,-69.17,37.91,-69.52,38.65,-69.78,39.67,-69.54,40.02,-69.11,40.92,-68.93,41.96,-68.6,42.94,-68.46,44.11,-68.27,44.9,-68.05,45.72,-67.82,46.5,-67.6,47.44,-67.72,48.34,-67.37,48.99,-67.09,49.93,-67.11,50.75,-66.88,50.95,-66.52,51.79,-66.25,52.61,-66.05,53.61,-65.9,54.53,-65.82,55.41,-65.88,56.36,-65.97,57.16,-66.25,57.26,-66.68,58.14,-67.01,58.74,-67.29,59.94,-67.41,60.61,-67.68,61.43,-67.95,62.39,-68.01,63.19,-67.82,64.05,-67.41,64.99,-67.62,65.97,-67.74,66.91,-67.86,67.89,-67.93,68.89,-67.93,69.71,-68.97,69.67,-69.23,69.56,-69.68,68.6,-69.93,67.81,-70.31,67.95,-70.7,69.07,-70.68,68.93,-71.07,68.42,-71.44,67.95,-71.85,68.71,-72.17,69.87,-72.26,71.02,-72.09,71.57,-71.7,71.91,-71.32,72.45,-71.01,73.08,-70.72,73.34,-70.36,73.86,-69.87,74.49,-69.78,75.63,-69.74,76.63,-69.62,77.64,-69.46,78.13,-69.07,78.43,-68.7,79.11,-68.33,80.09,-68.07,80.94,-67.88,81.48,-67.54,82.05,-67.37,82.78,-67.21,83.78,-67.31,84.68,-67.21,85.66,-67.09,86.75,-67.15,87.48,-66.88,87.99,-66.21,88.36,-66.48,88.83,-66.95,89.67,-67.15,90.63,-67.23,91.59,-67.11,92.61,-67.19,93.55,-67.21,94.18,-67.11,95.02,-67.17,95.78,-67.39,96.68,-67.25,97.76,-67.25,98.68,-67.11,99.72,-67.25,100.38,-66.92,100.89,-66.58,101.58,-66.31,102.83,-65.56,103.48,-65.7,104.24,-65.97,104.91,-66.33,106.18,-66.93,107.16,-66.95,108.08,-66.95,109.16,-66.84,110.24,-66.7,111.06,-66.43,111.74,-66.13,112.86,-66.09,113.6,-65.88,114.39,-66.07,114.9,-66.39,115.6,-66.7,116.7,-66.66,117.38,-66.92,118.58,-67.17,119.83,-67.27,120.87,-67.19,121.65,-66.88,122.32,-66.56,123.22,-66.48,124.12,-66.62,125.16,-66.72,126.1,-66.56,127,-66.56,127.88,-66.66,128.8,-66.76,129.7,-66.58,130.78,-66.43,131.8,-66.39,132.94,-66.39,133.86,-66.29,134.76,-66.21,135.03,-65.72,135.07,-65.31,135.7,-65.58,135.87,-66.03,136.21,-66.45,136.62,-66.78,137.46,-66.95,138.6,-66.9,139.91,-66.88,140.81,-66.82,142.12,-66.82,143.06,-66.8,144.37,-66.84,145.49,-66.92,146.2,-67.23,146,-67.6,146.65,-67.9,147.72,-68.13,148.84,-68.39,150.13,-68.56,151.48,-68.72,152.5,-68.87,153.64,-68.89,154.28,-68.56,155.17,-68.84,155.93,-69.15,156.81,-69.38,158.03,-69.48,159.18,-69.6,159.67,-69.99,160.81,-70.23,161.57,-70.58,162.69,-70.74,163.84,-70.72,164.92,-70.78,166.11,-70.76,167.31,-70.83,168.43,-70.97,169.46,-71.21,170.5,-71.4,171.21,-71.7,171.09,-72.09,170.56,-72.44,170.11,-72.89,169.76,-73.24,169.29,-73.66,167.98,-73.81,167.39,-74.17,166.09,-74.38,165.64,-74.77,164.96,-75.15,164.23,-75.46,163.82,-75.87,163.57,-76.24,163.47,-76.69,163.49,-77.07,164.06,-77.46,164.27,-77.83,164.74,-78.18,166.6,-78.32,167,-78.75,165.19,-78.91,163.67,-79.12,161.77,-79.16,160.92,-79.73,160.75,-80.2,160.32,-80.57,159.79,-80.95,161.12,-81.28,161.63,-81.69,162.49,-82.06,163.71,-82.4,165.1,-82.71,166.6,-83.02,168.9,-83.34,169.4,-83.83,172.28,-84.04,172.48,-84.12,173.22,-84.41,175.99,-84.16,178.28,-84.47,180,-84.71,-179.94,-84.72,-179.06,-84.14,-177.26,-84.45,-177.14,-84.42,-176.08,-84.1,-175.95,-84.11,-175.83,-84.12,-174.38,-84.53,-173.12,-84.12,-172.89,-84.06,-169.95,-83.88,-169,-84.12,-168.53,-84.24,-167.02,-84.57,-164.18,-84.83,-161.93,-85.14,-158.07,-85.37,-155.19,-85.1,-150.94,-85.3,-148.53,-85.61,-145.89,-85.32,-143.11,-85.04,-142.89,-84.57,-146.83,-84.53,-150.06,-84.3,-150.9,-83.9,-153.59,-83.69,-153.41,-83.24,-153.04,-82.83,-152.67,-82.45,-152.86,-82.04,-154.53,-81.77,-155.29,-81.42,-156.84,-81.1,-154.41,-81.16,-152.1,-81,-150.65,-81.34,-148.87,-81.04,-147.22,-80.67,-146.42,-80.34,-146.77,-79.93,-148.06,-79.65,-149.53,-79.36,-151.59,-79.3,-153.39,-79.16,-155.33,-79.06,-155.98,-78.69,-157.27,-78.38,-158.05,-78.03,-158.37,-76.89,-157.88,-76.99,-156.97,-77.3,-155.33,-77.2,-153.74,-77.07,-152.92,-77.5,-151.33,-77.4,-150,-77.18,-148.75,-76.91,-147.61,-76.58,-146.1,-76.48,-146.14,-76.11,-146.5,-75.73,-146.2,-75.38,-144.91,-75.2,-144.32,-75.54,-142.79,-75.34,-141.64,-75.09,-140.21,-75.07,-138.86,-74.97,-137.51,-74.73,-136.43,-74.52,-135.21,-74.3,-134.43,-74.36,-133.75,-74.44,-132.26,-74.3,-130.93,-74.48,-129.55,-74.46,-128.24,-74.32,-126.89,-74.42,-125.4,-74.52,-124.01,-74.48,-122.56,-74.5,-121.07,-74.52,-119.7,-74.48,-118.68,-74.19,-117.47,-74.03,-116.22,-74.24,-115.02,-74.07,-113.94,-73.71,-113.3,-74.03,-112.95,-74.38,-112.3,-74.71,-111.26,-74.42,-110.07,-74.79,-108.71,-74.91,-107.56,-75.18,-106.15,-75.13,-104.88,-74.95,-103.37,-74.99,-102.02,-75.13,-100.65,-75.3,-100.12,-74.87,-100.76,-74.54,-101.25,-74.19,-102.55,-74.11,-103.11,-73.73,-103.33,-73.36,-103.68,-72.62,-102.92,-72.75,-101.61,-72.81,-100.31,-72.75,-99.14,-72.91,-98.12,-73.21,-97.69,-73.56,-96.34,-73.62,-95.04,-73.48,-93.67,-73.28,-92.44,-73.17,-91.42,-73.4,-90.09,-73.32,-89.23,-72.56,-88.42,-73.01,-87.27,-73.19,-86.01,-73.09,-85.19,-73.48,-83.88,-73.52,-82.67,-73.64,-81.47,-73.85,-80.69,-73.48,-80.3,-73.13,-79.3,-73.52,-77.93,-73.42,-76.91,-73.64,-76.22,-73.97,-74.89,-73.87,-73.85,-73.66,-72.83,-73.4,-71.62,-73.26,-70.21,-73.15,-68.94,-73.01,-67.96,-72.79,-67.37,-72.48,-67.13,-72.05,-67.25,-71.64,-67.56,-71.25,-67.92,-70.85,-68.23,-70.46,-68.49,-70.11,-68.54,-69.72,-68.45,-69.33,-67.98,-68.95,-67.58,-68.54,-67.43,-68.15,-67.62,-67.72,-67.74,-67.33,-67.25,-66.88,-66.7,-66.58,-66.06,-66.21,-65.37,-65.9,-64.57,-65.6,-64.18,-65.17,-63.63,-64.9,-63,-64.64,-62.04,-64.58,-61.41,-64.27,-60.71,-64.07,-59.89,-63.96,-59.16,-63.7,-58.59,-63.39,-57.81,-63.27,-57.22,-63.53,-57.6,-63.86,-58.61,-64.15],[68.94,-48.62,69.58,-48.94,70.53,-49.06,70.56,-49.25,70.28,-49.71,68.75,-49.77,68.72,-49.24,68.87,-48.83,68.94,-48.62],[145.4,-40.79,146.36,-41.14,146.91,-41,147.69,-40.81,148.29,-40.88,148.36,-42.06,148.02,-42.41,147.91,-43.21,147.56,-42.94,146.87,-43.63,146.66,-43.58,146.05,-43.55,145.43,-42.69,145.3,-42.03,144.72,-41.16,144.74,-40.7,145.4,-40.79],[143.56,-13.76,143.92,-14.55,144.56,-14.17,144.89,-14.59,145.37,-14.98,145.27,-15.43,145.49,-16.29,145.64,-16.78,145.89,-16.91,146.16,-17.76,146.06,-18.28,146.39,-18.96,147.47,-19.48,148.18,-19.96,148.85,-20.39,148.72,-20.63,149.29,-21.26,149.68,-22.34,150.08,-22.12,150.48,-22.56,150.73,-22.4,150.9,-23.46,151.61,-24.08,152.07,-24.46,152.86,-25.27,153.14,-26.07,153.16,-26.64,153.09,-27.26,153.57,-28.11,153.51,-29,153.34,-29.46,153.07,-30.35,153.09,-30.92,152.89,-31.64,152.45,-32.55,151.71,-33.04,151.34,-33.82,151.01,-34.31,150.71,-35.17,150.33,-35.67,150.08,-36.42,149.95,-37.11,150,-37.43,149.42,-37.77,148.3,-37.81,147.38,-38.22,146.92,-38.61,146.32,-39.04,145.49,-38.59,144.88,-38.42,145.03,-37.9,144.49,-38.09,143.61,-38.81,142.75,-38.54,142.18,-38.38,141.61,-38.31,140.64,-38.02,139.99,-37.4,139.81,-36.64,139.57,-36.14,139.08,-35.73,138.12,-35.61,138.45,-35.13,138.21,-34.38,137.72,-35.08,136.83,-35.26,137.35,-34.71,137.5,-34.13,137.89,-33.64,137.81,-32.9,137,-33.75,136.37,-34.09,135.99,-34.89,135.21,-34.48,135.24,-33.95,134.61,-33.22,134.09,-32.85,134.27,-32.62,132.99,-32.01,132.29,-31.98,131.33,-31.5,129.54,-31.59,128.24,-31.95,127.1,-32.28,126.15,-32.22,125.09,-32.73,124.22,-32.96,124.03,-33.48,123.66,-33.89,122.81,-33.91,122.18,-34,121.3,-33.82,120.58,-33.93,119.89,-33.98,119.3,-34.51,119.01,-34.46,118.51,-34.75,118.02,-35.06,117.3,-35.03,116.63,-35.03,115.56,-34.39,115.03,-34.2,115.05,-33.62,115.55,-33.49,115.71,-33.26,115.68,-32.9,115.8,-32.21,115.69,-31.61,115.16,-30.6,115,-30.03,115.04,-29.46,114.64,-28.81,114.62,-28.52,114.17,-28.12,114.05,-27.33,113.48,-26.54,113.34,-26.12,113.78,-26.55,113.44,-25.62,113.94,-25.91,114.23,-26.3,114.22,-25.79,113.72,-25,113.63,-24.68,113.39,-24.38,113.5,-23.81,113.71,-23.56,113.84,-23.06,113.74,-22.48,114.15,-21.76,114.23,-22.52,114.65,-21.83,115.46,-21.5,115.95,-21.07,116.71,-20.7,117.17,-20.62,117.44,-20.75,118.23,-20.37,118.84,-20.26,118.99,-20.04,119.25,-19.95,119.81,-19.98,120.86,-19.68,121.4,-19.24,121.66,-18.71,122.24,-18.2,122.29,-17.8,122.31,-17.25,123.01,-16.41,123.43,-17.27,123.86,-17.07,123.5,-16.6,123.82,-16.11,124.26,-16.33,124.38,-15.57,124.93,-15.08,125.17,-14.68,125.67,-14.51,125.69,-14.23,126.13,-14.35,126.14,-14.1,126.58,-13.95,127.07,-13.82,127.8,-14.28,128.36,-14.87,128.99,-14.88,129.62,-14.97,129.41,-14.42,129.89,-13.62,130.34,-13.36,130.18,-13.11,130.62,-12.54,131.22,-12.18,131.74,-12.3,132.58,-12.11,132.56,-11.6,131.82,-11.27,132.36,-11.13,133.02,-11.38,133.55,-11.79,134.39,-12.04,134.68,-11.94,135.3,-12.25,135.88,-11.96,136.26,-12.05,136.49,-11.86,136.95,-12.35,136.69,-12.89,136.31,-13.29,135.96,-13.32,136.08,-13.72,135.78,-14.22,135.43,-14.72,135.5,-15,136.3,-15.55,137.07,-15.87,137.58,-16.22,138.3,-16.81,138.59,-16.81,139.11,-17.06,139.26,-17.37,140.22,-17.71,140.88,-17.37,141.07,-16.83,141.27,-16.39,141.4,-15.84,141.7,-15.04,141.56,-14.56,141.64,-14.27,141.52,-13.7,141.65,-12.94,141.84,-12.74,141.69,-12.41,141.93,-11.88,142.12,-11.33,142.14,-11.04,142.52,-10.67,142.8,-11.16,142.87,-11.78,143.12,-11.91,143.16,-12.33,143.52,-12.83,143.6,-13.4,143.56,-13.76],[16.98,48.12,16.9,47.71,16.34,47.71,16.53,47.5,16.2,46.85,16.01,46.68,15.14,46.66,14.63,46.43,13.81,46.51,12.38,46.77,12.15,47.12,11.16,46.94,11.05,46.75,10.44,46.89,9.93,46.92,9.48,47.1,9.63,47.35,9.59,47.53,9.9,47.58,10.4,47.3,10.54,47.57,11.43,47.52,12.14,47.7,12.62,47.67,12.93,47.47,13.03,47.64,12.88,48.29,13.24,48.42,13.6,48.88,14.34,48.56,14.9,48.96,15.25,49.04,16.03,48.73,16.5,48.79,16.96,48.6,16.88,48.47,16.98,48.12],[45,39.74,45.3,39.47,45.74,39.47,45.74,39.32,46.14,38.74,45.46,38.87,44.95,39.34,44.79,39.71,45,39.74],[47.37,41.22,47.82,41.15,47.99,41.41,48.58,41.81,49.11,41.28,49.62,40.57,50.08,40.53,50.39,40.26,49.57,40.18,49.4,39.4,49.22,39.05,48.86,38.82,48.88,38.32,48.63,38.27,48.01,38.79,48.36,39.29,48.06,39.58,47.69,39.51,46.51,38.77,46.48,39.46,46.03,39.63,45.61,39.9,45.89,40.22,45.36,40.56,45.56,40.81,45.18,40.99,44.97,41.25,45.22,41.41,45.96,41.12,46.5,41.06,46.64,41.18,46.15,41.72,46.4,41.86,46.69,41.83,47.37,41.22],[29.34,-4.5,29.28,-3.29,29.02,-2.84,29.63,-2.92,29.94,-2.35,30.47,-2.41,30.53,-2.81,30.74,-3.03,30.75,-3.36,30.51,-3.57,30.12,-4.09,29.75,-4.45,29.34,-4.5],[3.31,51.35,4.05,51.27,4.97,51.48,5.61,51.04,6.16,50.8,6.04,50.13,5.78,50.09,5.67,49.53,4.8,49.99,4.29,49.91,3.59,50.38,3.12,50.78,2.66,50.8,2.51,51.15,3.31,51.35],[2.69,6.26,1.87,6.14,1.62,6.83,1.66,9.13,1.46,9.33,1.43,9.83,1.08,10.18,.77,10.47,.9,11,1.24,11.11,1.45,11.55,1.94,11.64,2.15,11.94,2.49,12.23,2.85,12.24,3.61,11.66,3.57,11.33,3.8,10.73,3.6,10.33,3.71,10.06,3.22,9.44,2.91,9.14,2.72,8.51,2.75,7.87,2.69,6.26],[-2.83,9.64,-3.51,9.9,-3.98,9.86,-4.33,9.61,-4.78,9.82,-4.95,10.15,-5.4,10.37,-5.47,10.95,-5.2,11.38,-5.22,11.71,-4.43,12.54,-4.28,13.23,-4.01,13.47,-3.52,13.34,-3.1,13.54,-2.97,13.8,-2.19,14.25,-2,14.56,-1.07,14.97,-.52,15.12,-.27,14.92,.37,14.93,.3,14.44,.43,13.99,.99,13.34,1.02,12.85,2.18,12.63,2.15,11.94,1.94,11.64,1.45,11.55,1.24,11.11,.9,11,.02,11.02,-.44,11.1,-.76,10.94,-1.2,11.01,-2.94,10.96,-2.96,10.4,-2.83,9.64],[92.67,22.04,92.65,21.32,92.3,21.48,92.37,20.67,92.08,21.19,92.03,21.7,91.83,22.18,91.42,22.77,90.5,22.81,90.59,22.39,90.27,21.84,89.85,22.04,89.7,21.86,89.42,21.97,89.03,22.06,88.88,22.88,88.53,23.63,88.7,24.23,88.08,24.5,88.31,24.87,88.93,25.24,88.21,25.77,88.56,26.45,89.36,26.01,89.83,25.97,89.92,25.27,90.87,25.13,91.8,25.15,92.38,24.98,91.92,24.13,91.47,24.07,91.16,23.5,91.71,22.99,91.87,23.62,92.15,23.63,92.67,22.04],[22.66,44.23,22.94,43.82,23.33,43.9,24.1,43.74,25.57,43.69,26.07,43.94,27.24,44.18,27.97,43.81,28.56,43.71,28.04,43.29,27.67,42.58,28,42.01,27.14,42.14,26.12,41.83,26.11,41.33,25.2,41.23,24.49,41.58,23.69,41.31,22.95,41.34,22.88,42,22.38,42.32,22.55,42.46,22.44,42.58,22.6,42.9,22.99,43.21,22.5,43.64,22.41,44.01,22.66,44.23],[-77.53,23.76,-77.78,23.71,-78.03,24.29,-78.41,24.58,-78.19,25.21,-77.89,25.17,-77.54,24.34,-77.53,23.76],[-77.82,26.58,-78.91,26.42,-78.98,26.79,-78.51,26.87,-77.85,26.84,-77.82,26.58],[-77,26.59,-77.17,25.88,-77.36,26.01,-77.34,26.53,-77.79,26.93,-77.79,27.04,-77,26.59],[19.01,44.86,19.37,44.86,19.12,44.42,19.6,44.04,19.45,43.57,19.22,43.52,19.03,43.43,18.71,43.2,18.56,42.65,17.67,43.03,17.3,43.45,16.92,43.67,16.46,44.04,16.24,44.35,15.75,44.82,15.96,45.23,16.32,45,16.53,45.21,17,45.23,17.86,45.07,18.55,45.08,19.01,44.86],[23.48,53.91,24.45,53.91,25.54,54.28,25.77,54.85,26.59,55.17,26.49,55.62,27.1,55.78,28.18,56.17,29.23,55.92,29.37,55.67,29.9,55.79,30.87,55.55,30.97,55.08,30.76,54.81,31.38,54.16,31.79,53.97,31.73,53.79,32.41,53.62,32.69,53.35,32.3,53.13,31.5,53.17,31.31,53.07,31.54,52.74,31.79,52.1,30.93,52.04,30.62,51.82,30.56,51.32,30.16,51.42,29.25,51.37,28.99,51.6,28.62,51.43,28.24,51.57,27.45,51.59,26.34,51.83,25.33,51.91,24.55,51.89,24.01,51.62,23.53,51.58,23.51,52.02,23.2,52.49,23.8,52.69,23.8,53.09,23.53,53.47,23.48,53.91],[-89.14,17.81,-89.15,17.96,-89.03,18,-88.85,17.88,-88.49,18.49,-88.3,18.5,-88.3,18.35,-88.11,18.35,-88.12,18.08,-88.29,17.64,-88.2,17.49,-88.3,17.13,-88.24,17.04,-88.36,16.53,-88.55,16.27,-88.73,16.23,-88.93,15.89,-89.23,15.89,-89.15,17.02,-89.14,17.81],[-62.85,-22.03,-63.99,-21.99,-64.38,-22.8,-64.96,-22.08,-66.27,-21.83,-67.11,-22.74,-67.83,-22.87,-68.22,-21.49,-68.76,-20.37,-68.44,-19.41,-68.97,-18.98,-69.1,-18.26,-69.59,-17.58,-68.96,-16.5,-69.39,-15.66,-69.16,-15.32,-69.34,-14.95,-68.95,-14.45,-68.93,-13.6,-68.88,-12.9,-68.67,-12.56,-69.53,-10.95,-68.79,-11.04,-68.27,-11.01,-68.05,-10.71,-67.17,-10.31,-66.65,-9.93,-65.34,-9.76,-65.44,-10.51,-65.32,-10.9,-65.4,-11.57,-64.32,-12.46,-63.2,-12.63,-62.8,-13,-62.13,-13.2,-61.71,-13.49,-61.08,-13.48,-60.5,-13.78,-60.46,-14.35,-60.26,-14.65,-60.25,-15.08,-60.54,-15.09,-60.16,-16.26,-58.24,-16.3,-58.39,-16.88,-58.28,-17.27,-57.73,-17.55,-57.5,-18.17,-57.68,-18.96,-57.95,-19.4,-57.85,-19.97,-58.17,-20.18,-58.18,-19.87,-59.12,-19.36,-60.04,-19.34,-61.79,-19.63,-62.27,-20.51,-62.29,-21.05,-62.69,-22.25,-62.85,-22.03],[-57.63,-30.22,-56.29,-28.85,-55.16,-27.88,-54.49,-27.47,-53.65,-26.92,-53.63,-26.12,-54.13,-25.55,-54.63,-25.74,-54.43,-25.16,-54.29,-24.57,-54.29,-24.02,-54.65,-23.84,-55.03,-24,-55.4,-23.96,-55.52,-23.57,-55.61,-22.66,-55.8,-22.36,-56.47,-22.09,-56.88,-22.28,-57.94,-22.09,-57.87,-20.73,-58.17,-20.18,-57.85,-19.97,-57.95,-19.4,-57.68,-18.96,-57.5,-18.17,-57.73,-17.55,-58.28,-17.27,-58.39,-16.88,-58.24,-16.3,-60.16,-16.26,-60.54,-15.09,-60.25,-15.08,-60.26,-14.65,-60.46,-14.35,-60.5,-13.78,-61.08,-13.48,-61.71,-13.49,-62.13,-13.2,-62.8,-13,-63.2,-12.63,-64.32,-12.46,-65.4,-11.57,-65.32,-10.9,-65.44,-10.51,-65.34,-9.76,-66.65,-9.93,-67.17,-10.31,-68.05,-10.71,-68.27,-11.01,-68.79,-11.04,-69.53,-10.95,-70.09,-11.12,-70.55,-11.01,-70.48,-9.49,-71.3,-10.08,-72.18,-10.05,-72.56,-9.52,-73.23,-9.46,-73.02,-9.03,-73.57,-8.42,-73.99,-7.52,-73.72,-7.34,-73.72,-6.92,-73.12,-6.63,-73.22,-6.09,-72.96,-5.74,-72.89,-5.27,-71.75,-4.59,-70.93,-4.4,-70.79,-4.25,-69.89,-4.3,-69.44,-1.56,-69.42,-1.12,-69.58,-.55,-70.02,-.19,-70.02,.54,-69.45,.71,-69.25,.6,-69.22,.99,-69.8,1.09,-69.82,1.71,-67.87,1.69,-67.54,2.04,-67.26,1.72,-67.07,1.13,-66.88,1.25,-66.33,.72,-65.55,.79,-65.35,1.1,-64.61,1.33,-64.2,1.49,-64.08,1.92,-63.37,2.2,-63.42,2.41,-64.27,2.5,-64.41,3.13,-64.37,3.8,-64.82,4.06,-64.63,4.15,-63.89,4.02,-63.09,3.77,-62.8,4.01,-62.09,4.16,-60.97,4.54,-60.6,4.92,-60.73,5.2,-60.21,5.24,-59.98,5.01,-60.11,4.57,-59.77,4.42,-59.54,3.96,-59.82,3.61,-59.97,2.76,-59.72,2.25,-59.65,1.79,-59.03,1.32,-58.54,1.27,-58.43,1.46,-58.11,1.51,-57.66,1.68,-57.34,1.95,-56.78,1.86,-56.54,1.9,-56,1.82,-55.91,2.02,-56.07,2.22,-55.97,2.51,-55.57,2.42,-55.1,2.52,-54.52,2.31,-54.09,2.11,-53.78,2.38,-53.55,2.33,-53.42,2.05,-52.94,2.12,-52.56,2.5,-52.25,3.24,-51.66,4.16,-51.32,4.2,-51.07,3.65,-50.51,1.9,-49.97,1.74,-49.95,1.05,-50.7,.22,-50.39,-.08,-48.62,-.24,-48.58,-1.24,-47.82,-.58,-46.57,-.94,-44.91,-1.55,-44.42,-2.14,-44.58,-2.69,-43.42,-2.38,-41.47,-2.91,-39.98,-2.87,-38.5,-3.7,-37.22,-4.82,-36.45,-5.11,-35.6,-5.15,-35.24,-5.46,-34.9,-6.74,-34.73,-7.34,-35.13,-9,-35.64,-9.65,-37.05,-11.04,-37.68,-12.17,-38.42,-13.04,-38.67,-13.06,-38.95,-13.79,-38.88,-15.67,-39.16,-17.21,-39.27,-17.87,-39.58,-18.26,-39.76,-19.6,-40.77,-20.9,-40.94,-21.94,-41.75,-22.37,-41.99,-22.97,-43.07,-22.97,-44.65,-23.35,-45.35,-23.8,-46.47,-24.09,-47.65,-24.89,-48.5,-25.88,-48.64,-26.62,-48.47,-27.18,-48.66,-28.19,-48.89,-28.67,-49.59,-29.22,-50.7,-30.98,-51.58,-31.78,-52.26,-32.25,-52.71,-33.2,-53.37,-33.77,-53.65,-33.2,-53.21,-32.73,-53.79,-32.05,-54.57,-31.49,-55.6,-30.85,-55.97,-30.88,-56.98,-30.11,-57.63,-30.22],[114.2,4.53,114.6,4.9,115.45,5.45,115.41,4.96,115.35,4.32,114.87,4.35,114.66,4.01,114.2,4.53],[91.7,27.77,92.1,27.45,92.03,26.84,91.22,26.81,90.37,26.88,89.74,26.72,88.84,27.1,88.81,27.3,89.48,28.04,90.02,28.3,90.73,28.06,91.26,28.04,91.7,27.77],[25.65,-18.54,25.85,-18.71,26.16,-19.29,27.3,-20.39,27.72,-20.5,27.73,-20.85,28.02,-21.49,28.79,-21.64,29.43,-22.09,28.02,-22.83,27.12,-23.57,26.79,-24.24,26.49,-24.62,25.94,-24.7,25.77,-25.17,25.66,-25.49,25.03,-25.72,24.21,-25.67,23.73,-25.39,23.31,-25.27,22.82,-25.5,22.58,-25.98,22.11,-26.28,21.61,-26.73,20.89,-26.83,20.67,-26.48,20.76,-25.87,20.17,-24.92,19.9,-24.77,19.9,-21.85,20.88,-21.81,20.91,-18.25,21.66,-18.22,23.2,-17.87,23.58,-18.28,24.22,-17.89,24.52,-17.89,25.08,-17.66,25.26,-17.74,25.65,-18.54],[15.28,7.42,16.11,7.5,16.29,7.75,16.46,7.73,16.71,7.51,17.96,7.89,18.39,8.28,18.91,8.63,18.81,8.98,19.09,9.07,20.06,9.01,21,9.48,21.72,10.57,22.23,10.97,22.86,11.14,22.98,10.71,23.55,10.09,23.56,9.68,23.39,9.27,23.46,8.95,23.81,8.67,24.57,8.23,25.11,7.83,25.12,7.5,25.8,6.98,26.21,6.55,26.47,5.95,27.21,5.55,27.37,5.23,27.04,5.13,26.4,5.15,25.65,5.26,25.28,5.17,25.13,4.93,24.81,4.9,24.41,5.11,23.3,4.61,22.84,4.71,22.7,4.63,22.41,4.03,21.66,4.22,20.93,4.32,20.29,4.69,19.47,5.03,18.93,4.71,18.54,4.2,18.45,3.5,17.81,3.56,17.13,3.73,16.54,3.2,16.01,2.27,15.91,2.56,15.86,3.01,15.41,3.34,15.04,3.85,14.95,4.21,14.48,4.73,14.56,5.03,14.46,5.45,14.54,6.23,14.78,6.41,15.28,7.42],[-63.66,46.55,-62.94,46.42,-62.01,46.44,-62.5,46.03,-62.87,45.97,-64.14,46.39,-64.39,46.73,-64.01,47.04,-63.66,46.55],[-61.81,49.11,-62.29,49.09,-63.59,49.4,-64.52,49.87,-64.17,49.96,-62.86,49.71,-61.84,49.29,-61.81,49.11],[-123.51,48.51,-124.01,48.37,-125.66,48.83,-125.95,49.18,-126.85,49.53,-127.03,49.81,-128.06,49.99,-128.44,50.54,-128.36,50.77,-127.31,50.55,-126.7,50.4,-125.76,50.3,-125.42,49.95,-124.92,49.48,-123.92,49.06,-123.51,48.51],[-56.13,50.69,-56.8,49.81,-56.14,50.15,-55.47,49.94,-55.82,49.59,-54.94,49.31,-54.47,49.56,-53.48,49.25,-53.79,48.52,-53.09,48.69,-52.96,48.16,-52.65,47.54,-53.07,46.66,-53.52,46.62,-54.18,46.81,-53.96,47.63,-54.24,47.75,-55.4,46.88,-56,46.92,-55.29,47.39,-56.25,47.63,-57.33,47.57,-59.27,47.6,-59.42,47.9,-58.8,48.25,-59.23,48.52,-58.39,49.13,-57.36,50.72,-56.74,51.29,-55.87,51.63,-55.41,51.59,-55.6,51.32,-56.13,50.69],[-132.71,54.04,-131.75,54.12,-132.05,52.98,-131.18,52.18,-131.58,52.18,-132.18,52.64,-132.55,53.1,-133.05,53.41,-133.24,53.85,-133.18,54.17,-132.71,54.04],[-79.27,62.16,-79.66,61.63,-80.1,61.72,-80.36,62.02,-80.32,62.09,-79.93,62.39,-79.52,62.36,-79.27,62.16],[-81.9,62.71,-83.07,62.16,-83.77,62.18,-83.99,62.45,-83.25,62.91,-81.88,62.9,-81.9,62.71],[-85.16,65.66,-84.98,65.22,-84.46,65.37,-83.88,65.11,-82.79,64.77,-81.64,64.46,-81.55,63.98,-80.82,64.06,-80.1,63.73,-80.99,63.41,-82.55,63.65,-83.11,64.1,-84.1,63.57,-85.52,63.05,-85.87,63.64,-87.22,63.54,-86.35,64.04,-86.22,64.82,-85.88,65.74,-85.16,65.66],[-75.87,67.15,-76.99,67.1,-77.24,67.59,-76.81,68.15,-75.9,68.29,-75.11,68.01,-75.1,67.58,-75.22,67.44,-75.87,67.15],[-95.65,69.11,-96.27,68.76,-97.62,69.06,-98.43,68.95,-99.8,69.4,-98.92,69.71,-98.22,70.14,-97.16,69.86,-96.56,69.68,-96.26,69.49,-95.65,69.11],[-90.55,69.5,-90.55,68.47,-89.22,69.26,-88.02,68.62,-88.32,67.87,-87.35,67.2,-86.31,67.92,-85.58,68.78,-85.52,69.88,-84.1,69.81,-82.62,69.66,-81.28,69.16,-81.22,68.67,-81.96,68.13,-81.26,67.6,-81.39,67.11,-83.34,66.41,-84.74,66.26,-85.77,66.56,-86.07,66.06,-87.03,65.21,-87.32,64.78,-88.48,64.1,-89.91,64.03,-90.7,63.61,-90.77,62.96,-91.93,62.84,-93.16,62.02,-94.24,60.9,-94.63,60.11,-94.68,58.95,-93.22,58.78,-92.76,57.85,-92.3,57.09,-90.9,57.28,-89.04,56.85,-88.04,56.47,-87.32,56,-86.07,55.72,-85.01,55.3,-83.36,55.24,-82.27,55.15,-82.44,54.28,-82.13,53.28,-81.4,52.16,-79.91,51.21,-79.14,51.53,-78.6,52.56,-79.12,54.14,-79.83,54.67,-78.23,55.14,-77.1,55.84,-76.54,56.53,-76.62,57.2,-77.3,58.05,-78.52,58.8,-77.34,59.85,-77.77,60.76,-78.11,62.32,-77.41,62.55,-75.7,62.28,-74.67,62.18,-73.84,62.44,-72.91,62.11,-71.68,61.53,-71.37,61.14,-69.59,61.06,-69.62,60.22,-69.29,58.96,-68.37,58.8,-67.65,58.21,-66.2,58.77,-65.25,59.87,-64.58,60.34,-63.8,59.44,-62.5,58.17,-61.4,56.97,-61.8,56.34,-60.47,55.78,-59.57,55.2,-57.98,54.95,-57.33,54.63,-56.94,53.78,-56.16,53.65,-55.76,53.27,-55.68,52.15,-56.41,51.77,-57.13,51.42,-58.77,51.06,-60.03,50.24,-61.72,50.08,-63.86,50.29,-65.36,50.3,-66.4,50.23,-67.24,49.51,-68.51,49.07,-69.95,47.74,-71.1,46.82,-70.26,46.99,-68.65,48.3,-66.55,49.13,-65.06,49.23,-64.17,48.74,-65.12,48.07,-64.8,46.99,-64.47,46.24,-63.17,45.74,-61.52,45.88,-60.52,47.01,-60.45,46.28,-59.8,45.92,-61.04,45.27,-63.25,44.67,-64.25,44.27,-65.36,43.55,-66.12,43.62,-66.16,44.47,-64.43,45.29,-66.03,45.26,-67.14,45.14,-67.79,45.7,-67.79,47.07,-68.23,47.35,-68.9,47.19,-69.24,47.45,-70,46.69,-70.31,45.92,-70.66,45.46,-71.08,45.31,-71.4,45.26,-71.51,45.01,-73.35,45.01,-74.87,45,-75.32,44.82,-76.37,44.1,-76.5,44.02,-76.82,43.63,-77.74,43.63,-78.72,43.63,-79.17,43.47,-79.01,43.27,-78.92,42.97,-78.94,42.86,-80.25,42.37,-81.28,42.21,-82.44,41.68,-82.69,41.68,-83.03,41.83,-83.14,41.98,-83.12,42.08,-82.9,42.43,-82.43,42.98,-82.14,43.57,-82.34,44.44,-82.55,45.35,-83.59,45.82,-83.47,45.99,-83.62,46.12,-83.89,46.12,-84.09,46.28,-84.14,46.51,-84.34,46.41,-84.6,46.44,-84.54,46.54,-84.78,46.64,-84.88,46.9,-85.65,47.22,-86.46,47.55,-87.44,47.94,-88.38,48.3,-89.27,48.02,-89.6,48.01,-90.83,48.27,-91.64,48.14,-92.61,48.45,-93.63,48.61,-94.33,48.67,-94.64,48.84,-94.82,49.39,-95.16,49.38,-95.16,49,-97.23,49,-100.65,49,-104.05,49,-107.05,49,-110.05,49,-113,49,-116.05,49,-117.03,49,-120,49,-122.84,49,-122.97,49,-124.91,49.98,-125.62,50.42,-127.44,50.83,-127.99,51.72,-127.85,52.33,-129.13,52.76,-129.31,53.56,-130.51,54.29,-130.54,54.8,-129.98,55.29,-130.01,55.92,-131.71,56.55,-132.73,57.69,-133.36,58.41,-134.27,58.86,-134.94,59.27,-135.48,59.79,-136.48,59.46,-137.45,58.91,-138.34,59.56,-139.04,60,-140.01,60.28,-141,60.31,-140.99,66,-140.99,69.71,-139.12,69.47,-137.55,68.99,-136.5,68.9,-135.63,69.32,-134.41,69.63,-132.93,69.51,-131.43,69.94,-129.79,70.19,-129.11,69.78,-128.36,70.01,-128.14,70.48,-127.45,70.38,-125.76,69.48,-124.42,70.16,-124.29,69.4,-123.06,69.56,-122.68,69.86,-121.47,69.8,-119.94,69.38,-117.6,69.01,-116.23,68.84,-115.25,68.91,-113.9,68.4,-115.3,67.9,-113.5,67.69,-110.8,67.81,-109.95,67.98,-108.88,67.38,-107.79,67.89,-108.81,68.31,-108.17,68.65,-106.95,68.7,-106.15,68.8,-105.34,68.56,-104.34,68.02,-103.22,68.1,-101.45,67.65,-99.9,67.81,-98.44,67.78,-98.56,68.4,-97.67,68.58,-96.12,68.24,-96.13,67.29,-95.49,68.09,-94.68,68.06,-94.23,69.07,-95.3,69.69,-96.47,70.09,-96.39,71.19,-95.21,71.92,-93.89,71.76,-92.88,71.32,-91.52,70.19,-92.41,69.7,-90.55,69.5],[-114.17,73.12,-114.67,72.65,-112.44,72.96,-111.05,72.45,-109.92,72.96,-109.01,72.63,-108.19,71.65,-107.69,72.07,-108.4,73.09,-107.52,73.24,-106.52,73.08,-105.4,72.67,-104.77,71.7,-104.46,70.99,-102.79,70.5,-100.98,70.02,-101.09,69.58,-102.73,69.5,-102.09,69.12,-102.43,68.75,-104.24,68.91,-105.96,69.18,-107.12,69.12,-109,68.78,-111.53,68.63,-113.31,68.54,-113.85,69.01,-115.22,69.28,-116.11,69.17,-117.34,69.96,-116.67,70.07,-115.13,70.24,-113.72,70.19,-112.42,70.37,-114.35,70.6,-116.49,70.52,-117.9,70.54,-118.43,70.91,-116.11,71.31,-117.66,71.3,-119.4,71.56,-118.56,72.31,-117.87,72.71,-115.19,73.31,-114.17,73.12],[-104.5,73.42,-105.38,72.76,-106.94,73.46,-106.6,73.6,-105.26,73.64,-104.5,73.42],[-76.34,73.1,-76.25,72.83,-77.31,72.86,-78.39,72.88,-79.49,72.74,-79.78,72.8,-80.88,73.33,-80.83,73.69,-80.35,73.76,-78.06,73.65,-76.34,73.1],[-86.56,73.16,-85.77,72.53,-84.85,73.34,-82.32,73.75,-80.6,72.72,-80.75,72.06,-78.77,72.35,-77.82,72.75,-75.61,72.24,-74.23,71.77,-74.1,71.33,-72.24,71.56,-71.2,70.92,-68.79,70.53,-67.91,70.12,-66.97,69.19,-68.81,68.72,-66.45,68.07,-64.86,67.85,-63.42,66.93,-61.85,66.86,-62.16,66.16,-63.92,65,-65.15,65.43,-66.72,66.39,-68.02,66.26,-68.14,65.69,-67.09,65.11,-65.73,64.65,-65.32,64.38,-64.67,63.39,-65.01,62.67,-66.28,62.95,-68.78,63.75,-67.37,62.88,-66.33,62.28,-66.17,61.93,-68.88,62.33,-71.02,62.91,-72.24,63.4,-71.89,63.68,-73.38,64.19,-74.83,64.68,-74.82,64.39,-77.71,64.23,-78.56,64.57,-77.9,65.31,-76.02,65.33,-73.96,65.45,-74.29,65.81,-73.94,66.31,-72.65,67.28,-72.93,67.73,-73.31,68.07,-74.84,68.55,-76.87,68.89,-76.23,69.15,-77.29,69.77,-78.17,69.83,-78.96,70.17,-79.49,69.87,-81.31,69.74,-84.94,69.97,-87.06,70.26,-88.68,70.41,-89.51,70.76,-88.47,71.22,-89.89,71.22,-90.21,72.24,-89.44,73.13,-88.41,73.54,-85.83,73.8,-86.56,73.16],[-100.36,73.84,-99.16,73.63,-97.38,73.76,-97.12,73.47,-98.05,72.99,-96.54,72.56,-96.72,71.66,-98.36,71.27,-99.32,71.36,-100.01,71.74,-102.5,72.51,-102.48,72.83,-100.44,72.71,-101.54,73.36,-100.36,73.84],[-93.2,72.77,-94.27,72.02,-95.41,72.06,-96.03,72.94,-96.02,73.44,-95.5,73.86,-94.5,74.13,-92.42,74.1,-90.51,73.86,-92,72.97,-93.2,72.77],[-120.46,71.38,-123.09,70.9,-123.62,71.34,-125.93,71.87,-125.5,72.29,-124.81,73.02,-123.94,73.68,-124.92,74.29,-121.54,74.45,-120.11,74.24,-117.56,74.19,-116.58,73.9,-115.51,73.48,-116.77,73.22,-119.22,72.52,-120.46,71.82,-120.46,71.38],[-93.61,74.98,-94.16,74.59,-95.61,74.67,-96.82,74.93,-96.29,75.38,-94.85,75.65,-93.98,75.3,-93.61,74.98],[-98.5,76.72,-97.74,76.26,-97.7,75.74,-98.16,75,-99.81,74.9,-100.88,75.06,-100.86,75.64,-102.5,75.56,-102.57,76.34,-101.49,76.31,-99.98,76.65,-98.58,76.59,-98.5,76.72],[-108.21,76.2,-107.82,75.85,-106.93,76.01,-105.88,75.97,-105.7,75.48,-106.31,75.01,-109.7,74.85,-112.22,74.42,-113.74,74.39,-113.87,74.72,-111.79,75.16,-116.31,75.04,-117.71,75.22,-116.35,76.2,-115.4,76.48,-112.59,76.14,-110.81,75.55,-109.07,75.47,-110.5,76.43,-109.58,76.79,-108.55,76.68,-108.21,76.2],[-94.68,77.1,-93.57,76.78,-91.61,76.78,-90.74,76.45,-90.97,76.07,-89.82,75.85,-89.19,75.61,-87.84,75.57,-86.38,75.48,-84.79,75.7,-82.75,75.78,-81.13,75.71,-80.06,75.34,-79.83,74.92,-80.46,74.66,-81.95,74.44,-83.23,74.56,-86.1,74.41,-88.15,74.39,-89.76,74.52,-92.42,74.84,-92.77,75.39,-92.89,75.88,-93.89,76.32,-95.96,76.44,-97.12,76.75,-96.75,77.16,-94.68,77.1],[-116.2,77.65,-116.34,76.88,-117.11,76.53,-118.04,76.48,-119.9,76.05,-121.5,75.9,-122.85,76.12,-121.16,76.86,-119.1,77.51,-117.57,77.5,-116.2,77.65],[-93.84,77.52,-94.3,77.49,-96.17,77.56,-96.44,77.83,-94.42,77.82,-93.72,77.63,-93.84,77.52],[-110.19,77.7,-112.05,77.41,-113.53,77.73,-112.72,78.05,-111.26,78.15,-109.85,78,-110.19,77.7],[-109.66,78.6,-110.88,78.41,-112.54,78.41,-112.53,78.55,-111.5,78.85,-110.96,78.8,-109.66,78.6],[-95.83,78.06,-97.31,77.85,-98.12,78.08,-98.55,78.46,-98.63,78.87,-97.34,78.83,-96.75,78.77,-95.56,78.42,-95.83,78.06],[-100.06,78.32,-99.67,77.91,-101.3,78.02,-102.95,78.34,-105.18,78.38,-104.21,78.68,-105.42,78.92,-105.49,79.3,-103.53,79.17,-100.83,78.8,-100.06,78.32],[-87.02,79.66,-85.81,79.34,-87.19,79.04,-89.04,78.29,-90.8,78.22,-92.88,78.34,-93.95,78.75,-93.94,79.11,-93.15,79.38,-94.97,79.37,-96.08,79.71,-96.71,80.16,-96.02,80.6,-95.32,80.91,-94.3,80.98,-94.74,81.21,-92.41,81.26,-91.13,80.72,-89.45,80.51,-87.81,80.32,-87.02,79.66],[-68.5,83.11,-65.83,83.03,-63.68,82.9,-61.85,82.63,-61.89,82.36,-64.33,81.93,-66.75,81.73,-67.66,81.5,-65.48,81.51,-67.84,80.9,-69.47,80.62,-71.18,79.8,-73.24,79.63,-73.88,79.43,-76.91,79.32,-75.53,79.2,-76.22,79.02,-75.39,78.53,-76.34,78.18,-77.89,77.9,-78.36,77.51,-79.76,77.21,-79.62,76.98,-77.91,77.02,-77.89,76.78,-80.56,76.18,-83.17,76.45,-86.11,76.3,-87.6,76.42,-89.49,76.47,-89.62,76.95,-87.77,77.18,-88.26,77.9,-87.65,77.97,-84.98,77.54,-86.34,78.18,-87.96,78.37,-87.15,78.76,-85.38,79,-85.09,79.35,-86.51,79.74,-86.93,80.25,-84.2,80.21,-83.41,80.1,-81.85,80.46,-84.1,80.58,-87.6,80.52,-89.37,80.86,-90.2,81.26,-91.37,81.55,-91.59,81.89,-90.1,82.09,-88.93,82.12,-86.97,82.28,-85.5,82.65,-84.26,82.6,-83.18,82.32,-82.42,82.86,-81.1,83.02,-79.31,83.13,-76.25,83.17,-75.72,83.06,-72.83,83.23,-70.67,83.17,-68.5,83.11],[9.59,47.53,9.63,47.35,9.48,47.1,9.93,46.92,10.44,46.89,10.36,46.48,9.92,46.31,9.18,46.44,8.97,46.04,8.49,46.01,8.32,46.16,7.76,45.82,7.27,45.78,6.84,45.99,6.5,46.43,6.02,46.27,6.04,46.73,6.77,47.29,6.74,47.54,7.19,47.45,7.47,47.62,8.32,47.61,8.52,47.83,9.59,47.53],[-68.63,-52.64,-68.63,-54.87,-67.56,-54.87,-66.96,-54.9,-67.29,-55.3,-68.15,-55.61,-68.64,-55.58,-69.23,-55.5,-69.96,-55.2,-71.01,-55.05,-72.26,-54.5,-73.29,-53.96,-74.66,-52.84,-73.84,-53.05,-72.43,-53.72,-71.11,-54.07,-70.59,-53.62,-70.27,-52.93,-69.35,-52.52,-68.63,-52.64],[-68.22,-21.49,-67.83,-22.87,-67.11,-22.74,-66.99,-22.99,-67.33,-24.03,-68.42,-24.52,-68.39,-26.19,-68.59,-26.51,-68.3,-26.9,-69,-27.52,-69.66,-28.46,-70.01,-29.37,-69.92,-30.34,-70.54,-31.37,-70.07,-33.09,-69.81,-33.27,-69.82,-34.19,-70.39,-35.17,-70.36,-36.01,-71.12,-36.66,-71.12,-37.58,-70.81,-38.55,-71.41,-38.92,-71.68,-39.81,-71.92,-40.83,-71.75,-42.05,-72.15,-42.25,-71.92,-43.41,-71.46,-43.79,-71.79,-44.21,-71.33,-44.41,-71.22,-44.78,-71.66,-44.97,-71.55,-45.56,-71.92,-46.88,-72.45,-47.74,-72.33,-48.24,-72.65,-48.88,-73.42,-49.32,-73.33,-50.38,-72.98,-50.74,-72.31,-50.68,-72.33,-51.43,-71.91,-52.01,-69.5,-52.14,-68.57,-52.3,-69.46,-52.29,-69.94,-52.54,-70.85,-52.9,-71.01,-53.83,-71.43,-53.86,-72.56,-53.53,-73.7,-52.84,-74.95,-52.26,-75.26,-51.63,-74.98,-51.04,-75.48,-50.38,-75.61,-48.67,-75.18,-47.71,-74.13,-46.94,-75.64,-46.65,-74.69,-45.76,-74.35,-44.1,-73.24,-44.45,-72.72,-42.38,-73.39,-42.12,-73.7,-43.37,-74.33,-43.22,-74.02,-41.79,-73.68,-39.94,-73.22,-39.26,-73.51,-38.28,-73.59,-37.16,-73.17,-37.12,-72.55,-35.51,-71.86,-33.91,-71.44,-32.42,-71.67,-30.92,-71.37,-30.1,-71.49,-28.86,-70.91,-27.64,-70.72,-25.71,-70.4,-23.63,-70.09,-21.39,-70.16,-19.76,-70.37,-18.35,-69.86,-18.09,-69.59,-17.58,-69.1,-18.26,-68.97,-18.98,-68.44,-19.41,-68.76,-20.37,-68.22,-21.49],[110.34,18.68,109.48,18.2,108.66,18.51,108.63,19.37,109.12,19.82,110.21,20.1,110.79,20.08,111.01,19.7,110.57,19.26,110.34,18.68],[127.66,49.76,129.4,49.44,130.58,48.73,130.99,47.79,132.51,47.79,133.37,48.18,135.03,48.48,134.5,47.58,134.11,47.21,133.77,46.12,133.1,45.14,131.88,45.32,131.03,44.97,131.29,44.11,131.14,42.93,130.63,42.9,130.64,42.4,129.99,42.99,129.6,42.42,128.05,41.99,128.21,41.47,127.34,41.5,126.87,41.82,126.18,41.11,125.08,40.57,124.27,39.93,122.87,39.64,122.13,39.17,121.05,38.9,121.59,39.36,121.38,39.75,122.17,40.42,121.64,40.95,120.77,40.59,119.64,39.9,119.02,39.25,118.04,39.2,117.53,38.74,118.06,38.06,118.88,37.9,118.91,37.45,119.7,37.16,120.82,37.87,121.71,37.48,122.36,37.45,122.52,36.93,121.1,36.65,120.64,36.11,119.66,35.61,119.15,34.91,120.23,34.36,120.62,33.38,121.23,32.46,121.91,31.69,121.89,30.95,121.26,30.68,121.5,30.14,122.09,29.83,121.94,29.02,121.68,28.23,121.13,28.14,120.4,27.05,119.59,25.74,118.66,24.55,117.28,23.62,115.89,22.78,114.76,22.67,114.15,22.22,113.81,22.55,113.24,22.05,111.84,21.55,110.79,21.4,110.44,20.34,109.89,20.28,109.63,21.01,109.86,21.4,108.52,21.72,108.05,21.55,107.04,21.81,106.57,22.22,106.73,22.79,105.81,22.98,105.33,23.35,104.48,22.82,103.5,22.7,102.71,22.71,102.17,22.46,101.65,22.32,101.8,21.17,101.27,21.2,101.18,21.44,101.15,21.85,100.42,21.56,99.98,21.74,99.24,22.12,99.53,22.95,98.9,23.14,98.66,24.06,97.6,23.9,97.72,25.08,98.67,25.92,98.71,26.74,98.68,27.51,98.25,27.75,97.91,28.34,97.33,28.26,96.25,28.41,96.59,28.83,96.12,29.45,95.4,29.03,94.57,29.28,93.41,28.64,92.5,27.9,91.7,27.77,91.26,28.04,90.73,28.06,90.02,28.3,89.48,28.04,88.81,27.3,88.73,28.09,88.12,27.88,86.95,27.97,85.82,28.2,85.01,28.64,84.23,28.84,83.9,29.32,83.34,29.46,82.33,30.12,81.53,30.42,81.11,30.18,79.72,30.88,78.74,31.52,78.46,32.62,79.18,32.48,79.21,32.99,78.81,33.51,78.91,34.32,77.84,35.49,76.19,35.9,75.9,36.67,75.16,37.13,74.98,37.42,74.83,37.99,74.86,38.38,74.26,38.61,73.93,38.51,73.68,39.43,73.96,39.66,73.82,39.89,74.78,40.37,75.47,40.56,76.53,40.43,76.9,41.07,78.19,41.19,78.54,41.58,80.12,42.12,80.26,42.35,80.18,42.92,80.87,43.18,79.97,44.92,81.95,45.32,82.46,45.54,83.18,47.33,85.16,47,85.72,47.45,85.77,48.46,86.6,48.55,87.36,49.21,87.75,49.3,88.01,48.6,88.85,48.07,90.28,47.69,90.97,46.89,90.59,45.72,90.95,45.29,92.13,45.12,93.48,44.98,94.69,44.35,95.31,44.24,95.76,43.32,96.35,42.73,97.45,42.75,99.52,42.52,100.85,42.66,101.83,42.51,103.31,41.91,104.52,41.91,104.96,41.6,106.13,42.13,107.74,42.48,109.24,42.52,110.41,42.87,111.13,43.41,111.83,43.74,111.67,44.07,111.35,44.46,111.87,45.1,112.44,45.01,113.46,44.81,114.46,45.34,115.99,45.73,116.72,46.39,117.42,46.67,118.87,46.81,119.66,46.69,119.77,47.05,118.87,47.75,118.06,48.07,117.3,47.7,116.31,47.85,115.74,47.73,115.49,48.14,116.19,49.13,116.68,49.89,117.88,49.51,119.29,50.14,119.28,50.58,120.18,51.64,120.74,51.96,120.73,52.52,120.18,52.75,121,53.25,122.25,53.43,123.57,53.46,125.07,53.16,125.95,52.79,126.56,51.78,126.94,51.35,127.29,50.74,127.66,49.76],[-2.86,4.99,-3.31,4.98,-4.01,5.18,-4.65,5.17,-5.83,4.99,-6.53,4.71,-7.52,4.34,-7.71,4.36,-7.64,5.19,-7.54,5.31,-7.57,5.71,-7.99,6.13,-8.31,6.19,-8.6,6.47,-8.39,6.91,-8.49,7.4,-8.44,7.69,-8.28,7.69,-8.22,8.12,-8.3,8.32,-8.2,8.46,-7.83,8.58,-8.08,9.38,-8.31,9.79,-8.23,10.13,-8.03,10.21,-7.9,10.3,-7.62,10.15,-6.85,10.14,-6.67,10.43,-6.49,10.41,-6.21,10.52,-6.05,10.1,-5.82,10.22,-5.4,10.37,-4.95,10.15,-4.78,9.82,-4.33,9.61,-3.98,9.86,-3.51,9.9,-2.83,9.64,-2.56,8.22,-2.98,7.38,-3.24,6.25,-2.81,5.39,-2.86,4.99],[13.08,2.27,12.95,2.32,12.36,2.19,11.75,2.33,11.28,2.26,9.65,2.28,9.8,3.07,9.4,3.73,8.95,3.9,8.74,4.35,8.49,4.5,8.5,4.77,8.76,5.48,9.23,6.44,9.52,6.45,10.12,7.04,10.5,7.06,11.06,6.64,11.75,6.98,11.84,7.4,12.06,7.8,12.22,8.31,12.75,8.72,12.96,9.42,13.17,9.64,13.31,10.16,13.57,10.8,14.42,11.57,14.47,11.9,14.58,12.09,14.18,12.48,14.21,12.8,14.5,12.86,14.89,12.22,14.96,11.56,14.92,10.89,15.47,9.98,14.91,9.99,14.63,9.92,14.17,10.02,13.95,9.55,14.54,8.97,14.98,8.8,15.12,8.38,15.44,7.69,15.28,7.42,14.78,6.41,14.54,6.23,14.46,5.45,14.56,5.03,14.48,4.73,14.95,4.21,15.04,3.85,15.41,3.34,15.86,3.01,15.91,2.56,16.01,2.27,15.94,1.73,15.15,1.96,14.34,2.23,13.08,2.27],[30.83,3.51,30.77,2.34,31.17,2.2,30.85,1.85,30.47,1.58,30.09,1.06,29.88,.6,29.82,-.21,29.59,-.59,29.58,-1.34,29.29,-1.62,29.25,-2.22,29.12,-2.29,29.02,-2.84,29.28,-3.29,29.34,-4.5,29.52,-5.42,29.42,-5.94,29.62,-6.52,30.2,-7.08,30.74,-8.34,30.35,-8.24,29,-8.41,28.73,-8.53,28.45,-9.16,28.67,-9.61,28.5,-10.79,28.37,-11.79,28.64,-11.97,29.34,-12.36,29.62,-12.18,29.7,-13.26,28.93,-13.25,28.52,-12.7,28.16,-12.27,27.39,-12.13,27.16,-11.61,26.55,-11.92,25.75,-11.78,25.42,-11.33,24.78,-11.24,24.31,-11.26,24.26,-10.95,23.91,-10.93,23.46,-10.87,22.84,-11.02,22.4,-10.99,22.16,-11.08,22.21,-9.89,21.88,-9.52,21.8,-8.91,21.95,-8.31,21.75,-7.92,21.73,-7.29,20.51,-7.3,20.6,-6.94,20.09,-6.94,20.04,-7.12,19.42,-7.16,19.17,-7.74,19.02,-7.99,18.46,-7.85,18.13,-7.99,17.47,-8.07,17.09,-7.55,16.86,-7.22,16.57,-6.62,16.33,-5.88,13.38,-5.86,13.02,-5.98,12.74,-5.97,12.32,-6.1,12.18,-5.79,12.44,-5.68,12.47,-5.25,12.63,-4.99,13,-4.78,13.26,-4.88,13.6,-4.5,14.14,-4.51,14.21,-4.79,14.58,-4.97,15.17,-4.34,15.75,-3.86,16.01,-3.54,15.97,-2.71,16.41,-1.74,16.87,-1.23,17.52,-.74,17.64,-.42,17.66,-.06,17.83,.29,17.77,.86,17.9,1.74,18.09,2.37,18.39,2.9,18.45,3.5,18.54,4.2,18.93,4.71,19.47,5.03,20.29,4.69,20.93,4.32,21.66,4.22,22.41,4.03,22.7,4.63,22.84,4.71,23.3,4.61,24.41,5.11,24.81,4.9,25.13,4.93,25.28,5.17,25.65,5.26,26.4,5.15,27.04,5.13,27.37,5.23,27.98,4.41,28.43,4.29,28.7,4.46,29.16,4.39,29.72,4.6,29.95,4.17,30.83,3.51],[13,-4.78,12.62,-4.44,12.32,-4.61,11.91,-5.04,11.09,-3.98,11.86,-3.43,11.48,-2.77,11.82,-2.51,12.5,-2.39,12.58,-1.95,13.11,-2.43,13.99,-2.47,14.3,-2,14.43,-1.33,14.32,-.55,13.84,.04,14.28,1.2,14.03,1.4,13.28,1.31,13,1.83,13.08,2.27,14.34,2.23,15.15,1.96,15.94,1.73,16.01,2.27,16.54,3.2,17.13,3.73,17.81,3.56,18.45,3.5,18.39,2.9,18.09,2.37,17.9,1.74,17.77,.86,17.83,.29,17.66,-.06,17.64,-.42,17.52,-.74,16.87,-1.23,16.41,-1.74,15.97,-2.71,16.01,-3.54,15.75,-3.86,15.17,-4.34,14.58,-4.97,14.21,-4.79,14.14,-4.51,13.6,-4.5,13.26,-4.88,13,-4.78],[-75.37,-.15,-75.8,.08,-76.29,.42,-76.58,.26,-77.42,.4,-77.67,.83,-77.86,.81,-78.86,1.38,-78.99,1.69,-78.62,1.77,-78.66,2.27,-78.43,2.63,-77.93,2.7,-77.51,3.33,-77.13,3.85,-77.5,4.09,-77.31,4.67,-77.53,5.58,-77.32,5.85,-77.48,6.69,-77.88,7.22,-77.75,7.71,-77.43,7.64,-77.24,7.94,-77.47,8.52,-77.35,8.67,-76.84,8.64,-76.09,9.34,-75.67,9.44,-75.66,9.77,-75.48,10.62,-74.91,11.08,-74.28,11.1,-74.2,11.31,-73.41,11.23,-72.63,11.73,-72.24,11.96,-71.75,12.44,-71.4,12.38,-71.14,12.11,-71.33,11.78,-71.97,11.61,-72.23,11.11,-72.61,10.82,-72.91,10.45,-73.03,9.74,-73.3,9.15,-72.79,9.09,-72.66,8.63,-72.44,8.41,-72.36,8,-72.48,7.63,-72.44,7.42,-72.2,7.34,-71.96,6.99,-70.67,7.09,-70.09,6.96,-69.39,6.1,-68.99,6.21,-68.27,6.15,-67.7,6.27,-67.34,6.1,-67.52,5.56,-67.74,5.22,-67.82,4.5,-67.62,3.84,-67.34,3.54,-67.3,3.32,-67.81,2.82,-67.45,2.6,-67.18,2.25,-66.88,1.25,-67.07,1.13,-67.26,1.72,-67.54,2.04,-67.87,1.69,-69.82,1.71,-69.8,1.09,-69.22,.99,-69.25,.6,-69.45,.71,-70.02,.54,-70.02,-.19,-69.58,-.55,-69.42,-1.12,-69.44,-1.56,-69.89,-4.3,-70.39,-3.77,-70.69,-3.74,-70.05,-2.73,-70.81,-2.26,-71.41,-2.34,-71.77,-2.17,-72.33,-2.43,-73.07,-2.31,-73.66,-1.26,-74.12,-1,-74.44,-.53,-75.11,-.06,-75.37,-.15],[-82.97,8.23,-83.51,8.45,-83.71,8.66,-83.6,8.83,-83.63,9.05,-83.91,9.29,-84.3,9.49,-84.65,9.62,-84.71,9.91,-84.98,10.09,-84.91,9.8,-85.11,9.56,-85.34,9.83,-85.66,9.93,-85.8,10.13,-85.79,10.44,-85.66,10.75,-85.94,10.9,-85.71,11.09,-85.56,11.22,-84.9,10.95,-84.67,11.08,-84.36,11,-84.19,10.79,-83.9,10.73,-83.66,10.94,-83.4,10.4,-83.02,9.99,-82.55,9.57,-82.93,9.48,-82.93,9.07,-82.72,8.93,-82.87,8.81,-82.83,8.63,-82.91,8.42,-82.97,8.23],[-82.27,23.19,-81.4,23.12,-80.62,23.11,-79.68,22.77,-79.28,22.4,-78.35,22.51,-77.99,22.28,-77.15,21.66,-76.52,21.21,-76.19,21.22,-75.6,21.02,-75.67,20.74,-74.93,20.69,-74.18,20.28,-74.3,20.05,-74.96,19.92,-75.63,19.87,-76.32,19.95,-77.76,19.86,-77.09,20.41,-77.49,20.67,-78.14,20.74,-78.48,21.03,-78.72,21.6,-79.28,21.56,-80.22,21.83,-80.52,22.04,-81.82,22.19,-82.17,22.39,-81.8,22.64,-82.78,22.69,-83.49,22.17,-83.91,22.15,-84.05,21.91,-84.55,21.8,-84.97,21.9,-84.45,22.2,-84.23,22.57,-83.78,22.79,-83.27,22.98,-82.51,23.08,-82.27,23.19],[32.73,35.14,32.8,35.15,32.95,35.39,33.67,35.37,34.58,35.67,33.9,35.25,33.97,35.06,33.87,35.09,33.68,35.02,33.53,35.04,33.48,35,33.46,35.1,33.38,35.16,33.19,35.17,32.92,35.09,32.73,35.14],[33.97,35.06,34,34.98,32.98,34.57,32.49,34.7,32.26,35.1,32.73,35.14,32.92,35.09,33.19,35.17,33.38,35.16,33.46,35.1,33.48,35,33.53,35.04,33.68,35.02,33.87,35.09,33.97,35.06],[16.96,48.6,16.5,48.79,16.03,48.73,15.25,49.04,14.9,48.96,14.34,48.56,13.6,48.88,13.03,49.31,12.52,49.55,12.42,49.97,12.24,50.27,12.97,50.48,13.34,50.73,14.06,50.93,14.31,51.12,14.57,51,15.02,51.11,15.49,50.78,16.24,50.7,16.18,50.42,16.72,50.22,16.87,50.47,17.55,50.36,17.65,50.05,18.39,49.99,18.85,49.5,18.55,49.5,18.4,49.32,18.17,49.27,18.1,49.04,17.91,49,17.89,48.9,17.55,48.8,17.1,48.82,16.96,48.6],[9.92,54.98,9.94,54.6,10.95,54.36,10.94,54.01,11.96,54.2,12.52,54.47,13.65,54.08,14.12,53.76,14.35,53.25,14.07,52.98,14.44,52.62,14.69,52.09,14.61,51.75,15.02,51.11,14.57,51,14.31,51.12,14.06,50.93,13.34,50.73,12.97,50.48,12.24,50.27,12.42,49.97,12.52,49.55,13.03,49.31,13.6,48.88,13.24,48.42,12.88,48.29,13.03,47.64,12.93,47.47,12.62,47.67,12.14,47.7,11.43,47.52,10.54,47.57,10.4,47.3,9.9,47.58,9.59,47.53,8.52,47.83,8.32,47.61,7.47,47.62,7.59,48.33,8.1,49.02,6.66,49.2,6.19,49.46,6.24,49.9,6.04,50.13,6.16,50.8,5.99,51.85,6.59,51.85,6.84,52.23,7.09,53.14,6.91,53.48,7.1,53.69,7.94,53.75,8.12,53.53,8.8,54.02,8.57,54.4,8.53,54.96,9.28,54.83,9.92,54.98],[43.08,12.7,43.32,12.39,43.29,11.97,42.72,11.74,43.15,11.46,42.78,10.93,42.55,11.11,42.31,11.03,41.76,11.05,41.74,11.36,41.66,11.63,42,12.1,42.35,12.54,42.78,12.46,43.08,12.7],[12.69,55.61,12.09,54.8,11.04,55.36,10.9,55.78,12.37,56.11,12.69,55.61],[10.91,56.46,10.67,56.08,10.37,56.19,9.65,55.47,9.92,54.98,9.28,54.83,8.53,54.96,8.12,55.52,8.09,56.54,8.26,56.81,8.54,57.11,9.42,57.17,9.78,57.45,10.58,57.73,10.55,57.22,10.25,56.89,10.37,56.61,10.91,56.46],[-71.71,19.71,-71.59,19.88,-70.81,19.88,-70.21,19.62,-69.95,19.65,-69.77,19.29,-69.22,19.31,-69.25,19.02,-68.81,18.98,-68.32,18.61,-68.69,18.21,-69.16,18.42,-69.62,18.38,-69.95,18.43,-70.13,18.25,-70.52,18.18,-70.67,18.43,-71,18.28,-71.4,17.6,-71.66,17.76,-71.71,18.04,-71.69,18.32,-71.95,18.62,-71.7,18.79,-71.62,19.17,-71.71,19.71],[12,23.47,8.57,21.57,5.68,19.6,4.27,19.16,3.16,19.06,3.15,19.69,2.68,19.86,2.06,20.14,1.82,20.61,-1.55,22.79,-4.92,24.97,-8.68,27.4,-8.67,27.59,-8.67,27.66,-8.67,28.84,-7.06,29.58,-6.06,29.73,-5.24,30,-4.86,30.5,-3.69,30.9,-3.65,31.64,-3.07,31.72,-2.62,32.09,-1.31,32.26,-1.12,32.65,-1.39,32.86,-1.73,33.92,-1.79,34.53,-2.17,35.17,-1.21,35.71,-.13,35.89,.5,36.3,1.47,36.61,3.16,36.78,4.82,36.87,5.32,36.72,6.26,37.11,7.33,37.12,7.74,36.89,8.42,36.95,8.22,36.43,8.38,35.48,8.14,34.66,7.52,34.1,7.61,33.34,8.43,32.75,8.44,32.51,9.06,32.1,9.48,30.31,9.81,29.42,9.86,28.96,9.68,28.14,9.76,27.69,9.63,27.14,9.72,26.51,9.32,26.09,9.91,25.37,9.95,24.94,10.3,24.38,10.77,24.56,11.56,24.1,12,23.47],[-80.3,-3.4,-79.77,-2.66,-79.99,-2.22,-80.37,-2.69,-80.97,-2.25,-80.76,-1.97,-80.93,-1.06,-80.58,-.91,-80.4,-.28,-80.02,.36,-80.09,.77,-79.54,.98,-78.86,1.38,-77.86,.81,-77.67,.83,-77.42,.4,-76.58,.26,-76.29,.42,-75.8,.08,-75.37,-.15,-75.23,-.91,-75.54,-1.56,-76.64,-2.61,-77.84,-3,-78.45,-3.87,-78.64,-4.55,-79.21,-4.96,-79.62,-4.45,-80.03,-4.35,-80.44,-4.43,-80.47,-4.06,-80.18,-3.82,-80.3,-3.4],[34.92,29.5,34.64,29.1,34.43,28.34,34.15,27.82,33.92,27.65,33.59,27.97,33.14,28.42,32.42,29.85,32.32,29.76,32.73,28.71,33.35,27.7,34.1,26.14,34.47,25.6,34.8,25.03,35.69,23.93,35.49,23.75,35.53,23.1,36.69,22.2,36.87,22,32.9,22,29.02,22,25,22,25,25.68,25,29.24,24.7,30.04,24.96,30.66,24.8,31.09,25.16,31.57,26.5,31.59,27.46,31.32,28.45,31.03,28.91,30.87,29.68,31.19,30.1,31.47,30.98,31.56,31.69,31.43,31.96,30.93,32.19,31.26,32.99,31.02,33.77,30.97,34.27,31.22,34.92,29.5],[42.35,12.54,42.01,12.87,41.6,13.45,41.16,13.77,40.9,14.12,40.03,14.52,39.34,14.53,39.1,14.74,38.51,14.51,37.91,14.96,37.59,14.21,36.43,14.42,36.32,14.82,36.75,16.29,36.85,16.96,37.17,17.26,37.9,17.43,38.41,18,38.99,16.84,39.27,15.92,39.81,15.44,41.18,14.49,41.73,13.92,42.28,13.34,42.59,13,43.08,12.7,42.78,12.46,42.35,12.54],[-9.03,41.88,-8.98,42.59,-9.39,43.03,-7.98,43.75,-6.75,43.57,-5.41,43.57,-4.35,43.4,-3.52,43.46,-1.9,43.42,-1.5,43.03,.34,42.58,.7,42.8,1.83,42.34,2.99,42.47,3.04,41.89,2.09,41.23,.81,41.01,.72,40.68,.11,40.12,-.28,39.31,.11,38.74,-.47,38.29,-.68,37.64,-1.44,37.44,-2.15,36.67,-3.42,36.66,-4.37,36.68,-5,36.32,-5.38,35.95,-5.87,36.03,-6.24,36.37,-6.52,36.94,-7.45,37.1,-7.54,37.43,-7.17,37.8,-7.03,38.08,-7.37,38.37,-7.1,39.03,-7.5,39.63,-7.07,39.71,-7.03,40.18,-6.86,40.33,-6.85,41.11,-6.39,41.38,-6.67,41.88,-7.25,41.92,-7.42,41.79,-8.01,41.79,-8.26,42.28,-8.67,42.13,-9.03,41.88],[24.31,57.79,24.43,58.38,24.06,58.26,23.43,58.61,23.34,59.19,24.6,59.47,25.86,59.61,26.95,59.45,27.98,59.48,28.13,59.3,27.42,58.72,27.72,57.79,27.29,57.47,26.46,57.48,25.6,57.85,25.16,57.97,24.31,57.79],[37.91,14.96,38.51,14.51,39.1,14.74,39.34,14.53,40.03,14.52,40.9,14.12,41.16,13.77,41.6,13.45,42.01,12.87,42.35,12.54,42,12.1,41.66,11.63,41.74,11.36,41.76,11.05,42.31,11.03,42.55,11.11,42.78,10.93,42.56,10.57,42.93,10.02,43.3,9.54,43.68,9.18,46.95,8,47.79,8,44.96,5,43.66,4.96,42.77,4.25,42.13,4.23,41.86,3.92,41.17,3.92,40.77,4.26,39.85,3.84,39.56,3.42,38.89,3.5,38.67,3.62,38.44,3.59,38.12,3.6,36.86,4.45,36.16,4.45,35.82,4.78,35.82,5.34,35.3,5.51,34.71,6.59,34.25,6.83,34.08,7.23,33.57,7.71,32.95,7.78,33.29,8.35,33.83,8.38,33.97,8.68,33.96,9.58,34.26,10.63,34.73,10.91,34.83,11.32,35.26,12.08,35.86,12.58,36.27,13.56,36.43,14.42,37.59,14.21,37.91,14.96],[28.59,69.06,28.45,68.36,29.98,67.7,29.05,66.94,30.22,65.81,29.54,64.95,30.44,64.2,30.04,63.55,31.52,62.87,31.14,62.36,30.21,61.78,28.07,60.5,26.26,60.42,24.5,60.06,22.87,59.85,22.29,60.39,21.32,60.72,21.54,61.71,21.06,62.61,21.54,63.19,22.44,63.82,24.73,64.9,25.4,65.11,25.29,65.53,23.9,66.01,23.57,66.4,23.54,67.94,21.98,68.62,20.65,69.11,21.24,69.37,22.36,68.84,23.66,68.89,24.74,68.65,25.69,69.09,26.18,69.83,27.73,70.16,29.02,69.77,28.59,69.06],[178.37,-17.34,178.72,-17.63,178.55,-18.15,177.93,-18.29,177.38,-18.16,177.29,-17.72,177.67,-17.38,178.13,-17.5,178.37,-17.34],[179.36,-16.8,178.73,-17.01,178.6,-16.64,179.1,-16.43,179.41,-16.38,180,-16.07,180,-16.56,179.36,-16.8],[-61.2,-51.85,-60,-51.25,-59.15,-51.5,-58.55,-51.1,-57.75,-51.55,-58.05,-51.9,-59.4,-52.2,-59.85,-51.85,-60.7,-52.3,-61.2,-51.85],[9.56,42.15,9.23,41.38,8.78,41.58,8.54,42.26,8.75,42.63,9.39,43.01,9.56,42.15],[3.59,50.38,4.29,49.91,4.8,49.99,5.67,49.53,5.9,49.44,6.19,49.46,6.66,49.2,8.1,49.02,7.59,48.33,7.47,47.62,7.19,47.45,6.74,47.54,6.77,47.29,6.04,46.73,6.02,46.27,6.5,46.43,6.84,45.99,6.8,45.71,7.1,45.33,6.75,45.03,7.01,44.25,7.55,44.13,7.44,43.69,6.53,43.13,4.56,43.4,3.1,43.08,2.99,42.47,1.83,42.34,.7,42.8,.34,42.58,-1.5,43.03,-1.9,43.42,-1.38,44.02,-1.19,46.01,-2.23,47.06,-2.96,47.57,-4.49,47.95,-4.59,48.68,-3.3,48.9,-1.62,48.64,-1.93,49.78,-.99,49.35,1.34,50.13,1.64,50.95,2.51,51.15,2.66,50.8,3.12,50.78,3.59,50.38],[11.09,-3.98,10.07,-2.97,9.41,-2.14,8.8,-1.11,8.83,-.78,9.05,-.46,9.29,.27,9.49,1.01,9.83,1.07,11.29,1.06,11.28,2.26,11.75,2.33,12.36,2.19,12.95,2.32,13.08,2.27,13,1.83,13.28,1.31,14.03,1.4,14.28,1.2,13.84,.04,14.32,-.55,14.43,-1.33,14.3,-2,13.99,-2.47,13.11,-2.43,12.58,-1.95,12.5,-2.39,11.82,-2.51,11.48,-2.77,11.86,-3.43,11.09,-3.98],[-5.66,54.55,-6.2,53.87,-6.95,54.07,-7.57,54.06,-7.37,54.6,-7.57,55.13,-6.73,55.17,-5.66,54.55],[-3.01,58.64,-4.07,57.55,-3.06,57.69,-1.96,57.68,-2.22,56.87,-3.12,55.97,-2.09,55.91,-2.01,55.8,-1.11,54.62,-.43,54.46,.18,53.33,.47,52.93,1.68,52.74,1.56,52.1,1.05,51.81,1.45,51.29,.55,50.77,-.79,50.77,-2.49,50.5,-2.96,50.7,-3.62,50.23,-4.54,50.34,-5.25,49.96,-5.78,50.16,-4.31,51.21,-3.41,51.43,-3.42,51.43,-4.98,51.59,-5.27,51.99,-4.22,52.3,-4.77,52.84,-4.58,53.5,-3.09,53.4,-2.95,53.99,-3.61,54.6,-3.63,54.62,-4.84,54.79,-5.08,55.06,-4.72,55.51,-5.05,55.78,-5.59,55.31,-5.64,56.28,-6.15,56.79,-5.79,57.82,-5.01,58.63,-4.21,58.55,-3.01,58.64],[41.55,41.54,41.7,41.96,41.45,42.65,40.88,43.01,40.32,43.13,39.96,43.43,40.08,43.55,40.92,43.38,42.39,43.22,43.76,42.74,43.93,42.55,44.54,42.71,45.47,42.5,45.78,42.09,46.4,41.86,46.15,41.72,46.64,41.18,46.5,41.06,45.96,41.12,45.22,41.41,44.97,41.25,43.58,41.09,42.62,41.58,41.55,41.54],[1.06,5.93,-.51,5.34,-1.06,5,-1.96,4.71,-2.86,4.99,-2.81,5.39,-3.24,6.25,-2.98,7.38,-2.56,8.22,-2.83,9.64,-2.96,10.4,-2.94,10.96,-1.2,11.01,-.76,10.94,-.44,11.1,.02,11.02,-.05,10.71,.37,10.19,.37,9.47,.46,8.68,.71,8.31,.49,7.41,.57,6.91,.84,6.28,1.06,5.93],[-8.44,7.69,-8.72,7.71,-8.93,7.31,-9.21,7.31,-9.4,7.53,-9.34,7.93,-9.76,8.54,-10.02,8.43,-10.23,8.41,-10.51,8.35,-10.49,8.72,-10.65,8.98,-10.62,9.27,-10.84,9.69,-11.12,10.05,-11.92,10.05,-12.15,9.86,-12.43,9.84,-12.6,9.62,-12.71,9.34,-13.25,8.9,-13.69,9.49,-14.07,9.89,-14.33,10.02,-14.58,10.21,-14.69,10.66,-14.84,10.88,-15.13,11.04,-14.69,11.53,-14.38,11.51,-14.12,11.68,-13.9,11.68,-13.74,11.81,-13.83,12.14,-13.72,12.25,-13.7,12.59,-13.22,12.58,-12.5,12.33,-12.28,12.35,-12.2,12.47,-11.66,12.39,-11.51,12.44,-11.46,12.08,-11.3,12.08,-11.04,12.21,-10.87,12.18,-10.59,11.92,-10.17,11.84,-9.89,12.06,-9.57,12.19,-9.33,12.33,-9.13,12.31,-8.91,12.09,-8.79,11.81,-8.38,11.39,-8.58,11.14,-8.62,10.81,-8.41,10.91,-8.28,10.79,-8.34,10.49,-8.03,10.21,-8.23,10.13,-8.31,9.79,-8.08,9.38,-7.83,8.58,-8.2,8.46,-8.3,8.32,-8.22,8.12,-8.28,7.69,-8.44,7.69],[-16.84,13.15,-16.71,13.59,-15.62,13.62,-15.4,13.86,-15.08,13.88,-14.69,13.63,-14.38,13.63,-14.05,13.79,-13.84,13.51,-14.28,13.28,-14.71,13.3,-15.14,13.51,-15.51,13.28,-15.69,13.27,-15.93,13.13,-16.84,13.15],[-15.13,11.04,-15.66,11.46,-16.09,11.52,-16.31,11.81,-16.31,11.96,-16.61,12.17,-16.68,12.38,-16.15,12.55,-15.82,12.52,-15.55,12.63,-13.7,12.59,-13.72,12.25,-13.83,12.14,-13.74,11.81,-13.9,11.68,-14.12,11.68,-14.38,11.51,-14.69,11.53,-15.13,11.04],[9.49,1.01,9.31,1.16,9.65,2.28,11.28,2.26,11.29,1.06,9.83,1.07,9.49,1.01],[23.7,35.71,24.25,35.37,25.03,35.42,25.77,35.35,25.75,35.18,26.29,35.3,26.16,35,24.72,34.92,24.74,35.08,23.51,35.28,23.7,35.71],[26.6,41.56,26.29,40.94,26.06,40.82,25.45,40.85,24.93,40.95,23.71,40.69,24.41,40.12,23.9,39.96,23.34,39.96,22.81,40.48,22.63,40.26,22.85,39.66,23.35,39.19,22.97,38.97,23.53,38.51,24.03,38.22,24.04,37.66,23.12,37.92,23.41,37.41,22.77,37.31,23.15,36.42,22.49,36.41,21.67,36.84,21.3,37.64,21.12,38.31,20.73,38.77,20.22,39.34,20.15,39.62,20.62,40.11,20.67,40.44,21,40.58,21.02,40.84,21.67,40.93,22.06,41.15,22.6,41.13,22.76,41.3,22.95,41.34,23.69,41.31,24.49,41.58,25.2,41.23,26.11,41.33,26.12,41.83,26.6,41.56],[-46.76,82.63,-43.41,83.23,-39.9,83.18,-38.62,83.55,-35.09,83.65,-27.1,83.52,-20.85,82.73,-22.69,82.34,-26.52,82.3,-31.9,82.2,-31.4,82.02,-27.86,82.13,-24.84,81.79,-22.9,82.09,-22.07,81.73,-23.17,81.15,-20.62,81.52,-15.77,81.91,-12.77,81.72,-12.21,81.29,-16.29,80.58,-16.85,80.35,-20.05,80.18,-17.73,80.13,-18.9,79.4,-19.7,78.75,-19.67,77.64,-18.47,76.99,-20.04,76.94,-21.68,76.63,-19.83,76.1,-19.6,75.25,-20.67,75.16,-19.37,74.3,-21.59,74.22,-20.43,73.82,-20.76,73.46,-22.17,73.31,-23.57,73.31,-22.31,72.63,-22.3,72.18,-24.28,72.6,-24.79,72.33,-23.44,72.08,-22.13,71.47,-21.75,70.66,-23.54,70.47,-24.31,70.86,-25.54,71.43,-25.2,70.75,-26.36,70.23,-23.73,70.18,-22.35,70.13,-25.03,69.26,-27.75,68.47,-30.67,68.13,-31.78,68.12,-32.81,67.74,-34.2,66.68,-36.35,65.98,-37.04,65.94,-38.38,65.69,-39.81,65.46,-40.67,64.84,-40.68,64.14,-41.19,63.48,-42.82,62.68,-42.42,61.9,-42.87,61.07,-43.38,60.1,-44.79,60.04,-46.26,60.85,-48.26,60.86,-49.23,61.41,-49.9,62.38,-51.63,63.63,-52.14,64.28,-52.28,65.18,-53.66,66.1,-53.3,66.84,-53.97,67.19,-52.98,68.36,-51.48,68.73,-51.08,69.15,-50.87,69.93,-52.01,69.57,-52.56,69.43,-53.46,69.28,-54.68,69.61,-54.75,70.29,-54.36,70.82,-53.43,70.84,-51.39,70.57,-53.11,71.2,-54,71.55,-55,71.41,-55.83,71.65,-54.72,72.59,-55.33,72.96,-56.12,73.65,-57.32,74.71,-58.6,75.1,-58.59,75.52,-61.27,76.1,-63.39,76.18,-66.06,76.13,-68.5,76.06,-69.66,76.38,-71.4,77.01,-68.78,77.32,-66.76,77.38,-71.04,77.64,-73.3,78.04,-73.16,78.43,-69.37,78.91,-65.71,79.39,-65.32,79.76,-68.02,80.12,-67.15,80.52,-63.69,81.21,-62.23,81.32,-62.65,81.77,-60.28,82.03,-57.21,82.19,-54.13,82.2,-53.04,81.89,-50.39,82.44,-48,82.06,-46.6,81.99,-44.52,81.66,-46.9,82.2,-46.76,82.63],[-90.1,13.74,-90.61,13.91,-91.23,13.93,-91.69,14.13,-92.23,14.54,-92.2,14.83,-92.09,15.06,-92.23,15.25,-91.75,16.07,-90.46,16.07,-90.44,16.41,-90.6,16.47,-90.71,16.69,-91.08,16.92,-91.45,17.25,-91,17.25,-91,17.82,-90.07,17.82,-89.14,17.81,-89.15,17.02,-89.23,15.89,-88.93,15.89,-88.6,15.71,-88.52,15.86,-88.23,15.73,-88.68,15.35,-89.15,15.07,-89.23,14.87,-89.15,14.68,-89.35,14.42,-89.59,14.36,-89.53,14.24,-89.72,14.13,-90.06,13.88,-90.1,13.74],[-52.56,2.5,-52.94,2.12,-53.42,2.05,-53.55,2.33,-53.78,2.38,-54.09,2.11,-54.52,2.31,-54.27,2.74,-54.18,3.19,-54.01,3.62,-54.4,4.21,-54.48,4.9,-53.96,5.76,-53.62,5.65,-52.88,5.41,-51.82,4.57,-51.66,4.16,-52.25,3.24,-52.56,2.5],[-59.76,8.37,-59.1,8,-58.48,7.35,-58.45,6.83,-58.08,6.81,-57.54,6.32,-57.15,5.97,-57.31,5.07,-57.91,4.81,-57.86,4.58,-58.04,4.06,-57.6,3.33,-57.28,3.33,-57.15,2.77,-56.54,1.9,-56.78,1.86,-57.34,1.95,-57.66,1.68,-58.11,1.51,-58.43,1.46,-58.54,1.27,-59.03,1.32,-59.65,1.79,-59.72,2.25,-59.97,2.76,-59.82,3.61,-59.54,3.96,-59.77,4.42,-60.11,4.57,-59.98,5.01,-60.21,5.24,-60.73,5.2,-61.41,5.96,-61.14,6.23,-61.16,6.7,-60.54,6.86,-60.3,7.04,-60.64,7.42,-60.55,7.78,-59.76,8.37],[-87.32,12.98,-87.49,13.3,-87.79,13.38,-87.72,13.79,-87.86,13.89,-88.07,13.96,-88.5,13.85,-88.54,13.98,-88.84,14.14,-89.06,14.34,-89.35,14.42,-89.15,14.68,-89.23,14.87,-89.15,15.07,-88.68,15.35,-88.23,15.73,-88.12,15.69,-87.9,15.86,-87.62,15.88,-87.52,15.8,-87.37,15.85,-86.9,15.76,-86.44,15.78,-86.12,15.89,-86,16.01,-85.68,15.95,-85.44,15.89,-85.18,15.91,-84.98,16,-84.53,15.86,-84.37,15.84,-84.06,15.65,-83.77,15.42,-83.41,15.27,-83.15,15,-83.49,15.02,-83.63,14.88,-83.98,14.75,-84.23,14.75,-84.45,14.62,-84.65,14.67,-84.82,14.82,-84.92,14.79,-85.05,14.55,-85.15,14.56,-85.17,14.35,-85.51,14.08,-85.7,13.96,-85.8,13.84,-86.1,14.04,-86.31,13.77,-86.52,13.78,-86.76,13.75,-86.73,13.26,-86.88,13.25,-87.01,13.03,-87.32,12.98],[18.83,45.91,19.07,45.52,19.39,45.24,19.01,44.86,18.55,45.08,17.86,45.07,17,45.23,16.53,45.21,16.32,45,15.96,45.23,15.75,44.82,16.24,44.35,16.46,44.04,16.92,43.67,17.3,43.45,17.67,43.03,18.56,42.65,18.45,42.48,17.51,42.85,16.93,43.21,16.02,43.51,15.17,44.24,15.38,44.32,14.92,44.74,14.9,45.08,14.26,45.23,13.95,44.8,13.66,45.14,13.68,45.48,13.72,45.5,14.41,45.47,14.6,45.63,14.94,45.47,15.33,45.45,15.32,45.73,15.67,45.83,15.77,46.24,16.56,46.5,16.88,46.38,17.63,45.95,18.46,45.76,18.83,45.91],[-73.19,19.92,-72.58,19.87,-71.71,19.71,-71.62,19.17,-71.7,18.79,-71.95,18.62,-71.69,18.32,-71.71,18.04,-72.37,18.21,-72.84,18.15,-73.45,18.22,-73.92,18.03,-74.46,18.34,-74.37,18.66,-73.45,18.53,-72.69,18.45,-72.33,18.67,-72.79,19.1,-72.78,19.48,-73.42,19.64,-73.19,19.92],[16.2,46.85,16.53,47.5,16.34,47.71,16.9,47.71,16.98,48.12,17.49,47.87,17.86,47.76,18.7,47.88,18.78,48.08,19.17,48.11,19.66,48.27,19.77,48.2,20.24,48.33,20.47,48.56,20.8,48.62,21.87,48.32,22.09,48.42,22.64,48.15,22.71,47.88,22.1,47.67,21.63,46.99,21.02,46.32,20.22,46.13,19.6,46.17,18.83,45.91,18.46,45.76,17.63,45.95,16.88,46.38,16.56,46.5,16.37,46.84,16.2,46.85],[120.72,-10.24,120.3,-10.26,118.97,-9.56,119.9,-9.36,120.43,-9.67,120.78,-9.97,120.72,-10.24],[124.44,-10.14,123.58,-10.36,123.46,-10.24,123.55,-9.9,123.98,-9.29,124.97,-8.89,125.07,-9.09,125.09,-9.39,124.44,-10.14],[117.9,-8.1,118.26,-8.36,118.88,-8.28,119.13,-8.71,117.97,-8.91,117.28,-9.04,116.74,-9.03,117.08,-8.46,117.63,-8.45,117.9,-8.1],[122.9,-8.09,122.76,-8.65,121.25,-8.93,119.92,-8.81,119.92,-8.44,120.72,-8.24,121.34,-8.54,122.01,-8.46,122.9,-8.09],[108.62,-6.78,110.54,-6.88,110.76,-6.47,112.61,-6.95,112.98,-7.59,114.48,-7.78,115.71,-8.37,114.56,-8.75,113.46,-8.35,112.56,-8.38,111.52,-8.3,110.59,-8.12,109.43,-7.74,108.69,-7.64,108.28,-7.77,106.45,-7.35,106.28,-6.92,105.37,-6.85,106.05,-5.9,107.27,-5.95,108.07,-6.35,108.49,-6.42,108.62,-6.78],[134.72,-6.21,134.21,-6.9,134.11,-6.14,134.29,-5.78,134.5,-5.45,134.73,-5.74,134.72,-6.21],[127.25,-3.46,126.87,-3.79,126.18,-3.61,125.99,-3.18,127,-3.13,127.25,-3.46],[130.47,-3.09,130.83,-3.86,129.99,-3.45,129.16,-3.36,128.59,-3.43,127.9,-3.39,128.14,-2.84,129.37,-2.8,130.47,-3.09],[134.14,-1.15,134.42,-2.77,135.46,-3.37,136.29,-2.31,137.44,-1.7,138.33,-1.7,139.18,-2.05,139.93,-2.41,141,-2.6,141.02,-5.86,141.03,-9.12,140.14,-8.3,139.13,-8.1,138.88,-8.38,137.61,-8.41,138.04,-7.6,138.67,-7.32,138.41,-6.23,137.93,-5.39,135.99,-4.55,135.16,-4.46,133.66,-3.54,133.37,-4.02,132.98,-4.11,132.76,-3.75,132.75,-3.31,131.99,-2.82,133.07,-2.46,133.78,-2.48,133.7,-2.21,132.23,-2.21,131.84,-1.62,130.94,-1.43,130.52,-.94,131.87,-.7,132.38,-.37,133.99,-.78,134.14,-1.15],[125.24,1.42,124.44,.43,123.69,.24,122.72,.43,121.06,.38,120.18,.24,120.04,-.52,120.94,-1.41,121.48,-.96,123.34,-.62,123.26,-1.08,122.82,-.93,122.39,-1.52,121.51,-1.9,122.45,-3.19,122.27,-3.53,123.17,-4.68,123.16,-5.34,122.63,-5.63,122.24,-5.28,122.72,-4.46,121.74,-4.85,121.49,-4.57,121.62,-4.19,120.9,-3.6,120.97,-2.63,120.31,-2.93,120.39,-4.1,120.43,-5.53,119.8,-5.67,119.37,-5.38,119.65,-4.46,119.5,-3.49,119.08,-3.49,118.77,-2.8,119.18,-2.15,119.32,-1.35,119.83,.15,120.04,.57,120.89,1.31,121.67,1.01,122.93,.88,124.08,.92,125.07,1.64,125.24,1.42],[128.69,1.13,128.64,.26,128.12,.36,127.97,-.25,128.38,-.78,128.1,-.9,127.7,-.27,127.4,1.01,127.6,1.81,127.93,2.17,128,1.63,128.59,1.54,128.69,1.13],[117.88,1.83,119,.9,117.81,.78,117.48,.1,117.52,-.8,116.56,-1.49,116.53,-2.48,116.15,-4.01,116,-3.66,114.86,-4.11,114.47,-3.5,113.76,-3.44,113.26,-3.12,112.07,-3.48,111.7,-2.99,111.05,-3.05,110.22,-2.93,110.07,-1.59,109.57,-1.31,109.09,-.46,108.95,.42,109.07,1.34,109.66,2.01,109.83,1.34,110.51,.77,111.16,.98,111.8,.9,112.38,1.41,112.86,1.5,113.81,1.22,114.62,1.43,115.13,2.82,115.52,3.17,115.87,4.31,117.02,4.31,117.88,4.14,117.31,3.23,118.05,2.29,117.88,1.83],[105.82,-5.85,104.71,-5.87,103.87,-5.04,102.58,-4.22,102.16,-3.61,101.4,-2.8,100.9,-2.05,100.14,-.65,99.26,.18,98.97,1.04,98.6,1.82,97.7,2.45,97.18,3.31,96.42,3.87,95.38,4.97,95.29,5.48,95.94,5.44,97.48,5.25,98.37,4.27,99.14,3.59,99.69,3.17,100.64,2.1,101.66,2.08,102.5,1.4,103.08,.56,103.84,.1,103.44,-.71,104.01,-1.06,104.37,-1.08,104.54,-1.78,104.89,-2.34,105.62,-2.43,106.11,-3.06,105.86,-4.31,105.82,-5.85],[77.84,35.49,78.91,34.32,78.81,33.51,79.21,32.99,79.18,32.48,78.46,32.62,78.74,31.52,79.72,30.88,81.11,30.18,80.48,29.73,80.09,28.79,81.06,28.42,82,27.93,83.3,27.36,84.68,27.23,85.25,26.73,86.02,26.63,87.23,26.4,88.06,26.41,88.17,26.81,88.04,27.45,88.12,27.88,88.73,28.09,88.81,27.3,88.84,27.1,89.74,26.72,90.37,26.88,91.22,26.81,92.03,26.84,92.1,27.45,91.7,27.77,92.5,27.9,93.41,28.64,94.57,29.28,95.4,29.03,96.12,29.45,96.59,28.83,96.25,28.41,97.33,28.26,97.4,27.88,97.05,27.7,97.13,27.08,96.42,27.26,95.12,26.57,95.16,26,94.6,25.16,94.55,24.68,94.11,23.85,93.33,24.08,93.29,23.04,93.06,22.7,93.17,22.28,92.67,22.04,92.15,23.63,91.87,23.62,91.71,22.99,91.16,23.5,91.47,24.07,91.92,24.13,92.38,24.98,91.8,25.15,90.87,25.13,89.92,25.27,89.83,25.97,89.36,26.01,88.56,26.45,88.21,25.77,88.93,25.24,88.31,24.87,88.08,24.5,88.7,24.23,88.53,23.63,88.88,22.88,89.03,22.06,88.89,21.69,88.21,21.7,86.98,21.5,87.03,20.74,86.5,20.15,85.06,19.48,83.94,18.3,83.19,17.67,82.19,17.02,82.19,16.56,81.69,16.31,80.79,15.95,80.32,15.9,80.03,15.14,80.23,13.84,80.29,13.01,79.86,12.06,79.86,10.36,79.34,10.31,78.89,9.55,79.19,9.22,78.28,8.93,77.94,8.25,77.54,7.97,76.59,8.9,76.13,10.3,75.75,11.31,75.4,11.78,74.86,12.74,74.62,13.99,74.44,14.62,73.53,15.99,73.12,17.93,72.82,19.21,72.82,20.42,72.63,21.36,71.18,20.76,70.47,20.88,69.16,22.09,69.64,22.45,69.35,22.84,68.18,23.69,68.84,24.36,71.04,24.36,70.84,25.22,70.28,25.72,70.17,26.49,69.51,26.94,70.62,27.99,71.78,27.91,72.82,28.96,73.45,29.98,74.42,30.98,74.41,31.69,75.26,32.27,74.45,32.76,74.1,33.44,73.75,34.32,74.24,34.75,75.76,34.5,76.87,34.65,77.84,35.49],[-6.2,53.87,-6.03,53.15,-6.79,52.26,-8.56,51.67,-9.98,51.82,-9.17,52.86,-9.69,53.88,-8.33,54.66,-7.57,55.13,-7.37,54.6,-7.57,54.06,-6.95,54.07,-6.2,53.87],[53.92,37.2,54.8,37.39,55.51,37.96,56.18,37.94,56.62,38.12,57.33,38.03,58.44,37.52,59.23,37.41,60.38,36.53,61.12,36.49,61.21,35.65,60.8,34.4,60.53,33.68,60.96,33.53,60.54,32.98,60.86,32.18,60.94,31.55,61.7,31.38,61.78,30.74,60.87,29.83,61.37,29.3,61.77,28.7,62.73,28.26,62.76,27.38,63.23,27.22,63.32,26.76,61.87,26.24,61.5,25.08,59.62,25.38,58.53,25.61,57.4,25.74,56.97,26.97,56.49,27.14,55.72,26.96,54.72,26.48,53.49,26.81,52.48,27.58,51.52,27.87,50.85,28.81,50.12,30.15,49.58,29.99,48.94,30.32,48.57,29.93,48.01,30.45,48,30.99,47.69,30.98,47.85,31.71,47.33,32.47,46.11,33.02,45.42,33.97,45.65,34.75,46.15,35.09,46.08,35.68,45.42,35.98,44.77,37.17,44.23,37.97,44.42,38.28,44.11,39.43,44.79,39.71,44.95,39.34,45.46,38.87,46.14,38.74,46.51,38.77,47.69,39.51,48.06,39.58,48.36,39.29,48.01,38.79,48.63,38.27,48.88,38.32,49.2,37.58,50.15,37.37,50.84,36.87,52.26,36.7,53.83,36.97,53.92,37.2],[45.42,35.98,46.08,35.68,46.15,35.09,45.65,34.75,45.42,33.97,46.11,33.02,47.33,32.47,47.85,31.71,47.69,30.98,48,30.99,48.01,30.45,48.57,29.93,47.97,29.98,47.3,30.06,46.57,29.1,44.71,29.18,41.89,31.19,40.4,31.89,39.2,32.16,38.79,33.38,41.01,34.42,41.38,35.63,41.29,36.36,41.84,36.61,42.35,37.23,42.78,37.39,43.94,37.26,44.29,37,44.77,37.17,45.42,35.98],[-14.51,66.46,-14.74,65.81,-13.61,65.13,-14.91,64.36,-17.79,63.68,-18.66,63.5,-19.97,63.64,-22.76,63.96,-21.78,64.4,-23.96,64.89,-22.18,65.08,-22.23,65.38,-24.33,65.61,-23.65,66.26,-22.13,66.41,-20.58,65.73,-19.06,66.28,-17.8,65.99,-16.17,66.53,-14.51,66.46],[35.72,32.71,35.55,32.39,35.18,32.53,34.97,31.87,35.23,31.75,34.97,31.62,34.93,31.35,35.4,31.49,35.42,31.1,34.92,29.5,34.27,31.22,34.56,31.55,34.49,31.61,34.75,32.07,34.96,32.83,35.1,33.08,35.13,33.09,35.46,33.09,35.55,33.26,35.82,33.28,35.84,32.87,35.7,32.72,35.72,32.71],[15.52,38.23,15.16,37.44,15.31,37.13,15.1,36.62,14.34,37,13.83,37.1,12.43,37.61,12.57,38.13,13.74,38.03,14.76,38.14,15.52,38.23],[9.21,41.21,9.81,40.5,9.67,39.18,9.21,39.24,8.81,38.91,8.43,39.17,8.39,40.38,8.16,40.95,8.71,40.9,9.21,41.21],[12.38,46.77,13.81,46.51,13.7,46.02,13.94,45.59,13.14,45.74,12.33,45.38,12.38,44.89,12.26,44.6,12.59,44.09,13.53,43.59,14.03,42.76,15.14,41.96,15.93,41.96,16.17,41.74,15.89,41.54,16.79,41.18,17.52,40.88,18.38,40.36,18.48,40.17,18.29,39.81,17.74,40.28,16.87,40.44,16.45,39.8,17.17,39.42,17.05,38.9,16.64,38.84,16.1,37.99,15.68,37.91,15.69,38.21,15.89,38.75,16.11,38.96,15.72,39.54,15.41,40.05,15,40.17,14.7,40.6,14.06,40.79,13.63,41.19,12.89,41.25,12.11,41.7,11.19,42.36,10.51,42.93,10.2,43.92,9.7,44.04,8.89,44.37,8.43,44.23,7.85,43.77,7.44,43.69,7.55,44.13,7.01,44.25,6.75,45.03,7.1,45.33,6.8,45.71,6.84,45.99,7.27,45.78,7.76,45.82,8.32,46.16,8.49,46.01,8.97,46.04,9.18,46.44,9.92,46.31,10.36,46.48,10.44,46.89,11.05,46.75,11.16,46.94,12.15,47.12,12.38,46.77],[-77.57,18.49,-76.9,18.4,-76.37,18.16,-76.2,17.89,-76.9,17.87,-77.21,17.7,-77.77,17.86,-78.34,18.23,-78.22,18.45,-77.8,18.52,-77.57,18.49],[35.55,32.39,35.72,32.71,36.83,32.31,38.79,33.38,39.2,32.16,39,32.01,37,31.51,38,30.51,37.67,30.34,37.5,30,36.74,29.87,36.5,29.51,36.07,29.2,34.96,29.36,34.92,29.5,35.42,31.1,35.4,31.49,35.55,31.78,35.55,32.39],[134.64,34.15,134.77,33.81,134.2,33.2,133.79,33.52,133.28,33.29,133.01,32.7,132.36,32.99,132.37,33.46,132.92,34.06,133.49,33.94,133.9,34.36,134.64,34.15],[140.98,37.14,140.6,36.34,140.77,35.84,140.25,35.14,138.98,34.67,137.22,34.61,135.79,33.46,135.12,33.85,135.08,34.6,133.34,34.38,132.16,33.9,130.99,33.89,132,33.15,131.33,31.45,130.69,31.03,130.2,31.42,130.45,32.32,129.81,32.61,129.41,33.3,130.35,33.6,130.88,34.23,131.88,34.75,132.62,35.43,134.61,35.73,135.68,35.53,136.72,37.3,137.39,36.83,138.86,37.83,139.43,38.22,140.05,39.44,139.88,40.56,140.31,41.2,141.37,41.38,141.91,39.99,141.88,39.18,140.96,38.17,140.98,37.14],[143.91,44.17,144.61,43.96,145.32,44.38,145.54,43.26,144.06,42.99,143.18,42,141.61,42.68,141.07,41.58,139.96,41.57,139.82,42.56,140.31,43.33,141.38,43.39,141.67,44.77,141.97,45.55,143.14,44.51,143.91,44.17],[70.96,42.27,70.39,42.08,69.07,41.38,68.63,40.67,68.26,40.66,67.99,41.14,66.71,41.17,66.51,41.99,66.02,41.99,66.1,43,64.9,43.73,63.19,43.65,62.01,43.5,61.06,44.41,60.24,44.78,58.69,45.5,58.5,45.59,55.93,45,55.97,41.31,55.46,41.26,54.76,42.04,54.08,42.32,52.94,42.12,52.5,41.78,52.45,42.03,52.69,42.44,52.5,42.79,51.34,43.13,50.89,44.03,50.34,44.28,50.31,44.61,51.28,44.51,51.32,45.25,52.17,45.41,53.04,45.26,53.22,46.23,53.04,46.85,52.04,46.8,51.19,47.05,50.03,46.61,49.1,46.4,48.59,46.56,48.69,47.08,48.06,47.74,47.32,47.72,46.47,48.39,47.04,49.15,46.75,49.36,47.55,50.45,48.58,49.87,48.7,50.61,50.77,51.69,52.33,51.72,54.53,51.03,55.72,50.62,56.78,51.04,58.36,51.06,59.64,50.55,59.93,50.84,61.34,50.8,61.59,51.27,59.97,51.96,60.93,52.45,60.74,52.72,61.7,52.98,60.98,53.66,61.44,54.01,65.18,54.35,65.67,54.6,68.17,54.97,69.07,55.39,70.87,55.17,71.18,54.13,72.22,54.38,73.51,54.04,73.43,53.49,74.38,53.55,76.89,54.49,76.53,54.18,77.8,53.4,80.04,50.86,80.57,51.39,81.95,50.81,83.38,51.07,83.94,50.89,84.42,50.31,85.12,50.12,85.54,49.69,86.83,49.83,87.36,49.21,86.6,48.55,85.77,48.46,85.72,47.45,85.16,47,83.18,47.33,82.46,45.54,81.95,45.32,79.97,44.92,80.87,43.18,80.18,42.92,80.26,42.35,79.64,42.5,79.14,42.86,77.66,42.96,76,42.99,75.64,42.88,74.21,43.3,73.65,43.09,73.49,42.5,71.84,42.85,71.19,42.7,70.96,42.27],[40.99,-.86,41.59,-1.68,40.88,-2.08,40.64,-2.5,40.26,-2.57,40.12,-3.28,39.8,-3.68,39.6,-4.35,39.2,-4.68,37.77,-3.68,37.7,-3.1,34.07,-1.06,33.9,-.95,33.89,.11,34.18,.52,34.67,1.18,35.04,1.91,34.6,3.05,34.48,3.56,34.01,4.25,34.62,4.85,35.3,5.51,35.82,5.34,35.82,4.78,36.16,4.45,36.86,4.45,38.12,3.6,38.44,3.59,38.67,3.62,38.89,3.5,39.56,3.42,39.85,3.84,40.77,4.26,41.17,3.92,41.86,3.92,40.98,2.78,40.99,-.86],[70.96,42.27,71.19,42.7,71.84,42.85,73.49,42.5,73.65,43.09,74.21,43.3,75.64,42.88,76,42.99,77.66,42.96,79.14,42.86,79.64,42.5,80.26,42.35,80.12,42.12,78.54,41.58,78.19,41.19,76.9,41.07,76.53,40.43,75.47,40.56,74.78,40.37,73.82,39.89,73.96,39.66,73.68,39.43,71.78,39.28,70.55,39.6,69.46,39.53,69.56,40.1,70.65,39.94,71.01,40.24,71.77,40.15,73.06,40.87,71.87,41.39,71.16,41.14,70.42,41.52,71.26,42.17,70.96,42.27],[103.5,10.63,103.09,11.15,102.58,12.19,102.35,13.39,102.99,14.23,104.28,14.42,105.22,14.27,106.04,13.88,106.5,14.57,107.38,14.2,107.61,13.54,107.49,12.34,105.81,11.57,106.25,10.96,105.2,10.89,104.33,10.49,103.5,10.63],[128.35,38.61,129.21,37.43,129.46,36.78,129.47,35.63,129.09,35.08,128.19,34.89,127.39,34.48,126.49,34.39,126.37,34.93,126.56,35.68,126.12,36.73,126.86,36.89,126.17,37.75,126.24,37.84,126.68,37.8,127.07,38.26,127.78,38.3,128.21,38.37,128.35,38.61],[20.76,42.05,20.72,41.85,20.59,41.86,20.52,42.22,20.28,42.32,20.07,42.59,20.26,42.81,20.5,42.88,20.64,43.22,20.81,43.27,20.96,43.13,21.14,43.07,21.27,42.91,21.44,42.86,21.63,42.68,21.78,42.68,21.66,42.44,21.54,42.32,21.58,42.25,21.35,42.21,20.76,42.05],[47.97,29.98,48.18,29.53,48.09,29.31,48.42,28.55,47.71,28.53,47.46,29,46.57,29.1,47.3,30.06,47.97,29.98],[105.22,14.27,105.54,14.72,105.59,15.57,104.78,16.44,104.72,17.43,103.96,18.24,103.2,18.31,103,17.96,102.41,17.93,102.11,18.11,101.06,17.51,101.04,18.41,101.28,19.46,100.61,19.51,100.55,20.11,100.12,20.42,100.33,20.79,101.18,21.44,101.27,21.2,101.8,21.17,101.65,22.32,102.17,22.46,102.75,21.68,103.2,20.77,104.44,20.76,104.82,19.89,104.18,19.62,103.9,19.27,105.09,18.67,105.93,17.49,106.56,16.6,107.31,15.91,107.56,15.2,107.38,14.2,106.5,14.57,106.04,13.88,105.22,14.27],[35.82,33.28,35.55,33.26,35.46,33.09,35.13,33.09,35.48,33.91,35.98,34.61,36,34.64,36.45,34.59,36.61,34.2,36.07,33.82,35.82,33.28],[-7.71,4.36,-7.97,4.36,-9,4.83,-9.91,5.59,-10.77,6.14,-11.44,6.79,-11.2,7.11,-11.15,7.4,-10.7,7.94,-10.23,8.41,-10.02,8.43,-9.76,8.54,-9.34,7.93,-9.4,7.53,-9.21,7.31,-8.93,7.31,-8.72,7.71,-8.44,7.69,-8.49,7.4,-8.39,6.91,-8.6,6.47,-8.31,6.19,-7.99,6.13,-7.57,5.71,-7.54,5.31,-7.64,5.19,-7.71,4.36],[14.85,22.86,14.14,22.49,13.58,23.04,12,23.47,11.56,24.1,10.77,24.56,10.3,24.38,9.95,24.94,9.91,25.37,9.32,26.09,9.72,26.51,9.63,27.14,9.76,27.69,9.68,28.14,9.86,28.96,9.81,29.42,9.48,30.31,9.97,30.54,10.06,30.96,9.95,31.38,10.64,31.76,10.94,32.08,11.43,32.37,11.49,33.14,12.66,32.79,13.08,32.88,13.92,32.71,15.25,32.27,15.71,31.38,16.61,31.18,18.02,30.76,19.09,30.27,19.57,30.53,20.05,30.99,19.82,31.75,20.13,32.24,20.85,32.71,21.54,32.84,22.9,32.64,23.24,32.19,23.61,32.19,23.93,32.02,24.92,31.9,25.16,31.57,24.8,31.09,24.96,30.66,24.7,30.04,25,29.24,25,25.68,25,22,25,20,23.85,20,23.84,19.58,19.85,21.5,15.86,23.41,14.85,22.86],[81.79,7.52,81.64,6.48,81.22,6.2,80.35,5.97,79.87,6.76,79.7,8.2,80.15,9.82,80.84,9.27,81.3,8.56,81.79,7.52],[28.98,-28.96,29.33,-29.26,29.02,-29.74,28.85,-30.07,28.29,-30.23,28.11,-30.55,27.75,-30.65,27,-29.88,27.53,-29.24,28.07,-28.85,28.54,-28.65,28.98,-28.96],[22.73,54.33,22.65,54.58,22.76,54.86,22.32,55.02,21.27,55.19,21.06,56.03,22.2,56.34,23.88,56.27,24.86,56.37,25,56.16,25.53,56.1,26.49,55.62,26.59,55.17,25.77,54.85,25.54,54.28,24.45,53.91,23.48,53.91,23.24,54.22,22.73,54.33],[6.04,50.13,6.24,49.9,6.19,49.46,5.9,49.44,5.67,49.53,5.78,50.09,6.04,50.13],[21.06,56.03,21.09,56.78,21.58,57.41,22.52,57.75,23.32,57.01,24.12,57.03,24.31,57.79,25.16,57.97,25.6,57.85,26.46,57.48,27.29,57.47,27.77,57.24,27.86,56.76,28.18,56.17,27.1,55.78,26.49,55.62,25.53,56.1,25,56.16,24.86,56.37,23.88,56.27,22.2,56.34,21.06,56.03],[-5.19,35.76,-4.59,35.33,-3.64,35.4,-2.6,35.18,-2.17,35.17,-1.79,34.53,-1.73,33.92,-1.39,32.86,-1.12,32.65,-1.31,32.26,-2.62,32.09,-3.07,31.72,-3.65,31.64,-3.69,30.9,-4.86,30.5,-5.24,30,-6.06,29.73,-7.06,29.58,-8.67,28.84,-8.67,27.66,-8.82,27.66,-8.79,27.12,-9.41,27.09,-9.74,26.86,-10.19,26.86,-10.55,26.99,-11.39,26.88,-11.72,26.1,-12.03,26.03,-12.5,24.77,-13.89,23.69,-14.22,22.31,-14.63,21.86,-14.75,21.5,-17,21.42,-17.02,21.42,-16.97,21.89,-16.59,22.16,-16.26,22.68,-16.33,23.02,-15.98,23.72,-15.43,24.36,-15.09,24.52,-14.82,25.1,-14.8,25.64,-14.44,26.25,-13.77,26.62,-13.14,27.64,-13.12,27.65,-12.62,28.04,-11.69,28.15,-10.9,28.83,-10.4,29.1,-9.56,29.93,-9.81,31.18,-9.43,32.04,-9.3,32.56,-8.66,33.24,-7.65,33.7,-6.91,34.11,-6.24,35.15,-5.93,35.76,-5.19,35.76],[26.62,48.22,26.86,48.37,27.52,48.47,28.26,48.16,28.67,48.12,29.12,47.85,29.05,47.51,29.42,47.35,29.56,46.93,29.91,46.67,29.84,46.53,30.02,46.42,29.76,46.35,29.17,46.38,29.07,46.52,28.86,46.44,28.93,46.26,28.66,45.94,28.49,45.6,28.23,45.49,28.05,45.94,28.16,46.37,28.13,46.81,27.55,47.41,27.23,47.83,26.92,48.12,26.62,48.22],[49.54,-12.47,49.81,-12.9,50.06,-13.56,50.22,-14.76,50.48,-15.23,50.38,-15.71,50.2,-16,49.86,-15.41,49.67,-15.71,49.86,-16.45,49.77,-16.88,49.5,-17.11,49.44,-17.95,49.04,-19.12,48.55,-20.5,47.93,-22.39,47.55,-23.78,47.1,-24.94,46.28,-25.18,45.41,-25.6,44.83,-25.35,44.04,-24.99,43.76,-24.46,43.7,-23.57,43.35,-22.78,43.25,-22.06,43.43,-21.34,43.89,-21.16,43.9,-20.83,44.37,-20.07,44.46,-19.44,44.23,-18.96,44.04,-18.33,43.96,-17.41,44.31,-16.85,44.45,-16.22,44.94,-16.18,45.5,-15.97,45.87,-15.79,46.31,-15.78,46.88,-15.21,47.71,-14.59,48.01,-14.09,47.87,-13.66,48.29,-13.78,48.85,-13.09,48.86,-12.49,49.19,-12.04,49.54,-12.47],[-97.14,25.87,-97.53,24.99,-97.7,24.27,-97.78,22.93,-97.87,22.44,-97.7,21.9,-97.39,21.41,-97.19,20.64,-96.53,19.89,-96.29,19.32,-95.9,18.83,-94.84,18.56,-94.43,18.14,-93.55,18.42,-92.79,18.52,-92.04,18.7,-91.41,18.88,-90.77,19.28,-90.53,19.87,-90.45,20.71,-90.28,21,-89.6,21.26,-88.54,21.49,-87.66,21.46,-87.05,21.54,-86.81,21.33,-86.85,20.85,-87.38,20.26,-87.62,19.65,-87.44,19.47,-87.59,19.04,-87.84,18.26,-88.09,18.52,-88.3,18.5,-88.49,18.49,-88.85,17.88,-89.03,18,-89.15,17.96,-89.14,17.81,-90.07,17.82,-91,17.82,-91,17.25,-91.45,17.25,-91.08,16.92,-90.71,16.69,-90.6,16.47,-90.44,16.41,-90.46,16.07,-91.75,16.07,-92.23,15.25,-92.09,15.06,-92.2,14.83,-92.23,14.54,-93.36,15.62,-93.88,15.94,-94.69,16.2,-95.25,16.13,-96.05,15.75,-96.56,15.65,-97.26,15.92,-98.01,16.11,-98.95,16.57,-99.7,16.71,-100.83,17.17,-101.67,17.65,-101.92,17.92,-102.48,17.98,-103.5,18.29,-103.92,18.75,-104.99,19.32,-105.49,19.95,-105.73,20.43,-105.4,20.53,-105.5,20.82,-105.27,21.08,-105.27,21.42,-105.6,21.87,-105.69,22.27,-106.03,22.77,-106.91,23.77,-107.92,24.55,-108.4,25.17,-109.26,25.58,-109.44,25.82,-109.29,26.44,-109.8,26.68,-110.39,27.16,-110.64,27.86,-111.18,27.94,-111.76,28.47,-112.23,28.95,-112.27,29.27,-112.81,30.02,-113.16,30.79,-113.15,31.17,-113.87,31.57,-114.21,31.52,-114.78,31.8,-114.94,31.39,-114.77,30.91,-114.67,30.16,-114.33,29.75,-113.59,29.06,-113.42,28.83,-113.27,28.75,-113.14,28.41,-112.96,28.43,-112.76,27.78,-112.46,27.53,-112.24,27.17,-111.62,26.66,-111.28,25.73,-110.99,25.29,-110.71,24.83,-110.66,24.3,-110.17,24.27,-109.77,23.81,-109.41,23.36,-109.43,23.19,-109.85,22.82,-110.03,22.82,-110.3,23.43,-110.95,24,-111.67,24.48,-112.18,24.74,-112.15,25.47,-112.3,26.01,-112.78,26.32,-113.46,26.77,-113.6,26.64,-113.85,26.9,-114.47,27.14,-115.06,27.72,-114.98,27.8,-114.57,27.74,-114.2,28.12,-114.16,28.57,-114.93,29.28,-115.52,29.56,-115.89,30.18,-116.26,30.84,-116.72,31.64,-117.13,32.54,-115.99,32.61,-114.72,32.72,-114.81,32.53,-113.3,32.04,-111.02,31.33,-109.03,31.34,-108.24,31.34,-108.24,31.75,-106.51,31.75,-106.14,31.4,-105.63,31.08,-105.04,30.64,-104.71,30.12,-104.46,29.57,-103.94,29.27,-103.11,28.97,-102.48,29.76,-101.66,29.78,-100.96,29.38,-100.46,28.7,-100.11,28.11,-99.52,27.54,-99.3,26.84,-99.02,26.37,-98.24,26.06,-97.53,25.84,-97.14,25.87],[20.59,41.86,20.72,41.85,20.76,42.05,21.35,42.21,21.58,42.25,21.92,42.3,22.38,42.32,22.88,42,22.95,41.34,22.76,41.3,22.6,41.13,22.06,41.15,21.67,40.93,21.02,40.84,20.61,41.09,20.46,41.52,20.59,41.86],[-12.17,14.62,-11.83,14.8,-11.67,15.39,-11.35,15.41,-10.65,15.13,-10.09,15.33,-9.7,15.26,-9.55,15.49,-5.54,15.5,-5.32,16.2,-5.49,16.33,-5.97,20.64,-6.45,24.96,-4.92,24.97,-1.55,22.79,1.82,20.61,2.06,20.14,2.68,19.86,3.15,19.69,3.16,19.06,4.27,19.16,4.27,16.85,3.72,16.18,3.64,15.57,2.75,15.41,1.39,15.32,1.02,14.97,.37,14.93,-.27,14.92,-.52,15.12,-1.07,14.97,-2,14.56,-2.19,14.25,-2.97,13.8,-3.1,13.54,-3.52,13.34,-4.01,13.47,-4.28,13.23,-4.43,12.54,-5.22,11.71,-5.2,11.38,-5.47,10.95,-5.4,10.37,-5.82,10.22,-6.05,10.1,-6.21,10.52,-6.49,10.41,-6.67,10.43,-6.85,10.14,-7.62,10.15,-7.9,10.3,-8.03,10.21,-8.34,10.49,-8.28,10.79,-8.41,10.91,-8.62,10.81,-8.58,11.14,-8.38,11.39,-8.79,11.81,-8.91,12.09,-9.13,12.31,-9.33,12.33,-9.57,12.19,-9.89,12.06,-10.17,11.84,-10.59,11.92,-10.87,12.18,-11.04,12.21,-11.3,12.08,-11.46,12.08,-11.51,12.44,-11.47,12.75,-11.55,13.14,-11.93,13.42,-12.12,13.99,-12.17,14.62],[99.54,20.19,98.96,19.75,98.25,19.71,97.8,18.63,97.38,18.45,97.86,17.57,98.49,16.84,98.9,16.18,98.54,15.31,98.19,15.12,98.43,14.62,99.1,13.83,99.21,13.27,99.2,12.8,99.59,11.89,99.04,10.96,98.55,9.93,98.46,10.68,98.76,11.44,98.43,12.03,98.51,13.12,98.1,13.64,97.78,14.84,97.6,16.1,97.16,16.93,96.51,16.43,95.37,15.71,94.81,15.8,94.19,16.04,94.53,17.28,94.32,18.21,93.54,19.37,93.66,19.73,93.08,19.86,92.37,20.67,92.3,21.48,92.65,21.32,92.67,22.04,93.17,22.28,93.06,22.7,93.29,23.04,93.33,24.08,94.11,23.85,94.55,24.68,94.6,25.16,95.16,26,95.12,26.57,96.42,27.26,97.13,27.08,97.05,27.7,97.4,27.88,97.33,28.26,97.91,28.34,98.25,27.75,98.68,27.51,98.71,26.74,98.67,25.92,97.72,25.08,97.6,23.9,98.66,24.06,98.9,23.14,99.53,22.95,99.24,22.12,99.98,21.74,100.42,21.56,101.15,21.85,101.18,21.44,100.33,20.79,100.12,20.42,99.54,20.19],[19.8,42.5,19.74,42.69,19.3,42.2,19.37,41.88,19.16,41.96,18.88,42.28,18.45,42.48,18.56,42.65,18.71,43.2,19.03,43.43,19.22,43.52,19.48,43.35,19.63,43.21,19.96,43.11,20.34,42.9,20.26,42.81,20.07,42.59,19.8,42.5],[87.75,49.3,88.81,49.47,90.71,50.33,92.23,50.8,93.1,50.5,94.15,50.48,94.82,50.01,95.81,49.98,97.26,49.73,98.23,50.42,97.83,51.01,98.86,52.05,99.98,51.63,100.89,51.52,102.07,51.26,102.26,50.51,103.68,50.09,104.62,50.28,105.89,50.41,106.89,50.27,107.87,49.79,108.48,49.28,109.4,49.29,110.66,49.13,111.58,49.38,112.9,49.54,114.36,50.25,114.96,50.14,115.49,49.81,116.68,49.89,116.19,49.13,115.49,48.14,115.74,47.73,116.31,47.85,117.3,47.7,118.06,48.07,118.87,47.75,119.77,47.05,119.66,46.69,118.87,46.81,117.42,46.67,116.72,46.39,115.99,45.73,114.46,45.34,113.46,44.81,112.44,45.01,111.87,45.1,111.35,44.46,111.67,44.07,111.83,43.74,111.13,43.41,110.41,42.87,109.24,42.52,107.74,42.48,106.13,42.13,104.96,41.6,104.52,41.91,103.31,41.91,101.83,42.51,100.85,42.66,99.52,42.52,97.45,42.75,96.35,42.73,95.76,43.32,95.31,44.24,94.69,44.35,93.48,44.98,92.13,45.12,90.95,45.29,90.59,45.72,90.97,46.89,90.28,47.69,88.85,48.07,88.01,48.6,87.75,49.3],[34.56,-11.52,35.31,-11.44,36.51,-11.72,36.78,-11.59,37.47,-11.57,37.83,-11.27,38.43,-11.29,39.52,-10.9,40.32,-10.32,40.48,-10.77,40.44,-11.76,40.56,-12.64,40.6,-14.2,40.78,-14.69,40.48,-15.41,40.09,-16.1,39.45,-16.72,38.54,-17.1,37.41,-17.59,36.28,-18.66,35.9,-18.84,35.2,-19.55,34.79,-19.78,34.7,-20.5,35.18,-21.25,35.37,-21.84,35.39,-22.14,35.56,-22.09,35.53,-23.07,35.37,-23.54,35.61,-23.71,35.46,-24.12,35.04,-24.48,34.22,-24.82,33.01,-25.36,32.57,-25.73,32.66,-26.15,32.92,-26.22,32.83,-26.74,32.07,-26.73,31.99,-26.29,31.84,-25.84,31.75,-25.48,31.93,-24.37,31.67,-23.66,31.19,-22.25,32.24,-21.12,32.51,-20.4,32.66,-20.3,32.77,-19.72,32.61,-19.42,32.65,-18.67,32.85,-17.98,32.85,-16.71,32.33,-16.39,31.85,-16.32,31.64,-16.07,31.17,-15.86,30.34,-15.88,30.27,-15.51,30.18,-14.8,33.21,-13.97,33.79,-14.45,34.06,-14.36,34.46,-14.61,34.52,-15.01,34.31,-15.48,34.38,-16.18,35.03,-16.8,35.34,-16.11,35.77,-15.9,35.69,-14.61,35.27,-13.89,34.91,-13.57,34.56,-13.58,34.28,-12.28,34.56,-11.52],[-12.17,14.62,-12.83,15.3,-13.44,16.04,-14.1,16.3,-14.58,16.6,-15.14,16.59,-15.62,16.37,-16.12,16.46,-16.46,16.14,-16.55,16.67,-16.27,17.17,-16.15,18.11,-16.26,19.1,-16.38,19.59,-16.28,20.09,-16.54,20.57,-17.06,21,-16.85,21.33,-12.93,21.33,-13.12,22.77,-12.87,23.28,-11.94,23.37,-11.97,25.93,-8.69,25.88,-8.68,27.4,-4.92,24.97,-6.45,24.96,-5.97,20.64,-5.49,16.33,-5.32,16.2,-5.54,15.5,-9.55,15.49,-9.7,15.26,-10.09,15.33,-10.65,15.13,-11.35,15.41,-11.67,15.39,-11.83,14.8,-12.17,14.62],[34.56,-11.52,34.28,-12.28,34.56,-13.58,34.91,-13.57,35.27,-13.89,35.69,-14.61,35.77,-15.9,35.34,-16.11,35.03,-16.8,34.38,-16.18,34.31,-15.48,34.52,-15.01,34.46,-14.61,34.06,-14.36,33.79,-14.45,33.21,-13.97,32.69,-13.71,32.99,-12.78,33.31,-12.44,33.11,-11.61,33.32,-10.8,33.49,-10.53,33.23,-9.68,32.76,-9.23,33.74,-9.42,33.94,-9.69,34.28,-10.16,34.56,-11.52],[101.08,6.2,101.15,5.69,101.81,5.81,102.14,6.22,102.37,6.13,102.96,5.52,103.38,4.86,103.44,4.18,103.33,3.73,103.43,3.38,103.5,2.79,103.85,2.52,104.25,1.63,104.23,1.29,103.52,1.23,102.57,1.97,101.39,2.76,101.27,3.27,100.7,3.94,100.56,4.77,100.2,5.31,100.31,6.04,100.09,6.46,100.26,6.64,101.08,6.2],[118.62,4.48,117.88,4.14,117.02,4.31,115.87,4.31,115.52,3.17,115.13,2.82,114.62,1.43,113.81,1.22,112.86,1.5,112.38,1.41,111.8,.9,111.16,.98,110.51,.77,109.83,1.34,109.66,2.01,110.4,1.66,111.17,1.85,111.37,2.7,111.8,2.89,113,3.1,113.71,3.89,114.2,4.53,114.66,4.01,114.87,4.35,115.35,4.32,115.41,4.96,115.45,5.45,116.22,6.14,116.73,6.92,117.13,6.93,117.64,6.42,117.69,5.99,118.35,5.71,119.18,5.41,119.11,5.02,118.44,4.97,118.62,4.48],[16.34,-28.58,15.6,-27.82,15.21,-27.09,14.99,-26.12,14.74,-25.39,14.41,-23.85,14.39,-22.66,14.26,-22.11,13.87,-21.7,13.35,-20.87,12.83,-19.67,12.61,-19.05,11.79,-18.07,11.73,-17.3,12.22,-17.11,12.81,-16.94,13.46,-16.97,14.06,-17.42,14.21,-17.35,18.26,-17.31,18.96,-17.79,21.38,-17.93,23.22,-17.52,24.03,-17.3,24.68,-17.35,25.08,-17.58,25.08,-17.66,24.52,-17.89,24.22,-17.89,23.58,-18.28,23.2,-17.87,21.66,-18.22,20.91,-18.25,20.88,-21.81,19.9,-21.85,19.9,-24.77,19.89,-28.46,19,-28.97,18.46,-29.05,17.84,-28.86,17.39,-28.78,17.22,-28.36,16.82,-28.08,16.34,-28.58],[165.78,-21.08,166.6,-21.7,167.12,-22.16,166.74,-22.4,166.19,-22.13,165.47,-21.68,164.83,-21.15,164.17,-20.44,164.03,-20.11,164.46,-20.12,165.02,-20.46,165.46,-20.8,165.78,-21.08],[2.15,11.94,2.18,12.63,1.02,12.85,.99,13.34,.43,13.99,.3,14.44,.37,14.93,1.02,14.97,1.39,15.32,2.75,15.41,3.64,15.57,3.72,16.18,4.27,16.85,4.27,19.16,5.68,19.6,8.57,21.57,12,23.47,13.58,23.04,14.14,22.49,14.85,22.86,15.1,21.31,15.47,21.05,15.49,20.73,15.9,20.39,15.69,19.96,15.3,17.93,15.25,16.63,13.97,15.68,13.54,14.37,13.96,14,13.95,13.35,14.6,13.33,14.5,12.86,14.21,12.8,14.18,12.48,14,12.46,13.32,13.56,13.08,13.6,12.3,13.04,11.53,13.33,10.99,13.39,10.7,13.25,10.11,13.28,9.52,12.85,9.01,12.83,7.8,13.34,7.33,13.1,6.82,13.12,6.45,13.49,5.44,13.87,4.37,13.75,4.11,13.53,3.97,12.96,3.68,12.55,3.61,11.66,2.85,12.24,2.49,12.23,2.15,11.94],[8.5,4.77,7.46,4.41,7.08,4.46,6.7,4.24,5.9,4.26,5.36,4.89,5.03,5.61,4.33,6.27,3.57,6.26,2.69,6.26,2.75,7.87,2.72,8.51,2.91,9.14,3.22,9.44,3.71,10.06,3.6,10.33,3.8,10.73,3.57,11.33,3.61,11.66,3.68,12.55,3.97,12.96,4.11,13.53,4.37,13.75,5.44,13.87,6.45,13.49,6.82,13.12,7.33,13.1,7.8,13.34,9.01,12.83,9.52,12.85,10.11,13.28,10.7,13.25,10.99,13.39,11.53,13.33,12.3,13.04,13.08,13.6,13.32,13.56,14,12.46,14.18,12.48,14.58,12.09,14.47,11.9,14.42,11.57,13.57,10.8,13.31,10.16,13.17,9.64,12.96,9.42,12.75,8.72,12.22,8.31,12.06,7.8,11.84,7.4,11.75,6.98,11.06,6.64,10.5,7.06,10.12,7.04,9.52,6.45,9.23,6.44,8.76,5.48,8.5,4.77],[-85.71,11.09,-86.06,11.4,-86.53,11.81,-86.75,12.14,-87.17,12.46,-87.67,12.91,-87.56,13.06,-87.39,12.91,-87.32,12.98,-87.01,13.03,-86.88,13.25,-86.73,13.26,-86.76,13.75,-86.52,13.78,-86.31,13.77,-86.1,14.04,-85.8,13.84,-85.7,13.96,-85.51,14.08,-85.17,14.35,-85.15,14.56,-85.05,14.55,-84.92,14.79,-84.82,14.82,-84.65,14.67,-84.45,14.62,-84.23,14.75,-83.98,14.75,-83.63,14.88,-83.49,15.02,-83.15,15,-83.23,14.9,-83.28,14.68,-83.18,14.31,-83.41,13.97,-83.52,13.57,-83.55,13.13,-83.5,12.87,-83.47,12.42,-83.63,12.32,-83.72,11.89,-83.65,11.63,-83.86,11.37,-83.81,11.1,-83.66,10.94,-83.9,10.73,-84.19,10.79,-84.36,11,-84.67,11.08,-84.9,10.95,-85.56,11.22,-85.71,11.09],[6.07,53.51,6.91,53.48,7.09,53.14,6.84,52.23,6.59,51.85,5.99,51.85,6.16,50.8,5.61,51.04,4.97,51.48,4.05,51.27,3.31,51.35,3.83,51.62,4.71,53.09,6.07,53.51],[28.17,71.19,31.29,70.45,30.01,70.19,31.1,69.56,29.4,69.16,28.59,69.06,29.02,69.77,27.73,70.16,26.18,69.83,25.69,69.09,24.74,68.65,23.66,68.89,22.36,68.84,21.24,69.37,20.65,69.11,20.03,69.07,19.88,68.41,17.99,68.57,17.73,68.01,16.77,68.01,16.11,67.3,15.11,66.19,13.56,64.79,13.92,64.45,13.57,64.05,12.58,64.07,11.93,63.13,11.99,61.8,12.63,61.29,12.3,60.12,11.47,59.43,11.03,58.86,10.36,59.47,8.38,58.31,7.05,58.08,5.67,58.59,5.31,59.66,4.99,61.97,5.91,62.61,8.55,63.45,10.53,64.49,12.36,65.88,14.76,67.81,16.44,68.56,19.18,69.82,21.38,70.26,23.02,70.2,24.55,71.03,26.37,70.99,28.17,71.19],[24.72,77.85,22.49,77.44,20.73,77.68,21.42,77.94,20.81,78.25,22.88,78.45,23.28,78.08,24.72,77.85],[18.25,79.7,21.54,78.96,19.03,78.56,18.47,77.83,17.59,77.64,17.12,76.81,15.91,76.77,13.76,77.38,14.67,77.74,13.17,78.02,11.22,78.87,10.44,79.65,13.17,80.01,13.72,79.66,15.14,79.67,15.52,80.02,16.99,80.05,18.25,79.7],[25.45,80.41,27.41,80.06,25.92,79.52,23.02,79.4,20.08,79.57,19.9,79.84,18.46,79.86,17.37,80.32,20.46,80.6,21.91,80.36,22.92,80.66,25.45,80.41],[88.12,27.88,88.04,27.45,88.17,26.81,88.06,26.41,87.23,26.4,86.02,26.63,85.25,26.73,84.68,27.23,83.3,27.36,82,27.93,81.06,28.42,80.09,28.79,80.48,29.73,81.11,30.18,81.53,30.42,82.33,30.12,83.34,29.46,83.9,29.32,84.23,28.84,85.01,28.64,85.82,28.2,86.95,27.97,88.12,27.88],[173.02,-40.92,173.25,-41.33,173.96,-40.93,174.25,-41.35,174.25,-41.77,173.88,-42.23,173.22,-42.97,172.71,-43.37,173.08,-43.85,172.31,-43.87,171.45,-44.24,171.19,-44.9,170.62,-45.91,169.83,-46.36,169.33,-46.64,168.41,-46.62,167.76,-46.29,166.68,-46.22,166.51,-45.85,167.05,-45.11,168.3,-44.12,168.95,-43.94,169.67,-43.56,170.52,-43.03,171.13,-42.51,171.57,-41.77,171.95,-41.51,172.1,-40.96,172.8,-40.49,173.02,-40.92],[174.61,-36.16,175.34,-37.21,175.36,-36.53,175.81,-36.8,175.96,-37.56,176.76,-37.88,177.44,-37.96,178.01,-37.58,178.52,-37.7,178.27,-38.58,177.97,-39.17,177.21,-39.15,176.94,-39.45,177.03,-39.88,176.89,-40.07,176.51,-40.6,176.01,-41.29,175.24,-41.69,175.07,-41.43,174.65,-41.28,175.23,-40.46,174.9,-39.91,173.82,-39.51,173.85,-39.15,174.57,-38.8,174.74,-38.03,174.7,-37.38,174.29,-36.71,174.32,-36.53,173.84,-36.12,173.05,-35.24,172.64,-34.53,173.01,-34.45,173.55,-35.01,174.33,-35.27,174.61,-36.16],[58.86,21.11,58.49,20.43,58.03,20.48,57.83,20.24,57.67,19.74,57.79,19.07,57.69,18.94,57.23,18.95,56.61,18.57,56.51,18.09,56.28,17.88,55.66,17.88,55.27,17.63,55.27,17.23,54.79,16.95,54.24,17.04,53.57,16.71,53.11,16.65,52.78,17.35,52,19,55,20,55.67,22,55.21,22.71,55.23,23.11,55.53,23.52,55.53,23.93,55.98,24.13,55.8,24.27,55.89,24.92,56.4,24.92,56.85,24.24,57.4,23.88,58.14,23.75,58.73,23.57,59.18,22.99,59.45,22.66,59.81,22.53,59.81,22.31,59.44,21.71,59.28,21.43,58.86,21.11],[56.39,25.9,56.26,25.71,56.07,26.06,56.36,26.4,56.49,26.31,56.39,25.9],[75.16,37.13,75.9,36.67,76.19,35.9,77.84,35.49,76.87,34.65,75.76,34.5,74.24,34.75,73.75,34.32,74.1,33.44,74.45,32.76,75.26,32.27,74.41,31.69,74.42,30.98,73.45,29.98,72.82,28.96,71.78,27.91,70.62,27.99,69.51,26.94,70.17,26.49,70.28,25.72,70.84,25.22,71.04,24.36,68.84,24.36,68.18,23.69,67.44,23.94,67.15,24.66,66.37,25.43,64.53,25.24,62.91,25.22,61.5,25.08,61.87,26.24,63.32,26.76,63.23,27.22,62.76,27.38,62.73,28.26,61.77,28.7,61.37,29.3,60.87,29.83,62.55,29.32,63.55,29.47,64.15,29.34,64.35,29.56,65.05,29.47,66.35,29.89,66.38,30.74,66.94,31.3,67.68,31.3,67.79,31.58,68.56,31.71,68.93,31.62,69.32,31.9,69.26,32.5,69.69,33.11,70.32,33.36,69.93,34.02,70.88,33.99,71.16,34.35,71.12,34.73,71.61,35.15,71.5,35.65,71.26,36.07,71.85,36.51,72.92,36.72,74.07,36.84,74.58,37.02,75.16,37.13],[-77.88,7.22,-78.21,7.51,-78.43,8.05,-78.18,8.32,-78.44,8.39,-78.62,8.72,-79.12,9,-79.56,8.93,-79.76,8.58,-80.16,8.33,-80.38,8.3,-80.48,8.09,-80,7.55,-80.28,7.42,-80.42,7.27,-80.89,7.22,-81.06,7.82,-81.19,7.65,-81.52,7.71,-81.72,8.11,-82.13,8.18,-82.39,8.29,-82.82,8.29,-82.85,8.07,-82.97,8.23,-82.91,8.42,-82.83,8.63,-82.87,8.81,-82.72,8.93,-82.93,9.07,-82.93,9.48,-82.55,9.57,-82.19,9.21,-82.21,9,-81.81,8.95,-81.71,9.03,-81.44,8.79,-80.95,8.86,-80.52,9.11,-79.91,9.31,-79.57,9.61,-79.02,9.55,-79.06,9.45,-78.5,9.42,-78.06,9.25,-77.73,8.95,-77.35,8.67,-77.47,8.52,-77.24,7.94,-77.43,7.64,-77.75,7.71,-77.88,7.22],[-69.59,-17.58,-69.86,-18.09,-70.37,-18.35,-71.38,-17.77,-71.46,-17.36,-73.44,-16.36,-75.24,-15.27,-76.01,-14.65,-76.42,-13.82,-76.26,-13.54,-77.11,-12.22,-78.09,-10.38,-79.04,-8.39,-79.45,-7.93,-79.76,-7.19,-80.54,-6.54,-81.25,-6.14,-80.93,-5.69,-81.41,-4.74,-81.1,-4.04,-80.3,-3.4,-80.18,-3.82,-80.47,-4.06,-80.44,-4.43,-80.03,-4.35,-79.62,-4.45,-79.21,-4.96,-78.64,-4.55,-78.45,-3.87,-77.84,-3,-76.64,-2.61,-75.54,-1.56,-75.23,-.91,-75.37,-.15,-75.11,-.06,-74.44,-.53,-74.12,-1,-73.66,-1.26,-73.07,-2.31,-72.33,-2.43,-71.77,-2.17,-71.41,-2.34,-70.81,-2.26,-70.05,-2.73,-70.69,-3.74,-70.39,-3.77,-69.89,-4.3,-70.79,-4.25,-70.93,-4.4,-71.75,-4.59,-72.89,-5.27,-72.96,-5.74,-73.22,-6.09,-73.12,-6.63,-73.72,-6.92,-73.72,-7.34,-73.99,-7.52,-73.57,-8.42,-73.02,-9.03,-73.23,-9.46,-72.56,-9.52,-72.18,-10.05,-71.3,-10.08,-70.48,-9.49,-70.55,-11.01,-70.09,-11.12,-69.53,-10.95,-68.67,-12.56,-68.88,-12.9,-68.93,-13.6,-68.95,-14.45,-69.34,-14.95,-69.16,-15.32,-69.39,-15.66,-68.96,-16.5,-69.59,-17.58],[126.38,8.41,126.48,7.75,126.54,7.19,126.2,6.27,125.83,7.29,125.36,6.79,125.68,6.05,125.4,5.58,124.22,6.16,123.94,6.89,124.24,7.36,123.61,7.83,123.3,7.42,122.83,7.46,122.09,6.9,121.92,7.19,122.31,8.03,122.94,8.32,123.49,8.69,123.84,8.24,124.6,8.51,124.76,8.96,125.47,8.99,125.41,9.76,126.22,9.29,126.31,8.78,126.38,8.41],[123.98,10.28,123.62,9.95,123.31,9.32,123,9.02,122.38,9.71,122.59,9.98,122.84,10.26,122.95,10.88,123.5,10.94,123.34,10.27,124.08,11.23,123.98,10.28],[118.5,9.32,117.17,8.37,117.66,9.07,118.39,9.68,118.99,10.38,119.51,11.37,119.69,10.55,119.03,10,118.5,9.32],[121.88,11.89,122.48,11.58,123.12,11.58,123.1,11.17,122.64,10.74,122,10.44,121.97,10.91,122.04,11.42,121.88,11.89],[125.5,12.16,125.78,11.05,125.01,11.31,125.03,10.98,125.28,10.36,124.8,10.13,124.76,10.84,124.46,10.89,124.3,11.5,124.89,11.42,124.88,11.79,124.27,12.56,125.23,12.54,125.5,12.16],[121.53,13.07,121.26,12.21,120.83,12.7,120.32,13.47,121.18,13.43,121.53,13.07],[121.32,18.5,121.94,18.22,122.25,18.48,122.34,18.22,122.17,17.81,122.52,17.09,122.25,16.26,121.66,15.93,121.51,15.12,121.73,14.33,122.26,14.22,122.7,14.34,123.95,13.78,123.86,13.24,124.18,13,124.08,12.54,123.3,13.03,122.93,13.55,122.67,13.19,122.03,13.78,121.13,13.64,120.63,13.86,120.68,14.27,120.99,14.53,120.69,14.76,120.56,14.4,120.07,14.97,119.92,15.41,119.88,16.36,120.29,16.03,120.39,17.6,120.72,18.51,121.32,18.5],[155.88,-6.82,155.6,-6.92,155.17,-6.54,154.73,-5.9,154.51,-5.14,154.65,-5.04,154.76,-5.34,155.06,-5.57,155.55,-6.2,156.02,-6.54,155.88,-6.82],[151.98,-5.48,151.46,-5.56,151.3,-5.84,150.75,-6.08,150.24,-6.32,149.71,-6.32,148.89,-6.03,148.32,-5.75,148.4,-5.44,149.3,-5.58,149.85,-5.51,150,-5.03,150.14,-5,150.24,-5.53,150.81,-5.46,151.09,-5.11,151.65,-4.76,151.54,-4.17,152.14,-4.15,152.34,-4.31,152.32,-4.87,151.98,-5.48],[147.19,-7.39,148.08,-8.04,148.73,-9.1,149.31,-9.07,149.27,-9.51,150.04,-9.68,149.74,-9.87,150.8,-10.29,150.69,-10.58,150.03,-10.65,149.78,-10.39,148.92,-10.28,147.91,-10.13,147.14,-9.49,146.57,-8.94,146.05,-8.07,144.74,-7.63,143.9,-7.92,143.29,-8.25,143.41,-8.98,142.63,-9.33,142.07,-9.16,141.03,-9.12,141.02,-5.86,141,-2.6,142.74,-3.29,144.58,-3.86,145.27,-4.37,145.83,-4.88,145.98,-5.47,147.65,-6.08,147.89,-6.61,146.97,-6.72,147.19,-7.39],[153.14,-4.5,152.83,-4.77,152.64,-4.18,152.41,-3.79,151.95,-3.46,151.38,-3.04,150.66,-2.74,150.94,-2.5,151.48,-2.78,151.82,-3,152.24,-3.24,152.64,-3.66,153.02,-3.98,153.14,-4.5],[15.02,51.11,14.61,51.75,14.69,52.09,14.44,52.62,14.07,52.98,14.35,53.25,14.12,53.76,14.8,54.05,16.36,54.51,17.62,54.85,18.62,54.68,18.7,54.44,19.66,54.43,20.89,54.31,22.73,54.33,23.24,54.22,23.48,53.91,23.53,53.47,23.8,53.09,23.8,52.69,23.2,52.49,23.51,52.02,23.53,51.58,24.03,50.71,23.92,50.42,23.43,50.31,22.52,49.48,22.78,49.03,22.56,49.09,21.61,49.47,20.89,49.33,20.42,49.43,19.83,49.22,19.32,49.57,18.91,49.44,18.85,49.5,18.39,49.99,17.65,50.05,17.55,50.36,16.87,50.47,16.72,50.22,16.18,50.42,16.24,50.7,15.49,50.78,15.02,51.11],[-66.28,18.51,-65.77,18.43,-65.59,18.23,-65.85,17.98,-66.6,17.98,-67.18,17.95,-67.24,18.37,-67.1,18.52,-66.28,18.51],[130.64,42.4,130.78,42.22,130.4,42.28,129.97,41.94,129.67,41.6,129.71,40.88,129.19,40.66,129.01,40.49,128.63,40.19,127.97,40.03,127.53,39.76,127.5,39.32,127.39,39.21,127.78,39.05,128.35,38.61,128.21,38.37,127.78,38.3,127.07,38.26,126.68,37.8,126.24,37.84,126.17,37.75,125.69,37.94,125.57,37.75,125.28,37.67,125.24,37.86,124.98,37.95,124.71,38.11,124.99,38.55,125.22,38.67,125.13,38.85,125.39,39.39,125.32,39.55,124.74,39.66,124.27,39.93,125.08,40.57,126.18,41.11,126.87,41.82,127.34,41.5,128.21,41.47,128.05,41.99,129.6,42.42,129.99,42.99,130.64,42.4],[-9.03,41.88,-8.67,42.13,-8.26,42.28,-8.01,41.79,-7.42,41.79,-7.25,41.92,-6.67,41.88,-6.39,41.38,-6.85,41.11,-6.86,40.33,-7.03,40.18,-7.07,39.71,-7.5,39.63,-7.1,39.03,-7.37,38.37,-7.03,38.08,-7.17,37.8,-7.54,37.43,-7.45,37.1,-7.86,36.84,-8.38,36.98,-8.9,36.87,-8.75,37.65,-8.84,38.27,-9.29,38.36,-9.53,38.74,-9.45,39.39,-9.05,39.76,-8.98,40.16,-8.77,40.76,-8.79,41.18,-8.99,41.54,-9.03,41.88],[-62.69,-22.25,-62.29,-21.05,-62.27,-20.51,-61.79,-19.63,-60.04,-19.34,-59.12,-19.36,-58.18,-19.87,-58.17,-20.18,-57.87,-20.73,-57.94,-22.09,-56.88,-22.28,-56.47,-22.09,-55.8,-22.36,-55.61,-22.66,-55.52,-23.57,-55.4,-23.96,-55.03,-24,-54.65,-23.84,-54.29,-24.02,-54.29,-24.57,-54.43,-25.16,-54.63,-25.74,-54.79,-26.62,-55.7,-27.39,-56.49,-27.55,-57.61,-27.4,-58.62,-27.12,-57.63,-25.6,-57.78,-25.16,-58.81,-24.77,-60.03,-24.03,-60.85,-23.88,-62.69,-22.25],[50.81,24.75,50.74,25.48,51.01,26.01,51.29,26.11,51.59,25.8,51.61,25.22,51.39,24.63,51.11,24.56,50.81,24.75],[22.71,47.88,23.14,48.1,23.76,47.99,24.4,47.98,24.87,47.74,25.21,47.89,25.95,47.99,26.2,48.22,26.62,48.22,26.92,48.12,27.23,47.83,27.55,47.41,28.13,46.81,28.16,46.37,28.05,45.94,28.23,45.49,28.68,45.3,29.15,45.46,29.6,45.29,29.63,45.04,29.14,44.82,28.84,44.91,28.56,43.71,27.97,43.81,27.24,44.18,26.07,43.94,25.57,43.69,24.1,43.74,23.33,43.9,22.94,43.82,22.66,44.23,22.47,44.41,22.71,44.58,22.46,44.7,22.15,44.48,21.56,44.77,21.48,45.18,20.87,45.42,20.76,45.73,20.22,46.13,21.02,46.32,21.63,46.99,22.1,47.67,22.71,47.88],[143.65,50.75,144.65,48.98,143.17,49.31,142.56,47.86,143.53,46.84,143.51,46.14,142.75,46.74,142.09,45.97,141.91,46.81,142.02,47.78,141.9,48.86,142.14,49.62,142.18,50.95,141.59,51.94,141.68,53.3,142.61,53.76,142.21,54.23,142.65,54.37,142.91,53.7,143.26,52.74,143.24,51.76,143.65,50.75],[22.73,54.33,20.89,54.31,19.66,54.43,19.89,54.87,21.27,55.19,22.32,55.02,22.76,54.86,22.65,54.58,22.73,54.33],[-175.01,66.58,-174.34,66.34,-174.57,67.06,-171.86,66.91,-169.9,65.98,-170.89,65.54,-172.53,65.44,-172.55,64.46,-172.96,64.25,-173.89,64.28,-174.65,64.63,-175.98,64.92,-176.21,65.36,-177.22,65.52,-178.36,65.39,-178.9,65.74,-178.69,66.11,-179.88,65.87,-179.43,65.4,-180,64.98,-180,68.96,-177.55,68.2,-174.93,67.21,-175.01,66.58],[180,70.83,178.9,70.78,178.73,71.1,180,71.52,180,70.83],[-178.69,70.89,-180,70.83,-180,71.52,-179.87,71.56,-179.02,71.56,-177.58,71.27,-177.66,71.13,-178.69,70.89],[143.6,73.21,142.09,73.21,140.04,73.32,139.86,73.37,140.81,73.77,142.06,73.86,143.48,73.48,143.6,73.21],[150.73,75.08,149.58,74.69,147.98,74.78,146.12,75.17,146.36,75.5,148.22,75.35,150.73,75.08],[145.09,75.56,144.3,74.82,140.61,74.85,138.96,74.61,136.97,75.26,137.51,75.95,138.83,76.14,141.47,76.09,145.09,75.56],[57.54,70.72,56.94,70.63,53.68,70.76,53.41,71.21,51.6,71.47,51.46,72.01,52.48,72.23,52.44,72.77,54.43,73.63,53.51,73.75,55.9,74.63,55.63,75.08,57.87,75.61,61.17,76.25,64.5,76.44,66.21,76.81,68.16,76.94,68.85,76.54,68.18,76.23,64.64,75.74,61.58,75.26,58.48,74.31,56.99,73.33,55.42,72.37,55.62,71.54,57.54,70.72],[106.97,76.97,107.24,76.48,108.15,76.72,111.08,76.71,113.33,76.22,114.13,75.85,113.89,75.33,112.78,75.03,110.15,74.48,109.4,74.18,110.64,74.04,112.12,73.79,113.02,73.98,113.53,73.34,113.97,73.59,115.57,73.75,118.78,73.59,119.02,73.12,123.2,72.97,123.26,73.74,125.38,73.56,126.98,73.57,128.59,73.04,129.05,72.4,128.46,71.98,129.72,71.19,131.29,70.79,132.25,71.84,133.86,71.39,135.56,71.66,137.5,71.35,138.23,71.63,139.87,71.49,139.15,72.42,140.47,72.85,149.5,72.2,150.35,71.61,152.97,70.84,157.01,71.03,159,70.87,159.83,70.45,159.71,69.72,160.94,69.44,162.28,69.64,164.05,69.67,165.94,69.47,167.84,69.58,169.58,68.69,170.82,69.01,170.01,69.65,170.45,70.1,173.64,69.82,175.72,69.88,178.6,69.4,180,68.96,180,64.98,179.99,64.97,178.71,64.53,177.41,64.61,178.31,64.08,178.91,63.25,179.37,62.98,179.49,62.57,179.23,62.3,177.36,62.52,174.57,61.77,173.68,61.65,172.15,60.95,170.7,60.34,170.33,59.88,168.9,60.57,166.29,59.79,165.84,60.16,164.88,59.73,163.54,59.87,163.22,59.21,162.02,58.24,162.05,57.84,163.19,57.62,163.06,56.16,162.13,56.12,161.7,55.29,162.12,54.86,160.37,54.34,160.02,53.2,158.53,52.96,158.23,51.94,156.79,51.01,156.42,51.7,155.99,53.16,155.43,55.38,155.91,56.77,156.76,57.36,156.81,57.83,158.36,58.06,160.15,59.31,161.87,60.34,163.67,61.14,164.47,62.55,163.26,62.47,162.66,61.64,160.12,60.54,159.3,61.77,156.72,61.43,154.22,59.76,155.04,59.14,152.81,58.88,151.27,58.78,151.34,59.5,149.78,59.66,148.54,59.16,145.49,59.34,142.2,59.04,138.96,57.09,135.13,54.73,136.7,54.6,137.19,53.98,138.16,53.76,138.8,54.25,139.9,54.19,141.35,53.09,141.38,52.24,140.6,51.24,140.51,50.05,140.06,48.45,138.55,47,138.22,46.31,136.86,45.14,135.52,43.99,134.87,43.4,133.54,42.81,132.91,42.8,132.28,43.28,130.94,42.55,130.78,42.22,130.64,42.4,130.63,42.9,131.14,42.93,131.29,44.11,131.03,44.97,131.88,45.32,133.1,45.14,133.77,46.12,134.11,47.21,134.5,47.58,135.03,48.48,133.37,48.18,132.51,47.79,130.99,47.79,130.58,48.73,129.4,49.44,127.66,49.76,127.29,50.74,126.94,51.35,126.56,51.78,125.95,52.79,125.07,53.16,123.57,53.46,122.25,53.43,121,53.25,120.18,52.75,120.73,52.52,120.74,51.96,120.18,51.64,119.28,50.58,119.29,50.14,117.88,49.51,116.68,49.89,115.49,49.81,114.96,50.14,114.36,50.25,112.9,49.54,111.58,49.38,110.66,49.13,109.4,49.29,108.48,49.28,107.87,49.79,106.89,50.27,105.89,50.41,104.62,50.28,103.68,50.09,102.26,50.51,102.07,51.26,100.89,51.52,99.98,51.63,98.86,52.05,97.83,51.01,98.23,50.42,97.26,49.73,95.81,49.98,94.82,50.01,94.15,50.48,93.1,50.5,92.23,50.8,90.71,50.33,88.81,49.47,87.75,49.3,87.36,49.21,86.83,49.83,85.54,49.69,85.12,50.12,84.42,50.31,83.94,50.89,83.38,51.07,81.95,50.81,80.57,51.39,80.04,50.86,77.8,53.4,76.53,54.18,76.89,54.49,74.38,53.55,73.43,53.49,73.51,54.04,72.22,54.38,71.18,54.13,70.87,55.17,69.07,55.39,68.17,54.97,65.67,54.6,65.18,54.35,61.44,54.01,60.98,53.66,61.7,52.98,60.74,52.72,60.93,52.45,59.97,51.96,61.59,51.27,61.34,50.8,59.93,50.84,59.64,50.55,58.36,51.06,56.78,51.04,55.72,50.62,54.53,51.03,52.33,51.72,50.77,51.69,48.7,50.61,48.58,49.87,47.55,50.45,46.75,49.36,47.04,49.15,46.47,48.39,47.32,47.72,48.06,47.74,48.69,47.08,48.59,46.56,49.1,46.4,48.65,45.81,47.68,45.64,46.68,44.61,47.59,43.66,47.49,42.99,48.58,41.81,47.99,41.41,47.82,41.15,47.37,41.22,46.69,41.83,46.4,41.86,45.78,42.09,45.47,42.5,44.54,42.71,43.93,42.55,43.76,42.74,42.39,43.22,40.92,43.38,40.08,43.55,39.96,43.43,38.68,44.28,37.54,44.66,36.68,45.24,37.4,45.4,38.23,46.24,37.67,46.64,39.15,47.04,39.12,47.26,38.22,47.1,38.26,47.55,38.77,47.83,39.74,47.9,39.9,48.23,39.67,48.78,40.08,49.31,40.07,49.6,38.59,49.93,38.01,49.92,37.39,50.38,36.63,50.23,35.36,50.58,35.38,50.77,35.02,51.21,34.22,51.26,34.14,51.57,34.39,51.77,33.75,52.34,32.72,52.24,32.41,52.29,32.16,52.06,31.79,52.1,31.54,52.74,31.31,53.07,31.5,53.17,32.3,53.13,32.69,53.35,32.41,53.62,31.73,53.79,31.79,53.97,31.38,54.16,30.76,54.81,30.97,55.08,30.87,55.55,29.9,55.79,29.37,55.67,29.23,55.92,28.18,56.17,27.86,56.76,27.77,57.24,27.29,57.47,27.72,57.79,27.42,58.72,28.13,59.3,27.98,59.48,29.12,60.03,28.07,60.5,30.21,61.78,31.14,62.36,31.52,62.87,30.04,63.55,30.44,64.2,29.54,64.95,30.22,65.81,29.05,66.94,29.98,67.7,28.45,68.36,28.59,69.06,29.4,69.16,31.1,69.56,32.13,69.91,33.78,69.3,36.51,69.06,40.29,67.93,41.06,67.46,41.13,66.79,40.02,66.27,38.38,66,33.92,66.76,33.18,66.63,34.81,65.9,34.88,65.44,34.94,64.41,36.23,64.11,37.01,63.85,37.14,64.33,36.54,64.76,37.18,65.14,39.59,64.52,40.44,64.76,39.76,65.5,42.09,66.48,43.02,66.42,43.95,66.07,44.53,66.76,43.7,67.35,44.19,67.95,43.45,68.57,46.25,68.25,46.82,67.69,45.56,67.57,45.56,67.01,46.35,66.67,47.89,66.88,48.14,67.52,50.23,68,53.72,68.86,54.47,68.81,53.49,68.2,54.73,68.1,55.44,68.44,57.32,68.47,58.8,68.88,59.94,68.28,61.08,68.94,60.03,69.52,60.55,69.85,63.5,69.55,64.89,69.23,68.51,68.09,69.18,68.62,68.16,69.14,68.14,69.36,66.93,69.45,67.26,69.93,66.72,70.71,66.69,71.03,68.54,71.93,69.2,72.84,69.94,73.04,72.59,72.78,72.8,72.22,71.85,71.41,72.47,71.09,72.79,70.39,72.56,69.02,73.67,68.41,73.24,67.74,71.28,66.32,72.42,66.17,72.82,66.53,73.92,66.79,74.19,67.28,75.05,67.76,74.47,68.33,74.94,68.99,73.84,69.07,73.6,69.63,74.4,70.63,73.1,71.45,74.89,72.12,74.66,72.83,75.16,72.85,75.68,72.3,75.29,71.34,76.36,71.15,75.9,71.87,77.58,72.27,79.65,72.32,81.5,71.75,80.61,72.58,80.51,73.65,82.25,73.85,84.66,73.81,86.82,73.94,86.01,74.46,87.17,75.12,88.32,75.14,90.26,75.64,92.9,75.77,93.23,76.05,95.86,76.14,96.68,75.92,98.92,76.45,100.76,76.43,101.04,76.86,101.99,77.29,104.35,77.7,106.07,77.37,104.71,77.13,106.97,76.97],[105.08,78.31,99.44,77.92,101.26,79.23,102.09,79.35,102.84,79.28,105.37,78.71,105.08,78.31],[51.14,80.55,49.79,80.42,48.89,80.34,48.75,80.18,47.59,80.01,46.5,80.25,47.07,80.56,44.85,80.59,46.8,80.77,48.32,80.78,48.52,80.51,49.1,80.75,50.04,80.92,51.52,80.7,51.14,80.55],[99.94,78.88,97.76,78.76,94.97,79.04,93.31,79.43,92.55,80.14,91.18,80.34,93.78,81.02,95.94,81.25,97.88,80.75,100.19,79.78,99.94,78.88],[30.42,-1.13,30.82,-1.7,30.76,-2.29,30.47,-2.41,29.94,-2.35,29.63,-2.92,29.02,-2.84,29.12,-2.29,29.25,-2.22,29.29,-1.62,29.58,-1.34,29.82,-1.44,30.42,-1.13],[-8.79,27.12,-8.82,27.66,-8.67,27.66,-8.67,27.59,-8.68,27.4,-8.69,25.88,-11.97,25.93,-11.94,23.37,-12.87,23.28,-13.12,22.77,-12.93,21.33,-16.85,21.33,-17.06,21,-17.02,21.42,-17,21.42,-14.75,21.5,-14.63,21.86,-14.22,22.31,-13.89,23.69,-12.5,24.77,-12.03,26.03,-11.72,26.1,-11.39,26.88,-10.55,26.99,-10.19,26.86,-9.74,26.86,-9.41,27.09,-8.79,27.12],[42.78,16.35,42.65,16.77,42.35,17.08,42.27,17.47,41.75,17.83,41.22,18.67,40.94,19.49,40.25,20.17,39.8,20.34,39.14,21.29,39.02,21.99,39.07,22.58,38.49,23.69,38.02,24.08,37.48,24.29,37.15,24.86,37.21,25.08,36.93,25.6,36.64,25.83,36.25,26.57,35.64,27.38,35.13,28.06,34.63,28.06,34.79,28.61,34.83,28.96,34.96,29.36,36.07,29.2,36.5,29.51,36.74,29.87,37.5,30,37.67,30.34,38,30.51,37,31.51,39,32.01,39.2,32.16,40.4,31.89,41.89,31.19,44.71,29.18,46.57,29.1,47.46,29,47.71,28.53,48.42,28.55,48.81,27.69,49.3,27.46,49.47,27.11,50.15,26.69,50.21,26.28,50.11,25.94,50.24,25.61,50.53,25.33,50.66,25,50.81,24.75,51.11,24.56,51.39,24.63,51.58,24.25,51.62,24.01,52,23,55.01,22.5,55.21,22.71,55.67,22,55,20,52,19,49.12,18.62,48.18,18.17,47.47,17.12,47,16.95,46.75,17.28,46.37,17.23,45.4,17.33,45.22,17.43,44.06,17.41,43.79,17.32,43.38,17.58,43.12,17.09,43.22,16.67,42.78,16.35],[33.96,9.46,33.82,9.48,33.84,9.98,33.72,10.33,33.21,10.72,33.09,11.44,33.21,12.18,32.74,12.25,32.67,12.02,32.07,11.97,32.31,11.68,32.4,11.08,31.85,10.53,31.35,9.81,30.84,9.71,30,10.29,29.62,10.08,29.52,9.79,29,9.6,28.97,9.4,27.97,9.4,27.83,9.6,27.11,9.64,26.75,9.47,26.48,9.55,25.96,10.14,25.79,10.41,25.07,10.27,24.79,9.81,24.54,8.92,24.19,8.73,23.89,8.62,23.81,8.67,23.46,8.95,23.39,9.27,23.56,9.68,23.55,10.09,22.98,10.71,22.86,11.14,22.88,11.38,22.51,11.68,22.5,12.26,22.29,12.65,21.94,12.59,22.04,12.96,22.3,13.37,22.18,13.79,22.51,14.09,22.3,14.33,22.57,14.94,23.02,15.68,23.89,15.61,23.84,19.58,23.85,20,25,20,25,22,29.02,22,32.9,22,36.87,22,37.19,21.02,36.97,20.84,37.11,19.81,37.48,18.61,37.86,18.37,38.41,18,37.9,17.43,37.17,17.26,36.85,16.96,36.75,16.29,36.32,14.82,36.43,14.42,36.27,13.56,35.86,12.58,35.26,12.08,34.83,11.32,34.73,10.91,34.26,10.63,33.96,9.58,33.96,9.46],[33.96,9.46,33.97,8.68,33.83,8.38,33.29,8.35,32.95,7.78,33.57,7.71,34.08,7.23,34.25,6.83,34.71,6.59,35.3,5.51,34.62,4.85,34.01,4.25,33.39,3.79,32.69,3.79,31.88,3.56,31.25,3.78,30.83,3.51,29.95,4.17,29.72,4.6,29.16,4.39,28.7,4.46,28.43,4.29,27.98,4.41,27.37,5.23,27.21,5.55,26.47,5.95,26.21,6.55,25.8,6.98,25.12,7.5,25.11,7.83,24.57,8.23,23.89,8.62,24.19,8.73,24.54,8.92,24.79,9.81,25.07,10.27,25.79,10.41,25.96,10.14,26.48,9.55,26.75,9.47,27.11,9.64,27.83,9.6,27.97,9.4,28.97,9.4,29,9.6,29.52,9.79,29.62,10.08,30,10.29,30.84,9.71,31.35,9.81,31.85,10.53,32.4,11.08,32.31,11.68,32.07,11.97,32.67,12.02,32.74,12.25,33.21,12.18,33.09,11.44,33.21,10.72,33.72,10.33,33.84,9.98,33.82,9.48,33.96,9.46],[-16.71,13.59,-17.13,14.37,-17.63,14.73,-17.19,14.92,-16.7,15.62,-16.46,16.14,-16.12,16.46,-15.62,16.37,-15.14,16.59,-14.58,16.6,-14.1,16.3,-13.44,16.04,-12.83,15.3,-12.17,14.62,-12.12,13.99,-11.93,13.42,-11.55,13.14,-11.47,12.75,-11.51,12.44,-11.66,12.39,-12.2,12.47,-12.28,12.35,-12.5,12.33,-13.22,12.58,-13.7,12.59,-15.55,12.63,-15.82,12.52,-16.15,12.55,-16.68,12.38,-16.84,13.15,-15.93,13.13,-15.69,13.27,-15.51,13.28,-15.14,13.51,-14.71,13.3,-14.28,13.28,-13.84,13.51,-14.05,13.79,-14.38,13.63,-14.69,13.63,-15.08,13.88,-15.4,13.86,-15.62,13.62,-16.71,13.59],[162.12,-10.48,162.4,-10.83,161.7,-10.82,161.32,-10.2,161.92,-10.45,162.12,-10.48],[160.85,-9.87,160.46,-9.9,159.85,-9.79,159.64,-9.64,159.7,-9.24,160.36,-9.4,160.69,-9.61,160.85,-9.87],[161.68,-9.6,161.53,-9.78,160.79,-8.92,160.58,-8.32,160.92,-8.32,161.28,-9.12,161.68,-9.6],[159.88,-8.34,159.92,-8.54,159.13,-8.11,158.59,-7.75,158.21,-7.42,158.36,-7.32,158.82,-7.56,159.64,-8.02,159.88,-8.34],[157.54,-7.35,157.34,-7.4,156.9,-7.18,156.49,-6.77,156.54,-6.6,157.14,-7.02,157.54,-7.35],[-11.44,6.79,-11.71,6.86,-12.43,7.26,-12.95,7.8,-13.12,8.16,-13.25,8.9,-12.71,9.34,-12.6,9.62,-12.43,9.84,-12.15,9.86,-11.92,10.05,-11.12,10.05,-10.84,9.69,-10.62,9.27,-10.65,8.98,-10.49,8.72,-10.51,8.35,-10.23,8.41,-10.7,7.94,-11.15,7.4,-11.2,7.11,-11.44,6.79],[-87.79,13.38,-87.9,13.15,-88.48,13.16,-88.84,13.26,-89.26,13.46,-89.81,13.52,-90.1,13.74,-90.06,13.88,-89.72,14.13,-89.53,14.24,-89.59,14.36,-89.35,14.42,-89.06,14.34,-88.84,14.14,-88.54,13.98,-88.5,13.85,-88.07,13.96,-87.86,13.89,-87.72,13.79,-87.79,13.38],[48.94,9.45,48.49,8.84,47.79,8,46.95,8,43.68,9.18,43.3,9.54,42.93,10.02,42.56,10.57,42.78,10.93,43.15,11.46,43.47,11.28,43.67,10.86,44.12,10.45,44.61,10.44,45.56,10.7,46.65,10.82,47.53,11.13,48.02,11.19,48.38,11.38,48.95,11.41,48.94,11.39,48.94,10.98,48.94,9.97,48.94,9.45],[49.73,11.58,50.26,11.68,50.73,12.02,51.11,12.02,51.13,11.75,51.04,11.17,51.05,10.64,50.83,10.28,50.55,9.2,50.07,8.08,49.45,6.8,48.59,5.34,47.74,4.22,46.56,2.86,45.56,2.05,44.07,1.05,43.14,.29,42.04,-.92,41.81,-1.45,41.59,-1.68,40.99,-.86,40.98,2.78,41.86,3.92,42.13,4.23,42.77,4.25,43.66,4.96,44.96,5,47.79,8,48.49,8.84,48.94,9.45,48.94,9.97,48.94,10.98,48.94,11.39,48.95,11.41,49.27,11.43,49.73,11.58],[20.87,45.42,21.48,45.18,21.56,44.77,22.15,44.48,22.46,44.7,22.71,44.58,22.47,44.41,22.66,44.23,22.41,44.01,22.5,43.64,22.99,43.21,22.6,42.9,22.44,42.58,22.55,42.46,22.38,42.32,21.92,42.3,21.58,42.25,21.54,42.32,21.66,42.44,21.78,42.68,21.63,42.68,21.44,42.86,21.27,42.91,21.14,43.07,20.96,43.13,20.81,43.27,20.64,43.22,20.5,42.88,20.26,42.81,20.34,42.9,19.96,43.11,19.63,43.21,19.48,43.35,19.22,43.52,19.45,43.57,19.6,44.04,19.12,44.42,19.37,44.86,19.01,44.86,19.39,45.24,19.07,45.52,18.83,45.91,19.6,46.17,20.22,46.13,20.76,45.73,20.87,45.42],[-57.15,5.97,-55.95,5.77,-55.84,5.95,-55.03,6.03,-53.96,5.76,-54.48,4.9,-54.4,4.21,-54.01,3.62,-54.18,3.19,-54.27,2.73,-54.52,2.31,-55.1,2.52,-55.57,2.42,-55.97,2.51,-56.07,2.22,-55.91,2.02,-56,1.82,-56.54,1.9,-57.15,2.77,-57.28,3.33,-57.6,3.33,-58.04,4.06,-57.86,4.58,-57.91,4.81,-57.31,5.07,-57.15,5.97],[18.85,49.5,18.91,49.44,19.32,49.57,19.83,49.22,20.42,49.43,20.89,49.33,21.61,49.47,22.56,49.09,22.28,48.83,22.09,48.42,21.87,48.32,20.8,48.62,20.47,48.56,20.24,48.33,19.77,48.2,19.66,48.27,19.17,48.11,18.78,48.08,18.7,47.88,17.86,47.76,17.49,47.87,16.98,48.12,16.88,48.47,16.96,48.6,17.1,48.82,17.55,48.8,17.89,48.9,17.91,49,18.1,49.04,18.17,49.27,18.4,49.32,18.55,49.5,18.85,49.5],[13.81,46.51,14.63,46.43,15.14,46.66,16.01,46.68,16.2,46.85,16.37,46.84,16.56,46.5,15.77,46.24,15.67,45.83,15.32,45.73,15.33,45.45,14.94,45.47,14.6,45.63,14.41,45.47,13.72,45.5,13.94,45.59,13.7,46.02,13.81,46.51],[22.18,65.72,21.21,65.03,21.37,64.41,19.78,63.61,17.85,62.75,17.12,61.34,17.83,60.64,18.79,60.08,17.87,58.95,16.83,58.72,16.45,57.04,15.88,56.1,14.67,56.2,14.1,55.41,12.94,55.36,12.63,56.31,11.79,57.44,11.03,58.86,11.47,59.43,12.3,60.12,12.63,61.29,11.99,61.8,11.93,63.13,12.58,64.07,13.57,64.05,13.92,64.45,13.56,64.79,15.11,66.19,16.11,67.3,16.77,68.01,17.73,68.01,17.99,68.57,19.88,68.41,20.03,69.07,20.65,69.11,21.98,68.62,23.54,67.94,23.57,66.4,23.9,66.01,22.18,65.72],[17.06,57.39,17.21,57.33,16.43,56.18,16.36,56.56,17.06,57.39],[19.36,57.96,18.8,57.65,18.83,57.44,19,57.44,18.95,57.37,18.69,57.31,18.71,57.2,18.46,57.13,18.32,56.93,18.11,56.89,18.19,57.11,18.07,57.27,18.15,57.39,18.09,57.55,18.66,57.93,19.04,57.94,19.11,57.99,19.37,58,19.36,57.96],[32.07,-26.73,31.87,-27.18,31.28,-27.29,30.69,-26.74,30.68,-26.4,30.95,-26.02,31.04,-25.73,31.33,-25.66,31.84,-25.84,31.99,-26.29,32.07,-26.73],[38.79,33.38,36.83,32.31,35.72,32.71,35.7,32.72,35.84,32.87,35.82,33.28,36.07,33.82,36.61,34.2,36.45,34.59,36,34.64,35.91,35.41,36.15,35.82,36.42,36.04,36.69,36.26,36.74,36.82,37.07,36.62,38.17,36.9,38.7,36.71,39.52,36.72,40.67,37.09,41.21,37.07,42.35,37.23,41.84,36.61,41.29,36.36,41.38,35.63,41.01,34.42,38.79,33.38],[14.5,12.86,14.6,13.33,13.95,13.35,13.96,14,13.54,14.37,13.97,15.68,15.25,16.63,15.3,17.93,15.69,19.96,15.9,20.39,15.49,20.73,15.47,21.05,15.1,21.31,14.85,22.86,15.86,23.41,19.85,21.5,23.84,19.58,23.89,15.61,23.02,15.68,22.57,14.94,22.3,14.33,22.51,14.09,22.18,13.79,22.3,13.37,22.04,12.96,21.94,12.59,22.29,12.65,22.5,12.26,22.51,11.68,22.88,11.38,22.86,11.14,22.23,10.97,21.72,10.57,21,9.48,20.06,9.01,19.09,9.07,18.81,8.98,18.91,8.63,18.39,8.28,17.96,7.89,16.71,7.51,16.46,7.73,16.29,7.75,16.11,7.5,15.28,7.42,15.44,7.69,15.12,8.38,14.98,8.8,14.54,8.97,13.95,9.55,14.17,10.02,14.63,9.92,14.91,9.99,15.47,9.98,14.92,10.89,14.96,11.56,14.89,12.22,14.5,12.86],[1.87,6.14,1.06,5.93,.84,6.28,.57,6.91,.49,7.41,.71,8.31,.46,8.68,.37,9.47,.37,10.19,-.05,10.71,.02,11.02,.9,11,.77,10.47,1.08,10.18,1.43,9.83,1.46,9.33,1.66,9.13,1.62,6.83,1.87,6.14],[102.58,12.19,101.69,12.65,100.83,12.63,100.98,13.41,100.1,13.41,100.02,12.31,99.48,10.85,99.15,9.96,99.22,9.24,99.87,9.21,100.28,8.3,100.46,7.43,101.02,6.86,101.62,6.74,102.14,6.22,101.81,5.81,101.15,5.69,101.08,6.2,100.26,6.64,100.09,6.46,99.69,6.85,99.52,7.34,98.99,7.91,98.5,8.38,98.34,7.79,98.15,8.35,98.26,8.97,98.55,9.93,99.04,10.96,99.59,11.89,99.2,12.8,99.21,13.27,99.1,13.83,98.43,14.62,98.19,15.12,98.54,15.31,98.9,16.18,98.49,16.84,97.86,17.57,97.38,18.45,97.8,18.63,98.25,19.71,98.96,19.75,99.54,20.19,100.12,20.42,100.55,20.11,100.61,19.51,101.28,19.46,101.04,18.41,101.06,17.51,102.11,18.11,102.41,17.93,103,17.96,103.2,18.31,103.96,18.24,104.72,17.43,104.78,16.44,105.59,15.57,105.54,14.72,105.22,14.27,104.28,14.42,102.99,14.23,102.35,13.39,102.58,12.19],[71.01,40.24,70.65,39.94,69.56,40.1,69.46,39.53,70.55,39.6,71.78,39.28,73.68,39.43,73.93,38.51,74.26,38.61,74.86,38.38,74.83,37.99,74.98,37.42,73.95,37.42,73.26,37.5,72.64,37.05,72.19,36.95,71.84,36.74,71.45,37.07,71.54,37.91,71.24,37.95,71.35,38.26,70.81,38.49,70.38,38.14,70.27,37.74,70.12,37.59,69.52,37.61,69.2,37.15,68.86,37.34,68.14,37.02,67.83,37.14,68.39,38.16,68.18,38.9,67.44,39.14,67.7,39.58,68.54,39.53,69.01,40.09,69.33,40.73,70.67,40.96,70.46,40.5,70.6,40.22,71.01,40.24],[61.21,35.65,61.12,36.49,60.38,36.53,59.23,37.41,58.44,37.52,57.33,38.03,56.62,38.12,56.18,37.94,55.51,37.96,54.8,37.39,53.92,37.2,53.74,37.91,53.88,38.95,53.1,39.29,53.36,39.98,52.69,40.03,52.92,40.88,53.86,40.63,54.74,40.95,54.01,41.55,53.72,42.12,52.92,41.87,52.81,41.14,52.5,41.78,52.94,42.12,54.08,42.32,54.76,42.04,55.46,41.26,55.97,41.31,57.1,41.32,56.93,41.83,57.79,42.17,58.63,42.75,59.98,42.22,60.08,41.43,60.47,41.22,61.55,41.27,61.88,41.08,62.37,40.05,63.52,39.36,64.17,38.89,65.22,38.4,66.55,37.97,66.52,37.36,66.22,37.39,65.75,37.66,65.59,37.31,64.75,37.11,64.55,36.31,63.98,36.01,63.19,35.86,62.98,35.4,62.23,35.27,61.21,35.65],[124.97,-8.89,125.09,-8.66,125.95,-8.43,126.64,-8.4,126.96,-8.27,127.34,-8.4,126.97,-8.67,125.93,-9.11,125.09,-9.39,125.07,-9.09,124.97,-8.89],[-61.68,10.76,-61.1,10.89,-60.89,10.86,-60.93,10.11,-61.77,10,-61.95,10.09,-61.66,10.37,-61.68,10.76],[9.48,30.31,9.06,32.1,8.44,32.51,8.43,32.75,7.61,33.34,7.52,34.1,8.14,34.66,8.38,35.48,8.22,36.43,8.42,36.95,9.51,37.35,10.21,37.23,10.18,36.72,11.03,37.09,11.1,36.9,10.6,36.41,10.59,35.95,10.94,35.7,10.81,34.83,10.15,34.33,10.34,33.79,10.86,33.77,11.11,33.29,11.49,33.14,11.43,32.37,10.94,32.08,10.64,31.76,9.95,31.38,10.06,30.96,9.97,30.54,9.48,30.31],[36.91,41.34,38.35,40.95,39.51,41.1,40.37,41.01,41.55,41.54,42.62,41.58,43.58,41.09,43.75,40.74,43.66,40.25,44.4,40.01,44.79,39.71,44.11,39.43,44.42,38.28,44.23,37.97,44.77,37.17,44.29,37,43.94,37.26,42.78,37.39,42.35,37.23,41.21,37.07,40.67,37.09,39.52,36.72,38.7,36.71,38.17,36.9,37.07,36.62,36.74,36.82,36.69,36.26,36.42,36.04,36.15,35.82,35.78,36.27,36.16,36.65,35.55,36.57,34.71,36.8,34.03,36.22,32.51,36.11,31.7,36.64,30.62,36.68,30.39,36.26,29.7,36.14,28.73,36.68,27.64,36.66,27.05,37.65,26.32,38.21,26.8,38.99,26.17,39.46,27.28,40.42,28.82,40.46,29.24,41.22,31.15,41.09,32.35,41.74,33.51,42.02,35.17,42.04,36.91,41.34],[27.19,40.69,26.36,40.15,26.04,40.62,26.06,40.82,26.29,40.94,26.6,41.56,26.12,41.83,27.14,42.14,28,42.01,28.12,41.62,28.99,41.3,28.81,41.05,27.62,41,27.19,40.69],[121.78,24.39,121.18,22.79,120.75,21.97,120.22,22.81,120.11,23.56,120.69,24.54,121.5,25.3,121.95,25,121.78,24.39],[33.9,-.95,34.07,-1.06,37.7,-3.1,37.77,-3.68,39.2,-4.68,38.74,-5.91,38.8,-6.48,39.44,-6.84,39.47,-7.1,39.19,-7.7,39.25,-8.01,39.19,-8.49,39.54,-9.11,39.95,-10.1,40.32,-10.32,39.52,-10.9,38.43,-11.29,37.83,-11.27,37.47,-11.57,36.78,-11.59,36.51,-11.72,35.31,-11.44,34.56,-11.52,34.28,-10.16,33.94,-9.69,33.74,-9.42,32.76,-9.23,32.19,-8.93,31.56,-8.76,31.16,-8.59,30.74,-8.34,30.2,-7.08,29.62,-6.52,29.42,-5.94,29.52,-5.42,29.34,-4.5,29.75,-4.45,30.12,-4.09,30.51,-3.57,30.75,-3.36,30.74,-3.03,30.53,-2.81,30.47,-2.41,30.76,-2.29,30.82,-1.7,30.42,-1.13,30.77,-1.01,31.87,-1.03,33.9,-.95],[31.87,-1.03,30.77,-1.01,30.42,-1.13,29.82,-1.44,29.58,-1.34,29.59,-.59,29.82,-.21,29.88,.6,30.09,1.06,30.47,1.58,30.85,1.85,31.17,2.2,30.77,2.34,30.83,3.51,31.25,3.78,31.88,3.56,32.69,3.79,33.39,3.79,34.01,4.25,34.48,3.56,34.6,3.05,35.04,1.91,34.67,1.18,34.18,.52,33.89,.11,33.9,-.95,31.87,-1.03],[31.79,52.1,32.16,52.06,32.41,52.29,32.72,52.24,33.75,52.34,34.39,51.77,34.14,51.57,34.22,51.26,35.02,51.21,35.38,50.77,35.36,50.58,36.63,50.23,37.39,50.38,38.01,49.92,38.59,49.93,40.07,49.6,40.08,49.31,39.67,48.78,39.9,48.23,39.74,47.9,38.77,47.83,38.26,47.55,38.22,47.1,37.43,47.02,36.76,46.7,35.82,46.65,34.96,46.27,35.02,45.65,35.51,45.41,36.53,45.47,36.33,45.11,35.24,44.94,33.88,44.36,33.33,44.56,33.55,45.03,32.45,45.33,32.63,45.52,33.59,45.85,33.3,46.08,31.74,46.33,31.68,46.71,30.75,46.58,30.38,46.03,29.6,45.29,29.15,45.46,28.68,45.3,28.23,45.49,28.49,45.6,28.66,45.94,28.93,46.26,28.86,46.44,29.07,46.52,29.17,46.38,29.76,46.35,30.02,46.42,29.84,46.53,29.91,46.67,29.56,46.93,29.42,47.35,29.05,47.51,29.12,47.85,28.67,48.12,28.26,48.16,27.52,48.47,26.86,48.37,26.62,48.22,26.2,48.22,25.95,47.99,25.21,47.89,24.87,47.74,24.4,47.98,23.76,47.99,23.14,48.1,22.71,47.88,22.64,48.15,22.09,48.42,22.28,48.83,22.56,49.09,22.78,49.03,22.52,49.48,23.43,50.31,23.92,50.42,24.03,50.71,23.53,51.58,24.01,51.62,24.55,51.89,25.33,51.91,26.34,51.83,27.45,51.59,28.24,51.57,28.62,51.43,28.99,51.6,29.25,51.37,30.16,51.42,30.56,51.32,30.62,51.82,30.93,52.04,31.79,52.1],[-57.63,-30.22,-56.98,-30.11,-55.97,-30.88,-55.6,-30.85,-54.57,-31.49,-53.79,-32.05,-53.21,-32.73,-53.65,-33.2,-53.37,-33.77,-53.81,-34.4,-54.94,-34.95,-55.67,-34.75,-56.22,-34.86,-57.14,-34.43,-57.82,-34.46,-58.43,-33.91,-58.35,-33.26,-58.13,-33.04,-58.14,-32.04,-57.87,-31.02,-57.63,-30.22],[-155.54,19.08,-155.69,18.92,-155.94,19.06,-155.91,19.34,-156.07,19.7,-156.02,19.81,-155.85,19.98,-155.92,20.17,-155.86,20.27,-155.79,20.25,-155.4,20.08,-155.22,19.99,-155.06,19.86,-154.81,19.51,-154.83,19.45,-155.22,19.24,-155.54,19.08],[-156.08,20.64,-156.41,20.57,-156.59,20.78,-156.7,20.86,-156.71,20.93,-156.61,21.01,-156.26,20.92,-156,20.76,-156.08,20.64],[-157.65,21.32,-157.71,21.26,-157.78,21.28,-158.13,21.31,-158.25,21.54,-158.29,21.58,-158.03,21.72,-157.94,21.65,-157.65,21.32],[-94.82,49.39,-94.64,48.84,-94.33,48.67,-93.63,48.61,-92.61,48.45,-91.64,48.14,-90.83,48.27,-89.6,48.01,-89.27,48.02,-88.38,48.3,-87.44,47.94,-86.46,47.55,-85.65,47.22,-84.88,46.9,-84.78,46.64,-84.54,46.54,-84.6,46.44,-84.34,46.41,-84.14,46.51,-84.09,46.28,-83.89,46.12,-83.62,46.12,-83.47,45.99,-83.59,45.82,-82.55,45.35,-82.34,44.44,-82.14,43.57,-82.43,42.98,-82.9,42.43,-83.12,42.08,-83.14,41.98,-83.03,41.83,-82.69,41.68,-82.44,41.68,-81.28,42.21,-80.25,42.37,-78.94,42.86,-78.92,42.97,-79.01,43.27,-79.17,43.47,-78.72,43.63,-77.74,43.63,-76.82,43.63,-76.5,44.02,-76.37,44.1,-75.32,44.82,-74.87,45,-73.35,45.01,-71.51,45.01,-71.4,45.26,-71.08,45.31,-70.66,45.46,-70.31,45.92,-70,46.69,-69.24,47.45,-68.9,47.19,-68.23,47.35,-67.79,47.07,-67.79,45.7,-67.14,45.14,-66.96,44.81,-68.03,44.33,-69.06,43.98,-70.12,43.68,-70.65,43.09,-70.81,42.87,-70.82,42.34,-70.49,41.81,-70.08,41.78,-70.18,42.15,-69.88,41.92,-69.97,41.64,-70.64,41.48,-71.12,41.49,-71.86,41.32,-72.29,41.27,-72.88,41.22,-73.71,40.93,-72.24,41.12,-71.94,40.93,-73.34,40.63,-73.98,40.63,-73.95,40.75,-74.26,40.47,-73.96,40.43,-74.18,39.71,-74.91,38.94,-74.98,39.2,-75.2,39.25,-75.53,39.5,-75.32,38.96,-75.07,38.78,-75.06,38.4,-75.38,38.02,-75.94,37.22,-76.03,37.26,-75.72,37.94,-76.23,38.32,-76.35,39.15,-76.54,38.72,-76.33,38.08,-76.99,38.24,-76.3,37.92,-76.26,36.97,-75.97,36.9,-75.87,36.55,-75.73,35.55,-76.36,34.81,-77.4,34.51,-78.05,33.93,-78.55,33.86,-79.06,33.49,-79.2,33.16,-80.3,32.51,-80.86,32.03,-81.34,31.44,-81.49,30.73,-81.31,30.04,-80.98,29.18,-80.54,28.47,-80.53,28.04,-80.06,26.88,-80.09,26.21,-80.13,25.82,-80.38,25.21,-80.68,25.08,-81.17,25.2,-81.33,25.64,-81.71,25.87,-82.24,26.73,-82.71,27.5,-82.86,27.89,-82.65,28.55,-82.93,29.1,-83.71,29.94,-84.1,30.09,-85.11,29.64,-85.29,29.69,-85.77,30.15,-86.4,30.4,-87.53,30.27,-88.42,30.38,-89.18,30.32,-89.59,30.16,-89.41,29.89,-89.43,29.49,-89.22,29.29,-89.41,29.16,-89.78,29.31,-90.15,29.12,-90.88,29.15,-91.63,29.68,-92.5,29.55,-93.23,29.78,-93.85,29.71,-94.69,29.48,-95.6,28.74,-96.59,28.31,-97.14,27.83,-97.37,27.38,-97.38,26.69,-97.33,26.21,-97.14,25.87,-97.53,25.84,-98.24,26.06,-99.02,26.37,-99.3,26.84,-99.52,27.54,-100.11,28.11,-100.46,28.7,-100.96,29.38,-101.66,29.78,-102.48,29.76,-103.11,28.97,-103.94,29.27,-104.46,29.57,-104.71,30.12,-105.04,30.64,-105.63,31.08,-106.14,31.4,-106.51,31.75,-108.24,31.75,-108.24,31.34,-109.03,31.34,-111.02,31.33,-113.3,32.04,-114.81,32.53,-114.72,32.72,-115.99,32.61,-117.13,32.54,-117.3,33.05,-117.94,33.62,-118.41,33.74,-118.52,34.03,-119.08,34.08,-119.44,34.35,-120.37,34.45,-120.62,34.61,-120.74,35.16,-121.71,36.16,-122.55,37.55,-122.51,37.78,-122.95,38.11,-123.73,38.95,-123.87,39.77,-124.4,40.31,-124.18,41.14,-124.21,42,-124.53,42.77,-124.14,43.71,-124.02,44.62,-123.9,45.52,-124.08,46.86,-124.4,47.72,-124.69,48.18,-124.57,48.38,-123.12,48.04,-122.59,47.1,-122.34,47.36,-122.5,48.18,-122.84,49,-120,49,-117.03,49,-116.05,49,-113,49,-110.05,49,-107.05,49,-104.05,49,-100.65,49,-97.23,49,-95.16,49,-95.16,49.38,-94.82,49.39],[-153.01,57.12,-154.01,56.73,-154.52,56.99,-154.67,57.46,-153.76,57.82,-153.23,57.97,-152.56,57.9,-152.14,57.59,-153.01,57.12],[-165.58,59.91,-166.19,59.75,-166.85,59.94,-167.46,60.21,-166.47,60.38,-165.67,60.29,-165.58,59.91],[-171.73,63.78,-171.11,63.59,-170.49,63.69,-169.68,63.43,-168.69,63.3,-168.77,63.19,-169.53,62.98,-170.29,63.19,-170.67,63.38,-171.55,63.32,-171.79,63.41,-171.73,63.78],[-155.07,71.15,-154.34,70.7,-153.9,70.89,-152.21,70.83,-152.27,70.6,-150.74,70.43,-149.72,70.53,-147.61,70.21,-145.69,70.12,-144.92,69.99,-143.59,70.15,-142.07,69.85,-140.99,69.71,-140.99,66,-141,60.31,-140.01,60.28,-139.04,60,-138.34,59.56,-137.45,58.91,-136.48,59.46,-135.48,59.79,-134.94,59.27,-134.27,58.86,-133.36,58.41,-132.73,57.69,-131.71,56.55,-130.01,55.92,-129.98,55.28,-130.54,54.8,-131.09,55.18,-131.97,55.5,-132.25,56.37,-133.54,57.18,-134.08,58.12,-135.04,58.19,-136.63,58.21,-137.8,58.5,-139.87,59.54,-140.83,59.73,-142.57,60.08,-143.96,60,-145.93,60.46,-147.11,60.88,-148.22,60.67,-148.02,59.98,-148.57,59.91,-149.73,59.71,-150.61,59.37,-151.72,59.16,-151.86,59.74,-151.41,60.73,-150.35,61.03,-150.62,61.28,-151.9,60.73,-152.58,60.06,-154.02,59.35,-153.29,58.86,-154.23,58.15,-155.31,57.73,-156.31,57.42,-156.56,56.98,-158.12,56.46,-158.43,55.99,-159.6,55.57,-160.29,55.64,-161.22,55.36,-162.24,55.02,-163.07,54.69,-164.79,54.4,-164.94,54.57,-163.85,55.04,-162.87,55.35,-161.8,55.89,-160.56,56.01,-160.07,56.42,-158.68,57.02,-158.46,57.22,-157.72,57.57,-157.55,58.33,-157.04,58.92,-158.19,58.62,-158.52,58.79,-159.06,58.42,-159.71,58.93,-159.98,58.57,-160.36,59.07,-161.36,58.67,-161.97,58.67,-162.05,59.27,-161.87,59.63,-162.52,59.99,-163.82,59.8,-164.66,60.27,-165.35,60.51,-165.35,61.07,-166.12,61.5,-165.73,62.07,-164.92,62.63,-164.56,63.15,-163.75,63.22,-163.07,63.06,-162.26,63.54,-161.53,63.46,-160.77,63.77,-160.96,64.22,-161.52,64.4,-160.78,64.79,-161.39,64.78,-162.45,64.56,-162.76,64.34,-163.55,64.56,-164.96,64.45,-166.43,64.69,-166.85,65.09,-168.11,65.67,-166.71,66.09,-164.47,66.58,-163.65,66.58,-163.79,66.08,-161.68,66.12,-162.49,66.74,-163.72,67.12,-164.43,67.62,-165.39,68.04,-166.76,68.36,-166.2,68.88,-164.43,68.92,-163.17,69.37,-162.93,69.86,-161.91,70.33,-160.93,70.45,-159.04,70.89,-158.12,70.82,-156.58,71.36,-155.07,71.15],[66.52,37.36,66.55,37.97,65.22,38.4,64.17,38.89,63.52,39.36,62.37,40.05,61.88,41.08,61.55,41.27,60.47,41.22,60.08,41.43,59.98,42.22,58.63,42.75,57.79,42.17,56.93,41.83,57.1,41.32,55.97,41.31,55.93,45,58.5,45.59,58.69,45.5,60.24,44.78,61.06,44.41,62.01,43.5,63.19,43.65,64.9,43.73,66.1,43,66.02,41.99,66.51,41.99,66.71,41.17,67.99,41.14,68.26,40.66,68.63,40.67,69.07,41.38,70.39,42.08,70.96,42.27,71.26,42.17,70.42,41.52,71.16,41.14,71.87,41.39,73.06,40.87,71.77,40.15,71.01,40.24,70.6,40.22,70.46,40.5,70.67,40.96,69.33,40.73,69.01,40.09,68.54,39.53,67.7,39.58,67.44,39.14,68.18,38.9,68.39,38.16,67.83,37.14,67.08,37.36,66.52,37.36],[-71.33,11.78,-71.36,11.54,-71.95,11.42,-71.62,10.97,-71.63,10.45,-72.07,9.87,-71.7,9.07,-71.26,9.14,-71.04,9.86,-71.35,10.21,-71.4,10.97,-70.16,11.38,-70.29,11.85,-69.94,12.16,-69.58,11.46,-68.88,11.44,-68.23,10.89,-68.19,10.55,-67.3,10.55,-66.23,10.65,-65.66,10.2,-64.89,10.08,-64.33,10.39,-64.32,10.64,-63.08,10.7,-61.88,10.72,-62.73,10.42,-62.39,9.95,-61.59,9.87,-60.83,9.38,-60.67,8.58,-60.15,8.6,-59.76,8.37,-60.55,7.78,-60.64,7.42,-60.3,7.04,-60.54,6.86,-61.16,6.7,-61.14,6.23,-61.41,5.96,-60.73,5.2,-60.6,4.92,-60.97,4.54,-62.09,4.16,-62.8,4.01,-63.09,3.77,-63.89,4.02,-64.63,4.15,-64.82,4.06,-64.37,3.8,-64.41,3.13,-64.27,2.5,-63.42,2.41,-63.37,2.2,-64.08,1.92,-64.2,1.49,-64.61,1.33,-65.35,1.1,-65.55,.79,-66.33,.72,-66.88,1.25,-67.18,2.25,-67.45,2.6,-67.81,2.82,-67.3,3.32,-67.34,3.54,-67.62,3.84,-67.82,4.5,-67.74,5.22,-67.52,5.56,-67.34,6.1,-67.7,6.27,-68.27,6.15,-68.99,6.21,-69.39,6.1,-70.09,6.96,-70.67,7.09,-71.96,6.99,-72.2,7.34,-72.44,7.42,-72.48,7.63,-72.36,8,-72.44,8.41,-72.66,8.63,-72.79,9.09,-73.3,9.15,-73.03,9.74,-72.91,10.45,-72.61,10.82,-72.23,11.11,-71.97,11.61,-71.33,11.78],[108.05,21.55,106.72,20.7,105.88,19.75,105.66,19.06,106.43,18,107.36,16.7,108.27,16.08,108.88,15.28,109.34,13.43,109.2,11.67,108.37,11.01,107.22,10.36,106.41,9.53,105.16,8.6,104.8,9.24,105.08,9.92,104.33,10.49,105.2,10.89,106.25,10.96,105.81,11.57,107.49,12.34,107.61,13.54,107.38,14.2,107.56,15.2,107.31,15.91,106.56,16.6,105.93,17.49,105.09,18.67,103.9,19.27,104.18,19.62,104.82,19.89,104.44,20.76,103.2,20.77,102.75,21.68,102.17,22.46,102.71,22.71,103.5,22.7,104.48,22.82,105.33,23.35,105.81,22.98,106.73,22.79,106.57,22.22,107.04,21.81,108.05,21.55],[167.84,-16.47,167.52,-16.6,167.18,-16.16,167.22,-15.89,167.84,-16.47],[167.11,-14.93,167.27,-15.74,167,-15.61,166.79,-15.67,166.65,-15.39,166.63,-14.63,167.11,-14.93],[35.55,32.39,35.55,31.78,35.4,31.49,34.93,31.35,34.97,31.62,35.23,31.75,34.97,31.87,35.18,32.53,35.55,32.39],[53.11,16.65,52.39,16.38,52.19,15.94,52.17,15.6,51.17,15.18,49.57,14.71,48.68,14,48.24,13.95,47.94,14.01,47.35,13.59,46.72,13.4,45.88,13.35,45.63,13.29,45.41,13.03,45.14,12.95,44.99,12.7,44.49,12.72,44.18,12.59,43.48,12.64,43.22,13.22,43.25,13.77,43.09,14.06,42.89,14.8,42.6,15.21,42.81,15.26,42.7,15.72,42.82,15.91,42.78,16.35,43.22,16.67,43.12,17.09,43.38,17.58,43.79,17.32,44.06,17.41,45.22,17.43,45.4,17.33,46.37,17.23,46.75,17.28,47,16.95,47.47,17.12,48.18,18.17,49.12,18.62,52,19,52.78,17.35,53.11,16.65],[31.52,-29.26,31.33,-29.4,30.9,-29.91,30.62,-30.42,30.06,-31.14,28.93,-32.17,28.22,-32.77,27.46,-33.23,26.42,-33.61,25.91,-33.67,25.78,-33.94,25.17,-33.8,24.68,-33.99,23.59,-33.79,22.99,-33.92,22.57,-33.86,21.54,-34.26,20.69,-34.42,20.07,-34.8,19.62,-34.82,19.19,-34.46,18.86,-34.44,18.42,-34,18.38,-34.14,18.24,-33.87,18.25,-33.28,17.93,-32.61,18.25,-32.43,18.22,-31.66,17.57,-30.73,17.06,-29.88,16.34,-28.58,16.82,-28.08,17.22,-28.36,17.39,-28.78,17.84,-28.86,18.46,-29.05,19,-28.97,19.89,-28.46,19.9,-24.77,20.17,-24.92,20.76,-25.87,20.67,-26.48,20.89,-26.83,21.61,-26.73,22.11,-26.28,22.58,-25.98,22.82,-25.5,23.31,-25.27,23.73,-25.39,24.21,-25.67,25.03,-25.72,25.66,-25.49,25.77,-25.17,25.94,-24.7,26.49,-24.62,26.79,-24.24,27.12,-23.57,28.02,-22.83,29.43,-22.09,29.84,-22.1,30.32,-22.27,30.66,-22.15,31.19,-22.25,31.67,-23.66,31.93,-24.37,31.75,-25.48,31.84,-25.84,31.33,-25.66,31.04,-25.73,30.95,-26.02,30.68,-26.4,30.69,-26.74,31.28,-27.29,31.87,-27.18,32.07,-26.73,32.83,-26.74,32.58,-27.47,32.46,-28.3,32.2,-28.75,31.52,-29.26],[28.98,-28.96,28.54,-28.65,28.07,-28.85,27.53,-29.24,27,-29.88,27.75,-30.65,28.11,-30.55,28.29,-30.23,28.85,-30.07,29.02,-29.74,29.33,-29.26,28.98,-28.96],[32.76,-9.23,33.23,-9.68,33.49,-10.53,33.32,-10.8,33.11,-11.61,33.31,-12.44,32.99,-12.78,32.69,-13.71,33.21,-13.97,30.18,-14.8,30.27,-15.51,29.52,-15.64,28.95,-16.04,28.83,-16.39,28.47,-16.47,27.6,-17.29,27.04,-17.94,26.71,-17.96,26.38,-17.85,25.26,-17.74,25.08,-17.66,25.08,-17.58,24.68,-17.35,24.03,-17.3,23.22,-17.52,22.56,-16.9,21.89,-16.08,21.93,-12.9,24.02,-12.91,23.93,-12.57,24.08,-12.19,23.9,-11.72,24.02,-11.24,23.91,-10.93,24.26,-10.95,24.31,-11.26,24.78,-11.24,25.42,-11.33,25.75,-11.78,26.55,-11.92,27.16,-11.61,27.39,-12.13,28.16,-12.27,28.52,-12.7,28.93,-13.25,29.7,-13.26,29.62,-12.18,29.34,-12.36,28.64,-11.97,28.37,-11.79,28.5,-10.79,28.67,-9.61,28.45,-9.16,28.73,-8.53,29,-8.41,30.35,-8.24,30.74,-8.34,31.16,-8.59,31.56,-8.76,32.19,-8.93,32.76,-9.23],[31.19,-22.25,30.66,-22.15,30.32,-22.27,29.84,-22.1,29.43,-22.09,28.79,-21.64,28.02,-21.49,27.73,-20.85,27.72,-20.5,27.3,-20.39,26.16,-19.29,25.85,-18.71,25.65,-18.54,25.26,-17.74,26.38,-17.85,26.71,-17.96,27.04,-17.94,27.6,-17.29,28.47,-16.47,28.83,-16.39,28.95,-16.04,29.52,-15.64,30.27,-15.51,30.34,-15.88,31.17,-15.86,31.64,-16.07,31.85,-16.32,32.33,-16.39,32.85,-16.71,32.85,-17.98,32.65,-18.67,32.61,-19.42,32.77,-19.72,32.66,-20.3,32.51,-20.4,32.24,-21.12,31.19,-22.25]]}});function dc(n,e){return lc(n,{i:2},e&&e.out,e&&e.dictionary)}function oo(n,e){if(e){for(var t="",o=0;o<n.length;o+=16384)t+=String.fromCharCode.apply(null,n.subarray(o,o+16384));return t}else{if(_o)return _o.decode(n);var r=uc(n),i=r.s,t=r.r;return t.length&&Le(8),i}}function fs(n,e){for(var t={},o=n.length-22;Ue(n,o)!=101010256;--o)(!o||n.length-o>65558)&&Le(13);var r=Ye(n,o+8);if(!r)return{};var i=Ue(n,o+16),a=i==4294967295||r==65535;if(a){var s=Ue(n,o-12);a=Ue(n,s)==101075792,a&&(r=Ue(n,s+32),i=Ue(n,s+48))}for(var l=e&&e.filter,u=0;u<r;++u){var c=hc(n,i,a),p=c[0],d=c[1],g=c[2],m=c[3],y=c[4],v=c[5],h=gc(n,v);i=y,(!l||l({name:m,size:d,originalSize:g,compression:p}))&&(p?p==8?t[m]=dc(n.subarray(h,h+d),{out:new Ee(g)}):Le(14,"unknown compression type "+p):t[m]=zo(n,h,h+d))}return t}var Ee,_t,ec,ls,cs,tc,ds,ps,us,nc,gs,oc,V5,Eo,nt,X,Jt,en,X,X,X,X,hs,X,rc,ic,To,He,Mo,ac,zo,sc,Le,lc,cc,Ye,Ue,Io,_o,pc,uc,gc,hc,fc,ms=Lo(()=>{"use strict";Ee=Uint8Array,_t=Uint16Array,ec=Int32Array,ls=new Ee([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),cs=new Ee([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),tc=new Ee([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ds=function(n,e){for(var t=new _t(31),o=0;o<31;++o)t[o]=e+=1<<n[o-1];for(var r=new ec(t[30]),o=1;o<30;++o)for(var i=t[o];i<t[o+1];++i)r[i]=i-t[o]<<5|o;return{b:t,r}},ps=ds(ls,2),us=ps.b,nc=ps.r;us[28]=258,nc[258]=28;gs=ds(cs,0),oc=gs.b,V5=gs.r,Eo=new _t(32768);for(X=0;X<32768;++X)nt=(X&43690)>>1|(X&21845)<<1,nt=(nt&52428)>>2|(nt&13107)<<2,nt=(nt&61680)>>4|(nt&3855)<<4,Eo[X]=((nt&65280)>>8|(nt&255)<<8)>>1;Jt=(function(n,e,t){for(var o=n.length,r=0,i=new _t(e);r<o;++r)n[r]&&++i[n[r]-1];var a=new _t(e);for(r=1;r<e;++r)a[r]=a[r-1]+i[r-1]<<1;var s;if(t){s=new _t(1<<e);var l=15-e;for(r=0;r<o;++r)if(n[r])for(var u=r<<4|n[r],c=e-n[r],p=a[n[r]-1]++<<c,d=p|(1<<c)-1;p<=d;++p)s[Eo[p]>>l]=u}else for(s=new _t(o),r=0;r<o;++r)n[r]&&(s[r]=Eo[a[n[r]-1]++]>>15-n[r]);return s}),en=new Ee(288);for(X=0;X<144;++X)en[X]=8;for(X=144;X<256;++X)en[X]=9;for(X=256;X<280;++X)en[X]=7;for(X=280;X<288;++X)en[X]=8;hs=new Ee(32);for(X=0;X<32;++X)hs[X]=5;rc=Jt(en,9,1),ic=Jt(hs,5,1),To=function(n){for(var e=n[0],t=1;t<n.length;++t)n[t]>e&&(e=n[t]);return e},He=function(n,e,t){var o=e/8|0;return(n[o]|n[o+1]<<8)>>(e&7)&t},Mo=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},ac=function(n){return(n+7)/8|0},zo=function(n,e,t){return(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length),new Ee(n.subarray(e,t))},sc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Le=function(n,e,t){var o=new Error(e||sc[n]);if(o.code=n,Error.captureStackTrace&&Error.captureStackTrace(o,Le),!t)throw o;return o},lc=function(n,e,t,o){var r=n.length,i=o?o.length:0;if(!r||e.f&&!e.l)return t||new Ee(0);var a=!t,s=a||e.i!=2,l=e.i;a&&(t=new Ee(r*3));var u=function(Dt){var L=t.length;if(Dt>L){var W=new Ee(Math.max(L*2,Dt));W.set(t),t=W}},c=e.f||0,p=e.p||0,d=e.b||0,g=e.l,m=e.d,y=e.m,v=e.n,h=r*8;do{if(!g){c=He(n,p,1);var b=He(n,p+1,3);if(p+=3,b)if(b==1)g=rc,m=ic,y=9,v=5;else if(b==2){var S=He(n,p,31)+257,A=He(n,p+10,15)+4,k=S+He(n,p+5,31)+1;p+=14;for(var C=new Ee(k),E=new Ee(19),P=0;P<A;++P)E[tc[P]]=He(n,p+P*3,7);p+=A*3;for(var M=To(E),D=(1<<M)-1,T=Jt(E,M,1),P=0;P<k;){var I=T[He(n,p,D)];p+=I&15;var f=I>>4;if(f<16)C[P++]=f;else{var _=0,N=0;for(f==16?(N=3+He(n,p,3),p+=2,_=C[P-1]):f==17?(N=3+He(n,p,7),p+=3):f==18&&(N=11+He(n,p,127),p+=7);N--;)C[P++]=_}}var R=C.subarray(0,S),z=C.subarray(S);y=To(R),v=To(z),g=Jt(R,y,1),m=Jt(z,v,1)}else Le(1);else{var f=ac(p)+4,w=n[f-4]|n[f-3]<<8,x=f+w;if(x>r){l&&Le(0);break}s&&u(d+w),t.set(n.subarray(f,x),d),e.b=d+=w,e.p=p=x*8,e.f=c;continue}if(p>h){l&&Le(0);break}}s&&u(d+131072);for(var G=(1<<y)-1,F=(1<<v)-1,H=p;;H=p){var _=g[Mo(n,p)&G],O=_>>4;if(p+=_&15,p>h){l&&Le(0);break}if(_||Le(2),O<256)t[d++]=O;else if(O==256){H=p,g=null;break}else{var U=O-254;if(O>264){var P=O-257,q=ls[P];U=He(n,p,(1<<q)-1)+us[P],p+=q}var Se=m[Mo(n,p)&F],ge=Se>>4;Se||Le(3),p+=Se&15;var z=oc[ge];if(ge>3){var q=cs[ge];z+=Mo(n,p)&(1<<q)-1,p+=q}if(p>h){l&&Le(0);break}s&&u(d+131072);var he=d+U;if(d<z){var gt=i-z,xt=Math.min(z,he);for(gt+d<0&&Le(3);d<xt;++d)t[d]=o[gt+d]}for(;d<he;++d)t[d]=t[d-z]}}e.l=g,e.p=H,e.b=d,e.f=c,g&&(c=1,e.m=y,e.d=m,e.n=v)}while(!c);return d!=t.length&&a?zo(t,0,d):t.subarray(0,d)},cc=new Ee(0),Ye=function(n,e){return n[e]|n[e+1]<<8},Ue=function(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16|n[e+3]<<24)>>>0},Io=function(n,e){return Ue(n,e)+Ue(n,e+4)*4294967296};_o=typeof TextDecoder<"u"&&new TextDecoder,pc=0;try{_o.decode(cc,{stream:!0}),pc=1}catch{}uc=function(n){for(var e="",t=0;;){var o=n[t++],r=(o>127)+(o>223)+(o>239);if(t+r>n.length)return{s:e,r:zo(n,t-1)};r?r==3?(o=((o&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,e+=String.fromCharCode(55296|o>>10,56320|o&1023)):r&1?e+=String.fromCharCode((o&31)<<6|n[t++]&63):e+=String.fromCharCode((o&15)<<12|(n[t++]&63)<<6|n[t++]&63):e+=String.fromCharCode(o)}};gc=function(n,e){return e+30+Ye(n,e+26)+Ye(n,e+28)},hc=function(n,e,t){var o=Ye(n,e+28),r=oo(n.subarray(e+46,e+46+o),!(Ye(n,e+8)&2048)),i=e+46+o,a=Ue(n,e+20),s=t&&a==4294967295?fc(n,i):[a,Ue(n,e+24),Ue(n,e+42)],l=s[0],u=s[1],c=s[2];return[Ye(n,e+10),l,u,r,i+Ye(n,e+30)+Ye(n,e+32),c]},fc=function(n,e){for(;Ye(n,e)!=1;e+=4+Ye(n,e+2));return[Io(n,e+12),Io(n,e+4),Io(n,e+20)]}});var bs={};Oo(bs,{ParseError:()=>zt,coerceValue:()=>ro,generateId:()=>yt,parseCSV:()=>vc,parseGraphXR:()=>Cc,parseJSON:()=>yc,resetIdCounter:()=>mc});function ro(n){if(n==null)return null;if(typeof n!="string")return n;if(n==="")return null;let e=n.toLowerCase();if(e==="true")return!0;if(e==="false")return!1;let t=Number(n);return n.trim()!==""&&!Number.isNaN(t)?t:n}function mc(){vs=0}function yt(){return String(++vs)}async function vc(n,e){if(!n||!n.trim())return{nodes:[],edges:[]};let t=e?.delimiter??",";if(t.length!==1)throw new zt(`delimiter must be a single character, got: ${JSON.stringify(t)}`,"csv");let o=e?.defaultCategory??"Default",r=e?.idColumn,i=bc(n,t);if(i.length<2)return{nodes:[],edges:[]};let a=i[0],s=[];for(let l=1;l<i.length;l++){let u=i[l];if(u.length===0||u.length===1&&u[0]==="")continue;let c={};for(let d=0;d<a.length;d++){let g=a[d],m=d<u.length?u[d]:"";c[g]=ro(m)}let p=r&&c[r]!=null?String(c[r]):yt();s.push({id:p,category:o,properties:c})}return{nodes:s,edges:[]}}function bc(n,e){let t=[],o=[],r="",i=!1,a=0;for(;a<n.length;){let s=n[a];i?s==='"'?a+1<n.length&&n[a+1]==='"'?(r+='"',a+=2):(i=!1,a++):(r+=s,a++):s==='"'?(i=!0,a++):s===e?(o.push(r),r="",a++):s==="\r"?(o.push(r),r="",o.length>0&&t.push(o),o=[],a++,a<n.length&&n[a]===`
2
+ `&&a++):s===`
3
+ `?(o.push(r),r="",o.length>0&&t.push(o),o=[],a++):(r+=s,a++)}return(r!==""||o.length>0)&&(o.push(r),t.push(o)),t}async function yc(n,e){if(n==null||n==="")return{nodes:[],edges:[]};let t;if(typeof n=="string"){let l=n.trim();if(l==="")return{nodes:[],edges:[]};try{t=JSON.parse(l)}catch(u){throw new zt("Invalid JSON","json",u)}}else t=n;let o=e?.defaultCategory??"Default",r=e?.defaultRelationship??"RELATED_TO",i=e?.childrenKey??"children",a=e?.format??"auto";switch(a==="auto"?xc(t,i):a){case"flat":return wc(Array.isArray(t)?t:[t],o);case"graph":return Sc(t,o,r);case"tree":return Pc(t,o,r,i)}}function xc(n,e){if(Array.isArray(n))return"flat";if(typeof n=="object"&&n!==null){if("nodes"in n||"edges"in n)return"graph";if(e in n&&Array.isArray(n[e]))return"tree"}return"flat"}function wc(n,e){return{nodes:n.filter(o=>o!=null&&typeof o=="object").map(o=>{let{id:r,category:i,labels:a,tags:s,...l}=o;return{id:r!=null?String(r):yt(),category:i??e,...a?{labels:a}:{},...s?{tags:s}:{},properties:l}}),edges:[]}}function Sc(n,e,t){let o=n.nodes??[],r=n.edges??[],i=o.filter(s=>s!=null&&typeof s=="object").map(s=>{let{id:l,category:u,labels:c,tags:p,...d}=s;return{id:l!=null?String(l):yt(),category:u??e,...c?{labels:c}:{},...p?{tags:p}:{},properties:d}}),a=r.filter(s=>s!=null&&typeof s=="object").map(s=>{let{id:l,source:u,target:c,relationship:p,...d}=s;if(u==null||c==null)throw new zt("Edge is missing required source or target field","json");return{id:l!=null?String(l):yt(),source:String(u),target:String(c),relationship:p??t,properties:d}});return{nodes:i,edges:a}}function Pc(n,e,t,o){let r=[],i=[];function a(s,l){let{[o]:u,id:c,category:p,labels:d,tags:g,...m}=s,y=c!=null?String(c):yt();if(r.push({id:y,category:p??e,...d?{labels:d}:{},...g?{tags:g}:{},properties:m}),l!==null&&i.push({id:yt(),source:l,target:y,relationship:t,properties:{}}),Array.isArray(u))for(let v of u)v!=null&&typeof v=="object"&&a(v,y)}return a(n,null),{nodes:r,edges:i}}async function Cc(n,e){let t=e?.defaultCategory??"Default",o=e?.defaultRelationship??"RELATED_TO",r;try{r=fs(new Uint8Array(n))}catch(p){throw new zt("Invalid ZIP archive","graphxr",p)}let i=Object.keys(r).find(p=>p.endsWith("nodes.json"));if(!i)throw new zt("Missing nodes.json in GraphXR archive","graphxr");let a=Object.keys(r).find(p=>p.endsWith("edges.json")),s=JSON.parse(oo(r[i])),l=a?JSON.parse(oo(r[a])):[],u=s.filter(p=>p!=null&&typeof p=="object").map(p=>kc(p,t)),c=l.filter(p=>p!=null&&typeof p=="object").map(p=>Ac(p,o));return{nodes:u,edges:c}}function kc(n,e){let t=String(n.id),o=typeof n.data=="object"&&n.data!==null?n.data:{},r=typeof o.detail=="object"&&o.detail!==null?o.detail:void 0,i=r?.type??e,a=typeof r?.data=="object"&&r.data!==null?r.data:{},s={};for(let[c,p]of Object.entries(a))s[c]=ro(p);let l=Array.isArray(n.tags)&&n.tags.length>0?n.tags:void 0,u={id:t,category:i,properties:s};return l&&(u.tags=l),u}function Rc(n){if(n==null||typeof n!="object")return{};let e={};for(let[t,o]of Object.entries(n))e[t]=ro(o);return e}function Ac(n,e){return{id:String(n.id),source:String(n.sourceId),target:String(n.targetId),relationship:n.relationship??n.name??e,properties:Rc(n.properties)}}var zt,vs,ys=Lo(()=>{"use strict";ms();zt=class extends Error{constructor(n,e,t){super(n,t!==void 0?{cause:t}:void 0),this.format=e,this.cause=t,this.name="ParseError"}};vs=0});var Mc={};Oo(Mc,{algorithms:()=>Do,allBuiltins:()=>Tc,contextMenu:()=>Ts,coverage:()=>Ms,geoEgoRing:()=>ws,io:()=>Es,legend:()=>Cs,maps:()=>xs,minimap:()=>Ss,nodeCards:()=>ks,nodeInfo:()=>Rs,polygons:()=>Is,quickCreate:()=>As,skills:()=>_s,toolbar:()=>Ps});module.exports=Gs(Mc);var Ct=require("react");var Oe=require("react");var Bo=require("react"),on=(0,Bo.createContext)(null);function Bs(n){return n._viewState}function Ge(){let n=(0,Oe.useContext)(on);if(!n)throw new Error("useGraphHandle must be used within a GraphRenderer");return n}function $e(n){let e=Bs(Ge()),t=(0,Oe.useCallback)(()=>e.getSnapshot()[n],[e,n]);return(0,Oe.useSyncExternalStore)(e.subscribe,t,t)}function rn(){return $e("isMapMode")}function Ho(){return $e("mapSphereRadius")}function Uo(){return $e("theme")}function Vo(){return{iconAtlasManager:$e("iconAtlasManager"),imageAtlasManager:$e("imageAtlasManager"),glyphAtlasManager:$e("glyphAtlasManager")}}function Wo(){return $e("layoutController")}function jo(){return $e("layoutPositionProvider")}function qo(n){let{store:e}=Ge(),t=(0,Oe.useCallback)(r=>e.changes.subscribe(n,r),[e,n]),o=(0,Oe.useCallback)(()=>e.changes.versionOf(n),[e,n]);return(0,Oe.useSyncExternalStore)(t,o,o)}function an(){let n=Ge();return{is3D:$e("is3D"),setIs3D:n.setIs3D}}var Nt=require("react"),Ko=(0,Nt.createContext)(null);function Yo(){let n=(0,Nt.useContext)(Ko);if(!n)throw new Error("useRenderEngineApi must be used within <GraphRenderer>");return n}function ze(){return(0,Nt.useContext)(Ko)}var sn=require("react"),Xo=require("react-dom");var $o=require("react/jsx-runtime");function ln({container:n,obliqueDegrees:e=45,durationMs:t=400}){let o=ze(),[r,i]=(0,sn.useState)(()=>o?.map.getPitch()??0);if((0,sn.useEffect)(()=>{if(!o)return;let l=o.events.on("map:pitchChanged",({pitch:u})=>i(u));return i(o.map.getPitch()),()=>{l()}},[o]),!o)return null;let a=r>.5;return(0,Xo.createPortal)((0,$o.jsx)("button",{onClick:()=>{o.map.setPitch(a?0:e,{animate:!0,durationMs:t})},title:a?"Switch to 2D (top-down)":"Switch to 3D (oblique view)",style:{position:"absolute",bottom:80,right:10,width:40,height:40,borderRadius:8,border:"1px solid rgba(255,255,255,0.2)",background:a?"rgba(60,100,160,0.65)":"rgba(0,0,0,0.55)",color:"#fff",cursor:"pointer",fontSize:12,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)",zIndex:1e3,transition:"background 0.15s",userSelect:"none",padding:0},children:a?"2D":"3D"}),n)}var ot=require("three");var be=require("three"),Qo=1.3,Jo=160,Hs=256,er=2,Us=4e3,Zo=22;function cn(n,e,t){return(n*4194304+e)*32+t}var Vs=async(n,e)=>{if(typeof fetch=="function"&&typeof createImageBitmap=="function"){let t=await fetch(n,{signal:e,mode:"cors",credentials:"omit"});if(!t.ok)throw new Error(`tile ${t.status}`);let o=await t.blob();return createImageBitmap(o,{imageOrientation:"flipY"})}return new Promise((t,o)=>{let r=new Image;r.crossOrigin="anonymous",r.onload=()=>t(r),r.onerror=()=>o(new Error("tile load failed")),e.addEventListener("abort",()=>{r.src="",o(new Error("aborted"))}),r.src=n})},so=()=>typeof performance<"u"?performance.now():Date.now(),St=class extends be.Group{constructor(t,o){super();this._tiles=new Map;this._fading=new Set;this._inFlight=0;this._serial=0;this._changed=!0;this._lastView=new Float64Array(17);this._m=new be.Matrix4;this._frustum=new be.Frustum;this._cam=new be.Vector3;this._stack=[];this._wanted=[];this._queue=[];this._shown=new Set;this._measuredDist=0;this.minLevel=t.minLevel??0,this.maxLevel=Math.min(Zo,t.maxLevel??o),this.tileSize=t.tileSize??256,this.maxConcurrent=t.maxConcurrent??8,this.cacheSize=t.cacheSize??400,this._loadImage=t.loadImage??Vs,this._anisotropy=t.anisotropy??8,this._tileUrl=t.tileUrl}_prepare(t){}_disposeMesh(t){}get tileUrl(){return this._tileUrl}set tileUrl(t){t!==this._tileUrl&&(this._tileUrl=t,this.clearTiles())}setSource(t){let o=t.tileSize??this.tileSize,r=Math.min(Zo,t.maxLevel??this.maxLevel);t.tileUrl===this._tileUrl&&o===this.tileSize&&r===this.maxLevel||(this._tileUrl=t.tileUrl,this.tileSize=o,this.maxLevel=r,this.clearTiles())}get level(){return this._level??0}setInvalidate(t){this._invalidate=t}updatePov(t,o){if(!t||!(t instanceof be.Camera))return!1;let r=so();if(this._advanceFades(r)&&(this._changed=!0),!this._tileUrl)return this._fading.size>0;t.updateMatrixWorld(),this.updateWorldMatrix(!0,!1);let i=this._m.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse).multiply(this.matrixWorld),a=o?.bufferHeight??800,s=this._lastView,l=!this._changed&&s[16]===a;for(let g=0;l&&g<16;g++)l=s[g]===i.elements[g];if(l)return this._fading.size>0;for(let g=0;g<16;g++)s[g]=i.elements[g];s[16]=a,this._changed=!1,this._frustum.setFromProjectionMatrix(i);let u=this._cam.setFromMatrixPosition(t.matrixWorld);this._m.copy(this.matrixWorld).invert(),u.applyMatrix4(this._m);let c=t instanceof be.PerspectiveCamera?t.fov:42,p=a/(2*Math.tan(c*Math.PI/360));this._serial+=1,this._prepare(u);let d=this._cover(u,p);return this._show(d,r),this._request(this._withBackstops(d)),this._evict(),this._fading.size>0}clearTiles(){for(let t of this._tiles.values())this._free(t);this._tiles.clear(),this._fading.clear(),this._inFlight=0,this._changed=!0}dispose(){this.clearTiles()}stats(){let t=0,o=0,r=0;for(let i of this._tiles.values())i.state==="loaded"&&t++,i.state==="loading"&&o++,i.mesh?.visible&&r++;return{loaded:t,loading:o,shown:r,total:this._tiles.size}}_tile(t,o,r){let i=cn(t,o,r),a=this._tiles.get(i);return a||(a={key:i,x:t,y:o,z:r,state:"idle",mesh:null,abort:null,used:0,dist:0,failedAt:-1/0,fadeStart:0},this._tiles.set(i,a)),a}_cover(t,o){let r=this._wanted;r.length=0;let i=this._stack;i.length=0,i.push(0,0,0);let a=0;for(;i.length>0;){let s=i.pop(),l=i.pop(),u=i.pop(),c=this._measure(u,l,s,t,o);if(c<0)continue;if(s<this.maxLevel&&(s<this.minLevel||c>this.tileSize*Qo)&&r.length+i.length/3<Hs){let g=s+1,m=u*2,y=l*2;i.push(m,y,g,m+1,y,g,m,y+1,g,m+1,y+1,g);continue}let d=this._tile(u,l,s);d.dist=this._measuredDist,d.used=this._serial,r.push(d),s>a&&(a=s)}return this._level=a,r.sort((s,l)=>s.dist-l.dist),r}_withBackstops(t){let o=this._queue;o.length=0;let r=Math.min(er,this.maxLevel);for(let i of t){if(i.z<=r)continue;let a=i.z-r,s=this._tile(i.x>>a,i.y>>a,r);s.used!==this._serial&&(s.used=this._serial,o.push(s))}for(let i of t)o.push(i);return o}_show(t,o){let r=this._shown;r.clear();for(let i of t){if(i.state==="loaded"&&(r.add(i),i.fadeStart!==0&&!this._fading.has(i)))continue;let a=i.x,s=i.y;for(let l=i.z-1;l>=0;l--){a>>=1,s>>=1;let u=this._tiles.get(cn(a,s,l));if(u?.state==="loaded"){u.used=this._serial,r.add(u);break}}for(let l=0;l<4;l++){let u=this._tiles.get(cn(i.x*2+(l&1),i.y*2+(l>>1),i.z+1));u?.state==="loaded"&&(u.used=this._serial,r.add(u))}}for(let i of this._tiles.values()){if(!i.mesh)continue;let a=r.has(i);a&&!i.mesh.visible&&i.fadeStart===0&&(i.fadeStart=o,this._setOpacity(i,0),this._fading.add(i)),i.mesh.visible=a}}_request(t){for(let r of this._tiles.values())r.state==="loading"&&r.used!==this._serial&&(r.abort?.abort(),r.abort=null,r.state="idle",this._inFlight--);let o=so();for(let r of t){if(this._inFlight>=this.maxConcurrent)break;(r.state==="idle"||r.state==="error"&&o-r.failedAt>Us)&&this._load(r)}}_load(t){let o=this._tileUrl;if(!o)return;let r=new AbortController;t.abort=r,t.state="loading",this._inFlight++;let i=()=>t.abort!==r||this._tiles.get(t.key)!==t?!1:(t.abort=null,this._inFlight--,this._changed=!0,!0);Promise.resolve(o(t.x,t.y,t.z)).then(a=>this._loadImage(a,r.signal)).then(a=>{if(!i()){a.close?.();return}let s=new be.Texture(a);s.flipY=!(typeof ImageBitmap<"u"&&a instanceof ImageBitmap),s.colorSpace=be.SRGBColorSpace,s.anisotropy=this._anisotropy,s.needsUpdate=!0;let l=this._createMesh(t,s);l.visible=!1,t.mesh=l,t.state="loaded",t.fadeStart=0,this.add(l),this._invalidate?.()},()=>{i()&&(t.state="error",t.failedAt=so(),this._invalidate?.())})}_advanceFades(t){let o=!1;for(let r of this._fading){let i=Math.min(1,(t-r.fadeStart)/Jo);this._setOpacity(r,i),i>=1&&(this._fading.delete(r),o=!0)}return o}_setOpacity(t,o){let r=t.mesh?.material;if(!r)return;let i=o<1;r.transparent!==i&&(r.transparent=i,r.needsUpdate=!0),r.opacity=o}_evict(){let t=this._tiles.size-this.cacheSize;if(t<=0)return;let o=[];for(let r of this._tiles.values())r.used!==this._serial&&r.state!=="loading"&&o.push(r);o.sort((r,i)=>r.used-i.used);for(let r=0;r<t&&r<o.length;r++)this._free(o[r]),this._tiles.delete(o[r].key)}_free(t){t.abort&&(t.abort.abort(),t.abort=null,this._inFlight--),this._fading.delete(t);let o=t.mesh;if(!o)return;this.remove(o);let r=o.material,i=r.map?.image;r.map?.dispose(),r.dispose(),i?.close?.(),this._disposeMesh(o),t.mesh=null}};var tr=256,nr=800,or=21*(Math.PI/180),dn=class extends St{constructor(t,o={}){super(o,17);this._geometry=new ot.PlaneGeometry(1,1);this._box=new ot.Box3;this._mapSize=t}get mapSize(){return this._mapSize}latLngToWorld(t,o){let r=(o+180)/360,i=Math.max(-1.484,Math.min(1.484,t*Math.PI/180)),a=(1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2;return{x:(r-.5)*this._mapSize,y:(.5-a)*this._mapSize}}snapViewDistToIntegerLevel(t){let o=Math.max(1e-4,t),r=nr/(2*Math.tan(or)*o),i=Math.log2(this._mapSize*r/tr),a=Math.min(this.maxLevel,Math.max(this.minLevel,Math.round(i)));return this._mapSize*nr/(2*Math.tan(or)*tr*Math.pow(2,a))}dispose(){super.dispose(),this._geometry.dispose()}_measure(t,o,r,i,a){let s=this._mapSize/2,l=this._mapSize/2**r,u=-s+t*l,c=u+l,p=s-o*l,d=p-l;if(this._box.min.set(u,d,-1e-6),this._box.max.set(c,p,1e-6),!this._frustum.intersectsBox(this._box))return-1;let g=Math.min(Math.max(i.x,u),c)-i.x,m=Math.min(Math.max(i.y,d),p)-i.y,y=Math.max(1e-9,Math.hypot(g,m,i.z));return this._measuredDist=y,l*a/y}_createMesh(t,o){let r=this._mapSize/2**t.z,i=new ot.Mesh(this._geometry,new ot.MeshBasicMaterial({map:o,depthWrite:!1,depthTest:!1}));return i.scale.set(r,r,1),i.position.set(-this._mapSize/2+(t.x+.5)*r,this._mapSize/2-(t.y+.5)*r,0),i.renderOrder=-100+t.z,i.matrixAutoUpdate=!1,i.updateMatrix(),i}};var pn=null,ir=null;function js(){return ir??(ir=Promise.resolve().then(()=>te(rr())).then(n=>{pn=(n.default??n).rings})),ir}function qs(n={}){let e=n.ocean??"#0b1a2e",t=n.land??"#1c3147",o=n.border??"#315a80",r=n.grid??"#1a3a55",i=n.gridStepDeg??15,a=new Map,s=(l,u,c,p)=>{let d=`${c}/${l}/${u}`,g=a.get(d);if(g)return g;let m=2**c,y=x=>(x+180)/360*m*256-l*256,v=x=>{let S=Math.max(-85,Math.min(85,x));return(1-Math.log(Math.tan(Math.PI/4+S*Math.PI/360))/Math.PI)/2*m*256-u*256},h=document.createElement("canvas");h.width=256,h.height=256;let b=h.getContext("2d");b.fillStyle=e,b.fillRect(0,0,256,256),b.fillStyle=t,b.lineJoin="round";let f=o!=="";f&&(b.strokeStyle=o,b.lineWidth=.5);for(let x of p){b.beginPath();for(let S=0;S<x.length;S+=2){let A=y(x[S]),k=v(x[S+1]);S===0?b.moveTo(A,k):b.lineTo(A,k)}b.closePath(),b.fill(),f&&b.stroke()}if(r!==""&&i>0){b.strokeStyle=r,b.lineWidth=.4;for(let x=-180;x<=180;x+=i){let S=y(x);b.beginPath(),b.moveTo(S,0),b.lineTo(S,256),b.stroke()}for(let x=-75;x<=75;x+=i){let S=v(x);b.beginPath(),b.moveTo(0,S),b.lineTo(256,S),b.stroke()}}let w=h.toDataURL();return a.set(d,w),w};return(l,u,c)=>pn?s(l,u,c,pn):js().then(()=>s(l,u,c,pn))}var ar=qs();function ht(n){let e=["a","b","c"];return e[Math.abs(n)%e.length]}var Ks=(n,e,t)=>`https://${ht(n)}.basemaps.cartocdn.com/dark_all/${t}/${n}/${e}.png`,Ys=(n,e,t)=>`https://${ht(n)}.basemaps.cartocdn.com/dark_nolabels/${t}/${n}/${e}.png`,Xs=(n,e,t)=>`https://${ht(n)}.basemaps.cartocdn.com/dark_nolabels/${t}/${n}/${e}@2x.png`,$s=(n,e,t)=>`https://${ht(n)}.basemaps.cartocdn.com/light_all/${t}/${n}/${e}.png`,Zs=(n,e,t)=>`https://${ht(n)}.basemaps.cartocdn.com/light_nolabels/${t}/${n}/${e}.png`,Qs=(n,e,t)=>`https://${ht(n)}.basemaps.cartocdn.com/rastertiles/voyager/${t}/${n}/${e}.png`,Js=(n,e,t)=>`https://${ht(n)}.tile.openstreetmap.org/${t}/${n}/${e}.png`,el=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=s&x=${n}&y=${e}&z=${t}`,tl=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=s&x=${n}&y=${e}&z=${t}&scale=2`,nl=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=y&x=${n}&y=${e}&z=${t}`,ol=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=y&x=${n}&y=${e}&z=${t}&scale=2`,rl=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=m&x=${n}&y=${e}&z=${t}`,il=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=m&x=${n}&y=${e}&z=${t}&scale=2`,al=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=p&x=${n}&y=${e}&z=${t}`,sl=(n,e,t)=>`https://mt${Math.abs(n)%4}.google.com/vt/lyrs=p&x=${n}&y=${e}&z=${t}&scale=2`,ll=(n,e,t)=>`https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${t}/${e}/${n}`,cl=(n,e,t)=>`https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/${t}/${e}/${n}`,dl=(n,e,t)=>`https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/${t}/${e}/${n}`,pl=(n,e,t)=>`https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/${t}/${e}/${n}`,ul=(n,e,t)=>`https://tiles.stadiamaps.com/tiles/stamen_toner/${t}/${n}/${e}.png`,gl=(n,e,t)=>`https://tiles.stadiamaps.com/tiles/stamen_watercolor/${t}/${n}/${e}.jpg`,hl=(n,e,t)=>`https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/${t}/${n}/${e}.png`;function fl(n){return(e,t,o)=>`https://api.mapbox.com/styles/v1/mapbox/streets-v12/tiles/${o}/${e}/${t}?access_token=${n}`}function ml(n){return(e,t,o)=>`https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/${o}/${e}/${t}?access_token=${n}`}function vl(n){return(e,t,o)=>`https://api.mapbox.com/styles/v1/mapbox/dark-v11/tiles/${o}/${e}/${t}?access_token=${n}`}var sr={cartoDark:Ks,cartoDarkNoLabels:Ys,cartoDarkNoLabelsRetina:Xs,cartoLight:$s,cartoLightNoLabels:Zs,cartoVoyager:Qs,openStreetMap:Js,googleSatellite:el,googleHybrid:nl,googleRoads:rl,googleTerrain:al,vectorDark:ar,esriDarkGray:cl,esriLightGray:dl,esriWorldImagery:ll,esriWorldTopo:pl,stamenToner:ul,stamenWatercolor:gl,stadiaAlidadeDark:hl,mapboxStreets:fl,mapboxSatellite:ml,mapboxDark:vl},Pt=" (needs a Carto API key)",bl={cartoDark:{name:"Carto Dark",description:"Dark basemap for data visualization"+Pt,requiresKey:!0},cartoDarkNoLabels:{name:"Carto Dark (no labels)",description:"Dark basemap without baked-in text"+Pt,requiresKey:!0},cartoDarkNoLabelsRetina:{name:"Carto Dark (no labels, HD)",description:"Dark no-labels basemap at @2x"+Pt,requiresKey:!0},cartoLight:{name:"Carto Light",description:"Light basemap"+Pt,requiresKey:!0},cartoLightNoLabels:{name:"Carto Light (no labels)",description:"Light basemap without baked-in text"+Pt,requiresKey:!0},cartoVoyager:{name:"Carto Voyager",description:"Colorful map with labels"+Pt,requiresKey:!0},vectorDark:{name:"Vector (offline)",description:"Flat-shaded vector earth rendered from a bundled world outline \u2014 no network, crisp at any zoom"},openStreetMap:{name:"OpenStreetMap",description:"Community street map",maxLevel:19},googleSatellite:{name:"Google Satellite",description:"Aerial/satellite imagery",maxLevel:20,tileUrl2x:tl},googleHybrid:{name:"Google Hybrid",description:"Satellite + road labels",maxLevel:20,tileUrl2x:ol},googleRoads:{name:"Google Roads",description:"Standard road map",maxLevel:20,tileUrl2x:il},googleTerrain:{name:"Google Terrain",description:"Terrain with labels",maxLevel:20,tileUrl2x:sl},esriDarkGray:{name:"ESRI Dark Gray",description:"Dark basemap without labels for data visualization (default)",maxLevel:16},esriLightGray:{name:"ESRI Light Gray",description:"Light basemap without labels for data visualization",maxLevel:16},esriWorldImagery:{name:"ESRI Satellite",description:"High-res satellite imagery",maxLevel:19},esriWorldTopo:{name:"ESRI Topo",description:"Topographic map",maxLevel:19},stamenToner:{name:"Stamen Toner",description:"High-contrast B&W (needs a Stadia API key)",requiresKey:!0},stamenWatercolor:{name:"Stamen Watercolor",description:"Artistic watercolor (needs a Stadia API key)",requiresKey:!0},stadiaAlidadeDark:{name:"Stadia Dark",description:"Modern dark theme (needs a Stadia API key)",requiresKey:!0}},lo="esriDarkGray";function lr(n,e=1,t=18){let o=bl[n],r=o?.maxLevel??t;return o?.tileUrl2x&&e>=1.5?{tileUrl:o.tileUrl2x,tileSize:512,maxLevel:r}:{tileUrl:sr[n]??sr[lo],tileSize:256,maxLevel:r}}function un(n,e,t){let o;return n.tileProvider||!n.tileUrl?o=lr(n.tileProvider??lo,e,t):n.tileUrl2x&&e>=1.5?o={tileUrl:n.tileUrl2x,tileSize:512,maxLevel:t}:o={tileUrl:n.tileUrl,tileSize:256,maxLevel:t},n.maxLevel!==void 0?{...o,maxLevel:n.maxLevel}:o}var pr=require("react/jsx-runtime"),cr="flat-layer",gn=42/2*(Math.PI/180);function co(n,e){let t=n.aspect>.1?n.aspect:1.7777777777777777,o=Math.atan(Math.tan(gn)*t),r=e/2/Math.tan(o),i=e/2/Math.tan(gn);return Math.min(r,i)}function yl(n,e,t){let o=co(e,t);n.position.x=0,n.position.y=0,n.position.z=e.position.z-o}function xl(n,e,t){let o=!1,r=co(e,t),i=e.position.z-r;n.position.z<i&&(n.position.z=i,o=!0);let a=Math.abs(e.position.z-n.position.z),s=e.aspect>.1?e.aspect:16/9,l=Math.atan(Math.tan(gn)*s),u=Math.tan(l)*a,c=Math.tan(gn)*a,p=t/2,d=Math.max(0,p-u),g=Math.max(0,p-c);return n.position.x<-d?(n.position.x=-d,o=!0):n.position.x>d&&(n.position.x=d,o=!0),n.position.y<-g?(n.position.y=-g,o=!0):n.position.y>g&&(n.position.y=g,o=!0),o}function dr({mapSize:n=10,tileUrl:e,tileUrl2x:t,tileProvider:o,minLevel:r=0,maxLevel:i,autoFit:a=!0,visible:s=!0,onReady:l,swapTokenRef:u}){let{cloudScene:c,camera:p,control:d,invalidate:g,registerFrameCallback:m,setMapMode:y,interaction:v,container:h,renderer:b}=Ge(),{is3D:f}=an(),w=ze(),x=(0,Ct.useRef)(null);return(0,Ct.useEffect)(()=>{let A={...un({tileProvider:o,tileUrl:e,tileUrl2x:t,maxLevel:i},b?.getPixelRatio()??1,17),minLevel:r},k=new dn(n,A);k.setInvalidate(g),x.current=k,c.add(k),c.quaternion.identity(),c.rotation.set(0,0,0),y(!0,0,.3),w?.map?.enableMap({mode:"planar",mapSize:n});let C;return a&&(C=requestAnimationFrame(()=>{x.current&&(yl(c,p,n),v?.syncTransforms(c),g())})),v?.syncTransforms(c),m(cr,()=>x.current?(xl(c,p,n)&&v?.syncTransforms(c),x.current.updatePov(p,{bufferHeight:b?.domElement.height})):void 0),l?.(k),g(),()=>{C!==void 0&&cancelAnimationFrame(C),m(cr,null),c.remove(k),k.setInvalidate(void 0),k.dispose(),x.current=null,y(!1,0);let E=u?.current??null;u&&(u.current=null),w?.map?.disableMap(E!==null?{swapToken:E}:void 0)}},[n,e,t,o,r,i]),(0,Ct.useEffect)(()=>{if(!d)return;let S=d.getZoomRange(),A=p.position.z-1e-4,k=co(p,n),C=p.position.z-k-.01;return d.setZoomRange(C,A),d.setWheelIdleSnap(null),()=>{d.setZoomRange(S.min,S.max),d.setWheelIdleSnap(null)}},[d,p,n]),(0,Ct.useEffect)(()=>{x.current&&(x.current.visible=s,g())},[s,g]),!h||!f?null:(0,pr.jsx)(ln,{container:h})}var rt=require("react"),Ze=te(require("three"));var ne=require("three");function po(n){let e=n;if(e.geometry&&e.geometry.dispose(),e.material){let t=Array.isArray(e.material)?e.material:[e.material];for(let o of t)o.map&&o.map.dispose(),o.dispose()}}function ur(n,e,t){let o=(90-n)*Math.PI/180,r=(90-e)*Math.PI/180;return{x:t*Math.sin(o)*Math.cos(r),y:t*Math.cos(o),z:t*Math.sin(o)*Math.sin(r)}}function gr({x:n,y:e,z:t}){let o=Math.sqrt(n*n+e*e+t*t),r=Math.acos(e/o),i=Math.atan2(t,n);return{lat:90-r*180/Math.PI,lng:90-i*180/Math.PI-(i<-Math.PI/2?360:0),r:o}}function ft(n){return n*Math.PI/180}function wl(n){return Math.log(Math.tan(Math.PI/4+n/2))}function Sl(n){return 2*Math.atan(Math.exp(n))-Math.PI/2}function hr(n){let e=(.5-n)*Math.PI;return 1-(wl(e)/Math.PI+1)/2}function uo(n){return Math.max(0,Math.min(1,hr(n)))}function Lt(n){let e=(2*(1-n)-1)*Math.PI;return .5-Sl(e)/Math.PI}function fr(n,e=0,t=1){let o=n.array,r=u=>{let c=Math.max(0,Math.min(1,u));return e+(t-e)*(1-c)},i=uo(e),a=uo(t),s=u=>{let c=Math.max(i,Math.min(a,u));return Math.abs(a-i)<1e-10?.5:1-(c-i)/(a-i)},l=u=>s(uo(r(u)));for(let u=0,c=o.length;u<c;u+=2)o[u+1]=l(o[u+1]);n.needsUpdate=!0}function go(n,e,t=0,o=0,r,i){let a=[],s=2**n,l=360/s,u=180/s,c=r===void 0?s-1:r,p=i===void 0?s-1:i;for(let d=t,g=Math.min(s-1,c);d<=g;d++)for(let m=o,y=Math.min(s-1,p);m<=y;m++){let v=m,h=u;e&&(v=m===0?m:Lt(m/s)*s,h=((m+1===s?m+1:Lt((m+1)/s)*s)-v)*180/s);let b=-180+(d+.5)*l,f=90-(v*180/s+h/2),w=h;a.push({x:d,y:m,lng:b,lat:f,latLen:w})}return a}var Pl=.02,Cl=2,Ot=Math.PI/180,kl=`
4
+ varying vec3 vVertexNormal;
5
+ varying vec3 vVertexWorldPosition;
6
+ void main() {
7
+ vVertexNormal = normalize(normalMatrix * normal);
8
+ vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;
9
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
10
+ }
11
+ `,Rl=`
12
+ uniform vec3 glowColor;
13
+ uniform float coefficient;
14
+ uniform float power;
15
+ varying vec3 vVertexNormal;
16
+ varying vec3 vVertexWorldPosition;
17
+ void main() {
18
+ vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;
19
+ vec3 viewCameraToVertex = normalize((viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz);
20
+ float intensity = pow(coefficient + dot(vVertexNormal, viewCameraToVertex), power);
21
+ gl_FragColor = vec4(glowColor, clamp(intensity, 0.0, 1.0));
22
+ }
23
+ `,hn=class extends St{constructor(t,o={}){super({...o,anisotropy:o.anisotropy??16},18);this.curvatureResolution=2;this._camLat=0;this._camLng=0;this._camR=0;this._p=new ne.Vector3;this._sphere=new ne.Sphere;this._radius=t,this._isMercator=o.mercatorProjection??!0,this._innerBackLayer=new ne.Mesh(new ne.SphereGeometry(this._radius*.99,180,90),new ne.MeshBasicMaterial({color:0})),this._innerBackLayer.visible=!0;let r=this._innerBackLayer.material;r.polygonOffset=!0,r.polygonOffsetUnits=3,r.polygonOffsetFactor=1,this.add(this._innerBackLayer),this._innerBackLayer.renderOrder=-200,(o.atmosphere??!0)&&this._buildAtmosphere(o.atmosphereColor??5078980,o.atmosphereAltitude??.07)}get radius(){return this._radius}switchTileUrl(t){this.tileUrl=t}dispose(){super.dispose();for(let t of[this._innerBackLayer,this._atmosphere])t&&(this.remove(t),po(t));this._atmosphere=void 0}get hasAtmosphere(){return!!this._atmosphere}setAtmosphere(t={}){let{enabled:o=!0,color:r,altitude:i,coefficient:a,power:s}=t;if(!o){this._atmosphere&&(this.remove(this._atmosphere),po(this._atmosphere),this._atmosphere=void 0);return}this._atmosphere||this._buildAtmosphere(r??5078980,i??.07);let l=this._atmosphere.material;if(r!==void 0&&l.uniforms.glowColor.value.set(r),a!==void 0&&(l.uniforms.coefficient.value=a),s!==void 0&&(l.uniforms.power.value=s),i!==void 0){let u=this._atmosphere.geometry;this._atmosphere.geometry=new ne.SphereGeometry(this._radius*(1+i),64,64),u.dispose()}}_buildAtmosphere(t,o){let r=new ne.ShaderMaterial({uniforms:{glowColor:{value:new ne.Color(t)},coefficient:{value:.4},power:{value:6}},vertexShader:kl,fragmentShader:Rl,side:ne.BackSide,blending:ne.AdditiveBlending,transparent:!1,depthTest:!1,depthWrite:!1}),i=new ne.Mesh(new ne.SphereGeometry(this._radius*(1+o),64,64),r);i.renderOrder=-1e3,i.raycast=()=>{},this._atmosphere=i,this.add(i)}_prepare(t){let o=t.length();if(this._camR=o,o===0)return;this._camLat=90-Math.acos(Math.max(-1,Math.min(1,t.y/o)))/Ot;let r=Math.atan2(t.z,t.x);this._camLng=90-r/Ot-(r<-Math.PI/2?360:0)}_measure(t,o,r,i,a){let s=this._radius,l=2**r,u=360/l,c=-180+(t+.5)*u,p=this._latAt(o,l),d=this._latAt(o+1,l),g=Math.min(Math.max(this._camLat,d),p),m=this._camLng-c;m-=360*Math.round(m/360);let y=c+Math.min(Math.max(m,-u/2),u/2),v=this._onSphere(g,y,this._p);if(v.dot(i)<s*s-Pl*s*this._camR)return-1;if(r>=Cl){let f=this._sphere;this._onSphere((p+d)/2,c,f.center);let w=0;for(let x=0;x<4;x++){let S=f.center.x,A=f.center.y,k=f.center.z;this._onSphere(x&1?p:d,c+(x&2?u:-u)/2,v),w=Math.max(w,(v.x-S)**2+(v.y-A)**2+(v.z-k)**2)}if(f.radius=Math.sqrt(w),!this._frustum.intersectsSphere(f))return-1;this._onSphere(g,y,v)}let h=Math.max(1e-9,v.distanceTo(i));this._measuredDist=h;let b=2*Math.PI*s*Math.cos(g*Ot)/l;return this._isMercator||(b=Math.max(b,Math.PI*s/l)),b*a/h}_createMesh(t,o){let{lng:r,lat:i,latLen:a}=go(t.z,this._isMercator,t.x,t.y,t.x,t.y)[0],s=360/2**t.z,l=a,u=new ne.Mesh(new ne.SphereGeometry(this._radius,Math.ceil(s/this.curvatureResolution),Math.ceil(l/this.curvatureResolution),ft(90-s/2)+ft(r),ft(s),ft(90-l/2)+ft(-i),ft(l)),new ne.MeshBasicMaterial({map:o,depthWrite:!1}));Al(u);let c=u.geometry.attributes.uv;return this._isMercator&&c&&fr(c,.5-(i+a/2)/180,.5-(i-a/2)/180),u.renderOrder=-100+t.z,u.matrixAutoUpdate=!1,u.updateMatrix(),u}_disposeMesh(t){t.geometry.dispose()}_latAt(t,o){return t<=0?90:t>=o?-90:this._isMercator?90-Lt(t/o)*180:90-t/o*180}_onSphere(t,o,r){let i=(90-t)*Ot,a=(90-o)*Ot,s=this._radius;return r.set(s*Math.sin(i)*Math.cos(a),s*Math.cos(i),s*Math.sin(i)*Math.sin(a))}};function Al(n){let e=n.geometry,{radius:t,phiStart:o,phiLength:r,thetaStart:i,thetaLength:a}=e.parameters,s=Math.max(3,Math.floor(e.parameters.widthSegments)),l=Math.max(2,Math.floor(e.parameters.heightSegments)),u=e.getAttribute("position");if(u.count!==(s+1)*(l+1))return;let c=(g,m)=>{let y=g/s,v=m/l,h=o+y*r,b=i+v*a;return[-t*Math.cos(h)*Math.sin(b),t*Math.cos(b),t*Math.sin(h)*Math.sin(b)]},p=c(s/2,l/2),d=0;for(let g=0;g<=l;g++)for(let m=0;m<=s;m++,d++){let y=c(m,g);u.setXYZ(d,y[0]-p[0],y[1]-p[1],y[2]-p[2])}u.needsUpdate=!0,e.computeBoundingSphere(),e.computeBoundingBox(),n.position.set(p[0],p[1],p[2])}var ke=te(require("three")),Tl={rotateSpeed:.005,zoomSpeed:.15,zoomMin:-50,zoomMax:-.5,enableRotate:!0,enableZoom:!0,dampingFactor:.92,cameraZ:6,globeRadius:5,fov:42,maxPitch:88,dragThreshold:3,zoomToCursor:!1,onPitchDelta:void 0,shouldSkipDrag:void 0},ho=new ke.Euler(0,0,0,"YXZ"),mr=new ke.Quaternion,vr=new ke.Quaternion,Ml=new ke.Vector3(0,1,0),Il=new ke.Vector3(1,0,0),fn=1e-9,mn=class{constructor(e,t,o){this.enabled=!0;this._azimuth=0;this._elevation=0;this.isDragging=!1;this.dragConfirmed=!1;this.downX=0;this.downY=0;this.prevX=0;this.prevY=0;this._rightDragging=!1;this._rightPrevY=0;this.velocityX=0;this.velocityY=0;this.animFrameId=null;this.isAnimating=!1;this.changeCallback=null;this.dampingLoop=()=>{if(!this.isAnimating)return;let e=this.config.dampingFactor;if(this.velocityX*=e,this.velocityY*=e,Math.abs(this.velocityX)<1e-5&&Math.abs(this.velocityY)<1e-5){this.velocityX=0,this.velocityY=0,this.isAnimating=!1;return}this.applyWorldRotation(this.velocityX,this.velocityY),this.notify(),this.animFrameId=requestAnimationFrame(this.dampingLoop)};this.object=e,this.domElement=t,this.config={...Tl,...o},ho.setFromQuaternion(this.object.quaternion,"YXZ"),this._azimuth=ho.y,this._elevation=ho.x,this._onMouseDown=this.handleMouseDown.bind(this),this._onMouseMove=this.handleMouseMove.bind(this),this._onMouseUp=this.handleMouseUp.bind(this),this._onWheel=this.handleWheel.bind(this),this._onContextMenu=r=>r.preventDefault()}connect(){this.domElement.addEventListener("mousedown",this._onMouseDown),this.domElement.addEventListener("wheel",this._onWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){this.domElement.removeEventListener("mousedown",this._onMouseDown),this.domElement.removeEventListener("wheel",this._onWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),window.removeEventListener("mousemove",this._onMouseMove),window.removeEventListener("mouseup",this._onMouseUp),this.stopDamping()}dispose(){this.disconnect(),this.changeCallback=null}onChange(e){this.changeCallback=e}getZoom(){return this.object.position.z}setZoom(e){this.object.position.z=ke.MathUtils.clamp(e,this.config.zoomMin,this.config.zoomMax)}pixelToRadians(){let e=Math.abs(this.config.cameraZ-this.object.position.z),t=Math.max(e-this.config.globeRadius,fn),o=this.config.fov/2*(Math.PI/180),i=this.domElement.getBoundingClientRect().height||600;return 2*Math.tan(o)*t/(i*this.config.globeRadius)}applyWorldRotation(e,t){let o=this.config.maxPitch*Math.PI/180;this._azimuth+=e,this._elevation=ke.MathUtils.clamp(this._elevation+t,-o,o),this.rebuildQuaternion()}rebuildQuaternion(){mr.setFromAxisAngle(Ml,this._azimuth),vr.setFromAxisAngle(Il,this._elevation),this.object.quaternion.multiplyQuaternions(vr,mr)}setOrientation(e,t){let o=this.config.maxPitch*Math.PI/180;this._azimuth=e,this._elevation=ke.MathUtils.clamp(t,-o,o),this.rebuildQuaternion()}getOrientation(){return{azimuth:this._azimuth,elevation:this._elevation}}startDamping(){this.isAnimating||(this.isAnimating=!0,this.dampingLoop())}stopDamping(){this.isAnimating=!1,this.animFrameId!==null&&(cancelAnimationFrame(this.animFrameId),this.animFrameId=null)}handleMouseDown(e){if(!(!this.enabled||!this.config.enableRotate)&&!(e.button!==0&&e.button!==2)){if(e.button===2){this._rightDragging=!0,this._rightPrevY=e.clientY,window.addEventListener("mousemove",this._onMouseMove),window.addEventListener("mouseup",this._onMouseUp);return}this.config.shouldSkipDrag&&this.config.shouldSkipDrag(e)||(this.isDragging=!0,this.dragConfirmed=!1,this.downX=e.clientX,this.downY=e.clientY,this.prevX=e.clientX,this.prevY=e.clientY,this.stopDamping(),this.velocityX=0,this.velocityY=0,window.addEventListener("mousemove",this._onMouseMove),window.addEventListener("mouseup",this._onMouseUp))}}handleMouseMove(e){if(this._rightDragging){let i=e.clientY-this._rightPrevY;if(this._rightPrevY=e.clientY,this.config.onPitchDelta){let a=i*.5;Math.abs(a)>.001&&this.config.onPitchDelta(a)}return}if(!this.isDragging)return;if(!this.dragConfirmed){let i=e.clientX-this.downX,a=e.clientY-this.downY;if(i*i+a*a<this.config.dragThreshold*this.config.dragThreshold)return;this.dragConfirmed=!0,this.prevX=e.clientX,this.prevY=e.clientY}let t=this.pixelToRadians(),o=(e.clientX-this.prevX)*t,r=(e.clientY-this.prevY)*t;this.applyWorldRotation(o,r),this.velocityX=o*.4+this.velocityX*.6,this.velocityY=r*.4+this.velocityY*.6,this.prevX=e.clientX,this.prevY=e.clientY,this.notify()}handleMouseUp(){let e=this.dragConfirmed;this._rightDragging=!1,this.isDragging=!1,this.dragConfirmed=!1,window.removeEventListener("mousemove",this._onMouseMove),window.removeEventListener("mouseup",this._onMouseUp),e&&(Math.abs(this.velocityX)>1e-4||Math.abs(this.velocityY)>1e-4)&&this.startDamping()}handleWheel(e){if(!this.enabled||!this.config.enableZoom)return;e.preventDefault();let t=this.object.position.z,o=Math.abs(this.config.cameraZ-t),r=Math.max(o-this.config.globeRadius,fn),i=e.deltaY/100,a=-Math.log(1-ke.MathUtils.clamp(this.config.zoomSpeed,1e-6,.95)),l=Math.max(fn,r*Math.exp(i*a))+this.config.globeRadius,u=Math.min(this.config.zoomMax,this.config.cameraZ-this.config.globeRadius-fn),c=ke.MathUtils.clamp(this.config.cameraZ-l,this.config.zoomMin,u),p=c-t;if(!(Math.abs(p)<=r*1e-9)){if(this.config.zoomToCursor){let d=this.domElement.getBoundingClientRect(),g=(e.clientX-d.left)/d.width-.5,m=-((e.clientY-d.top)/d.height-.5),y=this.config.fov/2*(Math.PI/180),v=d.width/d.height,h=Math.tan(y),b=Math.atan(g*2*h*v),f=Math.atan(m*2*h),w=Math.abs(this.config.cameraZ-t),x=Math.abs(this.config.cameraZ-c),S=w>.001?1-x/w:0;this.applyWorldRotation(-b*S,f*S)}this.object.position.z=c,this.notify()}}notify(){this.changeCallback?.()}};var El=te(require("three")),fo=6378137,vd=2*Math.PI*fo;var _l=.02,zl=1.5,Dl=50,Fl=1e-10;function br(n,e,t){if(!(n>=0)||!Number.isFinite(n))return t;let o=n*_l;if(o>=t.near)return t;let r=Math.sqrt(n*(2*e+n)),i=Math.min(t.far,Math.max(r*zl,n*Dl));return{near:Math.max(o,Fl),far:i}}function yr(n,e){return n*e/fo}var Sr=require("react/jsx-runtime"),xr="globe-layer";function Nl(n,e,t,o){let r=e.length/3;if(r===0)return;let i=0,a=0,s=0;for(let x=0;x<r;x++){let S=e[x*3],A=e[x*3+1],k=e[x*3+2];if(!isFinite(S)||!isFinite(A)||!isFinite(k)||S===0&&A===0&&k===0)continue;let{lat:C,lng:E}=gr({x:S,y:A,z:k});i+=C,a+=E,s++}if(s===0)return;let l=i/s,u=a/s,c=new Ze.Quaternion().setFromAxisAngle(new Ze.Vector3(0,1,0),-u*Math.PI/180),p=new Ze.Quaternion().setFromAxisAngle(new Ze.Vector3(1,0,0),-Math.max(-80,Math.min(80,l))*Math.PI/180);n.quaternion.copy(c).premultiply(p);let d=new Ze.Vector3,g=ur(l,u,t);d.set(g.x,g.y,g.z);let m=0;for(let x=0;x<r;x++){let S=e[x*3],A=e[x*3+1],k=e[x*3+2];if(!isFinite(S)||!isFinite(A)||!isFinite(k)||S===0&&A===0&&k===0)continue;let C=new Ze.Vector3(S,A,k),E=d.angleTo(C);m=Math.max(m,E)}let v=42/2*Math.PI/180,b=Math.min(m*1.5,Math.PI),w=(b>.001?t*Math.sin(b/2)/Math.tan(v):t*2)+t;n.position.z=Math.max(-100,Math.min(-.5,o-w))}function wr({radius:n=5,tileUrl:e,tileUrl2x:t,tileProvider:o,minLevel:r=0,maxLevel:i,mercatorProjection:a=!0,autoFit:s=!0,visible:l=!0,controlConfig:u,atmosphere:c=!0,atmosphereColor:p,onReady:d,swapTokenRef:g,minAltitude:m=2}){let{scene:y,cloudScene:v,camera:h,container:b,invalidate:f,registerFrameCallback:w,setMapMode:x,setMapDamping:S,store:A,interaction:k,control:C,renderer:E}=Ge(),P=ze(),M=(0,rt.useRef)(null),D=(0,rt.useRef)(null),T=un({tileProvider:o,tileUrl:e,tileUrl2x:t,maxLevel:i},E?.getPixelRatio()??1,18);return(0,rt.useEffect)(()=>{let I=v.position.clone(),_=v.quaternion.clone(),N=new hn(n,{...T,minLevel:r,mercatorProjection:a,atmosphere:c,atmosphereColor:p});if(M.current=N,N.setInvalidate(f),v.add(N),x(!0,n,.3),C&&(C.enabled=!1),k&&(k.drag.enabled=!0,k.coordinator?.setBackgroundGestureExternal(!0)),b){let F=new mn(v,b,{zoomMin:-100,zoomMax:h.position.z-n-yr(Math.max(0,m),n),cameraZ:h.position.z,globeRadius:n,...u,onPitchDelta:H=>{P?.map&&P.map.setPitch(P.map.getPitch()+H)},shouldSkipDrag:H=>{let O=k?.picker;if(!O?.pick||!b)return!1;let U=b.getBoundingClientRect(),q=O.pick(H.clientX-U.left,H.clientY-U.top);return!!(q&&q.type==="node"&&q.picked)}});F.onChange(()=>{P?.map?.reapplyPitch?.(),k?.syncTransforms(v),f()}),F.connect(),D.current=F,P?.map?.wireGlobeControl?.(F)}if(s){let F=A.positionProvider?.getPositions();F&&F.length>=3?Nl(v,F,n,h.position.z):v.position.z=h.position.z-n*3}P?.map?.enableMap({mode:"spherical",globeRadius:n}),k?.syncTransforms(v);let R={near:h.near,far:h.far},z=new Ze.Vector3,G=()=>{let F=h.position.distanceTo(v.getWorldPosition(z))-n,H=br(F,n,R);(H.near!==h.near||H.far!==h.far)&&(h.near=H.near,h.far=H.far,h.updateProjectionMatrix())};return w(xr,()=>(G(),M.current?.updatePov(h,{bufferHeight:E?.domElement.height})??!1)),d?.(N),f(),()=>{P?.map?.wireGlobeControl?.(null);let F=g?.current??null;g&&(g.current=null),P?.map?.disableMap(F!==null?{swapToken:F}:void 0),D.current?.dispose(),D.current=null,w(xr,null),(h.near!==R.near||h.far!==R.far)&&(h.near=R.near,h.far=R.far,h.updateProjectionMatrix()),v.remove(N),N.setInvalidate(void 0),N.dispose(),M.current=null,x(!1,0),v.position.copy(I),v.quaternion.copy(_),C&&(C.enabled=!0),k?.coordinator?.setBackgroundGestureExternal(!1),f()}},[n,r,a]),(0,rt.useEffect)(()=>{M.current&&(M.current.setSource(T),f())},[T.tileUrl,T.tileSize,T.maxLevel]),(0,rt.useEffect)(()=>{M.current&&(M.current.visible=l,f())},[l,f]),(0,rt.useEffect)(()=>{M.current&&(M.current.setAtmosphere({enabled:c,color:p}),f())},[c,p,f]),b?(0,Sr.jsx)(ln,{container:b}):null}var Nr=require("react");var it=require("react");var kr=te(require("three"));function Cr(n,e=0){switch(n){case"underlay":return-50+Pr(e,0,40);case"overlay":return 2+Pr(e,0,96);default:return 100+Math.max(0,e)}}function Pr(n,e,t){return n<e?e:n>t?t:n}function Rr(n){return{damping:n.mapDamping,maxGrowth:n.api?.map.getMaxNodeGrowth()??4}}function Ar(n,e,t,o,r){let i=t(),a=()=>{let c=new kr.Vector2;return n.getRenderer()?.getDrawingBufferSize(c),{width:c.x||1,height:c.y||1}},s={cloudScene:n.cloudScene,camera:n.camera,store:n.store,iconAtlasManager:n.iconAtlasManager,invalidate:n.invalidate,isMapMode:n.isMapMode(),sphereRadius:n.mapSphereRadius(),...n.mapNodeSizing?{getMapNodeSizing:n.mapNodeSizing}:{},renderOrder:Cr,getDrawingBufferSize:a,getEdgeOpacity:c=>{let p=n.store.index.getEdgeIndex(c),d=n.store.edgeState?.opacities;return p!==void 0&&d?d[p]:1},getNodeOpacity:c=>{let p=n.store.index.getNodeIndex?.(c),d=n.store.nodeState?.opacities;return p!==void 0&&p>=0&&d?d[p]:1},getHitTest:()=>n.getHitTest?.()??null};i.mount(s),i.update?.(o),n.invalidate();let l=0,u=!1;if(r?.frame===!0){let c=performance.now(),p=()=>{if(u)return;let d=performance.now(),g=(d-c)/1e3;c=d,s.sphereRadius=n.mapSphereRadius(),s.isMapMode=n.isMapMode(),i.frame?.(g,s)&&n.invalidate(),l=requestAnimationFrame(p)};l=requestAnimationFrame(p)}return n.registerMapModeCallback(e,(c,p=0)=>{s.sphereRadius=p,s.isMapMode=c,i.onMapMode?.(c,p),n.invalidate()}),{update(c){i.update?.(c),n.invalidate()},dispose(){u=!0,l&&cancelAnimationFrame(l),n.registerMapModeCallback(e,null),i.dispose(),n.invalidate()}}}function Tr(n,e,t,o,r){let i=Ge(),{store:a,cloudScene:s,camera:l,renderer:u,invalidate:c,registerMapModeCallback:p}=i,d=rn(),g=Ho(),{iconAtlasManager:m}=Vo(),y=(0,it.useRef)(null);y.current=u;let v=(0,it.useRef)(d);v.current=d;let h=(0,it.useRef)(g);h.current=g;let b=(0,it.useRef)(null);(0,it.useEffect)(()=>{let w=Ar({cloudScene:s,camera:l,getRenderer:()=>y.current,store:a,invalidate:c,registerMapModeCallback:p,iconAtlasManager:m,isMapMode:()=>v.current,mapSphereRadius:()=>h.current,mapNodeSizing:()=>Rr(i),getHitTest:()=>i.interaction?.picker??null},n,e,t,r);return b.current=w,()=>{w.dispose(),b.current=null}},[n,s,l,a,...o]),(0,it.useEffect)(()=>{b.current?.update(t)},[t])}function Gt(n,e,t){let o=new Set(e),r=new Map,i=(p,d)=>{let g=r.get(p);g?g.push(d):r.set(p,[d])};for(let p of t)i(p.source,p.target),i(p.target,p.source);let a=new Map;for(let p of n)a.set(p,0);let s=new Set(n),l=0;for(;s.size>0;){let p=new Set;for(let d of s){let g=r.get(d);if(g)for(let m of g)!o.has(m)||a.has(m)||(a.set(m,l+1),p.add(m))}s=p,l++}let u=[],c=[];for(let p of e){let d=a.get(p);if(d===void 0){c.push(p);continue}let g=[];for(let m of r.get(p)??[]){let y=a.get(m);y!==void 0&&y<d&&g.push(m)}u.push({id:p,depth:d,parents:g})}return u.sort((p,d)=>p.depth-d.depth),{entries:u,order:u.map(p=>p.id),disconnected:c}}function Mr(n){let e=new Map;for(let l of n.entries)e.set(l.id,l.depth);let t=new Map;for(let l of n.entries){let u=l.parents[0];if(u==null)continue;let c=t.get(u);c?c.push(l.id):t.set(u,[l.id])}let o=new Map,r=l=>{let u=o.get(l);if(u!==void 0)return u;let c=t.get(l),p=1;if(c&&c.length){p=0;for(let d of c)p+=r(d)}return o.set(l,p),p},i=[],a=(l,u,c,p)=>{let d=(c+p)/2;i.push({id:l,anchorId:u,depth:e.get(l)??1,dx:Math.cos(d-Math.PI/2),dy:Math.sin(d-Math.PI/2)});let g=t.get(l);if(!g||!g.length)return;let m=g.reduce((v,h)=>v+r(h),0)||1,y=c;for(let v of g){let h=r(v)/m*(p-c);a(v,u,y,y+h),y+=h}},s=new Set;for(let l of n.entries)l.depth===1&&s.add(l.parents[0]);for(let l of s){let u=t.get(l)??[],c=u.reduce((d,g)=>d+r(g),0)||1,p=0;for(let d of u){let g=r(d)/c*2*Math.PI;a(d,l,p,p+g),p+=g}}return i}function Bt(n,e){let t=new Map;for(let d of n.entries)t.set(d.id,d.depth);let o=new Map,r=(d,g)=>d<g?d+" "+g:g+" "+d;for(let d of e)o.set(r(d.source,d.target),(o.get(r(d.source,d.target))??0)+1);let i=(d,g)=>o.get(r(d,g))??0,a=new Map;for(let d of n.entries)a.set(d.id,d.parents);let s=(d,g)=>{let m=g[0];for(let y of g){let v=i(d,y),h=i(d,m);(v>h||v===h&&y<m)&&(m=y)}return m},l=new Map,u=d=>{let g=l.get(d);if(g)return g;let m=d;for(let h=0;h<n.entries.length+1;h++){let b=a.get(m)??[];if(b.length===0)break;let f=s(m,b);if(!t.has(f))return l.set(d,f),f;m=f}let v=(a.get(d)??[]).filter(h=>!t.has(h)).sort((h,b)=>h.localeCompare(b))[0]??"";return l.set(d,v),v},c=new Map,p=new Map;for(let d of n.entries){let g=u(d.id);g&&(c.set(d.id,g),p.set(g,(p.get(g)??0)+1))}return{primaryAnchorOf:c,ownedCountByAnchor:p}}function Ir(n){let e=0,t=0;for(let r of n)e+=r[0],t+=r[1];let o=n.length||1;return[e/o,t/o]}function Er(n){let e=[...n.keys()],t=new Map;for(let o of e){let r=n.get(o),i=1/0;for(let a of e){if(a===o)continue;let s=n.get(a),l=Math.hypot(r[0]-s[0],r[1]-s[1]);l<i&&(i=l)}t.set(o,i)}return t}function mo(n,e,t){return Math.max(n*t,e*t/(2*Math.PI))}function _r(n,e){let t=new Map;for(let[o,r]of n){let i=0;for(let[a,s]of r)i=Math.max(i,mo(a,s,e));t.set(o,i)}return t}var Ll=2,Ol=1.4;function zr(n,e,t){if(!e||!(e.requiredPx>0))return n;let o=t?.expandFactor??Ll,r=t?.collapseFactor??Ol,i=e.gapPx/e.requiredPx;return n?i>=r:i>=o}var Ht=te(require("three")),Dr=1.25,vn=class{constructor(){this.ctx=null;this.cfg=null;this.forest={entries:[],order:[],disconnected:[]};this.ring=[];this.pinned=[];this.ownership=null;this.geoNeighboursOf=new Map;this.ringCountByAnchorDepth=new Map;this.lastScale=0;this._repinPending=!1;this.lastWritten=new Map;this.placementAnchors=[];this.lastStoreVersion=-1;this.hiddenSig="";this._mv=new Ht.Matrix4;this._v=new Ht.Vector3;this._scale=new Ht.Vector3}mount(e){this.ctx=e}update(e){let t=!this.cfg||!Fr(this.cfg.geoIds,e.geoIds)||!Fr(this.cfg.nonGeoIds,e.nonGeoIds)||this.cfg.edges!==e.edges;if(this.cfg=e,t){this.forest=Gt(e.geoIds,e.nonGeoIds,e.edges),this.ring=Mr(this.forest),this.ownership=Bt(this.forest,e.edges),this.geoNeighboursOf=Gl(this.forest,e.geoIds),this.ringCountByAnchorDepth=new Map;for(let r of this.ring){let i=this.ringCountByAnchorDepth.get(r.anchorId);i||(i=new Map,this.ringCountByAnchorDepth.set(r.anchorId,i)),i.set(r.depth,(i.get(r.depth)??0)+1)}this.lastWritten.clear();let o=new Set;for(let r of this.geoNeighboursOf.values())for(let i of r)o.add(i);for(let r of this.ring)o.add(r.anchorId);this.placementAnchors=[...o],this.lastStoreVersion=-1}this.lastScale=0,this._repinPending=!0,this.repin()}expandedHas(e){let t=this.cfg?.expandedAnchors;return t?t.has(e):!0}anchorOf(e){return this.ownership?.primaryAnchorOf.get(e.id)??e.anchorId}repin(){let e=this.ctx?.store;e&&(this.pinned.length&&e.unpinNodes(this.pinned),this.pinned=this.ring.map(t=>t.id),this.pinned.length&&e.pinNodes(this.pinned))}frame(e,t){if(!t.isMapMode||t.sphereRadius!==0||!this.cfg||this.ring.length===0)return!1;let o=t.store.positionProvider?.getPositions?.();if(!o)return!0;let r=this.cfg.ringGapPx??50,{width:i,height:a}=Bl(t);t.camera.updateMatrixWorld(),t.cloudScene.updateMatrixWorld(!1),this._mv.multiplyMatrices(t.camera.matrixWorldInverse,t.cloudScene.matrixWorld);let s=t.camera.projectionMatrix.elements[5],l=t.cloudScene.getWorldScale(this._scale).x||1,u=s*(a/2)*l,c=C=>{let E=t.store.index.getNodeIndex(C);return E==null||E<0?null:E},p=t.store.nodeState?.hidden,d=C=>{if(!p)return!1;let E=c(C);return E!=null&&p[E]>.5},g=t.store.version??0;if(g!==this.lastStoreVersion){this.lastStoreVersion=g;let C="";for(let E of this.placementAnchors)C+=d(E)?"1":"0";C!==this.hiddenSig&&(this.hiddenSig=C,this.lastScale=0,this._repinPending=!0)}let m=C=>(this._v.set(o[C*3],o[C*3+1],o[C*3+2]).applyMatrix4(this._mv),-this._v.z),y=c(this.ring[0].anchorId);if(y==null)return!0;let v=m(y);if(!(v>0))return!1;let h=u/v;if(this.lastScale>0){let C=h/this.lastScale;if(C>1/Dr&&C<Dr)return!1}let b=new Map;for(let C of this.cfg.geoIds){let E=c(C);E!=null&&b.set(C,[o[E*3],o[E*3+1]])}let f=this.cfg.neighbourCap,w=!!this.cfg.onFitMetrics,x=f!=null||w?Er(b):null,S=this.cfg.maxViewportFraction??.25,A=new Map,k=new Map;for(let C of this.ring){let E=this.anchorOf(C),P=c(C.id);if(P==null)continue;let M=this.lastWritten.get(C.id);if(M&&(o[P*3]!==M[0]||o[P*3+1]!==M[1]||o[P*3+2]!==M[2]))continue;if(!this.expandedHas(E)){let H=c(E);if(H==null)continue;let O=o[H*3],U=o[H*3+1];k.set(C.id,[O,U,0]),this.lastWritten.set(C.id,[Math.fround(O),Math.fround(U),0]);continue}if(C.depth===1){let H=(this.geoNeighboursOf.get(C.id)??[]).filter(O=>this.expandedHas(O)&&!d(O));if(H.length>=2){let O=H.map(U=>b.get(U)).filter(U=>U!=null);if(O.length>=2){let[U,q]=Ir(O);k.set(C.id,[U,q,0]),this.lastWritten.set(C.id,[Math.fround(U),Math.fround(q),0]);continue}}}let D=C.anchorId;if(d(D)){let H=(this.geoNeighboursOf.get(C.id)??[]).find(O=>!d(O));H&&(D=H)}let T=c(D);if(T==null)continue;let I=A.get(D);if(I===void 0&&(I=m(T),A.set(D,I)),!(I>0))continue;let _=this.ringCountByAnchorDepth.get(C.anchorId)?.get(C.depth)??1,N=mo(C.depth,_,r),R=S*a*I/u,z=Math.min(N*I/u,R);if(f!=null&&x){let H=x.get(E);H!=null&&Number.isFinite(H)&&(z=Math.min(z,f*H))}let G=o[T*3]+C.dx*z,F=o[T*3+1]+C.dy*z;k.set(C.id,[G,F,0]),this.lastWritten.set(C.id,[Math.fround(G),Math.fround(F),0])}if(w&&x){let C=_r(this.ringCountByAnchorDepth,r),E=new Map;for(let P of b.keys()){let M=c(P);if(M==null)continue;let D=m(M);if(!(D>0))continue;let T=u/D,I=x.get(P),_=I!=null?I*T:1/0;E.set(P,{requiredPx:C.get(P)??0,gapPx:_})}this.cfg.onFitMetrics?.(E)}return k.size&&(t.store.setPositions(k),this._repinPending&&(t.store.pinNodes?.([...k.keys()]),this._repinPending=!1),t.invalidate()),this.lastScale=h,!0}dispose(){let e=this.ctx?.store;e&&this.pinned.length&&e.unpinNodes(this.pinned),this.pinned=[],this.ctx=null}};function Fr(n,e){if(n===e)return!0;if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function Gl(n,e){let t=new Set(e),o=new Map;for(let r of n.entries){if(r.depth!==1)continue;let i=r.parents.filter(a=>t.has(a));i.length&&o.set(r.id,i)}return o}function Bl(n){let{width:e,height:t}=n.getDrawingBufferSize(),o=typeof window<"u"&&window.devicePixelRatio?window.devicePixelRatio:1;return{width:e/o,height:t/o}}function Lr({geoIds:n,nonGeoIds:e,edges:t,ringGapPx:o,expandedAnchors:r,neighbourCap:i,maxViewportFraction:a,onFitMetrics:s}){let l=(0,Nr.useMemo)(()=>({geoIds:n,nonGeoIds:e,edges:t,ringGapPx:o,expandedAnchors:r,neighbourCap:i,maxViewportFraction:a,onFitMetrics:s}),[n,e,t,o,r,i,a,s]);return Tr("geo-ego-ring",()=>new vn,l,[],{frame:!0}),null}var Re=require("react");var Hl=new Map;function Or({geoIds:n,nonGeoIds:e,edges:t,config:o,onExpandedChange:r,getFitMetrics:i}){let a=Yo(),s=(0,Re.useRef)(()=>{}),l=(0,Re.useRef)(()=>new Set),u=(0,Re.useRef)(new Map),c=(0,Re.useRef)(Bt(Gt(n,e,t),t));(0,Re.useEffect)(()=>{c.current=Bt(Gt(n,e,t),t)},[n,e,t]);let p=(0,Re.useCallback)(()=>{let g=c.current.ownedCountByAnchor,m=c.current.primaryAnchorOf,y=new Set,v=f=>n.includes(f)?f:m.get(f)??null,h=o.expandZoom??"never";if(h==="auto"){let f=i?.()??Hl,w=new Map;for(let x of n){if((g.get(x)??0)<=0)continue;let S=zr(u.current.get(x)??!1,f.get(x));w.set(x,S),S&&y.add(x)}u.current=w}else{let f=!1;if(h==="always")f=!0;else if(h==="never")f=!1;else{let w=a?.map?.getZoomLevel?.()??null;f=w!=null&&w>=h}if(f)for(let w of n)(g.get(w)??0)>0&&y.add(w)}let b=o.expandOn??["hover"];if(b.includes("hover")){let f=a?.hover?.get?.();if(f&&f.kind==="node"){let w=v(f.id);w&&y.add(w)}}if(b.includes("click")){let f=a?.selection?.getSelectedNodeIds?.()??[];for(let w of f){let x=v(w);x&&y.add(x)}}return y},[a,n,o.expandZoom,o.expandOn,i]),d=(0,Re.useCallback)(()=>{let g=a?.store;if(!g)return;let m=c.current.primaryAnchorOf,y=p(),v=[],h=[];for(let b of e){let f=m.get(b);f&&!y.has(f)?v.push(b):h.push(b)}v.length&&g.hideNodes(v),h.length&&g.showNodes(h),r(y)},[a,e,r,p]);return(0,Re.useEffect)(()=>{s.current=d,l.current=p,d()},[d,p]),(0,Re.useEffect)(()=>{if(!a)return;let g=0,m=0,y=null,v=120,h=b=>{if(g=requestAnimationFrame(h),b-m<v)return;m=b;let f=Array.from(l.current()).sort().join("|");f!==y&&(y=f,s.current())};return g=requestAnimationFrame(h),()=>cancelAnimationFrame(g)},[a]),(0,Re.useEffect)(()=>{if(!a?.events)return;let g=a.events.on("selection:changed",()=>s.current());return()=>g?.()},[a]),(0,Re.useEffect)(()=>()=>{let g=a?.store;g&&e.length&&g.showNodes(e)},[a,e]),null}var se=require("react");var B={Structure:1,Data:2,Style:4,Icons:8,Labels:16,Selection:32,Hover:64,Visibility:128,Pin:256,Position:512,Decorations:1024,All:2047};var Ul=B.Selection|B.Visibility|B.Pin|B.Hover,Vl=B.Selection|B.Visibility|B.Hover,Gr={color:B.Style,size:B.Style,opacity:B.Style,icon:B.Icons,iconUV:B.Icons,imageUV:B.Icons,ringColor:B.Style,flags:Ul,effects:B.Style,collect:B.Decorations,suppressFill:B.Style,shape:B.Style},Br={color:B.Style,width:B.Style,opacity:B.Style,flags:Vl,shape:B.Style,endpoints:B.Structure,flow:B.Style,glow:B.Style,tubeGlow:B.Style},o2=new Map(Object.entries(Gr)),r2=new Map(Object.entries(Br));var i2=Object.keys(Gr),a2=Object.keys(Br);var c2=B.Decorations|B.Structure,d2=B.Style|B.Visibility,p2=B.Decorations|B.Structure|B.Position|B.Style,Hr=B.Structure|B.Style|B.Position|B.Visibility,u2=B.Structure|B.Position|B.Visibility|B.Style|B.Decorations;var ie=te(require("three"));var kt=class{constructor(e,t){this.aabb={minX:-1,maxX:1,minY:-1,maxY:1};this.minimapWidth=e,this.minimapHeight=t}fitAspectRatio(e){let t=this.minimapWidth/this.minimapHeight,o=e.maxX-e.minX,r=e.maxY-e.minY;if(r===0||o===0)return e;if(o/r>t){let a=o/t,s=(e.minY+e.maxY)/2;return{minX:e.minX,maxX:e.maxX,minY:s-a/2,maxY:s+a/2}}else{let a=r*t,s=(e.minX+e.maxX)/2;return{minX:s-a/2,maxX:s+a/2,minY:e.minY,maxY:e.maxY}}}updateBounds(e,t){if(t===0)return this.aabb=this.fitAspectRatio({minX:-1,maxX:1,minY:-1,maxY:1}),this.aabb;let o=1/0,r=1/0,i=-1/0,a=-1/0,s=t*3;for(let c=0;c<s;c+=3){let p=e[c],d=e[c+1];p<o&&(o=p),p>i&&(i=p),d<r&&(r=d),d>a&&(a=d)}if(i-o<2){let c=(o+i)/2;o=c-2/2,i=c+2/2}if(a-r<2){let c=(r+a)/2;r=c-2/2,a=c+2/2}let l=(i-o)*.1,u=(a-r)*.1;return this.aabb=this.fitAspectRatio({minX:o-l,maxX:i+l,minY:r-u,maxY:a+u}),this.aabb}getAABB(){return this.aabb}setAABB(e){this.aabb=this.fitAspectRatio(e)}worldToMinimap(e,t){let{minX:o,maxX:r,minY:i,maxY:a}=this.aabb,s=(e-o)/(r-o)*this.minimapWidth,l=(1-(t-i)/(a-i))*this.minimapHeight;return{px:s,py:l}}minimapToWorld(e,t){let{minX:o,maxX:r,minY:i,maxY:a}=this.aabb,s=e/this.minimapWidth*(r-o)+o,l=(1-t/this.minimapHeight)*(a-i)+i;return{worldX:s,worldY:l}}computeViewportFrame(e){let t=this.worldToMinimap(e.minX,e.maxY),o=this.worldToMinimap(e.maxX,e.minY);return{x:Math.max(0,t.px),y:Math.max(0,t.py),w:Math.min(this.minimapWidth,o.px)-Math.max(0,t.px),h:Math.min(this.minimapHeight,o.py)-Math.max(0,t.py)}}setDimensions(e,t){this.minimapWidth=e,this.minimapHeight=t}};var Rt=Object.freeze([Object.freeze({key:"frame-time",kind:"frame-time"}),Object.freeze({key:"draw-call-count",kind:"draw-call-count"}),Object.freeze({key:"pick-latency",kind:"pick-latency"}),Object.freeze({key:"position-readback-time:layout-position",kind:"position-readback-time",site:"layout-position"}),Object.freeze({key:"position-readback-time:picking",kind:"position-readback-time",site:"picking"}),Object.freeze({key:"position-readback-time:minimap",kind:"position-readback-time",site:"minimap"})]);function bn(n,e){return e?`${n}:${e}`:n}var Ut=600,Ur=30;var vo=class{constructor(e,t,o=Ut){this.writeIndex=0;this.retained=0;this.observed=0;if(!Number.isInteger(o)||o<1)throw new Error(`[perf] SampleBuffer capacity must be a positive integer, received: ${o}`);this.kind=e,this.site=t,this.capacity=o,this.values=new Float64Array(o)}get sampleCount(){return this.retained}get totalObserved(){return this.observed}append(e){return typeof e!="number"||!Number.isFinite(e)?!1:(this.values[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.retained<this.capacity&&this.retained++,this.observed++,!0)}toArrayOldestFirst(){let e=new Array(this.retained),t=this.retained<this.capacity?0:this.writeIndex;for(let o=0;o<this.retained;o++)e[o]=this.values[(t+o)%this.capacity];return e}};function Vr(n=Ut){let e=new Map;for(let t of Rt)e.set(t.key,new vo(t.kind,t.site,n));return e}function Wr(n){let e=n?.info?.render;return e?typeof e.drawCalls=="number"&&Number.isFinite(e.drawCalls)?{value:e.drawCalls,accurate:!0}:typeof e.calls=="number"&&Number.isFinite(e.calls)?{value:e.calls,accurate:!1}:null:null}function jr(n){return n.accurate?"accurate":"approximate"}var yn=class{constructor(e){this.pending=null;this.claimed=null;this.sequence=0;this.now=e}nextCorrelationId(){return this.sequence++,`pick-${this.sequence}`}markStart(e){let t=this.now();if(!Number.isFinite(t))return null;let o=e??this.nextCorrelationId();return this.pending={correlationId:o,startedAt:t},o}claim(){return this.pending?(this.claimed=this.pending,this.pending=null,!0):!1}settle(){let e=this.claimed;if(!e)return null;this.claimed=null;let t=this.now();return Number.isFinite(t)?{correlationId:e.correlationId,value:t-e.startedAt}:null}get hasPending(){return this.pending!==null}get hasClaimed(){return this.claimed!==null}};function Wl(n){n.sort((t,o)=>t-o);let e=Math.ceil(.95*n.length);return n[Math.min(n.length,Math.max(1,e))-1]}function qr(n){let e={kind:n.kind,sampleCount:n.sampleCount,totalObserved:n.totalObserved};if(n.site!==void 0&&(e.site=n.site),n.sampleCount===0)return e;let t=n.toArrayOldestFirst(),o=0,r=Number.NEGATIVE_INFINITY;for(let i=0;i<t.length;i++)o+=t[i],t[i]>r&&(r=t[i]);return e.mean=o/t.length,e.max=r,e.p95=Wl(t),e}function jl(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Number.NaN}var xn=class{constructor(e={}){this.channels=new Map;this.loggedReasons=new Set;this.renderFaultsSource=null;this.collecting=!0;this.frameCounter=0;this.pathId="webgl";this.drawCallAccuracyValue="unknown";this.nowFn=e.now??jl,this.suspendThreshold=e.suspendThreshold??Ur,this.warnFn=e.warn??(t=>console.warn(t)),this.buffers=Vr(e.capacity??Ut);for(let t of Rt)this.channels.set(t.key,{kind:t.kind,site:t.site,buffer:this.buffers.get(t.key),state:"active",consecutiveFailures:0,suspendReason:null,lastFrameId:-1});this.pickTracker=new yn(this.nowFn)}get collectionEnabled(){return this.collecting}setCollectionEnabled(e){this.collecting=e}get frameId(){return this.frameCounter}beginFrame(){return this.frameCounter++,this.frameCounter}get activePathId(){return this.pathId}setActivePathId(e){this.pathId=e}get drawCallAccuracy(){return this.drawCallAccuracyValue}now(){return this.nowFn()}frameTimeStart(){return this.nowFn()}readbackStart(){return this.nowFn()}recordFrameTime(e){let t=this.channels.get("frame-time");if(!this.canCollect(t)||t.lastFrameId===this.frameCounter)return;let o=this.nowFn();if(!Number.isFinite(e)||!Number.isFinite(o)){this.noteFailure(t,"clock-unavailable");return}this.append(t,o-e)&&(t.lastFrameId=this.frameCounter)}recordDrawCalls(e){let t=this.channels.get("draw-call-count");if(!this.canCollect(t)||t.lastFrameId===this.frameCounter)return;let o=Wr(e);if(o===null){this.noteFailure(t,"counter-unreadable");return}this.drawCallAccuracyValue=jr(o),this.append(t,o.value)&&(t.lastFrameId=this.frameCounter)}recordReadback(e,t){let o=this.channels.get(bn("position-readback-time",e));if(!this.canCollect(o))return;let r=this.nowFn();if(!Number.isFinite(t)||!Number.isFinite(r)){this.noteFailure(o,"clock-unavailable");return}this.append(o,r-t)}recordReadbackDuration(e,t){let o=this.channels.get(bn("position-readback-time",e));if(this.canCollect(o)){if(!Number.isFinite(t)){this.noteFailure(o,"clock-unavailable");return}this.append(o,t)}}markPickStart(e){let t=this.channels.get("pick-latency");this.canCollect(t)&&this.pickTracker.markStart(e)===null&&this.noteFailure(t,"clock-unavailable")}claimPickStart(){let e=this.channels.get("pick-latency");this.canCollect(e)&&this.pickTracker.claim()}settlePickLatency(){let e=this.channels.get("pick-latency");if(!this.canCollect(e))return;let t=this.pickTracker.settle();t!==null&&this.append(e,t.value)}get pickLatencyTracker(){return this.pickTracker}setRenderFaultsSource(e){this.renderFaultsSource=e}renderFaults(){let e={total:0,lostCount:0,compileFailedCount:0,lastOccurredAt:null,permanentlyFellBack:!1,failedEngineShaderCount:0,failedHostShaderLayerIndices:[]};if(!this.renderFaultsSource)return e;try{let t=this.renderFaultsSource();return{...t,failedHostShaderLayerIndices:[...t.failedHostShaderLayerIndices]}}catch{return e}}noteEntryPointFailure(e,t,o){try{let r=this.channels.get(bn(e,t));if(!r||r.state!=="active")return;this.noteFailure(r,o)}catch{}}summaries(){let e=[];for(let t of Rt)e.push(qr(this.channels.get(t.key).buffer));return e}channelHealth(){let e=[];for(let t of Rt){let o=this.channels.get(t.key),r={kind:o.kind,state:o.state,consecutiveFailures:o.consecutiveFailures,suspendReason:o.suspendReason};o.site!==void 0&&(r.site=o.site),e.push(r)}return e}canCollect(e){return this.collecting&&e.state==="active"}append(e,t){let o=!1;try{o=e.buffer.append(t)}catch{o=!1}return o?(this.noteSuccess(e),!0):(this.noteFailure(e,"buffer-write-failed"),!1)}noteFailure(e,t){if(e.consecutiveFailures++,!this.loggedReasons.has(t)){this.loggedReasons.add(t);let o=e.site?`:${e.site}`:"";this.warnFn(`[perf] collection failed (${t}); first seen on channel ${e.kind}${o}. This reason is reported once per session; see channel health for the full picture.`)}e.state==="active"&&e.consecutiveFailures>=this.suspendThreshold&&(e.state="suspended",e.suspendReason=t)}noteSuccess(e){e.consecutiveFailures=0}};var Kr="__kinevizPerf";function ql(n){return{readAt:n.now(),activePathId:n.activePathId,collectionEnabled:n.collectionEnabled,drawCallAccuracy:n.drawCallAccuracy,summaries:n.summaries(),channelHealth:n.channelHealth(),renderFaults:n.renderFaults()}}function Kl(n){return Object.freeze({read:()=>ql(n),setCollectionEnabled:e=>n.setCollectionEnabled(!!e)})}function Yr(n,e=globalThis){let t=Kl(n);try{e[Kr]=t}catch{}return t}var wn=new xn;Yr(wn);function Xr(){try{return wn.readbackStart()}catch{return Number.NaN}}function $r(n,e){try{wn.recordReadback(n,e)}catch{wn.noteEntryPointFailure("position-readback-time",n,"buffer-write-failed")}}function Zr(n,e){let{width:t,height:o,bytesPerPixel:r,bytesPerRow:i,orientation:a}=e;if(t<=0||o<=0)return new Uint8Array(0);let s=t*r;if(i<s)throw new RangeError(`normalizeReadback: bytesPerRow ${i} cannot hold a ${s}-byte row`);let l=new Uint8Array(s*o);for(let u=0;u<o;u++){let p=(a==="bottom-left"?o-1-u:u)*i,d=Math.min(s,n.length-p);d<=0||l.set(n.subarray(p,p+d),u*s)}return l}var Vt=class Vt{constructor(e,t,o,r,i,a,s){this._positionProvider=null;this._dirty=!0;this._disposed=!1;this._inflight=null;this._readyImage=null;this._readSeq=0;this._frameCount=0;this._layoutThrottleInterval=1;this._is3D=!1;this._hiddenMeshes=[];this._savedResolutions=[];this._savedNodeScales=[];this._savedEdgeUniforms=null;this.renderer=e,this.scene=t,this.cloudScene=o,this.mainCamera=r,this.store=i,this.control=a,this.config=s,this.readbackOrientation=s.readbackOrientation??"bottom-left",this.readPixelsAsync=s.readPixelsAsync??((c,p,d,g,m,y)=>this.renderer.readRenderTargetPixelsAsync(c,p,d,g,m,y));let l=Math.round(s.width*Math.min(s.dpr,2)),u=Math.round(s.height*Math.min(s.dpr,2));this.renderTarget=new ie.WebGLRenderTarget(l,u,{minFilter:ie.NearestFilter,magFilter:ie.NearestFilter,format:ie.RGBAFormat}),this.minimapCamera=new ie.OrthographicCamera(-1,1,1,-1,.01,500),this.minimapCamera.position.set(0,0,80),this.minimapCamera.lookAt(0,0,0),this.pixelBuffer=new Uint8Array(l*u*4),this.imageData=new ImageData(l,u),this.mapper=new kt(s.width,s.height)}markDirty(){this._dirty=!0}hasPendingReadback(){return this._inflight!==null||this._readyImage!==null}setPositionProvider(e){this._positionProvider=e,this.markDirty()}setIsDark(e){this.config.isDark!==e&&(this.config.isDark=e,this.markDirty())}setIs3D(e){this._is3D!==e&&(this._is3D=e,this.markDirty())}setLayoutRunning(e){this._layoutThrottleInterval=e?5:1}frameUpdate(){if(this._disposed)return null;if(this._frameCount++,this._readyImage){let c=this._readyImage;return this._readyImage=null,this._dirty&&this.requestFrameSoon(),c}if(this._frameCount%this._layoutThrottleInterval!==0&&!this._dirty||this._inflight||!this._dirty)return null;this._dirty=!1;let t=(this._positionProvider??this.store.positionProvider)?.getPositions?.();if(!t)return null;let o=this.store.nodeCount;this._is3D?this.updateRotatedBounds(t,o):this.mapper.updateBounds(t,o);let r=this.mapper.getAABB();this.updateCamera(r),this.hideTextLayers(),this.disableEdgeShortening(r),this.overrideResolutionForMinimap(r);let i=this.cloudScene.position.clone(),a=this.cloudScene.rotation.clone();this.cloudScene.position.set(0,0,0),this._is3D||this.cloudScene.rotation.set(0,0,0),this.cloudScene.updateMatrixWorld(!0);let s=this.renderer.getClearColor(new ie.Color),l=this.renderer.getClearAlpha(),u=this.config.isDark?1315860:16316666;return this.renderer.setClearColor(u,1),this.renderer.setRenderTarget(this.renderTarget),this.renderer.clear(),this.renderer.render(this.scene,this.minimapCamera),this.renderer.setRenderTarget(null),this.renderer.setClearColor(s,l),this.cloudScene.position.copy(i),this.cloudScene.rotation.copy(a),this.cloudScene.updateMatrixWorld(!0),this.restoreResolution(),this.restoreHiddenLayers(),this.restoreEdgeShortening(),this.startReadback(),null}startReadback(){let e=this.renderTarget.width,t=this.renderTarget.height,o=++this._readSeq,r=Xr();this._inflight=this.readPixelsAsync(this.renderTarget,0,0,e,t,this.pixelBuffer).then(i=>{try{if($r("minimap",r),this._disposed||o!==this._readSeq||i===void 0)return;this.imageData.data.set(Zr(i,{width:e,height:t,bytesPerPixel:4,bytesPerRow:e*4,orientation:this.readbackOrientation})),this._readyImage=this.imageData}catch{}finally{o===this._readSeq&&(this._inflight=null),this.afterReadbackSettled()}},()=>{o===this._readSeq&&(this._inflight=null),this.afterReadbackSettled()})}afterReadbackSettled(){this._disposed||this._inflight||(this._readyImage||this._dirty)&&this.config.requestFrame?.()}requestFrameSoon(){let e=this.config.requestFrame;e&&queueMicrotask(()=>{this._disposed||e()})}computeVisibleViewport(){let e=this.control.getFullPosition(),t=this.mainCamera.fov*Math.PI/180,o=Math.max(this.mainCamera.position.z-e.z,.001),r=Math.tan(t/2)*o,i=r*this.mainCamera.aspect,a=-e.x,s=-e.y;return{minX:a-i,maxX:a+i,minY:s-r,maxY:s+r}}updateCamera(e){this.minimapCamera.left=e.minX,this.minimapCamera.right=e.maxX,this.minimapCamera.top=e.maxY,this.minimapCamera.bottom=e.minY,this.minimapCamera.updateProjectionMatrix()}hideTextLayers(){this._hiddenMeshes=[],this.cloudScene.traverse(e=>{if(!(!e.visible||e===this.cloudScene)){if(e instanceof ie.LineSegments){e.visible=!1,this._hiddenMeshes.push(e);return}if(e instanceof ie.Mesh&&e.name==="GPUEdgeRenderer_arrows"){e.visible=!1,this._hiddenMeshes.push(e);return}if(e instanceof ie.Mesh&&e.renderOrder>=2){e.visible=!1,this._hiddenMeshes.push(e);return}}})}restoreHiddenLayers(){for(let e of this._hiddenMeshes)e.visible=!0;this._hiddenMeshes=[]}static minimapNodeScale(e,t,o,r,i){if(!(t>0)||!(r>0)||!(i>0))return 1;let a=100*Math.tan(e*Math.PI/360)/t,s=o/r;return a*s/(50/i)}overrideResolutionForMinimap(e){this._savedResolutions=[],this._savedNodeScales=[];let t=e.maxY-e.minY,o=this.minimapCamera.position.z;this.cloudScene.traverse(r=>{if(!(r instanceof ie.Mesh)||r.renderOrder!==1||r.name)return;let i=r.material;if(!i?.uniforms?.resolution)return;let a=i.uniforms.resolution,s=a.value.y;this._savedResolutions.push({uniform:a,saved:a.value.clone()});let l=i.uniforms.nodeSizeScale;l&&(this._savedNodeScales.push({uniform:l,saved:l.value}),l.value*=Vt.minimapNodeScale(this.mainCamera.fov,s,this.config.height,t,o)),a.value.set(this.config.width,this.config.height)})}restoreResolution(){for(let{uniform:e,saved:t}of this._savedResolutions)e.value.copy(t);for(let{uniform:e,saved:t}of this._savedNodeScales)e.value=t;this._savedResolutions=[],this._savedNodeScales=[]}disableEdgeShortening(e){this.cloudScene.traverse(t=>{if(t instanceof ie.Mesh&&t.name==="GPUEdgeRenderer_edges"){let r=t.material.uniforms;r?.arrowLengthWorld&&r?.nodeSizeScale&&r?.lineWidthScale&&(this._savedEdgeUniforms={arrowLength:r.arrowLengthWorld.value,nodeSizeScale:r.nodeSizeScale.value,lineWidthScale:r.lineWidthScale.value},r.arrowLengthWorld.value=0,r.nodeSizeScale.value=0,r.lineWidthScale.value=r.lineWidthScale.value*Vt.MINIMAP_EDGE_WIDTH_FACTOR)}})}restoreEdgeShortening(){if(!this._savedEdgeUniforms)return;let e=this._savedEdgeUniforms;this.cloudScene.traverse(t=>{if(t instanceof ie.Mesh&&t.name==="GPUEdgeRenderer_edges"){let r=t.material.uniforms;r?.arrowLengthWorld&&r?.nodeSizeScale&&r?.lineWidthScale&&(r.arrowLengthWorld.value=e.arrowLength,r.nodeSizeScale.value=e.nodeSizeScale,r.lineWidthScale.value=e.lineWidthScale)}}),this._savedEdgeUniforms=null}updateRotatedBounds(e,t){if(t===0){this.mapper.updateBounds(e,t);return}let o=new ie.Matrix4;o.makeRotationFromEuler(this.cloudScene.rotation);let r=new ie.Vector3,i=1/0,a=1/0,s=-1/0,l=-1/0,u=t*3;for(let g=0;g<u;g+=3)r.set(e[g],e[g+1],e[g+2]),r.applyMatrix4(o),r.x<i&&(i=r.x),r.x>s&&(s=r.x),r.y<a&&(a=r.y),r.y>l&&(l=r.y);let c=2;if(s-i<c){let g=(i+s)/2;i=g-c/2,s=g+c/2}if(l-a<c){let g=(a+l)/2;a=g-c/2,l=g+c/2}let p=(s-i)*.1,d=(l-a)*.1;this.mapper.setAABB({minX:i-p,maxX:s+p,minY:a-d,maxY:l+d})}dispose(){this._disposed=!0,this._inflight=null,this._readyImage=null,this.renderTarget.dispose()}};Vt.MINIMAP_EDGE_WIDTH_FACTOR=1/15/.16;var Sn=Vt;var Ve=require("react");var Ae=require("react/jsx-runtime");function Qr({width:n,height:e,pixelWidth:t,pixelHeight:o,position:r,margin:i,mapper:a,control:s,viewportFrame:l,collapsed:u,onToggleCollapse:c,zoomPercent:p,onFitToScreen:d,onResetZoom:g,cameraZ:m}){let y=(0,Ve.useRef)(null),v=(0,Ve.useRef)(null),h=(0,Ve.useRef)(null),b=(0,Ve.useRef)(a);b.current=a;let f=(0,Ve.useRef)(s);f.current=s;let w=(0,Ve.useRef)(l);w.current=l;let x=(0,Ve.useRef)(m);x.current=m;let S={position:"absolute"};r==="bottom-right"?(S.bottom=i,S.right=i):r==="bottom-left"?(S.bottom=i,S.left=i):(S.top=i,S.right=i);let A={...S};return(0,Ve.useEffect)(()=>{let k=y.current;if(!k)return;let C=(I,_)=>{let{worldX:N,worldY:R}=b.current.minimapToWorld(I,_);f.current.setPosition(-N,-R)},E=I=>{if(I.stopPropagation(),I.button!==0)return;let _=v.current?.getBoundingClientRect();if(!_)return;let N=I.clientX-_.left,R=I.clientY-_.top,z=w.current;N>=z.x&&N<=z.x+z.w&&R>=z.y&&R<=z.y+z.h?h.current={mode:"frame",startX:I.clientX,startY:I.clientY}:(h.current={mode:"background",startX:I.clientX,startY:I.clientY},C(N,R))},P=I=>{if(!h.current||!v.current)return;let _=v.current.getBoundingClientRect();if(h.current.mode==="frame"){let N=I.clientX-h.current.startX,R=I.clientY-h.current.startY;h.current.startX=I.clientX,h.current.startY=I.clientY;let z=b.current.getAABB(),G=N/n*(z.maxX-z.minX),F=-(R/e)*(z.maxY-z.minY);f.current.pan(-G,-F)}else{let N=I.clientX-_.left,R=I.clientY-_.top;C(N,R)}},M=()=>{h.current=null},D=I=>{I.stopPropagation(),I.preventDefault();let _=f.current.getZoom(),N=Math.abs(x.current-_)+.5,R=(I.deltaY>0?-1:1)*N*.1;f.current.setZoom(_+R)};k.addEventListener("mousedown",E),k.addEventListener("wheel",D,{passive:!1}),document.addEventListener("mousemove",P),document.addEventListener("mouseup",M);let T=I=>I.stopPropagation();return k.addEventListener("contextmenu",T),k.addEventListener("pointerdown",T),()=>{k.removeEventListener("mousedown",E),k.removeEventListener("wheel",D),k.removeEventListener("contextmenu",T),k.removeEventListener("pointerdown",T),document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",M)}},[n,e]),(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("div",{className:"minimap-toggle-btn",style:A,onClick:c,title:u?"Show minimap":"Hide minimap",children:u?"\u25A3":"\u25A1"}),(0,Ae.jsxs)("div",{ref:y,className:`minimap-container${u?" collapsed":""}`,style:{...S,width:n,height:e,cursor:"crosshair"},"data-testid":"minimap",children:[(0,Ae.jsx)("canvas",{ref:v,className:"minimap-canvas",width:t,height:o,style:{width:n,height:e}}),l.w>0&&l.h>0&&(0,Ae.jsx)("div",{className:"minimap-viewport-frame",style:{left:l.x,top:l.y,width:l.w,height:l.h}}),(0,Ae.jsxs)("div",{className:"minimap-controls",children:[(0,Ae.jsx)("button",{className:"minimap-ctrl-btn",title:"Zoom out",onMouseDown:k=>k.stopPropagation(),onClick:()=>{let k=s.getZoom(),C=Math.abs(m-k)+.5;s.setZoom(k-C*.2)},children:"-"}),(0,Ae.jsxs)("button",{className:"minimap-ctrl-zoom",title:"Reset zoom to 100%",onMouseDown:k=>k.stopPropagation(),onClick:()=>g(),children:[Math.round(p),"%"]}),(0,Ae.jsx)("button",{className:"minimap-ctrl-btn",title:"Zoom in",onMouseDown:k=>k.stopPropagation(),onClick:()=>{let k=s.getZoom(),C=Math.abs(m-k)+.5;s.setZoom(k+C*.2)},children:"+"}),(0,Ae.jsx)("button",{className:"minimap-ctrl-btn",title:"Fit all nodes",onMouseDown:k=>k.stopPropagation(),onClick:d,children:"\u22A1"})]})]})]})}function Jr(n,e={}){let{cameraZ:t=3,fov:o=42,padding:r=1.5,aspect:i=16/9}=e,a=n.length/3;if(a===0)return[0,0,-15];let s=1/0,l=-1/0,u=1/0,c=-1/0;for(let x=0;x<a;x++){let S=n[x*3],A=n[x*3+1];isFinite(S)&&isFinite(A)&&(s=Math.min(s,S),l=Math.max(l,S),u=Math.min(u,A),c=Math.max(c,A))}if(!isFinite(s))return[0,0,-15];let p=(s+l)/2,d=(u+c)/2,g=(l-s)*r,m=(c-u)*r,y=o/2*Math.PI/180,v=Math.tan(y),h=m>0?m/(2*v):1,b=g>0?g/(2*v*i):1,f=Math.max(b,h,.5),w=t-f;return[-p,-d,Math.max(-1e3,w)]}var ti=require("react/jsx-runtime");function ei({width:n=180,height:e=180,position:t="bottom-right",margin:o=12,defaultVisible:r=!0,positionProvider:i}){let{renderer:a,scene:s,cloudScene:l,camera:u,control:c,store:p,container:d,registerFrameCallback:g,invalidate:m}=Ge(),y=rn(),{is3D:v}=an(),h=Uo(),b=Wo(),f=jo(),w=h.isDark,x=(0,se.useRef)(null),S=(0,se.useRef)(m);S.current=m;let[A,k]=(0,se.useState)(!r),C=(0,se.useRef)({x:0,y:0,w:0,h:0}),[E,P]=(0,se.useState)({x:0,y:0,w:0,h:0}),[M,D]=(0,se.useState)(100),T=(0,se.useRef)(null),I=Math.min(window.devicePixelRatio,2),_=Math.round(n*I),N=Math.round(e*I),R=(0,se.useRef)(new kt(n,e)),z=qo(Hr);(0,se.useEffect)(()=>{if(!a||!c)return;let O=new Sn(a,s,l,u,p,c,{width:n,height:e,dpr:window.devicePixelRatio,isDark:w,requestFrame:()=>S.current()});x.current=O,R.current=O.mapper;let U=()=>O.markDirty();return c.onChange(U),()=>{c.offChange(U),O.dispose(),x.current=null}},[a,s,l,u,p,c,n,e]),(0,se.useEffect)(()=>{x.current?.setIsDark(w)},[w]),(0,se.useEffect)(()=>{x.current?.setIs3D(v)},[v]);let G=i??f??null;(0,se.useEffect)(()=>{x.current?.setPositionProvider(G)},[G]),(0,se.useEffect)(()=>{x.current?.markDirty(),m()},[z,m]),(0,se.useEffect)(()=>{let O=x.current;if(!O||!b)return;let U=setInterval(()=>{O.setLayoutRunning(!b.isFinish)},200);return()=>clearInterval(U)},[b]),(0,se.useEffect)(()=>{if(A||y){g("minimap",null);return}return g("minimap",()=>{let O=x.current;if(!O||!d)return;let U=O.computeVisibleViewport(),q=O.mapper.computeViewportFrame(U);if(c){let he=c.getZoom();T.current===null&&he<=-.1&&(T.current=he);let gt=T.current??he,xt=Math.round(gt/Math.min(he,-.1)*100);D(Math.max(1,xt))}let Se=C.current;(Math.abs(q.x-Se.x)>1||Math.abs(q.y-Se.y)>1||Math.abs(q.w-Se.w)>1||Math.abs(q.h-Se.h)>1)&&(C.current=q,P(q));let ge=O.frameUpdate();if(ge){let he=d.querySelector(".minimap-canvas")?.getContext("2d");he&&he.putImageData(ge,0,0)}}),()=>g("minimap",null)},[A,y,v,g,d]),(0,se.useEffect)(()=>{let O=U=>{if(U.key==="m"||U.key==="M"){let q=U.target?.tagName;if(q==="INPUT"||q==="TEXTAREA"||q==="SELECT"||U.ctrlKey||U.metaKey||U.altKey)return;k(Se=>!Se)}};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[]);let F=(0,se.useCallback)(()=>{if(!c)return;let U=(x.current?x.current._positionProvider??p.positionProvider:p.positionProvider)?.getPositions?.();if(!U)return;let q=Jr(U,{cameraZ:u.position.z,fov:u.fov});c.setPosition(q[0],q[1]),c.setZoom(q[2])},[c,p,u]),H=(0,se.useCallback)(()=>{c&&(c.setPosition(0,0),c.setZoom(T.current??c.getZoom()))},[c]);return y||!c?null:(0,ti.jsx)(Qr,{width:n,height:e,pixelWidth:_,pixelHeight:N,position:t,margin:o,mapper:R.current,control:c,viewportFrame:E,collapsed:A,onToggleCollapse:()=>k(O=>!O),zoomPercent:M,onFitToScreen:F,onResetZoom:H,cameraZ:u.position.z})}var Hi=require("react");var oe=require("react"),Ni=te(require("@radix-ui/react-tooltip"));var De=require("react"),wi=te(require("clsx"));var ni=te(require("react")),je=te(require("@radix-ui/react-tooltip")),oi=te(require("clsx"));var Yl={maximize:61441,"zoom-in":61442,"zoom-out":61443,"2d":61444,"3d-rotation":61445,"account-tree":61446,"all-inclusive":61447,"alt-route":61448,"bubble-chart":61449,"camera-alt":61450,category:61451,"center-focus-strong":61452,"close-fullscreen":61453,contrast:61454,"delete-forever":61455,delete:61456,"deployed-code":61457,"filter-alt":61458,"flip-to-back":61459,"fork-right":61460,"grid-on":61461,"horizontal-rule":61462,hub:61463,"linear-scale":61464,map:61465,"open-in-full":61466,palette:61467,"radio-button-unchecked":61468,redo:61469,refresh:61470,route:61471,share:61472,"sports-volleyball":61473,tag:61474,"trending-up":61475,undo:61476,"visibility-off":61477,visibility:61478,"fit-view":61479,"view-2d":61480,"view-3d":61481,"link-off":61482,"push-pin":61483},Xl="data:font/woff2;base64,d09GMgABAAAAABEwAAsAAAAAIdgAABDhAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACHPAqtZKZoATYCJAOBMAtaAAQgBYN+B4Q/Gz4dRUaGjQNAgf9kIyo1jez/8sB2TIMiTJo0YUvvqTt5yDPphcXuWlF6NeHqtO0Ts2n0JIoAzfQXoDYs2nGSQNxbHf16KCVE/bJfz9vZkO72QgxCIWQOisIn9RUyeyTCQPmokDiMH+Hg4eX2f263fbFFFFhbhoElVyMLUgra3l4ADE/b/IcszP3BihjWIU5OogyqTLDuPcQEG91vXRRn5SL63a8I4FfEvVfNL6XMHhauJFvenuz5ZccSsslhoYfQtUVdlZx5lAaOuHpCsOwlmGdME7d2u8AVEd5doAPIAM7y8Py9E/6/BA+Ate+7jUUT5GvZEs10WAFmFiF2tVZaRiFDQsie2aPZPeDKHPF+cMK7j6RD5Ei9S3gekFVIJcLEvf2oCJM4Ee0Cua3O4q+LBkYdY6t25LhIMYhtMBJ1jLr//gYBibNL3P71kYTSgX/+DF3KvRecTuXgbyohelrSiEpEkyDpx/zFLj7c1bwAn8Tv5W+NAY6f3CdXn72dh98/MrK8w0NtqfLGee2ADzywt2wtd/Tmi6dGe1ES3Ua9Jo+VwHYsaxJ27P5rHtQ4YmdrY21laWFuZmpibGRooKero62lqa6qoqwkl0klYpGQ8vQFfA0FpOMeZwC3QLODiQ81mAtEegAC007S9AG2sAA2sBDWsAhWsBiWsAQWsBTmsAxmsBymsBJMYGUYwwoYwSowhFVhAKtBD1aHLqwBHVgT2rBWQLINQVR2IMieXQiqyB4EVWcfoAwbQAk2hBw2ggw2hhQ2gQQ2hRg2gwg2hxC2AIUtwYOtAjtyDRDANuDDttCA7RoKsGDfwl3gLZz9gfGf246nSrKN4pbyueCIEfxTV/UjupcjnxTfGamqgENvSnALcAQhxGvlqllmtTyvFdWwnam6VtrXRhyGyeCk+TGOm8141cjy0TAeMwnCIGhqVYfrPNdCD0jjbawSIcfa0uCFjZIsamRhwnAeqM8gw0XZ8xKf1nqOGPsYQpe35k39aZdXUaHj/MXU/GrU3hAmjm0YBlFELnnxLIBfVtk4NknioigIQ0WASfI0GgRpdERAvpVhKKOII6eTRMexikuSjVFk95eDlQN3tGZWD3+4jUGtZdIfWslTVXz/fvhY1j7Iaf7y70KugaQMufM8jbnIwmgW6fYcq1XnoBBm6F7d5e7mjgGAvuEu2W6LngMIpSaOFi9Q+vaTS37O3Zq95dZ/6jTBZ8rLqKUP98jxTsTlTfQPS5X/XPM3nPIFijaUAQL2hbYASOeVKBoF5Qz4DbAZ9fbjSRGGr/HYm0sFmGiuCWWsqDE6K9VKxOLcQ7JZKJLkTRXqptFzOmIl6x4YFOmei42HlVh4eeVxNbh6jzD4h32pqtlcql4gTBA+V0AJKxaxo6LkXq1EQBMxjO+uB8f2hrlZIefxjQ1DKM2AY+Dh+8mbVWuPjg1WzxWa/qqDebtoltzCP4to69ojUV8dw+EwRA6552csMpPybyAMp52TO4Xv77TYEfYSG4rmUnRaMYj+3f8Icn2mF9O2O+ghguCRfQTyXrZxM8IeruYyAbklsyjMEpFLElGYMW9lIJjXModyuNpPpTk/qP1842cAAf8gbyQqSwnSgn4mEAfln5FK1tSABrV0PsC6vl7caupKVIr/QSB3sAIVe+rzvTGulsj0O2+HMNIpCbSvD2HGjp5lBGKv9pd/+3b/AjYdhiza7eFgZGfIYpep8QBqkdsbM6O7/mjXINlHoeMoAsuEQWbM8hxk/aw9hja4Tjl30xJ649t0ZyDf9J3w+MECFgE7XyhzJCmvbhQASdZKClNPBDgheEctECQDvQ8bxdwU4uX9d86bOXQ9PCaEaeudxXIC9DKCSr8sd0u23MtM+X7IXQfLOeYmPRX8JtjgFczaG0L1Q6BSOc+P2Bs8pesTqeL65qZO043tDY1+RWX1v96mqQrdkIwMk2XyUMMry1/Bl1IhJ7RDfsn6c8mfKfmFLo5oxTTqdOv46c/PczrF3+SVTNltl/nOsaGXI/3GI6SMP6xLfbskMXGcRyCByhe1JBxgJx8LTd7sNhZtRFEoans9cXDrVySJX1lcdL2dBRnFWFngL1Ngd0fN2J7bGQmGt3/MpNJMgL7E4XtQRLXNNSlKlAsWL1xL9eRA8btR5cmHq2btaGKi+WL2Z6z5R+n7xs5PBT3kZCM/2fiaVc+4kIrx6OzrQXIzF69KhPs5UF8vtUZLzCbatlHGhlfQ9j45ms9PGO9A9LQ+3TT0bXifJNm9vSXIL7/c8MlgrrrdoPaDWmjUfXv0XAPt7gOvUB/3FI0agWZnBNIiPeGoR4DbQIApguo4VhgteebeNnufhBURbd5oe/ece+2sxl6sx/ZC610PpMEZdrVnz6ZdOvHYM8LUIX49Xi6XlCQ6oRwcUDeS3MBAkvou2WChvYvrhRlkJV+vJ7dw8XNqFmZ00b/l5OJ8emP3mV5stbePMtOCUGmXQl/CDKaWBO0BdzZKjZ+Ec+77LbdFW1W5Y0flQYHFg2oWVbqW3BomJx77PhbXB7S6QCTKArqIQQvwUQS0J2JxMg5SnjdchpAEPsjm2iNt65rzZ3dJWwsONHzdvvZyQ99KY7ikJDwosGVQ1SyliNMir+i0N/QCNhajtnHdZ9u2ddQrN6ZMa5+usU7S3Nw2MhgOERW1Aws5zi4SDhILC+iXX+7IcTiUGYToNJHxcTvj6jy2on7RPzG+NFd0hgCx5dgWY+/q31f3mGJbqgqrLgp6jZw979+jvtz5xMWLT5wb1Pdc6gDRKMgKTKFPD1bihmpJ+drHDx+i6cNH4g3jlipn5r/t/atdXTmSxu2zDbJAPsBsKPzyyxibzPezLMbp6eEwAIZ6iDD2esTcBi8fUcfxmMEOY6i4OGTs+HLCfHGouMP45c3qTzRyK5NHK79Z75h7Xjkq35rWpPf02+YldtdthrLUxq27exbzSc/12b8ZqaxK5t73/Q68uw8M+Hbnmz5zQa/l2z0f7IjYDGVpQcX9/baBVMeuPhP4bPWbVx5YNJX+wOyaF2efmZvEAWydyq66RSPQFN7k0PbLQMIz3jNCIkNdeLPzC6G7QK1TdatlWY6QdtNCl2AYKBpIKa+M+SdYQm3yRUrpUyh8qsKDrc5zvxxlfjnn9F0sVCl8PsWbrOp+/kVfPnO0qPXganj9YsrgNngMEPz4I7tN5271K6oLC31K/30Cw529X9Hq92Q7s9uv51cE+WXVIXmRZ8jtHpoJiL8qHv2nrxFTU3I50PDNTxwsqQUdgfwG2fbZtY2dK1d5268cs1Raxqj44ZtpGnPb9Wz56b40Rboi3df9fTcDARyNy/lT0ik+Du3y+DhUQJbER8gkiBkqi0f3BXVIq0W64CsCj420QV2f2K1bJBBTompjuHSqjtGiq9FWo8Kgsj4qoopQUBS5u7CIMkA0vO77xZ0iG6huLL5LDMZBQUkSCeHsLMazs2JAkMylSZhIQErOHDxxCtKjxxCiBCRB0e106JNGNvhjbXhL8njK/SkXqV8wG/xXcwOxENdh6WNmqaLYi99rsnVZjKUzdYLOy20QJsPBsbG7ywcc1yZjrI3l/OXiBgJZaCgUqqhgsOeZZ4E+aSDb9fy251328K2yJemPGB9Jl9ziYbhI6Vco/C0CW1oUUeDOWeNb1eRXQgyVARfeQwIsxwgDQwODpTypP9TZuJyUQzmQR6NSBQTcVSJPkacLvV8fEeEGOL5+4gPpbLbzZXMkP9fXOwz78H58xrN4H0l5ICUUmpmeOR96bjDi4iyqzkfaqbRB2FG7NXCAJnjS/jE2ujrlmu633xIOrPr9vdBqQMUSkI7HaZigMzoRTRlVEKfAUH/sC9JSHkEjmsghKKULYgH6EOzFOgMN5zICCKQ18LYcLxnwpnjI7x/8atokOGdOr0+vPreuc0I4jmNxiiZkl/c/jAIWsDGCRyCiBCB6GQKIWXhdpOBI4sgBiKAp1ffy/U3BNDwf4aam54MUOtD0yuVY7bMICKa2aoWHAYwoTwGMt1+dnj43h9AGQoevnz2e/ArEMOh4ZvosAyEaqJm2KD6+FCLA4j6mjXIYmyKKjbZSGCWDMIUgw1LHMIMxpMjHYm4zSoupp9e0pcdk7rFQgdwvhyw9ZjKPaO3i1k+rPm0Flcb+0WeqfmuXNWjwr6OJr9+pmzhvwYaAdtfC+5dmJ6vW6gokaSNPZUy/xXhL2qStZCvFJAsEXNpHTY4oE+ghAk4XJn1UNLp72UsH52pjEDZIDA45ta2JrSuZpVW5FezqeMNT/evy3e78WoEtteRm9337vRjQA2bSuqNCp8C2BTP3FdTWYD4i59G9j3QrfzugPqz+cFrsJKBZ0s69TpeIORangPSM3BVZsXiVGqv3/+5RymX2vDy7DKD51/PkHtVvuwS5guLU5QQv47lHl7gVu6JWIbM+JgWaM58rG3K/v/cs57pulyEz3yGTOfwCj5pvuf+vP9t+pHKV1ojFEtkGIFrjvXhTBNhLX+pIIPzbXnI1+2Tt2y5ADYy3kZCkAR36IMOI/wMEaWAf6NdMPpo2aE+lves9kass11nHbnlKkBvZNMHZeNsba8THnhVnfPKbko7a3OqsTkwd/Jlq0XqCXZz7cqb4HN6Je29Kvmdphm1lzm1LDck4WZr7wth11qssnoh3fSptT7lqyz0hXadhcIjbYQmZijtKujdsMveUdnUae8wbgcfZ0ZQXkE5M5KG8IOdxaSOBRsagNJAXPs/nrzE1zPJEejSj9ZoczuGlkoMZKUL3KmLrXpDMJRFAOA5otCad4U/xaZ4v8wANSRbmT/FoDcMgACFDCXlFQZR1C398mjvAHRaVCa69Ms6lK0lulYm+rHw4KVHJcIEBlRYyGdMwMdFF6aP0WTTQHZlEV7ROZA/nMK6kgaI0zt0oiYS7OYsAmJgqu4O2Wcg2daV1loQtzYCuahOyvSLuzQNPK/dFmR7HX0n+ZX4w/paodpTnzL9Fqf6pi8UtJTR/ukcPVQ6aJPqwmb+7a/9u969UX/u/AO8FKZEdSFgQ/oO/8KeNjf5/gRNJ4d8NsUs8Zcqf0jW7dtyX6pCAmeYgJf9N0MDUqZpbeKQdiczzw3Gn5OVxT+ZNumZ/PO5r+gz4M9/geOI23xeRWsZ81741aPxDQxM0qgkH+09WWXO3nC2uvsU3ZTJ0il2/6+p6eHdPXTKdui/NTiLaFdNfCj4b3cvnfJ50c5oFnQ6GrYHGP/TaexO0jyan8v9EqvpZzZ2lmUVk+reUE1B0QiLQfhcq63p454ymzpdNJyV9FYQTEmFE36Wil38pEO/MmEEun+asu5TUOxMK0Ux5icnQojvxPpx4ouJLIKFEEv+d9TvLJJeSlKVQUVVT19DU0tbR1dM3MDQyNjE1M7ewtLK2sbWzd9jFXnUCbX4uD8H5as2Vexb23d3ToKApna+ZNvARBe89nrQc9dqN1p5wHqCVY8fhsRY1r7BWEdr1KHJaRzQ6teJTdG6U9EnqeGIU9c0wskLf3DVDy2GksKJ4UVodoXA+LyjkTjdaKFs1X0hN5GLCLU+8p+MJy4VwXlFyIxlCgxri7/Hx2Pr7UY33mh0FrAmdD8YRNF8ltRUYD6PfJOECXroKw+oisUObVnGVWJwMUPw2UhHdUYSgkc50VsjpjhMogqE12UUofgDD6g9BtFL9+qnBiPJzoJzLupKGVqG6aR4uAjoNarurgBMZVqC86VvfC0FAyOaXVxKgRG5RQ+0dO0irvKYbDEFbdvB86fVH0f05Oms+eu/gAAA=",At=Yl,Wt={name:"gxr-ui",url:Xl,fontFamily:"GXR UI Icons",fontWeight:"400",glyphMap:At};var jt=require("react/jsx-runtime");function Me({spec:n,size:e=20,className:t}){switch(n.kind){case"gxr":{let o=At[n.name];return o==null?null:(0,jt.jsx)("span",{"aria-hidden":!0,className:t,style:{fontFamily:"GXR UI Icons",fontSize:e,lineHeight:1,display:"inline-block"},children:String.fromCodePoint(o)})}case"component":{let o=n.render;return(0,jt.jsx)(o,{size:e,className:t})}case"svg":return(0,jt.jsx)("svg",{"aria-hidden":!0,width:e,height:e,viewBox:n.viewBox??"0 0 24 24",className:t,children:(0,jt.jsx)("path",{d:n.path,fill:"currentColor"})})}}var We=require("react/jsx-runtime"),qt=ni.default.forwardRef(function({item:e,ctx:t,onInvoke:o},r){if(e.kind==="separator")return(0,We.jsx)("div",{className:"rx-tool-separator",role:"separator"});let i=typeof e.enabled=="function"?e.enabled(t):e.enabled!==!1,a=typeof e.active=="function"?e.active(t):!!e.active,s=`toolbar.${e.i18nKey}.label`,l=`toolbar.${e.i18nKey}.tooltip`,u=typeof e.label=="function"?e.label(t):e.label,c=typeof e.tooltip=="function"?e.tooltip(t):e.tooltip,p=u??t.t(s),d=c??t.t(l),g=typeof e.icon=="function"?e.icon(t):e.icon,m=(0,We.jsx)("button",{ref:r,type:"button",className:(0,oi.default)("rx-tool-item",`rx-tool-item--${e.kind}`),"data-testid":`tool-${e.id}`,"data-active":a,disabled:!i,"aria-label":p,onClick:()=>o(e),children:(0,We.jsx)(Me,{spec:g})});return d?(0,We.jsxs)(je.Root,{delayDuration:300,children:[(0,We.jsx)(je.Trigger,{asChild:!0,children:m}),(0,We.jsx)(je.Portal,{children:(0,We.jsxs)(je.Content,{side:"top",sideOffset:8,className:"rx-tooltip",children:[d,(0,We.jsx)(je.Arrow,{className:"rx-tooltip__arrow"})]})})]}):m});var ri=require("react"),at=te(require("@radix-ui/react-popover"));var Be=require("react/jsx-runtime");function ii({items:n,ctx:e,onInvoke:t,orientation:o}){let[r,i]=(0,ri.useState)(!1);if(n.length===0)return null;let a=s=>{t(s),i(!1)};return(0,Be.jsxs)(at.Root,{open:r,onOpenChange:i,children:[(0,Be.jsx)(at.Trigger,{asChild:!0,children:(0,Be.jsx)("button",{type:"button",className:"rx-tool-item rx-tool-item--overflow","data-testid":"overflow-button",title:e.t("toolbar.overflow.tooltip"),"aria-label":e.t("toolbar.overflow.label"),children:(0,Be.jsx)(Me,{spec:{kind:"svg",path:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}})})}),(0,Be.jsx)(at.Portal,{children:(0,Be.jsx)(at.Content,{side:o==="horizontal"?"top":"left",sideOffset:6,className:"rx-popover rx-popover--overflow",children:(0,Be.jsx)("div",{className:"rx-popover__body rx-popover__body--list",children:n.map(s=>s.kind==="separator"?(0,Be.jsx)("div",{className:"rx-popover__sep"},s.id):(0,Be.jsx)(qt,{item:s,ctx:e,onInvoke:a},s.id))})})})]})}var ai=te(require("react")),li=require("react/jsx-runtime"),si=ai.default.forwardRef(function({orientation:e},t){return(0,li.jsx)("div",{ref:t,className:`rx-dock__handle rx-dock__handle--${e}`,"data-testid":"dock-drag-handle","aria-label":"Drag dock",role:"button",children:"\u22EE\u22EE"})});var di=require("react/jsx-runtime");function ci({collapsed:n,onClick:e,orientation:t}){return(0,di.jsx)("button",{type:"button",className:"rx-dock__collapse","data-testid":"dock-collapse-btn",onClick:e,"aria-label":n?"Expand dock":"Collapse dock",children:n?t==="vertical"?"\u25C2":"\u25B4":t==="vertical"?"\u25B8":"\u25BE"})}var Kt=require("react"),lt=te(require("@radix-ui/react-popover")),ui=te(require("clsx"));var st=require("react");var le=require("react/jsx-runtime");function pi(n){let e={};for(let t of n)e[t.key]=t.default;return e}function Pn({item:n,ctx:e,onBack:t,onApply:o}){let r=n.params??[],i=e.getState().layoutParams[n.id],a=pi(r),[s,l]=(0,st.useState)({...a,...i});(0,st.useEffect)(()=>{i&&l(d=>({...a,...i,...d}))},[i]);let u=(0,st.useCallback)((d,g)=>{l(m=>{let y={...m,[d]:g};return e.dispatch({type:"SET_LAYOUT_PARAMS",toolId:n.id,params:y}),y})},[e,n.id]),c=(0,st.useCallback)(()=>{o(n)},[n,o]),p=(0,st.useCallback)(()=>{let d=pi(r);l(d),e.dispatch({type:"SET_LAYOUT_PARAMS",toolId:n.id,params:d})},[r,e,n.id]);return(0,le.jsxs)("div",{className:"rx-layout-settings",children:[(0,le.jsxs)("button",{type:"button",className:"rx-layout-settings__back",onClick:t,children:[(0,le.jsx)("span",{className:"rx-layout-settings__back-arrow",children:"\u2190"}),(0,le.jsx)("span",{children:e.t("toolbar.layout.label")})]}),(0,le.jsxs)("div",{className:"rx-layout-settings__header",children:[(0,le.jsx)(Me,{spec:typeof n.icon=="function"?n.icon(e):n.icon,size:20}),(0,le.jsx)("span",{children:e.t(`toolbar.${n.i18nKey}.label`)})]}),(0,le.jsx)("div",{className:"rx-layout-settings__controls",children:r.map(d=>(0,le.jsxs)("div",{className:"rx-layout-settings__control",children:[(0,le.jsx)("label",{className:"rx-layout-settings__label",children:e.t(`toolbar.param.${d.key}`)}),d.type==="slider"&&(0,le.jsxs)("div",{className:"rx-layout-settings__slider-row",children:[(0,le.jsx)("input",{type:"range",min:d.min,max:d.max,step:d.step??.1,value:Number(s[d.key]??d.default),onChange:g=>u(d.key,parseFloat(g.target.value)),className:"rx-layout-settings__slider"}),(0,le.jsx)("span",{className:"rx-layout-settings__value",children:Number(s[d.key]??d.default).toFixed(1)})]}),d.type==="segmented"&&(0,le.jsx)("div",{className:"rx-layout-settings__segmented",children:d.options.map(g=>(0,le.jsx)("button",{type:"button",className:`rx-layout-settings__seg-btn${s[d.key]===g.value?" rx-layout-settings__seg-btn--active":""}`,onClick:()=>u(d.key,g.value),children:g.label},g.value))}),d.type==="number"&&(0,le.jsx)("input",{type:"number",className:"rx-layout-settings__number",placeholder:"auto",min:d.min,max:d.max,value:s[d.key]!=null?String(s[d.key]):"",onChange:g=>u(d.key,g.target.value===""?null:parseInt(g.target.value,10))})]},d.key))}),(0,le.jsxs)("div",{className:"rx-layout-settings__actions",children:[(0,le.jsx)("button",{type:"button",className:"rx-layout-settings__apply",onClick:c,children:e.t("toolbar.param.apply")}),(0,le.jsx)("button",{type:"button",className:"rx-layout-settings__reset",onClick:p,children:e.t("toolbar.param.reset")})]})]})}var ye=require("react/jsx-runtime");function gi({parent:n,anchor:e,ctx:t,open:o,onOpenChange:r,onInvoke:i,onPin:a,isPinnable:s}){let l=n.popoverLayout??"list",[u,c]=(0,Kt.useState)(null),p=(0,Kt.useCallback)(m=>{m.kind!=="separator"&&(i(m),!n.keepOpen&&l!=="form"&&r(!1))},[i,r,l,n.keepOpen]),d=(0,Kt.useCallback)(m=>{m||c(null),r(m)},[r]);return(0,ye.jsxs)(lt.Root,{open:o,onOpenChange:d,children:[(0,ye.jsx)(lt.Trigger,{asChild:!0,children:e}),(0,ye.jsx)(lt.Portal,{children:(0,ye.jsxs)(lt.Content,{side:"top",sideOffset:8,className:(0,ui.default)("rx-popover",`rx-popover--${l}`),children:[(0,ye.jsxs)("div",{className:"rx-popover__header",children:[(0,ye.jsx)("span",{className:"rx-popover__title",children:t.t(`toolbar.${n.i18nKey}.label`)}),s&&a&&(0,ye.jsx)("button",{type:"button",className:"rx-popover__pin",onClick:a,"aria-label":"Pin panel",title:"Pin",children:"\u{1F4CC}"})]}),u?(0,ye.jsx)(Pn,{item:u,ctx:t,onBack:()=>c(null),onApply:m=>i(m)}):(0,ye.jsx)("div",{className:`rx-popover__body rx-popover__body--${l}`,children:n.items.map(m=>m.kind==="separator"?(0,ye.jsx)("div",{className:"rx-popover__sep"},m.id):(0,ye.jsxs)("button",{type:"button",className:"rx-popover__item","data-testid":`popover-item-${m.id}`,onClick:()=>p(m),children:[(0,ye.jsx)(Me,{spec:typeof m.icon=="function"?m.icon(t):m.icon,size:18}),(0,ye.jsx)("span",{children:t.t(`toolbar.${m.i18nKey}.label`)}),m.kind==="action"&&m.params&&m.params.length>0&&(0,ye.jsx)("button",{type:"button",className:"rx-popover__item-gear","data-testid":`gear-${m.id}`,onClick:y=>{y.stopPropagation(),c(m)},children:"\u2699"})]},m.id))})]})})]})}var bo={L:720,M:480,S:320,XS:0},hi={L:400,M:260,S:0},fi={L:{button:32,gap:4,padding:6},M:{button:28,gap:2,padding:4},S:{button:28,gap:2,padding:4},XS:{button:28,gap:2,padding:4}};function mi(n){return n>=bo.L?"L":n>=bo.M?"M":n>=bo.S?"S":"XS"}function vi(n){return n>=hi.L?"L":n>=hi.M?"M":"S"}var Cn=require("react");function bi(n,e){let[t,o]=(0,Cn.useState)("L");return(0,Cn.useLayoutEffect)(()=>{let r=n.current;if(!r)return;let i=(l,u)=>e==="horizontal"?mi(l):vi(u),a=r.getBoundingClientRect();o(i(a.width,a.height));let s=new ResizeObserver(l=>{let u=l[0];if(!u)return;let{width:c,height:p}=u.contentRect,d=i(c,p);o(g=>g===d?g:d)});return s.observe(r),()=>s.disconnect()},[n,e]),t}function yi(n){return n.kind==="separator"?"normal":n.priority??"normal"}function xi(n,e){if(e==="L"||e==="M")return{visible:n,overflow:[]};let t;e==="S"?t=i=>i.kind==="separator"||yi(i)!=="optional":t=i=>i.kind==="separator"||yi(i)==="critical";let o=[],r=[];for(let i of n)t(i)?o.push(i):r.push(i);return{visible:$l(o),overflow:r}}function $l(n){return n.filter((e,t,o)=>{if(e.kind!=="separator")return!0;let r=!1,i=!1;for(let a=t-1;a>=0;a--)if(o[a].kind!=="separator"){r=!0;break}for(let a=t+1;a<o.length;a++)if(o[a].kind!=="separator"){i=!0;break}return r&&i})}var Qe=require("react/jsx-runtime");function Si(n){let{dock:e,ctx:t,position:o,containerRef:r,collapsed:i,onPositionChange:a,onToggleCollapse:s,onInvoke:l,activePopoverToolId:u,onPopoverOpenChange:c,onPin:p,pinnedTools:d}=n,g=(0,De.useRef)(null),m=(0,De.useRef)(null),y=bi(r,e.orientation==="horizontal"?"horizontal":"vertical"),{visible:v,overflow:h}=(0,De.useMemo)(()=>xi(e.items,y),[e.items,y]),b=fi[y],[f,w]=(0,De.useState)(o.x>=0&&o.y>=0?o:null);(0,De.useEffect)(()=>{o.x>=0&&o.y>=0&&w(o)},[o]),(0,De.useEffect)(()=>{if(f!==null)return;let A=r.current,k=g.current;if(!A||!k)return;let C=A.getBoundingClientRect(),E=k.getBoundingClientRect(),P=e.orientation==="vertical"?{x:Math.max(0,C.width-E.width-14),y:Math.max(0,(C.height-E.height)/2)}:{x:Math.max(0,(C.width-E.width)/2),y:Math.max(0,C.height-E.height-14)};w(P)},[f,e.orientation,r]),(0,De.useEffect)(()=>{let A=m.current;if(!A)return;let k=C=>{C.preventDefault(),C.stopPropagation();let E=g.current,P=r.current;if(!E||!P||!f)return;let M=C.clientX,D=C.clientY,T={...f},I=P.getBoundingClientRect(),_=E.getBoundingClientRect(),N=Math.max(0,I.width-_.width),R=Math.max(0,I.height-_.height),z=0,G=H=>{z||(z=requestAnimationFrame(()=>{z=0;let O=Math.max(0,Math.min(N,T.x+(H.clientX-M))),U=Math.max(0,Math.min(R,T.y+(H.clientY-D)));a({x:O,y:U})}))},F=()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",F),z&&cancelAnimationFrame(z)};document.addEventListener("mousemove",G),document.addEventListener("mouseup",F)};return A.addEventListener("mousedown",k),()=>{A.removeEventListener("mousedown",k)}},[f,r,a]),(0,De.useEffect)(()=>{let A=r.current,k=g.current;if(!A||!k||!f)return;let C=new ResizeObserver(()=>{let E=A.getBoundingClientRect(),P=k.getBoundingClientRect(),M=Math.max(0,E.width-P.width),D=Math.max(0,E.height-P.height);(f.x>M||f.y>D)&&a({x:Math.min(M,Math.max(0,f.x)),y:Math.min(D,Math.max(0,f.y))})});return C.observe(A),()=>C.disconnect()},[r,f,a]);let x={"--rx-toolbar-button-size":`${b.button}px`,"--rx-toolbar-gap":`${b.gap}px`,"--rx-toolbar-padding":`${b.padding}px`},S=f!==null?{...x,left:f.x,top:f.y}:{...x,visibility:"hidden",left:0,top:0};return(0,Qe.jsxs)("div",{ref:g,className:(0,wi.default)("rx-dock",`rx-dock--${e.orientation}`,i&&"rx-dock--collapsed"),"data-dock-id":e.dockId,style:S,children:[(0,Qe.jsx)(si,{ref:m,orientation:e.orientation}),v.map(A=>A.kind==="parent"?(0,Qe.jsx)(gi,{parent:A,anchor:(0,Qe.jsx)(qt,{item:A,ctx:t,onInvoke:l}),ctx:t,open:u===A.id&&!i,onOpenChange:C=>c(A.id,C),onInvoke:l,isPinnable:A.pinnable&&!d.includes(A.id),onPin:()=>p(A.id)},A.id):(0,Qe.jsx)(qt,{item:A,ctx:t,onInvoke:l},A.id)),(0,Qe.jsx)(ii,{items:h,ctx:t,onInvoke:l,orientation:e.orientation}),(0,Qe.jsx)(ci,{collapsed:i,onClick:s,orientation:e.orientation})]})}var Tt=require("react"),Ci=require("react-dom");var Pi=require("react");function kn(n){(0,Pi.useEffect)(()=>{let e=n.current;if(!e)return;let t=r=>{r.stopPropagation()},o=["mousedown","wheel","contextmenu","pointerdown"];for(let r of o)e.addEventListener(r,t);return()=>{for(let r of o)e.removeEventListener(r,t)}},[n])}var Je=require("react/jsx-runtime");function ki({toolId:n,title:e,position:t,onPositionChange:o,onClose:r,onUnpin:i,zIndex:a,onFocus:s,children:l}){let u=(0,Tt.useRef)(null),c=(0,Tt.useRef)(null),p=(0,Tt.useRef)(t);if(p.current=t,kn(u),(0,Tt.useEffect)(()=>{let g=c.current;if(!g)return;let m=y=>{y.preventDefault(),y.stopPropagation(),s();let v=y.clientX,h=y.clientY,b={...p.current},f=0,w=S=>{f||(f=requestAnimationFrame(()=>{f=0,o({x:b.x+(S.clientX-v),y:b.y+(S.clientY-h)})}))},x=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",x),f&&cancelAnimationFrame(f)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",x)};return g.addEventListener("mousedown",m),()=>g.removeEventListener("mousedown",m)},[o,s]),typeof document>"u")return null;let d=(0,Je.jsxs)("div",{ref:u,className:"rx-floating-panel","data-testid":`floating-panel-${n}`,style:{left:t.x,top:t.y,zIndex:a},onMouseDown:s,children:[(0,Je.jsxs)("div",{ref:c,className:"rx-floating-panel__header",children:[(0,Je.jsx)("span",{className:"rx-floating-panel__drag",children:"\u22EE\u22EE"}),(0,Je.jsx)("span",{className:"rx-floating-panel__title",children:e}),(0,Je.jsx)("button",{type:"button",className:"rx-floating-panel__btn",onClick:i,"aria-label":"Unpin",title:"Unpin",children:"\u{1F4CC}"}),(0,Je.jsx)("button",{type:"button",className:"rx-floating-panel__btn",onClick:r,"aria-label":"Close",title:"Close",children:"\xD7"})]}),(0,Je.jsx)("div",{className:"rx-floating-panel__body",children:l})]});return(0,Ci.createPortal)(d,document.body)}var Ti=require("react");var Rn=te(require("react")),yo=Rn.default.createContext({locale:"en",t:n=>n});function Ri(){return(0,Rn.useContext)(yo)}function Ai(n,e,t){let o=t.override[n]??t.bundle[n]??t.fallback[n]??n;return Zl(o,t.values)}function Zl(n,e){return e?n.replace(/\{(\w+)\}/g,(t,o)=>{let r=e[o];return r===void 0?`{${o}}`:String(r)}):n}var An={"toolbar.view.fit.label":"Fit to view","toolbar.view.fit.tooltip":"Fit all nodes into the viewport (F)","toolbar.view.zoomIn.label":"Zoom in","toolbar.view.zoomIn.tooltip":"Zoom in (+)","toolbar.view.zoomOut.label":"Zoom out","toolbar.view.zoomOut.tooltip":"Zoom out (-)","toolbar.view.mode.label":"2D / 3D","toolbar.view.mode.tooltip":"Switch between 2D and 3D camera","toolbar.view.minimap.label":"Minimap","toolbar.view.minimap.tooltip":"Toggle minimap overview","toolbar.view.axis.label":"Axis","toolbar.view.axis.tooltip":"Toggle axis grid","toolbar.view.background.label":"Background","toolbar.view.background.tooltip":"Toggle background style","toolbar.select.invert.label":"Invert selection","toolbar.select.invert.tooltip":"Invert the current selection","toolbar.select.traceNeighbors.label":"Trace neighbors","toolbar.select.traceNeighbors.tooltip":"Extend selection to one-hop neighbors","toolbar.nodes.deleteSelected.label":"Delete selected","toolbar.nodes.deleteSelected.tooltip":"Remove all currently selected nodes","toolbar.nodes.deleteAll.label":"Delete all","toolbar.nodes.deleteAll.tooltip":"Remove every node from the graph","toolbar.nodes.pinSelected.label":"Pin selected","toolbar.nodes.pinSelected.tooltip":"Lock selected nodes at their current position","toolbar.nodes.releasePinned.label":"Release pinned","toolbar.nodes.releasePinned.tooltip":"Unpin anchored nodes so they rejoin force layout","toolbar.layout.label":"Layout","toolbar.layout.tooltip":"Choose a graph layout","toolbar.layout.circle.label":"Circle","toolbar.layout.circle.tooltip":"Circle layout","toolbar.layout.grid.label":"Grid","toolbar.layout.grid.tooltip":"Grid layout","toolbar.layout.line.label":"Line","toolbar.layout.line.tooltip":"Line layout","toolbar.layout.spiral.label":"Spiral","toolbar.layout.spiral.tooltip":"Spiral layout","toolbar.layout.sphere.label":"Sphere","toolbar.layout.sphere.tooltip":"3D sphere layout","toolbar.layout.cube.label":"Cube","toolbar.layout.cube.tooltip":"3D cube layout","toolbar.layout.ego.label":"Ego","toolbar.layout.ego.tooltip":"Ego tree layout from selected nodes","toolbar.layout.scale.label":"Scale","toolbar.layout.scale.tooltip":"Spread nodes apart","toolbar.layout.contract.label":"Contract","toolbar.layout.contract.tooltip":"Bring nodes closer together","toolbar.layout.scatter.label":"Scatter","toolbar.layout.scatter.tooltip":"Random scatter layout","toolbar.algorithm.label":"Algorithm","toolbar.algorithm.tooltip":"Run a graph algorithm","toolbar.algorithm.pagerank.label":"PageRank","toolbar.algorithm.pagerank.tooltip":"Compute PageRank","toolbar.algorithm.louvain.label":"Louvain","toolbar.algorithm.louvain.tooltip":"Louvain community detection","toolbar.algorithm.degree.label":"Degree","toolbar.algorithm.degree.tooltip":"Compute node degree","toolbar.algorithm.betweenness.label":"Betweenness","toolbar.algorithm.betweenness.tooltip":"Compute betweenness centrality","toolbar.algorithm.bfs.label":"BFS","toolbar.algorithm.bfs.tooltip":"Breadth-first search","toolbar.algorithm.dfs.label":"DFS","toolbar.algorithm.dfs.tooltip":"Depth-first search","toolbar.filter.label":"Filter","toolbar.filter.tooltip":"Filter nodes and edges","toolbar.filter.hideSelected.label":"Hide selected","toolbar.filter.hideSelected.tooltip":"Hide the selected nodes","toolbar.filter.showOnlySelected.label":"Show only selected","toolbar.filter.showOnlySelected.tooltip":"Hide everything except the selected nodes","toolbar.filter.showAll.label":"Show all","toolbar.filter.showAll.tooltip":"Reveal every hidden node","toolbar.style.label":"Style","toolbar.style.tooltip":"Adjust node and edge appearance","toolbar.style.colorByCategory.label":"Color by category","toolbar.style.colorByCategory.tooltip":"Assign a distinct color to each category","toolbar.style.sizeByDegree.label":"Size by degree","toolbar.style.sizeByDegree.tooltip":"Scale node size by connection count","toolbar.style.resetStyle.label":"Reset style","toolbar.style.resetStyle.tooltip":"Restore default node colors and sizes","toolbar.history.undo.label":"Undo","toolbar.history.undo.tooltip":"Undo last action (\u2318Z)","toolbar.history.redo.label":"Redo","toolbar.history.redo.tooltip":"Redo (\u2318\u21E7Z)","toolbar.snapshot.take.label":"Screenshot","toolbar.snapshot.take.tooltip":"Save canvas as PNG","toolbar.overflow.label":"More","toolbar.overflow.tooltip":"Show more tools","toolbar.param.spacing":"Spacing","toolbar.param.radius":"Radius","toolbar.param.columns":"Columns","toolbar.param.axis":"Axis","toolbar.param.size":"Size","toolbar.param.mode":"Mode","toolbar.param.orientation":"Direction","toolbar.param.depth":"Depth","toolbar.param.apply":"Apply","toolbar.param.reset":"Reset"};var Ii=require("react/jsx-runtime");function Mi({locale:n,bundles:e={},messages:t={},children:o}){let r=(0,Ti.useMemo)(()=>{let i=e[n]??{};return{locale:n,t:(s,l)=>Ai(s,void 0,{override:t,bundle:i,fallback:An,values:l})}},[n,e,t]);return(0,Ii.jsx)(yo.Provider,{value:r,children:o})}var Tn={status:"closed",toolId:null};function Ei(n,e){switch(e.type){case"OPEN_POPOVER":return n.status==="pinned-floating"&&n.toolId===e.toolId?n:{status:"popover-open",toolId:e.toolId};case"CLICK_OUTSIDE":return n.status==="popover-open"?Tn:n;case"PIN":return n.status!=="popover-open"?n:{status:"pinned-floating",toolId:n.toolId};case"UNPIN":return n.status!=="pinned-floating"?n:{status:"popover-open",toolId:n.toolId};case"CLOSE":return Tn;default:return n}}var _i={"toolbar.view.fit.label":"\u9002\u914D\u89C6\u56FE","toolbar.view.fit.tooltip":"\u5C06\u6240\u6709\u8282\u70B9\u9002\u914D\u5230\u89C6\u53E3 (F)","toolbar.view.zoomIn.label":"\u653E\u5927","toolbar.view.zoomIn.tooltip":"\u653E\u5927\u89C6\u56FE (+)","toolbar.view.zoomOut.label":"\u7F29\u5C0F","toolbar.view.zoomOut.tooltip":"\u7F29\u5C0F\u89C6\u56FE (-)","toolbar.view.mode.label":"2D / 3D","toolbar.view.mode.tooltip":"\u5728 2D \u548C 3D \u76F8\u673A\u4E4B\u95F4\u5207\u6362","toolbar.view.minimap.label":"\u5C0F\u5730\u56FE","toolbar.view.minimap.tooltip":"\u5207\u6362\u5C0F\u5730\u56FE\u6982\u89C8","toolbar.view.axis.label":"\u5750\u6807\u8F74","toolbar.view.axis.tooltip":"\u5207\u6362\u5750\u6807\u8F74\u7F51\u683C","toolbar.view.background.label":"\u80CC\u666F","toolbar.view.background.tooltip":"\u5207\u6362\u80CC\u666F\u6837\u5F0F","toolbar.select.invert.label":"\u53CD\u9009","toolbar.select.invert.tooltip":"\u53CD\u8F6C\u5F53\u524D\u9009\u62E9","toolbar.select.traceNeighbors.label":"\u8FFD\u8E2A\u90BB\u5C45","toolbar.select.traceNeighbors.tooltip":"\u5C06\u9009\u62E9\u6269\u5C55\u5230\u4E00\u8DF3\u90BB\u5C45\u8282\u70B9","toolbar.nodes.deleteSelected.label":"\u5220\u9664\u9009\u4E2D","toolbar.nodes.deleteSelected.tooltip":"\u5220\u9664\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684\u8282\u70B9","toolbar.nodes.deleteAll.label":"\u5220\u9664\u5168\u90E8","toolbar.nodes.deleteAll.tooltip":"\u5220\u9664\u56FE\u4E2D\u7684\u6240\u6709\u8282\u70B9","toolbar.nodes.pinSelected.label":"\u951A\u5B9A\u9009\u4E2D","toolbar.nodes.pinSelected.tooltip":"\u5C06\u9009\u4E2D\u8282\u70B9\u9501\u5B9A\u5728\u5F53\u524D\u4F4D\u7F6E","toolbar.nodes.releasePinned.label":"\u91CA\u653E\u951A\u5B9A","toolbar.nodes.releasePinned.tooltip":"\u89E3\u9664\u951A\u5B9A\u8282\u70B9\uFF0C\u4F7F\u5176\u91CD\u65B0\u52A0\u5165\u529B\u5E03\u5C40","toolbar.layout.label":"\u5E03\u5C40","toolbar.layout.tooltip":"\u9009\u62E9\u56FE\u5E03\u5C40","toolbar.layout.circle.label":"\u5706\u5F62","toolbar.layout.circle.tooltip":"\u5706\u5F62\u5E03\u5C40","toolbar.layout.grid.label":"\u7F51\u683C","toolbar.layout.grid.tooltip":"\u7F51\u683C\u5E03\u5C40","toolbar.layout.line.label":"\u76F4\u7EBF","toolbar.layout.line.tooltip":"\u76F4\u7EBF\u5E03\u5C40","toolbar.layout.spiral.label":"\u87BA\u65CB","toolbar.layout.spiral.tooltip":"\u87BA\u65CB\u5E03\u5C40","toolbar.layout.sphere.label":"\u7403\u5F62","toolbar.layout.sphere.tooltip":"3D \u7403\u5F62\u5E03\u5C40","toolbar.layout.cube.label":"\u7ACB\u65B9\u4F53","toolbar.layout.cube.tooltip":"3D \u7ACB\u65B9\u4F53\u5E03\u5C40","toolbar.layout.ego.label":"Ego","toolbar.layout.ego.tooltip":"\u4ECE\u6240\u9009\u8282\u70B9\u5F00\u59CB\u7684\u5C42\u7EA7\u6811\u5E03\u5C40","toolbar.layout.scale.label":"\u6269\u5C55","toolbar.layout.scale.tooltip":"\u6269\u5927\u8282\u70B9\u95F4\u8DDD","toolbar.layout.contract.label":"\u6536\u7F29","toolbar.layout.contract.tooltip":"\u7F29\u5C0F\u8282\u70B9\u95F4\u8DDD","toolbar.layout.scatter.label":"\u6563\u70B9","toolbar.layout.scatter.tooltip":"\u968F\u673A\u6563\u70B9\u5E03\u5C40","toolbar.algorithm.label":"\u7B97\u6CD5","toolbar.algorithm.tooltip":"\u8FD0\u884C\u56FE\u7B97\u6CD5","toolbar.algorithm.pagerank.label":"PageRank","toolbar.algorithm.pagerank.tooltip":"\u8BA1\u7B97 PageRank","toolbar.algorithm.louvain.label":"Louvain","toolbar.algorithm.louvain.tooltip":"Louvain \u793E\u533A\u53D1\u73B0","toolbar.algorithm.degree.label":"\u5EA6\u6570","toolbar.algorithm.degree.tooltip":"\u8BA1\u7B97\u8282\u70B9\u5EA6\u6570","toolbar.algorithm.betweenness.label":"\u4ECB\u6570","toolbar.algorithm.betweenness.tooltip":"\u8BA1\u7B97\u4ECB\u6570\u4E2D\u5FC3\u6027","toolbar.algorithm.bfs.label":"BFS","toolbar.algorithm.bfs.tooltip":"\u5E7F\u5EA6\u4F18\u5148\u641C\u7D22","toolbar.algorithm.dfs.label":"DFS","toolbar.algorithm.dfs.tooltip":"\u6DF1\u5EA6\u4F18\u5148\u641C\u7D22","toolbar.filter.label":"\u7B5B\u9009","toolbar.filter.tooltip":"\u7B5B\u9009\u8282\u70B9\u548C\u8FB9","toolbar.filter.hideSelected.label":"\u9690\u85CF\u6240\u9009","toolbar.filter.hideSelected.tooltip":"\u9690\u85CF\u5F53\u524D\u9009\u4E2D\u7684\u8282\u70B9","toolbar.filter.showOnlySelected.label":"\u4EC5\u663E\u793A\u6240\u9009","toolbar.filter.showOnlySelected.tooltip":"\u9690\u85CF\u9664\u9009\u4E2D\u8282\u70B9\u5916\u7684\u6240\u6709\u8282\u70B9","toolbar.filter.showAll.label":"\u663E\u793A\u5168\u90E8","toolbar.filter.showAll.tooltip":"\u663E\u793A\u6240\u6709\u9690\u85CF\u7684\u8282\u70B9","toolbar.style.label":"\u6837\u5F0F","toolbar.style.tooltip":"\u8C03\u6574\u8282\u70B9\u548C\u8FB9\u5916\u89C2","toolbar.style.colorByCategory.label":"\u6309\u7C7B\u522B\u7740\u8272","toolbar.style.colorByCategory.tooltip":"\u4E3A\u6BCF\u4E2A\u7C7B\u522B\u5206\u914D\u4E0D\u540C\u989C\u8272","toolbar.style.sizeByDegree.label":"\u6309\u5EA6\u6570\u8C03\u6574\u5927\u5C0F","toolbar.style.sizeByDegree.tooltip":"\u6839\u636E\u8FDE\u63A5\u6570\u7F29\u653E\u8282\u70B9\u5927\u5C0F","toolbar.style.resetStyle.label":"\u91CD\u7F6E\u6837\u5F0F","toolbar.style.resetStyle.tooltip":"\u6062\u590D\u9ED8\u8BA4\u8282\u70B9\u989C\u8272\u548C\u5927\u5C0F","toolbar.history.undo.label":"\u64A4\u9500","toolbar.history.undo.tooltip":"\u64A4\u9500\u4E0A\u4E00\u6B65\u64CD\u4F5C (\u2318Z)","toolbar.history.redo.label":"\u91CD\u505A","toolbar.history.redo.tooltip":"\u91CD\u505A (\u2318\u21E7Z)","toolbar.snapshot.take.label":"\u622A\u56FE","toolbar.snapshot.take.tooltip":"\u5C06\u753B\u5E03\u4FDD\u5B58\u4E3A PNG","toolbar.overflow.label":"\u66F4\u591A","toolbar.overflow.tooltip":"\u663E\u793A\u66F4\u591A\u5DE5\u5177","toolbar.param.spacing":"\u95F4\u8DDD","toolbar.param.radius":"\u534A\u5F84","toolbar.param.columns":"\u5217\u6570","toolbar.param.axis":"\u8F74","toolbar.param.size":"\u5927\u5C0F","toolbar.param.mode":"\u6A21\u5F0F","toolbar.param.orientation":"\u65B9\u5411","toolbar.param.depth":"\u6DF1\u5EA6","toolbar.param.apply":"\u5E94\u7528","toolbar.param.reset":"\u91CD\u7F6E"};var zi={"toolbar.view.fit.label":"Ajustar a la vista","toolbar.view.fit.tooltip":"Ajustar todos los nodos al viewport (F)","toolbar.view.zoomIn.label":"Acercar","toolbar.view.zoomIn.tooltip":"Acercar (+)","toolbar.view.zoomOut.label":"Alejar","toolbar.view.zoomOut.tooltip":"Alejar (-)","toolbar.view.mode.label":"2D / 3D","toolbar.view.mode.tooltip":"Cambiar entre c\xE1mara 2D y 3D","toolbar.view.minimap.label":"Minimapa","toolbar.view.minimap.tooltip":"Alternar vista general del minimapa","toolbar.view.axis.label":"Ejes","toolbar.view.axis.tooltip":"Alternar cuadr\xEDcula de ejes","toolbar.view.background.label":"Fondo","toolbar.view.background.tooltip":"Alternar estilo de fondo","toolbar.select.invert.label":"Invertir selecci\xF3n","toolbar.select.invert.tooltip":"Invertir la selecci\xF3n actual","toolbar.select.traceNeighbors.label":"Trazar vecinos","toolbar.select.traceNeighbors.tooltip":"Extender selecci\xF3n a vecinos de un salto","toolbar.nodes.deleteSelected.label":"Eliminar seleccionados","toolbar.nodes.deleteSelected.tooltip":"Eliminar todos los nodos seleccionados","toolbar.nodes.deleteAll.label":"Eliminar todo","toolbar.nodes.deleteAll.tooltip":"Eliminar todos los nodos del grafo","toolbar.nodes.pinSelected.label":"Fijar seleccionados","toolbar.nodes.pinSelected.tooltip":"Bloquear los nodos seleccionados en su posici\xF3n actual","toolbar.nodes.releasePinned.label":"Liberar fijados","toolbar.nodes.releasePinned.tooltip":"Desfijar los nodos anclados para que vuelvan al dise\xF1o de fuerza","toolbar.layout.label":"Disposici\xF3n","toolbar.layout.tooltip":"Elegir una disposici\xF3n del grafo","toolbar.layout.circle.label":"C\xEDrculo","toolbar.layout.circle.tooltip":"Disposici\xF3n en c\xEDrculo","toolbar.layout.grid.label":"Cuadr\xEDcula","toolbar.layout.grid.tooltip":"Disposici\xF3n en cuadr\xEDcula","toolbar.layout.line.label":"L\xEDnea","toolbar.layout.line.tooltip":"Disposici\xF3n en l\xEDnea","toolbar.layout.spiral.label":"Espiral","toolbar.layout.spiral.tooltip":"Disposici\xF3n en espiral","toolbar.layout.sphere.label":"Esfera","toolbar.layout.sphere.tooltip":"Disposici\xF3n 3D esf\xE9rica","toolbar.layout.cube.label":"Cubo","toolbar.layout.cube.tooltip":"Disposici\xF3n 3D en cubo","toolbar.layout.ego.label":"Ego","toolbar.layout.ego.tooltip":"Disposici\xF3n en \xE1rbol desde los nodos seleccionados","toolbar.layout.scale.label":"Escalar","toolbar.layout.scale.tooltip":"Separar los nodos","toolbar.layout.contract.label":"Contraer","toolbar.layout.contract.tooltip":"Acercar los nodos","toolbar.layout.scatter.label":"Dispersi\xF3n","toolbar.layout.scatter.tooltip":"Disposici\xF3n dispersa aleatoria","toolbar.algorithm.label":"Algoritmo","toolbar.algorithm.tooltip":"Ejecutar un algoritmo de grafo","toolbar.algorithm.pagerank.label":"PageRank","toolbar.algorithm.pagerank.tooltip":"Calcular PageRank","toolbar.algorithm.louvain.label":"Louvain","toolbar.algorithm.louvain.tooltip":"Detecci\xF3n de comunidades Louvain","toolbar.algorithm.degree.label":"Grado","toolbar.algorithm.degree.tooltip":"Calcular grado de los nodos","toolbar.algorithm.betweenness.label":"Intermediaci\xF3n","toolbar.algorithm.betweenness.tooltip":"Calcular centralidad de intermediaci\xF3n","toolbar.algorithm.bfs.label":"BFS","toolbar.algorithm.bfs.tooltip":"B\xFAsqueda en anchura","toolbar.algorithm.dfs.label":"DFS","toolbar.algorithm.dfs.tooltip":"B\xFAsqueda en profundidad","toolbar.filter.label":"Filtro","toolbar.filter.tooltip":"Filtrar nodos y aristas","toolbar.filter.hideSelected.label":"Ocultar selecci\xF3n","toolbar.filter.hideSelected.tooltip":"Ocultar los nodos seleccionados","toolbar.filter.showOnlySelected.label":"Mostrar solo selecci\xF3n","toolbar.filter.showOnlySelected.tooltip":"Ocultar todos los nodos excepto los seleccionados","toolbar.filter.showAll.label":"Mostrar todo","toolbar.filter.showAll.tooltip":"Mostrar todos los nodos ocultos","toolbar.style.label":"Estilo","toolbar.style.tooltip":"Ajustar apariencia de nodos y aristas","toolbar.style.colorByCategory.label":"Colorear por categor\xEDa","toolbar.style.colorByCategory.tooltip":"Asignar un color distintivo a cada categor\xEDa","toolbar.style.sizeByDegree.label":"Tama\xF1o por grado","toolbar.style.sizeByDegree.tooltip":"Escalar el tama\xF1o del nodo seg\xFAn el n\xFAmero de conexiones","toolbar.style.resetStyle.label":"Restablecer estilo","toolbar.style.resetStyle.tooltip":"Restaurar colores y tama\xF1os predeterminados","toolbar.history.undo.label":"Deshacer","toolbar.history.undo.tooltip":"Deshacer \xFAltima acci\xF3n (\u2318Z)","toolbar.history.redo.label":"Rehacer","toolbar.history.redo.tooltip":"Rehacer (\u2318\u21E7Z)","toolbar.snapshot.take.label":"Captura de pantalla","toolbar.snapshot.take.tooltip":"Guardar el lienzo como PNG","toolbar.overflow.label":"M\xE1s","toolbar.overflow.tooltip":"Mostrar m\xE1s herramientas","toolbar.param.spacing":"Espaciado","toolbar.param.radius":"Radio","toolbar.param.columns":"Columnas","toolbar.param.axis":"Eje","toolbar.param.size":"Tama\xF1o","toolbar.param.mode":"Modo","toolbar.param.orientation":"Direcci\xF3n","toolbar.param.depth":"Profundidad","toolbar.param.apply":"Aplicar","toolbar.param.reset":"Restablecer"};var Mn={view:{x:-1,y:-1},main:{x:-1,y:-1}};var Di="data-rx-toolbar-fonts",xo=!1;function Fi(){if(typeof document>"u"||xo)return;if(document.head.querySelector(`style[${Di}]`)){xo=!0;return}let n=document.createElement("style");n.setAttribute(Di,"true"),n.textContent=`
24
+ @font-face {
25
+ font-family: ${JSON.stringify(Wt.fontFamily)};
26
+ src: url(${JSON.stringify(Wt.url)}) format('woff2');
27
+ font-weight: ${Wt.fontWeight??"400"};
28
+ font-style: normal;
29
+ font-display: block;
30
+ }
31
+ `.trim(),document.head.appendChild(n),xo=!0}var xe=require("react/jsx-runtime");Fi();var t1={en:An,zh:_i,es:zi};function Li(n){let{locale:e="en",messages:t={},registry:o,...r}=n,a={...o.getMergedMessages(e),...t};return(0,xe.jsx)(Ni.Provider,{delayDuration:300,children:(0,xe.jsx)(Mi,{locale:e,bundles:t1,messages:a,children:(0,xe.jsx)(n1,{registry:o,locale:e,...r})})})}function n1({registry:n,locale:e="en",dockPositions:t=Mn,onDockPositionsChange:o,collapsed:r={},onCollapsedChange:i,pinnedTools:a=[],onPinnedToolsChange:s,activeToggles:l={},onActiveTogglesChange:u,pinnedPositions:c={},onPinnedPositionsChange:p,layoutParams:d={},onLayoutParamsChange:g,api:m,theme:y="dark"}){let v=ze(),h=m??v??null;(0,oe.useSyncExternalStore)(R=>n.subscribe(R),()=>n.getAllDocks(),()=>n.getAllDocks());let b=n.getAllDocks(),{t:f}=Ri(),[,w]=(0,oe.useReducer)(R=>R+1,0);(0,oe.useEffect)(()=>{if(!h)return;let R={sel:h.selection.getSelectedNodeIds().length,edgeSel:h.selection.getSelectedEdgeIds().length,nodeCount:h.nodes.count(),edgeCount:h.edges.count(),canUndo:h.history.canUndo(),canRedo:h.history.canRedo()},G=setInterval(()=>{let F={sel:h.selection.getSelectedNodeIds().length,edgeSel:h.selection.getSelectedEdgeIds().length,nodeCount:h.nodes.count(),edgeCount:h.edges.count(),canUndo:h.history.canUndo(),canRedo:h.history.canRedo()};if(F.sel!==R.sel||F.edgeSel!==R.edgeSel||F.nodeCount!==R.nodeCount||F.edgeCount!==R.edgeCount||F.canUndo!==R.canUndo||F.canRedo!==R.canRedo){let H=R.sel>0||R.edgeSel>0,O=F.sel>0||F.edgeSel>0;H&&!O&&h.emphasis.stopAll("focusContext"),R=F,w()}},50);return()=>clearInterval(G)},[h]);let x=(0,oe.useCallback)(R=>{switch(R.type){case"SET_DOCK_POSITION":o?.({...t,[R.dockId]:R.position});break;case"TOGGLE_COLLAPSE":i?.({...r,[R.dockId]:!r[R.dockId]});break;case"PIN_TOOL":a.includes(R.toolId)||s?.([...a,R.toolId]);break;case"UNPIN_TOOL":s?.(a.filter(z=>z!==R.toolId));break;case"SET_ACTIVE_TOGGLE":if(R.toolId)u?.({...l,[R.group]:R.toolId});else{let{[R.group]:z,...G}=l;u?.(G)}break;case"SET_PINNED_POSITION":p?.({...c,[R.toolId]:R.position});break;case"SET_LAYOUT_PARAMS":g?.({...d,[R.toolId]:R.params});break}},[t,o,r,i,a,s,l,u,c,p,d,g]),S=(0,oe.useMemo)(()=>({dockPositions:t,collapsed:r,pinnedTools:a,activeToggles:l,pinnedPositions:c,layoutParams:d}),[t,r,a,l,c,d]),A=(0,oe.useMemo)(()=>({api:h,t:f,locale:e,getState:()=>S,dispatch:x}),[h,f,e,S,x]),[k,C]=(0,oe.useReducer)(Ei,Tn),E=(0,oe.useRef)(new Map),P=(0,oe.useRef)(1),M=(0,oe.useCallback)(R=>{P.current+=1,E.current.set(R,P.current)},[]);(0,oe.useEffect)(()=>{let R=z=>{if(z.key!=="Escape")return;let G=document.activeElement?.tagName;if(!(G==="INPUT"||G==="TEXTAREA"))if(a.length>0){let F=[...a].sort((H,O)=>(E.current.get(O)??0)-(E.current.get(H)??0))[0];x({type:"UNPIN_TOOL",toolId:F})}else k.status==="popover-open"&&C({type:"CLOSE"})};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[a,k.status,x]);let D=(0,oe.useCallback)(R=>{if(R.kind==="action")R.onInvoke(A);else if(R.kind==="toggle"){let z=l[R.exclusiveGroup??""]===R.id;R.onToggle(A,!z),R.exclusiveGroup&&x({type:"SET_ACTIVE_TOGGLE",group:R.exclusiveGroup,toolId:z?null:R.id})}else R.kind==="parent"&&(a.includes(R.id)||C({type:"OPEN_POPOVER",toolId:R.id}))},[A,l,x,a]),T=(0,oe.useCallback)(R=>{for(let z of b)for(let G of z.items)if(G.kind==="parent"&&G.id===R)return G},[b]),I=(0,oe.useRef)(null);kn(I);let[_,N]=(0,oe.useState)(!1);return(0,oe.useEffect)(()=>{if(typeof document>"u"||!document.fonts)return;if(_){document.body.classList.add("rx-fonts-ready");return}let R=!1;return document.fonts.load('24px "Material Symbols Outlined"').then(z=>{R||z.length!==0&&(N(!0),document.body.classList.add("rx-fonts-ready"))}).catch(()=>{}),()=>{R=!0}},[_]),(0,xe.jsxs)("div",{ref:I,className:"rx-toolbar","data-gxr-theme":y,"data-fonts-ready":_?"true":"false",children:[b.map(R=>(0,xe.jsx)(Si,{dock:R,ctx:A,position:t[R.dockId]??{x:-1,y:-1},containerRef:I,collapsed:r[R.dockId]??!1,onPositionChange:z=>x({type:"SET_DOCK_POSITION",dockId:R.dockId,position:z}),onToggleCollapse:()=>x({type:"TOGGLE_COLLAPSE",dockId:R.dockId}),onInvoke:D,activePopoverToolId:k.status==="popover-open"?k.toolId:null,onPopoverOpenChange:(z,G)=>{G||C({type:"CLOSE"})},onPin:z=>{M(z),x({type:"PIN_TOOL",toolId:z}),C({type:"CLOSE"})},pinnedTools:a},R.dockId)),a.map(R=>{let z=T(R);if(!z)return null;let G=c[R]??{x:80,y:80},F=E.current.get(R)??1;return(0,xe.jsx)(ki,{toolId:R,title:A.t(`toolbar.${z.i18nKey}.label`),position:G,onPositionChange:H=>x({type:"SET_PINNED_POSITION",toolId:R,position:H}),onClose:()=>x({type:"UNPIN_TOOL",toolId:R}),onUnpin:()=>{x({type:"UNPIN_TOOL",toolId:R}),C({type:"OPEN_POPOVER",toolId:R})},zIndex:F,onFocus:()=>M(R),children:z.renderPinnedPanel?z.renderPinnedPanel(A):(0,xe.jsx)(o1,{parent:z,ctx:A,onInvoke:D})},R)})]})}function o1({parent:n,ctx:e,onInvoke:t}){let[o,r]=(0,oe.useState)(null);return o?(0,xe.jsx)(Pn,{item:o,ctx:e,onBack:()=>r(null),onApply:i=>t(i)}):(0,xe.jsx)("div",{className:"rx-floating-panel__items",children:n.items.map(i=>i.kind==="separator"?(0,xe.jsx)("div",{className:"rx-popover__sep"},i.id):(0,xe.jsxs)("button",{type:"button",className:"rx-popover__item","data-testid":`pinned-item-${i.id}`,onClick:()=>t(i),children:[(0,xe.jsx)(Me,{spec:typeof i.icon=="function"?i.icon(e):i.icon,size:18}),(0,xe.jsx)("span",{children:e.t(`toolbar.${i.i18nKey}.label`)}),i.kind==="action"&&i.params&&i.params.length>0&&(0,xe.jsx)("button",{type:"button",className:"rx-pinned-gear","data-testid":`gear-${i.id}`,onClick:a=>{a.stopPropagation(),r(i)},children:"\u2699"})]},i.id))})}var In=class n{constructor(){this.docks=new Map;this.plugins=new Map;this.provenance=new Map;this.messagesByPlugin=new Map;this.listeners=new Set;this.cachedDocksSnapshot=null}registerDock(e){this.docks.set(e.dockId,{...e,items:[...e.items]}),this.notify()}getDock(e){return this.docks.get(e)}getAllDocks(){return this.cachedDocksSnapshot===null&&(this.cachedDocksSnapshot=Array.from(this.docks.values())),this.cachedDocksSnapshot}addItem(e,t,o,r="core"){let i=this.docks.get(e);if(!i)throw new Error(`ToolRegistry: dock "${e}" not registered`);let a=this.resolveInsertIndex(i.items,o);i.items.splice(a,0,t),this.provenance.set(t.id,r),this.notify()}removeItem(e,t){let o=this.docks.get(e);o&&(o.items=o.items.filter(r=>r.id!==t),this.provenance.delete(t),this.notify())}replaceItem(e,t,o,r="core"){let i=this.docks.get(e);if(!i)throw new Error(`ToolRegistry: dock "${e}" not registered`);let a=i.items.findIndex(l=>l.id===t);if(a<0)throw new Error(`ToolRegistry: item "${t}" not found in dock "${e}"`);let s=this.provenance.get(t)??"core";s!==r&&console.warn(`[Toolbar] Plugin "${r}" replaced item "${t}" previously owned by "${s}"`),i.items[a]=o,t!==o.id&&this.provenance.delete(t),this.provenance.set(o.id,r),this.notify()}registerPlugin(e){if(this.plugins.has(e.id))throw new Error(`Plugin "${e.id}" already registered`);e.messages&&this.messagesByPlugin.set(e.id,e.messages);let t=this.createPluginContext(e.id);e.install(t),this.plugins.set(e.id,e),this.notify()}unregisterPlugin(e){let t=this.plugins.get(e);if(t){try{let o=this.createPluginContext(e);t.uninstall?.(o)}catch(o){console.warn(`[Toolbar] Plugin "${e}" uninstall hook threw:`,o)}for(let o of this.docks.values())o.items=o.items.filter(r=>this.provenance.get(r.id)===e?(this.provenance.delete(r.id),!1):!0);this.messagesByPlugin.delete(e),this.plugins.delete(e),this.notify()}}getPlugin(e){return this.plugins.get(e)}getMergedMessages(e){let t={};for(let o of this.messagesByPlugin.values())o[e]&&Object.assign(t,o[e]);return t}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}clone(){let e=new n;for(let t of this.docks.values())e.registerDock({dockId:t.dockId,orientation:t.orientation,items:[]});for(let t of this.docks.values())for(let o of t.items)(this.provenance.get(o.id)??"core")==="core"&&e.addItem(t.dockId,o);for(let t of this.plugins.values())e.registerPlugin(t);return e}notify(){this.cachedDocksSnapshot=null;for(let e of this.listeners)e()}createPluginContext(e){return{registry:this,addItem:(t,o,r)=>this.addItem(t,o,r,e),replaceItem:(t,o,r)=>this.replaceItem(t,o,r,e),removeItem:(t,o)=>this.removeItem(t,o),registerDock:t=>this.registerDock(t)}}resolveInsertIndex(e,t){if(!t)return e.length;if(t.before){let o=e.findIndex(r=>r.id===t.before);return o<0?e.length:o}if(t.after){let o=e.findIndex(r=>r.id===t.after);return o<0?e.length:o+1}return e.length}};var Oi=["#e6194b","#3cb44b","#ffe119","#4363d8","#f58231","#911eb4","#42d4f4","#f032e6","#bfef45","#fabed4","#469990","#dcbeff","#9a6324","#fffac8","#800000","#aaffc3","#808000","#ffd8b1","#000075","#a9a9a9"];function Gi(){let n=new In;return n.registerDock({dockId:"main",orientation:"horizontal",items:[{kind:"action",id:"core.select.invert",i18nKey:"select.invert",icon:{kind:"gxr",name:"flip-to-back"},priority:"normal",enabled:({api:e})=>!!e&&e.selection.hasSelection(),onInvoke:({api:e})=>{e&&e.selection.invertSelection()}},{kind:"action",id:"core.select.traceNeighbors",i18nKey:"select.traceNeighbors",icon:{kind:"gxr",name:"share"},priority:"normal",enabled:({api:e})=>!!e&&e.selection.hasSelection(),onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds();if(t.length===0)return;let o=new Set(t),r=new Set;for(let s of t){let l=e.edges.connectedTo(s);for(let u of l){r.add(u.id);let c=u.source===s?u.target:u.source;o.add(c)}}let i=Array.from(o),a=Array.from(r);e.selection.selectNodes(i,"replace"),e.selection.selectEdges(a),e.emphasis.dimExcept(i,{edgeIds:a})}},{kind:"action",id:"core.nodes.deleteSelected",i18nKey:"nodes.deleteSelected",icon:{kind:"gxr",name:"delete"},priority:"normal",enabled:({api:e})=>!!e&&e.selection.hasSelection(),onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds(),o=e.selection.getSelectedEdgeIds();o.length>0&&e.edges.remove(o),t.length>0&&e.nodes.remove(t)}},{kind:"action",id:"core.nodes.deleteAll",i18nKey:"nodes.deleteAll",icon:{kind:"gxr",name:"delete-forever"},priority:"optional",onInvoke:({api:e})=>{e&&e.nodes.clear()}},{kind:"action",id:"core.nodes.pinSelected",i18nKey:"nodes.pinSelected",icon:{kind:"svg",path:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z"},priority:"normal",enabled:({api:e})=>{if(!e)return!1;let t=e.selection.getSelectedNodeIds();if(t.length===0)return!1;let o=new Set(e.nodes.getPinned());return t.some(r=>!o.has(r))},onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds();t.length>0&&e.nodes.pin(t)}},{kind:"action",id:"core.nodes.releasePinned",i18nKey:"nodes.releasePinned",icon:{kind:"svg",path:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3 2 4.27z"},priority:"normal",enabled:({api:e})=>e?e.nodes.getPinned().length>0:!1,tooltip:({api:e})=>{if(!e)return"Release Pinned";let t=e.selection.getSelectedNodeIds(),o=e.nodes.getPinned(),r=t.filter(i=>o.includes(i));return r.length>0?`Release ${r.length} selected pinned`:`Release all ${o.length} pinned`},onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds(),o=e.nodes.getPinned(),r=t.filter(i=>o.includes(i));r.length>0?e.nodes.unpin(r):e.nodes.unpin(o)}},{kind:"separator",id:"sep.main.1"},{kind:"parent",id:"core.layout",i18nKey:"layout",icon:{kind:"gxr",name:"account-tree"},popoverLayout:"grid",pinnable:!0,keepOpen:!0,priority:"critical",items:[{kind:"action",id:"core.layout.circle",i18nKey:"layout.circle",icon:{kind:"gxr",name:"radio-button-unchecked"},params:[{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1},{type:"slider",key:"radius",i18nKey:"radius",default:0,min:0,max:50,step:.5}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=t().layoutParams["core.layout.circle"]??{};e.layout.circle(void 0,{spacing:o.spacing,radius:o.radius||void 0})}},{kind:"action",id:"core.layout.grid",i18nKey:"layout.grid",icon:{kind:"gxr",name:"grid-on"},params:[{type:"number",key:"columns",i18nKey:"columns",default:null,min:1,max:100},{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=t().layoutParams["core.layout.grid"]??{};e.layout.grid(void 0,{columns:o.columns??void 0,spacing:o.spacing})}},{kind:"action",id:"core.layout.line",i18nKey:"layout.line",icon:{kind:"gxr",name:"horizontal-rule"},params:[{type:"segmented",key:"axis",i18nKey:"axis",default:"x",options:[{value:"x",label:"X"},{value:"y",label:"Y"},{value:"z",label:"Z"}]},{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=t().layoutParams["core.layout.line"]??{};e.layout.line(void 0,{axis:o.axis??void 0,spacing:o.spacing})}},{kind:"action",id:"core.layout.spiral",i18nKey:"layout.spiral",icon:{kind:"gxr",name:"all-inclusive"},params:[{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=t().layoutParams["core.layout.spiral"]??{};e.layout.spiral(void 0,{spacing:o.spacing})}},{kind:"action",id:"core.layout.sphere",i18nKey:"layout.sphere",icon:{kind:"gxr",name:"sports-volleyball"},params:[{type:"slider",key:"radius",i18nKey:"radius",default:0,min:0,max:50,step:.5},{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=t().layoutParams["core.layout.sphere"]??{};e.layout.sphere(void 0,{radius:o.radius||void 0,spacing:o.spacing})}},{kind:"action",id:"core.layout.cube",i18nKey:"layout.cube",icon:{kind:"gxr",name:"deployed-code"},params:[{type:"number",key:"size",i18nKey:"size",default:null,min:1,max:50},{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=t().layoutParams["core.layout.cube"]??{};e.layout.cube(void 0,{size:o.size??void 0,spacing:o.spacing})}},{kind:"action",id:"core.layout.ego",i18nKey:"layout.ego",icon:{kind:"gxr",name:"account-tree"},enabled:({api:e})=>!!e&&e.selection.getSelectedNodeIds().length>0,params:[{type:"segmented",key:"mode",i18nKey:"mode",default:"tree",options:[{value:"tree",label:"Tree"},{value:"rings",label:"Rings"}]},{type:"segmented",key:"orientation",i18nKey:"orientation",default:"right",options:[{value:"up",label:"\u2191"},{value:"down",label:"\u2193"},{value:"left",label:"\u2190"},{value:"right",label:"\u2192"}]},{type:"slider",key:"depth",i18nKey:"depth",default:100,min:1,max:100,step:1},{type:"slider",key:"spacing",i18nKey:"spacing",default:1,min:.1,max:20,step:.1}],onInvoke:({api:e,getState:t})=>{if(!e)return;let o=e.selection.getSelectedNodeIds();if(o.length===0)return;let r=t().layoutParams["core.layout.ego"]??{};e.layout.ego(o,{mode:r.mode??void 0,orientation:r.orientation??void 0,depth:r.depth??void 0,spacing:r.spacing})}},{kind:"action",id:"core.layout.scale",i18nKey:"layout.scale",icon:{kind:"gxr",name:"open-in-full"},onInvoke:({api:e})=>{e&&e.layout.scale(1.5)}},{kind:"action",id:"core.layout.contract",i18nKey:"layout.contract",icon:{kind:"gxr",name:"close-fullscreen"},onInvoke:({api:e})=>{e&&e.layout.scale(.67)}}]},{kind:"parent",id:"core.algorithm",i18nKey:"algorithm",icon:{kind:"gxr",name:"hub"},popoverLayout:"list",pinnable:!0,items:[{kind:"action",id:"core.algorithm.degree",i18nKey:"algorithm.degree",icon:{kind:"gxr",name:"tag"},onInvoke:({api:e})=>{e&&(e.algorithms.centrality.degree({writeTo:"degree",overwrite:!0}),e.style.sizeNodesByProperty("degree",{minSize:5,maxSize:25}))}},{kind:"action",id:"core.algorithm.pagerank",i18nKey:"algorithm.pagerank",icon:{kind:"gxr",name:"trending-up"},onInvoke:async({api:e})=>{if(e)try{await e.algorithms.centrality.pageRank({damping:.85,writeTo:"pageRank",overwrite:!0}),e.style.sizeNodesByProperty("pageRank",{minSize:5,maxSize:25}),e.style.colorNodesByProperty("pageRank",{mode:"sequential",colorFrom:"#1e3a8a",colorTo:"#fbbf24"})}catch(t){console.error("[toolbar] pageRank failed:",t)}}},{kind:"action",id:"core.algorithm.betweenness",i18nKey:"algorithm.betweenness",icon:{kind:"gxr",name:"route"},onInvoke:async({api:e})=>{if(e)try{await e.algorithms.centrality.betweenness({writeTo:"betweenness",overwrite:!0}),e.style.colorNodesByProperty("betweenness",{mode:"sequential",colorFrom:"#1e3a8a",colorTo:"#dc2626"})}catch(t){console.error("[toolbar] betweenness failed:",t)}}},{kind:"action",id:"core.algorithm.louvain",i18nKey:"algorithm.louvain",icon:{kind:"gxr",name:"bubble-chart"},onInvoke:async({api:e})=>{if(e)try{await e.algorithms.community.louvain({resolution:1,writeTo:"communityId",overwrite:!0}),e.style.colorNodesByProperty("communityId",{mode:"ordinal"})}catch(t){console.error("[toolbar] louvain failed:",t)}}},{kind:"action",id:"core.algorithm.bfs",i18nKey:"algorithm.bfs",icon:{kind:"gxr",name:"alt-route"},enabled:({api:e})=>!!e&&e.selection.getSelectedNodeIds().length>0,onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds();t.length!==0&&e.overlays.heatDiffusion(t[0],{color:[1,.1,.1],delayPerHop:450,maxHops:10,decay:.78,holdDuration:6e3})}},{kind:"action",id:"core.algorithm.dfs",i18nKey:"algorithm.dfs",icon:{kind:"gxr",name:"fork-right"},enabled:({api:e})=>!!e&&e.selection.getSelectedNodeIds().length>0,onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds();if(t.length===0)return;e.algorithms.paths.dfs({source:t[0]}).order.forEach((r,i)=>{setTimeout(()=>{e.animations.nodeRipple(r,{color:[1,.4,.8],duration:1500})},i*30)})}}]},{kind:"parent",id:"core.filter",i18nKey:"filter",icon:{kind:"gxr",name:"filter-alt"},popoverLayout:"list",pinnable:!0,items:[{kind:"action",id:"core.filter.hideSelected",i18nKey:"filter.hideSelected",icon:{kind:"gxr",name:"visibility-off"},enabled:({api:e})=>!!e&&e.selection.hasSelection(),onInvoke:({api:e})=>{if(!e)return;let t=e.selection.getSelectedNodeIds();t.length!==0&&(e.nodes.hide(t),e.selection.clear())}},{kind:"action",id:"core.filter.showOnlySelected",i18nKey:"filter.showOnlySelected",icon:{kind:"gxr",name:"center-focus-strong"},enabled:({api:e})=>!!e&&e.selection.hasSelection(),onInvoke:({api:e})=>{if(!e)return;let t=new Set(e.selection.getSelectedNodeIds());if(t.size===0)return;let o=e.nodes.getAll().map(r=>r.id).filter(r=>!t.has(r));o.length>0&&e.nodes.hide(o)}},{kind:"action",id:"core.filter.showAll",i18nKey:"filter.showAll",icon:{kind:"gxr",name:"visibility"},onInvoke:({api:e})=>{e&&e.nodes.showAll()}}]},{kind:"parent",id:"core.style",i18nKey:"style",icon:{kind:"gxr",name:"palette"},popoverLayout:"list",pinnable:!0,items:[{kind:"action",id:"core.style.colorByCategory",i18nKey:"style.colorByCategory",icon:{kind:"gxr",name:"category"},onInvoke:({api:e})=>{if(!e)return;e.types.getNodeTypes().forEach((o,r)=>{e.style.setCategoryColor(o,Oi[r%Oi.length])})}},{kind:"action",id:"core.style.sizeByDegree",i18nKey:"style.sizeByDegree",icon:{kind:"gxr",name:"linear-scale"},onInvoke:({api:e})=>{e&&(e.algorithms.centrality.degree({writeTo:"degree",overwrite:!0}),e.style.sizeNodesByProperty("degree",{minSize:5,maxSize:25}))}},{kind:"action",id:"core.style.resetStyle",i18nKey:"style.resetStyle",icon:{kind:"gxr",name:"refresh"},onInvoke:({api:e})=>{if(!e)return;let t=e.nodes.getAll();for(let o of t)e.style.setNodeColor(o.id,"#9ca3af"),e.style.setNodeSize(o.id,10);e.style.setDefaultNodeSize(10)}}]},{kind:"separator",id:"sep.main.2"},{kind:"action",id:"core.history.undo",i18nKey:"history.undo",icon:{kind:"gxr",name:"undo"},priority:"critical",enabled:({api:e})=>!!e&&e.history.canUndo(),onInvoke:({api:e})=>{e&&e.history.undo()}},{kind:"action",id:"core.history.redo",i18nKey:"history.redo",icon:{kind:"gxr",name:"redo"},enabled:({api:e})=>!!e&&e.history.canRedo(),onInvoke:({api:e})=>{e&&e.history.redo()}},{kind:"action",id:"core.snapshot.take",i18nKey:"snapshot.take",icon:{kind:"gxr",name:"camera-alt"},priority:"optional",onInvoke:async({api:e})=>{if(e)try{let t=await e.renderer.screenshot(),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o;let i=new Date().toISOString().replace(/[:.]/g,"-");r.download=`graph-screenshot-${i}.png`,r.click(),URL.revokeObjectURL(o)}catch(t){console.error("[toolbar] screenshot failed:",t)}}},{kind:"separator",id:"sep.main.view"},{kind:"action",id:"core.view.fit",i18nKey:"view.fit",icon:{kind:"gxr",name:"fit-view"},priority:"critical",onInvoke:({api:e})=>{e&&e.camera.flyToAll()}},{kind:"toggle",id:"core.view.mode",i18nKey:"view.mode",icon:({api:e})=>e?.renderer.getMode()==="3D"?{kind:"gxr",name:"view-3d"}:{kind:"gxr",name:"view-2d"},tooltip:({api:e})=>e?.renderer.getMode()==="3D"?"Switch to 2D":"Switch to 3D",exclusiveGroup:"view.mode",active:({api:e})=>e?.renderer.getMode()==="3D",onToggle:({api:e})=>{e&&e.renderer.setMode(e.renderer.getMode()==="3D"?"2D":"3D")}},{kind:"toggle",id:"core.view.minimap",i18nKey:"view.minimap",icon:{kind:"gxr",name:"map"},exclusiveGroup:"view.minimap",active:({api:e})=>e?.renderer.isMinimapVisible()??!0,onToggle:({api:e})=>{e&&e.renderer.setMinimapVisible(!e.renderer.isMinimapVisible())}},{kind:"toggle",id:"core.view.background",i18nKey:"view.background",icon:{kind:"gxr",name:"contrast"},exclusiveGroup:"view.background",active:({api:e})=>e?.renderer.getTheme()==="light",onToggle:({api:e})=>{e&&e.renderer.setTheme(e.renderer.getTheme()==="light"?"dark":"light")}}]}),n}var mt=require("react");function Bi(n){let[e,t]=(0,mt.useState)(n?.dockPositions??Mn),[o,r]=(0,mt.useState)(n?.collapsed??{}),[i,a]=(0,mt.useState)(n?.pinnedTools??[]),[s,l]=(0,mt.useState)(n?.activeToggles??{}),[u,c]=(0,mt.useState)(n?.pinnedPositions??{}),[p,d]=(0,mt.useState)(n?.layoutParams??{});return{dockPositions:e,onDockPositionsChange:t,collapsed:o,onCollapsedChange:r,pinnedTools:i,onPinnedToolsChange:a,activeToggles:s,onActiveTogglesChange:l,pinnedPositions:u,onPinnedPositionsChange:c,layoutParams:p,onLayoutParamsChange:d}}var Vi=require("react/jsx-runtime");function Ui({config:n,locale:e}){let t=typeof n=="object"?n:{},o=(0,Hi.useMemo)(()=>Gi(),[]),r=Bi(),i=t.registry??o,s=ze()?.renderer.getTheme()??"dark",l=t.theme??s,u=t.locale??e;return(0,Vi.jsx)(Li,{registry:i,...r,...t,locale:u,theme:l})}var ve=require("react");var Mt=require("react");function Wi(n,e){let[,t]=(0,Mt.useState)(0),o=(0,Mt.useCallback)(()=>t(c=>c+1),[]);(0,Mt.useEffect)(()=>{let c=[e.events.on("nodes:added",o),e.events.on("nodes:removed",o),e.events.on("edges:added",o),e.events.on("edges:removed",o),e.events.on("schema:changed",o),e.events.on("selection:changed",o),e.events.on("style:changed",o)];return()=>c.forEach(p=>p())},[e,o]);let r=n.getSchema(),i=new Set(n.getSelectedNodeIds()),a=n.visualMapper,s=n.nodeState,l=r.categories.map(c=>{let p=n.queries.getNodesByCategory(c.name),d=a.categoryConfigs.get(c.name),g=a.categoryColors.getColor(c.name),m=p.filter(h=>i.has(h.id)).length,y=p.length>0&&s!=null&&p.every(h=>{let b=n.index.getNodeIndex(h.id);return b!==void 0&&s.hidden[b]===1}),v;return d?.colorMapping&&(v={type:d.colorMapping.type,property:d.colorMapping.property}),{name:c.name,count:p.length,color:g,icon:d?.defaultIcon,isSelected:m>0,isHidden:y,colorMapping:v}}),u=r.relationships.map(c=>{let p=n.queries.getEdgesByRelationship(c.name),d=a.relationshipColors.getColor(c.name);return{name:c.name,count:p.length,color:d,isSelected:!1}});return{categories:l,relationships:u}}var Fe=require("react");function ji(){let[n,e]=(0,Fe.useState)({isOpen:!1,targetKey:null,position:null,flipped:!1}),t=(0,Fe.useRef)(null),o=(0,Fe.useRef)(!1),r=(0,Fe.useCallback)((s,l)=>{let u=l.getBoundingClientRect(),c=250,d=u.left<c+16,g=d?{top:u.bottom+8,left:u.right-c}:{top:u.top,left:u.left-c-12};e({isOpen:!0,targetKey:s,position:g,flipped:d})},[]),i=(0,Fe.useCallback)(()=>{e({isOpen:!1,targetKey:null,position:null,flipped:!1})},[]),a=(0,Fe.useCallback)((s,l)=>{n.isOpen&&n.targetKey===s?i():r(s,l)},[n.isOpen,n.targetKey,r,i]);return(0,Fe.useEffect)(()=>{if(!n.isOpen)return;let s=l=>{if(o.current){o.current=!1;return}t.current&&!t.current.contains(l.target)&&i()};return document.addEventListener("mousedown",s,!0),()=>document.removeEventListener("mousedown",s,!0)},[n.isOpen,i]),(0,Fe.useEffect)(()=>{if(!n.isOpen)return;let s=l=>{l.key==="Escape"&&i()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n.isOpen,i]),{...n,open:r,close:i,toggle:a,popoverRef:t,hasDraggedRef:o}}var Yt=require("react");var En=[{name:"Material",colors:["#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722"]},{name:"D3 Classic",colors:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"]},{name:"Flat UI",colors:["#74b9ff","#a29bfe","#0984e3","#6c5ce7","#ff7675","#fd79a8","#fdcb6e","#e17055","#e84393"]},{name:"Japandi",colors:["#f3f0e8","#e6e4e0","#b9b99d","#e0cfc3","#dfcaba","#dcb482","#c09e85","#8f837a","#858480","#b0b9a8","#606c5a","#5e5e5e"]},{name:"Pastel",colors:["#FFB3BA","#FFDFBA","#FFFFBA","#BAFFC9","#BAE1FF","#E1BAFF","#FFBAE1","#C9BAFF"]},{name:"Vibrant",colors:["#FF6B6B","#4ECDC4","#45B7D1","#96CEB4","#FFEAA7","#DDA0DD","#98D8C8","#F7DC6F"]},{name:"Monochrome",colors:["#000000","#2C2C2C","#4A4A4A","#6B6B6B","#8C8C8C","#ADADAD","#CECECE","#EFEFEF","#FFFFFF"]},{name:"Ocean",colors:["#003f5c","#2f4b7c","#665191","#a05195","#d45087","#f95d6a","#ff7c43","#ffa600"]},{name:"Sunset",colors:["#264653","#2a9d8f","#e9c46a","#f4a261","#e76f51","#e63946","#f77f00","#fcbf49"]},{name:"Forest",colors:["#1b4332","#2d5016","#52734d","#78a55a","#87a96b","#a2c579","#b7d28d","#cfe1b9"]}],qi=["Material","Vibrant","Japandi"],Ki=["Flat UI","D3 Classic","Material"];function r1(n){let e=parseInt(n.slice(1,3),16)/255,t=parseInt(n.slice(3,5),16)/255,o=parseInt(n.slice(5,7),16)/255,r=i=>i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4);return .2126*r(e)+.7152*r(t)+.0722*r(o)}function _n(n){return r1(n)>.4?"#000":"#fff"}var fe=require("react/jsx-runtime");function Yi({entry:n,onSelect:e,onEditClick:t}){let{name:o,count:r,color:i,isSelected:a,isHidden:s,colorMapping:l}=n,u=_n(i),c=(0,Yt.useCallback)(()=>{e(o)},[e,o]),p=(0,Yt.useCallback)(v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),e(o))},[e,o]),d=(0,Yt.useCallback)(v=>{v.stopPropagation(),t(o,v.currentTarget)},[t,o]),g=(0,Yt.useCallback)(v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),v.stopPropagation(),t(o,v.currentTarget))},[t,o]),m=["legend-pill",a&&"legend-pill--selected",s&&"legend-pill--hidden"].filter(Boolean).join(" ");return(0,fe.jsxs)("div",{className:m,style:{"--legend-pill-color":i,"--legend-pill-text":u},role:"button",tabIndex:0,onClick:c,onKeyDown:p,"data-testid":`legend-category-${o}`,children:[(0,fe.jsx)("span",{className:"legend-pill__dot"}),(0,fe.jsx)("span",{className:"legend-pill__name",children:o}),l?(0,fe.jsxs)(fe.Fragment,{children:[l.type==="sequential"||l.type==="diverging"?(0,fe.jsx)("span",{className:"legend-pill__gradient-bar",style:{background:l.type==="sequential"?`linear-gradient(to right, ${i}, #fff)`:`linear-gradient(to right, #2196F3, #fff, ${i})`}}):(0,fe.jsxs)("span",{className:"legend-pill__multi-dots",children:[(0,fe.jsx)("span",{className:"legend-pill__multi-dot",style:{background:i}}),(0,fe.jsx)("span",{className:"legend-pill__multi-dot",style:{background:"#4ECDC4"}}),(0,fe.jsx)("span",{className:"legend-pill__multi-dot",style:{background:"#45B7D1"}})]}),(0,fe.jsx)("span",{className:"legend-pill__prop-name",children:l.property})]}):(0,fe.jsx)("span",{className:"legend-pill__count",children:r}),(0,fe.jsx)("span",{className:"legend-pill__separator"}),(0,fe.jsx)("button",{className:"legend-pill__brush",onClick:d,onKeyDown:g,tabIndex:0,"aria-label":`Edit style for ${o}`,children:"\u270E"})]})}var Xt=require("react");var ct=require("react/jsx-runtime");function Xi({entry:n,onSelect:e,onEditClick:t}){let{name:o,count:r,color:i,isSelected:a}=n,s=_n(i),l=(0,Xt.useCallback)(()=>{e(o)},[e,o]),u=(0,Xt.useCallback)(m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),e(o))},[e,o]),c=(0,Xt.useCallback)(m=>{m.stopPropagation(),t(o,m.currentTarget)},[t,o]),p=(0,Xt.useCallback)(m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),m.stopPropagation(),t(o,m.currentTarget))},[t,o]),d=["legend-pill",a&&"legend-pill--selected"].filter(Boolean).join(" ");return(0,ct.jsxs)("div",{className:d,style:{"--legend-pill-color":i,"--legend-pill-text":s},role:"button",tabIndex:0,onClick:l,onKeyDown:u,"data-testid":`legend-relationship-${o}`,children:[(0,ct.jsx)("span",{className:"legend-pill__line"}),(0,ct.jsx)("span",{className:"legend-pill__name",children:o}),(0,ct.jsx)("span",{className:"legend-pill__count",children:r}),(0,ct.jsx)("span",{className:"legend-pill__separator"}),(0,ct.jsx)("button",{className:"legend-pill__brush",onClick:c,onKeyDown:p,tabIndex:0,"aria-label":`Edit style for ${o}`,children:"\u270E"})]})}var tt=require("react");var pe=require("react");var wo=require("react/jsx-runtime");function $i({colors:n,selected:e,onSelect:t}){return(0,wo.jsx)("div",{className:"swatch-grid",role:"group","aria-label":"Color swatches",children:n.map(o=>{let r=e?.toLowerCase()===o.toLowerCase();return(0,wo.jsx)("button",{className:`swatch-grid__item${r?" swatch-grid__item--selected":""}`,style:{background:o},"aria-label":o,"aria-pressed":r,onClick:()=>t(o)},o)})})}var dt=require("react/jsx-runtime");function Zi({values:n,onColorChange:e}){return n.length===0?(0,dt.jsx)("div",{className:"prop-value-list__empty",children:"No values found"}):(0,dt.jsx)("div",{className:"prop-value-list",role:"list",children:n.map(t=>(0,dt.jsxs)("div",{className:"prop-value-list__row",role:"listitem",children:[(0,dt.jsx)("span",{className:"prop-value-list__swatch",style:{background:t.color},title:`Color: ${t.color}`}),(0,dt.jsx)("span",{className:"prop-value-list__name",title:t.value,children:t.value}),(0,dt.jsx)("span",{className:"prop-value-list__count",children:t.count})]},t.value))})}var et=require("react/jsx-runtime"),zn=[{name:"viridis",stops:"linear-gradient(to right, #440154, #31688e, #fde725)",colorFrom:"#440154",colorTo:"#fde725"},{name:"plasma",stops:"linear-gradient(to right, #0d0887, #9c179e, #f0f921)",colorFrom:"#0d0887",colorTo:"#f0f921"},{name:"blue-pink",stops:"linear-gradient(to right, #2563eb, #ec4899)",colorFrom:"#2563eb",colorTo:"#ec4899"}];function Qi({onScaleChange:n,activeScheme:e,domain:t}){let o=zn.find(a=>a.name===e)??zn[0],[r,i]=t??[0,1];return(0,et.jsxs)("div",{className:"gradient-picker",children:[(0,et.jsx)("div",{className:"gradient-picker__presets",role:"group","aria-label":"Gradient presets",children:zn.map(a=>{let s=a.name===o.name;return(0,et.jsx)("button",{className:`gradient-picker__strip${s?" gradient-picker__strip--active":""}`,style:{background:a.stops},"aria-label":`Gradient: ${a.name}`,"aria-pressed":s,onClick:()=>n(a.name)},a.name)})}),(0,et.jsx)("div",{className:"gradient-picker__active-bar",style:{background:o.stops}}),(0,et.jsxs)("div",{className:"gradient-picker__labels",children:[(0,et.jsx)("span",{className:"gradient-picker__label",children:r}),(0,et.jsx)("span",{className:"gradient-picker__label",children:i})]})]})}function Ji(n){let e=zn.find(t=>t.name===n);return e?{colorFrom:e.colorFrom,colorTo:e.colorTo}:{colorFrom:"#440154",colorTo:"#fde725"}}var Dn=te(require("react"));var ea={"legend.section.nodes":"\u8282\u70B9","legend.section.edges":"\u5173\u7CFB","legend.section.tags":"\u6807\u7B7E","legend.color.default":"\u9ED8\u8BA4\u989C\u8272","legend.color.byProperty":"\u6309\u5C5E\u6027\u7740\u8272","legend.color.discrete":"\u79BB\u6563","legend.color.gradient":"\u6E10\u53D8","legend.tab.color":"\u989C\u8272","legend.tab.size":"\u5927\u5C0F","legend.tab.caption":"\u6807\u9898","legend.tab.width":"\u5BBD\u5EA6","legend.palette":"\u8C03\u8272\u677F","legend.customColor":"\u81EA\u5B9A\u4E49\u989C\u8272","legend.resetColor":"\u91CD\u7F6E\u989C\u8272","legend.nMore":"\u8FD8\u6709 {n} \u4E2A...","legend.sizeByProperty":"\u6309\u5C5E\u6027\u8BBE\u7F6E\u5927\u5C0F","legend.widthByProperty":"\u6309\u5C5E\u6027\u8BBE\u7F6E\u5BBD\u5EA6","legend.apply":"\u5E94\u7528","legend.appliesToAll":"\u5E94\u7528\u4E8E\u6240\u6709\u8282\u70B9","legend.captionComingSoon":"\u6807\u9898\u6E32\u67D3\u5373\u5C06\u63A8\u51FA","legend.defaultSize":"\u9ED8\u8BA4\u5927\u5C0F","legend.defaultWidth":"\u9ED8\u8BA4\u5BBD\u5EA6","legend.captionProperty":"\u6807\u9898\u5C5E\u6027","legend.property":"\u5C5E\u6027","legend.activeCaptions":"\u5DF2\u542F\u7528\u6807\u9898","legend.addCaption":"\u6DFB\u52A0\u6807\u9898","legend.clearAll":"\u6E05\u9664\u5168\u90E8","legend.remove":"\u79FB\u9664","legend.noProperties":"\u65E0\u53EF\u7528\u5C5E\u6027","legend.appliesToCategory":"\u5E94\u7528\u4E8E\u6B64\u7C7B\u522B"};var ta={"legend.section.nodes":"NODOS","legend.section.edges":"ARISTAS","legend.section.tags":"ETIQUETAS","legend.color.default":"Color predeterminado","legend.color.byProperty":"Color por propiedad","legend.color.discrete":"Discreto","legend.color.gradient":"Degradado","legend.tab.color":"Color","legend.tab.size":"Tama\xF1o","legend.tab.caption":"Etiqueta","legend.tab.width":"Ancho","legend.palette":"Paleta","legend.customColor":"Color personalizado","legend.resetColor":"Restablecer color","legend.nMore":"+{n} m\xE1s...","legend.sizeByProperty":"Tama\xF1o por propiedad","legend.widthByProperty":"Ancho por propiedad","legend.apply":"Aplicar","legend.appliesToAll":"Se aplica a todos los nodos","legend.captionComingSoon":"Renderizado de etiquetas pr\xF3ximamente","legend.defaultSize":"Tama\xF1o predeterminado","legend.defaultWidth":"Ancho predeterminado","legend.captionProperty":"Propiedad de etiqueta","legend.property":"Propiedad","legend.activeCaptions":"Etiquetas activas","legend.addCaption":"A\xF1adir etiqueta","legend.clearAll":"Borrar todo","legend.remove":"Quitar","legend.noProperties":"No hay propiedades disponibles","legend.appliesToCategory":"Se aplica a esta categor\xEDa"};var Fn={"legend.section.nodes":"NODES","legend.section.edges":"EDGES","legend.section.tags":"TAGS","legend.color.default":"Default Color","legend.color.byProperty":"Color by Property","legend.color.discrete":"Discrete","legend.color.gradient":"Gradient","legend.tab.color":"Color","legend.tab.size":"Size","legend.tab.caption":"Caption","legend.tab.width":"Width","legend.palette":"Palette","legend.customColor":"Custom Color","legend.resetColor":"Reset Color","legend.nMore":"+{n} more...","legend.sizeByProperty":"Size by Property","legend.widthByProperty":"Width by Property","legend.apply":"Apply","legend.appliesToAll":"Applies to all nodes","legend.captionComingSoon":"Caption rendering coming soon","legend.defaultSize":"Default Size","legend.defaultWidth":"Default Width","legend.captionProperty":"Caption Property","legend.property":"Property","legend.activeCaptions":"Active Captions","legend.addCaption":"Add Caption","legend.clearAll":"Clear All","legend.remove":"Remove","legend.noProperties":"No properties available","legend.appliesToCategory":"Applies to this category"},s1={en:Fn,zh:ea,es:ta};function na(n,e){return{...n&&s1[n]||Fn,...e}}var So=Dn.default.createContext({t:n=>Fn[n]??n});function qe(){return(0,Dn.useContext)(So)}function oa(n,e,t){let o=n?.[e]??Fn[e]??e;return l1(o,t)}function l1(n,e){return e?n.replace(/\{(\w+)\}/g,(t,o)=>{let r=e[o];return r===void 0?`{${o}}`:String(r)}):n}var Z=require("react/jsx-runtime"),ra="legend-palette";function c1(){try{return localStorage.getItem(ra)??"Material"}catch{return"Material"}}function d1(n){try{localStorage.setItem(ra,n)}catch{}}function ia({targetKey:n,isCategory:e,store:t,api:o}){let{t:r}=qe(),[i,a]=(0,pe.useState)("default"),[s,l]=(0,pe.useState)(c1),[u,c]=(0,pe.useState)(""),[p,d]=(0,pe.useState)("discrete"),[g,m]=(0,pe.useState)("viridis"),y=e?t.visualMapper.categoryColors.getColor(n):t.visualMapper.relationshipColors.getColor(n),v=(0,pe.useMemo)(()=>{let P=e?qi:Ki,D=En.map(T=>T.name).filter(T=>!P.includes(T));return[...P,...D]},[e]),h=(0,pe.useMemo)(()=>En.find(M=>M.name===s)?.colors??En[0].colors,[s]),b=(0,pe.useMemo)(()=>e?o.types.getNodeTypeProperties(n).map(P=>P.key):o.types.getEdgeTypeProperties(n).map(P=>P.key),[o,n,e]),f=(0,pe.useMemo)(()=>u&&b.includes(u)?u:b[0]??"",[u,b]),w=(0,pe.useMemo)(()=>{if(!f)return[];let P=e?t.data.nodes.filter(_=>_.category===n):t.data.edges.filter(_=>_.relationship===n),M=new Map;for(let _ of P){let N=String(_.properties[f]??"");M.set(N,(M.get(N)??0)+1)}let D=h,T=[],I=0;for(let[_,N]of M)T.push({value:_,color:D[I%D.length],count:N}),I++;return T.sort((_,N)=>N.count-_.count)},[f,e,n,t,h]),x=(0,pe.useMemo)(()=>{if(!f)return[0,1];let M=(e?t.data.nodes.filter(I=>I.category===n):t.data.edges.filter(I=>I.relationship===n)).map(I=>{let _=I.properties[f];return typeof _=="number"?_:parseFloat(String(_??0))||0});if(M.length===0)return[0,1];let D=Math.min(...M),T=Math.max(...M);return[D,T===D?D+1:T]},[f,e,n,t]),S=(0,pe.useCallback)(P=>{e?o.style.setCategoryColor(n,P):o.style.setRelationshipColor(n,P)},[o,n,e]),A=(0,pe.useCallback)(P=>{let M=P.target.value;l(M),d1(M)},[]),k=(0,pe.useCallback)(P=>{c(P.target.value)},[]),C=(0,pe.useCallback)(()=>{if(!f)return;let P={};for(let M of w)P[M.value]=M.color;e?o.style.colorNodesByProperty(f,{mode:"ordinal",category:n,colorMap:P}):o.style.colorEdgesByProperty(f,{mode:"ordinal",relationship:n,colorMap:P})},[f,w,e,n,o]),E=(0,pe.useCallback)(()=>{if(!f)return;let{colorFrom:P,colorTo:M}=Ji(g);e?o.style.colorNodesByProperty(f,{mode:"sequential",category:n,colorFrom:P,colorTo:M}):o.style.colorEdgesByProperty(f,{mode:"sequential",relationship:n,colorFrom:P,colorTo:M})},[f,g,e,n,o]);return(0,Z.jsxs)("div",{className:"color-tab","data-testid":"color-tab",children:[(0,Z.jsxs)("div",{className:"color-tab__mode-toggle",role:"tablist","aria-label":"Color mode",children:[(0,Z.jsx)("button",{role:"tab","aria-selected":i==="default",className:`color-tab__mode-btn${i==="default"?" color-tab__mode-btn--active":""}`,onClick:()=>a("default"),children:r("legend.color.default")}),(0,Z.jsx)("button",{role:"tab","aria-selected":i==="byProperty",className:`color-tab__mode-btn${i==="byProperty"?" color-tab__mode-btn--active":""}`,onClick:()=>a("byProperty"),children:r("legend.color.byProperty")})]}),i==="default"&&(0,Z.jsxs)("div",{className:"color-tab__default",children:[(0,Z.jsxs)("div",{className:"color-tab__palette-row",children:[(0,Z.jsxs)("label",{className:"color-tab__label",children:[r("legend.palette"),":"]}),(0,Z.jsx)("select",{className:"color-tab__select",value:s,onChange:A,"aria-label":"Select palette",children:v.map(P=>(0,Z.jsx)("option",{value:P,children:P},P))})]}),(0,Z.jsx)($i,{colors:h,selected:y,onSelect:S})]}),i==="byProperty"&&(0,Z.jsxs)("div",{className:"color-tab__by-property",children:[(0,Z.jsxs)("div",{className:"color-tab__palette-row",children:[(0,Z.jsxs)("label",{className:"color-tab__label",children:[r("legend.property"),":"]}),(0,Z.jsxs)("select",{className:"color-tab__select",value:f,onChange:k,"aria-label":"Select property",children:[b.length===0&&(0,Z.jsx)("option",{value:"",children:"No properties"}),b.map(P=>(0,Z.jsx)("option",{value:P,children:P},P))]})]}),(0,Z.jsxs)("div",{className:"color-tab__mode-toggle",role:"tablist","aria-label":"Coloring mode",children:[(0,Z.jsx)("button",{role:"tab","aria-selected":p==="discrete",className:`color-tab__mode-btn${p==="discrete"?" color-tab__mode-btn--active":""}`,onClick:()=>d("discrete"),children:r("legend.color.discrete")}),(0,Z.jsx)("button",{role:"tab","aria-selected":p==="gradient",className:`color-tab__mode-btn${p==="gradient"?" color-tab__mode-btn--active":""}`,onClick:()=>d("gradient"),children:r("legend.color.gradient")})]}),p==="discrete"&&(0,Z.jsxs)("div",{className:"color-tab__discrete",children:[(0,Z.jsx)(Zi,{values:w}),(0,Z.jsx)("button",{className:"color-tab__apply-btn",onClick:C,disabled:!f,children:r("legend.apply")})]}),p==="gradient"&&(0,Z.jsxs)("div",{className:"color-tab__gradient",children:[(0,Z.jsx)(Qi,{onScaleChange:m,activeScheme:g,domain:x}),(0,Z.jsx)("button",{className:"color-tab__apply-btn",onClick:E,disabled:!f,children:r("legend.apply")})]})]})]})}var Ne=require("react");var re=require("react/jsx-runtime"),p1=10,u1=5,g1=25;function aa({targetKey:n,store:e,api:t}){let{t:o}=qe(),[r,i]=(0,Ne.useState)(p1),[a,s]=(0,Ne.useState)(!1),[l,u]=(0,Ne.useState)(""),[c,p]=(0,Ne.useState)(u1),[d,g]=(0,Ne.useState)(g1),m=(0,Ne.useMemo)(()=>t.types.getNodeTypeProperties(n).map(f=>f.key),[t,n]),y=(0,Ne.useMemo)(()=>l&&m.includes(l)?l:m[0]??"",[l,m]),v=(0,Ne.useCallback)(f=>{let w=Number(f.target.value);i(w);let x=e.data.nodes.filter(S=>S.category===n);for(let S of x)t.style.setNodeSize(S.id,w)},[t,e,n]),h=(0,Ne.useCallback)(()=>{y&&t.style.sizeNodesByProperty(y,{minSize:c,maxSize:d,category:n})},[t,y,c,d,n]),b="legend-tab-property-select";return(0,re.jsxs)("div",{className:"size-tab","data-testid":"size-tab",style:{padding:"8px 10px 10px"},children:[(0,re.jsxs)("div",{style:{marginBottom:10},children:[(0,re.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,re.jsx)("label",{className:"color-tab__label",children:o("legend.defaultSize")}),(0,re.jsx)("span",{className:"color-tab__label",children:r})]}),(0,re.jsx)("input",{type:"range",className:"legend-tab-slider",min:1,max:50,value:r,onChange:v,"aria-label":"Default node size"}),(0,re.jsx)("p",{className:"size-tab__note",children:o("legend.appliesToCategory")})]}),(0,re.jsx)("div",{style:{marginBottom:6},children:(0,re.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontSize:12},children:[(0,re.jsx)("input",{type:"checkbox",checked:a,onChange:f=>s(f.target.checked),"aria-label":"Size by property"}),o("legend.sizeByProperty")]})}),a&&(0,re.jsxs)("div",{className:"size-tab__by-property",children:[(0,re.jsxs)("div",{style:{marginBottom:6},children:[(0,re.jsxs)("label",{className:"color-tab__label",style:{display:"block",marginBottom:4},children:[o("legend.property"),":"]}),(0,re.jsxs)("select",{className:b,value:y,onChange:f=>u(f.target.value),"aria-label":"Select property for sizing",children:[m.length===0&&(0,re.jsx)("option",{value:"",children:"No properties"}),m.map(f=>(0,re.jsx)("option",{value:f,children:f},f))]})]}),(0,re.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[(0,re.jsx)("label",{className:"color-tab__label",style:{flexShrink:0},children:"Min:"}),(0,re.jsx)("input",{type:"number",className:b,min:1,max:49,value:c,onChange:f=>p(Number(f.target.value)),"aria-label":"Minimum node size",style:{width:60}}),(0,re.jsx)("label",{className:"color-tab__label",style:{flexShrink:0},children:"Max:"}),(0,re.jsx)("input",{type:"number",className:b,min:2,max:50,value:d,onChange:f=>g(Number(f.target.value)),"aria-label":"Maximum node size",style:{width:60}})]}),(0,re.jsx)("button",{className:"color-tab__apply-btn",onClick:h,disabled:!y,"data-testid":"size-tab-apply",children:o("legend.apply")})]})]})}var Nn=require("react");var pt=require("react/jsx-runtime"),h1=1;function sa({targetKey:n,store:e,api:t}){let{t:o}=qe(),[r,i]=(0,Nn.useState)(()=>e.visualMapper.getRelationshipConfig(n)?.defaultWidth??h1),a=(0,Nn.useCallback)(s=>{let l=Number(s.target.value);i(l),t.style.setRelationshipWidth(n,l)},[t,n]);return(0,pt.jsx)("div",{className:"width-tab","data-testid":"width-tab",style:{padding:"8px 10px 10px"},children:(0,pt.jsxs)("div",{style:{marginBottom:10},children:[(0,pt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:4},children:[(0,pt.jsx)("label",{className:"color-tab__label",children:o("legend.defaultWidth")}),(0,pt.jsx)("span",{className:"color-tab__label",children:r})]}),(0,pt.jsx)("input",{type:"range",className:"legend-tab-slider",min:1,max:10,value:r,onChange:a,"aria-label":"Default relationship width"})]})})}var Ie=require("react");var me=require("react/jsx-runtime");function la({targetKey:n,isCategory:e,store:t,api:o}){let{t:r}=qe(),i=(0,Ie.useMemo)(()=>e?t.visualMapper.getCategoryConfig(n)?.captionConfig??null:t.visualMapper.getRelationshipConfig(n)?.captionConfig??null,[t,n,e]),[a,s]=(0,Ie.useState)(()=>i?.captions??[]),[l,u]=(0,Ie.useState)(""),c=(0,Ie.useMemo)(()=>e?o.types.getNodeTypeProperties(n).map(f=>f.key):o.types.getEdgeTypeProperties(n).map(f=>f.key),[o,n,e]),p=(0,Ie.useMemo)(()=>{let f=new Set(a.map(w=>w.source));return c.filter(w=>!f.has(`property:${w}`))},[c,a]),d=(0,Ie.useMemo)(()=>l&&p.includes(l)?l:p[0]??"",[l,p]),g=(0,Ie.useCallback)(f=>{if(e){let w=t.visualMapper.getCategoryConfig(n),x={captions:f};t.visualMapper.setCategoryConfig({...w,category:n,captionConfig:f.length>0?x:void 0},"user")}else{let w=t.visualMapper.getRelationshipConfig(n),x={captions:f};t.visualMapper.setRelationshipConfig({...w,relationship:n,captionConfig:f.length>0?x:void 0},"user")}t.notifyChange()},[t,n,e]),m=(0,Ie.useCallback)(()=>{if(!d)return;let f={source:`property:${d}`,whenEmpty:"hide"},w=[...a,f];s(w),u(""),g(w)},[d,a,g]),y=(0,Ie.useCallback)(f=>{let w=a.filter((x,S)=>S!==f);s(w),g(w)},[a,g]),v=(0,Ie.useCallback)(()=>{s([]),g([])},[g]),h=f=>f.startsWith("property:")?f.slice(9):f;return(0,me.jsxs)("div",{className:"caption-tab","data-testid":"caption-tab",style:{padding:"8px 10px 10px"},children:[a.length>0&&(0,me.jsxs)("div",{style:{marginBottom:8},children:[(0,me.jsxs)("label",{className:"color-tab__label",style:{display:"block",marginBottom:4},children:[r("legend.activeCaptions"),":"]}),(0,me.jsx)("div",{className:"caption-tab__list",children:a.map((f,w)=>(0,me.jsxs)("div",{className:"caption-tab__item",children:[(0,me.jsx)("span",{className:"caption-tab__item-name",children:h(f.source)}),(0,me.jsx)("button",{className:"caption-tab__item-remove",onClick:()=>y(w),"aria-label":`Remove ${h(f.source)}`,title:r("legend.remove"),children:"\u2715"})]},w))}),(0,me.jsx)("button",{className:"caption-tab__clear-btn",onClick:v,"data-testid":"caption-tab-clear",children:r("legend.clearAll")})]}),p.length>0&&(0,me.jsxs)("div",{children:[(0,me.jsxs)("label",{className:"color-tab__label",style:{display:"block",marginBottom:4},children:[r("legend.addCaption"),":"]}),(0,me.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,me.jsx)("select",{className:"legend-tab-property-select",style:{flex:1},value:d,onChange:f=>u(f.target.value),"aria-label":"Select caption property",children:p.map(f=>(0,me.jsx)("option",{value:f,children:f},f))}),(0,me.jsx)("button",{className:"color-tab__apply-btn",style:{width:"auto",padding:"4px 12px",marginTop:0},onClick:m,disabled:!d,"data-testid":"caption-tab-add",children:"+"})]})]}),a.length===0&&p.length===0&&(0,me.jsx)("p",{className:"size-tab__note",children:r("legend.noProperties")})]})}var Pe=require("react/jsx-runtime"),f1=["color","size","caption"],m1=["color","width","caption"],v1={color:"legend.tab.color",size:"legend.tab.size",caption:"legend.tab.caption",width:"legend.tab.width"};function b1(n){(0,tt.useEffect)(()=>{let e=n.current;if(!e)return;let t=r=>r.stopPropagation(),o=["mousedown","wheel","contextmenu","pointerdown"];for(let r of o)e.addEventListener(r,t);return()=>{for(let r of o)e.removeEventListener(r,t)}},[n])}function ca({targetKey:n,position:e,flipped:t,store:o,api:r,onClose:i,isCategory:a,popoverRef:s,hasDraggedRef:l}){let{t:u}=qe(),c=a?[...f1]:[...m1],[p,d]=(0,tt.useState)(c[0]),g=(0,tt.useRef)(null),m=(0,tt.useRef)({x:0,y:0}),y=o.visualMapper,v=a?y.categoryColors.getColor(n):y.relationshipColors.getColor(n);return b1(s),(0,tt.useEffect)(()=>{m.current={x:0,y:0},s.current&&(s.current.style.transform="")},[n,s]),(0,tt.useEffect)(()=>{let h=g.current;if(!h)return;let b=f=>{f.preventDefault(),l.current=!1;let w=f.clientX,x=f.clientY,S=m.current.x,A=m.current.y,k=s.current,C=P=>{l.current=!0;let M=S+(P.clientX-w),D=A+(P.clientY-x);m.current={x:M,y:D},k&&(k.style.transform=`translate(${M}px, ${D}px)`)},E=()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",E)};return h.addEventListener("mousedown",b),()=>h.removeEventListener("mousedown",b)},[l,s]),(0,Pe.jsxs)("div",{ref:s,className:"legend-popover",style:{top:e.top,left:e.left},"data-testid":"style-popover",children:[(0,Pe.jsxs)("div",{ref:g,className:"legend-popover__header",style:{cursor:"move",userSelect:"none"},children:[(0,Pe.jsxs)("div",{className:"legend-popover__header-left",children:[(0,Pe.jsx)("span",{className:"legend-popover__dot",style:{background:v}}),(0,Pe.jsx)("span",{className:"legend-popover__name",title:n,children:n})]}),(0,Pe.jsx)("button",{className:"legend-popover__close","aria-label":"Close",onClick:i,children:"\u2715"})]}),(0,Pe.jsx)("div",{className:"legend-popover__tabs",role:"tablist",children:c.map(h=>{let b=h===p;return(0,Pe.jsx)("button",{role:"tab","aria-selected":b,className:["legend-popover__tab",b?"legend-popover__tab--active":""].filter(Boolean).join(" "),style:b?{background:`${v}26`}:void 0,onClick:()=>d(h),children:u(v1[h])},h)})}),(0,Pe.jsxs)("div",{className:"legend-popover__content",role:"tabpanel",children:[p==="color"&&(0,Pe.jsx)(ia,{targetKey:n,isCategory:a,store:o,api:r}),p==="size"&&a&&(0,Pe.jsx)(aa,{targetKey:n,isCategory:a,store:o,api:r}),p==="width"&&!a&&(0,Pe.jsx)(sa,{targetKey:n,isCategory:a,store:o,api:r}),p==="caption"&&(0,Pe.jsx)(la,{targetKey:n,isCategory:a,store:o,api:r})]})]})}var Te=require("react/jsx-runtime"),Ln=20;function da({store:n,api:e,visible:t=!0,locale:o,messages:r,minimapVisible:i=!1,iconAtlasManager:a}){let s=(0,ve.useMemo)(()=>na(o,r),[o,r]),l=(0,ve.useCallback)((M,D)=>oa(s,M,D),[s]),u=(0,ve.useMemo)(()=>({t:l}),[l]),{categories:c,relationships:p}=Wi(n,e),d=ji(),[g,m]=(0,ve.useState)(!1),[y,v]=(0,ve.useState)(!1),h=(0,ve.useCallback)(M=>{let T=n.queries.getNodesByCategory(M).map(I=>I.id);e.selection.selectNodes(T,"toggle")},[n,e]),b=(0,ve.useCallback)(M=>{let T=n.queries.getEdgesByRelationship(M).map(I=>I.id);e.selection.selectEdges(T,"toggle")},[n,e]),f=(0,ve.useCallback)((M,D)=>{d.toggle(M,D)},[d]),w=c.length===0&&p.length===0,x=!t||w,S=(0,ve.useMemo)(()=>g||c.length<=Ln?c:c.slice(0,Ln),[c,g]),A=c.length-S.length,k=(0,ve.useMemo)(()=>y||p.length<=Ln?p:p.slice(0,Ln),[p,y]),C=p.length-k.length,E=(0,ve.useRef)(null);(0,ve.useEffect)(()=>{let M=E.current;if(!M)return;let D=I=>I.stopPropagation(),T=["wheel","mousedown","contextmenu","pointerdown"];for(let I of T)M.addEventListener(I,D);return()=>{for(let I of T)M.removeEventListener(I,D)}},[]);let P=["legend-container",x&&"legend-hidden"].filter(Boolean).join(" ");return(0,Te.jsx)(So.Provider,{value:u,children:(0,Te.jsxs)("div",{className:P,"data-testid":"legend-panel",children:[(0,Te.jsxs)("div",{className:"legend-scroll-area",ref:E,style:{maxHeight:i?"50vh":"calc(100vh - 80px)"},children:[c.length>0&&(0,Te.jsxs)("div",{className:"legend-section",children:[(0,Te.jsx)("span",{className:"legend-section-label",children:l("legend.section.nodes")}),S.map(M=>(0,Te.jsx)(Yi,{entry:M,onSelect:h,onEditClick:f},M.name)),A>0&&(0,Te.jsx)("div",{className:"legend-pill legend-pill--overflow",role:"button",tabIndex:0,onClick:()=>m(!0),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),m(!0))},children:l("legend.nMore",{n:A})})]}),p.length>0&&(0,Te.jsxs)("div",{className:"legend-section",children:[(0,Te.jsx)("span",{className:"legend-section-label",children:l("legend.section.edges")}),k.map(M=>(0,Te.jsx)(Xi,{entry:M,onSelect:b,onEditClick:f},M.name)),C>0&&(0,Te.jsx)("div",{className:"legend-pill legend-pill--overflow",role:"button",tabIndex:0,onClick:()=>v(!0),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),v(!0))},children:l("legend.nMore",{n:C})})]})]}),d.isOpen&&d.position&&(0,Te.jsx)(ca,{targetKey:d.targetKey,position:d.position,flipped:d.flipped,store:n,api:e,onClose:d.close,isCategory:c.some(M=>M.name===d.targetKey),popoverRef:d.popoverRef,hasDraggedRef:d.hasDraggedRef,iconAtlasManager:a})]})})}var Q=require("react"),wa=te(require("react-dom")),ko=te(require("three"));var Po=te(require("three"));function pa(n,e,t,o,r){e.updateMatrixWorld(!1);let i=n.clone().applyMatrix4(e.matrixWorld).project(t);return{x:(i.x+1)/2*o,y:(1-i.y)/2*r,z:i.z}}var Co=te(require("react"));var It=require("react/jsx-runtime");function ua({node:n,data:e}){let t=e.rows??Object.entries(n.properties).map(([o,r])=>({label:o,value:r}));return(0,It.jsx)("div",{className:"gxr-card-body gxr-card-kv",children:t.map((o,r)=>(0,It.jsxs)("div",{className:"gxr-card-kv-row",children:[(0,It.jsx)("span",{className:"gxr-card-kv-k",children:o.label}),(0,It.jsx)("span",{className:"gxr-card-kv-v",children:String(o.value??"")})]},r))})}var vt=require("react/jsx-runtime");function ga({node:n,data:e}){let t=e.imageKey,o=t?n.properties[t]:n.image,r=e.title??n.caption,i=e.subtitle??n.category;return(0,vt.jsxs)("div",{className:"gxr-card-body gxr-card-media",children:[o&&(0,vt.jsx)("img",{src:o,alt:"",className:"gxr-card-media-img"}),(0,vt.jsxs)("div",{className:"gxr-card-media-cap",children:[(0,vt.jsx)("div",{className:"gxr-card-media-title",children:r}),i&&(0,vt.jsx)("div",{className:"gxr-card-media-sub",children:i})]})]})}var ut=require("react/jsx-runtime");function ha({data:n}){let e=n.items??[];return(0,ut.jsxs)("div",{className:"gxr-card-body gxr-card-list",children:[n.title&&(0,ut.jsx)("div",{className:"gxr-card-list-title",children:n.title}),e.map((t,o)=>(0,ut.jsxs)("div",{className:"gxr-card-list-row",children:[t.icon&&(0,ut.jsx)("span",{className:"gxr-card-list-ic",children:t.icon}),(0,ut.jsxs)("span",{children:[t.label&&(0,ut.jsxs)("span",{className:"gxr-card-list-label",children:[t.label," "]}),t.text]})]},o))]})}var we=require("react/jsx-runtime");function fa({node:n,data:e}){let t=e.imageKey,o=t?n.properties[t]:n.image,r=e.title??n.caption,i=e.subtitle??n.category,a=e.stamp,s=e.footer,l=e.badges??[],u=new Set([...e.omit??[],...t?[t]:[]]),c=e.fields??Object.entries(n.properties).filter(([p])=>!u.has(p)).map(([p,d])=>({label:p,value:d}));return(0,we.jsxs)("div",{className:"gxr-card-body gxr-card-dossier",children:[(0,we.jsxs)("div",{className:"gxr-card-dossier-head",children:[(0,we.jsx)("span",{className:"gxr-card-dossier-title",children:r}),i&&(0,we.jsx)("span",{className:"gxr-card-dossier-sub",children:i})]}),l.length>0&&(0,we.jsx)("div",{className:"gxr-card-dossier-badges",children:l.map((p,d)=>(0,we.jsx)("span",{className:"gxr-card-dossier-badge",children:p},d))}),(0,we.jsxs)("div",{className:"gxr-card-dossier-main",children:[o!=null&&(0,we.jsx)("img",{src:o,alt:"",className:"gxr-card-dossier-photo"}),(0,we.jsx)("div",{className:"gxr-card-kv",children:c.map((p,d)=>(0,we.jsxs)("div",{className:"gxr-card-kv-row",children:[(0,we.jsx)("span",{className:"gxr-card-kv-k",children:p.label}),(0,we.jsx)("span",{className:"gxr-card-kv-v",children:String(p.value??"")})]},d))})]}),a&&(0,we.jsx)("div",{className:"gxr-card-dossier-stamp",children:a}),s&&(0,we.jsx)("div",{className:"gxr-card-dossier-foot",children:s})]})}var Ke=require("react/jsx-runtime");function va({content:n,node:e}){switch(n.kind){case"preset":return e?n.preset==="property"?(0,Ke.jsx)(ua,{node:e,data:n.data}):n.preset==="media"?(0,Ke.jsx)(ga,{node:e,data:n.data}):n.preset==="dossier"?(0,Ke.jsx)(fa,{node:e,data:n.data}):(0,Ke.jsx)(ha,{node:e,data:n.data}):null;case"html":return(0,Ke.jsx)("div",{className:"gxr-card-body",dangerouslySetInnerHTML:{__html:n.html}});case"render":{let t=n.fn(e);return typeof t=="string"?(0,Ke.jsx)("div",{className:"gxr-card-body",dangerouslySetInnerHTML:{__html:t}}):(0,Ke.jsx)(ma,{el:t})}case"element":return(0,Ke.jsx)(ma,{el:n.el})}}function ma({el:n}){let e=Co.default.useRef(null);return Co.default.useEffect(()=>{let t=e.current;t&&(t.innerHTML="",t.appendChild(n))},[n]),(0,Ke.jsx)("div",{className:"gxr-card-body",ref:e})}var y1=["name","title","label","displayName","display_name","Name","Title","Label"];function $t(n){let e=n.properties;for(let t of y1)if(e[t]!=null&&String(e[t]).trim()!=="")return String(e[t]);for(let t of Object.keys(e)){let o=e[t];if(typeof o=="string"&&o.trim()!=="")return o}return n.category}var x1=/\.(jpg|jpeg|png|gif|webp|svg|bmp)(\?.*)?$/i,w1=/image|photo|avatar|picture|thumbnail|logo|img|portrait/i;function S1(n,e){if(typeof e!="string"||!e.startsWith("http://")&&!e.startsWith("https://"))return!1;try{let t=new URL(e).pathname;if(x1.test(t))return!0}catch{}return!!w1.test(n)}function On(n){for(let[e,t]of Object.entries(n))if(S1(e,t))return{key:e,url:t};return null}function ba(n,e){let t=n.queries.getNode(e);if(!t)return null;let o=t.properties??{};return{id:e,category:t.category??"",caption:$t(t)??e,properties:o,image:On(t.properties)?.url??null}}function P1(n,e,t){let o={right:e.width-n.x,left:n.x,bottom:e.height-n.y,top:n.y};return o.right>=t.width+16?"right":o.left>=t.width+16?"left":o.bottom>=o.top?"bottom":"top"}function ya(n){let{anchor:e,viewport:t,size:o,offset:r}=n;if(e.z>1||e.x<-o.width||e.x>t.width+o.width||e.y<-o.height||e.y>t.height+o.height)return{visible:!1,x:0,y:0,side:"right"};let i=n.placement==="auto"?P1(e,t,o):n.placement;if(i==="center")return{visible:!0,x:e.x-o.width/2+r[0],y:e.y-o.height/2+r[1],side:i};let a=e.x,s=e.y;return i==="right"?(a=e.x+r[0],s=e.y-o.height/2+r[1]):i==="left"?(a=e.x-r[0]-o.width,s=e.y-o.height/2+r[1]):i==="bottom"?(a=e.x-o.width/2+r[0],s=e.y+r[1]):(a=e.x-o.width/2+r[0],s=e.y-r[1]-o.height),a=Math.max(0,Math.min(a,t.width-o.width)),s=Math.max(0,Math.min(s,t.height-o.height)),{visible:!0,x:a,y:s,side:i}}var Et=require("react/jsx-runtime"),Gn=new ko.Vector3,xa=new ko.Vector3;function C1(n,e,t,o){xa.copy(n).applyMatrix4(e.matrixWorld).applyMatrix4(t.matrixWorldInverse);let i=2*Math.max(-xa.z,.001)*Math.tan(t.fov*Math.PI/360);return o/i*e.matrixWorld.getMaxScaleOnAxis()}function k1(n,e){(0,Q.useEffect)(()=>{if(!e)return;let t=n.current;if(!t)return;let o=i=>i.stopPropagation(),r=["mousedown","wheel","contextmenu","pointerdown"];for(let i of r)t.addEventListener(i,o);return()=>{for(let i of r)t.removeEventListener(i,o)}},[n,e])}function R1(n){let e=n<.08?.08:n>12?12:n;return Math.round(e*1e4)/1e4}function A1({card:n,node:e,onMount:t,getDrag:o,setDrag:r,getAnchor:i}){let a=(0,Q.useRef)(null),s=(0,Q.useCallback)(u=>{a.current=u,t(n.id,u)},[n.id,t]);k1(a,n.interactive),(0,Q.useEffect)(()=>{if(!n.draggable)return;let u=a.current;if(!u)return;let c=p=>{let d=p.clientX,g=p.clientY,m=o(n.id),y=h=>{let b=m.dx+(h.clientX-d),f=m.dy+(h.clientY-g);r(n.id,b,f);let w=i(n.id);w&&a.current&&(a.current.style.transform=`translate(${w.x+b}px, ${w.y+f}px)`)},v=()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",y),document.addEventListener("mouseup",v)};return u.addEventListener("mousedown",c),()=>u.removeEventListener("mousedown",c)},[n.id,n.draggable,o,r,i]);let l={position:"absolute",top:0,left:0,maxWidth:n.maxWidth,pointerEvents:n.interactive?"auto":"none",cursor:n.draggable?"move":void 0,transformOrigin:n.scale>0?"50% 50%":void 0,...n.style};return(0,Et.jsx)("div",{ref:s,className:[n.variant==="card"?"gxr-card":void 0,n.className].filter(Boolean).join(" ")||void 0,style:l,children:(0,Et.jsx)(va,{content:n.content,node:e})})}function T1({manager:n,store:e,container:t,project:o=pa,handle:r}){let i=(0,Q.useContext)(on),a=r??i;if(!a)throw new Error("CardLayer must be rendered inside a GraphRenderer, or receive a `handle` prop.");let{cloudScene:s,camera:l,registerFrameCallback:u}=a,[c,p]=(0,Q.useState)(()=>n.getAll()),d=(0,Q.useRef)(c);d.current=c,(0,Q.useEffect)(()=>n.onChange(()=>p(n.getAll())),[n]);let g=(0,Q.useRef)(new Map),m=(0,Q.useRef)(new Map),y=(0,Q.useRef)(new Map),v=(0,Q.useCallback)((S,A)=>{A?g.current.set(S,A):(g.current.delete(S),y.current.delete(S))},[]),h=(0,Q.useCallback)(S=>y.current.get(S)??{dx:0,dy:0},[]),b=(0,Q.useCallback)((S,A,k)=>{y.current.set(S,{dx:A,dy:k})},[]),f=(0,Q.useCallback)(S=>m.current.get(S),[]),w=(0,Q.useRef)([]);if((0,Q.useEffect)(()=>{let S=c.filter(k=>k.hideNode&&k.nodeId).map(k=>k.nodeId),A=w.current;A.length===0&&S.length===0||(A.length&&e.setNodeFillSuppressed(A,!1),S.length&&e.setNodeFillSuppressed(S,!0),w.current=S)},[c,e]),(0,Q.useEffect)(()=>()=>{w.current.length&&(e.setNodeFillSuppressed(w.current,!1),w.current=[])},[e]),(0,Q.useEffect)(()=>(u("gxr-cards",()=>{if(!t)return;let S=t.clientWidth,A=t.clientHeight,k=e.positionProvider?.getPositions?.()??null;for(let C of d.current){let E=g.current.get(C.id);if(!E)continue;if(C.position)Gn.set(C.position[0],C.position[1],C.position[2]);else{if(!k){E.style.display="none";continue}let N=e.index.getNodeIndex(C.nodeId);if(N===void 0||N<0){E.style.display="none";continue}Gn.set(k[N*3],k[N*3+1],k[N*3+2])}let P=o(Gn,s,l,S,A),M={width:E.offsetWidth,height:E.offsetHeight},D=ya({anchor:P,viewport:{width:S,height:A},size:M,placement:C.placement,offset:C.offset});m.current.set(C.id,{x:D.x,y:D.y,visible:D.visible});let T=y.current.get(C.id),I=T?T.dx:0,_=T?T.dy:0;if(D.visible){E.style.display="";let N="";if(C.scale>0&&M.width>0){let R=C.scale*C1(Gn,s,l,A);N=` scale(${R1(R/M.width)})`}E.style.transform=`translate(${D.x+I}px, ${D.y+_}px)${N}`}else E.style.display="none"}}),()=>{u("gxr-cards",null)}),[u,t,e,s,l,o]),!t)return null;let x=(0,Et.jsx)("div",{className:"gxr-cards-root",style:{position:"absolute",inset:0,pointerEvents:"none"},children:c.map(S=>{let A=S.nodeId?ba(e,S.nodeId):null;return S.nodeId&&!A?null:(0,Et.jsx)(A1,{card:S,node:A,onMount:v,getDrag:h,setDrag:b,getAnchor:f},S.id)})});return wa.createPortal(x,t)}function M1(){(0,Q.useEffect)(()=>{if(typeof document>"u"||document.getElementById("gxr-cards-style"))return;let n=document.createElement("style");n.id="gxr-cards-style",n.textContent=`
32
+ .gxr-card {
33
+ background: var(--gxr-panel-bg, #16191f);
34
+ border: 1px solid var(--gxr-panel-border, #2a2d35);
35
+ border-radius: 8px;
36
+ box-shadow: var(--gxr-shadow, 0 4px 16px rgba(0,0,0,0.45));
37
+ font-family: inherit;
38
+ font-size: 13px;
39
+ color: var(--gxr-text-primary, #e2e5eb);
40
+ overflow: hidden;
41
+ }
42
+ .gxr-card-body {
43
+ padding: 10px 12px;
44
+ }
45
+ .gxr-card-kv-row {
46
+ display: flex;
47
+ justify-content: space-between;
48
+ align-items: baseline;
49
+ gap: 8px;
50
+ padding: 3px 0;
51
+ }
52
+ .gxr-card-kv-k {
53
+ color: var(--gxr-text-muted, #7a7f8a);
54
+ flex-shrink: 0;
55
+ max-width: 50%;
56
+ overflow: hidden;
57
+ text-overflow: ellipsis;
58
+ white-space: nowrap;
59
+ }
60
+ .gxr-card-kv-v {
61
+ color: var(--gxr-text-secondary, #b4b9c6);
62
+ text-align: right;
63
+ overflow: hidden;
64
+ text-overflow: ellipsis;
65
+ white-space: nowrap;
66
+ }
67
+ .gxr-card-media-img {
68
+ width: 100%;
69
+ display: block;
70
+ object-fit: cover;
71
+ }
72
+ .gxr-card-media-title {
73
+ font-weight: 600;
74
+ padding: 8px 12px 2px;
75
+ color: var(--gxr-text-primary, #e2e5eb);
76
+ }
77
+ .gxr-card-media-sub {
78
+ padding: 0 12px 8px;
79
+ color: var(--gxr-text-muted, #7a7f8a);
80
+ font-size: 12px;
81
+ }
82
+ .gxr-card-list-title {
83
+ font-weight: 600;
84
+ padding: 8px 12px 4px;
85
+ color: var(--gxr-text-primary, #e2e5eb);
86
+ border-bottom: 1px solid var(--gxr-panel-divider, #23262e);
87
+ }
88
+ .gxr-card-list-row {
89
+ display: flex;
90
+ align-items: center;
91
+ gap: 6px;
92
+ padding: 4px 12px;
93
+ color: var(--gxr-text-secondary, #b4b9c6);
94
+ }
95
+ .gxr-card-list-label {
96
+ flex: 1;
97
+ overflow: hidden;
98
+ text-overflow: ellipsis;
99
+ white-space: nowrap;
100
+ }
101
+ .gxr-card-list-ic {
102
+ flex-shrink: 0;
103
+ color: var(--gxr-text-muted, #7a7f8a);
104
+ }
105
+ .gxr-card-dossier {
106
+ padding: 0;
107
+ position: relative;
108
+ }
109
+ .gxr-card-dossier-head {
110
+ display: flex;
111
+ align-items: baseline;
112
+ justify-content: space-between;
113
+ gap: 8px;
114
+ padding: 7px 12px;
115
+ background: var(--gxr-accent, #d8b24a);
116
+ color: var(--gxr-accent-text, #13171c);
117
+ }
118
+ .gxr-card-dossier-title {
119
+ font-weight: 700;
120
+ letter-spacing: 0.02em;
121
+ overflow: hidden;
122
+ text-overflow: ellipsis;
123
+ white-space: nowrap;
124
+ }
125
+ .gxr-card-dossier-sub {
126
+ font-size: 11px;
127
+ font-weight: 600;
128
+ opacity: 0.78;
129
+ flex-shrink: 0;
130
+ }
131
+ .gxr-card-dossier-badges {
132
+ display: flex;
133
+ flex-wrap: wrap;
134
+ gap: 4px;
135
+ padding: 8px 12px 0;
136
+ }
137
+ .gxr-card-dossier-badge {
138
+ font-size: 10px;
139
+ font-weight: 600;
140
+ letter-spacing: 0.04em;
141
+ padding: 2px 6px;
142
+ border-radius: 3px;
143
+ background: var(--gxr-panel-divider, #23262e);
144
+ color: var(--gxr-text-secondary, #b4b9c6);
145
+ }
146
+ .gxr-card-dossier-main {
147
+ display: flex;
148
+ gap: 10px;
149
+ padding: 10px 12px;
150
+ }
151
+ .gxr-card-dossier-photo {
152
+ width: 34%;
153
+ max-width: 108px;
154
+ align-self: flex-start;
155
+ aspect-ratio: 1 / 1.28;
156
+ object-fit: cover;
157
+ border: 1px solid var(--gxr-accent, #d8b24a);
158
+ background: var(--gxr-panel-divider, #23262e);
159
+ }
160
+ .gxr-card-dossier-main .gxr-card-kv {
161
+ flex: 1;
162
+ min-width: 0;
163
+ }
164
+ .gxr-card-dossier-stamp {
165
+ position: absolute;
166
+ left: 50%;
167
+ top: 62%;
168
+ transform: translate(-50%, -50%) rotate(-22deg);
169
+ font-size: 22px;
170
+ font-weight: 800;
171
+ letter-spacing: 0.08em;
172
+ color: var(--gxr-accent, #d8b24a);
173
+ opacity: 0.22;
174
+ pointer-events: none;
175
+ white-space: nowrap;
176
+ }
177
+ .gxr-card-dossier-foot {
178
+ padding: 0 12px 8px;
179
+ font-size: 11px;
180
+ color: var(--gxr-text-muted, #7a7f8a);
181
+ }
182
+ `,document.head.appendChild(n)},[])}function Sa(n){M1();let[e,t]=(0,Q.useState)(()=>n.manager.getAll().length>0);return(0,Q.useEffect)(()=>n.manager.onChange(()=>t(n.manager.getAll().length>0)),[n.manager]),e?(0,Et.jsx)(T1,{...n}):null}var ue=require("react");var Ro={"nodeInfo.properties":"Properties","nodeInfo.relations":"Relations","nodeInfo.expandNeighbors":"\u2197 Expand neighbors"};var Pa={"nodeInfo.properties":"\u5C5E\u6027","nodeInfo.relations":"\u5173\u7CFB","nodeInfo.expandNeighbors":"\u2197 \u6269\u5C55\u90BB\u5C45"};var Ca={"nodeInfo.properties":"Propiedades","nodeInfo.relations":"Relaciones","nodeInfo.expandNeighbors":"\u2197 Expandir vecinos"};var K=require("react/jsx-runtime"),z1={en:Ro,zh:Pa,es:Ca};function D1(n,e,t){let o=n&&z1[n]||void 0;return e?.[t]??o?.[t]??Ro[t]??t}function F1(n){(0,ue.useEffect)(()=>{let e=n.current;if(!e)return;let t=r=>r.stopPropagation(),o=["mousedown","wheel","contextmenu","pointerdown"];for(let r of o)e.addEventListener(r,t);return()=>{for(let r of o)e.removeEventListener(r,t)}},[n])}function ka(n,e){let t=n.index.getNodeIndex(e),o=n.nodeState;if(t===void 0||!o)return"var(--gxr-accent)";let r=o.colors,i=Math.round((r[t*3]??0)*255),a=Math.round((r[t*3+1]??0)*255),s=Math.round((r[t*3+2]??0)*255);return`rgb(${i}, ${a}, ${s})`}function Ra({manager:n,store:e,container:t,showExpandNeighbors:o,onExpandNeighbors:r,locale:i,messages:a}){let[s,l]=(0,ue.useState)(n.state),u=(0,ue.useRef)(!1);return(0,ue.useEffect)(()=>n.onChange(()=>l({...n.state})),[n]),!s.visible||!s.nodeId?null:(0,K.jsx)(N1,{nodeId:s.nodeId,rawPosition:s.position,store:e,container:t,manager:n,hasDraggedRef:u,showExpandNeighbors:o,onExpandNeighbors:r,locale:i,messages:a})}function N1({nodeId:n,rawPosition:e,store:t,container:o,manager:r,hasDraggedRef:i,showExpandNeighbors:a,onExpandNeighbors:s,locale:l,messages:u}){let c=T=>D1(l,u,T),p=(0,ue.useRef)(null),d=(0,ue.useRef)({x:0,y:0}),[g,m]=(0,ue.useState)(!1),[y,v]=(0,ue.useState)({left:e.x,top:e.y});(0,ue.useEffect)(()=>{m(!1)},[n]),(0,ue.useLayoutEffect)(()=>{if(!p.current)return;let T=p.current.getBoundingClientRect(),I=o?o.clientWidth:window.innerWidth,_=o?o.clientHeight:window.innerHeight,N=e.x,R=e.y;N+T.width+8>I&&(N=Math.max(0,N-T.width)),R+T.height+8>_&&(R=Math.max(0,R-T.height)),v({left:N,top:R})},[e,n,o]),(0,ue.useEffect)(()=>{let T=_=>{if(i.current){i.current=!1;return}p.current&&!p.current.contains(_.target)&&r.hide()},I=setTimeout(()=>document.addEventListener("mousedown",T),50);return()=>{clearTimeout(I),document.removeEventListener("mousedown",T)}},[r]),(0,ue.useEffect)(()=>{let T=I=>{I.key==="Escape"&&r.hide()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[r]),F1(p),(0,ue.useEffect)(()=>{d.current={x:0,y:0},p.current&&(p.current.style.transform="")},[n]);let h=(0,ue.useRef)(null);(0,ue.useEffect)(()=>{let T=h.current;if(!T)return;let I=_=>{if(_.target.closest("[data-no-drag]"))return;_.preventDefault(),i.current=!1;let N=_.clientX,R=_.clientY,z=d.current.x,G=d.current.y,F=p.current,H=U=>{i.current=!0;let q=z+(U.clientX-N),Se=G+(U.clientY-R);d.current={x:q,y:Se},F&&(F.style.transform=`translate(${q}px, ${Se}px)`)},O=()=>{document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",O)};return T.addEventListener("mousedown",I),()=>T.removeEventListener("mousedown",I)},[]);let b=t.queries.getNode(n);if(!b)return null;let f=$t(b),w=On(b.properties),x=w&&!g,S=ka(t,n),A=b.properties._source,k=A==null?"":String(A),C=Object.entries(b.properties).filter(([T,I])=>!(T.startsWith("_")||w&&T===w.key||String(I??"")===f)),E=new Set,P=[];for(let T of t.queries.getNeighbors(n)){if(E.has(T.nodeId))continue;let I=t.queries.getNode(T.nodeId);I&&(E.add(T.nodeId),P.push({id:T.nodeId,title:$t(I),category:I.category,color:ka(t,T.nodeId)}))}let M=T=>{t.selectNodes([T]),r.show(T,e)},D="14px 16px";return(0,K.jsxs)("div",{ref:p,"data-testid":"node-info-panel",style:{position:"absolute",left:y.left,top:y.top,zIndex:1e4,width:320,maxHeight:"82vh",display:"flex",flexDirection:"column",background:"var(--gxr-panel-bg)",border:"1px solid var(--gxr-panel-border)",borderRadius:12,boxShadow:"var(--gxr-shadow)",overflow:"hidden",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:13,userSelect:"text"},children:[(0,K.jsxs)("div",{ref:h,style:{padding:D,display:"flex",alignItems:"flex-start",gap:14,cursor:"move",userSelect:"none"},children:[x?(0,K.jsx)("img",{src:w.url,onError:()=>m(!0),style:{width:52,height:52,borderRadius:12,objectFit:"cover",flexShrink:0}}):(0,K.jsx)("div",{style:{width:52,height:52,borderRadius:12,flexShrink:0,background:S,boxShadow:`0 0 18px ${S}55`}}),(0,K.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,K.jsx)("div",{style:{color:"var(--gxr-text-primary)",fontSize:20,fontWeight:700,lineHeight:1.2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),(0,K.jsxs)("div",{style:{color:"var(--gxr-text-secondary)",fontSize:13,marginTop:4},children:[b.category,k&&(0,K.jsxs)(K.Fragment,{children:[" \xB7 ",(0,K.jsxs)("span",{style:{color:"var(--gxr-text-muted)"},children:["_source: ",k]})]})]})]}),(0,K.jsx)("span",{"data-no-drag":!0,onClick:()=>r.hide(),style:{fontSize:20,color:"var(--gxr-text-muted)",cursor:"pointer",lineHeight:1,flexShrink:0},children:"\xD7"})]}),(0,K.jsxs)("div",{style:{overflowY:"auto",flex:1},children:[C.length>0&&(0,K.jsxs)("div",{style:{padding:D,borderTop:"1px solid var(--gxr-panel-divider)"},children:[(0,K.jsx)("div",{style:{color:"var(--gxr-text-secondary)",fontSize:13,marginBottom:10,letterSpacing:.5},children:c("nodeInfo.properties")}),C.map(([T,I],_)=>(0,K.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,padding:"9px 0",borderBottom:_<C.length-1?"1px solid var(--gxr-panel-divider)":void 0},children:[(0,K.jsx)("span",{style:{color:"var(--gxr-text-secondary)",fontSize:13,flexShrink:0},children:T}),(0,K.jsx)("span",{style:{color:"var(--gxr-text-primary)",fontSize:13,fontWeight:500,textAlign:"right",wordBreak:"break-word"},children:String(I??"")})]},T))]}),P.length>0&&(0,K.jsxs)("div",{style:{padding:D,borderTop:"1px solid var(--gxr-panel-divider)"},children:[(0,K.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--gxr-text-secondary)",fontSize:13,marginBottom:10,letterSpacing:.5},children:[(0,K.jsx)("span",{children:c("nodeInfo.relations")}),(0,K.jsx)("span",{style:{color:"var(--gxr-text-muted)"},children:P.length})]}),(0,K.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:P.map(T=>(0,K.jsxs)("div",{onClick:()=>M(T.id),title:T.title,style:{display:"flex",alignItems:"center",gap:10,padding:"11px 14px",borderRadius:10,border:"1px solid var(--gxr-panel-border)",background:"var(--gxr-hover-bg)",cursor:"pointer"},onMouseEnter:I=>{I.currentTarget.style.borderColor="var(--gxr-text-muted)"},onMouseLeave:I=>{I.currentTarget.style.borderColor="var(--gxr-panel-border)"},children:[(0,K.jsx)("span",{style:{width:9,height:9,borderRadius:"50%",background:T.color,flexShrink:0}}),(0,K.jsx)("span",{style:{flex:1,minWidth:0,color:"var(--gxr-text-primary)",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.title}),(0,K.jsx)("span",{style:{color:"var(--gxr-text-muted)",fontSize:12,flexShrink:0},children:T.category})]},T.id))})]})]}),a&&(0,K.jsx)("div",{style:{padding:D,borderTop:"1px solid var(--gxr-panel-divider)"},children:(0,K.jsx)("button",{"data-no-drag":!0,onClick:()=>s?.(n),style:{width:"100%",padding:"10px 14px",borderRadius:10,border:"1px solid var(--gxr-panel-border)",background:"transparent",color:"var(--gxr-text-secondary)",fontSize:13,cursor:"pointer"},onMouseEnter:T=>{T.currentTarget.style.background="var(--gxr-hover-bg)"},onMouseLeave:T=>{T.currentTarget.style.background="transparent"},children:c("nodeInfo.expandNeighbors")})})]})}var Y=require("react");var V=require("react/jsx-runtime");function Aa(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function L1(n){n.stopPropagation()}function O1(n){(0,Y.useEffect)(()=>{let e=n.current;if(!e)return;let t=r=>r.stopPropagation(),o=["mousedown","wheel","contextmenu","pointerdown"];for(let r of o)e.addEventListener(r,t,{capture:!1});return()=>{for(let r of o)e.removeEventListener(r,t,{capture:!1})}},[n])}function G1(n){(0,Y.useEffect)(()=>{let e=n.current;if(!e)return;let t=r=>r.stopPropagation(),o=["keydown","keyup","keypress"];for(let r of o)e.addEventListener(r,t,{capture:!1});return()=>{for(let r of o)e.removeEventListener(r,t,{capture:!1})}},[n])}function Ma({result:n,store:e,api:t,container:o,onDone:r,onCreated:i,allowedRelationships:a}){let s=n.targetNodeId===null,l=(0,Y.useRef)(null),u=ze(),c=t??u;O1(l),G1(l);let p=(0,Y.useRef)({x:0,y:0}),d=(0,Y.useMemo)(()=>e.getSchema(),[e.version]),g=(0,Y.useMemo)(()=>!a||a.length===0?d.relationships:d.relationships.filter(L=>a.includes(L.name)),[d,a]),[m,y]=(0,Y.useState)(d.categories[0]?.name||"Node"),[v,h]=(0,Y.useState)(!1),[b,f]=(0,Y.useState)(""),[w,x]=(0,Y.useState)(""),[S,A]=(0,Y.useState)(()=>g.length===0),[k,C]=(0,Y.useState)(""),[E,P]=(0,Y.useState)({}),[M,D]=(0,Y.useState)({}),[T,I]=(0,Y.useState)([]),[_,N]=(0,Y.useState)([]),R=(0,Y.useMemo)(()=>v?null:d.categories.find(L=>L.name===m)||null,[d,m,v]),z=(0,Y.useMemo)(()=>S?null:g.find(L=>L.name===w)||null,[g,w,S]);(0,Y.useEffect)(()=>{g.length>0&&!g.find(L=>L.name===w)?x(g[0].name):g.length===0&&A(!0)},[g]),(0,Y.useEffect)(()=>{P({})},[m,v]),(0,Y.useEffect)(()=>{D({})},[w,S]);let G=(0,Y.useCallback)(async()=>{if(!c){console.error("[QuickCreatePanel] Cannot create node/edge: no RenderEngineApi available. Pass `api` as a prop or mount QuickCreatePanel inside a <GraphRenderer> subtree.");return}let L=v&&b||m,W=S&&k||w,J={};if(R)for(let ee of R.properties){let ae=E[ee.key];ae!==void 0&&ae!==""&&(J[ee.key]=Ta(ae,ee.type))}for(let[ee,ae]of Object.entries(E))!(ee in J)&&ae!==""&&(J[ee]=ae);{let ee=new Set;for(let{key:ae,value:Xe}of T){let _e=ae.trim();!_e||ee.has(_e)||(ee.add(_e),J[_e]=Xe)}}let $={};if(z)for(let ee of z.properties){let ae=M[ee.key];ae!==void 0&&ae!==""&&($[ee.key]=Ta(ae,ee.type))}for(let[ee,ae]of Object.entries(M))!(ee in $)&&ae!==""&&($[ee]=ae);{let ee=new Set;for(let{key:ae,value:Xe}of _){let _e=ae.trim();!_e||ee.has(_e)||(ee.add(_e),$[_e]=Xe)}}let Ft=n.targetNodeId,wt=null;s&&(wt=Aa(),await c.nodes.add([{id:wt,category:L,properties:J,position:{x:n.dropWorldPosition.x,y:n.dropWorldPosition.y,z:n.dropWorldPosition.z}}]),Ft=wt);let tn=[];if(Ft){let ee=n.sourceNodeIds.map(ae=>{let Xe=Aa();return tn.push(Xe),{id:Xe,source:ae,target:Ft,relationship:W,properties:$}});await c.edges.add(ee)}i?.(wt,tn),r()},[m,w,v,b,S,k,E,M,T,_,R,z,n,e,c,s,r,i]);(0,Y.useEffect)(()=>{let L=J=>{l.current&&!l.current.contains(J.target)&&r()},W=setTimeout(()=>document.addEventListener("mousedown",L),100);return()=>{clearTimeout(W),document.removeEventListener("mousedown",L)}},[r]),(0,Y.useEffect)(()=>{let L=W=>{W.key==="Escape"&&r(),W.key==="Enter"&&!W.shiftKey&&G()};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[r,G]);let F=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let L=F.current;if(!L)return;let W=J=>{J.preventDefault();let $=J.clientX,Ft=J.clientY,wt=p.current.x,tn=p.current.y,ee=l.current,ae=_e=>{let Fo=wt+(_e.clientX-$),No=tn+(_e.clientY-Ft);p.current={x:Fo,y:No},ee&&(ee.style.transform=`translate(${Fo}px, ${No}px)`)},Xe=()=>{document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",Xe)};document.addEventListener("mousemove",ae),document.addEventListener("mouseup",Xe)};return L.addEventListener("mousedown",W),()=>L.removeEventListener("mousedown",W)},[]);let H=o?o.clientWidth:window.innerWidth,O=o?o.clientHeight:window.innerHeight,U=Math.min(n.dropScreenPosition.x+12,H-300),q=Math.min(n.dropScreenPosition.y+12,O-300),Se={position:"absolute",left:U,top:q,zIndex:1e3,background:"var(--gxr-panel-bg)",border:"1px solid var(--gxr-panel-border)",borderRadius:"8px",padding:16,minWidth:260,maxWidth:340,maxHeight:400,overflowY:"auto",boxShadow:"var(--gxr-shadow)",color:"var(--gxr-text-primary)",fontFamily:"system-ui, sans-serif",fontSize:13},ge={width:"100%",padding:"6px 8px",background:"var(--gxr-hover-bg)",border:"1px solid var(--gxr-panel-border)",borderRadius:4,color:"inherit",fontSize:13,boxSizing:"border-box"},he={display:"block",marginBottom:4,opacity:.7,fontSize:12},gt={padding:"6px 16px",borderRadius:4,border:"none",cursor:"pointer",fontSize:13,fontWeight:500},xt={background:"transparent",color:"var(--gxr-text-secondary)",border:"none",cursor:"pointer",padding:"0 6px",fontSize:16,lineHeight:1},Dt={marginTop:6,background:"transparent",border:"1px dashed var(--gxr-panel-border)",color:"var(--gxr-text-secondary)",borderRadius:4,cursor:"pointer",padding:"4px 10px",fontSize:12,width:"100%"};return(0,V.jsxs)("div",{ref:l,"data-testid":"quick-create-panel",style:Se,onClick:L1,children:[(0,V.jsx)("div",{ref:F,style:{fontWeight:600,marginBottom:12,cursor:"grab",userSelect:"none"},children:s?"Quick Create":"Create Edge"}),s&&(0,V.jsxs)("div",{style:{marginBottom:10},children:[(0,V.jsx)("label",{style:he,children:"Category"}),(0,V.jsxs)("select",{"data-testid":"quick-create-category",value:v?"__custom__":m,onChange:L=>{L.target.value==="__custom__"?(h(!0),f("")):(h(!1),y(L.target.value),f(""))},style:ge,children:[d.categories.map(L=>(0,V.jsx)("option",{value:L.name,children:L.name},L.name)),(0,V.jsx)("option",{value:"__custom__",children:"+ New category..."})]}),v&&(0,V.jsx)("input",{autoFocus:!0,"data-testid":"quick-create-custom-category",type:"text",value:b,onChange:L=>f(L.target.value),style:{...ge,marginTop:4},placeholder:"Category name"})]}),s&&(0,V.jsxs)("div",{style:{marginBottom:10},children:[(R&&R.properties.length>0||T.length>0)&&(0,V.jsx)("label",{style:{...he,fontWeight:500},children:"Properties"}),R&&R.properties.map(L=>(0,V.jsxs)("div",{style:{marginBottom:4},children:[(0,V.jsxs)("label",{style:{...he,fontSize:11,opacity:.5},children:[L.key," (",L.type,")",L.required?" *":""]}),(0,V.jsx)("input",{type:L.type==="number"?"number":"text",value:E[L.key]||"",onChange:W=>P(J=>({...J,[L.key]:W.target.value})),style:ge,placeholder:L.key})]},L.key)),T.map((L,W)=>(0,V.jsxs)("div",{style:{display:"flex",gap:4,marginTop:4},children:[(0,V.jsx)("input",{"data-testid":`custom-node-key-${W}`,placeholder:"key",value:L.key,onChange:J=>{let $=[...T];$[W]={...$[W],key:J.target.value},I($)},style:{...ge,flex:1,width:"auto"}}),(0,V.jsx)("input",{"data-testid":`custom-node-value-${W}`,placeholder:"value",value:L.value,onChange:J=>{let $=[...T];$[W]={...$[W],value:J.target.value},I($)},style:{...ge,flex:1,width:"auto"}}),(0,V.jsx)("button",{"data-testid":`custom-node-remove-${W}`,onClick:()=>I(T.filter((J,$)=>$!==W)),style:xt,title:"Remove property",children:"\xD7"})]},W)),(0,V.jsx)("button",{"data-testid":"add-custom-node-prop",onClick:()=>I([...T,{key:"",value:""}]),style:Dt,children:"+ Add property"})]}),n.sourceNodeIds.length>0&&(0,V.jsxs)("div",{style:{marginBottom:10},children:[(0,V.jsx)("label",{style:he,children:"Relationship"}),(0,V.jsxs)("select",{"data-testid":"quick-create-relationship",value:S?"__custom__":w,onChange:L=>{L.target.value==="__custom__"?(A(!0),C("")):(A(!1),x(L.target.value),C(""))},style:ge,children:[g.map(L=>(0,V.jsx)("option",{value:L.name,children:L.name},L.name)),(0,V.jsx)("option",{value:"__custom__",children:"+ New relationship..."})]}),S&&(0,V.jsx)("input",{autoFocus:!0,"data-testid":"quick-create-custom-relationship",type:"text",value:k,onChange:L=>C(L.target.value),style:{...ge,marginTop:4},placeholder:"Relationship type"})]}),n.sourceNodeIds.length>0&&(0,V.jsxs)("div",{style:{marginBottom:10},children:[(z&&z.properties.length>0||_.length>0)&&(0,V.jsx)("label",{style:{...he,fontWeight:500},children:"Edge Properties"}),z&&z.properties.map(L=>(0,V.jsxs)("div",{style:{marginBottom:4},children:[(0,V.jsxs)("label",{style:{...he,fontSize:11,opacity:.5},children:[L.key," (",L.type,")",L.required?" *":""]}),(0,V.jsx)("input",{type:L.type==="number"?"number":"text",value:M[L.key]||"",onChange:W=>D(J=>({...J,[L.key]:W.target.value})),style:ge,placeholder:L.key})]},L.key)),_.map((L,W)=>(0,V.jsxs)("div",{style:{display:"flex",gap:4,marginTop:4},children:[(0,V.jsx)("input",{"data-testid":`custom-edge-key-${W}`,placeholder:"key",value:L.key,onChange:J=>{let $=[..._];$[W]={...$[W],key:J.target.value},N($)},style:{...ge,flex:1,width:"auto"}}),(0,V.jsx)("input",{"data-testid":`custom-edge-value-${W}`,placeholder:"value",value:L.value,onChange:J=>{let $=[..._];$[W]={...$[W],value:J.target.value},N($)},style:{...ge,flex:1,width:"auto"}}),(0,V.jsx)("button",{"data-testid":`custom-edge-remove-${W}`,onClick:()=>N(_.filter((J,$)=>$!==W)),style:xt,title:"Remove property",children:"\xD7"})]},W)),(0,V.jsx)("button",{"data-testid":"add-custom-edge-prop",onClick:()=>N([..._,{key:"",value:""}]),style:Dt,children:"+ Add property"})]}),(0,V.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:4},children:[(0,V.jsx)("button",{"data-testid":"quick-create-cancel",onClick:r,style:{...gt,background:"var(--gxr-hover-bg)",color:"var(--gxr-text-primary)"},children:"Cancel"}),(0,V.jsx)("button",{"data-testid":"quick-create-confirm",onClick:G,style:{...gt,background:"#61dafb",color:"#000"},children:"Create"})]})]})}function Ta(n,e){switch(e){case"number":{let t=Number(n);return isNaN(t)?n:t}case"boolean":return n==="true"||n==="1";default:return n}}var de=require("react");var ce=require("react/jsx-runtime");function Ia({manager:n,container:e}){let[t,o]=(0,de.useState)(n.state),r=(0,de.useRef)(null),[i,a]=(0,de.useState)({left:0,top:0});return(0,de.useEffect)(()=>n.onChange(()=>o({...n.state})),[n]),(0,de.useLayoutEffect)(()=>{if(!t.visible||!r.current)return;let s=r.current.getBoundingClientRect(),l=e?e.clientWidth:window.innerWidth,u=e?e.clientHeight:window.innerHeight,c=Math.min(t.position.x,Math.max(0,l-s.width-8)),p=Math.min(t.position.y,Math.max(0,u-s.height-8));a({left:c,top:p})},[t.visible,t.position,t.sections,e]),(0,de.useEffect)(()=>{if(!t.visible)return;let s=u=>{r.current&&!r.current.contains(u.target)&&n.hide()},l=setTimeout(()=>document.addEventListener("mousedown",s),50);return()=>{clearTimeout(l),document.removeEventListener("mousedown",s)}},[t.visible,n]),(0,de.useEffect)(()=>{if(!t.visible)return;let s=l=>{l.key==="Escape"&&n.hide()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t.visible,n]),!t.visible||!t.context?null:(0,ce.jsx)("div",{ref:r,role:"menu","data-testid":"context-menu",style:{position:"absolute",left:i.left,top:i.top,zIndex:1e4,minWidth:180,background:"var(--gxr-panel-bg)",border:"1px solid var(--gxr-panel-border)",borderRadius:"8px",boxShadow:"var(--gxr-shadow)",padding:"4px 0",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:13,color:"var(--gxr-text-primary)",userSelect:"none",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},onContextMenu:s=>s.preventDefault(),children:t.sections.map((s,l)=>(0,ce.jsxs)(de.Fragment,{children:[l>0&&(0,ce.jsx)("div",{style:{height:1,margin:"4px 8px",background:"var(--gxr-panel-divider)"},"aria-hidden":"true"}),(0,ce.jsx)("section",{"data-group":s.groupId,children:s.items.map(u=>(0,ce.jsx)(B1,{item:u,context:t.context,onClose:()=>n.hide(),container:e,parentMenuRef:r},u.id))})]},s.groupId))})}function B1({item:n,context:e,onClose:t,container:o,parentMenuRef:r}){let[i,a]=(0,de.useState)(!1),[s,l]=(0,de.useState)(null),[u,c]=(0,de.useState)(!1),p=(0,de.useRef)(null),d=!!n.children;(0,de.useEffect)(()=>{if(!i||!n.children)return;if(Array.isArray(n.children)){l(n.children.map(h=>({id:h.id,label:typeof h.label=="function"?h.label(e):h.label,icon:h.icon,enabled:h.enabled?h.enabled(e):!0,danger:h.danger??!1,action:h.action,children:h.children,hasAsyncChildren:typeof h.children=="function"})));return}let v=!1;return c(!0),n.children(e).then(h=>{v||(l(h.map(b=>({id:b.id,label:typeof b.label=="function"?b.label(e):b.label,icon:b.icon,enabled:b.enabled?b.enabled(e):!0,danger:b.danger??!1,action:b.action,children:b.children,hasAsyncChildren:typeof b.children=="function"}))),c(!1))}).catch(()=>{v||c(!1)}),()=>{v=!0}},[i,n.children,e]);let g=(0,de.useCallback)(()=>{!n.enabled||d||(n.action?.(e),t())},[n,d,e,t]),y=i&&d?(()=>{if(!r.current)return{left:0,top:-4};let v=r.current.getBoundingClientRect(),h=o?o.clientWidth:window.innerWidth,b=v.width-4;return v.right+200>h&&(b=-196),{left:b,top:-4}})():null;return(0,ce.jsxs)("div",{ref:p,style:{position:"relative"},onMouseEnter:()=>a(!0),onMouseLeave:()=>{a(!1),l(null)},children:[(0,ce.jsxs)("div",{role:"menuitem","aria-disabled":!n.enabled,"data-testid":`context-menu-item-${n.id}`,onClick:g,style:{display:"flex",alignItems:"center",padding:"6px 12px",cursor:n.enabled&&!d?"pointer":"default",color:n.enabled?n.danger?"#ff6b6b":"var(--gxr-text-primary)":"var(--gxr-text-muted)",background:i&&n.enabled?"var(--gxr-hover-bg)":"transparent",transition:"background 0.1s",gap:8},children:[(0,ce.jsx)("span",{style:{width:16,textAlign:"center",fontSize:12,color:n.danger?"#ff6b6b":"var(--gxr-text-secondary)",flexShrink:0,display:"inline-flex",justifyContent:"center"},children:Ea(n.icon,14)}),(0,ce.jsx)("span",{style:{flex:1},children:n.label}),d&&(0,ce.jsx)("span",{style:{fontSize:10,opacity:.5,marginLeft:8},children:"\u25B6"})]}),i&&d&&y&&(u||s&&s.length>0)&&(0,ce.jsxs)("div",{style:{position:"absolute",left:y.left,top:y.top,minWidth:160,background:"var(--gxr-panel-bg)",border:"1px solid var(--gxr-panel-border)",borderRadius:"8px",boxShadow:"var(--gxr-shadow)",padding:"4px 0",fontFamily:"inherit",fontSize:13,color:"var(--gxr-text-primary)",zIndex:10001,backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[u&&(0,ce.jsx)("div",{style:{padding:"6px 12px",color:"var(--gxr-text-secondary)",fontStyle:"italic"},children:"Loading..."}),s?.map(v=>(0,ce.jsx)(H1,{item:v,context:e,onClose:t},v.id))]})]})}function H1({item:n,context:e,onClose:t}){let[o,r]=(0,de.useState)(!1);return(0,ce.jsxs)("div",{role:"menuitem","aria-disabled":!n.enabled,"data-testid":`context-menu-item-${n.id}`,onClick:()=>{n.enabled&&(n.action?.(e),t())},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{display:"flex",alignItems:"center",padding:"6px 12px",cursor:n.enabled?"pointer":"default",color:n.enabled?n.danger?"#ff6b6b":"var(--gxr-text-primary)":"var(--gxr-text-muted)",background:o&&n.enabled?"var(--gxr-hover-bg)":"transparent",transition:"background 0.1s",gap:8},children:[(0,ce.jsx)("span",{style:{width:16,textAlign:"center",fontSize:12,color:"var(--gxr-text-secondary)",flexShrink:0,display:"inline-flex",justifyContent:"center"},children:Ea(n.icon,14)}),(0,ce.jsx)("span",{style:{flex:1},children:n.label})]})}function Ea(n,e=14){if(!n)return null;if(typeof n=="object")return(0,ce.jsx)(Me,{spec:n,size:e});if(n in At)return(0,ce.jsx)(Me,{spec:{kind:"gxr",name:n},size:e});let t=U1(n);return t?(0,ce.jsx)("span",{"aria-hidden":!0,style:{fontSize:e,lineHeight:1},children:t}):null}function U1(n){return{info:"\u2139",expand:"\u2295",layout:"\u229E",neighbors:"\u229B",pin:"\u25CE",fit:"\u2B1C",hide:"\u25CC",show:"\u25C9",delete:"\u2715",select:"\u2611",path:"\u27BF"}[n]||""}var Ce=te(require("three"));var _a=`// kv_mapGrowth \u2014 the shared soft caps on how big geometry may appear:
183
+ // \`kvMapGrowth\` for map-mode inverse-zoom growth, \`kvScreenCap\` (below, built
184
+ // on it) for the near-camera cap that applies in every mode.
185
+ //
186
+ // \`raw\` is pow(refDepth / viewDepth, mapDamping): how much a node would grow
187
+ // versus the reference depth. Below the knee the growth passes through; above it
188
+ // a rational asymptote A\xB7t/(A+t) approaches \`maxGrowth\` (C\xB9-continuous at the
189
+ // knee, so no kink). \`maxGrowth < 0\` is the "Infinity" sentinel: no cap.
190
+ //
191
+ // Every shader that has to agree on a node's on-screen size (node, picking,
192
+ // edge, arrow, badge, tag) calls this, so the visible bubble, its hitbox, the
193
+ // edge endpoint and the decorations freeze in lockstep. Keep the operations in
194
+ // this order: the A/B screenshot gate expects bit-identical output to the
195
+ // per-shader copies this replaced.
196
+ float kvMapGrowth(float raw, float maxGrowth) {
197
+ if (maxGrowth < 0.0) return raw;
198
+ float softKnee = maxGrowth * 0.5;
199
+ float overflow = max(raw - softKnee, 0.0);
200
+ float A = maxGrowth - softKnee;
201
+ return min(raw, softKnee) + (A * overflow) / (A + overflow);
202
+ }
203
+
204
+ // kvScreenCap \u2014 the single definition of the near-camera size cap.
205
+ //
206
+ // \`px\` is an uncapped on-screen size in CSS pixels (a node diameter, an edge
207
+ // width). \`maxFraction\` is the share of the SMALLER viewport dimension that one
208
+ // piece of geometry may cover. \`maxFraction < 0\` is the "Infinity" sentinel and
209
+ // returns \`px\` untouched \u2014 bit-identical to the engine before the cap existed.
210
+ //
211
+ // Why this exists: outside map mode the apparent size is \`size * 50 / depth\`, so
212
+ // a scene flight that passes a node at depth 0.02 asks for a ~4000 px quad. The
213
+ // hard 4096 px clamp in node.vert.glsl allowed exactly that: the node covered
214
+ // the frame and the shot was unreadable. kvMapGrowth already has the right curve \u2014 below
215
+ // half the cap it is the identity, so ordinary zooming is untouched to the bit,
216
+ // and above it the same C\xB9 rational asymptote map mode uses.
217
+ //
218
+ // Callers MUST cap the NOMINAL size (before selection / halo expansion) so the
219
+ // node quad, its hitbox, the edge endpoint pullback and the arrow cone agree on
220
+ // where the bubble boundary is: node.vert, picking.vert, edge.vert, arrow.vert.
221
+ float kvScreenCap(float px, float maxFraction, vec2 resolution) {
222
+ if (maxFraction < 0.0) return px;
223
+ return kvMapGrowth(px, maxFraction * min(resolution.x, resolution.y));
224
+ }
225
+ `;var za=`// kv_shapes \u2014 built-in node outlines. Mirrors core/shapes/reference.ts (the source of
226
+ // truth); scripts/glsl-conformance.mjs compares the two on a fixed grid (tolerance 1e-4).
227
+ //
228
+ // Unit box [-0.5, 0.5]\xB2, y UP. kvShapeSdf is a signed distance: negative inside, 0 on the
229
+ // outline. Callers use \`0.5 + kvShapeSdf(...)\` where the circle code used length(p), so soft
230
+ // edges, rings and icon clipping follow the outline. Shape ids: 0 circle, 1 rect,
231
+ // 2 roundRect, 3 diamond, 4 triangle, 5 hexagon, 6 star, 7 ring.
232
+
233
+ float kvSdBox(vec2 p, vec2 h) {
234
+ vec2 q = abs(p) - h;
235
+ return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0);
236
+ }
237
+
238
+ float kvSdStar5(vec2 p, float r, float rf) {
239
+ const vec2 k1 = vec2(0.809016994375, -0.587785252292);
240
+ const vec2 k2 = vec2(-0.809016994375, -0.587785252292);
241
+ p.x = abs(p.x);
242
+ p -= 2.0 * max(dot(k1, p), 0.0) * k1;
243
+ p -= 2.0 * max(dot(k2, p), 0.0) * k2;
244
+ p.x = abs(p.x);
245
+ p.y -= r;
246
+ vec2 ba = rf * vec2(-k1.y, k1.x) - vec2(0.0, 1.0);
247
+ float h = clamp(dot(p, ba) / dot(ba, ba), 0.0, r);
248
+ return length(p - ba * h) * sign(p.y * ba.x - p.x * ba.y);
249
+ }
250
+
251
+ float kvShapeSdf(float shapeId, vec2 p) {
252
+ float id = floor(shapeId + 0.5);
253
+ if (id < 0.5) return length(p) - 0.5;
254
+ if (id < 1.5) return kvSdBox(p, vec2(0.5));
255
+ if (id < 2.5) return kvSdBox(p, vec2(0.5 - 0.18)) - 0.18;
256
+ if (id < 3.5) return (abs(p.x) + abs(p.y) - 0.5) * 0.70710678118;
257
+ if (id < 4.5) {
258
+ float l = -0.894427191 * p.x + 0.4472135955 * p.y - 0.2236067977;
259
+ float r = 0.894427191 * p.x + 0.4472135955 * p.y - 0.2236067977;
260
+ return max(max(l, r), -p.y - 0.5);
261
+ }
262
+ if (id < 5.5) {
263
+ vec2 a = abs(p);
264
+ return max(a.y, 0.86602540378 * a.x + 0.5 * a.y) - 0.43301270189;
265
+ }
266
+ if (id < 6.5) return kvSdStar5(p, 0.5, 0.5);
267
+ if (id < 7.5) return abs(length(p) - 0.4) - 0.1;
268
+ return length(p) - 0.5;
269
+ }
270
+
271
+ // Coverage 0..1. edgeOuter = node radius in unit-box units (0.5; 0.38 selected; 0.40 highlighted).
272
+ float kvShapeMask(float shapeId, vec2 p, float edgeOuter) {
273
+ float d = kvShapeSdf(shapeId, p) + (0.5 - edgeOuter);
274
+ return 1.0 - smoothstep(-0.02, 0.0, d);
275
+ }
276
+
277
+ // \u2500\u2500 edge endpoint clipping (mirrors shapeCode / shapeRadiusAlong in reference.ts) \u2500\u2500
278
+
279
+ float kvCodeShape(float code) { return mod(code, 16.0); }
280
+ float kvCodeAspect(float code) {
281
+ float q = floor(code / 16.0);
282
+ return q > 0.5 ? q / 1024.0 : 1.0;
283
+ }
284
+
285
+ float kvOuterSdf(float id, vec2 p) {
286
+ return (id > 6.5 && id < 7.5) ? length(p) - 0.5 : kvShapeSdf(id, p);
287
+ }
288
+
289
+ // Distance from the node centre to its outline along unit screen direction u (y up), for a node
290
+ // \`widthPx\` wide. A plain circle returns exactly 0.5 * widthPx (the pre-shape behaviour).
291
+ float kvShapeRadiusAlong(float shapeId, float aspect, float widthPx, vec2 u) {
292
+ if (shapeId < 0.5 && abs(aspect - 1.0) < 1e-4) return 0.5 * widthPx;
293
+ vec2 d = vec2(u.x, u.y * aspect);
294
+ float lo = 0.0;
295
+ float hi = 0.7072 / length(d);
296
+ for (int i = 0; i < 14; i++) {
297
+ float mid = 0.5 * (lo + hi);
298
+ if (kvOuterSdf(shapeId, d * mid) < 0.0) lo = mid; else hi = mid;
299
+ }
300
+ return widthPx * 0.5 * (lo + hi);
301
+ }
302
+ `;var Da=`// kv_orthoEdge \u2014 the \`orthogonal\` edge shape (shape id 3), evaluated per vertex.
303
+ //
304
+ // Routed from the two endpoints alone: leg1 leaves the source along the routing
305
+ // axis, leg2 runs across at the bend, leg3 drops into the target along the axis.
306
+ // Both corners are quarter circles. Nothing per edge is uploaded beyond the
307
+ // bend, so nodes can move every frame (force layout, drag, tweens) at no CPU cost.
308
+ //
309
+ // S \u25CF axis = vertical
310
+ // \u2502 leg1 bend = where leg2 sits between S and E
311
+ // \u2570\u2500\u2500\u2500\u2500\u2500\u2500\u256E leg2
312
+ // \u2502 leg3
313
+ // E \u25CF
314
+ //
315
+ // Vertex budget. A strip vertex is addressed by k = along * segments. Corners
316
+ // get most of the vertices, straight legs need only their two ends:
317
+ // k = 0 start of leg1
318
+ // k = 1 .. 1+a corner 1 (a = floor((segments - 4) / 2) segments)
319
+ // k = 1+a .. 2+a leg2
320
+ // k = 2+a .. 2+2a corner 2
321
+ // k = 2+2a .. N leg3
322
+ // With the default 20 segments each corner gets 8, which reads as a smooth arc
323
+ // at any zoom; the legs stay exactly straight. \`segments\` < 8 degrades to
324
+ // chamfered corners, still correct.
325
+ //
326
+ // Bend encoding (controlOffset.x / .y, written by GPUEdgeRenderer):
327
+ // .y >= 9999 explicit bend in .x: 0..1 = fraction of the S\u2192E span along
328
+ // the axis; < 0 = absolute world distance from S (family-tree
329
+ // "comb": every child of one couple shares one bar height)
330
+ // otherwise 0.5 + .x (multi-edge curvature spreads parallel edges)
331
+ //
332
+ // MUST match: arrow.vert.glsl (end direction), edge/orthoPath.ts (CPU mirror
333
+ // used by labels and tests).
334
+
335
+ const float KV_ORTHO_EXPLICIT = 9999.0;
336
+
337
+ // Routing frame. Fills the corner points and leg directions; returns false when
338
+ // the axis span is ~0 (both ends level) and the caller should draw straight.
339
+ bool kvOrthoFrame(vec3 S, vec3 E, vec2 ctrl, float axisMode,
340
+ out vec3 P1, out vec3 P2, out vec3 d1, out vec3 d3) {
341
+ vec3 dir = E - S;
342
+ bool vertical;
343
+ if (axisMode > 1.5) vertical = false;
344
+ else if (axisMode > 0.5) vertical = true;
345
+ else vertical = abs(dir.y) >= abs(dir.x);
346
+
347
+ float span = vertical ? dir.y : dir.x;
348
+ float sgn = span >= 0.0 ? 1.0 : -1.0;
349
+ float m; // position of leg2 along the axis, relative to S
350
+ if (ctrl.y >= KV_ORTHO_EXPLICIT) {
351
+ m = ctrl.x < 0.0 ? sgn * min(-ctrl.x, abs(span)) : span * clamp(ctrl.x, 0.0, 1.0);
352
+ } else {
353
+ m = span * clamp(0.5 + ctrl.x, 0.05, 0.95);
354
+ }
355
+ if (vertical) {
356
+ P1 = vec3(S.x, S.y + m, S.z);
357
+ P2 = vec3(E.x, S.y + m, E.z);
358
+ d1 = vec3(0.0, sgn, 0.0);
359
+ } else {
360
+ P1 = vec3(S.x + m, S.y, S.z);
361
+ P2 = vec3(S.x + m, E.y, E.z);
362
+ d1 = vec3(sgn, 0.0, 0.0);
363
+ }
364
+ d3 = d1;
365
+ return abs(span) > 1e-5;
366
+ }
367
+
368
+ // Point on the routed polyline at strip coordinate k (0..segments).
369
+ // A, B leg1 start / leg3 end (already pulled back from the node discs)
370
+ // r corner-radius fraction 0..1 (uniform orthoCornerRadius)
371
+ // s out: arc length from A, for dash / flow counters
372
+ // L out: total arc length
373
+ vec3 kvOrthoPoint(float k, float segments, vec3 A, vec3 P1, vec3 P2, vec3 B,
374
+ vec3 d1, float r, out float s, out float L) {
375
+ vec3 across = P2 - P1;
376
+ float L1 = max(dot(P1 - A, d1), 0.0);
377
+ float L2 = length(across);
378
+ float L3 = max(dot(B - P2, d1), 0.0);
379
+ vec3 d2 = L2 > 1e-6 ? across / L2 : d1;
380
+
381
+ // Corner radii scale with the outer legs only, so every edge of a comb
382
+ // (one parent, same level gap) gets the same arc whatever its cross leg;
383
+ // then capped to the leg it sits on and to half the cross leg. A floor
384
+ // keeps the arcs from collapsing to a point (strip joints need distinct
385
+ // neighbours) without visibly rounding a tight bend.
386
+ float tot = L1 + L2 + L3;
387
+ float rMin = 1e-4 * tot;
388
+ float rr = r * min(L1, L3);
389
+ float r1 = max(min(rr, min(L1, 0.5 * L2)), rMin);
390
+ float r2 = max(min(rr, min(L3, 0.5 * L2)), rMin);
391
+
392
+ float a = max(floor((segments - 4.0) * 0.5), 1.0);
393
+ float qArc = 1.5707963 ;
394
+ float l1 = max(L1 - r1, 0.0), l2 = max(L2 - r1 - r2, 0.0), l3 = max(L3 - r2, 0.0);
395
+ float c1 = qArc * r1, c2 = qArc * r2;
396
+ L = l1 + c1 + l2 + c2 + l3;
397
+
398
+ vec3 p;
399
+ if (k <= 1.0) { // leg1
400
+ float u = clamp(k, 0.0, 1.0);
401
+ p = A + d1 * (l1 * u);
402
+ s = l1 * u;
403
+ } else if (k <= 1.0 + a) { // corner 1
404
+ float phi = qArc * (k - 1.0) / a;
405
+ vec3 O = P1 - d1 * r1 + d2 * r1;
406
+ p = O - d2 * (r1 * cos(phi)) + d1 * (r1 * sin(phi));
407
+ s = l1 + r1 * phi;
408
+ } else if (k <= 2.0 + a) { // leg2
409
+ float u = k - (1.0 + a);
410
+ p = P1 + d2 * (r1 + l2 * u);
411
+ s = l1 + c1 + l2 * u;
412
+ } else if (k <= 2.0 + 2.0 * a) { // corner 2
413
+ float phi = qArc * (k - (2.0 + a)) / a;
414
+ vec3 O = P2 - d2 * r2 + d1 * r2;
415
+ p = O - d1 * (r2 * cos(phi)) + d2 * (r2 * sin(phi));
416
+ s = l1 + c1 + l2 + r2 * phi;
417
+ } else { // leg3
418
+ float rest = max(segments - (2.0 + 2.0 * a), 1e-3);
419
+ float u = clamp((k - (2.0 + 2.0 * a)) / rest, 0.0, 1.0);
420
+ p = P2 + d1 * (r2 + l3 * u);
421
+ s = l1 + c1 + l2 + c2 + l3 * u;
422
+ }
423
+ return p;
424
+ }
425
+ `;var Fa=`// kv_routedEdge \u2014 the \`routed\` (id 4) and \`family\` (id 5) edge shapes.
426
+ //
427
+ // routed: the edge bends through stored points. Each point is kept relative to
428
+ // the two node centres S and E, as (u, v) in the chord frame:
429
+ // P.xy = S.xy + u * d.xy + v * perp(d.xy), P.z = S.z + u * d.z, d = E - S
430
+ // That is a similarity in the xy plane, so the route follows its nodes every
431
+ // frame with nothing recomputed or uploaded. Points live in a float RGBA
432
+ // texture, one texel each: (u, v, fraction of the route's length, unused).
433
+ // controlOffset.x = the edge's first texel, .y = its point count.
434
+ //
435
+ // One strip vertex sits on each bend (vertex k = point k), so corners are
436
+ // exact; vertices past the last point collapse onto the end.
437
+ //
438
+ // family: an orthogonal edge from the midpoint of its source and an anchor
439
+ // node (the other parent). controlOffset.y = KV_ORTHO_EXPLICIT + 1 + anchor
440
+ // slot, which still reads as "explicit bend in .x" to kvOrthoFrame.
441
+ //
442
+ // MUST match edge/edgePath.ts.
443
+
444
+ const float KV_ROUTED_SHAPE = 4.0;
445
+ const float KV_FAMILY_SHAPE = 5.0;
446
+
447
+ vec4 kvRouteTexel(sampler2D tex, float size, float i) {
448
+ vec2 uv = vec2(mod(i, size) + 0.5, floor(i / size) + 0.5) / size;
449
+ return texture2D(tex, uv);
450
+ }
451
+
452
+ vec3 kvRouteToWorld(vec2 uv, vec3 S, vec3 E) {
453
+ vec3 d = E - S;
454
+ return vec3(S.x + uv.x * d.x - uv.y * d.y, S.y + uv.x * d.y + uv.y * d.x, S.z + uv.x * d.z);
455
+ }
456
+
457
+ // Point \`i\` of a routed edge with \`count\` bends: 0 = A, count + 1 = B.
458
+ // S, E are the node centres the route is stored against; A, B the drawn ends.
459
+ vec3 kvRoutedPoint(sampler2D tex, float size, float first, float count, float i,
460
+ vec3 S, vec3 E, vec3 A, vec3 B, out float frac) {
461
+ if (i < 0.5) { frac = 0.0; return A; }
462
+ if (i > count + 0.5) { frac = 1.0; return B; }
463
+ vec4 t = kvRouteTexel(tex, size, first + i - 1.0);
464
+ frac = t.z;
465
+ return kvRouteToWorld(t.xy, S, E);
466
+ }
467
+ `;var V1=_a,W1=za,j1=Da,q1=Fa;function Ao(n){return`${j1}
468
+ ${q1}
469
+ ${n}`}function bt(n){return`${V1}
470
+ ${n}`}function Zt(n){return`${W1}
471
+ ${n}`}var Na=`precision highp float;
472
+ const float HALO_EXPAND = 2.2; // quad expansion when halo active
473
+
474
+ // Position texture (from GPU layout controller)
475
+ uniform sampler2D positionTexture;
476
+ uniform float textureSize;
477
+ uniform float spaceSize;
478
+ uniform float fixedSize;
479
+ uniform float nodeSizeScale;
480
+ uniform float mapMode;
481
+ uniform float mapDamping; // 0.0 = constant screen size, 1.0 = full perspective (used when mapMode > 0.5)
482
+ uniform float mapMaxGrowth; // default 4.0; -1.0 sentinel \u21D2 Infinity / unbounded
483
+ uniform float maxScreenFraction; // share of the smaller viewport one node may cover; -1.0 \u21D2 unbounded
484
+ uniform float pixelRatio;
485
+ uniform float minPixelSize; // CSS px floor; nodes never draw under one device pixel
486
+ uniform float sphereRadius;
487
+ uniform vec2 resolution;
488
+
489
+ // Animation
490
+ uniform float animate;
491
+ uniform float t;
492
+
493
+ // Per-vertex attributes
494
+ attribute float nodeIndex;
495
+ attribute vec3 nodeColor;
496
+ attribute float nodeSize;
497
+ attribute float nodeOpacity;
498
+ attribute float nodeIcon;
499
+ attribute vec4 nodeIconUV;
500
+ attribute vec4 nodeImageUV;
501
+ attribute float nodeFlags;
502
+ attribute float aNodeCollect;
503
+ attribute float nodeSuppressFill;
504
+ attribute vec3 toPosition;
505
+ attribute vec4 nodeEffects; // x ripple, y breathe, z halo, w aspect (width / height)
506
+ #ifndef KV_POINT_PRIMITIVE
507
+ attribute vec2 corner; // [-0.5, 0.5]\xB2 quad corner offset
508
+ #else
509
+ uniform float maxPointSize; // ALIASED_POINT_SIZE_RANGE max, device px
510
+ #endif
511
+
512
+ // Time uniform for shader-driven effects
513
+ uniform float time;
514
+ // Hover-neighbor-highlight: current frame timestamp (ms, mod 2^19 = 524288)
515
+ // + ramp duration. Lets each instance fade independently when hover-move
516
+ // in Steady state diffs only a subset of instances.
517
+ uniform float u_hoverTime;
518
+ uniform float u_hoverDuration;
519
+
520
+ // Varyings
521
+ varying vec3 vColor;
522
+ varying float vOpacity;
523
+ varying float vIcon;
524
+ varying vec4 vIconUV;
525
+ varying vec4 vImageUV;
526
+ varying float vSelected;
527
+ varying float vHighlighted;
528
+ varying float vPinned;
529
+ varying float vNodeCollect;
530
+ varying float vSuppressFill;
531
+ varying float vHidden;
532
+ varying float vHoverDim;
533
+ varying float vRipple;
534
+ varying float vBreathe;
535
+ varying float vHalo;
536
+ #ifndef KV_POINT_PRIMITIVE
537
+ varying vec2 vUv; // [0,1]\xB2 fragment-local coordinate (replaces gl_PointCoord)
538
+ #endif
539
+ varying float vShape; // built-in shape id (0 = circle)
540
+ varying float vCoverage; // area alpha of a node under one device pixel, else 1
541
+ varying float vDevicePx; // drawn diameter in device pixels
542
+
543
+ vec3 samplePosition(float idx) {
544
+ float texX = mod(idx, textureSize) + 0.5;
545
+ float texY = floor(idx / textureSize) + 0.5;
546
+ vec2 texCoord = vec2(texX, texY) / textureSize;
547
+ vec4 posData = texture2D(positionTexture, texCoord);
548
+ return posData.xyz;
549
+ }
550
+
551
+ void main() {
552
+ // Unpack nodeFlags. Low 5 bits = flag bits (sel/hi/pin/hid/hoverDim);
553
+ // upper 19 bits = the timestamp (ms mod 2^19) when the hoverDim bit last
554
+ // flipped. The flag-bit unpack lines below keep working because the
555
+ // timestamp portion is always a multiple of 32 (= 2^5) \u2192 even when
556
+ // divided by 16, so it doesn't pollute the 0/1 result of \`mod ... 2\`.
557
+ vSelected = mod(nodeFlags, 2.0);
558
+ vHighlighted = mod(floor(nodeFlags / 2.0), 2.0);
559
+ vPinned = mod(floor(nodeFlags / 4.0), 2.0);
560
+ vHidden = mod(floor(nodeFlags / 8.0), 2.0);
561
+ float _hoverTarget = mod(floor(nodeFlags / 16.0), 2.0);
562
+ // Per-instance fade. \`_hoverStart\` is 0 for instances that have never
563
+ // flipped (sentinel: skip animation, render at the target value).
564
+ // For instances that have flipped, modular ms arithmetic gives
565
+ // \`diff = (u_hoverTime - start) mod 524288\`. When diff > duration the
566
+ // ramp is done; when 0 \u2264 diff < duration the instance is mid-fade.
567
+ float _hoverStart = floor(nodeFlags / 32.0);
568
+ float _hoverDiff = u_hoverTime - _hoverStart;
569
+ if (_hoverDiff < 0.0) _hoverDiff += 524288.0;
570
+ float _hoverT = _hoverStart < 0.5
571
+ ? 1.0 // never animated \u2192 snap to target
572
+ : clamp(_hoverDiff / max(u_hoverDuration, 1.0), 0.0, 1.0);
573
+ float _hoverEased = _hoverT < 0.5
574
+ ? 4.0 * _hoverT * _hoverT * _hoverT
575
+ : 1.0 - pow(-2.0 * _hoverT + 2.0, 3.0) / 2.0;
576
+ vHoverDim = mix(1.0 - _hoverTarget, _hoverTarget, _hoverEased);
577
+ vColor = nodeColor;
578
+ vOpacity = nodeOpacity;
579
+ vIcon = nodeIcon;
580
+ vIconUV = nodeIconUV;
581
+ vNodeCollect = aNodeCollect;
582
+ // nodeSuppressFill = suppress (0/1) + 2 * shapeId \u2014 packed to stay within the attribute budget.
583
+ vSuppressFill = mod(nodeSuppressFill, 2.0);
584
+ vImageUV = nodeImageUV;
585
+ vRipple = nodeEffects.x;
586
+ vBreathe = nodeEffects.y;
587
+ vHalo = nodeEffects.z;
588
+
589
+ vec3 sampledPos = samplePosition(nodeIndex);
590
+
591
+ vec3 finalPosition = sampledPos;
592
+ if (animate > 0.5) {
593
+ finalPosition = mix(sampledPos, toPosition, t);
594
+ }
595
+
596
+ vec4 mvCenter = modelViewMatrix * vec4(finalPosition, 1.0);
597
+
598
+ // Per-node perspective sizing (matches legacy nodeVertex.glsl).
599
+ // \`pixelSize\` is the on-screen diameter of the node in physical pixels.
600
+ float scaledSize = nodeSize * nodeSizeScale;
601
+ if (vBreathe > 0.0) {
602
+ scaledSize *= 1.0 + vBreathe * 0.15 * sin(time * 3.0);
603
+ }
604
+ float viewDepth = max(-mvCenter.z, 0.001);
605
+ float baseSize;
606
+ if (mapMode > 0.5) {
607
+ // Map mode: damped scaling so nodes stay roughly constant screen size.
608
+ // refDepth=10 is the anchor depth where sizes match the designed CSS px.
609
+ // damping=0 \u2192 constant size, damping=1 \u2192 full perspective (same as normal).
610
+ float refDepth = 10.0;
611
+ float refSize = scaledSize * (50.0 / refDepth);
612
+ // \`growth\` is the inverse-zoom multiplier vs the refDepth baseline.
613
+ // Soft-cap curve to prevent nodes from covering the map at deep zoom while
614
+ // keeping the "still growing" feel users expect when they zoom in:
615
+ // - Below softKnee: pass through (full damped growth).
616
+ // - Above softKnee: rational asymptote A\xB7t/(A+t) toward mapMaxGrowth.
617
+ // The curve is C\xB9-continuous at the knee (matches derivative, no kink).
618
+ // Curve MUST stay in sync with picking.vert.glsl, badge.vert.glsl, and
619
+ // tag.vert.glsl so hitbox and decorations freeze in lockstep with the bubble.
620
+ float raw = pow(refDepth / viewDepth, mapDamping);
621
+ float growth = kvMapGrowth(raw, mapMaxGrowth);
622
+ baseSize = refSize * growth;
623
+ } else {
624
+ baseSize = scaledSize * (50.0 / viewDepth);
625
+ }
626
+ float sizeMultiplier = (vSelected > 0.5 || vHighlighted > 0.5) ? 1.5 : 1.0;
627
+ float rippleExpand = vRipple > 0.0 ? 3.0 : 1.0;
628
+ float expand = max(rippleExpand, nodeEffects.z > 0.0 ? HALO_EXPAND : 1.0);
629
+ // pixelSize is the on-screen diameter in CSS pixels. Do NOT multiply by pixelRatio:
630
+ // resolution is in CSS px (container.clientWidth/Height), and gl_PointSize in the
631
+ // legacy Point pipeline included pixelRatio only because gl_PointSize is in physical
632
+ // pixels \u2014 the browser then halved it for display, cancelling out. Quads work in CSS
633
+ // px directly, so multiplying by pixelRatio would double-scale on Retina.
634
+ float pixelSize = baseSize * sizeMultiplier * expand;
635
+
636
+ // Near-camera cap: what the budget protects is the FRAME, so it is the whole
637
+ // quad that gets capped \u2014 selection multiplier and ripple/halo expansion
638
+ // included. A node the scene flies past otherwise covers everything, and a
639
+ // highlighted one covers 1.5\xD7 everything. MUST stay in sync with
640
+ // picking.vert.glsl (hitbox), edge.vert.glsl (endpoint pullback) and
641
+ // arrow.vert.glsl (cone): all four cap the same expression with the same
642
+ // call, so for an ordinary node \u2014 multiplier 1, expand 1 \u2014 they agree
643
+ // exactly. For a selected or rippling one they differ by the multipliers,
644
+ // which those three shaders have never known about anyway (an edge has
645
+ // always stopped at the unselected radius); the cap inherits that
646
+ // approximation rather than adding one.
647
+ //
648
+ // Cap ONCE. \`kvScreenCap\` is not idempotent above its knee \u2014 capping both
649
+ // \`baseSize\` and \`pixelSize\` would shrink the quad below the fill radius the
650
+ // fragment shader derives from \`expand\`, and the node would clip itself.
651
+ pixelSize = kvScreenCap(pixelSize, maxScreenFraction, resolution);
652
+
653
+ // Clamp pixelSize to a sane range:
654
+ // - Lower bound \`minPixelSize\` (CSS px, default 1.5): WebGL does not
655
+ // anti-alias triangle edges below ~1 px without MSAA, so very small quads
656
+ // alias badly. The floor restores the visual stability point primitives
657
+ // provided implicitly. Whatever the floor, a node never draws under one
658
+ // device pixel: one that is smaller draws one device pixel with its alpha
659
+ // scaled by its area (vCoverage), so a cloud of sub-pixel nodes keeps the
660
+ // brightness of their true size instead of flickering or filling in.
661
+ // MUST stay in sync with picking.vert.glsl.
662
+ // - Upper bound 4096 px: nodes very near the camera otherwise produce
663
+ // screen-spanning quads with extreme fragment cost. Replaces the implicit
664
+ // hardware \u2264255 px cap that gl_PointSize used to enforce.
665
+ float devicePx = pixelSize * pixelRatio;
666
+ vCoverage = devicePx < 1.0 ? devicePx * devicePx : 1.0;
667
+ pixelSize = clamp(pixelSize, max(minPixelSize, 1.0 / pixelRatio), 4096.0);
668
+ vDevicePx = pixelSize * pixelRatio;
669
+
670
+ vec4 clipCenter = projectionMatrix * mvCenter;
671
+ vShape = floor(nodeSuppressFill * 0.5);
672
+ #ifdef KV_POINT_PRIMITIVE
673
+ // Point primitive: one vertex per node. gl_PointSize is in device pixels and
674
+ // the GPU caps it; past the cap the sprite stops growing (the trade-off this
675
+ // primitive makes, see GPUNodeRendererConfig.primitive). A shape's aspect is
676
+ // not applied: the sprite is square. The fragment reads gl_PointCoord, which
677
+ // has the same [0,1]\xB2, Y-down convention as the quad's vUv.
678
+ vDevicePx = min(vDevicePx, maxPointSize);
679
+ gl_PointSize = vDevicePx;
680
+ gl_Position = clipCenter;
681
+ #else
682
+ // Project the center to clip space, then offset by corner * pixelSize / viewport.
683
+ // Multiplying by gl_Position.w preserves the offset after perspective divide.
684
+ float shapeAspect = nodeEffects.w > 0.0 ? nodeEffects.w : 1.0; // 0 (unset) -> square
685
+ // Height = width / aspect; aspect 1 divides by exactly 1.0, so square nodes are unchanged.
686
+ vec2 offsetClip = vec2(corner.x, corner.y / shapeAspect) * pixelSize / resolution * 2.0 * clipCenter.w;
687
+ gl_Position = clipCenter + vec4(offsetClip, 0.0, 0.0);
688
+
689
+ // Fragment-local UV: [0,1]\xB2 with (0.5, 0.5) at the node center, matching gl_PointCoord.
690
+ // gl_PointCoord is Y-DOWN (origin at top-left), but clip-space Y is Y-UP (top corners have
691
+ // corner.y = +0.5). We invert Y here so vUv.y = 0 at the visual top of the node \u2014 keeps
692
+ // icon/image atlas UVs (which are Y-down via Three.js flipY=true) right-side up.
693
+ vUv = vec2(corner.x + 0.5, 0.5 - corner.y);
694
+ #endif
695
+ // Globe mode: vertex-level back-face culling.
696
+ // depthTest is disabled in globe mode to prevent billboard clipping against
697
+ // the occlusion sphere. Instead, we hide back-facing nodes here.
698
+ if (sphereRadius > 0.001) {
699
+ vec3 wN = normalize(mat3(modelMatrix) * normalize(finalPosition));
700
+ vec3 wP = (modelMatrix * vec4(finalPosition, 1.0)).xyz;
701
+ if (dot(wN, normalize(cameraPosition - wP)) < 0.0) {
702
+ // Push the quad off-screen (NDC outside [-1,1]) so all 4 corners are clipped.
703
+ gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
704
+ }
705
+ }
706
+ }
707
+ `;var La=`precision highp float;
708
+
709
+ const float HALO_EXPAND = 2.2; // MUST match node.vert.glsl
710
+ const float HALO_EDGE = 1.7; // outer radius (in node-radius units) where halo fades to 0
711
+ const float HALO_GAIN = 0.9; // (unused after translucent-disk rewrite \u2014 kept to minimize churn)
712
+ const float HALO_ALPHA = 0.35; // halo alpha ceiling
713
+
714
+ // Uniforms
715
+ uniform float hideRing;
716
+ uniform float useCircle;
717
+ uniform float lightMode;
718
+ uniform sampler2D iconSdfAtlas;
719
+ uniform float hasIconSdfAtlas;
720
+ uniform sampler2D imageAtlas;
721
+ uniform float hasImageAtlas;
722
+ uniform float iconDisplayMode;
723
+
724
+ // Pin icon (push-pin texture overlay). When vPinned > 0.5 and hidePin == 0,
725
+ // the pinTexture is sampled in the upper-right quadrant of the node sprite
726
+ // (matches legacy nodeImageFragment.glsl renderPin pattern).
727
+ uniform sampler2D pinTexture;
728
+ uniform float hidePin;
729
+
730
+ // Time uniform for shader-driven effects
731
+ uniform float time;
732
+ // Ripple effect configuration
733
+ uniform vec3 uRippleColor;
734
+ uniform float uRippleSpeed;
735
+ uniform float uRippleRings;
736
+
737
+ // Hover dim: when a node is hovered, non-neighbor nodes fade to u_hoverDimOpacity.
738
+ // u_hoverProgress animates 0\u21921 over the hover-in duration (driven by HoverApi).
739
+ uniform float u_hoverProgress;
740
+ uniform float u_hoverDimOpacity;
741
+
742
+ // Varyings
743
+ varying vec3 vColor;
744
+ varying float vOpacity;
745
+ varying float vIcon;
746
+ varying vec4 vIconUV;
747
+ varying vec4 vImageUV;
748
+ varying float vSelected;
749
+ varying float vHighlighted;
750
+ varying float vPinned;
751
+ varying float vNodeCollect;
752
+ varying float vSuppressFill;
753
+ varying float vHidden;
754
+ varying float vHoverDim;
755
+ varying float vRipple;
756
+ varying float vBreathe;
757
+ varying float vHalo;
758
+ #ifdef KV_POINT_PRIMITIVE
759
+ // Point primitive: the sprite's own [0,1]\xB2 coordinate, Y-down like the quad's vUv.
760
+ #define vUv gl_PointCoord
761
+ #else
762
+ varying vec2 vUv;
763
+ #endif
764
+ varying float vShape;
765
+ varying float vCoverage;
766
+ varying float vDevicePx;
767
+
768
+ void main() {
769
+ // Discard hidden nodes
770
+ if (vHidden > 0.5) discard;
771
+ if (vSuppressFill > 0.5) discard;
772
+
773
+ // A node under 1.5 device pixels is a dot: no shape, ring or icon would be
774
+ // visible, and on a quad this small the pixel centre can fall outside the
775
+ // circle, so a shape mask would drop the node. Fill the pixel instead, with
776
+ // the area alpha of a node under one device pixel. Only reachable when the
777
+ // host lowers \`minPixelSize\` below the default 1.5 CSS px.
778
+ if (vDevicePx < 1.5) {
779
+ float dotAlpha = vOpacity * vCoverage * mix(1.0, u_hoverDimOpacity, vHoverDim * u_hoverProgress);
780
+ if (dotAlpha < 0.001) discard;
781
+ gl_FragColor = vec4(vColor, dotAlpha);
782
+ return;
783
+ }
784
+
785
+ // When ripple is active, the billboard quad is 3x larger (rippleExpand in node.vert.glsl).
786
+ // Remap coordinates so the node draws at its normal size in the center. Ripples use raw coords.
787
+ float rippleExpand = vRipple > 0.0 ? 3.0 : 1.0;
788
+ float expand = max(rippleExpand, vHalo > 0.0 ? HALO_EXPAND : 1.0);
789
+ vec2 nodeCoord = (vUv - 0.5) * expand + 0.5;
790
+ vec2 center = nodeCoord - vec2(0.5);
791
+ float dist = length(center);
792
+ // Non-circle shapes: 0.5 + signed distance plays the role of the radius, so the soft edge,
793
+ // rings, icon clip and collect gate below follow the outline. y flipped: vUv is y-down.
794
+ if (vShape > 0.5) dist = 0.5 + kvShapeSdf(vShape, vec2(center.x, -center.y));
795
+
796
+ // Discard pixels outside the expanded area that are also outside the node
797
+ // (when ripple is off, this has no effect since rippleExpand = 1)
798
+ if (vRipple > 0.0 && dist > 0.5) {
799
+ // Outside node circle \u2014 only keep if a ripple ring will draw here
800
+ float rawDist = length(vUv - vec2(0.5)) * 2.0;
801
+ if (rawDist > 1.0) discard;
802
+ }
803
+
804
+ // Circle mode
805
+ // Circle clip: discard pixels outside node radius.
806
+ // When ripple is active, keep outer pixels alive for the ripple rings.
807
+ if (useCircle > 0.5 && dist > 0.5 && vRipple <= 0.0 && vHalo <= 0.0) discard;
808
+ // For ripple nodes: pixels outside the node circle start fully transparent
809
+ // (the ripple code below will add ring color to them).
810
+ bool outsideNodeCircle = (dist > 0.5);
811
+
812
+ // Check if node has an SDF icon (and no image override)
813
+ bool hasIcon = hasIconSdfAtlas > 0.5 && vIconUV.x >= 0.0 && !(hasImageAtlas > 0.5 && vImageUV.x >= 0.0);
814
+ bool transparentBg = hasIcon && iconDisplayMode > 0.5;
815
+
816
+ // Base color: transparent for ring/plain icon modes, solid for filled mode
817
+ if (transparentBg) {
818
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
819
+ } else {
820
+ gl_FragColor = vec4(vColor, vOpacity);
821
+ }
822
+
823
+ // Soft edge for circle (skip for transparent bg modes)
824
+ if (useCircle > 0.5 && !transparentBg) {
825
+ float edgeOuter = 0.5;
826
+ if (vSelected > 0.5) edgeOuter = 0.38;
827
+ else if (vHighlighted > 0.5) edgeOuter = 0.40;
828
+ float alpha = 1.0 - smoothstep(edgeOuter - 0.02, edgeOuter, dist);
829
+ gl_FragColor.a *= alpha;
830
+ }
831
+
832
+ // Image overlay: photo inside node circle
833
+ if (hasImageAtlas > 0.5 && vImageUV.x >= 0.0) {
834
+ float imgSize = 0.88;
835
+ vec2 imgLocal = (nodeCoord - 0.5) / imgSize + 0.5;
836
+ float imgInBounds = step(0.0, imgLocal.x) * step(imgLocal.x, 1.0)
837
+ * step(0.0, imgLocal.y) * step(imgLocal.y, 1.0);
838
+ if (imgInBounds > 0.5) {
839
+ vec2 imgUV = mix(vImageUV.xy, vImageUV.zw, clamp(imgLocal, 0.0, 1.0));
840
+ vec4 imgColor = texture2D(imageAtlas, imgUV);
841
+ float imgAlpha = imgColor.a * (1.0 - smoothstep(0.42, 0.48, dist));
842
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, imgColor.rgb, imgAlpha);
843
+ gl_FragColor.a = max(gl_FragColor.a, imgAlpha * vOpacity);
844
+ }
845
+ }
846
+
847
+ // Icon SDF overlay \u2014 mode-aware rendering
848
+ // Skip icon when image is present \u2014 image takes priority.
849
+ if (hasIcon) {
850
+ // Plain mode uses larger icon since there's no ring
851
+ float iconSize = (iconDisplayMode > 1.5) ? 0.80 : 0.70;
852
+ vec2 local = (nodeCoord - 0.5) / iconSize + 0.5;
853
+ float inBounds = step(0.0, local.x) * step(local.x, 1.0)
854
+ * step(0.0, local.y) * step(local.y, 1.0);
855
+ if (inBounds > 0.5) {
856
+ vec2 iconUV = mix(vIconUV.xy, vIconUV.zw, clamp(local, 0.0, 1.0));
857
+ float sdf = texture2D(iconSdfAtlas, iconUV).r;
858
+ float fw = fwidth(sdf);
859
+ // SDF_EDGE = 1.0 - TinySDF cutoff (0.25) = 0.75. Using 0.5 dilates the
860
+ // glyph by ~radius*0.25 px, which fills small interior holes (e.g.
861
+ // bomb sparkle gap) and bloats fine details. Tag/badge/text shaders
862
+ // already use 0.75 \u2014 node icon was the outlier.
863
+ const float SDF_EDGE = 0.75;
864
+ float iconAlpha = smoothstep(SDF_EDGE - fw, SDF_EDGE + fw, sdf);
865
+ // Soft circular clip: fade out near circle edge
866
+ float clipEdge = transparentBg ? 0.40 : 0.42;
867
+ iconAlpha *= 1.0 - smoothstep(clipEdge, clipEdge + 0.06, dist);
868
+ // Icon color: dark gray for filled, node color for ring/plain
869
+ vec3 iconCol;
870
+ if (iconDisplayMode < 0.5) {
871
+ iconCol = vColor * 0.3;
872
+ } else {
873
+ iconCol = vColor;
874
+ }
875
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, iconCol, iconAlpha);
876
+ if (transparentBg) gl_FragColor.a = max(gl_FragColor.a, iconAlpha * vOpacity);
877
+ }
878
+ }
879
+
880
+ // --- Border ring / Selection ring ---
881
+ if (useCircle > 0.5) {
882
+ // Ring-only mode: always draw colored ring first (underneath sel/hl).
883
+ // Pin state has no ring treatment \u2014 the push-pin texture overlay
884
+ // below is the sole pin indicator (matches legacy GraphXR).
885
+ if (transparentBg && iconDisplayMode < 1.5) {
886
+ float ringOuter = 0.50;
887
+ float ringInner = 0.43;
888
+ float ring = smoothstep(ringInner - 0.02, ringInner, dist)
889
+ * (1.0 - smoothstep(ringOuter - 0.02, ringOuter, dist));
890
+ float boost = lightMode > 0.5 ? 0.85 : 1.2;
891
+ vec3 ringCol = vColor * boost;
892
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, ringCol, ring);
893
+ gl_FragColor.a = max(gl_FragColor.a, ring * vOpacity);
894
+ }
895
+ // Selection/highlight rings (all modes)
896
+ if (vSelected > 0.5) {
897
+ vec3 selColor = lightMode > 0.5 ? vec3(0.40, 0.42, 0.48) : vec3(1.0, 1.0, 1.0);
898
+ float selRing = smoothstep(0.41, 0.42, dist) * (1.0 - smoothstep(0.48, 0.50, dist));
899
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, selColor, selRing);
900
+ gl_FragColor.a = max(gl_FragColor.a, selRing * vOpacity);
901
+ } else if (vHighlighted > 0.5) {
902
+ vec3 hlColor = lightMode > 0.5 ? vec3(0.55, 0.57, 0.62) : vec3(0.85, 0.85, 0.85);
903
+ float hlRing = smoothstep(0.42, 0.43, dist) * (1.0 - smoothstep(0.48, 0.50, dist));
904
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, hlColor, hlRing * 0.9);
905
+ gl_FragColor.a = max(gl_FragColor.a, hlRing * 0.9 * vOpacity);
906
+ } else if (!transparentBg && hideRing < 0.5) {
907
+ // Normal filled mode: border ring on node edge.
908
+ // Pin state has no ring treatment \u2014 the push-pin texture overlay
909
+ // below is the sole pin indicator (matches legacy GraphXR).
910
+ float ring = smoothstep(0.42, 0.44, dist) * (1.0 - smoothstep(0.48, 0.50, dist));
911
+ float boost = lightMode > 0.5 ? 0.76 : 1.3;
912
+ vec3 ringColor = vColor * boost;
913
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, ringColor, ring * 0.5);
914
+ }
915
+ }
916
+
917
+ // Collect indicator: legacy-style overlay \u2014 4 corner balls + center circle, NO digits.
918
+ // Pulled inward vs. legacy so a visible gap separates the inner symbol from the outer ring;
919
+ // the count display is delegated to BadgeCloud (top-right anchor by convention).
920
+ //
921
+ // Layout (in node-local coords, node center at 0.5, node radius at 0.5):
922
+ // 4 balls \u2014 centers at (0.32, 0.32) / (0.32, 0.68) / (0.68, 0.32) / (0.68, 0.68), r=0.13
923
+ // \u2192 ball outer edge reaches dist \u2248 0.385 from node center
924
+ // center \u2014 circle at (0.5, 0.5), r=0.10 with thin darker border (mirrors legacy badge,
925
+ // digits removed per Phase-5 redesign)
926
+ // gap \u2014 interior gate at dist < 0.40 leaves dist \u2208 [0.40, 0.50] as deadband + ring,
927
+ // giving ~0.035 of clear space between symbol and outer ring (\u22487% of diameter)
928
+ // ring \u2014 drawn by the base shader's selection/highlight/normal ring code below
929
+ if (useCircle > 0.5 && vNodeCollect > 0.5) {
930
+ float ballR = 0.13;
931
+ vec2 c0 = vec2(0.32, 0.32);
932
+ vec2 c1 = vec2(0.32, 0.68);
933
+ vec2 c2 = vec2(0.68, 0.32);
934
+ vec2 c3 = vec2(0.68, 0.68);
935
+ float d0 = length(nodeCoord - c0);
936
+ float d1 = length(nodeCoord - c1);
937
+ float d2 = length(nodeCoord - c2);
938
+ float d3 = length(nodeCoord - c3);
939
+ float minBallDist = min(min(d0, d1), min(d2, d3));
940
+
941
+ // Center circle (no digits)
942
+ float centerR = 0.10;
943
+ float centerDist = length(nodeCoord - vec2(0.5));
944
+
945
+ // Interior zone \u2014 anything outside is left to base shader (preserves outer ring zone).
946
+ bool inInterior = dist < 0.40;
947
+ if (inInterior) {
948
+ if (minBallDist < ballR) {
949
+ // Inside a corner ball \u2014 node color with soft AA edge.
950
+ float ballAlpha = 1.0 - smoothstep(ballR - 0.015, ballR, minBallDist);
951
+ gl_FragColor = vec4(vColor, vOpacity * ballAlpha);
952
+ } else if (centerDist < centerR) {
953
+ // Center circle \u2014 node color with thin darker border (legacy badge look, no digit).
954
+ float centerAlpha = 1.0 - smoothstep(centerR - 0.015, centerR, centerDist);
955
+ float borderW = 0.015;
956
+ float innerMask = 1.0 - smoothstep(centerR - borderW - 0.008, centerR - borderW, centerDist);
957
+ vec3 borderColor = vColor * (lightMode > 0.5 ? 0.6 : 1.4);
958
+ vec3 fillColor = mix(borderColor, vColor, innerMask);
959
+ gl_FragColor = vec4(fillColor, vOpacity * centerAlpha);
960
+ } else {
961
+ // Between elements \u2014 clear so background shows through (creates the visible gap).
962
+ gl_FragColor.a = 0.0;
963
+ }
964
+ }
965
+ }
966
+
967
+ // Ripple effect: concentric rings expanding OUTSIDE the node.
968
+ // The billboard quad was expanded 3x (rippleExpand) for ripple nodes \u2014 the node occupies
969
+ // the inner 1/3. 'dist' uses nodeCoord (remapped to node space). Raw vUv covers the full area.
970
+ if (vRipple > 0.0) {
971
+ // Use raw vUv for ripple (covers the full 3x expanded area)
972
+ float rawDist = length(vUv - vec2(0.5)) * 2.0;
973
+ float nodeEdge = 1.0 / 3.0;
974
+ float speed = uRippleSpeed > 0.0 ? uRippleSpeed : 0.5;
975
+ float rings = uRippleRings > 0.0 ? uRippleRings : 3.0;
976
+ float rippleAlphaSum = 0.0;
977
+ vec3 rColor = uRippleColor.r + uRippleColor.g + uRippleColor.b > 0.01 ? uRippleColor : vec3(0.0, 0.9, 1.0);
978
+ for (float i = 0.0; i < 4.0; i++) {
979
+ if (i >= rings) break;
980
+ float phase = fract(time * speed + i / rings);
981
+ // Ring starts at node edge and expands to the full area
982
+ float ringRadius = nodeEdge + phase * (1.0 - nodeEdge);
983
+ float ringWidth = 0.03;
984
+ float ringDist = abs(rawDist - ringRadius) / ringWidth;
985
+ if (ringDist < 1.0 && rawDist > nodeEdge * 0.9) {
986
+ float alpha = (1.0 - phase) * (1.0 - ringDist * ringDist) * vRipple;
987
+ rippleAlphaSum += alpha;
988
+ }
989
+ }
990
+ // \xD7 vOpacity: rings must dim with their node under focusContext \u2014 the
991
+ // ring/additive writes below otherwise ignore the per-node dim opacity.
992
+ rippleAlphaSum *= vOpacity;
993
+ if (rippleAlphaSum > 0.0) {
994
+ if (outsideNodeCircle) {
995
+ // Outside node: paint the ring on transparent background
996
+ gl_FragColor = vec4(rColor * rippleAlphaSum, rippleAlphaSum * 0.7);
997
+ } else {
998
+ // Inside node: additive blend over existing node color
999
+ gl_FragColor.rgb += rColor * rippleAlphaSum * 0.3;
1000
+ }
1001
+ } else if (outsideNodeCircle && vHalo <= 0.0) {
1002
+ // Outside node and no ripple ring here \u2014 fully transparent
1003
+ discard;
1004
+ }
1005
+ }
1006
+
1007
+ // \u2500\u2500 Pin icon overlay (push-pin texture) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
1008
+ // Render the pin icon last so it sits above ring + icon, like the legacy
1009
+ // GraphXR nodeImageFragment.glsl renderPin() pattern. Sized so the pin
1010
+ // appears in the upper-right quadrant of the node sprite. The pulsing
1011
+ // blue ring above is the secondary "anchored" indicator; this is the
1012
+ // primary one (matches user expectation from legacy).
1013
+ if (vPinned > 0.5 && hidePin < 0.5) {
1014
+ float pinScale = (vSelected > 0.5 || vHighlighted > 0.5) ? 6.0 : 4.0;
1015
+ float pinAngle = 0.7853981633974483; // PI / 4
1016
+ float c = cos(pinAngle);
1017
+ float s = sin(pinAngle);
1018
+ // Flip y so coords match the pin PNG orientation (matches legacy
1019
+ // \`normalCoord = vec2(gl_PointCoord.s, 1.0 - gl_PointCoord.t)\`).
1020
+ vec2 normalCoord = vec2(vUv.x, 1.0 - vUv.y);
1021
+ // Rotate + scale around (0.5, 0.5), no extra translation.
1022
+ vec2 centered = normalCoord - vec2(0.5);
1023
+ vec2 pinUV = vec2(
1024
+ pinScale * (c * centered.x - s * centered.y) + 0.5,
1025
+ pinScale * (s * centered.x + c * centered.y) + 0.5
1026
+ );
1027
+ if (pinUV.x >= 0.0 && pinUV.x <= 1.0 && pinUV.y >= 0.0 && pinUV.y <= 1.0) {
1028
+ vec4 pinSample = texture2D(pinTexture, pinUV);
1029
+ // Selected/highlighted nodes get a slightly stronger pin overlay so
1030
+ // it stays visible above selection rings.
1031
+ float pinStrength = (vSelected > 0.5 || vHighlighted > 0.5) ? 0.95 : 0.85;
1032
+ pinSample.a *= pinStrength;
1033
+ gl_FragColor.rgb = mix(gl_FragColor.rgb, pinSample.rgb, pinSample.a);
1034
+ gl_FragColor.a = max(gl_FragColor.a, pinSample.a * vOpacity);
1035
+ }
1036
+ }
1037
+
1038
+ // Node halo: a soft SEMI-TRANSPARENT disk in the node's OWN color (no
1039
+ // brightening \u2014 a brightened/additive halo reads as a glow/bloom). Pure
1040
+ // translucency via alpha under NormalBlending.
1041
+ if (vHalo > 0.0 && outsideNodeCircle) {
1042
+ float rr = length(nodeCoord - vec2(0.5)) * 2.0; // 1.0 at circle edge, grows outward
1043
+ // Pure-color flat disk: UNIFORM alpha all the way to HALO_EDGE, then a
1044
+ // crisp ~1px anti-aliased cutoff (fwidth \u2014 resolution independent, same as
1045
+ // the icon/text shaders). No gradient band \u2192 reads as a solid colored
1046
+ // disk, not a glow/bloom. (Previously a 0.15-wide smoothstep band made the
1047
+ // edge fade over ~15% of the node radius, which read as a soft glow.)
1048
+ float aa = fwidth(rr);
1049
+ float falloff = 1.0 - smoothstep(HALO_EDGE - aa, HALO_EDGE, rr);
1050
+ gl_FragColor.rgb = vColor; // node's own color, NOT brightened
1051
+ // \xD7 vOpacity: the max() must not resurrect alpha focusContext dimmed.
1052
+ gl_FragColor.a = max(gl_FragColor.a, falloff * vHalo * HALO_ALPHA * vOpacity);
1053
+ }
1054
+
1055
+ // Hover dim: dim non-neighbor nodes when a hover is active.
1056
+ float hoverDimMul = mix(1.0, u_hoverDimOpacity, vHoverDim * u_hoverProgress);
1057
+ gl_FragColor.a *= hoverDimMul;
1058
+
1059
+ // Alpha test
1060
+ if (gl_FragColor.a < 0.01) discard;
1061
+ }
1062
+ `;var Oa=`precision highp float;
1063
+ const float GLOW_WIDEN_K = 3.0; // max strip widen = 1 + strength*K (strength 1 \u2192 4x)
1064
+ const float EDGE_WIDTH_SHARE = 0.125; // a capped strip's share of a capped bubble's budget
1065
+ const float KV_NEAR_Z = 1e-3; // view depth the strip must stay in front of (camera looks down -z)
1066
+
1067
+ uniform sampler2D positionTexture;
1068
+ uniform float textureSize;
1069
+ uniform float spaceSize;
1070
+ uniform vec2 resolution;
1071
+ uniform float sizeAttenuation;
1072
+ uniform float lineWidthScale;
1073
+ uniform float nodeSizeScale;
1074
+ uniform float fixedSize;
1075
+ uniform float mapMode;
1076
+ uniform float mapDamping;
1077
+ uniform float mapMaxGrowth; // shared semantics with node.vert.glsl; -1.0 = Infinity sentinel
1078
+ uniform float maxScreenFraction; // shared semantics with node.vert.glsl; -1.0 = unbounded
1079
+ uniform float sphereRadius;
1080
+ uniform float arrowLengthWorld;
1081
+ uniform float defaultEdgeShape;
1082
+ uniform float radialAxis;
1083
+ uniform float orthoCornerRadius; // 0..1, orthogonal corner rounding (see kv_orthoEdge.glsl)
1084
+ uniform float edgeSegments; // strip segments per edge (geometry constant)
1085
+ uniform sampler2D routeTexture; // routed edges' bend points (see kv_routedEdge.glsl)
1086
+ uniform float routeTextureSize;
1087
+ // Projection-consistent formula computes node world radius from shader size
1088
+
1089
+ attribute float sourceIndex;
1090
+ attribute float targetIndex;
1091
+ attribute float side;
1092
+ attribute float along;
1093
+ attribute float counters;
1094
+ attribute vec3 edgeColor;
1095
+ attribute float edgeWidth;
1096
+ attribute float edgeOpacity;
1097
+ attribute float edgeSelected;
1098
+ attribute float edgeHighlighted;
1099
+ attribute vec3 controlOffset;
1100
+ attribute vec4 nodeSizes; // x,y: source / target size; z,w: their shape codes (see kv_shapes.glsl)
1101
+ attribute float edgeFlags;
1102
+
1103
+ // Time uniform for shader-driven effects
1104
+ uniform float time;
1105
+ // Hover-neighbor-highlight: per-instance fade driven by edgeFlags upper bits
1106
+ // (the timestamp, ms mod 2^19) compared against u_hoverTime.
1107
+ uniform float u_hoverTime;
1108
+ uniform float u_hoverDuration;
1109
+
1110
+ varying vec4 vColor;
1111
+ varying float vCounters;
1112
+ varying float vOpacity;
1113
+ varying float vUseDash;
1114
+ varying float vSelected;
1115
+ varying float vFlow;
1116
+ varying float vGlow;
1117
+ varying float vSide;
1118
+ varying float vTubeGlow;
1119
+ varying float vHoverDim;
1120
+ // Fine-line coverage: |vSide| at which the desired (possibly sub-pixel) line
1121
+ // edge sits inside the min-width geometric strip. 1.0 = no thinning; <1 fades a
1122
+ // thin line's alpha so it stays a crisp hairline instead of shimmering/fattening.
1123
+ varying float vCoreEdge;
1124
+
1125
+ vec3 samplePosition(float idx) {
1126
+ float texX = mod(idx, textureSize) + 0.5;
1127
+ float texY = floor(idx / textureSize) + 0.5;
1128
+ vec2 texCoord = vec2(texX, texY) / textureSize;
1129
+ return texture2D(positionTexture, texCoord).xyz;
1130
+ }
1131
+
1132
+ vec3 bezier(vec3 p0, vec3 p1, vec3 p2, float t) {
1133
+ float t1 = 1.0 - t;
1134
+ return t1 * t1 * p0 + 2.0 * t1 * t * p1 + t * t * p2;
1135
+ }
1136
+
1137
+ // Spherical linear interpolation between two unit vectors \`a\` and \`b\`.
1138
+ // Used by globe-mode edges to ride the great-circle arc instead of a
1139
+ // chord-proportional bezier bulge. Falls back to straight \`mix\` when the
1140
+ // endpoints are near-coincident (sinOmega \u2248 0) to avoid divide-by-zero.
1141
+ vec3 slerp(vec3 a, vec3 b, float t) {
1142
+ float cosOmega = clamp(dot(a, b), -1.0, 1.0);
1143
+ float omega = acos(cosOmega);
1144
+ float sinOmega = sin(omega);
1145
+ if (sinOmega < 1e-5) return normalize(mix(a, b, t));
1146
+ return (sin((1.0 - t) * omega) * a + sin(t * omega) * b) / sinOmega;
1147
+ }
1148
+
1149
+ vec2 fix(vec4 pos, float aspect) {
1150
+ vec2 res = pos.xy / pos.w;
1151
+ res.x *= aspect;
1152
+ return res;
1153
+ }
1154
+
1155
+ vec3 rotateAroundAxis(vec3 v, vec3 axis, float angle) {
1156
+ float c = cos(angle);
1157
+ float s = sin(angle);
1158
+ return v * c + cross(axis, v) * s + axis * dot(axis, v) * (1.0 - c);
1159
+ }
1160
+
1161
+ vec3 computePerpendicular(vec3 dir) {
1162
+ // Modified: Use Z-axis as reference for vertical plane curves
1163
+ vec3 ref = abs(dir.z) < 0.99 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
1164
+ return normalize(cross(dir, ref));
1165
+ }
1166
+
1167
+ // Cubic bezier for S-curve tree edges
1168
+ vec3 cubicBezier(vec3 p0, vec3 p1, vec3 p2, vec3 p3, float t) {
1169
+ float t1 = 1.0 - t;
1170
+ return t1*t1*t1*p0 + 3.0*t1*t1*t*p1 + 3.0*t1*t*t*p2 + t*t*t*p3;
1171
+ }
1172
+
1173
+ // Radial S-curve: smooth tree edge using cubic bezier
1174
+ // P0=src, P1=(src.x, midY), P2=(tgt.x, midY), P3=tgt (vertical routing)
1175
+ // Creates smooth S-curve that exits parent vertically and arrives at child vertically
1176
+ vec3 radialInterpolate(vec3 src, vec3 tgt, vec3 dir, float t, float axisMode) {
1177
+ bool useVertical;
1178
+ if (axisMode > 1.5) { useVertical = false; }
1179
+ else if (axisMode > 0.5) { useVertical = true; }
1180
+ else { useVertical = abs(dir.y) >= abs(dir.x); }
1181
+ vec3 cp1, cp2;
1182
+ if (useVertical) {
1183
+ float midY = (src.y + tgt.y) * 0.5;
1184
+ cp1 = vec3(src.x, midY, src.z);
1185
+ cp2 = vec3(tgt.x, midY, tgt.z);
1186
+ } else {
1187
+ float midX = (src.x + tgt.x) * 0.5;
1188
+ cp1 = vec3(midX, src.y, src.z);
1189
+ cp2 = vec3(midX, tgt.y, tgt.z);
1190
+ }
1191
+ return cubicBezier(src, cp1, cp2, tgt, t);
1192
+ }
1193
+
1194
+ void main() {
1195
+ float aspect = resolution.x / resolution.y;
1196
+
1197
+ vColor = vec4(edgeColor, edgeOpacity);
1198
+ vCounters = counters;
1199
+ vOpacity = edgeOpacity;
1200
+ // Unpack edgeFlags. Low 5 bits = flag bits (dashed/flow/glow/hoverDim);
1201
+ // upper 19 bits = hoverDim flip timestamp (ms mod 2^19). The flag-bit
1202
+ // unpacks below stay correct because timestamp*32 is always even when
1203
+ // divided by {2,4,8,16}.
1204
+ vUseDash = mod(edgeFlags, 2.0);
1205
+ vSelected = edgeSelected;
1206
+ vFlow = mod(floor(edgeFlags / 2.0), 2.0);
1207
+ vGlow = mod(floor(edgeFlags / 4.0), 2.0);
1208
+ vTubeGlow = mod(floor(edgeFlags / 8.0), 2.0);
1209
+ float _hoverTarget = mod(floor(edgeFlags / 16.0), 2.0);
1210
+ float _hoverStart = floor(edgeFlags / 32.0);
1211
+ float _hoverDiff = u_hoverTime - _hoverStart;
1212
+ if (_hoverDiff < 0.0) _hoverDiff += 524288.0;
1213
+ float _hoverT = _hoverStart < 0.5
1214
+ ? 1.0
1215
+ : clamp(_hoverDiff / max(u_hoverDuration, 1.0), 0.0, 1.0);
1216
+ float _hoverEased = _hoverT < 0.5
1217
+ ? 4.0 * _hoverT * _hoverT * _hoverT
1218
+ : 1.0 - pow(-2.0 * _hoverT + 2.0, 3.0) / 2.0;
1219
+ vHoverDim = mix(1.0 - _hoverTarget, _hoverTarget, _hoverEased);
1220
+ vSide = side;
1221
+
1222
+ // Self-loops are drawn by SelfLoopCloud. Eject this vertex outside clip
1223
+ // space so the GPU never rasterizes it (CPU-side zeroing can leave a
1224
+ // black phantom in some drivers \u2014 see arrow.vert.glsl for the same pattern).
1225
+ if (sourceIndex == targetIndex) {
1226
+ gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
1227
+ return;
1228
+ }
1229
+
1230
+ vec3 srcPos = samplePosition(sourceIndex);
1231
+ vec3 tgtPos = samplePosition(targetIndex);
1232
+
1233
+ // Family (shape 5): the edge starts halfway between its source and the
1234
+ // anchor node (the other parent), and from there routes as orthogonal.
1235
+ float shape0 = controlOffset.z >= 0.0 ? controlOffset.z : defaultEdgeShape;
1236
+ bool familyAnchored = false;
1237
+ if (shape0 > 4.5 && shape0 < 5.5) {
1238
+ float anchorSlot = controlOffset.y - KV_ORTHO_EXPLICIT - 1.0;
1239
+ if (anchorSlot > -0.5) {
1240
+ srcPos = 0.5 * (srcPos + samplePosition(anchorSlot));
1241
+ familyAnchored = true;
1242
+ }
1243
+ }
1244
+
1245
+ vec3 edgeDir = tgtPos - srcPos;
1246
+ float edgeLength = length(edgeDir);
1247
+ // Threshold for the degenerate (overlapping endpoints) fallback. Was 0.001
1248
+ // \u2014 far too coarse for map mode, where world-coord positions are tiny
1249
+ // (lat/lng-derived ~0.06) and typical inter-station chords sit around
1250
+ // 1e-4..1e-3. Under the old threshold ~76% of metro edges fell back to
1251
+ // (0,1,0), causing arrows to point straight up and edge geometry to
1252
+ // mis-orient. The fallback is only needed for true self-overlap, so we
1253
+ // drop to 1e-9 (well above f32 division underflow) to keep the
1254
+ // degenerate guard without ever firing for distinct nodes.
1255
+ vec3 edgeNorm = edgeLength > 1e-9 ? edgeDir / edgeLength : vec3(0.0, 1.0, 0.0);
1256
+
1257
+ float curvature = controlOffset.x;
1258
+ float planeRotation = controlOffset.y;
1259
+
1260
+ // Node world radius per endpoint \u2014 perspective-correct with screen-pixel clamp.
1261
+ // Node shader (node.vert.glsl): pixelSize = nodeSize * 50.0 / viewDist * pixelRatio (clamped to [1.5, 4096]).
1262
+ // We replicate the formula, clamp to the same 4096 physical-pixel cap, then convert back to
1263
+ // world-space radius. The legacy 256 cap was a gl_PointSize hardware limit and no longer applies
1264
+ // to quad billboards; the previous detachment at high zoom is resolved by matching the node cap.
1265
+ float srcViewZ = abs((modelViewMatrix * vec4(srcPos, 1.0)).z);
1266
+ float tgtViewZ = abs((modelViewMatrix * vec4(tgtPos, 1.0)).z);
1267
+ float maxPS = 4096.0;
1268
+ float srcPixDiam, tgtPixDiam;
1269
+ if (mapMode > 0.5) {
1270
+ // MUST mirror node.vert.glsl's soft-asymptote curve so the edge endpoint
1271
+ // lands on the actual visible bubble boundary. Without this, edges stop
1272
+ // short of (or punch through) the bubble at deep zoom.
1273
+ // MUST stay in sync with node.vert.glsl / picking.vert.glsl.
1274
+ float refDepth = 10.0;
1275
+ float srcRef = nodeSizes.x * nodeSizeScale * (50.0 / refDepth);
1276
+ float tgtRef = nodeSizes.y * nodeSizeScale * (50.0 / refDepth);
1277
+ float srcRaw = pow(refDepth / srcViewZ, mapDamping);
1278
+ float tgtRaw = pow(refDepth / tgtViewZ, mapDamping);
1279
+ float srcGrowth = kvMapGrowth(srcRaw, mapMaxGrowth);
1280
+ float tgtGrowth = kvMapGrowth(tgtRaw, mapMaxGrowth);
1281
+ srcPixDiam = min(srcRef * srcGrowth, maxPS);
1282
+ tgtPixDiam = min(tgtRef * tgtGrowth, maxPS);
1283
+ } else {
1284
+ srcPixDiam = min(nodeSizes.x * nodeSizeScale * 50.0 / srcViewZ, maxPS);
1285
+ tgtPixDiam = min(nodeSizes.y * nodeSizeScale * 50.0 / tgtViewZ, maxPS);
1286
+ }
1287
+ // Near-camera cap on both endpoints \u2014 the same call, on the same nominal
1288
+ // diameter, as node.vert.glsl. Applied after the mode branch so it caps map
1289
+ // mode too, and before the shape-outline adjustment below so a capped square
1290
+ // still stops at its own outline.
1291
+ srcPixDiam = kvScreenCap(srcPixDiam, maxScreenFraction, resolution);
1292
+ tgtPixDiam = kvScreenCap(tgtPixDiam, maxScreenFraction, resolution);
1293
+ // Non-circle endpoints: stop at the outline along the edge direction, not at the bounding circle.
1294
+ // The arrow cone keeps the nominal (circle) radius, see arrow.vert.glsl.
1295
+ float tgtNominalDiam = tgtPixDiam;
1296
+ // Plain circles skip this block entirely, so their output is unchanged bit for bit.
1297
+ float srcShape = kvCodeShape(nodeSizes.z);
1298
+ float tgtShape = kvCodeShape(nodeSizes.w);
1299
+ float srcAspect = kvCodeAspect(nodeSizes.z);
1300
+ float tgtAspect = kvCodeAspect(nodeSizes.w);
1301
+ bool srcPlain = srcShape < 0.5 && abs(srcAspect - 1.0) < 1e-4;
1302
+ bool tgtPlain = tgtShape < 0.5 && abs(tgtAspect - 1.0) < 1e-4;
1303
+ if (!(srcPlain && tgtPlain)) {
1304
+ vec4 srcClip = projectionMatrix * (modelViewMatrix * vec4(srcPos, 1.0));
1305
+ vec4 tgtClip = projectionMatrix * (modelViewMatrix * vec4(tgtPos, 1.0));
1306
+ vec2 chordPx = (tgtClip.xy / tgtClip.w - srcClip.xy / srcClip.w) * resolution * 0.5;
1307
+ float chordLen = length(chordPx);
1308
+ vec2 chordDir = chordLen > 1e-4 ? chordPx / chordLen : vec2(1.0, 0.0);
1309
+ if (!srcPlain) srcPixDiam = 2.0 * kvShapeRadiusAlong(srcShape, srcAspect, srcPixDiam, chordDir);
1310
+ if (!tgtPlain) tgtPixDiam = 2.0 * kvShapeRadiusAlong(tgtShape, tgtAspect, tgtPixDiam, -chordDir);
1311
+ }
1312
+ // Shrink offset by 4% so edge overlaps with node ring instead of ending
1313
+ // at the transparent outer edge (ring fades at dist 0.48-0.50).
1314
+ float srcOffset = srcPixDiam * srcViewZ / (projectionMatrix[1][1] * resolution.y) * 0.96;
1315
+ float tgtOffset = tgtPixDiam * tgtViewZ / (projectionMatrix[1][1] * resolution.y) * 0.96;
1316
+ // A family edge starting between two parents starts on no node.
1317
+ if (familyAnchored) srcOffset = 0.0;
1318
+ // Clamp offsets so they don't exceed the edge length
1319
+ float totalOffset = srcOffset + tgtOffset;
1320
+ float clampFactor = totalOffset > edgeLength * 0.9 ? (edgeLength * 0.9) / totalOffset : 1.0;
1321
+ srcOffset *= clampFactor;
1322
+ tgtOffset *= clampFactor;
1323
+ float tgtConeOffset = tgtNominalDiam * tgtViewZ / (projectionMatrix[1][1] * resolution.y) * 0.96 * clampFactor;
1324
+ // Arrow cone clearance \u2014 used below to cap the rendered range of \`along\`
1325
+ // (see drawT_max). Bezier geometry is NOT shifted; only the visible
1326
+ // segment is shortened. Computed POST-clamp so the value matches the
1327
+ // post-clamp \`tgtWorldRadius\` arrow.vert.glsl uses to size the cone \u2014
1328
+ // otherwise edge and cone disagree on length when the clamp kicks in for
1329
+ // short edges. Mirrors arrow.vert.glsl: cone height (4) * arrowScale.y
1330
+ // (0.035) * regime factor (tgtWorldRadius*3 screen-constant, 0.3 world).
1331
+ float coneLen = 0.0;
1332
+ if (arrowLengthWorld > 0.5) {
1333
+ coneLen = (mapMode > 0.5 || fixedSize > 0.5)
1334
+ ? 4.0 * 0.035 * tgtConeOffset * 4.0
1335
+ : 4.0 * 0.035 * 0.3;
1336
+ }
1337
+ float shape = shape0;
1338
+ if (shape > 4.5 && shape < 5.5) shape = 3.0; // family: orthogonal from the moved start
1339
+ // Routed (shape 4) with no points draws straight.
1340
+ bool isRouted = shape > 3.5 && shape < 4.5 && controlOffset.y > 0.5;
1341
+ if (shape > 3.5 && shape < 4.5 && !isRouted) shape = 0.0;
1342
+ // Orthogonal (shape 3): routed by kv_orthoEdge.glsl below. Level endpoints
1343
+ // (no span along the routing axis) degrade to a straight edge.
1344
+ vec3 oP1, oP2, oD1, oD3;
1345
+ bool isOrtho = shape > 2.5 && shape < 3.5;
1346
+ if (isOrtho && !kvOrthoFrame(srcPos, tgtPos, controlOffset.xy, radialAxis, oP1, oP2, oD1, oD3)) {
1347
+ isOrtho = false;
1348
+ shape = 0.0;
1349
+ }
1350
+ // Radial: skip srcOffset (edges overlap at parent) and offset tgt along curve tangent
1351
+ vec3 tgtOffsetDir = edgeNorm;
1352
+ if (shape > 1.5 && shape < 2.5) {
1353
+ srcOffset = 0.0;
1354
+ // Cubic bezier tangent at t=1 is (P3-P2) direction
1355
+ bool ev; vec3 ecp2;
1356
+ if (radialAxis > 1.5) { ev = false; }
1357
+ else if (radialAxis > 0.5) { ev = true; }
1358
+ else { ev = abs(edgeDir.y) >= abs(edgeDir.x); }
1359
+ if (ev) { float my = (srcPos.y+tgtPos.y)*0.5; ecp2 = vec3(tgtPos.x,my,tgtPos.z); }
1360
+ else { float mx = (srcPos.x+tgtPos.x)*0.5; ecp2 = vec3(mx,tgtPos.y,tgtPos.z); }
1361
+ vec3 tang = tgtPos - ecp2;
1362
+ tgtOffsetDir = length(tang) > 0.0001 ? normalize(tang) : edgeNorm;
1363
+ }
1364
+ vec3 adjustedSrc = srcPos + edgeNorm * srcOffset;
1365
+ vec3 adjustedTgt = tgtPos - tgtOffsetDir * tgtOffset;
1366
+
1367
+ // Near-plane trim.
1368
+ //
1369
+ // This strip is built in SCREEN space: \`fix()\` divides by clip.w and the
1370
+ // widening offset is added in clip space. A vertex BEHIND the camera has
1371
+ // clip.w < 0, so that divide mirrors it through the origin, and the quad
1372
+ // between it and a still-visible neighbour stretches across the whole frame
1373
+ // as a flat sheet. No width cap can touch that \u2014 the width is right, the
1374
+ // POSITION is wrong \u2014 and a scene animation crosses the camera plane on
1375
+ // every pass, so it is the worst artifact of flying through a graph.
1376
+ //
1377
+ // Pull the endpoint that is behind forward along the segment until it sits
1378
+ // just in front of the camera plane. View-space z is affine along the
1379
+ // segment, so the crossing is exact. Done HERE, once per edge instance and
1380
+ // before the control point, the chord length and the polyline are derived
1381
+ // from these two points, so every vertex of the strip reaches the same
1382
+ // decision and the strip cannot tear. The same trim per vertex cannot: a
1383
+ // vertex whose two neighbours are both behind has nothing to lean on, and
1384
+ // its quad then straddles w = 0 anyway.
1385
+ //
1386
+ // A camera-crossing edge changes shape slightly (its curve is rebuilt from
1387
+ // the trimmed end). That is the right trade: the alternative is a sheet.
1388
+ // When BOTH ends are behind nothing is trimmed and nothing needs to be \u2014
1389
+ // every vertex has w < 0, and the hardware clips those triangles away.
1390
+ float zSrc = (modelViewMatrix * vec4(adjustedSrc, 1.0)).z;
1391
+ float zTgt = (modelViewMatrix * vec4(adjustedTgt, 1.0)).z;
1392
+ bool srcBehind = zSrc > -KV_NEAR_Z;
1393
+ bool tgtBehind = zTgt > -KV_NEAR_Z;
1394
+ if (srcBehind != tgtBehind) {
1395
+ // The ends straddle the plane, so zTgt - zSrc cannot be zero.
1396
+ float tNear = (-KV_NEAR_Z - zSrc) / (zTgt - zSrc);
1397
+ if (srcBehind) adjustedSrc = mix(adjustedSrc, adjustedTgt, tNear);
1398
+ else adjustedTgt = mix(adjustedSrc, adjustedTgt, tNear);
1399
+ }
1400
+ float effectiveCurvature = curvature;
1401
+ if (shape > 0.5 && shape < 1.5 && abs(curvature) < 0.001) { effectiveCurvature = 0.15; }
1402
+ vec3 adjustedDir = adjustedTgt - adjustedSrc;
1403
+
1404
+ // Globe mode: regular edges (shape < 1.5, excluding radial S-curves) ride
1405
+ // the great-circle arc via slerp instead of a chord-proportional bezier
1406
+ // bulge. Multi-edge fan separation is layered on as a perpendicular offset
1407
+ // scaled by sin(omega/2), so short Paris-internal edges collapse to near-
1408
+ // straight while cross-continent edges spread visibly. Per the design spec
1409
+ // (2026-05-25-globe-edge-greatcircle-design.md \xA76) this branch ignores the
1410
+ // legacy \`effectiveCurvature\` / \`isGlobeStraight\` synthesis.
1411
+ // Only ride the great-circle arc when BOTH endpoints are actually pinned on
1412
+ // the sphere surface (geo nodes: |pos| ~= sphereRadius). Non-geo (force-
1413
+ // layout) nodes sit at arbitrary radii near the origin; projecting their
1414
+ // edges onto the sphere (slerp(normalize(pos)) * sphereRadius) makes the
1415
+ // edge radiate off the node toward the silhouette. Those fall through to the
1416
+ // chord/curve branch so the edge connects the two real node positions.
1417
+ // Geo nodes land exactly on the radius; force clusters sit well inside it,
1418
+ // so a 10% band cleanly separates the two. MUST match arrow.vert.glsl.
1419
+ float srcSphereDist = length(srcPos);
1420
+ float tgtSphereDist = length(tgtPos);
1421
+ float sphereBand = sphereRadius * 0.1;
1422
+ bool bothOnSphere = abs(srcSphereDist - sphereRadius) < sphereBand
1423
+ && abs(tgtSphereDist - sphereRadius) < sphereBand;
1424
+ // Short arcs (city-scale edges on a globe) are visually straight, and the
1425
+ // great-circle endpoint pullback degenerates for them: when a node's radius
1426
+ // is a large fraction of the tiny arc, the arc-fraction saturates (clamped)
1427
+ // and the edge/arrow stops well inside the node \u2014 visible as edges punching
1428
+ // through the bubble at deep map zoom (e.g. adjacent Tube stations). Only ride
1429
+ // the great-circle arc for arcs long enough to visibly curve (~1.1\xB0); shorter
1430
+ // ones fall through to the straight/curve branch, whose chord pullback reaches
1431
+ // the node surface correctly (no 0.49 clamp). MUST match arrow.vert.glsl.
1432
+ float arcOmega = acos(clamp(dot(normalize(srcPos), normalize(tgtPos)), -1.0, 1.0));
1433
+ bool isSphereEdge = sphereRadius > 0.001 && shape < 1.5 && bothOnSphere && arcOmega > 0.02;
1434
+
1435
+ // Globe straight edges: DISABLED. The old behavior synthesized a 0.15*len
1436
+ // bulge for every straight edge in globe mode \u2014 but non-geo edges (now that
1437
+ // isSphereEdge is gated to geo-on-sphere endpoints) must look exactly like
1438
+ // 2D straight edges: dead straight unless the user actually enabled curve.
1439
+ // Keeping this true added an unwanted arc to non-geo edges even with curve
1440
+ // off. Geo edges ride isSphereEdge; curved edges ride shape/curvature below.
1441
+ bool isGlobeStraight = false;
1442
+ bool isCurveBranch = !isSphereEdge && !isOrtho && !isRouted && (shape > 0.5 || abs(effectiveCurvature) > 0.001);
1443
+
1444
+ // Sphere-edge precomputed quantities (only meaningful when isSphereEdge).
1445
+ // Kept at outer scope so prev/next sampling can reuse without recomputing.
1446
+ vec3 dirSrcS, dirTgtS, planeNormalS, arcMidDirS, perpMidS;
1447
+ float omegaS = 0.0;
1448
+ if (isSphereEdge) {
1449
+ // The node-radius gap (srcOffset/tgtOffset, a world-space radius) must be
1450
+ // applied as an ARC-LENGTH pullback along the great circle, NOT as a chord
1451
+ // subtraction. \`normalize(tgtPos - edgeNorm * tgtOffset)\` (the old form)
1452
+ // retreats the endpoint along the straight chord; for long edges the chord
1453
+ // dives through the globe interior, so re-normalizing barely changes the
1454
+ // angular position and the rendered arc \u2014 and the arrowhead mirroring it \u2014
1455
+ // collapse onto the node center instead of stopping one node-radius back
1456
+ // along the visible arc. Stepping each endpoint direction along the arc by
1457
+ // offset / sphereRadius radians keeps the gap a true on-surface distance,
1458
+ // so the edge/arrow meet the node boundary at every edge length and zoom.
1459
+ // MUST stay in sync with arrow.vert.glsl's isSphereArrow branch.
1460
+ vec3 dSrcRaw = normalize(srcPos);
1461
+ vec3 dTgtRaw = normalize(tgtPos);
1462
+ float omegaFull = acos(clamp(dot(dSrcRaw, dTgtRaw), -1.0, 1.0));
1463
+ // Pull each endpoint back along the arc by its node-radius worth of arc
1464
+ // length. Capping each fraction independently at 0.49 (the old form)
1465
+ // under-pulls the LARGER endpoint on short arcs \u2014 the pullback ends up far
1466
+ // less than the node radius, so the edge end lands INSIDE the node (visible
1467
+ // as edges punching through the bubble at deep map zoom). Instead cap the
1468
+ // COMBINED pullback at 0.98 of the arc and split it proportionally, so each
1469
+ // endpoint keeps as much of its full node-radius pullback as the arc allows
1470
+ // and the bigger node still wins its share. MUST stay in sync with
1471
+ // arrow.vert.glsl.
1472
+ //
1473
+ // Screen-foreshorten compensation: the node is a screen-facing billboard
1474
+ // (constant screen radius) but this pullback is a world arc-length along the
1475
+ // surface tangent. When that tangent dives toward the camera the pullback
1476
+ // projects to far fewer pixels than the node radius and the edge enters the
1477
+ // node disc (verified numerically: penetrating edges had foreshorten<0.6).
1478
+ // Scale each endpoint's pullback up by 1/foreshorten (clamped to 3.3x) so the
1479
+ // ON-SCREEN gap clears the node's screen radius; foreshorten==1 (tangent in
1480
+ // screen plane) leaves normal edges unchanged. MUST stay in sync with
1481
+ // arrow.vert.glsl.
1482
+ vec3 tanSrc = normalize(dTgtRaw - dot(dTgtRaw, dSrcRaw) * dSrcRaw);
1483
+ vec3 tanTgt = normalize(dSrcRaw - dot(dSrcRaw, dTgtRaw) * dTgtRaw);
1484
+ vec3 vDirSrc = normalize((modelViewMatrix * vec4(srcPos, 1.0)).xyz);
1485
+ vec3 vDirTgt = normalize((modelViewMatrix * vec4(tgtPos, 1.0)).xyz);
1486
+ vec3 tanSrcV = normalize((modelViewMatrix * vec4(tanSrc, 0.0)).xyz);
1487
+ vec3 tanTgtV = normalize((modelViewMatrix * vec4(tanTgt, 0.0)).xyz);
1488
+ float foreSrc = max(sqrt(max(0.0, 1.0 - pow(dot(tanSrcV, vDirSrc), 2.0))), 0.3);
1489
+ float foreTgt = max(sqrt(max(0.0, 1.0 - pow(dot(tanTgtV, vDirTgt), 2.0))), 0.3);
1490
+ float srcOffsetAdj = srcOffset / foreSrc;
1491
+ float tgtOffsetAdj = tgtOffset / foreTgt;
1492
+ float srcFracRaw = omegaFull > 1e-6 ? (srcOffsetAdj / sphereRadius) / omegaFull : 0.0;
1493
+ float tgtFracRaw = omegaFull > 1e-6 ? (tgtOffsetAdj / sphereRadius) / omegaFull : 0.0;
1494
+ float fracSum = srcFracRaw + tgtFracRaw;
1495
+ float fracK = fracSum > 0.98 ? 0.98 / fracSum : 1.0;
1496
+ float srcFrac = srcFracRaw * fracK;
1497
+ float tgtFrac = tgtFracRaw * fracK;
1498
+ dirSrcS = slerp(dSrcRaw, dTgtRaw, srcFrac);
1499
+ dirTgtS = slerp(dTgtRaw, dSrcRaw, tgtFrac);
1500
+ float cosO = clamp(dot(dirSrcS, dirTgtS), -1.0, 1.0);
1501
+ omegaS = acos(cosO);
1502
+ float sinO = sin(omegaS);
1503
+ // Plane normal of the great circle; degenerate (near-coincident
1504
+ // endpoints) falls back to world +Y to avoid NaN perp downstream.
1505
+ planeNormalS = sinO < 1e-5 ? vec3(0.0, 1.0, 0.0) : normalize(cross(dirSrcS, dirTgtS));
1506
+ }
1507
+
1508
+ // Compute controlPoint once (shared by drawT_max + position + prev/next).
1509
+ // For straight edges controlPoint is unused; reference distance falls back
1510
+ // to chord length.
1511
+ vec3 controlPoint;
1512
+ if (isCurveBranch) {
1513
+ vec3 midPoint = (adjustedSrc + adjustedTgt) * 0.5;
1514
+ // Bulge direction (issue: edge arc top up after 3D pitch).
1515
+ //
1516
+ // Goal: in map mode the arc crest must always face the viewport's top,
1517
+ // regardless of edge direction or scene pitch. The most robust reference
1518
+ // for "up in viewport" inside a vertex shader is the camera's local +Y
1519
+ // expressed in model space \u2014 derived as the first row of the upper-3x3
1520
+ // of \`modelViewMatrix\`, which is equivalent to \`transpose(mat3(mvm)) *
1521
+ // (0,1,0)\`. For pitched planar maps this resolves to a direction that
1522
+ // rotates back to world +Y after the scene's X rotation; for pitched
1523
+ // (camera-orbit) spherical maps it resolves to whatever world direction
1524
+ // the orbiting camera now treats as "up." Either way, after the full
1525
+ // model\u2192view transform the perpendicular ends up aligned with viewport +Y.
1526
+ //
1527
+ // Replaces both (a) the great-circle approximation used previously for
1528
+ // globeStraight edges (which produced direction-dependent bulges that
1529
+ // flipped above/below the horizon under pitch) and (b) the surface-normal
1530
+ // approach used in the prior fix (which only solved the planar case).
1531
+ //
1532
+ // Outside map mode the legacy lateral \`cross(edgeNorm, +Z)\` is kept so
1533
+ // non-map graphs retain their existing look.
1534
+ vec3 perp;
1535
+ if (mapMode > 0.5) {
1536
+ vec3 camUpInModel = vec3(
1537
+ modelViewMatrix[0][1],
1538
+ modelViewMatrix[1][1],
1539
+ modelViewMatrix[2][1]
1540
+ );
1541
+ vec3 proj = camUpInModel - dot(camUpInModel, edgeNorm) * edgeNorm;
1542
+ float l = length(proj);
1543
+ perp = l > 0.001 ? proj / l : computePerpendicular(edgeNorm);
1544
+ } else {
1545
+ perp = computePerpendicular(edgeNorm);
1546
+ }
1547
+ if (abs(planeRotation) > 0.001) {
1548
+ perp = rotateAroundAxis(perp, edgeNorm, planeRotation);
1549
+ }
1550
+ // Bulge magnitude: for explicitly curved edges use effectiveCurvature *
1551
+ // edgeLength (legacy). For globeStraight (sphere mode, curvature=0,
1552
+ // shape<0.5) synthesize a magnitude proportional to chord length so the
1553
+ // arc has visible height \u2014 tuned to roughly match the previous
1554
+ // great-circle crest height for typical inter-city edges.
1555
+ float bulgeMag = isGlobeStraight
1556
+ ? edgeLength * 0.15
1557
+ : effectiveCurvature * edgeLength;
1558
+ controlPoint = midPoint + perp * bulgeMag;
1559
+ }
1560
+
1561
+ // Cap the rendered range of \`along\` so the visible edge stops at the cone
1562
+ // base while the bezier geometry stays anchored at adjustedTgt (cone apex
1563
+ // position). For a quadratic bezier the tangent at t=1 is 2*(P2 - P1), so
1564
+ // near t=1 the curve advances ~ 2*|P2 - P1| world units per unit of t. That
1565
+ // makes 2*|P2 - P1| the right reference length to convert coneLen into a
1566
+ // parametric back-off \u2014 using chord length over-retracts on curves because
1567
+ // the curve's tangent at the endpoint is longer than the chord direction.
1568
+ // For straight edges controlPoint is the chord midpoint, so 2*|P2 - P1|
1569
+ // collapses back to chord length and the formula stays exact.
1570
+ float adjustedChordLen = length(adjustedDir);
1571
+ // Reference length used to convert world-space \`coneLen\` into a parametric
1572
+ // back-off (drawT_max). For straight edges it's the chord; for bezier
1573
+ // curves it's 2*|P2-P1| (tangent speed at t=1); for slerp arcs it's the
1574
+ // arc length omega*R (slerp has constant speed = omega*R per unit t).
1575
+ float refLen = isSphereEdge
1576
+ ? omegaS * sphereRadius
1577
+ : (isCurveBranch ? 2.0 * length(adjustedTgt - controlPoint) : adjustedChordLen);
1578
+ float drawT_max = refLen > 0.001
1579
+ ? clamp(1.0 - coneLen / refLen, 0.001, 1.0)
1580
+ : 1.0;
1581
+ float effAlong = along * drawT_max;
1582
+
1583
+ // Routed: one strip vertex per bend point; the ends leave the source towards
1584
+ // the first bend and enter the target from the last, pulled back off the discs.
1585
+ float rFirst = controlOffset.x, rCount = controlOffset.y;
1586
+ vec3 rA = srcPos, rB = tgtPos;
1587
+ float rI = 0.0;
1588
+ if (isRouted) {
1589
+ float f0, fN;
1590
+ vec3 firstBend = kvRoutedPoint(routeTexture, routeTextureSize, rFirst, rCount, 1.0, srcPos, tgtPos, srcPos, tgtPos, f0);
1591
+ vec3 lastBend = kvRoutedPoint(routeTexture, routeTextureSize, rFirst, rCount, rCount, srcPos, tgtPos, srcPos, tgtPos, fN);
1592
+ vec3 out0 = firstBend - srcPos, in1 = tgtPos - lastBend;
1593
+ rA = srcPos + (length(out0) > 1e-9 ? normalize(out0) : edgeNorm) * srcOffset;
1594
+ rB = tgtPos - (length(in1) > 1e-9 ? normalize(in1) : edgeNorm) * (tgtOffset + coneLen);
1595
+ rI = min(floor(along * edgeSegments + 0.5), rCount + 1.0);
1596
+ }
1597
+
1598
+ vec3 edgePosition;
1599
+ // Orthogonal: the whole strip comes from kvOrthoPoint. Ends leave / enter the
1600
+ // nodes along the routing axis; the arrow cone is cleared off leg3.
1601
+ vec3 oA = srcPos + oD1 * srcOffset;
1602
+ vec3 oB = tgtPos - oD1 * (tgtOffset + coneLen);
1603
+ float oS = 0.0, oL = 1.0;
1604
+ float oK = along * edgeSegments;
1605
+ if (isRouted) {
1606
+ float rf;
1607
+ edgePosition = kvRoutedPoint(routeTexture, routeTextureSize, rFirst, rCount, rI, srcPos, tgtPos, rA, rB, rf);
1608
+ vCounters = rf;
1609
+ } else if (isOrtho) {
1610
+ edgePosition = kvOrthoPoint(oK, edgeSegments, oA, oP1, oP2, oB, oD1, orthoCornerRadius, oS, oL);
1611
+ // Dash / flow / reveal run on arc length so they do not bunch up in corners.
1612
+ vCounters = oL > 1e-6 ? oS / oL : along;
1613
+ } else if (isSphereEdge) {
1614
+ // Great-circle arc on the sphere surface, plus a perpendicular fan
1615
+ // offset for multi-edges. Fan magnitude \`controlOffset.x * sin(omega/2)
1616
+ // * sphereRadius\` is the design's \u03B8-scaled separation rule \u2014 see
1617
+ // sphereMath.fanOffsetMag for the CPU mirror.
1618
+ vec3 arcDir = slerp(dirSrcS, dirTgtS, effAlong);
1619
+ vec3 arcPos = arcDir * sphereRadius;
1620
+ vec3 perpOnSphere = normalize(cross(arcDir, planeNormalS));
1621
+ float offsetMag = controlOffset.x * sin(omegaS * 0.5) * sphereRadius;
1622
+ edgePosition = arcPos + perpOnSphere * offsetMag;
1623
+ } else if (shape > 1.5 && shape < 2.5) {
1624
+ edgePosition = radialInterpolate(adjustedSrc, adjustedTgt, adjustedDir, effAlong, radialAxis);
1625
+ } else if (isCurveBranch) {
1626
+ // Straighten last 15% of curve into a straight line toward target.
1627
+ // This ensures the edge connects cleanly to the arrow at the node boundary.
1628
+ float blendStart = 0.85;
1629
+ vec3 bAtBlend = bezier(adjustedSrc, controlPoint, adjustedTgt, blendStart);
1630
+ if (effAlong > blendStart) {
1631
+ edgePosition = mix(bAtBlend, adjustedTgt, (effAlong - blendStart) / (1.0 - blendStart));
1632
+ } else {
1633
+ edgePosition = bezier(adjustedSrc, controlPoint, adjustedTgt, effAlong);
1634
+ }
1635
+ } else {
1636
+ edgePosition = mix(adjustedSrc, adjustedTgt, effAlong);
1637
+ }
1638
+
1639
+ mat4 mvp = projectionMatrix * modelViewMatrix;
1640
+ vec4 currentClip = mvp * vec4(edgePosition, 1.0);
1641
+
1642
+ // Prev/next sample neighbors on the rendered (capped) curve so the line
1643
+ // direction at the visible endpoint reflects the cone-aligned tangent.
1644
+ float prevEff = max(0.0, effAlong - 0.01);
1645
+ float nextEff = min(drawT_max, effAlong + 0.01);
1646
+
1647
+ vec3 prevPos, nextPos;
1648
+ if (isRouted) {
1649
+ float rf;
1650
+ prevPos = kvRoutedPoint(routeTexture, routeTextureSize, rFirst, rCount, max(rI - 1.0, 0.0), srcPos, tgtPos, rA, rB, rf);
1651
+ nextPos = kvRoutedPoint(routeTexture, routeTextureSize, rFirst, rCount, min(rI + 1.0, rCount + 1.0), srcPos, tgtPos, rA, rB, rf);
1652
+ } else if (isOrtho) {
1653
+ float dS, dL;
1654
+ prevPos = kvOrthoPoint(max(oK - 0.2, 0.0), edgeSegments, oA, oP1, oP2, oB, oD1, orthoCornerRadius, dS, dL);
1655
+ nextPos = kvOrthoPoint(min(oK + 0.2, edgeSegments), edgeSegments, oA, oP1, oP2, oB, oD1, orthoCornerRadius, dS, dL);
1656
+ } else if (isSphereEdge) {
1657
+ vec3 prevArcDir = slerp(dirSrcS, dirTgtS, prevEff);
1658
+ vec3 nextArcDir = slerp(dirSrcS, dirTgtS, nextEff);
1659
+ vec3 prevArcPos = prevArcDir * sphereRadius;
1660
+ vec3 nextArcPos = nextArcDir * sphereRadius;
1661
+ vec3 prevPerp = normalize(cross(prevArcDir, planeNormalS));
1662
+ vec3 nextPerp = normalize(cross(nextArcDir, planeNormalS));
1663
+ float prevOff = controlOffset.x * sin(omegaS * 0.5) * sphereRadius;
1664
+ float nextOff = controlOffset.x * sin(omegaS * 0.5) * sphereRadius;
1665
+ prevPos = prevArcPos + prevPerp * prevOff;
1666
+ nextPos = nextArcPos + nextPerp * nextOff;
1667
+ } else if (shape > 1.5 && shape < 2.5) {
1668
+ prevPos = radialInterpolate(adjustedSrc, adjustedTgt, adjustedDir, prevEff, radialAxis);
1669
+ nextPos = radialInterpolate(adjustedSrc, adjustedTgt, adjustedDir, nextEff, radialAxis);
1670
+ } else if (isCurveBranch) {
1671
+ float blendStart = 0.85;
1672
+ vec3 bAtBlend = bezier(adjustedSrc, controlPoint, adjustedTgt, blendStart);
1673
+ prevPos = prevEff > blendStart
1674
+ ? mix(bAtBlend, adjustedTgt, (prevEff - blendStart) / (1.0 - blendStart))
1675
+ : bezier(adjustedSrc, controlPoint, adjustedTgt, prevEff);
1676
+ nextPos = nextEff > blendStart
1677
+ ? mix(bAtBlend, adjustedTgt, (nextEff - blendStart) / (1.0 - blendStart))
1678
+ : bezier(adjustedSrc, controlPoint, adjustedTgt, nextEff);
1679
+ } else {
1680
+ prevPos = mix(adjustedSrc, adjustedTgt, prevEff);
1681
+ nextPos = mix(adjustedSrc, adjustedTgt, nextEff);
1682
+ }
1683
+
1684
+ vec4 prevClip = mvp * vec4(prevPos, 1.0);
1685
+ vec4 nextClip = mvp * vec4(nextPos, 1.0);
1686
+
1687
+ vec2 currentP = fix(currentClip, aspect);
1688
+ vec2 prevP = fix(prevClip, aspect);
1689
+ vec2 nextP = fix(nextClip, aspect);
1690
+
1691
+ float baseWidth = edgeWidth * lineWidthScale;
1692
+ if (edgeSelected > 0.5) baseWidth += 2.0 * lineWidthScale;
1693
+
1694
+ float pixelWidth = currentClip.w;
1695
+ float w;
1696
+
1697
+ // Two width regimes (mirrored in arrow.vert.glsl):
1698
+ // - World-scaled (legacy parity, default): w is clip-space constant, so
1699
+ // screen size = w/clip.w shrinks with distance \u2014 edges visibly grow on
1700
+ // zoom-in / shrink on zoom-out like legacy.
1701
+ // - Screen-constant: multiply by clip.w so it cancels in the perspective
1702
+ // divide. Used when nodes are at fixed screen size (fixedSize), and in
1703
+ // mapMode where camera-z range is huge (city-street \u2194 continent) and a
1704
+ // world-scaled line would either vanish or blow up.
1705
+ //
1706
+ // edgeScale = base screen-pixel thickness for the screen-constant regime
1707
+ // (fixedSize bumps it to 0.15 to match larger fixedSize nodes).
1708
+ // worldScale = 0.16 matches legacy clip-space width: legacy used 0.008
1709
+ // directly, new engine multiplies through lineWidthScale (default 0.05),
1710
+ // so 0.008 / 0.05 = 0.16 gives a default edge the same legacy look.
1711
+ float edgeScale = 1.0 / 15.0;
1712
+ float worldScale = 0.16;
1713
+ if (mapMode > 0.5 || fixedSize > 0.5) {
1714
+ float k = fixedSize > 0.5 ? 0.15 : edgeScale;
1715
+ w = 1.8 * pixelWidth * baseWidth * k;
1716
+ } else {
1717
+ w = 1.8 * baseWidth * worldScale;
1718
+ }
1719
+
1720
+ // Fine-line anti-aliasing (the deck.gl / Mapbox technique). Do NOT fatten a
1721
+ // thin line to stop it shimmering \u2014 instead draw it at a minimum geometric
1722
+ // width so the strip always covers \u2265~1px (MSAA-safe, no sub-pixel drop-out),
1723
+ // then carry the *desired* width as a coverage fraction so the fragment shader
1724
+ // fades the strip's alpha to match. A 0.3px arc is drawn ~1px wide at 0.3
1725
+ // coverage, reading as a delicate hairline \u2014 neither shimmering (sub-pixel)
1726
+ // nor fat (a hard min-width clamp). The on-screen half-width of the current
1727
+ // \`w\` is \`0.25 * w * resolution.y / pixelWidth\` (clip\u2192NDC divide then NDC\u2192px).
1728
+ float desiredHalfPx = 0.25 * w * resolution.y / max(pixelWidth, 1e-6);
1729
+ // Near-camera cap on the strip itself. The world-scaled regime keeps \`w\`
1730
+ // constant in clip space, so the on-screen width goes as 1/clip.w \u2014 an edge
1731
+ // the scene flies past had no upper bound at all and swept a band across the
1732
+ // frame. Cap the FULL width (hence \xD72 in, \xD70.5 out); everything downstream
1733
+ // still uses the real \`pixelWidth\`, so the clip\u2192pixel round-trip below stays
1734
+ // exact.
1735
+ //
1736
+ // An edge gets a SMALLER share of the budget than a node, because it spends
1737
+ // it differently: a capped bubble is a disc of the cap, a capped strip is a
1738
+ // band of the cap running the whole length of the frame. At EDGE_WIDTH_SHARE
1739
+ // an edge at its limit is about an eighth of a bubble at its limit, which is
1740
+ // roughly the proportion the two have at ordinary distances \u2014 so the cap
1741
+ // reads as "the line got thick", not as "a wall crossed the screen". The
1742
+ // first version of this gave both the same share, and the A/B screenshots
1743
+ // showed the bubble tamed and the band still taking a third of the frame.
1744
+ desiredHalfPx = kvScreenCap(
1745
+ desiredHalfPx * 2.0, maxScreenFraction * EDGE_WIDTH_SHARE, resolution) * 0.5;
1746
+ float MIN_HALF_PX = 0.5;
1747
+ float drawHalfPx = max(desiredHalfPx, MIN_HALF_PX);
1748
+ vCoreEdge = clamp(desiredHalfPx / drawHalfPx, 0.0, 1.0); // 1 for thick, <1 fades sub-pixel
1749
+ w = drawHalfPx * 4.0 * pixelWidth / resolution.y; // round-trips to the original w when not thinning
1750
+
1751
+ vec2 dir;
1752
+ if (nextP == currentP) dir = normalize(currentP - prevP);
1753
+ else if (prevP == currentP) dir = normalize(nextP - currentP);
1754
+ else dir = normalize(normalize(currentP - prevP) + normalize(nextP - currentP));
1755
+
1756
+ vec2 normal = vec2(-dir.y, dir.x);
1757
+ normal.x /= aspect;
1758
+ // Tube glow: widen the strip so the soft halo has room outside the solid core.
1759
+ // The visible solid core stays at the original width (the fragment uses coreFrac).
1760
+ w *= 1.0 + vTubeGlow * GLOW_WIDEN_K;
1761
+ normal *= 0.5 * w;
1762
+
1763
+ vec4 finalPosition = currentClip;
1764
+ finalPosition.xy += normal * side;
1765
+
1766
+ // Globe mode: per-vertex back-face culling (same approach as nodes).
1767
+ // depthTest is disabled in globe mode, so we hide back-facing edges here.
1768
+ // Each vertex along the edge is checked individually using its actual
1769
+ // position on the great-circle arc \u2014 not just the midpoint.
1770
+ // This correctly hides the portion of an edge that crosses the globe horizon.
1771
+ if (sphereRadius > 0.001) {
1772
+ vec3 wN = normalize(mat3(modelMatrix) * normalize(edgePosition));
1773
+ vec3 wP = (modelMatrix * vec4(edgePosition, 1.0)).xyz;
1774
+ if (dot(wN, normalize(cameraPosition - wP)) < 0.0) {
1775
+ vOpacity = 0.0;
1776
+ }
1777
+ }
1778
+
1779
+ gl_Position = finalPosition;
1780
+ }
1781
+ `;var Ga=`// Mirrors node.vert.glsl billboard math. Intentionally omits breathe / ripple
1782
+ // (animation) \u2014 picking should be stable, not pulse with visual effects. But
1783
+ // MUST mirror the min/max pixelSize clamp from node.vert.glsl (\`minPixelSize\`
1784
+ // floor, default 1.5 px, never under 1.5 px here; 4096 px ceil): the visual quad
1785
+ // is floored so far-camera nodes stay visible, and the picker hitbox MUST match \u2014 otherwise distant nodes become
1786
+ // sub-pixel in the picking buffer and clicks miss them entirely (only a few
1787
+ // near-camera nodes register). Keep the size + projection block in sync with
1788
+ // node.vert.glsl when changing per-node sizing semantics.
1789
+ precision highp float;
1790
+
1791
+ uniform sampler2D positionTexture;
1792
+ uniform float textureSize;
1793
+ uniform float spaceSize;
1794
+ uniform float fixedSize;
1795
+ uniform float nodeSizeScale;
1796
+ uniform float mapMode;
1797
+ uniform float mapDamping;
1798
+ uniform float mapMaxGrowth; // shared semantics with node.vert.glsl
1799
+ uniform float maxScreenFraction; // MUST match node.vert.glsl, or the hitbox outgrows the quad
1800
+ uniform float pixelRatio;
1801
+ uniform float minPixelSize; // node.vert.glsl's floor; the hitbox never goes under 1.5 px
1802
+ uniform float sphereRadius;
1803
+ uniform vec2 resolution;
1804
+ attribute float nodeIndex;
1805
+ attribute vec3 idColor;
1806
+ attribute float nodeSize;
1807
+ attribute float nodeFlags;
1808
+ #ifndef KV_POINT_PRIMITIVE
1809
+ attribute vec2 corner;
1810
+ #else
1811
+ uniform float maxPointSize; // ALIASED_POINT_SIZE_RANGE max, device px; as node.vert.glsl
1812
+ #endif
1813
+ attribute float nodeSuppressFill; // suppress + 2 * shapeId; must match node.vert.glsl
1814
+ attribute vec4 nodeEffects; // w = aspect
1815
+
1816
+ varying vec3 vIdColor;
1817
+ varying float vHidden;
1818
+ #ifndef KV_POINT_PRIMITIVE
1819
+ varying vec2 vUv;
1820
+ #endif
1821
+ varying float vShape;
1822
+
1823
+ vec3 samplePosition(float idx) {
1824
+ float texX = mod(idx, textureSize) + 0.5;
1825
+ float texY = floor(idx / textureSize) + 0.5;
1826
+ vec2 texCoord = vec2(texX, texY) / textureSize;
1827
+ return texture2D(positionTexture, texCoord).xyz;
1828
+ }
1829
+
1830
+ void main() {
1831
+ vIdColor = idColor;
1832
+ // Unpack nodeFlags
1833
+ float nodeSelected = mod(nodeFlags, 2.0);
1834
+ float nodeHighlighted = mod(floor(nodeFlags / 2.0), 2.0);
1835
+ vHidden = mod(floor(nodeFlags / 8.0), 2.0);
1836
+
1837
+ vec3 sampledPos = samplePosition(nodeIndex);
1838
+ vec3 finalPosition = sampledPos;
1839
+
1840
+ vec4 mvCenter = modelViewMatrix * vec4(finalPosition, 1.0);
1841
+
1842
+ // Must match nodeVertexShader exactly (same formula) so picking hitbox aligns with visual.
1843
+ // The 1.1 factor is picking-only \u2014 adds slack to the hitbox so edge clicks still register.
1844
+ float scaledSize = nodeSize * nodeSizeScale;
1845
+ float viewDepth = max(-mvCenter.z, 0.001);
1846
+ float baseSize;
1847
+ if (mapMode > 0.5) {
1848
+ float refDepth = 10.0;
1849
+ float refSize = scaledSize * (50.0 / refDepth);
1850
+ // MUST mirror the soft-asymptote curve in node.vert.glsl exactly \u2014 same
1851
+ // softKnee derivation, same mapMaxGrowth \u2014 so the hitbox tracks the visible
1852
+ // bubble at every zoom level (no click-far-from-node bug).
1853
+ float raw = pow(refDepth / viewDepth, mapDamping);
1854
+ float growth = kvMapGrowth(raw, mapMaxGrowth);
1855
+ baseSize = refSize * growth;
1856
+ } else {
1857
+ baseSize = scaledSize * (50.0 / viewDepth);
1858
+ }
1859
+ float sizeMultiplier = (nodeSelected > 0.5 || nodeHighlighted > 0.5) ? 1.5 : 1.0;
1860
+ // Match node.vert.glsl: pixelSize is in CSS pixels, NOT physical pixels.
1861
+ // node.vert.glsl does NOT multiply by pixelRatio (see its comments).
1862
+ // The render target is at physical-pixel resolution, but offsetClip divides
1863
+ // by CSS-px resolution, and the viewport transform multiplies by pixelRatio \u2014
1864
+ // so pixelRatio cancels naturally. Adding it here would make the hitbox
1865
+ // pixelRatio\xD7 too large (2.2\xD7 on Retina instead of 1.1\xD7).
1866
+ float pixelSize = baseSize * sizeMultiplier * 1.1;
1867
+ // Mirror node.vert.glsl's near-camera cap, at the same point: on the finished
1868
+ // quad. Without it a node the camera passes close renders capped but stays
1869
+ // clickable across the whole screen, and every click in the frame hits it.
1870
+ // The 1.1 slack is inside the cap on both sides of the comparison, so the
1871
+ // hitbox keeps its relationship to the visible quad at the limit too.
1872
+ pixelSize = kvScreenCap(pixelSize, maxScreenFraction, resolution);
1873
+ // Mirror node.vert.glsl's clamp(1.5, 4096). The 1.5 floor is critical:
1874
+ // node.vert.glsl applies it so far-camera nodes stay at least 1.5 px on
1875
+ // screen (visible). Without the same floor here, the picker hitbox shrinks
1876
+ // sub-pixel for distant nodes and they vanish from the picking buffer \u2014
1877
+ // result: only near-camera nodes are clickable. The 4096 ceil prevents
1878
+ // near-camera zoom-in from growing hitbox past the visible quad.
1879
+ // A host floor above 1.5 (\`minPixelSize\`) raises the hitbox with the quad;
1880
+ // one below it does not shrink the hitbox, so dots stay clickable.
1881
+ pixelSize = clamp(pixelSize, max(minPixelSize, 1.5), 4096.0);
1882
+
1883
+ vec4 clipCenter = projectionMatrix * mvCenter;
1884
+ vShape = floor(nodeSuppressFill * 0.5);
1885
+ #ifdef KV_POINT_PRIMITIVE
1886
+ // Point primitive: one vertex per node, as node.vert.glsl. gl_PointSize is in
1887
+ // device px and capped by the GPU at the same size the visible sprite is.
1888
+ gl_PointSize = min(pixelSize * pixelRatio, maxPointSize);
1889
+ gl_Position = clipCenter;
1890
+ #else
1891
+ float shapeAspect = nodeEffects.w > 0.0 ? nodeEffects.w : 1.0;
1892
+ vec2 offsetClip = vec2(corner.x, corner.y / shapeAspect) * pixelSize / resolution * 2.0 * clipCenter.w;
1893
+ gl_Position = clipCenter + vec4(offsetClip, 0.0, 0.0);
1894
+ // Y-down to match node.vert.glsl (gl_PointCoord convention). See node.vert.glsl for rationale.
1895
+ vUv = vec2(corner.x + 0.5, 0.5 - corner.y);
1896
+ #endif
1897
+
1898
+ // Globe mode: vertex-level back-face culling (must match nodeVertexShader).
1899
+ if (sphereRadius > 0.001) {
1900
+ vec3 wN = normalize(mat3(modelMatrix) * normalize(finalPosition));
1901
+ vec3 wP = (modelMatrix * vec4(finalPosition, 1.0)).xyz;
1902
+ if (dot(wN, normalize(cameraPosition - wP)) < 0.0) {
1903
+ // Push the quad off-screen (NDC outside [-1,1]) so all 4 corners are clipped.
1904
+ gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
1905
+ }
1906
+ }
1907
+ }
1908
+ `;var Ba=`precision highp float;
1909
+
1910
+ varying vec3 vIdColor;
1911
+ varying float vHidden;
1912
+ #ifndef KV_POINT_PRIMITIVE
1913
+ varying vec2 vUv;
1914
+ #endif
1915
+ varying float vShape;
1916
+
1917
+ uniform float useCircle;
1918
+
1919
+ void main() {
1920
+ if (vHidden > 0.5) discard;
1921
+
1922
+ if (useCircle > 0.5) {
1923
+ #ifdef KV_POINT_PRIMITIVE
1924
+ vec2 c = gl_PointCoord - vec2(0.5);
1925
+ #else
1926
+ vec2 c = vUv - vec2(0.5);
1927
+ #endif
1928
+ // Same outline the node fragment shader draws: the hitbox IS the visible shape.
1929
+ float r = vShape > 0.5 ? 0.5 + kvShapeSdf(vShape, vec2(c.x, -c.y)) : length(c);
1930
+ if (r > 0.5) discard;
1931
+ }
1932
+
1933
+ gl_FragColor = vec4(vIdColor, 1.0);
1934
+ }
1935
+ `;var Ha=`precision highp float;
1936
+
1937
+ uniform sampler2D positionTexture;
1938
+ uniform float textureSize;
1939
+ uniform float spaceSize;
1940
+ uniform float useCurve;
1941
+ uniform vec2 resolution;
1942
+ uniform float fixedSize;
1943
+ uniform float nodeSizeScale;
1944
+ uniform float mapMode;
1945
+ uniform float mapDamping;
1946
+ uniform float mapMaxGrowth; // shared semantics with node.vert.glsl; -1.0 = Infinity sentinel
1947
+ uniform float maxScreenFraction; // shared semantics with node.vert.glsl; -1.0 = unbounded
1948
+ uniform float sphereRadius;
1949
+
1950
+ // Per-instance attributes
1951
+ attribute float sourceIndex;
1952
+ attribute float targetIndex;
1953
+ attribute vec3 arrowColor;
1954
+ attribute float arrowOpacity;
1955
+ attribute vec3 arrowScale;
1956
+ attribute float arrowRotation;
1957
+ attribute vec2 targetSize; // x size, y shape code
1958
+ attribute vec2 sourceSize;
1959
+ attribute vec3 controlOffset;
1960
+ attribute float edgeSelected;
1961
+ // Hover-neighbor-highlight: packed \`target + start_ts * 2\`. Low bit = the
1962
+ // target dim state (0/1); upper 23 bits = ms-since-epoch (mod 2^19) when
1963
+ // the target last flipped. Start = 0 is a sentinel: never animated \u2192 no
1964
+ // fade, render at target.
1965
+ attribute float aHoverDim;
1966
+
1967
+ uniform float u_hoverTime;
1968
+ uniform float u_hoverDuration;
1969
+
1970
+ uniform float defaultEdgeShape;
1971
+ uniform float radialAxis;
1972
+ uniform sampler2D routeTexture; // routed edges' bend points (see kv_routedEdge.glsl)
1973
+ uniform float routeTextureSize;
1974
+
1975
+ varying vec3 vColor;
1976
+ varying float vOpacity;
1977
+ varying float vSelected;
1978
+ varying float vHoverDim;
1979
+
1980
+ vec3 samplePosition(float idx) {
1981
+ float texX = mod(idx, textureSize) + 0.5;
1982
+ float texY = floor(idx / textureSize) + 0.5;
1983
+ vec2 texCoord = vec2(texX, texY) / textureSize;
1984
+ return texture2D(positionTexture, texCoord).xyz;
1985
+ }
1986
+
1987
+ // Apply quaternion rotation to position (matches CPU quaternion() helper)
1988
+ vec3 applyQuaternion(vec3 pos, vec4 q) {
1989
+ return pos + 2.0 * cross(q.xyz, cross(q.xyz, pos) + q.w * pos);
1990
+ }
1991
+
1992
+ // Build rotation matrix around axis - matches lineCloud.js rotationMatrix()
1993
+ mat4 rotationMatrix(vec3 axis, float angle) {
1994
+ axis = normalize(axis);
1995
+ float s = sin(angle);
1996
+ float c = cos(angle);
1997
+ float oc = 1.0 - c;
1998
+ return mat4(
1999
+ oc*axis.x*axis.x+c, oc*axis.x*axis.y-axis.z*s, oc*axis.z*axis.x+axis.y*s, 0.0,
2000
+ oc*axis.x*axis.y+axis.z*s, oc*axis.y*axis.y+c, oc*axis.y*axis.z-axis.x*s, 0.0,
2001
+ oc*axis.z*axis.x-axis.y*s, oc*axis.y*axis.z+axis.x*s, oc*axis.z*axis.z+c, 0.0,
2002
+ 0.0, 0.0, 0.0, 1.0);
2003
+ }
2004
+
2005
+ // Compute direction quaternion - matches lineCloud.js getDirection()
2006
+ vec4 getDirectionQuaternion(vec3 dir) {
2007
+ vec4 q;
2008
+ if (dir.y > 0.99999) {
2009
+ q = vec4(0.0, 0.0, 0.0, 1.0);
2010
+ } else if (dir.y < -0.99999) {
2011
+ q = vec4(1.0, 0.0, 0.0, 0.0);
2012
+ } else {
2013
+ vec3 axis = normalize(vec3(dir.z, 0.0, -dir.x));
2014
+ float angle = acos(dir.y);
2015
+ float s = sin(angle * 0.5);
2016
+ float c = cos(angle * 0.5);
2017
+ q = vec4(axis * s, c);
2018
+ }
2019
+ return q;
2020
+ }
2021
+
2022
+ // Compute perpendicular vector to a direction (matches edge shader)
2023
+ vec3 computePerpendicular(vec3 dir) {
2024
+ vec3 ref = abs(dir.z) < 0.99 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
2025
+ return normalize(cross(dir, ref));
2026
+ }
2027
+
2028
+ // Rotate vector around axis by angle (matches edge shader)
2029
+ vec3 rotateAroundAxis(vec3 v, vec3 axis, float angle) {
2030
+ float c = cos(angle);
2031
+ float s = sin(angle);
2032
+ return v * c + cross(axis, v) * s + axis * dot(axis, v) * (1.0 - c);
2033
+ }
2034
+
2035
+ // Quadratic bezier evaluation
2036
+ vec3 bezier(vec3 p0, vec3 p1, vec3 p2, float t) {
2037
+ float t1 = 1.0 - t;
2038
+ return t1 * t1 * p0 + 2.0 * t1 * t * p1 + t * t * p2;
2039
+ }
2040
+
2041
+ // Quadratic bezier tangent (derivative): B'(t) = 2(1-t)(P1-P0) + 2t(P2-P1)
2042
+ vec3 bezierTangent(vec3 p0, vec3 p1, vec3 p2, float t) {
2043
+ return 2.0 * (1.0 - t) * (p1 - p0) + 2.0 * t * (p2 - p1);
2044
+ }
2045
+
2046
+ // Great-circle slerp + tangent-at-endpoint helpers. MUST stay in sync with
2047
+ // edge.vert.glsl \`slerp\` so the arrow tip sits exactly on the arc geometry
2048
+ // the edge shader rendered. See sphereMath.ts for the CPU mirror used by
2049
+ // EdgeTextCloud and the acceptance probes.
2050
+ vec3 slerp(vec3 a, vec3 b, float t) {
2051
+ float cosOmega = clamp(dot(a, b), -1.0, 1.0);
2052
+ float omega = acos(cosOmega);
2053
+ float sinOmega = sin(omega);
2054
+ if (sinOmega < 1e-5) return normalize(mix(a, b, t));
2055
+ return (sin((1.0 - t) * omega) * a + sin(t * omega) * b) / sinOmega;
2056
+ }
2057
+
2058
+ // Unit tangent at the slerp endpoint (t = 1). Used to orient the arrowhead
2059
+ // along the arc rather than along the chord \u2014 without this, arrowheads for
2060
+ // long-arc edges (e.g. Paris\u2192Tokyo) point in the wrong direction at the
2061
+ // target node.
2062
+ vec3 arcTangentAtEnd(vec3 a, vec3 b) {
2063
+ float cosOmega = clamp(dot(a, b), -1.0, 1.0);
2064
+ float omega = acos(cosOmega);
2065
+ float sinOmega = sin(omega);
2066
+ if (sinOmega < 1e-5) return normalize(b - a);
2067
+ return normalize((cosOmega * b - a) * (omega / sinOmega));
2068
+ }
2069
+
2070
+ void main() {
2071
+ vColor = arrowColor;
2072
+ vOpacity = arrowOpacity;
2073
+ vSelected = edgeSelected;
2074
+ // Unpack hoverDim: low bit = target, upper bits = start timestamp.
2075
+ float _hoverTarget = mod(aHoverDim, 2.0);
2076
+ float _hoverStart = floor(aHoverDim / 2.0);
2077
+ float _hoverDiff = u_hoverTime - _hoverStart;
2078
+ if (_hoverDiff < 0.0) _hoverDiff += 524288.0;
2079
+ float _hoverT = _hoverStart < 0.5
2080
+ ? 1.0
2081
+ : clamp(_hoverDiff / max(u_hoverDuration, 1.0), 0.0, 1.0);
2082
+ float _hoverEased = _hoverT < 0.5
2083
+ ? 4.0 * _hoverT * _hoverT * _hoverT
2084
+ : 1.0 - pow(-2.0 * _hoverT + 2.0, 3.0) / 2.0;
2085
+ vHoverDim = mix(1.0 - _hoverTarget, _hoverTarget, _hoverEased);
2086
+
2087
+ // Self-loops are drawn by SelfLoopCloud, not here. The CPU side zeros all
2088
+ // attributes (arrowScale, arrowOpacity, etc.) hoping the cone collapses to a
2089
+ // point, but that left a visible black phantom in some drivers (degenerate
2090
+ // triangles aren't reliably culled, or pos*scale=0 hits FP edge cases).
2091
+ // Ejecting the vertex outside clip space is the only deterministic discard.
2092
+ if (sourceIndex == targetIndex) {
2093
+ gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
2094
+ return;
2095
+ }
2096
+
2097
+ vec3 srcPos = samplePosition(sourceIndex);
2098
+ vec3 tgtPos = samplePosition(targetIndex);
2099
+
2100
+ // Family (shape 5): starts halfway between source and anchor. MUST match edge.vert.glsl.
2101
+ float shape0 = controlOffset.z >= 0.0 ? controlOffset.z : defaultEdgeShape;
2102
+ if (shape0 > 4.5 && shape0 < 5.5) {
2103
+ float anchorSlot = controlOffset.y - KV_ORTHO_EXPLICIT - 1.0;
2104
+ if (anchorSlot > -0.5) srcPos = 0.5 * (srcPos + samplePosition(anchorSlot));
2105
+ }
2106
+
2107
+ vec3 edgeDir = tgtPos - srcPos;
2108
+ float edgeLength = length(edgeDir);
2109
+ // Degenerate-fallback threshold MUST match edge.vert.glsl. Old 0.001 was
2110
+ // too coarse for map mode (positions ~0.06, typical chords ~1e-4..1e-3)
2111
+ // and caused arrows to flip to (0,1,0) \u2014 visible as "arrows pointing
2112
+ // straight up" in dense metro clusters. 1e-9 keeps the guard against
2113
+ // true zero-length self-overlap without false positives.
2114
+ vec3 edgeNorm = edgeLength > 1e-9 ? edgeDir / edgeLength : vec3(0.0, 1.0, 0.0);
2115
+
2116
+ // Node world radius \u2014 MUST mirror node.vert.glsl pixelSize formula so the
2117
+ // arrow tip lands exactly on the visible bubble edge. In map mode this means
2118
+ // using the SAME soft-asymptote growth curve driven by the \`mapMaxGrowth\`
2119
+ // uniform; otherwise the arrow shader thinks the bubble is bigger than it
2120
+ // actually renders, and the arrow floats away from the bubble edge at deep
2121
+ // zoom. MUST stay in sync with node.vert.glsl / picking.vert.glsl.
2122
+ float srcViewZ = abs((modelViewMatrix * vec4(srcPos, 1.0)).z);
2123
+ float tgtViewZ = abs((modelViewMatrix * vec4(tgtPos, 1.0)).z);
2124
+ float maxPS = 4096.0;
2125
+ float srcPixDiam, tgtPixDiam;
2126
+ float srcScaled = sourceSize.x * nodeSizeScale;
2127
+ float tgtScaled = targetSize.x * nodeSizeScale;
2128
+ if (mapMode > 0.5) {
2129
+ float refDepth = 10.0;
2130
+ float srcRaw = pow(refDepth / srcViewZ, mapDamping);
2131
+ float tgtRaw = pow(refDepth / tgtViewZ, mapDamping);
2132
+ float srcGrowth = kvMapGrowth(srcRaw, mapMaxGrowth);
2133
+ float tgtGrowth = kvMapGrowth(tgtRaw, mapMaxGrowth);
2134
+ srcPixDiam = min((srcScaled * 50.0 / refDepth) * srcGrowth, maxPS);
2135
+ tgtPixDiam = min((tgtScaled * 50.0 / refDepth) * tgtGrowth, maxPS);
2136
+ } else {
2137
+ srcPixDiam = min(srcScaled * 50.0 / srcViewZ, maxPS);
2138
+ tgtPixDiam = min(tgtScaled * 50.0 / tgtViewZ, maxPS);
2139
+ }
2140
+ // Near-camera cap \u2014 same call on the same nominal diameter as
2141
+ // node.vert.glsl, so the cone keeps landing on the capped bubble edge.
2142
+ // \`tgtNominalDiam\` below is taken from the capped value on purpose: the cone
2143
+ // must not outgrow the node it points at.
2144
+ srcPixDiam = kvScreenCap(srcPixDiam, maxScreenFraction, resolution);
2145
+ tgtPixDiam = kvScreenCap(tgtPixDiam, maxScreenFraction, resolution);
2146
+ // The cone is sized by the node's nominal (circle) radius, not by how far the outline is along
2147
+ // this edge: a triangle's narrow side must not shrink its arrowhead.
2148
+ float tgtNominalDiam = tgtPixDiam;
2149
+ // Non-circle endpoints (must mirror edge.vert.glsl): stop at the outline along the chord.
2150
+ float srcShape = kvCodeShape(sourceSize.y);
2151
+ float tgtShape = kvCodeShape(targetSize.y);
2152
+ float srcAspect = kvCodeAspect(sourceSize.y);
2153
+ float tgtAspect = kvCodeAspect(targetSize.y);
2154
+ bool srcPlain = srcShape < 0.5 && abs(srcAspect - 1.0) < 1e-4;
2155
+ bool tgtPlain = tgtShape < 0.5 && abs(tgtAspect - 1.0) < 1e-4;
2156
+ if (!(srcPlain && tgtPlain)) {
2157
+ vec4 srcClip = projectionMatrix * (modelViewMatrix * vec4(srcPos, 1.0));
2158
+ vec4 tgtClip = projectionMatrix * (modelViewMatrix * vec4(tgtPos, 1.0));
2159
+ vec2 chordPx = (tgtClip.xy / tgtClip.w - srcClip.xy / srcClip.w) * resolution * 0.5;
2160
+ float chordLen = length(chordPx);
2161
+ vec2 chordDir = chordLen > 1e-4 ? chordPx / chordLen : vec2(1.0, 0.0);
2162
+ if (!srcPlain) srcPixDiam = 2.0 * kvShapeRadiusAlong(srcShape, srcAspect, srcPixDiam, chordDir);
2163
+ if (!tgtPlain) tgtPixDiam = 2.0 * kvShapeRadiusAlong(tgtShape, tgtAspect, tgtPixDiam, -chordDir);
2164
+ }
2165
+ // 0.96 factor matches edge.vert.glsl so both shaders build the same bezier
2166
+ // (cone apex at adjustedTgt = edge bezier endpoint). The edge shader caps
2167
+ // its rendered range so the visible line stops at the cone base; the
2168
+ // bezier itself still runs all the way to adjustedTgt, keeping the curve's
2169
+ // end-tangent identical to the arrow direction we derive here.
2170
+ float srcWorldRadius = srcPixDiam * srcViewZ / (projectionMatrix[1][1] * resolution.y) * 0.96;
2171
+ float tgtWorldRadius = tgtPixDiam * tgtViewZ / (projectionMatrix[1][1] * resolution.y) * 0.96;
2172
+ // Clamp offsets so they don't exceed 90% of edge length (must match edge shader).
2173
+ float totalOff = srcWorldRadius + tgtWorldRadius;
2174
+ float clampFac = totalOff > edgeLength * 0.9 ? (edgeLength * 0.9) / totalOff : 1.0;
2175
+ srcWorldRadius *= clampFac;
2176
+ tgtWorldRadius *= clampFac;
2177
+ float tgtConeRadius = tgtNominalDiam * tgtViewZ / (projectionMatrix[1][1] * resolution.y) * 0.96 * clampFac;
2178
+ float arrowLength = 4.0 * arrowScale.y; // Cone height * Y scale
2179
+
2180
+ float curvature = controlOffset.x;
2181
+ float planeRotation = controlOffset.y;
2182
+
2183
+ vec3 dir;
2184
+ vec3 arrowPos;
2185
+
2186
+ float shape = shape0;
2187
+ if (shape > 4.5 && shape < 5.5) shape = 3.0; // family routes as orthogonal
2188
+ bool isRouted = shape > 3.5 && shape < 4.5 && controlOffset.y > 0.5;
2189
+ if (shape > 3.5 && shape < 4.5 && !isRouted) shape = 0.0;
2190
+
2191
+ // Globe-mode regular edges (shape < 1.5) ride a true great-circle arc;
2192
+ // arrowhead orientation = arc tangent at the target end. MUST stay in sync
2193
+ // with edge.vert.glsl's \`isSphereEdge\` branch.
2194
+ // MUST match edge.vert.glsl isSphereEdge gating: only geo endpoints (on the
2195
+ // sphere, |pos| ~= sphereRadius) ride the great-circle arrow. Non-geo (force)
2196
+ // arrows fall through to the curve branch so the arrowhead sits on the actual
2197
+ // rendered edge instead of radiating onto the sphere.
2198
+ float srcSphereDist = length(srcPos);
2199
+ float tgtSphereDist = length(tgtPos);
2200
+ float sphereBand = sphereRadius * 0.1;
2201
+ bool bothOnSphere = abs(srcSphereDist - sphereRadius) < sphereBand
2202
+ && abs(tgtSphereDist - sphereRadius) < sphereBand;
2203
+ // Short arcs (city-scale edges on a globe) are visually straight, and the
2204
+ // great-circle endpoint pullback degenerates for them: when a node's radius
2205
+ // is a large fraction of the tiny arc, the arc-fraction saturates (clamped)
2206
+ // and the arrow stops well inside the node \u2014 visible as arrows floating mid-
2207
+ // edge at deep map zoom (e.g. adjacent Tube stations). Only ride the great-
2208
+ // circle arc for arcs long enough to visibly curve (~1.1\xB0); shorter ones fall
2209
+ // through to the straight/curve branch, whose chord pullback reaches the node
2210
+ // surface correctly (no 0.49 clamp). MUST match edge.vert.glsl.
2211
+ float arcOmega = acos(clamp(dot(normalize(srcPos), normalize(tgtPos)), -1.0, 1.0));
2212
+ bool isSphereArrow = sphereRadius > 0.001 && shape < 1.5 && bothOnSphere && arcOmega > 0.02;
2213
+
2214
+ vec3 oP1, oP2, oD1, oD3;
2215
+ bool isOrtho = shape > 2.5 && shape < 3.5
2216
+ && kvOrthoFrame(srcPos, tgtPos, controlOffset.xy, radialAxis, oP1, oP2, oD1, oD3);
2217
+ if (shape > 2.5 && shape < 3.5 && !isOrtho) shape = 0.0; // level ends: straight, as edge.vert
2218
+
2219
+ if (isRouted) {
2220
+ // --- Routed: the last leg, from the last bend into the target ---
2221
+ float rf;
2222
+ vec3 lastBend = kvRoutedPoint(routeTexture, routeTextureSize, controlOffset.x, controlOffset.y,
2223
+ controlOffset.y, srcPos, tgtPos, srcPos, tgtPos, rf);
2224
+ vec3 inLeg = tgtPos - lastBend;
2225
+ dir = length(inLeg) > 1e-9 ? normalize(inLeg) : edgeNorm;
2226
+ arrowPos = tgtPos - dir * tgtWorldRadius;
2227
+ } else if (isOrtho) {
2228
+ // --- Orthogonal: leg3 runs along the routing axis into the target ---
2229
+ dir = oD1;
2230
+ arrowPos = tgtPos - dir * tgtWorldRadius;
2231
+ } else if (shape > 1.5 && shape < 2.5) {
2232
+ // --- Radial S-curve: arrow direction = cubic bezier tangent at t=1 ---
2233
+ // Tangent at t=1 of cubic bezier = 3*(P3-P2), where P2=(tgt.x, midY)
2234
+ vec3 eDir = tgtPos - srcPos;
2235
+ bool useVert;
2236
+ if (radialAxis > 1.5) { useVert = false; }
2237
+ else if (radialAxis > 0.5) { useVert = true; }
2238
+ else { useVert = abs(eDir.y) >= abs(eDir.x); }
2239
+
2240
+ vec3 cp2;
2241
+ if (useVert) {
2242
+ float midY = (srcPos.y + tgtPos.y) * 0.5;
2243
+ cp2 = vec3(tgtPos.x, midY, tgtPos.z);
2244
+ } else {
2245
+ float midX = (srcPos.x + tgtPos.x) * 0.5;
2246
+ cp2 = vec3(midX, tgtPos.y, tgtPos.z);
2247
+ }
2248
+ vec3 tangent = tgtPos - cp2;
2249
+ dir = length(tangent) > 0.0001 ? normalize(tangent) : edgeNorm;
2250
+ arrowPos = tgtPos - dir * tgtWorldRadius;
2251
+ } else if (isSphereArrow) {
2252
+ // --- Globe great-circle arrow ---
2253
+ // Mirror edge.vert.glsl: arc end position = dirTgt * R + perp * fanOff.
2254
+ // Tangent at the arc endpoint (used to orient the cone) = arcTangentAtEnd.
2255
+ //
2256
+ // The node-radius gap (srcWorldRadius/tgtWorldRadius) is an ARC-LENGTH
2257
+ // pullback along the great circle, NOT a chord subtraction. The old form
2258
+ // \`normalize(tgtPos - edgeNorm * tgtWorldRadius)\` retreats along the
2259
+ // straight chord; for long edges the chord cuts through the globe, so
2260
+ // re-normalizing barely moves the angular position and the arrowhead
2261
+ // collapses onto the node center (visible as the arrow not reaching the
2262
+ // node at deep zoom). Step the endpoint directions along the arc by
2263
+ // worldRadius / sphereRadius radians so the tip lands exactly one
2264
+ // node-radius back along the visible arc. MUST match edge.vert.glsl.
2265
+ vec3 dSrcRaw = normalize(srcPos);
2266
+ vec3 dTgtRaw = normalize(tgtPos);
2267
+ float omegaFull = acos(clamp(dot(dSrcRaw, dTgtRaw), -1.0, 1.0));
2268
+ // Pull each endpoint back along the arc by its node-radius worth of arc
2269
+ // length. Capping each fraction independently at 0.49 (the old form)
2270
+ // under-pulls the LARGER endpoint on short arcs \u2014 the pullback ends up far
2271
+ // less than the node radius, so the arrow/edge tip lands INSIDE the node
2272
+ // (visible as edges/arrows punching through the bubble at deep map zoom).
2273
+ // Instead cap the COMBINED pullback at 0.98 of the arc and split it
2274
+ // proportionally, so each endpoint keeps as much of its full node-radius
2275
+ // pullback as the arc allows and the bigger node still wins its share.
2276
+ // MUST stay in sync with edge.vert.glsl.
2277
+ //
2278
+ // Screen-foreshorten compensation (MUST stay in sync with edge.vert.glsl):
2279
+ // the node is a screen-facing billboard but the pullback is a world arc-length
2280
+ // along the surface tangent; when that tangent dives toward the camera it
2281
+ // projects to too few pixels and the arrow enters the node. Scale each
2282
+ // endpoint's pullback up by 1/foreshorten (clamped) so the arrow tip clears
2283
+ // the node's screen radius.
2284
+ vec3 tanSrc = normalize(dTgtRaw - dot(dTgtRaw, dSrcRaw) * dSrcRaw);
2285
+ vec3 tanTgt = normalize(dSrcRaw - dot(dSrcRaw, dTgtRaw) * dTgtRaw);
2286
+ vec3 vDirSrc = normalize((modelViewMatrix * vec4(srcPos, 1.0)).xyz);
2287
+ vec3 vDirTgt = normalize((modelViewMatrix * vec4(tgtPos, 1.0)).xyz);
2288
+ vec3 tanSrcV = normalize((modelViewMatrix * vec4(tanSrc, 0.0)).xyz);
2289
+ vec3 tanTgtV = normalize((modelViewMatrix * vec4(tanTgt, 0.0)).xyz);
2290
+ float foreSrc = max(sqrt(max(0.0, 1.0 - pow(dot(tanSrcV, vDirSrc), 2.0))), 0.3);
2291
+ float foreTgt = max(sqrt(max(0.0, 1.0 - pow(dot(tanTgtV, vDirTgt), 2.0))), 0.3);
2292
+ float srcRadiusAdj = srcWorldRadius / foreSrc;
2293
+ float tgtRadiusAdj = tgtWorldRadius / foreTgt;
2294
+ float srcFracRaw = omegaFull > 1e-6 ? (srcRadiusAdj / sphereRadius) / omegaFull : 0.0;
2295
+ float tgtFracRaw = omegaFull > 1e-6 ? (tgtRadiusAdj / sphereRadius) / omegaFull : 0.0;
2296
+ float fracSum = srcFracRaw + tgtFracRaw;
2297
+ float fracK = fracSum > 0.98 ? 0.98 / fracSum : 1.0;
2298
+ float srcFrac = srcFracRaw * fracK;
2299
+ float tgtFrac = tgtFracRaw * fracK;
2300
+ vec3 dirSrcS = slerp(dSrcRaw, dTgtRaw, srcFrac);
2301
+ vec3 dirTgtS = slerp(dTgtRaw, dSrcRaw, tgtFrac);
2302
+ float cosO = clamp(dot(dirSrcS, dirTgtS), -1.0, 1.0);
2303
+ float omegaS = acos(cosO);
2304
+ float sinO = sin(omegaS);
2305
+ vec3 planeNormalS = sinO < 1e-5
2306
+ ? vec3(0.0, 1.0, 0.0)
2307
+ : normalize(cross(dirSrcS, dirTgtS));
2308
+ vec3 perpAtTgt = normalize(cross(dirTgtS, planeNormalS));
2309
+ float fanOff = curvature * sin(omegaS * 0.5) * sphereRadius;
2310
+ dir = arcTangentAtEnd(dirSrcS, dirTgtS);
2311
+ arrowPos = dirTgtS * sphereRadius + perpAtTgt * fanOff;
2312
+ } else if (shape > 0.5 || abs(curvature) > 0.001) {
2313
+ // --- Curve arrow: unified bezier arrow alignment ---
2314
+ // Control point math MUST mirror edge.vert.glsl exactly so the arrow's
2315
+ // tangent direction lands on the actual rendered curve. Any divergence
2316
+ // here makes the arrow head point along a different bezier and visibly
2317
+ // floats off the curve at the node boundary.
2318
+ // Globe-straight synthesis removed (mirror edge.vert.glsl isGlobeStraight=false):
2319
+ // non-geo straight arrows fall through to the plain straight branch below.
2320
+ bool isGlobe = false;
2321
+ float effCurvature = curvature;
2322
+ if (shape > 0.5 && shape < 1.5 && abs(curvature) < 0.001) { effCurvature = 0.15; }
2323
+ vec3 edgeSrc = srcPos + edgeNorm * srcWorldRadius;
2324
+ vec3 edgeTgt = tgtPos - edgeNorm * tgtWorldRadius;
2325
+ vec3 midPoint = (edgeSrc + edgeTgt) * 0.5;
2326
+
2327
+ // Bulge direction (matches edge.vert.glsl): in map mode use the camera's
2328
+ // up-in-model derived from modelViewMatrix so the bezier always bulges
2329
+ // toward viewport up; outside map mode fall back to the legacy lateral
2330
+ // cross-product perpendicular.
2331
+ vec3 perp;
2332
+ if (mapMode > 0.5) {
2333
+ vec3 camUpInModel = vec3(
2334
+ modelViewMatrix[0][1],
2335
+ modelViewMatrix[1][1],
2336
+ modelViewMatrix[2][1]
2337
+ );
2338
+ vec3 proj = camUpInModel - dot(camUpInModel, edgeNorm) * edgeNorm;
2339
+ float l = length(proj);
2340
+ perp = l > 0.001 ? proj / l : computePerpendicular(edgeNorm);
2341
+ } else {
2342
+ perp = computePerpendicular(edgeNorm);
2343
+ }
2344
+ if (abs(planeRotation) > 0.001) {
2345
+ perp = rotateAroundAxis(perp, edgeNorm, planeRotation);
2346
+ }
2347
+
2348
+ // Bulge magnitude: same regime as edge.vert.glsl \u2014 synthesized for
2349
+ // globeStraight, effCurvature \xD7 edgeLength otherwise.
2350
+ float bulgeMag = isGlobe
2351
+ ? edgeLength * 0.15
2352
+ : effCurvature * edgeLength;
2353
+ vec3 controlPoint = midPoint + perp * bulgeMag;
2354
+
2355
+ // Arrow direction from bezier tangent near endpoint (matches edge straightening)
2356
+ vec3 bAt85 = bezier(edgeSrc, controlPoint, edgeTgt, 0.85);
2357
+ dir = normalize(edgeTgt - bAt85);
2358
+ arrowPos = edgeTgt;
2359
+ } else {
2360
+ // --- Straight edge mode ---
2361
+ dir = edgeNorm;
2362
+ arrowPos = tgtPos - dir * tgtWorldRadius;
2363
+ }
2364
+
2365
+ // Compute direction quaternion from arrow direction
2366
+ vec4 qDirection = getDirectionQuaternion(dir);
2367
+
2368
+ // Transform vertex:
2369
+ // 1. Scale
2370
+ // 2. Apply direction quaternion
2371
+ // 3. Translate to arrow position
2372
+ vec3 pos = position;
2373
+ vec3 scale = arrowScale;
2374
+ if (edgeSelected > 0.5) { scale.x *= 3.0; scale.z *= 3.0; }
2375
+ // Two arrow sizing regimes (must match edge.vert.glsl width regimes):
2376
+ // - World-scaled (legacy parity, default): arrowScale buffer values are
2377
+ // interpreted as world-space scale of the cone geometry; perspective
2378
+ // does the rest, so arrows shrink/grow with zoom like edges.
2379
+ // - Screen-constant: multiply by tgtWorldRadius so the arrow size tracks
2380
+ // the node's projected on-screen radius \u2014 necessary in mapMode where
2381
+ // camera-z range is too large for world units to look right, and in
2382
+ // fixedSize mode where nodes are already screen-constant.
2383
+ //
2384
+ // X/Z (base width) and Y (length) take DIFFERENT multipliers because the
2385
+ // base arrowScale buffer (0.012, 0.035, 0.012) bakes in a ~2.92\xD7 ratio of
2386
+ // height-multiplier to radius-multiplier; with three.js cone geometry
2387
+ // (height=4 along Y, base radius=1 at scale 1) a uniform per-axis \xD7 3.0
2388
+ // would render an 11.7:1 height-to-base-radius needle \u2014 visually a line
2389
+ // extension rather than a recognizable arrow. Non-map mode fixes that by
2390
+ // \`scale.y *= 0.3\` AFTER the 1:1 buffer scale, landing on a 3.5:1 cone.
2391
+ // Mirror that proportion here by giving the width axes a larger multiplier
2392
+ // so the rendered aspect (X:Y of final scale \xD7 geometry aspect) lands
2393
+ // around 3:1.
2394
+ if (mapMode > 0.5 || fixedSize > 0.5) {
2395
+ scale.x *= tgtConeRadius * 18.0;
2396
+ scale.y *= tgtConeRadius * 4.0;
2397
+ scale.z *= tgtConeRadius * 18.0;
2398
+ // Cap the cone's base radius to a sane arrowhead aspect. The base width is
2399
+ // edge-width-driven (arrowScale.x = w\xB71.5) AND node-radius-driven
2400
+ // (\xD7 tgtWorldRadius), so a wide edge into a big node compounds into a fat
2401
+ // chevron far wider than its own length (which is edge-width-INdependent).
2402
+ // Clamp base \u2264 ~0.55\xD7 cone height (= 4\xB7scale.y) so the arrow keeps a
2403
+ // recognizable shape; default-width edges sit below the cap and are
2404
+ // unchanged. Width still grows with edge thickness up to the cap.
2405
+ float maxHalfWidth = scale.y * 2.2;
2406
+ scale.x = min(scale.x, maxHalfWidth);
2407
+ scale.z = min(scale.z, maxHalfWidth);
2408
+ } else {
2409
+ // arrowScale.y default (0.035) was tuned for the screen-constant path
2410
+ // where it gets multiplied by tgtWorldRadius * 3. In the world-scaled
2411
+ // path that multiplier is gone, so the cone would render ~3.5x longer
2412
+ // than legacy. Bring length back to legacy proportions (~3x cone radius).
2413
+ scale.y *= 0.3;
2414
+ // Floor against node radius: world-scaled cone is constant in world units
2415
+ // (lineWidth-driven), so on hubs sized by sizeByDegree / per-node setSize
2416
+ // the arrow:radius ratio collapses and the cone gets swallowed by the
2417
+ // node's soft edge. Mirror the screen-constant ratio (X/Z = radius * 0.216,
2418
+ // Y = radius * 0.14) as a lower bound \u2014 small nodes pass through
2419
+ // unchanged because their radius-derived size is below the lineWidth
2420
+ // baseline; only big nodes get bumped up to a visible cone.
2421
+ float growX = tgtConeRadius * 0.216;
2422
+ float growY = tgtConeRadius * 0.140;
2423
+ scale.x = max(scale.x, growX);
2424
+ scale.y = max(scale.y, growY);
2425
+ scale.z = max(scale.z, growX);
2426
+ }
2427
+ pos *= scale;
2428
+ pos = applyQuaternion(pos, qDirection);
2429
+ pos += arrowPos;
2430
+
2431
+ vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0);
2432
+ gl_Position = projectionMatrix * mvPosition;
2433
+
2434
+ // Globe mode: vertex-level back-face culling.
2435
+ // depthTest is disabled in globe mode, so we hide back-facing arrows here.
2436
+ if (sphereRadius > 0.001) {
2437
+ vec3 wN = normalize(mat3(modelMatrix) * normalize(arrowPos));
2438
+ vec3 wP = (modelMatrix * vec4(arrowPos, 1.0)).xyz;
2439
+ if (dot(wN, normalize(cameraPosition - wP)) < 0.0) {
2440
+ vOpacity = 0.0;
2441
+ }
2442
+ }
2443
+ }
2444
+ `;var Ua=`attribute vec3 aCenter;
2445
+ attribute float aRadius;
2446
+ attribute vec3 aColor;
2447
+ attribute float aFillOpacity;
2448
+ attribute float aFalloff;
2449
+ attribute vec3 aRingColor;
2450
+ attribute float aRingWidth;
2451
+ attribute float aRingOpacity; // boundary-ring opacity, independent of fillOpacity
2452
+ attribute vec3 aPulse; // x=flag, y=speed, z=rings
2453
+ attribute float aDim; // anchor node render opacity (focus / click-dim); 1 = full
2454
+ attribute float aSelected; // 1 when the anchor node is selected
2455
+ attribute vec3 aSector; // x=azimuth(deg CW from N), y=beamWidth(deg; 360=full disc), z=innerRadius(fraction). One attribute (not 3) to stay under MAX_VERTEX_ATTRIBS.
2456
+ uniform float uSphereRadius; // > 0 in globe mode: lay discs flat in the surface tangent plane
2457
+ varying vec2 vLocal; // [-1,1]; length 1 at the circle edge
2458
+ varying vec3 vColor; varying float vFill; varying float vFalloff;
2459
+ varying vec3 vRingColor; varying float vRingWidth; varying vec3 vPulse;
2460
+ varying float vRingOpacity;
2461
+ varying float vDim;
2462
+ varying float vSelected;
2463
+ varying vec3 vSector; // x=azimuth, y=beamWidth, z=innerRadius
2464
+ void main() {
2465
+ vLocal = position.xy * 2.0; // position.xy in [-0.5,0.5]
2466
+ vColor = aColor; vFill = aFillOpacity; vFalloff = aFalloff;
2467
+ vRingColor = aRingColor; vRingWidth = aRingWidth; vPulse = aPulse;
2468
+ vRingOpacity = aRingOpacity;
2469
+ vDim = aDim;
2470
+ vSelected = aSelected;
2471
+ vSector = aSector;
2472
+ vec2 offset = position.xy * 2.0 * aRadius; // disc-local offset, world units
2473
+ vec3 world;
2474
+ if (uSphereRadius > 0.0 && length(aCenter) > 1e-4) {
2475
+ // Globe mode: build the disc in the sphere's surface TANGENT plane at the
2476
+ // anchor so the ring stays parallel to the ground. The globe is centred at
2477
+ // the model origin, so normalize(aCenter) is the outward surface normal.
2478
+ // Without this the disc sits in the fixed cloudScene XY plane and looks
2479
+ // tilted/deformed everywhere except the front-facing point of the globe.
2480
+ vec3 N = normalize(aCenter);
2481
+ // Tangent basis: east = poleAxis \xD7 N, north = N \xD7 east. The pole axis is +Y
2482
+ // (datumsToVector maps latitude \u2192 Y). Guard the pole singularity (N \u2225 Y) by
2483
+ // switching the reference axis to +X there.
2484
+ vec3 ref = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
2485
+ vec3 east = normalize(cross(ref, N));
2486
+ vec3 north = cross(N, east);
2487
+ world = aCenter + east * offset.x + north * offset.y;
2488
+ } else {
2489
+ world = aCenter + vec3(offset, 0.0); // flat disc in cloudScene XY (planar map / no map)
2490
+ }
2491
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(world, 1.0);
2492
+ }
2493
+ `;var Va=`precision highp float;
2494
+ uniform float uTime;
2495
+ varying vec2 vLocal;
2496
+ varying vec3 vColor; varying float vFill; varying float vFalloff;
2497
+ varying vec3 vRingColor; varying float vRingWidth; varying vec3 vPulse;
2498
+ varying float vRingOpacity;
2499
+ varying float vDim;
2500
+ varying float vSelected; // 1 when the anchor node is selected
2501
+ varying vec3 vSector; // x=azimuth(deg CW from N), y=beamWidth(deg; 360=full disc), z=innerRadius(fraction)
2502
+ void main() {
2503
+ float d = length(vLocal);
2504
+ if (d > 1.0) discard;
2505
+ // Sector mask: keep only fragments inside the wedge. beamWidth>=360 \u2192 full disc.
2506
+ if (vSector.y < 359.999) {
2507
+ float ang = degrees(atan(vLocal.x, vLocal.y)); // bearing CW from north, (-180,180]
2508
+ float delta = mod(ang - vSector.x + 540.0, 360.0) - 180.0; // signed wrap
2509
+ if (abs(delta) > vSector.y * 0.5) discard;
2510
+ }
2511
+ if (d < vSector.z) discard; // annular gap
2512
+ bool sel = vSelected > 0.5;
2513
+ // radial signal falloff shape (strong center -> weak edge), 0..1
2514
+ float fill = pow(1.0 - clamp(d, 0.0, 1.0), max(vFalloff, 0.0));
2515
+ // boundary ring shape near d == 1, 0..1.
2516
+ float ring = (vRingWidth > 0.0) ? (1.0 - smoothstep(0.0, vRingWidth, abs(d - 1.0))) : 0.0;
2517
+ // optional expanding pulse rings (radar ping), bounded by the real radius
2518
+ float pulse = 0.0;
2519
+ if (vPulse.x > 0.5) {
2520
+ float rings = max(vPulse.z, 1.0);
2521
+ // Fixed bound <4 keeps this WebGL2-portable; variable \`break\` is safe under GLSL ES 3.00 (WebGL2 context).
2522
+ for (int i = 0; i < 4; i++) {
2523
+ if (float(i) >= rings) break;
2524
+ float phase = fract(d - uTime * vPulse.y - float(i) / rings);
2525
+ pulse += (1.0 - phase) * (1.0 - d) * 0.5;
2526
+ }
2527
+ }
2528
+ // A selected disc stays un-dimmed so it remains prominent while its
2529
+ // focus-dimmed neighbours fade (click-to-isolate). Its boundary keeps its own
2530
+ // colour/opacity \u2014 the selection is marked by a dashed RADIUS SPOKE (below).
2531
+ float dim = sel ? 1.0 : vDim;
2532
+ vec3 col = mix(vColor, vRingColor, ring);
2533
+ // fillOpacity (vFill) scales ONLY the interior fill and the radar pulse, so you
2534
+ // can fade the fill to let the basemap show through. The boundary ring has its
2535
+ // OWN opacity (vRingOpacity) and is unaffected by fillOpacity \u2014 it stays crisp.
2536
+ // Then * dim so a disc fades with its node under focus / click-dim.
2537
+ float alpha = clamp(max(vFill * fill, vRingOpacity * ring) + vFill * pulse, 0.0, 1.0) * dim;
2538
+
2539
+ // Selection marker: a dashed RADIUS spoke from the centre (d=0) out to the +X
2540
+ // edge (d=1), drawn in the coverage's own fill colour \u2014 reads as a literal
2541
+ // radius line annotating the coverage reach.
2542
+ if (sel) {
2543
+ const float halfThick = 0.008 / 3.0; // spoke half-width in local units (fraction of radius); 3x thinner
2544
+ const float dashFreq = 7.0; // ~7 dashes from centre to edge
2545
+ // Spoke direction: +X for a full disc (back-compat); along the sector azimuth for a wedge.
2546
+ vec2 dir = (vSector.y < 359.999) ? vec2(sin(radians(vSector.x)), cos(radians(vSector.x))) : vec2(1.0, 0.0);
2547
+ float along = dot(vLocal, dir);
2548
+ float perp = dot(vLocal, vec2(dir.y, -dir.x));
2549
+ float onAxis = 1.0 - smoothstep(halfThick * 0.5, halfThick, abs(perp));
2550
+ float onSide = step(0.0, along); // centre -> edge along the spoke direction
2551
+ float dash = step(fract(d * dashFreq), 0.55); // alternating dash/gap along the radius
2552
+ float spoke = onAxis * onSide * dash;
2553
+ if (spoke > 0.0) {
2554
+ col = mix(col, vColor, spoke); // spoke in the coverage's own fill colour
2555
+ alpha = max(alpha, spoke); // spoke at full opacity (sel => dim == 1)
2556
+ }
2557
+ }
2558
+
2559
+ if (alpha <= 0.0) discard;
2560
+ gl_FragColor = vec4(col, alpha);
2561
+ }
2562
+ `;var Wa=`precision highp float;
2563
+
2564
+ // Position texture (from GPU layout controller)
2565
+ uniform sampler2D positionTexture;
2566
+ uniform float textureSize;
2567
+
2568
+ // Viewport in CSS pixels (not physical pixels)
2569
+ uniform vec2 uViewportPx;
2570
+ uniform float mapMode;
2571
+ uniform float mapDamping;
2572
+ uniform float mapMaxGrowth; // shared semantics with node.vert.glsl; -1.0 = Infinity sentinel
2573
+
2574
+ // Per-instance attributes
2575
+ attribute float aParentNodeIndex;
2576
+ attribute vec2 aAnchorOffsetPx;
2577
+ attribute vec2 aSizePx;
2578
+ attribute vec4 aUvRect;
2579
+ attribute vec3 aBgRgb;
2580
+ attribute vec3 aFgRgb;
2581
+ attribute float aGroupRole; // 0 = background quad, 1 = glyph quad
2582
+ attribute vec2 aGlyphOffsetPx; // glyph pixel offset within badge (CSS px)
2583
+ attribute vec2 aGlyphSizePx; // glyph quad size in CSS px
2584
+
2585
+ // Varyings to fragment shader
2586
+ varying vec2 vUv;
2587
+ varying vec4 vUvRect;
2588
+ varying vec3 vBgRgb;
2589
+ varying vec3 vFgRgb;
2590
+ varying float vGroupRole;
2591
+ varying vec2 vSizePx; // background pill dimensions in CSS px (used by frag for aspect)
2592
+
2593
+ // Helper: Sample position from position texture using ES 1.0 pattern
2594
+ vec3 samplePosition(float idx) {
2595
+ float texX = mod(idx, textureSize) + 0.5;
2596
+ float texY = floor(idx / textureSize) + 0.5;
2597
+ vec2 texCoord = vec2(texX, texY) / textureSize;
2598
+ vec4 posData = texture2D(positionTexture, texCoord);
2599
+ return posData.xyz;
2600
+ }
2601
+
2602
+ void main() {
2603
+ vUv = uv;
2604
+ vUvRect = aUvRect;
2605
+ vBgRgb = aBgRgb;
2606
+ vFgRgb = aFgRgb;
2607
+ vGroupRole = aGroupRole;
2608
+ vSizePx = aSizePx;
2609
+
2610
+ // 1. Sample parent position from the position texture
2611
+ vec3 parentPos = samplePosition(aParentNodeIndex);
2612
+
2613
+ // 2. Project parent center to clip space using the standard MVP
2614
+ vec4 mvParent = modelViewMatrix * vec4(parentPos, 1.0);
2615
+ vec4 clip = projectionMatrix * mvParent;
2616
+
2617
+ // 3. Compute screen-space pixel offset based on group role.
2618
+ // \`position.xy\` is [-0.5, 0.5]\xB2 for a Three.js PlaneGeometry of size 1.
2619
+ // ANCHOR_OFFSETS use CSS screen convention (Y increases downward). NDC uses
2620
+ // Y-up, so we negate the anchor Y component. \`position.xy\` already uses the
2621
+ // correct NDC sign (positive Y = up), so only the anchor needs flipping.
2622
+ vec2 anchorNdc = vec2(aAnchorOffsetPx.x, -aAnchorOffsetPx.y);
2623
+ vec2 pxOffset;
2624
+ if (aGroupRole < 0.5) {
2625
+ // Background quad \u2014 centre the pill at anchor + size offset
2626
+ pxOffset = anchorNdc + (position.xy * aSizePx);
2627
+ } else {
2628
+ // Glyph quad \u2014 position glyph within the badge at its measured offset
2629
+ pxOffset = anchorNdc + aGlyphOffsetPx + (position.xy * aGlyphSizePx);
2630
+ }
2631
+
2632
+ // 4. Apply pixel offset in NDC, scaled by scene depth so badges grow/shrink
2633
+ // proportionally with nodes as the user zooms.
2634
+ // Nodes use: pixelSize = nodeSize * 50 / max(-mvCenter.z, 0.001)
2635
+ // We match that depth curve: REF_DEPTH=10 is the depth where a size-10
2636
+ // node appears as 50 CSS px \u2014 matching the designed sizes in TypeScript.
2637
+ // At half the depth (zoom in 2\xD7), depthFactor=2 \u2192 badge is 2\xD7 bigger, same
2638
+ // as the node. At REF_DEPTH=10 exactly, depthFactor=1 \u2192 defined CSS px sizes.
2639
+ // Beyond softKnee (raw > mapMaxGrowth \xD7 0.5) the growth softly asymptotes
2640
+ // to mapMaxGrowth \u2014 see the soft-knee block below. Tracks node.vert.glsl
2641
+ // identically.
2642
+ float viewDepth = max(-mvParent.z, 0.001);
2643
+ float depthFactor;
2644
+ // Soft-knee curve \u2014 MUST mirror node.vert.glsl / picking.vert.glsl exactly so
2645
+ // badge/tag freeze in lockstep with the parent bubble (see spec G4).
2646
+ if (mapMode > 0.5) {
2647
+ float raw = pow(10.0 / viewDepth, mapDamping);
2648
+ depthFactor = kvMapGrowth(raw, mapMaxGrowth);
2649
+ } else {
2650
+ depthFactor = 10.0 / viewDepth;
2651
+ }
2652
+ vec2 ndc = clip.xy / clip.w;
2653
+ ndc += (pxOffset * depthFactor * 2.0) / uViewportPx;
2654
+ gl_Position = vec4(ndc * clip.w, clip.z, clip.w);
2655
+ }
2656
+ `;var ja=`precision highp float;
2657
+
2658
+ // Position texture (from GPU layout controller)
2659
+ uniform sampler2D positionTexture;
2660
+ uniform float textureSize;
2661
+
2662
+ // Viewport in CSS pixels (not physical pixels)
2663
+ uniform vec2 uViewportPx;
2664
+ uniform float mapMode;
2665
+ uniform float mapDamping;
2666
+ uniform float mapMaxGrowth; // shared semantics with node.vert.glsl; -1.0 = Infinity sentinel
2667
+
2668
+ // Per-instance attributes
2669
+ attribute float aParentNodeIndex;
2670
+ attribute vec2 aAnchorOffsetPx;
2671
+ attribute vec2 aSizePx;
2672
+ attribute vec4 aUvRect;
2673
+ attribute vec3 aBgRgb;
2674
+ attribute vec3 aFgRgb;
2675
+ attribute float aGroupRole; // 0 = background quad, 1 = glyph quad
2676
+ attribute vec2 aGlyphOffsetPx; // glyph pixel offset within tag (CSS px)
2677
+ attribute vec2 aGlyphSizePx; // glyph quad size in CSS px
2678
+
2679
+ // Varyings to fragment shader
2680
+ varying vec2 vUv;
2681
+ varying vec4 vUvRect;
2682
+ varying vec3 vBgRgb;
2683
+ varying vec3 vFgRgb;
2684
+ varying float vGroupRole;
2685
+ varying vec2 vSizePx; // background pill dimensions in CSS px (used by frag for aspect)
2686
+
2687
+ // Helper: Sample position from position texture using ES 1.0 pattern
2688
+ vec3 samplePosition(float idx) {
2689
+ float texX = mod(idx, textureSize) + 0.5;
2690
+ float texY = floor(idx / textureSize) + 0.5;
2691
+ vec2 texCoord = vec2(texX, texY) / textureSize;
2692
+ vec4 posData = texture2D(positionTexture, texCoord);
2693
+ return posData.xyz;
2694
+ }
2695
+
2696
+ void main() {
2697
+ vUv = uv;
2698
+ vUvRect = aUvRect;
2699
+ vBgRgb = aBgRgb;
2700
+ vFgRgb = aFgRgb;
2701
+ vGroupRole = aGroupRole;
2702
+ vSizePx = aSizePx;
2703
+
2704
+ // 1. Sample parent position from the position texture
2705
+ vec3 parentPos = samplePosition(aParentNodeIndex);
2706
+
2707
+ // 2. Project parent center to clip space using the standard MVP
2708
+ vec4 mvParent = modelViewMatrix * vec4(parentPos, 1.0);
2709
+ vec4 clip = projectionMatrix * mvParent;
2710
+
2711
+ // 3. Compute screen-space pixel offset based on group role.
2712
+ // \`position.xy\` is [-0.5, 0.5]\xB2 for a Three.js PlaneGeometry of size 1.
2713
+ // ANCHOR_OFFSETS use CSS screen convention (Y increases downward). NDC uses
2714
+ // Y-up, so we negate the anchor Y component. \`position.xy\` already uses the
2715
+ // correct NDC sign (positive Y = up), so only the anchor needs flipping.
2716
+ vec2 anchorNdc = vec2(aAnchorOffsetPx.x, -aAnchorOffsetPx.y);
2717
+ vec2 pxOffset;
2718
+ if (aGroupRole < 0.5) {
2719
+ // Background quad \u2014 centre the pill at anchor + size offset
2720
+ pxOffset = anchorNdc + (position.xy * aSizePx);
2721
+ } else {
2722
+ // Glyph quad \u2014 position glyph within the tag at its measured offset
2723
+ pxOffset = anchorNdc + aGlyphOffsetPx + (position.xy * aGlyphSizePx);
2724
+ }
2725
+
2726
+ // 4. Apply pixel offset in NDC, scaled by scene depth so tags grow/shrink
2727
+ // proportionally with nodes as the user zooms.
2728
+ // Nodes use: pixelSize = nodeSize * 50 / max(-mvCenter.z, 0.001)
2729
+ // We match that depth curve: REF_DEPTH=10 is the depth where a size-10
2730
+ // node appears as 50 CSS px \u2014 matching the designed sizes in TypeScript.
2731
+ // At half the depth (zoom in 2\xD7), depthFactor=2 \u2192 tag is 2\xD7 bigger, same
2732
+ // as the node. At REF_DEPTH=10 exactly, depthFactor=1 \u2192 defined CSS px sizes.
2733
+ // Beyond softKnee (raw > mapMaxGrowth \xD7 0.5) the growth softly asymptotes
2734
+ // to mapMaxGrowth \u2014 see the soft-knee block below. Tracks node.vert.glsl
2735
+ // identically.
2736
+ float viewDepth = max(-mvParent.z, 0.001);
2737
+ float depthFactor;
2738
+ // Soft-knee curve \u2014 MUST mirror node.vert.glsl / picking.vert.glsl exactly so
2739
+ // badge/tag freeze in lockstep with the parent bubble (see spec G4).
2740
+ if (mapMode > 0.5) {
2741
+ float raw = pow(10.0 / viewDepth, mapDamping);
2742
+ depthFactor = kvMapGrowth(raw, mapMaxGrowth);
2743
+ } else {
2744
+ depthFactor = 10.0 / viewDepth;
2745
+ }
2746
+ vec2 ndc = clip.xy / clip.w;
2747
+ ndc += (pxOffset * depthFactor * 2.0) / uViewportPx;
2748
+ gl_Position = vec4(ndc * clip.w, clip.z, clip.w);
2749
+ }
2750
+ `;var e5=bt(Na),t5=Zt(La),n5=bt(Zt(Ao(Oa)));var o5=bt(Ga),r5=Zt(Ba),i5=bt(Zt(Ao(Ha)));var qa=Ua,Ka=Va,l5=bt(Wa),c5=bt(ja);var K1=[[-.5,.5],[.5,.5],[.5,-.5],[-.5,-.5]],Bn=class{constructor(){this.maxItems=1024;this.ctx=null;this.geometry=null;this.material=null;this.mesh=null;this.items=[];this.hasPulse=!1;this.time=0;this.positions=null;this.aCenter=null;this.aRadius=null;this.aColor=null;this.aFillOpacity=null;this.aFalloff=null;this.aRingColor=null;this.aRingWidth=null;this.aRingOpacity=null;this.aPulse=null;this.aDim=null;this.aSelected=null;this.aSector=null}mount(e){this.ctx=e;let t=this.maxItems*4,o=new Ce.BufferGeometry;this.positions=new Float32Array(t*3);for(let l=0;l<t;l++){let u=K1[l%4];this.positions[l*3]=u[0],this.positions[l*3+1]=u[1],this.positions[l*3+2]=0}o.setAttribute("position",new Ce.Float32BufferAttribute(this.positions,3));let r=(l,u)=>{let c=new Ce.BufferAttribute(l,u);return c.setUsage(Ce.DynamicDrawUsage),c};this.aCenter=new Float32Array(t*3),this.aRadius=new Float32Array(t),this.aColor=new Float32Array(t*3),this.aFillOpacity=new Float32Array(t),this.aFalloff=new Float32Array(t),this.aRingColor=new Float32Array(t*3),this.aRingWidth=new Float32Array(t),this.aRingOpacity=new Float32Array(t),this.aPulse=new Float32Array(t*3),this.aDim=new Float32Array(t).fill(1),this.aSelected=new Float32Array(t),this.aSector=new Float32Array(t*3);for(let l=0;l<t;l++)this.aSector[l*3+1]=360;o.setAttribute("aCenter",r(this.aCenter,3)),o.setAttribute("aRadius",r(this.aRadius,1)),o.setAttribute("aColor",r(this.aColor,3)),o.setAttribute("aFillOpacity",r(this.aFillOpacity,1)),o.setAttribute("aFalloff",r(this.aFalloff,1)),o.setAttribute("aRingColor",r(this.aRingColor,3)),o.setAttribute("aRingWidth",r(this.aRingWidth,1)),o.setAttribute("aRingOpacity",r(this.aRingOpacity,1)),o.setAttribute("aPulse",r(this.aPulse,3)),o.setAttribute("aDim",r(this.aDim,1)),o.setAttribute("aSelected",r(this.aSelected,1)),o.setAttribute("aSector",r(this.aSector,3));let i=new Uint16Array(this.maxItems*6);for(let l=0;l<this.maxItems;l++){let u=l*4,c=l*6;i[c]=u,i[c+1]=u+1,i[c+2]=u+2,i[c+3]=u,i[c+4]=u+2,i[c+5]=u+3}o.setIndex(new Ce.BufferAttribute(i,1)),o.setDrawRange(0,0);let a=new Ce.ShaderMaterial({vertexShader:qa,fragmentShader:Ka,uniforms:{uTime:{value:0},uSphereRadius:{value:e.sphereRadius}},transparent:!0,depthWrite:!1,depthTest:!1,side:Ce.DoubleSide}),s=new Ce.Mesh(o,a);s.frustumCulled=!1,s.name="CoverageRenderer",s.renderOrder=e.renderOrder("overlay",1),this.geometry=o,this.material=a,this.mesh=s,e.cloudScene.add(s)}update(e){let t=this.ctx;if(!t||!this.geometry)return;if(this.items=(e.items??[]).slice(0,this.maxItems),this.hasPulse=this.items.some(b=>!!b.pulse),this.mesh){let b=this.items[0]?.band??"overlay";this.mesh.renderOrder=b==="underlay"?t.renderOrder("underlay",33):t.renderOrder("overlay",1)}let o=t.store.positionProvider?.getPositions()??null,r=t.store.index,i=t.store.nodeState?.selected??null,a=this.aCenter,s=this.aRadius,l=this.aColor,u=this.aFillOpacity,c=this.aFalloff,p=this.aRingColor,d=this.aRingWidth,g=this.aRingOpacity,m=this.aPulse,y=this.aDim,v=this.aSelected,h=this.aSector;for(let b=0;b<this.items.length;b++){let f=this.items[b],w=0,x=0,S=0;if(f.position)[w,x,S]=f.position;else if(f.anchorNodeId&&o){let G=r.getNodeIndex(f.anchorNodeId);G!==void 0&&G>=0&&(w=o[G*3],x=o[G*3+1],S=o[G*3+2])}let A=f.anchorNodeId?t.getNodeOpacity(f.anchorNodeId):1,k=0;if(f.anchorNodeId&&i){let G=r.getNodeIndex(f.anchorNodeId);G!==void 0&&G>=0&&(k=i[G]>0?1:0)}let C=f.fillOpacity??.25,E=f.falloff??2,P=f.ringColor??f.fillColor,M=f.ringWidth??.04,D=f.ringOpacity??.8,T=f.pulse?1:0,I=f.pulse?.speed??.5,_=f.pulse?.rings??2,N=f.azimuthDeg??0,R=f.beamWidthDeg??360,z=f.innerRadius??0;for(let G=0;G<4;G++){let F=b*4+G;a[F*3]=w,a[F*3+1]=x,a[F*3+2]=S,s[F]=f.radius,l[F*3]=f.fillColor[0],l[F*3+1]=f.fillColor[1],l[F*3+2]=f.fillColor[2],u[F]=C,c[F]=E,p[F*3]=P[0],p[F*3+1]=P[1],p[F*3+2]=P[2],d[F]=M,g[F]=D,m[F*3]=T,m[F*3+1]=I,m[F*3+2]=_,y[F]=A,v[F]=k,h[F*3]=N,h[F*3+1]=R,h[F*3+2]=z}}this.geometry.getAttribute("aCenter").needsUpdate=!0,this.geometry.getAttribute("aRadius").needsUpdate=!0,this.geometry.getAttribute("aColor").needsUpdate=!0,this.geometry.getAttribute("aFillOpacity").needsUpdate=!0,this.geometry.getAttribute("aFalloff").needsUpdate=!0,this.geometry.getAttribute("aRingColor").needsUpdate=!0,this.geometry.getAttribute("aRingWidth").needsUpdate=!0,this.geometry.getAttribute("aRingOpacity").needsUpdate=!0,this.geometry.getAttribute("aPulse").needsUpdate=!0,this.geometry.getAttribute("aDim").needsUpdate=!0,this.geometry.getAttribute("aSelected").needsUpdate=!0,this.geometry.getAttribute("aSector").needsUpdate=!0,this.geometry.setDrawRange(0,this.items.length*6)}frame(e,t){let o=this.geometry;if(!o)return!1;let r=!1;this.material&&this.material.uniforms.uSphereRadius.value!==t.sphereRadius&&(this.material.uniforms.uSphereRadius.value=t.sphereRadius,r=!0);let i=!1,a=!1,s=!1,l=t.store.positionProvider?.getPositions()??null,u=t.store.index,c=t.store.nodeState?.selected??null,p=this.aCenter,d=this.aDim,g=this.aSelected;for(let m=0;m<this.items.length;m++){let y=this.items[m];if(!y.anchorNodeId)continue;let v=u.getNodeIndex(y.anchorNodeId);if(v===void 0||v<0)continue;if(l){let f=l[v*3],w=l[v*3+1],x=l[v*3+2],S=m*4*3;if(p[S]!==f||p[S+1]!==w||p[S+2]!==x){for(let A=0;A<4;A++){let k=(m*4+A)*3;p[k]=f,p[k+1]=w,p[k+2]=x}i=!0}}let h=t.getNodeOpacity(y.anchorNodeId);if(Math.abs(d[m*4]-h)>1e-4){for(let f=0;f<4;f++)d[m*4+f]=h;a=!0}let b=c&&c[v]>0?1:0;if(g[m*4]!==b){for(let f=0;f<4;f++)g[m*4+f]=b;s=!0}}return i&&(o.getAttribute("aCenter").needsUpdate=!0),a&&(o.getAttribute("aDim").needsUpdate=!0),s&&(o.getAttribute("aSelected").needsUpdate=!0),this.hasPulse&&this.material&&(this.time+=e,this.material.uniforms.uTime.value=this.time),this.hasPulse||i||a||s||r}dispose(){this.mesh&&this.ctx&&this.ctx.cloudScene.remove(this.mesh),this.geometry?.dispose(),this.material?.dispose(),this.geometry=null,this.material=null,this.mesh=null,this.ctx=null,this.items=[],this.positions=null,this.aCenter=null,this.aRadius=null,this.aColor=null,this.aFillOpacity=null,this.aFalloff=null,this.aRingColor=null,this.aRingWidth=null,this.aRingOpacity=null,this.aPulse=null,this.aDim=null,this.aSelected=null,this.aSector=null}};var Hn="coverage",Un=class{constructor(e,t){this.layers=e;this.kmToWorld=t;this.items=new Map}resolve(e,t){let o=t.radius!=null?t.radius:t.radiusKm!=null?this.kmToWorld(t.radiusKm,t.latitude??0):0;t.radius==null&&t.radiusKm==null&&console.warn(`[coverage] item "${e}" has neither radius nor radiusKm; it will be invisible (radius 0)`);let{radiusKm:r,latitude:i,key:a,...s}=t;return{...s,anchorNodeId:s.anchorNodeId??e,radius:o}}set(e,t){if(Array.isArray(e))for(let o of e){let r=o.key!=null?o.key:o.anchorNodeId!=null?o.anchorNodeId:o.position!=null?`pos:${o.position.join(",")}`:`pos:${this.items.size}`;this.items.set(r,this.resolve(r,o))}else{if(t==null)throw new Error("[coverage] set(nodeId, spec): spec is required");this.items.set(e,this.resolve(e,{...t,anchorNodeId:e}))}this.flush()}clear(e){e?this.items.delete(e):this.items.clear(),this.flush()}flush(){let e=[...this.items.values()];if(e.length===0){this.layers.unmount(Hn);return}this.layers.has(Hn)?this.layers.update(Hn,{items:e}):this.layers.mount(Hn,()=>new Bn,{items:e},{frame:!0})}};var j=te(require("three")),Ya=n=>new j.Color(n[0],n[1],n[2]),Vn=class{constructor(){this.ctx=null;this.group=null;this.geometries=[];this.materials=[]}mount(e){this.ctx=e;let t=new j.Group;t.name="PolygonRenderer",t.renderOrder=e.renderOrder("overlay",3),this.group=t,e.cloudScene.add(t)}update(e){let t=this.ctx,o=this.group;if(!t||!o)return;this.clearChildren();let r=e.items??[];for(let i of r){let a=i.rings??[];if(!a.length||a[0].length<3)continue;let s=i.fillOpacity??.4,l=i.outline??!0,u=i.outlineColor??i.fillColor,c=i.outlineOpacity??.9,p=i.band??"overlay",d=t.renderOrder(p,p==="underlay"?36:3),g=t.renderOrder(p,p==="underlay"?37:4),m=a[0],y=m[0][2]??0,v=this.ctx.sphereRadius>0,h;if(v){let P=new j.Vector3;for(let _ of m)P.add(new j.Vector3(_[0],_[1],_[2]));P.multiplyScalar(1/m.length);let M=P.clone().normalize(),D=Math.abs(M.y)>.999?new j.Vector3(1,0,0):new j.Vector3(0,1,0),T=new j.Vector3().crossVectors(D,M).normalize(),I=new j.Vector3().crossVectors(M,T);h=_=>{let N=new j.Vector3(_[0]-P.x,_[1]-P.y,_[2]-P.z);return new j.Vector2(N.dot(T),N.dot(I))}}else h=P=>new j.Vector2(P[0],P[1]);let b=m.map(h),f=[],w=[];for(let P=1;P<a.length;P++)a[P].length<3||(f.push(a[P].map(h)),w.push(a[P]));let x=j.ShapeUtils.triangulateShape(b,f),S=m.concat(...w),A=new Float32Array(S.length*3);for(let P=0;P<S.length;P++)A[P*3]=S[P][0],A[P*3+1]=S[P][1],A[P*3+2]=v?S[P][2]:y;let k=new j.BufferGeometry;k.setAttribute("position",new j.Float32BufferAttribute(A,3)),k.setIndex(x.flat());let C=new j.MeshBasicMaterial({color:Ya(i.fillColor),transparent:!0,opacity:s,depthWrite:!1,depthTest:!1,side:j.DoubleSide}),E=new j.Mesh(k,C);if(E.frustumCulled=!1,E.renderOrder=d,o.add(E),this.geometries.push(k),this.materials.push(C),l)for(let P of a){if(P.length<2)continue;let M=new j.BufferGeometry().setFromPoints(P.map(I=>new j.Vector3(I[0],I[1],I[2]??0))),D=new j.LineBasicMaterial({color:Ya(u),transparent:!0,opacity:c,depthWrite:!1,depthTest:!1}),T=new j.LineLoop(M,D);T.frustumCulled=!1,T.renderOrder=g,o.add(T),this.geometries.push(M),this.materials.push(D)}}t.invalidate()}dispose(){this.clearChildren(),this.group&&this.ctx&&this.ctx.cloudScene.remove(this.group),this.group=null,this.ctx=null}clearChildren(){if(this.group)for(let e=this.group.children.length-1;e>=0;e--)this.group.remove(this.group.children[e]);for(let e of this.geometries)e.dispose();for(let e of this.materials)e.dispose();this.geometries=[],this.materials=[]}};var Wn="polygon",jn=class{constructor(e,t){this.layers=e;this.latLngToWorld=t;this.items=new Map}toWorldRing(e,t){return e.map(o=>{let r=t?o[1]:o[0],i=t?o[0]:o[1],a=this.latLngToWorld(r,i);return[a.x,a.y,a.z]})}resolve(e,t){let o={fillColor:t.fillColor,fillOpacity:t.fillOpacity,outlineColor:t.outlineColor,outlineOpacity:t.outlineOpacity,outline:t.outline,band:t.band};if(t.worldRings)return[{id:e,rings:t.worldRings,...o}];if(t.latLngRings)return[{id:e,rings:t.latLngRings.map(r=>this.toWorldRing(r,!1)),...o}];if(t.geojson){let r=t.geojson.type==="Feature"?t.geojson.geometry:t.geojson;return r.type==="Polygon"?[{id:e,rings:r.coordinates.map(i=>this.toWorldRing(i,!0)),...o}]:r.coordinates.map((i,a)=>({id:`${e}#${a}`,rings:i.map(s=>this.toWorldRing(s,!0)),...o}))}return console.warn(`[polygon] item "${e}" has no geojson/latLngRings/worldRings; nothing to draw`),[]}set(e,t){if(Array.isArray(e))for(let o of e){let r=o.id!=null?o.id:`poly:${this.items.size}`;this.items.set(r,this.resolve(r,o))}else{if(t==null)throw new Error("[polygon] set(id, spec): spec is required");this.items.set(e,this.resolve(e,{...t,id:e}))}this.flush()}clear(e){e?this.items.delete(e):this.items.clear(),this.flush()}flush(){let e=[...this.items.values()].flat();if(e.length===0){this.layers.unmount(Wn);return}this.layers.has(Wn)?this.layers.update(Wn,{items:e}):this.layers.mount(Wn,()=>new Vn,{items:e})}};var qn=class{constructor(e){this.owner=e}pageRank(...e){return this.owner.pageRank(...e)}eigenvectorCentrality(...e){return this.owner.eigenvectorCentrality(...e)}hits(...e){return this.owner.hits(...e)}betweenness(...e){return this.owner.betweenness(...e)}closeness(...e){return this.owner.closeness(...e)}degree(...e){return this.owner.degree(...e)}};var Kn=class{constructor(e){this.owner=e}connectedComponent(...e){return this.owner.connectedComponent(...e)}stronglyConnectedComponent(...e){return this.owner.stronglyConnectedComponent(...e)}labelPropagation(...e){return this.owner.labelPropagation(...e)}louvain(...e){return this.owner.louvain(...e)}};var Yn=class{constructor(e){this.owner=e}shortestPath(...e){return this.owner.shortestPath(...e)}kShortestPaths(...e){return this.owner.kShortestPaths(...e)}aStar(...e){return this.owner.aStar(...e)}bfs(...e){return this.owner.bfs(...e)}dfs(...e){return this.owner.dfs(...e)}};var Xn=class{constructor(e){this.owner=e}triangleCount(...e){return this.owner.triangleCount(...e)}clusteringCoefficient(...e){return this.owner.clusteringCoefficient(...e)}};var Xa=`// ../graph-algorithms/dist/index.mjs
2751
+ var NegativeWeightError = class extends Error {
2752
+ constructor(edgeId, weight, algorithm) {
2753
+ super(
2754
+ \`Algorithm "\${algorithm}" requires non-negative edge weights, but edge "\${edgeId}" has weight \${weight}.\`
2755
+ );
2756
+ this.edgeId = edgeId;
2757
+ this.weight = weight;
2758
+ this.algorithm = algorithm;
2759
+ this.name = "NegativeWeightError";
2760
+ }
2761
+ };
2762
+ var AlgorithmAbortError = class extends Error {
2763
+ constructor(algorithm) {
2764
+ super(\`Algorithm "\${algorithm}" was aborted.\`);
2765
+ this.algorithm = algorithm;
2766
+ this.name = "AbortError";
2767
+ }
2768
+ };
2769
+ function checkAborted(signal, algorithm) {
2770
+ if (signal?.aborted) {
2771
+ throw new AlgorithmAbortError(algorithm);
2772
+ }
2773
+ }
2774
+ function parseWeight(value) {
2775
+ if (value == null) return 1;
2776
+ const n = typeof value === "number" ? value : parseFloat(String(value));
2777
+ return isFinite(n) ? n : 1;
2778
+ }
2779
+ function buildCSR(context, options) {
2780
+ const { direction, weightProperty } = options;
2781
+ const n = context.nodes.length;
2782
+ const nodeIdToIndex = /* @__PURE__ */ new Map();
2783
+ const nodeIndexToId = new Array(n);
2784
+ for (let i = 0; i < n; i++) {
2785
+ const node = context.nodes[i];
2786
+ if (node === void 0) continue;
2787
+ nodeIdToIndex.set(node.id, i);
2788
+ nodeIndexToId[i] = node.id;
2789
+ }
2790
+ const edgeIdToIndex = /* @__PURE__ */ new Map();
2791
+ const edgeIndexToId = new Array(context.edges.length);
2792
+ const validEdges = [];
2793
+ for (let i = 0; i < context.edges.length; i++) {
2794
+ const edge = context.edges[i];
2795
+ if (edge === void 0) continue;
2796
+ edgeIdToIndex.set(edge.id, i);
2797
+ edgeIndexToId[i] = edge.id;
2798
+ const s = nodeIdToIndex.get(edge.source);
2799
+ const t = nodeIdToIndex.get(edge.target);
2800
+ if (s === void 0 || t === void 0) continue;
2801
+ const w = weightProperty ? parseWeight(edge.properties[weightProperty]) : 1;
2802
+ validEdges.push({ s, t, w, origIdx: i });
2803
+ }
2804
+ const degree2 = new Uint32Array(n);
2805
+ for (const e of validEdges) {
2806
+ if (direction === "any") {
2807
+ degree2[e.s]++;
2808
+ degree2[e.t]++;
2809
+ } else if (direction === "out") {
2810
+ degree2[e.s]++;
2811
+ } else {
2812
+ degree2[e.t]++;
2813
+ }
2814
+ }
2815
+ const rowPtr = new Uint32Array(n + 1);
2816
+ for (let i = 0; i < n; i++) {
2817
+ rowPtr[i + 1] = rowPtr[i] + (degree2[i] ?? 0);
2818
+ }
2819
+ const m = rowPtr[n] ?? 0;
2820
+ const colIdx = new Uint32Array(m);
2821
+ const edgeIdx = new Uint32Array(m);
2822
+ const weights = new Float32Array(m);
2823
+ const cursor = new Uint32Array(n);
2824
+ for (const e of validEdges) {
2825
+ if (direction === "any" || direction === "out") {
2826
+ const k = (rowPtr[e.s] ?? 0) + (cursor[e.s] ?? 0);
2827
+ cursor[e.s]++;
2828
+ colIdx[k] = e.t;
2829
+ edgeIdx[k] = e.origIdx;
2830
+ weights[k] = e.w;
2831
+ }
2832
+ if (direction === "any" || direction === "in") {
2833
+ const k = (rowPtr[e.t] ?? 0) + (cursor[e.t] ?? 0);
2834
+ cursor[e.t]++;
2835
+ colIdx[k] = e.s;
2836
+ edgeIdx[k] = e.origIdx;
2837
+ weights[k] = e.w;
2838
+ }
2839
+ }
2840
+ return {
2841
+ n,
2842
+ m,
2843
+ rowPtr,
2844
+ colIdx,
2845
+ edgeIdx,
2846
+ weights,
2847
+ nodeIdToIndex,
2848
+ nodeIndexToId,
2849
+ edgeIdToIndex,
2850
+ edgeIndexToId
2851
+ };
2852
+ }
2853
+ function powerIterate(csr, options) {
2854
+ const { iterations, tolerance, updateFn, signal, onProgress, algorithmName = "powerIterate" } = options;
2855
+ const n = csr.n;
2856
+ if (n === 0) return new Float64Array(0);
2857
+ let curr = options.initial ? new Float64Array(options.initial) : new Float64Array(n).fill(1 / n);
2858
+ let next = new Float64Array(n);
2859
+ for (let iter = 0; iter < iterations; iter++) {
2860
+ checkAborted(signal, algorithmName);
2861
+ updateFn(next, curr, csr, iter);
2862
+ let delta = 0;
2863
+ for (let i = 0; i < n; i++) delta += Math.abs(next[i] - curr[i]);
2864
+ const tmp = curr;
2865
+ curr = next;
2866
+ next = tmp;
2867
+ if (onProgress) onProgress((iter + 1) / iterations);
2868
+ if (delta < tolerance) break;
2869
+ }
2870
+ return curr;
2871
+ }
2872
+ function pageRank(context, options = {}) {
2873
+ const {
2874
+ damping = 0.85,
2875
+ iterations = 100,
2876
+ tolerance = 1e-6,
2877
+ weightProperty,
2878
+ signal,
2879
+ onProgress,
2880
+ direction = "any"
2881
+ } = options;
2882
+ const isUndirected = direction === "any";
2883
+ const csr = buildCSR(context, { direction, weightProperty });
2884
+ const n = csr.n;
2885
+ if (n === 0) return /* @__PURE__ */ new Map();
2886
+ let outDeg;
2887
+ if (isUndirected) {
2888
+ outDeg = new Uint32Array(n);
2889
+ for (const edge of context.edges) {
2890
+ if (edge.source === edge.target) continue;
2891
+ const s = csr.nodeIdToIndex.get(edge.source);
2892
+ const t = csr.nodeIdToIndex.get(edge.target);
2893
+ if (s !== void 0) outDeg[s]++;
2894
+ if (t !== void 0) outDeg[t]++;
2895
+ }
2896
+ } else {
2897
+ outDeg = new Uint32Array(n);
2898
+ for (const edge of context.edges) {
2899
+ if (edge.source === edge.target) continue;
2900
+ const s = csr.nodeIdToIndex.get(edge.source);
2901
+ if (s !== void 0) outDeg[s]++;
2902
+ }
2903
+ }
2904
+ const inCsr = isUndirected ? csr : buildCSR(context, { direction: "in", weightProperty });
2905
+ const rank = powerIterate(csr, {
2906
+ iterations,
2907
+ tolerance,
2908
+ signal,
2909
+ onProgress,
2910
+ algorithmName: "pageRank",
2911
+ initial: new Float64Array(n).fill(1 / n),
2912
+ updateFn: (next, curr) => {
2913
+ let danglingSum = 0;
2914
+ for (let i = 0; i < n; i++) {
2915
+ if (outDeg[i] === 0) danglingSum += curr[i];
2916
+ }
2917
+ const teleport = (1 - damping) / n;
2918
+ const danglingContribution = damping * danglingSum / n;
2919
+ for (let i = 0; i < n; i++) {
2920
+ let sum = 0;
2921
+ const rowStart = inCsr.rowPtr[i];
2922
+ const rowEnd = inCsr.rowPtr[i + 1];
2923
+ for (let k = rowStart; k < rowEnd; k++) {
2924
+ const j = inCsr.colIdx[k];
2925
+ if (outDeg[j] > 0) sum += curr[j] / outDeg[j];
2926
+ }
2927
+ next[i] = teleport + damping * sum + danglingContribution;
2928
+ }
2929
+ }
2930
+ });
2931
+ const result = /* @__PURE__ */ new Map();
2932
+ for (let i = 0; i < n; i++) {
2933
+ result.set(csr.nodeIndexToId[i], rank[i]);
2934
+ }
2935
+ return result;
2936
+ }
2937
+ function eigenvectorCentrality(context, options = {}) {
2938
+ const { iterations = 100, tolerance = 1e-6, signal, onProgress } = options;
2939
+ const csr = buildCSR(context, { direction: "any" });
2940
+ const n = csr.n;
2941
+ if (n === 0) return /* @__PURE__ */ new Map();
2942
+ const result = powerIterate(csr, {
2943
+ iterations,
2944
+ tolerance,
2945
+ signal,
2946
+ onProgress,
2947
+ algorithmName: "eigenvectorCentrality",
2948
+ initial: new Float64Array(n).fill(1 / Math.sqrt(n)),
2949
+ updateFn: (next, curr, csr2) => {
2950
+ for (let i = 0; i < n; i++) {
2951
+ let sum = 0;
2952
+ for (let k = csr2.rowPtr[i]; k < csr2.rowPtr[i + 1]; k++) {
2953
+ sum += curr[csr2.colIdx[k]];
2954
+ }
2955
+ next[i] = sum;
2956
+ }
2957
+ let norm = 0;
2958
+ for (let i = 0; i < n; i++) norm += next[i] * next[i];
2959
+ norm = Math.sqrt(norm) || 1;
2960
+ for (let i = 0; i < n; i++) next[i] /= norm;
2961
+ }
2962
+ });
2963
+ const out = /* @__PURE__ */ new Map();
2964
+ for (let i = 0; i < n; i++) out.set(csr.nodeIndexToId[i], result[i]);
2965
+ return out;
2966
+ }
2967
+ function hits(context, options = {}) {
2968
+ const { iterations = 100, tolerance = 1e-8, signal } = options;
2969
+ const csrOut = buildCSR(context, { direction: "out" });
2970
+ const csrIn = buildCSR(context, { direction: "in" });
2971
+ const n = csrOut.n;
2972
+ if (n === 0) {
2973
+ return { hubs: /* @__PURE__ */ new Map(), authorities: /* @__PURE__ */ new Map() };
2974
+ }
2975
+ let hubs = new Float64Array(n).fill(1 / n);
2976
+ let auths = new Float64Array(n).fill(1 / n);
2977
+ for (let iter = 0; iter < iterations; iter++) {
2978
+ checkAborted(signal, "hits");
2979
+ const newAuths = new Float64Array(n);
2980
+ for (let i = 0; i < n; i++) {
2981
+ let sum = 0;
2982
+ for (let k = csrIn.rowPtr[i]; k < csrIn.rowPtr[i + 1]; k++) {
2983
+ sum += hubs[csrIn.colIdx[k]];
2984
+ }
2985
+ newAuths[i] = sum;
2986
+ }
2987
+ let authSum = 0;
2988
+ for (let i = 0; i < n; i++) authSum += newAuths[i];
2989
+ if (authSum > 0) for (let i = 0; i < n; i++) newAuths[i] /= authSum;
2990
+ const newHubs = new Float64Array(n);
2991
+ for (let i = 0; i < n; i++) {
2992
+ let sum = 0;
2993
+ for (let k = csrOut.rowPtr[i]; k < csrOut.rowPtr[i + 1]; k++) {
2994
+ sum += newAuths[csrOut.colIdx[k]];
2995
+ }
2996
+ newHubs[i] = sum;
2997
+ }
2998
+ let hubSum = 0;
2999
+ for (let i = 0; i < n; i++) hubSum += newHubs[i];
3000
+ if (hubSum > 0) for (let i = 0; i < n; i++) newHubs[i] /= hubSum;
3001
+ let delta = 0;
3002
+ for (let i = 0; i < n; i++) delta += Math.abs(newHubs[i] - hubs[i]);
3003
+ hubs = newHubs;
3004
+ auths = newAuths;
3005
+ if (delta < tolerance) break;
3006
+ }
3007
+ const hubsResult = /* @__PURE__ */ new Map();
3008
+ const authsResult = /* @__PURE__ */ new Map();
3009
+ for (let i = 0; i < n; i++) {
3010
+ hubsResult.set(csrOut.nodeIndexToId[i], hubs[i]);
3011
+ authsResult.set(csrOut.nodeIndexToId[i], auths[i]);
3012
+ }
3013
+ return { hubs: hubsResult, authorities: authsResult };
3014
+ }
3015
+ var UnionFind = class {
3016
+ constructor(n) {
3017
+ this.parent = new Int32Array(n);
3018
+ this.rank = new Uint8Array(n);
3019
+ for (let i = 0; i < n; i++) this.parent[i] = i;
3020
+ }
3021
+ find(x) {
3022
+ let root = x;
3023
+ while (this.parent[root] !== root) root = this.parent[root];
3024
+ while (this.parent[x] !== root) {
3025
+ const next = this.parent[x];
3026
+ this.parent[x] = root;
3027
+ x = next;
3028
+ }
3029
+ return root;
3030
+ }
3031
+ /** Returns true if a merge happened, false if already unioned. */
3032
+ union(a, b) {
3033
+ const ra = this.find(a);
3034
+ const rb = this.find(b);
3035
+ if (ra === rb) return false;
3036
+ if (this.rank[ra] < this.rank[rb]) {
3037
+ this.parent[ra] = rb;
3038
+ } else if (this.rank[ra] > this.rank[rb]) {
3039
+ this.parent[rb] = ra;
3040
+ } else {
3041
+ this.parent[rb] = ra;
3042
+ this.rank[ra]++;
3043
+ }
3044
+ return true;
3045
+ }
3046
+ /** Count distinct roots. O(n). */
3047
+ countRoots() {
3048
+ let count = 0;
3049
+ for (let i = 0; i < this.parent.length; i++) {
3050
+ if (this.parent[i] === i) count++;
3051
+ }
3052
+ return count;
3053
+ }
3054
+ };
3055
+ function connectedComponent(context, _options = {}) {
3056
+ const csr = buildCSR(context, { direction: "any" });
3057
+ const n = csr.n;
3058
+ if (n === 0) return /* @__PURE__ */ new Map();
3059
+ const uf = new UnionFind(n);
3060
+ for (let i = 0; i < n; i++) {
3061
+ for (let k = csr.rowPtr[i]; k < csr.rowPtr[i + 1]; k++) {
3062
+ uf.union(i, csr.colIdx[k]);
3063
+ }
3064
+ }
3065
+ const rootToLabel = /* @__PURE__ */ new Map();
3066
+ let nextLabel = 0;
3067
+ const result = /* @__PURE__ */ new Map();
3068
+ for (let i = 0; i < n; i++) {
3069
+ const root = uf.find(i);
3070
+ let label = rootToLabel.get(root);
3071
+ if (label === void 0) {
3072
+ label = nextLabel++;
3073
+ rootToLabel.set(root, label);
3074
+ }
3075
+ result.set(csr.nodeIndexToId[i], label);
3076
+ }
3077
+ return result;
3078
+ }
3079
+ function stronglyConnectedComponent(context, _options = {}) {
3080
+ const csr = buildCSR(context, { direction: "out" });
3081
+ const n = csr.n;
3082
+ if (n === 0) return /* @__PURE__ */ new Map();
3083
+ const index = new Int32Array(n).fill(-1);
3084
+ const lowlink = new Int32Array(n);
3085
+ const onStack = new Uint8Array(n);
3086
+ const sccLabel = new Int32Array(n).fill(-1);
3087
+ const tarjanStack = [];
3088
+ const work = [];
3089
+ let idxCounter = 0;
3090
+ let sccCounter = 0;
3091
+ for (let start = 0; start < n; start++) {
3092
+ if (index[start] >= 0) continue;
3093
+ work.push(start, csr.rowPtr[start]);
3094
+ index[start] = idxCounter;
3095
+ lowlink[start] = idxCounter;
3096
+ idxCounter++;
3097
+ tarjanStack.push(start);
3098
+ onStack[start] = 1;
3099
+ while (work.length > 0) {
3100
+ const cursor = work[work.length - 1];
3101
+ const v = work[work.length - 2];
3102
+ if (cursor < csr.rowPtr[v + 1]) {
3103
+ work[work.length - 1] = cursor + 1;
3104
+ const w = csr.colIdx[cursor];
3105
+ if (index[w] < 0) {
3106
+ index[w] = idxCounter;
3107
+ lowlink[w] = idxCounter;
3108
+ idxCounter++;
3109
+ tarjanStack.push(w);
3110
+ onStack[w] = 1;
3111
+ work.push(w, csr.rowPtr[w]);
3112
+ } else if (onStack[w]) {
3113
+ if (index[w] < lowlink[v]) lowlink[v] = index[w];
3114
+ }
3115
+ } else {
3116
+ if (lowlink[v] === index[v]) {
3117
+ let w;
3118
+ do {
3119
+ w = tarjanStack.pop();
3120
+ onStack[w] = 0;
3121
+ sccLabel[w] = sccCounter;
3122
+ } while (w !== v);
3123
+ sccCounter++;
3124
+ }
3125
+ work.length -= 2;
3126
+ if (work.length > 0) {
3127
+ const parent = work[work.length - 2];
3128
+ if (lowlink[v] < lowlink[parent]) lowlink[parent] = lowlink[v];
3129
+ }
3130
+ }
3131
+ }
3132
+ }
3133
+ const result = /* @__PURE__ */ new Map();
3134
+ for (let i = 0; i < n; i++) result.set(csr.nodeIndexToId[i], sccLabel[i]);
3135
+ return result;
3136
+ }
3137
+ function labelPropagation(context, options = {}) {
3138
+ const { maxIterations = 50, signal } = options;
3139
+ const csr = buildCSR(context, { direction: "any" });
3140
+ const n = csr.n;
3141
+ if (n === 0) return /* @__PURE__ */ new Map();
3142
+ const labels = new Int32Array(n);
3143
+ for (let i = 0; i < n; i++) labels[i] = i;
3144
+ for (let iter = 0; iter < maxIterations; iter++) {
3145
+ checkAborted(signal, "labelPropagation");
3146
+ let changed = false;
3147
+ for (let v = 0; v < n; v++) {
3148
+ const rowEnd = csr.rowPtr[v + 1];
3149
+ if (csr.rowPtr[v] === rowEnd) continue;
3150
+ const counts = /* @__PURE__ */ new Map();
3151
+ for (let k = csr.rowPtr[v]; k < rowEnd; k++) {
3152
+ const nl = labels[csr.colIdx[k]];
3153
+ counts.set(nl, (counts.get(nl) ?? 0) + 1);
3154
+ }
3155
+ let bestLabel = labels[v];
3156
+ let bestCount = counts.get(bestLabel) ?? 0;
3157
+ for (const [label, count] of counts) {
3158
+ if (count > bestCount || count === bestCount && label < bestLabel) {
3159
+ bestLabel = label;
3160
+ bestCount = count;
3161
+ }
3162
+ }
3163
+ if (bestLabel !== labels[v]) {
3164
+ labels[v] = bestLabel;
3165
+ changed = true;
3166
+ }
3167
+ }
3168
+ if (!changed) break;
3169
+ }
3170
+ const labelMap = /* @__PURE__ */ new Map();
3171
+ let nextLabel = 0;
3172
+ const result = /* @__PURE__ */ new Map();
3173
+ for (let i = 0; i < n; i++) {
3174
+ let lbl = labelMap.get(labels[i]);
3175
+ if (lbl === void 0) {
3176
+ lbl = nextLabel++;
3177
+ labelMap.set(labels[i], lbl);
3178
+ }
3179
+ result.set(csr.nodeIndexToId[i], lbl);
3180
+ }
3181
+ return result;
3182
+ }
3183
+ function buildWeightedGraph(context) {
3184
+ const nodeIdToIdx = /* @__PURE__ */ new Map();
3185
+ context.nodes.forEach((node, i) => nodeIdToIdx.set(node.id, i));
3186
+ const n = context.nodes.length;
3187
+ const adj = Array.from({ length: n }, () => []);
3188
+ const k = new Float64Array(n);
3189
+ const selfLoop = new Float64Array(n);
3190
+ for (const edge of context.edges) {
3191
+ const s = nodeIdToIdx.get(edge.source);
3192
+ const t = nodeIdToIdx.get(edge.target);
3193
+ if (s === void 0 || t === void 0) continue;
3194
+ const w = 1;
3195
+ if (s === t) {
3196
+ selfLoop[s] += w;
3197
+ k[s] += 2 * w;
3198
+ } else {
3199
+ adj[s].push({ to: t, w });
3200
+ adj[t].push({ to: s, w });
3201
+ k[s] += w;
3202
+ k[t] += w;
3203
+ }
3204
+ }
3205
+ let m2 = 0;
3206
+ for (let i = 0; i < n; i++) m2 += k[i];
3207
+ return { n, adj, k, selfLoop, m2 };
3208
+ }
3209
+ function phase1(g, resolution, signal) {
3210
+ const { n, adj, k, m2 } = g;
3211
+ const community = new Int32Array(n);
3212
+ for (let i = 0; i < n; i++) community[i] = i;
3213
+ const commTotalK = new Float64Array(n);
3214
+ for (let i = 0; i < n; i++) commTotalK[i] = k[i];
3215
+ if (m2 === 0) return community;
3216
+ let improved = true;
3217
+ let passes = 0;
3218
+ const maxPasses = 100;
3219
+ while (improved && passes < maxPasses) {
3220
+ checkAborted(signal, "louvain");
3221
+ improved = false;
3222
+ passes++;
3223
+ for (let v = 0; v < n; v++) {
3224
+ const linksToComm = /* @__PURE__ */ new Map();
3225
+ for (const { to, w } of adj[v]) {
3226
+ const c = community[to];
3227
+ linksToComm.set(c, (linksToComm.get(c) ?? 0) + w);
3228
+ }
3229
+ const currComm = community[v];
3230
+ const kv = k[v];
3231
+ commTotalK[currComm] -= kv;
3232
+ let bestComm = currComm;
3233
+ const kvInCurr = linksToComm.get(currComm) ?? 0;
3234
+ let bestGain = 2 * kvInCurr / m2 - resolution * kv * commTotalK[currComm] * 2 / (m2 * m2);
3235
+ for (const [c, kvInC] of linksToComm) {
3236
+ if (c === currComm) continue;
3237
+ const sigmaTot = commTotalK[c];
3238
+ const gain = 2 * kvInC / m2 - resolution * kv * sigmaTot * 2 / (m2 * m2);
3239
+ if (gain > bestGain || // Deterministic tie-break: smaller community id wins
3240
+ gain === bestGain && c < bestComm) {
3241
+ bestGain = gain;
3242
+ bestComm = c;
3243
+ }
3244
+ }
3245
+ commTotalK[bestComm] += kv;
3246
+ if (bestComm !== currComm) {
3247
+ community[v] = bestComm;
3248
+ improved = true;
3249
+ }
3250
+ }
3251
+ }
3252
+ return community;
3253
+ }
3254
+ function phase2(g, community) {
3255
+ const { n, adj, selfLoop } = g;
3256
+ const commMap = /* @__PURE__ */ new Map();
3257
+ let numComms = 0;
3258
+ const mapping = new Int32Array(n);
3259
+ for (let i = 0; i < n; i++) {
3260
+ const c = community[i];
3261
+ let newC = commMap.get(c);
3262
+ if (newC === void 0) {
3263
+ newC = numComms++;
3264
+ commMap.set(c, newC);
3265
+ }
3266
+ mapping[i] = newC;
3267
+ }
3268
+ const aggSelfLoop = new Float64Array(numComms);
3269
+ for (let v = 0; v < n; v++) {
3270
+ aggSelfLoop[mapping[v]] += selfLoop[v];
3271
+ }
3272
+ const intraSum = new Float64Array(numComms);
3273
+ for (let v = 0; v < n; v++) {
3274
+ const cv = mapping[v];
3275
+ for (const { to, w } of adj[v]) {
3276
+ if (mapping[to] === cv) intraSum[cv] += w;
3277
+ }
3278
+ }
3279
+ for (let i = 0; i < numComms; i++) aggSelfLoop[i] += intraSum[i] / 2;
3280
+ const aggAdjMap = Array.from({ length: numComms }, () => /* @__PURE__ */ new Map());
3281
+ for (let v = 0; v < n; v++) {
3282
+ const cv = mapping[v];
3283
+ for (const { to, w } of adj[v]) {
3284
+ const cw = mapping[to];
3285
+ if (cv !== cw) {
3286
+ aggAdjMap[cv].set(cw, (aggAdjMap[cv].get(cw) ?? 0) + w);
3287
+ }
3288
+ }
3289
+ }
3290
+ const aggAdj = aggAdjMap.map(
3291
+ (m) => Array.from(m.entries()).map(([to, w]) => ({ to, w }))
3292
+ );
3293
+ const aggK = new Float64Array(numComms);
3294
+ for (let i = 0; i < numComms; i++) {
3295
+ aggK[i] = 2 * aggSelfLoop[i];
3296
+ for (const { w } of aggAdj[i]) aggK[i] += w;
3297
+ }
3298
+ let aggM2 = 0;
3299
+ for (let i = 0; i < numComms; i++) aggM2 += aggK[i];
3300
+ return {
3301
+ aggregated: {
3302
+ n: numComms,
3303
+ adj: aggAdj,
3304
+ k: aggK,
3305
+ selfLoop: aggSelfLoop,
3306
+ m2: aggM2
3307
+ },
3308
+ mapping
3309
+ };
3310
+ }
3311
+ function louvain(context, options = {}) {
3312
+ const { resolution = 1, signal } = options;
3313
+ const n = context.nodes.length;
3314
+ if (n === 0) return /* @__PURE__ */ new Map();
3315
+ let g = buildWeightedGraph(context);
3316
+ const currentMapping = new Int32Array(n);
3317
+ for (let i = 0; i < n; i++) currentMapping[i] = i;
3318
+ const maxIterations = options.maxIterations ?? 50;
3319
+ let iterations = 0;
3320
+ while (iterations < maxIterations) {
3321
+ checkAborted(signal, "louvain");
3322
+ iterations++;
3323
+ const community = phase1(g, resolution, signal);
3324
+ const distinctComms = /* @__PURE__ */ new Set();
3325
+ for (let i = 0; i < g.n; i++) distinctComms.add(community[i]);
3326
+ if (distinctComms.size === g.n) break;
3327
+ const { aggregated, mapping } = phase2(g, community);
3328
+ for (let i = 0; i < n; i++) {
3329
+ currentMapping[i] = mapping[currentMapping[i]];
3330
+ }
3331
+ g = aggregated;
3332
+ if (g.n <= 1) break;
3333
+ }
3334
+ const labelMap = /* @__PURE__ */ new Map();
3335
+ let nextLabel = 0;
3336
+ const result = /* @__PURE__ */ new Map();
3337
+ for (let i = 0; i < n; i++) {
3338
+ const raw = currentMapping[i];
3339
+ let lbl = labelMap.get(raw);
3340
+ if (lbl === void 0) {
3341
+ lbl = nextLabel++;
3342
+ labelMap.set(raw, lbl);
3343
+ }
3344
+ result.set(context.nodes[i].id, lbl);
3345
+ }
3346
+ return result;
3347
+ }
3348
+ var MinHeap = class {
3349
+ constructor() {
3350
+ this.heap = [];
3351
+ }
3352
+ get size() {
3353
+ return this.heap.length;
3354
+ }
3355
+ push(item) {
3356
+ this.heap.push(item);
3357
+ this._bubbleUp(this.heap.length - 1);
3358
+ }
3359
+ pop() {
3360
+ if (this.heap.length === 0) return null;
3361
+ const top = this.heap[0];
3362
+ const last = this.heap[this.heap.length - 1];
3363
+ this.heap.length--;
3364
+ if (this.heap.length > 0) {
3365
+ this.heap[0] = last;
3366
+ this._bubbleDown(0);
3367
+ }
3368
+ return top;
3369
+ }
3370
+ peek() {
3371
+ return this.heap[0] ?? null;
3372
+ }
3373
+ _bubbleUp(idx) {
3374
+ const h = this.heap;
3375
+ while (idx > 0) {
3376
+ const parent = idx - 1 >>> 1;
3377
+ const current = h[idx];
3378
+ const parentItem = h[parent];
3379
+ if (current === void 0 || parentItem === void 0) break;
3380
+ if (current.cost >= parentItem.cost) break;
3381
+ [h[idx], h[parent]] = [parentItem, current];
3382
+ idx = parent;
3383
+ }
3384
+ }
3385
+ _bubbleDown(idx) {
3386
+ const h = this.heap;
3387
+ const n = h.length;
3388
+ while (true) {
3389
+ const left = 2 * idx + 1;
3390
+ const right = 2 * idx + 2;
3391
+ let smallest = idx;
3392
+ const currentItem = h[smallest];
3393
+ if (currentItem === void 0) break;
3394
+ const leftItem = h[left];
3395
+ const rightItem = h[right];
3396
+ if (left < n && leftItem !== void 0 && leftItem.cost < currentItem.cost) smallest = left;
3397
+ const smallestItem = h[smallest];
3398
+ if (right < n && rightItem !== void 0 && smallestItem !== void 0 && rightItem.cost < smallestItem.cost)
3399
+ smallest = right;
3400
+ if (smallest === idx) break;
3401
+ const swapItem = h[smallest];
3402
+ if (swapItem === void 0) break;
3403
+ [h[idx], h[smallest]] = [swapItem, currentItem];
3404
+ idx = smallest;
3405
+ }
3406
+ }
3407
+ };
3408
+ function shortestPath(context, options) {
3409
+ const { source, target, weightProperty, direction = "any" } = options;
3410
+ if (source === target) {
3411
+ if (!context.nodes.some((n2) => n2.id === source)) return null;
3412
+ return { nodes: [source], edges: [], totalWeight: 0 };
3413
+ }
3414
+ const csr = buildCSR(context, { direction, weightProperty });
3415
+ const sIdx = csr.nodeIdToIndex.get(source);
3416
+ const tIdx = csr.nodeIdToIndex.get(target);
3417
+ if (sIdx === void 0 || tIdx === void 0) return null;
3418
+ if (weightProperty) {
3419
+ for (let k = 0; k < csr.weights.length; k++) {
3420
+ if (csr.weights[k] < 0) {
3421
+ const edgeIdx = csr.edgeIdx[k];
3422
+ throw new NegativeWeightError(csr.edgeIndexToId[edgeIdx], csr.weights[k], "shortestPath");
3423
+ }
3424
+ }
3425
+ }
3426
+ const n = csr.n;
3427
+ const dist = new Float64Array(n).fill(Infinity);
3428
+ const prevNode = new Int32Array(n).fill(-1);
3429
+ const prevEdge = new Int32Array(n).fill(-1);
3430
+ if (!weightProperty) {
3431
+ dist[sIdx] = 0;
3432
+ const queue = new Uint32Array(n);
3433
+ queue[0] = sIdx;
3434
+ let qHead = 0;
3435
+ let qTail = 1;
3436
+ while (qHead < qTail) {
3437
+ const v = queue[qHead++];
3438
+ if (v === tIdx) break;
3439
+ for (let k = csr.rowPtr[v]; k < csr.rowPtr[v + 1]; k++) {
3440
+ const w = csr.colIdx[k];
3441
+ if (dist[w] === Infinity) {
3442
+ dist[w] = dist[v] + 1;
3443
+ prevNode[w] = v;
3444
+ prevEdge[w] = csr.edgeIdx[k];
3445
+ queue[qTail++] = w;
3446
+ }
3447
+ }
3448
+ }
3449
+ } else {
3450
+ dist[sIdx] = 0;
3451
+ const heap = new MinHeap();
3452
+ heap.push({ cost: 0, node: sIdx });
3453
+ while (heap.size > 0) {
3454
+ const top = heap.pop();
3455
+ if (top.cost > dist[top.node]) continue;
3456
+ if (top.node === tIdx) break;
3457
+ for (let k = csr.rowPtr[top.node]; k < csr.rowPtr[top.node + 1]; k++) {
3458
+ const w = csr.colIdx[k];
3459
+ const newDist = top.cost + csr.weights[k];
3460
+ if (newDist < dist[w]) {
3461
+ dist[w] = newDist;
3462
+ prevNode[w] = top.node;
3463
+ prevEdge[w] = csr.edgeIdx[k];
3464
+ heap.push({ cost: newDist, node: w });
3465
+ }
3466
+ }
3467
+ }
3468
+ }
3469
+ if (dist[tIdx] === Infinity) return null;
3470
+ const nodes = [];
3471
+ const edges = [];
3472
+ let cur = tIdx;
3473
+ while (cur !== sIdx) {
3474
+ nodes.push(csr.nodeIndexToId[cur]);
3475
+ edges.push(csr.edgeIndexToId[prevEdge[cur]]);
3476
+ cur = prevNode[cur];
3477
+ }
3478
+ nodes.push(csr.nodeIndexToId[sIdx]);
3479
+ nodes.reverse();
3480
+ edges.reverse();
3481
+ return { nodes, edges, totalWeight: dist[tIdx] };
3482
+ }
3483
+ function kShortestPaths(context, options) {
3484
+ const { source, target, k, weightProperty, direction = "any" } = options;
3485
+ if (k <= 0) return [];
3486
+ const first = shortestPath(context, { source, target, weightProperty, direction });
3487
+ if (!first) return [];
3488
+ const A = [first];
3489
+ const B = [];
3490
+ const edgeWeightMap = /* @__PURE__ */ new Map();
3491
+ if (weightProperty) {
3492
+ for (const edge of context.edges) {
3493
+ const raw = edge.properties[weightProperty];
3494
+ const w = typeof raw === "number" ? raw : parseFloat(String(raw));
3495
+ edgeWeightMap.set(edge.id, isFinite(w) ? w : 1);
3496
+ }
3497
+ }
3498
+ for (let i = 1; i < k; i++) {
3499
+ const prev = A[i - 1];
3500
+ if (!prev) break;
3501
+ for (let spurIdx = 0; spurIdx < prev.nodes.length - 1; spurIdx++) {
3502
+ const spurNode = prev.nodes[spurIdx];
3503
+ const rootPath = prev.nodes.slice(0, spurIdx + 1);
3504
+ const removedEdgeIds = /* @__PURE__ */ new Set();
3505
+ for (const p of A) {
3506
+ if (p.nodes.length <= spurIdx) continue;
3507
+ const prefix = p.nodes.slice(0, spurIdx + 1);
3508
+ if (prefix.every((id, idx) => id === rootPath[idx])) {
3509
+ removedEdgeIds.add(p.edges[spurIdx]);
3510
+ }
3511
+ }
3512
+ const removedNodeIds = new Set(rootPath.slice(0, -1));
3513
+ const subContext = {
3514
+ nodes: context.nodes.filter((n) => !removedNodeIds.has(n.id)),
3515
+ edges: context.edges.filter(
3516
+ (e) => !removedEdgeIds.has(e.id) && !removedNodeIds.has(e.source) && !removedNodeIds.has(e.target)
3517
+ )
3518
+ };
3519
+ const spurPath = shortestPath(subContext, {
3520
+ source: spurNode,
3521
+ target,
3522
+ weightProperty,
3523
+ direction
3524
+ });
3525
+ if (spurPath) {
3526
+ const totalNodes = [...rootPath.slice(0, -1), ...spurPath.nodes];
3527
+ const totalEdges = [...prev.edges.slice(0, spurIdx), ...spurPath.edges];
3528
+ let w;
3529
+ if (weightProperty) {
3530
+ w = 0;
3531
+ for (const eid of totalEdges) {
3532
+ w += edgeWeightMap.get(eid) ?? 1;
3533
+ }
3534
+ } else {
3535
+ w = totalEdges.length;
3536
+ }
3537
+ const key = totalNodes.join(">");
3538
+ if (!B.some((p) => p.nodes.join(">") === key)) {
3539
+ B.push({ nodes: totalNodes, edges: totalEdges, totalWeight: w });
3540
+ }
3541
+ }
3542
+ }
3543
+ if (B.length === 0) break;
3544
+ B.sort((a, b) => a.totalWeight - b.totalWeight);
3545
+ A.push(B.shift());
3546
+ }
3547
+ return A;
3548
+ }
3549
+ function triangleCount(context, _options = {}) {
3550
+ const csr = buildCSR(context, { direction: "any" });
3551
+ const n = csr.n;
3552
+ const result = /* @__PURE__ */ new Map();
3553
+ const neighborSet = new Uint8Array(n);
3554
+ for (let v = 0; v < n; v++) {
3555
+ for (let k = csr.rowPtr[v]; k < csr.rowPtr[v + 1]; k++) {
3556
+ neighborSet[csr.colIdx[k]] = 1;
3557
+ }
3558
+ let count = 0;
3559
+ for (let ki = csr.rowPtr[v]; ki < csr.rowPtr[v + 1]; ki++) {
3560
+ const u = csr.colIdx[ki];
3561
+ if (u === v) continue;
3562
+ for (let kj = csr.rowPtr[u]; kj < csr.rowPtr[u + 1]; kj++) {
3563
+ const w = csr.colIdx[kj];
3564
+ if (w !== v && neighborSet[w]) count++;
3565
+ }
3566
+ }
3567
+ result.set(csr.nodeIndexToId[v], count / 2);
3568
+ for (let k = csr.rowPtr[v]; k < csr.rowPtr[v + 1]; k++) {
3569
+ neighborSet[csr.colIdx[k]] = 0;
3570
+ }
3571
+ }
3572
+ return result;
3573
+ }
3574
+ function clusteringCoefficient(context, options = {}) {
3575
+ const triangles = triangleCount(context, options);
3576
+ const csr = buildCSR(context, { direction: "any" });
3577
+ const result = /* @__PURE__ */ new Map();
3578
+ for (let i = 0; i < csr.n; i++) {
3579
+ const d = csr.rowPtr[i + 1] - csr.rowPtr[i];
3580
+ const id = csr.nodeIndexToId[i];
3581
+ if (d < 2) {
3582
+ result.set(id, 0);
3583
+ } else {
3584
+ const t = triangles.get(id) ?? 0;
3585
+ result.set(id, 2 * t / (d * (d - 1)));
3586
+ }
3587
+ }
3588
+ return result;
3589
+ }
3590
+ function betweenness(context, options = {}) {
3591
+ const { normalized = true, signal, onProgress } = options;
3592
+ const csr = buildCSR(context, { direction: "any" });
3593
+ const n = csr.n;
3594
+ if (n === 0) return /* @__PURE__ */ new Map();
3595
+ const central = new Float64Array(n);
3596
+ const stack = new Uint32Array(n);
3597
+ const predecessors = Array.from({ length: n }, () => []);
3598
+ const sigma = new Float64Array(n);
3599
+ const dist = new Int32Array(n);
3600
+ const delta = new Float64Array(n);
3601
+ const queue = new Uint32Array(n);
3602
+ for (let s = 0; s < n; s++) {
3603
+ checkAborted(signal, "betweenness");
3604
+ if (onProgress && s % 100 === 0) onProgress(s / n);
3605
+ let stackLen = 0;
3606
+ for (let i = 0; i < n; i++) {
3607
+ predecessors[i].length = 0;
3608
+ sigma[i] = 0;
3609
+ dist[i] = -1;
3610
+ delta[i] = 0;
3611
+ }
3612
+ sigma[s] = 1;
3613
+ dist[s] = 0;
3614
+ queue[0] = s;
3615
+ let qHead = 0;
3616
+ let qTail = 1;
3617
+ while (qHead < qTail) {
3618
+ const v = queue[qHead++];
3619
+ stack[stackLen++] = v;
3620
+ const rowEnd = csr.rowPtr[v + 1];
3621
+ for (let k = csr.rowPtr[v]; k < rowEnd; k++) {
3622
+ const w = csr.colIdx[k];
3623
+ if (dist[w] < 0) {
3624
+ dist[w] = dist[v] + 1;
3625
+ queue[qTail++] = w;
3626
+ }
3627
+ if (dist[w] === dist[v] + 1) {
3628
+ sigma[w] += sigma[v];
3629
+ predecessors[w].push(v);
3630
+ }
3631
+ }
3632
+ }
3633
+ while (stackLen > 0) {
3634
+ const w = stack[--stackLen];
3635
+ const sw = sigma[w];
3636
+ const coeff = (1 + delta[w]) / (sw || 1);
3637
+ const preds = predecessors[w];
3638
+ for (let j = 0; j < preds.length; j++) {
3639
+ const pred = preds[j];
3640
+ delta[pred] += sigma[pred] * coeff;
3641
+ }
3642
+ if (w !== s) central[w] += delta[w];
3643
+ }
3644
+ }
3645
+ for (let i = 0; i < n; i++) central[i] /= 2;
3646
+ if (normalized && n > 2) {
3647
+ const scale = 2 / ((n - 1) * (n - 2));
3648
+ for (let i = 0; i < n; i++) central[i] *= scale;
3649
+ }
3650
+ const result = /* @__PURE__ */ new Map();
3651
+ for (let i = 0; i < n; i++) result.set(csr.nodeIndexToId[i], central[i]);
3652
+ return result;
3653
+ }
3654
+ function bfsFromSource(csr, source, options = {}) {
3655
+ const { n, rowPtr, colIdx } = csr;
3656
+ const dist = new Int32Array(n).fill(-1);
3657
+ const order = new Uint32Array(n);
3658
+ const predecessors = options.recordPredecessors ? Array.from({ length: n }, () => []) : void 0;
3659
+ const sigma = options.recordSigma ? new Float64Array(n) : void 0;
3660
+ dist[source] = 0;
3661
+ if (sigma) sigma[source] = 1;
3662
+ order[0] = source;
3663
+ let orderLen = 1;
3664
+ const queue = new Uint32Array(n);
3665
+ queue[0] = source;
3666
+ let qHead = 0;
3667
+ let qTail = 1;
3668
+ while (qHead < qTail) {
3669
+ const v = queue[qHead++];
3670
+ const rowEnd = rowPtr[v + 1];
3671
+ for (let k = rowPtr[v]; k < rowEnd; k++) {
3672
+ const w = colIdx[k];
3673
+ if (dist[w] < 0) {
3674
+ dist[w] = dist[v] + 1;
3675
+ queue[qTail++] = w;
3676
+ order[orderLen++] = w;
3677
+ }
3678
+ if (dist[w] === dist[v] + 1) {
3679
+ if (sigma) sigma[w] += sigma[v];
3680
+ if (predecessors) predecessors[w].push(v);
3681
+ }
3682
+ }
3683
+ }
3684
+ return {
3685
+ dist,
3686
+ order: order.slice(0, orderLen),
3687
+ predecessors,
3688
+ sigma
3689
+ };
3690
+ }
3691
+ function closeness(context, options = {}) {
3692
+ const { signal, onProgress } = options;
3693
+ const csr = buildCSR(context, { direction: "any" });
3694
+ const n = csr.n;
3695
+ if (n === 0) return /* @__PURE__ */ new Map();
3696
+ const result = /* @__PURE__ */ new Map();
3697
+ for (let s = 0; s < n; s++) {
3698
+ checkAborted(signal, "closeness");
3699
+ if (onProgress && s % 100 === 0) onProgress(s / n);
3700
+ const { dist } = bfsFromSource(csr, s);
3701
+ let sumDist = 0;
3702
+ let reachable = 0;
3703
+ for (let i = 0; i < n; i++) {
3704
+ if (dist[i] >= 0) {
3705
+ sumDist += dist[i];
3706
+ reachable++;
3707
+ }
3708
+ }
3709
+ let c = 0;
3710
+ if (sumDist > 0 && reachable > 1) {
3711
+ c = (reachable - 1) * (reachable - 1) / ((n - 1) * sumDist);
3712
+ }
3713
+ result.set(csr.nodeIndexToId[s], c);
3714
+ }
3715
+ return result;
3716
+ }
3717
+
3718
+ // src/algorithms/AlgorithmWorker.ts
3719
+ function postResult(jobId, result) {
3720
+ const msg = { type: "result", jobId, result };
3721
+ self.postMessage(msg);
3722
+ }
3723
+ function postError(jobId, error) {
3724
+ const err = error instanceof Error ? error : new Error(String(error));
3725
+ const msg = {
3726
+ type: "error",
3727
+ jobId,
3728
+ message: err.message,
3729
+ stack: err.stack,
3730
+ errorName: err.name
3731
+ };
3732
+ self.postMessage(msg);
3733
+ }
3734
+ function makeProgressCallback(jobId) {
3735
+ return (pct) => {
3736
+ const msg = { type: "progress", jobId, pct };
3737
+ self.postMessage(msg);
3738
+ };
3739
+ }
3740
+ self.onmessage = (e) => {
3741
+ const req = e.data;
3742
+ const onProgress = makeProgressCallback(req.jobId);
3743
+ try {
3744
+ switch (req.type) {
3745
+ case "pageRank": {
3746
+ const opts = { ...req.options, onProgress };
3747
+ postResult(req.jobId, pageRank(req.context, opts));
3748
+ break;
3749
+ }
3750
+ case "eigenvector": {
3751
+ const opts = { ...req.options, onProgress };
3752
+ postResult(req.jobId, eigenvectorCentrality(req.context, opts));
3753
+ break;
3754
+ }
3755
+ case "hits": {
3756
+ const opts = { ...req.options, onProgress };
3757
+ postResult(req.jobId, hits(req.context, opts));
3758
+ break;
3759
+ }
3760
+ case "connectedComponent": {
3761
+ const opts = { ...req.options, onProgress };
3762
+ postResult(req.jobId, connectedComponent(req.context, opts));
3763
+ break;
3764
+ }
3765
+ case "triangleCount": {
3766
+ const opts = { ...req.options, onProgress };
3767
+ postResult(req.jobId, triangleCount(req.context, opts));
3768
+ break;
3769
+ }
3770
+ case "clusteringCoefficient": {
3771
+ const opts = { ...req.options, onProgress };
3772
+ postResult(req.jobId, clusteringCoefficient(req.context, opts));
3773
+ break;
3774
+ }
3775
+ case "betweenness": {
3776
+ const opts = { ...req.options, onProgress };
3777
+ postResult(req.jobId, betweenness(req.context, opts));
3778
+ break;
3779
+ }
3780
+ case "closeness": {
3781
+ const opts = { ...req.options, onProgress };
3782
+ postResult(req.jobId, closeness(req.context, opts));
3783
+ break;
3784
+ }
3785
+ case "stronglyConnectedComponent": {
3786
+ const opts = { ...req.options, onProgress };
3787
+ postResult(req.jobId, stronglyConnectedComponent(req.context, opts));
3788
+ break;
3789
+ }
3790
+ case "labelPropagation": {
3791
+ const opts = { ...req.options, onProgress };
3792
+ postResult(req.jobId, labelPropagation(req.context, opts));
3793
+ break;
3794
+ }
3795
+ case "louvain": {
3796
+ const opts = { ...req.options, onProgress };
3797
+ postResult(req.jobId, louvain(req.context, opts));
3798
+ break;
3799
+ }
3800
+ case "kShortestPaths": {
3801
+ const opts = { ...req.options, onProgress };
3802
+ postResult(req.jobId, kShortestPaths(req.context, opts));
3803
+ break;
3804
+ }
3805
+ default: {
3806
+ const _exhaustive = req;
3807
+ postError("unknown", new Error(\`Unknown algorithm type: \${JSON.stringify(_exhaustive)}\`));
3808
+ }
3809
+ }
3810
+ } catch (err) {
3811
+ postError(req.jobId, err);
3812
+ }
3813
+ };
3814
+ `;var $n=null;function Y1(){if($n)return $n;let n=new Blob([Xa],{type:"application/javascript"});return $n=URL.createObjectURL(n),$n}var Zn=class{constructor(){this.worker=null;this.pending=new Map}ensureWorker(){return this.worker?this.worker:(this.worker=new Worker(Y1(),{type:"module"}),this.worker.onmessage=e=>{this.handleMessage(e.data)},this.worker.onerror=e=>{let t=new Error(`Algorithm worker crashed: ${e.message||"(no message)"}`);for(let{reject:o}of this.pending.values())o(t);this.pending.clear(),this.worker?.terminate(),this.worker=null},this.worker)}handleMessage(e){let t=this.pending.get(e.jobId);if(t){if(e.type==="result")this.pending.delete(e.jobId),t.resolve(e.result);else if(e.type==="progress")t.onProgress?.(e.pct);else if(e.type==="error"){this.pending.delete(e.jobId);let o=new Error(e.message);o.name=e.errorName??"Error",e.stack&&(o.stack=e.stack),t.reject(o)}}}run(e,t){let o=this.ensureWorker();return new Promise((r,i)=>{this.pending.set(e.jobId,{resolve:r,reject:i,onProgress:t?.onProgress}),o.postMessage(e)})}terminate(){this.worker?.terminate(),this.worker=null;let e=new Error("Algorithm worker terminated");e.name="AbortError";for(let{reject:t}of this.pending.values())t(e);this.pending.clear()}};var Qn=class{constructor(e,t,o){this.type="ApplyAlgorithmResult";this.oldValues=new Map;this.wasInAlgorithmSet=!1;this.store=e,this.propertyKey=t,this.newValues=new Map(o)}execute(){for(let[t]of this.newValues){let o=this.store.index.nodeIdToIndex.get(t);o!==void 0&&this.oldValues.set(t,this.store.data.nodes[o].properties[this.propertyKey])}this.wasInAlgorithmSet=this.store.hasAlgorithmProperty(this.propertyKey);let e=Array.from(this.newValues.entries()).map(([t,o])=>({id:t,previous:{properties:{[this.propertyKey]:this.oldValues.get(t)??null}},next:{properties:{[this.propertyKey]:o}}}));this.store.applyDelta({updatedNodes:e}),this.store.addAlgorithmProperty(this.propertyKey),this.store.notifyChange()}undo(){let e=Array.from(this.newValues.entries()).map(([t])=>({id:t,previous:{properties:{[this.propertyKey]:this.newValues.get(t)}},next:{properties:{[this.propertyKey]:this.oldValues.get(t)??null}}}));this.store.applyDelta({updatedNodes:e}),this.wasInAlgorithmSet||this.store.removeAlgorithmProperty(this.propertyKey),this.store.notifyChange()}};var $a=class extends Error{constructor(n,e,t){super(`Property "${n}" already exists on ${e} nodes and was not produced by an algorithm run. To replace it, pass { overwrite: true } or use a different writeTo key. (Caught while running "${t}".)`),this.propertyKey=n,this.affectedNodeCount=e,this.algorithm=t,this.name="PropertyCollisionError"}},X1=class extends Error{constructor(n,e,t){super(`Algorithm "${t}" requires non-negative edge weights, but edge "${n}" has weight ${e}.`),this.edgeId=n,this.weight=e,this.algorithm=t,this.name="NegativeWeightError"}};function $1(n){if(n==null)return 1;let e=typeof n=="number"?n:parseFloat(String(n));return isFinite(e)?e:1}function Qt(n,e){let{direction:t,weightProperty:o}=e,r=n.nodes.length,i=new Map,a=new Array(r);for(let h=0;h<r;h++){let b=n.nodes[h];b!==void 0&&(i.set(b.id,h),a[h]=b.id)}let s=new Map,l=new Array(n.edges.length),u=[];for(let h=0;h<n.edges.length;h++){let b=n.edges[h];if(b===void 0)continue;s.set(b.id,h),l[h]=b.id;let f=i.get(b.source),w=i.get(b.target);if(f===void 0||w===void 0)continue;let x=o?$1(b.properties[o]):1;u.push({s:f,t:w,w:x,origIdx:h})}let c=new Uint32Array(r);for(let h of u)t==="any"?(c[h.s]++,c[h.t]++):t==="out"?c[h.s]++:c[h.t]++;let p=new Uint32Array(r+1);for(let h=0;h<r;h++)p[h+1]=p[h]+(c[h]??0);let d=p[r]??0,g=new Uint32Array(d),m=new Uint32Array(d),y=new Float32Array(d),v=new Uint32Array(r);for(let h of u){if(t==="any"||t==="out"){let b=(p[h.s]??0)+(v[h.s]??0);v[h.s]++,g[b]=h.t,m[b]=h.origIdx,y[b]=h.w}if(t==="any"||t==="in"){let b=(p[h.t]??0)+(v[h.t]??0);v[h.t]++,g[b]=h.s,m[b]=h.origIdx,y[b]=h.w}}return{n:r,m:d,rowPtr:p,colIdx:g,edgeIdx:m,weights:y,nodeIdToIndex:i,nodeIndexToId:a,edgeIdToIndex:s,edgeIndexToId:l}}function Za(n,e={}){let t=Qt(n,{direction:e.direction??"any"}),o=new Map;for(let r=0;r<t.n;r++){let i=t.rowPtr[r+1]-t.rowPtr[r];o.set(t.nodeIndexToId[r],i)}return o}function Qa(n,e){let{source:t,maxDepth:o=1/0,direction:r="any"}=e,i=Qt(n,{direction:r}),a=i.nodeIdToIndex.get(t);if(a===void 0)return{visited:new Set,order:[]};let s=new Int32Array(i.n).fill(-1),l=[],u=new Set;s[a]=0;let c=new Uint32Array(i.n);c[0]=a;let p=0,d=1;for(;p<d;){let g=c[p++];if(l.push(i.nodeIndexToId[g]),u.add(i.nodeIndexToId[g]),!(s[g]>=o))for(let m=i.rowPtr[g];m<i.rowPtr[g+1];m++){let y=i.colIdx[m];s[y]<0&&(s[y]=s[g]+1,c[d++]=y)}}return{visited:u,order:l}}function Ja(n,e){let{source:t,direction:o="any"}=e,r=Qt(n,{direction:o}),i=r.nodeIdToIndex.get(t);if(i===void 0)return{visited:new Set,order:[]};let a=new Uint8Array(r.n),s=[],l=[i,r.rowPtr[i]];for(a[i]=1,s.push(r.nodeIndexToId[i]);l.length>0;){let c=l[l.length-1],p=l[l.length-2];if(c>=r.rowPtr[p+1]){l.pop(),l.pop();continue}l[l.length-1]=c+1;let d=r.colIdx[c];a[d]||(a[d]=1,s.push(r.nodeIndexToId[d]),l.push(d,r.rowPtr[d]))}let u=new Set;for(let c=0;c<r.n;c++)a[c]&&u.add(r.nodeIndexToId[c]);return{visited:u,order:s}}var es=class{constructor(){this.heap=[]}get size(){return this.heap.length}push(n){this.heap.push(n),this._bubbleUp(this.heap.length-1)}pop(){if(this.heap.length===0)return null;let n=this.heap[0],e=this.heap[this.heap.length-1];return this.heap.length--,this.heap.length>0&&(this.heap[0]=e,this._bubbleDown(0)),n}peek(){return this.heap[0]??null}_bubbleUp(n){let e=this.heap;for(;n>0;){let t=n-1>>>1,o=e[n],r=e[t];if(o===void 0||r===void 0||o.cost>=r.cost)break;[e[n],e[t]]=[r,o],n=t}}_bubbleDown(n){let e=this.heap,t=e.length;for(;;){let o=2*n+1,r=2*n+2,i=n,a=e[i];if(a===void 0)break;let s=e[o],l=e[r];o<t&&s!==void 0&&s.cost<a.cost&&(i=o);let u=e[i];if(r<t&&l!==void 0&&u!==void 0&&l.cost<u.cost&&(i=r),i===n)break;let c=e[i];if(c===void 0)break;[e[n],e[i]]=[c,a],n=i}}};function ts(n,e){let{source:t,target:o,weightProperty:r,direction:i="any"}=e;if(t===o)return n.nodes.some(v=>v.id===t)?{nodes:[t],edges:[],totalWeight:0}:null;let a=Qt(n,{direction:i,weightProperty:r}),s=a.nodeIdToIndex.get(t),l=a.nodeIdToIndex.get(o);if(s===void 0||l===void 0)return null;if(r){for(let v=0;v<a.weights.length;v++)if(a.weights[v]<0){let h=a.edgeIdx[v];throw new X1(a.edgeIndexToId[h],a.weights[v],"shortestPath")}}let u=a.n,c=new Float64Array(u).fill(1/0),p=new Int32Array(u).fill(-1),d=new Int32Array(u).fill(-1);if(r){c[s]=0;let v=new es;for(v.push({cost:0,node:s});v.size>0;){let h=v.pop();if(!(h.cost>c[h.node])){if(h.node===l)break;for(let b=a.rowPtr[h.node];b<a.rowPtr[h.node+1];b++){let f=a.colIdx[b],w=h.cost+a.weights[b];w<c[f]&&(c[f]=w,p[f]=h.node,d[f]=a.edgeIdx[b],v.push({cost:w,node:f}))}}}}else{c[s]=0;let v=new Uint32Array(u);v[0]=s;let h=0,b=1;for(;h<b;){let f=v[h++];if(f===l)break;for(let w=a.rowPtr[f];w<a.rowPtr[f+1];w++){let x=a.colIdx[w];c[x]===1/0&&(c[x]=c[f]+1,p[x]=f,d[x]=a.edgeIdx[w],v[b++]=x)}}}if(c[l]===1/0)return null;let g=[],m=[],y=l;for(;y!==s;)g.push(a.nodeIndexToId[y]),m.push(a.edgeIndexToId[d[y]]),y=p[y];return g.push(a.nodeIndexToId[s]),g.reverse(),m.reverse(),{nodes:g,edges:m,totalWeight:c[l]}}function ns(n,e){let{source:t,target:o,heuristic:r,weightProperty:i,direction:a="any"}=e;if(t===o)return n.nodes.some(b=>b.id===t)?{nodes:[t],edges:[],totalWeight:0}:null;let s=Qt(n,{direction:a,weightProperty:i}),l=s.nodeIdToIndex.get(t),u=s.nodeIdToIndex.get(o);if(l===void 0||u===void 0)return null;let c=s.n,p=new Float64Array(c).fill(1/0),d=new Int32Array(c).fill(-1),g=new Int32Array(c).fill(-1);p[l]=0;let m=new es;for(m.push({cost:r(t,o),node:l});m.size>0;){let b=m.pop();if(b.node===u)break;let f=p[b.node];for(let w=s.rowPtr[b.node];w<s.rowPtr[b.node+1];w++){let x=s.colIdx[w],S=f+s.weights[w];if(S<p[x]){p[x]=S,d[x]=b.node,g[x]=s.edgeIdx[w];let A=S+r(s.nodeIndexToId[x],o);m.push({cost:A,node:x})}}}if(p[u]===1/0)return null;let y=[],v=[],h=u;for(;h!==l;)y.push(s.nodeIndexToId[h]),v.push(s.edgeIndexToId[g[h]]),h=d[h];return y.push(s.nodeIndexToId[l]),y.reverse(),v.reverse(),{nodes:y,edges:v,totalWeight:p[u]}}var Z1=0;function Q1(){return`algo-${Date.now()}-${Z1++}`}var Jn=class{constructor(e,t,o,r,i){this.store=e,this.executor=t,this.eventBus=o,this.selection=r,this.worker=i??new Zn,this.centrality=new qn(this),this.community=new Kn(this),this.paths=new Yn(this),this.metrics=new Xn(this)}buildContext(e){let t=this.store.data.nodes,o=e?t.filter(a=>e.includes(a.id)):t,r=new Set(o.map(a=>a.id)),i=e?this.store.data.edges.filter(a=>r.has(a.source)&&r.has(a.target)):this.store.data.edges;return{nodes:o,edges:i}}checkCollision(e,t,o){if(o||this.store.hasAlgorithmProperty(t))return;let r=0;for(let i of this.store.data.nodes)i.properties[t]!=null&&r++;if(r>0)throw new $a(t,r,e)}async runHeavy(e,t,o){let r=Q1(),i=Date.now();this.eventBus.emit("algorithm:start",{algo:e,jobId:r,nodeCount:t.nodes.length,edgeCount:t.edges.length});try{let a=await this.worker.run(o(r),{onProgress:s=>this.eventBus.emit("algorithm:progress",{algo:e,jobId:r,pct:s})});return this.eventBus.emit("algorithm:end",{algo:e,jobId:r,duration:Date.now()-i}),a}catch(a){let s=a instanceof Error?a:new Error(String(a));throw s.name==="AbortError"?this.eventBus.emit("algorithm:cancelled",{algo:e,jobId:r}):this.eventBus.emit("algorithm:error",{algo:e,jobId:r,error:s}),s}}applyResult(e,t){let o=new Qn(this.store,e,t);this.executor.execute(o)}async pageRank(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("pageRank",t,o);let a=this.buildContext(r),s=await this.runHeavy("pageRank",a,l=>({type:"pageRank",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async eigenvectorCentrality(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("eigenvector",t,o);let a=this.buildContext(r),s=await this.runHeavy("eigenvector",a,l=>({type:"eigenvector",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async hits(e={}){let{writeHubsTo:t,writeAuthsTo:o,overwrite:r=!1,nodeIds:i,...a}=e;t&&this.checkCollision("hits",t,r),o&&this.checkCollision("hits",o,r);let s=this.buildContext(i),l=await this.runHeavy("hits",s,u=>({type:"hits",jobId:u,context:s,options:a}));return t&&this.applyResult(t,l.hubs),o&&this.applyResult(o,l.authorities),l}async betweenness(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("betweenness",t,o);let a=this.buildContext(r),s=await this.runHeavy("betweenness",a,l=>({type:"betweenness",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async closeness(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("closeness",t,o);let a=this.buildContext(r),s=await this.runHeavy("closeness",a,l=>({type:"closeness",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async connectedComponent(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("connectedComponent",t,o);let a=this.buildContext(r),s=await this.runHeavy("connectedComponent",a,l=>({type:"connectedComponent",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async stronglyConnectedComponent(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("stronglyConnectedComponent",t,o);let a=this.buildContext(r),s=await this.runHeavy("stronglyConnectedComponent",a,l=>({type:"stronglyConnectedComponent",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async labelPropagation(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("labelPropagation",t,o);let a=this.buildContext(r),s=await this.runHeavy("labelPropagation",a,l=>({type:"labelPropagation",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async louvain(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("louvain",t,o);let a=this.buildContext(r),s=await this.runHeavy("louvain",a,l=>({type:"louvain",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async triangleCount(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("triangleCount",t,o);let a=this.buildContext(r),s=await this.runHeavy("triangleCount",a,l=>({type:"triangleCount",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}async clusteringCoefficient(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("clusteringCoefficient",t,o);let a=this.buildContext(r),s=await this.runHeavy("clusteringCoefficient",a,l=>({type:"clusteringCoefficient",jobId:l,context:a,options:i}));return t&&this.applyResult(t,s),s}degree(e={}){let{writeTo:t,overwrite:o=!1,nodeIds:r,...i}=e;t&&this.checkCollision("degree",t,o);let a=this.buildContext(r),s=Za(a,i);return t&&this.applyResult(t,s),s}shortestPath(e){let{selectResult:t,nodeIds:o,...r}=e,i=this.buildContext(o),a=ts(i,r);return a&&t&&(this.selection.selectNodes(a.nodes,"replace"),this.selection.selectEdges(a.edges)),a}async kShortestPaths(e){let{nodeIds:t,...o}=e,r=this.buildContext(t);return this.runHeavy("kShortestPaths",r,i=>({type:"kShortestPaths",jobId:i,context:r,options:o}))}aStar(e){let{selectResult:t,nodeIds:o,...r}=e,i=this.buildContext(o),a=ns(i,r);return a&&t&&(this.selection.selectNodes(a.nodes,"replace"),this.selection.selectEdges(a.edges)),a}bfs(e){let{nodeIds:t,...o}=e,r=this.buildContext(t);return Qa(r,o)}dfs(e){let{nodeIds:t,...o}=e,r=this.buildContext(t);return Ja(r,o)}dispose(){this.worker.terminate()}};function os(n){return{nodes:n.nodes.map(e=>({id:e.id,category:e.category,...e.labels!==void 0?{labels:[...e.labels]}:{},...e.tags!==void 0?{tags:[...e.tags]}:{},properties:{...e.properties}})),edges:n.edges.map(e=>({id:e.id,source:e.source,target:e.target,relationship:e.relationship,properties:{...e.properties}}))}}function no(n){let e=n.nodeState,t=n.edgeState,o=n.positionProvider?.getPositions()??null;return{data:os(n.data),nodeState:e?{colors:new Float32Array(e.colors),sizes:new Float32Array(e.sizes),opacities:new Float32Array(e.opacities),icons:new Float32Array(e.icons),imageIndices:new Float32Array(e.imageIndices),selected:new Float32Array(e.selected),highlighted:new Float32Array(e.highlighted),hovered:new Float32Array(e.hovered),pinned:new Float32Array(e.pinned),hidden:new Float32Array(e.hidden),collection:new Float32Array(e.collection),iconUVs:new Float32Array(e.iconUVs),imageUVs:new Float32Array(e.imageUVs),ripple:new Float32Array(e.ripple),breathe:new Float32Array(e.breathe),shapeIds:new Float32Array(e.shapeIds),aspects:new Float32Array(e.aspects),overrides:new Float32Array(e.overrides)}:null,edgeState:t?{colors:new Float32Array(t.colors),widths:new Float32Array(t.widths),opacities:new Float32Array(t.opacities),selected:new Float32Array(t.selected),highlighted:new Float32Array(t.highlighted),dashed:new Float32Array(t.dashed),shapes:new Float32Array(t.shapes),bends:new Float32Array(t.bends),flow:new Float32Array(t.flow),glow:new Float32Array(t.glow)}:null,positions:o?new Float32Array(o):null,iconNames:new Map(n.iconNames),imageUrls:new Map(n.imageUrls),defaultNodeSize:n.defaultNodeSize,edgeArrowVisible:n.edgeArrowVisible,edgeScale:n.edgeScale,defaultEdgeShape:n.defaultEdgeShape,...n._snapshotDecorationsForUndo()}}function eo(n,e){n.setData(os(e.data)),n.defaultNodeSize=e.defaultNodeSize,n.edgeArrowVisible=e.edgeArrowVisible,n.edgeScale=e.edgeScale,n.defaultEdgeShape=e.defaultEdgeShape;let t=n.nodeState;if(t&&e.nodeState){let i=n.data.nodes.length;t.colors.set(e.nodeState.colors.subarray(0,i*3)),t.sizes.set(e.nodeState.sizes.subarray(0,i)),t.opacities.set(e.nodeState.opacities.subarray(0,i)),t.icons.set(e.nodeState.icons.subarray(0,i)),t.imageIndices.set(e.nodeState.imageIndices.subarray(0,i)),t.selected.set(e.nodeState.selected.subarray(0,i)),t.highlighted.set(e.nodeState.highlighted.subarray(0,i)),t.hovered.set(e.nodeState.hovered.subarray(0,i)),t.pinned.set(e.nodeState.pinned.subarray(0,i)),t.hidden.set(e.nodeState.hidden.subarray(0,i)),t.collection.set(e.nodeState.collection.subarray(0,i)),t.iconUVs.set(e.nodeState.iconUVs.subarray(0,i*4)),t.imageUVs.set(e.nodeState.imageUVs.subarray(0,i*4)),t.ripple.set(e.nodeState.ripple.subarray(0,i)),t.breathe.set(e.nodeState.breathe.subarray(0,i)),t.shapeIds.set(e.nodeState.shapeIds.subarray(0,i)),t.aspects.set(e.nodeState.aspects.subarray(0,i))}let o=n.edgeState;if(o&&e.edgeState){let i=n.data.edges.length;o.colors.set(e.edgeState.colors.subarray(0,i*3)),o.widths.set(e.edgeState.widths.subarray(0,i)),o.opacities.set(e.edgeState.opacities.subarray(0,i)),o.selected.set(e.edgeState.selected.subarray(0,i)),o.highlighted.set(e.edgeState.highlighted.subarray(0,i)),o.dashed.set(e.edgeState.dashed.subarray(0,i)),o.shapes.set(e.edgeState.shapes.subarray(0,i)),e.edgeState.bends&&o.bends.set(e.edgeState.bends.subarray(0,i)),o.flow.set(e.edgeState.flow.subarray(0,i)),o.glow.set(e.edgeState.glow.subarray(0,i))}let r=n.positionProvider?.getPositions()??null;if(r&&e.positions){let i=n.data.nodes.length;r.set(e.positions.subarray(0,i*3))}for(let[i,a]of e.iconNames)n.setNodeIcon(i,a);for(let i of n.iconNames.keys())e.iconNames.has(i)||n.setNodeIcon(i,null);t&&e.nodeState&&t.overrides.set(e.nodeState.overrides.subarray(0,n.data.nodes.length));for(let[i,a]of e.imageUrls)n.setNodeImageUrl(i,a);for(let i of n.imageUrls.keys())e.imageUrls.has(i)||n.setNodeImageUrl(i,null);n._restoreDecorationsFromSnapshot(e),n.notifyChange()}var to=class{constructor(e,t){this.type="ImportSnapshot";this.oldSnapshot=null;this.store=e,this.newSnapshotData=t}execute(){this.oldSnapshot=no(this.store),eo(this.store,this.newSnapshotData)}undo(){this.oldSnapshot&&eo(this.store,this.oldSnapshot)}};function rs(n){let e=n.replace("#","");if(e.length!==3&&e.length!==6)return[.5,.5,.5];let t=parseInt(e,16);return isNaN(t)?[.5,.5,.5]:e.length===3?[(t>>8&15)/15,(t>>4&15)/15,(t&15)/15]:[(t>>16&255)/255,(t>>8&255)/255,(t&255)/255]}var is=n=>{let[e,t,o]=rs(n);return[e,t,o]};function as(n){let e=[];if(n.positions)for(let[l,[u,c,p]]of n.positions)e.push({id:l,x:u,y:c,z:p});let t=new Set(n.pinnedNodeIds??[]),o=[],r=new Set;if(n.nodeVisuals)for(let[l,u]of n.nodeVisuals){let c={id:l};u.color&&(c.color=is(u.color)),u.size!==void 0&&(c.size=u.size),t.has(l)&&(c.pinned=!0),o.push(c),r.add(l)}for(let l of t)r.has(l)||o.push({id:l,pinned:!0});let i=[];if(n.edgeVisuals)for(let[l,u]of n.edgeVisuals){let c={id:l};u.color&&(c.color=is(u.color)),u.width!==void 0&&(c.width=u.width),i.push(c)}let a={},s={};for(let l of n.style?.categories??[])l.defaultColor&&(a[l.category]=l.defaultColor);for(let l of n.style?.relationships??[])l.defaultColor&&(s[l.relationship]=l.defaultColor);return{version:"1.0",data:{nodes:n.nodes,edges:n.edges},positions:e,styles:{categoryColors:a,relationshipColors:s},nodeOverrides:o,edgeOverrides:i,selection:{nodeIds:[],edgeIds:[]},hiddenNodeIds:[...n.hiddenNodeIds??[]],hiddenEdgeIds:[],collections:[],camera:J1(n),layout:n.layout?.type?{type:n.layout.type,...n.layout.options?{options:n.layout.options}:{}}:null,map:null,plot:null,extensions:{}}}function J1(n){let e=n.camera;if(!e)return null;let[t,o,r]=e.position;return{position:{x:t,y:o,z:r},rotation:e.rotation??{x:0,y:0,z:0},zoom:r,mode:e.rotation?"3D":"2D"}}function ss(n){return{categories:n.style?.categories??[],relationships:n.style?.relationships??[],hiddenCategories:n.style?.hiddenCategories??[]}}var io=class{constructor(e,t,o){this.store=e,this.interaction=t,this.executor=o}wireInteraction(e){this.interaction=e}export(){let{nodes:e,edges:t}=this.store.data,o=this.store.nodeState,r=this.store.edgeState,i=this.store.positionProvider?.getPositions()??null,a={nodes:e.map(v=>({id:v.id,category:v.category,...v.labels!==void 0?{labels:[...v.labels]}:{},...v.tags!==void 0?{tags:[...v.tags]}:{},properties:{...v.properties}})),edges:t.map(v=>({id:v.id,source:v.source,target:v.target,relationship:v.relationship,properties:{...v.properties}}))},s=[];for(let v of e){let h=this.store.index.nodeIdToIndex.get(v.id);h!==void 0&&i?s.push({id:v.id,x:i[h*3],y:i[h*3+1],z:i[h*3+2]}):s.push({id:v.id,x:0,y:0,z:0})}let l=this.store.defaultNodeSize,u=[];if(o)for(let v of e){let h=this.store.index.nodeIdToIndex.get(v.id);if(h===void 0)continue;let b={id:v.id},f=!1,w=o.colors[h*3],x=o.colors[h*3+1],S=o.colors[h*3+2];(w!==0||x!==0||S!==0)&&(b.color=[w,x,S],f=!0);let A=o.sizes[h];A!==l&&(b.size=A,f=!0),o.pinned[h]>0&&(b.pinned=!0,f=!0),f&&u.push(b)}let c=[];if(r)for(let v of t){let h=this.store.index.edgeIdToIndex.get(v.id);if(h===void 0)continue;let b={id:v.id},f=!1,w=r.colors[h*3],x=r.colors[h*3+1],S=r.colors[h*3+2];(w!==0||x!==0||S!==0)&&(b.color=[w,x,S],f=!0);let A=r.widths[h];A!==1&&(b.width=A,f=!0),r.dashed[h]>0&&(b.dashed=!0,f=!0),f&&c.push(b)}let p=this.store.getSelectedNodeIds(),d=[];if(r){for(let v=0;v<r.selected.length;v++)if(r.selected[v]>0){let h=this.store.index.edgeIndexToId[v];h&&d.push(h)}}let g=[];if(o){for(let v=0;v<o.hidden.length;v++)if(o.hidden[v]>0){let h=this.store.index.nodeIndexToId[v];h&&g.push(h)}}let m=null,y=this.interaction?.graphControl??null;if(y){let v=y.getRotation(),h=y.getZoom();m={position:{x:0,y:0,z:h},rotation:v,zoom:h,mode:"3D"}}return{version:"1.0",data:a,positions:s,styles:{categoryColors:{},relationshipColors:{}},nodeOverrides:u,edgeOverrides:c,selection:{nodeIds:p,edgeIds:d},hiddenNodeIds:g,hiddenEdgeIds:[],collections:Array.from(this.store.getCollectionManager().collections.values()).map(v=>({parentId:v.parentId,childIds:[...v.childNodeIds]})),camera:m,layout:null,map:null,plot:null,extensions:{}}}import(e){let t=no(this.store);this.store.setData(e.data);let o=this.store.positionProvider?.getPositions()??null;if(o)for(let i of e.positions){let a=this.store.index.nodeIdToIndex.get(i.id);a!==void 0&&(o[a*3]=i.x,o[a*3+1]=i.y,o[a*3+2]=i.z)}for(let i of e.nodeOverrides)i.color!==void 0&&this.store.setNodeColor(i.id,i.color),i.size!==void 0&&this.store.setNodeSize(i.id,i.size),i.pinned&&this.store.pinNodes([i.id]);for(let i of e.edgeOverrides)i.color!==void 0&&this.store.setEdgeColor(i.id,i.color),i.width!==void 0&&this.store.setEdgeWidth(i.id,i.width),i.dashed!==void 0&&this.store.setEdgeDashed(i.id,i.dashed);if(e.selection.nodeIds.length>0&&this.store.selectNodes(e.selection.nodeIds),e.selection.edgeIds.length>0&&this.store.selectEdges(e.selection.edgeIds),e.hiddenNodeIds.length>0&&this.store.hideNodes(e.hiddenNodeIds),e.collections&&e.collections.length>0){let i=this.store.getCollectionManager();for(let a of e.collections)i.isCollection(a.parentId)||i.collect(a.parentId,a.childIds)}let r=no(this.store);eo(this.store,t),this.executor.execute(new to(this.store,r))}async importGraphXR(e,t){let{parseGraphXR:o}=await Promise.resolve().then(()=>(ys(),bs)),r=await o(e,t);return this.applyGraphXR(r),{nodes:r.nodes.length,edges:r.edges.length}}applyGraphXR(e){this.import(as(e));let{categories:t,relationships:o,hiddenCategories:r}=ss(e),i=this.store.visualMapper;for(let a of t)i.setCategoryConfig(a,"user");for(let a of o)i.setRelationshipConfig(a,"user");if(e.nodeVisuals)for(let[a,s]of e.nodeVisuals)s.icon&&this.store.setNodeIcon(a,s.icon);if(r.length>0){let a=new Set(r),s=e.nodes.filter(l=>a.has(l.category)).map(l=>l.id);s.length>0&&this.store.hideNodes(s)}e.layout?.settings&&Object.keys(e.layout.settings).length>0&&this.store.updateLayoutSettings({...e.layout.settings}),this.applyGraphXRCamera(e.camera)}applyGraphXRCamera(e){if(!e)return;let t=this.interaction?.drag.getCloudScene();if(!t)return;let[o,r,i]=e.position;t.position.set(o,r,i),e.rotation&&t.rotation.set(e.rotation.x,e.rotation.y,e.rotation.z)}exportData(){let{nodes:e,edges:t}=this.store.data;return{nodes:e.map(o=>({id:o.id,category:o.category,...o.labels!==void 0?{labels:[...o.labels]}:{},...o.tags!==void 0?{tags:[...o.tags]}:{},properties:{...o.properties}})),edges:t.map(o=>({id:o.id,source:o.source,target:o.target,relationship:o.relationship,properties:{...o.properties}}))}}exportSelected(){let e=new Set(this.store.getSelectedNodeIds()),t=this.store.data.nodes.filter(r=>e.has(r.id)),o=this.store.data.edges.filter(r=>e.has(r.source)&&e.has(r.target));return{nodes:t.map(r=>({id:r.id,category:r.category,...r.labels!==void 0?{labels:[...r.labels]}:{},...r.tags!==void 0?{tags:[...r.tags]}:{},properties:{...r.properties}})),edges:o.map(r=>({id:r.id,source:r.source,target:r.target,relationship:r.relationship,properties:{...r.properties}}))}}static diff(e,t){let o=new Set(e.data.nodes.map(g=>g.id)),r=new Set(t.data.nodes.map(g=>g.id)),i=new Set(e.data.edges.map(g=>g.id)),a=new Set(t.data.edges.map(g=>g.id)),s=t.data.nodes.filter(g=>!o.has(g.id)).map(g=>g.id),l=e.data.nodes.filter(g=>!r.has(g.id)).map(g=>g.id),u=t.data.edges.filter(g=>!i.has(g.id)).map(g=>g.id),c=e.data.edges.filter(g=>!a.has(g.id)).map(g=>g.id),p=new Map(e.data.nodes.map(g=>[g.id,g])),d=[];for(let g of t.data.nodes){let m=p.get(g.id);if(!m)continue;let y=[];m.category!==g.category&&y.push("category");let v=m.properties,h=g.properties,b=new Set([...Object.keys(v),...Object.keys(h)]);for(let f of b)v[f]!==h[f]&&y.push(`properties.${f}`);y.length>0&&d.push({id:g.id,changes:y})}return{nodesAdded:s,nodesRemoved:l,nodesModified:d,edgesAdded:u,edgesRemoved:c}}};var ao=class{constructor(e,t){this.registry=new Map;this.globalLlm=void 0;this.resultHandlers=[];this.nodes=e,this.edges=t}register(e){this.registry.set(e.id,e)}configure(e){this.globalLlm=e.llm}async processFile(e){for(let t of this.registry.values())if(t.accepts(e))return this._run(t,{file:e});return null}async execute(e,t){let o=this.registry.get(e);return o?this._run(o,t):null}async apply(e){e.nodes.length>0&&await this.nodes.add(e.nodes),e.edges.length>0&&await this.edges.add(e.edges)}onResult(e){return this.resultHandlers.push(e),()=>{this.resultHandlers=this.resultHandlers.filter(t=>t!==e)}}async _run(e,t){let o={llm:this.globalLlm},r=await e.run(t,o);for(let i of this.resultHandlers)try{i(r)}catch(a){console.error("SkillsApi: error in result handler",a)}return r}};var xs={name:"maps",slots:{flatMap:dr,globeMap:wr}},ws={name:"geoEgoRing",slots:{geoEgoRing:Lr,egoCollapse:Or}},Ss={name:"minimap",slots:{minimap:ei}},Do={name:"algorithms",namespaces:{algorithms:n=>new Jn(n.store,n.executor,n.events,n.selection,n.algorithmWorker)}},Ps={name:"toolbar",slots:{toolbar:Ui},requires:[Do]},Cs={name:"legend",slots:{legend:da}},ks={name:"nodeCards",slots:{cards:Sa}},Rs={name:"nodeInfo",slots:{nodeInfo:Ra}},As={name:"quickCreate",slots:{quickCreate:Ma}},Ts={name:"contextMenu",slots:{contextMenu:Ia}},Ms={name:"coverage",namespaces:{coverage:n=>new Un(n.layers,(e,t)=>n.map.groundKmToWorld(e,t))}},Is={name:"polygons",namespaces:{polygon:n=>new jn(n.layers,(e,t)=>n.map.latLngToWorld(e,t))}},Es={name:"io",namespaces:{io:n=>new io(n.store,n.interaction,n.executor)}},_s={name:"skills",namespaces:{skills:n=>new ao(n.nodes,n.edges)}},Tc=[xs,ws,Ss,Ps,Cs,ks,Rs,As,Ts,Ms,Is,Do,Es,_s];
3815
+ //# sourceMappingURL=builtins.js.map