@dropins/tools 2.0.0-beta.1 → 2.0.1-alpha-20260728135101
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.
- package/CHANGELOG.md +462 -64
- package/LICENSE.md +257 -157
- package/chunks/Image.js.map +1 -1
- package/chunks/cjs.js.map +1 -1
- package/chunks/format-calendar-date.js.map +1 -1
- package/chunks/image-params-keymap.js.map +1 -1
- package/chunks/initializer.js.map +1 -1
- package/chunks/locale-config.js.map +1 -1
- package/chunks/preact-vendor.js.map +1 -1
- package/chunks/vcomponent.js.map +1 -1
- package/components.js +1 -1
- package/components.js.map +1 -1
- package/event-bus.js.map +1 -1
- package/fetch-graphql.js.map +1 -1
- package/lib/aem/assets.js.map +1 -1
- package/lib/aem/configs.js.map +1 -1
- package/lib.js.map +1 -1
- package/package.json +1 -1
- package/recaptcha.js.map +1 -1
- package/shims/importmap.js.map +1 -1
- package/signals.js.map +1 -1
package/chunks/vcomponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vcomponent.js","sources":["/@dropins/tools/src/lib/classes.ts","/@dropins/tools/src/lib/resolve-image.ts","/@dropins/tools/src/lib/render.tsx","/@dropins/tools/src/lib/vcomponent.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\n// @ts-ignore\nimport { JSXInternal } from 'preact/src/jsx';\n\ntype ClassName = string | JSXInternal.SignalLike<string | undefined>;\n\nexport const classes = (\n classes: Array<ClassName | [ClassName, boolean] | undefined>\n) => {\n const result = classes.reduce((result, item) => {\n if (!item) return result;\n\n if (typeof item === 'string') result += ` ${item}`;\n\n if (Array.isArray(item)) {\n const [className, isActive] = item;\n if (className && isActive) {\n result += ` ${className}`;\n }\n }\n\n return result;\n }, '') as string;\n\n return result.trim();\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { getImageParamsKeyMap } from '@adobe-commerce/elsie/lib/';\n\nconst BREAKPOINTS = {\n medium: 768,\n large: 1024,\n xlarge: 1366,\n xxlarge: 1920,\n};\n\nexport interface ResolveImageUrlOptions {\n width: number;\n height?: number;\n auto?: string;\n quality?: number;\n crop?: boolean;\n fit?: string;\n}\n\nconst resolveImageUrl = (url: string, _opts?: ResolveImageUrlOptions) => {\n const [base, query] = url.split('?');\n const params = new URLSearchParams(query);\n\n const keyMapping = getImageParamsKeyMap();\n const keyMappingKeys = (keyMapping && Object.keys(keyMapping)) || [];\n\n let opts: any = {};\n const unusedMapping = { ...keyMapping };\n\n if (keyMappingKeys?.length > 0 && _opts) {\n opts = Object.entries(_opts).reduce((acc, [key, value]) => {\n const newKey = keyMapping![key];\n if (typeof newKey === 'string') {\n acc[newKey] = value;\n } else if (typeof newKey === 'function') {\n const [newKeyString, newValue] = newKey(value);\n acc[newKeyString] = newValue;\n }\n delete unusedMapping![key];\n return acc;\n }, {} as { [key: string]: any });\n } else {\n opts = {\n auto: 'webp',\n quality: 80,\n crop: false,\n fit: 'cover',\n ..._opts,\n };\n }\n\n // Set unused mapping as default params\n Object.entries(unusedMapping).forEach(([, value]) => {\n if (typeof value === 'function') {\n const [newKeyString, newValue] = value(undefined);\n opts[newKeyString] = newValue;\n }\n });\n\n // Append image optimization parameters\n Object.entries(opts).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n\n return `${base}?${params.toString()}`;\n};\n\nexport const generateSrcset = (\n imageURL: string,\n options: ResolveImageUrlOptions\n) => {\n if (!imageURL || !options?.width) return;\n\n const generateSrcsetUrl = (options: ResolveImageUrlOptions) => {\n return resolveImageUrl(imageURL, {\n ...options,\n });\n };\n\n return Object.entries(BREAKPOINTS)\n .map(([, value]) => {\n const relativeWidth = Math.round(\n (options.width * value) / BREAKPOINTS.xxlarge\n );\n\n return `${generateSrcsetUrl({\n ...options,\n width: relativeWidth,\n })} ${relativeWidth}w`;\n })\n .join(',\\n');\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { render, VNode, createContext } from 'preact';\nimport renderToString from 'preact-render-to-string';\nimport { Container, VComponent } from '@adobe-commerce/elsie/lib';\nimport { Signal, signal } from '@adobe-commerce/elsie/lib/signals';\nimport debuggerCss from '../components/UIProvider/debugger.css?inline';\n\nexport const SlotQueueContext = createContext<Signal<Set<string>> | null>(null);\n\ntype RenderAPI = {\n remove: () => void;\n setProps: (cb: (prev: any) => any) => void;\n};\n\n/**\n * The `Render` class provides methods to render and unmount components, as well as to render components to a string.\n * @class\n *\n * @property {Function} render - Renders a component to a root element.\n * @property {Function} toString - Renders a component to a string.\n */\nexport class Render {\n private _provider: VNode<any>;\n\n constructor(provider: VNode<any>) {\n this._provider = provider;\n }\n\n /**\n * Renders a container to a root element.\n * @param Container - The container to render.\n * @param props - The container parameters.\n * @returns A function to render the component to a root element.\n */\n render<T>(Component: Container<T>, props: T) {\n /**\n * Renders a component to a root element.\n * @param rootElement - The root element to render the component to.\n * @returns A promise that resolves to an object with methods to control the rendered component.\n */\n return async (rootElement: HTMLElement): Promise<RenderAPI> => {\n if (!Component) throw new Error('Component is not defined');\n if (!rootElement) throw new Error('Root element is not defined');\n\n const initialData = (await Component.getInitialData?.(props)) ?? {};\n\n const state = signal<T>({ ...props });\n\n const queue = signal<Set<string>>(new Set());\n\n const provider = this._provider;\n\n const Root = ({ next }: { next: Signal<T> }) => {\n return (\n <SlotQueueContext.Provider value={queue}>\n <VComponent node={provider} {...provider.props}>\n <Component {...next.value} initialData={initialData} />\n </VComponent>\n </SlotQueueContext.Provider>\n );\n };\n\n // clear the root element\n rootElement.innerHTML = '';\n\n // clone the root element to initialize rendering on the background\n const root = document.createElement('div');\n\n // apply base design tokens and global styles to the root element\n rootElement.classList.add('dropin-design');\n if (Component.displayName) {\n rootElement.setAttribute('data-dropin-container', Component.displayName);\n }\n\n // store the virtual root element\n (rootElement as any).__rootElement = root;\n\n render(<Root next={state} />, root);\n\n // API object to control the rendered component\n const API: RenderAPI = {\n remove: () => {\n render(null, root);\n },\n setProps: (cb: (prev: T) => T) => {\n const next = cb(state.peek());\n state.value = next;\n },\n };\n\n // wait for all slots to be resolved\n return new Promise((resolve) => {\n queue.subscribe((pending) => {\n if (pending.size === 0) {\n // apply base design tokens and global styles to the root element\n rootElement.classList.add('dropin-design');\n\n // append the rendered component to the DOM only when all slots are resolved\n rootElement.appendChild(root.firstChild ?? root);\n\n return resolve(API);\n }\n });\n });\n };\n }\n\n /**\n * Unmounts a container from a root element.\n * @param rootElement - The root element to unmount the container from.\n */\n static unmount(rootElement: HTMLElement) {\n const root = (rootElement as any)?.__rootElement;\n if (!root) throw new Error('Root element is not defined');\n render(null, root);\n }\n\n /**\n * UnRenders a component from a root element.\n * @param rootElement - The root element to unmount the component from.\n * @deprecated Use `remove` method from the returned object of the `mount` method instead or `unmount` method from the `Render` class.\n */\n unmount(rootElement: HTMLElement) {\n if (!rootElement) throw new Error('Root element is not defined');\n rootElement.firstChild?.remove();\n }\n\n /**\n * Renders a component to a string.\n * @param Component - The component to render.\n * @param props - The component props.\n * @param options - Optional rendering options.\n */\n async toString<T>(Component: Container<T>, props: T, options?: T) {\n if (!Component) throw new Error('Component is not defined');\n\n const initialData = (await Component.getInitialData?.(props)) ?? {};\n\n return renderToString(\n <VComponent node={this._provider} {...this._provider.props}>\n <Component {...props} initialData={initialData} />\n </VComponent>,\n {},\n { ...options }\n );\n }\n}\n\n// Debugger\n\n// @ts-ignore\nwindow.DROPINS = window.DROPINS || {};\n\nlet _debuggerStyleEl: HTMLStyleElement | null = null;\n\n// @ts-ignore\nwindow.DROPINS.showOverlays = async (state: boolean) => {\n window.sessionStorage.setItem('dropin-debugger--show-overlays', state.toString());\n\n if (state && !_debuggerStyleEl) {\n _debuggerStyleEl = document.createElement('style');\n _debuggerStyleEl.setAttribute('data-dropin-debugger', '');\n _debuggerStyleEl.textContent = debuggerCss;\n document.head.appendChild(_debuggerStyleEl);\n } else if (!state && _debuggerStyleEl) {\n _debuggerStyleEl.remove();\n _debuggerStyleEl = null;\n }\n\n document.body.classList.toggle('dropin-debugger--show-overlays', state);\n};\n\n/** Persistent Settings */\n\n// @ts-ignore\nwindow.DROPINS.showOverlays(\n window.sessionStorage.getItem('dropin-debugger--show-overlays') === 'true'\n);","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { VNode, ComponentChildren } from 'preact';\nimport { classes } from '.';\n\nexport type VComponentProps = {\n node: VNode | VNode[];\n children?: ComponentChildren;\n [key: string]: any; // allow other unspecified props to be passed without any TS warning\n};\n\nexport function VComponent({ node, ...props }: VComponentProps) {\n if (!node) return null;\n\n if (Array.isArray(node)) {\n return (\n <>\n {node.map((n, key) => (\n <VComponent\n key={key}\n node={n}\n className={props.className}\n {...props}\n />\n ))}\n </>\n );\n }\n\n // @ts-ignore\n props.className = classes([node.props.className, props.className]);\n\n // @ts-ignore\n return <node.type ref={node.ref} key={node.key} {...node.props} {...props} />;\n}\n"],"names":["classes","result","item","className","isActive","BREAKPOINTS","resolveImageUrl","url","_opts","base","query","params","keyMapping","getImageParamsKeyMap","keyMappingKeys","opts","unusedMapping","acc","key","value","newKey","newKeyString","newValue","generateSrcset","imageURL","options","generateSrcsetUrl","relativeWidth","SlotQueueContext","createContext","Render","provider","__publicField","Component","props","rootElement","initialData","_a","state","signal","queue","Root","next","jsx","VComponent","root","render","API","cb","resolve","pending","renderToString","_debuggerStyleEl","debuggerCss","node","Fragment","n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"vcomponent.js","sources":["/@dropins/tools/src/lib/classes.ts","/@dropins/tools/src/lib/resolve-image.ts","/@dropins/tools/src/lib/render.tsx","/@dropins/tools/src/lib/vcomponent.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\n// @ts-ignore\nimport { JSXInternal } from 'preact/src/jsx';\n\ntype ClassName = string | JSXInternal.SignalLike<string | undefined>;\n\nexport const classes = (\n classes: Array<ClassName | [ClassName, boolean] | undefined>,\n) => {\n const result = classes.reduce((result, item) => {\n if (!item) return result;\n\n if (typeof item === 'string') result += ` ${item}`;\n\n if (Array.isArray(item)) {\n const [className, isActive] = item;\n if (className && isActive) {\n result += ` ${className}`;\n }\n }\n\n return result;\n }, '') as string;\n\n return result.trim();\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { getImageParamsKeyMap } from '@adobe-commerce/elsie/lib/';\n\nconst BREAKPOINTS = {\n medium: 768,\n large: 1024,\n xlarge: 1366,\n xxlarge: 1920,\n};\n\nexport interface ResolveImageUrlOptions {\n width: number;\n height?: number;\n auto?: string;\n quality?: number;\n crop?: boolean;\n fit?: string;\n}\n\nconst resolveImageUrl = (url: string, _opts?: ResolveImageUrlOptions) => {\n const [base, query] = url.split('?');\n const params = new URLSearchParams(query);\n\n const keyMapping = getImageParamsKeyMap();\n const keyMappingKeys = (keyMapping && Object.keys(keyMapping)) || [];\n\n let opts: any = {};\n const unusedMapping = { ...keyMapping };\n\n if (keyMappingKeys?.length > 0 && _opts) {\n opts = Object.entries(_opts).reduce(\n (acc, [key, value]) => {\n const newKey = keyMapping![key];\n if (typeof newKey === 'string') {\n acc[newKey] = value;\n } else if (typeof newKey === 'function') {\n const [newKeyString, newValue] = newKey(value);\n acc[newKeyString] = newValue;\n }\n delete unusedMapping![key];\n return acc;\n },\n {} as { [key: string]: any },\n );\n } else {\n opts = {\n auto: 'webp',\n quality: 80,\n crop: false,\n fit: 'cover',\n ..._opts,\n };\n }\n\n // Set unused mapping as default params\n Object.entries(unusedMapping).forEach(([, value]) => {\n if (typeof value === 'function') {\n const [newKeyString, newValue] = value(undefined);\n opts[newKeyString] = newValue;\n }\n });\n\n // Append image optimization parameters\n Object.entries(opts).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n\n return `${base}?${params.toString()}`;\n};\n\nexport const generateSrcset = (\n imageURL: string,\n options: ResolveImageUrlOptions,\n) => {\n if (!imageURL || !options?.width) return;\n\n const generateSrcsetUrl = (options: ResolveImageUrlOptions) => {\n return resolveImageUrl(imageURL, {\n ...options,\n });\n };\n\n return Object.entries(BREAKPOINTS)\n .map(([, value]) => {\n const relativeWidth = Math.round(\n (options.width * value) / BREAKPOINTS.xxlarge,\n );\n\n return `${generateSrcsetUrl({\n ...options,\n width: relativeWidth,\n })} ${relativeWidth}w`;\n })\n .join(',\\n');\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { render, VNode, createContext } from 'preact';\nimport renderToString from 'preact-render-to-string';\nimport { Container, VComponent } from '@adobe-commerce/elsie/lib';\nimport { Signal, signal } from '@adobe-commerce/elsie/lib/signals';\nimport debuggerCss from '../components/UIProvider/debugger.css?inline';\n\nexport const SlotQueueContext = createContext<Signal<Set<string>> | null>(null);\n\ntype RenderAPI = {\n remove: () => void;\n setProps: (cb: (prev: any) => any) => void;\n};\n\n/**\n * The `Render` class provides methods to render and unmount components, as well as to render components to a string.\n * @class\n *\n * @property {Function} render - Renders a component to a root element.\n * @property {Function} toString - Renders a component to a string.\n */\nexport class Render {\n private _provider: VNode<any>;\n\n constructor(provider: VNode<any>) {\n this._provider = provider;\n }\n\n /**\n * Renders a container to a root element.\n * @param Container - The container to render.\n * @param props - The container parameters.\n * @returns A function to render the component to a root element.\n */\n render<T>(Component: Container<T>, props: T) {\n /**\n * Renders a component to a root element.\n * @param rootElement - The root element to render the component to.\n * @returns A promise that resolves to an object with methods to control the rendered component.\n */\n return async (rootElement: HTMLElement): Promise<RenderAPI> => {\n if (!Component) throw new Error('Component is not defined');\n if (!rootElement) throw new Error('Root element is not defined');\n\n const initialData = (await Component.getInitialData?.(props)) ?? {};\n\n const state = signal<T>({ ...props });\n\n const queue = signal<Set<string>>(new Set());\n\n const provider = this._provider;\n\n const Root = ({ next }: { next: Signal<T> }) => {\n return (\n <SlotQueueContext.Provider value={queue}>\n <VComponent node={provider} {...provider.props}>\n <Component {...next.value} initialData={initialData} />\n </VComponent>\n </SlotQueueContext.Provider>\n );\n };\n\n // clear the root element\n rootElement.innerHTML = '';\n\n // clone the root element to initialize rendering on the background\n const root = document.createElement('div');\n\n // apply base design tokens and global styles to the root element\n rootElement.classList.add('dropin-design');\n if (Component.displayName) {\n rootElement.setAttribute(\n 'data-dropin-container',\n Component.displayName,\n );\n }\n\n // store the virtual root element\n (rootElement as any).__rootElement = root;\n\n render(<Root next={state} />, root);\n\n // API object to control the rendered component\n const API: RenderAPI = {\n remove: () => {\n render(null, root);\n },\n setProps: (cb: (prev: T) => T) => {\n const next = cb(state.peek());\n state.value = next;\n },\n };\n\n // wait for all slots to be resolved\n return new Promise((resolve) => {\n queue.subscribe((pending) => {\n if (pending.size === 0) {\n // apply base design tokens and global styles to the root element\n rootElement.classList.add('dropin-design');\n\n // append the rendered component to the DOM only when all slots are resolved\n rootElement.appendChild(root.firstChild ?? root);\n\n return resolve(API);\n }\n });\n });\n };\n }\n\n /**\n * Unmounts a container from a root element.\n * @param rootElement - The root element to unmount the container from.\n */\n static unmount(rootElement: HTMLElement) {\n const root = (rootElement as any)?.__rootElement;\n if (!root) throw new Error('Root element is not defined');\n render(null, root);\n }\n\n /**\n * UnRenders a component from a root element.\n * @param rootElement - The root element to unmount the component from.\n * @deprecated Use `remove` method from the returned object of the `mount` method instead or `unmount` method from the `Render` class.\n */\n unmount(rootElement: HTMLElement) {\n if (!rootElement) throw new Error('Root element is not defined');\n rootElement.firstChild?.remove();\n }\n\n /**\n * Renders a component to a string.\n * @param Component - The component to render.\n * @param props - The component props.\n * @param options - Optional rendering options.\n */\n async toString<T>(Component: Container<T>, props: T, options?: T) {\n if (!Component) throw new Error('Component is not defined');\n\n const initialData = (await Component.getInitialData?.(props)) ?? {};\n\n return renderToString(\n <VComponent node={this._provider} {...this._provider.props}>\n <Component {...props} initialData={initialData} />\n </VComponent>,\n {},\n { ...options },\n );\n }\n}\n\n// Debugger\n\n// @ts-ignore\nwindow.DROPINS = window.DROPINS || {};\n\nlet _debuggerStyleEl: HTMLStyleElement | null = null;\n\n// @ts-ignore\nwindow.DROPINS.showOverlays = async (state: boolean) => {\n window.sessionStorage.setItem(\n 'dropin-debugger--show-overlays',\n state.toString(),\n );\n\n if (state && !_debuggerStyleEl) {\n _debuggerStyleEl = document.createElement('style');\n _debuggerStyleEl.setAttribute('data-dropin-debugger', '');\n _debuggerStyleEl.textContent = debuggerCss;\n document.head.appendChild(_debuggerStyleEl);\n } else if (!state && _debuggerStyleEl) {\n _debuggerStyleEl.remove();\n _debuggerStyleEl = null;\n }\n\n document.body.classList.toggle('dropin-debugger--show-overlays', state);\n};\n\n/** Persistent Settings */\n\n// @ts-ignore\nwindow.DROPINS.showOverlays(\n window.sessionStorage.getItem('dropin-debugger--show-overlays') === 'true',\n);\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { VNode, ComponentChildren } from 'preact';\nimport { classes } from '.';\n\nexport type VComponentProps = {\n node: VNode | VNode[];\n children?: ComponentChildren;\n [key: string]: any; // allow other unspecified props to be passed without any TS warning\n};\n\nexport function VComponent({ node, ...props }: VComponentProps) {\n if (!node) return null;\n\n if (Array.isArray(node)) {\n return (\n <>\n {node.map((n, key) => (\n <VComponent\n key={key}\n node={n}\n className={props.className}\n {...props}\n />\n ))}\n </>\n );\n }\n\n // @ts-ignore\n props.className = classes([node.props.className, props.className]);\n\n // @ts-ignore\n return <node.type ref={node.ref} key={node.key} {...node.props} {...props} />;\n}\n"],"names":["classes","result","item","className","isActive","BREAKPOINTS","resolveImageUrl","url","_opts","base","query","params","keyMapping","getImageParamsKeyMap","keyMappingKeys","opts","unusedMapping","acc","key","value","newKey","newKeyString","newValue","generateSrcset","imageURL","options","generateSrcsetUrl","relativeWidth","SlotQueueContext","createContext","Render","provider","__publicField","Component","props","rootElement","initialData","_a","state","signal","queue","Root","next","jsx","VComponent","root","render","API","cb","resolve","pending","renderToString","_debuggerStyleEl","debuggerCss","node","Fragment","n"],"mappings":"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"}
|
package/components.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{u as e,L as ge,h as B,y as M,F as k,q as C,a as Ne,b as _e,c as R,A as X,T as Q,g as me,N as Ee,E as Me,k as ee,d as Fe,x as Be}from"./chunks/preact-vendor.js";import{c as o,V as I}from"./chunks/vcomponent.js";import{I as We,U as He}from"./chunks/Image.js";import{a as ar,p as or}from"./chunks/Image.js";import{S as de,a as le,b as qe,c as Ke,d as Ue,e as ae,f as he,g as Ge,h as je,i as ze,j as se,k as Je}from"./chunks/icons.js";import{d as xe,i as we,f as Xe,a as Ye,b as Ze}from"./chunks/format-calendar-date.js";import"./chunks/image-params-keymap.js";import"./signals.js";import"./chunks/cjs.js";import"./chunks/locale-config.js";const ye=1,Y=({className:t,fullWidth:r=!1,lines:n=ye,size:i="small",variant:l="row",children:a=null,multilineGap:s="medium",...c})=>{const d=[[`dropin-skeleton-row__${l}`,l],[`dropin-skeleton-row__${l}-${i}`,l&&i]];if(!a&&l==="empty")return e("div",{className:o(["dropin-skeleton-row dropin-skeleton-row__empty",t])});if(a){const u=a.trim();return e("div",{...c,class:o(["dropin-skeleton-row",["dropin-skeleton-row--full",r],t]),dangerouslySetInnerHTML:{__html:u}})}return n>ye===!1?e("div",{...c,class:o(["dropin-skeleton-row",["dropin-skeleton-row--full",r],"dropin-skeleton--row__content",...d,t])}):e("div",{...c,style:{"--multiline-gap-spacing":`var(--spacing-${s})`},class:o(["dropin-skeleton-row--multiline",["dropin-skeleton-row--full",r],t]),children:Array.from({length:n}).map((u,b)=>e("div",{class:o(["dropin-skeleton-row",["dropin-skeleton-row--full",r],"dropin-skeleton--row__content",...d])},b))})},ce=({className:t,children:r,rowGap:n="medium",...i})=>e("div",{style:{"--row-gap-spacing":`var(--spacing-${n})`},...i,className:o(["dropin-skeleton",t]),role:"status","aria-label":"Loading...",children:r}),Qe=function(){const r=typeof document<"u"&&document.createElement("link").relList;return r&&r.supports&&r.supports("modulepreload")?"modulepreload":"preload"}(),et=function(t){return"/"+t},ke={},D=function(r,n,i){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));l=Promise.allSettled(n.map(d=>{if(d=et(d),d in ke)return;ke[d]=!0;const p=d.endsWith(".css"),u=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${u}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":Qe,p||(b.as="script"),b.crossOrigin="",b.href=d,c&&b.setAttribute("nonce",c),document.head.appendChild(b),p)return new Promise((_,m)=>{b.addEventListener("load",_),b.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(s){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=s,window.dispatchEvent(c),!c.defaultPrevented)throw s}return l.then(s=>{for(const c of s||[])c.status==="rejected"&&a(c.reason);return r().catch(a)})},De={Add:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.A),[])),AddressBook:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.l),[])),Bulk:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.B),[])),Burger:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.m),[])),Business:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.n),[])),Card:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.C),[])),Cart:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.o),[])),Check:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.p),[])),CheckWithCircle:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.q),[])),ChevronDown:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.r),[])),ChevronRight:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.s),[])),ChevronUp:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.t),[])),Close:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.u),[])),Coupon:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.v),[])),Date:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.D),[])),Delivery:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.w),[])),Edit:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.E),[])),EmptyBox:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.x),[])),Eye:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.y),[])),EyeClose:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.z),[])),Gift:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.G),[])),GiftCard:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.F),[])),Heart:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.H),[])),HeartFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.I),[])),InfoFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.J),[])),List:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.L),[])),Locker:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.K),[])),Minus:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.M),[])),Order:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.O),[])),OrderError:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.N),[])),OrderSuccess:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.P),[])),PaymentError:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.Q),[])),Placeholder:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.R),[])),PlaceholderFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.T),[])),Purchase:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.U),[])),Quote:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.V),[])),Search:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.W),[])),SearchFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.X),[])),Sort:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.Y),[])),Star:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.Z),[])),Structure:k(()=>D(()=>import("./chunks/icons.js").then(t=>t._),[])),Team:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.$),[])),Trash:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a0),[])),User:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a1),[])),View:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a2),[])),Wallet:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a3),[])),Warning:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a4),[])),WarningFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a5),[])),WarningWithCircle:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a6),[]))};function Ie(t){try{if(t.startsWith("//")){const n=`${window.location.protocol}${t}`;return new URL(n).hostname!==window.location.hostname?(console.error(`[Icon] External URL rejected for security: ${t} - Only same-domain URLs are allowed`),!1):!0}return new URL(t).hostname!==window.location.hostname?(console.error(`[Icon] External URL rejected for security: ${t} - Only same-domain URLs are allowed`),!1):!0}catch{return console.error(`[Icon] Invalid URL format: ${t}`),!1}}function tt({url:t,...r}){const[n,i]=B(""),[l,a]=B(!0),[s,c]=B(!1);return M(()=>{fetch(t).then(d=>{if(!d.ok)throw console.error(`[Icon] Failed to fetch SVG: ${d.status} ${d.statusText}`),new Error(`Failed to fetch SVG: ${d.status} ${d.statusText}`);return d.text()}).then(d=>{try{if(!new DOMParser().parseFromString(d,"image/svg+xml").querySelector("svg"))throw new Error("No <svg> element found")}catch(u){u instanceof Error?console.error(`[Icon] Invalid SVG content from ${t}: ${u.message}`):console.error(`[Icon] Invalid SVG content from ${t}: ${String(u)}`),c(!0),a(!1)}let p=d;r.width&&(p=p.replace(/<svg([^>]*)\s+width\s*=\s*["'][^"']*["']/gi,"<svg$1"),p=p.replace(/<svg/i,`<svg width="${r.width}"`)),r.height&&(p=p.replace(/<svg([^>]*)\s+height\s*=\s*["'][^"']*["']/gi,"<svg$1"),p=p.replace(/<svg/i,`<svg height="${r.height}"`)),r.title&&(p=p.replace(/<title[^>]*>.*?<\/title>/gi,""),p=p.replace(/<svg([^>]*)>/i,`<svg$1><title>${r.title}</title>`)),i(p),a(!1)}).catch(d=>{d instanceof Error?console.error(`[Icon] ${d.message}`):console.error(`[Icon] ${String(d)}`),c(!0),a(!1)})},[t,r.width,r.height,r.title]),l||s?e("svg",{...r}):e("span",{className:r.className,style:{width:String(r.width),height:String(r.height),display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:n}})}function W({source:t,size:r="24",stroke:n="2",viewBox:i="0 0 24 24",className:l,...a}){const s={className:o(["dropin-icon",`dropin-icon--shape-stroke-${n}`,l]),width:r,height:r,viewBox:i},c=typeof t=="string"&&(t.startsWith("http")||t.startsWith("//")||t.startsWith("/"));if(c&&Ie(t))return e(ge,{fallback:e("svg",{...a,...s}),children:e(tt,{url:t,...a,...s})});const d=typeof t=="string"&&t in De?De[t]:null,p=c&&!Ie(t);return e(ge,{fallback:e("svg",{...a,...s}),children:d?e(d,{...a,...s}):p?e("svg",{...a,...s}):e(t,{...a,...s})})}const rt=({name:t,value:r="1",className:n,disabled:i,error:l,success:a,min:s,max:c,onValue:d,onUpdateError:p,size:u="medium",showButtons:b=!0,..._})=>{const[m,N]=B(Number(r)),[v,g]=B(!1),f=Number(s),h=Number(c),w=l||v||m<f||m>h,E=v?"Dropin.Incrementer.requiredMessage":m<f?"Dropin.Incrementer.minQuantityMessage":m>h?"Dropin.Incrementer.maxQuantityMessage":"Dropin.Incrementer.errorMessage";M(()=>{const $=Number(r);$!==m&&(N($),g(!1))},[r]);const x=C(xe(async $=>{if(d)try{d($)}catch(T){p&&p(T)}},200),[d,p]),S=$=>{g(!1),x($),N($)};return e("div",{className:o(["dropin-incrementer",`dropin-incrementer--${u}`,n]),children:[e("div",{className:o(["dropin-incrementer__content",`dropin-incrementer__content--${u}`,["dropin-incrementer__content--no-buttons",!b],["dropin-incrementer__content--error",w],["dropin-incrementer__content--success",a],["dropin-incrementer__content--disabled",i]]),children:[b&&e("div",{className:o(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",i]]),children:e(Ne,{children:e("button",{type:"button",className:o(["dropin-incrementer__decrease-button",["dropin-incrementer__decrease-button--disabled",i]]),onClick:()=>S(m-1),disabled:i||m<f+1,"aria-label":e(_e,{id:"Dropin.Incrementer.decreaseLabel"}),children:e(W,{source:de,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__down"})})})}),e("input",{className:"dropin-incrementer__input",max:c,min:s,step:1,type:"number",name:t,value:v?"":m,disabled:i,onBlur:()=>{v||S(Number(m))},onChange:$=>{const T=$.currentTarget.value;T===""?g(!0):S(Number(T))},..._}),b&&e("div",{className:o(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",i]]),children:e(Ne,{children:e("button",{type:"button",className:o(["dropin-incrementer__increase-button",["dropin-incrementer__increase-button--disabled",i]]),onClick:()=>S(m+1),disabled:i||m>h-1,"aria-label":e(_e,{id:"Dropin.Incrementer.increaseLabel"}),children:e(W,{source:le,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__add"})})})})]}),w&&e("p",{className:"dropin-incrementer__content--error-message",children:e(_e,{id:E,fields:{minQuantity:s,maxQuantity:c}})})]})},Le=({name:t,value:r,variant:n="primary",className:i,disabled:l,error:a,floatingLabel:s,onValue:c,onUpdateError:d,size:p="medium",icon:u,maxLength:b,success:_,...m})=>{const N=(m==null?void 0:m.id)||t||`dropin-input-${Math.random().toString(36)}`,v=R({errorIconAriaLabel:"Dropin.Input.errorIconAriaLabel",successIconAriaLabel:"Dropin.Input.successIconAriaLabel"}),g=C(xe(async h=>{if(c)try{await c(h)}catch(w){d&&d(w)}},200),[c,d]),f=h=>{const w=h.target;g(w.value.trim())};return e("div",{className:o(["dropin-input-container",`dropin-input-container--${n}`,["dropin-input-container--floating",!!s],["dropin-input-container--disabled",l]]),children:[u&&e(I,{node:u,className:o(["dropin-input__field-icon--left",u.props.className])}),e("div",{className:"dropin-input-label-container",children:[e("input",{id:N,onChange:f,type:"text",maxLength:b,name:t,value:r,...m,className:o(["dropin-input",`dropin-input--${p}`,`dropin-input--${n}`,["dropin-input--error",!!a],["dropin-input--success",!!_],["dropin-input--disabled",l],["dropin-input--floating",!!s],["dropin-input--icon-left",!!u],i]),disabled:l}),s&&e("label",{htmlFor:N,className:o([["dropin-input__label--floating",!!s],["dropin-input__label--floating--icon-left",!!u],["dropin-input__label--floating--error",!!a]]),children:s})]}),a&&e("div",{className:o(["dropin-input__field-icon--right","dropin-input__field-icon--error"]),children:e(W,{source:qe,size:"16",stroke:"2",className:"dropin-input--warning-icon",viewBox:"-1 -1 26 26",role:"img","aria-label":v.errorIconAriaLabel})}),_&&e("div",{className:o(["dropin-input__field-icon--right","dropin-input__field-icon--success"]),children:e(W,{source:Ke,size:"16",stroke:"2",className:"dropin-input--success-icon",viewBox:"-1 -1 26 26",role:"img","aria-label":v.successIconAriaLabel})})]})},At=({name:t="",error:r,value:n,label:i,onChange:l,onBlur:a,...s})=>{const[c,d]=B(n??""),[p,u]=B(!1),b=X(null),_=R({picker:"Dropin.InputDate.picker"}),m=C(()=>{var f;u(!0),we()&&((f=b.current)==null||f.focus())},[]),N=C(f=>{var w;const h=(w=f.currentTarget.parentElement)==null?void 0:w.querySelector("input");h==null||h.focus(),h==null||h.showPicker()},[]),v=C(f=>{u(!1),a==null||a(f)},[a]),g=C(f=>{d(f.target.value),l==null||l(f)},[l]);return e("div",{className:o(["dropin-input-date"]),children:[we()?e("input",{ref:b,"data-testid":"inputDateIos",className:"dropin-input-date__input--ios",type:"date",onChange:g}):null,e(Te,{error:r,children:e(Le,{"data-testid":"input-date",error:!!r,name:t,value:p?c:Xe(c),type:p?"date":"text",placeholder:i,floatingLabel:i,onFocus:m,onBlur:v,onChange:g,className:"dropin-input-date__input",...s})}),e("button",{type:"button","data-testid":"dropin-input-date__icon",className:"dropin-input-date__icon","aria-label":_.picker,onClick:N,children:e(W,{source:Ue,size:"24"})})]})},nt=({minLength:t=0,requiredCharacterClasses:r=0,uniqueSymbolsStatus:n="pending",validateLengthConfig:i={status:"",icon:"",message:""}})=>{const l=R({chartTwoSymbols:"Dropin.PasswordStatusIndicator.chartTwoSymbols",chartThreeSymbols:"Dropin.PasswordStatusIndicator.chartThreeSymbols",chartFourSymbols:"Dropin.PasswordStatusIndicator.chartFourSymbols",iconPendingAlt:"Dropin.PasswordStatusIndicator.iconPendingAlt",iconSuccessAlt:"Dropin.PasswordStatusIndicator.iconSuccessAlt",iconErrorAlt:"Dropin.PasswordStatusIndicator.iconErrorAlt"}),a=Q(()=>({pending:e(de,{role:"img","aria-label":l.iconPendingAlt}),success:e(he,{role:"img","aria-label":l.iconSuccessAlt}),error:e(ae,{style:{fill:"red"},role:"img","aria-label":l.iconErrorAlt})}),[l.iconPendingAlt,l.iconSuccessAlt,l.iconErrorAlt]),s=c=>{switch(c){case 2:return l.chartTwoSymbols;case 3:return l.chartThreeSymbols;case 4:return l.chartFourSymbols;default:return""}};return e("div",{className:o(["dropin-password-status-indicator"]),children:[t>0?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${i.status}`,"data-testid":`dropin-password-status-indicator__item--${i.icon}`,children:[a[i.icon],e("span",{className:`${i.status}`,children:i.message})]}):null,r>=2?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${n}`,"data-testid":`dropin-password-status-indicator__item--${n}`,children:[a[n],e("span",{className:"pending",children:s(r)})]}):null]})},Tt=({placeholder:t,floatingLabel:r,children:n,name:i,required:l,className:a,minLength:s,autoComplete:c,defaultValue:d="",hideStatusIndicator:p=!1,uniqueSymbolsStatus:u,validateLengthConfig:b,requiredCharacterClasses:_,errorMessage:m,onValue:N,onBlur:v,...g})=>{const f=R({placeholder:"Dropin.InputPassword.placeholder",floatingLabel:"Dropin.InputPassword.floatingLabel",buttonShowTitle:"Dropin.InputPassword.buttonShowTitle",buttonHideTitle:"Dropin.InputPassword.buttonHideTitle"}),[h,w]=B(!1),E=C(()=>{w(S=>!S)},[]),x=h?f.buttonHideTitle:f.buttonShowTitle;return e("div",{"data-testid":"passwordFieldInput",className:o(["dropin-input-password",["dropin-input-password--error",m],a]),...g,children:[e(Te,{error:m,children:e(Le,{autoComplete:c,name:i??"password",type:h?"text":"password",placeholder:t||f.placeholder,floatingLabel:r||f.floatingLabel,"aria-label":f.placeholder,"aria-required":l||!0,"aria-invalid":!!m,"aria-describedby":"password-feedback",required:l||!1,value:d,onValue:N,icon:e(Ge,{}),onBlur:v,"data-testid":"passwordInput"})}),e(Z,{"aria-label":x,title:x,type:"button","data-testid":"toggle-password-icon",variant:"tertiary",className:o(["dropin-input-password__eye-icon",`dropin-input-password__eye-icon--${h?"show":"hide"}`,a]),onClick:E,children:e(W,{focusable:"false","aria-hidden":h,source:h?ze:je})}),p?null:e(nt,{minLength:s,requiredCharacterClasses:_,validateLengthConfig:b,uniqueSymbolsStatus:u}),n]})},Ot=({disabled:t,name:r="",errorMessage:n,value:i,label:l,className:a,onChange:s,onBlur:c,...d})=>{const p=X(null),u=me(),b=!!(n!=null&&n.length);return M(()=>{const _=p.current;_&&(_.style.height="auto",_.style.height=`${_.scrollHeight}px`)},[i]),e("div",{className:o(["dropin-textarea-container",a]),"data-testid":"dropin-textarea-container",children:[e("textarea",{ref:p,"data-testid":"dropin-textarea-field",className:o(["dropin-textarea",["dropin-textarea--error",b],["dropin-textarea--disabled",!!t]]),id:u,placeholder:l,name:r,value:i,disabled:t,onBlur:c,onChange:s,...d}),e("label",{htmlFor:u,className:o(["dropin-textarea__label--floating",["dropin-textarea__label--floating--error",b]]),children:l}),b?e("div",{className:o(["dropin-textarea__label--floating--text",["dropin-textarea__label--floating--error",b]]),children:n}):null]})},Ae=({variant:t="primary",className:r})=>e("hr",{role:"separator",className:o(["dropin-divider",`dropin-divider--${t}`,r])}),te=({amount:t=0,currency:r,locale:n,variant:i="default",weight:l="bold",className:a,children:s,sale:c=!1,formatOptions:d={},size:p="small",...u})=>{const b=Q(()=>Ye({currency:r,locale:n,formatOptions:d}).format(t),[t,r,n,d]);return e("span",{...u,className:o(["dropin-price",`dropin-price--${i}`,`dropin-price--${p}`,`dropin-price--${l}`,["dropin-price--sale",c],a]),children:b})},it=({name:t,label:r,value:n,size:i="medium",checked:l=!1,disabled:a=!1,error:s=!1,description:c="",busy:d=!1,icon:p,className:u,children:b,..._})=>{var m;return e("label",{className:o([u,"dropin-radio-button",["dropin-radio-button--error",s],["dropin-radio-button--disabled",a]]),children:[e("input",{name:t,value:n,checked:l,disabled:a,type:"radio",className:o(["dropin-radio-button__input",["dropin-radio-button__input--error",s],["dropin-radio-button__input--disabled",a]]),"aria-busy":d,..._}),e("span",{className:o(["dropin-radio-button__label",`dropin-radio-button__label--${i}`,["dropin-radio-button__label--error",s],["dropin-radio-button__label--disabled",a]]),children:[p&&e(p.type,{...p==null?void 0:p.props,className:o(["dropin-radio-button__icon",(m=p==null?void 0:p.props)==null?void 0:m.className])}),r]}),e("span",{className:o(["dropin-radio-button__description",`dropin-radio-button__description--${i}`,["dropin-radio-button__description--disabled",a]]),children:c})]})},Z=({value:t,variant:r="primary",size:n="medium",icon:i,className:l,children:a,disabled:s=!1,active:c=!1,activeChildren:d,activeIcon:p,href:u,...b})=>{let _="dropin-button";(i&&!a||i&&c&&!d||!i&&c&&p)&&(_="dropin-iconButton"),c&&d&&(_="dropin-button"),l=o([_,`${_}--${n}`,`${_}--${r}`,[`${_}--${r}--disabled`,s],a&&i&&`${_}--with-icon`,!a&&d&&i&&`${_}--with-icon`,c&&p&&`${_}--with-icon`,l]);const m=o(["dropin-button-icon",`dropin-button-icon--${r}`,[`dropin-button-icon--${r}--disabled`,s],i==null?void 0:i.props.className]),N=u?{node:e("a",{}),role:"link",href:u,...b,disabled:s,active:c,onKeyDown:v=>{s&&v.preventDefault()},tabIndex:s?-1:0}:{node:e("button",{}),role:"button",...b,value:t,disabled:s,active:c};return e(I,{...N,className:l,children:[i&&!c&&e(I,{node:i,className:m}),p&&c&&e(I,{node:p,className:m}),a&&!c&&(typeof a=="string"?e("span",{children:a}):a),c&&d&&(typeof d=="string"?e("span",{children:d}):d)]})};function Se(t,r,n,i,l,a){return t||(r?r.value:a?a.value:n||i?"":l?l.value:null)}const at=({name:t,value:r=null,options:n,variant:i="primary",floatingLabel:l,size:a="medium",handleSelect:s=()=>{},disabled:c=!1,disableWhenSingle:d=!0,error:p=!1,placeholder:u,defaultOption:b,icon:_,className:m,id:N,...v})=>{var z;const g=N??t??`dropin-picker-${Math.random().toString(36)}`,f=!!(v!=null&&v.required),h=c||d&&(n==null?void 0:n.length)===1,w=X(null),E=t??l??u,x=n==null?void 0:n.find(U=>!U.disabled),S=!c&&d&&(n==null?void 0:n.length)===1&&!((z=n[0])!=null&&z.disabled)?n[0]:void 0,[$,T]=B(()=>Se(r,b,u,l,x,S));M(()=>{T(Se(r,b,u,l,x,S))},[r,b,u,l,x,S]),M(()=>{if(!S||r===S.value)return;const U=w.current;U&&(U.value=S.value,U.dispatchEvent(new Event("change",{bubbles:!0})))},[S==null?void 0:S.value,r]);const H=U=>{const{options:G,value:V}=U.target;for(const re of G)re.selected&&(T(V),s(U))},K=n==null?void 0:n.map(U=>{const{value:G,text:V,disabled:re}=U;return e("option",{value:G,selected:G===$,disabled:re,className:o(["dropin-picker__option"]),children:V},G)}),j=!!$,L=()=>(!f||!j)&&(l||u);return e("div",{className:o([m,"dropin-picker",`dropin-picker__${a}`,["dropin-picker__floating",!!l],["dropin-picker__selected",j],["dropin-picker__error",p],["dropin-picker__disabled",h],["dropin-picker__icon",_]]),children:[_&&e(_.type,{..._.props,className:"dropin-picker__icon--placeholder"}),e("select",{ref:w,id:g,className:o(["dropin-picker__select",`dropin-picker__select--${i}`,`dropin-picker__select--${a}`,["dropin-picker__select--floating",!!l]]),name:t,"aria-label":E,disabled:h,onChange:H,...v,children:[L()&&e("option",{selected:!j,value:"",className:o(["dropin-picker__option dropin-picker__placeholder"]),children:l??u},r),K]}),e(W,{source:se,size:"24",stroke:"2",className:"dropin-picker__chevronDown"}),l&&j&&e("label",{htmlFor:g,className:o(["dropin-picker__floatingLabel",!!l]),children:l})]})},Te=({className:t,label:r,error:n,hint:i,success:l,size:a="medium",disabled:s=!1,children:c,...d})=>{var _;const p=((_=c==null?void 0:c.props)==null?void 0:_.id)??`dropin-field-${Math.random().toString(36)}`,u=`${p}-description`;let b=null;return c&&typeof c!="string"&&(b=e(I,{node:c,id:p,disabled:s,size:a,error:!!n,success:!!l&&!n,"aria-describedby":n?u:void 0},c.key)),e("div",{...d,className:o(["dropin-field",t]),children:[r&&e("label",{className:o(["dropin-field__label",["dropin-field__label--disabled",s],`dropin-field__label--${a}`]),htmlFor:p,children:r}),e("div",{className:o(["dropin-field__content"]),children:b}),e("div",{id:u,role:"status","aria-live":"polite",className:o(["dropin-field__hint",[`dropin-field__hint--${a}`,a],["dropin-field__hint--error",!!n],["dropin-field__hint--success",!!l&&!n],["dropin-field__hint--disabled",!!s]]),children:n||l||i})]})},Rt=({icon:t,className:r,children:n,active:i=!1,disabled:l=!1,...a})=>e("button",{role:"button",disabled:l,...a,className:o(["dropin-action-button",["dropin-action-button--active",i],["dropin-action-button--disabled",l],r]),children:[t&&e(I,{node:t,className:o(["dropin-action-button-icon"])}),n&&(typeof n=="string"?e("span",{children:n}):n)]}),Vt=({className:t,variant:r="primary",activeOption:n,disabled:i=!1,dividers:l=!0,children:a,handleSelect:s,...c})=>{const[d,p]=B(n),u=C(_=>{i||_.props.disabled||(p(_.props.value),s&&s(_.props.value))},[s,p,i]),b=Ee.map(a,_=>{const m=i||_.props.disabled,N=_.props.value===d;return Me(_,{disabled:m,active:N,onClick:()=>u(_),className:o(["dropin-action-button-group__option",`dropin-action-button-group__option--${r}`,["dropin-action-button-group__option--active",N],["dropin-action-button-group__option--with-dividers",l]])})});return e("div",{role:"group",...c,className:o(["dropin-action-button-group",`dropin-action-button-group--${r}`,t]),children:b})},ot=({variant:t="primary",className:r,children:n,...i})=>e("div",{...i,className:o(["dropin-card",`dropin-card--${t}`,r]),children:e("div",{class:"dropin-card__content",children:n})}),Ct=({name:t,value:r,size:n="medium",disabled:i=!1,error:l=!1,label:a="",description:s="",className:c,checked:d,...p})=>{const[u,b]=B(d===void 0?!1:d),_=X(null),m=v=>{var g;(g=p.onChange)==null||g.call(p,v),b(v.currentTarget.checked)},N=v=>{var g;v.key===" "&&(v.preventDefault(),(g=_==null?void 0:_.current)==null||g.click())};return M(()=>{typeof d=="boolean"&&b(d)},[d]),e("label",{className:o(["dropin-checkbox",["dropin-checkbox--disabled",i]]),children:[e("input",{ref:_,name:t,value:r,type:"checkbox",disabled:i,className:o(["dropin-checkbox__checkbox",["dropin-checkbox__checkbox--error",l],c]),...p,onChange:m,checked:u}),e("div",{className:"dropin-checkbox__checkbox-icon",children:["",e("span",{"aria-checked":u?"true":"false","aria-labelledby":`${t}-label`,"aria-describedby":s?`${t}-description`:void 0,className:o(["dropin-checkbox__box",["dropin-checkbox__box--error",l],["dropin-checkbox__box--disabled",i]]),role:"checkbox",tabIndex:i?-1:0,onKeyDown:N,children:e(W,{className:o(["dropin-checkbox__checkmark"]),source:he,size:"16",stroke:"3"})})]}),e("div",{id:`${t}-label`,className:o(["dropin-checkbox__label",`dropin-checkbox__label--${n}`,["dropin-checkbox__label--disabled",i]]),children:a}),e("div",{}),s&&e("div",{id:`${t}-description`,role:"note",className:o(["dropin-checkbox__description",`dropin-checkbox__description--${n}`,["dropin-checkbox__description--disabled",i]]),children:s})]})},Pt=({className:t,name:r,value:n,id:i,label:l,groupAriaLabel:a,size:s="medium",color:c,disabled:d=!1,selected:p=!1,outOfStock:u=!1,multi:b=!1,onValue:_,onUpdateError:m,...N})=>{const v=R("Dropin.Swatches.outOfStock.label").label,g=R("Dropin.Swatches.selected.label").label,f=R("Dropin.Swatches.swatch.label").label,h=C(async T=>{if(_)try{await _(T)}catch(H){m&&m(H)}},[_,m]),w=T=>{const H=T.target;h(H.value)},S=c&&(T=>{const H=new Option().style;return H.color=T,H.color!==""})(c)?c:"var(--color-gray-300);",$=()=>u?`${a}: ${l} ${v}`:p?`${a}: ${l} ${g}`:`${a}: ${l} ${f}`;return e("label",{className:o(["dropin-color-swatch__container",`dropin-color-swatch__container--${s}`,t]),children:[e("input",{type:b?"checkbox":"radio",name:r,id:i,value:n,"aria-label":$(),checked:p,disabled:d,onChange:w,...N,className:o(["dropin-color-swatch",["dropin-color-swatch--selected",p],["dropin-color-swatch--disabled",d],t])}),e("span",{style:{"--bg-color":S},className:o(["dropin-color-swatch__span",["dropin-color-swatch__span--out-of-stock",u],t])})]})},Mt=({className:t,name:r,value:n,label:i,groupAriaLabel:l,id:a,disabled:s=!1,selected:c=!1,outOfStock:d=!1,multi:p=!1,onValue:u,onUpdateError:b,..._})=>{const m=R("Dropin.Swatches.outOfStock.label").label,N=R("Dropin.Swatches.selected.label").label,v=R("Dropin.Swatches.swatch.label").label,[g,f]=B(!1),h=X(null),w=C(async $=>{if(u)try{await u($)}catch(T){b&&b(T)}},[u,b]),E=$=>{const T=$.target;w(T.value)},x=()=>d?`${l}: ${i} ${m}`:c?`${l}: ${i} ${N}`:`${l}: ${i} ${v}`;M(()=>{h.current&&h.current.scrollWidth>h.current.clientWidth&&f(!0)},[i]);const S=Q(()=>a??`${r}_${a}_${Math.random().toString(36)}`,[r,a]);return e("div",{className:"dropin-text-swatch__container",...g?{"data-tooltip":i}:{},children:[e("input",{type:p?"checkbox":"radio",name:r,id:S,value:n,"aria-label":x(),checked:c,disabled:s,onChange:E,..._,className:o(["dropin-text-swatch",["dropin-text-swatch--selected",c],["dropin-text-swatch--disabled",s],t])}),e("label",{htmlFor:S,ref:h,className:o(["dropin-text-swatch__label",["dropin-text-swatch__label--out-of-stock",d],t]),children:i})]})},lt=({ariaLabel:t,size:r="small",stroke:n="4",children:i,className:l,style:a,...s})=>{const c=["dropin-progress-spinner",`dropin-progress-spinner--shape-size-${r}`,`dropin-progress-spinner--shape-stroke-${n}`],d=R({updating:"Dropin.ProgressSpinner.updating.label",updatingChildren:"Dropin.ProgressSpinner.updatingChildren.label"}),p=()=>t||(i?d.updatingChildren:d.updating);return i?e("div",{...s,className:o(["dropin-progress-spinner-provider"]),"aria-live":"polite",role:"status",children:[e("div",{"aria-hidden":!0,children:i}),e("div",{"aria-label":p(),role:"status",className:o(["dropin-progress-spinner-background",l]),style:a}),e("div",{className:o(["dropin-progress-spinner-with-provider",...c]),"aria-hidden":!0})]}):e("div",{...s,className:o([l,...c]),"aria-live":"polite",role:"status","aria-label":p()})},Ft=({className:t,name:r,value:n,id:i,label:l,groupAriaLabel:a,src:s,alt:c,disabled:d=!1,selected:p=!1,outOfStock:u=!1,multi:b=!1,imageNode:_,onValue:m,onUpdateError:N,...v})=>{const g=R("Dropin.Swatches.outOfStock.label").label,f=R("Dropin.Swatches.selected.label").label,h=R("Dropin.Swatches.swatch.label").label,w=C(async $=>{if(m)try{await m($)}catch(T){N&&N(T)}},[m,N]),E=$=>{const T=$.target;w(T.value)},x=()=>u?`${a}: ${l} ${g}`:p?`${a}: ${l} ${f}`:`${a}: ${l} ${h}`,S=Q(()=>({src:s,alt:c,loading:"lazy",params:{width:100,fit:"bounds",crop:!0},onError:$=>$.target.style.display="none"}),[s,c]);return e("label",{className:o(["dropin-image-swatch__container",t]),children:[e("input",{type:b?"checkbox":"radio",name:r,id:i,value:n,"aria-label":x(),checked:p,disabled:d,onChange:E,...v,className:o(["dropin-image-swatch",["dropin-image-swatch--selected",p],["dropin-image-swatch--disabled",d],t])}),e("span",{className:o(["dropin-image-swatch__span",["dropin-image-swatch__span--out-of-stock",u],t]),children:typeof _=="function"?_({...S,imageSwatchContext:{disabled:d,outOfStock:u,selected:p,value:n,label:l,groupAriaLabel:a,name:r,id:i}}):_||e(We,{...S,className:o(["dropin-image-swatch__content"])})})]})},st=({className:t,children:r,title:n,ariaLabelTitle:i,secondaryText:l,actionIconPosition:a="left",iconOpen:s=le,iconClose:c=de,iconLeft:d=le,showIconLeft:p=!1,renderContentWhenClosed:u=!0,defaultOpen:b,onStateChange:_,...m})=>{const[N,v]=B(!1),g=x=>{x.stopImmediatePropagation();const S=!N;v(S),_==null||_(S)};M(()=>{typeof b<"u"&&v(b)},[b]);const f=R(`Dropin.Accordion.${N?"close":"open"}.label`).label,h=e(W,{source:s,size:"24",onClick:g,onKeyPress:g,className:"dropin-accordion-section__open-icon"}),w=e(W,{source:c,size:"24",onClick:g,onKeyPress:g,className:"dropin-accordion-section__close-icon"}),E=e(W,{source:d,size:"24"});return e("div",{...m,className:o(["dropin-accordion-section",t]),children:[e("div",{className:"dropin-accordion-section__heading",children:[e("div",{className:"dropin-accordion-section__flex",onClick:g,onKeyPress:g,role:"button","aria-label":`${f} ${i??n}`,tabIndex:0,children:e("div",{className:"dropin-accordion-section__title-container",children:[a==="left"&&(N?w:h),p&&E,e("h3",{className:"dropin-accordion-section__title",children:n})]})}),e("div",{className:"dropin-accordion-section__secondary-text-container",children:[l&&e("h4",{className:"dropin-accordion-section__secondary-text",children:l}),a==="right"&&(N?w:h)]})]}),e("div",{className:"dropin-accordion-section__content-container",style:{display:N?"grid":"none"},children:(N||u&&!N)&&r})]})},Bt=({className:t,children:r,actionIconPosition:n="left",iconOpen:i=le,iconClose:l=de,...a})=>{const s=e(Ae,{variant:"secondary"}),c=d=>e(ee,{children:[e(st,{...d.props,actionIconPosition:n,iconOpen:i,iconClose:l}),s]});return e("div",{...a,className:o(["dropin-accordion",t]),children:[s,...(Array.isArray(r)?r:[r]).map(c)]})},Wt=({variant:t="primary",className:r,type:n="warning",additionalActions:i,onDismiss:l,heading:a,description:s,icon:c,itemList:d,actionButtonPosition:p,...u})=>{var _,m,N,v;const b=R({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...u,role:n==="error"?"alert":"status","aria-live":n==="error"?"assertive":"polite",className:o(["dropin-in-line-alert",`dropin-in-line-alert--${n}`,`dropin-in-line-alert--${t}`,r]),children:[e("div",{className:"dropin-in-line-alert__heading",children:[e("div",{className:"dropin-in-line-alert__title-container",children:[c&&e(I,{node:c,className:"dropin-in-line-alert__icon"}),e("span",{className:"dropin-in-line-alert__title",children:a})]}),e("div",{className:"dropin-in-line-alert__actions-container",children:[i&&(p==="top"||!p&&i.length<=1)&&e(Z,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:i.length>0?(_=i[0])==null?void 0:_.onClick:void 0,"aria-label":((m=i[0])==null?void 0:m["aria-label"])??((N=i[0])==null?void 0:N.label),children:(v=i[0])==null?void 0:v.label}),l&&e(Z,{icon:e(W,{source:ae,size:"24",stroke:"2"}),className:"dropin-in-line-alert__dismiss-button",variant:"tertiary",onClick:l,"aria-label":b.dismiss})]})]}),s&&e("p",{className:"dropin-in-line-alert__description",children:s}),e("div",{className:"dropin-in-line-alert__item-list-container",children:d&&e(I,{node:d,className:o(["dropin-in-line-alert__item-list"])})}),i&&(p==="bottom"||!p&&i.length>1)&&e("div",{className:"dropin-in-line-alert__additional-actions-container",children:i.map(g=>e(Z,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:g.onClick,"aria-label":g["aria-label"]??g.label,children:g.label},g.label))})]})},ct=({children:t})=>{const r=X(null),n=X(null);return Fe(()=>(r.current||(r.current=document.createElement("div"),r.current.setAttribute("data-portal-root",""),document.body.appendChild(r.current)),n.current&&r.current&&r.current.appendChild(n.current),()=>{r.current&&(r.current.remove(),r.current=null)}),[]),e("div",{ref:n,className:"dropin-design",children:t})},$e='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])',Ht=({size:t="small",title:r=null,centered:n=!1,backgroundDim:i=!0,clickToDismiss:l=!0,escapeToDismiss:a=!0,onClose:s,showCloseButton:c=!0,className:d,children:p=null,...u})=>{const b=me(),_=X(null),m=X(null),N=C(()=>{s==null||s()},[s]),v=R({modalCloseLabel:"Dropin.Modal.Close.label"});return M(()=>{const g=f=>{const h=document.querySelector(".dropin-modal"),w=document.querySelector(".dropin-modal__body");l&&h&&w&&!w.contains(f.target)&&N()};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[N,l]),M(()=>{const g=f=>{f.key==="Escape"&&a&&N()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[N,a]),M(()=>{const g=document.scrollingElement,f=g.style.overflow;return g.style.overflow="hidden",()=>{g.style.overflow=f}},[]),M(()=>{m.current=document.activeElement;const g=_.current,[f]=g.querySelectorAll($e);return(f??g).focus(),()=>{var h;(h=m.current)==null||h.focus()}},[]),M(()=>{const g=_.current,f=h=>{if(h.key!=="Tab")return;const w=g.querySelectorAll($e),E=w[0],x=w[w.length-1];!E||!x||(h.shiftKey&&document.activeElement===E?(h.preventDefault(),x.focus()):!h.shiftKey&&document.activeElement===x&&(h.preventDefault(),E.focus()))};return g.addEventListener("keydown",f),()=>{g.removeEventListener("keydown",f)}},[]),e(ct,{children:e("div",{className:o(["dropin-modal",["dropin-modal--dim",i]]),children:e("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?b:void 0,tabIndex:-1,...u,ref:_,className:o(["dropin-modal__body",[`dropin-modal__body--${t}`,t],d]),children:[e("div",{className:o(["dropin-modal__header",["dropin-modal__header-title",!!r]]),children:[r&&e("div",{id:b,className:o(["dropin-modal__header-title-content"]),children:r}),c&&e(Z,{"aria-label":v.modalCloseLabel,variant:"tertiary",className:"dropin-modal__header-close-button",onClick:N,icon:e(ae,{})})]}),e("div",{className:o(["dropin-modal__content",["dropin-modal__body--centered",n]]),children:p})]})})})},qt=({className:t,children:r,ariaLabel:n,image:i,title:l,price:a,rowTotalFooter:s,taxIncluded:c=!1,taxExcluded:d=!1,total:p,totalExcludingTax:u,sku:b,configurations:_,warning:m,alert:N,discount:v,savings:g,actions:f,removeContent:h,quantity:w,quantityContent:E,description:x,attributes:S,footer:$,loading:T=!1,updating:H=!1,quantityType:K,dropdownOptions:j,onQuantity:L,onRemove:z,...U})=>{var ie,oe;const{locale:G}=Be(He),V=R({each:"Dropin.CartItem.each.label",pricePerItem:"Dropin.CartItem.pricePerItem.label",quantity:"Dropin.CartItem.quantity.label",remove:"Dropin.CartItem.remove.label",removeDefault:"Dropin.CartItem.removeDefault.label",taxIncluded:"Dropin.CartItem.taxIncluded.label",taxExcluded:"Dropin.CartItem.taxExcluded.label",updating:"Dropin.CartItem.updating.label",updatingDefault:"Dropin.ProgressSpinner.updating.label"});if(T)return e(dt,{});const re=K==="dropdown"?e(at,{className:o(["dropin-cart-item__quantity__picker"]),value:String(w),name:"quantity","aria-label":V.quantity,disabled:H,variant:"primary",options:j,handleSelect:J=>L==null?void 0:L(Number(J.target.value))}):e(rt,{className:o(["dropin-cart-item__quantity__incrementer"]),value:w,min:1,onValue:J=>L==null?void 0:L(Number(J)),name:"quantity","aria-label":V.quantity,disabled:H});return e("div",{...U,className:o(["dropin-cart-item",["dropin-cart-item--updating",H],t]),children:[H&&e(lt,{className:o(["dropin-cart-item__spinner"]),ariaLabel:n?(ie=V.updating)==null?void 0:ie.replace("{product}",n):V.updatingDefault}),e("div",{className:"dropin-cart-item__wrapper",children:[i&&e(I,{node:i,className:o(["dropin-cart-item__image"])}),l&&e(I,{node:l,className:o(["dropin-cart-item__title",["dropin-cart-item__title--edit",!!L||!!z]])}),x&&e(I,{node:x,className:o(["dropin-cart-item__description"])}),b&&e(I,{node:b,className:o(["dropin-cart-item__sku"])}),e("div",{className:o(["dropin-cart-item__savings__wrapper"]),children:[v&&e(I,{node:v,className:o(["dropin-cart-item__discount","dropin-cart-item__discount__large-screen"])}),g&&e(I,{node:g,className:o(["dropin-cart-item__savings","dropin-cart-item__savings__large-screen"])})]}),S&&e("div",{className:o(["dropin-cart-item__attributes"]),children:e(I,{node:S})}),_&&e("ul",{className:o(["dropin-cart-item__configurations"]),children:Object.entries(_).map(([J,ne])=>e("li",{className:o(["dropin-cart-item__configurations__item"]),children:[J,":"," ",e("strong",{className:o(["dropin-cart-item__configurations__item__value"]),children:ne})]},J))}),a&&e("span",{className:o(["dropin-cart-item__price"]),"aria-label":V.pricePerItem,children:[w&&!L&&e(ee,{children:[e("span",{className:"dropin-cart-item__price__quantity","aria-hidden":!0,children:[w.toLocaleString(G)," x"," "]}),e("div",{className:"dropin-cart-item__sr-only",children:[V.quantity,": ",w==null?void 0:w.toLocaleString(G),";"]})]}),e(I,{node:a,role:"text"}),w&&w>1&&e(ee,{children:[" ",V.each]}),c&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",V.taxIncluded]}),d&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",V.taxExcluded]})]}),e("div",{className:o(["dropin-cart-item__quantity",["dropin-cart-item__quantity--edit",!!L]]),children:[E?e(I,{node:E}):L?re:w&&e("span",{className:o(["dropin-cart-item__quantity__value"]),children:[V.quantity,":"," ",e("strong",{className:"dropin-cart-item__quantity__number",children:Number(w).toLocaleString(G)})]}),m&&e(I,{node:m,className:o(["dropin-cart-item__warning","dropin-cart-item__warning--quantity"])}),N&&e(I,{node:N,className:o(["dropin-cart-item__alert","dropin-cart-item__alert--quantity"])})]}),f&&e("div",{className:o(["dropin-cart-item__actions"]),children:e(I,{node:f,className:o(["dropin-cart-item__buttons"])})}),m&&e(I,{node:m,className:o(["dropin-cart-item__warning"])}),N&&e(I,{node:N,className:o(["dropin-cart-item__alert"])}),e("div",{className:o(["dropin-cart-item__total",["dropin-cart-item__total--edit",!!z]]),children:[e("div",{className:"dropin-cart-item__row-total__wrapper",children:[p&&e("div",{className:"dropin-cart-item__row-total",children:e(I,{node:p,role:"text"})}),c&&e("div",{className:"dropin-cart-item__total-tax-included",children:e("span",{"data-testid":"tax-message",className:o(["dropin-cart-item__total-tax-message"]),children:V.taxIncluded})})]}),d&&e("div",{className:"dropin-cart-item__total-tax-excluded",children:e("span",{"data-testid":"tax-message",className:o(["dropin-cart-item__total-tax-excluded-message"]),children:[u&&e(I,{node:u,role:"text"})," ",V.taxExcluded]})}),v&&e(I,{node:v,className:o(["dropin-cart-item__discount"])}),g&&e(I,{node:g,className:o(["dropin-cart-item__savings"])}),s&&e(I,{node:s,className:o(["dropin-cart-item__row-total-footer"])})]}),$&&e(I,{node:$,className:o(["dropin-cart-item__footer"])})]}),h?e(I,{node:h}):z?e(Z,{"data-testid":"cart-item-remove-button",className:o(["dropin-cart-item__remove"]),variant:"tertiary",onClick:()=>z==null?void 0:z(),icon:e(W,{"data-testid":"cart-item-remove-icon",source:Je,size:"24",stroke:"2",viewBox:"0 0 24 24","aria-label":n?(oe=V.remove)==null?void 0:oe.replace("{product}",n):V.removeDefault}),disabled:H}):null]})},dt=()=>e("div",{className:"dropin-cart-item dropin-cart-item-skeleton",children:e(ce,{className:"dropin-cart-item__skeleton dropin-cart-item__wrapper",children:[e("div",{className:"dropin-cart-item__image",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__title",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__sku",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__price",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__quantity",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__total",children:e(Y,{className:"dropin-cart-item__skeleton__item"})})]})}),Kt=({className:t,children:r,...n})=>e("div",{...n,className:o(["dropin-cart-list",t]),children:e("div",{className:"dropin-cart-list__wrapper","aria-live":"assertive","aria-relevant":"all",children:Ee.map(r,(i,l)=>e("div",{className:"dropin-cart-list__item",children:i},l))})}),Ut=({className:t,children:r,locale:n,currency:i,amount:l,variant:a="default",minimumAmount:s,maximumAmount:c,size:d="small",display:p="dash",specialPrice:u,sale:b=!1,..._})=>{const m=Q(()=>l||s===c||s&&!c||c&&!s,[l,c,s]);return e("div",{children:m?e("div",{..._,className:o(["dropin-price-range",t]),children:e(te,{amount:l??s??c,currency:i,locale:n,size:d,variant:a,sale:b})}):e("div",{..._,className:o(["dropin-price-range",t]),children:[p==="dash"?e(pt,{specialPrice:u,minimumAmount:s,maximumAmount:c,currency:i,locale:n,size:d,sale:b}):null,p==="from to"?e(_t,{specialPrice:u,minimumAmount:s,maximumAmount:c,currency:i,locale:n,size:d,sale:b}):null,p==="as low as"?e(ut,{specialPrice:u,minimumAmount:s,maximumAmount:c,currency:i,locale:n,size:d,sale:b}):null]})})};function pt({specialPrice:t,minimumAmount:r,maximumAmount:n,currency:i,locale:l,size:a,sale:s}){return e(ee,{children:[e(te,{amount:t??r,currency:i,locale:l,size:a,sale:!!t&&s}),e("span",{className:"dropin-price-range__separator",children:"-"}),e(te,{amount:n,currency:i,locale:l,size:a})]})}function _t({specialPrice:t,minimumAmount:r,maximumAmount:n,currency:i,locale:l,size:a,sale:s}){const c=R({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(ee,{children:[e("span",{className:o(["dropin-price-range__from",`dropin-price-range__from--${a}`]),children:c.from}),e(te,{amount:t??r,currency:i,locale:l,size:a,sale:!!t&&s}),e("span",{className:o(["dropin-price-range__to",`dropin-price-range__to--${a}`]),children:c.to}),e(te,{amount:n,currency:i,locale:l,size:a})]})}function ut({specialPrice:t,minimumAmount:r,maximumAmount:n,currency:i,locale:l,size:a,sale:s}){const c=R({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(ee,{children:[e("span",{className:o(["dropin-price-range__as-low-as",`dropin-price-range__as-low-as--${a}`]),children:c.asLowAs}),t?e("div",{children:[e(te,{amount:n,currency:i,locale:l,size:a,variant:"strikethrough"}),e(te,{amount:t,currency:i,locale:l,size:a,className:"dropin-price-range__special",sale:!!t&&s})]}):e(te,{amount:r,currency:i,locale:l,size:a})]})}const Gt=({className:t,categories:r,separator:n,...i})=>e(ee,{children:(r==null?void 0:r.length)>1&&e("nav",{role:"navigation",...i,className:o(["dropin-breadcrumbs__container",t]),children:e("ul",{className:"dropin-breadcrumbs__items",children:r==null?void 0:r.map((l,a)=>e("li",{className:o(["dropin-breadcrumbs__item",["dropin-breadcrumbs__item--last",a===r.length-1]]),children:[e(I,{node:l,className:"dropin-breadcrumbs__link"}),!n&&a!==r.length-1&&e("span",{className:"dropin-breadcrumbs__separator--default",children:[" ","/"," "]}),n&&a!==r.length-1&&e(I,{node:n,className:"dropin-breadcrumbs__separator--icon"})]},a))})})}),jt=({className:t,variant:r,icon:n,message:i,onDismiss:l,action:a,...s})=>{const c=R({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...s,className:o([t,"dropin-alert-banner",`dropin-alert-banner--${r}`]),children:[e("div",{className:"dropin-alert-banner__content",children:[n&&e(I,{node:n,"aria-hidden":"true",className:"dropin-alert-banner__icon"}),e(I,{node:i,className:o(["dropin-alert-banner__message"])})]}),e("div",{className:"dropin-alert-banner__actions",children:[a&&e(Z,{variant:"tertiary",className:"dropin-alert-banner__action",onClick:a.onClick,"aria-label":a.label,children:a.label}),e(Z,{icon:e(W,{source:ae,size:"24",stroke:"2"}),className:"dropin-alert-banner__dismiss-button",variant:"primary",onClick:l,"aria-label":c.dismiss})]})]})},zt=({className:t,icon:r,heading:n,headingLevel:i=2,message:l,action:a,variant:s="secondary",...c})=>{const d=i>=1&&i<=6?`h${i}`:"h2";return e("div",{...c,className:o(["dropin-illustrated-message",t]),children:e(ot,{variant:s,children:[r&&e(I,{node:r,"aria-hidden":"true",size:"80",className:"dropin-illustrated-message__icon"}),n&&e(d,{className:"dropin-illustrated-message__heading",children:n}),l&&e(I,{node:l,className:"dropin-illustrated-message__message"}),a&&e(I,{node:a,className:"dropin-illustrated-message__action"})]})})},Jt=({label:t,name:r,value:n,ariaLabel:i,busy:l=!1,disabled:a=!1,children:s,className:c,icon:d,onChange:p,selected:u=!0,...b})=>{const _=`dropin-toggle-button__content-${r}-${n}`.replace(/\s+/g,"-");return e("div",{...b,className:o(["dropin-toggle-button",c,["dropin-toggle-button__selected",u],["dropin-toggle-button__disabled",a]]),children:e("label",{className:"dropin-toggle-button__actionButton",children:[e(it,{label:"",name:r,value:n,checked:u,disabled:a,onChange:()=>p&&p(n),"aria-label":i,"aria-labelledby":i?void 0:_,busy:l,className:o([c,"dropin-toggle-button__radioButton"])}),e("span",{className:"dropin-toggle-button__content",id:_,children:[d&&e(d.type,{...d==null?void 0:d.props,className:"dropin-toggle-button__icon"}),t]})]})})},mt=({level:t,className:r,children:n})=>{const i=t&&t>=1&&t<=6?`h${t}`:"span";return e(i,{className:r,children:n})},Xt=({title:t=null,size:r="medium",cta:n,divider:i=!0,className:l,level:a,...s})=>t?e("div",{...s,className:o(["dropin-header-container",l]),"data-testid":"dropin-header-container",children:[e(mt,{className:o(["dropin-header-container__title",["dropin-header-container__title--medium",r==="medium"],["dropin-header-container__title--large",r==="large"]]),level:a,children:t}),n?e(I,{node:n,className:"dropin-header-container__actions"}):null,i?e(Ae,{className:o(["dropin-header-container__divider",["dropin-header-container__divider--medium",r==="medium"],["dropin-header-container__divider--large",r==="large"]])}):null]}):null,ht=({label:t,className:r,children:n,...i})=>!t&&!n?null:e("div",{...i,className:o(["dropin-tag-container",r]),"data-testid":"dropin-tag-container",children:n??e("span",{className:"dropin-tag-container__label",children:t})}),Yt=({className:t,children:r,maxColumns:n,columnWidth:i="1fr",emptyGridContent:l,...a})=>{const s=!!r&&(Array.isArray(r)?r.length>0:!0),c=s?{gridTemplateColumns:`repeat(${n}, ${i})`}:void 0;return e("div",{...a,className:o(["dropin-content-grid",t]),tabindex:0,children:e("div",{"data-testid":"content-grid-content",className:o(["dropin-content-grid__content",["dropin-content-grid__dynamic-columns-content",!n],["dropin-content-grid__content--empty",!s]]),style:c,children:s?r:l})})},ue=t=>{if(t.href){const{href:i,disabled:l,...a}=t;return e("a",{href:i,"aria-disabled":l,...a})}const{type:r="button",...n}=t;return e("button",{type:r,...n})},Zt=({totalPages:t=10,currentPage:r=1,onChange:n,routePage:i,className:l,...a})=>{const s=R({backwardButton:"Dropin.Pagination.backwardButton.ariaLabel",forwardButton:"Dropin.Pagination.forwardButton.ariaLabel"}),c=C(_=>{const m=Math.min(r+1,t);n==null||n(m,_)},[r,n,t]),d=C(_=>{const m=Math.max(r-1,1);n==null||n(m,_)},[r,n]),p=C((_,m)=>{Ze(_)&&(n==null||n(_,m))},[n]),u=C((_,m)=>{const N=[],v=(g,f)=>{for(let h=g;h<=f;h++)N.push({page:h,isActive:h===_,label:h})};return m<=5?v(1,m):_<=2?(v(1,2),N.push({page:"ellipsis",isActive:!1,label:"..."}),v(m-1,m)):_>=m-3?v(m-4,m):(v(_-1,_),N.push({page:"ellipsis",isActive:!1,label:"..."}),v(m-1,m)),N},[]),b=Q(()=>u(r,t),[u,r,t]);return e("div",{...a,className:o(["dropin-pagination",l]),children:[e(ue,{"data-testid":"prev-button","aria-label":s.backwardButton,disabled:r===1,onClick:_=>d(_),href:(i==null?void 0:i(r))??void 0,className:o(["dropin-pagination-arrow","dropin-pagination-arrow--backward",["dropin-pagination-arrow--disabled",r===1]]),children:e(W,{size:"24",source:se})}),e("ul",{className:"dropin-pagination_list",children:b.map((_,m)=>e("li",{"data-testid":`dropin-pagination_list-item--${_.page}`,className:o(["dropin-pagination_list-item",`dropin-pagination_list-item--${_.page}`,["dropin-pagination_list-item--active",_.isActive]]),children:e(ue,{"data-testid":`set-page-button-${_.page}`,onClick:N=>p(_.page,N),href:(i==null?void 0:i(_.page))??void 0,children:_.label})},`${_.page}_${m}`))}),e(ue,{"data-testid":"next-button","aria-label":s.forwardButton,disabled:r===t,onClick:_=>c(_),href:(i==null?void 0:i(r))??void 0,className:o(["dropin-pagination-arrow","dropin-pagination-arrow--forward",["dropin-pagination-arrow--disabled",r===t]]),children:e(W,{size:"24",source:se})})]})},bt=()=>e("div",{className:"dropin-product-item-card dropin-product-item-card-skeleton",children:[e(ce,{className:"dropin-product-item-card__skeleton dropin-product-item-card__image-container",children:e(Y,{fullWidth:!0,className:"dropin-product-item-card__skeleton__image"})}),e(ce,{className:"dropin-product-item-card__content dropin-product-item-card__skeleton__content",children:[e(Y,{fullWidth:!0,size:"xsmall",className:"dropin-product-item-card__skeleton__item"}),e(Y,{fullWidth:!0,size:"xsmall",className:"dropin-product-item-card__skeleton__item"}),e(Y,{fullWidth:!0,size:"xsmall",className:"dropin-product-item-card__skeleton__item"})]})]}),Qt=({className:t,image:r,titleNode:n,price:i,sku:l,actionButton:a,swatches:s,initialized:c=!1,...d})=>c?e("div",{...d,className:o(["dropin-product-item-card",t]),children:[e("div",{className:"dropin-product-item-card__image-container",children:r&&e(I,{node:r,className:o(["dropin-product-item-card__image"])})}),e("div",{className:"dropin-product-item-card__content",children:[n&&e(I,{node:n,className:o(["dropin-product-item-card__title"])}),l&&e(I,{node:l,className:o(["dropin-product-item-card__sku"])}),i&&e("div",{className:"dropin-product-item-card__price",children:e(I,{node:i,className:o(["dropin-product-item-card__price"])})}),s&&e("div",{className:"dropin-product-item-card__swatches",children:e(I,{node:s,className:o(["dropin-product-item-card__swatches"])})}),a&&e("div",{className:"dropin-product-item-card__action",children:e(I,{node:a,className:o(["dropin-product-item-card__action"])})})]})]}):e(bt,{}),er=({accept:t,onChange:r,label:n="Upload Document",icon:i,className:l,multiple:a,id:s,...c})=>{const d=me(),p=s||d,u=b=>{r==null||r(b)};return e("div",{className:o(["dropin-input-file",l]),children:[e("label",{htmlFor:p,className:"dropin-input-file__label",children:[i&&e("span",{className:"dropin-input-file__icon",children:i}),n]}),e("input",{id:p,type:"file",accept:t,multiple:a,onChange:u,className:"dropin-input-file__input",...c})]})},tr=({className:t,children:r,columns:n=[],rowData:i=[],mobileLayout:l="none",caption:a,expandedRows:s=new Set,loading:c=!1,skeletonRowCount:d=10,onSortChange:p,...u})=>{const b=R({sortedAscending:"Dropin.Table.sortedAscending",sortedDescending:"Dropin.Table.sortedDescending",sortBy:"Dropin.Table.sortBy"}),_=f=>{if(!p)return;let h;f.sortBy===!0?h="asc":f.sortBy==="asc"?h="desc":h=!0,p(f.key,h)},m=f=>{if(f.sortBy===void 0)return null;const h=f.ariaLabel??f.label;let w,E;return f.sortBy==="asc"?(w="ChevronUp",E=b.sortedAscending.replace("{label}",h)):f.sortBy==="desc"?(w="ChevronDown",E=b.sortedDescending.replace("{label}",h)):(w="ChevronDown",E=b.sortBy.replace("{label}",h)),e(Z,{variant:"tertiary",size:"medium",className:"dropin-table__header__sort-button",icon:e(W,{source:w}),"aria-label":E,onClick:()=>_(f)})},N=()=>Array.from({length:d},(f,h)=>e("tr",{className:"dropin-table__body__row",children:n.map(w=>e("td",{className:"dropin-table__body__cell","data-label":w.ariaLabel??w.label,children:e(ce,{children:e(Y,{variant:"row",size:"small",fullWidth:!0})})},w.key))},`skeleton-${h}`)),v=()=>i.map((f,h)=>{const w=f._rowDetails!==void 0,E=s.has(h);return e(ee,{children:[e("tr",{className:o(["dropin-table__body__row",["dropin-table__body__row--expanded",E&&w]]),children:n.map(x=>{const S=f[x.key],$=x.ariaLabel??x.label;return typeof S=="string"||typeof S=="number"?e("td",{className:"dropin-table__body__cell","data-label":$,children:S},x.key):e("td",{className:"dropin-table__body__cell","data-label":$,children:e(I,{node:S})},x.key)})}),w&&E&&e("tr",{className:"dropin-table__row-details dropin-table__row-details--expanded",id:`row-${h}-details`,children:e("td",{className:"dropin-table__row-details__cell",colSpan:n.length,role:"region","aria-labelledby":`row-${h}-details`,children:typeof f._rowDetails=="string"?f._rowDetails:e(I,{node:f._rowDetails})})},`${h}-details`)]},h)}),g=f=>{if(f.sortBy===!0)return"none";if(f.sortBy==="asc")return"ascending";if(f.sortBy==="desc")return"descending"};return e("div",{className:o(["dropin-table",`dropin-table--mobile-layout-${l}`,t]),children:e("table",{...u,className:"dropin-table__table",children:[a&&e("caption",{className:"dropin-table__caption",children:a}),e("thead",{className:"dropin-table__header",children:e("tr",{className:"dropin-table__header__row",children:n.map(f=>e("th",{className:o(["dropin-table__header__cell",["dropin-table__header__cell--sorted",f.sortBy==="asc"||f.sortBy==="desc"],["dropin-table__header__cell--sortable",f.sortBy!==void 0]]),"aria-sort":g(f),children:[f.label,m(f)]},f.key))})}),e("tbody",{className:"dropin-table__body",children:c?N():v()})]})})},ft=(t,r)=>t.filter(n=>n.label.toLowerCase().includes(r.toLowerCase())),vt=(t,r)=>t.map(n=>{const i=r.find(l=>l.value===n);return i?i.label:n}),gt=(t,r,n)=>{const i=t||r;return{listboxId:`${i}-listbox`,searchInputId:`${i}-search`,labelId:n?`${i}-label`:void 0,selectedDescriptionId:`${r}-selected-description`}},Nt=()=>{const[t,r]=B(""),n=C(i=>{r(i),setTimeout(()=>r(""),1e3)},[]);return{announcement:t,announce:n}},wt=(t,r,n,i)=>(M(()=>{if(r>=0&&i.current){const a=i.current.querySelectorAll("[data-option-index]");a[r]&&a[r].scrollIntoView({block:"nearest",behavior:"smooth"})}},[r,i]),{navigate:C(a=>{n(s=>{var p,u,b;const c=a==="up"?-1:1;let d=s+c;for(;d>=0&&d<t.length&&((p=t[d])!=null&&p.disabled);)d+=c;if(d>=0&&d<t.length)return d;if(a==="up"){for(let _=t.length-1;_>=0;_--)if(!((u=t[_])!=null&&u.disabled))return _}else for(let _=0;_<t.length;_++)if(!((b=t[_])!=null&&b.disabled))return _;return-1})},[t,n])}),rr=({options:t=[],value:r=[],onChange:n=()=>{},id:i="",className:l="",selectAllText:a="",deselectAllText:s="",placeholder:c="",noResultsText:d="",floatingLabel:p="",name:u="multi-select-sdk",error:b=!1,success:_=!1,disabled:m=!1,maxHeight:N=300})=>{const v=R({selectAll:"Dropin.MultiSelect.selectAll",deselectAll:"Dropin.MultiSelect.deselectAll",placeholder:"Dropin.MultiSelect.placeholder",noResultsText:"Dropin.MultiSelect.noResultsText",removed:"Dropin.MultiSelect.ariaLabel.removed",added:"Dropin.MultiSelect.ariaLabel.added",itemsSelected:"Dropin.MultiSelect.ariaLabel.itemsSelected",itemsAdded:"Dropin.MultiSelect.ariaLabel.itemsAdded",itemsRemoved:"Dropin.MultiSelect.ariaLabel.itemsRemoved",selectedTotal:"Dropin.MultiSelect.ariaLabel.selectedTotal",noResultsFor:"Dropin.MultiSelect.ariaLabel.noResultsFor",optionsAvailable:"Dropin.MultiSelect.ariaLabel.optionsAvailable",dropdownExpanded:"Dropin.MultiSelect.ariaLabel.dropdownExpanded",useArrowKeys:"Dropin.MultiSelect.ariaLabel.useArrowKeys",removeFromSelection:"Dropin.MultiSelect.ariaLabel.removeFromSelection",fromSelection:"Dropin.MultiSelect.ariaLabel.fromSelection",selectedItem:"Dropin.MultiSelect.ariaLabel.selectedItem",inField:"Dropin.MultiSelect.ariaLabel.inField",selectedItems:"Dropin.MultiSelect.ariaLabel.selectedItems",scrollableOptionsList:"Dropin.MultiSelect.ariaLabel.scrollableOptionsList",selectOptions:"Dropin.MultiSelect.ariaLabel.selectOptions",itemAction:"Dropin.MultiSelect.ariaLabel.itemAction",bulkAdded:"Dropin.MultiSelect.ariaLabel.bulkAdded",bulkRemoved:"Dropin.MultiSelect.ariaLabel.bulkRemoved",dropdownExpandedWithOptions:"Dropin.MultiSelect.ariaLabel.dropdownExpandedWithOptions",selectedItemInField:"Dropin.MultiSelect.ariaLabel.selectedItemInField",removeFromSelectionWithText:"Dropin.MultiSelect.ariaLabel.removeFromSelectionWithText",itemsSelectedDescription:"Dropin.MultiSelect.ariaLabel.itemsSelectedDescription",noItemsSelected:"Dropin.MultiSelect.ariaLabel.noItemsSelected"}),[g,f]=B(!1),[h,w]=B(""),[E,x]=B(-1),S=X(null),$=X(null),T=X(null),{announcement:H,announce:K}=Nt(),j=C((y=!1)=>{f(!1),y&&w(""),x(-1)},[]),L=Q(()=>ft(t,h),[t,h]),{navigate:z}=wt(L,E,x,T);M(()=>{const y=A=>{S.current&&A.target&&!S.current.contains(A.target)&&j(!0)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[j]);const U=y=>{!m&&$.current&&y.target&&!y.target.closest("[data-tag]")&&(g?j(!1):($.current.focus(),f(!0)))},G=C(y=>{var P;const A=t.find(q=>q.value===y),O=r.includes(y),F=O?r.filter(q=>q!==y):[...r,y];if(n(F),(P=$.current)==null||P.focus(),A){const q=O?v.removed:v.added;K(v.itemAction.replace("{label}",A.label).replace("{action}",q).replace("{count}",F.length.toString()))}},[r,n,t,K,v]),V=(y,A)=>{var P;y.stopPropagation();const O=t.find(q=>q.value===A),F=r.filter(q=>q!==A);n(F),(P=$.current)==null||P.focus(),O&&K(v.itemAction.replace("{label}",O.label).replace("{action}",v.removed).replace("{count}",F.length.toString()))},re=y=>{y.preventDefault();const A=L.map(q=>q.value),O=new Set(r),F=A.filter(q=>!O.has(q)),P=[...r,...F];n(P),F.length>0&&K(v.bulkAdded.replace("{count}",F.length.toString()).replace("{total}",P.length.toString()))},ie=y=>{y.preventDefault();const A=new Set(L.map(P=>P.value)),O=r.filter(P=>A.has(P)).length,F=r.filter(P=>!A.has(P));n(F),O>0&&K(v.bulkRemoved.replace("{count}",O.toString()).replace("{total}",F.length.toString()))},oe=y=>{var A;if(y.key==="Backspace"&&h===""&&r.length>0){y.preventDefault();const O=r.slice(0,-1);n(O);return}if(!g&&(y.key==="ArrowDown"||y.key==="Enter")){y.preventDefault(),f(!0);return}if(g)switch(y.key){case"ArrowDown":y.preventDefault(),z("down");break;case"ArrowUp":y.preventDefault(),z("up");break;case"Enter":if(y.preventDefault(),E>=0&&E<L.length){const O=L[E];O!=null&&O.disabled||G(O.value)}else L.length===1&&!((A=L[0])!=null&&A.disabled)&&G(L[0].value);break;case"Escape":y.preventDefault(),j(!0);break;case"Tab":j(!0);break}},J=Q(()=>vt(r,t),[r,t]),{listboxId:ne,searchInputId:be,labelId:pe,selectedDescriptionId:fe}=gt(i,u,p),ve=E>=0?`${ne}-option-${E}`:"",Oe=Q(()=>r.length>0,[r]);M(()=>{h&&!g&&f(!0)},[g,h]),M(()=>{if(g&&h){const y=L.length;K(y===0?`${v.noResultsFor} "${h}"`:`${y} ${v.optionsAvailable}`)}},[L.length,h,g,K,v]),M(()=>{g&&$.current&&($.current.focus(),L.length>0&&K(v.dropdownExpandedWithOptions.replace("{count}",L.length.toString()).replace("{s}",L.length===1?"":"s")))},[g,J.length,L.length,K,v]);const Re=()=>e(ee,{children:J.map((y,A)=>{const O=r.length,F=p?`${p}: `:"",P=O===1?`${F}${v.itemsSelected.replace("{count}","1").replace("{labels}",String(y)).replace("{s}","")}`:`${F}${v.itemsSelected.replace("{count}",O.toString()).replace("{labels}",J.join(", ")).replace("{s}",O===1?"":"s")}`;return e(ht,{"data-tag":"true",className:"dropin-multi-select__tag",role:"group","aria-label":p?v.selectedItemInField.replace("{label}",String(y)).replace("{field}",p):`${v.selectedItem} ${String(y)}`,children:[e("span",{"aria-hidden":"true",children:y}),e("button",{type:"button",onClick:q=>V(q,r[A]),className:"dropin-multi-select__tag-remove",disabled:m,"aria-label":v.removeFromSelectionWithText.replace("{label}",String(y)).replace("{text}",P),children:e(ae,{size:12,"aria-hidden":"true"})})]},r[A])})}),Ve=()=>e("input",{id:be,ref:$,type:"text",role:"combobox","aria-haspopup":"listbox","aria-expanded":g,"aria-controls":ne,className:o(["dropin-multi-select__search",["dropin-multi-select__search--with-floating-label",!!p]]),placeholder:r.length===0?c||v.placeholder:"",value:h,onChange:y=>{const A=y.target;w(A.value),x(-1)},onKeyDown:oe,onFocus:()=>f(!0),disabled:m,style:{minWidth:h?`${h.length*8+20}px`:"40px"},"aria-autocomplete":"list","aria-activedescendant":g&&ve?ve:void 0,...pe?{"aria-labelledby":pe}:{"aria-label":p||c||v.placeholder||v.selectOptions},"aria-describedby":fe}),Ce=()=>e("div",{className:"dropin-multi-select__controls",children:[e(Z,{variant:"tertiary",type:"button",className:"dropin-multi-select__button dropin-multi-select__button--select-all",onMouseDown:re,"data-testid":"multi-select-select-all",children:a||v.selectAll})," | ",e(Z,{variant:"tertiary",type:"button",className:"dropin-multi-select__button dropin-multi-select__button--deselect-all",onMouseDown:ie,disabled:!Oe,"data-testid":"multi-select-deselect-all",children:s||v.deselectAll})]}),Pe=()=>e("ul",{className:"dropin-multi-select__list",id:ne,role:"listbox","aria-multiselectable":"true","aria-label":p||c||v.placeholder,children:L.map((y,A)=>{const O=r.includes(y.value),F=A===E,P=`${ne}-option-${A}`;return e("li",{id:P,"data-option-index":A,"data-testid":`multi-select-option-${A}`,className:o(["dropin-multi-select__option",["dropin-multi-select__option--focused",F],["dropin-multi-select__option--selected",O],["dropin-multi-select__option--disabled",y.disabled]]),onClick:()=>{y.disabled||G(y.value)},onMouseEnter:()=>!y.disabled&&x(A),role:"option","aria-selected":O,"aria-disabled":y.disabled,children:[e("span",{className:o(["dropin-multi-select__option-label",["dropin-multi-select__option-label--disabled",y.disabled]]),children:y.label}),O&&e(he,{width:16,height:16,className:"dropin-multi-select__check-icon","aria-hidden":"true"})]},y.value)})});return e("div",{ref:S,"data-testid":"multi-select",className:o(["dropin-multi-select",l]),children:[e("input",{id:i||u,type:"hidden",name:u,"data-testid":"multi-select-hidden-input",value:r.join(","),disabled:m,"aria-hidden":"true"}),e("div",{className:o(["dropin-multi-select__container",["dropin-multi-select__container--open",g],["dropin-multi-select__container--disabled",m],["dropin-multi-select__container--error",b],["dropin-multi-select__container--success",_],["dropin-multi-select__container--with-floating-label",!!p],["dropin-multi-select__container--has-value",!!(p&&(r.length>0||h.length>0))]]),onMouseDown:U,"data-testid":"multi-select-container",children:[e("div",{className:o(["dropin-multi-select__tags-area",["dropin-multi-select__tags-area--has-values",J.length>0]]),"data-testid":"multi-select-tags-area",role:"group","aria-label":v.selectedItems,children:[e("div",{id:fe,className:"dropin-multi-select__sr-only","aria-live":"polite","aria-atomic":"true",children:r.length>0?v.itemsSelectedDescription.replace("{count}",r.length.toString()).replace("{s}",r.length===1?"":"s").replace("{labels}",J.join(", ")):v.noItemsSelected}),Re(),Ve(),p?e("label",{className:"dropin-multi-select__floating-label",htmlFor:be,id:pe,children:p}):null]}),e(se,{className:o(["dropin-multi-select__chevron",["dropin-multi-select__chevron--open",g]])})]}),g&&e("div",{className:"dropin-multi-select__dropdown","data-testid":"multi-select-dropdown",children:[L.length>0&&Ce(),e("div",{ref:T,className:"dropin-multi-select__options","data-testid":"multi-select-options",style:{maxHeight:`${N}px`},tabIndex:0,role:"region","aria-label":v.scrollableOptionsList,children:L.length===0?e("div",{className:"dropin-multi-select__no-results","data-testid":"multi-select-no-results",role:"status","aria-live":"polite",children:[d||v.noResultsText," ",h&&`"${h}"`]}):Pe()})]}),e("div",{className:"dropin-multi-select__announcements dropin-multi-select__sr-only","aria-live":"assertive","aria-atomic":"true",children:H})]})};export{Bt as Accordion,st as AccordionSection,Rt as ActionButton,Vt as ActionButtonGroup,jt as AlertBanner,Gt as Breadcrumbs,Z as Button,ot as Card,qt as CartItem,dt as CartItemSkeleton,Kt as CartList,Ct as Checkbox,Pt as ColorSwatch,Yt as ContentGrid,Ae as Divider,Te as Field,Xt as Header,W as Icon,zt as IllustratedMessage,We as Image,Ft as ImageSwatch,Wt as InLineAlert,rt as Incrementer,Le as Input,At as InputDate,er as InputFile,Tt as InputPassword,Ht as Modal,rr as MultiSelect,Zt as Pagination,at as Picker,te as Price,Ut as PriceRange,Qt as ProductItemCard,lt as ProgressSpinner,it as RadioButton,ce as Skeleton,Y as SkeletonRow,tr as Table,ht as Tag,Ot as TextArea,Mt as TextSwatch,Jt as ToggleButton,He as UIContext,ar as UIProvider,or as provider};
|
|
3
|
+
import{u as e,L as Ne,h as G,y as M,F as k,A as H,a as we,b as _e,c as O,q as B,T as Q,g as he,N as xe,E as Me,k as ee,d as Fe,x as Be}from"./chunks/preact-vendor.js";import{c as o,V as S}from"./chunks/vcomponent.js";import{I as We,U as He}from"./chunks/Image.js";import{a as ar,p as or}from"./chunks/Image.js";import{S as de,a as le,b as qe,c as Ke,d as Ue,e as ae,f as be,g as Ge,h as je,i as ze,j as se,k as Je}from"./chunks/icons.js";import{d as me,i as ye,f as Xe,a as Ye,b as Ze}from"./chunks/format-calendar-date.js";import"./chunks/image-params-keymap.js";import"./signals.js";import"./chunks/cjs.js";import"./chunks/locale-config.js";const ke=1,Y=({className:t,fullWidth:r=!1,lines:n=ke,size:i="small",variant:l="row",children:a=null,multilineGap:s="medium",...c})=>{const d=[[`dropin-skeleton-row__${l}`,l],[`dropin-skeleton-row__${l}-${i}`,l&&i]];if(!a&&l==="empty")return e("div",{className:o(["dropin-skeleton-row dropin-skeleton-row__empty",t])});if(a){const m=a.trim();return e("div",{...c,class:o(["dropin-skeleton-row",["dropin-skeleton-row--full",r],t]),dangerouslySetInnerHTML:{__html:m}})}return n>ke===!1?e("div",{...c,class:o(["dropin-skeleton-row",["dropin-skeleton-row--full",r],"dropin-skeleton--row__content",...d,t])}):e("div",{...c,style:{"--multiline-gap-spacing":`var(--spacing-${s})`},class:o(["dropin-skeleton-row--multiline",["dropin-skeleton-row--full",r],t]),children:Array.from({length:n}).map((m,b)=>e("div",{class:o(["dropin-skeleton-row",["dropin-skeleton-row--full",r],"dropin-skeleton--row__content",...d])},b))})},ce=({className:t,children:r,rowGap:n="medium",...i})=>e("div",{style:{"--row-gap-spacing":`var(--spacing-${n})`},...i,className:o(["dropin-skeleton",t]),role:"status","aria-label":"Loading...",children:r}),Qe=function(){const r=typeof document<"u"&&document.createElement("link").relList;return r&&r.supports&&r.supports("modulepreload")?"modulepreload":"preload"}(),et=function(t){return"/"+t},De={},D=function(r,n,i){let l=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));l=Promise.allSettled(n.map(d=>{if(d=et(d),d in De)return;De[d]=!0;const p=d.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":Qe,p||(b.as="script"),b.crossOrigin="",b.href=d,c&&b.setAttribute("nonce",c),document.head.appendChild(b),p)return new Promise((_,u)=>{b.addEventListener("load",_),b.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(s){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=s,window.dispatchEvent(c),!c.defaultPrevented)throw s}return l.then(s=>{for(const c of s||[])c.status==="rejected"&&a(c.reason);return r().catch(a)})},Ie={Add:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.A),[])),AddressBook:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.l),[])),Bulk:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.B),[])),Burger:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.m),[])),Business:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.n),[])),Card:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.C),[])),Cart:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.o),[])),Check:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.p),[])),CheckWithCircle:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.q),[])),ChevronDown:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.r),[])),ChevronRight:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.s),[])),ChevronUp:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.t),[])),Close:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.u),[])),Coupon:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.v),[])),Date:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.D),[])),Delivery:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.w),[])),Edit:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.E),[])),EmptyBox:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.x),[])),Eye:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.y),[])),EyeClose:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.z),[])),Gift:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.G),[])),GiftCard:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.F),[])),Heart:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.H),[])),HeartFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.I),[])),InfoFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.J),[])),List:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.L),[])),Locker:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.K),[])),Minus:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.M),[])),Order:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.O),[])),OrderError:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.N),[])),OrderSuccess:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.P),[])),PaymentError:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.Q),[])),Placeholder:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.R),[])),PlaceholderFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.T),[])),Purchase:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.U),[])),Quote:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.V),[])),Search:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.W),[])),SearchFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.X),[])),Sort:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.Y),[])),Star:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.Z),[])),Structure:k(()=>D(()=>import("./chunks/icons.js").then(t=>t._),[])),Team:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.$),[])),Trash:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a0),[])),User:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a1),[])),View:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a2),[])),Wallet:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a3),[])),Warning:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a4),[])),WarningFilled:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a5),[])),WarningWithCircle:k(()=>D(()=>import("./chunks/icons.js").then(t=>t.a6),[]))};function Se(t){try{if(t.startsWith("//")){const n=`${window.location.protocol}${t}`;return new URL(n).hostname!==window.location.hostname?(console.error(`[Icon] External URL rejected for security: ${t} - Only same-domain URLs are allowed`),!1):!0}return new URL(t).hostname!==window.location.hostname?(console.error(`[Icon] External URL rejected for security: ${t} - Only same-domain URLs are allowed`),!1):!0}catch{return console.error(`[Icon] Invalid URL format: ${t}`),!1}}function tt({url:t,...r}){const[n,i]=G(""),[l,a]=G(!0),[s,c]=G(!1);return M(()=>{fetch(t).then(d=>{if(!d.ok)throw console.error(`[Icon] Failed to fetch SVG: ${d.status} ${d.statusText}`),new Error(`Failed to fetch SVG: ${d.status} ${d.statusText}`);return d.text()}).then(d=>{try{if(!new DOMParser().parseFromString(d,"image/svg+xml").querySelector("svg"))throw new Error("No <svg> element found")}catch(m){m instanceof Error?console.error(`[Icon] Invalid SVG content from ${t}: ${m.message}`):console.error(`[Icon] Invalid SVG content from ${t}: ${String(m)}`),c(!0),a(!1)}let p=d;r.width&&(p=p.replace(/<svg([^>]*)\s+width\s*=\s*["'][^"']*["']/gi,"<svg$1"),p=p.replace(/<svg/i,`<svg width="${r.width}"`)),r.height&&(p=p.replace(/<svg([^>]*)\s+height\s*=\s*["'][^"']*["']/gi,"<svg$1"),p=p.replace(/<svg/i,`<svg height="${r.height}"`)),r.title&&(p=p.replace(/<title[^>]*>.*?<\/title>/gi,""),p=p.replace(/<svg([^>]*)>/i,`<svg$1><title>${r.title}</title>`)),i(p),a(!1)}).catch(d=>{d instanceof Error?console.error(`[Icon] ${d.message}`):console.error(`[Icon] ${String(d)}`),c(!0),a(!1)})},[t,r.width,r.height,r.title]),l||s?e("svg",{...r}):e("span",{className:r.className,style:{width:String(r.width),height:String(r.height),display:"inline-flex",lineHeight:0},dangerouslySetInnerHTML:{__html:n}})}function j({source:t,size:r="24",stroke:n="2",viewBox:i="0 0 24 24",className:l,...a}){const s={className:o(["dropin-icon",`dropin-icon--shape-stroke-${n}`,l]),width:r,height:r,viewBox:i},c=typeof t=="string"&&(t.startsWith("http")||t.startsWith("//")||t.startsWith("/"));if(c&&Se(t))return e(Ne,{fallback:e("svg",{...a,...s}),children:e(tt,{url:t,...a,...s})});const d=typeof t=="string"&&t in Ie?Ie[t]:null,p=c&&!Se(t);return e(Ne,{fallback:e("svg",{...a,...s}),children:d?e(d,{...a,...s}):p?e("svg",{...a,...s}):e(t,{...a,...s})})}const rt=({name:t,value:r="1",className:n,disabled:i,error:l,success:a,min:s,max:c,onValue:d,onUpdateError:p,size:m="medium",showButtons:b=!0,..._})=>{const[u,N]=G(Number(r)),[v,g]=G(!1),f=H(!1),h=Number(s),w=Number(c),E=l||v||u<h||u>w,x=v?"Dropin.Incrementer.requiredMessage":u<h?"Dropin.Incrementer.minQuantityMessage":u>w?"Dropin.Incrementer.maxQuantityMessage":"Dropin.Incrementer.errorMessage",$=H(d);M(()=>{$.current=d},[d]);const L=H(p);M(()=>{L.current=p},[p]);const T=I=>{var F,K;try{(F=$.current)==null||F.call($,I)}catch(z){(K=L.current)==null||K.call(L,z)}},V=H(me(T,200)).current,C=H(!1),q=H(me(I=>{C.current=!1,T(I)},1e3)).current;return M(()=>{const I=Number(r);!f.current&&I!==u&&(N(I),g(!1))},[r]),e("div",{className:o(["dropin-incrementer",`dropin-incrementer--${m}`,n]),children:[e("div",{className:o(["dropin-incrementer__content",`dropin-incrementer__content--${m}`,["dropin-incrementer__content--no-buttons",!b],["dropin-incrementer__content--error",E],["dropin-incrementer__content--success",a],["dropin-incrementer__content--disabled",i]]),children:[b&&e("div",{className:o(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",i]]),children:e(we,{children:e("button",{type:"button",className:o(["dropin-incrementer__decrease-button",["dropin-incrementer__decrease-button--disabled",i]]),onMouseDown:I=>I.preventDefault(),onClick:()=>{g(!1),q.cancel(),C.current=!1,N(u-1),V(u-1)},disabled:i||u<h+1,"aria-label":e(_e,{id:"Dropin.Incrementer.decreaseLabel"}),children:e(j,{source:de,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__down"})})})}),e("input",{className:"dropin-incrementer__input",max:c,min:s,step:1,type:"number",name:t,value:v?"":u,disabled:i,onFocus:()=>{f.current=!0},onBlur:()=>{f.current=!1,q.cancel();const I=C.current;C.current=!1,!v&&I&&T(Number(u))},onChange:I=>{const F=I.currentTarget.value;F===""?g(!0):(g(!1),N(Number(F)),V.cancel(),C.current=!0,q(Number(F)))},..._}),b&&e("div",{className:o(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",i]]),children:e(we,{children:e("button",{type:"button",className:o(["dropin-incrementer__increase-button",["dropin-incrementer__increase-button--disabled",i]]),onMouseDown:I=>I.preventDefault(),onClick:()=>{g(!1),q.cancel(),C.current=!1,N(u+1),V(u+1)},disabled:i||u>w-1,"aria-label":e(_e,{id:"Dropin.Incrementer.increaseLabel"}),children:e(j,{source:le,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__add"})})})})]}),E&&e("p",{className:"dropin-incrementer__content--error-message",children:e(_e,{id:x,fields:{minQuantity:s,maxQuantity:c}})})]})},Le=({name:t,value:r,variant:n="primary",className:i,disabled:l,error:a,floatingLabel:s,onValue:c,onUpdateError:d,size:p="medium",icon:m,maxLength:b,success:_,...u})=>{const N=(u==null?void 0:u.id)||t||`dropin-input-${Math.random().toString(36)}`,v=O({errorIconAriaLabel:"Dropin.Input.errorIconAriaLabel",successIconAriaLabel:"Dropin.Input.successIconAriaLabel"}),g=B(me(async h=>{if(c)try{await c(h)}catch(w){d&&d(w)}},200),[c,d]),f=h=>{const w=h.target;g(w.value.trim())};return e("div",{className:o(["dropin-input-container",`dropin-input-container--${n}`,["dropin-input-container--floating",!!s],["dropin-input-container--disabled",l]]),children:[m&&e(S,{node:m,className:o(["dropin-input__field-icon--left",m.props.className])}),e("div",{className:"dropin-input-label-container",children:[e("input",{id:N,onChange:f,type:"text",maxLength:b,name:t,value:r,...u,className:o(["dropin-input",`dropin-input--${p}`,`dropin-input--${n}`,["dropin-input--error",!!a],["dropin-input--success",!!_],["dropin-input--disabled",l],["dropin-input--floating",!!s],["dropin-input--icon-left",!!m],i]),disabled:l}),s&&e("label",{htmlFor:N,className:o([["dropin-input__label--floating",!!s],["dropin-input__label--floating--icon-left",!!m],["dropin-input__label--floating--error",!!a]]),children:s})]}),a&&e("div",{className:o(["dropin-input__field-icon--right","dropin-input__field-icon--error"]),children:e(j,{source:qe,size:"16",stroke:"2",className:"dropin-input--warning-icon",viewBox:"-1 -1 26 26",role:"img","aria-label":v.errorIconAriaLabel})}),_&&e("div",{className:o(["dropin-input__field-icon--right","dropin-input__field-icon--success"]),children:e(j,{source:Ke,size:"16",stroke:"2",className:"dropin-input--success-icon",viewBox:"-1 -1 26 26",role:"img","aria-label":v.successIconAriaLabel})})]})},At=({name:t="",error:r,value:n,label:i,onChange:l,onBlur:a,...s})=>{const[c,d]=G(n??""),[p,m]=G(!1),b=H(null),_=O({picker:"Dropin.InputDate.picker"}),u=B(()=>{var f;m(!0),ye()&&((f=b.current)==null||f.focus())},[]),N=B(f=>{var w;const h=(w=f.currentTarget.parentElement)==null?void 0:w.querySelector("input");h==null||h.focus(),h==null||h.showPicker()},[]),v=B(f=>{m(!1),a==null||a(f)},[a]),g=B(f=>{d(f.target.value),l==null||l(f)},[l]);return e("div",{className:o(["dropin-input-date"]),children:[ye()?e("input",{ref:b,"data-testid":"inputDateIos",className:"dropin-input-date__input--ios",type:"date",onChange:g}):null,e(Te,{error:r,children:e(Le,{"data-testid":"input-date",error:!!r,name:t,value:p?c:Xe(c),type:p?"date":"text",placeholder:i,floatingLabel:i,onFocus:u,onBlur:v,onChange:g,className:"dropin-input-date__input",...s})}),e("button",{type:"button","data-testid":"dropin-input-date__icon",className:"dropin-input-date__icon","aria-label":_.picker,onClick:N,children:e(j,{source:Ue,size:"24"})})]})},nt=({minLength:t=0,requiredCharacterClasses:r=0,uniqueSymbolsStatus:n="pending",validateLengthConfig:i={status:"",icon:"",message:""}})=>{const l=O({chartTwoSymbols:"Dropin.PasswordStatusIndicator.chartTwoSymbols",chartThreeSymbols:"Dropin.PasswordStatusIndicator.chartThreeSymbols",chartFourSymbols:"Dropin.PasswordStatusIndicator.chartFourSymbols",iconPendingAlt:"Dropin.PasswordStatusIndicator.iconPendingAlt",iconSuccessAlt:"Dropin.PasswordStatusIndicator.iconSuccessAlt",iconErrorAlt:"Dropin.PasswordStatusIndicator.iconErrorAlt"}),a=Q(()=>({pending:e(de,{role:"img","aria-label":l.iconPendingAlt}),success:e(be,{role:"img","aria-label":l.iconSuccessAlt}),error:e(ae,{style:{fill:"red"},role:"img","aria-label":l.iconErrorAlt})}),[l.iconPendingAlt,l.iconSuccessAlt,l.iconErrorAlt]),s=c=>{switch(c){case 2:return l.chartTwoSymbols;case 3:return l.chartThreeSymbols;case 4:return l.chartFourSymbols;default:return""}};return e("div",{className:o(["dropin-password-status-indicator"]),children:[t>0?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${i.status}`,"data-testid":`dropin-password-status-indicator__item--${i.icon}`,children:[a[i.icon],e("span",{className:`${i.status}`,children:i.message})]}):null,r>=2?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${n}`,"data-testid":`dropin-password-status-indicator__item--${n}`,children:[a[n],e("span",{className:"pending",children:s(r)})]}):null]})},Tt=({placeholder:t,floatingLabel:r,children:n,name:i,required:l,className:a,minLength:s,autoComplete:c,defaultValue:d="",hideStatusIndicator:p=!1,uniqueSymbolsStatus:m,validateLengthConfig:b,requiredCharacterClasses:_,errorMessage:u,onValue:N,onBlur:v,...g})=>{const f=O({placeholder:"Dropin.InputPassword.placeholder",floatingLabel:"Dropin.InputPassword.floatingLabel",buttonShowTitle:"Dropin.InputPassword.buttonShowTitle",buttonHideTitle:"Dropin.InputPassword.buttonHideTitle"}),[h,w]=G(!1),E=B(()=>{w($=>!$)},[]),x=h?f.buttonHideTitle:f.buttonShowTitle;return e("div",{"data-testid":"passwordFieldInput",className:o(["dropin-input-password",["dropin-input-password--error",u],a]),...g,children:[e(Te,{error:u,children:e(Le,{autoComplete:c,name:i??"password",type:h?"text":"password",placeholder:t||f.placeholder,floatingLabel:r||f.floatingLabel,"aria-label":f.placeholder,"aria-required":l||!0,"aria-invalid":!!u,"aria-describedby":"password-feedback",required:l||!1,value:d,onValue:N,icon:e(Ge,{}),onBlur:v,"data-testid":"passwordInput"})}),e(Z,{"aria-label":x,title:x,type:"button","data-testid":"toggle-password-icon",variant:"tertiary",className:o(["dropin-input-password__eye-icon",`dropin-input-password__eye-icon--${h?"show":"hide"}`,a]),onClick:E,children:e(j,{focusable:"false","aria-hidden":h,source:h?ze:je})}),p?null:e(nt,{minLength:s,requiredCharacterClasses:_,validateLengthConfig:b,uniqueSymbolsStatus:m}),n]})},Rt=({disabled:t,name:r="",errorMessage:n,value:i,label:l,className:a,onChange:s,onBlur:c,...d})=>{const p=H(null),m=he(),b=!!(n!=null&&n.length);return M(()=>{const _=p.current;_&&(_.style.height="auto",_.style.height=`${_.scrollHeight}px`)},[i]),e("div",{className:o(["dropin-textarea-container",a]),"data-testid":"dropin-textarea-container",children:[e("textarea",{ref:p,"data-testid":"dropin-textarea-field",className:o(["dropin-textarea",["dropin-textarea--error",b],["dropin-textarea--disabled",!!t]]),id:m,placeholder:l,name:r,value:i,disabled:t,onBlur:c,onChange:s,...d}),e("label",{htmlFor:m,className:o(["dropin-textarea__label--floating",["dropin-textarea__label--floating--error",b]]),children:l}),b?e("div",{className:o(["dropin-textarea__label--floating--text",["dropin-textarea__label--floating--error",b]]),children:n}):null]})},Ae=({variant:t="primary",className:r})=>e("hr",{role:"separator",className:o(["dropin-divider",`dropin-divider--${t}`,r])}),te=({amount:t=0,currency:r,locale:n,variant:i="default",weight:l="bold",className:a,children:s,sale:c=!1,formatOptions:d={},size:p="small",...m})=>{const b=Q(()=>Ye({currency:r,locale:n,formatOptions:d}).format(t),[t,r,n,d]);return e("span",{...m,className:o(["dropin-price",`dropin-price--${i}`,`dropin-price--${p}`,`dropin-price--${l}`,["dropin-price--sale",c],a]),children:b})},it=({name:t,label:r,value:n,size:i="medium",checked:l=!1,disabled:a=!1,error:s=!1,description:c="",busy:d=!1,icon:p,className:m,children:b,..._})=>{var u;return e("label",{className:o([m,"dropin-radio-button",["dropin-radio-button--error",s],["dropin-radio-button--disabled",a]]),children:[e("input",{name:t,value:n,checked:l,disabled:a,type:"radio",className:o(["dropin-radio-button__input",["dropin-radio-button__input--error",s],["dropin-radio-button__input--disabled",a]]),"aria-busy":d,..._}),e("span",{className:o(["dropin-radio-button__label",`dropin-radio-button__label--${i}`,["dropin-radio-button__label--error",s],["dropin-radio-button__label--disabled",a]]),children:[p&&e(p.type,{...p==null?void 0:p.props,className:o(["dropin-radio-button__icon",(u=p==null?void 0:p.props)==null?void 0:u.className])}),r]}),e("span",{className:o(["dropin-radio-button__description",`dropin-radio-button__description--${i}`,["dropin-radio-button__description--disabled",a]]),children:c})]})},Z=({value:t,variant:r="primary",size:n="medium",icon:i,className:l,children:a,disabled:s=!1,active:c=!1,activeChildren:d,activeIcon:p,href:m,...b})=>{let _="dropin-button";(i&&!a||i&&c&&!d||!i&&c&&p)&&(_="dropin-iconButton"),c&&d&&(_="dropin-button"),l=o([_,`${_}--${n}`,`${_}--${r}`,[`${_}--${r}--disabled`,s],a&&i&&`${_}--with-icon`,!a&&d&&i&&`${_}--with-icon`,c&&p&&`${_}--with-icon`,l]);const u=o(["dropin-button-icon",`dropin-button-icon--${r}`,[`dropin-button-icon--${r}--disabled`,s],i==null?void 0:i.props.className]),N=m?{node:e("a",{}),role:"link",href:m,...b,disabled:s,active:c,onKeyDown:v=>{s&&v.preventDefault()},tabIndex:s?-1:0}:{node:e("button",{}),role:"button",...b,value:t,disabled:s,active:c};return e(S,{...N,className:l,children:[i&&!c&&e(S,{node:i,className:u}),p&&c&&e(S,{node:p,className:u}),a&&!c&&(typeof a=="string"?e("span",{children:a}):a),c&&d&&(typeof d=="string"?e("span",{children:d}):d)]})};function $e(t,r,n,i,l,a){return t||(r?r.value:a?a.value:n||i?"":l?l.value:null)}const at=({name:t,value:r=null,options:n,variant:i="primary",floatingLabel:l,size:a="medium",handleSelect:s=()=>{},disabled:c=!1,disableWhenSingle:d=!0,error:p=!1,placeholder:m,defaultOption:b,icon:_,className:u,id:N,...v})=>{var F;const g=N??t??`dropin-picker-${Math.random().toString(36)}`,f=!!(v!=null&&v.required),h=c||d&&(n==null?void 0:n.length)===1,w=H(null),E=t??l??m,x=n==null?void 0:n.find(K=>!K.disabled),$=!c&&d&&(n==null?void 0:n.length)===1&&!((F=n[0])!=null&&F.disabled)?n[0]:void 0,[L,T]=G(()=>$e(r,b,m,l,x,$));M(()=>{T($e(r,b,m,l,x,$))},[r,b,m,l,x,$]),M(()=>{if(!$||r===$.value)return;const K=w.current;K&&(K.value=$.value,K.dispatchEvent(new Event("change",{bubbles:!0})))},[$==null?void 0:$.value,r]);const V=K=>{const{options:z,value:P}=K.target;for(const re of z)re.selected&&(T(P),s(K))},C=n==null?void 0:n.map(K=>{const{value:z,text:P,disabled:re}=K;return e("option",{value:z,selected:z===L,disabled:re,className:o(["dropin-picker__option"]),children:P},z)}),q=!!L,I=()=>(!f||!q)&&(l||m);return e("div",{className:o([u,"dropin-picker",`dropin-picker__${a}`,["dropin-picker__floating",!!l],["dropin-picker__selected",q],["dropin-picker__error",p],["dropin-picker__disabled",h],["dropin-picker__icon",_]]),children:[_&&e(_.type,{..._.props,className:"dropin-picker__icon--placeholder"}),e("select",{ref:w,id:g,className:o(["dropin-picker__select",`dropin-picker__select--${i}`,`dropin-picker__select--${a}`,["dropin-picker__select--floating",!!l]]),name:t,"aria-label":E,disabled:h,onChange:V,...v,children:[I()&&e("option",{selected:!q,value:"",className:o(["dropin-picker__option dropin-picker__placeholder"]),children:l??m},r),C]}),e(j,{source:se,size:"24",stroke:"2",className:"dropin-picker__chevronDown"}),l&&q&&e("label",{htmlFor:g,className:o(["dropin-picker__floatingLabel",!!l]),children:l})]})},Te=({className:t,label:r,error:n,hint:i,success:l,size:a="medium",disabled:s=!1,children:c,...d})=>{var _;const p=((_=c==null?void 0:c.props)==null?void 0:_.id)??`dropin-field-${Math.random().toString(36)}`,m=`${p}-description`;let b=null;return c&&typeof c!="string"&&(b=e(S,{node:c,id:p,disabled:s,size:a,error:!!n,success:!!l&&!n,"aria-describedby":n?m:void 0},c.key)),e("div",{...d,className:o(["dropin-field",t]),children:[r&&e("label",{className:o(["dropin-field__label",["dropin-field__label--disabled",s],`dropin-field__label--${a}`]),htmlFor:p,children:r}),e("div",{className:o(["dropin-field__content"]),children:b}),e("div",{id:m,role:"status","aria-live":"polite",className:o(["dropin-field__hint",[`dropin-field__hint--${a}`,a],["dropin-field__hint--error",!!n],["dropin-field__hint--success",!!l&&!n],["dropin-field__hint--disabled",!!s]]),children:n||l||i})]})},Ot=({icon:t,className:r,children:n,active:i=!1,disabled:l=!1,...a})=>e("button",{role:"button",disabled:l,...a,className:o(["dropin-action-button",["dropin-action-button--active",i],["dropin-action-button--disabled",l],r]),children:[t&&e(S,{node:t,className:o(["dropin-action-button-icon"])}),n&&(typeof n=="string"?e("span",{children:n}):n)]}),Ct=({className:t,variant:r="primary",activeOption:n,disabled:i=!1,dividers:l=!0,children:a,handleSelect:s,...c})=>{const[d,p]=G(n),m=B(_=>{i||_.props.disabled||(p(_.props.value),s&&s(_.props.value))},[s,p,i]),b=xe.map(a,_=>{const u=i||_.props.disabled,N=_.props.value===d;return Me(_,{disabled:u,active:N,onClick:()=>m(_),className:o(["dropin-action-button-group__option",`dropin-action-button-group__option--${r}`,["dropin-action-button-group__option--active",N],["dropin-action-button-group__option--with-dividers",l]])})});return e("div",{role:"group",...c,className:o(["dropin-action-button-group",`dropin-action-button-group--${r}`,t]),children:b})},ot=({variant:t="primary",className:r,children:n,...i})=>e("div",{...i,className:o(["dropin-card",`dropin-card--${t}`,r]),children:e("div",{class:"dropin-card__content",children:n})}),Vt=({name:t,value:r,size:n="medium",disabled:i=!1,error:l=!1,label:a="",description:s="",className:c,checked:d,...p})=>{const[m,b]=G(d===void 0?!1:d),_=H(null),u=v=>{var g;(g=p.onChange)==null||g.call(p,v),b(v.currentTarget.checked)},N=v=>{var g;v.key===" "&&(v.preventDefault(),(g=_==null?void 0:_.current)==null||g.click())};return M(()=>{typeof d=="boolean"&&b(d)},[d]),e("label",{className:o(["dropin-checkbox",["dropin-checkbox--disabled",i]]),children:[e("input",{ref:_,name:t,value:r,type:"checkbox",disabled:i,className:o(["dropin-checkbox__checkbox",["dropin-checkbox__checkbox--error",l],c]),...p,onChange:u,checked:m}),e("div",{className:"dropin-checkbox__checkbox-icon",children:["",e("span",{"aria-checked":m?"true":"false","aria-labelledby":`${t}-label`,"aria-describedby":s?`${t}-description`:void 0,className:o(["dropin-checkbox__box",["dropin-checkbox__box--error",l],["dropin-checkbox__box--disabled",i]]),role:"checkbox",tabIndex:i?-1:0,onKeyDown:N,children:e(j,{className:o(["dropin-checkbox__checkmark"]),source:be,size:"16",stroke:"3"})})]}),e("div",{id:`${t}-label`,className:o(["dropin-checkbox__label",`dropin-checkbox__label--${n}`,["dropin-checkbox__label--disabled",i]]),children:a}),e("div",{}),s&&e("div",{id:`${t}-description`,role:"note",className:o(["dropin-checkbox__description",`dropin-checkbox__description--${n}`,["dropin-checkbox__description--disabled",i]]),children:s})]})},Pt=({className:t,name:r,value:n,id:i,label:l,groupAriaLabel:a,size:s="medium",color:c,disabled:d=!1,selected:p=!1,outOfStock:m=!1,multi:b=!1,onValue:_,onUpdateError:u,...N})=>{const v=O("Dropin.Swatches.outOfStock.label").label,g=O("Dropin.Swatches.selected.label").label,f=O("Dropin.Swatches.swatch.label").label,h=B(async T=>{if(_)try{await _(T)}catch(V){u&&u(V)}},[_,u]),w=T=>{const V=T.target;h(V.value)},$=c&&(T=>{const V=new Option().style;return V.color=T,V.color!==""})(c)?c:"var(--color-gray-300);",L=()=>m?`${a}: ${l} ${v}`:p?`${a}: ${l} ${g}`:`${a}: ${l} ${f}`;return e("label",{className:o(["dropin-color-swatch__container",`dropin-color-swatch__container--${s}`,t]),children:[e("input",{type:b?"checkbox":"radio",name:r,id:i,value:n,"aria-label":L(),checked:p,disabled:d,onChange:w,...N,className:o(["dropin-color-swatch",["dropin-color-swatch--selected",p],["dropin-color-swatch--disabled",d],t])}),e("span",{style:{"--bg-color":$},className:o(["dropin-color-swatch__span",["dropin-color-swatch__span--out-of-stock",m],t])})]})},Mt=({className:t,name:r,value:n,label:i,groupAriaLabel:l,id:a,disabled:s=!1,selected:c=!1,outOfStock:d=!1,multi:p=!1,onValue:m,onUpdateError:b,..._})=>{const u=O("Dropin.Swatches.outOfStock.label").label,N=O("Dropin.Swatches.selected.label").label,v=O("Dropin.Swatches.swatch.label").label,[g,f]=G(!1),h=H(null),w=B(async L=>{if(m)try{await m(L)}catch(T){b&&b(T)}},[m,b]),E=L=>{const T=L.target;w(T.value)},x=()=>d?`${l}: ${i} ${u}`:c?`${l}: ${i} ${N}`:`${l}: ${i} ${v}`;M(()=>{h.current&&h.current.scrollWidth>h.current.clientWidth&&f(!0)},[i]);const $=Q(()=>a??`${r}_${a}_${Math.random().toString(36)}`,[r,a]);return e("div",{className:"dropin-text-swatch__container",...g?{"data-tooltip":i}:{},children:[e("input",{type:p?"checkbox":"radio",name:r,id:$,value:n,"aria-label":x(),checked:c,disabled:s,onChange:E,..._,className:o(["dropin-text-swatch",["dropin-text-swatch--selected",c],["dropin-text-swatch--disabled",s],t])}),e("label",{htmlFor:$,ref:h,className:o(["dropin-text-swatch__label",["dropin-text-swatch__label--out-of-stock",d],t]),children:i})]})},lt=({ariaLabel:t,size:r="small",stroke:n="4",children:i,className:l,style:a,...s})=>{const c=["dropin-progress-spinner",`dropin-progress-spinner--shape-size-${r}`,`dropin-progress-spinner--shape-stroke-${n}`],d=O({updating:"Dropin.ProgressSpinner.updating.label",updatingChildren:"Dropin.ProgressSpinner.updatingChildren.label"}),p=()=>t||(i?d.updatingChildren:d.updating);return i?e("div",{...s,className:o(["dropin-progress-spinner-provider"]),"aria-live":"polite",role:"status",children:[e("div",{"aria-hidden":!0,children:i}),e("div",{"aria-label":p(),role:"status",className:o(["dropin-progress-spinner-background",l]),style:a}),e("div",{className:o(["dropin-progress-spinner-with-provider",...c]),"aria-hidden":!0})]}):e("div",{...s,className:o([l,...c]),"aria-live":"polite",role:"status","aria-label":p()})},Ft=({className:t,name:r,value:n,id:i,label:l,groupAriaLabel:a,src:s,alt:c,disabled:d=!1,selected:p=!1,outOfStock:m=!1,multi:b=!1,imageNode:_,onValue:u,onUpdateError:N,...v})=>{const g=O("Dropin.Swatches.outOfStock.label").label,f=O("Dropin.Swatches.selected.label").label,h=O("Dropin.Swatches.swatch.label").label,w=B(async L=>{if(u)try{await u(L)}catch(T){N&&N(T)}},[u,N]),E=L=>{const T=L.target;w(T.value)},x=()=>m?`${a}: ${l} ${g}`:p?`${a}: ${l} ${f}`:`${a}: ${l} ${h}`,$=Q(()=>({src:s,alt:c,loading:"lazy",params:{width:100,fit:"bounds",crop:!0},onError:L=>L.target.style.display="none"}),[s,c]);return e("label",{className:o(["dropin-image-swatch__container",t]),children:[e("input",{type:b?"checkbox":"radio",name:r,id:i,value:n,"aria-label":x(),checked:p,disabled:d,onChange:E,...v,className:o(["dropin-image-swatch",["dropin-image-swatch--selected",p],["dropin-image-swatch--disabled",d],t])}),e("span",{className:o(["dropin-image-swatch__span",["dropin-image-swatch__span--out-of-stock",m],t]),children:typeof _=="function"?_({...$,imageSwatchContext:{disabled:d,outOfStock:m,selected:p,value:n,label:l,groupAriaLabel:a,name:r,id:i}}):_||e(We,{...$,className:o(["dropin-image-swatch__content"])})})]})},st=({className:t,children:r,title:n,ariaLabelTitle:i,secondaryText:l,actionIconPosition:a="left",iconOpen:s=le,iconClose:c=de,iconLeft:d=le,showIconLeft:p=!1,renderContentWhenClosed:m=!0,defaultOpen:b,onStateChange:_,...u})=>{const[N,v]=G(!1),g=x=>{x.stopImmediatePropagation();const $=!N;v($),_==null||_($)};M(()=>{typeof b<"u"&&v(b)},[b]);const f=O(`Dropin.Accordion.${N?"close":"open"}.label`).label,h=e(j,{source:s,size:"24",onClick:g,onKeyPress:g,className:"dropin-accordion-section__open-icon"}),w=e(j,{source:c,size:"24",onClick:g,onKeyPress:g,className:"dropin-accordion-section__close-icon"}),E=e(j,{source:d,size:"24"});return e("div",{...u,className:o(["dropin-accordion-section",t]),children:[e("div",{className:"dropin-accordion-section__heading",children:[e("div",{className:"dropin-accordion-section__flex",onClick:g,onKeyPress:g,role:"button","aria-label":`${f} ${i??n}`,tabIndex:0,children:e("div",{className:"dropin-accordion-section__title-container",children:[a==="left"&&(N?w:h),p&&E,e("h3",{className:"dropin-accordion-section__title",children:n})]})}),e("div",{className:"dropin-accordion-section__secondary-text-container",children:[l&&e("h4",{className:"dropin-accordion-section__secondary-text",children:l}),a==="right"&&(N?w:h)]})]}),e("div",{className:"dropin-accordion-section__content-container",style:{display:N?"grid":"none"},children:(N||m&&!N)&&r})]})},Bt=({className:t,children:r,actionIconPosition:n="left",iconOpen:i=le,iconClose:l=de,...a})=>{const s=e(Ae,{variant:"secondary"}),c=d=>e(ee,{children:[e(st,{...d.props,actionIconPosition:n,iconOpen:i,iconClose:l}),s]});return e("div",{...a,className:o(["dropin-accordion",t]),children:[s,...(Array.isArray(r)?r:[r]).map(c)]})},Wt=({variant:t="primary",className:r,type:n="warning",additionalActions:i,onDismiss:l,heading:a,description:s,icon:c,itemList:d,actionButtonPosition:p,...m})=>{var _,u,N,v;const b=O({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...m,role:n==="error"?"alert":"status","aria-live":n==="error"?"assertive":"polite",className:o(["dropin-in-line-alert",`dropin-in-line-alert--${n}`,`dropin-in-line-alert--${t}`,r]),children:[e("div",{className:"dropin-in-line-alert__heading",children:[e("div",{className:"dropin-in-line-alert__title-container",children:[c&&e(S,{node:c,className:"dropin-in-line-alert__icon"}),e("span",{className:"dropin-in-line-alert__title",children:a})]}),e("div",{className:"dropin-in-line-alert__actions-container",children:[i&&(p==="top"||!p&&i.length<=1)&&e(Z,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:i.length>0?(_=i[0])==null?void 0:_.onClick:void 0,"aria-label":((u=i[0])==null?void 0:u["aria-label"])??((N=i[0])==null?void 0:N.label),children:(v=i[0])==null?void 0:v.label}),l&&e(Z,{icon:e(j,{source:ae,size:"24",stroke:"2"}),className:"dropin-in-line-alert__dismiss-button",variant:"tertiary",onClick:l,"aria-label":b.dismiss})]})]}),s&&e("p",{className:"dropin-in-line-alert__description",children:s}),e("div",{className:"dropin-in-line-alert__item-list-container",children:d&&e(S,{node:d,className:o(["dropin-in-line-alert__item-list"])})}),i&&(p==="bottom"||!p&&i.length>1)&&e("div",{className:"dropin-in-line-alert__additional-actions-container",children:i.map(g=>e(Z,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:g.onClick,"aria-label":g["aria-label"]??g.label,children:g.label},g.label))})]})},ct=({children:t})=>{const r=H(null),n=H(null);return Fe(()=>(r.current||(r.current=document.createElement("div"),r.current.setAttribute("data-portal-root",""),document.body.appendChild(r.current)),n.current&&r.current&&r.current.appendChild(n.current),()=>{r.current&&(r.current.remove(),r.current=null)}),[]),e("div",{ref:n,className:"dropin-design",children:t})},Ee='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])',Ht=({size:t="small",title:r=null,centered:n=!1,backgroundDim:i=!0,clickToDismiss:l=!0,escapeToDismiss:a=!0,onClose:s,showCloseButton:c=!0,className:d,children:p=null,...m})=>{const b=he(),_=H(null),u=H(null),N=B(()=>{s==null||s()},[s]),v=O({modalCloseLabel:"Dropin.Modal.Close.label"});return M(()=>{const g=f=>{const h=document.querySelector(".dropin-modal"),w=document.querySelector(".dropin-modal__body");l&&h&&w&&!w.contains(f.target)&&N()};return document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[N,l]),M(()=>{const g=f=>{f.key==="Escape"&&a&&N()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[N,a]),M(()=>{const g=document.scrollingElement,f=g.style.overflow;return g.style.overflow="hidden",()=>{g.style.overflow=f}},[]),M(()=>{u.current=document.activeElement;const g=_.current,[f]=g.querySelectorAll(Ee);return(f??g).focus(),()=>{var h;(h=u.current)==null||h.focus()}},[]),M(()=>{const g=_.current,f=h=>{if(h.key!=="Tab")return;const w=g.querySelectorAll(Ee),E=w[0],x=w[w.length-1];!E||!x||(h.shiftKey&&document.activeElement===E?(h.preventDefault(),x.focus()):!h.shiftKey&&document.activeElement===x&&(h.preventDefault(),E.focus()))};return g.addEventListener("keydown",f),()=>{g.removeEventListener("keydown",f)}},[]),e(ct,{children:e("div",{className:o(["dropin-modal",["dropin-modal--dim",i]]),children:e("div",{role:"dialog","aria-modal":"true","aria-labelledby":r?b:void 0,tabIndex:-1,...m,ref:_,className:o(["dropin-modal__body",[`dropin-modal__body--${t}`,t],d]),children:[e("div",{className:o(["dropin-modal__header",["dropin-modal__header-title",!!r]]),children:[r&&e("div",{id:b,className:o(["dropin-modal__header-title-content"]),children:r}),c&&e(Z,{"aria-label":v.modalCloseLabel,variant:"tertiary",className:"dropin-modal__header-close-button",onClick:N,icon:e(ae,{})})]}),e("div",{className:o(["dropin-modal__content",["dropin-modal__body--centered",n]]),children:p})]})})})},qt=({className:t,children:r,ariaLabel:n,image:i,title:l,price:a,rowTotalFooter:s,taxIncluded:c=!1,taxExcluded:d=!1,total:p,totalExcludingTax:m,sku:b,configurations:_,warning:u,alert:N,discount:v,savings:g,actions:f,removeContent:h,quantity:w,quantityContent:E,description:x,attributes:$,footer:L,loading:T=!1,updating:V=!1,quantityType:C,dropdownOptions:q,onQuantity:I,onRemove:F,...K})=>{var ie,oe;const{locale:z}=Be(He),P=O({each:"Dropin.CartItem.each.label",pricePerItem:"Dropin.CartItem.pricePerItem.label",quantity:"Dropin.CartItem.quantity.label",remove:"Dropin.CartItem.remove.label",removeDefault:"Dropin.CartItem.removeDefault.label",taxIncluded:"Dropin.CartItem.taxIncluded.label",taxExcluded:"Dropin.CartItem.taxExcluded.label",updating:"Dropin.CartItem.updating.label",updatingDefault:"Dropin.ProgressSpinner.updating.label"});if(T)return e(dt,{});const re=C==="dropdown"?e(at,{className:o(["dropin-cart-item__quantity__picker"]),value:String(w),name:"quantity","aria-label":P.quantity,disabled:V,variant:"primary",options:q,handleSelect:X=>I==null?void 0:I(Number(X.target.value))}):e(rt,{className:o(["dropin-cart-item__quantity__incrementer"]),value:w,min:1,onValue:X=>I==null?void 0:I(Number(X)),name:"quantity","aria-label":P.quantity,disabled:V});return e("div",{...K,className:o(["dropin-cart-item",["dropin-cart-item--updating",V],t]),children:[V&&e(lt,{className:o(["dropin-cart-item__spinner"]),ariaLabel:n?(ie=P.updating)==null?void 0:ie.replace("{product}",n):P.updatingDefault}),e("div",{className:"dropin-cart-item__wrapper",children:[i&&e(S,{node:i,className:o(["dropin-cart-item__image"])}),l&&e(S,{node:l,className:o(["dropin-cart-item__title",["dropin-cart-item__title--edit",!!I||!!F]])}),x&&e(S,{node:x,className:o(["dropin-cart-item__description"])}),b&&e(S,{node:b,className:o(["dropin-cart-item__sku"])}),e("div",{className:o(["dropin-cart-item__savings__wrapper"]),children:[v&&e(S,{node:v,className:o(["dropin-cart-item__discount","dropin-cart-item__discount__large-screen"])}),g&&e(S,{node:g,className:o(["dropin-cart-item__savings","dropin-cart-item__savings__large-screen"])})]}),$&&e("div",{className:o(["dropin-cart-item__attributes"]),children:e(S,{node:$})}),_&&e("ul",{className:o(["dropin-cart-item__configurations"]),children:Object.entries(_).map(([X,ne])=>e("li",{className:o(["dropin-cart-item__configurations__item"]),children:[X,":"," ",e("strong",{className:o(["dropin-cart-item__configurations__item__value"]),children:ne})]},X))}),a&&e("span",{className:o(["dropin-cart-item__price"]),"aria-label":P.pricePerItem,children:[w&&!I&&e(ee,{children:[e("span",{className:"dropin-cart-item__price__quantity","aria-hidden":!0,children:[w.toLocaleString(z)," x"," "]}),e("div",{className:"dropin-cart-item__sr-only",children:[P.quantity,": ",w==null?void 0:w.toLocaleString(z),";"]})]}),e(S,{node:a,role:"text"}),w&&w>1&&e(ee,{children:[" ",P.each]}),c&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",P.taxIncluded]}),d&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",P.taxExcluded]})]}),e("div",{className:o(["dropin-cart-item__quantity",["dropin-cart-item__quantity--edit",!!I]]),children:[E?e(S,{node:E}):I?re:w&&e("span",{className:o(["dropin-cart-item__quantity__value"]),children:[P.quantity,":"," ",e("strong",{className:"dropin-cart-item__quantity__number",children:Number(w).toLocaleString(z)})]}),u&&e(S,{node:u,className:o(["dropin-cart-item__warning","dropin-cart-item__warning--quantity"])}),N&&e(S,{node:N,className:o(["dropin-cart-item__alert","dropin-cart-item__alert--quantity"])})]}),f&&e("div",{className:o(["dropin-cart-item__actions"]),children:e(S,{node:f,className:o(["dropin-cart-item__buttons"])})}),u&&e(S,{node:u,className:o(["dropin-cart-item__warning"])}),N&&e(S,{node:N,className:o(["dropin-cart-item__alert"])}),e("div",{className:o(["dropin-cart-item__total",["dropin-cart-item__total--edit",!!F]]),children:[e("div",{className:"dropin-cart-item__row-total__wrapper",children:[p&&e("div",{className:"dropin-cart-item__row-total",children:e(S,{node:p,role:"text"})}),c&&e("div",{className:"dropin-cart-item__total-tax-included",children:e("span",{"data-testid":"tax-message",className:o(["dropin-cart-item__total-tax-message"]),children:P.taxIncluded})})]}),d&&e("div",{className:"dropin-cart-item__total-tax-excluded",children:e("span",{"data-testid":"tax-message",className:o(["dropin-cart-item__total-tax-excluded-message"]),children:[m&&e(S,{node:m,role:"text"})," ",P.taxExcluded]})}),v&&e(S,{node:v,className:o(["dropin-cart-item__discount"])}),g&&e(S,{node:g,className:o(["dropin-cart-item__savings"])}),s&&e(S,{node:s,className:o(["dropin-cart-item__row-total-footer"])})]}),L&&e(S,{node:L,className:o(["dropin-cart-item__footer"])})]}),h?e(S,{node:h}):F?e(Z,{"data-testid":"cart-item-remove-button",className:o(["dropin-cart-item__remove"]),variant:"tertiary",onClick:()=>F==null?void 0:F(),icon:e(j,{"data-testid":"cart-item-remove-icon",source:Je,size:"24",stroke:"2",viewBox:"0 0 24 24","aria-label":n?(oe=P.remove)==null?void 0:oe.replace("{product}",n):P.removeDefault}),disabled:V}):null]})},dt=()=>e("div",{className:"dropin-cart-item dropin-cart-item-skeleton",children:e(ce,{className:"dropin-cart-item__skeleton dropin-cart-item__wrapper",children:[e("div",{className:"dropin-cart-item__image",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__title",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__sku",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__price",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__quantity",children:e(Y,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__total",children:e(Y,{className:"dropin-cart-item__skeleton__item"})})]})}),Kt=({className:t,children:r,...n})=>e("div",{...n,className:o(["dropin-cart-list",t]),children:e("div",{className:"dropin-cart-list__wrapper","aria-live":"assertive","aria-relevant":"all",children:xe.map(r,(i,l)=>e("div",{className:"dropin-cart-list__item",children:i},l))})}),Ut=({className:t,children:r,locale:n,currency:i,amount:l,variant:a="default",minimumAmount:s,maximumAmount:c,size:d="small",display:p="dash",specialPrice:m,sale:b=!1,..._})=>{const u=Q(()=>l||s===c||s&&!c||c&&!s,[l,c,s]);return e("div",{children:u?e("div",{..._,className:o(["dropin-price-range",t]),children:e(te,{amount:l??s??c,currency:i,locale:n,size:d,variant:a,sale:b})}):e("div",{..._,className:o(["dropin-price-range",t]),children:[p==="dash"?e(pt,{specialPrice:m,minimumAmount:s,maximumAmount:c,currency:i,locale:n,size:d,sale:b}):null,p==="from to"?e(_t,{specialPrice:m,minimumAmount:s,maximumAmount:c,currency:i,locale:n,size:d,sale:b}):null,p==="as low as"?e(ut,{specialPrice:m,minimumAmount:s,maximumAmount:c,currency:i,locale:n,size:d,sale:b}):null]})})};function pt({specialPrice:t,minimumAmount:r,maximumAmount:n,currency:i,locale:l,size:a,sale:s}){return e(ee,{children:[e(te,{amount:t??r,currency:i,locale:l,size:a,sale:!!t&&s}),e("span",{className:"dropin-price-range__separator",children:"-"}),e(te,{amount:n,currency:i,locale:l,size:a})]})}function _t({specialPrice:t,minimumAmount:r,maximumAmount:n,currency:i,locale:l,size:a,sale:s}){const c=O({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(ee,{children:[e("span",{className:o(["dropin-price-range__from",`dropin-price-range__from--${a}`]),children:c.from}),e(te,{amount:t??r,currency:i,locale:l,size:a,sale:!!t&&s}),e("span",{className:o(["dropin-price-range__to",`dropin-price-range__to--${a}`]),children:c.to}),e(te,{amount:n,currency:i,locale:l,size:a})]})}function ut({specialPrice:t,minimumAmount:r,maximumAmount:n,currency:i,locale:l,size:a,sale:s}){const c=O({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(ee,{children:[e("span",{className:o(["dropin-price-range__as-low-as",`dropin-price-range__as-low-as--${a}`]),children:c.asLowAs}),t?e("div",{children:[e(te,{amount:n,currency:i,locale:l,size:a,variant:"strikethrough"}),e(te,{amount:t,currency:i,locale:l,size:a,className:"dropin-price-range__special",sale:!!t&&s})]}):e(te,{amount:r,currency:i,locale:l,size:a})]})}const Gt=({className:t,categories:r,separator:n,...i})=>e(ee,{children:(r==null?void 0:r.length)>1&&e("nav",{role:"navigation",...i,className:o(["dropin-breadcrumbs__container",t]),children:e("ul",{className:"dropin-breadcrumbs__items",children:r==null?void 0:r.map((l,a)=>e("li",{className:o(["dropin-breadcrumbs__item",["dropin-breadcrumbs__item--last",a===r.length-1]]),children:[e(S,{node:l,className:"dropin-breadcrumbs__link"}),!n&&a!==r.length-1&&e("span",{className:"dropin-breadcrumbs__separator--default",children:[" ","/"," "]}),n&&a!==r.length-1&&e(S,{node:n,className:"dropin-breadcrumbs__separator--icon"})]},a))})})}),jt=({className:t,variant:r,icon:n,message:i,onDismiss:l,action:a,...s})=>{const c=O({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...s,className:o([t,"dropin-alert-banner",`dropin-alert-banner--${r}`]),children:[e("div",{className:"dropin-alert-banner__content",children:[n&&e(S,{node:n,"aria-hidden":"true",className:"dropin-alert-banner__icon"}),e(S,{node:i,className:o(["dropin-alert-banner__message"])})]}),e("div",{className:"dropin-alert-banner__actions",children:[a&&e(Z,{variant:"tertiary",className:"dropin-alert-banner__action",onClick:a.onClick,"aria-label":a.label,children:a.label}),e(Z,{icon:e(j,{source:ae,size:"24",stroke:"2"}),className:"dropin-alert-banner__dismiss-button",variant:"primary",onClick:l,"aria-label":c.dismiss})]})]})},zt=({className:t,icon:r,heading:n,headingLevel:i=2,message:l,action:a,variant:s="secondary",...c})=>{const d=i>=1&&i<=6?`h${i}`:"h2";return e("div",{...c,className:o(["dropin-illustrated-message",t]),children:e(ot,{variant:s,children:[r&&e(S,{node:r,"aria-hidden":"true",size:"80",className:"dropin-illustrated-message__icon"}),n&&e(d,{className:"dropin-illustrated-message__heading",children:n}),l&&e(S,{node:l,className:"dropin-illustrated-message__message"}),a&&e(S,{node:a,className:"dropin-illustrated-message__action"})]})})},Jt=({label:t,name:r,value:n,ariaLabel:i,busy:l=!1,disabled:a=!1,children:s,className:c,icon:d,onChange:p,selected:m=!0,...b})=>{const _=`dropin-toggle-button__content-${r}-${n}`.replace(/\s+/g,"-");return e("div",{...b,className:o(["dropin-toggle-button",c,["dropin-toggle-button__selected",m],["dropin-toggle-button__disabled",a]]),children:e("label",{className:"dropin-toggle-button__actionButton",children:[e(it,{label:"",name:r,value:n,checked:m,disabled:a,onChange:()=>p&&p(n),"aria-label":i,"aria-labelledby":i?void 0:_,busy:l,className:o([c,"dropin-toggle-button__radioButton"])}),e("span",{className:"dropin-toggle-button__content",id:_,children:[d&&e(d.type,{...d==null?void 0:d.props,className:"dropin-toggle-button__icon"}),t]})]})})},mt=({level:t,className:r,children:n})=>{const i=t&&t>=1&&t<=6?`h${t}`:"span";return e(i,{className:r,children:n})},Xt=({title:t=null,size:r="medium",cta:n,divider:i=!0,className:l,level:a,...s})=>t?e("div",{...s,className:o(["dropin-header-container",l]),"data-testid":"dropin-header-container",children:[e(mt,{className:o(["dropin-header-container__title",["dropin-header-container__title--medium",r==="medium"],["dropin-header-container__title--large",r==="large"]]),level:a,children:t}),n?e(S,{node:n,className:"dropin-header-container__actions"}):null,i?e(Ae,{className:o(["dropin-header-container__divider",["dropin-header-container__divider--medium",r==="medium"],["dropin-header-container__divider--large",r==="large"]])}):null]}):null,ht=({label:t,className:r,children:n,...i})=>!t&&!n?null:e("div",{...i,className:o(["dropin-tag-container",r]),"data-testid":"dropin-tag-container",children:n??e("span",{className:"dropin-tag-container__label",children:t})}),Yt=({className:t,children:r,maxColumns:n,columnWidth:i="1fr",emptyGridContent:l,...a})=>{const s=!!r&&(Array.isArray(r)?r.length>0:!0),c=s?{gridTemplateColumns:`repeat(${n}, ${i})`}:void 0;return e("div",{...a,className:o(["dropin-content-grid",t]),tabindex:0,children:e("div",{"data-testid":"content-grid-content",className:o(["dropin-content-grid__content",["dropin-content-grid__dynamic-columns-content",!n],["dropin-content-grid__content--empty",!s]]),style:c,children:s?r:l})})},ue=t=>{if(t.href){const{href:i,disabled:l,...a}=t;return e("a",{href:i,"aria-disabled":l,...a})}const{type:r="button",...n}=t;return e("button",{type:r,...n})},Zt=({totalPages:t=10,currentPage:r=1,onChange:n,routePage:i,className:l,...a})=>{const s=O({backwardButton:"Dropin.Pagination.backwardButton.ariaLabel",forwardButton:"Dropin.Pagination.forwardButton.ariaLabel"}),c=B(_=>{const u=Math.min(r+1,t);n==null||n(u,_)},[r,n,t]),d=B(_=>{const u=Math.max(r-1,1);n==null||n(u,_)},[r,n]),p=B((_,u)=>{Ze(_)&&(n==null||n(_,u))},[n]),m=B((_,u)=>{const N=[],v=(g,f)=>{for(let h=g;h<=f;h++)N.push({page:h,isActive:h===_,label:h})};return u<=5?v(1,u):_<=2?(v(1,2),N.push({page:"ellipsis",isActive:!1,label:"..."}),v(u-1,u)):_>=u-3?v(u-4,u):(v(_-1,_),N.push({page:"ellipsis",isActive:!1,label:"..."}),v(u-1,u)),N},[]),b=Q(()=>m(r,t),[m,r,t]);return e("div",{...a,className:o(["dropin-pagination",l]),children:[e(ue,{"data-testid":"prev-button","aria-label":s.backwardButton,disabled:r===1,onClick:_=>d(_),href:(i==null?void 0:i(r))??void 0,className:o(["dropin-pagination-arrow","dropin-pagination-arrow--backward",["dropin-pagination-arrow--disabled",r===1]]),children:e(j,{size:"24",source:se})}),e("ul",{className:"dropin-pagination_list",children:b.map((_,u)=>e("li",{"data-testid":`dropin-pagination_list-item--${_.page}`,className:o(["dropin-pagination_list-item",`dropin-pagination_list-item--${_.page}`,["dropin-pagination_list-item--active",_.isActive]]),children:e(ue,{"data-testid":`set-page-button-${_.page}`,onClick:N=>p(_.page,N),href:(i==null?void 0:i(_.page))??void 0,children:_.label})},`${_.page}_${u}`))}),e(ue,{"data-testid":"next-button","aria-label":s.forwardButton,disabled:r===t,onClick:_=>c(_),href:(i==null?void 0:i(r))??void 0,className:o(["dropin-pagination-arrow","dropin-pagination-arrow--forward",["dropin-pagination-arrow--disabled",r===t]]),children:e(j,{size:"24",source:se})})]})},bt=()=>e("div",{className:"dropin-product-item-card dropin-product-item-card-skeleton",children:[e(ce,{className:"dropin-product-item-card__skeleton dropin-product-item-card__image-container",children:e(Y,{fullWidth:!0,className:"dropin-product-item-card__skeleton__image"})}),e(ce,{className:"dropin-product-item-card__content dropin-product-item-card__skeleton__content",children:[e(Y,{fullWidth:!0,size:"xsmall",className:"dropin-product-item-card__skeleton__item"}),e(Y,{fullWidth:!0,size:"xsmall",className:"dropin-product-item-card__skeleton__item"}),e(Y,{fullWidth:!0,size:"xsmall",className:"dropin-product-item-card__skeleton__item"})]})]}),Qt=({className:t,image:r,titleNode:n,price:i,sku:l,actionButton:a,swatches:s,initialized:c=!1,...d})=>c?e("div",{...d,className:o(["dropin-product-item-card",t]),children:[e("div",{className:"dropin-product-item-card__image-container",children:r&&e(S,{node:r,className:o(["dropin-product-item-card__image"])})}),e("div",{className:"dropin-product-item-card__content",children:[n&&e(S,{node:n,className:o(["dropin-product-item-card__title"])}),l&&e(S,{node:l,className:o(["dropin-product-item-card__sku"])}),i&&e("div",{className:"dropin-product-item-card__price",children:e(S,{node:i,className:o(["dropin-product-item-card__price"])})}),s&&e("div",{className:"dropin-product-item-card__swatches",children:e(S,{node:s,className:o(["dropin-product-item-card__swatches"])})}),a&&e("div",{className:"dropin-product-item-card__action",children:e(S,{node:a,className:o(["dropin-product-item-card__action"])})})]})]}):e(bt,{}),er=({accept:t,onChange:r,label:n="Upload Document",icon:i,className:l,multiple:a,id:s,...c})=>{const d=he(),p=s||d,m=b=>{r==null||r(b)};return e("div",{className:o(["dropin-input-file",l]),children:[e("label",{htmlFor:p,className:"dropin-input-file__label",children:[i&&e("span",{className:"dropin-input-file__icon",children:i}),n]}),e("input",{id:p,type:"file",accept:t,multiple:a,onChange:m,className:"dropin-input-file__input",...c})]})},tr=({className:t,children:r,columns:n=[],rowData:i=[],mobileLayout:l="none",caption:a,expandedRows:s=new Set,loading:c=!1,skeletonRowCount:d=10,onSortChange:p,...m})=>{const b=O({sortedAscending:"Dropin.Table.sortedAscending",sortedDescending:"Dropin.Table.sortedDescending",sortBy:"Dropin.Table.sortBy"}),_=f=>{if(!p)return;let h;f.sortBy===!0?h="asc":f.sortBy==="asc"?h="desc":h=!0,p(f.key,h)},u=f=>{if(f.sortBy===void 0)return null;const h=f.ariaLabel??f.label;let w,E;return f.sortBy==="asc"?(w="ChevronUp",E=b.sortedAscending.replace("{label}",h)):f.sortBy==="desc"?(w="ChevronDown",E=b.sortedDescending.replace("{label}",h)):(w="ChevronDown",E=b.sortBy.replace("{label}",h)),e(Z,{variant:"tertiary",size:"medium",className:"dropin-table__header__sort-button",icon:e(j,{source:w}),"aria-label":E,onClick:()=>_(f)})},N=()=>Array.from({length:d},(f,h)=>e("tr",{className:"dropin-table__body__row",children:n.map(w=>e("td",{className:"dropin-table__body__cell","data-label":w.ariaLabel??w.label,children:e(ce,{children:e(Y,{variant:"row",size:"small",fullWidth:!0})})},w.key))},`skeleton-${h}`)),v=()=>i.map((f,h)=>{const w=f._rowDetails!==void 0,E=s.has(h);return e(ee,{children:[e("tr",{className:o(["dropin-table__body__row",["dropin-table__body__row--expanded",E&&w]]),children:n.map(x=>{const $=f[x.key],L=x.ariaLabel??x.label;return typeof $=="string"||typeof $=="number"?e("td",{className:"dropin-table__body__cell","data-label":L,children:$},x.key):e("td",{className:"dropin-table__body__cell","data-label":L,children:e(S,{node:$})},x.key)})}),w&&E&&e("tr",{className:"dropin-table__row-details dropin-table__row-details--expanded",id:`row-${h}-details`,children:e("td",{className:"dropin-table__row-details__cell",colSpan:n.length,role:"region","aria-labelledby":`row-${h}-details`,children:typeof f._rowDetails=="string"?f._rowDetails:e(S,{node:f._rowDetails})})},`${h}-details`)]},h)}),g=f=>{if(f.sortBy===!0)return"none";if(f.sortBy==="asc")return"ascending";if(f.sortBy==="desc")return"descending"};return e("div",{className:o(["dropin-table",`dropin-table--mobile-layout-${l}`,t]),children:e("table",{...m,className:"dropin-table__table",children:[a&&e("caption",{className:"dropin-table__caption",children:a}),e("thead",{className:"dropin-table__header",children:e("tr",{className:"dropin-table__header__row",children:n.map(f=>e("th",{className:o(["dropin-table__header__cell",["dropin-table__header__cell--sorted",f.sortBy==="asc"||f.sortBy==="desc"],["dropin-table__header__cell--sortable",f.sortBy!==void 0]]),"aria-sort":g(f),children:[f.label,u(f)]},f.key))})}),e("tbody",{className:"dropin-table__body",children:c?N():v()})]})})},ft=(t,r)=>t.filter(n=>n.label.toLowerCase().includes(r.toLowerCase())),vt=(t,r)=>t.map(n=>{const i=r.find(l=>l.value===n);return i?i.label:n}),gt=(t,r,n)=>{const i=t||r;return{listboxId:`${i}-listbox`,searchInputId:`${i}-search`,labelId:n?`${i}-label`:void 0,selectedDescriptionId:`${r}-selected-description`}},Nt=()=>{const[t,r]=G(""),n=B(i=>{r(i),setTimeout(()=>r(""),1e3)},[]);return{announcement:t,announce:n}},wt=(t,r,n,i)=>(M(()=>{if(r>=0&&i.current){const a=i.current.querySelectorAll("[data-option-index]");a[r]&&a[r].scrollIntoView({block:"nearest",behavior:"smooth"})}},[r,i]),{navigate:B(a=>{n(s=>{var p,m,b;const c=a==="up"?-1:1;let d=s+c;for(;d>=0&&d<t.length&&((p=t[d])!=null&&p.disabled);)d+=c;if(d>=0&&d<t.length)return d;if(a==="up"){for(let _=t.length-1;_>=0;_--)if(!((m=t[_])!=null&&m.disabled))return _}else for(let _=0;_<t.length;_++)if(!((b=t[_])!=null&&b.disabled))return _;return-1})},[t,n])}),rr=({options:t=[],value:r=[],onChange:n=()=>{},id:i="",className:l="",selectAllText:a="",deselectAllText:s="",placeholder:c="",noResultsText:d="",floatingLabel:p="",name:m="multi-select-sdk",error:b=!1,success:_=!1,disabled:u=!1,maxHeight:N=300})=>{const v=O({selectAll:"Dropin.MultiSelect.selectAll",deselectAll:"Dropin.MultiSelect.deselectAll",placeholder:"Dropin.MultiSelect.placeholder",noResultsText:"Dropin.MultiSelect.noResultsText",removed:"Dropin.MultiSelect.ariaLabel.removed",added:"Dropin.MultiSelect.ariaLabel.added",itemsSelected:"Dropin.MultiSelect.ariaLabel.itemsSelected",itemsAdded:"Dropin.MultiSelect.ariaLabel.itemsAdded",itemsRemoved:"Dropin.MultiSelect.ariaLabel.itemsRemoved",selectedTotal:"Dropin.MultiSelect.ariaLabel.selectedTotal",noResultsFor:"Dropin.MultiSelect.ariaLabel.noResultsFor",optionsAvailable:"Dropin.MultiSelect.ariaLabel.optionsAvailable",dropdownExpanded:"Dropin.MultiSelect.ariaLabel.dropdownExpanded",useArrowKeys:"Dropin.MultiSelect.ariaLabel.useArrowKeys",removeFromSelection:"Dropin.MultiSelect.ariaLabel.removeFromSelection",fromSelection:"Dropin.MultiSelect.ariaLabel.fromSelection",selectedItem:"Dropin.MultiSelect.ariaLabel.selectedItem",inField:"Dropin.MultiSelect.ariaLabel.inField",selectedItems:"Dropin.MultiSelect.ariaLabel.selectedItems",scrollableOptionsList:"Dropin.MultiSelect.ariaLabel.scrollableOptionsList",selectOptions:"Dropin.MultiSelect.ariaLabel.selectOptions",itemAction:"Dropin.MultiSelect.ariaLabel.itemAction",bulkAdded:"Dropin.MultiSelect.ariaLabel.bulkAdded",bulkRemoved:"Dropin.MultiSelect.ariaLabel.bulkRemoved",dropdownExpandedWithOptions:"Dropin.MultiSelect.ariaLabel.dropdownExpandedWithOptions",selectedItemInField:"Dropin.MultiSelect.ariaLabel.selectedItemInField",removeFromSelectionWithText:"Dropin.MultiSelect.ariaLabel.removeFromSelectionWithText",itemsSelectedDescription:"Dropin.MultiSelect.ariaLabel.itemsSelectedDescription",noItemsSelected:"Dropin.MultiSelect.ariaLabel.noItemsSelected"}),[g,f]=G(!1),[h,w]=G(""),[E,x]=G(-1),$=H(null),L=H(null),T=H(null),{announcement:V,announce:C}=Nt(),q=B((y=!1)=>{f(!1),y&&w(""),x(-1)},[]),I=Q(()=>ft(t,h),[t,h]),{navigate:F}=wt(I,E,x,T);M(()=>{const y=A=>{$.current&&A.target&&!$.current.contains(A.target)&&q(!0)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[q]);const K=y=>{!u&&L.current&&y.target&&!y.target.closest("[data-tag]")&&(g?q(!1):(L.current.focus(),f(!0)))},z=B(y=>{var W;const A=t.find(J=>J.value===y),R=r.includes(y),U=R?r.filter(J=>J!==y):[...r,y];if(n(U),(W=L.current)==null||W.focus(),A){const J=R?v.removed:v.added;C(v.itemAction.replace("{label}",A.label).replace("{action}",J).replace("{count}",U.length.toString()))}},[r,n,t,C,v]),P=(y,A)=>{var W;y.stopPropagation();const R=t.find(J=>J.value===A),U=r.filter(J=>J!==A);n(U),(W=L.current)==null||W.focus(),R&&C(v.itemAction.replace("{label}",R.label).replace("{action}",v.removed).replace("{count}",U.length.toString()))},re=y=>{y.preventDefault();const A=I.map(J=>J.value),R=new Set(r),U=A.filter(J=>!R.has(J)),W=[...r,...U];n(W),U.length>0&&C(v.bulkAdded.replace("{count}",U.length.toString()).replace("{total}",W.length.toString()))},ie=y=>{y.preventDefault();const A=new Set(I.map(W=>W.value)),R=r.filter(W=>A.has(W)).length,U=r.filter(W=>!A.has(W));n(U),R>0&&C(v.bulkRemoved.replace("{count}",R.toString()).replace("{total}",U.length.toString()))},oe=y=>{var A;if(y.key==="Backspace"&&h===""&&r.length>0){y.preventDefault();const R=r.slice(0,-1);n(R);return}if(!g&&(y.key==="ArrowDown"||y.key==="Enter")){y.preventDefault(),f(!0);return}if(g)switch(y.key){case"ArrowDown":y.preventDefault(),F("down");break;case"ArrowUp":y.preventDefault(),F("up");break;case"Enter":if(y.preventDefault(),E>=0&&E<I.length){const R=I[E];R!=null&&R.disabled||z(R.value)}else I.length===1&&!((A=I[0])!=null&&A.disabled)&&z(I[0].value);break;case"Escape":y.preventDefault(),q(!0);break;case"Tab":q(!0);break}},X=Q(()=>vt(r,t),[r,t]),{listboxId:ne,searchInputId:fe,labelId:pe,selectedDescriptionId:ve}=gt(i,m,p),ge=E>=0?`${ne}-option-${E}`:"",Re=Q(()=>r.length>0,[r]);M(()=>{h&&!g&&f(!0)},[g,h]),M(()=>{if(g&&h){const y=I.length;C(y===0?`${v.noResultsFor} "${h}"`:`${y} ${v.optionsAvailable}`)}},[I.length,h,g,C,v]),M(()=>{g&&L.current&&(L.current.focus(),I.length>0&&C(v.dropdownExpandedWithOptions.replace("{count}",I.length.toString()).replace("{s}",I.length===1?"":"s")))},[g,X.length,I.length,C,v]);const Oe=()=>e(ee,{children:X.map((y,A)=>{const R=r.length,U=p?`${p}: `:"",W=R===1?`${U}${v.itemsSelected.replace("{count}","1").replace("{labels}",String(y)).replace("{s}","")}`:`${U}${v.itemsSelected.replace("{count}",R.toString()).replace("{labels}",X.join(", ")).replace("{s}",R===1?"":"s")}`;return e(ht,{"data-tag":"true",className:"dropin-multi-select__tag",role:"group","aria-label":p?v.selectedItemInField.replace("{label}",String(y)).replace("{field}",p):`${v.selectedItem} ${String(y)}`,children:[e("span",{"aria-hidden":"true",children:y}),e("button",{type:"button",onClick:J=>P(J,r[A]),className:"dropin-multi-select__tag-remove",disabled:u,"aria-label":v.removeFromSelectionWithText.replace("{label}",String(y)).replace("{text}",W),children:e(ae,{size:12,"aria-hidden":"true"})})]},r[A])})}),Ce=()=>e("input",{id:fe,ref:L,type:"text",role:"combobox","aria-haspopup":"listbox","aria-expanded":g,"aria-controls":ne,className:o(["dropin-multi-select__search",["dropin-multi-select__search--with-floating-label",!!p]]),placeholder:r.length===0?c||v.placeholder:"",value:h,onChange:y=>{const A=y.target;w(A.value),x(-1)},onKeyDown:oe,onFocus:()=>f(!0),disabled:u,style:{minWidth:h?`${h.length*8+20}px`:"40px"},"aria-autocomplete":"list","aria-activedescendant":g&&ge?ge:void 0,...pe?{"aria-labelledby":pe}:{"aria-label":p||c||v.placeholder||v.selectOptions},"aria-describedby":ve}),Ve=()=>e("div",{className:"dropin-multi-select__controls",children:[e(Z,{variant:"tertiary",type:"button",className:"dropin-multi-select__button dropin-multi-select__button--select-all",onMouseDown:re,"data-testid":"multi-select-select-all",children:a||v.selectAll})," | ",e(Z,{variant:"tertiary",type:"button",className:"dropin-multi-select__button dropin-multi-select__button--deselect-all",onMouseDown:ie,disabled:!Re,"data-testid":"multi-select-deselect-all",children:s||v.deselectAll})]}),Pe=()=>e("ul",{className:"dropin-multi-select__list",id:ne,role:"listbox","aria-multiselectable":"true","aria-label":p||c||v.placeholder,children:I.map((y,A)=>{const R=r.includes(y.value),U=A===E,W=`${ne}-option-${A}`;return e("li",{id:W,"data-option-index":A,"data-testid":`multi-select-option-${A}`,className:o(["dropin-multi-select__option",["dropin-multi-select__option--focused",U],["dropin-multi-select__option--selected",R],["dropin-multi-select__option--disabled",y.disabled]]),onClick:()=>{y.disabled||z(y.value)},onMouseEnter:()=>!y.disabled&&x(A),role:"option","aria-selected":R,"aria-disabled":y.disabled,children:[e("span",{className:o(["dropin-multi-select__option-label",["dropin-multi-select__option-label--disabled",y.disabled]]),children:y.label}),R&&e(be,{width:16,height:16,className:"dropin-multi-select__check-icon","aria-hidden":"true"})]},y.value)})});return e("div",{ref:$,"data-testid":"multi-select",className:o(["dropin-multi-select",l]),children:[e("input",{id:i||m,type:"hidden",name:m,"data-testid":"multi-select-hidden-input",value:r.join(","),disabled:u,"aria-hidden":"true"}),e("div",{className:o(["dropin-multi-select__container",["dropin-multi-select__container--open",g],["dropin-multi-select__container--disabled",u],["dropin-multi-select__container--error",b],["dropin-multi-select__container--success",_],["dropin-multi-select__container--with-floating-label",!!p],["dropin-multi-select__container--has-value",!!(p&&(r.length>0||h.length>0))]]),onMouseDown:K,"data-testid":"multi-select-container",children:[e("div",{className:o(["dropin-multi-select__tags-area",["dropin-multi-select__tags-area--has-values",X.length>0]]),"data-testid":"multi-select-tags-area",role:"group","aria-label":v.selectedItems,children:[e("div",{id:ve,className:"dropin-multi-select__sr-only","aria-live":"polite","aria-atomic":"true",children:r.length>0?v.itemsSelectedDescription.replace("{count}",r.length.toString()).replace("{s}",r.length===1?"":"s").replace("{labels}",X.join(", ")):v.noItemsSelected}),Oe(),Ce(),p?e("label",{className:"dropin-multi-select__floating-label",htmlFor:fe,id:pe,children:p}):null]}),e(se,{className:o(["dropin-multi-select__chevron",["dropin-multi-select__chevron--open",g]])})]}),g&&e("div",{className:"dropin-multi-select__dropdown","data-testid":"multi-select-dropdown",children:[I.length>0&&Ve(),e("div",{ref:T,className:"dropin-multi-select__options","data-testid":"multi-select-options",style:{maxHeight:`${N}px`},tabIndex:0,role:"region","aria-label":v.scrollableOptionsList,children:I.length===0?e("div",{className:"dropin-multi-select__no-results","data-testid":"multi-select-no-results",role:"status","aria-live":"polite",children:[d||v.noResultsText," ",h&&`"${h}"`]}):Pe()})]}),e("div",{className:"dropin-multi-select__announcements dropin-multi-select__sr-only","aria-live":"assertive","aria-atomic":"true",children:V})]})};export{Bt as Accordion,st as AccordionSection,Ot as ActionButton,Ct as ActionButtonGroup,jt as AlertBanner,Gt as Breadcrumbs,Z as Button,ot as Card,qt as CartItem,dt as CartItemSkeleton,Kt as CartList,Vt as Checkbox,Pt as ColorSwatch,Yt as ContentGrid,Ae as Divider,Te as Field,Xt as Header,j as Icon,zt as IllustratedMessage,We as Image,Ft as ImageSwatch,Wt as InLineAlert,rt as Incrementer,Le as Input,At as InputDate,er as InputFile,Tt as InputPassword,Ht as Modal,rr as MultiSelect,Zt as Pagination,at as Picker,te as Price,Ut as PriceRange,Qt as ProductItemCard,lt as ProgressSpinner,it as RadioButton,ce as Skeleton,Y as SkeletonRow,tr as Table,ht as Tag,Rt as TextArea,Mt as TextSwatch,Jt as ToggleButton,He as UIContext,ar as UIProvider,or as provider};
|
|
4
4
|
//# sourceMappingURL=components.js.map
|