@dropins/tools 0.27.0 → 0.27.1-alpha585
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/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"./preact-jsx-runtime.js";import{d as J,c as r,b as ne,V as g,e as Ne,g as ve}from"./chunks/vcomponent.js";import{G as fe,T as M,F as v,L as we,h as V,y as z,q as R,S as K,A as G,_ as ke,N as ae,E as xe,k as A,x as De}from"./chunks/icons/Add.js";import{IntlProvider as Se,Localizer as Y,Text as $,useText as S}from"./i18n.js";import U from"./chunks/icons/Minus.js";import Ee from"./chunks/icons/CheckWithCircle.js";import Te from"./chunks/icons/WarningWithCircle.js";import Pe from"./chunks/icons/Date.js";import Ie from"./chunks/icons/Locker.js";import $e from"./chunks/icons/Eye.js";import Ce from"./chunks/icons/EyeClose.js";import oe from"./chunks/icons/Check.js";import Z from"./chunks/icons/Close.js";import se from"./chunks/icons/ChevronDown.js";import Le from"./chunks/icons/Trash.js";import Ae from"./chunks/icons/ChevronUp.js";import"./chunks/image-params-keymap.js";const Oe={ExampleComponentName:{item:{label:"string"}},Incrementer:{decreaseLabel:"Decrease Quantity",increaseLabel:"Increase Quantity",label:"Quantity"},Modal:{Close:{label:"Close"}},InputPassword:{requiredFieldError:"This is a required field.",placeholder:"Password",buttonTitle:"Click to show or hide password"},PasswordStatusIndicator:{chartTwoSymbols:"Use characters and numbers or symbols",chartThreeSymbols:"Use characters, numbers and symbols",chartFourSymbols:"Use uppercase characters, lowercase characters, numbers and symbols",messageLengthPassword:"At least {minLength} characters long"},InlineAlert:{dismissLabel:"Dismiss Alert"},PriceSummary:{subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to ",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},taxes:{total:"Tax Total",totalOnly:"Tax",breakdown:"Taxes",showBreakdown:"Show Tax Breakdown",hideBreakdown:"Hide Tax Breakdown",estimated:"Estimated Tax"},total:{estimated:"Estimated Total",label:"Total",withoutTax:"Total excluding taxes"}},ProgressSpinner:{updating:{label:"Item is updating"},updatingChildren:{label:"Items are updating"}},PriceRange:{from:{label:"From"},to:{label:"to"},asLowAs:{label:"As low as"}},Swatches:{outOfStock:{label:"out of stock swatch"},selected:{label:"swatch selected"},swatch:{label:"swatch"}},Accordion:{open:{label:"Open"},close:{label:"Close"}},CartItem:{each:{label:"each"},quantity:{label:"Quantity"},remove:{label:"Remove {product} from the cart"},removeDefault:{label:"Remove item from the cart"},taxIncluded:{label:"incl. VAT"},taxExcluded:{label:"excl. tax"},updating:{label:"{product} is updating"}},InputDate:{picker:"Select a date"}},Q={Dropin:Oe},ee={default:Q,en_US:Q},Ve=c=>J(ee.default,ee[c]||{}),re=1,W=({className:c,fullWidth:o=!1,lines:a=re,size:i="small",variant:s="row",children:n=null,multilineGap:l="medium",...t})=>{const d=[[`dropin-skeleton-row__${s}`,s],[`dropin-skeleton-row__${s}-${i}`,s&&i]];if(!n&&s==="empty")return e("div",{className:r(["dropin-skeleton-row dropin-skeleton-row__empty",c])});if(n){const p=n.trim();return e("div",{...t,class:r(["dropin-skeleton-row",["dropin-skeleton-row--full",o],c]),dangerouslySetInnerHTML:{__html:p}})}return a>re===!1?e("div",{...t,class:r(["dropin-skeleton-row",["dropin-skeleton-row--full",o],"dropin-skeleton--row__content",...d,c])}):e("div",{...t,style:{"--multiline-gap-spacing":`var(--spacing-${l})`},class:r(["dropin-skeleton-row--multiline",["dropin-skeleton-row--full",o],c]),children:Array.from({length:a}).map((p,u)=>e("div",{class:r(["dropin-skeleton-row",["dropin-skeleton-row--full",o],"dropin-skeleton--row__content",...d])},u))})},le=({className:c,children:o,rowGap:a="medium",...i})=>e("div",{style:{"--row-gap-spacing":`var(--spacing-${a})`},...i,className:r(["dropin-skeleton",c]),role:"status","aria-label":"Loading...",children:o}),ce=fe({locale:"en-US"}),ur=({lang:c="en_US",langDefinitions:o={},className:a,children:i,...s})=>{const n=M(()=>{const t=J(o.default,o[c]??{});return J(Ve(c),t)},[c,o]),l=c.replace("_","-");return e(ce.Provider,{value:{locale:l},children:e(Se,{definition:n,children:e("div",{...s,className:r(["dropin-design",a]),children:i})})})},Re=function(){const o=typeof document<"u"&&document.createElement("link").relList;return o&&o.supports&&o.supports("modulepreload")?"modulepreload":"preload"}(),Fe=function(c){return"/"+c},te={},f=function(o,a,i){let s=Promise.resolve();if(a&&a.length>0){document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),l=(n==null?void 0:n.nonce)||(n==null?void 0:n.getAttribute("nonce"));s=Promise.all(a.map(t=>{if(t=Fe(t),t in te)return;te[t]=!0;const d=t.endsWith(".css"),_=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${_}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":Re,d||(p.as="script",p.crossOrigin=""),p.href=t,l&&p.setAttribute("nonce",l),document.head.appendChild(p),d)return new Promise((u,m)=>{p.addEventListener("load",u),p.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>o()).catch(n=>{const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=n,window.dispatchEvent(l),!l.defaultPrevented)throw n})},Be={Add:v(()=>f(()=>import("./chunks/icons/Add.js").then(c=>c.$),[])),Bulk:v(()=>f(()=>import("./chunks/icons/Bulk.js"),[])),Burger:v(()=>f(()=>import("./chunks/icons/Burger.js"),[])),Cart:v(()=>f(()=>import("./chunks/icons/Cart.js"),[])),Check:v(()=>f(()=>import("./chunks/icons/Check.js"),[])),ChevronDown:v(()=>f(()=>import("./chunks/icons/ChevronDown.js"),[])),ChevronUp:v(()=>f(()=>import("./chunks/icons/ChevronUp.js"),[])),ChevronRight:v(()=>f(()=>import("./chunks/icons/ChevronRight.js"),[])),Close:v(()=>f(()=>import("./chunks/icons/Close.js"),[])),Heart:v(()=>f(()=>import("./chunks/icons/Heart.js"),[])),Minus:v(()=>f(()=>import("./chunks/icons/Minus.js"),[])),Placeholder:v(()=>f(()=>import("./chunks/icons/Placeholder.js"),[])),PlaceholderFilled:v(()=>f(()=>import("./chunks/icons/PlaceholderFilled.js"),[])),Search:v(()=>f(()=>import("./chunks/icons/Search.js"),[])),SearchFilled:v(()=>f(()=>import("./chunks/icons/SearchFilled.js"),[])),Sort:v(()=>f(()=>import("./chunks/icons/Sort.js"),[])),Star:v(()=>f(()=>import("./chunks/icons/Star.js"),[])),View:v(()=>f(()=>import("./chunks/icons/View.js"),[])),User:v(()=>f(()=>import("./chunks/icons/User.js"),[])),Warning:v(()=>f(()=>import("./chunks/icons/Warning.js"),[])),Locker:v(()=>f(()=>import("./chunks/icons/Locker.js"),[])),Wallet:v(()=>f(()=>import("./chunks/icons/Wallet.js"),[])),Card:v(()=>f(()=>import("./chunks/icons/Card.js"),[])),Order:v(()=>f(()=>import("./chunks/icons/Order.js"),[])),Delivery:v(()=>f(()=>import("./chunks/icons/Delivery.js"),[])),OrderError:v(()=>f(()=>import("./chunks/icons/OrderError.js"),[])),OrderSuccess:v(()=>f(()=>import("./chunks/icons/OrderSuccess.js"),[])),PaymentError:v(()=>f(()=>import("./chunks/icons/PaymentError.js"),[])),CheckWithCircle:v(()=>f(()=>import("./chunks/icons/CheckWithCircle.js"),[])),WarningWithCircle:v(()=>f(()=>import("./chunks/icons/WarningWithCircle.js"),[])),WarningFilled:v(()=>f(()=>import("./chunks/icons/WarningFilled.js"),[])),InfoFilled:v(()=>f(()=>import("./chunks/icons/InfoFilled.js"),[])),HeartFilled:v(()=>f(()=>import("./chunks/icons/HeartFilled.js"),[])),Trash:v(()=>f(()=>import("./chunks/icons/Trash.js"),[])),Eye:v(()=>f(()=>import("./chunks/icons/Eye.js"),[])),EyeClose:v(()=>f(()=>import("./chunks/icons/EyeClose.js"),[])),Date:v(()=>f(()=>import("./chunks/icons/Date.js"),[]))};function O({source:c,size:o="24",stroke:a="2",viewBox:i="0 0 24 24",className:s,...n}){const l=typeof c=="string"?Be[c]:null,t={className:r(["dropin-icon",`dropin-icon--shape-stroke-${a}`,s]),width:o,height:o,viewBox:i};return e(we,{fallback:null,children:l?e(l,{...n,...t}):e(c,{...n,...t})})}const qe=({name:c,value:o="1",className:a,disabled:i,error:s,success:n,min:l,max:t,onValue:d,onUpdateError:_,size:p="medium",...u})=>{const[m,h]=V(Number(o)),y=Number(l),b=Number(t);z(()=>{h(Number(o))},[o]);const w=R(ne(async N=>{if(d)try{await d(N)}catch(x){_&&_(x)}},200),[d,_]),k=N=>{let x=N;N<y&&(x=y),N>b&&(x=b),w(x),h(x)};return e("div",{className:r(["dropin-incrementer",`dropin-incrementer--${p}`,a]),children:e("div",{className:r(["dropin-incrementer__content",`dropin-incrementer__content--${p}`,["dropin-incrementer__content--error",s],["dropin-incrementer__content--success",n],["dropin-incrementer__content--disabled",i]]),children:[e("div",{className:r(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",i]]),children:e(Y,{children:e("button",{type:"button",className:r(["dropin-incrementer__decrease-button",["dropin-incrementer__decrease-button--disabled",i]]),onClick:()=>k(m-1),disabled:i||m<y+1,"aria-label":e($,{id:"Dropin.Incrementer.decreaseLabel"}),children:e(O,{source:U,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__down"})})})}),e("input",{className:"dropin-incrementer__input",max:t,min:l,step:1,type:"number",name:c,value:m,disabled:i,onChange:N=>{const x=N.currentTarget.value;x!==""&&k(Number(x))},...u}),e("div",{className:r(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",i]]),children:e(Y,{children:e("button",{type:"button",className:r(["dropin-incrementer__increase-button",["dropin-incrementer__increase-button--disabled",i]]),onClick:()=>k(m+1),disabled:i||m>b-1,"aria-label":e($,{id:"Dropin.Incrementer.increaseLabel"}),children:e(O,{source:K,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__add"})})})})]})})},de=({name:c,value:o,variant:a="primary",className:i,disabled:s,error:n,floatingLabel:l,onValue:t,onUpdateError:d,size:_="medium",icon:p,maxLength:u,success:m,...h})=>{const y=(h==null?void 0:h.id)||c||`dropin-input-${Math.random().toString(36)}`,b=R(ne(async k=>{if(t)try{await t(k)}catch(N){d&&d(N)}},200),[t,d]),w=k=>{const N=k.target;b(N.value.trim())};return e("div",{className:r(["dropin-input-container",`dropin-input-container--${a}`,["dropin-input-container--floating",!!l],["dropin-input-container--disabled",s]]),children:[p&&e(g,{node:p,className:r(["dropin-input__field-icon--left",p.props.className])}),e("div",{className:"dropin-input-label-container",children:[e("input",{id:y,onChange:w,type:"text",maxLength:u,name:c,value:o,...h,className:r(["dropin-input",`dropin-input--${_}`,`dropin-input--${a}`,["dropin-input--error",!!n],["dropin-input--success",!!m],["dropin-input--disabled",s],["dropin-input--floating",!!l],["dropin-input--icon-left",!!p],i]),disabled:s}),l&&e("label",{htmlFor:y,className:r([["dropin-input__label--floating",!!l],["dropin-input__label--floating--icon-left",!!p],["dropin-input__label--floating--error",!!n]]),children:l})]}),n&&e("div",{className:r(["dropin-input__field-icon--right","dropin-input__field-icon--error"]),children:e(O,{source:Te,size:"16",stroke:"2",className:"dropin-input--warning-icon",viewBox:"-1 -1 26 26"})}),m&&e("div",{className:r(["dropin-input__field-icon--right","dropin-input__field-icon--success"]),children:e(O,{source:Ee,size:"16",stroke:"2",className:"dropin-input--success-icon",viewBox:"-1 -1 26 26"})})]})},hr=({name:c="",error:o,value:a,label:i,onChange:s,onBlur:n,...l})=>{const t=S({picker:"Dropin.InputDate.picker"}),d=u=>{u.currentTarget.setAttribute("type","date")},_=u=>{var h;const m=(h=u.currentTarget.parentElement)==null?void 0:h.querySelector("input");m==null||m.focus(),m==null||m.showPicker()},p=u=>{u.currentTarget.setAttribute("type","text"),n==null||n(u)};return e("div",{className:r(["dropin-input-date"]),children:[e(me,{error:o,children:e(de,{error:!!o,name:c,value:a==null?void 0:a.toString(),placeholder:i,floatingLabel:i,onFocus:d,onBlur:p,onChange:s,"aria-labelledby":i,className:"dropin-input-date__input",...l})}),e("button",{className:"dropin-input-date__icon","aria-label":t.picker,onClick:_,children:e(O,{source:Pe,size:"24"})})]})},ie={pending:e(U,{}),success:e(oe,{}),error:e(Z,{style:{fill:"red"}})},We=({minLength:c=0,requiredCharacterClasses:o=0,uniqueSymbolsStatus:a="pending",validateLengthConfig:i={status:"",icon:"",message:""}})=>{const s=S({chartTwoSymbols:"Dropin.PasswordStatusIndicator.chartTwoSymbols",chartThreeSymbols:"Dropin.PasswordStatusIndicator.chartThreeSymbols",chartFourSymbols:"Dropin.PasswordStatusIndicator.chartFourSymbols"}),n=l=>{switch(l){case 2:return s.chartTwoSymbols;case 3:return s.chartThreeSymbols;case 4:return s.chartFourSymbols;default:return""}};return e("div",{className:r(["dropin-password-status-indicator"]),children:[c>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:[ie[i.icon],e("span",{className:`${i.status}`,children:i.message})]}):null,o>=2?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${a}`,"data-testid":`dropin-password-status-indicator__item--${a}`,children:[ie[a],e("span",{className:"pending",children:n(o)})]}):null]})},br=({children:c,name:o,required:a,className:i,minLength:s,autoComplete:n,error:l=!1,defaultValue:t="",hideStatusIndicator:d=!1,uniqueSymbolsStatus:_,validateLengthConfig:p,requiredCharacterClasses:u,onValue:m,onBlur:h,...y})=>{const b=S({requiredFieldError:"Dropin.InputPassword.requiredFieldError",placeholder:"Dropin.InputPassword.placeholder",buttonTitle:"Dropin.InputPassword.buttonTitle"}),[w,k]=V(!1),N=R(()=>{k(E=>!E)},[]),C=l&&!t.length?b.requiredFieldError:l&&t.length?" ":"";return e("div",{"data-testid":"passwordFieldInput",className:r(["dropin-input-password",["dropin-input-password--error",l],["dropin-input-password--hide-label",l&&!!t.length],i]),...y,children:[e(me,{error:C,children:e(de,{autoComplete:n,name:o??"password",type:w?"text":"password",placeholder:b.placeholder,floatingLabel:b.placeholder,"aria-label":b.placeholder,"aria-required":!0,required:a||!1,value:t,onValue:m,icon:e(Ie,{}),onBlur:h,"data-testid":"passwordInput"})}),e(q,{"aria-label":b.buttonTitle,title:b.buttonTitle,type:"button","data-testid":"toggle-password-icon",variant:"tertiary",className:r(["dropin-input-password__eye-icon",`dropin-input-password__eye-icon--${w?"show":"hide"}`,i]),onClick:N,children:w?e($e,{}):e(Ce,{})}),d?null:e(We,{minLength:s,requiredCharacterClasses:u,validateLengthConfig:p,uniqueSymbolsStatus:_}),c]})},yr=({disabled:c,name:o="",errorMessage:a,value:i,label:s,className:n,onChange:l,onBlur:t,...d})=>{const _=(d==null?void 0:d.id)||o||`dropin-textarea-${Math.random().toString(36)}`,p=!!(a!=null&&a.length),u=R(m=>{const h=m.target;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,l==null||l(m)},[l]);return e("div",{className:r(["dropin-textarea-container",n]),"data-testid":"dropin-textarea-container",children:[e("textarea",{"data-testid":"dropin-textarea-field",className:r(["dropin-textarea",["dropin-textarea--error",p],["dropin-textarea--disabled",!!c]]),id:_,placeholder:s,name:o,value:i,disabled:c,onBlur:t,onChange:u,...d}),e("label",{htmlFor:_,className:r(["dropin-textarea__label--floating",["dropin-textarea__label--floating--error",p]]),children:s}),p?e("div",{className:r(["dropin-textarea__label--floating--text",["dropin-textarea__label--floating--error",p]]),children:a}):null]})},ze=({className:c,src:o,params:a,loading:i="lazy",srcSet:s,onLoad:n,...l})=>{const[t,d]=V(!1),_=M(()=>{if(s)return s;if(!(!o||!a))return Ne(o,{...a})},[a,o,s]),p=u=>{d(!0),n==null||n(u)};return e("img",{...l,className:r(["dropin-image",["dropin-image--loaded",t],c]),loading:i,onLoad:p,src:o,srcSet:_})},pe=({variant:c="primary",className:o})=>e("hr",{role:"separator",className:r(["dropin-divider",`dropin-divider--${c}`,o])}),B=({amount:c=0,currency:o,locale:a=void 0,variant:i="default",weight:s="bold",className:n,children:l,sale:t=!1,formatOptions:d={},size:_="small",...p})=>{const u=M(()=>new Intl.NumberFormat(a,{style:"currency",currency:o||"USD",minimumFractionDigits:2,maximumFractionDigits:2,...d}),[a,o,d]),m=M(()=>u.format(c),[c,u]);return e("span",{...p,className:r(["dropin-price",`dropin-price--${i}`,`dropin-price--${_}`,`dropin-price--${s}`,["dropin-price--sale",t],n]),children:m})},He=({name:c,label:o,value:a,size:i="medium",checked:s=!1,disabled:n=!1,error:l=!1,description:t="",busy:d=!1,className:_,children:p,...u})=>e("label",{className:r([_,"dropin-radio-button",["dropin-radio-button--error",l],["dropin-radio-button--disabled",n]]),children:[e("input",{name:c,value:a,checked:s,disabled:n,type:"radio",className:r(["dropin-radio-button__input",["dropin-radio-button__input--error",l],["dropin-radio-button__input--disabled",n]]),"aria-busy":d,...u}),e("span",{className:r(["dropin-radio-button__label",`dropin-radio-button__label--${i}`,["dropin-radio-button__label--error",l],["dropin-radio-button__label--disabled",n]]),children:o}),e("span",{className:r(["dropin-radio-button__description",`dropin-radio-button__description--${i}`,["dropin-radio-button__description--disabled",n]]),children:t})]}),q=({value:c,variant:o="primary",size:a="medium",icon:i,className:s,children:n,disabled:l=!1,active:t=!1,activeChildren:d,activeIcon:_,href:p,...u})=>{let m="dropin-button";(i&&!n||i&&t&&!d||!i&&t&&_)&&(m="dropin-iconButton"),t&&d&&(m="dropin-button"),s=r([m,`${m}--${a}`,`${m}--${o}`,[`${m}--${o}--disabled`,l],n&&i&&`${m}--with-icon`,!n&&d&&i&&`${m}--with-icon`,t&&_&&`${m}--with-icon`,s]);const h=r(["dropin-button-icon",`dropin-button-icon--${o}`,[`dropin-button-icon--${o}--disabled`,l],i==null?void 0:i.props.className]),y=p?{node:e("a",{}),role:"link",href:p,...u,disabled:l,active:t,onKeyDown:b=>{l&&b.preventDefault()},tabIndex:l?-1:0}:{node:e("button",{}),role:"button",...u,value:c,disabled:l,active:t};return e(g,{...y,className:s,children:[i&&!t&&e(g,{node:i,className:h}),_&&t&&e(g,{node:_,className:h}),n&&!t&&(typeof n=="string"?e("span",{children:n}):n),t&&d&&(typeof d=="string"?e("span",{children:d}):d)]})},gr=({name:c,value:o=null,options:a,variant:i="primary",floatingLabel:s,size:n="medium",handleSelect:l=()=>{},disabled:t=!1,error:d=!1,placeholder:_,defaultOption:p,icon:u,className:m,...h})=>{var D;const y=(h==null?void 0:h.id)||c||`dropin-picker-${Math.random().toString(36)}`,b=a==null?void 0:a.find(T=>!T.disabled),[w,k]=V({value:o,text:(p==null?void 0:p.text)||_||(b==null?void 0:b.text),icon:u});z(()=>{const T=a==null?void 0:a.find(I=>I.value===o);k(T??{value:(p==null?void 0:p.value)||(_||s?null:b==null?void 0:b.value),text:(p==null?void 0:p.text)||_||(b==null?void 0:b.text),icon:u})},[o,a,_,u,p,s]);const N=T=>{const{options:I,value:L}=T.target;for(const F of I)F.selected&&(k({value:L,text:F.text,icon:u}),l(T))},x=a==null?void 0:a.map(T=>{const{value:I,text:L,disabled:F}=T,j=I===w.value;return e("option",{value:I,selected:j,disabled:F,className:r(["dropin-picker__option"]),children:L},I)}),C=G(null),E=!((D=C.current)!=null&&D.selected)||!!p;return e("div",{className:r([m,"dropin-picker",`dropin-picker__${n}`,["dropin-picker__floating",!!s],["dropin-picker__selected",E],["dropin-picker__error",d],["dropin-picker__disabled",t],["dropin-picker__icon",u]]),children:[u&&e(u.type,{...u.props,className:"dropin-picker__icon--placeholder"}),e("select",{id:y,className:r(["dropin-picker__select",`dropin-picker__select--${i}`,`dropin-picker__select--${n}`,["dropin-picker__select--floating",!!s]]),name:c,"aria-label":c,disabled:t,onChange:N,...h,children:[!p&&(s||_)&&e("option",{value:"",ref:C,className:r(["dropin-picker__option dropin-picker__placeholder"]),children:s??_},o),x]}),e(O,{source:se,size:"24",stroke:"2",className:"dropin-picker__chevronDown"}),s&&E&&e("label",{htmlFor:y,className:r(["dropin-picker__floatingLabel",!!s]),children:s})]})},me=({className:c,label:o,error:a,hint:i,success:s,size:n="medium",disabled:l=!1,children:t,...d})=>{var u;const _=((u=t==null?void 0:t.props)==null?void 0:u.id)??`dropin-field-${Math.random().toString(36)}`,p=t&&typeof t.type!="string"?t.type:null;return e("div",{...d,className:r(["dropin-field",c]),children:[o&&e("label",{className:r(["dropin-field__label",["dropin-field__label--disabled",l],`dropin-field__label--${n}`]),htmlFor:_,children:o}),e("div",{className:r(["dropin-field__content"]),children:p&&t&&ke(p,{...t.props,id:_,key:t.key,disabled:l,size:n,error:!!a,success:!!s&&!a})}),e("div",{className:r(["dropin-field__hint",[`dropin-field__hint--${n}`,n],["dropin-field__hint--error",!!a],["dropin-field__hint--success",!!s&&!a],["dropin-field__hint--disabled",!!l]]),children:a||s||i})]})},Nr=({icon:c,className:o,children:a,active:i=!1,disabled:s=!1,...n})=>e("button",{role:"button",disabled:s,...n,className:r(["dropin-action-button",["dropin-action-button--active",i],["dropin-action-button--disabled",s],o]),children:[c&&e(g,{node:c,className:r(["dropin-action-button-icon"])}),a&&(typeof a=="string"?e("span",{children:a}):a)]}),vr=({className:c,variant:o="primary",activeOption:a,disabled:i=!1,dividers:s=!0,children:n,handleSelect:l,...t})=>{const[d,_]=V(a),p=R(m=>{i||m.props.disabled||(_(m.props.value),l&&l(m.props.value))},[l,_,i]),u=ae.map(n,m=>{const h=i||m.props.disabled,y=m.props.value===d;return xe(m,{disabled:h,active:y,onClick:()=>p(m),className:r(["dropin-action-button-group__option",`dropin-action-button-group__option--${o}`,["dropin-action-button-group__option--active",y],["dropin-action-button-group__option--with-dividers",s]])})});return e("div",{role:"group",...t,className:r(["dropin-action-button-group",`dropin-action-button-group--${o}`,c]),children:u})},Me=({variant:c="primary",className:o,children:a,...i})=>e("div",{...i,className:r(["dropin-card",`dropin-card--${c}`,o]),children:e("div",{class:"dropin-card__content",children:a})}),fr=({name:c,value:o,size:a="medium",disabled:i=!1,error:s=!1,label:n="",description:l="",className:t,checked:d,..._})=>{const[p,u]=V(d===void 0?!1:d),m=G(null),h=b=>{var w;(w=_.onChange)==null||w.call(_,b),u(b.currentTarget.checked)},y=b=>{var w;b.key===" "&&(b.preventDefault(),(w=m==null?void 0:m.current)==null||w.click())};return e("label",{className:r(["dropin-checkbox",["dropin-checkbox--disabled",i]]),children:[e("input",{ref:m,name:c,value:o,type:"checkbox",disabled:i,className:r(["dropin-checkbox__checkbox",["dropin-checkbox__checkbox--error",s],t]),..._,onChange:h,checked:p}),e("span",{"aria-checked":p?"true":"false","aria-labelledby":`${c}-label`,"aria-describedby":`${c}-description`,className:r(["dropin-checkbox__box",["dropin-checkbox__box--error",s],["dropin-checkbox__box--disabled",i]]),role:"checkbox",tabIndex:i?-1:0,onKeyDown:y,children:e(O,{className:r(["dropin-checkbox__checkmark"]),source:oe,size:"16",stroke:"3"})}),e("div",{id:`${c}-label`,className:r(["dropin-checkbox__label",`dropin-checkbox__label--${a}`,["dropin-checkbox__label--disabled",i]]),children:n}),e("div",{}),e("div",{id:`${c}-description`,role:"note",className:r(["dropin-checkbox__description",`dropin-checkbox__description--${a}`,["dropin-checkbox__description--disabled",i]]),children:l})]})},wr=({className:c,name:o,value:a,id:i,label:s,groupAriaLabel:n,size:l="medium",color:t,disabled:d=!1,selected:_=!1,outOfStock:p=!1,multi:u=!1,onValue:m,onUpdateError:h,...y})=>{const b=S("Dropin.Swatches.outOfStock.label").label,w=S("Dropin.Swatches.selected.label").label,k=S("Dropin.Swatches.swatch.label").label,N=R(async I=>{if(m)try{await m(I)}catch(L){h&&h(L)}},[m,h]),x=I=>{const L=I.target;N(L.value)},D=t&&(I=>{const L=new Option().style;return L.color=I,L.color!==""})(t)?t:"var(--color-gray-300);",T=()=>p?`${n}: ${s} ${b}`:_?`${n}: ${s} ${w}`:`${n}: ${s} ${k}`;return e("label",{className:r(["dropin-color-swatch__container",`dropin-color-swatch__container--${l}`,c]),children:[e("input",{type:u?"checkbox":"radio",name:o,id:i,value:a,"aria-label":T(),checked:_,disabled:d,onChange:x,...y,className:r(["dropin-color-swatch",["dropin-color-swatch--selected",_],["dropin-color-swatch--disabled",d],c])}),e("span",{style:{"--bg-color":D},className:r(["dropin-color-swatch__span",["dropin-color-swatch__span--out-of-stock",p],c])})]})},kr=({className:c,name:o,value:a,label:i,groupAriaLabel:s,id:n,disabled:l=!1,selected:t=!1,outOfStock:d=!1,multi:_=!1,onValue:p,onUpdateError:u,...m})=>{const h=S("Dropin.Swatches.outOfStock.label").label,y=S("Dropin.Swatches.selected.label").label,b=S("Dropin.Swatches.swatch.label").label,[w,k]=V(!1),N=G(null),x=R(async D=>{if(p)try{await p(D)}catch(T){u&&u(T)}},[p,u]),C=D=>{const T=D.target;x(T.value)},E=()=>d?`${s}: ${i} ${h}`:t?`${s}: ${i} ${y}`:`${s}: ${i} ${b}`;return z(()=>{N.current&&N.current.scrollWidth>N.current.clientWidth&&k(!0)},[i]),e("div",{className:"dropin-text-swatch__container",...w?{"data-tooltip":i}:{},children:[e("input",{type:_?"checkbox":"radio",name:o,id:n,value:a,"aria-label":E(),checked:t,disabled:l,onChange:C,...m,className:r(["dropin-text-swatch",["dropin-text-swatch--selected",t],["dropin-text-swatch--disabled",l],c])}),e("label",{htmlFor:n,ref:N,className:r(["dropin-text-swatch__label",["dropin-text-swatch__label--out-of-stock",d],c]),children:i})]})},Ke=({ariaLabel:c,size:o="small",stroke:a="4",children:i,className:s,style:n,...l})=>{const t=["dropin-progress-spinner",`dropin-progress-spinner--shape-size-${o}`,`dropin-progress-spinner--shape-stroke-${a}`],d=S({updating:"Dropin.ProgressSpinner.updating.label",updatingChildren:"Dropin.ProgressSpinner.updatingChildren.label"}),_=()=>c||(i?d.updatingChildren:d.updating);return i?e("div",{...l,className:r(["dropin-progress-spinner-provider"]),"aria-live":"polite",role:"status",children:[e("div",{"aria-hidden":!0,children:i}),e("div",{"aria-label":_(),role:"status",className:r(["dropin-progress-spinner-background",s]),style:n}),e("div",{className:r(["dropin-progress-spinner-with-provider",...t]),"aria-hidden":!0})]}):e("div",{...l,className:r([s,...t]),"aria-live":"polite",role:"status","aria-label":_()})},xr=({className:c,name:o,value:a,id:i,label:s,groupAriaLabel:n,src:l,alt:t,disabled:d=!1,selected:_=!1,outOfStock:p=!1,multi:u=!1,onValue:m,onUpdateError:h,...y})=>{const b=S("Dropin.Swatches.outOfStock.label").label,w=S("Dropin.Swatches.selected.label").label,k=S("Dropin.Swatches.swatch.label").label,N=R(async E=>{if(m)try{await m(E)}catch(D){h&&h(D)}},[m,h]),x=E=>{const D=E.target;N(D.value)},C=()=>p?`${n}: ${s} ${b}`:_?`${n}: ${s} ${w}`:`${n}: ${s} ${k}`;return e("label",{className:r(["dropin-image-swatch__container",c]),children:[e("input",{type:u?"checkbox":"radio",name:o,id:i,value:a,"aria-label":C(),checked:_,disabled:d,onChange:x,...y,className:r(["dropin-image-swatch",["dropin-image-swatch--selected",_],["dropin-image-swatch--disabled",d],c])}),e("span",{className:r(["dropin-image-swatch__span",["dropin-image-swatch__span--out-of-stock",p],c]),children:e(ze,{src:l,className:r(["dropin-image-swatch__content"]),params:{width:100,fit:"bounds",crop:!0},alt:t,loading:"lazy",onError:E=>E.target.style.display="none"})})]})},_e=({className:c,children:o,title:a,secondaryText:i,actionIconPosition:s="left",iconOpen:n=K,iconClose:l=U,iconLeft:t=K,showIconLeft:d=!1,renderContentWhenClosed:_=!0,onStateChange:p,...u})=>{const[m,h]=V(!1),y=x=>{x.stopImmediatePropagation();const C=!m;h(C),p==null||p(C)},b=S(`Dropin.Accordion.${m?"close":"open"}.label`).label,w=e(O,{source:n,size:"24",onClick:y,onKeyPress:y,className:"dropin-accordion-section__open-icon"}),k=e(O,{source:l,size:"24",onClick:y,onKeyPress:y,className:"dropin-accordion-section__close-icon"}),N=e(O,{source:t,size:"24"});return e("div",{...u,className:r(["dropin-accordion-section",c]),children:[e("div",{className:"dropin-accordion-section__heading",children:[e("div",{className:"dropin-accordion-section__flex",onClick:y,onKeyPress:y,role:"button","aria-label":`${b} ${a}`,tabIndex:0,children:e("div",{className:"dropin-accordion-section__title-container",children:[s==="left"&&(m?k:w),d&&N,e("h3",{className:"dropin-accordion-section__title",children:a})]})}),e("div",{className:"dropin-accordion-section__secondary-text-container",children:[i&&e("h4",{className:"dropin-accordion-section__secondary-text",children:i}),s==="right"&&(m?k:w)]})]}),e("div",{className:"dropin-accordion-section__content-container",style:{display:m?"grid":"none"},children:(m||_&&!m)&&o})]})},Ge=({className:c,children:o,actionIconPosition:a="left",iconOpen:i=K,iconClose:s=U,...n})=>{const l=e(pe,{variant:"secondary"}),t=d=>e(A,{children:[e(_e,{...d.props,actionIconPosition:a,iconOpen:i,iconClose:s}),l]});return e("div",{...n,className:r(["dropin-accordion",c]),children:[l,...(Array.isArray(o)?o:[o]).map(t)]})},Dr=({variant:c="primary",className:o,type:a="warning",additionalActions:i,onDismiss:s,heading:n,description:l,icon:t,itemList:d,actionButtonPosition:_,...p})=>{var m,h,y;const u=S({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...p,className:r(["dropin-in-line-alert",`dropin-in-line-alert--${a}`,`dropin-in-line-alert--${c}`,o]),children:[e("div",{className:"dropin-in-line-alert__heading",children:[e("div",{className:"dropin-in-line-alert__title-container",children:[t&&e(g,{node:t,className:"dropin-in-line-alert__icon"}),e("span",{className:"dropin-in-line-alert__title",children:n})]}),e("div",{className:"dropin-in-line-alert__actions-container",children:[i&&(_==="top"||!_&&i.length<=1)&&e(q,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:i.length>0?(m=i[0])==null?void 0:m.onClick:void 0,"aria-label":(h=i[0])==null?void 0:h.label,children:(y=i[0])==null?void 0:y.label}),s&&e(q,{icon:e(O,{source:Z,size:"24",stroke:"2"}),className:"dropin-in-line-alert__dismiss-button",variant:"tertiary",onClick:s,"aria-label":u.dismiss})]})]}),l&&e("p",{className:"dropin-in-line-alert__description",children:l}),e("div",{className:"dropin-in-line-alert__item-list-container",children:d&&e(g,{node:d,className:r(["dropin-in-line-alert__item-list"])})}),i&&(_==="bottom"||!_&&i.length>1)&&e("div",{className:"dropin-in-line-alert__additional-actions-container",children:i.map(b=>e(q,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:b.onClick,children:b.label},b.label))})]})},Sr=({size:c="small",title:o=null,centered:a=!1,backgroundDim:i=!0,clickToDismiss:s=!0,escapeToDismiss:n=!0,onClose:l,showCloseButton:t=!0,className:d,children:_=null,...p})=>{const u=R(()=>{l==null||l()},[l]),m=S({modalCloseLabel:"Dropin.Modal.Close.label"});return z(()=>{const h=y=>{const b=document.querySelector(".dropin-modal"),w=document.querySelector(".dropin-modal__body");s&&b&&w&&!w.contains(y.target)&&u()};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[u,s]),z(()=>{const h=y=>{y.key==="Escape"&&n&&u()};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[u,n]),z(()=>{const h=document.scrollingElement,y=h.style.overflow;return h.style.overflow="hidden",()=>{h.style.overflow=y}},[]),e("div",{className:r(["dropin-modal",["dropin-modal--dim",i]]),children:e("div",{...p,className:r(["dropin-modal__body",[`dropin-modal__body--${c}`,c],d]),children:[e("div",{className:r(["dropin-modal__header",["dropin-modal__header-title",!!o]]),children:[o&&e("div",{className:r(["dropin-modal__header-title-content"]),children:o}),t&&e(q,{"aria-label":m.modalCloseLabel,variant:"tertiary",className:"dropin-modal__header-close-button",onClick:u,icon:e(Z,{})})]}),e("div",{className:r(["dropin-modal__content",["dropin-modal__body--centered",a]]),children:_})]})})},Er=({className:c,children:o,ariaLabel:a,image:i,title:s,price:n,taxIncluded:l=!1,taxExcluded:t=!1,total:d,totalExcludingTax:_,sku:p,configurations:u,warning:m,alert:h,quantity:y=1,description:b,loading:w=!1,updating:k=!1,onQuantity:N,onRemove:x,...C})=>{var T,I;const{locale:E}=De(ce),D=S({each:"Dropin.CartItem.each.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"});return w?e(Ue,{}):e("div",{...C,className:r(["dropin-cart-item",["dropin-cart-item--updating",k],c]),children:[k&&e(Ke,{className:r(["dropin-cart-item__spinner"]),ariaLabel:a?(T=D.updating)==null?void 0:T.replace("{product}",a):D.updatingDefault}),e("div",{className:"dropin-cart-item__wrapper",children:[e(g,{node:i,className:r(["dropin-cart-item__image"])}),e(g,{node:s,className:r(["dropin-cart-item__title",["dropin-cart-item__title--edit",!!N||!!x]])}),b&&e(g,{node:b,className:r(["dropin-cart-item__description"])}),e(g,{node:p,className:r(["dropin-cart-item__sku"])}),u&&e("ul",{className:r(["dropin-cart-item__configurations"]),children:Object.entries(u).map(([L,F])=>e("li",{className:r(["dropin-cart-item__configurations__item"]),children:[L,":"," ",e("strong",{className:r(["dropin-cart-item__configurations__item__value"]),children:F})]},L))}),e("span",{className:r(["dropin-cart-item__price"]),children:[!N&&e("span",{className:"dropin-cart-item__price__quantity",children:[y.toLocaleString(E)," x"," "]}),e(g,{node:n,role:"text"}),y>1&&e(A,{children:[" ",D.each]}),l&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",D.taxIncluded]}),t&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",D.taxExcluded]})]}),e("div",{className:r(["dropin-cart-item__quantity",["dropin-cart-item__quantity--edit",!!N]]),children:[N?e(qe,{className:r(["dropin-cart-item__quantity__incrementer"]),value:y,min:1,onValue:L=>N==null?void 0:N(Number(L)),name:"quantity","aria-label":D.quantity,disabled:k}):e("span",{className:r(["dropin-cart-item__quantity__value"]),children:[D.quantity,":"," ",e("strong",{className:"dropin-cart-item__quantity__number",children:Number(y).toLocaleString(E)})]}),m&&e(g,{node:m,className:r(["dropin-cart-item__warning","dropin-cart-item__warning--quantity"])}),h&&e(g,{node:h,className:r(["dropin-cart-item__alert","dropin-cart-item__alert--quantity"])})]}),m&&e(g,{node:m,className:r(["dropin-cart-item__warning"])}),h&&e(g,{node:h,className:r(["dropin-cart-item__alert"])}),e("div",{className:r(["dropin-cart-item__total",["dropin-cart-item__total--edit",!!x]]),children:[e("div",{className:"dropin-cart-item__row-total",children:e(g,{node:d,role:"text"})}),l&&e("div",{className:"dropin-cart-item__total-tax-included",children:e("span",{"data-testid":"tax-message",className:r(["dropin-cart-item__total-tax-message"]),children:D.taxIncluded})}),t&&e("div",{className:"dropin-cart-item__total-tax-excluded",children:e("span",{"data-testid":"tax-message",className:r(["dropin-cart-item__total-tax-excluded-message"]),children:[_&&e(g,{node:_,role:"text"})," ",D.taxExcluded]})})]})]}),x&&e(q,{className:r(["dropin-cart-item__remove"]),variant:"tertiary",onClick:()=>x==null?void 0:x(),icon:e(O,{source:Le,size:"24",stroke:"2",viewBox:"0 0 24 24","aria-label":a?(I=D.remove)==null?void 0:I.replace("{product}",a):D.removeDefault}),disabled:k})]})},Ue=()=>e("div",{className:"dropin-cart-item dropin-cart-item-skeleton",children:e(le,{className:"dropin-cart-item__skeleton dropin-cart-item__wrapper",children:[e("div",{className:"dropin-cart-item__image",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__title",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__sku",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__price",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__quantity",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__total",children:e(W,{className:"dropin-cart-item__skeleton__item"})})]})}),Tr=({className:c,children:o,...a})=>{const{heading:i,loading:s=!0,total:n,subTotal:l,shipping:t,taxTotal:d,taxesApplied:_,discounts:p,primaryAction:u,...m}=a,[h,y]=V(!1),b=G(null),[w,k]=V(!0),[N,x]=V("zip"),C=S({editZipAction:"Dropin.PriceSummary.shipping.editZipAction",destinationLinkAriaLabel:"Dropin.PriceSummary.shipping.destinationLinkAriaLabel",taxesBreakdownTitle:"Dropin.PriceSummary.taxes.breakdown",subtotalLabel:"Dropin.PriceSummary.subTotal.label",shippingLabel:"Dropin.PriceSummary.shipping.label",showTaxBreakdown:"Dropin.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"Dropin.PriceSummary.taxes.hideBreakdown",zipPlaceholder:"Dropin.PriceSummary.shipping.zipPlaceholder"}),E=P=>{P.preventDefault(),k(H=>!H)},D=P=>{P.preventDefault(),k(!0),x(H=>H==="zip"?"state":"zip")},T=P=>{var X;P.preventDefault(),k(!1);const H=ve(b.current);(X=t==null?void 0:t.onEstimate)==null||X.call(t,H)},I=e(le,{"data-testid":"loading-skeleton",rowGap:"xsmall",children:e(W,{variant:"row",size:"small",lines:5,fullWidth:!0,multilineGap:"xsmall"})}),L=()=>t?t.estimated?t.destinationText?e(A,{children:[e($,{id:"Dropin.PriceSummary.shipping.estimatedDestination"}),e("a",{className:"dropin-price-summary__shippingLink",role:"button",href:"",onClick:E,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&E(P)},tabIndex:0,"aria-label":C.destinationLinkAriaLabel,"aria-expanded":w,"data-testid":"shipping-destination-link",children:t.destinationText})]}):e($,{id:"Dropin.PriceSummary.shipping.estimated"}):e($,{id:"Dropin.PriceSummary.shipping.label"}):null,F=t&&e(A,{children:e("div",{"data-testid":"shipping-content",className:r(["dropin-price-summary__entry","dropin-price-summary__shipping"]),children:[e("span",{className:"dropin-price-summary__label",children:L()}),e(g,{node:t.price,className:"dropin-price-summary__price"}),t.estimated&&e(A,{children:e("div",{className:r(["dropin-price-summary__caption"]),children:e("a",{href:"#",className:"dropin-price-summary__shippingLink",onClick:D,"data-testid":"shipping-alternate-field-link",children:N==="zip"?e($,{id:"Dropin.PriceSummary.shipping.alternateField.state"}):e($,{id:"Dropin.PriceSummary.shipping.alternateField.zip"})})})}),t.estimated&&e(A,{children:e("form",{className:r(["dropin-price-summary__shipping--edit",["dropin-price-summary__shipping--hide",!w]]),ref:b,"data-testid":"shipping-estimate-form",children:[t.countryField&&e(g,{node:t.countryField,className:r(["dropin-price-summary__shipping--country"])}),N==="state"?t.stateField&&e(g,{node:t.stateField,className:r(["dropin-price-summary__shipping--state"])}):t.zipField&&e(g,{node:t.zipField,className:r(["dropin-price-summary__shipping--zip"])}),t.estimateButton&&e(g,{node:t.estimateButton,className:r(["dropin-price-summary__shipping--action"]),onClick:T,type:"submit"})]})}),t.taxIncluded&&e("div",{"data-testid":"shipping-tax-included",className:r(["dropin-price-summary__caption"]),children:e("span",{children:e($,{id:"Dropin.PriceSummary.shipping.withTaxes"})})}),t.taxExcluded?e("div",{"data-testid":"shipping-tax-included-excluded",className:r(["dropin-price-summary__caption"]),children:e("span",{children:[t.priceExcludingTax," ",e($,{id:"Dropin.PriceSummary.shipping.withoutTaxes"})]})}):void 0]})}),j=p&&e(A,{children:p.map(P=>e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__discount"]),children:[e("span",{className:r(["dropin-price-summary__label"]),children:P.label}),e(g,{node:P.price,className:r(["dropin-price-summary__price"])}),P.caption&&e(g,{node:P.caption,className:r(["dropin-price-summary__caption"])})]},P.label))}),ue=_?e(A,{children:e(Ge,{"data-testid":"tax-breakdown",className:"dropin-price-summary__taxes",iconOpen:se,iconClose:Ae,children:e(_e,{title:C.taxesBreakdownTitle,secondaryText:!h&&d?e(g,{node:d.price,className:"dropin-price-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:y,children:[e("div",{className:r(["dropin-price-summary__appliedTaxes"]),children:_.map(P=>e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__taxEntry"]),children:[e("span",{className:r(["dropin-price-summary__label","dropin-price-summary__label--muted"]),children:P.label}),e(g,{node:P.price,className:r(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]},P.label))}),e("div",{className:r(["dropin-price-summary__entry"]),children:[e("span",{className:"dropin-price-summary__label",children:e($,{id:"Dropin.PriceSummary.taxes.total"})}),d&&e(g,{node:d.price,className:"dropin-price-summary__price"})]})]})})}):d&&e("div",{"data-testid":"tax-total-only",className:r(["dropin-price-summary__entry","dropin-price-summary__taxTotal"]),children:[e("span",{className:"dropin-price-summary__label",children:d.estimated?e($,{id:"Dropin.PriceSummary.taxes.estimated"}):e($,{id:"Dropin.PriceSummary.taxes.totalOnly"})}),e(g,{node:d.price,className:"dropin-price-summary__price"})]}),he=n&&e(A,{children:e("div",{"data-testid":"total-content",className:r(["dropin-price-summary__entry","dropin-price-summary__total",n.estimated&&"dropin-price-summary__total--padded"]),children:[e("span",{className:r(["dropin-price-summary__label","dropin-price-summary__label--bold"]),children:n.estimated?e($,{id:"Dropin.PriceSummary.total.estimated"}):e($,{id:"Dropin.PriceSummary.total.label"})}),e(g,{node:n.price,className:r(["dropin-price-summary__price","dropin-price-summary__price--bold"])})]})}),be=n&&n.priceWithoutTax&&e("div",{"data-testid":"total-without-tax",className:"dropin-price-summary__entry dropin-price-summary__totalWithoutTax",children:[e("span",{className:r(["dropin-price-summary__label","dropin-price-summary__label--muted"]),children:e($,{id:"Dropin.PriceSummary.total.withoutTax"})}),e(g,{node:n.priceWithoutTax,className:r(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]}),ye=u&&e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__primaryAction"]),children:u}),ge=l&&e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__subTotal"]),children:[e("span",{className:"dropin-price-summary__label",children:e($,{id:"Dropin.PriceSummary.subTotal.label"})}),e(g,{node:l.price,className:"dropin-price-summary__price"}),l.taxIncluded&&e("div",{"data-testid":"sub-total-tax-caption",className:r(["dropin-price-summary__caption"]),children:e("span",{children:e($,{id:"Dropin.PriceSummary.subTotal.withTaxes"})})}),l.taxExcluded?e("div",{"data-testid":"sub-total-tax-caption-excluded",className:r(["dropin-price-summary__caption"]),children:e("span",{children:[l.priceExcludingTax," ",e($,{id:"Dropin.PriceSummary.subTotal.withoutTaxes"})]})}):void 0]});return e("div",{...m,className:r(["dropin-price-summary",c]),children:[e("div",{className:"dropin-price-summary__heading",children:i}),e(pe,{variant:"primary",className:"dropin-price-summary__divider-primary"}),s?I:e(A,{children:[ge,F,j,ue,he,be,ye]})]})},Pr=({className:c,children:o,...a})=>e("div",{...a,className:r(["dropin-cart-list",c]),children:e("div",{className:"dropin-cart-list__wrapper","aria-live":"assertive","aria-relevant":"all",children:ae.map(o,(i,s)=>e("div",{className:"dropin-cart-list__item",children:i},s))})}),Ir=({className:c,children:o,locale:a,currency:i,amount:s,variant:n="default",minimumAmount:l,maximumAmount:t,size:d="small",display:_="dash",specialPrice:p,sale:u=!1,...m})=>{const h=M(()=>s||l===t||l&&!t||t&&!l,[s,t,l]);return e("div",{children:h?e("div",{...m,className:r(["dropin-price-range",c]),children:e(B,{amount:s??l??t,currency:i,locale:a,size:d,variant:n,sale:u})}):e("div",{...m,className:r(["dropin-price-range",c]),children:[_==="dash"?e(Ze,{specialPrice:p,minimumAmount:l,maximumAmount:t,currency:i,locale:a,size:d,sale:u}):null,_==="from to"?e(je,{specialPrice:p,minimumAmount:l,maximumAmount:t,currency:i,locale:a,size:d,sale:u}):null,_==="as low as"?e(Je,{specialPrice:p,minimumAmount:l,maximumAmount:t,currency:i,locale:a,size:d,sale:u}):null]})})};function Ze({specialPrice:c,minimumAmount:o,maximumAmount:a,currency:i,locale:s,size:n,sale:l}){return e(A,{children:[e(B,{amount:c??o,currency:i,locale:s,size:n,sale:!!c&&l}),e("span",{className:"dropin-price-range__separator",children:"-"}),e(B,{amount:a,currency:i,locale:s,size:n})]})}function je({specialPrice:c,minimumAmount:o,maximumAmount:a,currency:i,locale:s,size:n,sale:l}){const t=S({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(A,{children:[e("span",{className:r(["dropin-price-range__from",`dropin-price-range__from--${n}`]),children:t.from}),e(B,{amount:c??o,currency:i,locale:s,size:n,sale:!!c&&l}),e("span",{className:r(["dropin-price-range__to",`dropin-price-range__to--${n}`]),children:t.to}),e(B,{amount:a,currency:i,locale:s,size:n})]})}function Je({specialPrice:c,minimumAmount:o,maximumAmount:a,currency:i,locale:s,size:n,sale:l}){const t=S({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(A,{children:[e("span",{className:r(["dropin-price-range__as-low-as",`dropin-price-range__as-low-as--${n}`]),children:t.asLowAs}),c?e("div",{children:[e(B,{amount:a,currency:i,locale:s,size:n,variant:"strikethrough"}),e(B,{amount:c,currency:i,locale:s,size:n,className:"dropin-price-range__special",sale:!!c&&l})]}):e(B,{amount:o,currency:i,locale:s,size:n})]})}const $r=({className:c,categories:o,separator:a,...i})=>e(A,{children:(o==null?void 0:o.length)>1&&e("nav",{role:"navigation",...i,className:r(["dropin-breadcrumbs__container",c]),children:e("ul",{className:"dropin-breadcrumbs__items",children:o==null?void 0:o.map((s,n)=>e("li",{className:r(["dropin-breadcrumbs__item",["dropin-breadcrumbs__item--last",n===o.length-1]]),children:[e(g,{node:s,className:"dropin-breadcrumbs__link"}),!a&&n!==o.length-1&&e("span",{className:"dropin-breadcrumbs__separator--default",children:[" ","/"," "]}),a&&n!==o.length-1&&e(g,{node:a,className:"dropin-breadcrumbs__separator--icon"})]},n))})})}),Cr=({className:c,variant:o,icon:a,message:i,onDismiss:s,action:n,...l})=>{const t=S({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...l,className:r([c,"dropin-alert-banner",`dropin-alert-banner--${o}`]),children:[e("div",{className:"dropin-alert-banner__content",children:[a&&e(g,{node:a,"aria-hidden":"true",className:"dropin-alert-banner__icon"}),e(g,{node:i,className:r(["dropin-alert-banner__message"])})]}),e("div",{className:"dropin-alert-banner__actions",children:[n&&e(q,{variant:"tertiary",className:"dropin-alert-banner__action",onClick:n.onClick,"aria-label":n.label,children:n.label}),e(q,{icon:e(O,{source:Z,size:"24",stroke:"2"}),className:"dropin-alert-banner__dismiss-button",variant:"primary",onClick:s,"aria-label":t.dismiss})]})]})},Lr=({className:c,icon:o,heading:a,headingLevel:i=2,message:s,action:n,variant:l="secondary",...t})=>{const d=i>=1&&i<=6?`h${i}`:"h2";return e("div",{...t,className:r(["dropin-illustrated-message",c]),children:e(Me,{variant:l,children:[o&&e(g,{node:o,"aria-hidden":"true",size:"80",className:"dropin-illustrated-message__icon"}),a&&e(d,{className:"dropin-illustrated-message__heading",children:a}),s&&e(g,{node:s,className:"dropin-illustrated-message__message"}),n&&e(g,{node:n,className:"dropin-illustrated-message__action"})]})})},Ar=({className:c,label:o,name:a,value:i,selected:s=!0,onChange:n,icon:l,busy:t=!1,children:d,..._})=>e("div",{..._,className:r(["dropin-toggle-button",c,["dropin-toggle-button__selected",s]]),children:e("label",{className:"dropin-toggle-button__actionButton",children:[e(He,{label:"",name:a,value:i,checked:s,onChange:()=>n&&n(i),"aria-label":o,busy:t,className:r([c,"dropin-toggle-button__radioButton"])}),e("span",{className:"dropin-toggle-button__content",children:[l&&e(l.type,{...l==null?void 0:l.props,className:"dropin-toggle-button__icon"}),o]})]})});export{Ge as Accordion,_e as AccordionSection,Nr as ActionButton,vr as ActionButtonGroup,Cr as AlertBanner,$r as Breadcrumbs,q as Button,Me as Card,Er as CartItem,Ue as CartItemSkeleton,Pr as CartList,fr as Checkbox,wr as ColorSwatch,pe as Divider,me as Field,O as Icon,Lr as IllustratedMessage,ze as Image,xr as ImageSwatch,Dr as InLineAlert,qe as Incrementer,de as Input,hr as InputDate,br as InputPassword,Sr as Modal,gr as Picker,B as Price,Ir as PriceRange,Tr as PriceSummary,Ke as ProgressSpinner,He as RadioButton,le as Skeleton,W as SkeletonRow,yr as TextArea,kr as TextSwatch,Ar as ToggleButton,ce as UIContext,ur as UIProvider};
|
|
1
|
+
import{jsx as e}from"./preact-jsx-runtime.js";import{d as J,c as r,b as ne,V as N,e as Ne,g as fe}from"./chunks/vcomponent.js";import{G as ve,T as M,F as f,L as we,h as V,y as z,q as R,S as K,A as G,_ as ke,N as ae,E as xe,k as A,x as De}from"./chunks/icons/Add.js";import{IntlProvider as Se,Localizer as Y,Text as $,useText as E}from"./i18n.js";import U from"./chunks/icons/Minus.js";import Ee from"./chunks/icons/CheckWithCircle.js";import Te from"./chunks/icons/WarningWithCircle.js";import Pe from"./chunks/icons/Date.js";import Ie from"./chunks/icons/Locker.js";import $e from"./chunks/icons/Eye.js";import Ce from"./chunks/icons/EyeClose.js";import oe from"./chunks/icons/Check.js";import Z from"./chunks/icons/Close.js";import se from"./chunks/icons/ChevronDown.js";import Le from"./chunks/icons/Trash.js";import Ae from"./chunks/icons/ChevronUp.js";import"./chunks/image-params-keymap.js";const Oe={ExampleComponentName:{item:{label:"string"}},Incrementer:{decreaseLabel:"Decrease Quantity",increaseLabel:"Increase Quantity",label:"Quantity"},Modal:{Close:{label:"Close"}},InputPassword:{requiredFieldError:"This is a required field.",placeholder:"Password",floatingLabel:"Password",buttonTitle:"Click to show or hide password"},PasswordStatusIndicator:{chartTwoSymbols:"Use characters and numbers or symbols",chartThreeSymbols:"Use characters, numbers and symbols",chartFourSymbols:"Use uppercase characters, lowercase characters, numbers and symbols",messageLengthPassword:"At least {minLength} characters long"},InlineAlert:{dismissLabel:"Dismiss Alert"},PriceSummary:{subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to ",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},taxes:{total:"Tax Total",totalOnly:"Tax",breakdown:"Taxes",showBreakdown:"Show Tax Breakdown",hideBreakdown:"Hide Tax Breakdown",estimated:"Estimated Tax"},total:{estimated:"Estimated Total",label:"Total",withoutTax:"Total excluding taxes"}},ProgressSpinner:{updating:{label:"Item is updating"},updatingChildren:{label:"Items are updating"}},PriceRange:{from:{label:"From"},to:{label:"to"},asLowAs:{label:"As low as"}},Swatches:{outOfStock:{label:"out of stock swatch"},selected:{label:"swatch selected"},swatch:{label:"swatch"}},Accordion:{open:{label:"Open"},close:{label:"Close"}},CartItem:{each:{label:"each"},quantity:{label:"Quantity"},remove:{label:"Remove {product} from the cart"},removeDefault:{label:"Remove item from the cart"},taxIncluded:{label:"incl. VAT"},taxExcluded:{label:"excl. tax"},updating:{label:"{product} is updating"}},InputDate:{picker:"Select a date"}},Q={Dropin:Oe},ee={default:Q,en_US:Q},Ve=l=>J(ee.default,ee[l]||{}),re=1,W=({className:l,fullWidth:o=!1,lines:a=re,size:t="small",variant:s="row",children:n=null,multilineGap:c="medium",...i})=>{const d=[[`dropin-skeleton-row__${s}`,s],[`dropin-skeleton-row__${s}-${t}`,s&&t]];if(!n&&s==="empty")return e("div",{className:r(["dropin-skeleton-row dropin-skeleton-row__empty",l])});if(n){const p=n.trim();return e("div",{...i,class:r(["dropin-skeleton-row",["dropin-skeleton-row--full",o],l]),dangerouslySetInnerHTML:{__html:p}})}return a>re===!1?e("div",{...i,class:r(["dropin-skeleton-row",["dropin-skeleton-row--full",o],"dropin-skeleton--row__content",...d,l])}):e("div",{...i,style:{"--multiline-gap-spacing":`var(--spacing-${c})`},class:r(["dropin-skeleton-row--multiline",["dropin-skeleton-row--full",o],l]),children:Array.from({length:a}).map((p,u)=>e("div",{class:r(["dropin-skeleton-row",["dropin-skeleton-row--full",o],"dropin-skeleton--row__content",...d])},u))})},le=({className:l,children:o,rowGap:a="medium",...t})=>e("div",{style:{"--row-gap-spacing":`var(--spacing-${a})`},...t,className:r(["dropin-skeleton",l]),role:"status","aria-label":"Loading...",children:o}),ce=ve({locale:"en-US"}),ur=({lang:l="en_US",langDefinitions:o={},className:a,children:t,...s})=>{const n=M(()=>{const i=J(o.default,o[l]??{});return J(Ve(l),i)},[l,o]),c=l.replace("_","-");return e(ce.Provider,{value:{locale:c},children:e(Se,{definition:n,children:e("div",{...s,className:r(["dropin-design",a]),children:t})})})},Re=function(){const o=typeof document<"u"&&document.createElement("link").relList;return o&&o.supports&&o.supports("modulepreload")?"modulepreload":"preload"}(),Fe=function(l){return"/"+l},te={},v=function(o,a,t){let s=Promise.resolve();if(a&&a.length>0){document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),c=(n==null?void 0:n.nonce)||(n==null?void 0:n.getAttribute("nonce"));s=Promise.all(a.map(i=>{if(i=Fe(i),i in te)return;te[i]=!0;const d=i.endsWith(".css"),_=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${_}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":Re,d||(p.as="script",p.crossOrigin=""),p.href=i,c&&p.setAttribute("nonce",c),document.head.appendChild(p),d)return new Promise((u,m)=>{p.addEventListener("load",u),p.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${i}`)))})}))}return s.then(()=>o()).catch(n=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=n,window.dispatchEvent(c),!c.defaultPrevented)throw n})},Be={Add:f(()=>v(()=>import("./chunks/icons/Add.js").then(l=>l.$),[])),Bulk:f(()=>v(()=>import("./chunks/icons/Bulk.js"),[])),Burger:f(()=>v(()=>import("./chunks/icons/Burger.js"),[])),Cart:f(()=>v(()=>import("./chunks/icons/Cart.js"),[])),Check:f(()=>v(()=>import("./chunks/icons/Check.js"),[])),ChevronDown:f(()=>v(()=>import("./chunks/icons/ChevronDown.js"),[])),ChevronUp:f(()=>v(()=>import("./chunks/icons/ChevronUp.js"),[])),ChevronRight:f(()=>v(()=>import("./chunks/icons/ChevronRight.js"),[])),Close:f(()=>v(()=>import("./chunks/icons/Close.js"),[])),Heart:f(()=>v(()=>import("./chunks/icons/Heart.js"),[])),Minus:f(()=>v(()=>import("./chunks/icons/Minus.js"),[])),Placeholder:f(()=>v(()=>import("./chunks/icons/Placeholder.js"),[])),PlaceholderFilled:f(()=>v(()=>import("./chunks/icons/PlaceholderFilled.js"),[])),Search:f(()=>v(()=>import("./chunks/icons/Search.js"),[])),SearchFilled:f(()=>v(()=>import("./chunks/icons/SearchFilled.js"),[])),Sort:f(()=>v(()=>import("./chunks/icons/Sort.js"),[])),Star:f(()=>v(()=>import("./chunks/icons/Star.js"),[])),View:f(()=>v(()=>import("./chunks/icons/View.js"),[])),User:f(()=>v(()=>import("./chunks/icons/User.js"),[])),Warning:f(()=>v(()=>import("./chunks/icons/Warning.js"),[])),Locker:f(()=>v(()=>import("./chunks/icons/Locker.js"),[])),Wallet:f(()=>v(()=>import("./chunks/icons/Wallet.js"),[])),Card:f(()=>v(()=>import("./chunks/icons/Card.js"),[])),Order:f(()=>v(()=>import("./chunks/icons/Order.js"),[])),Delivery:f(()=>v(()=>import("./chunks/icons/Delivery.js"),[])),OrderError:f(()=>v(()=>import("./chunks/icons/OrderError.js"),[])),OrderSuccess:f(()=>v(()=>import("./chunks/icons/OrderSuccess.js"),[])),PaymentError:f(()=>v(()=>import("./chunks/icons/PaymentError.js"),[])),CheckWithCircle:f(()=>v(()=>import("./chunks/icons/CheckWithCircle.js"),[])),WarningWithCircle:f(()=>v(()=>import("./chunks/icons/WarningWithCircle.js"),[])),WarningFilled:f(()=>v(()=>import("./chunks/icons/WarningFilled.js"),[])),InfoFilled:f(()=>v(()=>import("./chunks/icons/InfoFilled.js"),[])),HeartFilled:f(()=>v(()=>import("./chunks/icons/HeartFilled.js"),[])),Trash:f(()=>v(()=>import("./chunks/icons/Trash.js"),[])),Eye:f(()=>v(()=>import("./chunks/icons/Eye.js"),[])),EyeClose:f(()=>v(()=>import("./chunks/icons/EyeClose.js"),[])),Date:f(()=>v(()=>import("./chunks/icons/Date.js"),[]))};function O({source:l,size:o="24",stroke:a="2",viewBox:t="0 0 24 24",className:s,...n}){const c=typeof l=="string"?Be[l]:null,i={className:r(["dropin-icon",`dropin-icon--shape-stroke-${a}`,s]),width:o,height:o,viewBox:t};return e(we,{fallback:null,children:c?e(c,{...n,...i}):e(l,{...n,...i})})}const qe=({name:l,value:o="1",className:a,disabled:t,error:s,success:n,min:c,max:i,onValue:d,onUpdateError:_,size:p="medium",...u})=>{const[m,h]=V(Number(o)),b=Number(c),y=Number(i);z(()=>{h(Number(o))},[o]);const k=R(ne(async g=>{if(d)try{await d(g)}catch(x){_&&_(x)}},200),[d,_]),w=g=>{let x=g;g<b&&(x=b),g>y&&(x=y),k(x),h(x)};return e("div",{className:r(["dropin-incrementer",`dropin-incrementer--${p}`,a]),children:e("div",{className:r(["dropin-incrementer__content",`dropin-incrementer__content--${p}`,["dropin-incrementer__content--error",s],["dropin-incrementer__content--success",n],["dropin-incrementer__content--disabled",t]]),children:[e("div",{className:r(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",t]]),children:e(Y,{children:e("button",{type:"button",className:r(["dropin-incrementer__decrease-button",["dropin-incrementer__decrease-button--disabled",t]]),onClick:()=>w(m-1),disabled:t||m<b+1,"aria-label":e($,{id:"Dropin.Incrementer.decreaseLabel"}),children:e(O,{source:U,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__down"})})})}),e("input",{className:"dropin-incrementer__input",max:i,min:c,step:1,type:"number",name:l,value:m,disabled:t,onChange:g=>{const x=g.currentTarget.value;x!==""&&w(Number(x))},...u}),e("div",{className:r(["dropin-incrementer__button-container",["dropin-incrementer__button-container--disabled",t]]),children:e(Y,{children:e("button",{type:"button",className:r(["dropin-incrementer__increase-button",["dropin-incrementer__increase-button--disabled",t]]),onClick:()=>w(m+1),disabled:t||m>y-1,"aria-label":e($,{id:"Dropin.Incrementer.increaseLabel"}),children:e(O,{source:K,size:"16",stroke:"1",viewBox:"4 2 20 20",className:"dropin-incrementer__add"})})})})]})})},de=({name:l,value:o,variant:a="primary",className:t,disabled:s,error:n,floatingLabel:c,onValue:i,onUpdateError:d,size:_="medium",icon:p,maxLength:u,success:m,...h})=>{const b=(h==null?void 0:h.id)||l||`dropin-input-${Math.random().toString(36)}`,y=R(ne(async w=>{if(i)try{await i(w)}catch(g){d&&d(g)}},200),[i,d]),k=w=>{const g=w.target;y(g.value.trim())};return e("div",{className:r(["dropin-input-container",`dropin-input-container--${a}`,["dropin-input-container--floating",!!c],["dropin-input-container--disabled",s]]),children:[p&&e(N,{node:p,className:r(["dropin-input__field-icon--left",p.props.className])}),e("div",{className:"dropin-input-label-container",children:[e("input",{id:b,onChange:k,type:"text",maxLength:u,name:l,value:o,...h,className:r(["dropin-input",`dropin-input--${_}`,`dropin-input--${a}`,["dropin-input--error",!!n],["dropin-input--success",!!m],["dropin-input--disabled",s],["dropin-input--floating",!!c],["dropin-input--icon-left",!!p],t]),disabled:s}),c&&e("label",{htmlFor:b,className:r([["dropin-input__label--floating",!!c],["dropin-input__label--floating--icon-left",!!p],["dropin-input__label--floating--error",!!n]]),children:c})]}),n&&e("div",{className:r(["dropin-input__field-icon--right","dropin-input__field-icon--error"]),children:e(O,{source:Te,size:"16",stroke:"2",className:"dropin-input--warning-icon",viewBox:"-1 -1 26 26"})}),m&&e("div",{className:r(["dropin-input__field-icon--right","dropin-input__field-icon--success"]),children:e(O,{source:Ee,size:"16",stroke:"2",className:"dropin-input--success-icon",viewBox:"-1 -1 26 26"})})]})},hr=({name:l="",error:o,value:a,label:t,onChange:s,onBlur:n,...c})=>{const i=E({picker:"Dropin.InputDate.picker"}),d=u=>{u.currentTarget.setAttribute("type","date")},_=u=>{var h;const m=(h=u.currentTarget.parentElement)==null?void 0:h.querySelector("input");m==null||m.focus(),m==null||m.showPicker()},p=u=>{u.currentTarget.setAttribute("type","text"),n==null||n(u)};return e("div",{className:r(["dropin-input-date"]),children:[e(me,{error:o,children:e(de,{error:!!o,name:l,value:a==null?void 0:a.toString(),placeholder:t,floatingLabel:t,onFocus:d,onBlur:p,onChange:s,"aria-labelledby":t,className:"dropin-input-date__input",...c})}),e("button",{className:"dropin-input-date__icon","aria-label":i.picker,onClick:_,children:e(O,{source:Pe,size:"24"})})]})},ie={pending:e(U,{}),success:e(oe,{}),error:e(Z,{style:{fill:"red"}})},We=({minLength:l=0,requiredCharacterClasses:o=0,uniqueSymbolsStatus:a="pending",validateLengthConfig:t={status:"",icon:"",message:""}})=>{const s=E({chartTwoSymbols:"Dropin.PasswordStatusIndicator.chartTwoSymbols",chartThreeSymbols:"Dropin.PasswordStatusIndicator.chartThreeSymbols",chartFourSymbols:"Dropin.PasswordStatusIndicator.chartFourSymbols"}),n=c=>{switch(c){case 2:return s.chartTwoSymbols;case 3:return s.chartThreeSymbols;case 4:return s.chartFourSymbols;default:return""}};return e("div",{className:r(["dropin-password-status-indicator"]),children:[l>0?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${t.status}`,"data-testid":`dropin-password-status-indicator__item--${t.icon}`,children:[ie[t.icon],e("span",{className:`${t.status}`,children:t.message})]}):null,o>=2?e("div",{className:`dropin-password-status-indicator__item dropin-password-status-indicator__item--${a}`,"data-testid":`dropin-password-status-indicator__item--${a}`,children:[ie[a],e("span",{className:"pending",children:n(o)})]}):null]})},br=({placeholder:l,floatingLabel:o,children:a,name:t,required:s,className:n,minLength:c,autoComplete:i,error:d=!1,defaultValue:_="",hideStatusIndicator:p=!1,uniqueSymbolsStatus:u,validateLengthConfig:m,requiredCharacterClasses:h,onValue:b,onBlur:y,...k})=>{const w=E({requiredFieldError:"Dropin.InputPassword.requiredFieldError",placeholder:"Dropin.InputPassword.placeholder",floatingLabel:"Dropin.InputPassword.floatingLabel",buttonTitle:"Dropin.InputPassword.buttonTitle"}),[g,x]=V(!1),C=R(()=>{x(S=>!S)},[]),D=d&&!_.length?w.requiredFieldError:d&&_.length?" ":"";return e("div",{"data-testid":"passwordFieldInput",className:r(["dropin-input-password",["dropin-input-password--error",d],["dropin-input-password--hide-label",d&&!!_.length],n]),...k,children:[e(me,{error:D,children:e(de,{autoComplete:i,name:t??"password",type:g?"text":"password",placeholder:l||w.placeholder,floatingLabel:o||w.floatingLabel,"aria-label":w.placeholder,"aria-required":!0,required:s||!1,value:_,onValue:b,icon:e(Ie,{}),onBlur:y,"data-testid":"passwordInput"})}),e(q,{"aria-label":w.buttonTitle,title:w.buttonTitle,type:"button","data-testid":"toggle-password-icon",variant:"tertiary",className:r(["dropin-input-password__eye-icon",`dropin-input-password__eye-icon--${g?"show":"hide"}`,n]),onClick:C,children:g?e($e,{}):e(Ce,{})}),p?null:e(We,{minLength:c,requiredCharacterClasses:h,validateLengthConfig:m,uniqueSymbolsStatus:u}),a]})},yr=({disabled:l,name:o="",errorMessage:a,value:t,label:s,className:n,onChange:c,onBlur:i,...d})=>{const _=(d==null?void 0:d.id)||o||`dropin-textarea-${Math.random().toString(36)}`,p=!!(a!=null&&a.length),u=R(m=>{const h=m.target;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,c==null||c(m)},[c]);return e("div",{className:r(["dropin-textarea-container",n]),"data-testid":"dropin-textarea-container",children:[e("textarea",{"data-testid":"dropin-textarea-field",className:r(["dropin-textarea",["dropin-textarea--error",p],["dropin-textarea--disabled",!!l]]),id:_,placeholder:s,name:o,value:t,disabled:l,onBlur:i,onChange:u,...d}),e("label",{htmlFor:_,className:r(["dropin-textarea__label--floating",["dropin-textarea__label--floating--error",p]]),children:s}),p?e("div",{className:r(["dropin-textarea__label--floating--text",["dropin-textarea__label--floating--error",p]]),children:a}):null]})},ze=({className:l,src:o,params:a,loading:t="lazy",srcSet:s,onLoad:n,...c})=>{const[i,d]=V(!1),_=M(()=>{if(s)return s;if(!(!o||!a))return Ne(o,{...a})},[a,o,s]),p=u=>{d(!0),n==null||n(u)};return e("img",{...c,className:r(["dropin-image",["dropin-image--loaded",i],l]),loading:t,onLoad:p,src:o,srcSet:_})},pe=({variant:l="primary",className:o})=>e("hr",{role:"separator",className:r(["dropin-divider",`dropin-divider--${l}`,o])}),B=({amount:l=0,currency:o,locale:a=void 0,variant:t="default",weight:s="bold",className:n,children:c,sale:i=!1,formatOptions:d={},size:_="small",...p})=>{const u=M(()=>new Intl.NumberFormat(a,{style:"currency",currency:o||"USD",minimumFractionDigits:2,maximumFractionDigits:2,...d}),[a,o,d]),m=M(()=>u.format(l),[l,u]);return e("span",{...p,className:r(["dropin-price",`dropin-price--${t}`,`dropin-price--${_}`,`dropin-price--${s}`,["dropin-price--sale",i],n]),children:m})},He=({name:l,label:o,value:a,size:t="medium",checked:s=!1,disabled:n=!1,error:c=!1,description:i="",busy:d=!1,className:_,children:p,...u})=>e("label",{className:r([_,"dropin-radio-button",["dropin-radio-button--error",c],["dropin-radio-button--disabled",n]]),children:[e("input",{name:l,value:a,checked:s,disabled:n,type:"radio",className:r(["dropin-radio-button__input",["dropin-radio-button__input--error",c],["dropin-radio-button__input--disabled",n]]),"aria-busy":d,...u}),e("span",{className:r(["dropin-radio-button__label",`dropin-radio-button__label--${t}`,["dropin-radio-button__label--error",c],["dropin-radio-button__label--disabled",n]]),children:o}),e("span",{className:r(["dropin-radio-button__description",`dropin-radio-button__description--${t}`,["dropin-radio-button__description--disabled",n]]),children:i})]}),q=({value:l,variant:o="primary",size:a="medium",icon:t,className:s,children:n,disabled:c=!1,active:i=!1,activeChildren:d,activeIcon:_,href:p,...u})=>{let m="dropin-button";(t&&!n||t&&i&&!d||!t&&i&&_)&&(m="dropin-iconButton"),i&&d&&(m="dropin-button"),s=r([m,`${m}--${a}`,`${m}--${o}`,[`${m}--${o}--disabled`,c],n&&t&&`${m}--with-icon`,!n&&d&&t&&`${m}--with-icon`,i&&_&&`${m}--with-icon`,s]);const h=r(["dropin-button-icon",`dropin-button-icon--${o}`,[`dropin-button-icon--${o}--disabled`,c],t==null?void 0:t.props.className]),b=p?{node:e("a",{}),role:"link",href:p,...u,disabled:c,active:i,onKeyDown:y=>{c&&y.preventDefault()},tabIndex:c?-1:0}:{node:e("button",{}),role:"button",...u,value:l,disabled:c,active:i};return e(N,{...b,className:s,children:[t&&!i&&e(N,{node:t,className:h}),_&&i&&e(N,{node:_,className:h}),n&&!i&&(typeof n=="string"?e("span",{children:n}):n),i&&d&&(typeof d=="string"?e("span",{children:d}):d)]})},gr=({name:l,value:o=null,options:a,variant:t="primary",floatingLabel:s,size:n="medium",handleSelect:c=()=>{},disabled:i=!1,error:d=!1,placeholder:_,defaultOption:p,icon:u,className:m,...h})=>{var D;const b=(h==null?void 0:h.id)||l||`dropin-picker-${Math.random().toString(36)}`,y=a==null?void 0:a.find(S=>!S.disabled),[k,w]=V({value:o,text:(p==null?void 0:p.text)||_||(y==null?void 0:y.text),icon:u});z(()=>{const S=a==null?void 0:a.find(I=>I.value===o);w(S??{value:(p==null?void 0:p.value)||(_||s?null:y==null?void 0:y.value),text:(p==null?void 0:p.text)||_||(y==null?void 0:y.text),icon:u})},[o,a,_,u,p,s]);const g=S=>{const{options:I,value:L}=S.target;for(const F of I)F.selected&&(w({value:L,text:F.text,icon:u}),c(S))},x=a==null?void 0:a.map(S=>{const{value:I,text:L,disabled:F}=S,j=I===k.value;return e("option",{value:I,selected:j,disabled:F,className:r(["dropin-picker__option"]),children:L},I)}),C=G(null),P=!((D=C.current)!=null&&D.selected)||!!p;return e("div",{className:r([m,"dropin-picker",`dropin-picker__${n}`,["dropin-picker__floating",!!s],["dropin-picker__selected",P],["dropin-picker__error",d],["dropin-picker__disabled",i],["dropin-picker__icon",u]]),children:[u&&e(u.type,{...u.props,className:"dropin-picker__icon--placeholder"}),e("select",{id:b,className:r(["dropin-picker__select",`dropin-picker__select--${t}`,`dropin-picker__select--${n}`,["dropin-picker__select--floating",!!s]]),name:l,"aria-label":l,disabled:i,onChange:g,...h,children:[!p&&(s||_)&&e("option",{value:"",ref:C,className:r(["dropin-picker__option dropin-picker__placeholder"]),children:s??_},o),x]}),e(O,{source:se,size:"24",stroke:"2",className:"dropin-picker__chevronDown"}),s&&P&&e("label",{htmlFor:b,className:r(["dropin-picker__floatingLabel",!!s]),children:s})]})},me=({className:l,label:o,error:a,hint:t,success:s,size:n="medium",disabled:c=!1,children:i,...d})=>{var u;const _=((u=i==null?void 0:i.props)==null?void 0:u.id)??`dropin-field-${Math.random().toString(36)}`,p=i&&typeof i.type!="string"?i.type:null;return e("div",{...d,className:r(["dropin-field",l]),children:[o&&e("label",{className:r(["dropin-field__label",["dropin-field__label--disabled",c],`dropin-field__label--${n}`]),htmlFor:_,children:o}),e("div",{className:r(["dropin-field__content"]),children:p&&i&&ke(p,{...i.props,id:_,key:i.key,disabled:c,size:n,error:!!a,success:!!s&&!a})}),e("div",{className:r(["dropin-field__hint",[`dropin-field__hint--${n}`,n],["dropin-field__hint--error",!!a],["dropin-field__hint--success",!!s&&!a],["dropin-field__hint--disabled",!!c]]),children:a||s||t})]})},Nr=({icon:l,className:o,children:a,active:t=!1,disabled:s=!1,...n})=>e("button",{role:"button",disabled:s,...n,className:r(["dropin-action-button",["dropin-action-button--active",t],["dropin-action-button--disabled",s],o]),children:[l&&e(N,{node:l,className:r(["dropin-action-button-icon"])}),a&&(typeof a=="string"?e("span",{children:a}):a)]}),fr=({className:l,variant:o="primary",activeOption:a,disabled:t=!1,dividers:s=!0,children:n,handleSelect:c,...i})=>{const[d,_]=V(a),p=R(m=>{t||m.props.disabled||(_(m.props.value),c&&c(m.props.value))},[c,_,t]),u=ae.map(n,m=>{const h=t||m.props.disabled,b=m.props.value===d;return xe(m,{disabled:h,active:b,onClick:()=>p(m),className:r(["dropin-action-button-group__option",`dropin-action-button-group__option--${o}`,["dropin-action-button-group__option--active",b],["dropin-action-button-group__option--with-dividers",s]])})});return e("div",{role:"group",...i,className:r(["dropin-action-button-group",`dropin-action-button-group--${o}`,l]),children:u})},Me=({variant:l="primary",className:o,children:a,...t})=>e("div",{...t,className:r(["dropin-card",`dropin-card--${l}`,o]),children:e("div",{class:"dropin-card__content",children:a})}),vr=({name:l,value:o,size:a="medium",disabled:t=!1,error:s=!1,label:n="",description:c="",className:i,checked:d,..._})=>{const[p,u]=V(d===void 0?!1:d),m=G(null),h=y=>{var k;(k=_.onChange)==null||k.call(_,y),u(y.currentTarget.checked)},b=y=>{var k;y.key===" "&&(y.preventDefault(),(k=m==null?void 0:m.current)==null||k.click())};return e("label",{className:r(["dropin-checkbox",["dropin-checkbox--disabled",t]]),children:[e("input",{ref:m,name:l,value:o,type:"checkbox",disabled:t,className:r(["dropin-checkbox__checkbox",["dropin-checkbox__checkbox--error",s],i]),..._,onChange:h,checked:p}),e("span",{"aria-checked":p?"true":"false","aria-labelledby":`${l}-label`,"aria-describedby":`${l}-description`,className:r(["dropin-checkbox__box",["dropin-checkbox__box--error",s],["dropin-checkbox__box--disabled",t]]),role:"checkbox",tabIndex:t?-1:0,onKeyDown:b,children:e(O,{className:r(["dropin-checkbox__checkmark"]),source:oe,size:"16",stroke:"3"})}),e("div",{id:`${l}-label`,className:r(["dropin-checkbox__label",`dropin-checkbox__label--${a}`,["dropin-checkbox__label--disabled",t]]),children:n}),e("div",{}),e("div",{id:`${l}-description`,role:"note",className:r(["dropin-checkbox__description",`dropin-checkbox__description--${a}`,["dropin-checkbox__description--disabled",t]]),children:c})]})},wr=({className:l,name:o,value:a,id:t,label:s,groupAriaLabel:n,size:c="medium",color:i,disabled:d=!1,selected:_=!1,outOfStock:p=!1,multi:u=!1,onValue:m,onUpdateError:h,...b})=>{const y=E("Dropin.Swatches.outOfStock.label").label,k=E("Dropin.Swatches.selected.label").label,w=E("Dropin.Swatches.swatch.label").label,g=R(async I=>{if(m)try{await m(I)}catch(L){h&&h(L)}},[m,h]),x=I=>{const L=I.target;g(L.value)},D=i&&(I=>{const L=new Option().style;return L.color=I,L.color!==""})(i)?i:"var(--color-gray-300);",S=()=>p?`${n}: ${s} ${y}`:_?`${n}: ${s} ${k}`:`${n}: ${s} ${w}`;return e("label",{className:r(["dropin-color-swatch__container",`dropin-color-swatch__container--${c}`,l]),children:[e("input",{type:u?"checkbox":"radio",name:o,id:t,value:a,"aria-label":S(),checked:_,disabled:d,onChange:x,...b,className:r(["dropin-color-swatch",["dropin-color-swatch--selected",_],["dropin-color-swatch--disabled",d],l])}),e("span",{style:{"--bg-color":D},className:r(["dropin-color-swatch__span",["dropin-color-swatch__span--out-of-stock",p],l])})]})},kr=({className:l,name:o,value:a,label:t,groupAriaLabel:s,id:n,disabled:c=!1,selected:i=!1,outOfStock:d=!1,multi:_=!1,onValue:p,onUpdateError:u,...m})=>{const h=E("Dropin.Swatches.outOfStock.label").label,b=E("Dropin.Swatches.selected.label").label,y=E("Dropin.Swatches.swatch.label").label,[k,w]=V(!1),g=G(null),x=R(async D=>{if(p)try{await p(D)}catch(S){u&&u(S)}},[p,u]),C=D=>{const S=D.target;x(S.value)},P=()=>d?`${s}: ${t} ${h}`:i?`${s}: ${t} ${b}`:`${s}: ${t} ${y}`;return z(()=>{g.current&&g.current.scrollWidth>g.current.clientWidth&&w(!0)},[t]),e("div",{className:"dropin-text-swatch__container",...k?{"data-tooltip":t}:{},children:[e("input",{type:_?"checkbox":"radio",name:o,id:n,value:a,"aria-label":P(),checked:i,disabled:c,onChange:C,...m,className:r(["dropin-text-swatch",["dropin-text-swatch--selected",i],["dropin-text-swatch--disabled",c],l])}),e("label",{htmlFor:n,ref:g,className:r(["dropin-text-swatch__label",["dropin-text-swatch__label--out-of-stock",d],l]),children:t})]})},Ke=({ariaLabel:l,size:o="small",stroke:a="4",children:t,className:s,style:n,...c})=>{const i=["dropin-progress-spinner",`dropin-progress-spinner--shape-size-${o}`,`dropin-progress-spinner--shape-stroke-${a}`],d=E({updating:"Dropin.ProgressSpinner.updating.label",updatingChildren:"Dropin.ProgressSpinner.updatingChildren.label"}),_=()=>l||(t?d.updatingChildren:d.updating);return t?e("div",{...c,className:r(["dropin-progress-spinner-provider"]),"aria-live":"polite",role:"status",children:[e("div",{"aria-hidden":!0,children:t}),e("div",{"aria-label":_(),role:"status",className:r(["dropin-progress-spinner-background",s]),style:n}),e("div",{className:r(["dropin-progress-spinner-with-provider",...i]),"aria-hidden":!0})]}):e("div",{...c,className:r([s,...i]),"aria-live":"polite",role:"status","aria-label":_()})},xr=({className:l,name:o,value:a,id:t,label:s,groupAriaLabel:n,src:c,alt:i,disabled:d=!1,selected:_=!1,outOfStock:p=!1,multi:u=!1,onValue:m,onUpdateError:h,...b})=>{const y=E("Dropin.Swatches.outOfStock.label").label,k=E("Dropin.Swatches.selected.label").label,w=E("Dropin.Swatches.swatch.label").label,g=R(async P=>{if(m)try{await m(P)}catch(D){h&&h(D)}},[m,h]),x=P=>{const D=P.target;g(D.value)},C=()=>p?`${n}: ${s} ${y}`:_?`${n}: ${s} ${k}`:`${n}: ${s} ${w}`;return e("label",{className:r(["dropin-image-swatch__container",l]),children:[e("input",{type:u?"checkbox":"radio",name:o,id:t,value:a,"aria-label":C(),checked:_,disabled:d,onChange:x,...b,className:r(["dropin-image-swatch",["dropin-image-swatch--selected",_],["dropin-image-swatch--disabled",d],l])}),e("span",{className:r(["dropin-image-swatch__span",["dropin-image-swatch__span--out-of-stock",p],l]),children:e(ze,{src:c,className:r(["dropin-image-swatch__content"]),params:{width:100,fit:"bounds",crop:!0},alt:i,loading:"lazy",onError:P=>P.target.style.display="none"})})]})},_e=({className:l,children:o,title:a,secondaryText:t,actionIconPosition:s="left",iconOpen:n=K,iconClose:c=U,iconLeft:i=K,showIconLeft:d=!1,renderContentWhenClosed:_=!0,onStateChange:p,...u})=>{const[m,h]=V(!1),b=x=>{x.stopImmediatePropagation();const C=!m;h(C),p==null||p(C)},y=E(`Dropin.Accordion.${m?"close":"open"}.label`).label,k=e(O,{source:n,size:"24",onClick:b,onKeyPress:b,className:"dropin-accordion-section__open-icon"}),w=e(O,{source:c,size:"24",onClick:b,onKeyPress:b,className:"dropin-accordion-section__close-icon"}),g=e(O,{source:i,size:"24"});return e("div",{...u,className:r(["dropin-accordion-section",l]),children:[e("div",{className:"dropin-accordion-section__heading",children:[e("div",{className:"dropin-accordion-section__flex",onClick:b,onKeyPress:b,role:"button","aria-label":`${y} ${a}`,tabIndex:0,children:e("div",{className:"dropin-accordion-section__title-container",children:[s==="left"&&(m?w:k),d&&g,e("h3",{className:"dropin-accordion-section__title",children:a})]})}),e("div",{className:"dropin-accordion-section__secondary-text-container",children:[t&&e("h4",{className:"dropin-accordion-section__secondary-text",children:t}),s==="right"&&(m?w:k)]})]}),e("div",{className:"dropin-accordion-section__content-container",style:{display:m?"grid":"none"},children:(m||_&&!m)&&o})]})},Ge=({className:l,children:o,actionIconPosition:a="left",iconOpen:t=K,iconClose:s=U,...n})=>{const c=e(pe,{variant:"secondary"}),i=d=>e(A,{children:[e(_e,{...d.props,actionIconPosition:a,iconOpen:t,iconClose:s}),c]});return e("div",{...n,className:r(["dropin-accordion",l]),children:[c,...(Array.isArray(o)?o:[o]).map(i)]})},Dr=({variant:l="primary",className:o,type:a="warning",additionalActions:t,onDismiss:s,heading:n,description:c,icon:i,itemList:d,actionButtonPosition:_,...p})=>{var m,h,b;const u=E({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...p,className:r(["dropin-in-line-alert",`dropin-in-line-alert--${a}`,`dropin-in-line-alert--${l}`,o]),children:[e("div",{className:"dropin-in-line-alert__heading",children:[e("div",{className:"dropin-in-line-alert__title-container",children:[i&&e(N,{node:i,className:"dropin-in-line-alert__icon"}),e("span",{className:"dropin-in-line-alert__title",children:n})]}),e("div",{className:"dropin-in-line-alert__actions-container",children:[t&&(_==="top"||!_&&t.length<=1)&&e(q,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:t.length>0?(m=t[0])==null?void 0:m.onClick:void 0,"aria-label":(h=t[0])==null?void 0:h.label,children:(b=t[0])==null?void 0:b.label}),s&&e(q,{icon:e(O,{source:Z,size:"24",stroke:"2"}),className:"dropin-in-line-alert__dismiss-button",variant:"tertiary",onClick:s,"aria-label":u.dismiss})]})]}),c&&e("p",{className:"dropin-in-line-alert__description",children:c}),e("div",{className:"dropin-in-line-alert__item-list-container",children:d&&e(N,{node:d,className:r(["dropin-in-line-alert__item-list"])})}),t&&(_==="bottom"||!_&&t.length>1)&&e("div",{className:"dropin-in-line-alert__additional-actions-container",children:t.map(y=>e(q,{variant:"tertiary",className:"dropin-in-line-alert__additional-action",onClick:y.onClick,children:y.label},y.label))})]})},Sr=({size:l="small",title:o=null,centered:a=!1,backgroundDim:t=!0,clickToDismiss:s=!0,escapeToDismiss:n=!0,onClose:c,showCloseButton:i=!0,className:d,children:_=null,...p})=>{const u=R(()=>{c==null||c()},[c]),m=E({modalCloseLabel:"Dropin.Modal.Close.label"});return z(()=>{const h=b=>{const y=document.querySelector(".dropin-modal"),k=document.querySelector(".dropin-modal__body");s&&y&&k&&!k.contains(b.target)&&u()};return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[u,s]),z(()=>{const h=b=>{b.key==="Escape"&&n&&u()};return document.addEventListener("keydown",h),()=>{document.removeEventListener("keydown",h)}},[u,n]),z(()=>{const h=document.scrollingElement,b=h.style.overflow;return h.style.overflow="hidden",()=>{h.style.overflow=b}},[]),e("div",{className:r(["dropin-modal",["dropin-modal--dim",t]]),children:e("div",{...p,className:r(["dropin-modal__body",[`dropin-modal__body--${l}`,l],d]),children:[e("div",{className:r(["dropin-modal__header",["dropin-modal__header-title",!!o]]),children:[o&&e("div",{className:r(["dropin-modal__header-title-content"]),children:o}),i&&e(q,{"aria-label":m.modalCloseLabel,variant:"tertiary",className:"dropin-modal__header-close-button",onClick:u,icon:e(Z,{})})]}),e("div",{className:r(["dropin-modal__content",["dropin-modal__body--centered",a]]),children:_})]})})},Er=({className:l,children:o,ariaLabel:a,image:t,title:s,price:n,taxIncluded:c=!1,taxExcluded:i=!1,total:d,totalExcludingTax:_,sku:p,configurations:u,warning:m,alert:h,quantity:b=1,description:y,loading:k=!1,updating:w=!1,onQuantity:g,onRemove:x,...C})=>{var S,I;const{locale:P}=De(ce),D=E({each:"Dropin.CartItem.each.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"});return k?e(Ue,{}):e("div",{...C,className:r(["dropin-cart-item",["dropin-cart-item--updating",w],l]),children:[w&&e(Ke,{className:r(["dropin-cart-item__spinner"]),ariaLabel:a?(S=D.updating)==null?void 0:S.replace("{product}",a):D.updatingDefault}),e("div",{className:"dropin-cart-item__wrapper",children:[e(N,{node:t,className:r(["dropin-cart-item__image"])}),e(N,{node:s,className:r(["dropin-cart-item__title",["dropin-cart-item__title--edit",!!g||!!x]])}),y&&e(N,{node:y,className:r(["dropin-cart-item__description"])}),e(N,{node:p,className:r(["dropin-cart-item__sku"])}),u&&e("ul",{className:r(["dropin-cart-item__configurations"]),children:Object.entries(u).map(([L,F])=>e("li",{className:r(["dropin-cart-item__configurations__item"]),children:[L,":"," ",e("strong",{className:r(["dropin-cart-item__configurations__item__value"]),children:F})]},L))}),e("span",{className:r(["dropin-cart-item__price"]),children:[!g&&e("span",{className:"dropin-cart-item__price__quantity",children:[b.toLocaleString(P)," x"," "]}),e(N,{node:n,role:"text"}),b>1&&e(A,{children:[" ",D.each]}),c&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",D.taxIncluded]}),i&&e("span",{"data-testid":"tax-message",className:"dropin-cart-item__price-tax-message",children:[" ",D.taxExcluded]})]}),e("div",{className:r(["dropin-cart-item__quantity",["dropin-cart-item__quantity--edit",!!g]]),children:[g?e(qe,{className:r(["dropin-cart-item__quantity__incrementer"]),value:b,min:1,onValue:L=>g==null?void 0:g(Number(L)),name:"quantity","aria-label":D.quantity,disabled:w}):e("span",{className:r(["dropin-cart-item__quantity__value"]),children:[D.quantity,":"," ",e("strong",{className:"dropin-cart-item__quantity__number",children:Number(b).toLocaleString(P)})]}),m&&e(N,{node:m,className:r(["dropin-cart-item__warning","dropin-cart-item__warning--quantity"])}),h&&e(N,{node:h,className:r(["dropin-cart-item__alert","dropin-cart-item__alert--quantity"])})]}),m&&e(N,{node:m,className:r(["dropin-cart-item__warning"])}),h&&e(N,{node:h,className:r(["dropin-cart-item__alert"])}),e("div",{className:r(["dropin-cart-item__total",["dropin-cart-item__total--edit",!!x]]),children:[e("div",{className:"dropin-cart-item__row-total",children:e(N,{node:d,role:"text"})}),c&&e("div",{className:"dropin-cart-item__total-tax-included",children:e("span",{"data-testid":"tax-message",className:r(["dropin-cart-item__total-tax-message"]),children:D.taxIncluded})}),i&&e("div",{className:"dropin-cart-item__total-tax-excluded",children:e("span",{"data-testid":"tax-message",className:r(["dropin-cart-item__total-tax-excluded-message"]),children:[_&&e(N,{node:_,role:"text"})," ",D.taxExcluded]})})]})]}),x&&e(q,{className:r(["dropin-cart-item__remove"]),variant:"tertiary",onClick:()=>x==null?void 0:x(),icon:e(O,{source:Le,size:"24",stroke:"2",viewBox:"0 0 24 24","aria-label":a?(I=D.remove)==null?void 0:I.replace("{product}",a):D.removeDefault}),disabled:w})]})},Ue=()=>e("div",{className:"dropin-cart-item dropin-cart-item-skeleton",children:e(le,{className:"dropin-cart-item__skeleton dropin-cart-item__wrapper",children:[e("div",{className:"dropin-cart-item__image",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__title",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__sku",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__price",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__quantity",children:e(W,{className:"dropin-cart-item__skeleton__item"})}),e("div",{className:"dropin-cart-item__total",children:e(W,{className:"dropin-cart-item__skeleton__item"})})]})}),Tr=({className:l,children:o,...a})=>{const{heading:t,loading:s=!0,total:n,subTotal:c,shipping:i,taxTotal:d,taxesApplied:_,discounts:p,primaryAction:u,...m}=a,[h,b]=V(!1),y=G(null),[k,w]=V(!0),[g,x]=V("zip"),C=E({editZipAction:"Dropin.PriceSummary.shipping.editZipAction",destinationLinkAriaLabel:"Dropin.PriceSummary.shipping.destinationLinkAriaLabel",taxesBreakdownTitle:"Dropin.PriceSummary.taxes.breakdown",subtotalLabel:"Dropin.PriceSummary.subTotal.label",shippingLabel:"Dropin.PriceSummary.shipping.label",showTaxBreakdown:"Dropin.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"Dropin.PriceSummary.taxes.hideBreakdown",zipPlaceholder:"Dropin.PriceSummary.shipping.zipPlaceholder"}),P=T=>{T.preventDefault(),w(H=>!H)},D=T=>{T.preventDefault(),w(!0),x(H=>H==="zip"?"state":"zip")},S=T=>{var X;T.preventDefault(),w(!1);const H=fe(y.current);(X=i==null?void 0:i.onEstimate)==null||X.call(i,H)},I=e(le,{"data-testid":"loading-skeleton",rowGap:"xsmall",children:e(W,{variant:"row",size:"small",lines:5,fullWidth:!0,multilineGap:"xsmall"})}),L=()=>i?i.estimated?i.destinationText?e(A,{children:[e($,{id:"Dropin.PriceSummary.shipping.estimatedDestination"}),e("a",{className:"dropin-price-summary__shippingLink",role:"button",href:"",onClick:P,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&P(T)},tabIndex:0,"aria-label":C.destinationLinkAriaLabel,"aria-expanded":k,"data-testid":"shipping-destination-link",children:i.destinationText})]}):e($,{id:"Dropin.PriceSummary.shipping.estimated"}):e($,{id:"Dropin.PriceSummary.shipping.label"}):null,F=i&&e(A,{children:e("div",{"data-testid":"shipping-content",className:r(["dropin-price-summary__entry","dropin-price-summary__shipping"]),children:[e("span",{className:"dropin-price-summary__label",children:L()}),e(N,{node:i.price,className:"dropin-price-summary__price"}),i.estimated&&e(A,{children:e("div",{className:r(["dropin-price-summary__caption"]),children:e("a",{href:"#",className:"dropin-price-summary__shippingLink",onClick:D,"data-testid":"shipping-alternate-field-link",children:g==="zip"?e($,{id:"Dropin.PriceSummary.shipping.alternateField.state"}):e($,{id:"Dropin.PriceSummary.shipping.alternateField.zip"})})})}),i.estimated&&e(A,{children:e("form",{className:r(["dropin-price-summary__shipping--edit",["dropin-price-summary__shipping--hide",!k]]),ref:y,"data-testid":"shipping-estimate-form",children:[i.countryField&&e(N,{node:i.countryField,className:r(["dropin-price-summary__shipping--country"])}),g==="state"?i.stateField&&e(N,{node:i.stateField,className:r(["dropin-price-summary__shipping--state"])}):i.zipField&&e(N,{node:i.zipField,className:r(["dropin-price-summary__shipping--zip"])}),i.estimateButton&&e(N,{node:i.estimateButton,className:r(["dropin-price-summary__shipping--action"]),onClick:S,type:"submit"})]})}),i.taxIncluded&&e("div",{"data-testid":"shipping-tax-included",className:r(["dropin-price-summary__caption"]),children:e("span",{children:e($,{id:"Dropin.PriceSummary.shipping.withTaxes"})})}),i.taxExcluded?e("div",{"data-testid":"shipping-tax-included-excluded",className:r(["dropin-price-summary__caption"]),children:e("span",{children:[i.priceExcludingTax," ",e($,{id:"Dropin.PriceSummary.shipping.withoutTaxes"})]})}):void 0]})}),j=p&&e(A,{children:p.map(T=>e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__discount"]),children:[e("span",{className:r(["dropin-price-summary__label"]),children:T.label}),e(N,{node:T.price,className:r(["dropin-price-summary__price"])}),T.caption&&e(N,{node:T.caption,className:r(["dropin-price-summary__caption"])})]},T.label))}),ue=_?e(A,{children:e(Ge,{"data-testid":"tax-breakdown",className:"dropin-price-summary__taxes",iconOpen:se,iconClose:Ae,children:e(_e,{title:C.taxesBreakdownTitle,secondaryText:!h&&d?e(N,{node:d.price,className:"dropin-price-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:b,children:[e("div",{className:r(["dropin-price-summary__appliedTaxes"]),children:_.map(T=>e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__taxEntry"]),children:[e("span",{className:r(["dropin-price-summary__label","dropin-price-summary__label--muted"]),children:T.label}),e(N,{node:T.price,className:r(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]},T.label))}),e("div",{className:r(["dropin-price-summary__entry"]),children:[e("span",{className:"dropin-price-summary__label",children:e($,{id:"Dropin.PriceSummary.taxes.total"})}),d&&e(N,{node:d.price,className:"dropin-price-summary__price"})]})]})})}):d&&e("div",{"data-testid":"tax-total-only",className:r(["dropin-price-summary__entry","dropin-price-summary__taxTotal"]),children:[e("span",{className:"dropin-price-summary__label",children:d.estimated?e($,{id:"Dropin.PriceSummary.taxes.estimated"}):e($,{id:"Dropin.PriceSummary.taxes.totalOnly"})}),e(N,{node:d.price,className:"dropin-price-summary__price"})]}),he=n&&e(A,{children:e("div",{"data-testid":"total-content",className:r(["dropin-price-summary__entry","dropin-price-summary__total",n.estimated&&"dropin-price-summary__total--padded"]),children:[e("span",{className:r(["dropin-price-summary__label","dropin-price-summary__label--bold"]),children:n.estimated?e($,{id:"Dropin.PriceSummary.total.estimated"}):e($,{id:"Dropin.PriceSummary.total.label"})}),e(N,{node:n.price,className:r(["dropin-price-summary__price","dropin-price-summary__price--bold"])})]})}),be=n&&n.priceWithoutTax&&e("div",{"data-testid":"total-without-tax",className:"dropin-price-summary__entry dropin-price-summary__totalWithoutTax",children:[e("span",{className:r(["dropin-price-summary__label","dropin-price-summary__label--muted"]),children:e($,{id:"Dropin.PriceSummary.total.withoutTax"})}),e(N,{node:n.priceWithoutTax,className:r(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]}),ye=u&&e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__primaryAction"]),children:u}),ge=c&&e("div",{className:r(["dropin-price-summary__entry","dropin-price-summary__subTotal"]),children:[e("span",{className:"dropin-price-summary__label",children:e($,{id:"Dropin.PriceSummary.subTotal.label"})}),e(N,{node:c.price,className:"dropin-price-summary__price"}),c.taxIncluded&&e("div",{"data-testid":"sub-total-tax-caption",className:r(["dropin-price-summary__caption"]),children:e("span",{children:e($,{id:"Dropin.PriceSummary.subTotal.withTaxes"})})}),c.taxExcluded?e("div",{"data-testid":"sub-total-tax-caption-excluded",className:r(["dropin-price-summary__caption"]),children:e("span",{children:[c.priceExcludingTax," ",e($,{id:"Dropin.PriceSummary.subTotal.withoutTaxes"})]})}):void 0]});return e("div",{...m,className:r(["dropin-price-summary",l]),children:[e("div",{className:"dropin-price-summary__heading",children:t}),e(pe,{variant:"primary",className:"dropin-price-summary__divider-primary"}),s?I:e(A,{children:[ge,F,j,ue,he,be,ye]})]})},Pr=({className:l,children:o,...a})=>e("div",{...a,className:r(["dropin-cart-list",l]),children:e("div",{className:"dropin-cart-list__wrapper","aria-live":"assertive","aria-relevant":"all",children:ae.map(o,(t,s)=>e("div",{className:"dropin-cart-list__item",children:t},s))})}),Ir=({className:l,children:o,locale:a,currency:t,amount:s,variant:n="default",minimumAmount:c,maximumAmount:i,size:d="small",display:_="dash",specialPrice:p,sale:u=!1,...m})=>{const h=M(()=>s||c===i||c&&!i||i&&!c,[s,i,c]);return e("div",{children:h?e("div",{...m,className:r(["dropin-price-range",l]),children:e(B,{amount:s??c??i,currency:t,locale:a,size:d,variant:n,sale:u})}):e("div",{...m,className:r(["dropin-price-range",l]),children:[_==="dash"?e(Ze,{specialPrice:p,minimumAmount:c,maximumAmount:i,currency:t,locale:a,size:d,sale:u}):null,_==="from to"?e(je,{specialPrice:p,minimumAmount:c,maximumAmount:i,currency:t,locale:a,size:d,sale:u}):null,_==="as low as"?e(Je,{specialPrice:p,minimumAmount:c,maximumAmount:i,currency:t,locale:a,size:d,sale:u}):null]})})};function Ze({specialPrice:l,minimumAmount:o,maximumAmount:a,currency:t,locale:s,size:n,sale:c}){return e(A,{children:[e(B,{amount:l??o,currency:t,locale:s,size:n,sale:!!l&&c}),e("span",{className:"dropin-price-range__separator",children:"-"}),e(B,{amount:a,currency:t,locale:s,size:n})]})}function je({specialPrice:l,minimumAmount:o,maximumAmount:a,currency:t,locale:s,size:n,sale:c}){const i=E({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(A,{children:[e("span",{className:r(["dropin-price-range__from",`dropin-price-range__from--${n}`]),children:i.from}),e(B,{amount:l??o,currency:t,locale:s,size:n,sale:!!l&&c}),e("span",{className:r(["dropin-price-range__to",`dropin-price-range__to--${n}`]),children:i.to}),e(B,{amount:a,currency:t,locale:s,size:n})]})}function Je({specialPrice:l,minimumAmount:o,maximumAmount:a,currency:t,locale:s,size:n,sale:c}){const i=E({from:"Dropin.PriceRange.from.label",to:"Dropin.PriceRange.to.label",asLowAs:"Dropin.PriceRange.asLowAs.label"});return e(A,{children:[e("span",{className:r(["dropin-price-range__as-low-as",`dropin-price-range__as-low-as--${n}`]),children:i.asLowAs}),l?e("div",{children:[e(B,{amount:a,currency:t,locale:s,size:n,variant:"strikethrough"}),e(B,{amount:l,currency:t,locale:s,size:n,className:"dropin-price-range__special",sale:!!l&&c})]}):e(B,{amount:o,currency:t,locale:s,size:n})]})}const $r=({className:l,categories:o,separator:a,...t})=>e(A,{children:(o==null?void 0:o.length)>1&&e("nav",{role:"navigation",...t,className:r(["dropin-breadcrumbs__container",l]),children:e("ul",{className:"dropin-breadcrumbs__items",children:o==null?void 0:o.map((s,n)=>e("li",{className:r(["dropin-breadcrumbs__item",["dropin-breadcrumbs__item--last",n===o.length-1]]),children:[e(N,{node:s,className:"dropin-breadcrumbs__link"}),!a&&n!==o.length-1&&e("span",{className:"dropin-breadcrumbs__separator--default",children:[" ","/"," "]}),a&&n!==o.length-1&&e(N,{node:a,className:"dropin-breadcrumbs__separator--icon"})]},n))})})}),Cr=({className:l,variant:o,icon:a,message:t,onDismiss:s,action:n,...c})=>{const i=E({dismiss:"Dropin.InlineAlert.dismissLabel"});return e("div",{...c,className:r([l,"dropin-alert-banner",`dropin-alert-banner--${o}`]),children:[e("div",{className:"dropin-alert-banner__content",children:[a&&e(N,{node:a,"aria-hidden":"true",className:"dropin-alert-banner__icon"}),e(N,{node:t,className:r(["dropin-alert-banner__message"])})]}),e("div",{className:"dropin-alert-banner__actions",children:[n&&e(q,{variant:"tertiary",className:"dropin-alert-banner__action",onClick:n.onClick,"aria-label":n.label,children:n.label}),e(q,{icon:e(O,{source:Z,size:"24",stroke:"2"}),className:"dropin-alert-banner__dismiss-button",variant:"primary",onClick:s,"aria-label":i.dismiss})]})]})},Lr=({className:l,icon:o,heading:a,headingLevel:t=2,message:s,action:n,variant:c="secondary",...i})=>{const d=t>=1&&t<=6?`h${t}`:"h2";return e("div",{...i,className:r(["dropin-illustrated-message",l]),children:e(Me,{variant:c,children:[o&&e(N,{node:o,"aria-hidden":"true",size:"80",className:"dropin-illustrated-message__icon"}),a&&e(d,{className:"dropin-illustrated-message__heading",children:a}),s&&e(N,{node:s,className:"dropin-illustrated-message__message"}),n&&e(N,{node:n,className:"dropin-illustrated-message__action"})]})})},Ar=({className:l,label:o,name:a,value:t,selected:s=!0,onChange:n,icon:c,busy:i=!1,children:d,..._})=>e("div",{..._,className:r(["dropin-toggle-button",l,["dropin-toggle-button__selected",s]]),children:e("label",{className:"dropin-toggle-button__actionButton",children:[e(He,{label:"",name:a,value:t,checked:s,onChange:()=>n&&n(t),"aria-label":o,busy:i,className:r([l,"dropin-toggle-button__radioButton"])}),e("span",{className:"dropin-toggle-button__content",children:[c&&e(c.type,{...c==null?void 0:c.props,className:"dropin-toggle-button__icon"}),o]})]})});export{Ge as Accordion,_e as AccordionSection,Nr as ActionButton,fr as ActionButtonGroup,Cr as AlertBanner,$r as Breadcrumbs,q as Button,Me as Card,Er as CartItem,Ue as CartItemSkeleton,Pr as CartList,vr as Checkbox,wr as ColorSwatch,pe as Divider,me as Field,O as Icon,Lr as IllustratedMessage,ze as Image,xr as ImageSwatch,Dr as InLineAlert,qe as Incrementer,de as Input,hr as InputDate,br as InputPassword,Sr as Modal,gr as Picker,B as Price,Ir as PriceRange,Tr as PriceSummary,Ke as ProgressSpinner,He as RadioButton,le as Skeleton,W as SkeletonRow,yr as TextArea,kr as TextSwatch,Ar as ToggleButton,ce as UIContext,ur as UIProvider};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/tools", "version": "0.27.
|
|
1
|
+
{"name": "@dropins/tools", "version": "0.27.1-alpha585"}
|
|
@@ -3,6 +3,8 @@ import { PasswordStatusIndicatorProps } from './PasswordStatusIndicator';
|
|
|
3
3
|
import { HTMLAttributes } from 'preact/compat';
|
|
4
4
|
|
|
5
5
|
export interface InputPasswordProps extends PasswordStatusIndicatorProps, Omit<HTMLAttributes<HTMLDivElement>, 'minLength'> {
|
|
6
|
+
placeholder: string;
|
|
7
|
+
floatingLabel: string;
|
|
6
8
|
defaultValue?: string;
|
|
7
9
|
error?: boolean;
|
|
8
10
|
className?: string;
|
|
@@ -20,6 +20,7 @@ export declare const definition: {
|
|
|
20
20
|
InputPassword: {
|
|
21
21
|
requiredFieldError: string;
|
|
22
22
|
placeholder: string;
|
|
23
|
+
floatingLabel: string;
|
|
23
24
|
buttonTitle: string;
|
|
24
25
|
};
|
|
25
26
|
PasswordStatusIndicator: {
|
|
@@ -151,6 +152,7 @@ export declare const definition: {
|
|
|
151
152
|
InputPassword: {
|
|
152
153
|
requiredFieldError: string;
|
|
153
154
|
placeholder: string;
|
|
155
|
+
floatingLabel: string;
|
|
154
156
|
buttonTitle: string;
|
|
155
157
|
};
|
|
156
158
|
PasswordStatusIndicator: {
|
|
@@ -284,6 +286,7 @@ export declare const getDefinitionByLanguage: (lang: Lang) => {
|
|
|
284
286
|
InputPassword: {
|
|
285
287
|
requiredFieldError: string;
|
|
286
288
|
placeholder: string;
|
|
289
|
+
floatingLabel: string;
|
|
287
290
|
buttonTitle: string;
|
|
288
291
|
};
|
|
289
292
|
PasswordStatusIndicator: {
|