@dropins/storefront-wishlist 3.2.0 → 3.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"WishlistToggle.js","sources":["/@dropins/storefront-wishlist/src/containers/WishlistToggle/WishlistToggle.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n useState,\n HTMLAttributes,\n useEffect,\n useCallback,\n} from 'preact/compat';\nimport { Button, Icon } from '@adobe-commerce/elsie/components';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { Heart, HeartFilled } from '@adobe-commerce/elsie/icons';\nimport { state } from '@/wishlist/lib/state';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport {\n addProductsToWishlist,\n removeProductsFromWishlist,\n config,\n} from '@/wishlist/api';\nimport { Product } from '@/wishlist/data/models';\nimport { getPersistedWishlistData } from '@/wishlist/lib/persisted-data';\nimport { VNode } from 'preact';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport interface WishlistToggleProps extends HTMLAttributes<HTMLDivElement> {\n product: Product;\n iconWishlisted?: VNode<HTMLAttributes<SVGSVGElement>>;\n iconToWishlist?: VNode<HTMLAttributes<SVGSVGElement>>;\n size?: 'medium' | 'large';\n variant?: 'primary' | 'secondary' | 'tertiary';\n disabled?: boolean;\n labelToWishlist?: string;\n labelWishlisted?: string;\n onClick?: () => void;\n removeProdFromCart?: (\n product: { uid: string; quantity: number }[]\n ) => Promise<any>;\n}\n\nexport const WishlistToggle: Container<WishlistToggleProps> = ({\n product,\n iconWishlisted,\n iconToWishlist,\n size,\n variant,\n disabled,\n labelToWishlist,\n labelWishlisted,\n onClick,\n removeProdFromCart,\n}: WishlistToggleProps) => {\n const [isLoggedIn, setIsLoggedIn] = useState(state.authenticated);\n const [isWishlisted, setIsWishlisted] = useState(false);\n const [wishlistItem, setWishlistItem] = useState(null);\n const { isGuestWishlistEnabled } = config.getConfig();\n\n const dictionary = useText({\n addToWishlist: 'Wishlist.Wishlist.ariaLabelAddToWishlist',\n removeFromWishlist: 'Wishlist.Wishlist.ariaLabelRemoveFromWishlist',\n });\n\n const handleWishlistData = useCallback(() => {\n const updatedWishlist = getPersistedWishlistData();\n const item = updatedWishlist?.items?.find((item: any) =>\n isMatchingWishlistItem(item, {\n sku: product.topLevelSku ?? product.sku,\n optionUIDs:\n product.optionUIDs ??\n (product.selectedOptionsUIDs\n ? Object.values(product.selectedOptionsUIDs)\n : undefined) ??\n (product.bundleOptionsUIDs\n ? Object.values(product.bundleOptionsUIDs)\n : undefined),\n })\n );\n\n setWishlistItem(item ?? null);\n setIsWishlisted(!!item);\n }, [\n product.topLevelSku,\n product.sku,\n product.optionUIDs,\n product.selectedOptionsUIDs,\n product.bundleOptionsUIDs,\n ]);\n\n useEffect(() => {\n handleWishlistData();\n }, [handleWishlistData]);\n\n useEffect(() => {\n const handleAuthentication = (authenticated: boolean) =>\n setIsLoggedIn(authenticated);\n\n const onAuthenticated = events.on('authenticated', handleAuthentication);\n const onWishlistData = events.on('wishlist/data', handleWishlistData);\n\n return () => {\n onAuthenticated?.off();\n onWishlistData?.off();\n };\n }, [handleWishlistData]);\n\n const handleClick = async () => {\n if (isWishlisted) {\n try {\n await removeProductsFromWishlist([wishlistItem]);\n } catch (error) {\n events.emit('wishlist/alert', {\n action: 'removeError',\n item: { product },\n });\n return null;\n }\n\n setIsWishlisted(false);\n events.emit('wishlist/alert', {\n action: 'remove',\n item: { product },\n });\n } else {\n try {\n await addProductsToWishlist([\n {\n sku: product.topLevelSku ?? product.sku,\n quantity: 1,\n optionsUIDs:\n product.optionUIDs ??\n (product.selectedOptionsUIDs\n ? Object.values(product.selectedOptionsUIDs)\n : undefined) ??\n (product.bundleOptionsUIDs\n ? Object.values(product.bundleOptionsUIDs)\n : undefined),\n enteredOptions: product.options?.items\n ? product.options.items\n .filter((option: any) => option.selected)\n .map((option: any) => ({\n uid: option.uid,\n value: option.value,\n }))\n : undefined,\n },\n ]);\n } catch (error) {\n events.emit('wishlist/alert', {\n action: 'addError',\n item: { product },\n });\n return null;\n }\n\n setIsWishlisted(true);\n events.emit('wishlist/alert', {\n action: 'add',\n item: { product },\n });\n if (removeProdFromCart) {\n await removeProdFromCart([\n {\n uid: product.uid,\n quantity: 0,\n },\n ]);\n }\n }\n };\n\n if (!isLoggedIn && !isGuestWishlistEnabled) {\n return null;\n }\n\n const ariaLabel: string = isWishlisted\n ? dictionary['removeFromWishlist'].replace('{PRODUCT_NAME}', product?.name)\n : dictionary['addToWishlist'].replace('{PRODUCT_NAME}', product?.name);\n\n return (\n <Button\n active={isWishlisted}\n aria-label={ariaLabel}\n data-testid=\"wishlist-toggle\"\n size={size ?? 'medium'}\n variant={variant ?? 'tertiary'}\n disabled={disabled}\n icon={<Icon source={iconToWishlist ?? Heart} />}\n activeIcon={<Icon source={iconWishlisted ?? HeartFilled} />}\n onClick={onClick ?? handleClick}\n children={labelToWishlist}\n activeChildren={labelWishlisted}\n />\n );\n};\n"],"names":["WishlistToggle","product","iconWishlisted","iconToWishlist","size","variant","disabled","labelToWishlist","labelWishlisted","onClick","removeProdFromCart","isLoggedIn","setIsLoggedIn","useState","state","isWishlisted","setIsWishlisted","wishlistItem","setWishlistItem","isGuestWishlistEnabled","config","dictionary","useText","handleWishlistData","useCallback","updatedWishlist","getPersistedWishlistData","item","_a","isMatchingWishlistItem","useEffect","handleAuthentication","authenticated","onAuthenticated","events","onWishlistData","handleClick","removeProductsFrom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S,IAAI,EACxEoB,EAAW,cAAiB,QAAQ,iBAAkBpB,GAAA,YAAAA,EAAS,IAAI,EAGrE,OAAAwC,EAACC,EAAA,CACC,OAAQ3B,EACR,aAAYyB,EACZ,cAAY,kBACZ,KAAMpC,GAAQ,SACd,QAASC,GAAW,WACpB,SAAAC,EACA,KAAMmC,EAACE,EAAK,CAAA,OAAQxC,GAAkByC,EAAO,EAC7C,WAAYH,EAACE,EAAK,CAAA,OAAQzC,GAAkB2C,EAAa,EACzD,QAASpC,GAAW2B,EACpB,SAAU7B,EACV,eAAgBC,CAAA,CAClB,CAEJ"}
1
+ {"version":3,"file":"WishlistToggle.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Cart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Heart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/HeartFilled.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Warning.svg","/@dropins/storefront-wishlist/src/containers/WishlistToggle/WishlistToggle.tsx","/@dropins/storefront-wishlist/src/components/EmptyWishlist/EmptyWishlist.tsx","/@dropins/storefront-wishlist/src/components/Wishlist/WishlistItemSkeleton.tsx","/@dropins/storefront-wishlist/src/components/Wishlist/WishlistSkeleton.tsx","/@dropins/storefront-wishlist/src/containers/WishlistAlert/WishlistAlert.tsx","/@dropins/storefront-wishlist/src/containers/Wishlist/Wishlist.tsx","/@dropins/storefront-wishlist/src/components/Wishlist/Wishlist.tsx","/@dropins/storefront-wishlist/src/components/ProductItem/ProductItem.tsx","/@dropins/storefront-wishlist/src/components/ImageCarousel/ImageCarousel.tsx","/@dropins/storefront-wishlist/src/components/Login/Login.tsx","/@dropins/storefront-wishlist/src/containers/WishlistItem/WishlistItem.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgCart = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_102_196)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z\", stroke: \"currentColor\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.25 6.37L20.89 8.06L20.14 14.8H6.19\", stroke: \"currentColor\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_102_196\" }, /* @__PURE__ */ React.createElement(\"rect\", { vectorEffect: \"non-scaling-stroke\", width: 19.29, height: 19.5, fill: \"white\", transform: \"translate(2.3501 2.25)\" }))));\nexport default SvgCart;\n","import * as React from \"react\";\nconst SvgHeart = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M19.734 5.4175C17.8557 3.5275 14.7987 3.5275 12.9105 5.4175L11.9814 6.3475L11.0523 5.4175C9.15407 3.5475 6.09699 3.5775 4.22878 5.4875C2.39054 7.3675 2.39054 10.3675 4.22878 12.2475L5.15789 13.1775L11.9814 20.0075L18.8048 13.1775L19.734 12.2475C21.6221 10.3675 21.6221 7.3075 19.734 5.4175Z\", stroke: \"currentColor\", strokeWidth: 1 }));\nexport default SvgHeart;\n","import * as React from \"react\";\nconst SvgHeartFilled = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12,20.75h0c-.2,0-.39-.08-.53-.22L3.71,12.77c-2.12-2.16-2.12-5.66,0-7.82,1.04-1.06,2.44-1.66,3.93-1.67h.06c1.47,0,2.85,.57,3.9,1.6l.4,.4,.4-.4c1.05-1.05,2.45-1.63,3.94-1.63h0c1.49,0,2.89,.58,3.94,1.63,.02,.02,.03,.03,.05,.05,1.02,1.05,1.59,2.43,1.59,3.9s-.58,2.89-1.63,3.94l-7.76,7.76c-.14,.14-.33,.22-.53,.22Z\", stroke: \"currentColor\" }));\nexport default SvgHeartFilled;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }));\nexport default SvgTrash;\n","import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Warning_Base\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_841_1324)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_841_1324\" }, /* @__PURE__ */ React.createElement(\"rect\", { width: 24, height: 21, fill: \"white\", transform: \"translate(0 1.5)\", strokeWidth: 1 }))));\nexport default SvgWarning;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n useState,\n HTMLAttributes,\n useEffect,\n useCallback,\n} from 'preact/compat';\nimport { Button, Icon } from '@adobe-commerce/elsie/components';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { Heart, HeartFilled } from '@adobe-commerce/elsie/icons';\nimport { state } from '@/wishlist/lib/state';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport {\n addProductsToWishlist,\n removeProductsFromWishlist,\n config,\n} from '@/wishlist/api';\nimport { Product } from '@/wishlist/data/models';\nimport { getPersistedWishlistData } from '@/wishlist/lib/persisted-data';\nimport { VNode } from 'preact';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nexport interface WishlistToggleProps extends HTMLAttributes<HTMLDivElement> {\n product: Product;\n iconWishlisted?: VNode<HTMLAttributes<SVGSVGElement>>;\n iconToWishlist?: VNode<HTMLAttributes<SVGSVGElement>>;\n size?: 'medium' | 'large';\n variant?: 'primary' | 'secondary' | 'tertiary';\n disabled?: boolean;\n labelToWishlist?: string;\n labelWishlisted?: string;\n onClick?: () => void;\n removeProdFromCart?: (\n product: { uid: string; quantity: number }[]\n ) => Promise<any>;\n}\n\nexport const WishlistToggle: Container<WishlistToggleProps> = ({\n product,\n iconWishlisted,\n iconToWishlist,\n size,\n variant,\n disabled,\n labelToWishlist,\n labelWishlisted,\n onClick,\n removeProdFromCart,\n}: WishlistToggleProps) => {\n const [isLoggedIn, setIsLoggedIn] = useState(state.authenticated);\n const [isWishlisted, setIsWishlisted] = useState(false);\n const [wishlistItem, setWishlistItem] = useState(null);\n const { isGuestWishlistEnabled } = config.getConfig();\n\n const dictionary = useText({\n addToWishlist: 'Wishlist.Wishlist.ariaLabelAddToWishlist',\n removeFromWishlist: 'Wishlist.Wishlist.ariaLabelRemoveFromWishlist',\n });\n\n const handleWishlistData = useCallback(() => {\n const updatedWishlist = getPersistedWishlistData();\n const item = updatedWishlist?.items?.find((item: any) =>\n isMatchingWishlistItem(item, {\n sku: product.topLevelSku ?? product.sku,\n optionUIDs:\n product.optionUIDs ??\n (product.selectedOptionsUIDs\n ? Object.values(product.selectedOptionsUIDs)\n : undefined) ??\n (product.bundleOptionsUIDs\n ? Object.values(product.bundleOptionsUIDs)\n : undefined),\n })\n );\n\n setWishlistItem(item ?? null);\n setIsWishlisted(!!item);\n }, [\n product.topLevelSku,\n product.sku,\n product.optionUIDs,\n product.selectedOptionsUIDs,\n product.bundleOptionsUIDs,\n ]);\n\n useEffect(() => {\n handleWishlistData();\n }, [handleWishlistData]);\n\n useEffect(() => {\n const handleAuthentication = (authenticated: boolean) =>\n setIsLoggedIn(authenticated);\n\n const onAuthenticated = events.on('authenticated', handleAuthentication);\n const onWishlistData = events.on('wishlist/data', handleWishlistData);\n\n return () => {\n onAuthenticated?.off();\n onWishlistData?.off();\n };\n }, [handleWishlistData]);\n\n const handleClick = async () => {\n if (isWishlisted) {\n try {\n await removeProductsFromWishlist([wishlistItem]);\n } catch (error) {\n events.emit('wishlist/alert', {\n action: 'removeError',\n item: { product },\n });\n return null;\n }\n\n setIsWishlisted(false);\n events.emit('wishlist/alert', {\n action: 'remove',\n item: { product },\n });\n } else {\n try {\n await addProductsToWishlist([\n {\n sku: product.topLevelSku ?? product.sku,\n quantity: 1,\n optionsUIDs:\n product.optionUIDs ??\n (product.selectedOptionsUIDs\n ? Object.values(product.selectedOptionsUIDs)\n : undefined) ??\n (product.bundleOptionsUIDs\n ? Object.values(product.bundleOptionsUIDs)\n : undefined),\n enteredOptions: product.options?.items\n ? product.options.items\n .filter((option: any) => option.selected)\n .map((option: any) => ({\n uid: option.uid,\n value: option.value,\n }))\n : undefined,\n },\n ]);\n } catch (error) {\n events.emit('wishlist/alert', {\n action: 'addError',\n item: { product },\n });\n return null;\n }\n\n setIsWishlisted(true);\n events.emit('wishlist/alert', {\n action: 'add',\n item: { product },\n });\n if (removeProdFromCart) {\n await removeProdFromCart([\n {\n uid: product.uid,\n quantity: 0,\n },\n ]);\n }\n }\n };\n\n if (!isLoggedIn && !isGuestWishlistEnabled) {\n return null;\n }\n\n const ariaLabel: string = isWishlisted\n ? dictionary['removeFromWishlist'].replace('{PRODUCT_NAME}', product?.name)\n : dictionary['addToWishlist'].replace('{PRODUCT_NAME}', product?.name);\n\n return (\n <Button\n active={isWishlisted}\n aria-label={ariaLabel}\n data-testid=\"wishlist-toggle\"\n size={size ?? 'medium'}\n variant={variant ?? 'tertiary'}\n disabled={disabled}\n icon={<Icon source={iconToWishlist ?? Heart} />}\n activeIcon={<Icon source={iconWishlisted ?? HeartFilled} />}\n onClick={onClick ?? handleClick}\n children={labelToWishlist}\n activeChildren={labelWishlisted}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Button, Icon, IllustratedMessage } from '@adobe-commerce/elsie/components';\nimport { Heart } from '@adobe-commerce/elsie/icons';\n\nimport '@/wishlist/components/EmptyWishlist/EmptyWishlist.css';\n\nexport interface EmptyWishlistProps extends HTMLAttributes<HTMLDivElement> {\n ctaLinkURL?: string;\n}\n\nexport const EmptyWishlist: FunctionComponent<EmptyWishlistProps> = ({\n className,\n children,\n ctaLinkURL,\n ...props\n}) => {\n const labels = useText({\n emptyWishlist: 'Wishlist.EmptyWishlist.heading',\n message: 'Wishlist.EmptyWishlist.message',\n cta: 'Wishlist.EmptyWishlist.cta',\n });\n\n return (\n <div {...props} className={classes(['wishlist-empty-wishlist', className])}>\n <IllustratedMessage\n className={classes(['wishlist-empty-wishlist__wrapper', className])}\n data-testid=\"wishlist-empty-wishlist\"\n heading={labels.emptyWishlist}\n icon={<Icon className=\"wishlist-empty-wishlist__icon\" source={Heart} />}\n message={<p>{labels.message}</p>}\n action={\n ctaLinkURL ? (\n <Button\n data-testid=\"wishlist-empty-wishlist-button\"\n size=\"medium\"\n variant=\"primary\"\n key=\"routeHome\"\n type=\"submit\"\n href={ctaLinkURL}\n >\n {labels.cta}\n </Button>\n ) : undefined\n }\n />\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { SkeletonRow } from '@adobe-commerce/elsie/components';\nimport { FunctionComponent } from 'preact';\n\nexport const WishlistItemSkeleton: FunctionComponent = () => {\n return (\n <SkeletonRow>{`\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 288 658\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMinYMin meet\"\n >\n <rect x=\"6\" y=\"24\" width=\"282px\" height=\"480\" rx=\"8\" fill=\"#E8E8E8\" />\n <rect x=\"6\" y=\"522\" width=\"280\" height=\"22\" rx=\"4\" fill=\"#E8E8E8\" />\n <rect x=\"6\" y=\"556\" width=\"132\" height=\"22\" rx=\"4\" fill=\"#E8E8E8\" />\n <rect x=\"6\" y=\"592\" width=\"280\" height=\"48\" rx=\"24\" fill=\"#D9D9D9\" />\n </svg>\n `}</SkeletonRow>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Skeleton } from '@adobe-commerce/elsie/components';\nimport { FunctionComponent } from 'preact';\nimport { WishlistItemSkeleton } from '@/wishlist/components/Wishlist/WishlistItemSkeleton';\n\nexport const WishlistSkeleton: FunctionComponent = () => {\n return (\n <Skeleton data-testid=\"wishlist-loader\">\n <WishlistItemSkeleton />\n <WishlistItemSkeleton />\n <WishlistItemSkeleton />\n </Skeleton>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Icon, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Cart, HeartFilled, Trash, Warning } from '@adobe-commerce/elsie/icons';\n\nexport interface WishlistAlertProps extends HTMLAttributes<HTMLDivElement> {\n action: 'add' | 'remove' | 'move' | 'addError' | 'removeError';\n item?: { product: { name: string } };\n routeToWishlist?: string;\n}\n\nexport const WishlistAlert: FunctionComponent<WishlistAlertProps> = ({\n action,\n item,\n routeToWishlist,\n}) => {\n const dictionary = useText({\n addHeading: 'Wishlist.Alert.addProduct.heading',\n addMessage: 'Wishlist.Alert.addProduct.message',\n removeHeading: 'Wishlist.Alert.removeProduct.heading',\n removeMessage: 'Wishlist.Alert.removeProduct.message',\n moveHeading: 'Wishlist.Alert.moveToCart.heading',\n moveMessage: 'Wishlist.Alert.moveToCart.message',\n viewWishlist: 'Wishlist.Alert.viewWishlist',\n addErrorHeading: 'Wishlist.Alert.addError.heading',\n addErrorMessage: 'Wishlist.Alert.addError.message',\n removeErrorHeading: 'Wishlist.Alert.removeError.heading',\n removeErrorMessage: 'Wishlist.Alert.removeError.message',\n });\n\n if (!action) {\n return null;\n }\n\n const heading = dictionary[`${action}Heading`];\n const message = dictionary[`${action}Message`];\n const iconMap = {\n add: HeartFilled,\n remove: Trash,\n move: Cart,\n addError: Warning,\n removeError: Warning,\n };\n\n const isWishlistPage = routeToWishlist\n ? location.href.includes(routeToWishlist)\n : false;\n\n return (\n <InLineAlert\n data-testid=\"wishlist-alert\"\n heading={heading}\n description={\n item ? message.replace('{product}', item.product.name) : message\n }\n type={\n action === 'addError' || action === 'removeError'\n ? 'warning'\n : 'success'\n }\n icon={<Icon source={iconMap[action]} size=\"16\" />}\n actionButtonPosition=\"top\"\n additionalActions={\n !isWishlistPage && routeToWishlist\n ? [\n {\n label: dictionary.viewWishlist,\n onClick: () => {\n location.href = routeToWishlist;\n },\n },\n ]\n : undefined\n }\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useCallback,\n useEffect,\n useState,\n} from 'preact/compat';\nimport { Container, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { Wishlist as WishlistComponent } from '@/wishlist/components';\nimport { events, WishlistActionPayload } from '@adobe-commerce/event-bus';\nimport {\n Item,\n Product,\n Wishlist as WishlistModel,\n} from '@/wishlist/data/models';\nimport { state } from '@/wishlist/lib/state';\nimport { WishlistAlert } from '@/wishlist/containers/WishlistAlert';\nimport { ImageProps } from '@adobe-commerce/elsie/components';\n\nexport interface WishlistProps extends HTMLAttributes<HTMLDivElement> {\n routeEmptyWishlistCTA?: () => string;\n routeToWishlist?: string;\n moveProdToCart: (\n products: { sku: string; quantity: number }[]\n ) => Promise<any>;\n routeProdDetailPage: (product: Product) => string;\n getProductData?: (sku: string) => Promise<Product | null>;\n getRefinedProduct?: (\n sku: string,\n optionUIDs: string[],\n anchorOptions?: string[],\n raw?: boolean\n ) => Promise<Product | null>;\n slots?: {\n image?: SlotProps<{\n defaultImageProps: ImageProps;\n item: Item;\n }>;\n };\n}\n\nexport const Wishlist: Container<WishlistProps> = ({\n routeEmptyWishlistCTA,\n routeToWishlist,\n moveProdToCart,\n routeProdDetailPage,\n getProductData,\n getRefinedProduct,\n slots,\n ...props\n}: WishlistProps) => {\n const [wishlistData, setWishlistData] = useState<WishlistModel | null>(null);\n const [isLoggedIn, setIsLoggedIn] = useState(state.authenticated);\n const [isLoading, setIsLoading] = useState(state.isLoading);\n\n const handleAuthentication = (authenticated: boolean) =>\n setIsLoggedIn(authenticated);\n\n const [wishlistAlert, setWishlistAlert] = useState<Element | null>(null);\n const handleWishlistAlert = useCallback(\n (payload: WishlistActionPayload) => {\n const { action, item } = payload;\n setWishlistAlert(\n <WishlistAlert\n action={action}\n item={item}\n routeToWishlist={routeToWishlist}\n />\n );\n },\n [routeToWishlist]\n );\n\n useEffect(() => {\n const authEvent = events.on('authenticated', handleAuthentication);\n const updateEvent = events.on('wishlist/alert', (payload) =>\n handleWishlistAlert(payload)\n );\n const dataEvent = events.on(\n 'wishlist/data',\n (payload) => {\n setWishlistData(payload as WishlistModel);\n setIsLoading(false);\n },\n { eager: true }\n );\n return () => {\n authEvent?.off();\n dataEvent?.off();\n updateEvent?.off();\n };\n }, [handleWishlistAlert]);\n\n return (\n <WishlistComponent\n {...props}\n wishlistData={wishlistData}\n wishlistAlert={wishlistAlert}\n routeEmptyWishlistCTA={routeEmptyWishlistCTA}\n moveProdToCart={moveProdToCart}\n getProductData={getProductData}\n getRefinedProduct={getRefinedProduct}\n isLoggedIn={isLoggedIn}\n isLoading={isLoading}\n routeProdDetailPage={routeProdDetailPage}\n slots={slots}\n />\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, useState, useEffect, useMemo } from 'preact/compat';\nimport {\n VComponent,\n classes,\n Slot,\n SlotProps,\n} from '@adobe-commerce/elsie/lib';\nimport { WishlistSkeleton } from '@/wishlist/components/Wishlist/WishlistSkeleton';\nimport '@/wishlist/components/Wishlist/Wishlist.css';\nimport {\n Product,\n Wishlist as WishlistModel,\n Item,\n} from '@/wishlist/data/models';\nimport { WishlistItem, WishlistAlert } from '@/wishlist/containers';\nimport { Fragment } from 'react';\nimport { EmptyWishlist, Login } from '@/wishlist/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { ImageProps } from '@adobe-commerce/elsie/components';\n\nexport interface WishlistProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n wishlistData: WishlistModel;\n wishlistAlert: WishlistAlert | null;\n isLoggedIn: boolean;\n isLoading: boolean;\n moveProdToCart: (\n products: { sku: string; quantity: number }[]\n ) => Promise<any>;\n getProductData?: (sku: string) => Promise<Product | null>;\n getRefinedProduct?: (\n sku: string,\n optionUIDs: string[],\n anchorOptions?: string[],\n raw?: boolean\n ) => Promise<Product | null>;\n routeEmptyWishlistCTA?: () => string;\n onLoginClick?: () => void;\n routeProdDetailPage: (product: Product) => string;\n slots?: {\n image?: SlotProps<{\n defaultImageProps: ImageProps;\n item: Item;\n }>;\n };\n}\n\nexport const Wishlist: FunctionComponent<WishlistProps> = ({\n className,\n wishlistData,\n wishlistAlert,\n isLoggedIn,\n isLoading,\n moveProdToCart,\n getProductData,\n getRefinedProduct,\n routeEmptyWishlistCTA,\n onLoginClick,\n routeProdDetailPage,\n slots,\n ...props\n}) => {\n const [alert, setAlert] = useState<VNode | null>(wishlistAlert);\n\n const dictionary = useText({\n wishlistHeading: 'Wishlist.Wishlist.heading',\n wishlistLoadingHeading: 'Wishlist.Wishlist.loading',\n });\n\n const products = useMemo(() => {\n return wishlistData?.items?.length > 0\n ? wishlistData.items.map((item: Item) => (\n <WishlistItem\n key={item.id}\n item={item}\n getProductData={getProductData}\n getRefinedProduct={getRefinedProduct}\n moveProdToCart={moveProdToCart}\n routeProdDetailPage={routeProdDetailPage}\n imageNode={\n slots?.image\n ? ({ defaultImageProps }) => (\n <Slot\n name=\"image\"\n slot={slots.image}\n context={{\n defaultImageProps,\n item,\n }}\n />\n )\n : undefined\n }\n />\n ))\n : null;\n }, [wishlistData, moveProdToCart, getProductData, getRefinedProduct, routeProdDetailPage, slots?.image]);\n\n useEffect(() => {\n if (wishlistAlert) {\n setAlert(wishlistAlert);\n\n const timer = setTimeout(() => {\n setAlert(null);\n }, 5000);\n\n return () => clearTimeout(timer);\n }\n }, [wishlistAlert]);\n\n const renderAlert = useMemo(\n () =>\n alert ? (\n <VComponent node={alert} className=\"wishlist-wishlist__alert\" />\n ) : null,\n [alert]\n );\n\n const renderLoader = () => {\n return (\n <>\n <div\n className=\"wishlist-wishlist__heading\"\n data-testid=\"wishlist-heading-wrapper\"\n >\n <h1\n className=\"wishlist-wishlist__heading-text\"\n data-testid=\"loader-wishlist-heading\"\n >\n {dictionary.wishlistLoadingHeading}\n </h1>\n </div>\n <WishlistSkeleton />\n </>\n );\n };\n\n const renderWishlist = () => {\n return products ? (\n <>\n {renderHeading}\n <div className=\"wishlist-wishlist__content\">{products}</div>\n </>\n ) : (\n <div\n className={classes([\n 'wishlist-wishlist__content',\n 'wishlist-wishlist__content--empty',\n ])}\n >\n <div>\n <EmptyWishlist\n data-testid=\"empty-wishlist\"\n ctaLinkURL={routeEmptyWishlistCTA?.()}\n />\n {!isLoggedIn && <Login onLoginClick={onLoginClick} />}\n </div>\n </div>\n );\n };\n\n const renderHeading = useMemo(() => {\n if (!products) return null;\n\n return (\n <div\n className=\"wishlist-wishlist__heading\"\n data-testid=\"wishlist-heading-wrapper\"\n >\n <h1\n className=\"wishlist-wishlist__heading-text\"\n data-testid=\"default-wishlist-heading\"\n >\n {dictionary.wishlistHeading\n ?.split(' {count}')\n .map((title: string, index: number) => (\n <Fragment key={wishlistData?.id?.toString() + index}>\n {title}\n {index === 0 && (\n <span\n className=\"wishlist-wishlist__heading-count\"\n data-testid=\"wishlist-heading-count\"\n >\n {`${wishlistData?.items_count} products`}\n </span>\n )}\n </Fragment>\n ))}\n </h1>\n </div>\n );\n }, [dictionary, products, wishlistData]);\n\n return (\n <div {...props} className={classes(['wishlist-wishlist', className])}>\n {renderAlert}\n {isLoading ? renderLoader() : renderWishlist()}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { HTMLAttributes, useMemo } from 'preact/compat';\nimport { FunctionComponent, JSX } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n Button,\n Icon,\n ImageNodeRenderProps,\n Price,\n} from '@adobe-commerce/elsie/components';\nimport { ImageCarousel } from '@/wishlist/components';\nimport { Item, Product } from '@/wishlist/data/models';\nimport { Cart, Trash } from '@adobe-commerce/elsie/icons';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/wishlist/components/ProductItem/ProductItem.css';\n\nexport interface ProductItemProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n item?: Item;\n onCartActionButtonClick?: () => boolean;\n onTrashButtonClick?: () => boolean;\n routeProdDetailPage: (product: Product) => string;\n imageNode?: (props: {\n defaultImageProps: ImageNodeRenderProps;\n }) => JSX.Element;\n}\n\nexport const ProductItem: FunctionComponent<ProductItemProps> = ({\n className,\n item,\n onCartActionButtonClick,\n onTrashButtonClick,\n routeProdDetailPage,\n imageNode,\n ...props\n}) => {\n const labels = useText({\n cartActionBtn: 'ProductItem.CartActionButton',\n trashActionBtn: 'ProductItem.TrashActionButton',\n customizeActionBtn: 'ProductItem.CustomizeActionButton',\n });\n\n const discounted =\n item.product?.prices?.final?.amount < item.product?.prices?.regular?.amount;\n\n const renderImage = () => {\n return (\n <a\n className=\"wishlist-product-item-image\"\n data-testid=\"wishlist-product-item-image\"\n href={routeProdDetailPage(item.product)}\n >\n <ImageCarousel\n images={item.product?.images ?? []}\n imageNode={imageNode}\n />\n </a>\n );\n };\n\n const renderPrices = () => {\n if (\n item.product?.prices?.final?.amount === undefined &&\n item.product?.prices?.final?.maximumAmount !== undefined &&\n item.product?.prices?.final?.maximumAmount > 0\n ) {\n return (\n <>\n <Price\n className=\"wishlist-product-item-price\"\n data-testid=\"wishlist-product-item-price\"\n amount={item.product?.prices?.final?.minimumAmount}\n currency={item.product?.prices?.final?.currency}\n />\n -\n <Price\n className=\"wishlist-product-item-price\"\n data-testid=\"wishlist-product-item-price\"\n amount={item.product?.prices?.final?.maximumAmount}\n currency={item.product?.prices?.final?.currency}\n />\n </>\n );\n }\n return (\n <>\n <Price\n className={classes([\n 'wishlist-product-item-price',\n discounted ? 'strikethrough' : '',\n ])}\n data-testid=\"wishlist-product-item-price\"\n amount={item.product?.prices?.regular?.amount}\n currency={item.product?.prices?.regular?.currency}\n />\n\n {discounted && (\n <Price\n className=\"wishlist-product-item-discounted-price\"\n data-testid=\"wishlist-product-item-discounted-price\"\n amount={item.product?.prices?.final?.amount}\n currency={item.product?.prices?.final?.currency}\n />\n )}\n </>\n );\n };\n\n const renderTrashButton = () => {\n return (\n <Button\n data-testid=\"wishlist-product-item-remove-button\"\n className=\"wishlist-product-item-button__remove\"\n variant=\"tertiary\"\n onClick={() => onTrashButtonClick?.()}\n icon={\n <Icon\n source={Trash}\n size=\"24\"\n stroke=\"2\"\n viewBox=\"0 0 24 24\"\n aria-label={labels.trashActionBtn}\n />\n }\n />\n );\n };\n\n const renderMainActionButton = () => {\n return isProductReady()\n ? renderMoveToCartButton()\n : renderCustomizeButton();\n };\n\n const isProductReady = () => {\n if (item.product?.productType === 'complex') {\n return areAllRequiredOptionsIncluded();\n }\n return true;\n };\n\n const selectedOptions = useMemo(\n () => item.selectedOptions?.map((opt: any) => opt.uid) || [],\n [item.selectedOptions]\n );\n\n const requiredOptions = useMemo(() => {\n const options = item.product.options || [];\n const required = options.filter((option: any) => option.required);\n return required.length === 0 ? options : required;\n }, [item.product.options]);\n\n const areAllRequiredOptionsIncluded = (): boolean => {\n return requiredOptions.every((option: any) =>\n option.items?.some((item: any) => selectedOptions.includes(item.id))\n );\n };\n\n const renderOptions = () => {\n if (selectedOptions.length === 0) return null;\n\n return (\n <div className=\"wishlist-product-item-options\">\n {requiredOptions.map((option: any) => {\n const selectedValue = option.items?.find((item: any) =>\n selectedOptions.includes(item.id)\n );\n return selectedValue ? (\n <div key={option.type} className=\"wishlist-product-item-option\">\n <span className=\"wishlist-product-item-option__attribute\">\n {option.label}:\n </span>\n &nbsp;\n <span className=\"wishlist-product-item-option__label\">\n {selectedValue.label}\n </span>\n </div>\n ) : null;\n })}\n </div>\n );\n };\n\n const renderMoveToCartButton = () => {\n return (\n <Button\n data-testid=\"wishlist-product-item-move-to-cart-button\"\n size=\"medium\"\n type=\"submit\"\n icon={<Icon source={Cart} />}\n disabled={!item.product?.inStock}\n aria-label={labels.cartActionBtn}\n onClick={() => onCartActionButtonClick?.()}\n >\n {labels.cartActionBtn}\n </Button>\n );\n };\n\n const renderCustomizeButton = () => {\n return (\n <Button\n data-testid=\"wishlist-product-item-customize-button\"\n size=\"medium\"\n type=\"submit\"\n aria-label={labels.customizeActionBtn}\n href={routeProdDetailPage(item.product)}\n >\n {labels.customizeActionBtn}\n </Button>\n );\n };\n\n return (\n <div {...props} className={classes(['wishlist-product-item', className])}>\n <div className=\"wishlist-product-item__content\">\n {renderImage()}\n <div\n className=\"wishlist-product-item__title\"\n data-testid=\"wishlist-product-item-header\"\n >\n <a\n className=\"wishlist-product-item-name\"\n data-testid=\"wishlist-product-item-name\"\n href={routeProdDetailPage(item.product)}\n >\n {item.product?.name}\n </a>\n\n {renderTrashButton()}\n {renderPrices()}\n </div>\n {renderOptions()}\n {renderMainActionButton()}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, JSX } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Image, ImageNodeRenderProps } from '@adobe-commerce/elsie/components';\nimport { useState } from 'react';\n\nimport '@/wishlist/components/ImageCarousel/ImageCarousel.css';\n\nexport interface ImageCarouselProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n children?: any;\n images: Image[];\n imageNode?: (props: {\n defaultImageProps: ImageNodeRenderProps;\n }) => JSX.Element;\n}\n\nexport const ImageCarousel: FunctionComponent<ImageCarouselProps> = ({\n className,\n children,\n images,\n imageNode,\n ...props\n}) => {\n const [carouselIndex, setCarouselIndex] = useState(0);\n\n return (\n <>\n <div {...props} className={classes(['image-carousel', className])}>\n <div\n className={classes([\n 'overflow-hidden relative max-w-[200px]',\n className,\n ])}\n >\n {images?.map(\n (image: ImageCarouselProps['images'][0], index: number) => {\n const defaultProps = {\n className: classes(['image-carousel-image', className]),\n src: image.url,\n alt: image.label,\n } as const;\n\n if (index !== carouselIndex) {\n return null;\n }\n\n return typeof imageNode === 'function'\n ? imageNode({\n defaultImageProps: defaultProps,\n })\n : imageNode || <Image {...defaultProps} />;\n }\n )}\n </div>\n </div>\n {images?.length > 1 && (\n <div className={classes(['absolute', 'image-switcher-area'])}>\n {images?.map(\n (_image: ImageCarouselProps['images'][0], index: number) => {\n return (\n <span\n className={classes([\n 'image-switcher',\n carouselIndex === index\n ? 'image-switcher-active'\n : 'image-switcher-inactive',\n ])}\n key={index}\n onClick={(event: MouseEvent | TouchEvent) => {\n setCarouselIndex(index);\n event.preventDefault(); // prevent navigate on click since ImageCarousel is wrapped in a link\n event.stopPropagation();\n }}\n />\n );\n }\n )}\n </div>\n )}\n </>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Text } from '@adobe-commerce/elsie/i18n';\nimport { FunctionComponent } from 'preact';\n\nimport '@/wishlist/components/Login/Login.css';\n\nexport interface LoginProps {\n onLoginClick?: () => void;\n}\n\nexport const Login: FunctionComponent<LoginProps> = ({ onLoginClick }) => {\n return (\n <div className=\"wishlist-login__sign-in\">\n <a\n data-testid=\"log-in-link\"\n className=\"wishlist-login__link\"\n href=\"\"\n rel=\"noreferrer\"\n onClick={onLoginClick}\n role=\"button\"\n >\n <Text id=\"Wishlist.Login.logIn\" />\n </a>\n <Text id=\"Wishlist.Login.sync\" />\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useEffect,\n useState,\n useCallback,\n} from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { ProductItem } from '@/wishlist/components';\nimport { Item, Product } from '@/wishlist/data/models';\nimport { removeProductsFromWishlist } from '@/wishlist/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { ImageNodeRenderProps } from '@adobe-commerce/elsie/components';\nimport { JSX } from 'preact';\n\nexport interface WishlistItemProps extends HTMLAttributes<HTMLDivElement> {\n item: Item;\n getProductData?: (sku: string) => Promise<Product | null>;\n getRefinedProduct?: (\n sku: string,\n optionUIDs: string[],\n anchorOptions?: string[],\n raw?: boolean\n ) => Promise<Product | null>;\n moveProdToCart: (\n products: {\n sku: string;\n quantity: number;\n optionsUIDs?: [];\n enteredOptions?: [];\n }[]\n ) => Promise<any>;\n routeProdDetailPage: (product: Product) => string;\n imageNode?: (props: {\n defaultImageProps: ImageNodeRenderProps;\n }) => JSX.Element;\n}\n\nexport const WishlistItem: Container<WishlistItemProps> = ({\n item,\n getProductData,\n getRefinedProduct,\n moveProdToCart,\n routeProdDetailPage,\n imageNode,\n}: WishlistItemProps) => {\n const [productData, setProductData] = useState<Product | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n\n async function fetchProductData() {\n try {\n let data: Product | null;\n if (getRefinedProduct && item?.selectedOptions?.length > 0) {\n data = await getRefinedProduct(\n item.product.sku,\n item.selectedOptions.map((option: { uid: any }) => option.uid)\n );\n } else {\n data = getProductData\n ? await getProductData(item?.product.sku)\n : item?.product;\n }\n if (!cancelled) setProductData(data);\n } catch (err) {\n if (!cancelled) {\n console.error('Failed to fetch product data:', err);\n }\n }\n }\n\n fetchProductData();\n\n return () => {\n cancelled = true;\n };\n }, [item, getProductData, getRefinedProduct]);\n\n /**\n * Removes product from wishlist\n */\n const removeProductFromWishlist = useCallback(\n async (showAlert: boolean = true): Promise<boolean> => {\n try {\n await removeProductsFromWishlist([item]);\n console.log(`Product ${productData?.sku} removed from wishlist!`);\n if (showAlert) {\n events.emit('wishlist/alert', {\n action: 'remove',\n item: { ...item, product: productData },\n });\n }\n return true;\n } catch (error) {\n console.error(\n `Product ${productData.sku} could not be removed from wishlist`,\n error\n );\n return false;\n }\n },\n [item, productData]\n );\n\n /**\n * Moves product to cart\n */\n const moveProductToCart = useCallback(async (): Promise<boolean> => {\n try {\n await moveProdToCart([\n {\n sku: productData.sku,\n quantity: 1,\n optionsUIDs: item.selectedOptions?.map(\n (option: { uid: any }) => option.uid\n ),\n enteredOptions: item.enteredOptions,\n },\n ]);\n console.log(`Product ${productData.sku} successfully moved to cart 🛒`);\n events.emit('wishlist/alert', {\n action: 'move',\n item: { ...item, product: productData },\n });\n return await removeProductFromWishlist(false);\n } catch (error) {\n console.error('Could not move product to cart: ', error);\n if (\n error.toString().includes('You need to choose options for your item.')\n ) {\n window.location.replace(routeProdDetailPage(productData));\n }\n return false;\n }\n }, [\n productData,\n item,\n moveProdToCart,\n routeProdDetailPage,\n removeProductFromWishlist,\n ]);\n\n if (!productData || !item) return null;\n\n return (\n <ProductItem\n item={{ ...item, product: productData }}\n onCartActionButtonClick={moveProductToCart}\n onTrashButtonClick={removeProductFromWishlist}\n routeProdDetailPage={routeProdDetailPage}\n imageNode={imageNode}\n />\n );\n};\n"],"names":["SvgCart","props","React","SvgHeart","SvgHeartFilled","SvgTrash","SvgWarning","WishlistToggle","product","iconWishlisted","iconToWishlist","size","variant","disabled","labelToWishlist","labelWishlisted","onClick","removeProdFromCart","isLoggedIn","setIsLoggedIn","useState","state","isWishlisted","setIsWishlisted","wishlistItem","setWishlistItem","isGuestWishlistEnabled","config","dictionary","useText","handleWishlistData","useCallback","updatedWishlist","getPersistedWishlistData","item","_a","isMatchingWishlistItem","useEffect","handleAuthentication","authenticated","onAuthenticated","events","onWishlistData","handleClick","removeProductsFromWishlist","addProductsToWishlist","option","ariaLabel","jsx","Button","Icon","Heart","HeartFilled","EmptyWishlist","className","children","ctaLinkURL","labels","classes","IllustratedMessage","WishlistItemSkeleton","SkeletonRow","WishlistSkeleton","jsxs","Skeleton","WishlistAlert","action","routeToWishlist","heading","message","iconMap","Trash","Cart","Warning","isWishlistPage","InLineAlert","Wishlist","routeEmptyWishlistCTA","moveProdToCart","routeProdDetailPage","getProductData","getRefinedProduct","slots","wishlistData","setWishlistData","isLoading","setIsLoading","wishlistAlert","setWishlistAlert","handleWishlistAlert","payload","authEvent","updateEvent","dataEvent","WishlistComponent","onLoginClick","alert","setAlert","products","useMemo","WishlistItem","defaultImageProps","Slot","timer","renderAlert","VComponent","renderLoader","Fragment","renderWishlist","renderHeading","Login","title","index","ProductItem","onCartActionButtonClick","onTrashButtonClick","imageNode","discounted","_c","_b","_f","_e","_d","renderImage","ImageCarousel","renderPrices","_i","_h","_g","Price","_l","_k","_j","_o","_n","_m","_r","_q","_p","_u","_t","_s","_x","_w","_v","_A","_z","_y","_D","_C","_B","_G","_F","_E","renderTrashButton","renderMainActionButton","isProductReady","renderMoveToCartButton","renderCustomizeButton","areAllRequiredOptionsIncluded","selectedOptions","opt","requiredOptions","options","required","renderOptions","selectedValue","images","carouselIndex","setCarouselIndex","image","defaultProps","Image","_image","event","Text","productData","setProductData","cancelled","fetchProductData","data","err","removeProductFromWishlist","showAlert","error","moveProductToCart"],"mappings":"mxBACA,MAAMA,GAAWC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,EAAM,cAAc,IAAK,CAAE,SAAU,qBAAqB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,oZAAqZ,OAAQ,eAAgB,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,wCAAyC,OAAQ,eAAgB,eAAgB,OAAS,CAAA,CAAC,EAAmBA,EAAM,cAAc,OAAQ,KAAsBA,EAAM,cAAc,WAAY,CAAE,GAAI,eAAe,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,MAAO,MAAO,OAAQ,KAAM,KAAM,QAAS,UAAW,wBAAwB,CAAE,CAAC,CAAC,CAAC,ECA7uCC,GAAYF,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,qSAAsS,OAAQ,eAAgB,YAAa,CAAG,CAAA,CAAC,ECAnlBE,GAAkBH,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,eAAgB,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,yTAA0T,OAAQ,cAAgB,CAAA,CAAC,ECArmBG,GAAYJ,GAA0BC,EAAM,cAAc,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 @@
1
1
  {
2
2
  "name": "@dropins/storefront-wishlist",
3
- "version": "3.2.0",
3
+ "version": "3.3.0-beta.0",
4
4
  "license": "SEE LICENSE IN LICENSE.md"
5
5
  }
