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,EAAK,IAAI,CACf,UAAW,CAAC,CAAA,SAAE,CAAQ,CAAE,GACtB,AAAA,CAAA,EAAA,EAAA,UAAS,AAAT,EACE,uDACA,mFACA,EACI,+BACA,wDACJ,EAAW,MAAM,CAAiB,KAGtC,QACE,EAAK,OAAO,CACR,AAAA,IACE,EAAK,OAAO,EAAI,EAAK,OAAO,CAAC,EAC/B,EACA,KAAA,EAGL,SAAA,EAAK,KAAK,AApBN,EAAA,EAAK,KAAK,E,E,EA0B3B,C","sources":["","src/js/Root/SubNav.tsx"],"sourcesContent":["\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true, configurable: true});\n}\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n var parcelRequire = $parcel$global[\"parcelRequire3976\"];\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"4Hh9A\", function(module, exports) {\n\n$parcel$defineInteropFlag(module.exports);\n\n$parcel$export(module.exports, \"default\", function () { return $2967ee55962dc96b$export$2e2bcd8739ae039; });\n\nvar $e1vzu = parcelRequire(\"e1vzu\");\n\nvar $dD535 = parcelRequire(\"dD535\");\n\nvar $3QbnI = parcelRequire(\"3QbnI\");\n\nvar $2BiEt = parcelRequire(\"2BiEt\");\n\nvar $ctHcP = parcelRequire(\"ctHcP\");\nconst $2967ee55962dc96b$var$SubNav = ()=>{\n const { setIsOpen: setOpenHelp } = (0, $3QbnI.useContext)((0, $ctHcP.HelpModalContext));\n const pageType = document.querySelector(\"[data-type]\")?.dataset.type ?? \"\";\n const navigation = [\n {\n label: \"About\",\n href: \"/index.html\"\n },\n {\n label: \"Digital Access\",\n href: \"/digital-access.html\"\n },\n {\n label: \"Translation\",\n href: \"/translation.html\"\n },\n {\n label: \"Pre-Order Printed Bibles\",\n href: \"/pre-order.html\"\n },\n {\n label: \"Help\",\n href: \"\",\n onClick: (evt)=>{\n if (evt) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n setOpenHelp(true);\n }\n }\n ];\n const currentPage = navigation.findIndex((n)=>n.label.toLowerCase() === pageType);\n return /*#__PURE__*/ (0, $e1vzu.jsx)((0, $dD535.TabGroup), {\n defaultIndex: currentPage,\n selectedIndex: currentPage,\n onChange: (index)=>{\n const link = navigation[index];\n if (link.onClick) link.onClick();\n else // @ts-expect-error not sure how to type this\n window.location = link.href;\n },\n manual: true,\n children: /*#__PURE__*/ (0, $e1vzu.jsx)((0, $dD535.TabList), {\n className: \"flex flex-wrap items-center justify-center space-x-3 p-1 text-center sm:space-x-4\",\n children: navigation.map((link, index)=>/*#__PURE__*/ (0, $e1vzu.jsx)((0, $dD535.Tab), {\n as: \"a\",\n href: link.href,\n className: ({ selected: selected })=>(0, $2BiEt.classNames)(\"rounded-lg p-2 text-sm font-medium whitespace-nowrap\", \"ring-white/60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2\", selected ? \"bg-white shadow text-sky-700\" : \"text-blue-100 hover:bg-white/[0.12] hover:text-white\", navigation.length - 1 === index ? \"\" : \"\"),\n onClick: link.onClick ? (evt)=>{\n link.onClick && link.onClick(evt);\n } : undefined,\n children: link.label\n }, link.label))\n })\n });\n};\nvar $2967ee55962dc96b$export$2e2bcd8739ae039 = $2967ee55962dc96b$var$SubNav;\n\n});\n\n\n//# sourceMappingURL=SubNav.07715b50.js.map\n","import { Tab, TabGroup, TabList } from \"@headlessui/react\"\nimport { useContext } from \"react\"\nimport { classNames } from \"../lib\"\nimport { HelpModalContext } from \"./Contexts\"\nimport { NavigationItem } from \"./MenuNavigation\"\n\nconst SubNav = () => {\n const { setIsOpen: setOpenHelp } = useContext(HelpModalContext)\n const pageType = document.querySelector(\"[data-type]\")?.dataset.type ?? \"\"\n const navigation: NavigationItem[] = [\n { label: \"About\", href: \"/index.html\" },\n { label: \"Digital Access\", href: \"/digital-access.html\" },\n { label: \"Translation\", href: \"/translation.html\" },\n { label: \"Pre-Order Printed Bibles\", href: \"/pre-order.html\" },\n {\n label: \"Help\",\n href: \"\",\n onClick: evt => {\n if (evt) {\n evt.preventDefault()\n evt.stopPropagation()\n }\n setOpenHelp(true)\n },\n },\n ]\n const currentPage = navigation.findIndex(n => n.label.toLowerCase() === pageType)\n\n return (\n {\n const link = navigation[index]\n\n if (link.onClick) {\n link.onClick()\n } else {\n // @ts-expect-error not sure how to type this\n window.location = link.href\n }\n }}\n manual\n >\n \n {navigation.map((link, index) => (\n \n classNames(\n \"rounded-lg p-2 text-sm font-medium whitespace-nowrap\",\n \"ring-white/60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2\",\n selected\n ? \"bg-white shadow text-sky-700\"\n : \"text-blue-100 hover:bg-white/[0.12] hover:text-white\",\n navigation.length - 1 === index ? \"\" : \"\"\n )\n }\n onClick={\n link.onClick\n ? evt => {\n link.onClick && link.onClick(evt)\n }\n : undefined\n }\n >\n {link.label}\n \n ))}\n \n \n )\n}\n\nexport default SubNav\n"],"names":["parcelRequire","$parcel$global","globalThis","self","window","global","parcelRegister","register","module","exports","Object","defineProperty","value","configurable","get","$2967ee55962dc96b$export$2e2bcd8739ae039","set","s","enumerable","$e1vzu","$dD535","$3QbnI","$2BiEt","$ctHcP","setIsOpen","setOpenHelp","useContext","HelpModalContext","pageType","document","querySelector","dataset","type","navigation","label","href","onClick","evt","preventDefault","stopPropagation","currentPage","findIndex","n","toLowerCase","jsx","TabGroup","defaultIndex","selectedIndex","onChange","index","link","location","manual","children","TabList","className","map","Tab","as","selected","classNames","length","undefined"],"version":3,"file":"SubNav.07715b50.js.map"}