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AI,GAC3C,IAAI","sources":["webpack://_N_E/ignored|/codebuild/output/src1531329247/src/raraity/node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal|fast-xml-parser","webpack://_N_E/ignored|/codebuild/output/src1531329247/src/raraity/node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils|buffer","webpack://_N_E/./utils/api-helpers.ts","webpack://_N_E/ignored|/codebuild/output/src1531329247/src/raraity/node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal|buffer","webpack://_N_E/ignored|/codebuild/output/src1531329247/src/raraity/node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data|fast-xml-parser","webpack://_N_E/./data/index.ts","webpack://_N_E/ignored|/codebuild/output/src1531329247/src/raraity/node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data|buffer","webpack://_N_E/./utils/get-stripejs.ts","webpack://_N_E/./components/cart/CartImages.tsx","webpack://_N_E/./components/cart/CartItems.tsx","webpack://_N_E/./components/cart/Cart.tsx","webpack://_N_E/./components/cart/CartIcon.tsx","webpack://_N_E/./components/Layout/Navbar.tsx","webpack://_N_E/./utils/store.ts"],"sourcesContent":["/* (ignored) */","/* (ignored) */","export async function fetchGetJSON(url: string) {\n try {\n const data = await fetch(url).then((res) => res.json());\n return data;\n } catch (err) {\n if (err instanceof Error) {\n throw new Error(err.message);\n }\n throw err;\n }\n}\n\nexport async function fetchPostJSON(url: string, data?: object) {\n try {\n // Default options are marked with *\n const response = await fetch(url, {\n method: \"POST\", // *GET, POST, PUT, DELETE, etc.\n mode: \"cors\", // no-cors, *cors, same-origin\n cache: \"no-cache\", // *default, no-cache, reload, force-cache, only-if-cached\n credentials: \"same-origin\", // include, *same-origin, omit\n headers: {\n \"Content-Type\": \"application/json\",\n // 'Content-Type': 'application/x-www-form-urlencoded',\n },\n redirect: \"follow\", // manual, *follow, error\n referrerPolicy: \"no-referrer\", // no-referrer, *client\n body: JSON.stringify(data || {}), // body data type must match \"Content-Type\" header\n });\n return await response.json(); // parses JSON response into native JavaScript objects\n } catch (err) {\n if (err instanceof Error) {\n throw new Error(err.message);\n }\n throw err;\n }\n}\n","/* (ignored) */","/* (ignored) */","/* eslint-disable import/no-unresolved */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport const KLAVIYO_SIGNUP = process.env.NEXT_PUBLIC_KLAVIYO_SIGNUP;\n\nexport const imageLoader = ({ src, width, quality }) =>\n `https://www.raraity.com/_next/image?url=${src}&w=${width}&q=${\n quality || 75\n }`;\n\nexport const BRAND_NAME: string = \"Raraity\";\n\nexport const BRAND_TAGLINE: string = \"design with intelligence\";\n\nexport const BRAND_DESCRIPTION: string =\n \"Raraity is an AI atelier that translates your creative vision into reality. Our platform uses machine learning and artificial intelligence to deliver wall art that is custom, instant and quality -- design with intelligence.\";\n\nexport const BRAND_URL: string = \"https://www.raraity.com\";\n\nexport const BRAND_IMAGE: string =\n \"https://raraityart55525-prod.s3.us-west-2.amazonaws.com/public/ogimageraraity.png\";\n\nexport const FAVICON: string =\n \"https://raraityart55525-prod.s3.us-west-2.amazonaws.com/public/favicon.ico\";\n\nexport const HOME_IMAGE: string =\n \"https://raraityart55525-prod.s3.us-west-2.amazonaws.com/public/home/hamptons_centered_4_compressed.webp\";\n\nexport const HOME_IMAGES: Array = [\n \"/home/hamptons_centered_4_1.webp\",\n \"/home/hamptons_centered_4_2.webp\",\n \"/home/hamptons_centered_4_3.webp\",\n \"/home/hamptons_centered_4_4.webp\",\n \"/home/hamptons_centered_4_5.webp\",\n \"/home/hamptons_centered_4_6.webp\",\n];\n\nexport const HOME_ICON: string = \"/Raraity_Primary_Icon_Black.svg\";\n\nexport const NAV_ICON: string = \"/Raraity_Logo_Black.svg\";\n\nexport const ABOUT_PREFIX: string =\n \"https://raraityart55525-prod.s3.us-west-2.amazonaws.com/public/about/\";\n\nexport const classNames = (...classes: any) =>\n classes.filter(Boolean).join(\" \");\n\nexport const footerNavigation = {\n navigation: [\n { name: \"Home\", href: \"/\" },\n { name: \"Create\", href: \"/create-story\" },\n { name: \"Gallery\", href: \"/gallery\" },\n { name: \"Orders\", href: \"/orders\" },\n ],\n customerService: [\n { name: \"Account\", href: \"/account\" },\n { name: \"FAQ\", href: \"/faq\" },\n // { name: \"Hanging Guide\", href: \"/hanging\" },\n // { name: \"Sizing Guide\", href: \"/sizing\" },\n { name: \"Shipping & Exchanges\", href: \"/shipping&exchanges\" },\n { name: \"Track\", href: \"/track\" },\n ],\n company: [\n { name: \"About\", href: \"/about\" },\n { name: \"Press\", href: \"/press\" },\n { name: \"Contact\", href: \"/contact\" },\n // { name: \"Learn\", href: \"/learn\" },\n ],\n legal: [\n { name: \"Terms & Conditions\", href: \"/terms&conditions\" },\n { name: \"Privacy Policy\", href: \"/privacy\" },\n // { name: \"Trade\", href: \"/trade\" },\n ],\n social: [\n {\n name: \"Pinterest\",\n image: \"/pinterest.png\",\n href: \"https://www.pinterest.com/37lckju6v5xyh140ac4qt04v38cqz9/\",\n },\n {\n name: \"Instagram\",\n image: \"/instagram.png\",\n href: \"https://www.instagram.com/raraitydesign/\",\n },\n {\n name: \"Threads\",\n image: \"/threads.png\",\n href: \"https://www.threads.net/@raraitydesign\",\n },\n {\n name: \"Tiktok\",\n image: \"/tiktok.png\",\n href: \"https://www.tiktok.com/@raraityart\",\n },\n {\n name: \"Youtube\",\n image: \"/youtube.png\",\n href: \"https://www.youtube.com/@Raraity\",\n },\n ],\n};\n","/* (ignored) */","/**\n * This is a singleton to ensure we only instantiate Stripe once.\n */\nimport { loadStripe } from \"@stripe/stripe-js/pure\";\nimport type { Stripe } from \"@stripe/stripe-js\";\n\nlet stripePromise: Promise;\nconst getStripe = () => {\n if (!stripePromise) {\n stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);\n }\n return stripePromise;\n};\n\nexport default getStripe;\n","import React, { useEffect, useState } from \"react\";\nimport Image from \"next/image\";\nimport { getUrl } from \"@aws-amplify/storage\";\nimport { ImageType } from \"../../src/types\";\n\nexport default function CartArtImageComponent({ src, alt }: ImageType) {\n const [imageSrc, setImageSrc] = useState(null);\n\n useEffect(() => {\n async function fetchImageURL() {\n try {\n const urlObject = await getUrl({\n key: src,\n options: {\n accessLevel: \"protected\",\n },\n });\n setImageSrc(urlObject.url.toString());\n } catch (error) {\n console.error(\"Error fetching image URL:\", error);\n }\n }\n fetchImageURL();\n }, [src]);\n\n const handleContextMenu = (event: React.MouseEvent) => {\n event.preventDefault();\n };\n\n if (!imageSrc) {\n return
Loading...
;\n }\n\n return (\n \n );\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState, useRef } from \"react\";\nimport { useRouter } from \"next/router\";\nimport localforage from \"localforage\";\nimport { fetchUserAttributes } from \"aws-amplify/auth\";\nimport { PlusIcon } from \"@heroicons/react/24/solid\";\nimport Link from \"next/link\";\nimport { Divider } from \"@aws-amplify/ui-react\";\nimport InfoOutlinedIcon from \"@mui/icons-material/InfoOutlined\";\nimport getStripe from \"../../utils/get-stripejs\";\nimport { cartStateStore } from \"../../utils/store\";\nimport { CartContentType, CheckoutCartType } from \"../../src/types\";\nimport CartArtImageComponent from \"./CartImages\";\nimport { fetchPostJSON } from \"../../utils/api-helpers\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction TaxModal({ isOpen, onClose }) {\n if (!isOpen) return null;\n\n return (\n
\n
\n