package/render.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
3
  (function(r,e){try{if(typeof document<"u"){const t=document.createElement("style"),n=e.styleId;for(const i in e.attributes)t.setAttribute(i,e.attributes[i]);t.setAttribute("data-dropin",n),t.appendChild(document.createTextNode(r));const a=document.querySelector('style[data-dropin="sdk"]');if(a)a.after(t);else{const i=document.querySelector('link[rel="stylesheet"], style');i?i.before(t):document.head.append(t)}}}catch(t){console.error("dropin-styles (injectCodeFunction)",t)}})(".wishlist-empty-wishlist{container-type:inline-size;container-name:wishlist}.wishlist-empty-wishlist__wrapper .dropin-card--secondary{display:grid;grid-auto-rows:min-content;justify-content:center;text-align:center;border:unset}.wishlist-empty-wishlist .dropin-illustrated-message__heading{font:var(--type-headline-1-font)}.wishlist-empty-wishlist .dropin-illustrated-message__message{font:var(--type-body-1-default-font)}@container wishlist (width < 737px){.wishlist-empty-wishlist__wrapper .dropin-card{border:unset;border-style:hidden}}.wishlist-wishlist{container-type:inline-size;container-name:wishlist-grid;max-width:inherit}.wishlist-wishlist__content{display:grid;gap:var(--spacing-medium);margin:auto;padding:var(--spacing-medium) 0}.wishlist-wishlist__heading{color:var(--color-neutral-800);display:grid;font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);padding:var(--spacing-small) 0;row-gap:var(--spacing-xsmall)}.wishlist-wishlist__heading-text{font-size:inherit;font-weight:inherit;margin:0;line-height:inherit}.wishlist-wishlist__heading-count{color:#6d6d6d;margin-left:var(--spacing-xxsmall);letter-spacing:normal;font:var(--type-details-caption-2-font)}.wishlist-wishlist__content.wishlist-wishlist__content--empty{border:var(--shape-border-width-2) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-2);grid-template-columns:repeat(1,1fr);padding:var(--spacing-xxbig);margin:var(--spacing-xxbig) auto}@media only screen and (max-width: 480px){.dropin-skeleton{grid-template-columns:repeat(1,1fr)}.dropin-skeleton-row:nth-child(n+2){display:none}.wishlist-wishlist__content{grid-template-columns:repeat(1,1fr);min-height:320px}}@media only screen and (min-width: 480px) and (max-width: 600px){.dropin-skeleton{grid-template-columns:repeat(2,1fr)}.dropin-skeleton-row:nth-child(n+3){display:none}.wishlist-wishlist__content{grid-template-columns:repeat(2,1fr);min-height:320px}}@media only screen and (min-width: 600px){.dropin-skeleton{grid-template-columns:repeat(2,1fr)}.dropin-skeleton-row:nth-child(n+3){display:none}.wishlist-wishlist__content{grid-template-columns:repeat(2,1fr);min-height:320px}}@media only screen and (min-width: 768px){.dropin-skeleton{grid-template-columns:repeat(3,1fr)}.dropin-skeleton-row:nth-child(n){display:block}.wishlist-wishlist__content{grid-template-columns:repeat(3,1fr);min-height:480px}}.wishlist-product-item{background-color:var(--color-neutral-50);margin-bottom:var(--spacing-small)}.wishlist-product-item__content{display:flex;flex-direction:column;gap:var(--spacing-small)}.wishlist-product-item__content .wishlist-product-item-image{background:var(--color-neutral-200);height:100%;padding:0;position:relative;width:100%}.wishlist-product-item__content .wishlist-product-item__title{color:var(--color-neutral-800);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin:0;position:relative}.wishlist-product-item-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:85%}a.wishlist-product-item-name:active,a.wishlist-product-item-name:hover,a.wishlist-product-item-name{color:var(--color-neutral-800);cursor:pointer;font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing)}.wishlist-product-item__content .wishlist-product-item-button__remove{position:absolute;right:0;top:-10px}.wishlist-product-item__content .wishlist-product-item-options{font:var(--type-body-2-default-font)}.wishlist-product-item__content .wishlist-product-item-option__attribute{text-transform:capitalize}.wishlist-product-item__content .wishlist-product-item-option__label{font:var(--type-body-2-strong-font)}.wishlist-product-item__content .wishlist-product-item-price{display:inline;font:var(--type-body-2-default-font)}.strikethrough{text-decoration:line-through}.wishlist-product-item__content .wishlist-product-item-discounted-price{display:inline;margin-left:var(--spacing-xsmall);color:var(--color-alert-800)}.wishlist-product-item-move-to-cart{display:grid;grid-area:product-add-to-cart;justify-content:end}.wishlist-product-item-tax{color:var(--color-neutral-500)}.wishlist-product-item-tax span{margin-right:var(--spacing-xsmall)}.image-carousel{display:flex;flex-direction:column;gap:var(--spacing-medium);padding:var(--spacing-medium)}.image-carousel .image-carousel-image{object-fit:contain;padding:var(--spacing-xxsmall) 0;width:100%}.image-switcher-area{bottom:var(--spacing-xxsmall);left:0;margin-top:var(--spacing-small);position:absolute;text-align:center;width:100%}.image-switcher-area .image-switcher{cursor:pointer;border-radius:50%;display:inline-flex;height:var(--spacing-xsmall);margin:0 var(--spacing-xxsmall);width:var(--spacing-xsmall)}.image-switcher-area .image-switcher-active{background-color:var(--color-neutral-900);border:var(--shape-border-width-1) solid var(--color-brand-700)}.image-switcher-area .image-switcher-inactive{background-color:var(--color-neutral-600);border:var(--shape-border-width-1) solid var(--color-neutral-600)}@media only screen and (max-width: 480px){.image-carousel{gap:var(--spacing-xxsmall)}.image-carousel .image-carousel-image{height:250px}}@media only screen and (min-width: 480px) and (max-width: 600px){.image-carousel{gap:var(--spacing-xsmall)}.image-carousel .image-carousel-image{height:300px}}@media only screen and (min-width: 600px){.image-carousel{gap:var(--spacing-xsmall)}.image-carousel .image-carousel-image{height:300px}}@media only screen and (min-width: 768px){.image-carousel{gap:var(--spacing-small)}.image-carousel .image-carousel-image{height:350px}}@media only screen and (min-width: 1024px){.image-carousel{gap:var(--spacing-medium)}.image-carousel .image-carousel-image{height:400px}}.wishlist-login__sign-in{grid-column-start:2;color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:var(--spacing-xxsmall);text-align:center}a.wishlist-login__link{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-left:var(--spacing-xxsmall);text-decoration:underline;text-decoration-thickness:auto;text-underline-offset:auto;color:var(--color-neutral-800)}a.wishlist-login__link:hover{color:var(--color-neutral-800);text-decoration:underline;text-decoration-thickness:auto;text-underline-offset:auto}",{styleId:"Wishlist"});
