popost 4.6.1 → 4.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1253) hide show
  1. package/LICENSE +59 -3
  2. package/README.md +20 -7
  3. package/SKILL.md +48 -131
  4. package/THIRD_PARTY_NOTICES +524 -0
  5. package/agents/openai.yaml +2 -2
  6. package/assets/video/examples/audio-bars.html +125 -0
  7. package/assets/video/examples/bouncing-ball.html +182 -0
  8. package/assets/video/examples/card-flip.html +92 -0
  9. package/assets/video/examples/catalogue.json +16221 -0
  10. package/assets/video/examples/counter-stat.html +155 -0
  11. package/assets/video/examples/folding-doors.html +94 -0
  12. package/assets/video/examples/glitch-title.html +120 -0
  13. package/assets/video/examples/goo-blobs.html +127 -0
  14. package/assets/video/examples/grid-reveal.html +151 -0
  15. package/assets/video/examples/hf/agent-cursor.html +781 -0
  16. package/assets/video/examples/hf/ai-answer-rank.html +767 -0
  17. package/assets/video/examples/hf/ai-chat-reveal.html +1260 -0
  18. package/assets/video/examples/hf/animated-bar-chart.html +312 -0
  19. package/assets/video/examples/hf/app-showcase.html +1115 -0
  20. package/assets/video/examples/hf/apple-money-count.html +453 -0
  21. package/assets/video/examples/hf/arc-motion-path.html +303 -0
  22. package/assets/video/examples/hf/ascii-render-pass.html +728 -0
  23. package/assets/video/examples/hf/ascii-trail-reveal.html +595 -0
  24. package/assets/video/examples/hf/aurora-drift.html +439 -0
  25. package/assets/video/examples/hf/aurora.html +258 -0
  26. package/assets/video/examples/hf/avatar-cloud.html +667 -0
  27. package/assets/video/examples/hf/avatar-group-hover.html +342 -0
  28. package/assets/video/examples/hf/badge-pop.html +400 -0
  29. package/assets/video/examples/hf/bar-chart-race.html +795 -0
  30. package/assets/video/examples/hf/beat-accent.html +507 -0
  31. package/assets/video/examples/hf/beat-freeze-cut.html +1050 -0
  32. package/assets/video/examples/hf/beat-pulse-background.html +422 -0
  33. package/assets/video/examples/hf/beat-timeline.html +488 -0
  34. package/assets/video/examples/hf/before-after-wipe.html +681 -0
  35. package/assets/video/examples/hf/blob.html +258 -0
  36. package/assets/video/examples/hf/blue-sweater-intro-video.html +1656 -0
  37. package/assets/video/examples/hf/blur-in.html +624 -0
  38. package/assets/video/examples/hf/blur-out-up.html +350 -0
  39. package/assets/video/examples/hf/bottom-up-letters.html +335 -0
  40. package/assets/video/examples/hf/browser-device-stage.html +847 -0
  41. package/assets/video/examples/hf/camcorder-hud.html +371 -0
  42. package/assets/video/examples/hf/camera-dolly-zoom.html +485 -0
  43. package/assets/video/examples/hf/camera-rig-depth-stack.html +246 -0
  44. package/assets/video/examples/hf/camera-scan-gate.html +708 -0
  45. package/assets/video/examples/hf/camera-shake.html +989 -0
  46. package/assets/video/examples/hf/canopy-part-title.html +2549 -0
  47. package/assets/video/examples/hf/caption-blend-difference.html +247 -0
  48. package/assets/video/examples/hf/caption-camera-follow.html +537 -0
  49. package/assets/video/examples/hf/caption-clip-wipe.html +363 -0
  50. package/assets/video/examples/hf/caption-editorial-emphasis.html +615 -0
  51. package/assets/video/examples/hf/caption-emoji-pop.html +623 -0
  52. package/assets/video/examples/hf/caption-glitch-rgb.html +475 -0
  53. package/assets/video/examples/hf/caption-gradient-fill.html +392 -0
  54. package/assets/video/examples/hf/caption-highlight.html +433 -0
  55. package/assets/video/examples/hf/caption-kinetic-slam.html +334 -0
  56. package/assets/video/examples/hf/caption-matrix-decode.html +399 -0
  57. package/assets/video/examples/hf/caption-neon-accent.html +684 -0
  58. package/assets/video/examples/hf/caption-neon-glow.html +373 -0
  59. package/assets/video/examples/hf/caption-parallax-layers.html +530 -0
  60. package/assets/video/examples/hf/caption-particle-burst.html +454 -0
  61. package/assets/video/examples/hf/caption-pill-karaoke.html +517 -0
  62. package/assets/video/examples/hf/caption-texture.html +368 -0
  63. package/assets/video/examples/hf/caption-weight-shift.html +566 -0
  64. package/assets/video/examples/hf/card-resize.html +435 -0
  65. package/assets/video/examples/hf/caret-swap.html +601 -0
  66. package/assets/video/examples/hf/carousel-circle-1.html +1175 -0
  67. package/assets/video/examples/hf/carousel-circle-2.html +1175 -0
  68. package/assets/video/examples/hf/carousel-circle-3.html +1175 -0
  69. package/assets/video/examples/hf/carousel-circle-4.html +1175 -0
  70. package/assets/video/examples/hf/carousel-circle-5.html +1175 -0
  71. package/assets/video/examples/hf/carousel-orbit-1.html +1198 -0
  72. package/assets/video/examples/hf/carousel-orbit-2.html +1198 -0
  73. package/assets/video/examples/hf/carousel-orbit-3.html +1198 -0
  74. package/assets/video/examples/hf/carousel-orbit-4.html +1214 -0
  75. package/assets/video/examples/hf/carousel-orbit-5.html +1198 -0
  76. package/assets/video/examples/hf/carousel-path-1.html +1219 -0
  77. package/assets/video/examples/hf/carousel-path-2.html +1176 -0
  78. package/assets/video/examples/hf/carousel-path-3.html +1190 -0
  79. package/assets/video/examples/hf/carousel-path-4.html +1219 -0
  80. package/assets/video/examples/hf/carousel-path-5.html +1218 -0
  81. package/assets/video/examples/hf/carousel-vision-1.html +1180 -0
  82. package/assets/video/examples/hf/carousel-vision-2.html +1180 -0
  83. package/assets/video/examples/hf/carousel-vision-3.html +1180 -0
  84. package/assets/video/examples/hf/carousel-vision-4.html +1187 -0
  85. package/assets/video/examples/hf/carousel-vision-5.html +1180 -0
  86. package/assets/video/examples/hf/char-slam-explode.html +546 -0
  87. package/assets/video/examples/hf/chart-story.html +973 -0
  88. package/assets/video/examples/hf/chat-message.html +635 -0
  89. package/assets/video/examples/hf/chat-thread.html +953 -0
  90. package/assets/video/examples/hf/chatgpt-exchange.html +1620 -0
  91. package/assets/video/examples/hf/chromatic-radial-split.html +613 -0
  92. package/assets/video/examples/hf/chrome-orb.html +258 -0
  93. package/assets/video/examples/hf/cinemagraph.html +422 -0
  94. package/assets/video/examples/hf/cinematic-zoom.html +613 -0
  95. package/assets/video/examples/hf/claude-exchange.html +1845 -0
  96. package/assets/video/examples/hf/code-3d-extrude.html +755 -0
  97. package/assets/video/examples/hf/code-diff.html +956 -0
  98. package/assets/video/examples/hf/code-highlight.html +885 -0
  99. package/assets/video/examples/hf/code-morph.html +1357 -0
  100. package/assets/video/examples/hf/code-particle-assemble.html +622 -0
  101. package/assets/video/examples/hf/code-scroll.html +1700 -0
  102. package/assets/video/examples/hf/code-shader-dissolve.html +677 -0
  103. package/assets/video/examples/hf/code-slice-hero.html +1276 -0
  104. package/assets/video/examples/hf/code-snippet-apple-terminal-pro.html +388 -0
  105. package/assets/video/examples/hf/code-snippet-dark-2026.html +1231 -0
  106. package/assets/video/examples/hf/code-snippet-dark-modern.html +1227 -0
  107. package/assets/video/examples/hf/code-terminal-run.html +766 -0
  108. package/assets/video/examples/hf/code-typing.html +903 -0
  109. package/assets/video/examples/hf/color-wheel.html +258 -0
  110. package/assets/video/examples/hf/colorama-wipe.html +503 -0
  111. package/assets/video/examples/hf/comparison-split.html +657 -0
  112. package/assets/video/examples/hf/confetti.html +349 -0
  113. package/assets/video/examples/hf/conic-progress-ring.html +441 -0
  114. package/assets/video/examples/hf/constellation-hub.html +662 -0
  115. package/assets/video/examples/hf/cosmic-orb.html +643 -0
  116. package/assets/video/examples/hf/count-up.html +552 -0
  117. package/assets/video/examples/hf/cross-warp-morph.html +624 -0
  118. package/assets/video/examples/hf/cta-close.html +492 -0
  119. package/assets/video/examples/hf/cta-lockup.html +470 -0
  120. package/assets/video/examples/hf/cuboid-carousel.html +2385 -0
  121. package/assets/video/examples/hf/cursor-annotate.html +827 -0
  122. package/assets/video/examples/hf/cursor-context-menu.html +757 -0
  123. package/assets/video/examples/hf/cursor-drag-drop.html +656 -0
  124. package/assets/video/examples/hf/cursor-glyph-trail.html +904 -0
  125. package/assets/video/examples/hf/cursor-marquee-select.html +1266 -0
  126. package/assets/video/examples/hf/cursor-text-select.html +638 -0
  127. package/assets/video/examples/hf/cursor-zoom-follow.html +973 -0
  128. package/assets/video/examples/hf/curtain-reveal.html +590 -0
  129. package/assets/video/examples/hf/cut-the-curve.html +715 -0
  130. package/assets/video/examples/hf/dart-cursor.html +863 -0
  131. package/assets/video/examples/hf/data-chart.html +666 -0
  132. package/assets/video/examples/hf/decision-tree.html +655 -0
  133. package/assets/video/examples/hf/decline-chart.html +485 -0
  134. package/assets/video/examples/hf/device-frame-stage.html +661 -0
  135. package/assets/video/examples/hf/domain-warp-dissolve.html +627 -0
  136. package/assets/video/examples/hf/drift-hold.html +392 -0
  137. package/assets/video/examples/hf/dynamic-grid.html +336 -0
  138. package/assets/video/examples/hf/echo-smear.html +994 -0
  139. package/assets/video/examples/hf/echo-trail.html +557 -0
  140. package/assets/video/examples/hf/editorial-flash-overlay.html +337 -0
  141. package/assets/video/examples/hf/exploded-stack.html +761 -0
  142. package/assets/video/examples/hf/extended-keyframe.html +715 -0
  143. package/assets/video/examples/hf/extruded-logo.html +757 -0
  144. package/assets/video/examples/hf/facet-morph.html +746 -0
  145. package/assets/video/examples/hf/fade-through.html +443 -0
  146. package/assets/video/examples/hf/falling-lines.html +259 -0
  147. package/assets/video/examples/hf/filmed-screen.html +1065 -0
  148. package/assets/video/examples/hf/flash-through-white.html +613 -0
  149. package/assets/video/examples/hf/flowchart-vertical.html +631 -0
  150. package/assets/video/examples/hf/flowchart.html +630 -0
  151. package/assets/video/examples/hf/flowing-gradient.html +258 -0
  152. package/assets/video/examples/hf/focus-blur-resolve.html +321 -0
  153. package/assets/video/examples/hf/focus-rack.html +542 -0
  154. package/assets/video/examples/hf/focus-swap.html +496 -0
  155. package/assets/video/examples/hf/fractal-noise.html +258 -0
  156. package/assets/video/examples/hf/freeze-frame-dressing.html +357 -0
  157. package/assets/video/examples/hf/frost.html +258 -0
  158. package/assets/video/examples/hf/gabor-noise.html +258 -0
  159. package/assets/video/examples/hf/gallery-tunnel.html +652 -0
  160. package/assets/video/examples/hf/gesture-tap.html +604 -0
  161. package/assets/video/examples/hf/glass-hero.html +505 -0
  162. package/assets/video/examples/hf/glass-shard-title.html +1618 -0
  163. package/assets/video/examples/hf/glitch.html +613 -0
  164. package/assets/video/examples/hf/gloss-sweep.html +418 -0
  165. package/assets/video/examples/hf/godrays.html +257 -0
  166. package/assets/video/examples/hf/goo.html +258 -0
  167. package/assets/video/examples/hf/gooey-split.html +1092 -0
  168. package/assets/video/examples/hf/grain-field.html +377 -0
  169. package/assets/video/examples/hf/grain-overlay.html +295 -0
  170. package/assets/video/examples/hf/gravitational-lens.html +612 -0
  171. package/assets/video/examples/hf/grid-card-assemble.html +671 -0
  172. package/assets/video/examples/hf/grid-pixelate-wipe.html +314 -0
  173. package/assets/video/examples/hf/halftone-dissolve.html +696 -0
  174. package/assets/video/examples/hf/halftone-field.html +598 -0
  175. package/assets/video/examples/hf/headline-slam.html +455 -0
  176. package/assets/video/examples/hf/heatmap.html +258 -0
  177. package/assets/video/examples/hf/heygen-avatar-promo-card.html +627 -0
  178. package/assets/video/examples/hf/hologram.html +258 -0
  179. package/assets/video/examples/hf/holographic.html +258 -0
  180. package/assets/video/examples/hf/hw-arrow.html +835 -0
  181. package/assets/video/examples/hf/hw-boil.html +632 -0
  182. package/assets/video/examples/hf/hw-box-label.html +741 -0
  183. package/assets/video/examples/hf/hw-callout-circle.html +820 -0
  184. package/assets/video/examples/hf/hw-frame.html +455 -0
  185. package/assets/video/examples/hf/hw-path-text.html +349 -0
  186. package/assets/video/examples/hf/hw-pipeline.html +472 -0
  187. package/assets/video/examples/hf/hw-scribble-transition.html +291 -0
  188. package/assets/video/examples/hf/hw-text-cloud.html +439 -0
  189. package/assets/video/examples/hf/hw-title.html +412 -0
  190. package/assets/video/examples/hf/hw-underline.html +403 -0
  191. package/assets/video/examples/hf/hw-write-title.html +1389 -0
  192. package/assets/video/examples/hf/icon-morph-beat.html +463 -0
  193. package/assets/video/examples/hf/icon-swap.html +380 -0
  194. package/assets/video/examples/hf/ink-bleed-reveal.html +659 -0
  195. package/assets/video/examples/hf/inline-highlight.html +322 -0
  196. package/assets/video/examples/hf/input-feedback.html +419 -0
  197. package/assets/video/examples/hf/instagram-follow.html +460 -0
  198. package/assets/video/examples/hf/ios26-liquid-glass.html +1597 -0
  199. package/assets/video/examples/hf/iris-reveal.html +684 -0
  200. package/assets/video/examples/hf/keyframe-scrub-stack.html +326 -0
  201. package/assets/video/examples/hf/kinetic-center-build.html +538 -0
  202. package/assets/video/examples/hf/kinetic-type-swap.html +610 -0
  203. package/assets/video/examples/hf/kinetic-type.html +862 -0
  204. package/assets/video/examples/hf/lens-flare.html +258 -0
  205. package/assets/video/examples/hf/light-edge.html +259 -0
  206. package/assets/video/examples/hf/light-leak.html +612 -0
  207. package/assets/video/examples/hf/light-sweep-pass.html +684 -0
  208. package/assets/video/examples/hf/line-by-line-slide.html +345 -0
  209. package/assets/video/examples/hf/line-swap.html +526 -0
  210. package/assets/video/examples/hf/liquid-glass-notification.html +1898 -0
  211. package/assets/video/examples/hf/liquid-glass-widgets.html +2175 -0
  212. package/assets/video/examples/hf/liquid-metal.html +259 -0
  213. package/assets/video/examples/hf/locked-nucleus-orbit.html +564 -0
  214. package/assets/video/examples/hf/logo-brand-close.html +598 -0
  215. package/assets/video/examples/hf/logo-outro.html +397 -0
  216. package/assets/video/examples/hf/logo-sting.html +378 -0
  217. package/assets/video/examples/hf/logo-wall.html +502 -0
  218. package/assets/video/examples/hf/lottie-character-walk.html +407 -0
  219. package/assets/video/examples/hf/lt-accent-underline.html +247 -0
  220. package/assets/video/examples/hf/lt-bold-block.html +249 -0
  221. package/assets/video/examples/hf/lt-clean-bar.html +251 -0
  222. package/assets/video/examples/hf/lt-color-block.html +241 -0
  223. package/assets/video/examples/hf/lt-dark-card.html +251 -0
  224. package/assets/video/examples/hf/lt-kicker-name.html +254 -0
  225. package/assets/video/examples/hf/lt-mask-reveal.html +260 -0
  226. package/assets/video/examples/hf/lt-neon-border.html +604 -0
  227. package/assets/video/examples/hf/lt-side-rule.html +254 -0
  228. package/assets/video/examples/hf/lt-soft-pill.html +259 -0
  229. package/assets/video/examples/hf/lt-stack-bars.html +249 -0
  230. package/assets/video/examples/hf/macos-notification.html +372 -0
  231. package/assets/video/examples/hf/macos-tahoe-liquid-glass.html +1701 -0
  232. package/assets/video/examples/hf/magnetic-cursor.html +684 -0
  233. package/assets/video/examples/hf/marble.html +257 -0
  234. package/assets/video/examples/hf/marker-checklist-card.html +727 -0
  235. package/assets/video/examples/hf/marker-highlight.html +589 -0
  236. package/assets/video/examples/hf/match-cut.html +505 -0
  237. package/assets/video/examples/hf/matrix-decode.html +363 -0
  238. package/assets/video/examples/hf/menu-morph.html +420 -0
  239. package/assets/video/examples/hf/mesh-gradient-bg.html +329 -0
  240. package/assets/video/examples/hf/mesh-gradient.html +257 -0
  241. package/assets/video/examples/hf/message-thread-reveal.html +1913 -0
  242. package/assets/video/examples/hf/micro-transitions.html +631 -0
  243. package/assets/video/examples/hf/mk-background.html +376 -0
  244. package/assets/video/examples/hf/mk-callout-highlight.html +322 -0
  245. package/assets/video/examples/hf/mk-clone-wall-transition.html +364 -0
  246. package/assets/video/examples/hf/mk-emphasis-type.html +235 -0
  247. package/assets/video/examples/hf/mk-line-graph.html +432 -0
  248. package/assets/video/examples/hf/mk-placeholder-grid.html +373 -0
  249. package/assets/video/examples/hf/mk-progress-stat.html +324 -0
  250. package/assets/video/examples/hf/mk-specs-list.html +362 -0
  251. package/assets/video/examples/hf/mk-usage-arc.html +297 -0
  252. package/assets/video/examples/hf/modal-morph.html +727 -0
  253. package/assets/video/examples/hf/morph-swap.html +590 -0
  254. package/assets/video/examples/hf/morph-text.html +409 -0
  255. package/assets/video/examples/hf/multi-device-splay.html +934 -0
  256. package/assets/video/examples/hf/multiplayer-cursors.html +642 -0
  257. package/assets/video/examples/hf/native-notification-pop.html +670 -0
  258. package/assets/video/examples/hf/nebula.html +258 -0
  259. package/assets/video/examples/hf/news-ticker.html +548 -0
  260. package/assets/video/examples/hf/north-korea-locked-down.html +447 -0
  261. package/assets/video/examples/hf/notes-reveal.html +2028 -0
  262. package/assets/video/examples/hf/notes-typing.html +631 -0
  263. package/assets/video/examples/hf/notification-cascade.html +740 -0
  264. package/assets/video/examples/hf/notification-pileup.html +667 -0
  265. package/assets/video/examples/hf/notification-stack.html +610 -0
  266. package/assets/video/examples/hf/number-pop-in.html +362 -0
  267. package/assets/video/examples/hf/number-wheel.html +378 -0
  268. package/assets/video/examples/hf/nyc-paris-flight.html +659 -0
  269. package/assets/video/examples/hf/nyt-graph.html +715 -0
  270. package/assets/video/examples/hf/obsidian.html +258 -0
  271. package/assets/video/examples/hf/offset-path-traveler.html +511 -0
  272. package/assets/video/examples/hf/onboarding-stepper-flow.html +292 -0
  273. package/assets/video/examples/hf/orbit-card.html +2457 -0
  274. package/assets/video/examples/hf/ordered-dither-pass.html +753 -0
  275. package/assets/video/examples/hf/organic-light-leak-overlay.html +336 -0
  276. package/assets/video/examples/hf/oscilloscope-trace.html +718 -0
  277. package/assets/video/examples/hf/outline-draw.html +394 -0
  278. package/assets/video/examples/hf/oversized-cursor.html +851 -0
  279. package/assets/video/examples/hf/overwhelm-surround.html +557 -0
  280. package/assets/video/examples/hf/page-slide.html +377 -0
  281. package/assets/video/examples/hf/pan-stations.html +555 -0
  282. package/assets/video/examples/hf/panel-reveal.html +370 -0
  283. package/assets/video/examples/hf/paper-collage-reveal.html +737 -0
  284. package/assets/video/examples/hf/parallax-device-dive.html +647 -0
  285. package/assets/video/examples/hf/parallax-unzoom.html +499 -0
  286. package/assets/video/examples/hf/parallax-zoom.html +515 -0
  287. package/assets/video/examples/hf/particle-image-reveal.html +595 -0
  288. package/assets/video/examples/hf/particle-text-dissolve.html +615 -0
  289. package/assets/video/examples/hf/path-traced-3d.html +508 -0
  290. package/assets/video/examples/hf/pendulum-swing.html +364 -0
  291. package/assets/video/examples/hf/per-word-crossfade.html +398 -0
  292. package/assets/video/examples/hf/per-word-rise.html +556 -0
  293. package/assets/video/examples/hf/perspective-marquee.html +366 -0
  294. package/assets/video/examples/hf/physical-exit.html +459 -0
  295. package/assets/video/examples/hf/plasma.html +258 -0
  296. package/assets/video/examples/hf/plastic.html +258 -0
  297. package/assets/video/examples/hf/play-mode.html +1035 -0
  298. package/assets/video/examples/hf/press-ripple.html +675 -0
  299. package/assets/video/examples/hf/prism.html +258 -0
  300. package/assets/video/examples/hf/product-promo.html +1311 -0
  301. package/assets/video/examples/hf/product-turntable.html +4569 -0
  302. package/assets/video/examples/hf/pull-back-reveal.html +546 -0
  303. package/assets/video/examples/hf/pull-to-refresh.html +861 -0
  304. package/assets/video/examples/hf/push-in.html +379 -0
  305. package/assets/video/examples/hf/rack-focus.html +779 -0
  306. package/assets/video/examples/hf/radial-surround.html +653 -0
  307. package/assets/video/examples/hf/reddit-post.html +515 -0
  308. package/assets/video/examples/hf/rgb-glitch-text.html +353 -0
  309. package/assets/video/examples/hf/ridged-burn.html +624 -0
  310. package/assets/video/examples/hf/ripple-waves.html +613 -0
  311. package/assets/video/examples/hf/ripples.html +259 -0
  312. package/assets/video/examples/hf/rubber-band-bumper.html +534 -0
  313. package/assets/video/examples/hf/scan-band.html +415 -0
  314. package/assets/video/examples/hf/scramble-reveal.html +510 -0
  315. package/assets/video/examples/hf/screen-flow-carousel.html +779 -0
  316. package/assets/video/examples/hf/scroll-camera-story.html +988 -0
  317. package/assets/video/examples/hf/scroll-feed.html +602 -0
  318. package/assets/video/examples/hf/sdf-iris.html +613 -0
  319. package/assets/video/examples/hf/segmentation-flood.html +748 -0
  320. package/assets/video/examples/hf/separator.html +620 -0
  321. package/assets/video/examples/hf/settings-toggle-flow.html +286 -0
  322. package/assets/video/examples/hf/share-sheet-carousel.html +591 -0
  323. package/assets/video/examples/hf/shared-axis-y.html +370 -0
  324. package/assets/video/examples/hf/shared-axis-z.html +514 -0
  325. package/assets/video/examples/hf/sheet-spring-up.html +681 -0
  326. package/assets/video/examples/hf/shimmer-sweep.html +301 -0
  327. package/assets/video/examples/hf/signup-flow.html +276 -0
  328. package/assets/video/examples/hf/sine-wave.html +258 -0
  329. package/assets/video/examples/hf/skeleton-reveal.html +373 -0
  330. package/assets/video/examples/hf/slack-notification-ad.html +901 -0
  331. package/assets/video/examples/hf/slit-scan-reveal.html +540 -0
  332. package/assets/video/examples/hf/slot-machine-roll.html +391 -0
  333. package/assets/video/examples/hf/snow.html +499 -0
  334. package/assets/video/examples/hf/social-proof-card.html +534 -0
  335. package/assets/video/examples/hf/soft-blur-in.html +322 -0
  336. package/assets/video/examples/hf/spain-map.html +583 -0
  337. package/assets/video/examples/hf/spiral-galaxy.html +507 -0
  338. package/assets/video/examples/hf/spiral.html +258 -0
  339. package/assets/video/examples/hf/split-flap-board.html +537 -0
  340. package/assets/video/examples/hf/split-tilt-cards.html +775 -0
  341. package/assets/video/examples/hf/spotify-card.html +470 -0
  342. package/assets/video/examples/hf/spotlight-card.html +328 -0
  343. package/assets/video/examples/hf/spring-pop.html +406 -0
  344. package/assets/video/examples/hf/spring-stack-shuffle.html +791 -0
  345. package/assets/video/examples/hf/stagger-cascade.html +465 -0
  346. package/assets/video/examples/hf/stagger-lattice.html +278 -0
  347. package/assets/video/examples/hf/staggered-fade-up.html +368 -0
  348. package/assets/video/examples/hf/star-rating-fill.html +511 -0
  349. package/assets/video/examples/hf/starfield.html +450 -0
  350. package/assets/video/examples/hf/state-chip-rail.html +585 -0
  351. package/assets/video/examples/hf/sticky-mock-swap.html +664 -0
  352. package/assets/video/examples/hf/stitched-text-draw.html +1053 -0
  353. package/assets/video/examples/hf/stop-motion-cadence.html +670 -0
  354. package/assets/video/examples/hf/store-badge-lockup.html +521 -0
  355. package/assets/video/examples/hf/strands.html +258 -0
  356. package/assets/video/examples/hf/streaming-text.html +581 -0
  357. package/assets/video/examples/hf/strikethrough-replace.html +356 -0
  358. package/assets/video/examples/hf/stripes.html +258 -0
  359. package/assets/video/examples/hf/success-check.html +390 -0
  360. package/assets/video/examples/hf/sun-burst.html +258 -0
  361. package/assets/video/examples/hf/svg-line-draw-loader.html +257 -0
  362. package/assets/video/examples/hf/svg-mask-reveal.html +523 -0
  363. package/assets/video/examples/hf/svg-stroke-trace.html +465 -0
  364. package/assets/video/examples/hf/swipe-rail.html +564 -0
  365. package/assets/video/examples/hf/swirl-vortex.html +623 -0
  366. package/assets/video/examples/hf/swirl.html +258 -0
  367. package/assets/video/examples/hf/swiss-grid.html +837 -0
  368. package/assets/video/examples/hf/tabs-slide-indicator.html +424 -0
  369. package/assets/video/examples/hf/telemetry-hud.html +760 -0
  370. package/assets/video/examples/hf/terminal-simulator.html +293 -0
  371. package/assets/video/examples/hf/testimonial-card.html +545 -0
  372. package/assets/video/examples/hf/testimonial-proof-card.html +720 -0
  373. package/assets/video/examples/hf/text-match-cut.html +1345 -0
  374. package/assets/video/examples/hf/text-shimmer.html +394 -0
  375. package/assets/video/examples/hf/text-stagger.html +373 -0
  376. package/assets/video/examples/hf/text-state-swap.html +421 -0
  377. package/assets/video/examples/hf/thermal-distortion.html +624 -0
  378. package/assets/video/examples/hf/thin-film.html +258 -0
  379. package/assets/video/examples/hf/thread-message-stack.html +377 -0
  380. package/assets/video/examples/hf/three-orbiting-cards.html +322 -0
  381. package/assets/video/examples/hf/ticker-takeover.html +534 -0
  382. package/assets/video/examples/hf/tiktok-follow.html +435 -0
  383. package/assets/video/examples/hf/tilt-card.html +406 -0
  384. package/assets/video/examples/hf/titlecard-calm.html +388 -0
  385. package/assets/video/examples/hf/titlecard-lockup.html +546 -0
  386. package/assets/video/examples/hf/toggle-flip.html +601 -0
  387. package/assets/video/examples/hf/top-down-letters.html +326 -0
  388. package/assets/video/examples/hf/torn-paper-rip.html +762 -0
  389. package/assets/video/examples/hf/touch-indicator.html +777 -0
  390. package/assets/video/examples/hf/tracing-beam.html +608 -0
  391. package/assets/video/examples/hf/tracking-in.html +317 -0
  392. package/assets/video/examples/hf/transitions-3d.html +434 -0
  393. package/assets/video/examples/hf/transitions-blur.html +524 -0
  394. package/assets/video/examples/hf/transitions-cover.html +508 -0
  395. package/assets/video/examples/hf/transitions-destruction.html +551 -0
  396. package/assets/video/examples/hf/transitions-dissolve.html +529 -0
  397. package/assets/video/examples/hf/transitions-distortion.html +522 -0
  398. package/assets/video/examples/hf/transitions-grid.html +442 -0
  399. package/assets/video/examples/hf/transitions-light.html +528 -0
  400. package/assets/video/examples/hf/transitions-mechanical.html +560 -0
  401. package/assets/video/examples/hf/transitions-other.html +532 -0
  402. package/assets/video/examples/hf/transitions-push.html +520 -0
  403. package/assets/video/examples/hf/transitions-radial.html +492 -0
  404. package/assets/video/examples/hf/transitions-scale.html +487 -0
  405. package/assets/video/examples/hf/trust-strip.html +445 -0
  406. package/assets/video/examples/hf/typed-prompt.html +619 -0
  407. package/assets/video/examples/hf/typewriter.html +350 -0
  408. package/assets/video/examples/hf/typing-indicator.html +702 -0
  409. package/assets/video/examples/hf/ui-3d-reveal.html +2929 -0
  410. package/assets/video/examples/hf/ui-focus-zoom.html +786 -0
  411. package/assets/video/examples/hf/us-map-bubble.html +669 -0
  412. package/assets/video/examples/hf/us-map-flow.html +621 -0
  413. package/assets/video/examples/hf/us-map-hex.html +733 -0
  414. package/assets/video/examples/hf/us-map.html +591 -0
  415. package/assets/video/examples/hf/variable-font-flex.html +538 -0
  416. package/assets/video/examples/hf/vector-editor-rig.html +977 -0
  417. package/assets/video/examples/hf/vfx-anamorphic-flare.html +572 -0
  418. package/assets/video/examples/hf/vfx-iphone-device.html +1089 -0
  419. package/assets/video/examples/hf/vfx-liquid-background.html +1479 -0
  420. package/assets/video/examples/hf/vfx-liquid-glass.html +2054 -0
  421. package/assets/video/examples/hf/vfx-magnetic.html +660 -0
  422. package/assets/video/examples/hf/vfx-portal.html +1090 -0
  423. package/assets/video/examples/hf/vfx-shatter.html +1382 -0
  424. package/assets/video/examples/hf/vignette.html +385 -0
  425. package/assets/video/examples/hf/voronoi.html +258 -0
  426. package/assets/video/examples/hf/vox-annotate.html +707 -0
  427. package/assets/video/examples/hf/vpn-youtube-spot.html +1118 -0
  428. package/assets/video/examples/hf/water.html +258 -0
  429. package/assets/video/examples/hf/waveform.html +258 -0
  430. package/assets/video/examples/hf/week-in-merges.html +673 -0
  431. package/assets/video/examples/hf/weight-wave.html +531 -0
  432. package/assets/video/examples/hf/whip-pan-cut.html +668 -0
  433. package/assets/video/examples/hf/whip-pan.html +613 -0
  434. package/assets/video/examples/hf/whiteboard-ink.html +763 -0
  435. package/assets/video/examples/hf/wireframe-portal-title.html +3840 -0
  436. package/assets/video/examples/hf/wordmark-tiles.html +559 -0
  437. package/assets/video/examples/hf/world-map.html +623 -0
  438. package/assets/video/examples/hf/worley-noise.html +259 -0
  439. package/assets/video/examples/hf/x-follow-card.html +286 -0
  440. package/assets/video/examples/hf/x-post.html +611 -0
  441. package/assets/video/examples/hf/yt-camera-move.html +308 -0
  442. package/assets/video/examples/hf/yt-circle-pointer.html +301 -0
  443. package/assets/video/examples/hf/yt-comment-card.html +458 -0
  444. package/assets/video/examples/hf/yt-feather-highlight.html +279 -0
  445. package/assets/video/examples/hf/yt-lcd-background.html +446 -0
  446. package/assets/video/examples/hf/yt-logo-intro.html +390 -0
  447. package/assets/video/examples/hf/yt-lower-third.html +414 -0
  448. package/assets/video/examples/hf/yt-prism-title.html +343 -0
  449. package/assets/video/examples/hf/yt-screen-warp.html +257 -0
  450. package/assets/video/examples/hf/yt-vertical-fill.html +367 -0
  451. package/assets/video/examples/kinetic-type.html +137 -0
  452. package/assets/video/examples/motion-blur-streak.html +119 -0
  453. package/assets/video/examples/object-reveal.html +107 -0
  454. package/assets/video/examples/parallax-layers.html +130 -0
  455. package/assets/video/examples/particle-burst.html +157 -0
  456. package/assets/video/examples/pen-draw.html +146 -0
  457. package/assets/video/examples/shape-morph.html +151 -0
  458. package/assets/video/examples/slam-title.html +125 -0
  459. package/assets/video/examples/speed-lines.html +123 -0
  460. package/assets/video/examples/spring-pop.html +129 -0
  461. package/assets/video/examples/streak-wipe.html +78 -0
  462. package/assets/video/examples/three-chrome-knot.html +155 -0
  463. package/assets/video/examples/three-clay.html +138 -0
  464. package/assets/video/examples/three-cube-wave.html +140 -0
  465. package/assets/video/examples/three-extruded-shape.html +148 -0
  466. package/assets/video/examples/type-on.html +128 -0
  467. package/assets/video/motion.js +991 -0
  468. package/assets/video/screen.js +298 -0
  469. package/assets/video/sfx/catalogue.json +2283 -0
  470. package/dist/cli.js +35440 -2563
  471. package/dist/index.js +35143 -2437
  472. package/dist/types/args.d.ts +2 -0
  473. package/dist/types/cloud/service.d.ts +13 -0
  474. package/dist/types/commands/usage.d.ts +2 -0
  475. package/dist/types/commands/video.d.ts +10 -0
  476. package/dist/types/cpu-budget.d.ts +43 -0
  477. package/dist/types/images/batch-jobs.d.ts +2 -0
  478. package/dist/types/images/batch-run.d.ts +2 -1
  479. package/dist/types/images/jobs.d.ts +7 -0
  480. package/dist/types/images/pending.d.ts +40 -0
  481. package/dist/types/images/retry.d.ts +4 -1
  482. package/dist/types/images/run.d.ts +9 -1
  483. package/dist/types/node-runtime.d.ts +6 -1
  484. package/dist/types/providers/api.d.ts +9 -0
  485. package/dist/types/providers/base.d.ts +2 -0
  486. package/dist/types/providers/cli-generate.d.ts +5 -1
  487. package/dist/types/providers/cli-pending.d.ts +24 -0
  488. package/dist/types/providers/errors.d.ts +2 -1
  489. package/dist/types/providers/ledger.d.ts +10 -6
  490. package/dist/types/providers/popost-async.d.ts +35 -0
  491. package/dist/types/providers/popost-tasks.d.ts +16 -5
  492. package/dist/types/providers/popost.d.ts +16 -1
  493. package/dist/types/providers/task.d.ts +43 -0
  494. package/dist/types/render/browser.d.ts +16 -2
  495. package/dist/types/runtime.d.ts +73 -2
  496. package/dist/types/version.d.ts +1 -1
  497. package/dist/types/video/align/index.d.ts +43 -0
  498. package/dist/types/video/capture/director.d.ts +70 -0
  499. package/dist/types/video/capture/index.d.ts +141 -0
  500. package/dist/types/video/capture/stage.d.ts +99 -0
  501. package/dist/types/video/capture/steps.d.ts +138 -0
  502. package/dist/types/video/commands/cast.d.ts +3 -0
  503. package/dist/types/video/commands/clips.d.ts +2 -0
  504. package/dist/types/video/commands/compare-scope.d.ts +7 -0
  505. package/dist/types/video/commands/credits.d.ts +19 -0
  506. package/dist/types/video/commands/elements.d.ts +22 -0
  507. package/dist/types/video/commands/eval.d.ts +2 -0
  508. package/dist/types/video/commands/example.d.ts +1 -0
  509. package/dist/types/video/commands/generate.d.ts +14 -0
  510. package/dist/types/video/commands/loop-shared.d.ts +12 -0
  511. package/dist/types/video/commands/loop.d.ts +4 -0
  512. package/dist/types/video/commands/make.d.ts +9 -0
  513. package/dist/types/video/commands/materials.d.ts +1 -0
  514. package/dist/types/video/commands/measure.d.ts +2 -0
  515. package/dist/types/video/commands/media.d.ts +2 -0
  516. package/dist/types/video/commands/music-plan.d.ts +1 -0
  517. package/dist/types/video/commands/music.d.ts +2 -0
  518. package/dist/types/video/commands/read.d.ts +19 -0
  519. package/dist/types/video/commands/replication.d.ts +2 -0
  520. package/dist/types/video/commands/sfx-extract.d.ts +2 -0
  521. package/dist/types/video/commands/sfx-place.d.ts +3 -0
  522. package/dist/types/video/commands/sfx.d.ts +2 -0
  523. package/dist/types/video/commands/shared.d.ts +39 -0
  524. package/dist/types/video/commands/source.d.ts +2 -0
  525. package/dist/types/video/commands/speech-check.d.ts +1 -0
  526. package/dist/types/video/commands/speech-kind.d.ts +6 -0
  527. package/dist/types/video/commands/template.d.ts +10 -0
  528. package/dist/types/video/commands/voice-profile.d.ts +2 -0
  529. package/dist/types/video/commands/voice-sample.d.ts +1 -0
  530. package/dist/types/video/compile/footage.d.ts +36 -0
  531. package/dist/types/video/compile/index.d.ts +30 -0
  532. package/dist/types/video/compile/page-bundle.d.ts +1 -0
  533. package/dist/types/video/compile/page.d.ts +10 -0
  534. package/dist/types/video/compile/words.d.ts +9 -0
  535. package/dist/types/video/describe/aim.d.ts +20 -0
  536. package/dist/types/video/describe/beats.d.ts +53 -0
  537. package/dist/types/video/describe/curves.d.ts +27 -0
  538. package/dist/types/video/describe/frames.d.ts +62 -0
  539. package/dist/types/video/describe/index.d.ts +34 -0
  540. package/dist/types/video/describe/inset.d.ts +83 -0
  541. package/dist/types/video/describe/kind.d.ts +29 -0
  542. package/dist/types/video/describe/known.d.ts +31 -0
  543. package/dist/types/video/describe/movement.d.ts +17 -0
  544. package/dist/types/video/describe/parts.d.ts +50 -0
  545. package/dist/types/video/describe/paths.d.ts +21 -0
  546. package/dist/types/video/describe/speech-kind.d.ts +144 -0
  547. package/dist/types/video/describe/unrecovered.d.ts +29 -0
  548. package/dist/types/video/draft/build.d.ts +34 -0
  549. package/dist/types/video/draft/export.d.ts +19 -0
  550. package/dist/types/video/draft/lifecycle.d.ts +9 -0
  551. package/dist/types/video/draft/native.d.ts +27 -0
  552. package/dist/types/video/draft/schema.d.ts +316 -0
  553. package/dist/types/video/draft/targets.d.ts +19 -0
  554. package/dist/types/video/elements/caption-reading.d.ts +9 -0
  555. package/dist/types/video/elements/caption-roles.d.ts +6 -0
  556. package/dist/types/video/elements/carry.d.ts +45 -0
  557. package/dist/types/video/elements/check.d.ts +14 -0
  558. package/dist/types/video/elements/findings.d.ts +49 -0
  559. package/dist/types/video/elements/main.d.ts +54 -0
  560. package/dist/types/video/elements/picture.d.ts +31 -0
  561. package/dist/types/video/elements/questions.d.ts +35 -0
  562. package/dist/types/video/elements/read.d.ts +14 -0
  563. package/dist/types/video/elements/status.d.ts +23 -0
  564. package/dist/types/video/elements/types.d.ts +120 -0
  565. package/dist/types/video/eval/contrast.d.ts +136 -0
  566. package/dist/types/video/eval/dataset.d.ts +21 -0
  567. package/dist/types/video/eval/floor.d.ts +27 -0
  568. package/dist/types/video/eval/ledger.d.ts +27 -0
  569. package/dist/types/video/eval/legibility.d.ts +33 -0
  570. package/dist/types/video/eval/readback-frames.d.ts +41 -0
  571. package/dist/types/video/eval/readback-run.d.ts +54 -0
  572. package/dist/types/video/eval/readback.d.ts +48 -0
  573. package/dist/types/video/eval/roundtrip.d.ts +71 -0
  574. package/dist/types/video/generate/approved.d.ts +74 -0
  575. package/dist/types/video/generate/cast.d.ts +56 -0
  576. package/dist/types/video/generate/character.d.ts +14 -0
  577. package/dist/types/video/generate/clip-sound.d.ts +63 -0
  578. package/dist/types/video/generate/cloud-image.d.ts +12 -0
  579. package/dist/types/video/generate/cloud.d.ts +67 -0
  580. package/dist/types/video/generate/dialogue.d.ts +116 -0
  581. package/dist/types/video/generate/index.d.ts +265 -0
  582. package/dist/types/video/generate/provenance.d.ts +11 -0
  583. package/dist/types/video/generate/speech-lock.d.ts +4 -0
  584. package/dist/types/video/generate/speech.d.ts +20 -0
  585. package/dist/types/video/host.d.ts +42 -0
  586. package/dist/types/video/hosted-api.d.ts +161 -0
  587. package/dist/types/video/look/index.d.ts +67 -0
  588. package/dist/types/video/look/like.d.ts +18 -0
  589. package/dist/types/video/look/sheets.d.ts +58 -0
  590. package/dist/types/video/measure/align.d.ts +33 -0
  591. package/dist/types/video/measure/amount.d.ts +52 -0
  592. package/dist/types/video/measure/bars.d.ts +22 -0
  593. package/dist/types/video/measure/boundaries.d.ts +18 -0
  594. package/dist/types/video/measure/cache.d.ts +6 -0
  595. package/dist/types/video/measure/camera.d.ts +21 -0
  596. package/dist/types/video/measure/colour.d.ts +12 -0
  597. package/dist/types/video/measure/curve.d.ts +29 -0
  598. package/dist/types/video/measure/cuts.d.ts +17 -0
  599. package/dist/types/video/measure/easing.d.ts +52 -0
  600. package/dist/types/video/measure/fill.d.ts +20 -0
  601. package/dist/types/video/measure/fits.d.ts +80 -0
  602. package/dist/types/video/measure/gradual.d.ts +23 -0
  603. package/dist/types/video/measure/index.d.ts +28 -0
  604. package/dist/types/video/measure/kinds.d.ts +71 -0
  605. package/dist/types/video/measure/motion.d.ts +26 -0
  606. package/dist/types/video/measure/move.d.ts +90 -0
  607. package/dist/types/video/measure/moves.d.ts +22 -0
  608. package/dist/types/video/measure/orientation.d.ts +11 -0
  609. package/dist/types/video/measure/pixels.d.ts +41 -0
  610. package/dist/types/video/measure/profile.d.ts +53 -0
  611. package/dist/types/video/measure/reveal.d.ts +48 -0
  612. package/dist/types/video/measure/rhythm.d.ts +7 -0
  613. package/dist/types/video/measure/robust.d.ts +18 -0
  614. package/dist/types/video/measure/signals.d.ts +48 -0
  615. package/dist/types/video/measure/signature.d.ts +10 -0
  616. package/dist/types/video/measure/span.d.ts +28 -0
  617. package/dist/types/video/measure/still-shots.d.ts +40 -0
  618. package/dist/types/video/measure/switch.d.ts +101 -0
  619. package/dist/types/video/measure/tracks.d.ts +20 -0
  620. package/dist/types/video/measure/unmix.d.ts +20 -0
  621. package/dist/types/video/media/decode.d.ts +59 -0
  622. package/dist/types/video/media/ffmpeg.d.ts +48 -0
  623. package/dist/types/video/media/footage.d.ts +53 -0
  624. package/dist/types/video/media/screenshot.d.ts +26 -0
  625. package/dist/types/video/media/selection.d.ts +4 -0
  626. package/dist/types/video/media/wav.d.ts +26 -0
  627. package/dist/types/video/music/hosted.d.ts +110 -0
  628. package/dist/types/video/music/plan.d.ts +103 -0
  629. package/dist/types/video/music/provenance.d.ts +86 -0
  630. package/dist/types/video/page/apply.d.ts +9 -0
  631. package/dist/types/video/page/contract.d.ts +150 -0
  632. package/dist/types/video/page/css.d.ts +9 -0
  633. package/dist/types/video/page/dom.d.ts +51 -0
  634. package/dist/types/video/page/fit.d.ts +13 -0
  635. package/dist/types/video/page/layout.d.ts +8 -0
  636. package/dist/types/video/page/main.d.ts +1 -0
  637. package/dist/types/video/page/scene.d.ts +38 -0
  638. package/dist/types/video/page/texts.d.ts +10 -0
  639. package/dist/types/video/page/words.d.ts +39 -0
  640. package/dist/types/video/paid-download.d.ts +19 -0
  641. package/dist/types/video/plan/ask.d.ts +77 -0
  642. package/dist/types/video/plan/generated.d.ts +29 -0
  643. package/dist/types/video/plan/index.d.ts +6 -0
  644. package/dist/types/video/plan/materials.d.ts +22 -0
  645. package/dist/types/video/plan/model.d.ts +59 -0
  646. package/dist/types/video/plan/prompt.d.ts +41 -0
  647. package/dist/types/video/plan/see.d.ts +35 -0
  648. package/dist/types/video/presets/camera.d.ts +27 -0
  649. package/dist/types/video/presets/easing.d.ts +11 -0
  650. package/dist/types/video/presets/fill.d.ts +16 -0
  651. package/dist/types/video/presets/loop.d.ts +20 -0
  652. package/dist/types/video/presets/motion.d.ts +47 -0
  653. package/dist/types/video/presets/spoken.d.ts +35 -0
  654. package/dist/types/video/presets/text-styles.d.ts +44 -0
  655. package/dist/types/video/presets/transition.d.ts +66 -0
  656. package/dist/types/video/preview/cloud.d.ts +13 -0
  657. package/dist/types/video/preview/edit/check.d.ts +15 -0
  658. package/dist/types/video/preview/edit/editor.d.ts +52 -0
  659. package/dist/types/video/preview/edit/ops.d.ts +52 -0
  660. package/dist/types/video/preview/edit/render.d.ts +11 -0
  661. package/dist/types/video/preview/edit/retime.d.ts +2 -0
  662. package/dist/types/video/preview/edit/routes.d.ts +1106 -0
  663. package/dist/types/video/preview/export-settings.d.ts +25 -0
  664. package/dist/types/video/preview/files.d.ts +25 -0
  665. package/dist/types/video/preview/html.d.ts +9 -0
  666. package/dist/types/video/preview/index.d.ts +20 -0
  667. package/dist/types/video/preview/project.d.ts +48 -0
  668. package/dist/types/video/preview/protocol.d.ts +91 -0
  669. package/dist/types/video/preview/server.d.ts +21 -0
  670. package/dist/types/video/preview/shell/app.d.ts +81 -0
  671. package/dist/types/video/preview/shell/dom.d.ts +40 -0
  672. package/dist/types/video/preview/shell/edit/controller.d.ts +32 -0
  673. package/dist/types/video/preview/shell/edit/fields.d.ts +49 -0
  674. package/dist/types/video/preview/shell/edit/form-parts.d.ts +17 -0
  675. package/dist/types/video/preview/shell/edit/form.d.ts +17 -0
  676. package/dist/types/video/preview/shell/edit/inline.d.ts +4 -0
  677. package/dist/types/video/preview/shell/edit/lanes-edit.d.ts +31 -0
  678. package/dist/types/video/preview/shell/edit/layer-order.d.ts +4 -0
  679. package/dist/types/video/preview/shell/edit/remove.d.ts +4 -0
  680. package/dist/types/video/preview/shell/edit/reveal.d.ts +4 -0
  681. package/dist/types/video/preview/shell/edit/scenes.d.ts +7 -0
  682. package/dist/types/video/preview/shell/edit/schema.d.ts +30 -0
  683. package/dist/types/video/preview/shell/edit/source.d.ts +83 -0
  684. package/dist/types/video/preview/shell/edit/split.d.ts +8 -0
  685. package/dist/types/video/preview/shell/edit/stage-edit.d.ts +21 -0
  686. package/dist/types/video/preview/shell/edit/text-fit.d.ts +4 -0
  687. package/dist/types/video/preview/shell/edit/toolbar.d.ts +14 -0
  688. package/dist/types/video/preview/shell/footage.d.ts +6 -0
  689. package/dist/types/video/preview/shell/i18n.d.ts +176 -0
  690. package/dist/types/video/preview/shell/lanes.d.ts +2 -0
  691. package/dist/types/video/preview/shell/main.d.ts +1 -0
  692. package/dist/types/video/preview/shell/model.d.ts +85 -0
  693. package/dist/types/video/preview/shell/panel.d.ts +3 -0
  694. package/dist/types/video/preview/shell/readonly.d.ts +1 -0
  695. package/dist/types/video/preview/shell/stage.d.ts +7 -0
  696. package/dist/types/video/preview/shell/studio/audio.d.ts +3 -0
  697. package/dist/types/video/preview/shell/studio/cloud.d.ts +3 -0
  698. package/dist/types/video/preview/shell/studio/code.d.ts +6 -0
  699. package/dist/types/video/preview/shell/studio/copy.d.ts +159 -0
  700. package/dist/types/video/preview/shell/studio/draft-result.d.ts +3 -0
  701. package/dist/types/video/preview/shell/studio/export.d.ts +3 -0
  702. package/dist/types/video/preview/shell/studio/scene-selection.d.ts +19 -0
  703. package/dist/types/video/preview/shell/studio/sidebar.d.ts +27 -0
  704. package/dist/types/video/preview/shell/studio/style.d.ts +2 -0
  705. package/dist/types/video/preview/shell/studio/timeline.d.ts +3 -0
  706. package/dist/types/video/preview/shell/studio/ui.d.ts +16 -0
  707. package/dist/types/video/preview/shell/studio/workspace.d.ts +11 -0
  708. package/dist/types/video/preview/shell/style.d.ts +5 -0
  709. package/dist/types/video/preview/shell/transport.d.ts +6 -0
  710. package/dist/types/video/preview/shell-bundle.d.ts +1 -0
  711. package/dist/types/video/preview/studio-actions.d.ts +4 -0
  712. package/dist/types/video/preview/studio-data.d.ts +32 -0
  713. package/dist/types/video/preview/thumbnails.d.ts +5 -0
  714. package/dist/types/video/preview/watch.d.ts +23 -0
  715. package/dist/types/video/progress.d.ts +28 -0
  716. package/dist/types/video/project/check-camera.d.ts +8 -0
  717. package/dist/types/video/project/check-caption.d.ts +8 -0
  718. package/dist/types/video/project/check-common.d.ts +25 -0
  719. package/dist/types/video/project/check-footage.d.ts +22 -0
  720. package/dist/types/video/project/check-look.d.ts +19 -0
  721. package/dist/types/video/project/check-sound.d.ts +54 -0
  722. package/dist/types/video/project/check-span.d.ts +11 -0
  723. package/dist/types/video/project/check-tracks.d.ts +8 -0
  724. package/dist/types/video/project/check-transition.d.ts +11 -0
  725. package/dist/types/video/project/check-words.d.ts +32 -0
  726. package/dist/types/video/project/check.d.ts +42 -0
  727. package/dist/types/video/project/issues.d.ts +43 -0
  728. package/dist/types/video/project/schema.d.ts +2074 -0
  729. package/dist/types/video/project/suggest.d.ts +4 -0
  730. package/dist/types/video/project/words.d.ts +6 -0
  731. package/dist/types/video/render/browser-step.d.ts +5 -0
  732. package/dist/types/video/render/encode.d.ts +49 -0
  733. package/dist/types/video/render/index.d.ts +90 -0
  734. package/dist/types/video/render/layout.d.ts +26 -0
  735. package/dist/types/video/render/record.d.ts +80 -0
  736. package/dist/types/video/render/session.d.ts +64 -0
  737. package/dist/types/video/render/verify.d.ts +16 -0
  738. package/dist/types/video/replication/audio-provenance.d.ts +36 -0
  739. package/dist/types/video/replication/browser.d.ts +1 -0
  740. package/dist/types/video/replication/check.d.ts +19 -0
  741. package/dist/types/video/replication/contract.d.ts +683 -0
  742. package/dist/types/video/replication/io.d.ts +22 -0
  743. package/dist/types/video/replication/motion-bundle.d.ts +1 -0
  744. package/dist/types/video/replication/motion.d.ts +109 -0
  745. package/dist/types/video/replication/pairs.d.ts +69 -0
  746. package/dist/types/video/replication/prefill.d.ts +34 -0
  747. package/dist/types/video/replication/production.d.ts +163 -0
  748. package/dist/types/video/replication/revision.d.ts +2 -0
  749. package/dist/types/video/replication/schema.d.ts +56 -0
  750. package/dist/types/video/replication/source-clock.d.ts +24 -0
  751. package/dist/types/video/replication/speech-observed.d.ts +121 -0
  752. package/dist/types/video/replication/voice-spans.d.ts +3 -0
  753. package/dist/types/video/retarget/caption-look.d.ts +14 -0
  754. package/dist/types/video/retarget/fps.d.ts +7 -0
  755. package/dist/types/video/retarget/index.d.ts +248 -0
  756. package/dist/types/video/retarget/items.d.ts +44 -0
  757. package/dist/types/video/retarget/marks.d.ts +12 -0
  758. package/dist/types/video/retarget/pace.d.ts +36 -0
  759. package/dist/types/video/retarget/speak.d.ts +41 -0
  760. package/dist/types/video/retarget/tempo.d.ts +40 -0
  761. package/dist/types/video/retarget/titles.d.ts +76 -0
  762. package/dist/types/video/retarget/words.d.ts +39 -0
  763. package/dist/types/video/scene/author.d.ts +74 -0
  764. package/dist/types/video/scene/check.d.ts +64 -0
  765. package/dist/types/video/scene/copied.d.ts +30 -0
  766. package/dist/types/video/scene/cues.d.ts +40 -0
  767. package/dist/types/video/scene/examples.d.ts +129 -0
  768. package/dist/types/video/scene/findings.d.ts +71 -0
  769. package/dist/types/video/scene/fonts.d.ts +19 -0
  770. package/dist/types/video/scene/items.d.ts +23 -0
  771. package/dist/types/video/scene/library.d.ts +41 -0
  772. package/dist/types/video/scene/lint.d.ts +15 -0
  773. package/dist/types/video/scene/numbers.d.ts +39 -0
  774. package/dist/types/video/scene/pictures.d.ts +12 -0
  775. package/dist/types/video/scene/write.d.ts +41 -0
  776. package/dist/types/video/score/index.d.ts +13 -0
  777. package/dist/types/video/score/pair.d.ts +43 -0
  778. package/dist/types/video/score/picture.d.ts +14 -0
  779. package/dist/types/video/score/project-windows.d.ts +9 -0
  780. package/dist/types/video/score/shot-transition.d.ts +62 -0
  781. package/dist/types/video/score/shots.d.ts +101 -0
  782. package/dist/types/video/score/time.d.ts +22 -0
  783. package/dist/types/video/score/tracks.d.ts +42 -0
  784. package/dist/types/video/score/weights.d.ts +19 -0
  785. package/dist/types/video/sfx/cache.d.ts +16 -0
  786. package/dist/types/video/sfx/catalogue.d.ts +64 -0
  787. package/dist/types/video/sfx/extract.d.ts +65 -0
  788. package/dist/types/video/sfx/levels.d.ts +39 -0
  789. package/dist/types/video/sfx/library.d.ts +26 -0
  790. package/dist/types/video/sfx/place.d.ts +82 -0
  791. package/dist/types/video/sfx/project.d.ts +36 -0
  792. package/dist/types/video/sound/analysis.d.ts +46 -0
  793. package/dist/types/video/sound/breaks.d.ts +84 -0
  794. package/dist/types/video/sound/measure.d.ts +106 -0
  795. package/dist/types/video/sound/modes.d.ts +75 -0
  796. package/dist/types/video/sound/pcm.d.ts +21 -0
  797. package/dist/types/video/sound/reading.d.ts +124 -0
  798. package/dist/types/video/sound/speech-check.d.ts +76 -0
  799. package/dist/types/video/source/collect.d.ts +64 -0
  800. package/dist/types/video/source/read.d.ts +57 -0
  801. package/dist/types/video/source/used.d.ts +4 -0
  802. package/dist/types/video/speech/hosted.d.ts +36 -0
  803. package/dist/types/video/speech/index.d.ts +83 -0
  804. package/dist/types/video/speech/types.d.ts +41 -0
  805. package/dist/types/video/submit-retry.d.ts +15 -0
  806. package/dist/types/video/synth/generate.d.ts +53 -0
  807. package/dist/types/video/synth/truth.d.ts +8 -0
  808. package/dist/types/video/synth/write.d.ts +13 -0
  809. package/dist/types/video/template/capacity.d.ts +37 -0
  810. package/dist/types/video/template/card-elements.d.ts +17 -0
  811. package/dist/types/video/template/card.d.ts +22 -0
  812. package/dist/types/video/template/check-captions.d.ts +11 -0
  813. package/dist/types/video/template/check.d.ts +40 -0
  814. package/dist/types/video/template/facts.d.ts +90 -0
  815. package/dist/types/video/template/fill.d.ts +51 -0
  816. package/dist/types/video/template/fingerprint.d.ts +2 -0
  817. package/dist/types/video/template/fit.d.ts +60 -0
  818. package/dist/types/video/template/index.d.ts +8 -0
  819. package/dist/types/video/template/project.d.ts +21 -0
  820. package/dist/types/video/template/save.d.ts +52 -0
  821. package/dist/types/video/template/slots.d.ts +26 -0
  822. package/dist/types/video/template/speech-rules.d.ts +61 -0
  823. package/dist/types/video/template/split.d.ts +10 -0
  824. package/dist/types/video/template/structure.d.ts +81 -0
  825. package/dist/types/video/template/swap.d.ts +33 -0
  826. package/dist/types/video/template/types.d.ts +387 -0
  827. package/dist/types/video/text/bar.d.ts +63 -0
  828. package/dist/types/video/text/change.d.ts +19 -0
  829. package/dist/types/video/text/core.d.ts +25 -0
  830. package/dist/types/video/text/cues.d.ts +26 -0
  831. package/dist/types/video/text/fold.d.ts +9 -0
  832. package/dist/types/video/text/frame.d.ts +41 -0
  833. package/dist/types/video/text/highlight.d.ts +19 -0
  834. package/dist/types/video/text/index.d.ts +67 -0
  835. package/dist/types/video/text/letters.d.ts +85 -0
  836. package/dist/types/video/text/look.d.ts +53 -0
  837. package/dist/types/video/text/reader-command.d.ts +26 -0
  838. package/dist/types/video/text/reveal.d.ts +37 -0
  839. package/dist/types/video/text/rings.d.ts +39 -0
  840. package/dist/types/video/text/shadow.d.ts +44 -0
  841. package/dist/types/video/text/share.d.ts +2 -0
  842. package/dist/types/video/text/speech.d.ts +15 -0
  843. package/dist/types/video/text/strokes.d.ts +30 -0
  844. package/dist/types/video/text/types.d.ts +147 -0
  845. package/dist/types/video/timeline/cue-words.d.ts +27 -0
  846. package/dist/types/video/timeline/footage.d.ts +25 -0
  847. package/dist/types/video/timeline/frame.d.ts +55 -0
  848. package/dist/types/video/timeline/items.d.ts +28 -0
  849. package/dist/types/video/timeline/mix.d.ts +67 -0
  850. package/dist/types/video/timeline/resolve.d.ts +20 -0
  851. package/dist/types/video/timeline/spans.d.ts +32 -0
  852. package/dist/types/video/timeline/words.d.ts +64 -0
  853. package/dist/types/video/tool.d.ts +29 -0
  854. package/dist/types/video/types.d.ts +1057 -0
  855. package/dist/types/video/voice/create.d.ts +43 -0
  856. package/dist/types/video/voice/hosted.d.ts +36 -0
  857. package/dist/types/video/voice/index.d.ts +61 -0
  858. package/dist/types/video/voice/pace.d.ts +37 -0
  859. package/dist/types/video/voice/profile.d.ts +26 -0
  860. package/dist/types/video/voice/sample.d.ts +46 -0
  861. package/dist/types/video/wallet.d.ts +38 -0
  862. package/dist/types/video/work.d.ts +10 -0
  863. package/dist/types/workflow/post-bundle.d.ts +2 -2
  864. package/package.json +13 -4
  865. package/references/image-workflow.md +111 -0
  866. package/references/onboarding.md +50 -19
  867. package/references/post-bundle.md +1 -1
  868. package/references/providers.md +5 -2
  869. package/references/video-draft-export.md +13 -0
  870. package/references/video-editing.md +43 -0
  871. package/references/video-effects.md +605 -0
  872. package/references/video-elements.md +199 -0
  873. package/references/video-examples/showcase/assets/pattern.svg +18 -0
  874. package/references/video-examples/showcase/assets/voice.sbg +4 -0
  875. package/references/video-examples/showcase/assets/voice.words.json +68 -0
  876. package/references/video-examples/showcase/video.json +550 -0
  877. package/references/video-examples/template-demo/TEMPLATE.md +30 -0
  878. package/references/video-examples/template-demo/fill.json +29 -0
  879. package/references/video-examples/template-demo/slots.json +210 -0
  880. package/references/video-examples/template-demo/template.json +105 -0
  881. package/references/video-motion.md +315 -0
  882. package/references/video-native-observation.md +37 -0
  883. package/references/video-performers.md +86 -0
  884. package/references/video-project.md +63 -0
  885. package/references/video-replication.md +276 -0
  886. package/references/video-scenes.md +366 -0
  887. package/references/video-sfx.md +109 -0
  888. package/references/video-sound.md +207 -0
  889. package/references/video-templates.md +177 -0
  890. package/references/video-tools.md +560 -0
  891. package/references/video.md +756 -0
  892. package/templates/community/README.md +274 -1
  893. package/templates/community/index.json +3829 -0
  894. package/templates/community/instagram-age-expectations/README.md +14 -0
  895. package/templates/community/instagram-age-expectations/SKILL.md +52 -0
  896. package/templates/community/instagram-age-expectations/source.json +9 -0
  897. package/templates/community/instagram-age-expectations/template.json +53 -0
  898. package/templates/community/instagram-artwork-detail/README.md +19 -0
  899. package/templates/community/instagram-artwork-detail/SKILL.md +53 -0
  900. package/templates/community/instagram-artwork-detail/source.json +9 -0
  901. package/templates/community/instagram-artwork-detail/template.json +61 -0
  902. package/templates/community/instagram-balanced-traits/README.md +12 -0
  903. package/templates/community/instagram-balanced-traits/SKILL.md +52 -0
  904. package/templates/community/instagram-balanced-traits/source.json +9 -0
  905. package/templates/community/instagram-balanced-traits/template.json +53 -0
  906. package/templates/community/instagram-behind-the-scenes/README.md +12 -0
  907. package/templates/community/instagram-behind-the-scenes/SKILL.md +53 -0
  908. package/templates/community/instagram-behind-the-scenes/source.json +9 -0
  909. package/templates/community/instagram-behind-the-scenes/template.json +52 -0
  910. package/templates/community/instagram-brand-personification/README.md +26 -0
  911. package/templates/community/instagram-brand-personification/SKILL.md +53 -0
  912. package/templates/community/instagram-brand-personification/source.json +9 -0
  913. package/templates/community/instagram-brand-personification/template.json +66 -0
  914. package/templates/community/instagram-brand-system/README.md +17 -0
  915. package/templates/community/instagram-brand-system/SKILL.md +53 -0
  916. package/templates/community/instagram-brand-system/source.json +9 -0
  917. package/templates/community/instagram-brand-system/template.json +60 -0
  918. package/templates/community/instagram-calendar-cheat-sheet/README.md +8 -0
  919. package/templates/community/instagram-calendar-cheat-sheet/SKILL.md +53 -0
  920. package/templates/community/instagram-calendar-cheat-sheet/source.json +9 -0
  921. package/templates/community/instagram-calendar-cheat-sheet/template.json +47 -0
  922. package/templates/community/instagram-capacity-planning/README.md +12 -0
  923. package/templates/community/instagram-capacity-planning/SKILL.md +53 -0
  924. package/templates/community/instagram-capacity-planning/source.json +9 -0
  925. package/templates/community/instagram-capacity-planning/template.json +55 -0
  926. package/templates/community/instagram-category-use-guide/README.md +14 -0
  927. package/templates/community/instagram-category-use-guide/SKILL.md +53 -0
  928. package/templates/community/instagram-category-use-guide/source.json +9 -0
  929. package/templates/community/instagram-category-use-guide/template.json +55 -0
  930. package/templates/community/instagram-character-led-tour/README.md +17 -0
  931. package/templates/community/instagram-character-led-tour/SKILL.md +53 -0
  932. package/templates/community/instagram-character-led-tour/source.json +9 -0
  933. package/templates/community/instagram-character-led-tour/template.json +56 -0
  934. package/templates/community/instagram-comic-dialogue/README.md +16 -0
  935. package/templates/community/instagram-comic-dialogue/SKILL.md +53 -0
  936. package/templates/community/instagram-comic-dialogue/source.json +9 -0
  937. package/templates/community/instagram-comic-dialogue/template.json +59 -0
  938. package/templates/community/instagram-command-shortcuts/README.md +13 -0
  939. package/templates/community/instagram-command-shortcuts/SKILL.md +53 -0
  940. package/templates/community/instagram-command-shortcuts/source.json +9 -0
  941. package/templates/community/instagram-command-shortcuts/template.json +52 -0
  942. package/templates/community/instagram-context-changes-meaning/README.md +11 -0
  943. package/templates/community/instagram-context-changes-meaning/SKILL.md +53 -0
  944. package/templates/community/instagram-context-changes-meaning/source.json +9 -0
  945. package/templates/community/instagram-context-changes-meaning/template.json +54 -0
  946. package/templates/community/instagram-continuous-canvas/README.md +16 -0
  947. package/templates/community/instagram-continuous-canvas/SKILL.md +52 -0
  948. package/templates/community/instagram-continuous-canvas/source.json +9 -0
  949. package/templates/community/instagram-continuous-canvas/template.json +59 -0
  950. package/templates/community/instagram-conversation-questions/README.md +12 -0
  951. package/templates/community/instagram-conversation-questions/SKILL.md +52 -0
  952. package/templates/community/instagram-conversation-questions/source.json +9 -0
  953. package/templates/community/instagram-conversation-questions/template.json +51 -0
  954. package/templates/community/instagram-copy-alternatives/README.md +11 -0
  955. package/templates/community/instagram-copy-alternatives/SKILL.md +53 -0
  956. package/templates/community/instagram-copy-alternatives/source.json +9 -0
  957. package/templates/community/instagram-copy-alternatives/template.json +50 -0
  958. package/templates/community/instagram-copyable-notes/README.md +13 -0
  959. package/templates/community/instagram-copyable-notes/SKILL.md +52 -0
  960. package/templates/community/instagram-copyable-notes/source.json +9 -0
  961. package/templates/community/instagram-copyable-notes/template.json +51 -0
  962. package/templates/community/instagram-curated-resources/README.md +13 -0
  963. package/templates/community/instagram-curated-resources/SKILL.md +52 -0
  964. package/templates/community/instagram-curated-resources/source.json +9 -0
  965. package/templates/community/instagram-curated-resources/template.json +54 -0
  966. package/templates/community/instagram-destination-costs/README.md +17 -0
  967. package/templates/community/instagram-destination-costs/SKILL.md +52 -0
  968. package/templates/community/instagram-destination-costs/source.json +9 -0
  969. package/templates/community/instagram-destination-costs/template.json +56 -0
  970. package/templates/community/instagram-diagram-reference/README.md +10 -0
  971. package/templates/community/instagram-diagram-reference/SKILL.md +53 -0
  972. package/templates/community/instagram-diagram-reference/source.json +9 -0
  973. package/templates/community/instagram-diagram-reference/template.json +52 -0
  974. package/templates/community/instagram-different-perspectives/README.md +15 -0
  975. package/templates/community/instagram-different-perspectives/SKILL.md +53 -0
  976. package/templates/community/instagram-different-perspectives/source.json +9 -0
  977. package/templates/community/instagram-different-perspectives/template.json +55 -0
  978. package/templates/community/instagram-document-reveal/README.md +8 -0
  979. package/templates/community/instagram-document-reveal/SKILL.md +53 -0
  980. package/templates/community/instagram-document-reveal/source.json +9 -0
  981. package/templates/community/instagram-document-reveal/template.json +46 -0
  982. package/templates/community/instagram-effect-breakdown/README.md +14 -0
  983. package/templates/community/instagram-effect-breakdown/SKILL.md +53 -0
  984. package/templates/community/instagram-effect-breakdown/source.json +9 -0
  985. package/templates/community/instagram-effect-breakdown/template.json +55 -0
  986. package/templates/community/instagram-effort-and-outcome/README.md +13 -0
  987. package/templates/community/instagram-effort-and-outcome/SKILL.md +52 -0
  988. package/templates/community/instagram-effort-and-outcome/source.json +9 -0
  989. package/templates/community/instagram-effort-and-outcome/template.json +54 -0
  990. package/templates/community/instagram-emotion-and-meaning/README.md +16 -0
  991. package/templates/community/instagram-emotion-and-meaning/SKILL.md +52 -0
  992. package/templates/community/instagram-emotion-and-meaning/source.json +9 -0
  993. package/templates/community/instagram-emotion-and-meaning/template.json +56 -0
  994. package/templates/community/instagram-everyday-interface-story/README.md +12 -0
  995. package/templates/community/instagram-everyday-interface-story/SKILL.md +53 -0
  996. package/templates/community/instagram-everyday-interface-story/source.json +9 -0
  997. package/templates/community/instagram-everyday-interface-story/template.json +51 -0
  998. package/templates/community/instagram-everyday-photo-diary/README.md +16 -0
  999. package/templates/community/instagram-everyday-photo-diary/SKILL.md +52 -0
  1000. package/templates/community/instagram-everyday-photo-diary/source.json +9 -0
  1001. package/templates/community/instagram-everyday-photo-diary/template.json +61 -0
  1002. package/templates/community/instagram-evidence-to-method/README.md +13 -0
  1003. package/templates/community/instagram-evidence-to-method/SKILL.md +53 -0
  1004. package/templates/community/instagram-evidence-to-method/source.json +9 -0
  1005. package/templates/community/instagram-evidence-to-method/template.json +56 -0
  1006. package/templates/community/instagram-expectation-reality-review/README.md +18 -0
  1007. package/templates/community/instagram-expectation-reality-review/SKILL.md +53 -0
  1008. package/templates/community/instagram-expectation-reality-review/source.json +9 -0
  1009. package/templates/community/instagram-expectation-reality-review/template.json +57 -0
  1010. package/templates/community/instagram-experiment-story/README.md +20 -0
  1011. package/templates/community/instagram-experiment-story/SKILL.md +54 -0
  1012. package/templates/community/instagram-experiment-story/source.json +9 -0
  1013. package/templates/community/instagram-experiment-story/template.json +58 -0
  1014. package/templates/community/instagram-fill-in-speech/README.md +14 -0
  1015. package/templates/community/instagram-fill-in-speech/SKILL.md +53 -0
  1016. package/templates/community/instagram-fill-in-speech/source.json +9 -0
  1017. package/templates/community/instagram-fill-in-speech/template.json +53 -0
  1018. package/templates/community/instagram-fill-in-workbook/README.md +16 -0
  1019. package/templates/community/instagram-fill-in-workbook/SKILL.md +53 -0
  1020. package/templates/community/instagram-fill-in-workbook/source.json +9 -0
  1021. package/templates/community/instagram-fill-in-workbook/template.json +57 -0
  1022. package/templates/community/instagram-font-pairing/README.md +14 -0
  1023. package/templates/community/instagram-font-pairing/SKILL.md +52 -0
  1024. package/templates/community/instagram-font-pairing/source.json +9 -0
  1025. package/templates/community/instagram-font-pairing/template.json +53 -0
  1026. package/templates/community/instagram-goal-benchmarks/README.md +12 -0
  1027. package/templates/community/instagram-goal-benchmarks/SKILL.md +53 -0
  1028. package/templates/community/instagram-goal-benchmarks/source.json +9 -0
  1029. package/templates/community/instagram-goal-benchmarks/template.json +51 -0
  1030. package/templates/community/instagram-identity-match/README.md +19 -0
  1031. package/templates/community/instagram-identity-match/SKILL.md +52 -0
  1032. package/templates/community/instagram-identity-match/source.json +9 -0
  1033. package/templates/community/instagram-identity-match/template.json +64 -0
  1034. package/templates/community/instagram-illustrated-opinion/README.md +16 -0
  1035. package/templates/community/instagram-illustrated-opinion/SKILL.md +52 -0
  1036. package/templates/community/instagram-illustrated-opinion/source.json +9 -0
  1037. package/templates/community/instagram-illustrated-opinion/template.json +56 -0
  1038. package/templates/community/instagram-illustrated-story-explainer/README.md +14 -0
  1039. package/templates/community/instagram-illustrated-story-explainer/SKILL.md +53 -0
  1040. package/templates/community/instagram-illustrated-story-explainer/source.json +9 -0
  1041. package/templates/community/instagram-illustrated-story-explainer/template.json +55 -0
  1042. package/templates/community/instagram-image-to-palette/README.md +17 -0
  1043. package/templates/community/instagram-image-to-palette/SKILL.md +53 -0
  1044. package/templates/community/instagram-image-to-palette/source.json +9 -0
  1045. package/templates/community/instagram-image-to-palette/template.json +58 -0
  1046. package/templates/community/instagram-incremental-assembly/README.md +15 -0
  1047. package/templates/community/instagram-incremental-assembly/SKILL.md +52 -0
  1048. package/templates/community/instagram-incremental-assembly/source.json +9 -0
  1049. package/templates/community/instagram-incremental-assembly/template.json +55 -0
  1050. package/templates/community/instagram-interview-storyboard/README.md +25 -0
  1051. package/templates/community/instagram-interview-storyboard/SKILL.md +53 -0
  1052. package/templates/community/instagram-interview-storyboard/source.json +9 -0
  1053. package/templates/community/instagram-interview-storyboard/template.json +65 -0
  1054. package/templates/community/instagram-launch-news/README.md +9 -0
  1055. package/templates/community/instagram-launch-news/SKILL.md +53 -0
  1056. package/templates/community/instagram-launch-news/source.json +9 -0
  1057. package/templates/community/instagram-launch-news/template.json +55 -0
  1058. package/templates/community/instagram-layout-anatomy/README.md +12 -0
  1059. package/templates/community/instagram-layout-anatomy/SKILL.md +53 -0
  1060. package/templates/community/instagram-layout-anatomy/source.json +9 -0
  1061. package/templates/community/instagram-layout-anatomy/template.json +54 -0
  1062. package/templates/community/instagram-learning-path/README.md +14 -0
  1063. package/templates/community/instagram-learning-path/SKILL.md +53 -0
  1064. package/templates/community/instagram-learning-path/source.json +9 -0
  1065. package/templates/community/instagram-learning-path/template.json +55 -0
  1066. package/templates/community/instagram-local-picks/README.md +16 -0
  1067. package/templates/community/instagram-local-picks/SKILL.md +52 -0
  1068. package/templates/community/instagram-local-picks/source.json +9 -0
  1069. package/templates/community/instagram-local-picks/template.json +55 -0
  1070. package/templates/community/instagram-matched-test/README.md +10 -0
  1071. package/templates/community/instagram-matched-test/SKILL.md +53 -0
  1072. package/templates/community/instagram-matched-test/source.json +9 -0
  1073. package/templates/community/instagram-matched-test/template.json +49 -0
  1074. package/templates/community/instagram-metric-formulas/README.md +15 -0
  1075. package/templates/community/instagram-metric-formulas/SKILL.md +53 -0
  1076. package/templates/community/instagram-metric-formulas/source.json +9 -0
  1077. package/templates/community/instagram-metric-formulas/template.json +55 -0
  1078. package/templates/community/instagram-milestones-and-feelings/README.md +13 -0
  1079. package/templates/community/instagram-milestones-and-feelings/SKILL.md +52 -0
  1080. package/templates/community/instagram-milestones-and-feelings/source.json +9 -0
  1081. package/templates/community/instagram-milestones-and-feelings/template.json +56 -0
  1082. package/templates/community/instagram-mistakes-and-alternatives/README.md +12 -0
  1083. package/templates/community/instagram-mistakes-and-alternatives/SKILL.md +52 -0
  1084. package/templates/community/instagram-mistakes-and-alternatives/source.json +9 -0
  1085. package/templates/community/instagram-mistakes-and-alternatives/template.json +53 -0
  1086. package/templates/community/instagram-myth-and-fact/README.md +12 -0
  1087. package/templates/community/instagram-myth-and-fact/SKILL.md +53 -0
  1088. package/templates/community/instagram-myth-and-fact/source.json +9 -0
  1089. package/templates/community/instagram-myth-and-fact/template.json +51 -0
  1090. package/templates/community/instagram-news-digest/README.md +13 -0
  1091. package/templates/community/instagram-news-digest/SKILL.md +53 -0
  1092. package/templates/community/instagram-news-digest/source.json +9 -0
  1093. package/templates/community/instagram-news-digest/template.json +52 -0
  1094. package/templates/community/instagram-numbers-at-human-scale/README.md +12 -0
  1095. package/templates/community/instagram-numbers-at-human-scale/SKILL.md +53 -0
  1096. package/templates/community/instagram-numbers-at-human-scale/source.json +9 -0
  1097. package/templates/community/instagram-numbers-at-human-scale/template.json +52 -0
  1098. package/templates/community/instagram-object-led-activities/README.md +16 -0
  1099. package/templates/community/instagram-object-led-activities/SKILL.md +53 -0
  1100. package/templates/community/instagram-object-led-activities/source.json +9 -0
  1101. package/templates/community/instagram-object-led-activities/template.json +56 -0
  1102. package/templates/community/instagram-object-name-origins/README.md +11 -0
  1103. package/templates/community/instagram-object-name-origins/SKILL.md +52 -0
  1104. package/templates/community/instagram-object-name-origins/source.json +9 -0
  1105. package/templates/community/instagram-object-name-origins/template.json +52 -0
  1106. package/templates/community/instagram-one-input-many-results/README.md +14 -0
  1107. package/templates/community/instagram-one-input-many-results/SKILL.md +53 -0
  1108. package/templates/community/instagram-one-input-many-results/source.json +9 -0
  1109. package/templates/community/instagram-one-input-many-results/template.json +52 -0
  1110. package/templates/community/instagram-one-variable-comparison/README.md +11 -0
  1111. package/templates/community/instagram-one-variable-comparison/SKILL.md +53 -0
  1112. package/templates/community/instagram-one-variable-comparison/source.json +9 -0
  1113. package/templates/community/instagram-one-variable-comparison/template.json +52 -0
  1114. package/templates/community/instagram-opportunity-guide/README.md +18 -0
  1115. package/templates/community/instagram-opportunity-guide/SKILL.md +53 -0
  1116. package/templates/community/instagram-opportunity-guide/source.json +9 -0
  1117. package/templates/community/instagram-opportunity-guide/template.json +57 -0
  1118. package/templates/community/instagram-palette-application-board/README.md +11 -0
  1119. package/templates/community/instagram-palette-application-board/SKILL.md +52 -0
  1120. package/templates/community/instagram-palette-application-board/source.json +9 -0
  1121. package/templates/community/instagram-palette-application-board/template.json +52 -0
  1122. package/templates/community/instagram-personal-budget-case/README.md +14 -0
  1123. package/templates/community/instagram-personal-budget-case/SKILL.md +53 -0
  1124. package/templates/community/instagram-personal-budget-case/source.json +9 -0
  1125. package/templates/community/instagram-personal-budget-case/template.json +53 -0
  1126. package/templates/community/instagram-personal-experiment/README.md +11 -0
  1127. package/templates/community/instagram-personal-experiment/SKILL.md +53 -0
  1128. package/templates/community/instagram-personal-experiment/source.json +9 -0
  1129. package/templates/community/instagram-personal-experiment/template.json +52 -0
  1130. package/templates/community/instagram-photo-and-technical-sketch/README.md +10 -0
  1131. package/templates/community/instagram-photo-and-technical-sketch/SKILL.md +53 -0
  1132. package/templates/community/instagram-photo-and-technical-sketch/source.json +9 -0
  1133. package/templates/community/instagram-photo-and-technical-sketch/template.json +49 -0
  1134. package/templates/community/instagram-photo-moment-story/README.md +12 -0
  1135. package/templates/community/instagram-photo-moment-story/SKILL.md +53 -0
  1136. package/templates/community/instagram-photo-moment-story/source.json +9 -0
  1137. package/templates/community/instagram-photo-moment-story/template.json +53 -0
  1138. package/templates/community/instagram-product-change/README.md +9 -0
  1139. package/templates/community/instagram-product-change/SKILL.md +53 -0
  1140. package/templates/community/instagram-product-change/source.json +10 -0
  1141. package/templates/community/instagram-product-change/template.json +53 -0
  1142. package/templates/community/instagram-prompt-result-reference/README.md +26 -0
  1143. package/templates/community/instagram-prompt-result-reference/SKILL.md +53 -0
  1144. package/templates/community/instagram-prompt-result-reference/source.json +9 -0
  1145. package/templates/community/instagram-prompt-result-reference/template.json +68 -0
  1146. package/templates/community/instagram-public-follow-up/README.md +15 -0
  1147. package/templates/community/instagram-public-follow-up/SKILL.md +53 -0
  1148. package/templates/community/instagram-public-follow-up/source.json +9 -0
  1149. package/templates/community/instagram-public-follow-up/template.json +54 -0
  1150. package/templates/community/instagram-reader-question-answer/README.md +10 -0
  1151. package/templates/community/instagram-reader-question-answer/SKILL.md +53 -0
  1152. package/templates/community/instagram-reader-question-answer/source.json +9 -0
  1153. package/templates/community/instagram-reader-question-answer/template.json +48 -0
  1154. package/templates/community/instagram-remaining-capacity/README.md +11 -0
  1155. package/templates/community/instagram-remaining-capacity/SKILL.md +52 -0
  1156. package/templates/community/instagram-remaining-capacity/source.json +9 -0
  1157. package/templates/community/instagram-remaining-capacity/template.json +52 -0
  1158. package/templates/community/instagram-research-brief/README.md +16 -0
  1159. package/templates/community/instagram-research-brief/SKILL.md +53 -0
  1160. package/templates/community/instagram-research-brief/source.json +9 -0
  1161. package/templates/community/instagram-research-brief/template.json +54 -0
  1162. package/templates/community/instagram-result-and-recipe/README.md +17 -0
  1163. package/templates/community/instagram-result-and-recipe/SKILL.md +53 -0
  1164. package/templates/community/instagram-result-and-recipe/source.json +9 -0
  1165. package/templates/community/instagram-result-and-recipe/template.json +56 -0
  1166. package/templates/community/instagram-result-to-steps/README.md +13 -0
  1167. package/templates/community/instagram-result-to-steps/SKILL.md +53 -0
  1168. package/templates/community/instagram-result-to-steps/source.json +9 -0
  1169. package/templates/community/instagram-result-to-steps/template.json +51 -0
  1170. package/templates/community/instagram-reverse-instruction/README.md +15 -0
  1171. package/templates/community/instagram-reverse-instruction/SKILL.md +53 -0
  1172. package/templates/community/instagram-reverse-instruction/source.json +9 -0
  1173. package/templates/community/instagram-reverse-instruction/template.json +54 -0
  1174. package/templates/community/instagram-said-and-meant/README.md +9 -0
  1175. package/templates/community/instagram-said-and-meant/SKILL.md +52 -0
  1176. package/templates/community/instagram-said-and-meant/source.json +10 -0
  1177. package/templates/community/instagram-said-and-meant/template.json +46 -0
  1178. package/templates/community/instagram-same-budget-choices/README.md +12 -0
  1179. package/templates/community/instagram-same-budget-choices/SKILL.md +53 -0
  1180. package/templates/community/instagram-same-budget-choices/source.json +9 -0
  1181. package/templates/community/instagram-same-budget-choices/template.json +52 -0
  1182. package/templates/community/instagram-screenshot-walkthrough/README.md +12 -0
  1183. package/templates/community/instagram-screenshot-walkthrough/SKILL.md +53 -0
  1184. package/templates/community/instagram-screenshot-walkthrough/source.json +9 -0
  1185. package/templates/community/instagram-screenshot-walkthrough/template.json +58 -0
  1186. package/templates/community/instagram-searchable-asset-index/README.md +13 -0
  1187. package/templates/community/instagram-searchable-asset-index/SKILL.md +52 -0
  1188. package/templates/community/instagram-searchable-asset-index/source.json +9 -0
  1189. package/templates/community/instagram-searchable-asset-index/template.json +53 -0
  1190. package/templates/community/instagram-similar-concepts/README.md +15 -0
  1191. package/templates/community/instagram-similar-concepts/SKILL.md +52 -0
  1192. package/templates/community/instagram-similar-concepts/source.json +9 -0
  1193. package/templates/community/instagram-similar-concepts/template.json +54 -0
  1194. package/templates/community/instagram-single-event-news/README.md +14 -0
  1195. package/templates/community/instagram-single-event-news/SKILL.md +53 -0
  1196. package/templates/community/instagram-single-event-news/source.json +9 -0
  1197. package/templates/community/instagram-single-event-news/template.json +56 -0
  1198. package/templates/community/instagram-style-assembly/README.md +13 -0
  1199. package/templates/community/instagram-style-assembly/SKILL.md +53 -0
  1200. package/templates/community/instagram-style-assembly/source.json +9 -0
  1201. package/templates/community/instagram-style-assembly/template.json +53 -0
  1202. package/templates/community/instagram-style-choice/README.md +14 -0
  1203. package/templates/community/instagram-style-choice/SKILL.md +53 -0
  1204. package/templates/community/instagram-style-choice/source.json +9 -0
  1205. package/templates/community/instagram-style-choice/template.json +58 -0
  1206. package/templates/community/instagram-symbolism-in-artifact/README.md +9 -0
  1207. package/templates/community/instagram-symbolism-in-artifact/SKILL.md +52 -0
  1208. package/templates/community/instagram-symbolism-in-artifact/source.json +9 -0
  1209. package/templates/community/instagram-symbolism-in-artifact/template.json +47 -0
  1210. package/templates/community/instagram-taste-matched-recommendations/README.md +17 -0
  1211. package/templates/community/instagram-taste-matched-recommendations/SKILL.md +52 -0
  1212. package/templates/community/instagram-taste-matched-recommendations/source.json +9 -0
  1213. package/templates/community/instagram-taste-matched-recommendations/template.json +56 -0
  1214. package/templates/community/instagram-then-now-pairs/README.md +14 -0
  1215. package/templates/community/instagram-then-now-pairs/SKILL.md +52 -0
  1216. package/templates/community/instagram-then-now-pairs/source.json +9 -0
  1217. package/templates/community/instagram-then-now-pairs/template.json +52 -0
  1218. package/templates/community/instagram-timed-action-plan/README.md +15 -0
  1219. package/templates/community/instagram-timed-action-plan/SKILL.md +53 -0
  1220. package/templates/community/instagram-timed-action-plan/source.json +9 -0
  1221. package/templates/community/instagram-timed-action-plan/template.json +60 -0
  1222. package/templates/community/instagram-tools-by-task/README.md +13 -0
  1223. package/templates/community/instagram-tools-by-task/SKILL.md +53 -0
  1224. package/templates/community/instagram-tools-by-task/source.json +9 -0
  1225. package/templates/community/instagram-tools-by-task/template.json +57 -0
  1226. package/templates/community/instagram-two-perspectives/README.md +8 -0
  1227. package/templates/community/instagram-two-perspectives/SKILL.md +52 -0
  1228. package/templates/community/instagram-two-perspectives/source.json +9 -0
  1229. package/templates/community/instagram-two-perspectives/template.json +47 -0
  1230. package/templates/community/instagram-two-views-one-dataset/README.md +8 -0
  1231. package/templates/community/instagram-two-views-one-dataset/SKILL.md +53 -0
  1232. package/templates/community/instagram-two-views-one-dataset/source.json +9 -0
  1233. package/templates/community/instagram-two-views-one-dataset/template.json +51 -0
  1234. package/templates/community/instagram-version-change-audit/README.md +10 -0
  1235. package/templates/community/instagram-version-change-audit/SKILL.md +53 -0
  1236. package/templates/community/instagram-version-change-audit/source.json +9 -0
  1237. package/templates/community/instagram-version-change-audit/template.json +51 -0
  1238. package/templates/community/instagram-visual-analogy/README.md +13 -0
  1239. package/templates/community/instagram-visual-analogy/SKILL.md +53 -0
  1240. package/templates/community/instagram-visual-analogy/source.json +9 -0
  1241. package/templates/community/instagram-visual-analogy/template.json +53 -0
  1242. package/templates/community/instagram-visual-guess/README.md +15 -0
  1243. package/templates/community/instagram-visual-guess/SKILL.md +53 -0
  1244. package/templates/community/instagram-visual-guess/source.json +9 -0
  1245. package/templates/community/instagram-visual-guess/template.json +54 -0
  1246. package/templates/community/instagram-visual-technique-reference/README.md +18 -0
  1247. package/templates/community/instagram-visual-technique-reference/SKILL.md +53 -0
  1248. package/templates/community/instagram-visual-technique-reference/source.json +9 -0
  1249. package/templates/community/instagram-visual-technique-reference/template.json +60 -0
  1250. package/templates/community/instagram-worked-examples/README.md +13 -0
  1251. package/templates/community/instagram-worked-examples/SKILL.md +52 -0
  1252. package/templates/community/instagram-worked-examples/source.json +9 -0
  1253. package/templates/community/instagram-worked-examples/template.json +57 -0
@@ -0,0 +1,3840 @@
1
+ <!doctype html>
2
+ <!--
3
+ Adapted from HyperFrames (https://github.com/heygen-com/hyperframes), registry/blocks/wireframe-portal-title, commit a8332860c396e9224d42b7ea2a9cc8f42918c961.
4
+ Copyright 2026 HeyGen, Inc. Licensed under the Apache License, Version 2.0; the licence text is in the popost
5
+ Skill's THIRD_PARTY_NOTICES. Changed for the popost Skill (tools/video/port-hyperframes.mjs): its comments removed; its fonts drawn by roles of the Skill's font library, linked from the project (../css/<role>.css); fixed for the scene's clock by hand (tools/video/hyperframes-patches.mjs): its title font read from the three.js typeface of the same font (Geist Bold, OFL) that the registry's extruded logo ships, instead of parsing the TrueType file at run time (a font parser and a binary font the Skill does not ship); libraries it loaded from a CDN put into the page from tools/video/hyperframes-vendor/ (clipper-lib 6.4.2 (Boost Software License 1.0), minified); three.js modules replaced by the project's three.js (../lib/three.min.js, r147), set up as later releases are; three.js addons (loaders/FontLoader, postprocessing/EffectComposer, shaders/CopyShader, postprocessing/ShaderPass, postprocessing/Pass, postprocessing/MaskPass, postprocessing/RenderPass, postprocessing/OutputPass, shaders/GammaCorrectionShader, lines/LineSegments2, lines/LineSegmentsGeometry, lines/LineMaterial) put into the page from three.js r147 (MIT); the runtime's asset address helper reduced to the plain path (the scene's files are beside it); the root composition given the size of its data-width and data-height, as the HyperFrames runtime gives it; its deferred calls (setTimeout) run when the page has loaded, before the first frame; GSAP loaded from the project (../lib/gsap.min.js) instead of a CDN; Math.random replaced by a seeded generator; the 1920x1080 composition scaled into the scene's canvas (parameter "fit"); HyperFrames variables declared as parameters; its root-level clips laid out as HyperFrames lays them out; its clips shown and hidden from the scene's time; sound cues derived from its tweens.
6
+ -->
7
+ <html
8
+ lang="en"
9
+ data-composition-variables='[{"id":"title","type":"string","label":"Title","default":"BREAKTHROUGH","maxLength":18},{"id":"replacementPhrase","type":"string","label":"3D replacement phrase (auto layout)","default":"Lets do this sir!","description":"Every word is preserved. Whole-word line wrapping and type size adapt to the 3D frame."},{"id":"phraseDuration","type":"number","label":"Phrase transition duration (s)","default":1.85,"min":0.65,"max":2.9,"step":0.05,"unit":"s","description":"Total time for the letter transition, including the stagger. Lower is faster. The opening and white return keep their original timing."},{"id":"phraseEasing","type":"number","label":"Transition easing (1 gentle – 8 snap)","default":8,"min":1,"max":8,"step":0.25,"description":"Higher values keep the beginning slow and concentrate acceleration at the letter swap, then settle gently. 4 is the default."},{"id":"settleGlitch","type":"number","label":"Letter settle glitch strength","default":0.2,"min":0,"max":4,"step":0.05,"description":"Scales the deterministic block glitch and letter jitter around swap and settling. 0 disables it; 4 makes it strongest."},{"id":"depthFog","type":"boolean","label":"Depth fog (early fade always on)","default":true,"description":"Dims receding outlines into the dark scene. Early opacity fades remain active when fog is off."},{"id":"subtitle","type":"string","label":"Subtitle","default":"HYPERFRAMES PORTAL TITLE","maxLength":48},{"id":"accent","type":"color","label":"Accent","default":"#F5C518"},{"id":"burstChaos","type":"number","label":"Burst chaos (0-2)","default":1,"min":0,"max":2,"step":0.01}]'
10
+ >
11
+ <head>
12
+ <script>
13
+ /* popost: deferred calls (setTimeout) run in order when the page has loaded, before the first frame. */
14
+ (function () {
15
+ var queue = [], n = 0, done = false;
16
+ var flush = function () { for (var k = 0; queue.length && k < 100000; k++) { var c = queue.shift(); if (!c.cancelled) c.f.apply(null, c.args); } };
17
+ window.__popostLater = function (f, ms) { var c = { f: typeof f === 'function' ? f : function () {}, args: Array.prototype.slice.call(arguments, 2), id: ++n }; queue.push(c); if (done) flush(); return c.id; };
18
+ window.__popostCancel = function (id) { queue.forEach(function (c) { if (c.id === id) c.cancelled = true; }); };
19
+ window.addEventListener('load', function () { done = true; flush(); });
20
+ })();
21
+ </script>
22
+ <meta charset="UTF-8" />
23
+ <meta name="viewport" content="width=1920, height=1080" />
24
+ <title>Wireframe Portal Title</title>
25
+ <script src="../lib/gsap.min.js"></script>
26
+ <script>
27
+ /*******************************************************************************
28
+ * *
29
+ * Author : Angus Johnson *
30
+ * Version : 6.4.2 *
31
+ * Date : 27 February 2017 *
32
+ * Website : http://www.angusj.com *
33
+ * Copyright : Angus Johnson 2010-2017 *
34
+ * *
35
+ * License: *
36
+ * Use, modification & distribution is subject to Boost Software License Ver 1. *
37
+ * http://www.boost.org/LICENSE_1_0.txt *
38
+ * *
39
+ * Attributions: *
40
+ * The code in this library is an extension of Bala Vatti's clipping algorithm: *
41
+ * "A generic solution to polygon clipping" *
42
+ * Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63. *
43
+ * http://portal.acm.org/citation.cfm?id=129906 *
44
+ * *
45
+ * Computer graphics and geometric modeling: implementation and algorithms *
46
+ * By Max K. Agoston *
47
+ * Springer; 1 edition (January 4, 2005) *
48
+ * http://books.google.com/books?q=vatti+clipping+agoston *
49
+ * *
50
+ * See also: *
51
+ * "Polygon Offsetting by Computing Winding Numbers" *
52
+ * Paper no. DETC2005-85513 pp. 565-575 *
53
+ * ASME 2005 International Design Engineering Technical Conferences *
54
+ * and Computers and Information in Engineering Conference (IDETC/CIE2005) *
55
+ * September 24-28, 2005 , Long Beach, California, USA *
56
+ * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf *
57
+ * *
58
+ *******************************************************************************/
59
+ /* clipper-lib 6.4.2 (npm), minified with esbuild for the popost Skill's port of HyperFrames blocks. */
60
+ (function(){"use strict";var n={};n.version="6.4.2.2",n.use_lines=!0,n.use_xyz=!1;var Z=!1;typeof module<"u"&&module.exports?(module.exports=n,Z=!0):(typeof define=="function"&&define.amd&&define(n),typeof document<"u"?window.ClipperLib=n:self.ClipperLib=n);var M;if(Z){var x="chrome";M="Netscape"}else{var x=navigator.userAgent.toString().toLowerCase();M=navigator.appName}var C={};x.indexOf("chrome")!=-1&&x.indexOf("chromium")==-1?C.chrome=1:C.chrome=0,x.indexOf("chromium")!=-1?C.chromium=1:C.chromium=0,x.indexOf("safari")!=-1&&x.indexOf("chrome")==-1&&x.indexOf("chromium")==-1?C.safari=1:C.safari=0,x.indexOf("firefox")!=-1?C.firefox=1:C.firefox=0,x.indexOf("firefox/17")!=-1?C.firefox17=1:C.firefox17=0,x.indexOf("firefox/15")!=-1?C.firefox15=1:C.firefox15=0,x.indexOf("firefox/3")!=-1?C.firefox3=1:C.firefox3=0,x.indexOf("opera")!=-1?C.opera=1:C.opera=0,x.indexOf("msie 10")!=-1?C.msie10=1:C.msie10=0,x.indexOf("msie 9")!=-1?C.msie9=1:C.msie9=0,x.indexOf("msie 8")!=-1?C.msie8=1:C.msie8=0,x.indexOf("msie 7")!=-1?C.msie7=1:C.msie7=0,x.indexOf("msie ")!=-1?C.msie=1:C.msie=0,n.biginteger_used=null;var Y,z=0xdeadbeefcafe,q=(z&16777215)==15715070;function p(t,i,e){n.biginteger_used=1,t!=null&&(typeof t=="number"&&typeof i>"u"?this.fromInt(t):typeof t=="number"?this.fromNumber(t,i,e):i==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,i))}function c(){return new p(null,void 0,void 0)}function K(t,i,e,r,s,l){for(;--l>=0;){var o=i*this[t++]+e[r]+s;s=Math.floor(o/67108864),e[r++]=o&67108863}return s}function Q(t,i,e,r,s,l){for(var o=i&32767,f=i>>15;--l>=0;){var u=this[t]&32767,h=this[t++]>>15,P=f*u+h*o;u=o*u+((P&32767)<<15)+e[r]+(s&1073741823),s=(u>>>30)+(P>>>15)+f*h+(s>>>30),e[r++]=u&1073741823}return s}function $(t,i,e,r,s,l){for(var o=i&16383,f=i>>14;--l>=0;){var u=this[t]&16383,h=this[t++]>>14,P=f*u+h*o;u=o*u+((P&16383)<<14)+e[r]+s,s=(u>>28)+(P>>14)+f*h,e[r++]=u&268435455}return s}q&&M=="Microsoft Internet Explorer"?(p.prototype.am=Q,Y=30):q&&M!="Netscape"?(p.prototype.am=K,Y=26):(p.prototype.am=$,Y=28),p.prototype.DB=Y,p.prototype.DM=(1<<Y)-1,p.prototype.DV=1<<Y;var W=52;p.prototype.FV=Math.pow(2,W),p.prototype.F1=W-Y,p.prototype.F2=2*Y-W;var j="0123456789abcdefghijklmnopqrstuvwxyz",F=new Array,E,X;for(E=48,X=0;X<=9;++X)F[E++]=X;for(E=97,X=10;X<36;++X)F[E++]=X;for(E=65,X=10;X<36;++X)F[E++]=X;function U(t){return j.charAt(t)}function k(t,i){var e=F[t.charCodeAt(i)];return e??-1}function tt(t){for(var i=this.t-1;i>=0;--i)t[i]=this[i];t.t=this.t,t.s=this.s}function it(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function N(t){var i=c();return i.fromInt(t),i}function et(t,i){var e;if(i==16)e=4;else if(i==8)e=3;else if(i==256)e=8;else if(i==2)e=1;else if(i==32)e=5;else if(i==4)e=2;else{this.fromRadix(t,i);return}this.t=0,this.s=0;for(var r=t.length,s=!1,l=0;--r>=0;){var o=e==8?t[r]&255:k(t,r);if(o<0){t.charAt(r)=="-"&&(s=!0);continue}s=!1,l==0?this[this.t++]=o:l+e>this.DB?(this[this.t-1]|=(o&(1<<this.DB-l)-1)<<l,this[this.t++]=o>>this.DB-l):this[this.t-1]|=o<<l,l+=e,l>=this.DB&&(l-=this.DB)}e==8&&(t[0]&128)!=0&&(this.s=-1,l>0&&(this[this.t-1]|=(1<<this.DB-l)-1<<l)),this.clamp(),s&&p.ZERO.subTo(this,this)}function nt(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function rt(t){if(this.s<0)return"-"+this.negate().toString(t);var i;if(t==16)i=4;else if(t==8)i=3;else if(t==2)i=1;else if(t==32)i=5;else if(t==4)i=2;else return this.toRadix(t);var e=(1<<i)-1,r,s=!1,l="",o=this.t,f=this.DB-o*this.DB%i;if(o-- >0)for(f<this.DB&&(r=this[o]>>f)>0&&(s=!0,l=U(r));o>=0;)f<i?(r=(this[o]&(1<<f)-1)<<i-f,r|=this[--o]>>(f+=this.DB-i)):(r=this[o]>>(f-=i)&e,f<=0&&(f+=this.DB,--o)),r>0&&(s=!0),s&&(l+=U(r));return s?l:"0"}function st(){var t=c();return p.ZERO.subTo(this,t),t}function lt(){return this.s<0?this.negate():this}function ot(t){var i=this.s-t.s;if(i!=0)return i;var e=this.t;if(i=e-t.t,i!=0)return this.s<0?-i:i;for(;--e>=0;)if((i=this[e]-t[e])!=0)return i;return 0}function g(t){var i=1,e;return(e=t>>>16)!=0&&(t=e,i+=16),(e=t>>8)!=0&&(t=e,i+=8),(e=t>>4)!=0&&(t=e,i+=4),(e=t>>2)!=0&&(t=e,i+=2),(e=t>>1)!=0&&(t=e,i+=1),i}function ft(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)}function ut(t,i){var e;for(e=this.t-1;e>=0;--e)i[e+t]=this[e];for(e=t-1;e>=0;--e)i[e]=0;i.t=this.t+t,i.s=this.s}function ht(t,i){for(var e=t;e<this.t;++e)i[e-t]=this[e];i.t=Math.max(this.t-t,0),i.s=this.s}function at(t,i){var e=t%this.DB,r=this.DB-e,s=(1<<r)-1,l=Math.floor(t/this.DB),o=this.s<<e&this.DM,f;for(f=this.t-1;f>=0;--f)i[f+l+1]=this[f]>>r|o,o=(this[f]&s)<<e;for(f=l-1;f>=0;--f)i[f]=0;i[l]=o,i.t=this.t+l+1,i.s=this.s,i.clamp()}function pt(t,i){i.s=this.s;var e=Math.floor(t/this.DB);if(e>=this.t){i.t=0;return}var r=t%this.DB,s=this.DB-r,l=(1<<r)-1;i[0]=this[e]>>r;for(var o=e+1;o<this.t;++o)i[o-e-1]|=(this[o]&l)<<s,i[o-e]=this[o]>>r;r>0&&(i[this.t-e-1]|=(this.s&l)<<s),i.t=this.t-e,i.clamp()}function Pt(t,i){for(var e=0,r=0,s=Math.min(t.t,this.t);e<s;)r+=this[e]-t[e],i[e++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;e<this.t;)r+=this[e],i[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<t.t;)r-=t[e],i[e++]=r&this.DM,r>>=this.DB;r-=t.s}i.s=r<0?-1:0,r<-1?i[e++]=this.DV+r:r>0&&(i[e++]=r),i.t=e,i.clamp()}function mt(t,i){var e=this.abs(),r=t.abs(),s=e.t;for(i.t=s+r.t;--s>=0;)i[s]=0;for(s=0;s<r.t;++s)i[s+e.t]=e.am(0,r[s],i,s,0,e.t);i.s=0,i.clamp(),this.s!=t.s&&p.ZERO.subTo(i,i)}function yt(t){for(var i=this.abs(),e=t.t=2*i.t;--e>=0;)t[e]=0;for(e=0;e<i.t-1;++e){var r=i.am(e,i[e],t,2*e,0,1);(t[e+i.t]+=i.am(e+1,2*i[e],t,2*e+1,r,i.t-e-1))>=i.DV&&(t[e+i.t]-=i.DV,t[e+i.t+1]=1)}t.t>0&&(t[t.t-1]+=i.am(e,i[e],t,2*e,0,1)),t.s=0,t.clamp()}function dt(t,i,e){var r=t.abs();if(!(r.t<=0)){var s=this.abs();if(s.t<r.t){i?.fromInt(0),e!=null&&this.copyTo(e);return}e==null&&(e=c());var l=c(),o=this.s,f=t.s,u=this.DB-g(r[r.t-1]);u>0?(r.lShiftTo(u,l),s.lShiftTo(u,e)):(r.copyTo(l),s.copyTo(e));var h=l.t,P=l[h-1];if(P!=0){var a=P*(1<<this.F1)+(h>1?l[h-2]>>this.F2:0),m=this.FV/a,y=(1<<this.F1)/a,v=1<<this.F2,I=e.t,_=I-h,L=i??c();for(l.dlShiftTo(_,L),e.compareTo(L)>=0&&(e[e.t++]=1,e.subTo(L,e)),p.ONE.dlShiftTo(h,L),L.subTo(l,l);l.t<h;)l[l.t++]=0;for(;--_>=0;){var O=e[--I]==P?this.DM:Math.floor(e[I]*m+(e[I-1]+v)*y);if((e[I]+=l.am(0,O,e,_,0,h))<O)for(l.dlShiftTo(_,L),e.subTo(L,e);e[I]<--O;)e.subTo(L,e)}i!=null&&(e.drShiftTo(h,i),o!=f&&p.ZERO.subTo(i,i)),e.t=h,e.clamp(),u>0&&e.rShiftTo(u,e),o<0&&p.ZERO.subTo(e,e)}}}function vt(t){var i=c();return this.abs().divRemTo(t,null,i),this.s<0&&i.compareTo(p.ZERO)>0&&t.subTo(i,i),i}function S(t){this.m=t}function Ct(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function It(t){return t}function ct(t){t.divRemTo(this.m,null,t)}function _t(t,i,e){t.multiplyTo(i,e),this.reduce(e)}function xt(t,i){t.squareTo(i),this.reduce(i)}S.prototype.convert=Ct,S.prototype.revert=It,S.prototype.reduce=ct,S.prototype.mulTo=_t,S.prototype.sqrTo=xt;function Tt(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var i=t&3;return i=i*(2-(t&15)*i)&15,i=i*(2-(t&255)*i)&255,i=i*(2-((t&65535)*i&65535))&65535,i=i*(2-t*i%this.DV)%this.DV,i>0?this.DV-i:-i}function A(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function Lt(t){var i=c();return t.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),t.s<0&&i.compareTo(p.ZERO)>0&&this.m.subTo(i,i),i}function Xt(t){var i=c();return t.copyTo(i),this.reduce(i),i}function Ot(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var i=0;i<this.m.t;++i){var e=t[i]&32767,r=e*this.mpl+((e*this.mph+(t[i]>>15)*this.mpl&this.um)<<15)&t.DM;for(e=i+this.m.t,t[e]+=this.m.am(0,r,t,i,0,this.m.t);t[e]>=t.DV;)t[e]-=t.DV,t[++e]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function Yt(t,i){t.squareTo(i),this.reduce(i)}function Nt(t,i,e){t.multiplyTo(i,e),this.reduce(e)}A.prototype.convert=Lt,A.prototype.revert=Xt,A.prototype.reduce=Ot,A.prototype.mulTo=Nt,A.prototype.sqrTo=Yt;function St(){return(this.t>0?this[0]&1:this.s)==0}function At(t,i){if(t>4294967295||t<1)return p.ONE;var e=c(),r=c(),s=i.convert(this),l=g(t)-1;for(s.copyTo(e);--l>=0;)if(i.sqrTo(e,r),(t&1<<l)>0)i.mulTo(r,s,e);else{var o=e;e=r,r=o}return i.revert(e)}function Et(t,i){var e;return t<256||i.isEven()?e=new S(i):e=new A(i),this.exp(t,e)}p.prototype.copyTo=tt,p.prototype.fromInt=it,p.prototype.fromString=et,p.prototype.clamp=nt,p.prototype.dlShiftTo=ut,p.prototype.drShiftTo=ht,p.prototype.lShiftTo=at,p.prototype.rShiftTo=pt,p.prototype.subTo=Pt,p.prototype.multiplyTo=mt,p.prototype.squareTo=yt,p.prototype.divRemTo=dt,p.prototype.invDigit=Tt,p.prototype.isEven=St,p.prototype.exp=At,p.prototype.toString=rt,p.prototype.negate=st,p.prototype.abs=lt,p.prototype.compareTo=ot,p.prototype.bitLength=ft,p.prototype.mod=vt,p.prototype.modPowInt=Et,p.ZERO=N(0),p.ONE=N(1);function Bt(){var t=c();return this.copyTo(t),t}function wt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Dt(){return this.t==0?this.s:this[0]<<24>>24}function bt(){return this.t==0?this.s:this[0]<<16>>16}function Mt(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function Ft(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function gt(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var i=this.chunkSize(t),e=Math.pow(t,i),r=N(e),s=c(),l=c(),o="";for(this.divRemTo(r,s,l);s.signum()>0;)o=(e+l.intValue()).toString(t).substr(1)+o,s.divRemTo(r,s,l);return l.intValue().toString(t)+o}function Wt(t,i){this.fromInt(0),i==null&&(i=10);for(var e=this.chunkSize(i),r=Math.pow(i,e),s=!1,l=0,o=0,f=0;f<t.length;++f){var u=k(t,f);if(u<0){t.charAt(f)=="-"&&this.signum()==0&&(s=!0);continue}o=i*o+u,++l>=e&&(this.dMultiply(r),this.dAddOffset(o,0),l=0,o=0)}l>0&&(this.dMultiply(Math.pow(i,l)),this.dAddOffset(o,0)),s&&p.ZERO.subTo(this,this)}function Rt(t,i,e){if(typeof i=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,e),this.testBit(t-1)||this.bitwiseTo(p.ONE.shiftLeft(t-1),R,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(p.ONE.shiftLeft(t-1),this);else{var r=new Array,s=t&7;r.length=(t>>3)+1,i.nextBytes(r),s>0?r[0]&=(1<<s)-1:r[0]=0,this.fromString(r,256)}}function Zt(){var t=this.t,i=new Array;i[0]=this.s;var e=this.DB-t*this.DB%8,r,s=0;if(t-- >0)for(e<this.DB&&(r=this[t]>>e)!=(this.s&this.DM)>>e&&(i[s++]=r|this.s<<this.DB-e);t>=0;)e<8?(r=(this[t]&(1<<e)-1)<<8-e,r|=this[--t]>>(e+=this.DB-8)):(r=this[t]>>(e-=8)&255,e<=0&&(e+=this.DB,--t)),(r&128)!=0&&(r|=-256),s==0&&(this.s&128)!=(r&128)&&++s,(s>0||r!=this.s)&&(i[s++]=r);return i}function qt(t){return this.compareTo(t)==0}function Ut(t){return this.compareTo(t)<0?this:t}function kt(t){return this.compareTo(t)>0?this:t}function Ht(t,i,e){var r,s,l=Math.min(t.t,this.t);for(r=0;r<l;++r)e[r]=i(this[r],t[r]);if(t.t<this.t){for(s=t.s&this.DM,r=l;r<this.t;++r)e[r]=i(this[r],s);e.t=this.t}else{for(s=this.s&this.DM,r=l;r<t.t;++r)e[r]=i(s,t[r]);e.t=t.t}e.s=i(this.s,t.s),e.clamp()}function Jt(t,i){return t&i}function Gt(t){var i=c();return this.bitwiseTo(t,Jt,i),i}function R(t,i){return t|i}function Vt(t){var i=c();return this.bitwiseTo(t,R,i),i}function H(t,i){return t^i}function zt(t){var i=c();return this.bitwiseTo(t,H,i),i}function J(t,i){return t&~i}function Kt(t){var i=c();return this.bitwiseTo(t,J,i),i}function Qt(){for(var t=c(),i=0;i<this.t;++i)t[i]=this.DM&~this[i];return t.t=this.t,t.s=~this.s,t}function $t(t){var i=c();return t<0?this.rShiftTo(-t,i):this.lShiftTo(t,i),i}function jt(t){var i=c();return t<0?this.lShiftTo(-t,i):this.rShiftTo(t,i),i}function ti(t){if(t==0)return-1;var i=0;return(t&65535)==0&&(t>>=16,i+=16),(t&255)==0&&(t>>=8,i+=8),(t&15)==0&&(t>>=4,i+=4),(t&3)==0&&(t>>=2,i+=2),(t&1)==0&&++i,i}function ii(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+ti(this[t]);return this.s<0?this.t*this.DB:-1}function ei(t){for(var i=0;t!=0;)t&=t-1,++i;return i}function ni(){for(var t=0,i=this.s&this.DM,e=0;e<this.t;++e)t+=ei(this[e]^i);return t}function ri(t){var i=Math.floor(t/this.DB);return i>=this.t?this.s!=0:(this[i]&1<<t%this.DB)!=0}function si(t,i){var e=p.ONE.shiftLeft(t);return this.bitwiseTo(e,i,e),e}function li(t){return this.changeBit(t,R)}function oi(t){return this.changeBit(t,J)}function fi(t){return this.changeBit(t,H)}function ui(t,i){for(var e=0,r=0,s=Math.min(t.t,this.t);e<s;)r+=this[e]+t[e],i[e++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;e<this.t;)r+=this[e],i[e++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;e<t.t;)r+=t[e],i[e++]=r&this.DM,r>>=this.DB;r+=t.s}i.s=r<0?-1:0,r>0?i[e++]=r:r<-1&&(i[e++]=this.DV+r),i.t=e,i.clamp()}function hi(t){var i=c();return this.addTo(t,i),i}function ai(t){var i=c();return this.subTo(t,i),i}function pi(t){var i=c();return this.multiplyTo(t,i),i}function Pi(){var t=c();return this.squareTo(t),t}function mi(t){var i=c();return this.divRemTo(t,i,null),i}function yi(t){var i=c();return this.divRemTo(t,null,i),i}function di(t){var i=c(),e=c();return this.divRemTo(t,i,e),new Array(i,e)}function vi(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Ci(t,i){if(t!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=t;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}}function b(){}function G(t){return t}function Ii(t,i,e){t.multiplyTo(i,e)}function ci(t,i){t.squareTo(i)}b.prototype.convert=G,b.prototype.revert=G,b.prototype.mulTo=Ii,b.prototype.sqrTo=ci;function _i(t){return this.exp(t,new b)}function xi(t,i,e){var r=Math.min(this.t+t.t,i);for(e.s=0,e.t=r;r>0;)e[--r]=0;var s;for(s=e.t-this.t;r<s;++r)e[r+this.t]=this.am(0,t[r],e,r,0,this.t);for(s=Math.min(t.t,i);r<s;++r)this.am(0,t[r],e,r,0,i-r);e.clamp()}function Ti(t,i,e){--i;var r=e.t=this.t+t.t-i;for(e.s=0;--r>=0;)e[r]=0;for(r=Math.max(i-this.t,0);r<t.t;++r)e[this.t+r-i]=this.am(i-r,t[r],e,0,0,this.t+r-i);e.clamp(),e.drShiftTo(1,e)}function B(t){this.r2=c(),this.q3=c(),p.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function Li(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var i=c();return t.copyTo(i),this.reduce(i),i}function Xi(t){return t}function Oi(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function Yi(t,i){t.squareTo(i),this.reduce(i)}function Ni(t,i,e){t.multiplyTo(i,e),this.reduce(e)}B.prototype.convert=Li,B.prototype.revert=Xi,B.prototype.reduce=Oi,B.prototype.mulTo=Ni,B.prototype.sqrTo=Yi;function Si(t,i){var e=t.bitLength(),r,s=N(1),l;if(e<=0)return s;e<18?r=1:e<48?r=3:e<144?r=4:e<768?r=5:r=6,e<8?l=new S(i):i.isEven()?l=new B(i):l=new A(i);var o=new Array,f=3,u=r-1,h=(1<<r)-1;if(o[1]=l.convert(this),r>1){var P=c();for(l.sqrTo(o[1],P);f<=h;)o[f]=c(),l.mulTo(P,o[f-2],o[f]),f+=2}var a=t.t-1,m,y=!0,v=c(),I;for(e=g(t[a])-1;a>=0;){for(e>=u?m=t[a]>>e-u&h:(m=(t[a]&(1<<e+1)-1)<<u-e,a>0&&(m|=t[a-1]>>this.DB+e-u)),f=r;(m&1)==0;)m>>=1,--f;if((e-=f)<0&&(e+=this.DB,--a),y)o[m].copyTo(s),y=!1;else{for(;f>1;)l.sqrTo(s,v),l.sqrTo(v,s),f-=2;f>0?l.sqrTo(s,v):(I=s,s=v,v=I),l.mulTo(v,o[m],s)}for(;a>=0&&(t[a]&1<<e)==0;)l.sqrTo(s,v),I=s,s=v,v=I,--e<0&&(e=this.DB-1,--a)}return l.revert(s)}function Ai(t){var i=this.s<0?this.negate():this.clone(),e=t.s<0?t.negate():t.clone();if(i.compareTo(e)<0){var r=i;i=e,e=r}var s=i.getLowestSetBit(),l=e.getLowestSetBit();if(l<0)return i;for(s<l&&(l=s),l>0&&(i.rShiftTo(l,i),e.rShiftTo(l,e));i.signum()>0;)(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),i.compareTo(e)>=0?(i.subTo(e,i),i.rShiftTo(1,i)):(e.subTo(i,e),e.rShiftTo(1,e));return l>0&&e.lShiftTo(l,e),e}function Ei(t){if(t<=0)return 0;var i=this.DV%t,e=this.s<0?t-1:0;if(this.t>0)if(i==0)e=this[0]%t;else for(var r=this.t-1;r>=0;--r)e=(i*e+this[r])%t;return e}function Bi(t){var i=t.isEven();if(this.isEven()&&i||t.signum()==0)return p.ZERO;for(var e=t.clone(),r=this.clone(),s=N(1),l=N(0),o=N(0),f=N(1);e.signum()!=0;){for(;e.isEven();)e.rShiftTo(1,e),i?((!s.isEven()||!l.isEven())&&(s.addTo(this,s),l.subTo(t,l)),s.rShiftTo(1,s)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);for(;r.isEven();)r.rShiftTo(1,r),i?((!o.isEven()||!f.isEven())&&(o.addTo(this,o),f.subTo(t,f)),o.rShiftTo(1,o)):f.isEven()||f.subTo(t,f),f.rShiftTo(1,f);e.compareTo(r)>=0?(e.subTo(r,e),i&&s.subTo(o,s),l.subTo(f,l)):(r.subTo(e,r),i&&o.subTo(s,o),f.subTo(l,f))}if(r.compareTo(p.ONE)!=0)return p.ZERO;if(f.compareTo(t)>=0)return f.subtract(t);if(f.signum()<0)f.addTo(t,f);else return f;return f.signum()<0?f.add(t):f}var T=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],wi=(1<<26)/T[T.length-1];function Di(t){var i,e=this.abs();if(e.t==1&&e[0]<=T[T.length-1]){for(i=0;i<T.length;++i)if(e[0]==T[i])return!0;return!1}if(e.isEven())return!1;for(i=1;i<T.length;){for(var r=T[i],s=i+1;s<T.length&&r<wi;)r*=T[s++];for(r=e.modInt(r);i<s;)if(r%T[i++]==0)return!1}return e.millerRabin(t)}function bi(t){var i=this.subtract(p.ONE),e=i.getLowestSetBit();if(e<=0)return!1;var r=i.shiftRight(e);t=t+1>>1,t>T.length&&(t=T.length);for(var s=c(),l=0;l<t;++l){s.fromInt(T[Math.floor(window.__popostRandom()*T.length)]);var o=s.modPow(r,this);if(o.compareTo(p.ONE)!=0&&o.compareTo(i)!=0){for(var f=1;f++<e&&o.compareTo(i)!=0;)if(o=o.modPowInt(2,this),o.compareTo(p.ONE)==0)return!1;if(o.compareTo(i)!=0)return!1}}return!0}p.prototype.chunkSize=Mt,p.prototype.toRadix=gt,p.prototype.fromRadix=Wt,p.prototype.fromNumber=Rt,p.prototype.bitwiseTo=Ht,p.prototype.changeBit=si,p.prototype.addTo=ui,p.prototype.dMultiply=vi,p.prototype.dAddOffset=Ci,p.prototype.multiplyLowerTo=xi,p.prototype.multiplyUpperTo=Ti,p.prototype.modInt=Ei,p.prototype.millerRabin=bi,p.prototype.clone=Bt,p.prototype.intValue=wt,p.prototype.byteValue=Dt,p.prototype.shortValue=bt,p.prototype.signum=Ft,p.prototype.toByteArray=Zt,p.prototype.equals=qt,p.prototype.min=Ut,p.prototype.max=kt,p.prototype.and=Gt,p.prototype.or=Vt,p.prototype.xor=zt,p.prototype.andNot=Kt,p.prototype.not=Qt,p.prototype.shiftLeft=$t,p.prototype.shiftRight=jt,p.prototype.getLowestSetBit=ii,p.prototype.bitCount=ni,p.prototype.testBit=ri,p.prototype.setBit=li,p.prototype.clearBit=oi,p.prototype.flipBit=fi,p.prototype.add=hi,p.prototype.subtract=ai,p.prototype.multiply=pi,p.prototype.divide=mi,p.prototype.remainder=yi,p.prototype.divideAndRemainder=di,p.prototype.modPow=Si,p.prototype.modInverse=Bi,p.prototype.pow=_i,p.prototype.gcd=Ai,p.prototype.isProbablePrime=Di,p.prototype.square=Pi;var d=p;d.prototype.IsNegative=function(){return this.compareTo(d.ZERO)==-1},d.op_Equality=function(t,i){return t.compareTo(i)==0},d.op_Inequality=function(t,i){return t.compareTo(i)!=0},d.op_GreaterThan=function(t,i){return t.compareTo(i)>0},d.op_LessThan=function(t,i){return t.compareTo(i)<0},d.op_Addition=function(t,i){return new d(t,void 0,void 0).add(new d(i,void 0,void 0))},d.op_Subtraction=function(t,i){return new d(t,void 0,void 0).subtract(new d(i,void 0,void 0))},d.Int128Mul=function(t,i){return new d(t,void 0,void 0).multiply(new d(i,void 0,void 0))},d.op_Division=function(t,i){return t.divide(i)},d.prototype.ToDouble=function(){return parseFloat(this.toString())};var V=function(t,i){var e;if(typeof Object.getOwnPropertyNames>"u"){for(e in i.prototype)(typeof t.prototype[e]>"u"||t.prototype[e]===Object.prototype[e])&&(t.prototype[e]=i.prototype[e]);for(e in i)typeof t[e]>"u"&&(t[e]=i[e]);t.$baseCtor=i}else{for(var r=Object.getOwnPropertyNames(i.prototype),s=0;s<r.length;s++)typeof Object.getOwnPropertyDescriptor(t.prototype,r[s])>"u"&&Object.defineProperty(t.prototype,r[s],Object.getOwnPropertyDescriptor(i.prototype,r[s]));for(e in i)typeof t[e]>"u"&&(t[e]=i[e]);t.$baseCtor=i}};n.Path=function(){return[]},n.Path.prototype.push=Array.prototype.push,n.Paths=function(){return[]},n.Paths.prototype.push=Array.prototype.push,n.DoublePoint=function(){var t=arguments;this.X=0,this.Y=0,t.length===1?(this.X=t[0].X,this.Y=t[0].Y):t.length===2&&(this.X=t[0],this.Y=t[1])},n.DoublePoint0=function(){this.X=0,this.Y=0},n.DoublePoint0.prototype=n.DoublePoint.prototype,n.DoublePoint1=function(t){this.X=t.X,this.Y=t.Y},n.DoublePoint1.prototype=n.DoublePoint.prototype,n.DoublePoint2=function(t,i){this.X=t,this.Y=i},n.DoublePoint2.prototype=n.DoublePoint.prototype,n.PolyNode=function(){this.m_Parent=null,this.m_polygon=new n.Path,this.m_Index=0,this.m_jointype=0,this.m_endtype=0,this.m_Childs=[],this.IsOpen=!1},n.PolyNode.prototype.IsHoleNode=function(){for(var t=!0,i=this.m_Parent;i!==null;)t=!t,i=i.m_Parent;return t},n.PolyNode.prototype.ChildCount=function(){return this.m_Childs.length},n.PolyNode.prototype.Contour=function(){return this.m_polygon},n.PolyNode.prototype.AddChild=function(t){var i=this.m_Childs.length;this.m_Childs.push(t),t.m_Parent=this,t.m_Index=i},n.PolyNode.prototype.GetNext=function(){return this.m_Childs.length>0?this.m_Childs[0]:this.GetNextSiblingUp()},n.PolyNode.prototype.GetNextSiblingUp=function(){return this.m_Parent===null?null:this.m_Index===this.m_Parent.m_Childs.length-1?this.m_Parent.GetNextSiblingUp():this.m_Parent.m_Childs[this.m_Index+1]},n.PolyNode.prototype.Childs=function(){return this.m_Childs},n.PolyNode.prototype.Parent=function(){return this.m_Parent},n.PolyNode.prototype.IsHole=function(){return this.IsHoleNode()},n.PolyTree=function(){this.m_AllPolys=[],n.PolyNode.call(this)},n.PolyTree.prototype.Clear=function(){for(var t=0,i=this.m_AllPolys.length;t<i;t++)this.m_AllPolys[t]=null;this.m_AllPolys.length=0,this.m_Childs.length=0},n.PolyTree.prototype.GetFirst=function(){return this.m_Childs.length>0?this.m_Childs[0]:null},n.PolyTree.prototype.Total=function(){var t=this.m_AllPolys.length;return t>0&&this.m_Childs[0]!==this.m_AllPolys[0]&&t--,t},V(n.PolyTree,n.PolyNode),n.Math_Abs_Int64=n.Math_Abs_Int32=n.Math_Abs_Double=function(t){return Math.abs(t)},n.Math_Max_Int32_Int32=function(t,i){return Math.max(t,i)},C.msie||C.opera||C.safari?n.Cast_Int32=function(t){return t|0}:n.Cast_Int32=function(t){return~~t},typeof Number.toInteger>"u"&&(Number.toInteger=null),C.chrome?n.Cast_Int64=function(t){return t<-2147483648||t>2147483647?t<0?Math.ceil(t):Math.floor(t):~~t}:C.firefox&&typeof Number.toInteger=="function"?n.Cast_Int64=function(t){return Number.toInteger(t)}:C.msie7||C.msie8?n.Cast_Int64=function(t){return parseInt(t,10)}:C.msie?n.Cast_Int64=function(t){return t<-2147483648||t>2147483647?t<0?Math.ceil(t):Math.floor(t):t|0}:n.Cast_Int64=function(t){return t<0?Math.ceil(t):Math.floor(t)},n.Clear=function(t){t.length=0},n.PI=3.141592653589793,n.PI2=2*3.141592653589793,n.IntPoint=function(){var t=arguments,i=t.length;if(this.X=0,this.Y=0,n.use_xyz)if(this.Z=0,i===3)this.X=t[0],this.Y=t[1],this.Z=t[2];else if(i===2)this.X=t[0],this.Y=t[1],this.Z=0;else if(i===1)if(t[0]instanceof n.DoublePoint){var e=t[0];this.X=n.Clipper.Round(e.X),this.Y=n.Clipper.Round(e.Y),this.Z=0}else{var r=t[0];typeof r.Z>"u"&&(r.Z=0),this.X=r.X,this.Y=r.Y,this.Z=r.Z}else this.X=0,this.Y=0,this.Z=0;else if(i===2)this.X=t[0],this.Y=t[1];else if(i===1)if(t[0]instanceof n.DoublePoint){var e=t[0];this.X=n.Clipper.Round(e.X),this.Y=n.Clipper.Round(e.Y)}else{var r=t[0];this.X=r.X,this.Y=r.Y}else this.X=0,this.Y=0},n.IntPoint.op_Equality=function(t,i){return t.X===i.X&&t.Y===i.Y},n.IntPoint.op_Inequality=function(t,i){return t.X!==i.X||t.Y!==i.Y},n.IntPoint0=function(){this.X=0,this.Y=0,n.use_xyz&&(this.Z=0)},n.IntPoint0.prototype=n.IntPoint.prototype,n.IntPoint1=function(t){this.X=t.X,this.Y=t.Y,n.use_xyz&&(typeof t.Z>"u"?this.Z=0:this.Z=t.Z)},n.IntPoint1.prototype=n.IntPoint.prototype,n.IntPoint1dp=function(t){this.X=n.Clipper.Round(t.X),this.Y=n.Clipper.Round(t.Y),n.use_xyz&&(this.Z=0)},n.IntPoint1dp.prototype=n.IntPoint.prototype,n.IntPoint2=function(t,i,e){this.X=t,this.Y=i,n.use_xyz&&(typeof e>"u"?this.Z=0:this.Z=e)},n.IntPoint2.prototype=n.IntPoint.prototype,n.IntRect=function(){var t=arguments,i=t.length;if(i===4)this.left=t[0],this.top=t[1],this.right=t[2],this.bottom=t[3];else if(i===1){var e=t[0];this.left=e.left,this.top=e.top,this.right=e.right,this.bottom=e.bottom}else this.left=0,this.top=0,this.right=0,this.bottom=0},n.IntRect0=function(){this.left=0,this.top=0,this.right=0,this.bottom=0},n.IntRect0.prototype=n.IntRect.prototype,n.IntRect1=function(t){this.left=t.left,this.top=t.top,this.right=t.right,this.bottom=t.bottom},n.IntRect1.prototype=n.IntRect.prototype,n.IntRect4=function(t,i,e,r){this.left=t,this.top=i,this.right=e,this.bottom=r},n.IntRect4.prototype=n.IntRect.prototype,n.ClipType={ctIntersection:0,ctUnion:1,ctDifference:2,ctXor:3},n.PolyType={ptSubject:0,ptClip:1},n.PolyFillType={pftEvenOdd:0,pftNonZero:1,pftPositive:2,pftNegative:3},n.JoinType={jtSquare:0,jtRound:1,jtMiter:2},n.EndType={etOpenSquare:0,etOpenRound:1,etOpenButt:2,etClosedLine:3,etClosedPolygon:4},n.EdgeSide={esLeft:0,esRight:1},n.Direction={dRightToLeft:0,dLeftToRight:1},n.TEdge=function(){this.Bot=new n.IntPoint0,this.Curr=new n.IntPoint0,this.Top=new n.IntPoint0,this.Delta=new n.IntPoint0,this.Dx=0,this.PolyTyp=n.PolyType.ptSubject,this.Side=n.EdgeSide.esLeft,this.WindDelta=0,this.WindCnt=0,this.WindCnt2=0,this.OutIdx=0,this.Next=null,this.Prev=null,this.NextInLML=null,this.NextInAEL=null,this.PrevInAEL=null,this.NextInSEL=null,this.PrevInSEL=null},n.IntersectNode=function(){this.Edge1=null,this.Edge2=null,this.Pt=new n.IntPoint0},n.MyIntersectNodeSort=function(){},n.MyIntersectNodeSort.Compare=function(t,i){var e=i.Pt.Y-t.Pt.Y;return e>0?1:e<0?-1:0},n.LocalMinima=function(){this.Y=0,this.LeftBound=null,this.RightBound=null,this.Next=null},n.Scanbeam=function(){this.Y=0,this.Next=null},n.Maxima=function(){this.X=0,this.Next=null,this.Prev=null},n.OutRec=function(){this.Idx=0,this.IsHole=!1,this.IsOpen=!1,this.FirstLeft=null,this.Pts=null,this.BottomPt=null,this.PolyNode=null},n.OutPt=function(){this.Idx=0,this.Pt=new n.IntPoint0,this.Next=null,this.Prev=null},n.Join=function(){this.OutPt1=null,this.OutPt2=null,this.OffPt=new n.IntPoint0},n.ClipperBase=function(){this.m_MinimaList=null,this.m_CurrentLM=null,this.m_edges=new Array,this.m_UseFullRange=!1,this.m_HasOpenPaths=!1,this.PreserveCollinear=!1,this.m_Scanbeam=null,this.m_PolyOuts=null,this.m_ActiveEdges=null},n.ClipperBase.horizontal=-9007199254740992,n.ClipperBase.Skip=-2,n.ClipperBase.Unassigned=-1,n.ClipperBase.tolerance=1e-20,n.ClipperBase.loRange=47453132,n.ClipperBase.hiRange=0xfffffffffffff,n.ClipperBase.near_zero=function(t){return t>-n.ClipperBase.tolerance&&t<n.ClipperBase.tolerance},n.ClipperBase.IsHorizontal=function(t){return t.Delta.Y===0},n.ClipperBase.prototype.PointIsVertex=function(t,i){var e=i;do{if(n.IntPoint.op_Equality(e.Pt,t))return!0;e=e.Next}while(e!==i);return!1},n.ClipperBase.prototype.PointOnLineSegment=function(t,i,e,r){return r?t.X===i.X&&t.Y===i.Y||t.X===e.X&&t.Y===e.Y||t.X>i.X==t.X<e.X&&t.Y>i.Y==t.Y<e.Y&&d.op_Equality(d.Int128Mul(t.X-i.X,e.Y-i.Y),d.Int128Mul(e.X-i.X,t.Y-i.Y)):t.X===i.X&&t.Y===i.Y||t.X===e.X&&t.Y===e.Y||t.X>i.X==t.X<e.X&&t.Y>i.Y==t.Y<e.Y&&(t.X-i.X)*(e.Y-i.Y)===(e.X-i.X)*(t.Y-i.Y)},n.ClipperBase.prototype.PointOnPolygon=function(t,i,e){for(var r=i;;){if(this.PointOnLineSegment(t,r.Pt,r.Next.Pt,e))return!0;if(r=r.Next,r===i)break}return!1},n.ClipperBase.prototype.SlopesEqual=n.ClipperBase.SlopesEqual=function(){var t=arguments,i=t.length,e,r,s,l,o,f,u;return i===3?(e=t[0],r=t[1],u=t[2],u?d.op_Equality(d.Int128Mul(e.Delta.Y,r.Delta.X),d.Int128Mul(e.Delta.X,r.Delta.Y)):n.Cast_Int64(e.Delta.Y*r.Delta.X)===n.Cast_Int64(e.Delta.X*r.Delta.Y)):i===4?(s=t[0],l=t[1],o=t[2],u=t[3],u?d.op_Equality(d.Int128Mul(s.Y-l.Y,l.X-o.X),d.Int128Mul(s.X-l.X,l.Y-o.Y)):n.Cast_Int64((s.Y-l.Y)*(l.X-o.X))-n.Cast_Int64((s.X-l.X)*(l.Y-o.Y))===0):(s=t[0],l=t[1],o=t[2],f=t[3],u=t[4],u?d.op_Equality(d.Int128Mul(s.Y-l.Y,o.X-f.X),d.Int128Mul(s.X-l.X,o.Y-f.Y)):n.Cast_Int64((s.Y-l.Y)*(o.X-f.X))-n.Cast_Int64((s.X-l.X)*(o.Y-f.Y))===0)},n.ClipperBase.SlopesEqual3=function(t,i,e){return e?d.op_Equality(d.Int128Mul(t.Delta.Y,i.Delta.X),d.Int128Mul(t.Delta.X,i.Delta.Y)):n.Cast_Int64(t.Delta.Y*i.Delta.X)===n.Cast_Int64(t.Delta.X*i.Delta.Y)},n.ClipperBase.SlopesEqual4=function(t,i,e,r){return r?d.op_Equality(d.Int128Mul(t.Y-i.Y,i.X-e.X),d.Int128Mul(t.X-i.X,i.Y-e.Y)):n.Cast_Int64((t.Y-i.Y)*(i.X-e.X))-n.Cast_Int64((t.X-i.X)*(i.Y-e.Y))===0},n.ClipperBase.SlopesEqual5=function(t,i,e,r,s){return s?d.op_Equality(d.Int128Mul(t.Y-i.Y,e.X-r.X),d.Int128Mul(t.X-i.X,e.Y-r.Y)):n.Cast_Int64((t.Y-i.Y)*(e.X-r.X))-n.Cast_Int64((t.X-i.X)*(e.Y-r.Y))===0},n.ClipperBase.prototype.Clear=function(){this.DisposeLocalMinimaList();for(var t=0,i=this.m_edges.length;t<i;++t){for(var e=0,r=this.m_edges[t].length;e<r;++e)this.m_edges[t][e]=null;n.Clear(this.m_edges[t])}n.Clear(this.m_edges),this.m_UseFullRange=!1,this.m_HasOpenPaths=!1},n.ClipperBase.prototype.DisposeLocalMinimaList=function(){for(;this.m_MinimaList!==null;){var t=this.m_MinimaList.Next;this.m_MinimaList=null,this.m_MinimaList=t}this.m_CurrentLM=null},n.ClipperBase.prototype.RangeTest=function(t,i){i.Value?(t.X>n.ClipperBase.hiRange||t.Y>n.ClipperBase.hiRange||-t.X>n.ClipperBase.hiRange||-t.Y>n.ClipperBase.hiRange)&&n.Error("Coordinate outside allowed range in RangeTest()."):(t.X>n.ClipperBase.loRange||t.Y>n.ClipperBase.loRange||-t.X>n.ClipperBase.loRange||-t.Y>n.ClipperBase.loRange)&&(i.Value=!0,this.RangeTest(t,i))},n.ClipperBase.prototype.InitEdge=function(t,i,e,r){t.Next=i,t.Prev=e,t.Curr.X=r.X,t.Curr.Y=r.Y,n.use_xyz&&(t.Curr.Z=r.Z),t.OutIdx=-1},n.ClipperBase.prototype.InitEdge2=function(t,i){t.Curr.Y>=t.Next.Curr.Y?(t.Bot.X=t.Curr.X,t.Bot.Y=t.Curr.Y,n.use_xyz&&(t.Bot.Z=t.Curr.Z),t.Top.X=t.Next.Curr.X,t.Top.Y=t.Next.Curr.Y,n.use_xyz&&(t.Top.Z=t.Next.Curr.Z)):(t.Top.X=t.Curr.X,t.Top.Y=t.Curr.Y,n.use_xyz&&(t.Top.Z=t.Curr.Z),t.Bot.X=t.Next.Curr.X,t.Bot.Y=t.Next.Curr.Y,n.use_xyz&&(t.Bot.Z=t.Next.Curr.Z)),this.SetDx(t),t.PolyTyp=i},n.ClipperBase.prototype.FindNextLocMin=function(t){for(var i;;){for(;n.IntPoint.op_Inequality(t.Bot,t.Prev.Bot)||n.IntPoint.op_Equality(t.Curr,t.Top);)t=t.Next;if(t.Dx!==n.ClipperBase.horizontal&&t.Prev.Dx!==n.ClipperBase.horizontal)break;for(;t.Prev.Dx===n.ClipperBase.horizontal;)t=t.Prev;for(i=t;t.Dx===n.ClipperBase.horizontal;)t=t.Next;if(t.Top.Y!==t.Prev.Bot.Y){i.Prev.Bot.X<t.Bot.X&&(t=i);break}}return t},n.ClipperBase.prototype.ProcessBound=function(t,i){var e,r=t,s;if(r.OutIdx===n.ClipperBase.Skip){if(t=r,i){for(;t.Top.Y===t.Next.Bot.Y;)t=t.Next;for(;t!==r&&t.Dx===n.ClipperBase.horizontal;)t=t.Prev}else{for(;t.Top.Y===t.Prev.Bot.Y;)t=t.Prev;for(;t!==r&&t.Dx===n.ClipperBase.horizontal;)t=t.Next}if(t===r)i?r=t.Next:r=t.Prev;else{i?t=r.Next:t=r.Prev;var l=new n.LocalMinima;l.Next=null,l.Y=t.Bot.Y,l.LeftBound=null,l.RightBound=t,t.WindDelta=0,r=this.ProcessBound(t,i),this.InsertLocalMinima(l)}return r}if(t.Dx===n.ClipperBase.horizontal&&(i?e=t.Prev:e=t.Next,e.Dx===n.ClipperBase.horizontal?e.Bot.X!==t.Bot.X&&e.Top.X!==t.Bot.X&&this.ReverseHorizontal(t):e.Bot.X!==t.Bot.X&&this.ReverseHorizontal(t)),e=t,i){for(;r.Top.Y===r.Next.Bot.Y&&r.Next.OutIdx!==n.ClipperBase.Skip;)r=r.Next;if(r.Dx===n.ClipperBase.horizontal&&r.Next.OutIdx!==n.ClipperBase.Skip){for(s=r;s.Prev.Dx===n.ClipperBase.horizontal;)s=s.Prev;s.Prev.Top.X>r.Next.Top.X&&(r=s.Prev)}for(;t!==r;)t.NextInLML=t.Next,t.Dx===n.ClipperBase.horizontal&&t!==e&&t.Bot.X!==t.Prev.Top.X&&this.ReverseHorizontal(t),t=t.Next;t.Dx===n.ClipperBase.horizontal&&t!==e&&t.Bot.X!==t.Prev.Top.X&&this.ReverseHorizontal(t),r=r.Next}else{for(;r.Top.Y===r.Prev.Bot.Y&&r.Prev.OutIdx!==n.ClipperBase.Skip;)r=r.Prev;if(r.Dx===n.ClipperBase.horizontal&&r.Prev.OutIdx!==n.ClipperBase.Skip){for(s=r;s.Next.Dx===n.ClipperBase.horizontal;)s=s.Next;(s.Next.Top.X===r.Prev.Top.X||s.Next.Top.X>r.Prev.Top.X)&&(r=s.Next)}for(;t!==r;)t.NextInLML=t.Prev,t.Dx===n.ClipperBase.horizontal&&t!==e&&t.Bot.X!==t.Next.Top.X&&this.ReverseHorizontal(t),t=t.Prev;t.Dx===n.ClipperBase.horizontal&&t!==e&&t.Bot.X!==t.Next.Top.X&&this.ReverseHorizontal(t),r=r.Prev}return r},n.ClipperBase.prototype.AddPath=function(t,i,e){n.use_lines?!e&&i===n.PolyType.ptClip&&n.Error("AddPath: Open paths must be subject."):e||n.Error("AddPath: Open paths have been disabled.");var r=t.length-1;if(e)for(;r>0&&n.IntPoint.op_Equality(t[r],t[0]);)--r;for(;r>0&&n.IntPoint.op_Equality(t[r],t[r-1]);)--r;if(e&&r<2||!e&&r<1)return!1;for(var s=new Array,l=0;l<=r;l++)s.push(new n.TEdge);var o=!0;s[1].Curr.X=t[1].X,s[1].Curr.Y=t[1].Y,n.use_xyz&&(s[1].Curr.Z=t[1].Z);var f={Value:this.m_UseFullRange};this.RangeTest(t[0],f),this.m_UseFullRange=f.Value,f.Value=this.m_UseFullRange,this.RangeTest(t[r],f),this.m_UseFullRange=f.Value,this.InitEdge(s[0],s[1],s[r],t[0]),this.InitEdge(s[r],s[0],s[r-1],t[r]);for(var l=r-1;l>=1;--l)f.Value=this.m_UseFullRange,this.RangeTest(t[l],f),this.m_UseFullRange=f.Value,this.InitEdge(s[l],s[l+1],s[l-1],t[l]);for(var u=s[0],h=u,P=u;;){if(h.Curr===h.Next.Curr&&(e||h.Next!==u)){if(h===h.Next)break;h===u&&(u=h.Next),h=this.RemoveEdge(h),P=h;continue}if(h.Prev===h.Next)break;if(e&&n.ClipperBase.SlopesEqual4(h.Prev.Curr,h.Curr,h.Next.Curr,this.m_UseFullRange)&&(!this.PreserveCollinear||!this.Pt2IsBetweenPt1AndPt3(h.Prev.Curr,h.Curr,h.Next.Curr))){h===u&&(u=h.Next),h=this.RemoveEdge(h),h=h.Prev,P=h;continue}if(h=h.Next,h===P||!e&&h.Next===u)break}if(!e&&h===h.Next||e&&h.Prev===h.Next)return!1;e||(this.m_HasOpenPaths=!0,u.Prev.OutIdx=n.ClipperBase.Skip),h=u;do this.InitEdge2(h,i),h=h.Next,o&&h.Curr.Y!==u.Curr.Y&&(o=!1);while(h!==u);if(o){if(e)return!1;h.Prev.OutIdx=n.ClipperBase.Skip;var a=new n.LocalMinima;for(a.Next=null,a.Y=h.Bot.Y,a.LeftBound=null,a.RightBound=h,a.RightBound.Side=n.EdgeSide.esRight,a.RightBound.WindDelta=0;h.Bot.X!==h.Prev.Top.X&&this.ReverseHorizontal(h),h.Next.OutIdx!==n.ClipperBase.Skip;)h.NextInLML=h.Next,h=h.Next;return this.InsertLocalMinima(a),this.m_edges.push(s),!0}this.m_edges.push(s);var m,y=null;for(n.IntPoint.op_Equality(h.Prev.Bot,h.Prev.Top)&&(h=h.Next);h=this.FindNextLocMin(h),h!==y;){y===null&&(y=h);var a=new n.LocalMinima;a.Next=null,a.Y=h.Bot.Y,h.Dx<h.Prev.Dx?(a.LeftBound=h.Prev,a.RightBound=h,m=!1):(a.LeftBound=h,a.RightBound=h.Prev,m=!0),a.LeftBound.Side=n.EdgeSide.esLeft,a.RightBound.Side=n.EdgeSide.esRight,e?a.LeftBound.Next===a.RightBound?a.LeftBound.WindDelta=-1:a.LeftBound.WindDelta=1:a.LeftBound.WindDelta=0,a.RightBound.WindDelta=-a.LeftBound.WindDelta,h=this.ProcessBound(a.LeftBound,m),h.OutIdx===n.ClipperBase.Skip&&(h=this.ProcessBound(h,m));var v=this.ProcessBound(a.RightBound,!m);v.OutIdx===n.ClipperBase.Skip&&(v=this.ProcessBound(v,!m)),a.LeftBound.OutIdx===n.ClipperBase.Skip?a.LeftBound=null:a.RightBound.OutIdx===n.ClipperBase.Skip&&(a.RightBound=null),this.InsertLocalMinima(a),m||(h=v)}return!0},n.ClipperBase.prototype.AddPaths=function(t,i,e){for(var r=!1,s=0,l=t.length;s<l;++s)this.AddPath(t[s],i,e)&&(r=!0);return r},n.ClipperBase.prototype.Pt2IsBetweenPt1AndPt3=function(t,i,e){return n.IntPoint.op_Equality(t,e)||n.IntPoint.op_Equality(t,i)||n.IntPoint.op_Equality(e,i)?!1:t.X!==e.X?i.X>t.X==i.X<e.X:i.Y>t.Y==i.Y<e.Y},n.ClipperBase.prototype.RemoveEdge=function(t){t.Prev.Next=t.Next,t.Next.Prev=t.Prev;var i=t.Next;return t.Prev=null,i},n.ClipperBase.prototype.SetDx=function(t){t.Delta.X=t.Top.X-t.Bot.X,t.Delta.Y=t.Top.Y-t.Bot.Y,t.Delta.Y===0?t.Dx=n.ClipperBase.horizontal:t.Dx=t.Delta.X/t.Delta.Y},n.ClipperBase.prototype.InsertLocalMinima=function(t){if(this.m_MinimaList===null)this.m_MinimaList=t;else if(t.Y>=this.m_MinimaList.Y)t.Next=this.m_MinimaList,this.m_MinimaList=t;else{for(var i=this.m_MinimaList;i.Next!==null&&t.Y<i.Next.Y;)i=i.Next;t.Next=i.Next,i.Next=t}},n.ClipperBase.prototype.PopLocalMinima=function(t,i){return i.v=this.m_CurrentLM,this.m_CurrentLM!==null&&this.m_CurrentLM.Y===t?(this.m_CurrentLM=this.m_CurrentLM.Next,!0):!1},n.ClipperBase.prototype.ReverseHorizontal=function(t){var i=t.Top.X;t.Top.X=t.Bot.X,t.Bot.X=i,n.use_xyz&&(i=t.Top.Z,t.Top.Z=t.Bot.Z,t.Bot.Z=i)},n.ClipperBase.prototype.Reset=function(){if(this.m_CurrentLM=this.m_MinimaList,this.m_CurrentLM!==null){this.m_Scanbeam=null;for(var t=this.m_MinimaList;t!==null;){this.InsertScanbeam(t.Y);var i=t.LeftBound;i!==null&&(i.Curr.X=i.Bot.X,i.Curr.Y=i.Bot.Y,n.use_xyz&&(i.Curr.Z=i.Bot.Z),i.OutIdx=n.ClipperBase.Unassigned),i=t.RightBound,i!==null&&(i.Curr.X=i.Bot.X,i.Curr.Y=i.Bot.Y,n.use_xyz&&(i.Curr.Z=i.Bot.Z),i.OutIdx=n.ClipperBase.Unassigned),t=t.Next}this.m_ActiveEdges=null}},n.ClipperBase.prototype.InsertScanbeam=function(t){if(this.m_Scanbeam===null)this.m_Scanbeam=new n.Scanbeam,this.m_Scanbeam.Next=null,this.m_Scanbeam.Y=t;else if(t>this.m_Scanbeam.Y){var i=new n.Scanbeam;i.Y=t,i.Next=this.m_Scanbeam,this.m_Scanbeam=i}else{for(var e=this.m_Scanbeam;e.Next!==null&&t<=e.Next.Y;)e=e.Next;if(t===e.Y)return;var r=new n.Scanbeam;r.Y=t,r.Next=e.Next,e.Next=r}},n.ClipperBase.prototype.PopScanbeam=function(t){return this.m_Scanbeam===null?(t.v=0,!1):(t.v=this.m_Scanbeam.Y,this.m_Scanbeam=this.m_Scanbeam.Next,!0)},n.ClipperBase.prototype.LocalMinimaPending=function(){return this.m_CurrentLM!==null},n.ClipperBase.prototype.CreateOutRec=function(){var t=new n.OutRec;return t.Idx=n.ClipperBase.Unassigned,t.IsHole=!1,t.IsOpen=!1,t.FirstLeft=null,t.Pts=null,t.BottomPt=null,t.PolyNode=null,this.m_PolyOuts.push(t),t.Idx=this.m_PolyOuts.length-1,t},n.ClipperBase.prototype.DisposeOutRec=function(t){var i=this.m_PolyOuts[t];i.Pts=null,i=null,this.m_PolyOuts[t]=null},n.ClipperBase.prototype.UpdateEdgeIntoAEL=function(t){t.NextInLML===null&&n.Error("UpdateEdgeIntoAEL: invalid call");var i=t.PrevInAEL,e=t.NextInAEL;return t.NextInLML.OutIdx=t.OutIdx,i!==null?i.NextInAEL=t.NextInLML:this.m_ActiveEdges=t.NextInLML,e!==null&&(e.PrevInAEL=t.NextInLML),t.NextInLML.Side=t.Side,t.NextInLML.WindDelta=t.WindDelta,t.NextInLML.WindCnt=t.WindCnt,t.NextInLML.WindCnt2=t.WindCnt2,t=t.NextInLML,t.Curr.X=t.Bot.X,t.Curr.Y=t.Bot.Y,t.PrevInAEL=i,t.NextInAEL=e,n.ClipperBase.IsHorizontal(t)||this.InsertScanbeam(t.Top.Y),t},n.ClipperBase.prototype.SwapPositionsInAEL=function(t,i){if(!(t.NextInAEL===t.PrevInAEL||i.NextInAEL===i.PrevInAEL)){if(t.NextInAEL===i){var e=i.NextInAEL;e!==null&&(e.PrevInAEL=t);var r=t.PrevInAEL;r!==null&&(r.NextInAEL=i),i.PrevInAEL=r,i.NextInAEL=t,t.PrevInAEL=i,t.NextInAEL=e}else if(i.NextInAEL===t){var s=t.NextInAEL;s!==null&&(s.PrevInAEL=i);var l=i.PrevInAEL;l!==null&&(l.NextInAEL=t),t.PrevInAEL=l,t.NextInAEL=i,i.PrevInAEL=t,i.NextInAEL=s}else{var o=t.NextInAEL,f=t.PrevInAEL;t.NextInAEL=i.NextInAEL,t.NextInAEL!==null&&(t.NextInAEL.PrevInAEL=t),t.PrevInAEL=i.PrevInAEL,t.PrevInAEL!==null&&(t.PrevInAEL.NextInAEL=t),i.NextInAEL=o,i.NextInAEL!==null&&(i.NextInAEL.PrevInAEL=i),i.PrevInAEL=f,i.PrevInAEL!==null&&(i.PrevInAEL.NextInAEL=i)}t.PrevInAEL===null?this.m_ActiveEdges=t:i.PrevInAEL===null&&(this.m_ActiveEdges=i)}},n.ClipperBase.prototype.DeleteFromAEL=function(t){var i=t.PrevInAEL,e=t.NextInAEL;i===null&&e===null&&t!==this.m_ActiveEdges||(i!==null?i.NextInAEL=e:this.m_ActiveEdges=e,e!==null&&(e.PrevInAEL=i),t.NextInAEL=null,t.PrevInAEL=null)},n.Clipper=function(t){typeof t>"u"&&(t=0),this.m_PolyOuts=null,this.m_ClipType=n.ClipType.ctIntersection,this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=null,this.m_IntersectNodeComparer=null,this.m_ExecuteLocked=!1,this.m_ClipFillType=n.PolyFillType.pftEvenOdd,this.m_SubjFillType=n.PolyFillType.pftEvenOdd,this.m_Joins=null,this.m_GhostJoins=null,this.m_UsingPolyTree=!1,this.ReverseSolution=!1,this.StrictlySimple=!1,n.ClipperBase.call(this),this.m_Scanbeam=null,this.m_Maxima=null,this.m_ActiveEdges=null,this.m_SortedEdges=null,this.m_IntersectList=new Array,this.m_IntersectNodeComparer=n.MyIntersectNodeSort.Compare,this.m_ExecuteLocked=!1,this.m_UsingPolyTree=!1,this.m_PolyOuts=new Array,this.m_Joins=new Array,this.m_GhostJoins=new Array,this.ReverseSolution=(1&t)!==0,this.StrictlySimple=(2&t)!==0,this.PreserveCollinear=(4&t)!==0,n.use_xyz&&(this.ZFillFunction=null)},n.Clipper.ioReverseSolution=1,n.Clipper.ioStrictlySimple=2,n.Clipper.ioPreserveCollinear=4,n.Clipper.prototype.Clear=function(){this.m_edges.length!==0&&(this.DisposeAllPolyPts(),n.ClipperBase.prototype.Clear.call(this))},n.Clipper.prototype.InsertMaxima=function(t){var i=new n.Maxima;if(i.X=t,this.m_Maxima===null)this.m_Maxima=i,this.m_Maxima.Next=null,this.m_Maxima.Prev=null;else if(t<this.m_Maxima.X)i.Next=this.m_Maxima,i.Prev=null,this.m_Maxima=i;else{for(var e=this.m_Maxima;e.Next!==null&&t>=e.Next.X;)e=e.Next;if(t===e.X)return;i.Next=e.Next,i.Prev=e,e.Next!==null&&(e.Next.Prev=i),e.Next=i}},n.Clipper.prototype.Execute=function(){var t=arguments,i=t.length,e=t[1]instanceof n.PolyTree;if(i===4&&!e){var r=t[0],s=t[1],l=t[2],o=t[3];if(this.m_ExecuteLocked)return!1;this.m_HasOpenPaths&&n.Error("Error: PolyTree struct is needed for open path clipping."),this.m_ExecuteLocked=!0,n.Clear(s),this.m_SubjFillType=l,this.m_ClipFillType=o,this.m_ClipType=r,this.m_UsingPolyTree=!1;try{var f=this.ExecuteInternal();f&&this.BuildResult(s)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return f}else if(i===4&&e){var r=t[0],u=t[1],l=t[2],o=t[3];if(this.m_ExecuteLocked)return!1;this.m_ExecuteLocked=!0,this.m_SubjFillType=l,this.m_ClipFillType=o,this.m_ClipType=r,this.m_UsingPolyTree=!0;try{var f=this.ExecuteInternal();f&&this.BuildResult2(u)}finally{this.DisposeAllPolyPts(),this.m_ExecuteLocked=!1}return f}else if(i===2&&!e){var r=t[0],s=t[1];return this.Execute(r,s,n.PolyFillType.pftEvenOdd,n.PolyFillType.pftEvenOdd)}else if(i===2&&e){var r=t[0],u=t[1];return this.Execute(r,u,n.PolyFillType.pftEvenOdd,n.PolyFillType.pftEvenOdd)}},n.Clipper.prototype.FixHoleLinkage=function(t){if(!(t.FirstLeft===null||t.IsHole!==t.FirstLeft.IsHole&&t.FirstLeft.Pts!==null)){for(var i=t.FirstLeft;i!==null&&(i.IsHole===t.IsHole||i.Pts===null);)i=i.FirstLeft;t.FirstLeft=i}},n.Clipper.prototype.ExecuteInternal=function(){try{this.Reset(),this.m_SortedEdges=null,this.m_Maxima=null;var t={},i={};if(!this.PopScanbeam(t))return!1;for(this.InsertLocalMinimaIntoAEL(t.v);this.PopScanbeam(i)||this.LocalMinimaPending();){if(this.ProcessHorizontals(),this.m_GhostJoins.length=0,!this.ProcessIntersections(i.v))return!1;this.ProcessEdgesAtTopOfScanbeam(i.v),t.v=i.v,this.InsertLocalMinimaIntoAEL(t.v)}var e,r,s;for(r=0,s=this.m_PolyOuts.length;r<s;r++)e=this.m_PolyOuts[r],!(e.Pts===null||e.IsOpen)&&(e.IsHole^this.ReverseSolution)==this.Area$1(e)>0&&this.ReversePolyPtLinks(e.Pts);for(this.JoinCommonEdges(),r=0,s=this.m_PolyOuts.length;r<s;r++)e=this.m_PolyOuts[r],e.Pts!==null&&(e.IsOpen?this.FixupOutPolyline(e):this.FixupOutPolygon(e));return this.StrictlySimple&&this.DoSimplePolygons(),!0}finally{this.m_Joins.length=0,this.m_GhostJoins.length=0}},n.Clipper.prototype.DisposeAllPolyPts=function(){for(var t=0,i=this.m_PolyOuts.length;t<i;++t)this.DisposeOutRec(t);n.Clear(this.m_PolyOuts)},n.Clipper.prototype.AddJoin=function(t,i,e){var r=new n.Join;r.OutPt1=t,r.OutPt2=i,r.OffPt.X=e.X,r.OffPt.Y=e.Y,n.use_xyz&&(r.OffPt.Z=e.Z),this.m_Joins.push(r)},n.Clipper.prototype.AddGhostJoin=function(t,i){var e=new n.Join;e.OutPt1=t,e.OffPt.X=i.X,e.OffPt.Y=i.Y,n.use_xyz&&(e.OffPt.Z=i.Z),this.m_GhostJoins.push(e)},n.Clipper.prototype.SetZ=function(t,i,e){if(this.ZFillFunction!==null){if(t.Z!==0||this.ZFillFunction===null)return;n.IntPoint.op_Equality(t,i.Bot)?t.Z=i.Bot.Z:n.IntPoint.op_Equality(t,i.Top)?t.Z=i.Top.Z:n.IntPoint.op_Equality(t,e.Bot)?t.Z=e.Bot.Z:n.IntPoint.op_Equality(t,e.Top)?t.Z=e.Top.Z:this.ZFillFunction(i.Bot,i.Top,e.Bot,e.Top,t)}},n.Clipper.prototype.InsertLocalMinimaIntoAEL=function(t){for(var i={},e,r;this.PopLocalMinima(t,i);){e=i.v.LeftBound,r=i.v.RightBound;var s=null;if(e===null?(this.InsertEdgeIntoAEL(r,null),this.SetWindingCount(r),this.IsContributing(r)&&(s=this.AddOutPt(r,r.Bot))):r===null?(this.InsertEdgeIntoAEL(e,null),this.SetWindingCount(e),this.IsContributing(e)&&(s=this.AddOutPt(e,e.Bot)),this.InsertScanbeam(e.Top.Y)):(this.InsertEdgeIntoAEL(e,null),this.InsertEdgeIntoAEL(r,e),this.SetWindingCount(e),r.WindCnt=e.WindCnt,r.WindCnt2=e.WindCnt2,this.IsContributing(e)&&(s=this.AddLocalMinPoly(e,r,e.Bot)),this.InsertScanbeam(e.Top.Y)),r!==null&&(n.ClipperBase.IsHorizontal(r)?(r.NextInLML!==null&&this.InsertScanbeam(r.NextInLML.Top.Y),this.AddEdgeToSEL(r)):this.InsertScanbeam(r.Top.Y)),!(e===null||r===null)){if(s!==null&&n.ClipperBase.IsHorizontal(r)&&this.m_GhostJoins.length>0&&r.WindDelta!==0)for(var l=0,o=this.m_GhostJoins.length;l<o;l++){var f=this.m_GhostJoins[l];this.HorzSegmentsOverlap(f.OutPt1.Pt.X,f.OffPt.X,r.Bot.X,r.Top.X)&&this.AddJoin(f.OutPt1,s,f.OffPt)}if(e.OutIdx>=0&&e.PrevInAEL!==null&&e.PrevInAEL.Curr.X===e.Bot.X&&e.PrevInAEL.OutIdx>=0&&n.ClipperBase.SlopesEqual5(e.PrevInAEL.Curr,e.PrevInAEL.Top,e.Curr,e.Top,this.m_UseFullRange)&&e.WindDelta!==0&&e.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(e.PrevInAEL,e.Bot);this.AddJoin(s,u,e.Top)}if(e.NextInAEL!==r){if(r.OutIdx>=0&&r.PrevInAEL.OutIdx>=0&&n.ClipperBase.SlopesEqual5(r.PrevInAEL.Curr,r.PrevInAEL.Top,r.Curr,r.Top,this.m_UseFullRange)&&r.WindDelta!==0&&r.PrevInAEL.WindDelta!==0){var u=this.AddOutPt(r.PrevInAEL,r.Bot);this.AddJoin(s,u,r.Top)}var h=e.NextInAEL;if(h!==null)for(;h!==r;)this.IntersectEdges(r,h,e.Curr),h=h.NextInAEL}}}},n.Clipper.prototype.InsertEdgeIntoAEL=function(t,i){if(this.m_ActiveEdges===null)t.PrevInAEL=null,t.NextInAEL=null,this.m_ActiveEdges=t;else if(i===null&&this.E2InsertsBeforeE1(this.m_ActiveEdges,t))t.PrevInAEL=null,t.NextInAEL=this.m_ActiveEdges,this.m_ActiveEdges.PrevInAEL=t,this.m_ActiveEdges=t;else{for(i===null&&(i=this.m_ActiveEdges);i.NextInAEL!==null&&!this.E2InsertsBeforeE1(i.NextInAEL,t);)i=i.NextInAEL;t.NextInAEL=i.NextInAEL,i.NextInAEL!==null&&(i.NextInAEL.PrevInAEL=t),t.PrevInAEL=i,i.NextInAEL=t}},n.Clipper.prototype.E2InsertsBeforeE1=function(t,i){return i.Curr.X===t.Curr.X?i.Top.Y>t.Top.Y?i.Top.X<n.Clipper.TopX(t,i.Top.Y):t.Top.X>n.Clipper.TopX(i,t.Top.Y):i.Curr.X<t.Curr.X},n.Clipper.prototype.IsEvenOddFillType=function(t){return t.PolyTyp===n.PolyType.ptSubject?this.m_SubjFillType===n.PolyFillType.pftEvenOdd:this.m_ClipFillType===n.PolyFillType.pftEvenOdd},n.Clipper.prototype.IsEvenOddAltFillType=function(t){return t.PolyTyp===n.PolyType.ptSubject?this.m_ClipFillType===n.PolyFillType.pftEvenOdd:this.m_SubjFillType===n.PolyFillType.pftEvenOdd},n.Clipper.prototype.IsContributing=function(t){var i,e;switch(t.PolyTyp===n.PolyType.ptSubject?(i=this.m_SubjFillType,e=this.m_ClipFillType):(i=this.m_ClipFillType,e=this.m_SubjFillType),i){case n.PolyFillType.pftEvenOdd:if(t.WindDelta===0&&t.WindCnt!==1)return!1;break;case n.PolyFillType.pftNonZero:if(Math.abs(t.WindCnt)!==1)return!1;break;case n.PolyFillType.pftPositive:if(t.WindCnt!==1)return!1;break;default:if(t.WindCnt!==-1)return!1;break}switch(this.m_ClipType){case n.ClipType.ctIntersection:switch(e){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return t.WindCnt2!==0;case n.PolyFillType.pftPositive:return t.WindCnt2>0;default:return t.WindCnt2<0}case n.ClipType.ctUnion:switch(e){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return t.WindCnt2===0;case n.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}case n.ClipType.ctDifference:if(t.PolyTyp===n.PolyType.ptSubject)switch(e){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return t.WindCnt2===0;case n.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}else switch(e){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return t.WindCnt2!==0;case n.PolyFillType.pftPositive:return t.WindCnt2>0;default:return t.WindCnt2<0}case n.ClipType.ctXor:if(t.WindDelta===0)switch(e){case n.PolyFillType.pftEvenOdd:case n.PolyFillType.pftNonZero:return t.WindCnt2===0;case n.PolyFillType.pftPositive:return t.WindCnt2<=0;default:return t.WindCnt2>=0}else return!0}return!0},n.Clipper.prototype.SetWindingCount=function(t){for(var i=t.PrevInAEL;i!==null&&(i.PolyTyp!==t.PolyTyp||i.WindDelta===0);)i=i.PrevInAEL;if(i===null){var e=t.PolyTyp===n.PolyType.ptSubject?this.m_SubjFillType:this.m_ClipFillType;t.WindDelta===0?t.WindCnt=e===n.PolyFillType.pftNegative?-1:1:t.WindCnt=t.WindDelta,t.WindCnt2=0,i=this.m_ActiveEdges}else if(t.WindDelta===0&&this.m_ClipType!==n.ClipType.ctUnion)t.WindCnt=1,t.WindCnt2=i.WindCnt2,i=i.NextInAEL;else if(this.IsEvenOddFillType(t)){if(t.WindDelta===0){for(var r=!0,s=i.PrevInAEL;s!==null;)s.PolyTyp===i.PolyTyp&&s.WindDelta!==0&&(r=!r),s=s.PrevInAEL;t.WindCnt=r?0:1}else t.WindCnt=t.WindDelta;t.WindCnt2=i.WindCnt2,i=i.NextInAEL}else i.WindCnt*i.WindDelta<0?Math.abs(i.WindCnt)>1?i.WindDelta*t.WindDelta<0?t.WindCnt=i.WindCnt:t.WindCnt=i.WindCnt+t.WindDelta:t.WindCnt=t.WindDelta===0?1:t.WindDelta:t.WindDelta===0?t.WindCnt=i.WindCnt<0?i.WindCnt-1:i.WindCnt+1:i.WindDelta*t.WindDelta<0?t.WindCnt=i.WindCnt:t.WindCnt=i.WindCnt+t.WindDelta,t.WindCnt2=i.WindCnt2,i=i.NextInAEL;if(this.IsEvenOddAltFillType(t))for(;i!==t;)i.WindDelta!==0&&(t.WindCnt2=t.WindCnt2===0?1:0),i=i.NextInAEL;else for(;i!==t;)t.WindCnt2+=i.WindDelta,i=i.NextInAEL},n.Clipper.prototype.AddEdgeToSEL=function(t){this.m_SortedEdges===null?(this.m_SortedEdges=t,t.PrevInSEL=null,t.NextInSEL=null):(t.NextInSEL=this.m_SortedEdges,t.PrevInSEL=null,this.m_SortedEdges.PrevInSEL=t,this.m_SortedEdges=t)},n.Clipper.prototype.PopEdgeFromSEL=function(t){if(t.v=this.m_SortedEdges,t.v===null)return!1;var i=t.v;return this.m_SortedEdges=t.v.NextInSEL,this.m_SortedEdges!==null&&(this.m_SortedEdges.PrevInSEL=null),i.NextInSEL=null,i.PrevInSEL=null,!0},n.Clipper.prototype.CopyAELToSEL=function(){var t=this.m_ActiveEdges;for(this.m_SortedEdges=t;t!==null;)t.PrevInSEL=t.PrevInAEL,t.NextInSEL=t.NextInAEL,t=t.NextInAEL},n.Clipper.prototype.SwapPositionsInSEL=function(t,i){if(!(t.NextInSEL===null&&t.PrevInSEL===null)&&!(i.NextInSEL===null&&i.PrevInSEL===null)){if(t.NextInSEL===i){var e=i.NextInSEL;e!==null&&(e.PrevInSEL=t);var r=t.PrevInSEL;r!==null&&(r.NextInSEL=i),i.PrevInSEL=r,i.NextInSEL=t,t.PrevInSEL=i,t.NextInSEL=e}else if(i.NextInSEL===t){var e=t.NextInSEL;e!==null&&(e.PrevInSEL=i);var r=i.PrevInSEL;r!==null&&(r.NextInSEL=t),t.PrevInSEL=r,t.NextInSEL=i,i.PrevInSEL=t,i.NextInSEL=e}else{var e=t.NextInSEL,r=t.PrevInSEL;t.NextInSEL=i.NextInSEL,t.NextInSEL!==null&&(t.NextInSEL.PrevInSEL=t),t.PrevInSEL=i.PrevInSEL,t.PrevInSEL!==null&&(t.PrevInSEL.NextInSEL=t),i.NextInSEL=e,i.NextInSEL!==null&&(i.NextInSEL.PrevInSEL=i),i.PrevInSEL=r,i.PrevInSEL!==null&&(i.PrevInSEL.NextInSEL=i)}t.PrevInSEL===null?this.m_SortedEdges=t:i.PrevInSEL===null&&(this.m_SortedEdges=i)}},n.Clipper.prototype.AddLocalMaxPoly=function(t,i,e){this.AddOutPt(t,e),i.WindDelta===0&&this.AddOutPt(i,e),t.OutIdx===i.OutIdx?(t.OutIdx=-1,i.OutIdx=-1):t.OutIdx<i.OutIdx?this.AppendPolygon(t,i):this.AppendPolygon(i,t)},n.Clipper.prototype.AddLocalMinPoly=function(t,i,e){var r,s,l;if(n.ClipperBase.IsHorizontal(i)||t.Dx>i.Dx?(r=this.AddOutPt(t,e),i.OutIdx=t.OutIdx,t.Side=n.EdgeSide.esLeft,i.Side=n.EdgeSide.esRight,s=t,s.PrevInAEL===i?l=i.PrevInAEL:l=s.PrevInAEL):(r=this.AddOutPt(i,e),t.OutIdx=i.OutIdx,t.Side=n.EdgeSide.esRight,i.Side=n.EdgeSide.esLeft,s=i,s.PrevInAEL===t?l=t.PrevInAEL:l=s.PrevInAEL),l!==null&&l.OutIdx>=0&&l.Top.Y<e.Y&&s.Top.Y<e.Y){var o=n.Clipper.TopX(l,e.Y),f=n.Clipper.TopX(s,e.Y);if(o===f&&s.WindDelta!==0&&l.WindDelta!==0&&n.ClipperBase.SlopesEqual5(new n.IntPoint2(o,e.Y),l.Top,new n.IntPoint2(f,e.Y),s.Top,this.m_UseFullRange)){var u=this.AddOutPt(l,e);this.AddJoin(r,u,s.Top)}}return r},n.Clipper.prototype.AddOutPt=function(t,i){if(t.OutIdx<0){var e=this.CreateOutRec();e.IsOpen=t.WindDelta===0;var r=new n.OutPt;return e.Pts=r,r.Idx=e.Idx,r.Pt.X=i.X,r.Pt.Y=i.Y,n.use_xyz&&(r.Pt.Z=i.Z),r.Next=r,r.Prev=r,e.IsOpen||this.SetHoleState(t,e),t.OutIdx=e.Idx,r}else{var e=this.m_PolyOuts[t.OutIdx],s=e.Pts,l=t.Side===n.EdgeSide.esLeft;if(l&&n.IntPoint.op_Equality(i,s.Pt))return s;if(!l&&n.IntPoint.op_Equality(i,s.Prev.Pt))return s.Prev;var r=new n.OutPt;return r.Idx=e.Idx,r.Pt.X=i.X,r.Pt.Y=i.Y,n.use_xyz&&(r.Pt.Z=i.Z),r.Next=s,r.Prev=s.Prev,r.Prev.Next=r,s.Prev=r,l&&(e.Pts=r),r}},n.Clipper.prototype.GetLastOutPt=function(t){var i=this.m_PolyOuts[t.OutIdx];return t.Side===n.EdgeSide.esLeft?i.Pts:i.Pts.Prev},n.Clipper.prototype.SwapPoints=function(t,i){var e=new n.IntPoint1(t.Value);t.Value.X=i.Value.X,t.Value.Y=i.Value.Y,n.use_xyz&&(t.Value.Z=i.Value.Z),i.Value.X=e.X,i.Value.Y=e.Y,n.use_xyz&&(i.Value.Z=e.Z)},n.Clipper.prototype.HorzSegmentsOverlap=function(t,i,e,r){var s;return t>i&&(s=t,t=i,i=s),e>r&&(s=e,e=r,r=s),t<r&&e<i},n.Clipper.prototype.SetHoleState=function(t,i){for(var e=t.PrevInAEL,r=null;e!==null;)e.OutIdx>=0&&e.WindDelta!==0&&(r===null?r=e:r.OutIdx===e.OutIdx&&(r=null)),e=e.PrevInAEL;r===null?(i.FirstLeft=null,i.IsHole=!1):(i.FirstLeft=this.m_PolyOuts[r.OutIdx],i.IsHole=!i.FirstLeft.IsHole)},n.Clipper.prototype.GetDx=function(t,i){return t.Y===i.Y?n.ClipperBase.horizontal:(i.X-t.X)/(i.Y-t.Y)},n.Clipper.prototype.FirstIsBottomPt=function(t,i){for(var e=t.Prev;n.IntPoint.op_Equality(e.Pt,t.Pt)&&e!==t;)e=e.Prev;var r=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=t.Next;n.IntPoint.op_Equality(e.Pt,t.Pt)&&e!==t;)e=e.Next;var s=Math.abs(this.GetDx(t.Pt,e.Pt));for(e=i.Prev;n.IntPoint.op_Equality(e.Pt,i.Pt)&&e!==i;)e=e.Prev;var l=Math.abs(this.GetDx(i.Pt,e.Pt));for(e=i.Next;n.IntPoint.op_Equality(e.Pt,i.Pt)&&e!==i;)e=e.Next;var o=Math.abs(this.GetDx(i.Pt,e.Pt));return Math.max(r,s)===Math.max(l,o)&&Math.min(r,s)===Math.min(l,o)?this.Area(t)>0:r>=l&&r>=o||s>=l&&s>=o},n.Clipper.prototype.GetBottomPt=function(t){for(var i=null,e=t.Next;e!==t;)e.Pt.Y>t.Pt.Y?(t=e,i=null):e.Pt.Y===t.Pt.Y&&e.Pt.X<=t.Pt.X&&(e.Pt.X<t.Pt.X?(i=null,t=e):e.Next!==t&&e.Prev!==t&&(i=e)),e=e.Next;if(i!==null)for(;i!==e;)for(this.FirstIsBottomPt(e,i)||(t=i),i=i.Next;n.IntPoint.op_Inequality(i.Pt,t.Pt);)i=i.Next;return t},n.Clipper.prototype.GetLowermostRec=function(t,i){t.BottomPt===null&&(t.BottomPt=this.GetBottomPt(t.Pts)),i.BottomPt===null&&(i.BottomPt=this.GetBottomPt(i.Pts));var e=t.BottomPt,r=i.BottomPt;return e.Pt.Y>r.Pt.Y?t:e.Pt.Y<r.Pt.Y?i:e.Pt.X<r.Pt.X?t:e.Pt.X>r.Pt.X||e.Next===e?i:r.Next===r||this.FirstIsBottomPt(e,r)?t:i},n.Clipper.prototype.OutRec1RightOfOutRec2=function(t,i){do if(t=t.FirstLeft,t===i)return!0;while(t!==null);return!1},n.Clipper.prototype.GetOutRec=function(t){for(var i=this.m_PolyOuts[t];i!==this.m_PolyOuts[i.Idx];)i=this.m_PolyOuts[i.Idx];return i},n.Clipper.prototype.AppendPolygon=function(t,i){var e=this.m_PolyOuts[t.OutIdx],r=this.m_PolyOuts[i.OutIdx],s;this.OutRec1RightOfOutRec2(e,r)?s=r:this.OutRec1RightOfOutRec2(r,e)?s=e:s=this.GetLowermostRec(e,r);var l=e.Pts,o=l.Prev,f=r.Pts,u=f.Prev;t.Side===n.EdgeSide.esLeft?i.Side===n.EdgeSide.esLeft?(this.ReversePolyPtLinks(f),f.Next=l,l.Prev=f,o.Next=u,u.Prev=o,e.Pts=u):(u.Next=l,l.Prev=u,f.Prev=o,o.Next=f,e.Pts=f):i.Side===n.EdgeSide.esRight?(this.ReversePolyPtLinks(f),o.Next=u,u.Prev=o,f.Next=l,l.Prev=f):(o.Next=f,f.Prev=o,l.Prev=u,u.Next=l),e.BottomPt=null,s===r&&(r.FirstLeft!==e&&(e.FirstLeft=r.FirstLeft),e.IsHole=r.IsHole),r.Pts=null,r.BottomPt=null,r.FirstLeft=e;var h=t.OutIdx,P=i.OutIdx;t.OutIdx=-1,i.OutIdx=-1;for(var a=this.m_ActiveEdges;a!==null;){if(a.OutIdx===P){a.OutIdx=h,a.Side=t.Side;break}a=a.NextInAEL}r.Idx=e.Idx},n.Clipper.prototype.ReversePolyPtLinks=function(t){if(t!==null){var i,e;i=t;do e=i.Next,i.Next=i.Prev,i.Prev=e,i=e;while(i!==t)}},n.Clipper.SwapSides=function(t,i){var e=t.Side;t.Side=i.Side,i.Side=e},n.Clipper.SwapPolyIndexes=function(t,i){var e=t.OutIdx;t.OutIdx=i.OutIdx,i.OutIdx=e},n.Clipper.prototype.IntersectEdges=function(t,i,e){var r=t.OutIdx>=0,s=i.OutIdx>=0;if(n.use_xyz&&this.SetZ(e,t,i),n.use_lines&&(t.WindDelta===0||i.WindDelta===0)){if(t.WindDelta===0&&i.WindDelta===0)return;t.PolyTyp===i.PolyTyp&&t.WindDelta!==i.WindDelta&&this.m_ClipType===n.ClipType.ctUnion?t.WindDelta===0?s&&(this.AddOutPt(t,e),r&&(t.OutIdx=-1)):r&&(this.AddOutPt(i,e),s&&(i.OutIdx=-1)):t.PolyTyp!==i.PolyTyp&&(t.WindDelta===0&&Math.abs(i.WindCnt)===1&&(this.m_ClipType!==n.ClipType.ctUnion||i.WindCnt2===0)?(this.AddOutPt(t,e),r&&(t.OutIdx=-1)):i.WindDelta===0&&Math.abs(t.WindCnt)===1&&(this.m_ClipType!==n.ClipType.ctUnion||t.WindCnt2===0)&&(this.AddOutPt(i,e),s&&(i.OutIdx=-1)));return}if(t.PolyTyp===i.PolyTyp)if(this.IsEvenOddFillType(t)){var l=t.WindCnt;t.WindCnt=i.WindCnt,i.WindCnt=l}else t.WindCnt+i.WindDelta===0?t.WindCnt=-t.WindCnt:t.WindCnt+=i.WindDelta,i.WindCnt-t.WindDelta===0?i.WindCnt=-i.WindCnt:i.WindCnt-=t.WindDelta;else this.IsEvenOddFillType(i)?t.WindCnt2=t.WindCnt2===0?1:0:t.WindCnt2+=i.WindDelta,this.IsEvenOddFillType(t)?i.WindCnt2=i.WindCnt2===0?1:0:i.WindCnt2-=t.WindDelta;var o,f,u,h;t.PolyTyp===n.PolyType.ptSubject?(o=this.m_SubjFillType,u=this.m_ClipFillType):(o=this.m_ClipFillType,u=this.m_SubjFillType),i.PolyTyp===n.PolyType.ptSubject?(f=this.m_SubjFillType,h=this.m_ClipFillType):(f=this.m_ClipFillType,h=this.m_SubjFillType);var P,a;switch(o){case n.PolyFillType.pftPositive:P=t.WindCnt;break;case n.PolyFillType.pftNegative:P=-t.WindCnt;break;default:P=Math.abs(t.WindCnt);break}switch(f){case n.PolyFillType.pftPositive:a=i.WindCnt;break;case n.PolyFillType.pftNegative:a=-i.WindCnt;break;default:a=Math.abs(i.WindCnt);break}if(r&&s)P!==0&&P!==1||a!==0&&a!==1||t.PolyTyp!==i.PolyTyp&&this.m_ClipType!==n.ClipType.ctXor?this.AddLocalMaxPoly(t,i,e):(this.AddOutPt(t,e),this.AddOutPt(i,e),n.Clipper.SwapSides(t,i),n.Clipper.SwapPolyIndexes(t,i));else if(r)(a===0||a===1)&&(this.AddOutPt(t,e),n.Clipper.SwapSides(t,i),n.Clipper.SwapPolyIndexes(t,i));else if(s)(P===0||P===1)&&(this.AddOutPt(i,e),n.Clipper.SwapSides(t,i),n.Clipper.SwapPolyIndexes(t,i));else if((P===0||P===1)&&(a===0||a===1)){var m,y;switch(u){case n.PolyFillType.pftPositive:m=t.WindCnt2;break;case n.PolyFillType.pftNegative:m=-t.WindCnt2;break;default:m=Math.abs(t.WindCnt2);break}switch(h){case n.PolyFillType.pftPositive:y=i.WindCnt2;break;case n.PolyFillType.pftNegative:y=-i.WindCnt2;break;default:y=Math.abs(i.WindCnt2);break}if(t.PolyTyp!==i.PolyTyp)this.AddLocalMinPoly(t,i,e);else if(P===1&&a===1)switch(this.m_ClipType){case n.ClipType.ctIntersection:m>0&&y>0&&this.AddLocalMinPoly(t,i,e);break;case n.ClipType.ctUnion:m<=0&&y<=0&&this.AddLocalMinPoly(t,i,e);break;case n.ClipType.ctDifference:(t.PolyTyp===n.PolyType.ptClip&&m>0&&y>0||t.PolyTyp===n.PolyType.ptSubject&&m<=0&&y<=0)&&this.AddLocalMinPoly(t,i,e);break;case n.ClipType.ctXor:this.AddLocalMinPoly(t,i,e);break}else n.Clipper.SwapSides(t,i)}},n.Clipper.prototype.DeleteFromSEL=function(t){var i=t.PrevInSEL,e=t.NextInSEL;i===null&&e===null&&t!==this.m_SortedEdges||(i!==null?i.NextInSEL=e:this.m_SortedEdges=e,e!==null&&(e.PrevInSEL=i),t.NextInSEL=null,t.PrevInSEL=null)},n.Clipper.prototype.ProcessHorizontals=function(){for(var t={};this.PopEdgeFromSEL(t);)this.ProcessHorizontal(t.v)},n.Clipper.prototype.GetHorzDirection=function(t,i){t.Bot.X<t.Top.X?(i.Left=t.Bot.X,i.Right=t.Top.X,i.Dir=n.Direction.dLeftToRight):(i.Left=t.Top.X,i.Right=t.Bot.X,i.Dir=n.Direction.dRightToLeft)},n.Clipper.prototype.ProcessHorizontal=function(t){var i={Dir:null,Left:null,Right:null};this.GetHorzDirection(t,i);for(var e=i.Dir,r=i.Left,s=i.Right,l=t.WindDelta===0,o=t,f=null;o.NextInLML!==null&&n.ClipperBase.IsHorizontal(o.NextInLML);)o=o.NextInLML;o.NextInLML===null&&(f=this.GetMaximaPair(o));var u=this.m_Maxima;if(u!==null)if(e===n.Direction.dLeftToRight){for(;u!==null&&u.X<=t.Bot.X;)u=u.Next;u!==null&&u.X>=o.Top.X&&(u=null)}else{for(;u.Next!==null&&u.Next.X<t.Bot.X;)u=u.Next;u.X<=o.Top.X&&(u=null)}for(var h=null;;){for(var P=t===o,a=this.GetNextInAEL(t,e);a!==null;){if(u!==null)if(e===n.Direction.dLeftToRight)for(;u!==null&&u.X<a.Curr.X;)t.OutIdx>=0&&!l&&this.AddOutPt(t,new n.IntPoint2(u.X,t.Bot.Y)),u=u.Next;else for(;u!==null&&u.X>a.Curr.X;)t.OutIdx>=0&&!l&&this.AddOutPt(t,new n.IntPoint2(u.X,t.Bot.Y)),u=u.Prev;if(e===n.Direction.dLeftToRight&&a.Curr.X>s||e===n.Direction.dRightToLeft&&a.Curr.X<r||a.Curr.X===t.Top.X&&t.NextInLML!==null&&a.Dx<t.NextInLML.Dx)break;if(t.OutIdx>=0&&!l){n.use_xyz&&(e===n.Direction.dLeftToRight?this.SetZ(a.Curr,t,a):this.SetZ(a.Curr,a,t)),h=this.AddOutPt(t,a.Curr);for(var m=this.m_SortedEdges;m!==null;){if(m.OutIdx>=0&&this.HorzSegmentsOverlap(t.Bot.X,t.Top.X,m.Bot.X,m.Top.X)){var y=this.GetLastOutPt(m);this.AddJoin(y,h,m.Top)}m=m.NextInSEL}this.AddGhostJoin(h,t.Bot)}if(a===f&&P){t.OutIdx>=0&&this.AddLocalMaxPoly(t,f,t.Top),this.DeleteFromAEL(t),this.DeleteFromAEL(f);return}if(e===n.Direction.dLeftToRight){var v=new n.IntPoint2(a.Curr.X,t.Curr.Y);this.IntersectEdges(t,a,v)}else{var v=new n.IntPoint2(a.Curr.X,t.Curr.Y);this.IntersectEdges(a,t,v)}var I=this.GetNextInAEL(a,e);this.SwapPositionsInAEL(t,a),a=I}if(t.NextInLML===null||!n.ClipperBase.IsHorizontal(t.NextInLML))break;t=this.UpdateEdgeIntoAEL(t),t.OutIdx>=0&&this.AddOutPt(t,t.Bot),i={Dir:e,Left:r,Right:s},this.GetHorzDirection(t,i),e=i.Dir,r=i.Left,s=i.Right}if(t.OutIdx>=0&&h===null){h=this.GetLastOutPt(t);for(var m=this.m_SortedEdges;m!==null;){if(m.OutIdx>=0&&this.HorzSegmentsOverlap(t.Bot.X,t.Top.X,m.Bot.X,m.Top.X)){var y=this.GetLastOutPt(m);this.AddJoin(y,h,m.Top)}m=m.NextInSEL}this.AddGhostJoin(h,t.Top)}if(t.NextInLML!==null)if(t.OutIdx>=0){if(h=this.AddOutPt(t,t.Top),t=this.UpdateEdgeIntoAEL(t),t.WindDelta===0)return;var _=t.PrevInAEL,I=t.NextInAEL;if(_!==null&&_.Curr.X===t.Bot.X&&_.Curr.Y===t.Bot.Y&&_.WindDelta===0&&_.OutIdx>=0&&_.Curr.Y>_.Top.Y&&n.ClipperBase.SlopesEqual3(t,_,this.m_UseFullRange)){var y=this.AddOutPt(_,t.Bot);this.AddJoin(h,y,t.Top)}else if(I!==null&&I.Curr.X===t.Bot.X&&I.Curr.Y===t.Bot.Y&&I.WindDelta!==0&&I.OutIdx>=0&&I.Curr.Y>I.Top.Y&&n.ClipperBase.SlopesEqual3(t,I,this.m_UseFullRange)){var y=this.AddOutPt(I,t.Bot);this.AddJoin(h,y,t.Top)}}else t=this.UpdateEdgeIntoAEL(t);else t.OutIdx>=0&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t)},n.Clipper.prototype.GetNextInAEL=function(t,i){return i===n.Direction.dLeftToRight?t.NextInAEL:t.PrevInAEL},n.Clipper.prototype.IsMinima=function(t){return t!==null&&t.Prev.NextInLML!==t&&t.Next.NextInLML!==t},n.Clipper.prototype.IsMaxima=function(t,i){return t!==null&&t.Top.Y===i&&t.NextInLML===null},n.Clipper.prototype.IsIntermediate=function(t,i){return t.Top.Y===i&&t.NextInLML!==null},n.Clipper.prototype.GetMaximaPair=function(t){return n.IntPoint.op_Equality(t.Next.Top,t.Top)&&t.Next.NextInLML===null?t.Next:n.IntPoint.op_Equality(t.Prev.Top,t.Top)&&t.Prev.NextInLML===null?t.Prev:null},n.Clipper.prototype.GetMaximaPairEx=function(t){var i=this.GetMaximaPair(t);return i===null||i.OutIdx===n.ClipperBase.Skip||i.NextInAEL===i.PrevInAEL&&!n.ClipperBase.IsHorizontal(i)?null:i},n.Clipper.prototype.ProcessIntersections=function(t){if(this.m_ActiveEdges===null)return!0;try{if(this.BuildIntersectList(t),this.m_IntersectList.length===0)return!0;if(this.m_IntersectList.length===1||this.FixupIntersectionOrder())this.ProcessIntersectList();else return!1}catch{this.m_SortedEdges=null,this.m_IntersectList.length=0,n.Error("ProcessIntersections error")}return this.m_SortedEdges=null,!0},n.Clipper.prototype.BuildIntersectList=function(t){if(this.m_ActiveEdges!==null){var i=this.m_ActiveEdges;for(this.m_SortedEdges=i;i!==null;)i.PrevInSEL=i.PrevInAEL,i.NextInSEL=i.NextInAEL,i.Curr.X=n.Clipper.TopX(i,t),i=i.NextInAEL;for(var e=!0;e&&this.m_SortedEdges!==null;){for(e=!1,i=this.m_SortedEdges;i.NextInSEL!==null;){var r=i.NextInSEL,s=new n.IntPoint0;if(i.Curr.X>r.Curr.X){this.IntersectPoint(i,r,s),s.Y<t&&(s=new n.IntPoint2(n.Clipper.TopX(i,t),t));var l=new n.IntersectNode;l.Edge1=i,l.Edge2=r,l.Pt.X=s.X,l.Pt.Y=s.Y,n.use_xyz&&(l.Pt.Z=s.Z),this.m_IntersectList.push(l),this.SwapPositionsInSEL(i,r),e=!0}else i=r}if(i.PrevInSEL!==null)i.PrevInSEL.NextInSEL=null;else break}this.m_SortedEdges=null}},n.Clipper.prototype.EdgesAdjacent=function(t){return t.Edge1.NextInSEL===t.Edge2||t.Edge1.PrevInSEL===t.Edge2},n.Clipper.IntersectNodeSort=function(t,i){return i.Pt.Y-t.Pt.Y},n.Clipper.prototype.FixupIntersectionOrder=function(){this.m_IntersectList.sort(this.m_IntersectNodeComparer),this.CopyAELToSEL();for(var t=this.m_IntersectList.length,i=0;i<t;i++){if(!this.EdgesAdjacent(this.m_IntersectList[i])){for(var e=i+1;e<t&&!this.EdgesAdjacent(this.m_IntersectList[e]);)e++;if(e===t)return!1;var r=this.m_IntersectList[i];this.m_IntersectList[i]=this.m_IntersectList[e],this.m_IntersectList[e]=r}this.SwapPositionsInSEL(this.m_IntersectList[i].Edge1,this.m_IntersectList[i].Edge2)}return!0},n.Clipper.prototype.ProcessIntersectList=function(){for(var t=0,i=this.m_IntersectList.length;t<i;t++){var e=this.m_IntersectList[t];this.IntersectEdges(e.Edge1,e.Edge2,e.Pt),this.SwapPositionsInAEL(e.Edge1,e.Edge2)}this.m_IntersectList.length=0};var Mi=function(t){return t<0?Math.ceil(t-.5):Math.round(t)},Fi=function(t){return t<0?Math.ceil(t-.5):Math.floor(t+.5)},gi=function(t){return t<0?-Math.round(Math.abs(t)):Math.round(t)},Wi=function(t){return t<0?(t-=.5,t<-2147483648?Math.ceil(t):t|0):(t+=.5,t>2147483647?Math.floor(t):t|0)};C.msie?n.Clipper.Round=Mi:C.chromium?n.Clipper.Round=gi:C.safari?n.Clipper.Round=Wi:n.Clipper.Round=Fi,n.Clipper.TopX=function(t,i){return i===t.Top.Y?t.Top.X:t.Bot.X+n.Clipper.Round(t.Dx*(i-t.Bot.Y))},n.Clipper.prototype.IntersectPoint=function(t,i,e){e.X=0,e.Y=0;var r,s;if(t.Dx===i.Dx){e.Y=t.Curr.Y,e.X=n.Clipper.TopX(t,e.Y);return}if(t.Delta.X===0)e.X=t.Bot.X,n.ClipperBase.IsHorizontal(i)?e.Y=i.Bot.Y:(s=i.Bot.Y-i.Bot.X/i.Dx,e.Y=n.Clipper.Round(e.X/i.Dx+s));else if(i.Delta.X===0)e.X=i.Bot.X,n.ClipperBase.IsHorizontal(t)?e.Y=t.Bot.Y:(r=t.Bot.Y-t.Bot.X/t.Dx,e.Y=n.Clipper.Round(e.X/t.Dx+r));else{r=t.Bot.X-t.Bot.Y*t.Dx,s=i.Bot.X-i.Bot.Y*i.Dx;var l=(s-r)/(t.Dx-i.Dx);e.Y=n.Clipper.Round(l),Math.abs(t.Dx)<Math.abs(i.Dx)?e.X=n.Clipper.Round(t.Dx*l+r):e.X=n.Clipper.Round(i.Dx*l+s)}if(e.Y<t.Top.Y||e.Y<i.Top.Y){if(t.Top.Y>i.Top.Y)return e.Y=t.Top.Y,e.X=n.Clipper.TopX(i,t.Top.Y),e.X<t.Top.X;e.Y=i.Top.Y,Math.abs(t.Dx)<Math.abs(i.Dx)?e.X=n.Clipper.TopX(t,e.Y):e.X=n.Clipper.TopX(i,e.Y)}e.Y>t.Curr.Y&&(e.Y=t.Curr.Y,Math.abs(t.Dx)>Math.abs(i.Dx)?e.X=n.Clipper.TopX(i,e.Y):e.X=n.Clipper.TopX(t,e.Y))},n.Clipper.prototype.ProcessEdgesAtTopOfScanbeam=function(t){for(var i=this.m_ActiveEdges;i!==null;){var e=this.IsMaxima(i,t);if(e){var r=this.GetMaximaPairEx(i);e=r===null||!n.ClipperBase.IsHorizontal(r)}if(e){this.StrictlySimple&&this.InsertMaxima(i.Top.X);var s=i.PrevInAEL;this.DoMaxima(i),s===null?i=this.m_ActiveEdges:i=s.NextInAEL}else{if(this.IsIntermediate(i,t)&&n.ClipperBase.IsHorizontal(i.NextInLML)?(i=this.UpdateEdgeIntoAEL(i),i.OutIdx>=0&&this.AddOutPt(i,i.Bot),this.AddEdgeToSEL(i)):(i.Curr.X=n.Clipper.TopX(i,t),i.Curr.Y=t),n.use_xyz&&(i.Top.Y===t?i.Curr.Z=i.Top.Z:i.Bot.Y===t?i.Curr.Z=i.Bot.Z:i.Curr.Z=0),this.StrictlySimple){var s=i.PrevInAEL;if(i.OutIdx>=0&&i.WindDelta!==0&&s!==null&&s.OutIdx>=0&&s.Curr.X===i.Curr.X&&s.WindDelta!==0){var l=new n.IntPoint1(i.Curr);n.use_xyz&&this.SetZ(l,s,i);var o=this.AddOutPt(s,l),f=this.AddOutPt(i,l);this.AddJoin(o,f,l)}}i=i.NextInAEL}}for(this.ProcessHorizontals(),this.m_Maxima=null,i=this.m_ActiveEdges;i!==null;){if(this.IsIntermediate(i,t)){var o=null;i.OutIdx>=0&&(o=this.AddOutPt(i,i.Top)),i=this.UpdateEdgeIntoAEL(i);var s=i.PrevInAEL,u=i.NextInAEL;if(s!==null&&s.Curr.X===i.Bot.X&&s.Curr.Y===i.Bot.Y&&o!==null&&s.OutIdx>=0&&s.Curr.Y===s.Top.Y&&n.ClipperBase.SlopesEqual5(i.Curr,i.Top,s.Curr,s.Top,this.m_UseFullRange)&&i.WindDelta!==0&&s.WindDelta!==0){var f=this.AddOutPt(ePrev2,i.Bot);this.AddJoin(o,f,i.Top)}else if(u!==null&&u.Curr.X===i.Bot.X&&u.Curr.Y===i.Bot.Y&&o!==null&&u.OutIdx>=0&&u.Curr.Y===u.Top.Y&&n.ClipperBase.SlopesEqual5(i.Curr,i.Top,u.Curr,u.Top,this.m_UseFullRange)&&i.WindDelta!==0&&u.WindDelta!==0){var f=this.AddOutPt(u,i.Bot);this.AddJoin(o,f,i.Top)}}i=i.NextInAEL}},n.Clipper.prototype.DoMaxima=function(t){var i=this.GetMaximaPairEx(t);if(i===null){t.OutIdx>=0&&this.AddOutPt(t,t.Top),this.DeleteFromAEL(t);return}for(var e=t.NextInAEL;e!==null&&e!==i;)this.IntersectEdges(t,e,t.Top),this.SwapPositionsInAEL(t,e),e=t.NextInAEL;t.OutIdx===-1&&i.OutIdx===-1?(this.DeleteFromAEL(t),this.DeleteFromAEL(i)):t.OutIdx>=0&&i.OutIdx>=0?(t.OutIdx>=0&&this.AddLocalMaxPoly(t,i,t.Top),this.DeleteFromAEL(t),this.DeleteFromAEL(i)):n.use_lines&&t.WindDelta===0?(t.OutIdx>=0&&(this.AddOutPt(t,t.Top),t.OutIdx=n.ClipperBase.Unassigned),this.DeleteFromAEL(t),i.OutIdx>=0&&(this.AddOutPt(i,t.Top),i.OutIdx=n.ClipperBase.Unassigned),this.DeleteFromAEL(i)):n.Error("DoMaxima error")},n.Clipper.ReversePaths=function(t){for(var i=0,e=t.length;i<e;i++)t[i].reverse()},n.Clipper.Orientation=function(t){return n.Clipper.Area(t)>=0},n.Clipper.prototype.PointCount=function(t){if(t===null)return 0;var i=0,e=t;do i++,e=e.Next;while(e!==t);return i},n.Clipper.prototype.BuildResult=function(t){n.Clear(t);for(var i=0,e=this.m_PolyOuts.length;i<e;i++){var r=this.m_PolyOuts[i];if(r.Pts!==null){var s=r.Pts.Prev,l=this.PointCount(s);if(!(l<2)){for(var o=new Array(l),f=0;f<l;f++)o[f]=s.Pt,s=s.Prev;t.push(o)}}}},n.Clipper.prototype.BuildResult2=function(t){t.Clear();for(var i=0,e=this.m_PolyOuts.length;i<e;i++){var r=this.m_PolyOuts[i],s=this.PointCount(r.Pts);if(!(r.IsOpen&&s<2||!r.IsOpen&&s<3)){this.FixHoleLinkage(r);var l=new n.PolyNode;t.m_AllPolys.push(l),r.PolyNode=l,l.m_polygon.length=s;for(var o=r.Pts.Prev,f=0;f<s;f++)l.m_polygon[f]=o.Pt,o=o.Prev}}for(var i=0,e=this.m_PolyOuts.length;i<e;i++){var r=this.m_PolyOuts[i];r.PolyNode!==null&&(r.IsOpen?(r.PolyNode.IsOpen=!0,t.AddChild(r.PolyNode)):r.FirstLeft!==null&&r.FirstLeft.PolyNode!==null?r.FirstLeft.PolyNode.AddChild(r.PolyNode):t.AddChild(r.PolyNode))}},n.Clipper.prototype.FixupOutPolyline=function(t){for(var i=t.Pts,e=i.Prev;i!==e;)if(i=i.Next,n.IntPoint.op_Equality(i.Pt,i.Prev.Pt)){i===e&&(e=i.Prev);var r=i.Prev;r.Next=i.Next,i.Next.Prev=r,i=r}i===i.Prev&&(t.Pts=null)},n.Clipper.prototype.FixupOutPolygon=function(t){var i=null;t.BottomPt=null;for(var e=t.Pts,r=this.PreserveCollinear||this.StrictlySimple;;){if(e.Prev===e||e.Prev===e.Next){t.Pts=null;return}if(n.IntPoint.op_Equality(e.Pt,e.Next.Pt)||n.IntPoint.op_Equality(e.Pt,e.Prev.Pt)||n.ClipperBase.SlopesEqual4(e.Prev.Pt,e.Pt,e.Next.Pt,this.m_UseFullRange)&&(!r||!this.Pt2IsBetweenPt1AndPt3(e.Prev.Pt,e.Pt,e.Next.Pt)))i=null,e.Prev.Next=e.Next,e.Next.Prev=e.Prev,e=e.Prev;else{if(e===i)break;i===null&&(i=e),e=e.Next}}t.Pts=e},n.Clipper.prototype.DupOutPt=function(t,i){var e=new n.OutPt;return e.Pt.X=t.Pt.X,e.Pt.Y=t.Pt.Y,n.use_xyz&&(e.Pt.Z=t.Pt.Z),e.Idx=t.Idx,i?(e.Next=t.Next,e.Prev=t,t.Next.Prev=e,t.Next=e):(e.Prev=t.Prev,e.Next=t,t.Prev.Next=e,t.Prev=e),e},n.Clipper.prototype.GetOverlap=function(t,i,e,r,s){return t<i?e<r?(s.Left=Math.max(t,e),s.Right=Math.min(i,r)):(s.Left=Math.max(t,r),s.Right=Math.min(i,e)):e<r?(s.Left=Math.max(i,e),s.Right=Math.min(t,r)):(s.Left=Math.max(i,r),s.Right=Math.min(t,e)),s.Left<s.Right},n.Clipper.prototype.JoinHorz=function(t,i,e,r,s,l){var o=t.Pt.X>i.Pt.X?n.Direction.dRightToLeft:n.Direction.dLeftToRight,f=e.Pt.X>r.Pt.X?n.Direction.dRightToLeft:n.Direction.dLeftToRight;if(o===f)return!1;if(o===n.Direction.dLeftToRight){for(;t.Next.Pt.X<=s.X&&t.Next.Pt.X>=t.Pt.X&&t.Next.Pt.Y===s.Y;)t=t.Next;l&&t.Pt.X!==s.X&&(t=t.Next),i=this.DupOutPt(t,!l),n.IntPoint.op_Inequality(i.Pt,s)&&(t=i,t.Pt.X=s.X,t.Pt.Y=s.Y,n.use_xyz&&(t.Pt.Z=s.Z),i=this.DupOutPt(t,!l))}else{for(;t.Next.Pt.X>=s.X&&t.Next.Pt.X<=t.Pt.X&&t.Next.Pt.Y===s.Y;)t=t.Next;!l&&t.Pt.X!==s.X&&(t=t.Next),i=this.DupOutPt(t,l),n.IntPoint.op_Inequality(i.Pt,s)&&(t=i,t.Pt.X=s.X,t.Pt.Y=s.Y,n.use_xyz&&(t.Pt.Z=s.Z),i=this.DupOutPt(t,l))}if(f===n.Direction.dLeftToRight){for(;e.Next.Pt.X<=s.X&&e.Next.Pt.X>=e.Pt.X&&e.Next.Pt.Y===s.Y;)e=e.Next;l&&e.Pt.X!==s.X&&(e=e.Next),r=this.DupOutPt(e,!l),n.IntPoint.op_Inequality(r.Pt,s)&&(e=r,e.Pt.X=s.X,e.Pt.Y=s.Y,n.use_xyz&&(e.Pt.Z=s.Z),r=this.DupOutPt(e,!l))}else{for(;e.Next.Pt.X>=s.X&&e.Next.Pt.X<=e.Pt.X&&e.Next.Pt.Y===s.Y;)e=e.Next;!l&&e.Pt.X!==s.X&&(e=e.Next),r=this.DupOutPt(e,l),n.IntPoint.op_Inequality(r.Pt,s)&&(e=r,e.Pt.X=s.X,e.Pt.Y=s.Y,n.use_xyz&&(e.Pt.Z=s.Z),r=this.DupOutPt(e,l))}return o===n.Direction.dLeftToRight===l?(t.Prev=e,e.Next=t,i.Next=r,r.Prev=i):(t.Next=e,e.Prev=t,i.Prev=r,r.Next=i),!0},n.Clipper.prototype.JoinPoints=function(t,i,e){var r=t.OutPt1,s=new n.OutPt,l=t.OutPt2,o=new n.OutPt,f=t.OutPt1.Pt.Y===t.OffPt.Y;if(f&&n.IntPoint.op_Equality(t.OffPt,t.OutPt1.Pt)&&n.IntPoint.op_Equality(t.OffPt,t.OutPt2.Pt)){if(i!==e)return!1;for(s=t.OutPt1.Next;s!==r&&n.IntPoint.op_Equality(s.Pt,t.OffPt);)s=s.Next;var u=s.Pt.Y>t.OffPt.Y;for(o=t.OutPt2.Next;o!==l&&n.IntPoint.op_Equality(o.Pt,t.OffPt);)o=o.Next;var h=o.Pt.Y>t.OffPt.Y;return u===h?!1:u?(s=this.DupOutPt(r,!1),o=this.DupOutPt(l,!0),r.Prev=l,l.Next=r,s.Next=o,o.Prev=s,t.OutPt1=r,t.OutPt2=s,!0):(s=this.DupOutPt(r,!0),o=this.DupOutPt(l,!1),r.Next=l,l.Prev=r,s.Prev=o,o.Next=s,t.OutPt1=r,t.OutPt2=s,!0)}else if(f){for(s=r;r.Prev.Pt.Y===r.Pt.Y&&r.Prev!==s&&r.Prev!==l;)r=r.Prev;for(;s.Next.Pt.Y===s.Pt.Y&&s.Next!==r&&s.Next!==l;)s=s.Next;if(s.Next===r||s.Next===l)return!1;for(o=l;l.Prev.Pt.Y===l.Pt.Y&&l.Prev!==o&&l.Prev!==s;)l=l.Prev;for(;o.Next.Pt.Y===o.Pt.Y&&o.Next!==l&&o.Next!==r;)o=o.Next;if(o.Next===l||o.Next===r)return!1;var P={Left:null,Right:null};if(!this.GetOverlap(r.Pt.X,s.Pt.X,l.Pt.X,o.Pt.X,P))return!1;var a=P.Left,m=P.Right,y=new n.IntPoint0,v;return r.Pt.X>=a&&r.Pt.X<=m?(y.X=r.Pt.X,y.Y=r.Pt.Y,n.use_xyz&&(y.Z=r.Pt.Z),v=r.Pt.X>s.Pt.X):l.Pt.X>=a&&l.Pt.X<=m?(y.X=l.Pt.X,y.Y=l.Pt.Y,n.use_xyz&&(y.Z=l.Pt.Z),v=l.Pt.X>o.Pt.X):s.Pt.X>=a&&s.Pt.X<=m?(y.X=s.Pt.X,y.Y=s.Pt.Y,n.use_xyz&&(y.Z=s.Pt.Z),v=s.Pt.X>r.Pt.X):(y.X=o.Pt.X,y.Y=o.Pt.Y,n.use_xyz&&(y.Z=o.Pt.Z),v=o.Pt.X>l.Pt.X),t.OutPt1=r,t.OutPt2=l,this.JoinHorz(r,s,l,o,y,v)}else{for(s=r.Next;n.IntPoint.op_Equality(s.Pt,r.Pt)&&s!==r;)s=s.Next;var I=s.Pt.Y>r.Pt.Y||!n.ClipperBase.SlopesEqual4(r.Pt,s.Pt,t.OffPt,this.m_UseFullRange);if(I){for(s=r.Prev;n.IntPoint.op_Equality(s.Pt,r.Pt)&&s!==r;)s=s.Prev;if(s.Pt.Y>r.Pt.Y||!n.ClipperBase.SlopesEqual4(r.Pt,s.Pt,t.OffPt,this.m_UseFullRange))return!1}for(o=l.Next;n.IntPoint.op_Equality(o.Pt,l.Pt)&&o!==l;)o=o.Next;var _=o.Pt.Y>l.Pt.Y||!n.ClipperBase.SlopesEqual4(l.Pt,o.Pt,t.OffPt,this.m_UseFullRange);if(_){for(o=l.Prev;n.IntPoint.op_Equality(o.Pt,l.Pt)&&o!==l;)o=o.Prev;if(o.Pt.Y>l.Pt.Y||!n.ClipperBase.SlopesEqual4(l.Pt,o.Pt,t.OffPt,this.m_UseFullRange))return!1}return s===r||o===l||s===o||i===e&&I===_?!1:I?(s=this.DupOutPt(r,!1),o=this.DupOutPt(l,!0),r.Prev=l,l.Next=r,s.Next=o,o.Prev=s,t.OutPt1=r,t.OutPt2=s,!0):(s=this.DupOutPt(r,!0),o=this.DupOutPt(l,!1),r.Next=l,l.Prev=r,s.Prev=o,o.Next=s,t.OutPt1=r,t.OutPt2=s,!0)}},n.Clipper.GetBounds=function(t){for(var i=0,e=t.length;i<e&&t[i].length===0;)i++;if(i===e)return new n.IntRect(0,0,0,0);var r=new n.IntRect;for(r.left=t[i][0].X,r.right=r.left,r.top=t[i][0].Y,r.bottom=r.top;i<e;i++)for(var s=0,l=t[i].length;s<l;s++)t[i][s].X<r.left?r.left=t[i][s].X:t[i][s].X>r.right&&(r.right=t[i][s].X),t[i][s].Y<r.top?r.top=t[i][s].Y:t[i][s].Y>r.bottom&&(r.bottom=t[i][s].Y);return r},n.Clipper.prototype.GetBounds2=function(t){var i=t,e=new n.IntRect;for(e.left=t.Pt.X,e.right=t.Pt.X,e.top=t.Pt.Y,e.bottom=t.Pt.Y,t=t.Next;t!==i;)t.Pt.X<e.left&&(e.left=t.Pt.X),t.Pt.X>e.right&&(e.right=t.Pt.X),t.Pt.Y<e.top&&(e.top=t.Pt.Y),t.Pt.Y>e.bottom&&(e.bottom=t.Pt.Y),t=t.Next;return e},n.Clipper.PointInPolygon=function(t,i){var e=0,r=i.length;if(r<3)return 0;for(var s=i[0],l=1;l<=r;++l){var o=l===r?i[0]:i[l];if(o.Y===t.Y&&(o.X===t.X||s.Y===t.Y&&o.X>t.X==s.X<t.X))return-1;if(s.Y<t.Y!=o.Y<t.Y){if(s.X>=t.X)if(o.X>t.X)e=1-e;else{var f=(s.X-t.X)*(o.Y-t.Y)-(o.X-t.X)*(s.Y-t.Y);if(f===0)return-1;f>0==o.Y>s.Y&&(e=1-e)}else if(o.X>t.X){var f=(s.X-t.X)*(o.Y-t.Y)-(o.X-t.X)*(s.Y-t.Y);if(f===0)return-1;f>0==o.Y>s.Y&&(e=1-e)}}s=o}return e},n.Clipper.prototype.PointInPolygon=function(t,i){var e=0,r=i,s=t.X,l=t.Y,o=i.Pt.X,f=i.Pt.Y;do{i=i.Next;var u=i.Pt.X,h=i.Pt.Y;if(h===l&&(u===s||f===l&&u>s==o<s))return-1;if(f<l!=h<l){if(o>=s)if(u>s)e=1-e;else{var P=(o-s)*(h-l)-(u-s)*(f-l);if(P===0)return-1;P>0==h>f&&(e=1-e)}else if(u>s){var P=(o-s)*(h-l)-(u-s)*(f-l);if(P===0)return-1;P>0==h>f&&(e=1-e)}}o=u,f=h}while(r!==i);return e},n.Clipper.prototype.Poly2ContainsPoly1=function(t,i){var e=t;do{var r=this.PointInPolygon(e.Pt,i);if(r>=0)return r>0;e=e.Next}while(e!==t);return!0},n.Clipper.prototype.FixupFirstLefts1=function(t,i){for(var e,r,s=0,l=this.m_PolyOuts.length;s<l;s++)e=this.m_PolyOuts[s],r=n.Clipper.ParseFirstLeft(e.FirstLeft),e.Pts!==null&&r===t&&this.Poly2ContainsPoly1(e.Pts,i.Pts)&&(e.FirstLeft=i)},n.Clipper.prototype.FixupFirstLefts2=function(t,i){for(var e=i.FirstLeft,r,s,l=0,o=this.m_PolyOuts.length;l<o;l++)r=this.m_PolyOuts[l],!(r.Pts===null||r===i||r===t)&&(s=n.Clipper.ParseFirstLeft(r.FirstLeft),!(s!==e&&s!==t&&s!==i)&&(this.Poly2ContainsPoly1(r.Pts,t.Pts)?r.FirstLeft=t:this.Poly2ContainsPoly1(r.Pts,i.Pts)?r.FirstLeft=i:(r.FirstLeft===t||r.FirstLeft===i)&&(r.FirstLeft=e)))},n.Clipper.prototype.FixupFirstLefts3=function(t,i){for(var e,r,s=0,l=this.m_PolyOuts.length;s<l;s++)e=this.m_PolyOuts[s],r=n.Clipper.ParseFirstLeft(e.FirstLeft),e.Pts!==null&&r===t&&(e.FirstLeft=i)},n.Clipper.ParseFirstLeft=function(t){for(;t!==null&&t.Pts===null;)t=t.FirstLeft;return t},n.Clipper.prototype.JoinCommonEdges=function(){for(var t=0,i=this.m_Joins.length;t<i;t++){var e=this.m_Joins[t],r=this.GetOutRec(e.OutPt1.Idx),s=this.GetOutRec(e.OutPt2.Idx);if(!(r.Pts===null||s.Pts===null)&&!(r.IsOpen||s.IsOpen)){var l;r===s?l=r:this.OutRec1RightOfOutRec2(r,s)?l=s:this.OutRec1RightOfOutRec2(s,r)?l=r:l=this.GetLowermostRec(r,s),this.JoinPoints(e,r,s)&&(r===s?(r.Pts=e.OutPt1,r.BottomPt=null,s=this.CreateOutRec(),s.Pts=e.OutPt2,this.UpdateOutPtIdxs(s),this.Poly2ContainsPoly1(s.Pts,r.Pts)?(s.IsHole=!r.IsHole,s.FirstLeft=r,this.m_UsingPolyTree&&this.FixupFirstLefts2(s,r),(s.IsHole^this.ReverseSolution)==this.Area$1(s)>0&&this.ReversePolyPtLinks(s.Pts)):this.Poly2ContainsPoly1(r.Pts,s.Pts)?(s.IsHole=r.IsHole,r.IsHole=!s.IsHole,s.FirstLeft=r.FirstLeft,r.FirstLeft=s,this.m_UsingPolyTree&&this.FixupFirstLefts2(r,s),(r.IsHole^this.ReverseSolution)==this.Area$1(r)>0&&this.ReversePolyPtLinks(r.Pts)):(s.IsHole=r.IsHole,s.FirstLeft=r.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(r,s))):(s.Pts=null,s.BottomPt=null,s.Idx=r.Idx,r.IsHole=l.IsHole,l===s&&(r.FirstLeft=s.FirstLeft),s.FirstLeft=r,this.m_UsingPolyTree&&this.FixupFirstLefts3(s,r)))}}},n.Clipper.prototype.UpdateOutPtIdxs=function(t){var i=t.Pts;do i.Idx=t.Idx,i=i.Prev;while(i!==t.Pts)},n.Clipper.prototype.DoSimplePolygons=function(){for(var t=0;t<this.m_PolyOuts.length;){var i=this.m_PolyOuts[t++],e=i.Pts;if(!(e===null||i.IsOpen))do{for(var r=e.Next;r!==i.Pts;){if(n.IntPoint.op_Equality(e.Pt,r.Pt)&&r.Next!==e&&r.Prev!==e){var s=e.Prev,l=r.Prev;e.Prev=l,l.Next=e,r.Prev=s,s.Next=r,i.Pts=e;var o=this.CreateOutRec();o.Pts=r,this.UpdateOutPtIdxs(o),this.Poly2ContainsPoly1(o.Pts,i.Pts)?(o.IsHole=!i.IsHole,o.FirstLeft=i,this.m_UsingPolyTree&&this.FixupFirstLefts2(o,i)):this.Poly2ContainsPoly1(i.Pts,o.Pts)?(o.IsHole=i.IsHole,i.IsHole=!o.IsHole,o.FirstLeft=i.FirstLeft,i.FirstLeft=o,this.m_UsingPolyTree&&this.FixupFirstLefts2(i,o)):(o.IsHole=i.IsHole,o.FirstLeft=i.FirstLeft,this.m_UsingPolyTree&&this.FixupFirstLefts1(i,o)),r=e}r=r.Next}e=e.Next}while(e!==i.Pts)}},n.Clipper.Area=function(t){if(!Array.isArray(t))return 0;var i=t.length;if(i<3)return 0;for(var e=0,r=0,s=i-1;r<i;++r)e+=(t[s].X+t[r].X)*(t[s].Y-t[r].Y),s=r;return-e*.5},n.Clipper.prototype.Area=function(t){var i=t;if(t===null)return 0;var e=0;do e=e+(t.Prev.Pt.X+t.Pt.X)*(t.Prev.Pt.Y-t.Pt.Y),t=t.Next;while(t!==i);return e*.5},n.Clipper.prototype.Area$1=function(t){return this.Area(t.Pts)},n.Clipper.SimplifyPolygon=function(t,i){var e=new Array,r=new n.Clipper(0);return r.StrictlySimple=!0,r.AddPath(t,n.PolyType.ptSubject,!0),r.Execute(n.ClipType.ctUnion,e,i,i),e},n.Clipper.SimplifyPolygons=function(t,i){typeof i>"u"&&(i=n.PolyFillType.pftEvenOdd);var e=new Array,r=new n.Clipper(0);return r.StrictlySimple=!0,r.AddPaths(t,n.PolyType.ptSubject,!0),r.Execute(n.ClipType.ctUnion,e,i,i),e},n.Clipper.DistanceSqrd=function(t,i){var e=t.X-i.X,r=t.Y-i.Y;return e*e+r*r},n.Clipper.DistanceFromLineSqrd=function(t,i,e){var r=i.Y-e.Y,s=e.X-i.X,l=r*i.X+s*i.Y;return l=r*t.X+s*t.Y-l,l*l/(r*r+s*s)},n.Clipper.SlopesNearCollinear=function(t,i,e,r){return Math.abs(t.X-i.X)>Math.abs(t.Y-i.Y)?t.X>i.X==t.X<e.X?n.Clipper.DistanceFromLineSqrd(t,i,e)<r:i.X>t.X==i.X<e.X?n.Clipper.DistanceFromLineSqrd(i,t,e)<r:n.Clipper.DistanceFromLineSqrd(e,t,i)<r:t.Y>i.Y==t.Y<e.Y?n.Clipper.DistanceFromLineSqrd(t,i,e)<r:i.Y>t.Y==i.Y<e.Y?n.Clipper.DistanceFromLineSqrd(i,t,e)<r:n.Clipper.DistanceFromLineSqrd(e,t,i)<r},n.Clipper.PointsAreClose=function(t,i,e){var r=t.X-i.X,s=t.Y-i.Y;return r*r+s*s<=e},n.Clipper.ExcludeOp=function(t){var i=t.Prev;return i.Next=t.Next,t.Next.Prev=i,i.Idx=0,i},n.Clipper.CleanPolygon=function(t,i){typeof i>"u"&&(i=1.415);var e=t.length;if(e===0)return new Array;for(var r=new Array(e),s=0;s<e;++s)r[s]=new n.OutPt;for(var s=0;s<e;++s)r[s].Pt=t[s],r[s].Next=r[(s+1)%e],r[s].Next.Prev=r[s],r[s].Idx=0;for(var l=i*i,o=r[0];o.Idx===0&&o.Next!==o.Prev;)n.Clipper.PointsAreClose(o.Pt,o.Prev.Pt,l)?(o=n.Clipper.ExcludeOp(o),e--):n.Clipper.PointsAreClose(o.Prev.Pt,o.Next.Pt,l)?(n.Clipper.ExcludeOp(o.Next),o=n.Clipper.ExcludeOp(o),e-=2):n.Clipper.SlopesNearCollinear(o.Prev.Pt,o.Pt,o.Next.Pt,l)?(o=n.Clipper.ExcludeOp(o),e--):(o.Idx=1,o=o.Next);e<3&&(e=0);for(var f=new Array(e),s=0;s<e;++s)f[s]=new n.IntPoint1(o.Pt),o=o.Next;return r=null,f},n.Clipper.CleanPolygons=function(t,i){for(var e=new Array(t.length),r=0,s=t.length;r<s;r++)e[r]=n.Clipper.CleanPolygon(t[r],i);return e},n.Clipper.Minkowski=function(t,i,e,r){var s=r?1:0,l=t.length,o=i.length,f=new Array;if(e)for(var u=0;u<o;u++){for(var h=new Array(l),P=0,a=t.length,m=t[P];P<a;P++,m=t[P])h[P]=new n.IntPoint2(i[u].X+m.X,i[u].Y+m.Y);f.push(h)}else for(var u=0;u<o;u++){for(var h=new Array(l),P=0,a=t.length,m=t[P];P<a;P++,m=t[P])h[P]=new n.IntPoint2(i[u].X-m.X,i[u].Y-m.Y);f.push(h)}for(var y=new Array,u=0;u<o-1+s;u++)for(var P=0;P<l;P++){var v=new Array;v.push(f[u%o][P%l]),v.push(f[(u+1)%o][P%l]),v.push(f[(u+1)%o][(P+1)%l]),v.push(f[u%o][(P+1)%l]),n.Clipper.Orientation(v)||v.reverse(),y.push(v)}return y},n.Clipper.MinkowskiSum=function(t,i,e){if(i[0]instanceof Array){for(var s=i,o=new n.Paths,l=new n.Clipper,f=0;f<s.length;++f){var u=n.Clipper.Minkowski(t,s[f],!0,e);if(l.AddPaths(u,n.PolyType.ptSubject,!0),e){var r=n.Clipper.TranslatePath(s[f],t[0]);l.AddPath(r,n.PolyType.ptClip,!0)}}return l.Execute(n.ClipType.ctUnion,o,n.PolyFillType.pftNonZero,n.PolyFillType.pftNonZero),o}else{var r=i,s=n.Clipper.Minkowski(t,r,!0,e),l=new n.Clipper;return l.AddPaths(s,n.PolyType.ptSubject,!0),l.Execute(n.ClipType.ctUnion,s,n.PolyFillType.pftNonZero,n.PolyFillType.pftNonZero),s}},n.Clipper.TranslatePath=function(t,i){for(var e=new n.Path,r=0;r<t.length;r++)e.push(new n.IntPoint2(t[r].X+i.X,t[r].Y+i.Y));return e},n.Clipper.MinkowskiDiff=function(t,i){var e=n.Clipper.Minkowski(t,i,!1,!0),r=new n.Clipper;return r.AddPaths(e,n.PolyType.ptSubject,!0),r.Execute(n.ClipType.ctUnion,e,n.PolyFillType.pftNonZero,n.PolyFillType.pftNonZero),e},n.Clipper.PolyTreeToPaths=function(t){var i=new Array;return n.Clipper.AddPolyNodeToPaths(t,n.Clipper.NodeType.ntAny,i),i},n.Clipper.AddPolyNodeToPaths=function(t,i,e){var r=!0;switch(i){case n.Clipper.NodeType.ntOpen:return;case n.Clipper.NodeType.ntClosed:r=!t.IsOpen;break;default:break}t.m_polygon.length>0&&r&&e.push(t.m_polygon);for(var s=0,l=t.Childs(),o=l.length,f=l[s];s<o;s++,f=l[s])n.Clipper.AddPolyNodeToPaths(f,i,e)},n.Clipper.OpenPathsFromPolyTree=function(t){for(var i=new n.Paths,e=0,r=t.ChildCount();e<r;e++)t.Childs()[e].IsOpen&&i.push(t.Childs()[e].m_polygon);return i},n.Clipper.ClosedPathsFromPolyTree=function(t){var i=new n.Paths;return n.Clipper.AddPolyNodeToPaths(t,n.Clipper.NodeType.ntClosed,i),i},V(n.Clipper,n.ClipperBase),n.Clipper.NodeType={ntAny:0,ntOpen:1,ntClosed:2},n.ClipperOffset=function(t,i){typeof t>"u"&&(t=2),typeof i>"u"&&(i=n.ClipperOffset.def_arc_tolerance),this.m_destPolys=new n.Paths,this.m_srcPoly=new n.Path,this.m_destPoly=new n.Path,this.m_normals=new Array,this.m_delta=0,this.m_sinA=0,this.m_sin=0,this.m_cos=0,this.m_miterLim=0,this.m_StepsPerRad=0,this.m_lowest=new n.IntPoint0,this.m_polyNodes=new n.PolyNode,this.MiterLimit=t,this.ArcTolerance=i,this.m_lowest.X=-1},n.ClipperOffset.two_pi=6.28318530717959,n.ClipperOffset.def_arc_tolerance=.25,n.ClipperOffset.prototype.Clear=function(){n.Clear(this.m_polyNodes.Childs()),this.m_lowest.X=-1},n.ClipperOffset.Round=n.Clipper.Round,n.ClipperOffset.prototype.AddPath=function(t,i,e){var r=t.length-1;if(!(r<0)){var s=new n.PolyNode;if(s.m_jointype=i,s.m_endtype=e,e===n.EndType.etClosedLine||e===n.EndType.etClosedPolygon)for(;r>0&&n.IntPoint.op_Equality(t[0],t[r]);)r--;s.m_polygon.push(t[0]);for(var l=0,o=0,f=1;f<=r;f++)n.IntPoint.op_Inequality(s.m_polygon[l],t[f])&&(l++,s.m_polygon.push(t[f]),(t[f].Y>s.m_polygon[o].Y||t[f].Y===s.m_polygon[o].Y&&t[f].X<s.m_polygon[o].X)&&(o=l));if(!(e===n.EndType.etClosedPolygon&&l<2)&&(this.m_polyNodes.AddChild(s),e===n.EndType.etClosedPolygon))if(this.m_lowest.X<0)this.m_lowest=new n.IntPoint2(this.m_polyNodes.ChildCount()-1,o);else{var u=this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon[this.m_lowest.Y];(s.m_polygon[o].Y>u.Y||s.m_polygon[o].Y===u.Y&&s.m_polygon[o].X<u.X)&&(this.m_lowest=new n.IntPoint2(this.m_polyNodes.ChildCount()-1,o))}}},n.ClipperOffset.prototype.AddPaths=function(t,i,e){for(var r=0,s=t.length;r<s;r++)this.AddPath(t[r],i,e)},n.ClipperOffset.prototype.FixOrientations=function(){if(this.m_lowest.X>=0&&!n.Clipper.Orientation(this.m_polyNodes.Childs()[this.m_lowest.X].m_polygon))for(var t=0;t<this.m_polyNodes.ChildCount();t++){var i=this.m_polyNodes.Childs()[t];(i.m_endtype===n.EndType.etClosedPolygon||i.m_endtype===n.EndType.etClosedLine&&n.Clipper.Orientation(i.m_polygon))&&i.m_polygon.reverse()}else for(var t=0;t<this.m_polyNodes.ChildCount();t++){var i=this.m_polyNodes.Childs()[t];i.m_endtype===n.EndType.etClosedLine&&!n.Clipper.Orientation(i.m_polygon)&&i.m_polygon.reverse()}},n.ClipperOffset.GetUnitNormal=function(t,i){var e=i.X-t.X,r=i.Y-t.Y;if(e===0&&r===0)return new n.DoublePoint2(0,0);var s=1/Math.sqrt(e*e+r*r);return e*=s,r*=s,new n.DoublePoint2(r,-e)},n.ClipperOffset.prototype.DoOffset=function(t){if(this.m_destPolys=new Array,this.m_delta=t,n.ClipperBase.near_zero(t)){for(var i=0;i<this.m_polyNodes.ChildCount();i++){var e=this.m_polyNodes.Childs()[i];e.m_endtype===n.EndType.etClosedPolygon&&this.m_destPolys.push(e.m_polygon)}return}this.MiterLimit>2?this.m_miterLim=2/(this.MiterLimit*this.MiterLimit):this.m_miterLim=.5;var r;this.ArcTolerance<=0?r=n.ClipperOffset.def_arc_tolerance:this.ArcTolerance>Math.abs(t)*n.ClipperOffset.def_arc_tolerance?r=Math.abs(t)*n.ClipperOffset.def_arc_tolerance:r=this.ArcTolerance;var s=3.14159265358979/Math.acos(1-r/Math.abs(t));this.m_sin=Math.sin(n.ClipperOffset.two_pi/s),this.m_cos=Math.cos(n.ClipperOffset.two_pi/s),this.m_StepsPerRad=s/n.ClipperOffset.two_pi,t<0&&(this.m_sin=-this.m_sin);for(var i=0;i<this.m_polyNodes.ChildCount();i++){var e=this.m_polyNodes.Childs()[i];this.m_srcPoly=e.m_polygon;var l=this.m_srcPoly.length;if(!(l===0||t<=0&&(l<3||e.m_endtype!==n.EndType.etClosedPolygon))){if(this.m_destPoly=new Array,l===1){if(e.m_jointype===n.JoinType.jtRound)for(var o=1,f=0,u=1;u<=s;u++){this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[0].X+o*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y+f*t)));var h=o;o=o*this.m_cos-this.m_sin*f,f=h*this.m_sin+f*this.m_cos}else for(var o=-1,f=-1,u=0;u<4;++u)this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[0].X+o*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y+f*t))),o<0?o=1:f<0?f=1:o=-1;this.m_destPolys.push(this.m_destPoly);continue}this.m_normals.length=0;for(var u=0;u<l-1;u++)this.m_normals.push(n.ClipperOffset.GetUnitNormal(this.m_srcPoly[u],this.m_srcPoly[u+1]));if(e.m_endtype===n.EndType.etClosedLine||e.m_endtype===n.EndType.etClosedPolygon?this.m_normals.push(n.ClipperOffset.GetUnitNormal(this.m_srcPoly[l-1],this.m_srcPoly[0])):this.m_normals.push(new n.DoublePoint1(this.m_normals[l-2])),e.m_endtype===n.EndType.etClosedPolygon){for(var P=l-1,u=0;u<l;u++)P=this.OffsetPoint(u,P,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else if(e.m_endtype===n.EndType.etClosedLine){for(var P=l-1,u=0;u<l;u++)P=this.OffsetPoint(u,P,e.m_jointype);this.m_destPolys.push(this.m_destPoly),this.m_destPoly=new Array;for(var a=this.m_normals[l-1],u=l-1;u>0;u--)this.m_normals[u]=new n.DoublePoint2(-this.m_normals[u-1].X,-this.m_normals[u-1].Y);this.m_normals[0]=new n.DoublePoint2(-a.X,-a.Y),P=0;for(var u=l-1;u>=0;u--)P=this.OffsetPoint(u,P,e.m_jointype);this.m_destPolys.push(this.m_destPoly)}else{for(var P=0,u=1;u<l-1;++u)P=this.OffsetPoint(u,P,e.m_jointype);var m;if(e.m_endtype===n.EndType.etOpenButt){var u=l-1;m=new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[u].X+this.m_normals[u].X*t),n.ClipperOffset.Round(this.m_srcPoly[u].Y+this.m_normals[u].Y*t)),this.m_destPoly.push(m),m=new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[u].X-this.m_normals[u].X*t),n.ClipperOffset.Round(this.m_srcPoly[u].Y-this.m_normals[u].Y*t)),this.m_destPoly.push(m)}else{var u=l-1;P=l-2,this.m_sinA=0,this.m_normals[u]=new n.DoublePoint2(-this.m_normals[u].X,-this.m_normals[u].Y),e.m_endtype===n.EndType.etOpenSquare?this.DoSquare(u,P):this.DoRound(u,P)}for(var u=l-1;u>0;u--)this.m_normals[u]=new n.DoublePoint2(-this.m_normals[u-1].X,-this.m_normals[u-1].Y);this.m_normals[0]=new n.DoublePoint2(-this.m_normals[1].X,-this.m_normals[1].Y),P=l-1;for(var u=P-1;u>0;--u)P=this.OffsetPoint(u,P,e.m_jointype);e.m_endtype===n.EndType.etOpenButt?(m=new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[0].X-this.m_normals[0].X*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y-this.m_normals[0].Y*t)),this.m_destPoly.push(m),m=new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[0].X+this.m_normals[0].X*t),n.ClipperOffset.Round(this.m_srcPoly[0].Y+this.m_normals[0].Y*t)),this.m_destPoly.push(m)):(P=1,this.m_sinA=0,e.m_endtype===n.EndType.etOpenSquare?this.DoSquare(0,1):this.DoRound(0,1)),this.m_destPolys.push(this.m_destPoly)}}}},n.ClipperOffset.prototype.Execute=function(){var t=arguments,i=t[0]instanceof n.PolyTree;if(i){var e=t[0],r=t[1];e.Clear(),this.FixOrientations(),this.DoOffset(r);var s=new n.Clipper(0);if(s.AddPaths(this.m_destPolys,n.PolyType.ptSubject,!0),r>0)s.Execute(n.ClipType.ctUnion,e,n.PolyFillType.pftPositive,n.PolyFillType.pftPositive);else{var l=n.Clipper.GetBounds(this.m_destPolys),o=new n.Path;if(o.push(new n.IntPoint2(l.left-10,l.bottom+10)),o.push(new n.IntPoint2(l.right+10,l.bottom+10)),o.push(new n.IntPoint2(l.right+10,l.top-10)),o.push(new n.IntPoint2(l.left-10,l.top-10)),s.AddPath(o,n.PolyType.ptSubject,!0),s.ReverseSolution=!0,s.Execute(n.ClipType.ctUnion,e,n.PolyFillType.pftNegative,n.PolyFillType.pftNegative),e.ChildCount()===1&&e.Childs()[0].ChildCount()>0){var f=e.Childs()[0];e.Childs()[0]=f.Childs()[0],e.Childs()[0].m_Parent=e;for(var u=1;u<f.ChildCount();u++)e.AddChild(f.Childs()[u])}else e.Clear()}}else{var e=t[0],r=t[1];n.Clear(e),this.FixOrientations(),this.DoOffset(r);var s=new n.Clipper(0);if(s.AddPaths(this.m_destPolys,n.PolyType.ptSubject,!0),r>0)s.Execute(n.ClipType.ctUnion,e,n.PolyFillType.pftPositive,n.PolyFillType.pftPositive);else{var l=n.Clipper.GetBounds(this.m_destPolys),o=new n.Path;o.push(new n.IntPoint2(l.left-10,l.bottom+10)),o.push(new n.IntPoint2(l.right+10,l.bottom+10)),o.push(new n.IntPoint2(l.right+10,l.top-10)),o.push(new n.IntPoint2(l.left-10,l.top-10)),s.AddPath(o,n.PolyType.ptSubject,!0),s.ReverseSolution=!0,s.Execute(n.ClipType.ctUnion,e,n.PolyFillType.pftNegative,n.PolyFillType.pftNegative),e.length>0&&e.splice(0,1)}}},n.ClipperOffset.prototype.OffsetPoint=function(t,i,e){if(this.m_sinA=this.m_normals[i].X*this.m_normals[t].Y-this.m_normals[t].X*this.m_normals[i].Y,Math.abs(this.m_sinA*this.m_delta)<1){var r=this.m_normals[i].X*this.m_normals[t].X+this.m_normals[t].Y*this.m_normals[i].Y;if(r>0)return this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[i].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[i].Y*this.m_delta))),i}else this.m_sinA>1?this.m_sinA=1:this.m_sinA<-1&&(this.m_sinA=-1);if(this.m_sinA*this.m_delta<0)this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[i].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[i].Y*this.m_delta))),this.m_destPoly.push(new n.IntPoint1(this.m_srcPoly[t])),this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)));else switch(e){case n.JoinType.jtMiter:{var s=1+(this.m_normals[t].X*this.m_normals[i].X+this.m_normals[t].Y*this.m_normals[i].Y);s>=this.m_miterLim?this.DoMiter(t,i,s):this.DoSquare(t,i);break}case n.JoinType.jtSquare:this.DoSquare(t,i);break;case n.JoinType.jtRound:this.DoRound(t,i);break}return i=t,i},n.ClipperOffset.prototype.DoSquare=function(t,i){var e=Math.tan(Math.atan2(this.m_sinA,this.m_normals[i].X*this.m_normals[t].X+this.m_normals[i].Y*this.m_normals[t].Y)/4);this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[i].X-this.m_normals[i].Y*e)),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[i].Y+this.m_normals[i].X*e)))),this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_delta*(this.m_normals[t].X+this.m_normals[t].Y*e)),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_delta*(this.m_normals[t].Y-this.m_normals[t].X*e))))},n.ClipperOffset.prototype.DoMiter=function(t,i,e){var r=this.m_delta/e;this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+(this.m_normals[i].X+this.m_normals[t].X)*r),n.ClipperOffset.Round(this.m_srcPoly[t].Y+(this.m_normals[i].Y+this.m_normals[t].Y)*r)))},n.ClipperOffset.prototype.DoRound=function(t,i){for(var e=Math.atan2(this.m_sinA,this.m_normals[i].X*this.m_normals[t].X+this.m_normals[i].Y*this.m_normals[t].Y),r=Math.max(n.Cast_Int32(n.ClipperOffset.Round(this.m_StepsPerRad*Math.abs(e))),1),s=this.m_normals[i].X,l=this.m_normals[i].Y,o,f=0;f<r;++f)this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+s*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+l*this.m_delta))),o=s,s=s*this.m_cos-this.m_sin*l,l=o*this.m_sin+l*this.m_cos;this.m_destPoly.push(new n.IntPoint2(n.ClipperOffset.Round(this.m_srcPoly[t].X+this.m_normals[t].X*this.m_delta),n.ClipperOffset.Round(this.m_srcPoly[t].Y+this.m_normals[t].Y*this.m_delta)))},n.Error=function(t){try{throw new Error(t)}catch(i){alert(i.message)}},n.JS={},n.JS.AreaOfPolygon=function(t,i){return i||(i=1),n.Clipper.Area(t)/(i*i)},n.JS.AreaOfPolygons=function(t,i){i||(i=1);for(var e=0,r=0;r<t.length;r++)e+=n.Clipper.Area(t[r]);return e/(i*i)},n.JS.BoundsOfPath=function(t,i){return n.JS.BoundsOfPaths([t],i)},n.JS.BoundsOfPaths=function(t,i){i||(i=1);var e=n.Clipper.GetBounds(t);return e.left/=i,e.bottom/=i,e.right/=i,e.top/=i,e},n.JS.Clean=function(r,i){if(!(r instanceof Array))return[];var e=r[0]instanceof Array,r=n.JS.Clone(r);if(typeof i!="number"||i===null)return n.Error("Delta is not a number in Clean()."),r;if(r.length===0||r.length===1&&r[0].length===0||i<0)return r;e||(r=[r]);for(var s=r.length,l,o,f,u,h,P,a,m=[],y=0;y<s;y++)if(o=r[y],l=o.length,l!==0){if(l<3){f=o,m.push(f);continue}for(f=o,u=i*i,h=o[0],P=1,a=1;a<l;a++)(o[a].X-h.X)*(o[a].X-h.X)+(o[a].Y-h.Y)*(o[a].Y-h.Y)<=u||(f[P]=o[a],h=o[a],P++);h=o[P-1],(o[0].X-h.X)*(o[0].X-h.X)+(o[0].Y-h.Y)*(o[0].Y-h.Y)<=u&&P--,P<l&&f.splice(P,l-P),f.length&&m.push(f)}return!e&&m.length?m=m[0]:!e&&m.length===0?m=[]:e&&m.length===0&&(m=[[]]),m},n.JS.Clone=function(t){if(!(t instanceof Array))return[];if(t.length===0)return[];if(t.length===1&&t[0].length===0)return[[]];var i=t[0]instanceof Array;i||(t=[t]);var e=t.length,r,s,l,o,f=new Array(e);for(s=0;s<e;s++){for(r=t[s].length,o=new Array(r),l=0;l<r;l++)o[l]={X:t[s][l].X,Y:t[s][l].Y};f[s]=o}return i||(f=f[0]),f},n.JS.Lighten=function(t,i){if(!(t instanceof Array))return[];if(typeof i!="number"||i===null)return n.Error("Tolerance is not a number in Lighten()."),n.JS.Clone(t);if(t.length===0||t.length===1&&t[0].length===0||i<0)return n.JS.Clone(t);var e=t[0]instanceof Array;e||(t=[t]);var r,s,l,o,f,u,h,P,a,m,y,v,I,_,L,O,w,Ri=t.length,Zi=i*i,D=[];for(r=0;r<Ri;r++)if(l=t[r],u=l.length,u!==0){for(o=0;o<1e6;o++){for(f=[],u=l.length,l[u-1].X!==l[0].X||l[u-1].Y!==l[0].Y?(v=1,l.push({X:l[0].X,Y:l[0].Y}),u=l.length):v=0,y=[],s=0;s<u-2;s++)h=l[s],a=l[s+1],P=l[s+2],O=h.X,w=h.Y,I=P.X-O,_=P.Y-w,(I!==0||_!==0)&&(L=((a.X-O)*I+(a.Y-w)*_)/(I*I+_*_),L>1?(O=P.X,w=P.Y):L>0&&(O+=I*L,w+=_*L)),I=a.X-O,_=a.Y-w,m=I*I+_*_,m<=Zi&&(y[s+1]=1,s++);for(f.push({X:l[0].X,Y:l[0].Y}),s=1;s<u-1;s++)y[s]||f.push({X:l[s].X,Y:l[s].Y});if(f.push({X:l[u-1].X,Y:l[u-1].Y}),v&&l.pop(),y.length)l=f;else break}u=f.length,f[u-1].X===f[0].X&&f[u-1].Y===f[0].Y&&f.pop(),f.length>2&&D.push(f)}return e||(D=D[0]),typeof D>"u"&&(D=[]),D},n.JS.PerimeterOfPath=function(t,i,e){if(typeof t>"u")return 0;var r=Math.sqrt,s=0,l,o,f=0,u=0,h=0,P=0,a=t.length;if(a<2)return 0;for(i&&(t[a]=t[0],a++);--a;)l=t[a],f=l.X,u=l.Y,o=t[a-1],h=o.X,P=o.Y,s+=r((f-h)*(f-h)+(u-P)*(u-P));return i&&t.pop(),s/e},n.JS.PerimeterOfPaths=function(t,i,e){e||(e=1);for(var r=0,s=0;s<t.length;s++)r+=n.JS.PerimeterOfPath(t[s],i,e);return r},n.JS.ScaleDownPath=function(t,i){var e,r;for(i||(i=1),e=t.length;e--;)r=t[e],r.X=r.X/i,r.Y=r.Y/i},n.JS.ScaleDownPaths=function(t,i){var e,r,s;for(i||(i=1),e=t.length;e--;)for(r=t[e].length;r--;)s=t[e][r],s.X=s.X/i,s.Y=s.Y/i},n.JS.ScaleUpPath=function(t,i){var e,r,s=Math.round;for(i||(i=1),e=t.length;e--;)r=t[e],r.X=s(r.X*i),r.Y=s(r.Y*i)},n.JS.ScaleUpPaths=function(t,i){var e,r,s,l=Math.round;for(i||(i=1),e=t.length;e--;)for(r=t[e].length;r--;)s=t[e][r],s.X=l(s.X*i),s.Y=l(s.Y*i)},n.ExPolygons=function(){return[]},n.ExPolygon=function(){this.outer=null,this.holes=null},n.JS.AddOuterPolyNodeToExPolygons=function(t,i){var e=new n.ExPolygon;e.outer=t.Contour();var r=t.Childs(),s=r.length;e.holes=new Array(s);var l,o,f,u,h,P;for(f=0;f<s;f++)for(l=r[f],e.holes[f]=l.Contour(),u=0,h=l.Childs(),P=h.length;u<P;u++)o=h[u],n.JS.AddOuterPolyNodeToExPolygons(o,i);i.push(e)},n.JS.ExPolygonsToPaths=function(t){var i,e,r,s,l=new n.Paths;for(i=0,r=t.length;i<r;i++)for(l.push(t[i].outer),e=0,s=t[i].holes.length;e<s;e++)l.push(t[i].holes[e]);return l},n.JS.PolyTreeToExPolygons=function(t){var i=new n.ExPolygons,e,r,s,l;for(r=0,s=t.Childs(),l=s.length;r<l;r++)e=s[r],n.JS.AddOuterPolyNodeToExPolygons(e,i);return i}})();
61
+
62
+ </script>
63
+ <style>
64
+
65
+
66
+
67
+ * {
68
+ margin: 0;
69
+ padding: 0;
70
+ box-sizing: border-box;
71
+ }
72
+ html,
73
+ body {
74
+ margin: 0;
75
+ width: 1920px;
76
+ height: 1080px;
77
+ overflow: hidden;
78
+ background: #000;
79
+ }
80
+ body {
81
+ font-family: "Geist", "Inter", system-ui, sans-serif;
82
+ }
83
+ #root {
84
+ position: relative;
85
+ width: 1920px;
86
+ height: 1080px;
87
+ overflow: hidden;
88
+ }
89
+ .clip {
90
+ position: absolute;
91
+ inset: 0;
92
+ }
93
+ /* dark underlay (never on the root itself) */
94
+ #wpt-under {
95
+ position: absolute;
96
+ inset: 0;
97
+ background: #0b0b0b;
98
+ }
99
+ /* ---- flat 2D title card ---- */
100
+ #wpt-card {
101
+ position: absolute;
102
+ inset: 0;
103
+ background: #e8e8e8;
104
+ color: #0a0a0a;
105
+ display: flex;
106
+ flex-direction: column;
107
+ align-items: center;
108
+ justify-content: center;
109
+ }
110
+ #wpt-kicker {
111
+ font-weight: 600;
112
+ font-size: 22px;
113
+ letter-spacing: 0;
114
+ text-indent: 0;
115
+ color: #1f1f1f;
116
+ margin-bottom: 34px;
117
+ display: flex;
118
+ align-items: center;
119
+ gap: 18px;
120
+ }
121
+ #wpt-headline {
122
+ font-weight: 700;
123
+ font-size: 176px;
124
+ line-height: 1;
125
+ letter-spacing: 0.03em;
126
+ white-space: nowrap;
127
+ color: #0a0a0a;
128
+ }
129
+ #wpt-headline span {
130
+ display: inline-block;
131
+ }
132
+ #wpt-subtitle {
133
+ margin-top: 40px;
134
+ font-weight: 400;
135
+ font-size: 34px;
136
+ letter-spacing: 0.02em;
137
+ color: #3d3d3d;
138
+ }
139
+ /* ---- canvas layers (intentionally cover the 2D card once the portal opens) ---- */
140
+ #wpt-three,
141
+ #wpt-warp {
142
+ position: absolute;
143
+ inset: 0;
144
+ width: 1920px;
145
+ height: 1080px;
146
+ display: block;
147
+ }
148
+ #wpt-white {
149
+ position: absolute;
150
+ inset: 0;
151
+ background: #ffffff;
152
+ opacity: 0;
153
+ display: flex;
154
+ align-items: center;
155
+ justify-content: center;
156
+ }
157
+ </style>
158
+ <link rel="stylesheet" href="../css/latin-inter.css" />
159
+ <style id="popost-fonts">
160
+ @font-face {
161
+ font-family: "Geist";
162
+ size-adjust: 97.4%;
163
+ font-style: normal;
164
+ font-display: swap;
165
+ font-weight: 100 900;
166
+ src: url("../fonts/latin-inter/inter-latin-ext-wght-normal.woff2") format('woff2-variations');
167
+ unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
168
+ }
169
+ @font-face {
170
+ font-family: "Geist";
171
+ size-adjust: 97.4%;
172
+ font-style: normal;
173
+ font-display: swap;
174
+ font-weight: 100 900;
175
+ src: url("../fonts/latin-inter/inter-latin-wght-normal.woff2") format('woff2-variations');
176
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
177
+ }
178
+ @font-face {
179
+ font-family: "Geist";
180
+ size-adjust: 97.4%;
181
+ font-style: italic;
182
+ font-display: swap;
183
+ font-weight: 100 900;
184
+ src: url("../fonts/latin-inter/inter-latin-ext-wght-italic.woff2") format('woff2-variations');
185
+ unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
186
+ }
187
+ @font-face {
188
+ font-family: "Geist";
189
+ size-adjust: 97.4%;
190
+ font-style: italic;
191
+ font-display: swap;
192
+ font-weight: 100 900;
193
+ src: url("../fonts/latin-inter/inter-latin-wght-italic.woff2") format('woff2-variations');
194
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
195
+ }
196
+ </style>
197
+ <script src="../lib/three.min.js"></script>
198
+ <script>
199
+ /* popost: three.js r147 set up as later releases are by default (sRGB output, colour management, physical lights). */
200
+ (function () {
201
+ if (!window.THREE || THREE.__popostCompat) return;
202
+ THREE.__popostCompat = true;
203
+ THREE.SRGBColorSpace = THREE.SRGBColorSpace || 'srgb';
204
+ THREE.LinearSRGBColorSpace = THREE.LinearSRGBColorSpace || 'srgb-linear';
205
+ THREE.NoColorSpace = THREE.NoColorSpace || '';
206
+ if (THREE.ColorManagement) THREE.ColorManagement.legacyMode = false;
207
+ var R = THREE.WebGLRenderer;
208
+ THREE.WebGLRenderer = function (p) { R.call(this, Object.assign({ preserveDrawingBuffer: true }, p || {})); this.outputEncoding = THREE.sRGBEncoding; this.physicallyCorrectLights = true; };
209
+ THREE.WebGLRenderer.prototype = R.prototype;
210
+ Object.defineProperty(R.prototype, 'outputColorSpace', { configurable: true, get: function () { return this.outputEncoding === THREE.sRGBEncoding ? 'srgb' : 'srgb-linear'; }, set: function (v) { this.outputEncoding = v === 'srgb' ? THREE.sRGBEncoding : THREE.LinearEncoding; } });
211
+ Object.defineProperty(THREE.Texture.prototype, 'colorSpace', { configurable: true, get: function () { return this.encoding === THREE.sRGBEncoding ? 'srgb' : ''; }, set: function (v) { this.encoding = v === 'srgb' ? THREE.sRGBEncoding : THREE.LinearEncoding; } });
212
+ R.prototype.compileAsync = R.prototype.compileAsync || function (scene, camera) { this.compile(scene, camera); return Promise.resolve(); };
213
+ /* the texture coordinates of later releases' shader chunks (vMapUv, ...), for code that onBeforeCompile adds */
214
+ THREE.ShaderChunk.common = ['Map', 'AlphaMap', 'NormalMap', 'BumpMap', 'RoughnessMap', 'MetalnessMap', 'EmissiveMap', 'SpecularMap', 'ClearcoatMap', 'ClearcoatNormalMap', 'ClearcoatRoughnessMap', 'SheenColorMap', 'SheenRoughnessMap', 'TransmissionMap', 'ThicknessMap', 'DisplacementMap'].map(function (k) { return '#define v' + k + 'Uv vUv\n'; }).join('') + '#define vAoMapUv vUv2\n#define vLightMapUv vUv2\n' + THREE.ShaderChunk.common;
215
+ /* scene.environmentIntensity (later releases) as every material's envMapIntensity */
216
+ var render = R.prototype.render;
217
+ R.prototype.render = function (scene, camera) {
218
+ if (scene && typeof scene.environmentIntensity === 'number') scene.traverse(function (o) { [].concat(o.material || []).forEach(function (m) { if ('envMapIntensity' in m) m.envMapIntensity = scene.environmentIntensity; }); });
219
+ return render.apply(this, arguments);
220
+ };
221
+ /* point and spot lights fall off with the square of the distance (decay 2), as later releases default to */
222
+ var P = THREE.PointLight, S = THREE.SpotLight;
223
+ THREE.PointLight = function (color, intensity, distance, decay) { return new P(color, intensity, distance, decay === undefined ? 2 : decay); };
224
+ THREE.PointLight.prototype = P.prototype;
225
+ THREE.SpotLight = function (color, intensity, distance, angle, penumbra, decay) { return new S(color, intensity, distance, angle, penumbra, decay === undefined ? 2 : decay); };
226
+ THREE.SpotLight.prototype = S.prototype;
227
+ })();
228
+ </script>
229
+ <style id="popost-fit">
230
+ html, body { margin: 0 !important; width: 1280px; height: 720px; overflow: hidden !important; background: #000000; }
231
+ #popost-stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden; }
232
+ </style>
233
+ <script type="application/json" id="popost-params">
234
+ {
235
+ "about": "A wireframe portal bursts open, the title comes through, then its letters swap into a second phrase.",
236
+ "class": "text",
237
+ "tags": [
238
+ "3d-motion",
239
+ "title-card",
240
+ "wireframe",
241
+ "portal",
242
+ "burst",
243
+ "typography",
244
+ "post-processing",
245
+ "phrase-swap"
246
+ ],
247
+ "placeholders": "Geist drawn in Inter",
248
+ "seconds": 8,
249
+ "params": [
250
+ {
251
+ "name": "fit",
252
+ "type": "choice",
253
+ "default": "contain",
254
+ "options": [
255
+ "contain",
256
+ "cover"
257
+ ],
258
+ "what": "how the 1920x1080 composition is fitted into the canvas: whole with bars, or filling it and cropped"
259
+ }
260
+ ],
261
+ "values": {}
262
+ }
263
+ </script>
264
+ <script>
265
+ /* popost: the scene's parameters stand in for HyperFrames variables; random numbers are seeded; the composition is
266
+ scaled into the canvas; clips are shown and hidden from the scene's time. */
267
+ (function () {
268
+ var block = document.getElementById('popost-params');
269
+ var values = block ? (JSON.parse(block.textContent).values || {}) : {};
270
+ var vars = {};
271
+ Object.keys(values).forEach(function (k) { if (k !== 'fit') vars[k] = values[k] === 'true' ? true : values[k] === 'false' ? false : values[k]; });
272
+ window.__hyperframes = { getVariables: function () { return vars; } };
273
+ var seed = 20240229;
274
+ window.__popostRandom = function () { seed = (seed + 0x6d2b79f5) >>> 0; var t = seed; t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((t ^ (t >>> 14)) >>> 0) / 4294967296; };
275
+ // HyperFrames variables as CSS custom properties (runtime/getVariables.ts, compositionLoader.ts). A mounted
276
+ // composition's host lists its variables (data-popost-variables, written by the port): before the composition's
277
+ // scripts run it gets those no rule gives it yet (an inherited value counts), and after them the rest; a value given
278
+ // by a parameter always wins.
279
+ var cssName = function (id) { return '--' + (String(id).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'node'); };
280
+ var givenId = function (n) { return Object.keys(values).filter(function (id) { return id !== 'fit' && cssName(id) === n; })[0]; };
281
+ var hostVars = function (h, early) {
282
+ (h.getAttribute('data-popost-variables') || '').split(';').forEach(function (d) {
283
+ var i = d.indexOf(':'), n = d.slice(0, i).trim(), k = givenId(n);
284
+ if (i < 0 || !n) return;
285
+ if (k !== undefined) h.style.setProperty(n, String(vars[k]));
286
+ else if (!(h.style.getPropertyValue(n) || (early ? getComputedStyle(h).getPropertyValue(n) : '')).trim()) h.style.setProperty(n, d.slice(i + 1).trim());
287
+ });
288
+ };
289
+ // Root-level clips laid out as HyperFrames lays them out (runtime/init.ts, applyCompositionSizing and applyClipLayout):
290
+ // its root composition (one marked data-root="true", else the first element with a data-composition-id, which is the
291
+ // page's <html> when that has one) gets its declared size, a position and overflow hidden; each child of it with a
292
+ // data-start is placed absolute unless it is absolute or fixed already, and given its declared size, or 100% where it
293
+ // measures 0. A composition box deeper in the page keeps the position its page gives it.
294
+ var layout = function () {
295
+ var hroot = document.querySelector('[data-composition-id][data-root="true"]') || document.querySelector('[data-composition-id]');
296
+ if (!hroot) return;
297
+ var px = function (v) { var n = parseFloat(v); return isFinite(n) && n > 0 ? n + 'px' : null; };
298
+ var rw = px(hroot.getAttribute('data-width')), rh = px(hroot.getAttribute('data-height'));
299
+ if (rw) { hroot.style.width = rw; hroot.style.setProperty('--comp-width', rw); }
300
+ if (rh) { hroot.style.height = rh; hroot.style.setProperty('--comp-height', rh); }
301
+ if (!hroot.style.position) hroot.style.position = 'relative';
302
+ hroot.style.overflow = 'hidden';
303
+ Array.prototype.forEach.call(hroot.children, function (el) {
304
+ if (/^(SCRIPT|STYLE|LINK|META)$/.test(el.tagName) || !el.hasAttribute('data-start')) return;
305
+ var none = el.style.getPropertyValue('display') === 'none', priority = el.style.getPropertyPriority('display');
306
+ if (none) el.style.removeProperty('display');
307
+ var cs = getComputedStyle(el);
308
+ if (cs.position !== 'absolute' && cs.position !== 'fixed') el.style.position = 'absolute';
309
+ if (el.tagName !== 'AUDIO') {
310
+ var byFile = /^(IMG|VIDEO)$/.test(el.tagName), fw = px(el.getAttribute('data-width')), fh = px(el.getAttribute('data-height'));
311
+ if (fw) { if (!el.style.width && (cs.width === '0px' || cs.width === 'auto')) el.style.width = fw; } else if (!byFile && !el.style.width && cs.width === '0px') el.style.width = '100%';
312
+ if (fh) { if (!el.style.height && (cs.height === '0px' || cs.height === 'auto')) el.style.height = fh; } else if (!byFile && !el.style.height && cs.height === '0px') el.style.height = '100%';
313
+ }
314
+ if (none) el.style.setProperty('display', 'none', priority);
315
+ });
316
+ };
317
+ // HyperFrames loads a mounted composition after it has laid out the page, so its scripts see the host placed: each
318
+ // script of a mounted composition calls this first (the port puts the call there).
319
+ window.__popostMount = function (script) {
320
+ var h = script && script.closest ? script.closest('[data-popost-host]') : null;
321
+ if (!h || h.__popostMounted) return;
322
+ h.__popostMounted = true;
323
+ layout();
324
+ hostVars(h, true);
325
+ };
326
+ window.__popostFit = function () {
327
+ // The canvas, from the size this file declares: a scene of a later shot loads in a layer that is not displayed, where the page measures 0.
328
+ var size = /width: (\d+)px; height: (\d+)px;/.exec(document.getElementById('popost-fit').textContent);
329
+ var W = 1920, H = 1080, s = document.getElementById('popost-stage'), cw = Number(size[1]), ch = Number(size[2]);
330
+ var k = (values.fit === 'cover' ? Math.max : Math.min)(cw / W, ch / H);
331
+ s.style.transform = 'translate(' + (cw - W * k) / 2 + 'px,' + (ch - H * k) / 2 + 'px) scale(' + k + ')';
332
+ // The page's own declared variables on its root element (runtime/getVariables.ts, injectCompositionCssVariables):
333
+ // each default where no rule defines its property, a value given by a parameter always.
334
+ var de = document.documentElement, declared = [];
335
+ try { declared = JSON.parse(de.getAttribute('data-composition-variables') || '[]'); } catch (e) {}
336
+ declared.forEach(function (d) {
337
+ var n = cssName(d.id), given = Object.prototype.hasOwnProperty.call(values, d.id), v = given ? vars[d.id] : d.default;
338
+ if (!((typeof v === 'string' && v !== '') || typeof v === 'number')) return;
339
+ if (!given && (de.style.getPropertyValue(n) || getComputedStyle(de).getPropertyValue(n)).trim()) return;
340
+ de.style.setProperty(n, String(v));
341
+ });
342
+ Array.prototype.forEach.call(document.querySelectorAll('[data-popost-host]'), function (h) { hostVars(h, false); });
343
+ layout();
344
+ // Timed elements as HyperFrames has them (runtime/clipTree.ts, clipWindow.ts): every element with a data-start but the
345
+ // root composition, from its start plus the starts of the compositions it sits in, for its data-duration (a
346
+ // composition without one: its timeline's length); one that runs to the end of the root keeps its last frame.
347
+ var root = s.querySelector('[data-composition-id]');
348
+ var clips = Array.prototype.slice.call(s.querySelectorAll('[data-start]')).filter(function (c) { return (root ? c !== root : c.parentNode !== s) && !/^(SCRIPT|STYLE|LINK|META|TEMPLATE|NOSCRIPT)$/.test(c.tagName) && isFinite(parseFloat(c.getAttribute('data-start'))); });
349
+ var windows = clips.map(function (c) {
350
+ var a = parseFloat(c.getAttribute('data-start')), d = parseFloat(c.getAttribute('data-duration')), id = c.getAttribute('data-composition-id');
351
+ for (var p = c.parentElement; p && p !== s; p = p.parentElement) if (p !== root && p.hasAttribute('data-composition-id') && isFinite(parseFloat(p.getAttribute('data-start')))) a += parseFloat(p.getAttribute('data-start'));
352
+ var tl = !(d > 0) && id && window.__timelines && window.__timelines[id];
353
+ return [a, d > 0 ? d : tl && tl.duration ? tl.duration() : Infinity];
354
+ });
355
+ var rootLength = parseFloat(root && root.getAttribute('data-duration'));
356
+ // A mounted composition that starts later in its host runs on its own time.
357
+ [].forEach(function (m) {
358
+ var tl = window.__timelines && window.__timelines[m.id];
359
+ if (tl) window.__timelines[m.id] = { pause: function () { tl.pause(); }, seek: function (t) { tl.seek(Math.max(0, t - m.start)); }, duration: function () { return tl.duration() + m.start; } };
360
+ });
361
+ var scene = (window.__popostScene = window.__popostScene || {}), before = scene.render;
362
+ scene.render = function (seconds, fps) {
363
+ if (before) before(seconds, fps);
364
+ // A page that draws on the HyperFrames seek event gets it for every frame; what it waits for resolves before the frame is taken.
365
+ window.dispatchEvent(new CustomEvent('hf-seek', { detail: { time: seconds, waitUntil: function () {} } }));
366
+ for (var i = 0; i < clips.length; i++) {
367
+ var a = windows[i][0], end = a + windows[i][1];
368
+ clips[i].style.visibility = seconds >= a - 1e-6 && (seconds < end - 1e-6 || end >= rootLength - 1e-6) ? 'visible' : 'hidden';
369
+ }
370
+ };
371
+ };
372
+ })();
373
+ </script>
374
+ <script type="application/json" id="popost-cues">[{"at":0,"cue":"tick","gain":0.3},{"at":0.22,"cue":"tick","gain":0.3}]</script>
375
+ </head>
376
+ <body>
377
+ <div id="popost-stage">
378
+ <div
379
+ data-hf-id="hf-ek69"
380
+ id="root"
381
+ data-composition-id="wireframe-portal-title"
382
+ data-start="0"
383
+ data-duration="8"
384
+ data-width="1920"
385
+ data-height="1080"
386
+ style="width: 1920px; height: 1080px;">
387
+ <section
388
+ data-hf-id="hf-50tz"
389
+ id="wpt-scene"
390
+ class="clip"
391
+ data-start="0"
392
+ data-duration="8"
393
+ data-track-index="1"
394
+ >
395
+ <div data-hf-id="hf-6av1" id="wpt-under"></div>
396
+
397
+ <div data-hf-id="hf-r32l" id="wpt-card" data-layout-allow-occlusion="">
398
+ <div data-hf-id="hf-0bgu" id="wpt-kicker">
399
+ <span data-hf-id="hf-m027" id="wpt-kicker-text">HYPERFRAMES PRESENTS</span>
400
+ </div>
401
+ <h1 data-hf-id="hf-pwyf" id="wpt-headline"></h1>
402
+ <div data-hf-id="hf-jivp" id="wpt-subtitle"></div>
403
+ </div>
404
+
405
+ <div data-hf-id="hf-dugk" id="wpt-white" data-layout-allow-occlusion=""></div>
406
+ </section>
407
+ </div>
408
+
409
+ <script>
410
+ // ---- variables (safe fallback when API absent) ----
411
+ (function () {
412
+ var vars = {};
413
+ try {
414
+ if (window.__hyperframes && window.__hyperframes.getVariables) {
415
+ vars = window.__hyperframes.getVariables() || {};
416
+ }
417
+ } catch (e) {}
418
+ var title =
419
+ String(vars.title || "BREAKTHROUGH")
420
+ .trim()
421
+ .toUpperCase() || "BREAKTHROUGH";
422
+ var subtitle = String(vars.subtitle || "HYPERFRAMES PORTAL TITLE");
423
+ // Preserve every word. The 3D layout wraps whole words and scales to fit.
424
+ window.__wptPhrase =
425
+ String(vars.replacementPhrase || "BEYOND LIMITS")
426
+ .trim()
427
+ .toUpperCase()
428
+ .replace(/\s+/g, " ") || "BEYOND LIMITS";
429
+ function numberVar(id, fallback, min, max) {
430
+ var value = vars[id] === undefined ? fallback : Number(vars[id]);
431
+ return isFinite(value) ? Math.max(min, Math.min(max, value)) : fallback;
432
+ }
433
+ window.__wptTransition = {
434
+ start: 2.85,
435
+ duration: numberVar("phraseDuration", 1.85, 0.65, 2.9),
436
+ easing: numberVar("phraseEasing", 4, 1, 8),
437
+ glitch: numberVar("settleGlitch", 1, 0, 4),
438
+ fog: vars.depthFog !== false,
439
+ };
440
+ var accent = String(vars.accent || "#F5C518");
441
+ document.documentElement.style.setProperty("--wpt-accent", accent);
442
+ window.__wptAccent = accent;
443
+ var bc = Number(vars.burstChaos);
444
+ window.__wptBurstChaos = isFinite(bc) ? Math.max(0, Math.min(2, bc)) : 1;
445
+
446
+ function fillHeadline(id, text, prefix) {
447
+ var hl = document.getElementById(id);
448
+ for (var i = 0; i < text.length; i++) {
449
+ var ch = text[i];
450
+ var span = document.createElement("span");
451
+ if (ch === " ") {
452
+ span.innerHTML = "&nbsp;";
453
+ } else {
454
+ span.textContent = ch;
455
+ span.setAttribute("data-3d-char", prefix + i);
456
+ }
457
+ hl.appendChild(span);
458
+ }
459
+ }
460
+ fillHeadline("wpt-headline", title, "t-");
461
+ document.getElementById("wpt-subtitle").textContent = subtitle;
462
+ // Runtime canvases keep the Studio variables parser intact.
463
+ ["wpt-three", "wpt-warp"].forEach(function (id) {
464
+ var canvas = document.createElement("canvas");
465
+ canvas.id = id;
466
+ canvas.width = 1920;
467
+ canvas.height = 1080;
468
+ document
469
+ .getElementById("wpt-scene")
470
+ .insertBefore(canvas, document.getElementById("wpt-white"));
471
+ });
472
+ })();
473
+ </script>
474
+
475
+ <script>
476
+ // ---- state proxy + single paused timeline ----
477
+ window.__timelines = window.__timelines || {};
478
+ const S = {
479
+ portal: 0, // 0 = flat 2D page, 1 = 3D wireframe world
480
+ push: 0, // exit camera push through the letterforms
481
+ glitch: 0, // block-glitch tick amount
482
+ warp: 0, // warp-dot visibility
483
+ travel: 0, // warp-dot accumulated z travel (world units)
484
+ exitFx: 0, // zoom-blur / brightness lift on the way out
485
+ };
486
+ window.__wptState = S;
487
+
488
+ const tl = gsap.timeline({ paused: true });
489
+
490
+ // IN — the flat 2D card settles first (the 3D module measures letter
491
+ // positions via offset* geometry, so these transforms don't skew it)
492
+ tl.from("#wpt-kicker", { y: -24, opacity: 0, duration: 0.45, ease: "power3.out" }, 0);
493
+ tl.from(
494
+ "#wpt-headline span",
495
+ { y: 44, opacity: 0, duration: 0.5, stagger: 0.025, ease: "power3.out" },
496
+ 0.03,
497
+ );
498
+ tl.from("#wpt-subtitle", { y: 18, opacity: 0, duration: 0.45, ease: "power3.out" }, 0.22);
499
+
500
+ // IN — portal irises open (p = 0.5 around t ~= 1.47s)
501
+ tl.to(S, { portal: 1, duration: 2.05, ease: "power2.inOut" }, 0.45);
502
+ // The 3D layer owns the copy by now. Keep the original card background
503
+ // under the portal feather, while retiring its covered DOM text.
504
+ tl.set(["#wpt-headline", "#wpt-kicker", "#wpt-subtitle"], { autoAlpha: 0 }, 2.5);
505
+
506
+ // warp dots: burst through the transition, settle to a slow stream in the hold
507
+ tl.to(S, { warp: 1, duration: 1.0, ease: "sine.in" }, 0.45);
508
+ tl.to(S, { warp: 0.28, duration: 1.2, ease: "sine.out" }, 1.5);
509
+ tl.to(S, { warp: 0.85, duration: 0.8, ease: "power1.in" }, 6.0);
510
+ tl.to(S, { travel: 16, duration: 2.05, ease: "sine.inOut" }, 0.45);
511
+ tl.to(S, { travel: 22, duration: 3.5, ease: "none" }, 2.5);
512
+ tl.to(S, { travel: 38, duration: 2.0, ease: "power2.in" }, 6.0);
513
+
514
+ // faint glitch ticks on two beats
515
+ tl.to(S, { glitch: 0.55, duration: 0.09, ease: "power1.in" }, 3.8);
516
+ tl.to(S, { glitch: 0, duration: 0.24, ease: "power2.out" }, 3.89);
517
+ tl.to(S, { glitch: 0.55, duration: 0.09, ease: "power1.in" }, 5.2);
518
+ tl.to(S, { glitch: 0, duration: 0.24, ease: "power2.out" }, 5.29);
519
+
520
+ // OUT — camera pushes through and past the letterforms, frame lifts to white
521
+ tl.to(S, { push: 1, duration: 1.6, ease: "power2.in" }, 6.0);
522
+ tl.to(S, { exitFx: 1, duration: 1.6, ease: "power2.in" }, 6.4);
523
+ tl.to("#wpt-white", { opacity: 1, duration: 0.95, ease: "sine.inOut" }, 6.9);
524
+ // The white plate is intentionally empty and fully opaque for the last hold.
525
+ tl.addLabel("light-card", 0.8);
526
+ tl.addLabel("portal-alignment", 1.47);
527
+ tl.addLabel(
528
+ "phrase-handoff",
529
+ window.__wptTransition.start + window.__wptTransition.duration * 0.6,
530
+ );
531
+ tl.addLabel("phrase-hold", window.__wptTransition.start + window.__wptTransition.duration);
532
+ tl.addLabel("white-empty", 7.9);
533
+
534
+ tl.eventCallback("onUpdate", function () {
535
+ if (window.__wptRender) window.__wptRender(tl.time());
536
+ });
537
+ /* Studio's player seeks with GSAP events suppressed and dispatches an
538
+ hf-seek CustomEvent instead — re-sync and repaint so the stage follows. */
539
+ window.addEventListener("hf-seek", function (event) {
540
+ var d = event && event.detail;
541
+ if (d && typeof d.time === "number")
542
+ tl.totalTime(Math.min(d.time, tl.totalDuration()), true);
543
+ var fn = tl.eventCallback("onUpdate");
544
+ if (fn) fn();
545
+ });
546
+
547
+ window.__timelines["wireframe-portal-title"] = tl;
548
+ </script>
549
+
550
+ <script>
551
+ ( function () {
552
+
553
+ class FontLoader extends THREE.Loader {
554
+
555
+ constructor( manager ) {
556
+
557
+ super( manager );
558
+
559
+ }
560
+ load( url, onLoad, onProgress, onError ) {
561
+
562
+ const scope = this;
563
+ const loader = new THREE.FileLoader( this.manager );
564
+ loader.setPath( this.path );
565
+ loader.setRequestHeader( this.requestHeader );
566
+ loader.setWithCredentials( this.withCredentials );
567
+ loader.load( url, function ( text ) {
568
+
569
+ const font = scope.parse( JSON.parse( text ) );
570
+ if ( onLoad ) onLoad( font );
571
+
572
+ }, onProgress, onError );
573
+
574
+ }
575
+ parse( json ) {
576
+
577
+ return new Font( json );
578
+
579
+ }
580
+
581
+ }
582
+
583
+ //
584
+
585
+ class Font {
586
+
587
+ constructor( data ) {
588
+
589
+ this.isFont = true;
590
+ this.type = 'Font';
591
+ this.data = data;
592
+
593
+ }
594
+ generateShapes( text, size = 100 ) {
595
+
596
+ const shapes = [];
597
+ const paths = createPaths( text, size, this.data );
598
+ for ( let p = 0, pl = paths.length; p < pl; p ++ ) {
599
+
600
+ shapes.push( ...paths[ p ].toShapes() );
601
+
602
+ }
603
+
604
+ return shapes;
605
+
606
+ }
607
+
608
+ }
609
+ function createPaths( text, size, data ) {
610
+
611
+ const chars = Array.from( text );
612
+ const scale = size / data.resolution;
613
+ const line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale;
614
+ const paths = [];
615
+ let offsetX = 0,
616
+ offsetY = 0;
617
+ for ( let i = 0; i < chars.length; i ++ ) {
618
+
619
+ const char = chars[ i ];
620
+ if ( char === '\n' ) {
621
+
622
+ offsetX = 0;
623
+ offsetY -= line_height;
624
+
625
+ } else {
626
+
627
+ const ret = createPath( char, scale, offsetX, offsetY, data );
628
+ offsetX += ret.offsetX;
629
+ paths.push( ret.path );
630
+
631
+ }
632
+
633
+ }
634
+
635
+ return paths;
636
+
637
+ }
638
+
639
+ function createPath( char, scale, offsetX, offsetY, data ) {
640
+
641
+ const glyph = data.glyphs[ char ] || data.glyphs[ '?' ];
642
+ if ( ! glyph ) {
643
+
644
+ console.error( 'THREE.Font: character "' + char + '" does not exists in font family ' + data.familyName + '.' );
645
+ return;
646
+
647
+ }
648
+
649
+ const path = new THREE.ShapePath();
650
+ let x, y, cpx, cpy, cpx1, cpy1, cpx2, cpy2;
651
+ if ( glyph.o ) {
652
+
653
+ const outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) );
654
+ for ( let i = 0, l = outline.length; i < l; ) {
655
+
656
+ const action = outline[ i ++ ];
657
+ switch ( action ) {
658
+
659
+ case 'm':
660
+ // moveTo
661
+
662
+ x = outline[ i ++ ] * scale + offsetX;
663
+ y = outline[ i ++ ] * scale + offsetY;
664
+ path.moveTo( x, y );
665
+ break;
666
+ case 'l':
667
+ // lineTo
668
+
669
+ x = outline[ i ++ ] * scale + offsetX;
670
+ y = outline[ i ++ ] * scale + offsetY;
671
+ path.lineTo( x, y );
672
+ break;
673
+ case 'q':
674
+ // quadraticCurveTo
675
+
676
+ cpx = outline[ i ++ ] * scale + offsetX;
677
+ cpy = outline[ i ++ ] * scale + offsetY;
678
+ cpx1 = outline[ i ++ ] * scale + offsetX;
679
+ cpy1 = outline[ i ++ ] * scale + offsetY;
680
+ path.quadraticCurveTo( cpx1, cpy1, cpx, cpy );
681
+ break;
682
+ case 'b':
683
+ // bezierCurveTo
684
+
685
+ cpx = outline[ i ++ ] * scale + offsetX;
686
+ cpy = outline[ i ++ ] * scale + offsetY;
687
+ cpx1 = outline[ i ++ ] * scale + offsetX;
688
+ cpy1 = outline[ i ++ ] * scale + offsetY;
689
+ cpx2 = outline[ i ++ ] * scale + offsetX;
690
+ cpy2 = outline[ i ++ ] * scale + offsetY;
691
+ path.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy );
692
+ break;
693
+
694
+ }
695
+
696
+ }
697
+
698
+ }
699
+
700
+ return {
701
+ offsetX: glyph.ha * scale,
702
+ path: path
703
+ };
704
+
705
+ }
706
+
707
+ THREE.Font = Font;
708
+ THREE.FontLoader = FontLoader;
709
+
710
+ } )();
711
+
712
+ </script><script>
713
+ ( function () {
714
+
715
+ /**
716
+ * Full-screen textured quad shader
717
+ */
718
+
719
+ const CopyShader = {
720
+ uniforms: {
721
+ 'tDiffuse': {
722
+ value: null
723
+ },
724
+ 'opacity': {
725
+ value: 1.0
726
+ }
727
+ },
728
+ vertexShader: /* glsl */`
729
+
730
+ varying vec2 vUv;
731
+
732
+ void main() {
733
+
734
+ vUv = uv;
735
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
736
+
737
+ }`,
738
+ fragmentShader: /* glsl */`
739
+
740
+ uniform float opacity;
741
+
742
+ uniform sampler2D tDiffuse;
743
+
744
+ varying vec2 vUv;
745
+
746
+ void main() {
747
+
748
+ gl_FragColor = texture2D( tDiffuse, vUv );
749
+ gl_FragColor.a *= opacity;
750
+
751
+
752
+ }`
753
+ };
754
+
755
+ THREE.CopyShader = CopyShader;
756
+
757
+ } )();
758
+
759
+ </script><script>
760
+ ( function () {
761
+
762
+ class Pass {
763
+
764
+ constructor() {
765
+
766
+ // if set to true, the pass is processed by the composer
767
+ this.enabled = true;
768
+
769
+ // if set to true, the pass indicates to swap read and write buffer after rendering
770
+ this.needsSwap = true;
771
+
772
+ // if set to true, the pass clears its buffer before rendering
773
+ this.clear = false;
774
+
775
+ // if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.
776
+ this.renderToScreen = false;
777
+
778
+ }
779
+ setSize() {}
780
+ render() {
781
+
782
+ console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );
783
+
784
+ }
785
+ dispose() {}
786
+
787
+ }
788
+
789
+ // Helper for passes that need to fill the viewport with a single quad.
790
+
791
+ const _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
792
+
793
+ // https://github.com/mrdoob/three.js/pull/21358
794
+
795
+ const _geometry = new THREE.BufferGeometry();
796
+ _geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
797
+ _geometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
798
+ class FullScreenQuad {
799
+
800
+ constructor( material ) {
801
+
802
+ this._mesh = new THREE.Mesh( _geometry, material );
803
+
804
+ }
805
+ dispose() {
806
+
807
+ this._mesh.geometry.dispose();
808
+
809
+ }
810
+ render( renderer ) {
811
+
812
+ renderer.render( this._mesh, _camera );
813
+
814
+ }
815
+ get material() {
816
+
817
+ return this._mesh.material;
818
+
819
+ }
820
+ set material( value ) {
821
+
822
+ this._mesh.material = value;
823
+
824
+ }
825
+
826
+ }
827
+
828
+ THREE.FullScreenQuad = FullScreenQuad;
829
+ THREE.Pass = Pass;
830
+
831
+ } )();
832
+
833
+ </script><script>
834
+ ( function () {
835
+
836
+ class ShaderPass extends THREE.Pass {
837
+
838
+ constructor( shader, textureID ) {
839
+
840
+ super();
841
+ this.textureID = textureID !== undefined ? textureID : 'tDiffuse';
842
+ if ( shader instanceof THREE.ShaderMaterial ) {
843
+
844
+ this.uniforms = shader.uniforms;
845
+ this.material = shader;
846
+
847
+ } else if ( shader ) {
848
+
849
+ this.uniforms = THREE.UniformsUtils.clone( shader.uniforms );
850
+ this.material = new THREE.ShaderMaterial( {
851
+ defines: Object.assign( {}, shader.defines ),
852
+ uniforms: this.uniforms,
853
+ vertexShader: shader.vertexShader,
854
+ fragmentShader: shader.fragmentShader
855
+ } );
856
+
857
+ }
858
+
859
+ this.fsQuad = new THREE.FullScreenQuad( this.material );
860
+
861
+ }
862
+ render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
863
+
864
+ if ( this.uniforms[ this.textureID ] ) {
865
+
866
+ this.uniforms[ this.textureID ].value = readBuffer.texture;
867
+
868
+ }
869
+
870
+ this.fsQuad.material = this.material;
871
+ if ( this.renderToScreen ) {
872
+
873
+ renderer.setRenderTarget( null );
874
+ this.fsQuad.render( renderer );
875
+
876
+ } else {
877
+
878
+ renderer.setRenderTarget( writeBuffer );
879
+ // TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
880
+ if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
881
+ this.fsQuad.render( renderer );
882
+
883
+ }
884
+
885
+ }
886
+ dispose() {
887
+
888
+ this.material.dispose();
889
+ this.fsQuad.dispose();
890
+
891
+ }
892
+
893
+ }
894
+
895
+ THREE.ShaderPass = ShaderPass;
896
+
897
+ } )();
898
+
899
+ </script><script>
900
+ ( function () {
901
+
902
+ class MaskPass extends THREE.Pass {
903
+
904
+ constructor( scene, camera ) {
905
+
906
+ super();
907
+ this.scene = scene;
908
+ this.camera = camera;
909
+ this.clear = true;
910
+ this.needsSwap = false;
911
+ this.inverse = false;
912
+
913
+ }
914
+ render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
915
+
916
+ const context = renderer.getContext();
917
+ const state = renderer.state;
918
+
919
+ // don't update color or depth
920
+
921
+ state.buffers.color.setMask( false );
922
+ state.buffers.depth.setMask( false );
923
+
924
+ // lock buffers
925
+
926
+ state.buffers.color.setLocked( true );
927
+ state.buffers.depth.setLocked( true );
928
+
929
+ // set up stencil
930
+
931
+ let writeValue, clearValue;
932
+ if ( this.inverse ) {
933
+
934
+ writeValue = 0;
935
+ clearValue = 1;
936
+
937
+ } else {
938
+
939
+ writeValue = 1;
940
+ clearValue = 0;
941
+
942
+ }
943
+
944
+ state.buffers.stencil.setTest( true );
945
+ state.buffers.stencil.setOp( context.REPLACE, context.REPLACE, context.REPLACE );
946
+ state.buffers.stencil.setFunc( context.ALWAYS, writeValue, 0xffffffff );
947
+ state.buffers.stencil.setClear( clearValue );
948
+ state.buffers.stencil.setLocked( true );
949
+
950
+ // draw into the stencil buffer
951
+
952
+ renderer.setRenderTarget( readBuffer );
953
+ if ( this.clear ) renderer.clear();
954
+ renderer.render( this.scene, this.camera );
955
+ renderer.setRenderTarget( writeBuffer );
956
+ if ( this.clear ) renderer.clear();
957
+ renderer.render( this.scene, this.camera );
958
+
959
+ // unlock color and depth buffer for subsequent rendering
960
+
961
+ state.buffers.color.setLocked( false );
962
+ state.buffers.depth.setLocked( false );
963
+
964
+ // only render where stencil is set to 1
965
+
966
+ state.buffers.stencil.setLocked( false );
967
+ state.buffers.stencil.setFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1
968
+ state.buffers.stencil.setOp( context.KEEP, context.KEEP, context.KEEP );
969
+ state.buffers.stencil.setLocked( true );
970
+
971
+ }
972
+
973
+ }
974
+ class ClearMaskPass extends THREE.Pass {
975
+
976
+ constructor() {
977
+
978
+ super();
979
+ this.needsSwap = false;
980
+
981
+ }
982
+ render( renderer /*, writeBuffer, readBuffer, deltaTime, maskActive */ ) {
983
+
984
+ renderer.state.buffers.stencil.setLocked( false );
985
+ renderer.state.buffers.stencil.setTest( false );
986
+
987
+ }
988
+
989
+ }
990
+
991
+ THREE.ClearMaskPass = ClearMaskPass;
992
+ THREE.MaskPass = MaskPass;
993
+
994
+ } )();
995
+
996
+ </script><script>
997
+ ( function () {
998
+
999
+ class EffectComposer {
1000
+
1001
+ constructor( renderer, renderTarget ) {
1002
+
1003
+ this.renderer = renderer;
1004
+ if ( renderTarget === undefined ) {
1005
+
1006
+ const size = renderer.getSize( new THREE.Vector2() );
1007
+ this._pixelRatio = renderer.getPixelRatio();
1008
+ this._width = size.width;
1009
+ this._height = size.height;
1010
+ renderTarget = new THREE.WebGLRenderTarget( this._width * this._pixelRatio, this._height * this._pixelRatio );
1011
+ renderTarget.texture.name = 'EffectComposer.rt1';
1012
+
1013
+ } else {
1014
+
1015
+ this._pixelRatio = 1;
1016
+ this._width = renderTarget.width;
1017
+ this._height = renderTarget.height;
1018
+
1019
+ }
1020
+
1021
+ this.renderTarget1 = renderTarget;
1022
+ this.renderTarget2 = renderTarget.clone();
1023
+ this.renderTarget2.texture.name = 'EffectComposer.rt2';
1024
+ this.writeBuffer = this.renderTarget1;
1025
+ this.readBuffer = this.renderTarget2;
1026
+ this.renderToScreen = true;
1027
+ this.passes = [];
1028
+
1029
+ // dependencies
1030
+
1031
+ if ( THREE.CopyShader === undefined ) {
1032
+
1033
+ console.error( 'THREE.EffectComposer relies on THREE.CopyShader' );
1034
+
1035
+ }
1036
+
1037
+ if ( THREE.ShaderPass === undefined ) {
1038
+
1039
+ console.error( 'THREE.EffectComposer relies on THREE.ShaderPass' );
1040
+
1041
+ }
1042
+
1043
+ this.copyPass = new THREE.ShaderPass( THREE.CopyShader );
1044
+ this.clock = new THREE.Clock();
1045
+
1046
+ }
1047
+ swapBuffers() {
1048
+
1049
+ const tmp = this.readBuffer;
1050
+ this.readBuffer = this.writeBuffer;
1051
+ this.writeBuffer = tmp;
1052
+
1053
+ }
1054
+ addPass( pass ) {
1055
+
1056
+ this.passes.push( pass );
1057
+ pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
1058
+
1059
+ }
1060
+ insertPass( pass, index ) {
1061
+
1062
+ this.passes.splice( index, 0, pass );
1063
+ pass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
1064
+
1065
+ }
1066
+ removePass( pass ) {
1067
+
1068
+ const index = this.passes.indexOf( pass );
1069
+ if ( index !== - 1 ) {
1070
+
1071
+ this.passes.splice( index, 1 );
1072
+
1073
+ }
1074
+
1075
+ }
1076
+ isLastEnabledPass( passIndex ) {
1077
+
1078
+ for ( let i = passIndex + 1; i < this.passes.length; i ++ ) {
1079
+
1080
+ if ( this.passes[ i ].enabled ) {
1081
+
1082
+ return false;
1083
+
1084
+ }
1085
+
1086
+ }
1087
+
1088
+ return true;
1089
+
1090
+ }
1091
+ render( deltaTime ) {
1092
+
1093
+ // deltaTime value is in seconds
1094
+
1095
+ if ( deltaTime === undefined ) {
1096
+
1097
+ deltaTime = this.clock.getDelta();
1098
+
1099
+ }
1100
+
1101
+ const currentRenderTarget = this.renderer.getRenderTarget();
1102
+ let maskActive = false;
1103
+ for ( let i = 0, il = this.passes.length; i < il; i ++ ) {
1104
+
1105
+ const pass = this.passes[ i ];
1106
+ if ( pass.enabled === false ) continue;
1107
+ pass.renderToScreen = this.renderToScreen && this.isLastEnabledPass( i );
1108
+ pass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive );
1109
+ if ( pass.needsSwap ) {
1110
+
1111
+ if ( maskActive ) {
1112
+
1113
+ const context = this.renderer.getContext();
1114
+ const stencil = this.renderer.state.buffers.stencil;
1115
+
1116
+ //context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );
1117
+ stencil.setFunc( context.NOTEQUAL, 1, 0xffffffff );
1118
+ this.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime );
1119
+
1120
+ //context.stencilFunc( context.EQUAL, 1, 0xffffffff );
1121
+ stencil.setFunc( context.EQUAL, 1, 0xffffffff );
1122
+
1123
+ }
1124
+
1125
+ this.swapBuffers();
1126
+
1127
+ }
1128
+
1129
+ if ( THREE.MaskPass !== undefined ) {
1130
+
1131
+ if ( pass instanceof THREE.MaskPass ) {
1132
+
1133
+ maskActive = true;
1134
+
1135
+ } else if ( pass instanceof THREE.ClearMaskPass ) {
1136
+
1137
+ maskActive = false;
1138
+
1139
+ }
1140
+
1141
+ }
1142
+
1143
+ }
1144
+
1145
+ this.renderer.setRenderTarget( currentRenderTarget );
1146
+
1147
+ }
1148
+ reset( renderTarget ) {
1149
+
1150
+ if ( renderTarget === undefined ) {
1151
+
1152
+ const size = this.renderer.getSize( new THREE.Vector2() );
1153
+ this._pixelRatio = this.renderer.getPixelRatio();
1154
+ this._width = size.width;
1155
+ this._height = size.height;
1156
+ renderTarget = this.renderTarget1.clone();
1157
+ renderTarget.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );
1158
+
1159
+ }
1160
+
1161
+ this.renderTarget1.dispose();
1162
+ this.renderTarget2.dispose();
1163
+ this.renderTarget1 = renderTarget;
1164
+ this.renderTarget2 = renderTarget.clone();
1165
+ this.writeBuffer = this.renderTarget1;
1166
+ this.readBuffer = this.renderTarget2;
1167
+
1168
+ }
1169
+ setSize( width, height ) {
1170
+
1171
+ this._width = width;
1172
+ this._height = height;
1173
+ const effectiveWidth = this._width * this._pixelRatio;
1174
+ const effectiveHeight = this._height * this._pixelRatio;
1175
+ this.renderTarget1.setSize( effectiveWidth, effectiveHeight );
1176
+ this.renderTarget2.setSize( effectiveWidth, effectiveHeight );
1177
+ for ( let i = 0; i < this.passes.length; i ++ ) {
1178
+
1179
+ this.passes[ i ].setSize( effectiveWidth, effectiveHeight );
1180
+
1181
+ }
1182
+
1183
+ }
1184
+ setPixelRatio( pixelRatio ) {
1185
+
1186
+ this._pixelRatio = pixelRatio;
1187
+ this.setSize( this._width, this._height );
1188
+
1189
+ }
1190
+ dispose() {
1191
+
1192
+ this.renderTarget1.dispose();
1193
+ this.renderTarget2.dispose();
1194
+ this.copyPass.dispose();
1195
+
1196
+ }
1197
+
1198
+ }
1199
+ class Pass {
1200
+
1201
+ constructor() {
1202
+
1203
+ // if set to true, the pass is processed by the composer
1204
+ this.enabled = true;
1205
+
1206
+ // if set to true, the pass indicates to swap read and write buffer after rendering
1207
+ this.needsSwap = true;
1208
+
1209
+ // if set to true, the pass clears its buffer before rendering
1210
+ this.clear = false;
1211
+
1212
+ // if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer.
1213
+ this.renderToScreen = false;
1214
+
1215
+ }
1216
+ setSize() {}
1217
+ render() {
1218
+
1219
+ console.error( 'THREE.Pass: .render() must be implemented in derived pass.' );
1220
+
1221
+ }
1222
+
1223
+ }
1224
+
1225
+ // Helper for passes that need to fill the viewport with a single quad.
1226
+
1227
+ const _camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
1228
+
1229
+ // https://github.com/mrdoob/three.js/pull/21358
1230
+
1231
+ const _geometry = new THREE.BufferGeometry();
1232
+ _geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
1233
+ _geometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
1234
+ class FullScreenQuad {
1235
+
1236
+ constructor( material ) {
1237
+
1238
+ this._mesh = new THREE.Mesh( _geometry, material );
1239
+
1240
+ }
1241
+ dispose() {
1242
+
1243
+ this._mesh.geometry.dispose();
1244
+
1245
+ }
1246
+ render( renderer ) {
1247
+
1248
+ renderer.render( this._mesh, _camera );
1249
+
1250
+ }
1251
+ get material() {
1252
+
1253
+ return this._mesh.material;
1254
+
1255
+ }
1256
+ set material( value ) {
1257
+
1258
+ this._mesh.material = value;
1259
+
1260
+ }
1261
+
1262
+ }
1263
+
1264
+ THREE.EffectComposer = EffectComposer;
1265
+ THREE.FullScreenQuad = FullScreenQuad;
1266
+ THREE.Pass = Pass;
1267
+
1268
+ } )();
1269
+
1270
+ </script><script>
1271
+ ( function () {
1272
+
1273
+ class RenderPass extends THREE.Pass {
1274
+
1275
+ constructor( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
1276
+
1277
+ super();
1278
+ this.scene = scene;
1279
+ this.camera = camera;
1280
+ this.overrideMaterial = overrideMaterial;
1281
+ this.clearColor = clearColor;
1282
+ this.clearAlpha = clearAlpha !== undefined ? clearAlpha : 0;
1283
+ this.clear = true;
1284
+ this.clearDepth = false;
1285
+ this.needsSwap = false;
1286
+ this._oldClearColor = new THREE.Color();
1287
+
1288
+ }
1289
+ render( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {
1290
+
1291
+ const oldAutoClear = renderer.autoClear;
1292
+ renderer.autoClear = false;
1293
+ let oldClearAlpha, oldOverrideMaterial;
1294
+ if ( this.overrideMaterial !== undefined ) {
1295
+
1296
+ oldOverrideMaterial = this.scene.overrideMaterial;
1297
+ this.scene.overrideMaterial = this.overrideMaterial;
1298
+
1299
+ }
1300
+
1301
+ if ( this.clearColor ) {
1302
+
1303
+ renderer.getClearColor( this._oldClearColor );
1304
+ oldClearAlpha = renderer.getClearAlpha();
1305
+ renderer.setClearColor( this.clearColor, this.clearAlpha );
1306
+
1307
+ }
1308
+
1309
+ if ( this.clearDepth ) {
1310
+
1311
+ renderer.clearDepth();
1312
+
1313
+ }
1314
+
1315
+ renderer.setRenderTarget( this.renderToScreen ? null : readBuffer );
1316
+
1317
+ // TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600
1318
+ if ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );
1319
+ renderer.render( this.scene, this.camera );
1320
+ if ( this.clearColor ) {
1321
+
1322
+ renderer.setClearColor( this._oldClearColor, oldClearAlpha );
1323
+
1324
+ }
1325
+
1326
+ if ( this.overrideMaterial !== undefined ) {
1327
+
1328
+ this.scene.overrideMaterial = oldOverrideMaterial;
1329
+
1330
+ }
1331
+
1332
+ renderer.autoClear = oldAutoClear;
1333
+
1334
+ }
1335
+
1336
+ }
1337
+
1338
+ THREE.RenderPass = RenderPass;
1339
+
1340
+ } )();
1341
+
1342
+ </script><script>
1343
+ ( function () {
1344
+
1345
+ /**
1346
+ * Gamma Correction Shader
1347
+ * http://en.wikipedia.org/wiki/gamma_correction
1348
+ */
1349
+
1350
+ const GammaCorrectionShader = {
1351
+ uniforms: {
1352
+ 'tDiffuse': {
1353
+ value: null
1354
+ }
1355
+ },
1356
+ vertexShader: /* glsl */`
1357
+
1358
+ varying vec2 vUv;
1359
+
1360
+ void main() {
1361
+
1362
+ vUv = uv;
1363
+ gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
1364
+
1365
+ }`,
1366
+ fragmentShader: /* glsl */`
1367
+
1368
+ uniform sampler2D tDiffuse;
1369
+
1370
+ varying vec2 vUv;
1371
+
1372
+ void main() {
1373
+
1374
+ vec4 tex = texture2D( tDiffuse, vUv );
1375
+
1376
+ gl_FragColor = LinearTosRGB( tex );
1377
+
1378
+ }`
1379
+ };
1380
+
1381
+ THREE.GammaCorrectionShader = GammaCorrectionShader;
1382
+
1383
+ } )();
1384
+
1385
+ </script><script>
1386
+ THREE.OutputPass = class extends THREE.ShaderPass { constructor() { super(THREE.GammaCorrectionShader); } };
1387
+ </script><script>
1388
+ ( function () {
1389
+
1390
+ const _box = new THREE.Box3();
1391
+ const _vector = new THREE.Vector3();
1392
+ class LineSegmentsGeometry extends THREE.InstancedBufferGeometry {
1393
+
1394
+ constructor() {
1395
+
1396
+ super();
1397
+ this.isLineSegmentsGeometry = true;
1398
+ this.type = 'LineSegmentsGeometry';
1399
+ const positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ];
1400
+ const uvs = [ - 1, 2, 1, 2, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 2, 1, - 2 ];
1401
+ const index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ];
1402
+ this.setIndex( index );
1403
+ this.setAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) );
1404
+ this.setAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) );
1405
+
1406
+ }
1407
+ applyMatrix4( matrix ) {
1408
+
1409
+ const start = this.attributes.instanceStart;
1410
+ const end = this.attributes.instanceEnd;
1411
+ if ( start !== undefined ) {
1412
+
1413
+ start.applyMatrix4( matrix );
1414
+ end.applyMatrix4( matrix );
1415
+ start.needsUpdate = true;
1416
+
1417
+ }
1418
+
1419
+ if ( this.boundingBox !== null ) {
1420
+
1421
+ this.computeBoundingBox();
1422
+
1423
+ }
1424
+
1425
+ if ( this.boundingSphere !== null ) {
1426
+
1427
+ this.computeBoundingSphere();
1428
+
1429
+ }
1430
+
1431
+ return this;
1432
+
1433
+ }
1434
+ setPositions( array ) {
1435
+
1436
+ let lineSegments;
1437
+ if ( array instanceof Float32Array ) {
1438
+
1439
+ lineSegments = array;
1440
+
1441
+ } else if ( Array.isArray( array ) ) {
1442
+
1443
+ lineSegments = new Float32Array( array );
1444
+
1445
+ }
1446
+
1447
+ const instanceBuffer = new THREE.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz
1448
+
1449
+ this.setAttribute( 'instanceStart', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz
1450
+ this.setAttribute( 'instanceEnd', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz
1451
+
1452
+ //
1453
+
1454
+ this.computeBoundingBox();
1455
+ this.computeBoundingSphere();
1456
+ return this;
1457
+
1458
+ }
1459
+ setColors( array ) {
1460
+
1461
+ let colors;
1462
+ if ( array instanceof Float32Array ) {
1463
+
1464
+ colors = array;
1465
+
1466
+ } else if ( Array.isArray( array ) ) {
1467
+
1468
+ colors = new Float32Array( array );
1469
+
1470
+ }
1471
+
1472
+ const instanceColorBuffer = new THREE.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb
1473
+
1474
+ this.setAttribute( 'instanceColorStart', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb
1475
+ this.setAttribute( 'instanceColorEnd', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb
1476
+
1477
+ return this;
1478
+
1479
+ }
1480
+ fromWireframeGeometry( geometry ) {
1481
+
1482
+ this.setPositions( geometry.attributes.position.array );
1483
+ return this;
1484
+
1485
+ }
1486
+ fromEdgesGeometry( geometry ) {
1487
+
1488
+ this.setPositions( geometry.attributes.position.array );
1489
+ return this;
1490
+
1491
+ }
1492
+ fromMesh( mesh ) {
1493
+
1494
+ this.fromWireframeGeometry( new THREE.WireframeGeometry( mesh.geometry ) );
1495
+
1496
+ // set colors, maybe
1497
+
1498
+ return this;
1499
+
1500
+ }
1501
+ fromLineSegments( lineSegments ) {
1502
+
1503
+ const geometry = lineSegments.geometry;
1504
+ this.setPositions( geometry.attributes.position.array ); // assumes non-indexed
1505
+
1506
+ // set colors, maybe
1507
+
1508
+ return this;
1509
+
1510
+ }
1511
+ computeBoundingBox() {
1512
+
1513
+ if ( this.boundingBox === null ) {
1514
+
1515
+ this.boundingBox = new THREE.Box3();
1516
+
1517
+ }
1518
+
1519
+ const start = this.attributes.instanceStart;
1520
+ const end = this.attributes.instanceEnd;
1521
+ if ( start !== undefined && end !== undefined ) {
1522
+
1523
+ this.boundingBox.setFromBufferAttribute( start );
1524
+ _box.setFromBufferAttribute( end );
1525
+ this.boundingBox.union( _box );
1526
+
1527
+ }
1528
+
1529
+ }
1530
+ computeBoundingSphere() {
1531
+
1532
+ if ( this.boundingSphere === null ) {
1533
+
1534
+ this.boundingSphere = new THREE.Sphere();
1535
+
1536
+ }
1537
+
1538
+ if ( this.boundingBox === null ) {
1539
+
1540
+ this.computeBoundingBox();
1541
+
1542
+ }
1543
+
1544
+ const start = this.attributes.instanceStart;
1545
+ const end = this.attributes.instanceEnd;
1546
+ if ( start !== undefined && end !== undefined ) {
1547
+
1548
+ const center = this.boundingSphere.center;
1549
+ this.boundingBox.getCenter( center );
1550
+ let maxRadiusSq = 0;
1551
+ for ( let i = 0, il = start.count; i < il; i ++ ) {
1552
+
1553
+ _vector.fromBufferAttribute( start, i );
1554
+ maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector ) );
1555
+ _vector.fromBufferAttribute( end, i );
1556
+ maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector ) );
1557
+
1558
+ }
1559
+
1560
+ this.boundingSphere.radius = Math.sqrt( maxRadiusSq );
1561
+ if ( isNaN( this.boundingSphere.radius ) ) {
1562
+
1563
+ console.error( 'THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this );
1564
+
1565
+ }
1566
+
1567
+ }
1568
+
1569
+ }
1570
+ toJSON() {
1571
+
1572
+ // todo
1573
+ }
1574
+ applyMatrix( matrix ) {
1575
+
1576
+ console.warn( 'THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().' );
1577
+ return this.applyMatrix4( matrix );
1578
+
1579
+ }
1580
+
1581
+ }
1582
+
1583
+ THREE.LineSegmentsGeometry = LineSegmentsGeometry;
1584
+
1585
+ } )();
1586
+
1587
+ </script><script>
1588
+ ( function () {
1589
+
1590
+ /**
1591
+ * parameters = {
1592
+ * color: <hex>,
1593
+ * linewidth: <float>,
1594
+ * dashed: <boolean>,
1595
+ * dashScale: <float>,
1596
+ * dashSize: <float>,
1597
+ * dashOffset: <float>,
1598
+ * gapSize: <float>,
1599
+ * resolution: <Vector2>, // to be set by renderer
1600
+ * }
1601
+ */
1602
+ THREE.UniformsLib.line = {
1603
+ worldUnits: {
1604
+ value: 1
1605
+ },
1606
+ linewidth: {
1607
+ value: 1
1608
+ },
1609
+ resolution: {
1610
+ value: new THREE.Vector2( 1, 1 )
1611
+ },
1612
+ dashOffset: {
1613
+ value: 0
1614
+ },
1615
+ dashScale: {
1616
+ value: 1
1617
+ },
1618
+ dashSize: {
1619
+ value: 1
1620
+ },
1621
+ gapSize: {
1622
+ value: 1
1623
+ } // todo FIX - maybe change to totalSize
1624
+ };
1625
+
1626
+ THREE.ShaderLib[ 'line' ] = {
1627
+ uniforms: THREE.UniformsUtils.merge( [ THREE.UniformsLib.common, THREE.UniformsLib.fog, THREE.UniformsLib.line ] ),
1628
+ vertexShader: /* glsl */`
1629
+ #include <common>
1630
+ #include <color_pars_vertex>
1631
+ #include <fog_pars_vertex>
1632
+ #include <logdepthbuf_pars_vertex>
1633
+ #include <clipping_planes_pars_vertex>
1634
+
1635
+ uniform float linewidth;
1636
+ uniform vec2 resolution;
1637
+
1638
+ attribute vec3 instanceStart;
1639
+ attribute vec3 instanceEnd;
1640
+
1641
+ attribute vec3 instanceColorStart;
1642
+ attribute vec3 instanceColorEnd;
1643
+
1644
+ #ifdef WORLD_UNITS
1645
+
1646
+ varying vec4 worldPos;
1647
+ varying vec3 worldStart;
1648
+ varying vec3 worldEnd;
1649
+
1650
+ #ifdef USE_DASH
1651
+
1652
+ varying vec2 vUv;
1653
+
1654
+ #endif
1655
+
1656
+ #else
1657
+
1658
+ varying vec2 vUv;
1659
+
1660
+ #endif
1661
+
1662
+ #ifdef USE_DASH
1663
+
1664
+ uniform float dashScale;
1665
+ attribute float instanceDistanceStart;
1666
+ attribute float instanceDistanceEnd;
1667
+ varying float vLineDistance;
1668
+
1669
+ #endif
1670
+
1671
+ void trimSegment( const in vec4 start, inout vec4 end ) {
1672
+
1673
+ // trim end segment so it terminates between the camera plane and the near plane
1674
+
1675
+ // conservative estimate of the near plane
1676
+ float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
1677
+ float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
1678
+ float nearEstimate = - 0.5 * b / a;
1679
+
1680
+ float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
1681
+
1682
+ end.xyz = mix( start.xyz, end.xyz, alpha );
1683
+
1684
+ }
1685
+
1686
+ void main() {
1687
+
1688
+ #ifdef USE_COLOR
1689
+
1690
+ vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
1691
+
1692
+ #endif
1693
+
1694
+ #ifdef USE_DASH
1695
+
1696
+ vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
1697
+ vUv = uv;
1698
+
1699
+ #endif
1700
+
1701
+ float aspect = resolution.x / resolution.y;
1702
+
1703
+ // camera space
1704
+ vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
1705
+ vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
1706
+
1707
+ #ifdef WORLD_UNITS
1708
+
1709
+ worldStart = start.xyz;
1710
+ worldEnd = end.xyz;
1711
+
1712
+ #else
1713
+
1714
+ vUv = uv;
1715
+
1716
+ #endif
1717
+
1718
+ // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
1719
+ // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
1720
+ // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
1721
+ // perhaps there is a more elegant solution -- WestLangley
1722
+
1723
+ bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
1724
+
1725
+ if ( perspective ) {
1726
+
1727
+ if ( start.z < 0.0 && end.z >= 0.0 ) {
1728
+
1729
+ trimSegment( start, end );
1730
+
1731
+ } else if ( end.z < 0.0 && start.z >= 0.0 ) {
1732
+
1733
+ trimSegment( end, start );
1734
+
1735
+ }
1736
+
1737
+ }
1738
+
1739
+ // clip space
1740
+ vec4 clipStart = projectionMatrix * start;
1741
+ vec4 clipEnd = projectionMatrix * end;
1742
+
1743
+ // ndc space
1744
+ vec3 ndcStart = clipStart.xyz / clipStart.w;
1745
+ vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
1746
+
1747
+ // direction
1748
+ vec2 dir = ndcEnd.xy - ndcStart.xy;
1749
+
1750
+ // account for clip-space aspect ratio
1751
+ dir.x *= aspect;
1752
+ dir = normalize( dir );
1753
+
1754
+ #ifdef WORLD_UNITS
1755
+
1756
+ // get the offset direction as perpendicular to the view vector
1757
+ vec3 worldDir = normalize( end.xyz - start.xyz );
1758
+ vec3 offset;
1759
+ if ( position.y < 0.5 ) {
1760
+
1761
+ offset = normalize( cross( start.xyz, worldDir ) );
1762
+
1763
+ } else {
1764
+
1765
+ offset = normalize( cross( end.xyz, worldDir ) );
1766
+
1767
+ }
1768
+
1769
+ // sign flip
1770
+ if ( position.x < 0.0 ) offset *= - 1.0;
1771
+
1772
+ float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
1773
+
1774
+ // don't extend the line if we're rendering dashes because we
1775
+ // won't be rendering the endcaps
1776
+ #ifndef USE_DASH
1777
+
1778
+ // extend the line bounds to encompass endcaps
1779
+ start.xyz += - worldDir * linewidth * 0.5;
1780
+ end.xyz += worldDir * linewidth * 0.5;
1781
+
1782
+ // shift the position of the quad so it hugs the forward edge of the line
1783
+ offset.xy -= dir * forwardOffset;
1784
+ offset.z += 0.5;
1785
+
1786
+ #endif
1787
+
1788
+ // endcaps
1789
+ if ( position.y > 1.0 || position.y < 0.0 ) {
1790
+
1791
+ offset.xy += dir * 2.0 * forwardOffset;
1792
+
1793
+ }
1794
+
1795
+ // adjust for linewidth
1796
+ offset *= linewidth * 0.5;
1797
+
1798
+ // set the world position
1799
+ worldPos = ( position.y < 0.5 ) ? start : end;
1800
+ worldPos.xyz += offset;
1801
+
1802
+ // project the worldpos
1803
+ vec4 clip = projectionMatrix * worldPos;
1804
+
1805
+ // shift the depth of the projected points so the line
1806
+ // segments overlap neatly
1807
+ vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
1808
+ clip.z = clipPose.z * clip.w;
1809
+
1810
+ #else
1811
+
1812
+ vec2 offset = vec2( dir.y, - dir.x );
1813
+ // undo aspect ratio adjustment
1814
+ dir.x /= aspect;
1815
+ offset.x /= aspect;
1816
+
1817
+ // sign flip
1818
+ if ( position.x < 0.0 ) offset *= - 1.0;
1819
+
1820
+ // endcaps
1821
+ if ( position.y < 0.0 ) {
1822
+
1823
+ offset += - dir;
1824
+
1825
+ } else if ( position.y > 1.0 ) {
1826
+
1827
+ offset += dir;
1828
+
1829
+ }
1830
+
1831
+ // adjust for linewidth
1832
+ offset *= linewidth;
1833
+
1834
+ // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
1835
+ offset /= resolution.y;
1836
+
1837
+ // select end
1838
+ vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
1839
+
1840
+ // back to clip space
1841
+ offset *= clip.w;
1842
+
1843
+ clip.xy += offset;
1844
+
1845
+ #endif
1846
+
1847
+ gl_Position = clip;
1848
+
1849
+ vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
1850
+
1851
+ #include <logdepthbuf_vertex>
1852
+ #include <clipping_planes_vertex>
1853
+ #include <fog_vertex>
1854
+
1855
+ }
1856
+ `,
1857
+ fragmentShader: /* glsl */`
1858
+ uniform vec3 diffuse;
1859
+ uniform float opacity;
1860
+ uniform float linewidth;
1861
+
1862
+ #ifdef USE_DASH
1863
+
1864
+ uniform float dashOffset;
1865
+ uniform float dashSize;
1866
+ uniform float gapSize;
1867
+
1868
+ #endif
1869
+
1870
+ varying float vLineDistance;
1871
+
1872
+ #ifdef WORLD_UNITS
1873
+
1874
+ varying vec4 worldPos;
1875
+ varying vec3 worldStart;
1876
+ varying vec3 worldEnd;
1877
+
1878
+ #ifdef USE_DASH
1879
+
1880
+ varying vec2 vUv;
1881
+
1882
+ #endif
1883
+
1884
+ #else
1885
+
1886
+ varying vec2 vUv;
1887
+
1888
+ #endif
1889
+
1890
+ #include <common>
1891
+ #include <color_pars_fragment>
1892
+ #include <fog_pars_fragment>
1893
+ #include <logdepthbuf_pars_fragment>
1894
+ #include <clipping_planes_pars_fragment>
1895
+
1896
+ vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
1897
+
1898
+ float mua;
1899
+ float mub;
1900
+
1901
+ vec3 p13 = p1 - p3;
1902
+ vec3 p43 = p4 - p3;
1903
+
1904
+ vec3 p21 = p2 - p1;
1905
+
1906
+ float d1343 = dot( p13, p43 );
1907
+ float d4321 = dot( p43, p21 );
1908
+ float d1321 = dot( p13, p21 );
1909
+ float d4343 = dot( p43, p43 );
1910
+ float d2121 = dot( p21, p21 );
1911
+
1912
+ float denom = d2121 * d4343 - d4321 * d4321;
1913
+
1914
+ float numer = d1343 * d4321 - d1321 * d4343;
1915
+
1916
+ mua = numer / denom;
1917
+ mua = clamp( mua, 0.0, 1.0 );
1918
+ mub = ( d1343 + d4321 * ( mua ) ) / d4343;
1919
+ mub = clamp( mub, 0.0, 1.0 );
1920
+
1921
+ return vec2( mua, mub );
1922
+
1923
+ }
1924
+
1925
+ void main() {
1926
+
1927
+ #include <clipping_planes_fragment>
1928
+
1929
+ #ifdef USE_DASH
1930
+
1931
+ if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
1932
+
1933
+ if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
1934
+
1935
+ #endif
1936
+
1937
+ float alpha = opacity;
1938
+
1939
+ #ifdef WORLD_UNITS
1940
+
1941
+ // Find the closest points on the view ray and the line segment
1942
+ vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
1943
+ vec3 lineDir = worldEnd - worldStart;
1944
+ vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
1945
+
1946
+ vec3 p1 = worldStart + lineDir * params.x;
1947
+ vec3 p2 = rayEnd * params.y;
1948
+ vec3 delta = p1 - p2;
1949
+ float len = length( delta );
1950
+ float norm = len / linewidth;
1951
+
1952
+ #ifndef USE_DASH
1953
+
1954
+ #ifdef USE_ALPHA_TO_COVERAGE
1955
+
1956
+ float dnorm = fwidth( norm );
1957
+ alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
1958
+
1959
+ #else
1960
+
1961
+ if ( norm > 0.5 ) {
1962
+
1963
+ discard;
1964
+
1965
+ }
1966
+
1967
+ #endif
1968
+
1969
+ #endif
1970
+
1971
+ #else
1972
+
1973
+ #ifdef USE_ALPHA_TO_COVERAGE
1974
+
1975
+ // artifacts appear on some hardware if a derivative is taken within a conditional
1976
+ float a = vUv.x;
1977
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
1978
+ float len2 = a * a + b * b;
1979
+ float dlen = fwidth( len2 );
1980
+
1981
+ if ( abs( vUv.y ) > 1.0 ) {
1982
+
1983
+ alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
1984
+
1985
+ }
1986
+
1987
+ #else
1988
+
1989
+ if ( abs( vUv.y ) > 1.0 ) {
1990
+
1991
+ float a = vUv.x;
1992
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
1993
+ float len2 = a * a + b * b;
1994
+
1995
+ if ( len2 > 1.0 ) discard;
1996
+
1997
+ }
1998
+
1999
+ #endif
2000
+
2001
+ #endif
2002
+
2003
+ vec4 diffuseColor = vec4( diffuse, alpha );
2004
+
2005
+ #include <logdepthbuf_fragment>
2006
+ #include <color_fragment>
2007
+
2008
+ gl_FragColor = vec4( diffuseColor.rgb, alpha );
2009
+
2010
+ #include <tonemapping_fragment>
2011
+ #include <encodings_fragment>
2012
+ #include <fog_fragment>
2013
+ #include <premultiplied_alpha_fragment>
2014
+
2015
+ }
2016
+ `
2017
+ };
2018
+ class LineMaterial extends THREE.ShaderMaterial {
2019
+
2020
+ constructor( parameters ) {
2021
+
2022
+ super( {
2023
+ type: 'LineMaterial',
2024
+ uniforms: THREE.UniformsUtils.clone( THREE.ShaderLib[ 'line' ].uniforms ),
2025
+ vertexShader: THREE.ShaderLib[ 'line' ].vertexShader,
2026
+ fragmentShader: THREE.ShaderLib[ 'line' ].fragmentShader,
2027
+ clipping: true // required for clipping support
2028
+ } );
2029
+
2030
+ this.isLineMaterial = true;
2031
+ Object.defineProperties( this, {
2032
+ color: {
2033
+ enumerable: true,
2034
+ get: function () {
2035
+
2036
+ return this.uniforms.diffuse.value;
2037
+
2038
+ },
2039
+ set: function ( value ) {
2040
+
2041
+ this.uniforms.diffuse.value = value;
2042
+
2043
+ }
2044
+ },
2045
+ worldUnits: {
2046
+ enumerable: true,
2047
+ get: function () {
2048
+
2049
+ return 'WORLD_UNITS' in this.defines;
2050
+
2051
+ },
2052
+ set: function ( value ) {
2053
+
2054
+ if ( value === true ) {
2055
+
2056
+ this.defines.WORLD_UNITS = '';
2057
+
2058
+ } else {
2059
+
2060
+ delete this.defines.WORLD_UNITS;
2061
+
2062
+ }
2063
+
2064
+ }
2065
+ },
2066
+ linewidth: {
2067
+ enumerable: true,
2068
+ get: function () {
2069
+
2070
+ return this.uniforms.linewidth.value;
2071
+
2072
+ },
2073
+ set: function ( value ) {
2074
+
2075
+ this.uniforms.linewidth.value = value;
2076
+
2077
+ }
2078
+ },
2079
+ dashed: {
2080
+ enumerable: true,
2081
+ get: function () {
2082
+
2083
+ return Boolean( 'USE_DASH' in this.defines );
2084
+
2085
+ },
2086
+ set( value ) {
2087
+
2088
+ if ( Boolean( value ) !== Boolean( 'USE_DASH' in this.defines ) ) {
2089
+
2090
+ this.needsUpdate = true;
2091
+
2092
+ }
2093
+
2094
+ if ( value === true ) {
2095
+
2096
+ this.defines.USE_DASH = '';
2097
+
2098
+ } else {
2099
+
2100
+ delete this.defines.USE_DASH;
2101
+
2102
+ }
2103
+
2104
+ }
2105
+ },
2106
+ dashScale: {
2107
+ enumerable: true,
2108
+ get: function () {
2109
+
2110
+ return this.uniforms.dashScale.value;
2111
+
2112
+ },
2113
+ set: function ( value ) {
2114
+
2115
+ this.uniforms.dashScale.value = value;
2116
+
2117
+ }
2118
+ },
2119
+ dashSize: {
2120
+ enumerable: true,
2121
+ get: function () {
2122
+
2123
+ return this.uniforms.dashSize.value;
2124
+
2125
+ },
2126
+ set: function ( value ) {
2127
+
2128
+ this.uniforms.dashSize.value = value;
2129
+
2130
+ }
2131
+ },
2132
+ dashOffset: {
2133
+ enumerable: true,
2134
+ get: function () {
2135
+
2136
+ return this.uniforms.dashOffset.value;
2137
+
2138
+ },
2139
+ set: function ( value ) {
2140
+
2141
+ this.uniforms.dashOffset.value = value;
2142
+
2143
+ }
2144
+ },
2145
+ gapSize: {
2146
+ enumerable: true,
2147
+ get: function () {
2148
+
2149
+ return this.uniforms.gapSize.value;
2150
+
2151
+ },
2152
+ set: function ( value ) {
2153
+
2154
+ this.uniforms.gapSize.value = value;
2155
+
2156
+ }
2157
+ },
2158
+ opacity: {
2159
+ enumerable: true,
2160
+ get: function () {
2161
+
2162
+ return this.uniforms.opacity.value;
2163
+
2164
+ },
2165
+ set: function ( value ) {
2166
+
2167
+ this.uniforms.opacity.value = value;
2168
+
2169
+ }
2170
+ },
2171
+ resolution: {
2172
+ enumerable: true,
2173
+ get: function () {
2174
+
2175
+ return this.uniforms.resolution.value;
2176
+
2177
+ },
2178
+ set: function ( value ) {
2179
+
2180
+ this.uniforms.resolution.value.copy( value );
2181
+
2182
+ }
2183
+ },
2184
+ alphaToCoverage: {
2185
+ enumerable: true,
2186
+ get: function () {
2187
+
2188
+ return Boolean( 'USE_ALPHA_TO_COVERAGE' in this.defines );
2189
+
2190
+ },
2191
+ set: function ( value ) {
2192
+
2193
+ if ( Boolean( value ) !== Boolean( 'USE_ALPHA_TO_COVERAGE' in this.defines ) ) {
2194
+
2195
+ this.needsUpdate = true;
2196
+
2197
+ }
2198
+
2199
+ if ( value === true ) {
2200
+
2201
+ this.defines.USE_ALPHA_TO_COVERAGE = '';
2202
+ this.extensions.derivatives = true;
2203
+
2204
+ } else {
2205
+
2206
+ delete this.defines.USE_ALPHA_TO_COVERAGE;
2207
+ this.extensions.derivatives = false;
2208
+
2209
+ }
2210
+
2211
+ }
2212
+ }
2213
+ } );
2214
+ this.setValues( parameters );
2215
+
2216
+ }
2217
+
2218
+ }
2219
+
2220
+ THREE.LineMaterial = LineMaterial;
2221
+
2222
+ } )();
2223
+
2224
+ </script><script>
2225
+ ( function () {
2226
+
2227
+ const _start = new THREE.Vector3();
2228
+ const _end = new THREE.Vector3();
2229
+ const _start4 = new THREE.Vector4();
2230
+ const _end4 = new THREE.Vector4();
2231
+ const _ssOrigin = new THREE.Vector4();
2232
+ const _ssOrigin3 = new THREE.Vector3();
2233
+ const _mvMatrix = new THREE.Matrix4();
2234
+ const _line = new THREE.Line3();
2235
+ const _closestPoint = new THREE.Vector3();
2236
+ const _box = new THREE.Box3();
2237
+ const _sphere = new THREE.Sphere();
2238
+ const _clipToWorldVector = new THREE.Vector4();
2239
+ let _ray, _instanceStart, _instanceEnd, _lineWidth;
2240
+
2241
+ // Returns the margin required to expand by in world space given the distance from the camera,
2242
+ // line width, resolution, and camera projection
2243
+ function getWorldSpaceHalfWidth( camera, distance, resolution ) {
2244
+
2245
+ // transform into clip space, adjust the x and y values by the pixel width offset, then
2246
+ // transform back into world space to get world offset. Note clip space is [-1, 1] so full
2247
+ // width does not need to be halved.
2248
+ _clipToWorldVector.set( 0, 0, - distance, 1.0 ).applyMatrix4( camera.projectionMatrix );
2249
+ _clipToWorldVector.multiplyScalar( 1.0 / _clipToWorldVector.w );
2250
+ _clipToWorldVector.x = _lineWidth / resolution.width;
2251
+ _clipToWorldVector.y = _lineWidth / resolution.height;
2252
+ _clipToWorldVector.applyMatrix4( camera.projectionMatrixInverse );
2253
+ _clipToWorldVector.multiplyScalar( 1.0 / _clipToWorldVector.w );
2254
+ return Math.abs( Math.max( _clipToWorldVector.x, _clipToWorldVector.y ) );
2255
+
2256
+ }
2257
+
2258
+ function raycastWorldUnits( lineSegments, intersects ) {
2259
+
2260
+ const matrixWorld = lineSegments.matrixWorld;
2261
+ for ( let i = 0, l = _instanceStart.count; i < l; i ++ ) {
2262
+
2263
+ _line.start.fromBufferAttribute( _instanceStart, i );
2264
+ _line.end.fromBufferAttribute( _instanceEnd, i );
2265
+ _line.applyMatrix4( matrixWorld );
2266
+ const pointOnLine = new THREE.Vector3();
2267
+ const point = new THREE.Vector3();
2268
+ _ray.distanceSqToSegment( _line.start, _line.end, point, pointOnLine );
2269
+ const isInside = point.distanceTo( pointOnLine ) < _lineWidth * 0.5;
2270
+ if ( isInside ) {
2271
+
2272
+ intersects.push( {
2273
+ point,
2274
+ pointOnLine,
2275
+ distance: _ray.origin.distanceTo( point ),
2276
+ object: lineSegments,
2277
+ face: null,
2278
+ faceIndex: i,
2279
+ uv: null,
2280
+ uv2: null
2281
+ } );
2282
+
2283
+ }
2284
+
2285
+ }
2286
+
2287
+ }
2288
+
2289
+ function raycastScreenSpace( lineSegments, camera, intersects ) {
2290
+
2291
+ const projectionMatrix = camera.projectionMatrix;
2292
+ const material = lineSegments.material;
2293
+ const resolution = material.resolution;
2294
+ const matrixWorld = lineSegments.matrixWorld;
2295
+ const geometry = lineSegments.geometry;
2296
+ const instanceStart = geometry.attributes.instanceStart;
2297
+ const instanceEnd = geometry.attributes.instanceEnd;
2298
+ const near = - camera.near;
2299
+
2300
+ //
2301
+
2302
+ // pick a point 1 unit out along the ray to avoid the ray origin
2303
+ // sitting at the camera origin which will cause "w" to be 0 when
2304
+ // applying the projection matrix.
2305
+ _ray.at( 1, _ssOrigin );
2306
+
2307
+ // ndc space [ - 1.0, 1.0 ]
2308
+ _ssOrigin.w = 1;
2309
+ _ssOrigin.applyMatrix4( camera.matrixWorldInverse );
2310
+ _ssOrigin.applyMatrix4( projectionMatrix );
2311
+ _ssOrigin.multiplyScalar( 1 / _ssOrigin.w );
2312
+
2313
+ // screen space
2314
+ _ssOrigin.x *= resolution.x / 2;
2315
+ _ssOrigin.y *= resolution.y / 2;
2316
+ _ssOrigin.z = 0;
2317
+ _ssOrigin3.copy( _ssOrigin );
2318
+ _mvMatrix.multiplyMatrices( camera.matrixWorldInverse, matrixWorld );
2319
+ for ( let i = 0, l = instanceStart.count; i < l; i ++ ) {
2320
+
2321
+ _start4.fromBufferAttribute( instanceStart, i );
2322
+ _end4.fromBufferAttribute( instanceEnd, i );
2323
+ _start4.w = 1;
2324
+ _end4.w = 1;
2325
+
2326
+ // camera space
2327
+ _start4.applyMatrix4( _mvMatrix );
2328
+ _end4.applyMatrix4( _mvMatrix );
2329
+
2330
+ // skip the segment if it's entirely behind the camera
2331
+ const isBehindCameraNear = _start4.z > near && _end4.z > near;
2332
+ if ( isBehindCameraNear ) {
2333
+
2334
+ continue;
2335
+
2336
+ }
2337
+
2338
+ // trim the segment if it extends behind camera near
2339
+ if ( _start4.z > near ) {
2340
+
2341
+ const deltaDist = _start4.z - _end4.z;
2342
+ const t = ( _start4.z - near ) / deltaDist;
2343
+ _start4.lerp( _end4, t );
2344
+
2345
+ } else if ( _end4.z > near ) {
2346
+
2347
+ const deltaDist = _end4.z - _start4.z;
2348
+ const t = ( _end4.z - near ) / deltaDist;
2349
+ _end4.lerp( _start4, t );
2350
+
2351
+ }
2352
+
2353
+ // clip space
2354
+ _start4.applyMatrix4( projectionMatrix );
2355
+ _end4.applyMatrix4( projectionMatrix );
2356
+
2357
+ // ndc space [ - 1.0, 1.0 ]
2358
+ _start4.multiplyScalar( 1 / _start4.w );
2359
+ _end4.multiplyScalar( 1 / _end4.w );
2360
+
2361
+ // screen space
2362
+ _start4.x *= resolution.x / 2;
2363
+ _start4.y *= resolution.y / 2;
2364
+ _end4.x *= resolution.x / 2;
2365
+ _end4.y *= resolution.y / 2;
2366
+
2367
+ // create 2d segment
2368
+ _line.start.copy( _start4 );
2369
+ _line.start.z = 0;
2370
+ _line.end.copy( _end4 );
2371
+ _line.end.z = 0;
2372
+
2373
+ // get closest point on ray to segment
2374
+ const param = _line.closestPointToPointParameter( _ssOrigin3, true );
2375
+ _line.at( param, _closestPoint );
2376
+
2377
+ // check if the intersection point is within clip space
2378
+ const zPos = THREE.MathUtils.lerp( _start4.z, _end4.z, param );
2379
+ const isInClipSpace = zPos >= - 1 && zPos <= 1;
2380
+ const isInside = _ssOrigin3.distanceTo( _closestPoint ) < _lineWidth * 0.5;
2381
+ if ( isInClipSpace && isInside ) {
2382
+
2383
+ _line.start.fromBufferAttribute( instanceStart, i );
2384
+ _line.end.fromBufferAttribute( instanceEnd, i );
2385
+ _line.start.applyMatrix4( matrixWorld );
2386
+ _line.end.applyMatrix4( matrixWorld );
2387
+ const pointOnLine = new THREE.Vector3();
2388
+ const point = new THREE.Vector3();
2389
+ _ray.distanceSqToSegment( _line.start, _line.end, point, pointOnLine );
2390
+ intersects.push( {
2391
+ point: point,
2392
+ pointOnLine: pointOnLine,
2393
+ distance: _ray.origin.distanceTo( point ),
2394
+ object: lineSegments,
2395
+ face: null,
2396
+ faceIndex: i,
2397
+ uv: null,
2398
+ uv2: null
2399
+ } );
2400
+
2401
+ }
2402
+
2403
+ }
2404
+
2405
+ }
2406
+
2407
+ class LineSegments2 extends THREE.Mesh {
2408
+
2409
+ constructor( geometry = new THREE.LineSegmentsGeometry(), material = new THREE.LineMaterial( {
2410
+ color: window.__popostRandom() * 0xffffff
2411
+ } ) ) {
2412
+
2413
+ super( geometry, material );
2414
+ this.isLineSegments2 = true;
2415
+ this.type = 'LineSegments2';
2416
+
2417
+ }
2418
+
2419
+ // for backwards-compatibility, but could be a method of THREE.LineSegmentsGeometry...
2420
+
2421
+ computeLineDistances() {
2422
+
2423
+ const geometry = this.geometry;
2424
+ const instanceStart = geometry.attributes.instanceStart;
2425
+ const instanceEnd = geometry.attributes.instanceEnd;
2426
+ const lineDistances = new Float32Array( 2 * instanceStart.count );
2427
+ for ( let i = 0, j = 0, l = instanceStart.count; i < l; i ++, j += 2 ) {
2428
+
2429
+ _start.fromBufferAttribute( instanceStart, i );
2430
+ _end.fromBufferAttribute( instanceEnd, i );
2431
+ lineDistances[ j ] = j === 0 ? 0 : lineDistances[ j - 1 ];
2432
+ lineDistances[ j + 1 ] = lineDistances[ j ] + _start.distanceTo( _end );
2433
+
2434
+ }
2435
+
2436
+ const instanceDistanceBuffer = new THREE.InstancedInterleavedBuffer( lineDistances, 2, 1 ); // d0, d1
2437
+
2438
+ geometry.setAttribute( 'instanceDistanceStart', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 0 ) ); // d0
2439
+ geometry.setAttribute( 'instanceDistanceEnd', new THREE.InterleavedBufferAttribute( instanceDistanceBuffer, 1, 1 ) ); // d1
2440
+
2441
+ return this;
2442
+
2443
+ }
2444
+ raycast( raycaster, intersects ) {
2445
+
2446
+ const worldUnits = this.material.worldUnits;
2447
+ const camera = raycaster.camera;
2448
+ if ( camera === null && ! worldUnits ) {
2449
+
2450
+ console.error( 'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.' );
2451
+
2452
+ }
2453
+
2454
+ const threshold = raycaster.params.Line2 !== undefined ? raycaster.params.Line2.threshold || 0 : 0;
2455
+ _ray = raycaster.ray;
2456
+ const matrixWorld = this.matrixWorld;
2457
+ const geometry = this.geometry;
2458
+ const material = this.material;
2459
+ _lineWidth = material.linewidth + threshold;
2460
+ _instanceStart = geometry.attributes.instanceStart;
2461
+ _instanceEnd = geometry.attributes.instanceEnd;
2462
+
2463
+ // check if we intersect the sphere bounds
2464
+ if ( geometry.boundingSphere === null ) {
2465
+
2466
+ geometry.computeBoundingSphere();
2467
+
2468
+ }
2469
+
2470
+ _sphere.copy( geometry.boundingSphere ).applyMatrix4( matrixWorld );
2471
+
2472
+ // increase the sphere bounds by the worst case line screen space width
2473
+ let sphereMargin;
2474
+ if ( worldUnits ) {
2475
+
2476
+ sphereMargin = _lineWidth * 0.5;
2477
+
2478
+ } else {
2479
+
2480
+ const distanceToSphere = Math.max( camera.near, _sphere.distanceToPoint( _ray.origin ) );
2481
+ sphereMargin = getWorldSpaceHalfWidth( camera, distanceToSphere, material.resolution );
2482
+
2483
+ }
2484
+
2485
+ _sphere.radius += sphereMargin;
2486
+ if ( _ray.intersectsSphere( _sphere ) === false ) {
2487
+
2488
+ return;
2489
+
2490
+ }
2491
+
2492
+ // check if we intersect the box bounds
2493
+ if ( geometry.boundingBox === null ) {
2494
+
2495
+ geometry.computeBoundingBox();
2496
+
2497
+ }
2498
+
2499
+ _box.copy( geometry.boundingBox ).applyMatrix4( matrixWorld );
2500
+
2501
+ // increase the box bounds by the worst case line width
2502
+ let boxMargin;
2503
+ if ( worldUnits ) {
2504
+
2505
+ boxMargin = _lineWidth * 0.5;
2506
+
2507
+ } else {
2508
+
2509
+ const distanceToBox = Math.max( camera.near, _box.distanceToPoint( _ray.origin ) );
2510
+ boxMargin = getWorldSpaceHalfWidth( camera, distanceToBox, material.resolution );
2511
+
2512
+ }
2513
+
2514
+ _box.expandByScalar( boxMargin );
2515
+ if ( _ray.intersectsBox( _box ) === false ) {
2516
+
2517
+ return;
2518
+
2519
+ }
2520
+
2521
+ if ( worldUnits ) {
2522
+
2523
+ raycastWorldUnits( this, intersects );
2524
+
2525
+ } else {
2526
+
2527
+ raycastScreenSpace( this, camera, intersects );
2528
+
2529
+ }
2530
+
2531
+ }
2532
+
2533
+ }
2534
+
2535
+ THREE.LineSegments2 = LineSegments2;
2536
+
2537
+ } )();
2538
+
2539
+ </script><script>
2540
+ (async function () {
2541
+
2542
+ var FontLoader = THREE.FontLoader;
2543
+ var EffectComposer = THREE.EffectComposer;
2544
+ var RenderPass = THREE.RenderPass;
2545
+ var ShaderPass = THREE.ShaderPass;
2546
+ var OutputPass = THREE.OutputPass;
2547
+ var LineSegments2 = THREE.LineSegments2;
2548
+ var LineSegmentsGeometry = THREE.LineSegmentsGeometry;
2549
+ var LineMaterial = THREE.LineMaterial;
2550
+
2551
+ function mulberry32(a) {
2552
+ return function () {
2553
+ a |= 0;
2554
+ a = (a + 0x6d2b79f5) | 0;
2555
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
2556
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
2557
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
2558
+ };
2559
+ }
2560
+ const rand = mulberry32(20260824);
2561
+ const phraseRand = mulberry32(20260831);
2562
+
2563
+ // ---------- params (preset 31 defaults from the experiment config) ----------
2564
+ const P = {
2565
+ gridLineColor: "#ffffff",
2566
+ gridSpacing: 29,
2567
+ gridSize: 500,
2568
+ gridOpacity: 0.15,
2569
+ gridFadeStart: 1,
2570
+ gridFadeEnd: 175,
2571
+ gridOffsetX: -14.5,
2572
+ gridGlowSpeed: 8.7,
2573
+ gridGlowIntensity: 1.3,
2574
+ textDepthMin: 0.28,
2575
+ textDepthMax: 2,
2576
+ letterZSpread: 4, // experiment: 9 — tightened so perspective shifts don't split the word or crop the frame
2577
+ outlineColor: "#ffffff",
2578
+ outlineWidth: 1.5,
2579
+ starburstPoints: 24,
2580
+ portalChromatic: 0,
2581
+ portalEdgeBlur: 0.15,
2582
+ portalIrregularity: window.__wptBurstChaos !== undefined ? window.__wptBurstChaos : 1,
2583
+ portalStartColor: "#e8e8e8",
2584
+ portalScale: 0.8,
2585
+ portalColorSpeed: 1.7,
2586
+ warpDotCount: 1000,
2587
+ warpDotSize: 2,
2588
+ warpDotOpacity: 0.7,
2589
+ warpDotColor: "#888888",
2590
+ transChromatic: 0.01,
2591
+ transZoomBlur: 3.2,
2592
+ transDistortion: 0.05,
2593
+ transBrightness: 1.6,
2594
+ transContrast: 1.25,
2595
+ transSaturation: 0,
2596
+ cameraDistance: 22,
2597
+ initialFOV: 100,
2598
+ cameraDistance3D: 66, // pulled back from the experiment's 48.5 so the full word composes in-frame at 1920x1080
2599
+ finalFOV: 72,
2600
+ contentZOffset: 30,
2601
+ vignetteIntensity: 1.7,
2602
+ chromaticAberration: 0.006,
2603
+ scanlineIntensity: 0.25,
2604
+ edgeBlur: 50,
2605
+ edgeBlurSpread: 0.15,
2606
+ glitchPower: 0.2,
2607
+ glitchSpeed: 3,
2608
+ glitchBlockSize: 15,
2609
+ glitchColorRate: 0.009,
2610
+ ambientIntensity: 0.5,
2611
+ keyLightIntensity: 4.25,
2612
+ keyLightX: 2,
2613
+ keyLightY: -2.5,
2614
+ keyLightZ: 4.5,
2615
+ bgColor: "#000000",
2616
+ };
2617
+ const W = 1920;
2618
+ const H = 1080;
2619
+ const ACCENT = window.__wptAccent || "#F5C518";
2620
+
2621
+ // ---------- shaders (ported verbatim from the experiment) ----------
2622
+ const PortalCompositeShader = {
2623
+ uniforms: {
2624
+ tDiffuse: { value: null },
2625
+ uPortalRadius: { value: 0.0 },
2626
+ uPortalCenter: { value: new THREE.Vector2(0.5, 0.5) },
2627
+ uStarburstPoints: { value: P.starburstPoints },
2628
+ uChromaticStrength: { value: P.portalChromatic },
2629
+ uEdgeBlur: { value: P.portalEdgeBlur },
2630
+ uIrregularity: { value: P.portalIrregularity },
2631
+ uStartColor: { value: new THREE.Color(P.portalStartColor) },
2632
+ uPortalProgress: { value: 0.0 },
2633
+ uTime: { value: 0 },
2634
+ uOuterBlur: { value: 0.0 },
2635
+ },
2636
+ vertexShader: `
2637
+ varying vec2 vUv;
2638
+ void main() {
2639
+ vUv = uv;
2640
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
2641
+ }
2642
+ `,
2643
+ fragmentShader: `
2644
+ uniform sampler2D tDiffuse;
2645
+ uniform float uPortalRadius;
2646
+ uniform vec2 uPortalCenter;
2647
+ uniform int uStarburstPoints;
2648
+ uniform float uChromaticStrength;
2649
+ uniform float uEdgeBlur;
2650
+ uniform float uIrregularity;
2651
+ uniform vec3 uStartColor;
2652
+ uniform float uPortalProgress;
2653
+ uniform float uTime;
2654
+ uniform float uOuterBlur;
2655
+ varying vec2 vUv;
2656
+
2657
+ float hash(float n) { return fract(sin(n) * 43758.5453); }
2658
+
2659
+ void main() {
2660
+ vec2 uv = vUv;
2661
+ vec2 center = uPortalCenter;
2662
+ vec2 delta = uv - center;
2663
+ float dist = length(delta);
2664
+ float angle = atan(delta.y, delta.x);
2665
+
2666
+ float points = float(uStarburstPoints);
2667
+ float spikeLength = 0.2 * uPortalRadius;
2668
+ float valleyDepth = 0.08 * uPortalRadius;
2669
+ float baseR = uPortalRadius - valleyDepth;
2670
+
2671
+ float seed = floor(uTime * 0.4) * 7.13;
2672
+
2673
+ // Low-frequency undulation: the base ellipse itself wobbles.
2674
+ float wob = sin(angle * 2.0 + seed * 1.7)
2675
+ * 0.45 + sin(angle * 3.0 - seed * 2.3 + 1.9) * 0.33
2676
+ + sin(angle * 5.0 + seed * 0.9 + 4.2) * 0.22;
2677
+ baseR *= 1.0 + wob * 0.16 * uIrregularity;
2678
+
2679
+ // Warp the angle before segmenting: spikes cluster and gap
2680
+ // instead of sitting on an even sunburst lattice.
2681
+ float aw = angle
2682
+ + (sin(angle * 3.0 + seed + 0.7) * 0.55
2683
+ + sin(angle * 5.0 - seed * 1.3 + 2.3) * 0.35)
2684
+ * 0.45 * uIrregularity;
2685
+
2686
+ float segAngle = 6.28318 / points;
2687
+ float localAngle = mod(aw + 3.14159, segAngle);
2688
+ float segIndex = floor((aw + 3.14159) / segAngle);
2689
+
2690
+ float t = localAngle / segAngle;
2691
+
2692
+ // Per-spike character: off-centre tips, fat-to-needle sharpness,
2693
+ // broad length spread with occasional dominant spikes.
2694
+ float h1 = hash(segIndex * 17.3 + seed);
2695
+ float h2 = hash(segIndex * 31.7 + seed + 5.1);
2696
+ float h3 = hash(segIndex * 47.9 + seed + 9.7);
2697
+ float tip = mix(0.5, mix(0.2, 0.8, h2), min(uIrregularity, 1.0));
2698
+ float spike = t < tip ? t / max(tip, 1e-3)
2699
+ : (1.0 - t) / max(1.0 - tip, 1e-3);
2700
+ spike = pow(clamp(spike, 0.0, 1.0),
2701
+ mix(1.0, mix(0.55, 3.2, h3), min(uIrregularity, 1.0)));
2702
+ float lenVar = mix(0.35, 1.15, h1) + pow(h2, 6.0) * 1.8;
2703
+ float spikeScale = mix(1.0, lenVar, min(uIrregularity, 1.5));
2704
+
2705
+ float thisSpike = spike * spikeLength * spikeScale;
2706
+ float starShape = baseR + thisSpike;
2707
+
2708
+ float feather = max(0.002, uEdgeBlur);
2709
+ float mask = smoothstep(starShape + feather, starShape - feather, dist);
2710
+
2711
+ if (mask < 0.001) {
2712
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
2713
+ return;
2714
+ }
2715
+
2716
+ float edgeDist = abs(dist - starShape);
2717
+ float edgeFactor = smoothstep(feather * 3.0, 0.0, edgeDist) * uChromaticStrength;
2718
+ vec2 chrDir = normalize(delta + 0.001) * edgeFactor;
2719
+
2720
+ float r = texture2D(tDiffuse, uv + chrDir).r;
2721
+ float g = texture2D(tDiffuse, uv).g;
2722
+ float b = texture2D(tDiffuse, uv - chrDir).b;
2723
+ vec3 sceneColor = vec3(r, g, b);
2724
+
2725
+ gl_FragColor = vec4(sceneColor, mask);
2726
+ }
2727
+ `,
2728
+ };
2729
+
2730
+ const TransitionFXShader = {
2731
+ uniforms: {
2732
+ tDiffuse: { value: null },
2733
+ uTransAmount: { value: 0.0 },
2734
+ uChromatic: { value: P.transChromatic },
2735
+ uZoomBlur: { value: P.transZoomBlur },
2736
+ uDistortion: { value: P.transDistortion },
2737
+ uBrightness: { value: P.transBrightness },
2738
+ uContrast: { value: P.transContrast },
2739
+ uSaturation: { value: P.transSaturation },
2740
+ },
2741
+ vertexShader: `
2742
+ varying vec2 vUv;
2743
+ void main() {
2744
+ vUv = uv;
2745
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
2746
+ }
2747
+ `,
2748
+ fragmentShader: `
2749
+ uniform sampler2D tDiffuse;
2750
+ uniform float uTransAmount;
2751
+ uniform float uChromatic;
2752
+ uniform float uZoomBlur;
2753
+ uniform float uDistortion;
2754
+ uniform float uBrightness;
2755
+ uniform float uContrast;
2756
+ uniform float uSaturation;
2757
+ varying vec2 vUv;
2758
+
2759
+ void main() {
2760
+ if (uTransAmount < 0.001) {
2761
+ gl_FragColor = texture2D(tDiffuse, vUv);
2762
+ return;
2763
+ }
2764
+
2765
+ vec2 uv = vUv;
2766
+ vec2 center = uv - 0.5;
2767
+ float dist = length(center);
2768
+
2769
+ vec2 distortedUV = uv + center * dist * dist * uDistortion * uTransAmount;
2770
+ distortedUV = clamp(distortedUV, 0.0, 1.0);
2771
+
2772
+ vec3 color = vec3(0.0);
2773
+ float totalWeight = 0.0;
2774
+ float blurAmount = uZoomBlur * uTransAmount * 0.1;
2775
+ for (int i = 0; i < 10; i++) {
2776
+ float t = float(i) / 9.0;
2777
+ float weight = 1.0 - t * 0.6;
2778
+ vec2 sampleUV = clamp(distortedUV + center * blurAmount * t, 0.0, 1.0);
2779
+ color += texture2D(tDiffuse, sampleUV).rgb * weight;
2780
+ totalWeight += weight;
2781
+ }
2782
+ color /= totalWeight;
2783
+
2784
+ float caAmount = uChromatic * uTransAmount;
2785
+ vec2 caDir = normalize(center + 0.001) * caAmount;
2786
+ color.r = mix(color.r, texture2D(tDiffuse, clamp(distortedUV + caDir, 0.0, 1.0)).r, uTransAmount);
2787
+ color.b = mix(color.b, texture2D(tDiffuse, clamp(distortedUV - caDir, 0.0, 1.0)).b, uTransAmount);
2788
+
2789
+ float brightness = mix(1.0, uBrightness, uTransAmount);
2790
+ color *= brightness;
2791
+
2792
+ float contrast = mix(1.0, uContrast, uTransAmount);
2793
+ color = (color - 0.5) * contrast + 0.5;
2794
+
2795
+ float saturation = mix(1.0, uSaturation, uTransAmount);
2796
+ float lum = dot(color, vec3(0.299, 0.587, 0.114));
2797
+ color = mix(vec3(lum), color, saturation);
2798
+
2799
+ gl_FragColor = vec4(clamp(color, 0.0, 1.0), texture2D(tDiffuse, uv).a);
2800
+ }
2801
+ `,
2802
+ };
2803
+
2804
+ const GlitchShader = {
2805
+ uniforms: {
2806
+ tDiffuse: { value: null },
2807
+ uTime: { value: 0 },
2808
+ uShakePower: { value: 0.0 },
2809
+ uShakeRate: { value: 0.0 },
2810
+ uShakeSpeed: { value: P.glitchSpeed },
2811
+ uShakeBlockSize: { value: P.glitchBlockSize },
2812
+ uShakeColorRate: { value: 0.0 },
2813
+ },
2814
+ vertexShader: `
2815
+ varying vec2 vUv;
2816
+ void main() {
2817
+ vUv = uv;
2818
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
2819
+ }
2820
+ `,
2821
+ fragmentShader: `
2822
+ uniform sampler2D tDiffuse;
2823
+ uniform float uTime;
2824
+ uniform float uShakePower;
2825
+ uniform float uShakeRate;
2826
+ uniform float uShakeSpeed;
2827
+ uniform float uShakeBlockSize;
2828
+ uniform float uShakeColorRate;
2829
+ varying vec2 vUv;
2830
+
2831
+ float random(float seed) {
2832
+ return fract(543.2543 * sin(dot(vec2(seed, seed), vec2(3525.46, -54.3415))));
2833
+ }
2834
+
2835
+ void main() {
2836
+ float enable_shift = float(
2837
+ random(trunc(uTime * uShakeSpeed)) < uShakeRate
2838
+ );
2839
+
2840
+ vec2 fixed_uv = vUv;
2841
+ fixed_uv.x += (
2842
+ random(
2843
+ (trunc(vUv.y * uShakeBlockSize) / uShakeBlockSize) + uTime
2844
+ ) - 0.5
2845
+ ) * uShakePower * enable_shift;
2846
+
2847
+ vec4 pixel_color = texture2D(tDiffuse, fixed_uv);
2848
+ pixel_color.r = mix(
2849
+ pixel_color.r,
2850
+ texture2D(tDiffuse, fixed_uv + vec2(uShakeColorRate, 0.0)).r,
2851
+ enable_shift
2852
+ );
2853
+ pixel_color.b = mix(
2854
+ pixel_color.b,
2855
+ texture2D(tDiffuse, fixed_uv + vec2(-uShakeColorRate, 0.0)).b,
2856
+ enable_shift
2857
+ );
2858
+
2859
+ gl_FragColor = pixel_color;
2860
+ }
2861
+ `,
2862
+ };
2863
+
2864
+ const EdgeBlurShader = {
2865
+ uniforms: {
2866
+ tDiffuse: { value: null },
2867
+ uDirection: { value: new THREE.Vector2(1, 0) },
2868
+ uBlurAmount: { value: 0.0 },
2869
+ uSpread: { value: P.edgeBlurSpread },
2870
+ uResolution: { value: new THREE.Vector2(W, H) },
2871
+ },
2872
+ vertexShader: `
2873
+ varying vec2 vUv;
2874
+ void main() {
2875
+ vUv = uv;
2876
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
2877
+ }
2878
+ `,
2879
+ fragmentShader: `
2880
+ uniform sampler2D tDiffuse;
2881
+ uniform vec2 uDirection;
2882
+ uniform float uBlurAmount;
2883
+ uniform float uSpread;
2884
+ uniform vec2 uResolution;
2885
+ varying vec2 vUv;
2886
+
2887
+ void main() {
2888
+ vec2 center = vUv - 0.5;
2889
+ float dist = length(center);
2890
+ float blurStart = (1.0 - uSpread) * 0.5;
2891
+ float edgeFactor = smoothstep(blurStart, blurStart + 0.3, dist);
2892
+ float radius = edgeFactor * uBlurAmount;
2893
+
2894
+ if (radius < 0.5) {
2895
+ gl_FragColor = texture2D(tDiffuse, vUv);
2896
+ return;
2897
+ }
2898
+
2899
+ vec2 texelSize = 1.0 / uResolution;
2900
+ vec2 step = uDirection * texelSize * radius;
2901
+
2902
+ vec4 result = vec4(0.0);
2903
+ result += texture2D(tDiffuse, vUv - step * 6.0) * 0.002;
2904
+ result += texture2D(tDiffuse, vUv - step * 5.0) * 0.009;
2905
+ result += texture2D(tDiffuse, vUv - step * 4.0) * 0.028;
2906
+ result += texture2D(tDiffuse, vUv - step * 3.0) * 0.066;
2907
+ result += texture2D(tDiffuse, vUv - step * 2.0) * 0.121;
2908
+ result += texture2D(tDiffuse, vUv - step * 1.0) * 0.175;
2909
+ result += texture2D(tDiffuse, vUv) * 0.198;
2910
+ result += texture2D(tDiffuse, vUv + step * 1.0) * 0.175;
2911
+ result += texture2D(tDiffuse, vUv + step * 2.0) * 0.121;
2912
+ result += texture2D(tDiffuse, vUv + step * 3.0) * 0.066;
2913
+ result += texture2D(tDiffuse, vUv + step * 4.0) * 0.028;
2914
+ result += texture2D(tDiffuse, vUv + step * 5.0) * 0.009;
2915
+ result += texture2D(tDiffuse, vUv + step * 6.0) * 0.002;
2916
+
2917
+ gl_FragColor = result;
2918
+ }
2919
+ `,
2920
+ };
2921
+
2922
+ const PostFXShader = {
2923
+ uniforms: {
2924
+ tDiffuse: { value: null },
2925
+ uVignetteIntensity: { value: 0.0 },
2926
+ uChromaticAberration: { value: 0.0 },
2927
+ uScanlineIntensity: { value: 0.0 },
2928
+ uTime: { value: 0.0 },
2929
+ },
2930
+ vertexShader: `
2931
+ varying vec2 vUv;
2932
+ void main() {
2933
+ vUv = uv;
2934
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
2935
+ }
2936
+ `,
2937
+ fragmentShader: `
2938
+ uniform sampler2D tDiffuse;
2939
+ uniform float uVignetteIntensity;
2940
+ uniform float uChromaticAberration;
2941
+ uniform float uScanlineIntensity;
2942
+ uniform float uTime;
2943
+ varying vec2 vUv;
2944
+
2945
+ void main() {
2946
+ vec2 uv = vUv;
2947
+ vec2 center = uv - 0.5;
2948
+ float dist = length(center);
2949
+ float dist2 = dot(center, center);
2950
+
2951
+ float edgeFactor = smoothstep(0.2, 0.6, dist);
2952
+ float caStrength = uChromaticAberration * edgeFactor;
2953
+ vec2 caDir = normalize(center + 0.001) * caStrength;
2954
+ vec3 color;
2955
+ color.r = texture2D(tDiffuse, clamp(uv + caDir, 0.0, 1.0)).r;
2956
+ color.g = texture2D(tDiffuse, uv).g;
2957
+ color.b = texture2D(tDiffuse, clamp(uv - caDir, 0.0, 1.0)).b;
2958
+
2959
+ float scanline = sin(uv.y * 800.0 + uTime * 2.0) * 0.5 + 0.5;
2960
+ scanline = pow(scanline, 8.0) * uScanlineIntensity;
2961
+ color -= scanline * 0.08;
2962
+ float noiseLine = fract(sin(floor(uv.y * 400.0 + uTime * 5.0) * 43758.5453)) * uScanlineIntensity * 0.03;
2963
+ color += noiseLine;
2964
+
2965
+ float vignette = 1.0 - dist2 * uVignetteIntensity;
2966
+ vignette = smoothstep(0.0, 0.5, clamp(vignette, 0.0, 1.0));
2967
+ color *= vignette;
2968
+
2969
+ gl_FragColor = vec4(color, texture2D(tDiffuse, uv).a);
2970
+ }
2971
+ `,
2972
+ };
2973
+
2974
+ const GridLineShader = {
2975
+ uniforms: {
2976
+ uColor: { value: new THREE.Color(P.gridLineColor) },
2977
+ uOpacity: { value: P.gridOpacity },
2978
+ uFadeStart: { value: P.gridFadeStart },
2979
+ uFadeEnd: { value: P.gridFadeEnd },
2980
+ uCameraPos: { value: new THREE.Vector3() },
2981
+ uTime: { value: 0.0 },
2982
+ uGlowSpeed: { value: P.gridGlowSpeed },
2983
+ uGlowIntensity: { value: P.gridGlowIntensity },
2984
+ },
2985
+ vertexShader: `
2986
+ varying vec3 vWorldPos;
2987
+ void main() {
2988
+ vec4 worldPos = modelMatrix * vec4(position, 1.0);
2989
+ vWorldPos = worldPos.xyz;
2990
+ gl_Position = projectionMatrix * viewMatrix * worldPos;
2991
+ }
2992
+ `,
2993
+ fragmentShader: `
2994
+ uniform vec3 uColor;
2995
+ uniform float uOpacity;
2996
+ uniform float uFadeStart;
2997
+ uniform float uFadeEnd;
2998
+ uniform vec3 uCameraPos;
2999
+ uniform float uTime;
3000
+ uniform float uGlowSpeed;
3001
+ uniform float uGlowIntensity;
3002
+ varying vec3 vWorldPos;
3003
+
3004
+ float hash(float n) { return fract(sin(n) * 43758.5453); }
3005
+
3006
+ void main() {
3007
+ float dist = distance(vWorldPos, uCameraPos);
3008
+ float fade = 1.0 - smoothstep(uFadeStart, uFadeEnd, dist);
3009
+ if (fade < 0.01) discard;
3010
+
3011
+ float dotGlow = 0.0;
3012
+ float dotRadius = 0.4;
3013
+
3014
+ for (int d = 0; d < 5; d++) {
3015
+ float di = float(d);
3016
+ float seedX = hash(floor(vWorldPos.y * 10.0) * 137.0 + floor(vWorldPos.z * 10.0) * 311.0 + di * 73.0);
3017
+ float dotPosX = mod(uTime * uGlowSpeed * (0.5 + seedX * 2.0) + seedX * 200.0, 300.0) - 150.0;
3018
+ dotGlow += exp(-pow((vWorldPos.x - dotPosX) / dotRadius, 2.0)) * 0.5;
3019
+
3020
+ float seedY = hash(floor(vWorldPos.x * 10.0) * 173.0 + floor(vWorldPos.z * 10.0) * 271.0 + di * 91.0);
3021
+ float dotPosY = mod(uTime * uGlowSpeed * (0.5 + seedY * 2.0) + seedY * 200.0, 300.0) - 150.0;
3022
+ dotGlow += exp(-pow((vWorldPos.y - dotPosY) / dotRadius, 2.0)) * 0.5;
3023
+
3024
+ float seedZ = hash(floor(vWorldPos.x * 10.0) * 251.0 + floor(vWorldPos.y * 10.0) * 197.0 + di * 59.0);
3025
+ float dotPosZ = mod(uTime * uGlowSpeed * (0.5 + seedZ * 2.0) + seedZ * 200.0, 300.0) - 150.0;
3026
+ dotGlow += exp(-pow((vWorldPos.z - dotPosZ) / dotRadius, 2.0)) * 0.5;
3027
+ }
3028
+
3029
+ dotGlow *= uGlowIntensity;
3030
+
3031
+ float finalAlpha = (uOpacity + dotGlow) * fade;
3032
+ vec3 finalColor = uColor * (1.0 + dotGlow * 3.0);
3033
+
3034
+ gl_FragColor = vec4(finalColor, min(finalAlpha, 1.0));
3035
+ }
3036
+ `,
3037
+ };
3038
+
3039
+ // ---------- font: local Geist Bold TTF -> three Font (blocks the load event) ----------
3040
+ // Beside this file when mounted; a runtime without assetUrl keeps the plain path.
3041
+ const assetUrl = (path) =>
3042
+ path;
3043
+ const font = new FontLoader().parse({"glyphs":{"0":{"ha":971,"x_min":65,"x_max":906,"o":"m 486 -22 q 261 40 356 -22 q 116 217 167 101 q 65 492 65 332 q 117 767 65 651 q 262 946 168 883 q 486 1008 356 1008 q 709 946 615 1008 q 854 767 803 883 q 906 492 906 651 q 855 218 906 333 q 710 40 804 103 q 486 -22 615 -22 m 486 156 q 635 240 583 156 q 688 492 688 325 q 665 679 688 604 q 597 792 642 754 q 486 831 551 831 q 374 792 419 831 q 306 679 329 754 q 283 492 283 604 q 335 240 283 325 q 486 156 388 156"},"1":{"ha":624,"x_min":53,"x_max":478,"o":"m 267 0 l 267 649 l 53 649 l 53 803 l 138 803 q 237 820 199 803 q 292 877 275 838 q 310 986 310 917 l 478 986 l 478 0"},"2":{"ha":907,"x_min":81,"x_max":828,"o":"m 81 0 q 115 219 81 126 q 226 386 149 312 q 431 526 303 460 q 538 588 499 561 q 594 643 578 615 q 611 708 611 671 q 595 772 611 744 q 549 815 579 799 q 472 831 518 831 q 353 787 397 831 q 299 660 310 743 l 82 672 q 197 919 96 829 q 469 1008 297 1008 q 663 971 583 1008 q 785 867 743 933 q 828 711 828 800 q 802 581 828 633 q 719 483 776 528 q 569 389 662 439 q 393 272 450 325 q 332 178 336 218 l 828 178 l 828 0"},"3":{"ha":903,"x_min":61,"x_max":842,"o":"m 450 -22 q 167 62 267 -22 q 61 289 68 146 l 276 297 q 328 190 283 224 q 450 156 374 156 q 539 170 500 156 q 601 215 578 185 q 624 292 624 246 q 575 398 624 362 q 443 433 526 433 l 356 433 l 356 590 l 443 590 q 549 617 507 590 q 592 710 592 644 q 557 798 592 765 q 447 831 522 831 q 335 800 372 831 q 289 721 297 769 l 76 732 q 187 933 90 857 q 447 1008 283 1008 q 644 975 564 1008 q 767 879 725 942 q 808 732 808 817 q 751 588 808 644 q 585 510 693 531 l 585 533 q 775 449 708 515 q 842 276 842 382 q 793 116 842 183 q 657 13 744 49 q 450 -22 569 -22"},"4":{"ha":911,"x_min":33,"x_max":850,"o":"m 524 0 l 524 188 l 33 188 l 33 356 l 483 986 l 735 986 l 735 365 l 850 365 l 850 188 l 735 188 l 735 0 m 257 365 l 524 365 l 524 726"},"5":{"ha":932,"x_min":78,"x_max":854,"o":"m 464 -22 q 260 14 343 -22 q 131 117 176 50 q 78 272 85 183 l 292 282 q 348 187 304 218 q 464 156 392 156 q 591 201 544 156 q 638 328 638 247 q 616 419 638 381 q 556 481 594 458 q 462 503 517 503 q 360 476 403 503 q 300 410 317 450 l 89 410 l 157 986 l 786 986 l 786 808 l 336 808 l 300 521 l 276 542 q 335 603 300 578 q 418 644 371 629 q 522 658 465 658 q 699 615 625 658 q 814 497 774 572 q 854 328 854 422 q 806 142 854 221 q 669 20 757 62 q 464 -22 582 -22"},"6":{"ha":918,"x_min":78,"x_max":839,"o":"m 461 -22 q 249 32 335 -22 q 121 188 164 86 q 78 435 78 290 q 103 663 78 558 q 178 845 128 768 q 308 965 229 922 q 494 1008 388 1008 q 723 939 639 1008 q 835 750 807 869 l 639 736 q 590 808 622 782 q 494 835 558 835 q 342 750 397 835 q 279 489 286 665 l 250 494 q 299 569 265 535 q 384 626 332 604 q 506 647 436 647 q 681 607 606 647 q 798 494 757 567 q 839 325 839 422 q 792 137 839 214 q 660 19 744 60 q 461 -22 575 -22 m 460 146 q 583 194 536 146 q 629 322 629 242 q 609 414 629 375 q 552 475 589 453 q 467 497 515 497 q 375 475 415 497 q 312 414 335 453 q 290 322 290 375 q 311 231 290 271 q 370 168 332 190 q 460 146 408 146"},"7":{"ha":756,"x_min":28,"x_max":756,"o":"m 228 0 q 267 296 228 153 q 376 568 306 439 q 542 808 447 697 l 28 808 l 28 986 l 756 986 l 756 821 q 583 581 653 704 q 477 317 512 458 q 442 0 442 175"},"8":{"ha":928,"x_min":50,"x_max":878,"o":"m 464 -22 q 244 10 338 -22 q 101 108 151 43 q 50 268 50 174 q 119 451 50 379 q 304 542 189 522 l 307 514 q 154 590 211 532 q 97 738 97 649 q 140 879 97 818 q 265 974 183 940 q 464 1008 346 1008 q 662 974 581 1008 q 787 879 744 940 q 829 738 829 818 q 773 591 829 649 q 619 514 717 533 l 622 542 q 808 450 739 521 q 878 268 878 379 q 827 108 878 174 q 683 10 776 43 q 464 -22 590 -22 m 464 156 q 606 194 553 156 q 660 300 660 232 q 609 409 660 368 q 464 450 558 450 q 318 409 369 450 q 267 300 267 368 q 321 194 267 232 q 464 156 375 156 m 464 599 q 574 627 535 599 q 614 715 614 656 q 576 800 614 768 q 464 832 538 832 q 351 800 390 832 q 312 715 312 768 q 353 627 312 656 q 464 599 393 599"},"9":{"ha":924,"x_min":78,"x_max":846,"o":"m 436 -22 q 215 41 300 -22 q 94 222 131 104 l 297 235 q 347 173 312 194 q 436 151 382 151 q 590 228 540 151 q 639 482 639 304 l 667 469 q 565 358 629 396 q 406 321 500 321 q 235 362 308 321 q 119 478 161 403 q 78 651 78 553 q 124 841 78 761 q 253 965 169 921 q 447 1008 336 1008 q 670 952 582 1008 q 802 789 758 896 q 846 528 846 682 q 821 297 846 399 q 747 124 796 194 q 620 15 697 53 q 436 -22 543 -22 m 451 472 q 542 494 504 472 q 601 557 581 517 q 622 654 622 597 q 602 752 622 710 q 544 817 582 794 q 454 840 507 840 q 367 817 404 840 q 309 753 329 794 q 289 656 289 711 q 310 558 289 599 q 367 495 331 518 q 451 472 403 472"}," ":{"ha":317,"x_min":0,"x_max":0,"o":""},"!":{"ha":357,"x_min":65,"x_max":292,"o":"m 111 315 q 96 429 104 362 q 82 565 88 496 q 76 689 76 633 l 76 986 l 286 986 l 286 689 q 281 565 286 633 q 267 429 275 496 q 253 315 260 362 m 65 0 l 65 212 l 292 212 l 292 0"},"\"":{"ha":542,"x_min":58,"x_max":483,"o":"m 88 599 l 58 869 l 58 986 l 224 986 l 214 599 m 328 599 l 318 986 l 483 986 l 483 869 l 454 599"},"#":{"ha":818,"x_min":4,"x_max":810,"o":"m 403 0 l 554 986 l 744 986 l 593 0 m 4 226 l 28 393 l 758 393 l 735 226 m 69 0 l 222 986 l 412 986 l 260 0 m 57 585 l 81 750 l 810 750 l 786 585"},"$":{"ha":931,"x_min":72,"x_max":858,"o":"m 415 -125 l 415 1111 l 529 1111 l 529 -125 m 485 -15 q 270 27 360 -15 q 130 146 181 69 q 72 324 79 222 l 281 335 q 314 238 289 278 q 381 177 339 197 q 488 157 424 157 q 575 169 539 157 q 630 206 611 181 q 649 268 649 231 q 633 327 649 301 q 570 374 617 353 q 433 415 524 396 q 235 478 310 443 q 126 568 160 514 q 92 704 92 622 q 135 856 92 790 q 259 958 178 921 q 453 994 340 994 q 656 953 572 994 q 785 838 739 911 q 843 667 832 764 l 636 658 q 608 744 631 707 q 545 803 585 782 q 450 824 506 824 q 340 792 381 824 q 300 711 300 761 q 317 651 300 675 q 378 609 335 626 q 500 575 422 592 q 713 507 635 549 q 825 408 792 465 q 858 278 858 351 q 812 122 858 188 q 683 20 767 56 q 485 -15 599 -15"},"%":{"ha":1146,"x_min":51,"x_max":1096,"o":"m 282 508 q 117 569 182 508 q 51 753 51 629 q 117 938 51 878 q 282 997 182 997 q 447 938 382 997 q 511 753 511 878 q 447 569 511 629 q 282 508 382 508 m 282 614 q 349 649 326 614 q 371 753 371 683 q 349 857 371 822 q 282 892 326 892 q 216 857 239 892 q 193 753 193 822 q 216 649 193 683 q 282 614 239 614 m 865 -11 q 700 49 765 -11 q 635 233 635 110 q 700 418 635 358 q 865 478 765 478 q 1031 418 965 478 q 1096 233 1096 358 q 1031 49 1096 110 q 865 -11 965 -11 m 865 94 q 932 129 910 94 q 954 233 954 164 q 932 338 954 303 q 865 372 910 372 q 799 338 822 372 q 776 233 776 303 q 799 129 776 164 q 865 94 822 94 m 182 0 l 838 986 l 965 986 l 310 0"},"&":{"ha":985,"x_min":50,"x_max":964,"o":"m 403 -22 q 140 47 231 -22 q 50 243 50 115 q 70 357 50 307 q 136 451 90 407 q 256 540 182 496 q 201 609 224 575 q 165 678 178 643 q 153 757 153 714 q 230 940 153 872 q 451 1008 307 1008 q 617 978 550 1008 q 717 894 683 947 q 750 772 750 840 q 698 624 750 685 q 538 503 646 564 l 693 308 q 729 456 728 360 l 940 435 q 906 282 935 356 q 829 156 876 208 l 964 0 l 718 0 l 682 43 q 565 -4 638 14 q 403 -22 492 -22 m 419 158 q 497 168 465 158 q 546 192 528 178 l 365 414 q 290 346 314 381 q 267 267 267 311 q 306 188 267 218 q 419 158 346 158 m 431 625 q 491 666 468 646 q 525 707 514 686 q 536 754 536 728 q 515 810 536 790 q 456 831 493 831 q 391 808 414 831 q 368 749 368 786 q 374 710 368 729 q 394 671 379 692 q 431 625 408 650"},"'":{"ha":282,"x_min":58,"x_max":224,"o":"m 79 599 l 58 869 l 58 986 l 224 986 l 224 869 l 203 599"},"(":{"ha":449,"x_min":58,"x_max":432,"o":"m 246 -153 q 58 444 58 143 q 246 1042 58 747 l 432 1042 q 264 444 264 743 q 306 147 264 296 q 432 -153 349 -3"},")":{"ha":449,"x_min":17,"x_max":390,"o":"m 201 -153 l 17 -153 q 143 147 101 -3 q 185 444 185 296 q 17 1042 185 743 l 201 1042 q 390 444 390 747 q 201 -153 390 143"},"*":{"ha":586,"x_min":51,"x_max":535,"o":"m 222 504 l 114 567 l 193 688 l 51 685 l 51 824 l 193 822 l 114 943 l 222 1004 l 293 879 l 365 1004 l 474 943 l 393 822 l 535 824 l 535 685 l 393 688 l 474 567 l 365 504 l 293 631"},"+":{"ha":792,"x_min":56,"x_max":736,"o":"m 311 58 l 311 739 l 481 739 l 481 58 m 56 314 l 56 482 l 736 482 l 736 314"},",":{"ha":328,"x_min":51,"x_max":278,"o":"m 67 -219 l 142 0 l 51 0 l 51 212 l 278 212 l 278 22 l 181 -219"},"-":{"ha":579,"x_min":51,"x_max":528,"o":"m 51 319 l 51 490 l 528 490 l 528 319"},".":{"ha":328,"x_min":51,"x_max":278,"o":"m 51 0 l 51 212 l 278 212 l 278 0"},"/":{"ha":725,"x_min":44,"x_max":661,"o":"m 44 -153 l 456 1042 l 661 1042 l 250 -153"},":":{"ha":432,"x_min":103,"x_max":329,"o":"m 103 0 l 103 212 l 329 212 l 329 0 m 103 494 l 103 707 l 329 707 l 329 494"},";":{"ha":432,"x_min":103,"x_max":329,"o":"m 103 494 l 103 707 l 329 707 l 329 494 m 118 -219 l 193 0 l 103 0 l 103 212 l 329 212 l 329 22 l 232 -219"},"<":{"ha":764,"x_min":56,"x_max":694,"o":"m 694 31 l 56 301 l 56 510 l 694 781 l 694 600 l 140 367 l 140 444 l 694 211"},"=":{"ha":767,"x_min":56,"x_max":711,"o":"m 56 482 l 56 651 l 711 651 l 711 482 m 56 162 l 56 331 l 711 331 l 711 162"},">":{"ha":764,"x_min":69,"x_max":708,"o":"m 69 31 l 69 211 l 624 444 l 624 367 l 69 600 l 69 781 l 708 510 l 708 301"},"?":{"ha":821,"x_min":51,"x_max":771,"o":"m 301 311 q 333 483 301 424 q 438 578 364 542 q 515 624 489 604 q 549 667 540 644 q 557 719 557 689 q 523 803 557 771 q 426 836 489 836 q 316 798 356 836 q 268 685 276 760 l 51 696 q 106 857 60 786 q 232 968 151 928 q 426 1008 312 1008 q 615 971 539 1008 q 731 868 692 933 q 771 719 771 803 q 753 618 771 660 q 699 543 736 576 q 599 475 661 510 q 528 411 549 444 q 508 311 508 378 m 289 0 l 289 212 l 515 212 l 515 0"},"@":{"ha":1336,"x_min":58,"x_max":1278,"o":"m 946 -101 q 780 -151 862 -135 q 608 -168 697 -168 q 312 -108 435 -168 q 124 66 189 -49 q 58 342 58 181 q 106 604 58 486 q 240 808 153 722 q 447 940 326 894 q 714 986 567 986 q 1010 925 883 986 q 1208 753 1138 864 q 1278 494 1278 643 q 1240 290 1278 376 q 1137 156 1203 203 q 983 108 1071 108 q 855 151 903 108 q 801 264 807 194 l 838 269 q 788 185 825 224 q 701 124 750 146 q 600 101 651 101 q 464 133 521 101 q 378 224 407 165 q 349 361 349 282 q 385 534 349 458 q 485 654 421 610 q 635 699 550 699 q 768 662 712 699 q 835 569 824 626 l 807 568 l 817 689 l 974 689 l 949 415 q 943 349 946 383 q 940 292 940 314 q 958 248 940 264 q 1006 232 975 232 q 1109 297 1071 232 q 1147 478 1147 361 q 1098 692 1147 606 q 951 821 1049 778 q 707 864 854 864 q 497 827 592 864 q 333 722 403 790 q 227 560 264 654 q 190 350 190 465 q 240 137 190 225 q 383 1 289 49 q 612 -46 478 -46 q 768 -32 696 -46 q 914 14 840 -18 m 643 239 q 723 264 690 239 q 773 331 756 289 q 790 422 790 372 q 778 495 790 464 q 739 544 765 526 q 671 561 712 561 q 594 537 626 561 q 545 470 562 512 q 528 375 528 428 q 556 276 528 314 q 643 239 583 239"},"A":{"ha":1014,"x_min":26,"x_max":988,"o":"m 26 0 l 382 986 l 632 986 l 988 0 l 768 0 l 696 210 l 317 210 l 244 0 m 376 383 l 638 383 l 507 764"},"B":{"ha":976,"x_min":103,"x_max":906,"o":"m 103 0 l 103 986 l 486 986 q 767 922 669 986 q 864 718 864 857 q 839 612 864 657 q 766 540 814 567 q 650 508 718 514 l 650 511 q 840 440 774 503 q 906 272 906 376 q 809 67 906 135 q 533 0 712 0 m 314 172 l 524 172 q 647 203 600 172 q 693 297 693 235 q 647 392 693 360 q 524 425 600 425 l 314 425 m 314 578 l 481 578 q 605 608 558 578 q 651 696 651 639 q 606 785 651 757 q 481 814 561 814 l 314 814"},"C":{"ha":1019,"x_min":58,"x_max":968,"o":"m 521 -22 q 281 39 386 -22 q 117 215 176 100 q 58 492 58 331 q 115 765 58 649 q 278 944 172 881 q 525 1008 383 1008 q 826 913 718 1008 q 964 642 933 818 l 744 633 q 672 778 728 726 q 525 831 617 831 q 390 789 446 831 q 306 671 335 747 q 276 492 276 594 q 306 312 276 388 q 392 196 336 236 q 524 156 447 156 q 678 212 624 156 q 747 368 733 268 l 968 360 q 892 154 949 239 q 742 24 835 69 q 521 -22 650 -22"},"D":{"ha":1000,"x_min":103,"x_max":942,"o":"m 103 0 l 103 986 l 443 986 q 812 858 683 986 q 942 492 942 729 q 815 128 942 256 q 451 0 688 0 m 314 178 l 443 178 q 655 255 586 178 q 724 493 724 332 q 655 731 724 654 q 443 808 586 808 l 314 808"},"E":{"ha":864,"x_min":103,"x_max":800,"o":"m 103 0 l 103 986 l 789 986 l 789 808 l 314 808 l 314 582 l 772 582 l 772 407 l 314 407 l 314 178 l 800 178 l 800 0"},"F":{"ha":839,"x_min":103,"x_max":783,"o":"m 103 0 l 103 986 l 783 986 l 783 808 l 197 808 l 314 929 l 314 478 l 197 569 l 758 569 l 758 394 l 197 394 l 314 486 l 314 0"},"G":{"ha":1025,"x_min":58,"x_max":960,"o":"m 514 -22 q 269 43 371 -22 q 113 224 168 108 q 58 492 58 340 q 114 757 58 640 q 274 941 169 874 q 526 1008 379 1008 q 742 966 654 1008 q 883 846 831 924 q 957 662 936 768 l 739 653 q 674 783 724 735 q 528 831 625 831 q 387 786 443 831 q 303 665 331 742 q 276 492 276 589 q 303 317 276 393 q 387 199 331 242 q 532 156 443 156 q 645 182 597 156 q 720 254 693 208 q 753 358 747 300 l 528 358 l 528 512 l 960 512 l 960 0 l 829 0 l 818 211 l 843 200 q 782 85 829 135 q 666 6 735 35 q 514 -22 597 -22"},"H":{"ha":1001,"x_min":103,"x_max":899,"o":"m 103 0 l 103 986 l 314 986 l 314 518 l 221 585 l 782 585 l 688 518 l 688 986 l 899 986 l 899 0 l 688 0 l 688 474 l 782 407 l 221 407 l 314 474 l 314 0"},"I":{"ha":417,"x_min":103,"x_max":314,"o":"m 103 0 l 103 986 l 314 986 l 314 0"},"J":{"ha":871,"x_min":68,"x_max":789,"o":"m 429 -22 q 234 26 314 -22 q 112 159 154 75 q 68 351 69 243 l 281 361 q 321 206 282 256 q 429 156 360 156 q 539 204 500 156 q 578 354 578 253 l 578 986 l 789 986 l 789 354 q 744 154 789 239 q 618 24 699 69 q 429 -22 538 -22"},"K":{"ha":957,"x_min":103,"x_max":940,"o":"m 103 0 l 103 986 l 314 986 l 314 556 l 672 986 l 918 986 l 556 551 l 940 0 l 700 0 l 417 410 l 314 290 l 314 0"},"L":{"ha":818,"x_min":103,"x_max":768,"o":"m 103 0 l 103 986 l 314 986 l 314 57 l 197 178 l 768 178 l 768 0"},"M":{"ha":1271,"x_min":103,"x_max":1168,"o":"m 103 0 l 103 986 l 385 986 l 636 268 l 886 986 l 1168 986 l 1168 0 l 957 0 l 957 639 l 725 3 l 544 3 l 314 639 l 314 0"},"N":{"ha":1042,"x_min":103,"x_max":939,"o":"m 103 0 l 103 986 l 336 986 l 728 306 l 728 986 l 939 986 l 939 0 l 703 0 l 314 657 l 314 0"},"O":{"ha":1078,"x_min":58,"x_max":1019,"o":"m 539 -22 q 281 40 389 -22 q 116 218 174 103 q 58 492 58 333 q 116 766 58 650 q 281 945 174 882 q 539 1008 389 1008 q 797 945 689 1008 q 962 766 904 882 q 1019 492 1019 650 q 962 218 1019 333 q 797 40 904 103 q 539 -22 689 -22 m 538 156 q 680 195 621 156 q 770 310 739 235 q 801 492 801 385 q 770 674 801 599 q 680 790 739 750 q 538 831 621 831 q 397 790 456 831 q 308 674 339 750 q 276 492 276 599 q 308 310 276 385 q 398 195 339 235 q 538 156 457 156"},"P":{"ha":933,"x_min":103,"x_max":876,"o":"m 103 0 l 103 986 l 497 986 q 776 900 675 986 q 876 664 876 814 q 831 492 876 565 q 701 380 786 419 q 497 340 615 340 l 314 340 l 314 0 m 314 518 l 485 518 q 614 555 568 518 q 660 664 660 592 q 615 772 660 735 q 485 808 569 808 l 314 808"},"Q":{"ha":1068,"x_min":58,"x_max":1010,"o":"m 788 -86 l 711 10 q 634 -14 679 -6 q 535 -22 589 -22 q 282 44 389 -22 q 117 226 175 110 q 58 492 58 342 q 113 756 58 639 q 274 940 168 872 q 535 1008 381 1008 q 795 940 689 1008 q 956 756 901 872 q 1010 492 1010 639 q 963 250 1010 354 q 831 76 917 146 l 961 -86 m 535 156 q 568 158 553 156 q 597 165 583 160 l 460 333 l 635 333 l 707 238 q 770 338 749 276 q 792 492 792 400 q 765 659 792 582 q 681 783 738 736 q 535 831 624 831 q 388 783 444 831 q 303 659 331 736 q 276 492 276 582 q 303 326 276 403 q 388 202 331 249 q 535 156 446 156"},"R":{"ha":968,"x_min":103,"x_max":899,"o":"m 103 0 l 103 986 l 535 986 q 723 950 643 986 q 846 848 803 914 q 889 692 889 782 q 860 571 889 624 q 783 485 832 518 q 669 443 733 451 l 665 456 q 815 413 764 456 q 874 283 867 371 l 899 0 l 683 0 l 665 250 q 630 334 661 307 q 524 361 599 361 l 314 361 l 314 0 m 314 538 l 511 538 q 630 573 588 538 q 672 674 672 608 q 629 774 672 740 q 504 808 586 808 l 314 808"},"S":{"ha":946,"x_min":72,"x_max":874,"o":"m 493 -22 q 274 21 365 -22 q 131 142 182 64 q 72 325 79 219 l 285 335 q 319 235 293 276 q 388 174 344 194 q 496 153 432 153 q 585 165 549 153 q 642 203 622 178 q 661 267 661 229 q 644 327 661 301 q 581 374 628 353 q 442 417 533 396 q 238 482 315 446 q 126 573 161 518 q 92 711 92 628 q 135 867 92 800 q 262 971 179 933 q 461 1008 346 1008 q 668 965 583 1008 q 801 847 753 922 q 858 675 849 772 l 647 664 q 619 753 643 715 q 556 812 596 792 q 458 833 515 833 q 345 801 386 833 q 304 718 304 769 q 323 658 304 682 q 385 615 342 633 q 510 581 429 597 q 727 510 647 553 q 840 410 807 468 q 874 276 874 351 q 827 117 874 185 q 695 14 781 50 q 493 -22 610 -22"},"T":{"ha":832,"x_min":15,"x_max":818,"o":"m 310 0 l 310 808 l 15 808 l 15 986 l 818 986 l 818 808 l 522 808 l 522 0"},"U":{"ha":976,"x_min":82,"x_max":894,"o":"m 489 -22 q 273 24 364 -22 q 132 155 182 69 q 82 356 82 240 l 82 988 l 293 988 l 293 356 q 344 208 293 260 q 489 156 394 156 q 633 208 583 156 q 683 356 683 260 l 683 988 l 894 988 l 894 356 q 845 155 894 240 q 704 24 796 69 q 489 -22 612 -22"},"V":{"ha":1014,"x_min":26,"x_max":988,"o":"m 382 0 l 26 986 l 244 986 l 507 238 l 769 986 l 988 986 l 631 0"},"W":{"ha":1410,"x_min":51,"x_max":1358,"o":"m 318 0 l 51 986 l 272 986 l 442 292 l 612 986 l 797 986 l 969 292 l 1138 986 l 1358 986 l 1093 0 l 865 0 l 704 631 l 543 0"},"X":{"ha":956,"x_min":17,"x_max":939,"o":"m 17 0 l 351 494 l 19 986 l 264 986 l 479 654 l 689 986 l 935 986 l 603 497 l 939 0 l 693 0 l 476 338 l 262 0"},"Y":{"ha":876,"x_min":-10,"x_max":886,"o":"m 333 0 l 333 383 l -10 986 l 224 986 l 439 589 l 653 986 l 886 986 l 544 383 l 544 0"},"Z":{"ha":825,"x_min":38,"x_max":788,"o":"m 38 0 l 38 172 l 507 808 l 60 808 l 60 986 l 769 986 l 769 814 l 290 178 l 788 178 l 788 0"},"[":{"ha":542,"x_min":103,"x_max":525,"o":"m 525 -153 l 103 -153 l 103 1042 l 525 1042 l 525 878 l 303 878 l 303 11 l 525 11"},"\\":{"ha":696,"x_min":39,"x_max":657,"o":"m 657 -153 l 450 -153 l 39 1042 l 244 1042"},"]":{"ha":542,"x_min":17,"x_max":439,"o":"m 17 -153 l 17 11 l 239 11 l 239 878 l 17 878 l 17 1042 l 439 1042 l 439 -153"},"^":{"ha":640,"x_min":56,"x_max":585,"o":"m 56 532 l 222 935 l 418 935 l 585 532 l 435 532 l 300 849 l 340 849 l 207 532"},"_":{"ha":779,"x_min":51,"x_max":728,"o":"m 51 -168 l 51 0 l 728 0 l 728 -168"},"`":{"ha":386,"x_min":51,"x_max":335,"o":"m 176 831 l 51 1035 l 253 1035 l 335 831"},"a":{"ha":825,"x_min":51,"x_max":807,"o":"m 312 -17 q 124 37 197 -17 q 51 186 51 90 q 113 338 51 285 q 296 417 175 392 l 536 464 q 503 573 536 536 q 410 610 471 610 q 317 583 350 610 q 274 503 283 556 l 64 512 q 174 698 85 635 q 410 761 264 761 q 660 682 576 761 q 744 450 744 603 l 744 196 q 755 153 744 164 q 786 143 765 143 l 807 143 l 807 0 q 776 -6 797 -3 q 733 -8 754 -8 q 651 7 689 -8 q 589 59 612 22 q 565 164 565 96 l 583 150 q 534 62 569 100 q 442 4 499 25 q 312 -17 386 -17 m 362 126 q 453 147 414 126 q 514 206 492 167 q 536 297 536 244 l 536 333 l 367 297 q 291 265 317 288 q 265 206 265 242 q 290 147 265 168 q 362 126 315 126"},"b":{"ha":881,"x_min":92,"x_max":829,"o":"m 519 -17 q 384 17 442 -17 q 294 110 326 50 l 290 0 l 92 0 l 92 986 l 300 986 l 300 639 q 386 726 329 690 q 519 761 443 761 q 683 713 614 761 q 791 578 753 665 q 829 372 829 490 q 791 167 829 254 q 683 31 753 79 q 519 -17 614 -17 m 461 143 q 573 203 531 143 q 615 372 615 264 q 574 541 615 481 q 462 601 532 601 q 374 574 411 601 q 319 496 338 547 q 300 372 300 444 q 319 250 300 301 q 374 171 338 199 q 461 143 411 143"},"c":{"ha":831,"x_min":51,"x_max":793,"o":"m 429 -17 q 231 31 315 -17 q 99 167 146 79 q 51 372 51 254 q 99 577 51 490 q 231 712 146 664 q 429 761 315 761 q 606 726 528 761 q 733 626 685 692 q 793 469 782 561 l 578 460 q 528 565 568 529 q 429 600 489 600 q 308 540 351 600 q 265 372 265 481 q 308 203 265 264 q 429 143 351 143 q 529 180 489 143 q 578 292 569 217 l 793 283 q 735 124 783 192 q 609 20 688 57 q 429 -17 531 -17"},"d":{"ha":881,"x_min":51,"x_max":789,"o":"m 357 -17 q 194 31 262 -17 q 88 166 125 79 q 51 372 51 253 q 89 578 51 492 q 195 713 126 665 q 357 761 264 761 q 494 728 436 761 q 581 639 551 696 l 581 986 l 789 986 l 789 0 l 590 0 l 586 110 q 495 17 556 50 q 357 -17 435 -17 m 425 143 q 510 169 475 143 q 562 247 544 196 q 581 372 581 297 q 562 499 581 449 q 510 576 544 550 q 425 601 475 601 q 308 540 351 601 q 265 372 265 478 q 309 206 265 268 q 425 143 353 143"},"e":{"ha":840,"x_min":51,"x_max":790,"o":"m 426 -17 q 228 31 312 -17 q 98 167 144 79 q 51 372 51 254 q 98 577 51 490 q 228 712 144 664 q 425 761 311 761 q 618 712 536 761 q 745 574 700 664 q 790 358 790 483 l 790 317 l 267 317 q 315 185 271 228 q 431 142 358 142 q 519 164 483 142 q 569 232 554 186 l 779 219 q 656 46 750 108 q 426 -17 561 -17 m 267 444 l 576 444 q 531 567 572 526 q 425 607 490 607 q 317 565 360 607 q 267 444 275 522"},"f":{"ha":621,"x_min":64,"x_max":576,"o":"m 172 0 l 172 754 q 232 926 172 865 q 418 986 292 986 l 576 986 l 576 831 l 462 831 q 400 809 419 831 q 381 744 381 788 l 381 0 m 64 561 l 64 717 l 565 717 l 565 561"},"g":{"ha":881,"x_min":51,"x_max":789,"o":"m 425 -225 q 247 -199 318 -225 q 133 -125 175 -172 q 74 -17 90 -78 l 288 -1 q 330 -58 299 -38 q 425 -79 361 -79 q 540 -44 500 -79 q 579 69 579 -8 l 579 149 q 494 66 553 97 q 364 35 436 35 q 201 80 272 35 q 91 206 131 125 q 51 397 51 288 q 91 586 51 504 q 201 715 131 668 q 361 761 271 761 q 499 725 443 761 q 585 629 556 689 l 585 744 l 789 744 l 789 74 q 743 -92 789 -26 q 615 -192 697 -158 q 425 -225 533 -225 m 424 189 q 538 244 496 189 q 581 399 581 300 q 562 511 581 464 q 508 583 543 558 q 424 608 472 608 q 307 551 349 608 q 265 399 265 494 q 308 245 265 301 q 424 189 351 189"},"h":{"ha":849,"x_min":92,"x_max":757,"o":"m 92 0 l 92 986 l 300 986 l 300 571 l 272 571 q 316 678 283 636 q 398 740 349 719 q 506 761 447 761 q 644 725 589 761 q 728 625 700 689 q 757 479 757 561 l 757 0 l 549 0 l 549 429 q 523 554 549 512 q 436 596 497 596 q 336 553 372 596 q 300 424 300 510 l 300 0"},"i":{"ha":390,"x_min":88,"x_max":303,"o":"m 92 0 l 92 744 l 300 744 l 300 0 m 88 836 l 88 1003 l 303 1003 l 303 836"},"j":{"ha":460,"x_min":-4,"x_max":372,"o":"m -4 -208 l -4 -53 l 78 -53 q 140 -36 119 -53 q 160 31 160 -19 l 160 744 l 369 744 l 369 25 q 313 -154 369 -100 q 121 -208 257 -208 m 157 836 l 157 1003 l 372 1003 l 372 836"},"k":{"ha":899,"x_min":92,"x_max":835,"o":"m 92 0 l 92 986 l 300 986 l 300 439 l 576 744 l 826 744 l 538 438 l 835 0 l 607 0 l 403 319 l 300 210 l 300 0"},"l":{"ha":435,"x_min":92,"x_max":410,"o":"m 286 0 q 143 46 194 0 q 92 194 92 92 l 92 986 l 300 986 l 300 217 q 315 169 300 183 q 360 156 331 156 l 410 156 l 410 0"},"m":{"ha":1250,"x_min":92,"x_max":1158,"o":"m 92 0 l 92 744 l 279 744 l 286 565 l 267 574 q 313 675 282 633 q 389 739 344 717 q 486 761 433 761 q 637 707 579 761 q 711 561 694 653 l 685 560 q 728 670 697 625 q 806 738 760 715 q 908 761 851 761 q 1042 729 986 761 q 1128 634 1097 697 q 1158 479 1158 571 l 1158 0 l 950 0 l 950 421 q 924 552 950 508 q 838 596 897 596 q 774 575 800 596 q 733 515 747 554 q 718 418 718 475 l 718 0 l 531 0 l 531 418 q 506 550 531 504 q 419 596 481 596 q 355 575 382 596 q 314 514 328 554 q 300 418 300 474 l 300 0"},"n":{"ha":849,"x_min":92,"x_max":757,"o":"m 92 0 l 92 744 l 279 744 l 288 526 l 261 533 q 306 667 272 617 q 392 739 340 717 q 504 761 443 761 q 641 726 585 761 q 727 628 697 692 q 757 479 757 565 l 757 0 l 549 0 l 549 410 q 539 511 549 469 q 504 574 529 553 q 435 596 479 596 q 335 548 369 596 q 300 410 300 500 l 300 0"},"o":{"ha":858,"x_min":51,"x_max":807,"o":"m 429 -17 q 231 31 315 -17 q 99 167 146 79 q 51 372 51 254 q 99 577 51 490 q 231 712 146 664 q 429 761 315 761 q 628 712 543 761 q 760 577 712 664 q 807 372 807 490 q 760 167 807 254 q 628 31 712 79 q 429 -17 543 -17 m 429 143 q 550 203 507 143 q 593 372 593 264 q 550 541 593 481 q 429 601 507 601 q 308 541 351 601 q 265 372 265 481 q 308 203 265 264 q 429 143 351 143"},"p":{"ha":881,"x_min":92,"x_max":829,"o":"m 92 -208 l 92 744 l 292 744 l 296 588 l 279 594 q 369 718 307 675 q 515 761 432 761 q 689 710 619 761 q 794 570 758 658 q 829 372 829 482 q 794 175 829 264 q 688 35 758 86 q 514 -17 618 -17 q 412 3 460 -17 q 331 60 365 24 q 282 146 297 96 l 300 157 l 300 -208 m 457 143 q 573 204 531 143 q 615 372 615 265 q 573 540 615 479 q 457 601 531 601 q 373 576 408 601 q 319 499 338 550 q 300 372 300 447 q 319 246 300 297 q 373 169 338 194 q 457 143 408 143"},"q":{"ha":881,"x_min":51,"x_max":789,"o":"m 789 -208 l 581 -208 l 581 157 l 599 146 q 549 60 583 96 q 468 3 515 24 q 367 -17 421 -17 q 192 35 262 -17 q 87 175 122 86 q 51 372 51 264 q 87 570 51 482 q 192 710 122 658 q 365 761 261 761 q 512 718 450 761 q 601 594 575 675 l 585 588 l 589 744 l 789 744 m 424 143 q 508 169 474 143 q 562 246 543 194 q 581 372 581 297 q 562 499 581 447 q 508 576 543 550 q 424 601 472 601 q 308 540 350 601 q 265 372 265 479 q 308 204 265 265 q 424 143 350 143"},"r":{"ha":590,"x_min":92,"x_max":539,"o":"m 92 0 l 92 744 l 289 744 l 296 528 l 281 532 q 344 694 299 644 q 471 744 390 744 l 539 744 l 539 572 l 471 572 q 375 557 412 572 q 319 508 338 542 q 300 418 300 475 l 300 0"},"s":{"ha":793,"x_min":51,"x_max":743,"o":"m 410 -17 q 217 16 294 -17 q 98 105 139 49 q 51 235 57 161 l 262 242 q 307 160 272 189 q 410 131 342 131 q 497 149 465 131 q 528 204 528 167 q 517 244 528 228 q 473 272 506 260 q 376 293 440 283 q 192 342 258 314 q 97 414 125 369 q 69 522 69 458 q 152 695 69 629 q 400 761 235 761 q 577 728 506 761 q 688 637 649 694 q 738 506 728 579 l 528 497 q 506 559 524 533 q 462 599 489 585 q 399 614 436 614 q 313 591 343 614 q 283 531 283 568 q 297 485 283 503 q 340 457 310 468 q 422 439 371 446 q 612 392 542 422 q 712 318 682 362 q 743 208 743 274 q 701 86 743 136 q 585 10 660 36 q 410 -17 511 -17"},"t":{"ha":618,"x_min":57,"x_max":581,"o":"m 400 0 q 231 53 285 0 q 176 224 176 107 l 176 919 l 385 919 l 385 249 q 408 175 385 194 q 476 156 431 156 l 581 156 l 581 0 m 57 589 l 57 744 l 581 744 l 581 589"},"u":{"ha":843,"x_min":92,"x_max":753,"o":"m 336 -17 q 156 58 221 -17 q 92 265 92 132 l 92 744 l 300 744 l 300 314 q 326 188 300 228 q 410 149 353 149 q 509 192 474 149 q 544 324 544 236 l 544 744 l 753 744 l 753 0 l 562 0 l 557 214 l 583 208 q 504 40 567 97 q 336 -17 442 -17"},"v":{"ha":846,"x_min":29,"x_max":817,"o":"m 301 0 l 29 744 l 247 744 l 424 210 l 599 744 l 817 744 l 543 0"},"w":{"ha":1179,"x_min":29,"x_max":1150,"o":"m 250 0 l 29 744 l 239 744 l 367 240 l 504 744 l 674 744 l 811 240 l 940 744 l 1150 744 l 929 0 l 726 0 l 589 465 l 451 0"},"x":{"ha":903,"x_min":64,"x_max":839,"o":"m 64 0 l 329 378 l 71 744 l 292 744 l 451 506 l 606 744 l 832 744 l 575 376 l 839 0 l 618 0 l 454 253 l 289 0"},"y":{"ha":814,"x_min":29,"x_max":785,"o":"m 153 -208 l 153 -53 l 251 -53 q 305 -42 288 -53 q 332 -6 322 -32 l 347 38 l 290 38 l 29 744 l 242 744 l 412 232 l 572 744 l 785 744 l 499 -71 q 426 -176 474 -144 q 294 -208 379 -208"},"z":{"ha":826,"x_min":78,"x_max":749,"o":"m 78 0 l 78 164 l 488 589 l 94 589 l 94 744 l 738 744 l 738 581 l 321 156 l 749 156 l 749 0"},"{":{"ha":567,"x_min":58,"x_max":550,"o":"m 462 -174 q 257 -100 331 -174 q 183 89 183 -26 l 183 204 q 170 296 183 262 q 129 344 157 329 q 58 358 101 358 l 58 522 q 129 536 101 522 q 170 584 157 550 q 183 676 183 618 l 183 792 q 257 980 183 907 q 462 1053 331 1053 l 550 1053 l 550 874 q 422 850 462 878 q 382 758 382 822 l 382 662 q 334 508 382 564 q 222 444 286 453 l 222 436 q 335 373 288 429 q 382 218 382 317 l 382 121 q 422 27 382 57 q 550 0 462 -3 l 550 -174"},"|":{"ha":408,"x_min":103,"x_max":306,"o":"m 103 -153 l 103 1042 l 306 1042 l 306 -153"},"}":{"ha":567,"x_min":17,"x_max":508,"o":"m 104 -174 l 17 -174 l 17 0 q 144 27 104 -3 q 183 121 183 57 l 183 218 q 231 373 183 317 q 344 436 279 429 l 344 444 q 232 508 281 453 q 183 662 183 564 l 183 758 q 144 850 183 822 q 17 874 104 878 l 17 1053 l 104 1053 q 310 980 238 1053 q 382 792 382 907 l 382 676 q 395 584 382 618 q 436 536 408 550 q 508 522 464 522 l 508 358 q 436 344 464 358 q 395 296 408 329 q 382 204 382 262 l 382 89 q 310 -100 382 -26 q 104 -174 238 -174"},"~":{"ha":726,"x_min":56,"x_max":671,"o":"m 478 333 q 404 348 435 333 q 340 399 374 362 q 305 435 318 424 q 283 451 292 447 q 261 454 274 454 q 219 426 233 454 q 204 340 204 397 l 56 340 q 108 524 56 457 q 250 592 160 592 q 326 575 294 592 q 389 524 357 558 q 433 481 418 490 q 467 471 447 471 q 509 499 496 471 q 522 585 522 528 l 671 585 q 619 401 671 468 q 478 333 567 333"}},"familyName":"Geist Bold","ascender":1396,"descender":-410,"underlinePosition":-100,"underlineThickness":50,"boundingBox":{"xMin":-200,"xMax":2338,"yMin":-253,"yMax":958},"resolution":1000,"original_font_information":{"copyright":"Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git)","licence_url":"https://openfontlicense.org"},"cssFontWeight":"bold","cssFontStyle":"normal"});
3044
+ try {
3045
+ await document.fonts.ready; // DOM letter rects must be measured with the real font
3046
+ } catch (e) {}
3047
+
3048
+ // Shrink the DOM headline if a long title overflows, BEFORE measuring spans
3049
+ for (const id of ["wpt-headline"]) {
3050
+ const el = document.getElementById(id);
3051
+ if (el.scrollWidth > 1760) {
3052
+ el.style.fontSize = Math.floor(176 * (1760 / el.scrollWidth)) + "px";
3053
+ }
3054
+ }
3055
+
3056
+ // ---------- renderer / scenes / camera ----------
3057
+ const canvas = document.getElementById("wpt-three");
3058
+ const renderer = new THREE.WebGLRenderer({
3059
+ canvas,
3060
+ antialias: true,
3061
+ alpha: true,
3062
+ stencil: true,
3063
+ preserveDrawingBuffer: true, // audit pixel-hashing + deterministic capture read the buffer back
3064
+ });
3065
+ renderer.setSize(W, H, false);
3066
+ renderer.setPixelRatio(1);
3067
+ renderer.setClearColor(0x000000, 0);
3068
+ renderer.toneMapping = THREE.NoToneMapping;
3069
+
3070
+ const scene = new THREE.Scene();
3071
+ const gridScene = new THREE.Scene();
3072
+ const camera = new THREE.PerspectiveCamera(P.initialFOV, W / H, 0.1, 500);
3073
+ camera.position.set(0, 0, P.cameraDistance);
3074
+ camera.lookAt(0, 0, 0);
3075
+
3076
+ // Lighting (for the floating extruded shapes)
3077
+ scene.add(new THREE.AmbientLight(0xffffff, P.ambientIntensity));
3078
+ const dirLight = new THREE.DirectionalLight(0xffffff, P.keyLightIntensity);
3079
+ dirLight.position.set(P.keyLightX, P.keyLightY, P.keyLightZ);
3080
+ scene.add(dirLight);
3081
+
3082
+ // ---------- background plane + volumetric glow-dot grid ----------
3083
+ const bgPlaneMat = new THREE.MeshBasicMaterial({
3084
+ color: P.portalStartColor,
3085
+ side: THREE.DoubleSide,
3086
+ });
3087
+ const bgPlane = new THREE.Mesh(new THREE.PlaneGeometry(500, 500), bgPlaneMat);
3088
+ bgPlane.position.z = -100;
3089
+ bgPlane.renderOrder = -10;
3090
+ gridScene.add(bgPlane);
3091
+
3092
+ const gridPositions = [];
3093
+ {
3094
+ const count = Math.floor(P.gridSize / P.gridSpacing);
3095
+ const he = P.gridSize;
3096
+ for (let a = -count; a <= count; a++) {
3097
+ for (let b = -count; b <= count; b++) {
3098
+ const ca = a * P.gridSpacing;
3099
+ const cb = b * P.gridSpacing;
3100
+ gridPositions.push(-he, ca, cb, he, ca, cb);
3101
+ gridPositions.push(ca, -he, cb, ca, he, cb);
3102
+ gridPositions.push(ca, cb, -he, ca, cb, he);
3103
+ }
3104
+ }
3105
+ }
3106
+ const gridGeo = new THREE.BufferGeometry();
3107
+ gridGeo.setAttribute("position", new THREE.Float32BufferAttribute(gridPositions, 3));
3108
+ const gridMat = new THREE.ShaderMaterial({
3109
+ uniforms: THREE.UniformsUtils.clone(GridLineShader.uniforms),
3110
+ vertexShader: GridLineShader.vertexShader,
3111
+ fragmentShader: GridLineShader.fragmentShader,
3112
+ transparent: true,
3113
+ depthWrite: false,
3114
+ });
3115
+ const gridLines = new THREE.LineSegments(gridGeo, gridMat);
3116
+ gridLines.position.x = P.gridOffsetX;
3117
+ gridLines.visible = false;
3118
+ gridScene.add(gridLines);
3119
+
3120
+ // ---------- floating extruded triangles (experiment's decorative shapes) ----------
3121
+ function triangleShape(size) {
3122
+ const shape = new THREE.Shape();
3123
+ const h = (size * Math.sqrt(3)) / 2;
3124
+ shape.moveTo(0, h * 0.66);
3125
+ shape.lineTo(-size / 2, -h * 0.33);
3126
+ shape.lineTo(size / 2, -h * 0.33);
3127
+ shape.closePath();
3128
+ return shape;
3129
+ }
3130
+ const floatingShapes = [];
3131
+ const shapeConfigs = [
3132
+ { size: 1.8, basePos: [-8, 5, 2], color: ACCENT },
3133
+ { size: 1.4, basePos: [7, -3, 1], color: ACCENT },
3134
+ { size: 1.0, basePos: [-6, -6, 3], color: "#1a1a1a" },
3135
+ { size: 1.2, basePos: [9, 6, 2], color: ACCENT },
3136
+ ];
3137
+ for (const cfg of shapeConfigs) {
3138
+ const geo = new THREE.ExtrudeGeometry(triangleShape(cfg.size), {
3139
+ depth: 0.3,
3140
+ bevelEnabled: true,
3141
+ bevelThickness: 0.02,
3142
+ bevelSize: 0.02,
3143
+ bevelSegments: 2,
3144
+ });
3145
+ geo.center();
3146
+ const mesh = new THREE.Mesh(
3147
+ geo,
3148
+ new THREE.MeshStandardMaterial({ color: cfg.color, roughness: 0.4, metalness: 0.1 }),
3149
+ );
3150
+ mesh.position.set(cfg.basePos[0], cfg.basePos[1], cfg.basePos[2]);
3151
+ mesh.userData.basePos = new THREE.Vector3(...cfg.basePos);
3152
+ scene.add(mesh);
3153
+ floatingShapes.push(mesh);
3154
+ }
3155
+
3156
+ // ---------- 3D page content: extruded letters + flat outlined lines ----------
3157
+ const contentGroup = new THREE.Group();
3158
+ contentGroup.visible = false;
3159
+ scene.add(contentGroup);
3160
+ const textMeshes = [];
3161
+
3162
+ // Screen px -> world units at the 2D camera (FOV 100, z 22)
3163
+ const fovRad = (P.initialFOV * Math.PI) / 180;
3164
+ const visH = 2 * P.cameraDistance * Math.tan(fovRad / 2);
3165
+ const visW = visH * (W / H);
3166
+ function rectToWorld(r) {
3167
+ return {
3168
+ x: ((r.left + r.width / 2) / W - 0.5) * visW,
3169
+ y: (0.5 - (r.top + r.height / 2) / H) * visH,
3170
+ w: (r.width / W) * visW,
3171
+ h: (r.height / H) * visH,
3172
+ };
3173
+ }
3174
+ // Transform-immune element rect (GSAP intro tweens offset elements at t=0)
3175
+ function offsetRect(el) {
3176
+ let left = el.offsetLeft;
3177
+ let top = el.offsetTop;
3178
+ let node = el.offsetParent;
3179
+ while (node && node.id !== "wpt-card" && node !== document.body) {
3180
+ left += node.offsetLeft;
3181
+ top += node.offsetTop;
3182
+ node = node.offsetParent;
3183
+ }
3184
+ return { left, top, width: el.offsetWidth, height: el.offsetHeight };
3185
+ }
3186
+ const lineResolution = new THREE.Vector2(W, H);
3187
+
3188
+ // Geist glyphs contain self-overlapping junction notches (fine for nonzero-winding
3189
+ // browser fills, fatal for extrusion triangulation + EdgesGeometry). Resolve the
3190
+ // overlaps with a nonzero polygon union before extruding.
3191
+ function cleanShapes(shapes) {
3192
+ const SC = 1000;
3193
+ const cleaned = [];
3194
+ for (const shape of shapes) {
3195
+ const pts = shape.extractPoints(12);
3196
+ const paths = [pts.shape, ...pts.holes].map((ring) =>
3197
+ ring.map((p) => ({ X: Math.round(p.x * SC), Y: Math.round(p.y * SC) })),
3198
+ );
3199
+ let simp;
3200
+ try {
3201
+ simp = ClipperLib.Clipper.SimplifyPolygons(paths, ClipperLib.PolyFillType.pftNonZero);
3202
+ } catch (e) {
3203
+ cleaned.push(shape);
3204
+ continue;
3205
+ }
3206
+ const outerRings = [];
3207
+ const holeRings = [];
3208
+ for (const ring of simp) {
3209
+ if (ring.length < 3) continue;
3210
+ (ClipperLib.Clipper.Orientation(ring) ? outerRings : holeRings).push(ring);
3211
+ }
3212
+ const outShapes = outerRings.map(
3213
+ (r) => new THREE.Shape(r.map((p) => new THREE.Vector2(p.X / SC, p.Y / SC))),
3214
+ );
3215
+ for (const hr of holeRings) {
3216
+ let owner = outShapes[0];
3217
+ for (let oi = 0; oi < outerRings.length; oi++) {
3218
+ if (ClipperLib.Clipper.PointInPolygon(hr[0], outerRings[oi]) !== 0) {
3219
+ owner = outShapes[oi];
3220
+ break;
3221
+ }
3222
+ }
3223
+ if (owner)
3224
+ owner.holes.push(
3225
+ new THREE.Path(hr.map((p) => new THREE.Vector2(p.X / SC, p.Y / SC))),
3226
+ );
3227
+ }
3228
+ cleaned.push(...outShapes);
3229
+ }
3230
+ return cleaned;
3231
+ }
3232
+
3233
+ function cleanTextGeometry(text, size, depth) {
3234
+ const shapes = cleanShapes(font.generateShapes(text, size));
3235
+ return new THREE.ExtrudeGeometry(shapes, { depth, bevelEnabled: false });
3236
+ }
3237
+
3238
+ function createLetterAt(char, wr, random = rand) {
3239
+ const g = new THREE.Group();
3240
+ // A shared geometry size lets a reused glyph scale continuously between
3241
+ // source and target layouts, even when a long phrase needs smaller type.
3242
+ const size = 10;
3243
+ const geo = cleanTextGeometry(char, size, P.textDepthMax);
3244
+ geo.computeBoundingBox();
3245
+ const bb = geo.boundingBox;
3246
+ const geoW = bb.max.x - bb.min.x;
3247
+ const geoH = bb.max.y - bb.min.y;
3248
+ geo.center();
3249
+ const xyScale = Math.min(wr.w / (geoW || 1), wr.h / (geoH || 1));
3250
+
3251
+ g.add(
3252
+ new THREE.Mesh(
3253
+ geo,
3254
+ new THREE.MeshBasicMaterial({
3255
+ color: "#050505",
3256
+ side: THREE.DoubleSide,
3257
+ transparent: true,
3258
+ }),
3259
+ ),
3260
+ );
3261
+
3262
+ const edges = new THREE.EdgesGeometry(geo, 20);
3263
+ const lineGeo = new LineSegmentsGeometry();
3264
+ lineGeo.setPositions(edges.attributes.position.array);
3265
+ const lineMat = new LineMaterial({
3266
+ color: new THREE.Color(P.outlineColor).getHex(),
3267
+ linewidth: P.outlineWidth,
3268
+ transparent: true,
3269
+ resolution: lineResolution,
3270
+ });
3271
+ g.add(new LineSegments2(lineGeo, lineMat));
3272
+ edges.dispose();
3273
+
3274
+ g.scale.set(xyScale, xyScale, 0.01);
3275
+ g.position.set(wr.x, wr.y, 0);
3276
+ g.userData.char = char;
3277
+ g.userData.baseX = wr.x;
3278
+ g.userData.baseY = wr.y;
3279
+ g.userData.xyScale = xyScale;
3280
+ g.userData.targetZ = (random() - 0.5) * P.letterZSpread;
3281
+ const ratio = P.textDepthMin / P.textDepthMax;
3282
+ g.userData.depthScale = ratio + random() * (1 - ratio);
3283
+ g.userData.isLetter = true;
3284
+ contentGroup.add(g);
3285
+ textMeshes.push(g);
3286
+ return g;
3287
+ }
3288
+
3289
+ function createFlatLine(text, wr, widthMult, opacity) {
3290
+ const geo = cleanTextGeometry(text, 1, 0.02);
3291
+ geo.computeBoundingBox();
3292
+ const bb = geo.boundingBox;
3293
+ const geoW = bb.max.x - bb.min.x;
3294
+ const geoH = bb.max.y - bb.min.y;
3295
+ geo.center();
3296
+ const s = Math.min(wr.h / (geoH || 1), wr.w / (geoW || 1));
3297
+
3298
+ const g = new THREE.Group();
3299
+ g.add(
3300
+ new THREE.Mesh(
3301
+ geo,
3302
+ new THREE.MeshBasicMaterial({
3303
+ color: "#050505",
3304
+ side: THREE.DoubleSide,
3305
+ transparent: true,
3306
+ }),
3307
+ ),
3308
+ );
3309
+ const edges = new THREE.EdgesGeometry(geo, 40);
3310
+ const lineGeo = new LineSegmentsGeometry();
3311
+ lineGeo.setPositions(edges.attributes.position.array);
3312
+ const lineMat = new LineMaterial({
3313
+ color: new THREE.Color(P.outlineColor).getHex(),
3314
+ linewidth: P.outlineWidth * widthMult,
3315
+ transparent: true,
3316
+ opacity: opacity,
3317
+ resolution: lineResolution,
3318
+ });
3319
+ g.add(new LineSegments2(lineGeo, lineMat));
3320
+ edges.dispose();
3321
+
3322
+ g.scale.set(s, s, 1);
3323
+ g.position.set(wr.x, wr.y, 0);
3324
+ g.userData.baseY = wr.y;
3325
+ g.userData.isSupporting = true;
3326
+ g.userData.faceColor = g.children[0].material.color.clone();
3327
+ contentGroup.add(g);
3328
+ textMeshes.push(g);
3329
+ }
3330
+
3331
+ // Headline letters from the DOM spans (2D card and 3D letters stay aligned)
3332
+ document.querySelectorAll("#wpt-headline [data-3d-char]").forEach((span) => {
3333
+ const ch = span.textContent;
3334
+ if (!ch || ch.trim() === "") return;
3335
+ const r = offsetRect(span);
3336
+ if (r.width < 1 || r.height < 1) return;
3337
+ createLetterAt(ch, rectToWorld(r));
3338
+ });
3339
+ const sourceLetters = textMeshes.slice();
3340
+ // Kicker + subtitle as flat outlined lines
3341
+ const kickEl = document.getElementById("wpt-kicker-text");
3342
+ if (kickEl && kickEl.textContent.trim()) {
3343
+ createFlatLine(kickEl.textContent, rectToWorld(offsetRect(kickEl)), 0.7, 0.6);
3344
+ }
3345
+ const subEl = document.getElementById("wpt-subtitle");
3346
+ if (subEl && subEl.textContent.trim()) {
3347
+ createFlatLine(subEl.textContent, rectToWorld(offsetRect(subEl)), 0.7, 0.6);
3348
+ }
3349
+
3350
+ const supportingLines = textMeshes.filter((obj) => obj.userData.isSupporting);
3351
+ const replacementLetters = [];
3352
+ const transition = window.__wptTransition;
3353
+ const clamp01 = (v) => Math.max(0, Math.min(1, v));
3354
+ const smooth = (v) => {
3355
+ const x = clamp01(v);
3356
+ return x * x * (3 - 2 * x);
3357
+ };
3358
+
3359
+ // Typeset from font metrics, independent of any final DOM card. Search
3360
+ // whole-word wraps, maximizing readable type size in a safe 1520 x 620 box.
3361
+ // A long unbroken word shrinks intact; no words or glyphs are discarded.
3362
+ function layoutPhrase(text) {
3363
+ const measure = document.createElement("canvas").getContext("2d");
3364
+ measure.font = "700 176px Geist";
3365
+ const tracking = 176 * 0.03;
3366
+ const advance = (char) => measure.measureText(char).width + tracking;
3367
+ const width = (line) =>
3368
+ Array.from(line).reduce((sum, char) => sum + advance(char), -tracking);
3369
+ const words = text.split(" ");
3370
+ const widest = Math.max(...words.map(width));
3371
+ const total = width(text);
3372
+ let best = null;
3373
+ // Trying each possible break-width gives several balanced candidates
3374
+ // without restricting the result to two words or a fixed line count.
3375
+ const candidates = new Set([total, widest]);
3376
+ for (let first = 0; first < words.length; first++) {
3377
+ let line = "";
3378
+ for (let last = first; last < words.length; last++) {
3379
+ line += (line ? " " : "") + words[last];
3380
+ candidates.add(width(line));
3381
+ }
3382
+ }
3383
+ for (const limit of candidates) {
3384
+ if (limit < widest) continue;
3385
+ const lines = [];
3386
+ let line = "";
3387
+ for (const word of words) {
3388
+ const next = line ? line + " " + word : word;
3389
+ if (line && width(next) > limit + 0.01) {
3390
+ lines.push(line);
3391
+ line = word;
3392
+ } else line = next;
3393
+ }
3394
+ if (line) lines.push(line);
3395
+ const widths = lines.map(width);
3396
+ const scale = Math.min(1, 1520 / Math.max(...widths), 620 / (lines.length * 176 * 1.18));
3397
+ const balance = Math.min(...widths) / Math.max(...widths);
3398
+ const score = scale * (0.94 + 0.06 * balance);
3399
+ if (!best || score > best.score) best = { lines, widths, scale, score };
3400
+ }
3401
+ const glyphs = [];
3402
+ const lineHeight = 176 * 1.18 * best.scale;
3403
+ best.lines.forEach((line, row) => {
3404
+ let left = (W - best.widths[row] * best.scale) / 2;
3405
+ for (const char of Array.from(line)) {
3406
+ const step = advance(char) * best.scale;
3407
+ if (char.trim())
3408
+ glyphs.push({
3409
+ char,
3410
+ row,
3411
+ rect: {
3412
+ left,
3413
+ top: H / 2 + (row - (best.lines.length - 1) / 2) * lineHeight - 88 * best.scale,
3414
+ width: (advance(char) - tracking) * best.scale,
3415
+ height: 176 * best.scale,
3416
+ },
3417
+ });
3418
+ left += step;
3419
+ }
3420
+ });
3421
+ return { ...best, glyphs };
3422
+ }
3423
+ const phraseLayout = layoutPhrase(window.__wptPhrase);
3424
+ for (const { char, rect, row } of phraseLayout.glyphs) {
3425
+ const letter = createLetterAt(char, rectToWorld(rect), phraseRand);
3426
+ // Keep spacing consistent at the hold camera while retaining real depth.
3427
+ const distance = P.cameraDistance3D - P.contentZOffset;
3428
+ const perspective = (distance - letter.userData.targetZ) / distance;
3429
+ letter.userData.baseX *= perspective;
3430
+ letter.userData.baseY *= perspective;
3431
+ letter.userData.xyScale *= perspective;
3432
+ letter.userData.row = row;
3433
+ replacementLetters.push(letter);
3434
+ }
3435
+
3436
+ // Reuse matching letter identities first, then pair remaining glyphs by
3437
+ // spatial proximity. Extra target letters have their own distant Z origin;
3438
+ // unused source letters depart early instead of lingering until a swap.
3439
+ const slots = replacementLetters.map((to) => ({ from: null, to }));
3440
+ const remaining = new Set(sourceLetters);
3441
+ const distance = (a, b) => Math.hypot(a.baseX - b.baseX, a.baseY - b.baseY);
3442
+ for (const exactOnly of [true, false]) {
3443
+ for (const slot of slots) {
3444
+ if (slot.from) continue;
3445
+ let closest = null,
3446
+ cost = Infinity;
3447
+ for (const letter of remaining) {
3448
+ if (exactOnly && letter.userData.char !== slot.to.userData.char) continue;
3449
+ const candidateCost = distance(letter.userData, slot.to.userData);
3450
+ if (candidateCost < cost) {
3451
+ closest = letter;
3452
+ cost = candidateCost;
3453
+ }
3454
+ }
3455
+ if (closest) {
3456
+ slot.from = closest;
3457
+ remaining.delete(closest);
3458
+ }
3459
+ }
3460
+ }
3461
+ for (const from of remaining) slots.push({ from, to: null });
3462
+ slots.forEach((slot, i) => {
3463
+ const target = slot.to || slot.from;
3464
+ slot.start = slot.from
3465
+ ? slot.from.userData
3466
+ : {
3467
+ baseX: target.userData.baseX * 1.25,
3468
+ baseY: target.userData.baseY * 1.25,
3469
+ targetZ: -60 - phraseRand() * 65,
3470
+ xyScale: target.userData.xyScale,
3471
+ };
3472
+ slot.end = (slot.to || slot.from).userData;
3473
+ const rank = i / Math.max(1, replacementLetters.length - 1);
3474
+ slot.delay = clamp01(rank) * transition.duration * 0.26;
3475
+ // Keep the same object alive when the character itself does not change.
3476
+ slot.sameGlyph = !!(
3477
+ slot.from &&
3478
+ slot.to &&
3479
+ slot.from.userData.char === slot.to.userData.char
3480
+ );
3481
+ if (slot.sameGlyph) slot.to.visible = false;
3482
+ });
3483
+
3484
+ // The adjustable power concentrates speed around the edge-on letter swap
3485
+ // at 62% of local time: slow preparation, fast handoff, then a soft settle.
3486
+ function phraseEase(progress) {
3487
+ const x = clamp01(progress);
3488
+ const a = Math.pow(x * 0.38, transition.easing);
3489
+ const b = Math.pow((1 - x) * 0.62, transition.easing);
3490
+ return a / (a + b);
3491
+ }
3492
+ function opacityFor(obj, opacity) {
3493
+ for (const child of obj.children) {
3494
+ child.material.opacity = opacity;
3495
+ child.material.depthWrite = opacity > 0.995;
3496
+ }
3497
+ }
3498
+ function depthFade(obj, amount, baseOpacity = 1) {
3499
+ const opacity = 1 - smooth((amount - 0.005) / 0.13);
3500
+ opacityFor(obj, opacity);
3501
+ const haze = transition.fog ? 1 - smooth(amount / 0.15) : 1;
3502
+ obj.children[1].material.color.set(P.outlineColor).lerp(endCol, 1 - haze);
3503
+ obj.children[1].material.opacity = baseOpacity * opacity;
3504
+ obj.visible = opacity > 0.001;
3505
+ return opacity;
3506
+ }
3507
+
3508
+ function handoffLetters(t, portal) {
3509
+ let glitchEnvelope = 0;
3510
+ for (let i = 0; i < slots.length; i++) {
3511
+ const slot = slots[i];
3512
+ const progress = clamp01(
3513
+ (t - transition.start - slot.delay) / (transition.duration * 0.74),
3514
+ );
3515
+ const motion = phraseEase(progress);
3516
+ const incoming = motion >= 0.5;
3517
+ const start = slot.start,
3518
+ end = slot.end;
3519
+ // Spare source letters fog out during the first fraction of recession,
3520
+ // before the active letters turn. This path also runs with fog disabled.
3521
+ if (!slot.to) {
3522
+ const depart = smooth(
3523
+ (t - transition.start - (i % 3) * 0.025) / Math.min(0.75, transition.duration * 0.45),
3524
+ );
3525
+ const obj = slot.from;
3526
+ obj.position.set(start.baseX, start.baseY, start.targetZ * portal - depart * 125);
3527
+ obj.rotation.set(0, depart * 0.3, 0);
3528
+ obj.scale.set(
3529
+ start.xyScale,
3530
+ start.xyScale,
3531
+ THREE.MathUtils.lerp(0.01, start.depthScale, portal),
3532
+ );
3533
+ depthFade(obj, depart);
3534
+ continue;
3535
+ }
3536
+ const x = THREE.MathUtils.lerp(start.baseX, end.baseX, motion);
3537
+ const y =
3538
+ THREE.MathUtils.lerp(start.baseY, end.baseY, motion) +
3539
+ Math.sin(t * 0.6 + i * 0.7) * 0.12 * portal;
3540
+ // Keep the approved forward rush: the original camera pushes into
3541
+ // the wireframe world as the resolved letters accelerate toward it.
3542
+ // A small reading-order stagger carries each letter past the lens;
3543
+ // there is no backward Z travel or opacity dissolve on this exit.
3544
+ const exitDelay = (i / Math.max(1, replacementLetters.length - 1)) * 0.2;
3545
+ const flyPast = Math.pow(clamp01((t - 6.0 - exitDelay) / 1.25), 3);
3546
+ const z =
3547
+ THREE.MathUtils.lerp(start.targetZ, end.targetZ, motion) * portal -
3548
+ Math.sin(Math.PI * motion) * 1.8 +
3549
+ flyPast * 38;
3550
+ // Retire a glyph only after its full extrusion is behind the camera.
3551
+ // Before then, clipping and perspective carry the fly-through.
3552
+ const cameraSpace = new THREE.Vector3(x, y, z + P.contentZOffset * portal).applyMatrix4(
3553
+ camera.matrixWorldInverse,
3554
+ );
3555
+ const passedCamera = cameraSpace.z > P.textDepthMax * 2;
3556
+ const edge = Math.pow(Math.abs(2 * motion - 1), 0.65);
3557
+ const swapPulse = Math.exp(-Math.pow((progress - 0.62) / 0.045, 2));
3558
+ const settlePulse = Math.exp(-Math.pow((progress - 0.86) / 0.065, 2));
3559
+ glitchEnvelope = Math.max(glitchEnvelope, swapPulse * 0.65, settlePulse);
3560
+ const tick =
3561
+ Math.sin(Math.floor(t * 36) * 17.1 + i * 4.7) * settlePulse * transition.glitch;
3562
+ for (const [obj, isIncoming] of [
3563
+ [slot.from, false],
3564
+ [slot.to, true],
3565
+ ]) {
3566
+ if (!obj) continue;
3567
+ const isActive = slot.sameGlyph ? !isIncoming : incoming === isIncoming;
3568
+ // New glyphs fly up from deep Z throughout the move. They are not
3569
+ // duplicates split out of a source letter, and never disappear at the seam.
3570
+ const extra = !slot.from;
3571
+ const entrance = extra ? smooth(motion / 0.34) : 1;
3572
+ const opacity = entrance;
3573
+ obj.visible = (extra || isActive) && opacity > 0.001 && !passedCamera;
3574
+ opacityFor(obj, opacity);
3575
+ obj.position.set(x + tick * 0.12, y + tick * 0.04, z);
3576
+ obj.rotation.set(
3577
+ 0,
3578
+ slot.sameGlyph
3579
+ ? Math.sin(Math.PI * motion) * 0.55
3580
+ : extra
3581
+ ? -Math.PI * 0.75 * (1 - motion)
3582
+ : incoming
3583
+ ? -Math.PI * (1 - motion)
3584
+ : Math.PI * motion,
3585
+ tick * 0.012,
3586
+ );
3587
+ const xyScale = THREE.MathUtils.lerp(start.xyScale, end.xyScale, motion);
3588
+ obj.scale.set(
3589
+ xyScale,
3590
+ xyScale,
3591
+ THREE.MathUtils.lerp(0.01, end.depthScale, portal) *
3592
+ (extra || slot.sameGlyph ? 1 : 0.015 + 0.985 * edge),
3593
+ );
3594
+ }
3595
+ }
3596
+ return glitchEnvelope;
3597
+ }
3598
+
3599
+ function recedeSupportingLines(t) {
3600
+ supportingLines.forEach((obj, i) => {
3601
+ const travel = smooth((t - 2.65 - i * 0.09) / 1.3);
3602
+ obj.position.z = -145 * travel;
3603
+ depthFade(obj, travel, 0.6);
3604
+ });
3605
+ }
3606
+
3607
+ // ---------- post-processing chain (experiment pass order + glitch pass) ----------
3608
+ const renderTarget = new THREE.WebGLRenderTarget(W, H, {
3609
+ format: THREE.RGBAFormat,
3610
+ type: THREE.HalfFloatType,
3611
+ depthBuffer: true,
3612
+ samples: 4,
3613
+ });
3614
+ const composer = new EffectComposer(renderer, renderTarget);
3615
+ composer.setSize(W, H);
3616
+
3617
+ const gridRenderPass = new RenderPass(gridScene, camera);
3618
+ gridRenderPass.clearAlpha = 0;
3619
+ composer.addPass(gridRenderPass);
3620
+
3621
+ const contentRenderPass = new RenderPass(scene, camera);
3622
+ contentRenderPass.clear = false;
3623
+ composer.addPass(contentRenderPass);
3624
+
3625
+ const blurPassH = new ShaderPass(EdgeBlurShader);
3626
+ blurPassH.uniforms.uDirection.value.set(1, 0);
3627
+ composer.addPass(blurPassH);
3628
+ const blurPassV = new ShaderPass(EdgeBlurShader);
3629
+ blurPassV.uniforms.uDirection.value.set(0, 1);
3630
+ composer.addPass(blurPassV);
3631
+
3632
+ const postfxPass = new ShaderPass(PostFXShader);
3633
+ composer.addPass(postfxPass);
3634
+
3635
+ const glitchPass = new ShaderPass(GlitchShader);
3636
+ composer.addPass(glitchPass);
3637
+
3638
+ const transFXPass = new ShaderPass(TransitionFXShader);
3639
+ composer.addPass(transFXPass);
3640
+
3641
+ const portalPass = new ShaderPass(PortalCompositeShader);
3642
+ portalPass.material.transparent = true;
3643
+ composer.addPass(portalPass);
3644
+
3645
+ composer.addPass(new OutputPass());
3646
+
3647
+ // ---------- warp dots (2D overlay canvas, pure function of state) ----------
3648
+ const warpCanvas = document.getElementById("wpt-warp");
3649
+ // Keep warp-dot rasterization identical on fresh and repeated seeks.
3650
+ const wctx = warpCanvas.getContext("2d", { willReadFrequently: true });
3651
+ const warpDots = [];
3652
+ {
3653
+ const count = P.warpDotCount;
3654
+ const depthLayers = Math.ceil(Math.cbrt(count) * 2);
3655
+ const sideCount = Math.ceil(Math.sqrt(count / depthLayers));
3656
+ outer: for (let iz = 0; iz < depthLayers; iz++) {
3657
+ for (let iy = 0; iy < sideCount; iy++) {
3658
+ for (let ix = 0; ix < sideCount; ix++) {
3659
+ if (warpDots.length >= count) break outer;
3660
+ warpDots.push({
3661
+ x: (ix - (sideCount - 1) / 2) * 1.0,
3662
+ y: (iy - (sideCount - 1) / 2) * 1.0,
3663
+ z: iz * 1.0 + 0.5,
3664
+ });
3665
+ }
3666
+ }
3667
+ }
3668
+ }
3669
+ const WARP_MAX_Z = Math.max(10, Math.ceil(Math.cbrt(P.warpDotCount) * 2));
3670
+
3671
+ function drawWarpDots(S) {
3672
+ wctx.clearRect(0, 0, W, H);
3673
+ const vis = S.warp;
3674
+ if (vis < 0.01) return;
3675
+ const cx = W / 2;
3676
+ const cy = H / 2;
3677
+ for (let i = 0; i < warpDots.length; i++) {
3678
+ const d = warpDots[i];
3679
+ let z = (((d.z - S.travel) % WARP_MAX_Z) + WARP_MAX_Z) % WARP_MAX_Z;
3680
+ if (z < 0.05) z += WARP_MAX_Z;
3681
+
3682
+ const scale = 300 / z;
3683
+ const sx = cx + d.x * scale;
3684
+ const sy = cy + d.y * scale;
3685
+ const size = (P.warpDotSize / z) * 3;
3686
+ if (size < 0.3) continue;
3687
+ if (sx < -10 || sx > W + 10 || sy < -10 || sy > H + 10) continue;
3688
+
3689
+ const depthAlpha = Math.min(1, 2 / z);
3690
+ const alpha = depthAlpha * vis * P.warpDotOpacity;
3691
+
3692
+ wctx.globalAlpha = alpha;
3693
+ wctx.fillStyle = P.warpDotColor;
3694
+ wctx.beginPath();
3695
+ wctx.arc(sx, sy, size, 0, Math.PI * 2);
3696
+ wctx.fill();
3697
+
3698
+ if (z < 2 && size > 1) {
3699
+ const streakLen = (2 - z) * 20 * vis;
3700
+ const dx = sx - cx;
3701
+ const dy = sy - cy;
3702
+ const dist = Math.sqrt(dx * dx + dy * dy) || 1;
3703
+ wctx.globalAlpha = alpha * 0.3;
3704
+ wctx.beginPath();
3705
+ wctx.moveTo(sx, sy);
3706
+ wctx.lineTo(sx + (dx / dist) * streakLen, sy + (dy / dist) * streakLen);
3707
+ wctx.strokeStyle = P.warpDotColor;
3708
+ wctx.lineWidth = size * 0.5;
3709
+ wctx.stroke();
3710
+ }
3711
+ }
3712
+ wctx.globalAlpha = 1;
3713
+ }
3714
+
3715
+ // ---------- render: everything derived from timeline time + state proxy ----------
3716
+ const startCol = new THREE.Color(P.portalStartColor);
3717
+ const endCol = new THREE.Color(P.bgColor);
3718
+
3719
+ function renderScene(t) {
3720
+ const S = window.__wptState;
3721
+ const portal = S.portal;
3722
+ const push = S.push;
3723
+ const transAmount = 1.0 - Math.abs(portal * 2 - 1);
3724
+ const effTrans = Math.min(1, Math.max(transAmount, S.exitFx * 0.85));
3725
+
3726
+ // Camera: FOV/distance lerp (2D -> 3D) plus exit push through the letters
3727
+ camera.fov = THREE.MathUtils.lerp(P.initialFOV, P.finalFOV, portal) + push * 10;
3728
+ camera.position.z =
3729
+ THREE.MathUtils.lerp(P.cameraDistance, P.cameraDistance3D, portal) -
3730
+ push * 52 +
3731
+ Math.sin(t * 0.34) * 1.6 * portal * (1 - push);
3732
+ const driftAmp = portal * (1 - 0.7 * push);
3733
+ camera.rotation.x = Math.cos(t * 0.47) * 0.04 * driftAmp;
3734
+ camera.rotation.y = Math.sin(t * 0.62 + 1.2) * 0.06 * driftAmp;
3735
+ camera.position.x = Math.sin(t * 0.41) * 1.4 * driftAmp;
3736
+ camera.position.y = Math.cos(t * 0.29) * 1.0 * driftAmp;
3737
+ camera.updateProjectionMatrix();
3738
+ camera.updateMatrixWorld();
3739
+
3740
+ // Portal composite
3741
+ portalPass.uniforms.uPortalRadius.value = portal * P.portalScale;
3742
+ portalPass.uniforms.uPortalProgress.value = portal;
3743
+ portalPass.uniforms.uTime.value = t;
3744
+
3745
+ // Vignette / scanline / CA scale with portal
3746
+ postfxPass.uniforms.uVignetteIntensity.value = P.vignetteIntensity * portal;
3747
+ postfxPass.uniforms.uChromaticAberration.value = P.chromaticAberration * portal;
3748
+ postfxPass.uniforms.uScanlineIntensity.value = P.scanlineIntensity * portal;
3749
+ postfxPass.uniforms.uTime.value = t;
3750
+
3751
+ const blurAmount = P.edgeBlur * portal;
3752
+ blurPassH.uniforms.uBlurAmount.value = blurAmount;
3753
+ blurPassV.uniforms.uBlurAmount.value = blurAmount;
3754
+
3755
+ // Transition FX peak at portal 0.5 + on the exit push
3756
+ transFXPass.uniforms.uTransAmount.value = effTrans;
3757
+
3758
+ // Block glitch ticks (the handoff envelope below follows duration/easing).
3759
+ glitchPass.uniforms.uTime.value = t;
3760
+ glitchPass.uniforms.uShakePower.value = P.glitchPower * S.glitch;
3761
+ glitchPass.uniforms.uShakeRate.value = S.glitch > 0.001 ? 1.0 : 0.0;
3762
+ glitchPass.uniforms.uShakeColorRate.value = P.glitchColorRate * Math.min(1, S.glitch * 1.8);
3763
+
3764
+ // Grid + background plane
3765
+ const showContent = portal > 0.01;
3766
+ gridLines.visible = showContent;
3767
+ contentGroup.visible = showContent;
3768
+ bgPlane.visible = showContent;
3769
+ const colorT = Math.min(1, Math.max(0, (portal - 0.15) * P.portalColorSpeed));
3770
+ bgPlaneMat.color.copy(startCol).lerp(endCol, colorT);
3771
+ gridMat.uniforms.uCameraPos.value.copy(camera.position);
3772
+ gridMat.uniforms.uTime.value = t;
3773
+
3774
+ // Floating shapes drift
3775
+ for (let i = 0; i < floatingShapes.length; i++) {
3776
+ const mesh = floatingShapes[i];
3777
+ const base = mesh.userData.basePos;
3778
+ const phase = i * 2.17;
3779
+ mesh.position.x =
3780
+ base.x + Math.sin(t * 0.15 + phase) * 1.2 + Math.sin(t * 0.07 + phase * 3) * 0.5;
3781
+ mesh.position.y =
3782
+ base.y + Math.sin(t * 0.12 + phase * 1.4) * 0.8 + Math.cos(t * 0.09 + phase * 2) * 0.3;
3783
+ mesh.position.z =
3784
+ base.z + Math.sin(t * 0.1 + phase * 0.7) * 0.6 + P.contentZOffset * portal;
3785
+ mesh.rotation.x = Math.sin(t * 0.08 + phase) * 0.4;
3786
+ mesh.rotation.y = t * 0.05 * (i % 2 === 0 ? 1 : -1) + phase;
3787
+ mesh.rotation.z = Math.sin(t * 0.06 + phase * 1.3) * 0.3;
3788
+ }
3789
+
3790
+ // Content: flat page -> per-letter depth and z-spread
3791
+ contentGroup.position.z = P.contentZOffset * portal;
3792
+ for (let i = 0; i < textMeshes.length; i++) {
3793
+ const obj = textMeshes[i];
3794
+ if (obj.userData.isLetter) {
3795
+ obj.position.z = obj.userData.targetZ * portal;
3796
+ const zScale = THREE.MathUtils.lerp(0.01, obj.userData.depthScale, portal);
3797
+ obj.scale.z = zScale;
3798
+ }
3799
+ obj.position.y = obj.userData.baseY + Math.sin(t * 0.6 + i * 0.7) * 0.12 * portal;
3800
+ }
3801
+ const handoffGlitch = handoffLetters(t, portal);
3802
+ recedeSupportingLines(t);
3803
+ const glitch = Math.max(S.glitch * 0.5, handoffGlitch * 0.35) * transition.glitch;
3804
+ glitchPass.uniforms.uShakePower.value = P.glitchPower * glitch;
3805
+ glitchPass.uniforms.uShakeRate.value = glitch > 0.001 ? 1 : 0;
3806
+ glitchPass.uniforms.uShakeColorRate.value = P.glitchColorRate * glitch * 1.8;
3807
+
3808
+ if (portal < 0.001) {
3809
+ renderer.clear();
3810
+ wctx.clearRect(0, 0, W, H);
3811
+ return;
3812
+ }
3813
+ composer.render();
3814
+ drawWarpDots(S);
3815
+ }
3816
+
3817
+ window.__wptRender = renderScene;
3818
+ const tl = window.__timelines["wireframe-portal-title"];
3819
+ renderScene(tl ? tl.time() : 0);
3820
+ /* The portal is closed at t=0 and draws nothing, so the first real draw would
3821
+ link every shader mid-playback. Draw across the timeline and flush the GPU
3822
+ before ready instead. */
3823
+ window.__hf = window.__hf || {};
3824
+ window.__hf.buildReady = window.__hf.buildReady || {};
3825
+ window.__hf.buildReady["wireframe-portal-title"] = (async () => {
3826
+ const warmDur = tl ? tl.duration() : 0;
3827
+ for (const f of [0.3, 0.5, 0.7]) {
3828
+ await new Promise((resolve) => window.__popostLater(resolve, 0));
3829
+ renderScene(warmDur * f);
3830
+ }
3831
+ renderScene(tl ? tl.time() : 0);
3832
+ renderer.getContext().finish();
3833
+ })();
3834
+
3835
+ })();
3836
+ </script>
3837
+ </div>
3838
+ <script>window.__popostFit();</script>
3839
+ </body>
3840
+ </html>