@dropins/tools 2.0.0-alpha-20260618145240 → 2.0.0-alpha-20260625173003

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.
Files changed (136) hide show
  1. package/CHANGELOG.md +4 -11
  2. package/chunks/Image.js +1 -250
  3. package/chunks/Image.js.map +1 -1
  4. package/chunks/cjs.js +1 -77
  5. package/chunks/cjs.js.map +1 -1
  6. package/chunks/get-path-value.js +1 -15
  7. package/chunks/get-path-value.js.map +1 -1
  8. package/chunks/get-price-formatter.js +1 -43
  9. package/chunks/get-price-formatter.js.map +1 -1
  10. package/chunks/icons.js +1 -212
  11. package/chunks/icons.js.map +1 -1
  12. package/chunks/image-params-keymap.js +1 -27
  13. package/chunks/image-params-keymap.js.map +1 -1
  14. package/chunks/initializer.js +3 -96
  15. package/chunks/initializer.js.map +1 -1
  16. package/chunks/locale-config.js +1 -27
  17. package/chunks/locale-config.js.map +1 -1
  18. package/chunks/preact-vendor.js +13 -1392
  19. package/chunks/preact-vendor.js.map +1 -1
  20. package/chunks/vcomponent.js +2 -152
  21. package/chunks/vcomponent.js.map +1 -1
  22. package/components.d.ts +1 -2
  23. package/components.js +1 -3763
  24. package/components.js.map +1 -1
  25. package/event-bus.d.ts +1 -2
  26. package/event-bus.js +1 -74
  27. package/event-bus.js.map +1 -1
  28. package/fetch-graphql.d.ts +1 -2
  29. package/fetch-graphql.js +1 -323
  30. package/fetch-graphql.js.map +1 -1
  31. package/i18n.d.ts +0 -1
  32. package/i18n.js +1 -13
  33. package/i18n.js.map +1 -1
  34. package/initializer.d.ts +1 -2
  35. package/initializer.js +3 -8
  36. package/initializer.js.map +1 -1
  37. package/lib/aem/assets.d.ts +1 -2
  38. package/lib/aem/assets.js +1 -124
  39. package/lib/aem/assets.js.map +1 -1
  40. package/lib/aem/configs.d.ts +1 -2
  41. package/lib/aem/configs.js +1 -61
  42. package/lib/aem/configs.js.map +1 -1
  43. package/lib.d.ts +1 -2
  44. package/lib.js +1 -289
  45. package/lib.js.map +1 -1
  46. package/package.json +1 -1
  47. package/preact-compat.d.ts +0 -1
  48. package/preact-compat.js +1 -49
  49. package/preact-compat.js.map +1 -1
  50. package/preact-hooks.d.ts +0 -1
  51. package/preact-hooks.js +1 -15
  52. package/preact-hooks.js.map +1 -1
  53. package/preact-jsx-runtime.d.ts +0 -1
  54. package/preact-jsx-runtime.js +1 -10
  55. package/preact-jsx-runtime.js.map +1 -1
  56. package/preact.d.ts +0 -1
  57. package/preact.js +1 -15
  58. package/preact.js.map +1 -1
  59. package/recaptcha.d.ts +1 -2
  60. package/recaptcha.js +6 -330
  61. package/recaptcha.js.map +1 -1
  62. package/shims/importmap.d.ts +1 -1
  63. package/shims/importmap.js +15 -1772
  64. package/shims/importmap.js.map +1 -1
  65. package/signals.d.ts +1 -2
  66. package/signals.js +1 -402
  67. package/signals.js.map +1 -1
  68. package/types/elsie/src/components/Accordion/Accordion.d.ts +1 -0
  69. package/types/elsie/src/components/ActionButton/ActionButton.d.ts +1 -0
  70. package/types/elsie/src/components/ActionButtonGroup/ActionButtonGroup.d.ts +1 -0
  71. package/types/elsie/src/components/AlertBanner/AlertBanner.d.ts +1 -0
  72. package/types/elsie/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -0
  73. package/types/elsie/src/components/Button/Button.d.ts +1 -0
  74. package/types/elsie/src/components/Card/Card.d.ts +1 -0
  75. package/types/elsie/src/components/CartItem/CartItem.d.ts +1 -0
  76. package/types/elsie/src/components/CartItem/CartItemSkeleton.d.ts +1 -0
  77. package/types/elsie/src/components/CartList/CartList.d.ts +1 -0
  78. package/types/elsie/src/components/Checkbox/Checkbox.d.ts +1 -0
  79. package/types/elsie/src/components/ColorSwatch/ColorSwatch.d.ts +1 -0
  80. package/types/elsie/src/components/ContentGrid/ContentGrid.d.ts +1 -0
  81. package/types/elsie/src/components/Divider/Divider.d.ts +1 -0
  82. package/types/elsie/src/components/Field/Field.d.ts +1 -0
  83. package/types/elsie/src/components/Header/Header.d.ts +1 -0
  84. package/types/elsie/src/components/Icon/Icon.d.ts +1 -0
  85. package/types/elsie/src/components/IllustratedMessage/IllustratedMessage.d.ts +1 -0
  86. package/types/elsie/src/components/Image/Image.d.ts +1 -0
  87. package/types/elsie/src/components/ImageSwatch/ImageSwatch.d.ts +1 -0
  88. package/types/elsie/src/components/InLineAlert/InLineAlert.d.ts +1 -0
  89. package/types/elsie/src/components/Incrementer/Incrementer.d.ts +1 -0
  90. package/types/elsie/src/components/Input/Input.d.ts +1 -0
  91. package/types/elsie/src/components/InputDate/InputDate.d.ts +1 -0
  92. package/types/elsie/src/components/InputFile/InputFile.d.ts +1 -0
  93. package/types/elsie/src/components/InputPassword/InputPassword.d.ts +1 -0
  94. package/types/elsie/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.d.ts +1 -0
  95. package/types/elsie/src/components/Modal/Modal.d.ts +1 -0
  96. package/types/elsie/src/components/MultiSelect/MultiSelect.d.ts +1 -0
  97. package/types/elsie/src/components/Pagination/Pagination.d.ts +1 -0
  98. package/types/elsie/src/components/Pagination/PaginationButton.d.ts +1 -0
  99. package/types/elsie/src/components/Picker/Picker.d.ts +1 -0
  100. package/types/elsie/src/components/Portal/Portal.d.ts +1 -0
  101. package/types/elsie/src/components/Price/Price.d.ts +1 -0
  102. package/types/elsie/src/components/PriceRange/PriceRange.d.ts +1 -0
  103. package/types/elsie/src/components/ProductItemCard/ProductItemCard.d.ts +1 -0
  104. package/types/elsie/src/components/ProductItemCard/ProductItemCardSkeleton.d.ts +1 -0
  105. package/types/elsie/src/components/ProgressSpinner/ProgressSpinner.d.ts +1 -0
  106. package/types/elsie/src/components/RadioButton/RadioButton.d.ts +1 -0
  107. package/types/elsie/src/components/Skeleton/Skeleton.d.ts +1 -0
  108. package/types/elsie/src/components/Table/Table.d.ts +1 -0
  109. package/types/elsie/src/components/Tag/Tag.d.ts +1 -0
  110. package/types/elsie/src/components/TextArea/TextArea.d.ts +1 -0
  111. package/types/elsie/src/components/TextSwatch/TextSwatch.d.ts +1 -0
  112. package/types/elsie/src/components/ToggleButton/ToggleButton.d.ts +1 -0
  113. package/types/elsie/src/components/UIProvider/UIProvider.d.ts +1 -0
  114. package/types/elsie/src/lib/aem/assets.d.ts +1 -0
  115. package/types/elsie/src/lib/classes.d.ts +1 -0
  116. package/types/elsie/src/lib/initializer.d.ts +1 -0
  117. package/types/elsie/src/lib/render.d.ts +1 -0
  118. package/types/elsie/src/lib/slot.d.ts +1 -0
  119. package/types/elsie/src/lib/tests.d.ts +2 -1
  120. package/types/elsie/src/lib/types.d.ts +2 -0
  121. package/types/elsie/src/lib/vcomponent.d.ts +1 -0
  122. package/types/event-bus/src/events-catalog.d.ts +24 -0
  123. package/types/event-bus/src/index.d.ts +1 -0
  124. package/types/fetch-graphql/src/index.d.ts +4 -4
  125. package/types/recaptcha/src/configs/index.d.ts +12 -0
  126. package/types/recaptcha/src/configs/message.config.d.ts +17 -0
  127. package/types/recaptcha/src/configs/recaptchaBadgeSelector.config.d.ts +10 -0
  128. package/types/recaptcha/src/configs/typeForms.config.d.ts +10 -0
  129. package/types/recaptcha/src/graphql/recaptchaConfig.graphql.d.ts +2 -0
  130. package/types/recaptcha/src/index.d.ts +4 -3
  131. package/types/recaptcha/src/lib/_checkRecaptchaBadge.d.ts +10 -0
  132. package/types/recaptcha/src/lib/_convertKeysToCamelCase.d.ts +14 -0
  133. package/types/recaptcha/src/lib/_extendConfig.d.ts +4 -0
  134. package/types/recaptcha/src/lib/_storageConfig.d.ts +6 -0
  135. package/types/recaptcha/src/lib/index.d.ts +13 -0
  136. package/types/recaptcha/src/services/recaptcha.service.d.ts +6 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @adobe-commerce/elsie