4
- import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as m,Render as c}from"@dropins/tools/lib.js";import{useState as h,useEffect as l}from"@dropins/tools/preact-hooks.js";import{UIProvider as g}from"@dropins/tools/components.js";import{events as u}from"@dropins/tools/event-bus.js";import{c as f}from"./chunks/mergeWishlists.js";import"./chunks/fetch-error.js";import"@dropins/tools/fetch-graphql.js";const p={EmptyWishlist:{heading:"Your wishlist is empty",message:"Add items by clicking on the heart icon.",cta:"Start shopping"},Wishlist:{heading:"Wishlist {count}",loading:"Loading...",ariaLabelAddToWishlist:"add {PRODUCT_NAME} to wishlist",ariaLabelRemoveFromWishlist:"remove {PRODUCT_NAME} from wishlist"},Alert:{addProduct:{heading:"Added to wishlist",message:"{product} has been added to your wishlist"},removeProduct:{heading:"Removed from wishlist",message:"{product} has been removed from your wishlist"},moveToCart:{heading:"Moved to cart",message:"{product} has been moved to your cart"},addError:{heading:"Error",message:"Failed to add product to wishlist"},removeError:{heading:"Error",message:"Failed to remove {product} from wishlist"},viewWishlist:"View wishlist"},Login:{sync:" to sync your saved items across all your devices.",logIn:"Log in"}},v={CartActionButton:"Move To Cart",TrashActionButton:"Remove this product from wishlist",CustomizeActionButton:"Customize"},w={Wishlist:p,ProductItem:v},y={default:w},A=({children:i})=>{var t;const[s,r]=h("en_US");l(()=>{const o=u.on("locale",d=>{r(d)},{eager:!0});return()=>{o==null||o.off()}},[]);const n=(t=f.getConfig())==null?void 0:t.langDefinitions,a=m(y,n??{});return e(g,{lang:s,langDefinitions:a,children:i})},T=new c(e(A,{}));export{T as render};
4
+ import{jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as m,Render as c}from"@dropins/tools/lib.js";import{useState as h,useEffect as l}from"@dropins/tools/preact-hooks.js";import{UIProvider as g}from"@dropins/tools/components.js";import{events as u}from"@dropins/tools/event-bus.js";import{config as f}from"./api.js";import"@dropins/tools/fetch-graphql.js";const p={EmptyWishlist:{heading:"Your wishlist is empty",message:"Add items by clicking on the heart icon.",cta:"Start shopping"},Wishlist:{heading:"Wishlist {count}",loading:"Loading...",ariaLabelAddToWishlist:"add {PRODUCT_NAME} to wishlist",ariaLabelRemoveFromWishlist:"remove {PRODUCT_NAME} from wishlist"},Alert:{addProduct:{heading:"Added to wishlist",message:"{product} has been added to your wishlist"},removeProduct:{heading:"Removed from wishlist",message:"{product} has been removed from your wishlist"},moveToCart:{heading:"Moved to cart",message:"{product} has been moved to your cart"},addError:{heading:"Error",message:"Failed to add product to wishlist"},removeError:{heading:"Error",message:"Failed to remove {product} from wishlist"},viewWishlist:"View wishlist"},Login:{sync:" to sync your saved items across all your devices.",logIn:"Log in"}},v={CartActionButton:"Move To Cart",TrashActionButton:"Remove this product from wishlist",CustomizeActionButton:"Customize"},w={Wishlist:p,ProductItem:v},y={default:w},A=({children:i})=>{var t;const[s,r]=h("en_US");l(()=>{const o=u.on("locale",d=>{r(d)},{eager:!0});return()=>{o==null||o.off()}},[]);const n=(t=f.getConfig())==null?void 0:t.langDefinitions,a=m(y,n??{});return e(g,{lang:s,langDefinitions:a,children:i})},R=new c(e(A,{}));export{R as render};
5
5
  //# sourceMappingURL=render.js.map
