{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "globe",
  "type": "registry:block",
  "title": "Globe",
  "description": "Globe",
  "files": [
    {
      "path": "components/usages/globeusage.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport dynamic from \"next/dynamic\";\r\n\r\nimport { motion } from \"motion/react\";\r\n\r\nconst World = dynamic(\r\n\t() => import(\"@/registry/open-source/globe\").then((m) => m.World),\r\n\t{\r\n\t\tssr: false,\r\n\t}\r\n);\r\n\r\nexport default function GlobeDemo() {\r\n\tconst globeConfig = {\r\n\t\tpointSize: 4,\r\n\t\tglobeColor: \"#062056\",\r\n\t\tshowAtmosphere: true,\r\n\t\tatmosphereColor: \"#FFFFFF\",\r\n\t\tatmosphereAltitude: 0.1,\r\n\t\temissive: \"#062056\",\r\n\t\temissiveIntensity: 0.1,\r\n\t\tshininess: 0.9,\r\n\t\tpolygonColor: \"rgba(255,255,255,0.7)\",\r\n\t\tambientLight: \"#38bdf8\",\r\n\t\tdirectionalLeftLight: \"#ffffff\",\r\n\t\tdirectionalTopLight: \"#ffffff\",\r\n\t\tpointLight: \"#ffffff\",\r\n\t\tarcTime: 1000,\r\n\t\tarcLength: 0.9,\r\n\t\trings: 1,\r\n\t\tmaxRings: 3,\r\n\t\tinitialPosition: { lat: 22.3193, lng: 114.1694 },\r\n\t\tautoRotate: true,\r\n\t\tautoRotateSpeed: 0.5,\r\n\t};\r\n\tconst colors = [\"#06b6d4\", \"#3b82f6\", \"#6366f1\"];\r\n\tconst sampleArcs = [\r\n\t\t{\r\n\t\t\torder: 1,\r\n\t\t\tstartLat: -19.885592,\r\n\t\t\tstartLng: -43.951191,\r\n\t\t\tendLat: -22.9068,\r\n\t\t\tendLng: -43.1729,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 1,\r\n\t\t\tstartLat: 28.6139,\r\n\t\t\tstartLng: 77.209,\r\n\t\t\tendLat: 3.139,\r\n\t\t\tendLng: 101.6869,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 1,\r\n\t\t\tstartLat: -19.885592,\r\n\t\t\tstartLng: -43.951191,\r\n\t\t\tendLat: -1.303396,\r\n\t\t\tendLng: 36.852443,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 2,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: 35.6762,\r\n\t\t\tendLng: 139.6503,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 2,\r\n\t\t\tstartLat: 51.5072,\r\n\t\t\tstartLng: -0.1276,\r\n\t\t\tendLat: 3.139,\r\n\t\t\tendLng: 101.6869,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 2,\r\n\t\t\tstartLat: -15.785493,\r\n\t\t\tstartLng: -47.909029,\r\n\t\t\tendLat: 36.162809,\r\n\t\t\tendLng: -115.119411,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 3,\r\n\t\t\tstartLat: -33.8688,\r\n\t\t\tstartLng: 151.2093,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 3,\r\n\t\t\tstartLat: 21.3099,\r\n\t\t\tstartLng: -157.8581,\r\n\t\t\tendLat: 40.7128,\r\n\t\t\tendLng: -74.006,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 3,\r\n\t\t\tstartLat: -6.2088,\r\n\t\t\tstartLng: 106.8456,\r\n\t\t\tendLat: 51.5072,\r\n\t\t\tendLng: -0.1276,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 4,\r\n\t\t\tstartLat: 11.986597,\r\n\t\t\tstartLng: 8.571831,\r\n\t\t\tendLat: -15.595412,\r\n\t\t\tendLng: -56.05918,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 4,\r\n\t\t\tstartLat: -34.6037,\r\n\t\t\tstartLng: -58.3816,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 4,\r\n\t\t\tstartLat: 51.5072,\r\n\t\t\tstartLng: -0.1276,\r\n\t\t\tendLat: 48.8566,\r\n\t\t\tendLng: -2.3522,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 5,\r\n\t\t\tstartLat: 14.5995,\r\n\t\t\tstartLng: 120.9842,\r\n\t\t\tendLat: 51.5072,\r\n\t\t\tendLng: -0.1276,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 5,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: -33.8688,\r\n\t\t\tendLng: 151.2093,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 5,\r\n\t\t\tstartLat: 34.0522,\r\n\t\t\tstartLng: -118.2437,\r\n\t\t\tendLat: 48.8566,\r\n\t\t\tendLng: -2.3522,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 6,\r\n\t\t\tstartLat: -15.432563,\r\n\t\t\tstartLng: 28.315853,\r\n\t\t\tendLat: 1.094136,\r\n\t\t\tendLng: -63.34546,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 6,\r\n\t\t\tstartLat: 37.5665,\r\n\t\t\tstartLng: 126.978,\r\n\t\t\tendLat: 35.6762,\r\n\t\t\tendLng: 139.6503,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 6,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: 51.5072,\r\n\t\t\tendLng: -0.1276,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 7,\r\n\t\t\tstartLat: -19.885592,\r\n\t\t\tstartLng: -43.951191,\r\n\t\t\tendLat: -15.595412,\r\n\t\t\tendLng: -56.05918,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 7,\r\n\t\t\tstartLat: 48.8566,\r\n\t\t\tstartLng: -2.3522,\r\n\t\t\tendLat: 52.52,\r\n\t\t\tendLng: 13.405,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 7,\r\n\t\t\tstartLat: 52.52,\r\n\t\t\tstartLng: 13.405,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 8,\r\n\t\t\tstartLat: -8.833221,\r\n\t\t\tstartLng: 13.264837,\r\n\t\t\tendLat: -33.936138,\r\n\t\t\tendLng: 18.436529,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 8,\r\n\t\t\tstartLat: 49.2827,\r\n\t\t\tstartLng: -123.1207,\r\n\t\t\tendLat: 52.3676,\r\n\t\t\tendLng: 4.9041,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 8,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: 40.7128,\r\n\t\t\tendLng: -74.006,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 9,\r\n\t\t\tstartLat: 51.5072,\r\n\t\t\tstartLng: -0.1276,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 9,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: -22.9068,\r\n\t\t\tendLng: -43.1729,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 9,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: -34.6037,\r\n\t\t\tendLng: -58.3816,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 10,\r\n\t\t\tstartLat: -22.9068,\r\n\t\t\tstartLng: -43.1729,\r\n\t\t\tendLat: 28.6139,\r\n\t\t\tendLng: 77.209,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 10,\r\n\t\t\tstartLat: 34.0522,\r\n\t\t\tstartLng: -118.2437,\r\n\t\t\tendLat: 31.2304,\r\n\t\t\tendLng: 121.4737,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 10,\r\n\t\t\tstartLat: -6.2088,\r\n\t\t\tstartLng: 106.8456,\r\n\t\t\tendLat: 52.3676,\r\n\t\t\tendLng: 4.9041,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 11,\r\n\t\t\tstartLat: 41.9028,\r\n\t\t\tstartLng: 12.4964,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 11,\r\n\t\t\tstartLat: -6.2088,\r\n\t\t\tstartLng: 106.8456,\r\n\t\t\tendLat: 31.2304,\r\n\t\t\tendLng: 121.4737,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 11,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: 1.3521,\r\n\t\t\tendLng: 103.8198,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 12,\r\n\t\t\tstartLat: 34.0522,\r\n\t\t\tstartLng: -118.2437,\r\n\t\t\tendLat: 37.7749,\r\n\t\t\tendLng: -122.4194,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 12,\r\n\t\t\tstartLat: 35.6762,\r\n\t\t\tstartLng: 139.6503,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 12,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 13,\r\n\t\t\tstartLat: 52.52,\r\n\t\t\tstartLng: 13.405,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 13,\r\n\t\t\tstartLat: 11.986597,\r\n\t\t\tstartLng: 8.571831,\r\n\t\t\tendLat: 35.6762,\r\n\t\t\tendLng: 139.6503,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 13,\r\n\t\t\tstartLat: -22.9068,\r\n\t\t\tstartLng: -43.1729,\r\n\t\t\tendLat: -34.6037,\r\n\t\t\tendLng: -58.3816,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 14,\r\n\t\t\tstartLat: -33.936138,\r\n\t\t\tstartLng: 18.436529,\r\n\t\t\tendLat: 21.395643,\r\n\t\t\tendLng: 39.883798,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t];\r\n\r\n\treturn (\r\n\t\t<div className=\"flex flex-row items-center justify-center py-20 h-screen md:h-auto dark:bg-background bg-background relative w-full\">\r\n\t\t\t<div className=\"max-w-7xl mx-auto w-full relative overflow-hidden h-full md:h-160 px-4\">\r\n\t\t\t\t<motion.div\r\n\t\t\t\t\tinitial={{\r\n\t\t\t\t\t\topacity: 0,\r\n\t\t\t\t\t\ty: 20,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tanimate={{\r\n\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t\ty: 0,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\ttransition={{\r\n\t\t\t\t\t\tduration: 1,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tclassName=\"div\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<h2 className=\"text-center text-xl md:text-4xl font-bold text-secondary dark:text-secondary\">\r\n\t\t\t\t\t\tWe sell soap worldwide\r\n\t\t\t\t\t</h2>\r\n\t\t\t\t\t<p className=\"text-center text-base md:text-lg font-normal text-secondary dark:text-secondary max-w-md mt-2 mx-auto\">\r\n\t\t\t\t\t\tThis globe is interactive and customizable. Have fun with it,\r\n\t\t\t\t\t\tand don&apos;t forget to share it. :)\r\n\t\t\t\t\t</p>\r\n\t\t\t\t</motion.div>\r\n\t\t\t\t<div className=\"absolute w-full bottom-0 inset-x-0 h-40 bg-linear-to-b pointer-events-none select-none from-transparent dark:to-background to-background z-40\" />\r\n\t\t\t\t<div className=\"absolute w-full -bottom-20 h-72 md:h-full z-10\">\r\n\t\t\t\t\t<World data={sampleArcs} globeConfig={globeConfig} />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n}\r\n",
      "type": "registry:block",
      "target": "~/example.tsx"
    },
    {
      "path": "components/usages/globeusage.tsx",
      "content": "\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport dynamic from \"next/dynamic\";\r\n\r\nimport { motion } from \"motion/react\";\r\n\r\nconst World = dynamic(\r\n\t() => import(\"@/registry/open-source/globe\").then((m) => m.World),\r\n\t{\r\n\t\tssr: false,\r\n\t}\r\n);\r\n\r\nexport default function GlobeDemo() {\r\n\tconst globeConfig = {\r\n\t\tpointSize: 4,\r\n\t\tglobeColor: \"#062056\",\r\n\t\tshowAtmosphere: true,\r\n\t\tatmosphereColor: \"#FFFFFF\",\r\n\t\tatmosphereAltitude: 0.1,\r\n\t\temissive: \"#062056\",\r\n\t\temissiveIntensity: 0.1,\r\n\t\tshininess: 0.9,\r\n\t\tpolygonColor: \"rgba(255,255,255,0.7)\",\r\n\t\tambientLight: \"#38bdf8\",\r\n\t\tdirectionalLeftLight: \"#ffffff\",\r\n\t\tdirectionalTopLight: \"#ffffff\",\r\n\t\tpointLight: \"#ffffff\",\r\n\t\tarcTime: 1000,\r\n\t\tarcLength: 0.9,\r\n\t\trings: 1,\r\n\t\tmaxRings: 3,\r\n\t\tinitialPosition: { lat: 22.3193, lng: 114.1694 },\r\n\t\tautoRotate: true,\r\n\t\tautoRotateSpeed: 0.5,\r\n\t};\r\n\tconst colors = [\"#06b6d4\", \"#3b82f6\", \"#6366f1\"];\r\n\tconst sampleArcs = [\r\n\t\t{\r\n\t\t\torder: 1,\r\n\t\t\tstartLat: -19.885592,\r\n\t\t\tstartLng: -43.951191,\r\n\t\t\tendLat: -22.9068,\r\n\t\t\tendLng: -43.1729,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 1,\r\n\t\t\tstartLat: 28.6139,\r\n\t\t\tstartLng: 77.209,\r\n\t\t\tendLat: 3.139,\r\n\t\t\tendLng: 101.6869,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 1,\r\n\t\t\tstartLat: -19.885592,\r\n\t\t\tstartLng: -43.951191,\r\n\t\t\tendLat: -1.303396,\r\n\t\t\tendLng: 36.852443,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 2,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: 35.6762,\r\n\t\t\tendLng: 139.6503,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 2,\r\n\t\t\tstartLat: 51.5072,\r\n\t\t\tstartLng: -0.1276,\r\n\t\t\tendLat: 3.139,\r\n\t\t\tendLng: 101.6869,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 2,\r\n\t\t\tstartLat: -15.785493,\r\n\t\t\tstartLng: -47.909029,\r\n\t\t\tendLat: 36.162809,\r\n\t\t\tendLng: -115.119411,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 3,\r\n\t\t\tstartLat: -33.8688,\r\n\t\t\tstartLng: 151.2093,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 3,\r\n\t\t\tstartLat: 21.3099,\r\n\t\t\tstartLng: -157.8581,\r\n\t\t\tendLat: 40.7128,\r\n\t\t\tendLng: -74.006,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 3,\r\n\t\t\tstartLat: -6.2088,\r\n\t\t\tstartLng: 106.8456,\r\n\t\t\tendLat: 51.5072,\r\n\t\t\tendLng: -0.1276,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 4,\r\n\t\t\tstartLat: 11.986597,\r\n\t\t\tstartLng: 8.571831,\r\n\t\t\tendLat: -15.595412,\r\n\t\t\tendLng: -56.05918,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 4,\r\n\t\t\tstartLat: -34.6037,\r\n\t\t\tstartLng: -58.3816,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 4,\r\n\t\t\tstartLat: 51.5072,\r\n\t\t\tstartLng: -0.1276,\r\n\t\t\tendLat: 48.8566,\r\n\t\t\tendLng: -2.3522,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 5,\r\n\t\t\tstartLat: 14.5995,\r\n\t\t\tstartLng: 120.9842,\r\n\t\t\tendLat: 51.5072,\r\n\t\t\tendLng: -0.1276,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 5,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: -33.8688,\r\n\t\t\tendLng: 151.2093,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 5,\r\n\t\t\tstartLat: 34.0522,\r\n\t\t\tstartLng: -118.2437,\r\n\t\t\tendLat: 48.8566,\r\n\t\t\tendLng: -2.3522,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 6,\r\n\t\t\tstartLat: -15.432563,\r\n\t\t\tstartLng: 28.315853,\r\n\t\t\tendLat: 1.094136,\r\n\t\t\tendLng: -63.34546,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 6,\r\n\t\t\tstartLat: 37.5665,\r\n\t\t\tstartLng: 126.978,\r\n\t\t\tendLat: 35.6762,\r\n\t\t\tendLng: 139.6503,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 6,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: 51.5072,\r\n\t\t\tendLng: -0.1276,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 7,\r\n\t\t\tstartLat: -19.885592,\r\n\t\t\tstartLng: -43.951191,\r\n\t\t\tendLat: -15.595412,\r\n\t\t\tendLng: -56.05918,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 7,\r\n\t\t\tstartLat: 48.8566,\r\n\t\t\tstartLng: -2.3522,\r\n\t\t\tendLat: 52.52,\r\n\t\t\tendLng: 13.405,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 7,\r\n\t\t\tstartLat: 52.52,\r\n\t\t\tstartLng: 13.405,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 8,\r\n\t\t\tstartLat: -8.833221,\r\n\t\t\tstartLng: 13.264837,\r\n\t\t\tendLat: -33.936138,\r\n\t\t\tendLng: 18.436529,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 8,\r\n\t\t\tstartLat: 49.2827,\r\n\t\t\tstartLng: -123.1207,\r\n\t\t\tendLat: 52.3676,\r\n\t\t\tendLng: 4.9041,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 8,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: 40.7128,\r\n\t\t\tendLng: -74.006,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 9,\r\n\t\t\tstartLat: 51.5072,\r\n\t\t\tstartLng: -0.1276,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 9,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: -22.9068,\r\n\t\t\tendLng: -43.1729,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 9,\r\n\t\t\tstartLat: 1.3521,\r\n\t\t\tstartLng: 103.8198,\r\n\t\t\tendLat: -34.6037,\r\n\t\t\tendLng: -58.3816,\r\n\t\t\tarcAlt: 0.5,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 10,\r\n\t\t\tstartLat: -22.9068,\r\n\t\t\tstartLng: -43.1729,\r\n\t\t\tendLat: 28.6139,\r\n\t\t\tendLng: 77.209,\r\n\t\t\tarcAlt: 0.7,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 10,\r\n\t\t\tstartLat: 34.0522,\r\n\t\t\tstartLng: -118.2437,\r\n\t\t\tendLat: 31.2304,\r\n\t\t\tendLng: 121.4737,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 10,\r\n\t\t\tstartLat: -6.2088,\r\n\t\t\tstartLng: 106.8456,\r\n\t\t\tendLat: 52.3676,\r\n\t\t\tendLng: 4.9041,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 11,\r\n\t\t\tstartLat: 41.9028,\r\n\t\t\tstartLng: 12.4964,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 11,\r\n\t\t\tstartLat: -6.2088,\r\n\t\t\tstartLng: 106.8456,\r\n\t\t\tendLat: 31.2304,\r\n\t\t\tendLng: 121.4737,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 11,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: 1.3521,\r\n\t\t\tendLng: 103.8198,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 12,\r\n\t\t\tstartLat: 34.0522,\r\n\t\t\tstartLng: -118.2437,\r\n\t\t\tendLat: 37.7749,\r\n\t\t\tendLng: -122.4194,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 12,\r\n\t\t\tstartLat: 35.6762,\r\n\t\t\tstartLng: 139.6503,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.2,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 12,\r\n\t\t\tstartLat: 22.3193,\r\n\t\t\tstartLng: 114.1694,\r\n\t\t\tendLat: 34.0522,\r\n\t\t\tendLng: -118.2437,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 13,\r\n\t\t\tstartLat: 52.52,\r\n\t\t\tstartLng: 13.405,\r\n\t\t\tendLat: 22.3193,\r\n\t\t\tendLng: 114.1694,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 13,\r\n\t\t\tstartLat: 11.986597,\r\n\t\t\tstartLng: 8.571831,\r\n\t\t\tendLat: 35.6762,\r\n\t\t\tendLng: 139.6503,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 13,\r\n\t\t\tstartLat: -22.9068,\r\n\t\t\tstartLng: -43.1729,\r\n\t\t\tendLat: -34.6037,\r\n\t\t\tendLng: -58.3816,\r\n\t\t\tarcAlt: 0.1,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t\t{\r\n\t\t\torder: 14,\r\n\t\t\tstartLat: -33.936138,\r\n\t\t\tstartLng: 18.436529,\r\n\t\t\tendLat: 21.395643,\r\n\t\t\tendLng: 39.883798,\r\n\t\t\tarcAlt: 0.3,\r\n\t\t\tcolor: colors[Math.floor(Math.random() * (colors.length - 1))],\r\n\t\t},\r\n\t];\r\n\r\n\treturn (\r\n\t\t<div className=\"flex flex-row items-center justify-center py-20 h-screen md:h-auto dark:bg-background bg-background relative w-full\">\r\n\t\t\t<div className=\"max-w-7xl mx-auto w-full relative overflow-hidden h-full md:h-160 px-4\">\r\n\t\t\t\t<motion.div\r\n\t\t\t\t\tinitial={{\r\n\t\t\t\t\t\topacity: 0,\r\n\t\t\t\t\t\ty: 20,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tanimate={{\r\n\t\t\t\t\t\topacity: 1,\r\n\t\t\t\t\t\ty: 0,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\ttransition={{\r\n\t\t\t\t\t\tduration: 1,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tclassName=\"div\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<h2 className=\"text-center text-xl md:text-4xl font-bold text-secondary dark:text-secondary\">\r\n\t\t\t\t\t\tWe sell soap worldwide\r\n\t\t\t\t\t</h2>\r\n\t\t\t\t\t<p className=\"text-center text-base md:text-lg font-normal text-secondary dark:text-secondary max-w-md mt-2 mx-auto\">\r\n\t\t\t\t\t\tThis globe is interactive and customizable. Have fun with it,\r\n\t\t\t\t\t\tand don&apos;t forget to share it. :)\r\n\t\t\t\t\t</p>\r\n\t\t\t\t</motion.div>\r\n\t\t\t\t<div className=\"absolute w-full bottom-0 inset-x-0 h-40 bg-linear-to-b pointer-events-none select-none from-transparent dark:to-background to-background z-40\" />\r\n\t\t\t\t<div className=\"absolute w-full -bottom-20 h-72 md:h-full z-10\">\r\n\t\t\t\t\t<World data={sampleArcs} globeConfig={globeConfig} />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n}\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/open-source/globe.tsx",
      "content": "\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\n\r\nimport countries from \"@/registry/utilities/globe.json\";\r\nimport { OrbitControls } from \"@react-three/drei\";\r\nimport { Canvas, extend, useThree } from \"@react-three/fiber\";\r\nimport { Color, Fog, PerspectiveCamera, Scene, Vector3 } from \"three\";\r\nimport ThreeGlobe from \"three-globe\";\r\n\r\n// Credit:\r\n// https://ui.aceternity.com/components/github-globe\r\n\r\ndeclare module \"@react-three/fiber\" {\r\n\tinterface ThreeElements {\r\n\t\tthreeGlobe: ThreeElements[\"mesh\"] & {\r\n\t\t\tnew (): ThreeGlobe;\r\n\t\t};\r\n\t}\r\n}\r\n\r\nextend({ ThreeGlobe: ThreeGlobe });\r\n\r\nconst RING_PROPAGATION_SPEED = 3;\r\nconst aspect = 1.2;\r\nconst cameraZ = 300;\r\n\r\ntype Position = {\r\n\torder: number;\r\n\tstartLat: number;\r\n\tstartLng: number;\r\n\tendLat: number;\r\n\tendLng: number;\r\n\tarcAlt: number;\r\n\tcolor: string;\r\n};\r\n\r\nexport type GlobeConfig = {\r\n\tpointSize?: number;\r\n\tglobeColor?: string;\r\n\tshowAtmosphere?: boolean;\r\n\tatmosphereColor?: string;\r\n\tatmosphereAltitude?: number;\r\n\temissive?: string;\r\n\temissiveIntensity?: number;\r\n\tshininess?: number;\r\n\tpolygonColor?: string;\r\n\tambientLight?: string;\r\n\tdirectionalLeftLight?: string;\r\n\tdirectionalTopLight?: string;\r\n\tpointLight?: string;\r\n\tarcTime?: number;\r\n\tarcLength?: number;\r\n\trings?: number;\r\n\tmaxRings?: number;\r\n\tinitialPosition?: {\r\n\t\tlat: number;\r\n\t\tlng: number;\r\n\t};\r\n\tautoRotate?: boolean;\r\n\tautoRotateSpeed?: number;\r\n};\r\n\r\ninterface WorldProps {\r\n\tglobeConfig: GlobeConfig;\r\n\tdata: Position[];\r\n}\r\n\r\nlet numbersOfRings = [0];\r\n\r\nexport function Globe({ globeConfig, data }: WorldProps) {\r\n\tconst globeRef = useRef<ThreeGlobe | null>(null);\r\n\tconst groupRef = useRef(null);\r\n\tconst [isInitialized, setIsInitialized] = useState(false);\r\n\r\n\tconst defaultProps = {\r\n\t\tpointSize: 1,\r\n\t\tatmosphereColor: \"#ffffff\",\r\n\t\tshowAtmosphere: true,\r\n\t\tatmosphereAltitude: 0.1,\r\n\t\tpolygonColor: \"rgba(255,255,255,0.7)\",\r\n\t\tglobeColor: \"#1d072e\",\r\n\t\temissive: \"#000000\",\r\n\t\temissiveIntensity: 0.1,\r\n\t\tshininess: 0.9,\r\n\t\tarcTime: 2000,\r\n\t\tarcLength: 0.9,\r\n\t\trings: 1,\r\n\t\tmaxRings: 3,\r\n\t\t...globeConfig,\r\n\t};\r\n\r\n\t// Initialize globe only once\r\n\tuseEffect(() => {\r\n\t\tif (!globeRef.current && groupRef.current) {\r\n\t\t\tglobeRef.current = new ThreeGlobe();\r\n\t\t\t(groupRef.current as any).add(globeRef.current);\r\n\t\t\tsetIsInitialized(true);\r\n\t\t}\r\n\t}, []);\r\n\r\n\t// Build material when globe is initialized or when relevant props change\r\n\tuseEffect(() => {\r\n\t\tif (!globeRef.current || !isInitialized) return;\r\n\r\n\t\tconst globeMaterial = globeRef.current.globeMaterial() as unknown as {\r\n\t\t\tcolor: Color;\r\n\t\t\temissive: Color;\r\n\t\t\temissiveIntensity: number;\r\n\t\t\tshininess: number;\r\n\t\t};\r\n\t\tglobeMaterial.color = new Color(globeConfig.globeColor);\r\n\t\tglobeMaterial.emissive = new Color(globeConfig.emissive);\r\n\t\tglobeMaterial.emissiveIntensity = globeConfig.emissiveIntensity || 0.1;\r\n\t\tglobeMaterial.shininess = globeConfig.shininess || 0.9;\r\n\t}, [\r\n\t\tisInitialized,\r\n\t\tglobeConfig.globeColor,\r\n\t\tglobeConfig.emissive,\r\n\t\tglobeConfig.emissiveIntensity,\r\n\t\tglobeConfig.shininess,\r\n\t]);\r\n\r\n\t// Build data when globe is initialized or when data changes\r\n\tuseEffect(() => {\r\n\t\tif (!globeRef.current || !isInitialized || !data) return;\r\n\r\n\t\tconst arcs = data;\r\n\t\tlet points = [];\r\n\t\tfor (let i = 0; i < arcs.length; i++) {\r\n\t\t\tconst arc = arcs[i];\r\n\t\t\tconst rgb = hexToRgb(arc.color) as { r: number; g: number; b: number };\r\n\t\t\tpoints.push({\r\n\t\t\t\tsize: defaultProps.pointSize,\r\n\t\t\t\torder: arc.order,\r\n\t\t\t\tcolor: arc.color,\r\n\t\t\t\tlat: arc.startLat,\r\n\t\t\t\tlng: arc.startLng,\r\n\t\t\t});\r\n\t\t\tpoints.push({\r\n\t\t\t\tsize: defaultProps.pointSize,\r\n\t\t\t\torder: arc.order,\r\n\t\t\t\tcolor: arc.color,\r\n\t\t\t\tlat: arc.endLat,\r\n\t\t\t\tlng: arc.endLng,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// remove duplicates for same lat and lng\r\n\t\tconst filteredPoints = points.filter(\r\n\t\t\t(v, i, a) =>\r\n\t\t\t\ta.findIndex((v2) =>\r\n\t\t\t\t\t[\"lat\", \"lng\"].every(\r\n\t\t\t\t\t\t(k) => v2[k as \"lat\" | \"lng\"] === v[k as \"lat\" | \"lng\"]\r\n\t\t\t\t\t)\r\n\t\t\t\t) === i\r\n\t\t);\r\n\r\n\t\tglobeRef.current\r\n\t\t\t.hexPolygonsData(countries.features)\r\n\t\t\t.hexPolygonResolution(3)\r\n\t\t\t.hexPolygonMargin(0.7)\r\n\t\t\t.showAtmosphere(defaultProps.showAtmosphere)\r\n\t\t\t.atmosphereColor(defaultProps.atmosphereColor)\r\n\t\t\t.atmosphereAltitude(defaultProps.atmosphereAltitude)\r\n\t\t\t.hexPolygonColor(() => defaultProps.polygonColor);\r\n\r\n\t\tglobeRef.current\r\n\t\t\t.arcsData(data)\r\n\t\t\t.arcStartLat((d) => (d as { startLat: number }).startLat * 1)\r\n\t\t\t.arcStartLng((d) => (d as { startLng: number }).startLng * 1)\r\n\t\t\t.arcEndLat((d) => (d as { endLat: number }).endLat * 1)\r\n\t\t\t.arcEndLng((d) => (d as { endLng: number }).endLng * 1)\r\n\t\t\t.arcColor((e: any) => (e as { color: string }).color)\r\n\t\t\t.arcAltitude((e) => (e as { arcAlt: number }).arcAlt * 1)\r\n\t\t\t.arcStroke(() => [0.32, 0.28, 0.3][Math.round(Math.random() * 2)])\r\n\t\t\t.arcDashLength(defaultProps.arcLength)\r\n\t\t\t.arcDashInitialGap((e) => (e as { order: number }).order * 1)\r\n\t\t\t.arcDashGap(15)\r\n\t\t\t.arcDashAnimateTime(() => defaultProps.arcTime);\r\n\r\n\t\tglobeRef.current\r\n\t\t\t.pointsData(filteredPoints)\r\n\t\t\t.pointColor((e) => (e as { color: string }).color)\r\n\t\t\t.pointsMerge(true)\r\n\t\t\t.pointAltitude(0.0)\r\n\t\t\t.pointRadius(2);\r\n\r\n\t\tglobeRef.current\r\n\t\t\t.ringsData([])\r\n\t\t\t.ringColor(() => defaultProps.polygonColor)\r\n\t\t\t.ringMaxRadius(defaultProps.maxRings)\r\n\t\t\t.ringPropagationSpeed(RING_PROPAGATION_SPEED)\r\n\t\t\t.ringRepeatPeriod(\r\n\t\t\t\t(defaultProps.arcTime * defaultProps.arcLength) / defaultProps.rings\r\n\t\t\t);\r\n\t}, [\r\n\t\tisInitialized,\r\n\t\tdata,\r\n\t\tdefaultProps.pointSize,\r\n\t\tdefaultProps.showAtmosphere,\r\n\t\tdefaultProps.atmosphereColor,\r\n\t\tdefaultProps.atmosphereAltitude,\r\n\t\tdefaultProps.polygonColor,\r\n\t\tdefaultProps.arcLength,\r\n\t\tdefaultProps.arcTime,\r\n\t\tdefaultProps.rings,\r\n\t\tdefaultProps.maxRings,\r\n\t]);\r\n\r\n\t// Handle rings animation with cleanup\r\n\tuseEffect(() => {\r\n\t\tif (!globeRef.current || !isInitialized || !data) return;\r\n\r\n\t\tconst interval = setInterval(() => {\r\n\t\t\tif (!globeRef.current) return;\r\n\r\n\t\t\tconst newNumbersOfRings = genRandomNumbers(\r\n\t\t\t\t0,\r\n\t\t\t\tdata.length,\r\n\t\t\t\tMath.floor((data.length * 4) / 5)\r\n\t\t\t);\r\n\r\n\t\t\tconst ringsData = data\r\n\t\t\t\t.filter((d, i) => newNumbersOfRings.includes(i))\r\n\t\t\t\t.map((d) => ({\r\n\t\t\t\t\tlat: d.startLat,\r\n\t\t\t\t\tlng: d.startLng,\r\n\t\t\t\t\tcolor: d.color,\r\n\t\t\t\t}));\r\n\r\n\t\t\tglobeRef.current.ringsData(ringsData);\r\n\t\t}, 2000);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearInterval(interval);\r\n\t\t};\r\n\t}, [isInitialized, data]);\r\n\r\n\treturn <group ref={groupRef} />;\r\n}\r\n\r\nexport function WebGLRendererConfig() {\r\n\tconst { gl, size } = useThree();\r\n\r\n\tuseEffect(() => {\r\n\t\tgl.setPixelRatio(window.devicePixelRatio);\r\n\t\tgl.setSize(size.width, size.height);\r\n\t\tgl.setClearColor(0xffaaff, 0);\r\n\t}, []);\r\n\r\n\treturn null;\r\n}\r\n\r\nexport function World(props: WorldProps) {\r\n\tconst { globeConfig } = props;\r\n\tconst scene = new Scene();\r\n\tscene.fog = new Fog(0xffffff, 400, 2000);\r\n\treturn (\r\n\t\t<Canvas\r\n\t\t\tscene={scene}\r\n\t\t\tcamera={new PerspectiveCamera(50, aspect, 180, 1800)}\r\n\t\t>\r\n\t\t\t<WebGLRendererConfig />\r\n\t\t\t<ambientLight color={globeConfig.ambientLight} intensity={0.6} />\r\n\t\t\t<directionalLight\r\n\t\t\t\tcolor={globeConfig.directionalLeftLight}\r\n\t\t\t\tposition={new Vector3(-400, 100, 400)}\r\n\t\t\t/>\r\n\t\t\t<directionalLight\r\n\t\t\t\tcolor={globeConfig.directionalTopLight}\r\n\t\t\t\tposition={new Vector3(-200, 500, 200)}\r\n\t\t\t/>\r\n\t\t\t<pointLight\r\n\t\t\t\tcolor={globeConfig.pointLight}\r\n\t\t\t\tposition={new Vector3(-200, 500, 200)}\r\n\t\t\t\tintensity={0.8}\r\n\t\t\t/>\r\n\t\t\t<Globe {...props} />\r\n\t\t\t<OrbitControls\r\n\t\t\t\tenablePan={false}\r\n\t\t\t\tenableZoom={false}\r\n\t\t\t\tminDistance={cameraZ}\r\n\t\t\t\tmaxDistance={cameraZ}\r\n\t\t\t\tautoRotateSpeed={1}\r\n\t\t\t\tautoRotate={true}\r\n\t\t\t\tminPolarAngle={Math.PI / 3.5}\r\n\t\t\t\tmaxPolarAngle={Math.PI - Math.PI / 3}\r\n\t\t\t/>\r\n\t\t</Canvas>\r\n\t);\r\n}\r\n\r\nexport function hexToRgb(hex: string) {\r\n\tvar shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n\thex = hex.replace(shorthandRegex, function (m, r, g, b) {\r\n\t\treturn r + r + g + g + b + b;\r\n\t});\r\n\r\n\tvar result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n\treturn result\r\n\t\t? {\r\n\t\t\t\tr: parseInt(result[1], 16),\r\n\t\t\t\tg: parseInt(result[2], 16),\r\n\t\t\t\tb: parseInt(result[3], 16),\r\n\t\t\t}\r\n\t\t: null;\r\n}\r\n\r\nexport function genRandomNumbers(min: number, max: number, count: number) {\r\n\tconst arr = [];\r\n\twhile (arr.length < count) {\r\n\t\tconst r = Math.floor(Math.random() * (max - min)) + min;\r\n\t\tif (arr.indexOf(r) === -1) arr.push(r);\r\n\t}\r\n\r\n\treturn arr;\r\n}\r\n",
      "type": "registry:ui"
    }
  ]
}