\n Raraity is required by state and local laws to charge applicable sales\n tax for online orders. Please note that during checkout reflects the\n estimated sales tax. The actual charge to your credit card will\n include the applicable state and local sales tax.\n

\n
\n
\n );\n}\n\nfunction CartItemsComponent() {\n const router = useRouter();\n const open = cartStateStore((state) => state.open);\n const setOpen = cartStateStore((state) => state.setOpen);\n const [arts, setArt] = useState(null);\n const [removeCartItem, setRemoveCartItem] = useState(false);\n const [taxOpen, setTaxOpen] = useState(false);\n const selectedTaxRef = useRef(null);\n\n const sum = arts?.reduce((a: any, b: any) => a + b.total, 0);\n const totalPrice: number =\n typeof sum === \"number\" ? Number(sum.toFixed(2)) : 0;\n\n async function fetchArtOrderID() {\n try {\n const foundValue = await new Promise((resolve, reject) => {\n localforage\n .iterate((value: CartContentType) => {\n if (value && typeof value === \"object\" && \"artOrderID\" in value) {\n resolve(value.artOrderID); // Resolve the Promise with the found cartID\n }\n })\n .then(() => resolve(null)) // Resolve with null if no item with cartID was found\n .catch(reject);\n });\n\n if (foundValue !== null) {\n return foundValue;\n }\n return null;\n } catch (err) {\n console.error(err);\n return null;\n }\n }\n\n const removeArt = async (id: string) => {\n try {\n const artOrderId = await fetchArtOrderID();\n // console.log(artOrderId);\n // Submit the body to the API\n const res = await fetch(\"/api/removefromcart\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n artOrderId,\n }),\n });\n await res.json();\n // console.log(response);\n localforage.removeItem(id);\n setRemoveCartItem(!removeCartItem);\n } catch (err) {\n console.log(err);\n }\n };\n\n useEffect(() => {\n const fetchCartContent = async () => {\n try {\n const data: any = [];\n await localforage.iterate((value: CartContentType) => {\n data.push({ ...value });\n });\n setArt(data);\n // console.log(\"printing arts \", data);\n } catch (err) {\n console.log(err);\n }\n };\n fetchCartContent();\n }, [open, removeCartItem]);\n\n const handleCheckout = async () => {\n const userAttributes = await fetchUserAttributes();\n if (!userAttributes.email || userAttributes.email.trim() === \"\") {\n throw new Error(\"Invalid email address\");\n }\n\n // Call the checkout session\n try {\n const response = await fetchPostJSON(\"/api/checkout_sessions/cart\", {\n arts: arts as CheckoutCartType,\n });\n\n // Wait for the response\n if (response.statusCode === 500) {\n console.error(response.message);\n return;\n }\n\n // Redirect to Checkout.\n const stripe = await getStripe();\n await stripe!.redirectToCheckout({\n sessionId: response.id,\n });\n } catch (error) {\n if (error instanceof Error) {\n console.error(error.message);\n } else {\n console.error(error);\n }\n }\n };\n\n function currencyFormat(num) {\n // Ensure num is a number before using toFixed\n const numberValue = parseFloat(num);\n if (isNaN(numberValue)) {\n // Handle the case where num is not a valid number\n return \"Invalid Number\";\n }\n return numberValue.toFixed(2).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n }\n\n // Add event listeners to handle clicks outside of popups\n useEffect(() => {\n const handleClickOutside = (event) => {\n if (\n selectedTaxRef.current &&\n !selectedTaxRef.current.contains(event.target)\n ) {\n // Click occurred outside of frame options popup\n setTaxOpen(false);\n }\n };\n // Add the event listener to the document\n document.addEventListener(\"mousedown\", handleClickOutside);\n // Clean up the event listener when the component unmounts\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, []);\n\n const toggleTaxModal = () => {\n setTaxOpen((prevTaxOpen) => !prevTaxOpen);\n };\n\n return (\n <>\n {arts && arts.length > 0 ? (\n <>\n {arts?.map((art: CartContentType, i: number) => (\n
  • \n
    \n \n
    \n
    \n
    \n
    \n

    Raraity Generated Art

    \n

    ${currencyFormat(art.total)}

    \n
    \n
    \n
    \n
    \n
    \n Frame Color: {art.moulding_finish}\n
    \n
    \n
    \n
    \n Size: {art.length}'H x {art.width}'W\n
    \n
    \n
    \n
    Mount: {art.mount}
    \n
    \n
    \n
    Glass: {art.plexiglass}
    \n
    \n
    \n
    \n removeArt(art.artId)}\n className=\"font-medium text-gray-500 hover:text-gray-500\"\n >\n Remove\n \n
    \n
    \n
  • \n ))}\n\n
    \n
    \n

    Subtotal

    \n

    \n ${currencyFormat(totalPrice)}\n

    \n
    \n
    \n

    \n Shipping & Handling\n

    \n

    FREE

    \n
    \n
    \n

    \n Estimated Tax   \n \n \n \n

    \n

    TBD

    \n
    \n setTaxOpen(false)} />\n \n
    \n

    \n Estimated Total\n

    \n

    \n ${currencyFormat(totalPrice)}\n

    \n
    \n
    \n {\n setOpen(!open);\n handleCheckout();\n }}\n className=\"bg-black text-white py-3 w-full rounded-full mt-4 hover:bg-gray-800 focus:outline-none active:bg-gray-800\"\n >\n Checkout\n \n
    \n
    \n

    \n or{\" \"}\n {\n setOpen(false);\n router.push(\"/gallery\");\n }}\n >\n Continue Shopping\n \n \n

    \n
    \n
    \n \n ) : (\n
    \n \n \n \n

    No Art

    \n
    \n \n {\n setOpen(!open);\n }}\n aria-hidden=\"true\"\n className=\"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-gray-600 hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500\"\n >\n \n Create Art\n
    \n \n
    \n \n )}\n \n );\n}\n\nexport default CartItemsComponent;\n","import React, { Fragment } from \"react\";\nimport { Dialog, Transition } from \"@headlessui/react\";\nimport { XMarkIcon } from \"@heroicons/react/24/outline\";\nimport { cartStateStore } from \"../../utils/store\";\nimport CartItemsComponent from \"./CartItems\";\n\nfunction CartComponent() {\n const open = cartStateStore((state) => state.open);\n const setOpen = cartStateStore((state) => state.setOpen);\n\n return (\n \n \n \n
    \n \n\n
    \n
    \n
    \n \n \n
    \n
    \n
    \n \n {\" \"}\n Shopping cart{\" \"}\n \n
    \n setOpen(false)}\n >\n Close panel\n \n \n
    \n
    \n\n
    \n
    \n
      \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n );\n}\n\nexport default CartComponent;\n","import React, { useEffect } from \"react\";\nimport { ShoppingCartIcon } from \"@heroicons/react/24/outline\";\nimport localforage from \"localforage\";\nimport { cartStateStore } from \"../../utils/store\";\n\nfunction CartIconComponent() {\n const open = cartStateStore((state) => state.open);\n const setOpen = cartStateStore((state) => state.setOpen);\n const [count, setCount] = React.useState(0);\n\n const fetchCount = async () => {\n try {\n await localforage.length().then((numberOfKeys) => {\n setCount(numberOfKeys);\n });\n } catch (err) {\n console.log(err);\n }\n };\n\n useEffect(() => {\n // Fetch cart count initially\n fetchCount();\n\n // Create an interval to periodically update the cart count\n const updateInterval = setInterval(() => {\n fetchCount();\n }, 60000); // Update every minute, adjust as needed\n\n return () => {\n // Clear the interval when the component unmounts\n clearInterval(updateInterval);\n };\n }, []);\n\n return (\n <>\n
    \n setOpen(!open)}\n >\n \n {count > 0 && (\n \n {count}\n \n )}\n items in cart, view bag\n \n
    \n \n );\n}\n\nexport default CartIconComponent;\n","import React, { Fragment, useEffect, useState } from \"react\";\nimport { useAuthenticator } from \"@aws-amplify/ui-react\";\nimport { Disclosure, Menu, Transition } from \"@headlessui/react\";\nimport {\n Bars3Icon,\n XMarkIcon,\n UsersIcon,\n BoltIcon,\n} from \"@heroicons/react/24/outline\";\nimport { useRouter } from \"next/router\";\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport localforage from \"localforage\";\nimport { fetchAuthSession } from \"aws-amplify/auth\";\nimport useSWR from \"swr\";\nimport CartComponent from \"../cart/Cart\";\nimport CartIconComponent from \"../cart/CartIcon\";\nimport { fetchPostJSON } from \"../../utils/api-helpers\";\nimport { NAV_ICON } from \"../../data\";\nimport { RemainingApiResponseData } from \"../../src/types\";\n\nfunction classNames(...classes: string[]) {\n return classes.filter(Boolean).join(\" \");\n}\n\n// Main function for the navbar\nexport default function Navbar() {\n const router = useRouter();\n const { signOut, authStatus, user } = useAuthenticator((context) => [\n context.authStatus,\n context.user,\n ]);\n\n const windowPath = typeof window !== \"undefined\" ? window.location.pathname : null;\n\n // Navigation options\n const navigation = [\n { name: \"About\", href: \"/about\", current: false },\n { name: \"Discover\", href: \"/discover\", current: false },\n ...(authStatus === \"authenticated\"\n ? [{ name: \"Gallery\", href: \"/gallery\", current: false }]\n : []),\n { name: \"Create\", href: \"/create-story\", current: false },\n { name: \"Gift\", href: \"/gifts\", current: false },\n ];\n\n const { data: remainingResponse } = useSWR(\n \"/api/remaining\",\n () =>\n fetchPostJSON(\"/api/remaining\", {\n id: user.userId,\n }),\n );\n\n const [credits, setCredits] = useState();\n const [userGroups, setUserGroups] = useState([]);\n\n useEffect(() => {\n setCredits(remainingResponse?.remainingGenerations);\n }, [remainingResponse]);\n\n async function logOut() {\n try {\n // Attempt to sign the user out\n const logout = await signOut({ global: true });\n console.log(logout);\n } catch (error) {\n console.error(\"Error signing out: \", error);\n }\n\n try {\n // Attempt to clear local storage\n await localforage.clear();\n // console.log(\"Local storage cleared successfully.\");\n\n // After clearing local storage, redirect to the login page\n router.push(\"/login\");\n } catch (err) {\n console.error(\"Error clearing local storage:\", err);\n }\n }\n\n // Define the image source based on the current route\n const imageSrc = router.pathname === \"/\" ? NAV_ICON : NAV_ICON;\n\n // Define the Tailwind CSS classes based on imageSrc and route\n const imageClasses =\n router.pathname === \"/\"\n ? \"h-8 w-28 object-contain\" // Classes for the root page\n : \"h-8 w-28 object-contain\"; // Classes for other pages\n\n // Define width and height based on imageSrc\n const imageWidth = imageSrc ? 50 : 200;\n const imageHeight = imageSrc ? 50 : 50;\n\n useEffect(() => {\n async function getUserGroups() {\n const { accessToken } = (await fetchAuthSession()).tokens ?? {};\n // const authUser = await Auth.currentAuthenticatedUser();\n setUserGroups(accessToken.payload[\"cognito:groups\"] as string[]);\n }\n if (authStatus === \"authenticated\" && user) {\n getUserGroups();\n }\n // subscribe();\n }, [authStatus, user]);\n\n const admin = userGroups?.includes(\"admin\");\n\n const [showAnnouncementBar, setShowAnnouncementBar] = useState(false);\n useEffect(() => {\n if (typeof window !== \"undefined\") {\n if (window.location.pathname === \"/\") {\n setShowAnnouncementBar(true);\n } else {\n setShowAnnouncementBar(false);\n }\n }\n }, [windowPath]);\n\n const [showAdminBar, setShowAdminBar] = useState(false);\n useEffect(() => {\n if (typeof window !== \"undefined\") {\n if (window.location.pathname.startsWith(\"/admin\")) {\n setShowAdminBar(true);\n } else {\n setShowAdminBar(false);\n }\n }\n }, [windowPath]);\n\n return (\n <>\n \n \n {({ open }) => (\n <>\n
    \n {showAnnouncementBar && (\n \n

    \n Free Shipping & 15% Off Your First Order Using Code LAUNCH15\n

    \n
    \n )}\n {showAdminBar && (\n \n

    Admin Mode

    \n \n )}\n
    \n
    \n {/* Mobile menu button */}\n \n Open main menu\n {open ? (\n \n ) : (\n \n )}\n \n \n \n \n
    \n
    \n
    \n
    \n \n \n \n {navigation.map((item) => (\n \n {item.name}\n \n ))}\n
    \n
    \n
    \n
    \n {authStatus !== \"authenticated\" && (\n \n {\" \"}\n Login  |  Sign Up{\" \"}\n \n )}\n {credits <= 10 && (\n \n \n Open credit menu\n \n \n \n \n {authStatus === \"authenticated\" ? (\n <>\n \n \n Current Credits: \n {credits}\n \n \n \n \n Buy Credits\n \n \n \n ) : (\n <>\n \n \n Buy Credits\n \n \n \n )}\n \n \n \n )}\n {/* Account dropdown */}\n \n \n Open user menu\n \n \n \n \n \n {authStatus !== \"authenticated\" ? (\n \n Account\n \n ) : (\n \n Account\n \n )}\n \n \n {authStatus !== \"authenticated\" ? (\n \n Orders\n \n ) : (\n \n Orders\n \n )}\n \n \n {authStatus !== \"authenticated\" ? (\n \n Gallery\n \n ) : (\n \n Gallery\n \n )}\n \n {authStatus === \"authenticated\" && admin && (\n <>\n \n \n Admin Discover\n \n \n \n \n Admin Create\n \n \n \n \n Admin Orders\n \n \n \n )}\n \n {authStatus !== \"authenticated\" ? (\n \n Sign In\n \n ) : (\n logOut()}\n >\n Sign Out\n \n )}\n \n \n \n \n \n
    \n
    \n \n \n
    \n {navigation.map((item) => (\n \n {item.name}\n \n ))}\n
    \n
    \n \n )}\n
    \n \n );\n}\n","import { create } from \"zustand\";\nimport { CartStateType } from \"../src/types\";\n\nexport const cartStateStore = create((set) => ({\n open: false,\n setOpen: (val) => set(() => ({ open: val })),\n}));\n\nexport default cartStateStore;\n"],"names":["fetchGetJSON","url","data","fetch","then","res","json","err","Error","message","fetchPostJSON","response","method","mode","cache","credentials","headers","redirect","referrerPolicy","body","JSON","stringify","HOME_IMAGE","navigation","name","href","customerService","company","legal","social","image","stripePromise","loadStripe","getStripe","process","CartArtImageComponent","src","alt","imageSrc","setImageSrc","useState","useEffect","fetchImageURL","urlObject","getUrl","key","options","accessLevel","toString","error","console","Image","height","width","onContextMenu","handleContextMenu","event","preventDefault","div","TaxModal","isOpen","onClose","className","p","CartItemsComponent","router","useRouter","open","cartStateStore","state","setOpen","arts","setArt","removeCartItem","setRemoveCartItem","taxOpen","setTaxOpen","selectedTaxRef","useRef","sum","reduce","a","b","total","totalPrice","Number","toFixed","fetchArtOrderID","foundValue","Promise","resolve","reject","localforage","value","removeArt","id","artOrderId","log","fetchCartContent","push","handleCheckout","userAttributes","fetchUserAttributes","email","trim","statusCode","stripe","sessionId","currencyFormat","num","numberValue","parseFloat","replace","handleClickOutside","current","contains","target","document","addEventListener","removeEventListener","length","map","art","i","li","artId","title","h3","h5","moulding_finish","mount","plexiglass","button","type","onClick","toggleTaxModal","prevTaxOpen","ref","InfoOutlinedIcon","fontSize","Divider","padding","span","aria-hidden","svg","fill","viewBox","stroke","path","vectorEffect","strokeLinecap","strokeLinejoin","strokeWidth","d","Link","PlusIcon","CartComponent","Transition","Root","show","as","Fragment","Dialog","Child","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","Panel","Title","XMarkIcon","ul","CartIconComponent","count","setCount","React","fetchCount","numberOfKeys","updateInterval","setInterval","clearInterval","ShoppingCartIcon","Navbar","signOut","authStatus","user","useAuthenticator","context","windowPath","location","pathname","remainingResponse","useSWR","userId","credits","setCredits","userGroups","setUserGroups","logOut","logout","global","remainingGenerations","NAV_ICON","imageClasses","imageWidth","getUserGroups","accessToken","fetchAuthSession","tokens","payload","admin","includes","showAnnouncementBar","setShowAnnouncementBar","window","showAdminBar","setShowAdminBar","startsWith","Disclosure","style","backgroundColor","Button","Bars3Icon","priority","imageHeight","item","classNames","classes","filter","Boolean","join","aria-current","undefined","Menu","BoltIcon","Items","Item","UsersIcon","create","set","val"],"sourceRoot":"","ignoreList":[0,1,3,4,6]}