package/render.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sources":["/@dropins/storefront-wishlist/src/render/Provider.tsx","/@dropins/storefront-wishlist/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\nimport { config } from '@/wishlist/api';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [lang, setLang] = useState<Lang>('en_US');\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (locale: string) => {\n setLang(locale as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, []);\n\n const userLangDefinitions = config.getConfig()?.langDefinitions;\n\n const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {});\n\n return (\n <UIProvider lang={lang} langDefinitions={definitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","lang","setLang","useState","useEffect","localeEvent","events","locale","userLangDefinitions","_a","config","definitions","deepmerge","jsx","UIProvider","render","Render"],"mappings":"i6CA4BMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,OACJ,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAe,OAAO,EAG9CC,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAmB,CAClBL,EAAQK,CAAc,CACxB,EACA,CAAE,MAAO,EAAK,CAChB,EACA,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,EAAE,EAEC,MAAAG,GAAsBC,EAAAC,EAAO,UAAA,IAAP,YAAAD,EAAoB,gBAE1CE,EAAcC,EAAUf,EAAiBW,GAAuB,CAAA,CAAE,EAExE,OACGK,EAAAC,EAAA,CAAW,KAAAb,EAAY,gBAAiBU,EACtC,SAAAX,EACH,CAEJ,EC5Cae,EAAS,IAAIC,EAAOH,EAACd,IAAS,CAAE"}
1
+ {"version":3,"file":"render.js","sources":["/@dropins/storefront-wishlist/src/render/Provider.tsx","/@dropins/storefront-wishlist/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\nimport { config } from '@/wishlist/api';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [lang, setLang] = useState<Lang>('en_US');\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (locale: string) => {\n setLang(locale as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, []);\n\n const userLangDefinitions = config.getConfig()?.langDefinitions;\n\n const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {});\n\n return (\n <UIProvider lang={lang} langDefinitions={definitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","lang","setLang","useState","useEffect","localeEvent","events","locale","userLangDefinitions","_a","config","definitions","deepmerge","jsx","UIProvider","render","Render"],"mappings":"o3CA4BMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,OACJ,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAe,OAAO,EAG9CC,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAmB,CAClBL,EAAQK,CAAc,CACxB,EACA,CAAE,MAAO,EAAK,CAChB,EACA,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,EAAE,EAEC,MAAAG,GAAsBC,EAAAC,EAAO,UAAA,IAAP,YAAAD,EAAoB,gBAE1CE,EAAcC,EAAUf,EAAiBW,GAAuB,CAAA,CAAE,EAExE,OACGK,EAAAC,EAAA,CAAW,KAAAb,EAAY,gBAAiBU,EACtC,SAAAX,EACH,CAEJ,EC5Cae,EAAS,IAAIC,EAAOH,EAACd,IAAS,CAAE"}
package/chunks/Heart.js DELETED
@@ -1,4 +0,0 @@
1
- /*! Copyright 2026 Adobe
2
- All Rights Reserved. */
3
- import*as t from"@dropins/tools/preact-compat.js";const o=e=>t.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.734 5.4175C17.8557 3.5275 14.7987 3.5275 12.9105 5.4175L11.9814 6.3475L11.0523 5.4175C9.15407 3.5475 6.09699 3.5775 4.22878 5.4875C2.39054 7.3675 2.39054 10.3675 4.22878 12.2475L5.15789 13.1775L11.9814 20.0075L18.8048 13.1775L19.734 12.2475C21.6221 10.3675 21.6221 7.3075 19.734 5.4175Z",stroke:"currentColor",strokeWidth:1}));export{o as S};
4
- //# sourceMappingURL=Heart.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Heart.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Heart.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgHeart = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M19.734 5.4175C17.8557 3.5275 14.7987 3.5275 12.9105 5.4175L11.9814 6.3475L11.0523 5.4175C9.15407 3.5475 6.09699 3.5775 4.22878 5.4875C2.39054 7.3675 2.39054 10.3675 4.22878 12.2475L5.15789 13.1775L11.9814 20.0075L18.8048 13.1775L19.734 12.2475C21.6221 10.3675 21.6221 7.3075 19.734 5.4175Z\", stroke: \"currentColor\", strokeWidth: 1 }));\nexport default SvgHeart;\n"],"names":["SvgHeart","props","React"],"mappings":"kDACK,MAACA,EAAYC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,qSAAsS,OAAQ,eAAgB,YAAa,CAAC,CAAE,CAAC","x_google_ignoreList":[0]}
@@ -1,4 +0,0 @@
1
- /*! Copyright 2026 Adobe
2
- All Rights Reserved. */
3
- import*as e from"@dropins/tools/preact-compat.js";const r=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12,20.75h0c-.2,0-.39-.08-.53-.22L3.71,12.77c-2.12-2.16-2.12-5.66,0-7.82,1.04-1.06,2.44-1.66,3.93-1.67h.06c1.47,0,2.85,.57,3.9,1.6l.4,.4,.4-.4c1.05-1.05,2.45-1.63,3.94-1.63h0c1.49,0,2.89,.58,3.94,1.63,.02,.02,.03,.03,.05,.05,1.02,1.05,1.59,2.43,1.59,3.9s-.58,2.89-1.63,3.94l-7.76,7.76c-.14,.14-.33,.22-.53,.22Z",stroke:"currentColor"}));export{r as S};
4
- //# sourceMappingURL=HeartFilled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeartFilled.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/HeartFilled.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgHeartFilled = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"currentColor\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12,20.75h0c-.2,0-.39-.08-.53-.22L3.71,12.77c-2.12-2.16-2.12-5.66,0-7.82,1.04-1.06,2.44-1.66,3.93-1.67h.06c1.47,0,2.85,.57,3.9,1.6l.4,.4,.4-.4c1.05-1.05,2.45-1.63,3.94-1.63h0c1.49,0,2.89,.58,3.94,1.63,.02,.02,.03,.03,.05,.05,1.02,1.05,1.59,2.43,1.59,3.9s-.58,2.89-1.63,3.94l-7.76,7.76c-.14,.14-.33,.22-.53,.22Z\", stroke: \"currentColor\" }));\nexport default SvgHeartFilled;\n"],"names":["SvgHeartFilled","props","React"],"mappings":"kDACK,MAACA,EAAkBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,eAAgB,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,yTAA0T,OAAQ,cAAc,CAAE,CAAC","x_google_ignoreList":[0]}
package/chunks/Trash.js DELETED
@@ -1,4 +0,0 @@
1
- /*! Copyright 2026 Adobe
2
- All Rights Reserved. */
3
- import*as e from"@dropins/tools/preact-compat.js";const r=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("g",{clipPath:"url(#clip0_102_196)"},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z",stroke:"currentColor",strokeLinejoin:"round"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.25 6.37L20.89 8.06L20.14 14.8H6.19",stroke:"currentColor",strokeLinejoin:"round"})),e.createElement("defs",null,e.createElement("clipPath",{id:"clip0_102_196"},e.createElement("rect",{vectorEffect:"non-scaling-stroke",width:19.29,height:19.5,fill:"white",transform:"translate(2.3501 2.25)"})))),o=t=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1 5H23",stroke:"currentColor",strokeWidth:1,strokeMiterlimit:10}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z",stroke:"currentColor",strokeWidth:1,strokeMiterlimit:10}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z",stroke:"currentColor",strokeWidth:1,strokeMiterlimit:10}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M8.87402 8.58057L9.39348 17.682",stroke:"currentColor",strokeWidth:1,strokeMiterlimit:10}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M14.6673 8.58057L14.146 17.682",stroke:"currentColor",strokeWidth:1,strokeMiterlimit:10}));export{r as S,o as a};
4
- //# sourceMappingURL=Trash.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Trash.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Cart.svg","../../node_modules/@adobe-commerce/elsie/src/icons/Trash.svg"],"sourcesContent":["import * as React from \"react\";\nconst SvgCart = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_102_196)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z\", stroke: \"currentColor\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M5.25 6.37L20.89 8.06L20.14 14.8H6.19\", stroke: \"currentColor\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_102_196\" }, /* @__PURE__ */ React.createElement(\"rect\", { vectorEffect: \"non-scaling-stroke\", width: 19.29, height: 19.5, fill: \"white\", transform: \"translate(2.3501 2.25)\" }))));\nexport default SvgCart;\n","import * as React from \"react\";\nconst SvgTrash = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M1 5H23\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M17.3674 22H6.63446C5.67952 22 4.88992 21.2688 4.8379 20.3338L4 5H20L19.1621 20.3338C19.1119 21.2688 18.3223 22 17.3655 22H17.3674Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M9.87189 2H14.1281C14.6085 2 15 2.39766 15 2.88889V5H9V2.88889C9 2.39912 9.39006 2 9.87189 2Z\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M8.87402 8.58057L9.39348 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M14.6673 8.58057L14.146 17.682\", stroke: \"currentColor\", strokeWidth: 1, strokeMiterlimit: 10 }));\nexport default SvgTrash;\n"],"names":["SvgCart","props","React","SvgTrash"],"mappings":"kDACK,MAACA,EAAWC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAO,EAAkBC,EAAM,cAAc,IAAK,CAAE,SAAU,qBAAqB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,oZAAqZ,OAAQ,eAAgB,eAAgB,OAAO,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,wCAAyC,OAAQ,eAAgB,eAAgB,OAAS,CAAA,CAAC,EAAmBA,EAAM,cAAc,OAAQ,KAAsBA,EAAM,cAAc,WAAY,CAAE,GAAI,eAAe,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,MAAO,MAAO,OAAQ,KAAM,KAAM,QAAS,UAAW,wBAA0B,CAAA,CAAC,CAAC,CAAC,ECA7uCC,EAAYF,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,6BAA8B,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,GAAGD,GAAyBC,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,UAAW,OAAQ,eAAgB,YAAa,EAAG,iBAAkB,EAAE,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,sIAAuI,OAAQ,eAAgB,YAAa,EAAG,iBAAkB,GAAI,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,gGAAiG,OAAQ,eAAgB,YAAa,EAAG,iBAAkB,GAAI,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,kCAAmC,OAAQ,eAAgB,YAAa,EAAG,iBAAkB,GAAI,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,iCAAkC,OAAQ,eAAgB,YAAa,EAAG,iBAAkB,GAAI,CAAC","x_google_ignoreList":[0,1]}
@@ -1,4 +0,0 @@
1
- /*! Copyright 2026 Adobe
2
- All Rights Reserved. */
3
- import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import{InLineAlert as m,Icon as g}from"@dropins/tools/components.js";import*as r from"@dropins/tools/preact-compat.js";import{S as h,a as v}from"./Trash.js";import{S as p}from"./HeartFilled.js";import{useText as E}from"@dropins/tools/i18n.js";const n=e=>r.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("g",{clipPath:"url(#clip0_841_1324)"},r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),r.createElement("defs",null,r.createElement("clipPath",{id:"clip0_841_1324"},r.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)",strokeWidth:1})))),k=({action:e,item:i,routeToWishlist:t})=>{const s=E({addHeading:"Wishlist.Alert.addProduct.heading",addMessage:"Wishlist.Alert.addProduct.message",removeHeading:"Wishlist.Alert.removeProduct.heading",removeMessage:"Wishlist.Alert.removeProduct.message",moveHeading:"Wishlist.Alert.moveToCart.heading",moveMessage:"Wishlist.Alert.moveToCart.message",viewWishlist:"Wishlist.Alert.viewWishlist",addErrorHeading:"Wishlist.Alert.addError.heading",addErrorMessage:"Wishlist.Alert.addError.message",removeErrorHeading:"Wishlist.Alert.removeError.heading",removeErrorMessage:"Wishlist.Alert.removeError.message"});if(!e)return null;const l=s[`${e}Heading`],o=s[`${e}Message`],d={add:p,remove:v,move:h,addError:n,removeError:n},c=t?location.href.includes(t):!1;return a(m,{"data-testid":"wishlist-alert",heading:l,description:i?o.replace("{product}",i.product.name):o,type:e==="addError"||e==="removeError"?"warning":"success",icon:a(g,{source:d[e],size:"16"}),actionButtonPosition:"top",additionalActions:!c&&t?[{label:s.viewWishlist,onClick:()=>{location.href=t}}]:void 0})};export{k as W};
4
- //# sourceMappingURL=WishlistAlert.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WishlistAlert.js","sources":["../../node_modules/@adobe-commerce/elsie/src/icons/Warning.svg","/@dropins/storefront-wishlist/src/containers/WishlistAlert/WishlistAlert.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgWarning = (props) => /* @__PURE__ */ React.createElement(\"svg\", { id: \"Icon_Warning_Base\", width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"g\", { clipPath: \"url(#clip0_841_1324)\" }, /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" }), /* @__PURE__ */ React.createElement(\"path\", { vectorEffect: \"non-scaling-stroke\", d: \"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z\", stroke: \"currentColor\", strokeWidth: 1, strokeLinecap: \"round\", strokeLinejoin: \"round\" })), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"clipPath\", { id: \"clip0_841_1324\" }, /* @__PURE__ */ React.createElement(\"rect\", { width: 24, height: 21, fill: \"white\", transform: \"translate(0 1.5)\", strokeWidth: 1 }))));\nexport default SvgWarning;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { Icon, InLineAlert } from '@adobe-commerce/elsie/components';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { Cart, HeartFilled, Trash, Warning } from '@adobe-commerce/elsie/icons';\n\nexport interface WishlistAlertProps extends HTMLAttributes<HTMLDivElement> {\n action: 'add' | 'remove' | 'move' | 'addError' | 'removeError';\n item?: { product: { name: string } };\n routeToWishlist?: string;\n}\n\nexport const WishlistAlert: FunctionComponent<WishlistAlertProps> = ({\n action,\n item,\n routeToWishlist,\n}) => {\n const dictionary = useText({\n addHeading: 'Wishlist.Alert.addProduct.heading',\n addMessage: 'Wishlist.Alert.addProduct.message',\n removeHeading: 'Wishlist.Alert.removeProduct.heading',\n removeMessage: 'Wishlist.Alert.removeProduct.message',\n moveHeading: 'Wishlist.Alert.moveToCart.heading',\n moveMessage: 'Wishlist.Alert.moveToCart.message',\n viewWishlist: 'Wishlist.Alert.viewWishlist',\n addErrorHeading: 'Wishlist.Alert.addError.heading',\n addErrorMessage: 'Wishlist.Alert.addError.message',\n removeErrorHeading: 'Wishlist.Alert.removeError.heading',\n removeErrorMessage: 'Wishlist.Alert.removeError.message',\n });\n\n if (!action) {\n return null;\n }\n\n const heading = dictionary[`${action}Heading`];\n const message = dictionary[`${action}Message`];\n const iconMap = {\n add: HeartFilled,\n remove: Trash,\n move: Cart,\n addError: Warning,\n removeError: Warning,\n };\n\n const isWishlistPage = routeToWishlist\n ? location.href.includes(routeToWishlist)\n : false;\n\n return (\n <InLineAlert\n data-testid=\"wishlist-alert\"\n heading={heading}\n description={\n item ? message.replace('{product}', item.product.name) : message\n }\n type={\n action === 'addError' || action === 'removeError'\n ? 'warning'\n : 'success'\n }\n icon={<Icon source={iconMap[action]} size=\"16\" />}\n actionButtonPosition=\"top\"\n additionalActions={\n !isWishlistPage && routeToWishlist\n ? [\n {\n label: dictionary.viewWishlist,\n onClick: () => {\n location.href = routeToWishlist;\n },\n },\n ]\n : undefined\n }\n />\n );\n};\n"],"names":["SvgWarning","props","React","WishlistAlert","action","item","routeToWishlist","dictionary","useText","heading","message","iconMap","HeartFilled","Trash","Cart","Warning","isWishlistPage","jsx","InLineAlert","Icon"],"mappings":"8SACA,MAAMA,EAAcC,GAA0BC,EAAM,cAAc,MAAO,CAAE,GAAI,oBAAqB,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,GAAyBC,EAAM,cAAc,IAAK,CAAE,SAAU,sBAAsB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,6DAA8D,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAS,CAAA,EAAmBA,EAAM,cAAc,OAAQ,CAAE,aAAc,qBAAsB,EAAG,qIAAsI,OAAQ,eAAgB,YAAa,EAAG,cAAe,QAAS,eAAgB,OAAO,CAAE,CAAC,EAAmBA,EAAM,cAAc,OAAQ,KAAsBA,EAAM,cAAc,WAAY,CAAE,GAAI,gBAAgB,EAAoBA,EAAM,cAAc,OAAQ,CAAE,MAAO,GAAI,OAAQ,GAAI,KAAM,QAAS,UAAW,mBAAoB,YAAa,EAAG,CAAC,CAAC,CAAC,EC4B3jCC,EAAuD,CAAC,CACnE,OAAAC,EACA,KAAAC,EACA,gBAAAC,CACF,IAAM,CACJ,MAAMC,EAAaC,EAAQ,CACzB,WAAY,oCACZ,WAAY,oCACZ,cAAe,uCACf,cAAe,uCACf,YAAa,oCACb,YAAa,oCACb,aAAc,8BACd,gBAAiB,kCACjB,gBAAiB,kCACjB,mBAAoB,qCACpB,mBAAoB,oCAAA,CACrB,EAED,GAAI,CAACJ,EACI,OAAA,KAGT,MAAMK,EAAUF,EAAW,GAAGH,CAAM,SAAS,EACvCM,EAAUH,EAAW,GAAGH,CAAM,SAAS,EACvCO,EAAU,CACd,IAAKC,EACL,OAAQC,EACR,KAAMC,EACN,SAAUC,EACV,YAAaA,CACf,EAEMC,EAAiBV,EACnB,SAAS,KAAK,SAASA,CAAe,EACtC,GAGF,OAAAW,EAACC,EAAA,CACC,cAAY,iBACZ,QAAAT,EACA,YACEJ,EAAOK,EAAQ,QAAQ,YAAaL,EAAK,QAAQ,IAAI,EAAIK,EAE3D,KACEN,IAAW,YAAcA,IAAW,cAChC,UACA,UAEN,OAAOe,EAAK,CAAA,OAAQR,EAAQP,CAAM,EAAG,KAAK,KAAK,EAC/C,qBAAqB,MACrB,kBACE,CAACY,GAAkBV,EACf,CACE,CACE,MAAOC,EAAW,aAClB,QAAS,IAAM,CACb,SAAS,KAAOD,CAAA,CAClB,CACF,EAEF,MAAA,CAER,CAEJ","x_google_ignoreList":[0]}
@@ -1,4 +0,0 @@
1
- /*! Copyright 2026 Adobe
2
- All Rights Reserved. */
3
- import{jsx as s,jsxs as w,Fragment as B}from"@dropins/tools/preact-jsx-runtime.js";import{useMemo as ut,useState as pt,useEffect as vt,useCallback as at}from"@dropins/tools/preact-compat.js";import{classes as v}from"@dropins/tools/lib.js";import{Button as x,Icon as lt,Price as I,Image as yt}from"@dropins/tools/components.js";import{events as dt}from"@dropins/tools/event-bus.js";import"./fetch-error.js";import{a as bt,S as Nt}from"./Trash.js";import{useText as At}from"@dropins/tools/i18n.js";import{r as It}from"./removeProductsFromWishlist.js";const xt=({className:r,item:t,onCartActionButtonClick:c,onTrashButtonClick:a,routeProdDetailPage:p,imageNode:y,...o})=>{var _,z,k,g,S,q,P;const u=At({cartActionBtn:"ProductItem.CartActionButton",trashActionBtn:"ProductItem.TrashActionButton",customizeActionBtn:"ProductItem.CustomizeActionButton"}),n=((k=(z=(_=t.product)==null?void 0:_.prices)==null?void 0:z.final)==null?void 0:k.amount)<((q=(S=(g=t.product)==null?void 0:g.prices)==null?void 0:S.regular)==null?void 0:q.amount),m=()=>{var e;return s("a",{className:"wishlist-product-item-image","data-testid":"wishlist-product-item-image",href:p(t.product),children:s(Bt,{images:((e=t.product)==null?void 0:e.images)??[],imageNode:y})})},l=()=>{var e,i,h,A,F,W,C,M,T,$,j,E,U,V,Y,G,H,J,K,L,Q,R,X,Z,D,tt,rt,et,st,ct,ot,it,nt;return((h=(i=(e=t.product)==null?void 0:e.prices)==null?void 0:i.final)==null?void 0:h.amount)===void 0&&((W=(F=(A=t.product)==null?void 0:A.prices)==null?void 0:F.final)==null?void 0:W.maximumAmount)!==void 0&&((T=(M=(C=t.product)==null?void 0:C.prices)==null?void 0:M.final)==null?void 0:T.maximumAmount)>0?w(B,{children:[s(I,{className:"wishlist-product-item-price","data-testid":"wishlist-product-item-price",amount:(E=(j=($=t.product)==null?void 0:$.prices)==null?void 0:j.final)==null?void 0:E.minimumAmount,currency:(Y=(V=(U=t.product)==null?void 0:U.prices)==null?void 0:V.final)==null?void 0:Y.currency}),"-",s(I,{className:"wishlist-product-item-price","data-testid":"wishlist-product-item-price",amount:(J=(H=(G=t.product)==null?void 0:G.prices)==null?void 0:H.final)==null?void 0:J.maximumAmount,currency:(Q=(L=(K=t.product)==null?void 0:K.prices)==null?void 0:L.final)==null?void 0:Q.currency})]}):w(B,{children:[s(I,{className:v(["wishlist-product-item-price",n?"strikethrough":""]),"data-testid":"wishlist-product-item-price",amount:(Z=(X=(R=t.product)==null?void 0:R.prices)==null?void 0:X.regular)==null?void 0:Z.amount,currency:(rt=(tt=(D=t.product)==null?void 0:D.prices)==null?void 0:tt.regular)==null?void 0:rt.currency}),n&&s(I,{className:"wishlist-product-item-discounted-price","data-testid":"wishlist-product-item-discounted-price",amount:(ct=(st=(et=t.product)==null?void 0:et.prices)==null?void 0:st.final)==null?void 0:ct.amount,currency:(nt=(it=(ot=t.product)==null?void 0:ot.prices)==null?void 0:it.final)==null?void 0:nt.currency})]})},d=()=>s(x,{"data-testid":"wishlist-product-item-remove-button",className:"wishlist-product-item-button__remove",variant:"tertiary",onClick:()=>a==null?void 0:a(),icon:s(lt,{source:bt,size:"24",stroke:"2",viewBox:"0 0 24 24","aria-label":u.trashActionBtn})}),N=()=>f()?ft():wt(),f=()=>{var e;return((e=t.product)==null?void 0:e.productType)==="complex"?mt():!0},b=ut(()=>{var e;return((e=t.selectedOptions)==null?void 0:e.map(i=>i.uid))||[]},[t.selectedOptions]),O=ut(()=>{const e=t.product.options||[],i=e.filter(h=>h.required);return i.length===0?e:i},[t.product.options]),mt=()=>O.every(e=>{var i;return(i=e.items)==null?void 0:i.some(h=>b.includes(h.id))}),ht=()=>b.length===0?null:s("div",{className:"wishlist-product-item-options",children:O.map(e=>{var h;const i=(h=e.items)==null?void 0:h.find(A=>b.includes(A.id));return i?w("div",{className:"wishlist-product-item-option",children:[w("span",{className:"wishlist-product-item-option__attribute",children:[e.label,":"]})," ",s("span",{className:"wishlist-product-item-option__label",children:i.label})]},e.type):null})}),ft=()=>{var e;return s(x,{"data-testid":"wishlist-product-item-move-to-cart-button",size:"medium",type:"submit",icon:s(lt,{source:Nt}),disabled:!((e=t.product)!=null&&e.inStock),"aria-label":u.cartActionBtn,onClick:()=>c==null?void 0:c(),children:u.cartActionBtn})},wt=()=>s(x,{"data-testid":"wishlist-product-item-customize-button",size:"medium",type:"submit","aria-label":u.customizeActionBtn,href:p(t.product),children:u.customizeActionBtn});return s("div",{...o,className:v(["wishlist-product-item",r]),children:w("div",{className:"wishlist-product-item__content",children:[m(),w("div",{className:"wishlist-product-item__title","data-testid":"wishlist-product-item-header",children:[s("a",{className:"wishlist-product-item-name","data-testid":"wishlist-product-item-name",href:p(t.product),children:(P=t.product)==null?void 0:P.name}),d(),l()]}),ht(),N()]})})},Bt=({className:r,children:t,images:c,imageNode:a,...p})=>{const[y,o]=pt(0);return w(B,{children:[s("div",{...p,className:v(["image-carousel",r]),children:s("div",{className:v(["overflow-hidden relative max-w-[200px]",r]),children:c==null?void 0:c.map((u,n)=>{const m={className:v(["image-carousel-image",r]),src:u.url,alt:u.label};return n!==y?null:typeof a=="function"?a({defaultImageProps:m}):a||s(yt,{...m})})})}),(c==null?void 0:c.length)>1&&s("div",{className:v(["absolute","image-switcher-area"]),children:c==null?void 0:c.map((u,n)=>s("span",{className:v(["image-switcher",y===n?"image-switcher-active":"image-switcher-inactive"]),onClick:m=>{o(n),m.preventDefault(),m.stopPropagation()}},n))})]})},Wt=({item:r,getProductData:t,getRefinedProduct:c,moveProdToCart:a,routeProdDetailPage:p,imageNode:y})=>{const[o,u]=pt(null);vt(()=>{let l=!1;async function d(){var N;try{let f;c&&((N=r==null?void 0:r.selectedOptions)==null?void 0:N.length)>0?f=await c(r.product.sku,r.selectedOptions.map(b=>b.uid)):f=t?await t(r==null?void 0:r.product.sku):r==null?void 0:r.product,l||u(f)}catch(f){l||console.error("Failed to fetch product data:",f)}}return d(),()=>{l=!0}},[r,t,c]);const n=at(async(l=!0)=>{try{return await It([r]),console.log(`Product ${o==null?void 0:o.sku} removed from wishlist!`),l&&dt.emit("wishlist/alert",{action:"remove",item:{...r,product:o}}),!0}catch(d){return console.error(`Product ${o.sku} could not be removed from wishlist`,d),!1}},[r,o]),m=at(async()=>{var l;try{return await a([{sku:o.sku,quantity:1,optionsUIDs:(l=r.selectedOptions)==null?void 0:l.map(d=>d.uid),enteredOptions:r.enteredOptions}]),console.log(`Product ${o.sku} successfully moved to cart 🛒`),dt.emit("wishlist/alert",{action:"move",item:{...r,product:o}}),await n(!1)}catch(d){return console.error("Could not move product to cart: ",d),d.toString().includes("You need to choose options for your item.")&&window.location.replace(p(o)),!1}},[o,r,a,p,n]);return!o||!r?null:s(xt,{item:{...r,product:o},onCartActionButtonClick:m,onTrashButtonClick:n,routeProdDetailPage:p,imageNode:y})};export{Wt as W};
4
- //# sourceMappingURL=WishlistItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WishlistItem.js","sources":["/@dropins/storefront-wishlist/src/components/ProductItem/ProductItem.tsx","/@dropins/storefront-wishlist/src/components/ImageCarousel/ImageCarousel.tsx","/@dropins/storefront-wishlist/src/containers/WishlistItem/WishlistItem.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { HTMLAttributes, useMemo } from 'preact/compat';\nimport { FunctionComponent, JSX } from 'preact';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport {\n Button,\n Icon,\n ImageNodeRenderProps,\n Price,\n} from '@adobe-commerce/elsie/components';\nimport { ImageCarousel } from '@/wishlist/components';\nimport { Item, Product } from '@/wishlist/data/models';\nimport { Cart, Trash } from '@adobe-commerce/elsie/icons';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport '@/wishlist/components/ProductItem/ProductItem.css';\n\nexport interface ProductItemProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n item?: Item;\n onCartActionButtonClick?: () => boolean;\n onTrashButtonClick?: () => boolean;\n routeProdDetailPage: (product: Product) => string;\n imageNode?: (props: {\n defaultImageProps: ImageNodeRenderProps;\n }) => JSX.Element;\n}\n\nexport const ProductItem: FunctionComponent<ProductItemProps> = ({\n className,\n item,\n onCartActionButtonClick,\n onTrashButtonClick,\n routeProdDetailPage,\n imageNode,\n ...props\n}) => {\n const labels = useText({\n cartActionBtn: 'ProductItem.CartActionButton',\n trashActionBtn: 'ProductItem.TrashActionButton',\n customizeActionBtn: 'ProductItem.CustomizeActionButton',\n });\n\n const discounted =\n item.product?.prices?.final?.amount < item.product?.prices?.regular?.amount;\n\n const renderImage = () => {\n return (\n <a\n className=\"wishlist-product-item-image\"\n data-testid=\"wishlist-product-item-image\"\n href={routeProdDetailPage(item.product)}\n >\n <ImageCarousel\n images={item.product?.images ?? []}\n imageNode={imageNode}\n />\n </a>\n );\n };\n\n const renderPrices = () => {\n if (\n item.product?.prices?.final?.amount === undefined &&\n item.product?.prices?.final?.maximumAmount !== undefined &&\n item.product?.prices?.final?.maximumAmount > 0\n ) {\n return (\n <>\n <Price\n className=\"wishlist-product-item-price\"\n data-testid=\"wishlist-product-item-price\"\n amount={item.product?.prices?.final?.minimumAmount}\n currency={item.product?.prices?.final?.currency}\n />\n -\n <Price\n className=\"wishlist-product-item-price\"\n data-testid=\"wishlist-product-item-price\"\n amount={item.product?.prices?.final?.maximumAmount}\n currency={item.product?.prices?.final?.currency}\n />\n </>\n );\n }\n return (\n <>\n <Price\n className={classes([\n 'wishlist-product-item-price',\n discounted ? 'strikethrough' : '',\n ])}\n data-testid=\"wishlist-product-item-price\"\n amount={item.product?.prices?.regular?.amount}\n currency={item.product?.prices?.regular?.currency}\n />\n\n {discounted && (\n <Price\n className=\"wishlist-product-item-discounted-price\"\n data-testid=\"wishlist-product-item-discounted-price\"\n amount={item.product?.prices?.final?.amount}\n currency={item.product?.prices?.final?.currency}\n />\n )}\n </>\n );\n };\n\n const renderTrashButton = () => {\n return (\n <Button\n data-testid=\"wishlist-product-item-remove-button\"\n className=\"wishlist-product-item-button__remove\"\n variant=\"tertiary\"\n onClick={() => onTrashButtonClick?.()}\n icon={\n <Icon\n source={Trash}\n size=\"24\"\n stroke=\"2\"\n viewBox=\"0 0 24 24\"\n aria-label={labels.trashActionBtn}\n />\n }\n />\n );\n };\n\n const renderMainActionButton = () => {\n return isProductReady()\n ? renderMoveToCartButton()\n : renderCustomizeButton();\n };\n\n const isProductReady = () => {\n if (item.product?.productType === 'complex') {\n return areAllRequiredOptionsIncluded();\n }\n return true;\n };\n\n const selectedOptions = useMemo(\n () => item.selectedOptions?.map((opt: any) => opt.uid) || [],\n [item.selectedOptions]\n );\n\n const requiredOptions = useMemo(() => {\n const options = item.product.options || [];\n const required = options.filter((option: any) => option.required);\n return required.length === 0 ? options : required;\n }, [item.product.options]);\n\n const areAllRequiredOptionsIncluded = (): boolean => {\n return requiredOptions.every((option: any) =>\n option.items?.some((item: any) => selectedOptions.includes(item.id))\n );\n };\n\n const renderOptions = () => {\n if (selectedOptions.length === 0) return null;\n\n return (\n <div className=\"wishlist-product-item-options\">\n {requiredOptions.map((option: any) => {\n const selectedValue = option.items?.find((item: any) =>\n selectedOptions.includes(item.id)\n );\n return selectedValue ? (\n <div key={option.type} className=\"wishlist-product-item-option\">\n <span className=\"wishlist-product-item-option__attribute\">\n {option.label}:\n </span>\n &nbsp;\n <span className=\"wishlist-product-item-option__label\">\n {selectedValue.label}\n </span>\n </div>\n ) : null;\n })}\n </div>\n );\n };\n\n const renderMoveToCartButton = () => {\n return (\n <Button\n data-testid=\"wishlist-product-item-move-to-cart-button\"\n size=\"medium\"\n type=\"submit\"\n icon={<Icon source={Cart} />}\n disabled={!item.product?.inStock}\n aria-label={labels.cartActionBtn}\n onClick={() => onCartActionButtonClick?.()}\n >\n {labels.cartActionBtn}\n </Button>\n );\n };\n\n const renderCustomizeButton = () => {\n return (\n <Button\n data-testid=\"wishlist-product-item-customize-button\"\n size=\"medium\"\n type=\"submit\"\n aria-label={labels.customizeActionBtn}\n href={routeProdDetailPage(item.product)}\n >\n {labels.customizeActionBtn}\n </Button>\n );\n };\n\n return (\n <div {...props} className={classes(['wishlist-product-item', className])}>\n <div className=\"wishlist-product-item__content\">\n {renderImage()}\n <div\n className=\"wishlist-product-item__title\"\n data-testid=\"wishlist-product-item-header\"\n >\n <a\n className=\"wishlist-product-item-name\"\n data-testid=\"wishlist-product-item-name\"\n href={routeProdDetailPage(item.product)}\n >\n {item.product?.name}\n </a>\n\n {renderTrashButton()}\n {renderPrices()}\n </div>\n {renderOptions()}\n {renderMainActionButton()}\n </div>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent, JSX } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes } from '@adobe-commerce/elsie/lib';\nimport { Image, ImageNodeRenderProps } from '@adobe-commerce/elsie/components';\nimport { useState } from 'react';\n\nimport '@/wishlist/components/ImageCarousel/ImageCarousel.css';\n\nexport interface ImageCarouselProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n children?: any;\n images: Image[];\n imageNode?: (props: {\n defaultImageProps: ImageNodeRenderProps;\n }) => JSX.Element;\n}\n\nexport const ImageCarousel: FunctionComponent<ImageCarouselProps> = ({\n className,\n children,\n images,\n imageNode,\n ...props\n}) => {\n const [carouselIndex, setCarouselIndex] = useState(0);\n\n return (\n <>\n <div {...props} className={classes(['image-carousel', className])}>\n <div\n className={classes([\n 'overflow-hidden relative max-w-[200px]',\n className,\n ])}\n >\n {images?.map(\n (image: ImageCarouselProps['images'][0], index: number) => {\n const defaultProps = {\n className: classes(['image-carousel-image', className]),\n src: image.url,\n alt: image.label,\n } as const;\n\n if (index !== carouselIndex) {\n return null;\n }\n\n return typeof imageNode === 'function'\n ? imageNode({\n defaultImageProps: defaultProps,\n })\n : imageNode || <Image {...defaultProps} />;\n }\n )}\n </div>\n </div>\n {images?.length > 1 && (\n <div className={classes(['absolute', 'image-switcher-area'])}>\n {images?.map(\n (_image: ImageCarouselProps['images'][0], index: number) => {\n return (\n <span\n className={classes([\n 'image-switcher',\n carouselIndex === index\n ? 'image-switcher-active'\n : 'image-switcher-inactive',\n ])}\n key={index}\n onClick={(event: MouseEvent | TouchEvent) => {\n setCarouselIndex(index);\n event.preventDefault(); // prevent navigate on click since ImageCarousel is wrapped in a link\n event.stopPropagation();\n }}\n />\n );\n }\n )}\n </div>\n )}\n </>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n HTMLAttributes,\n useEffect,\n useState,\n useCallback,\n} from 'preact/compat';\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { ProductItem } from '@/wishlist/components';\nimport { Item, Product } from '@/wishlist/data/models';\nimport { removeProductsFromWishlist } from '@/wishlist/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { ImageNodeRenderProps } from '@adobe-commerce/elsie/components';\nimport { JSX } from 'preact';\n\nexport interface WishlistItemProps extends HTMLAttributes<HTMLDivElement> {\n item: Item;\n getProductData?: (sku: string) => Promise<Product | null>;\n getRefinedProduct?: (\n sku: string,\n optionUIDs: string[],\n anchorOptions?: string[],\n raw?: boolean\n ) => Promise<Product | null>;\n moveProdToCart: (\n products: {\n sku: string;\n quantity: number;\n optionsUIDs?: [];\n enteredOptions?: [];\n }[]\n ) => Promise<any>;\n routeProdDetailPage: (product: Product) => string;\n imageNode?: (props: {\n defaultImageProps: ImageNodeRenderProps;\n }) => JSX.Element;\n}\n\nexport const WishlistItem: Container<WishlistItemProps> = ({\n item,\n getProductData,\n getRefinedProduct,\n moveProdToCart,\n routeProdDetailPage,\n imageNode,\n}: WishlistItemProps) => {\n const [productData, setProductData] = useState<Product | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n\n async function fetchProductData() {\n try {\n let data: Product | null;\n if (getRefinedProduct && item?.selectedOptions?.length > 0) {\n data = await getRefinedProduct(\n item.product.sku,\n item.selectedOptions.map((option: { uid: any }) => option.uid)\n );\n } else {\n data = getProductData\n ? await getProductData(item?.product.sku)\n : item?.product;\n }\n if (!cancelled) setProductData(data);\n } catch (err) {\n if (!cancelled) {\n console.error('Failed to fetch product data:', err);\n }\n }\n }\n\n fetchProductData();\n\n return () => {\n cancelled = true;\n };\n }, [item, getProductData, getRefinedProduct]);\n\n /**\n * Removes product from wishlist\n */\n const removeProductFromWishlist = useCallback(\n async (showAlert: boolean = true): Promise<boolean> => {\n try {\n await removeProductsFromWishlist([item]);\n console.log(`Product ${productData?.sku} removed from wishlist!`);\n if (showAlert) {\n events.emit('wishlist/alert', {\n action: 'remove',\n item: { ...item, product: productData },\n });\n }\n return true;\n } catch (error) {\n console.error(\n `Product ${productData.sku} could not be removed from wishlist`,\n error\n );\n return false;\n }\n },\n [item, productData]\n );\n\n /**\n * Moves product to cart\n */\n const moveProductToCart = useCallback(async (): Promise<boolean> => {\n try {\n await moveProdToCart([\n {\n sku: productData.sku,\n quantity: 1,\n optionsUIDs: item.selectedOptions?.map(\n (option: { uid: any }) => option.uid\n ),\n enteredOptions: item.enteredOptions,\n },\n ]);\n console.log(`Product ${productData.sku} successfully moved to cart 🛒`);\n events.emit('wishlist/alert', {\n action: 'move',\n item: { ...item, product: productData },\n });\n return await removeProductFromWishlist(false);\n } catch (error) {\n console.error('Could not move product to cart: ', error);\n if (\n error.toString().includes('You need to choose options for your item.')\n ) {\n window.location.replace(routeProdDetailPage(productData));\n }\n return false;\n }\n }, [\n productData,\n item,\n moveProdToCart,\n routeProdDetailPage,\n removeProductFromWishlist,\n ]);\n\n if (!productData || !item) return null;\n\n return (\n <ProductItem\n item={{ ...item, product: productData }}\n onCartActionButtonClick={moveProductToCart}\n onTrashButtonClick={removeProductFromWishlist}\n routeProdDetailPage={routeProdDetailPage}\n imageNode={imageNode}\n />\n );\n};\n"],"names":["ProductItem","className","item","onCartActionButtonClick","onTrashButtonClick","routeProdDetailPage","imageNode","props","labels","useText","discounted","_c","_b","_a","_f","_e","_d","renderImage","jsx","ImageCarousel","renderPrices","_i","_h","_g","jsxs","Fragment","Price","_l","_k","_j","_o","_n","_m","_r","_q","_p","_u","_t","_s","classes","_x","_w","_v","_A","_z","_y","_D","_C","_B","_G","_F","_E","renderTrashButton","Button","Icon","Trash","renderMainActionButton","isProductReady","renderMoveToCartButton","renderCustomizeButton","areAllRequiredOptionsIncluded","selectedOptions","useMemo","opt","requiredOptions","options","required","option","renderOptions","selectedValue","Cart","children","images","carouselIndex","setCarouselIndex","useState","image","index","defaultProps","Image","_image","event","WishlistItem","getProductData","getRefinedProduct","moveProdToCart","productData","setProductData","useEffect","cancelled","fetchProductData","data","err","removeProductFromWishlist","useCallback","showAlert","removeProductsFromWishlist","events","error","moveProductToCart"],"mappings":"qiBA4CO,MAAMA,GAAmD,CAAC,CAC/D,UAAAC,EACA,KAAAC,EACA,wBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,UAAAC,EACA,GAAGC,CACL,IAAM,mBACJ,MAAMC,EAASC,GAAQ,CACrB,cAAe,+BACf,eAAgB,gCAChB,mBAAoB,mCAAA,CACrB,EAEKC,IACJC,GAAAC,GAAAC,EAAAX,EAAK,UAAL,YAAAW,EAAc,SAAd,YAAAD,EAAsB,QAAtB,YAAAD,EAA6B,UAASG,GAAAC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AWZ,EAAY,GAAG,sCAC1BY,CACF,EACO,EAAA,CAEX,EACA,CAAChG,EAAMoF,CAAW,CACpB,EAKMa,EAAoBL,GAAY,SAA8B,OAC9D,GAAA,CACF,aAAMT,EAAe,CACnB,CACE,IAAKC,EAAY,IACjB,SAAU,EACV,aAAazE,EAAAX,EAAK,kBAAL,YAAAW,EAAsB,IAChCsD,GAAyBA,EAAO,KAEnC,eAAgBjE,EAAK,cAAA,CACvB,CACD,EACD,QAAQ,IAAI,WAAWoF,EAAY,GAAG,gCAAgC,EACtEW,GAAO,KAAK,iBAAkB,CAC5B,OAAQ,OACR,KAAM,CAAE,GAAG/F,EAAM,QAASoF,CAAY,CAAA,CACvC,EACM,MAAMO,EAA0B,EAAK,QACrCK,EAAO,CACN,eAAA,MAAM,mCAAoCA,CAAK,EAErDA,EAAM,SAAA,EAAW,SAAS,2CAA2C,GAErE,OAAO,SAAS,QAAQ7F,EAAoBiF,CAAW,CAAC,EAEnD,EAAA,CACT,EACC,CACDA,EACApF,EACAmF,EACAhF,EACAwF,CAAA,CACD,EAED,MAAI,CAACP,GAAe,CAACpF,EAAa,KAGhCgB,EAAClB,GAAA,CACC,KAAM,CAAE,GAAGE,EAAM,QAASoF,CAAY,EACtC,wBAAyBa,EACzB,mBAAoBN,EACpB,oBAAAxF,EACA,UAAAC,CAAA,CACF,CAEJ"}
@@ -1,4 +0,0 @@
1
- /*! Copyright 2026 Adobe
2
- All Rights Reserved. */
3
- import{FetchGraphQL as g}from"@dropins/tools/fetch-graphql.js";function f(t){const e=document.cookie.split(";");for(const s of e)if(s.trim().startsWith(`${t}=`))return s.trim().substring(t.length+1);return null}const a={wishlistId:null,authenticated:!1,isLoading:!0},d=()=>a.storeCode&&a.storeCode!=="default"?`DROPIN__WISHLIST__WISHLIST-ID__${a.storeCode}`:"DROPIN__WISHLIST__WISHLIST-ID",n=new Proxy(a,{set(t,e,s){if(t[e]=s,e==="wishlistId"){const r=d();if(s===n.wishlistId)return!0;if(s===null)return document.cookie=`${r}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`,!0;const o=new Date;o.setDate(o.getDate()+30),document.cookie=`${r}=${s}; expires=${o.toUTCString()}; path=/`}return Reflect.set(t,e,s)},get(t,e){return e==="wishlistId"?f(d()):t[e]}});function I(t,e){var o;if(t.product.sku!==e.sku)return!1;const s=((o=t.selectedOptions)==null?void 0:o.map(i=>i.uid).filter(i=>!!i).sort())||[],r=(e.optionUIDs||[]).filter(i=>!!i).sort();return JSON.stringify(s)===JSON.stringify(r)}const u="DROPIN__WISHLIST__WISHLIST__DATA",c=()=>n.storeCode&&n.storeCode!=="default"?`${u}__${n.storeCode}`:u;function p(t){const e=n.authenticated?sessionStorage:localStorage,s=c();if(t)try{e.setItem(s,JSON.stringify(t))}catch(r){S(r)?console.error("Storage quota exceeded:",r):console.error("Error saving wishlist:",r)}else e.removeItem(s)}const S=t=>t instanceof DOMException&&t.name==="QuotaExceededError";function _(t=!1){const e=n.authenticated&&!t?sessionStorage:localStorage,s=c();try{const r=e.getItem(s);return r?JSON.parse(r):{id:"",items:[]}}catch(r){return console.error("Error retrieving wishlist:",r),{id:"",items:[]}}}function D(){localStorage.removeItem(c())}function W(t,e=[]){var l;const s=n.authenticated?sessionStorage:localStorage,r=c(),o=s.getItem(r),i=o?JSON.parse(o):{items:[]};return(l=i==null?void 0:i.items)==null?void 0:l.find(h=>I(h,{sku:t,optionUIDs:e}))}const{setEndpoint:E,setFetchGraphQlHeader:O,removeFetchGraphQlHeader:k,setFetchGraphQlHeaders:w,fetchGraphQl:C,getConfig:T}=new g().getMethods(),H=t=>{const e=t.map(s=>s.message).join(" ");throw Error(e)};export{E as a,O as b,w as c,T as d,p as e,C as f,_ as g,H as h,I as i,D as j,W as k,k as r,n as s};
4
- //# sourceMappingURL=fetch-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-error.js","sources":["/@dropins/storefront-wishlist/src/lib/cookies.ts","/@dropins/storefront-wishlist/src/lib/state.ts","/@dropins/storefront-wishlist/src/lib/wishlist-item-comparator.ts","/@dropins/storefront-wishlist/src/lib/persisted-data.ts","/@dropins/storefront-wishlist/src/api/fetch-graphql/fetch-graphql.ts","/@dropins/storefront-wishlist/src/lib/fetch-error.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport function getCookie(cookieName: string) {\n // Split the cookie string into an array of individual cookies\n const cookies = document.cookie.split(';');\n\n // Loop through the cookies to find the one with the specified name\n for (const cookie of cookies) {\n // Check if this cookie starts with the name you're looking for\n if (cookie.trim().startsWith(`${cookieName}=`)) {\n // Extract and return the cookie's value\n return cookie.trim().substring(cookieName.length + 1);\n }\n }\n\n // If the cookie is not found, return null\n return null;\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { StoreConfigModel } from '@/wishlist/data/models/store-config';\nimport { getCookie } from '@/wishlist/lib/cookies';\n\ntype State = {\n wishlistId: string | null;\n initializing?: boolean;\n isLoading?: boolean;\n locale?: string;\n config?: StoreConfigModel | null;\n authenticated: boolean;\n storeCode?: string;\n};\n\nconst _state: State = (() => {\n return {\n wishlistId: null,\n authenticated: false,\n isLoading: true,\n };\n})();\n\nconst getWishlistCookieName = (): string =>\n _state.storeCode && _state.storeCode !== 'default'\n ? `DROPIN__WISHLIST__WISHLIST-ID__${_state.storeCode}`\n : 'DROPIN__WISHLIST__WISHLIST-ID';\n\n// Proxy state to allow reactivity\nexport const state = new Proxy(_state, {\n set(target, key, value) {\n // @ts-ignore\n target[key] = value;\n\n if (key === 'wishlistId') {\n const cookieName = getWishlistCookieName();\n\n // only update cookie if value has changed\n if (value === state.wishlistId) return true;\n\n if (value === null) {\n document.cookie = `${cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`;\n return true;\n }\n\n // set expiration date\n const expires = new Date();\n expires.setDate(expires.getDate() + 30);\n document.cookie = `${cookieName}=${value}; expires=${expires.toUTCString()}; path=/`;\n }\n\n return Reflect.set(target, key, value);\n },\n get(target, key) {\n if (key === 'wishlistId') {\n return getCookie(getWishlistCookieName());\n }\n\n return target[key as keyof State];\n },\n});\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Item } from '@/wishlist/data/models/wishlist';\n\ninterface ProductLike {\n sku: string;\n optionUIDs?: string[];\n}\n\n/**\n * Helper function to compare wishlist items by their SKU and selected options\n */\nexport function isMatchingWishlistItem(\n wishlistItem: Item,\n product: ProductLike\n): boolean {\n // Compare SKUs first for early return\n if (wishlistItem.product.sku !== product.sku) {\n return false;\n }\n\n // Compare selected options\n const wishlistItemOptions =\n wishlistItem.selectedOptions\n ?.map((option: any) => option.uid)\n .filter((uid: any) => !!uid)\n .sort() || [];\n const productOptionUIDs = (product.optionUIDs || [])\n .filter((uid: any) => !!uid)\n .sort();\n\n // If options match (or both are empty), items are considered matching\n return (\n JSON.stringify(wishlistItemOptions) === JSON.stringify(productOptionUIDs)\n );\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Wishlist } from '@/wishlist/data/models';\nimport { state } from '@/wishlist/lib/state';\nimport { isMatchingWishlistItem } from '@/wishlist/lib/wishlist-item-comparator';\n\nconst WISHLIST_KEY_BASE = 'DROPIN__WISHLIST__WISHLIST__DATA';\n\nconst getWishlistKey = (): string =>\n state.storeCode && state.storeCode !== 'default'\n ? `${WISHLIST_KEY_BASE}__${state.storeCode}`\n : WISHLIST_KEY_BASE;\n\nexport function setPersistedWishlistData(data: Wishlist | null) {\n const $storage = state.authenticated ? sessionStorage : localStorage;\n const key = getWishlistKey();\n if (data) {\n try {\n $storage.setItem(key, JSON.stringify(data));\n } catch (error) {\n if (isQuotaExceededError(error)) {\n console.error('Storage quota exceeded:', error);\n } else {\n console.error('Error saving wishlist:', error);\n }\n }\n } else {\n $storage.removeItem(key);\n }\n}\n\nconst isQuotaExceededError = (error: unknown) => {\n //https://mmazzarolo.com/blog/2022-06-25-local-storage-status/\n return error instanceof DOMException && error.name === 'QuotaExceededError';\n};\n\nexport function getPersistedWishlistData(\n guest: boolean = false\n): Wishlist | {} {\n const $storage =\n state.authenticated && !guest ? sessionStorage : localStorage;\n const key = getWishlistKey();\n try {\n const wishlist = $storage.getItem(key);\n return wishlist ? JSON.parse(wishlist) : { id: '', items: [] };\n } catch (error) {\n console.error('Error retrieving wishlist:', error);\n return { id: '', items: [] };\n }\n}\n\nexport function clearPersistedLocalStorage() {\n localStorage.removeItem(getWishlistKey());\n}\n\nexport function getWishlistItemFromStorage(\n productSku: string,\n optionUIDs: string[] = []\n) {\n const storage = state.authenticated ? sessionStorage : localStorage;\n const key = getWishlistKey();\n const raw = storage.getItem(key);\n const wishlist = raw ? JSON.parse(raw) : { id: '', items: [] };\n\n return wishlist?.items?.find((item: any) =>\n isMatchingWishlistItem(item, {\n sku: productSku,\n optionUIDs,\n })\n );\n}\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FetchGraphQL } from '@adobe-commerce/fetch-graphql';\n\nexport const {\n setEndpoint,\n setFetchGraphQlHeader,\n removeFetchGraphQlHeader,\n setFetchGraphQlHeaders,\n fetchGraphQl,\n getConfig,\n} = new FetchGraphQL().getMethods();\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/** Actions */\nexport const handleFetchError = (errors: Array<{ message: string }>) => {\n const errorMessage = errors.map((e: any) => e.message).join(' ');\n\n throw Error(errorMessage);\n};\n"],"names":["getCookie","cookieName","cookies","cookie","_state","getWishlistCookieName","state","target","key","value","expires","isMatchingWishlistItem","wishlistItem","product","wishlistItemOptions","_a","option","uid","productOptionUIDs","WISHLIST_KEY_BASE","getWishlistKey","setPersistedWishlistData","data","$storage","error","isQuotaExceededError","getPersistedWishlistData","guest","wishlist","clearPersistedLocalStorage","getWishlistItemFromStorage","productSku","optionUIDs","storage","raw","item","setEndpoint","setFetchGraphQlHeader","removeFetchGraphQlHeader","setFetchGraphQlHeaders","fetchGraphQl","getConfig","FetchGraphQL","handleFetchError","errors","errorMessage","e"],"mappings":"+DAiBO,SAASA,EAAUC,EAAoB,CAE5C,MAAMC,EAAU,SAAS,OAAO,MAAM,GAAG,EAGzC,UAAWC,KAAUD,EAEnB,GAAIC,EAAO,OAAO,WAAW,GAAGF,CAAU,GAAG,EAE3C,OAAOE,EAAO,KAAK,EAAE,UAAUF,EAAW,OAAS,CAAC,EAKjD,OAAA,IACT,CCFA,MAAMG,EACG,CACL,WAAY,KACZ,cAAe,GACf,UAAW,EACb,EAGIC,EAAwB,IAC5BD,EAAO,WAAaA,EAAO,YAAc,UACrC,kCAAkCA,EAAO,SAAS,GAClD,gCAGOE,EAAQ,IAAI,MAAMF,EAAQ,CACrC,IAAIG,EAAQC,EAAKC,EAAO,CAItB,GAFAF,EAAOC,CAAG,EAAIC,EAEVD,IAAQ,aAAc,CACxB,MAAMP,EAAaI,EAAsB,EAGrC,GAAAI,IAAUH,EAAM,WAAmB,MAAA,GAEvC,GAAIG,IAAU,KACH,gBAAA,OAAS,GAAGR,CAAU,mDACxB,GAIH,MAAAS,MAAc,KACpBA,EAAQ,QAAQA,EAAQ,QAAQ,EAAI,EAAE,EAC7B,SAAA,OAAS,GAAGT,CAAU,IAAIQ,CAAK,aAAaC,EAAQ,YAAa,CAAA,UAAA,CAG5E,OAAO,QAAQ,IAAIH,EAAQC,EAAKC,CAAK,CACvC,EACA,IAAIF,EAAQC,EAAK,CACf,OAAIA,IAAQ,aACHR,EAAUK,GAAuB,EAGnCE,EAAOC,CAAkB,CAAA,CAEpC,CAAC,EChDe,SAAAG,EACdC,EACAC,EACS,OAET,GAAID,EAAa,QAAQ,MAAQC,EAA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