2
2
 
3
- ## 2.0.0-alpha-20260618145240
3
+ ## 2.0.0-alpha-20260625173003
4
4
 
5
5
  ### Major Changes
6
6
 
@@ -8,18 +8,11 @@
8
8
 
9
9
  Updated testing and component development tools to latest stable versions. Jest 30.4.2 provides enhanced snapshot handling and improved test performance. Storybook 10.4.0 includes updated addon ecosystem, improved Preact Vite integration, and enhanced accessibility features with addon-a11y and addon-coverage support.
10
10
 
11
- - 57ba43c: Upgrade TypeScript to 6.0 and ESLint to 9 (flat config)
12
-
13
- Bumps TypeScript from 4.7 to 6.0 and ESLint from 8 to 9, with `@typescript-eslint` migrated to the unified `typescript-eslint` v8 package. The shared ESLint config (`@adobe-commerce/elsie/config/eslint`) is rewritten as a flat-config array; the `.eslintrc.js` files in each workspace package are replaced with `eslint.config.js`. TS 6 new defaults that would force wide source edits (`noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `verbatimModuleSyntax`) are explicitly opted-out of in `tsconfig-base.json` to preserve current behavior.
14
-
15
- Breaking for `@adobe-commerce/elsie` consumers only:
16
-
17
- - Projects extending `@adobe-commerce/elsie/config/eslint` must migrate their own ESLint config to flat config (ESLint 9+ requirement).
18
- - Projects consuming elsie's emitted `.d.ts` files should upgrade their own TypeScript to `>=6.0` for full compatibility.
11
+ ### Minor Changes
19
12
 
20
- See `docs/typescript-6-eslint-upgrade.md` for migration details.
13
+ - 9d558ed: Adds `window.DROPINS.showOverlays(state)` a developer utility that visually outlines all dropin containers and slots on the page with labeled overlays, making it easier to understand how the storefront is composed at runtime.
21
14
 
22
- ### Minor Changes
15
+ `DROPINS.showSlots()` is deprecated in favor of `showOverlays()` and will log a console warning when called.
23
16
 
24
17
  - 005edc7: Adds validation to the Incrementer component when the field is changed to "empty".
25
18
 
package/chunks/Image.js CHANGED
@@ -1,253 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import { G as x, T as m, u as o, e as S, k as y, h as f } from "./preact-vendor.js";
4
- import { d as r } from "./cjs.js";
5
- import { R as v, g as T, c as I } from "./vcomponent.js";
6
- const A = {
7
- ExampleComponentName: {
8
- item: {
9
- label: "string"
10
- }
11
- },
12
- Pagination: {
13
- backwardButton: {
14
- ariaLabel: "Go to previous page"
15
- },
16
- forwardButton: {
17
- ariaLabel: "Go to next page"
18
- }
19
- },
20
- Incrementer: {
21
- decreaseLabel: "Decrease Quantity",
22
- increaseLabel: "Increase Quantity",
23
- label: "Quantity",
24
- errorMessage: "Enter a valid quantity",
25
- requiredMessage: "Quantity is required",
26
- minQuantityMessage: "Enter at least {{minQuantity}}",
27
- maxQuantityMessage: "Maximum quantity is {{maxQuantity}}"
28
- },
29
- Modal: {
30
- Close: {
31
- label: "Close"
32
- }
33
- },
34
- InputPassword: {
35
- placeholder: "Password",
36
- floatingLabel: "Password",
37
- buttonShowTitle: "Click to show password",
38
- buttonHideTitle: "Click to hide password"
39
- },
40
- PasswordStatusIndicator: {
41
- chartTwoSymbols: "Use characters and numbers or symbols",
42
- chartThreeSymbols: "Use characters, numbers and symbols",
43
- chartFourSymbols: "Use uppercase characters, lowercase characters, numbers and symbols",
44
- messageLengthPassword: "At least {minLength} characters long"
45
- },
46
- InlineAlert: {
47
- dismissLabel: "Dismiss Alert"
48
- },
49
- PriceSummary: {
50
- subTotal: {
51
- label: "Subtotal",
52
- withTaxes: "Including taxes",
53
- withoutTaxes: "excluding taxes"
54
- },
55
- shipping: {
56
- label: "Shipping",
57
- editZipAction: "Apply",
58
- estimated: "Estimated Shipping",
59
- estimatedDestination: "Estimated Shipping to ",
60
- destinationLinkAriaLabel: "Change destination",
61
- zipPlaceholder: "Zip Code",
62
- withTaxes: "Including taxes",
63
- withoutTaxes: "excluding taxes",
64
- alternateField: {
65
- zip: "Estimate using country/zip",
66
- state: "Estimate using country/state"
67
- }
68
- },
69
- taxes: {
70
- total: "Tax Total",
71
- totalOnly: "Tax",
72
- breakdown: "Taxes",
73
- showBreakdown: "Show Tax Breakdown",
74
- hideBreakdown: "Hide Tax Breakdown",
75
- estimated: "Estimated Tax"
76
- },
77
- total: {
78
- estimated: "Estimated Total",
79
- label: "Total",
80
- withoutTax: "Total excluding taxes"
81
- }
82
- },
83
- ProgressSpinner: {
84
- updating: {
85
- label: "Item is updating"
86
- },
87
- updatingChildren: {
88
- label: "Items are updating"
89
- }
90
- },
91
- PriceRange: {
92
- from: {
93
- label: "From"
94
- },
95
- to: {
96
- label: "to"
97
- },
98
- asLowAs: {
99
- label: "As low as"
100
- }
101
- },
102
- Swatches: {
103
- outOfStock: {
104
- label: "out of stock swatch"
105
- },
106
- selected: {
107
- label: "swatch selected"
108
- },
109
- swatch: {
110
- label: "swatch"
111
- }
112
- },
113
- Accordion: {
114
- open: {
115
- label: "Open"
116
- },
117
- close: {
118
- label: "Close"
119
- }
120
- },
121
- CartItem: {
122
- each: {
123
- label: "each"
124
- },
125
- pricePerItem: {
126
- label: "price per item"
127
- },
128
- quantity: {
129
- label: "Quantity"
130
- },
131
- remove: {
132
- label: "Remove {product} from the cart"
133
- },
134
- removeDefault: {
135
- label: "Remove item from the cart"
136
- },
137
- taxIncluded: {
138
- label: "incl. VAT"
139
- },
140
- taxExcluded: {
141
- label: "excl. tax"
142
- },
143
- updating: {
144
- label: "{product} is updating"
145
- }
146
- },
147
- InputDate: {
148
- picker: "Select a date"
149
- },
150
- Table: {
151
- sortedAscending: "Sort {label} ascending",
152
- sortedDescending: "Sort {label} descending",
153
- sortBy: "Sort by {label}"
154
- },
155
- MultiSelect: {
156
- selectAll: "Select All",
157
- deselectAll: "Deselect All",
158
- placeholder: "Select options",
159
- noResultsText: "No options available",
160
- ariaLabel: {
161
- removed: "removed",
162
- added: "added",
163
- itemsSelected: "items selected",
164
- itemsAdded: "items added",
165
- itemsRemoved: "items removed",
166
- selectedTotal: "selected total",
167
- noResultsFor: "No results found for",
168
- optionsAvailable: "options available",
169
- dropdownExpanded: "Dropdown expanded",
170
- useArrowKeys: "Use arrow keys to navigate",
171
- removeFromSelection: "Remove",
172
- fromSelection: "from selection",
173
- selectedItem: "Selected item:",
174
- inField: " in {floatingLabel}",
175
- selectedItems: "Selected items",
176
- scrollableOptionsList: "Scrollable options list",
177
- selectOptions: "Select options",
178
- itemAction: "{label} {action}. {count} items selected.",
179
- bulkAdded: "{count} items added. {total} items selected total.",
180
- bulkRemoved: "{count} items removed. {total} items selected total.",
181
- dropdownExpandedWithOptions: "Dropdown expanded. {count} option{s} available. Use arrow keys to navigate.",
182
- selectedItemInField: "Selected item: {label} in {field}",
183
- removeFromSelectionWithText: "Remove {label} from selection. {text}",
184
- itemsSelectedDescription: "{count} item{s} selected: {labels}",
185
- noItemsSelected: "No items selected"
186
- }
187
- }
188
- }, d = {
189
- Dropin: A
190
- }, c = {
191
- default: d,
192
- en_US: d
193
- }, k = (e) => r(c.default, c[e] || {}), L = x({
194
- locale: "en-US"
195
- }), P = ({
196
- lang: e = "en_US",
197
- langDefinitions: t = {},
198
- children: a
199
- }) => {
200
- const s = m(() => {
201
- const i = r(
202
- t.default,
203
- t[e] ?? {}
204
- );
205
- return r(
206
- k(e),
207
- // SDK default definitions
208
- i
209
- // Custom definitions
210
- );
211
- }, [e, t]), l = e.replace("_", "-");
212
- return /* @__PURE__ */ o(L.Provider, { value: { locale: l }, children: /* @__PURE__ */ o(S, { definition: s, children: /* @__PURE__ */ o(y, { children: a }) }) });
213
- }, R = new v(/* @__PURE__ */ o(P, {})), U = ({
214
- className: e,
215
- src: t,
216
- params: a,
217
- loading: s = "lazy",
218
- srcSet: l,
219
- sizes: i,
220
- onLoad: n,
221
- ...u
222
- }) => {
223
- const [p, b] = f(!1), g = m(() => {
224
- if (l) return l;
225
- if (!(!t || !a))
226
- return T(t, { ...a });
227
- }, [a, t, l]), h = (w) => {
228
- b(!0), n == null || n(w);
229
- };
230
- return /* @__PURE__ */ o(
231
- "img",
232
- {
233
- ...u,
234
- className: I([
235
- "dropin-image",
236
- ["dropin-image--loaded", p],
237
- e
238
- ]),
239
- loading: s,
240
- onLoad: h,
241
- src: t,
242
- srcSet: g,
243
- sizes: i
244
- }
245
- );
246
- };
247
- export {
248
- U as I,
249
- L as U,
250
- P as a,
251
- R as p
252
- };
3
+ import{G as x,T as m,u as o,e as S,k as y,h as f}from"./preact-vendor.js";import{d as r}from"./cjs.js";import{R as v,g as T,c as I}from"./vcomponent.js";const A={ExampleComponentName:{item:{label:"string"}},Pagination:{backwardButton:{ariaLabel:"Go to previous page"},forwardButton:{ariaLabel:"Go to next page"}},Incrementer:{decreaseLabel:"Decrease Quantity",increaseLabel:"Increase Quantity",label:"Quantity",errorMessage:"Enter a valid quantity",requiredMessage:"Quantity is required",minQuantityMessage:"Enter at least {{minQuantity}}",maxQuantityMessage:"Maximum quantity is {{maxQuantity}}"},Modal:{Close:{label:"Close"}},InputPassword:{placeholder:"Password",floatingLabel:"Password",buttonShowTitle:"Click to show password",buttonHideTitle:"Click to 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"},pricePerItem:{label:"price per item"},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"},Table:{sortedAscending:"Sort {label} ascending",sortedDescending:"Sort {label} descending",sortBy:"Sort by {label}"},MultiSelect:{selectAll:"Select All",deselectAll:"Deselect All",placeholder:"Select options",noResultsText:"No options available",ariaLabel:{removed:"removed",added:"added",itemsSelected:"items selected",itemsAdded:"items added",itemsRemoved:"items removed",selectedTotal:"selected total",noResultsFor:"No results found for",optionsAvailable:"options available",dropdownExpanded:"Dropdown expanded",useArrowKeys:"Use arrow keys to navigate",removeFromSelection:"Remove",fromSelection:"from selection",selectedItem:"Selected item:",inField:" in {floatingLabel}",selectedItems:"Selected items",scrollableOptionsList:"Scrollable options list",selectOptions:"Select options",itemAction:"{label} {action}. {count} items selected.",bulkAdded:"{count} items added. {total} items selected total.",bulkRemoved:"{count} items removed. {total} items selected total.",dropdownExpandedWithOptions:"Dropdown expanded. {count} option{s} available. Use arrow keys to navigate.",selectedItemInField:"Selected item: {label} in {field}",removeFromSelectionWithText:"Remove {label} from selection. {text}",itemsSelectedDescription:"{count} item{s} selected: {labels}",noItemsSelected:"No items selected"}}},d={Dropin:A},c={default:d,en_US:d},k=e=>r(c.default,c[e]||{}),L=x({locale:"en-US"}),P=({lang:e="en_US",langDefinitions:t={},children:a})=>{const s=m(()=>{const i=r(t.default,t[e]??{});return r(k(e),i)},[e,t]),l=e.replace("_","-");return o(L.Provider,{value:{locale:l},children:o(S,{definition:s,children:o(y,{children:a})})})},R=new v(o(P,{})),U=({className:e,src:t,params:a,loading:s="lazy",srcSet:l,sizes:i,onLoad:n,...u})=>{const[p,b]=f(!1),g=m(()=>{if(l)return l;if(!(!t||!a))return T(t,{...a})},[a,t,l]),h=w=>{b(!0),n==null||n(w)};return o("img",{...u,className:I(["dropin-image",["dropin-image--loaded",p],e]),loading:s,onLoad:h,src:t,srcSet:g,sizes:i})};export{U as I,L as U,P as a,R as p};
253
4
  //# sourceMappingURL=Image.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Image.js","sources":["/@dropins/tools/src/i18n/index.ts","/@dropins/tools/src/components/UIProvider/UIProvider.tsx","/@dropins/tools/src/components/Image/Image.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\nimport en_US from '@adobe-commerce/elsie/i18n/en_US.json';\n\nexport type Lang = 'en_US';\n\nexport const definition = {\n default: en_US,\n en_US,\n};\n\n// https://github.com/synacor/preact-i18n\n// eslint-disable-next-line no-restricted-imports\nexport * from 'preact-i18n';\n\nexport const getDefinitionByLanguage = (lang: Lang) => {\n return deepmerge(definition.default, definition[lang] || {});\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes, createContext, useMemo } from 'preact/compat';\nimport { deepmerge, Render } from '@adobe-commerce/elsie/lib';\nimport { IntlProvider, getDefinitionByLanguage, Lang } from '@adobe-commerce/elsie/i18n';\n\nimport '@adobe-commerce/elsie/components/UIProvider/UIProvider.css';\nimport '@adobe-commerce/elsie/components/UIProvider/normalize.css';\n\nexport const UIContext = createContext<{\n locale: string;\n}>({\n locale: 'en-US',\n});\n\ntype LangDefinitions = { [key: string]: any };\n\nexport interface UIProviderProps extends HTMLAttributes<HTMLDivElement> {\n lang?: Lang; // ... list of other supported languages\n langDefinitions?: LangDefinitions;\n}\n\nexport const UIProvider: FunctionComponent<UIProviderProps> = ({\n lang = 'en_US',\n langDefinitions = {},\n children,\n}) => {\n const definitions = useMemo(() => {\n // Merge default definition with selected definition\n const selectedDefinitions: LangDefinitions = deepmerge(\n langDefinitions.default,\n langDefinitions[lang] ?? {}\n );\n\n // Merge SDK default definitions with custom definitions\n return deepmerge(\n getDefinitionByLanguage(lang), // SDK default definitions\n selectedDefinitions // Custom definitions\n );\n }, [lang, langDefinitions]);\n\n const locale = lang.replace('_', '-');\n\n return (\n <UIContext.Provider value={{ locale }}>\n <IntlProvider definition={definitions}>\n <>{children}</>\n </IntlProvider>\n </UIContext.Provider>\n );\n};\n\nexport const provider = new Render(<UIProvider />);","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes, useMemo, useState } from 'preact/compat';\nimport {\n classes,\n generateSrcset,\n ResolveImageUrlOptions,\n} from '@adobe-commerce/elsie/lib';\nimport '@adobe-commerce/elsie/components/Image/Image.css';\n\nexport interface ImageProps extends HTMLAttributes<HTMLDivElement> {\n params?: ResolveImageUrlOptions;\n src: string;\n sizes?: string;\n onLoad?: (e: any) => void;\n}\nexport const Image: FunctionComponent<ImageProps> = ({\n className,\n src,\n params,\n loading = 'lazy',\n srcSet,\n sizes,\n onLoad,\n ...props\n}) => {\n const [loaded, setLoaded] = useState(false);\n\n const _srcSet = useMemo(() => {\n // If srcSet is provided, use it\n if (srcSet) return srcSet;\n\n // If src is not provided, return \"undefined\"\n if (!src || !params) return;\n\n // Otherwise, generate srcSet based on params\n return generateSrcset(src, { ...params });\n }, [params, src, srcSet]);\n\n // Add class at image onLoad\n const onLoadHandler = (e: any) => {\n setLoaded(true); \n onLoad?.(e);\n };\n\n return (\n <img\n {...props}\n className={classes([\n 'dropin-image',\n ['dropin-image--loaded', loaded],\n className,\n ])}\n loading={loading}\n onLoad={onLoadHandler}\n src={src}\n srcSet={_srcSet}\n sizes={sizes}\n />\n );\n};\n"],"names":["definition","en_US","getDefinitionByLanguage","lang","deepmerge","UIContext","createContext","UIProvider","langDefinitions","children","definitions","useMemo","selectedDefinitions","locale","jsx","IntlProvider","Fragment","provider","Render","Image","className","src","params","loading","srcSet","sizes","onLoad","props","loaded","setLoaded","useState","_srcSet","generateSrcset","onLoadHandler","e","classes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAcaA,IAAa;AAAA,EACxB,SAASC;AAAA,EACT,OAAAA;AACF,GAMaC,IAA0B,CAACC,MAC/BC,EAAUJ,EAAW,SAASA,EAAWG,CAAI,KAAK,EAAE,GCPhDE,IAAYC,EAEtB;AAAA,EACD,QAAQ;AACV,CAAC,GASYC,IAAiD,CAAC;AAAA,EAC7D,MAAAJ,IAAO;AAAA,EACP,iBAAAK,IAAkB,CAAA;AAAA,EAClB,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAcC,EAAQ,MAAM;AAEhC,UAAMC,IAAuCR;AAAA,MAC3CI,EAAgB;AAAA,MAChBA,EAAgBL,CAAI,KAAK,CAAA;AAAA,IAAC;AAI5B,WAAOC;AAAA,MACLF,EAAwBC,CAAI;AAAA;AAAA,MAC5BS;AAAA;AAAA,IAAA;AAAA,EAEJ,GAAG,CAACT,GAAMK,CAAe,CAAC,GAEpBK,IAASV,EAAK,QAAQ,KAAK,GAAG;AAEpC,SACEW,gBAAAA,EAACT,EAAU,UAAV,EAAmB,OAAO,EAAE,QAAAQ,EAAA,GAC3B,UAAAC,gBAAAA,EAACC,KAAa,YAAYL,GACxB,UAAAI,gBAAAA,EAAAE,GAAA,EAAG,UAAAP,EAAA,CAAS,GACd,GACF;AAEJ,GAEaQ,IAAW,IAAIC,EAAOJ,gBAAAA,EAACP,KAAW,CAAE,GCpCpCY,IAAuC,CAAC;AAAA,EACnD,WAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAUpB,EAAQ,MAAM;AAE5B,QAAIa,EAAQ,QAAOA;AAGnB,QAAI,GAACH,KAAO,CAACC;AAGb,aAAOU,EAAeX,GAAK,EAAE,GAAGC,GAAQ;AAAA,EAC1C,GAAG,CAACA,GAAQD,GAAKG,CAAM,CAAC,GAGlBS,IAAgB,CAACC,MAAW;AAChC,IAAAL,EAAU,EAAI,GACdH,KAAA,QAAAA,EAASQ;AAAA,EACX;AAEA,SACEpB,gBAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGa;AAAA,MACJ,WAAWQ,EAAQ;AAAA,QACjB;AAAA,QACA,CAAC,wBAAwBP,CAAM;AAAA,QAC/BR;AAAA,MAAA,CACD;AAAA,MACD,SAAAG;AAAA,MACA,QAAQU;AAAA,MACR,KAAAZ;AAAA,MACA,QAAQU;AAAA,MACR,OAAAN;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"Image.js","sources":["/@dropins/tools/src/i18n/index.ts","/@dropins/tools/src/components/UIProvider/UIProvider.tsx","/@dropins/tools/src/components/Image/Image.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\nimport en_US from '@adobe-commerce/elsie/i18n/en_US.json';\n\nexport type Lang = 'en_US';\n\nexport const definition = {\n default: en_US,\n en_US,\n};\n\n// https://github.com/synacor/preact-i18n\n// eslint-disable-next-line no-restricted-imports\nexport * from 'preact-i18n';\n\nexport const getDefinitionByLanguage = (lang: Lang) => {\n return deepmerge(definition.default, definition[lang] || {});\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes, createContext, useMemo } from 'preact/compat';\nimport { deepmerge, Render } from '@adobe-commerce/elsie/lib';\nimport { IntlProvider, getDefinitionByLanguage, Lang } from '@adobe-commerce/elsie/i18n';\n\nimport '@adobe-commerce/elsie/components/UIProvider/UIProvider.css';\nimport '@adobe-commerce/elsie/components/UIProvider/normalize.css';\n\nexport const UIContext = createContext<{\n locale: string;\n}>({\n locale: 'en-US',\n});\n\ntype LangDefinitions = { [key: string]: any };\n\nexport interface UIProviderProps extends HTMLAttributes<HTMLDivElement> {\n lang?: Lang; // ... list of other supported languages\n langDefinitions?: LangDefinitions;\n}\n\nexport const UIProvider: FunctionComponent<UIProviderProps> = ({\n lang = 'en_US',\n langDefinitions = {},\n children,\n}) => {\n const definitions = useMemo(() => {\n // Merge default definition with selected definition\n const selectedDefinitions: LangDefinitions = deepmerge(\n langDefinitions.default,\n langDefinitions[lang] ?? {}\n );\n\n // Merge SDK default definitions with custom definitions\n return deepmerge(\n getDefinitionByLanguage(lang), // SDK default definitions\n selectedDefinitions // Custom definitions\n );\n }, [lang, langDefinitions]);\n\n const locale = lang.replace('_', '-');\n\n return (\n <UIContext.Provider value={{ locale }}>\n <IntlProvider definition={definitions}>\n <>{children}</>\n </IntlProvider>\n </UIContext.Provider>\n );\n};\n\nexport const provider = new Render(<UIProvider />);","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes, useMemo, useState } from 'preact/compat';\nimport {\n classes,\n generateSrcset,\n ResolveImageUrlOptions,\n} from '@adobe-commerce/elsie/lib';\nimport '@adobe-commerce/elsie/components/Image/Image.css';\n\nexport interface ImageProps extends HTMLAttributes<HTMLDivElement> {\n params?: ResolveImageUrlOptions;\n src: string;\n sizes?: string;\n onLoad?: (e: any) => void;\n}\nexport const Image: FunctionComponent<ImageProps> = ({\n className,\n src,\n params,\n loading = 'lazy',\n srcSet,\n sizes,\n onLoad,\n ...props\n}) => {\n const [loaded, setLoaded] = useState(false);\n\n const _srcSet = useMemo(() => {\n // If srcSet is provided, use it\n if (srcSet) return srcSet;\n\n // If src is not provided, return \"undefined\"\n if (!src || !params) return;\n\n // Otherwise, generate srcSet based on params\n return generateSrcset(src, { ...params });\n }, [params, src, srcSet]);\n\n // Add class at image onLoad\n const onLoadHandler = (e: any) => {\n setLoaded(true); \n onLoad?.(e);\n };\n\n return (\n <img\n {...props}\n className={classes([\n 'dropin-image',\n ['dropin-image--loaded', loaded],\n className,\n ])}\n loading={loading}\n onLoad={onLoadHandler}\n src={src}\n srcSet={_srcSet}\n sizes={sizes}\n />\n );\n};\n"],"names":["definition","en_US","getDefinitionByLanguage","lang","deepmerge","UIContext","createContext","UIProvider","langDefinitions","children","definitions","useMemo","selectedDefinitions","locale","jsx","IntlProvider","Fragment","provider","Render","Image","className","src","params","loading","srcSet","sizes","onLoad","props","loaded","setLoaded","useState","_srcSet","generateSrcset","onLoadHandler","e","classes"],"mappings":"wsHAcaA,EAAa,CACxB,QAASC,EACT,MAAAA,CACF,EAMaC,EAA2BC,GAC/BC,EAAUJ,EAAW,QAASA,EAAWG,CAAI,GAAK,EAAE,ECPhDE,EAAYC,EAEtB,CACD,OAAQ,OACV,CAAC,EASYC,EAAiD,CAAC,CAC7D,KAAAJ,EAAO,QACP,gBAAAK,EAAkB,CAAA,EAClB,SAAAC,CACF,IAAM,CACJ,MAAMC,EAAcC,EAAQ,IAAM,CAEhC,MAAMC,EAAuCR,EAC3CI,EAAgB,QAChBA,EAAgBL,CAAI,GAAK,CAAA,CAAC,EAI5B,OAAOC,EACLF,EAAwBC,CAAI,EAC5BS,CAAA,CAEJ,EAAG,CAACT,EAAMK,CAAe,CAAC,EAEpBK,EAASV,EAAK,QAAQ,IAAK,GAAG,EAEpC,OACEW,EAACT,EAAU,SAAV,CAAmB,MAAO,CAAE,OAAAQ,CAAA,EAC3B,SAAAC,EAACC,GAAa,WAAYL,EACxB,SAAAI,EAAAE,EAAA,CAAG,SAAAP,CAAA,CAAS,EACd,EACF,CAEJ,EAEaQ,EAAW,IAAIC,EAAOJ,EAACP,IAAW,CAAE,ECpCpCY,EAAuC,CAAC,CACnD,UAAAC,EACA,IAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,OACV,OAAAC,EACA,MAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAS,EAAK,EAEpCC,EAAUpB,EAAQ,IAAM,CAE5B,GAAIa,EAAQ,OAAOA,EAGnB,GAAI,GAACH,GAAO,CAACC,GAGb,OAAOU,EAAeX,EAAK,CAAE,GAAGC,EAAQ,CAC1C,EAAG,CAACA,EAAQD,EAAKG,CAAM,CAAC,EAGlBS,EAAiBC,GAAW,CAChCL,EAAU,EAAI,EACdH,GAAA,MAAAA,EAASQ,EACX,EAEA,OACEpB,EAAC,MAAA,CACE,GAAGa,EACJ,UAAWQ,EAAQ,CACjB,eACA,CAAC,uBAAwBP,CAAM,EAC/BR,CAAA,CACD,EACD,QAAAG,EACA,OAAQU,EACR,IAAAZ,EACA,OAAQU,EACR,MAAAN,CAAA,CAAA,CAGN"}
package/chunks/cjs.js CHANGED
@@ -1,80 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- function b(e) {
4
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
5
- }
6
- var o = function(r) {
7
- return s(r) && !y(r);
8
- };
9
- function s(e) {
10
- return !!e && typeof e == "object";
11
- }
12
- function y(e) {
13
- var r = Object.prototype.toString.call(e);
14
- return r === "[object RegExp]" || r === "[object Date]" || j(e);
15
- }
16
- var O = typeof Symbol == "function" && Symbol.for, m = O ? Symbol.for("react.element") : 60103;
17
- function j(e) {
18
- return e.$$typeof === m;
19
- }
20
- function g(e) {
21
- return Array.isArray(e) ? [] : {};
22
- }
23
- function u(e, r) {
24
- return r.clone !== !1 && r.isMergeableObject(e) ? a(g(e), e, r) : e;
25
- }
26
- function M(e, r, t) {
27
- return e.concat(r).map(function(c) {
28
- return u(c, t);
29
- });
30
- }
31
- function p(e, r) {
32
- if (!r.customMerge)
33
- return a;
34
- var t = r.customMerge(e);
35
- return typeof t == "function" ? t : a;
36
- }
37
- function d(e) {
38
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(r) {
39
- return Object.propertyIsEnumerable.call(e, r);
40
- }) : [];
41
- }
42
- function f(e) {
43
- return Object.keys(e).concat(d(e));
44
- }
45
- function l(e, r) {
46
- try {
47
- return r in e;
48
- } catch {
49
- return !1;
50
- }
51
- }
52
- function A(e, r) {
53
- return l(e, r) && !(Object.hasOwnProperty.call(e, r) && Object.propertyIsEnumerable.call(e, r));
54
- }
55
- function E(e, r, t) {
56
- var c = {};
57
- return t.isMergeableObject(e) && f(e).forEach(function(n) {
58
- c[n] = u(e[n], t);
59
- }), f(r).forEach(function(n) {
60
- A(e, n) || (l(e, n) && t.isMergeableObject(r[n]) ? c[n] = p(n, t)(e[n], r[n], t) : c[n] = u(r[n], t));
61
- }), c;
62
- }
63
- function a(e, r, t) {
64
- t = t || {}, t.arrayMerge = t.arrayMerge || M, t.isMergeableObject = t.isMergeableObject || o, t.cloneUnlessOtherwiseSpecified = u;
65
- var c = Array.isArray(r), n = Array.isArray(e), i = c === n;
66
- return i ? c ? t.arrayMerge(e, r, t) : E(e, r, t) : u(r, t);
67
- }
68
- a.all = function(r, t) {
69
- if (!Array.isArray(r))
70
- throw new Error("first argument should be an array");
71
- return r.reduce(function(c, n) {
72
- return a(c, n, t);
73
- }, {});
74
- };
75
- var S = a, h = S;
76
- const w = /* @__PURE__ */ b(h);
77
- export {
78
- w as d
79
- };
3
+ function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o=function(r){return s(r)&&!y(r)};function s(e){return!!e&&typeof e=="object"}function y(e){var r=Object.prototype.toString.call(e);return r==="[object RegExp]"||r==="[object Date]"||j(e)}var O=typeof Symbol=="function"&&Symbol.for,m=O?Symbol.for("react.element"):60103;function j(e){return e.$$typeof===m}function g(e){return Array.isArray(e)?[]:{}}function u(e,r){return r.clone!==!1&&r.isMergeableObject(e)?a(g(e),e,r):e}function M(e,r,t){return e.concat(r).map(function(c){return u(c,t)})}function p(e,r){if(!r.customMerge)return a;var t=r.customMerge(e);return typeof t=="function"?t:a}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(r){return Object.propertyIsEnumerable.call(e,r)}):[]}function f(e){return Object.keys(e).concat(d(e))}function l(e,r){try{return r in e}catch{return!1}}function A(e,r){return l(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))}function E(e,r,t){var c={};return t.isMergeableObject(e)&&f(e).forEach(function(n){c[n]=u(e[n],t)}),f(r).forEach(function(n){A(e,n)||(l(e,n)&&t.isMergeableObject(r[n])?c[n]=p(n,t)(e[n],r[n],t):c[n]=u(r[n],t))}),c}function a(e,r,t){t=t||{},t.arrayMerge=t.arrayMerge||M,t.isMergeableObject=t.isMergeableObject||o,t.cloneUnlessOtherwiseSpecified=u;var c=Array.isArray(r),n=Array.isArray(e),i=c===n;return i?c?t.arrayMerge(e,r,t):E(e,r,t):u(r,t)}a.all=function(r,t){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(c,n){return a(c,n,t)},{})};var S=a,h=S;const w=b(h);export{w as d};
80
4
  //# sourceMappingURL=cjs.js.map
package/chunks/cjs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cjs.js","sources":["../../../../node_modules/deepmerge/dist/cjs.js"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n"],"names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","isReactElement","canUseSymbol","REACT_ELEMENT_TYPE","emptyTarget","val","cloneUnlessOtherwiseSpecified","options","deepmerge","defaultArrayMerge","target","source","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","symbol","getKeys","propertyIsOnObject","object","property","propertyIsUnsafe","mergeObject","destination","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","array","prev","next","deepmerge_1","cjs"],"mappings":"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","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"cjs.js","sources":["../../../../node_modules/deepmerge/dist/cjs.js"],"sourcesContent":["'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn Object.propertyIsEnumerable.call(target, symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n"],"names":["isMergeableObject","value","isNonNullObject","isSpecial","stringValue","isReactElement","canUseSymbol","REACT_ELEMENT_TYPE","emptyTarget","val","cloneUnlessOtherwiseSpecified","options","deepmerge","defaultArrayMerge","target","source","element","getMergeFunction","key","customMerge","getEnumerableOwnPropertySymbols","symbol","getKeys","propertyIsOnObject","object","property","propertyIsUnsafe","mergeObject","destination","sourceIsArray","targetIsArray","sourceAndTargetTypesMatch","array","prev","next","deepmerge_1","cjs"],"mappings":"oGAEA,IAAIA,EAAoB,SAA2BC,EAAO,CACzD,OAAOC,EAAgBD,CAAK,GACxB,CAACE,EAAUF,CAAK,CACrB,EAEA,SAASC,EAAgBD,EAAO,CAC/B,MAAO,CAAC,CAACA,GAAS,OAAOA,GAAU,QACpC,CAEA,SAASE,EAAUF,EAAO,CACzB,IAAIG,EAAc,OAAO,UAAU,SAAS,KAAKH,CAAK,EAEtD,OAAOG,IAAgB,mBACnBA,IAAgB,iBAChBC,EAAeJ,CAAK,CACzB,CAGA,IAAIK,EAAe,OAAO,QAAW,YAAc,OAAO,IACtDC,EAAqBD,EAAe,OAAO,IAAI,eAAe,EAAI,MAEtE,SAASD,EAAeJ,EAAO,CAC9B,OAAOA,EAAM,WAAaM,CAC3B,CAEA,SAASC,EAAYC,EAAK,CACzB,OAAO,MAAM,QAAQA,CAAG,EAAI,CAAA,EAAK,CAAA,CAClC,CAEA,SAASC,EAA8BT,EAAOU,EAAS,CACtD,OAAQA,EAAQ,QAAU,IAASA,EAAQ,kBAAkBV,CAAK,EAC/DW,EAAUJ,EAAYP,CAAK,EAAGA,EAAOU,CAAO,EAC5CV,CACJ,CAEA,SAASY,EAAkBC,EAAQC,EAAQJ,EAAS,CACnD,OAAOG,EAAO,OAAOC,CAAM,EAAE,IAAI,SAASC,EAAS,CAClD,OAAON,EAA8BM,EAASL,CAAO,CACvD,CAAE,CACF,CAEA,SAASM,EAAiBC,EAAKP,EAAS,CACvC,GAAI,CAACA,EAAQ,YACZ,OAAOC,EAER,IAAIO,EAAcR,EAAQ,YAAYO,CAAG,EACzC,OAAO,OAAOC,GAAgB,WAAaA,EAAcP,CAC1D,CAEA,SAASQ,EAAgCN,EAAQ,CAChD,OAAO,OAAO,sBACX,OAAO,sBAAsBA,CAAM,EAAE,OAAO,SAASO,EAAQ,CAC9D,OAAO,OAAO,qBAAqB,KAAKP,EAAQO,CAAM,CACzD,CAAG,EACC,CAAA,CACJ,CAEA,SAASC,EAAQR,EAAQ,CACxB,OAAO,OAAO,KAAKA,CAAM,EAAE,OAAOM,EAAgCN,CAAM,CAAC,CAC1E,CAEA,SAASS,EAAmBC,EAAQC,EAAU,CAC7C,GAAI,CACH,OAAOA,KAAYD,CACrB,MAAY,CACV,MAAO,EACT,CACA,CAGA,SAASE,EAAiBZ,EAAQI,EAAK,CACtC,OAAOK,EAAmBT,EAAQI,CAAG,GACjC,EAAE,OAAO,eAAe,KAAKJ,EAAQI,CAAG,GACvC,OAAO,qBAAqB,KAAKJ,EAAQI,CAAG,EAClD,CAEA,SAASS,EAAYb,EAAQC,EAAQJ,EAAS,CAC7C,IAAIiB,EAAc,CAAA,EAClB,OAAIjB,EAAQ,kBAAkBG,CAAM,GACnCQ,EAAQR,CAAM,EAAE,QAAQ,SAASI,EAAK,CACrCU,EAAYV,CAAG,EAAIR,EAA8BI,EAAOI,CAAG,EAAGP,CAAO,CACxE,CAAG,EAEFW,EAAQP,CAAM,EAAE,QAAQ,SAASG,EAAK,CACjCQ,EAAiBZ,EAAQI,CAAG,IAI5BK,EAAmBT,EAAQI,CAAG,GAAKP,EAAQ,kBAAkBI,EAAOG,CAAG,CAAC,EAC3EU,EAAYV,CAAG,EAAID,EAAiBC,EAAKP,CAAO,EAAEG,EAAOI,CAAG,EAAGH,EAAOG,CAAG,EAAGP,CAAO,EAEnFiB,EAAYV,CAAG,EAAIR,EAA8BK,EAAOG,CAAG,EAAGP,CAAO,EAExE,CAAE,EACMiB,CACR,CAEA,SAAShB,EAAUE,EAAQC,EAAQJ,EAAS,CAC3CA,EAAUA,GAAW,CAAA,EACrBA,EAAQ,WAAaA,EAAQ,YAAcE,EAC3CF,EAAQ,kBAAoBA,EAAQ,mBAAqBX,EAGzDW,EAAQ,8BAAgCD,EAExC,IAAImB,EAAgB,MAAM,QAAQd,CAAM,EACpCe,EAAgB,MAAM,QAAQhB,CAAM,EACpCiB,EAA4BF,IAAkBC,EAElD,OAAKC,EAEMF,EACHlB,EAAQ,WAAWG,EAAQC,EAAQJ,CAAO,EAE1CgB,EAAYb,EAAQC,EAAQJ,CAAO,EAJnCD,EAA8BK,EAAQJ,CAAO,CAMtD,CAEAC,EAAU,IAAM,SAAsBoB,EAAOrB,EAAS,CACrD,GAAI,CAAC,MAAM,QAAQqB,CAAK,EACvB,MAAM,IAAI,MAAM,mCAAmC,EAGpD,OAAOA,EAAM,OAAO,SAASC,EAAMC,EAAM,CACxC,OAAOtB,EAAUqB,EAAMC,EAAMvB,CAAO,CACtC,EAAI,CAAA,CAAE,CACN,EAEA,IAAIwB,EAAcvB,EAElBwB,EAAiBD","x_google_ignoreList":[0]}
@@ -1,18 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- function n(o, t) {
4
- try {
5
- return t.split(".").reduce((r, e) => {
6
- if (!Object.prototype.hasOwnProperty.call(r, e))
7
- throw Error();
8
- return r[e];
9
- }, o);
10
- } catch {
11
- console.warn(`Property ${t} does not exist in the object`);
12
- return;
13
- }
14
- }
15
- export {
16
- n as g
17
- };
3
+ function n(o,t){try{return t.split(".").reduce((r,e)=>{if(!Object.prototype.hasOwnProperty.call(r,e))throw Error();return r[e]},o)}catch{console.warn(`Property ${t} does not exist in the object`);return}}export{n as g};
18
4
  //# sourceMappingURL=get-path-value.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-path-value.js","sources":["/@dropins/tools/src/lib/get-path-value.ts"],"sourcesContent":["/**\n * Retrieves a value from a config object using dot notation.\n *\n * @param {Object} obj - The config object.\n * @param {string} key - The key to retrieve (supports dot notation).\n * @returns {any} - The value of the key.\n */\nexport function getPathValue(obj: Record<string, any>, key: string): any {\n try {\n return key\n .split('.')\n .reduce((current: Record<string, any>, part: string) => {\n if (!Object.prototype.hasOwnProperty.call(current, part)) {\n throw Error();\n }\n return current[part];\n }, obj);\n } catch {\n console.warn(`Property ${key} does not exist in the object`);\n return undefined;\n }\n}\n"],"names":["getPathValue","obj","key","current","part"],"mappings":"AAOO,SAASA,EAAaC,GAA0BC,GAAkB;AACvE,MAAI;AACF,WAAOA,EACJ,MAAM,GAAG,EACT,OAAO,CAACC,GAA8BC,MAAiB;AACtD,UAAI,CAAC,OAAO,UAAU,eAAe,KAAKD,GAASC,CAAI;AACrD,cAAM,MAAA;AAER,aAAOD,EAAQC,CAAI;AAAA,IACrB,GAAGH,CAAG;AAAA,EACV,QAAQ;AACN,YAAQ,KAAK,YAAYC,CAAG,+BAA+B;AAC3D;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"get-path-value.js","sources":["/@dropins/tools/src/lib/get-path-value.ts"],"sourcesContent":["/**\n * Retrieves a value from a config object using dot notation.\n *\n * @param {Object} obj - The config object.\n * @param {string} key - The key to retrieve (supports dot notation).\n * @returns {any} - The value of the key.\n */\nexport function getPathValue(obj: Record<string, any>, key: string): any {\n try {\n return key\n .split('.')\n .reduce((current: Record<string, any>, part: string) => {\n if (!Object.prototype.hasOwnProperty.call(current, part)) {\n throw Error();\n }\n return current[part];\n }, obj);\n } catch {\n console.warn(`Property ${key} does not exist in the object`);\n return undefined;\n }\n}\n"],"names":["getPathValue","obj","key","current","part"],"mappings":"AAOO,SAASA,EAAaC,EAA0BC,EAAkB,CACvE,GAAI,CACF,OAAOA,EACJ,MAAM,GAAG,EACT,OAAO,CAACC,EAA8BC,IAAiB,CACtD,GAAI,CAAC,OAAO,UAAU,eAAe,KAAKD,EAASC,CAAI,EACrD,MAAM,MAAA,EAER,OAAOD,EAAQC,CAAI,CACrB,EAAGH,CAAG,CACV,MAAQ,CACN,QAAQ,KAAK,YAAYC,CAAG,+BAA+B,EAC3D,MACF,CACF"}
@@ -1,46 +1,4 @@
1
1
  /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import { g as s } from "./locale-config.js";
4
- const m = (e, t) => {
5
- let n;
6
- const r = function(...o) {
7
- clearTimeout(n), n = setTimeout(() => e.apply(this, o), t);
8
- };
9
- return r.cancel = () => {
10
- clearTimeout(n);
11
- }, r;
12
- }, l = (e) => typeof e == "number", f = () => {
13
- const e = navigator.userAgent.toLowerCase(), t = /ipad|iphone|ipod/.test(e), n = e.includes("mac") && "ontouchend" in document;
14
- return t || n;
15
- };
16
- function a(e) {
17
- if (e)
18
- return e;
19
- const t = s();
20
- return t || (process.env.LOCALE && process.env.LOCALE !== "undefined" ? process.env.LOCALE : "en-US");
21
- }
22
- function g(e = {}) {
23
- const { currency: t, locale: n, formatOptions: r = {} } = e, o = a(n), c = {
24
- style: "currency",
25
- currency: t && t !== "NONE" ? t : "USD",
26
- // These options are needed to round to whole numbers if that's what you want.
27
- minimumFractionDigits: 2,
28
- // (this suffices for whole numbers, but will print 2500.10 as $2,500.1)
29
- maximumFractionDigits: 2,
30
- // (causes 2500.99 to be printed as $2,501)
31
- ...r
32
- };
33
- try {
34
- return new Intl.NumberFormat(o, c);
35
- } catch (i) {
36
- return console.error(`Error creating Intl.NumberFormat instance for locale ${o}. Falling back to en-US.`, i), new Intl.NumberFormat("en-US", c);
37
- }
38
- }
39
- export {
40
- g as a,
41
- l as b,
42
- m as d,
43
- a as g,
44
- f as i
45
- };
3
+ import{g as s}from"./locale-config.js";const m=(e,t)=>{let n;const r=function(...o){clearTimeout(n),n=setTimeout(()=>e.apply(this,o),t)};return r.cancel=()=>{clearTimeout(n)},r},f=e=>typeof e=="number",d=()=>{const e=navigator.userAgent.toLowerCase(),t=/ipad|iphone|ipod/.test(e),n=e.includes("mac")&&"ontouchend"in document;return t||n};var c={};function u(e){if(e)return e;const t=s();return t||(c.LOCALE&&c.LOCALE!=="undefined"?c.LOCALE:"en-US")}function g(e={}){const{currency:t,locale:n,formatOptions:r={}}=e,o=u(n),i={style:"currency",currency:t&&t!=="NONE"?t:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...r};try{return new Intl.NumberFormat(o,i)}catch(a){return console.error(`Error creating Intl.NumberFormat instance for locale ${o}. Falling back to en-US.`,a),new Intl.NumberFormat("en-US",i)}}export{g as a,f as b,m as d,u as g,d as i};
46
4
  //# sourceMappingURL=get-price-formatter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-price-formatter.js","sources":["/@dropins/tools/src/lib/debounce.ts","/@dropins/tools/src/lib/is-number.ts","/@dropins/tools/src/lib/deviceUtils.ts","/@dropins/tools/src/lib/get-price-formatter.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const debounce = (fn: Function, ms: number) => {\n let timeoutId: ReturnType<typeof setTimeout>;\n const debouncedFn = function (this: any, ...args: any[]) {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => fn.apply(this, args), ms);\n };\n debouncedFn.cancel = () => {\n clearTimeout(timeoutId);\n };\n return debouncedFn;\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const isNumber = (value: number | string): value is number => {\n return typeof value === 'number';\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const isIOSMobileDevice = () => {\n const userAgent = navigator.userAgent.toLowerCase();\n const isIOS = /ipad|iphone|ipod/.test(userAgent);\n const isMacWithTouch = userAgent.includes('mac') && 'ontouchend' in document;\n\n return isIOS || isMacWithTouch;\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { getGlobalLocale } from '@adobe-commerce/elsie/lib';\n\nexport interface PriceFormatterOptions {\n currency?: string | null;\n locale?: string;\n formatOptions?: Intl.NumberFormatOptions;\n}\n\n/**\n * Determines the effective locale to use for price formatting\n * Priority: prop locale > global locale > browser locale > default 'en-US'\n */\nexport function getEffectiveLocale(locale?: string): string {\n if (locale) {\n return locale;\n }\n const globalLocale = getGlobalLocale();\n if (globalLocale) {\n return globalLocale;\n }\n // Fallback to browser locale or default\n return process.env.LOCALE && process.env.LOCALE !== 'undefined' ? process.env.LOCALE : 'en-US';\n}\n\n/**\n * Gets an Intl.NumberFormat instance for price formatting\n * Uses getEffectiveLocale internally to determine the best locale\n *\n * @example\n * // Single price formatting\n * const formatter = getPriceFormatter({ currency: 'USD', locale: 'en-US' });\n * const price = formatter.format(10.99); // \"$10.99\"\n *\n * @example\n * // Bulk price formatting (more efficient)\n * const formatter = getPriceFormatter({ currency: 'EUR', locale: 'fr-FR' });\n * const prices = [10.99, 25.50, 99.99].map(amount => formatter.format(amount));\n */\nexport function getPriceFormatter(\n options: PriceFormatterOptions = {}\n): Intl.NumberFormat {\n const { currency, locale, formatOptions = {} } = options;\n const effectiveLocale = getEffectiveLocale(locale);\n\n const params: Intl.NumberFormatOptions = {\n style: 'currency',\n currency: currency && currency !== 'NONE' ? currency : 'USD',\n // These options are needed to round to whole numbers if that's what you want.\n minimumFractionDigits: 2, // (this suffices for whole numbers, but will print 2500.10 as $2,500.1)\n maximumFractionDigits: 2, // (causes 2500.99 to be printed as $2,501)\n ...formatOptions,\n };\n\n try {\n return new Intl.NumberFormat(effectiveLocale, params);\n } catch (error) {\n console.error(`Error creating Intl.NumberFormat instance for locale ${effectiveLocale}. Falling back to en-US.`, error);\n return new Intl.NumberFormat('en-US', params);\n }\n}\n"],"names":["debounce","fn","ms","timeoutId","debouncedFn","args","isNumber","value","isIOSMobileDevice","userAgent","isIOS","isMacWithTouch","getEffectiveLocale","locale","globalLocale","getGlobalLocale","getPriceFormatter","options","currency","formatOptions","effectiveLocale","params","error"],"mappings":";AASO,MAAMA,IAAW,CAACC,GAAcC,MAAe;AACpD,MAAIC;AACJ,QAAMC,IAAc,YAAwBC,GAAa;AACvD,iBAAaF,CAAS,GACtBA,IAAY,WAAW,MAAMF,EAAG,MAAM,MAAMI,CAAI,GAAGH,CAAE;AAAA,EACvD;AACA,SAAAE,EAAY,SAAS,MAAM;AACzB,iBAAaD,CAAS;AAAA,EACxB,GACOC;AACT,GCVaE,IAAW,CAACC,MAChB,OAAOA,KAAU,UCDbC,IAAoB,MAAM;AACrC,QAAMC,IAAY,UAAU,UAAU,YAAA,GAChCC,IAAQ,mBAAmB,KAAKD,CAAS,GACzCE,IAAiBF,EAAU,SAAS,KAAK,KAAK,gBAAgB;AAEpE,SAAOC,KAASC;AAClB;ACMO,SAASC,EAAmBC,GAAyB;AAC1D,MAAIA;AACF,WAAOA;AAET,QAAMC,IAAeC,EAAA;AACrB,SAAID,MAIG,QAAQ,IAAI,UAAU,QAAQ,IAAI,WAAW,cAAc,QAAQ,IAAI,SAAS;AACzF;AAgBO,SAASE,EACdC,IAAiC,IACd;AACnB,QAAM,EAAE,UAAAC,GAAU,QAAAL,GAAQ,eAAAM,IAAgB,CAAA,MAAOF,GAC3CG,IAAkBR,EAAmBC,CAAM,GAE3CQ,IAAmC;AAAA,IACvC,OAAO;AAAA,IACP,UAAUH,KAAYA,MAAa,SAASA,IAAW;AAAA;AAAA,IAEvD,uBAAuB;AAAA;AAAA,IACvB,uBAAuB;AAAA;AAAA,IACvB,GAAGC;AAAA,EAAA;AAGL,MAAI;AACF,WAAO,IAAI,KAAK,aAAaC,GAAiBC,CAAM;AAAA,EACtD,SAASC,GAAO;AACd,mBAAQ,MAAM,wDAAwDF,CAAe,4BAA4BE,CAAK,GAC/G,IAAI,KAAK,aAAa,SAASD,CAAM;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"get-price-formatter.js","sources":["/@dropins/tools/src/lib/debounce.ts","/@dropins/tools/src/lib/is-number.ts","/@dropins/tools/src/lib/deviceUtils.ts","/@dropins/tools/src/lib/get-price-formatter.ts"],"sourcesContent":["/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const debounce = (fn: Function, ms: number) => {\n let timeoutId: ReturnType<typeof setTimeout>;\n const debouncedFn = function (this: any, ...args: any[]) {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => fn.apply(this, args), ms);\n };\n debouncedFn.cancel = () => {\n clearTimeout(timeoutId);\n };\n return debouncedFn;\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const isNumber = (value: number | string): value is number => {\n return typeof value === 'number';\n};\n","/********************************************************************\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this \n * file in accordance with the terms of the Adobe license agreement \n * accompanying it. \n *******************************************************************/\n\nexport const isIOSMobileDevice = () => {\n const userAgent = navigator.userAgent.toLowerCase();\n const isIOS = /ipad|iphone|ipod/.test(userAgent);\n const isMacWithTouch = userAgent.includes('mac') && 'ontouchend' in document;\n\n return isIOS || isMacWithTouch;\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { getGlobalLocale } from '@adobe-commerce/elsie/lib';\n\nexport interface PriceFormatterOptions {\n currency?: string | null;\n locale?: string;\n formatOptions?: Intl.NumberFormatOptions;\n}\n\n/**\n * Determines the effective locale to use for price formatting\n * Priority: prop locale > global locale > browser locale > default 'en-US'\n */\nexport function getEffectiveLocale(locale?: string): string {\n if (locale) {\n return locale;\n }\n const globalLocale = getGlobalLocale();\n if (globalLocale) {\n return globalLocale;\n }\n // Fallback to browser locale or default\n return process.env.LOCALE && process.env.LOCALE !== 'undefined' ? process.env.LOCALE : 'en-US';\n}\n\n/**\n * Gets an Intl.NumberFormat instance for price formatting\n * Uses getEffectiveLocale internally to determine the best locale\n *\n * @example\n * // Single price formatting\n * const formatter = getPriceFormatter({ currency: 'USD', locale: 'en-US' });\n * const price = formatter.format(10.99); // \"$10.99\"\n *\n * @example\n * // Bulk price formatting (more efficient)\n * const formatter = getPriceFormatter({ currency: 'EUR', locale: 'fr-FR' });\n * const prices = [10.99, 25.50, 99.99].map(amount => formatter.format(amount));\n */\nexport function getPriceFormatter(\n options: PriceFormatterOptions = {}\n): Intl.NumberFormat {\n const { currency, locale, formatOptions = {} } = options;\n const effectiveLocale = getEffectiveLocale(locale);\n\n const params: Intl.NumberFormatOptions = {\n style: 'currency',\n currency: currency && currency !== 'NONE' ? currency : 'USD',\n // These options are needed to round to whole numbers if that's what you want.\n minimumFractionDigits: 2, // (this suffices for whole numbers, but will print 2500.10 as $2,500.1)\n maximumFractionDigits: 2, // (causes 2500.99 to be printed as $2,501)\n ...formatOptions,\n };\n\n try {\n return new Intl.NumberFormat(effectiveLocale, params);\n } catch (error) {\n console.error(`Error creating Intl.NumberFormat instance for locale ${effectiveLocale}. Falling back to en-US.`, error);\n return new Intl.NumberFormat('en-US', params);\n }\n}\n"],"names":["debounce","fn","ms","timeoutId","debouncedFn","args","isNumber","value","isIOSMobileDevice","userAgent","isIOS","isMacWithTouch","getEffectiveLocale","locale","globalLocale","getGlobalLocale","define_process_env_default","getPriceFormatter","options","currency","formatOptions","effectiveLocale","params","error"],"mappings":"uCASO,MAAMA,EAAW,CAACC,EAAcC,IAAe,CACpD,IAAIC,EACJ,MAAMC,EAAc,YAAwBC,EAAa,CACvD,aAAaF,CAAS,EACtBA,EAAY,WAAW,IAAMF,EAAG,MAAM,KAAMI,CAAI,EAAGH,CAAE,CACvD,EACA,OAAAE,EAAY,OAAS,IAAM,CACzB,aAAaD,CAAS,CACxB,EACOC,CACT,ECVaE,EAAYC,GAChB,OAAOA,GAAU,SCDbC,EAAoB,IAAM,CACrC,MAAMC,EAAY,UAAU,UAAU,YAAA,EAChCC,EAAQ,mBAAmB,KAAKD,CAAS,EACzCE,EAAiBF,EAAU,SAAS,KAAK,GAAK,eAAgB,SAEpE,OAAOC,GAASC,CAClB,WCMO,SAASC,EAAmBC,EAAyB,CAC1D,GAAIA,EACF,OAAOA,EAET,MAAMC,EAAeC,EAAA,EACrB,OAAID,IAIGE,EAAY,QAAUA,EAAY,SAAW,YAAcA,EAAY,OAAS,QACzF,CAgBO,SAASC,EACdC,EAAiC,GACd,CACnB,KAAM,CAAE,SAAAC,EAAU,OAAAN,EAAQ,cAAAO,EAAgB,CAAA,GAAOF,EAC3CG,EAAkBT,EAAmBC,CAAM,EAE3CS,EAAmC,CACvC,MAAO,WACP,SAAUH,GAAYA,IAAa,OAASA,EAAW,MAEvD,sBAAuB,EACvB,sBAAuB,EACvB,GAAGC,CAAA,EAGL,GAAI,CACF,OAAO,IAAI,KAAK,aAAaC,EAAiBC,CAAM,CACtD,OAASC,EAAO,CACd,eAAQ,MAAM,wDAAwDF,CAAe,2BAA4BE,CAAK,EAC/G,IAAI,KAAK,aAAa,QAASD,CAAM,CAC9C,CACF"}