@foxy.io/elements 1.39.0-beta.4 → 1.39.0-beta.6

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.
@@ -100,13 +100,49 @@
100
100
  "helper_text": ""
101
101
  }
102
102
  },
103
- "legacy-api": {
104
- "label": "Legacy API",
103
+ "store-secrets": {
104
+ "label": "Store secrets",
105
105
  "helper_text": "",
106
+ "use-single-secret": {
107
+ "label": "Use a universal store secret",
108
+ "helper_text": "When enabled, we will use the same secret for cart signing, legacy API, XML datafeed and SSO. Note that changing this setting will invalidate all existing secrets.",
109
+ "checked": "Yes",
110
+ "unchecked": "No"
111
+ },
112
+ "webhook-key": {
113
+ "label": "Universal store secret",
114
+ "placeholder": "None",
115
+ "helper_text": "",
116
+ "v8n_required": "Please create a universal store secret.",
117
+ "v8n_too_long": "Please shorten this value to 100 characters or less."
118
+ },
106
119
  "webhook-key-api-legacy": {
107
- "label": "API key",
120
+ "label": "Legacy API key",
108
121
  "placeholder": "None",
109
- "helper_text": ""
122
+ "helper_text": "",
123
+ "v8n_required": "Please create a legacy API key.",
124
+ "v8n_too_long": "Please shorten this value to 100 characters or less."
125
+ },
126
+ "webhook-key-xml-datafeed": {
127
+ "label": "Legacy XML datafeed encryption key",
128
+ "placeholder": "None",
129
+ "helper_text": "",
130
+ "v8n_required": "Please create a legacy XML datafeed encryption key.",
131
+ "v8n_too_long": "Please shorten this value to 100 characters or less."
132
+ },
133
+ "webhook-key-sso": {
134
+ "label": "SSO secret",
135
+ "placeholder": "None",
136
+ "helper_text": "",
137
+ "v8n_required": "Please create an SSO secret.",
138
+ "v8n_too_long": "Please shorten this value to 100 characters or less."
139
+ },
140
+ "webhook-key-cart-signing": {
141
+ "label": "Cart signing key",
142
+ "placeholder": "None",
143
+ "helper_text": "",
144
+ "v8n_required": "Please create a cart signing key.",
145
+ "v8n_too_long": "Please shorten this value to 100 characters or less."
110
146
  }
111
147
  },
112
148
  "emails": {
@@ -197,22 +233,29 @@
197
233
  "day": "Day",
198
234
  "day_plural": "Days"
199
235
  },
200
- "webhook-key-cart-signing": {
201
- "label": "HMAC encryption key",
202
- "placeholder": "None",
203
- "helper_text": ""
204
- },
205
236
  "use-cart-validation": {
206
237
  "label": "Prevent product link and form tampering",
207
238
  "helper_text": "Enabling this option will require all cart links and forms to pass HMAC-based verification before products can be added to the cart. You will need to sign your HTML to use this feature.",
208
239
  "checked": "Yes",
209
- "unchecked": "No"
240
+ "unchecked": "No",
241
+ "v8n_webhook_key_required": "Please create a cart signing key or a universal store secret to enable this feature."
210
242
  },
211
243
  "products-require-expires-property": {
212
244
  "label": "My products have limited availability",
213
245
  "helper_text": "All products added to the cart for your store will need to contain the expires property to ensure stale products can't be purchased.",
214
246
  "checked": "Yes",
215
247
  "unchecked": "No"
248
+ },
249
+ "webhook-key-cart-signing": {
250
+ "label": "Cart signing key",
251
+ "helper_text": "You can edit this key in ",
252
+ "link_text": "Store Secrets settings",
253
+ "copy-to-clipboard": {
254
+ "failed_to_copy": "Failed to copy",
255
+ "click_to_copy": "Copy",
256
+ "copying": "Copying...",
257
+ "done": "Copied"
258
+ }
216
259
  }
217
260
  },
218
261
  "checkout": {
@@ -239,7 +282,8 @@
239
282
  "label": "Enable SSO",
240
283
  "helper_text": "When enabled, Foxy will redirect customers to your SSO endpoint prior to hitting the checkout page. You can use this to validate items or to log customers in via your own auth provider.",
241
284
  "checked": "Yes",
242
- "unchecked": "No"
285
+ "unchecked": "No",
286
+ "v8n_webhook_key_required": "Please create an SSO secret or a universal store secret to enable this feature."
243
287
  },
244
288
  "single-sign-on-url": {
245
289
  "label": "SSO endpoint",
@@ -250,8 +294,14 @@
250
294
  },
251
295
  "webhook-key-sso": {
252
296
  "label": "SSO secret",
253
- "placeholder": "None",
254
- "helper_text": ""
297
+ "helper_text": "You can edit this secret in ",
298
+ "link_text": "Store Secrets settings",
299
+ "copy-to-clipboard": {
300
+ "failed_to_copy": "Failed to copy",
301
+ "click_to_copy": "Copy",
302
+ "copying": "Copying...",
303
+ "done": "Copied"
304
+ }
255
305
  }
256
306
  },
257
307
  "receipt": {
@@ -344,18 +394,26 @@
344
394
  "label": "Enable datafeed",
345
395
  "helper_text": "This is a deprecated webhook that should only be used for third-party integrations that still require it. For any new integrations where you need to trigger a webhook for each transaction on your store, we strongly recommend using the JSON webhooks.",
346
396
  "checked": "Yes",
347
- "unchecked": "No"
397
+ "unchecked": "No",
398
+ "v8n_webhook_key_required": "Please create a legacy XML datafeed encryption key or a universal store secret to enable this feature."
348
399
  },
349
400
  "webhook-url": {
350
401
  "label": "Webhook URL",
351
402
  "placeholder": "https://example.com/my-xml-datafeed",
352
403
  "helper_text": "",
353
- "v8n_too_long": "Please shorten this URL to 300 characters or less"
404
+ "v8n_too_long": "Please shorten this URL to 300 characters or less.",
405
+ "v8n_required": "Please enter a URL."
354
406
  },
355
407
  "webhook-key-xml-datafeed": {
356
408
  "label": "Encryption key",
357
- "placeholder": "None",
358
- "helper_text": ""
409
+ "helper_text": "You can edit this key in ",
410
+ "link_text": "Store Secrets settings",
411
+ "copy-to-clipboard": {
412
+ "failed_to_copy": "Failed to copy",
413
+ "click_to_copy": "Copy",
414
+ "copying": "Copying...",
415
+ "done": "Copied"
416
+ }
359
417
  }
360
418
  },
361
419
  "hcaptcha": {
@@ -21,5 +21,6 @@ export declare class InternalCustomerPortalPasswordResetView extends InternalCus
21
21
  private readonly __generatorOptions;
22
22
  renderBody(): TemplateResult;
23
23
  submit(): void;
24
+ protected _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult>;
24
25
  }
25
26
  export {};
@@ -68,5 +68,15 @@ export class InternalCustomerPortalPasswordResetView extends TranslatableMixin(I
68
68
  this.edit({ password_old: (_a = this.passwordOld) !== null && _a !== void 0 ? _a : '' });
69
69
  super.submit();
70
70
  }
71
+ async _fetch(...args) {
72
+ const request = new Request(...args);
73
+ if (request.method !== 'PATCH')
74
+ return super._fetch(...args);
75
+ const body = await request.json();
76
+ const data = await super._fetch(...args);
77
+ data.password_old = body.password_old;
78
+ data.password = body.password;
79
+ return data;
80
+ }
71
81
  }
72
82
  //# sourceMappingURL=InternalCustomerPortalPasswordResetView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalCustomerPortalPasswordResetView.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,gBAAgB,CAAC;AAYhE,MAAM,OAAO,uCAAwC,SAAQ,iBAAiB,CAAC,YAAY,CAAO;IAAlG;;QA2BE,gBAAW,GAAkB,IAAI,CAAC;QAEjB,uBAAkB,GAAqB;YACtD,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC;SACxD,CAAC;IAqCJ,CAAC;IAnEC,MAAM,KAAK,UAAU;QACnB,OAAO;YACL,GAAG,KAAK,CAAC,UAAU;YACnB,WAAW,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE;SAC3C,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,KAAK,CAAC,MAAM;YACZ,GAAG;;;OAIF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG;QACZ,OAAO;YACL,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,uBAAuB;YACnD,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,EAAE,IAAI,uBAAuB;YACpE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,uBAAuB;SAClF,CAAC;IACJ,CAAC;IAQD,UAAU;QACR,OAAO,IAAI,CAAA;;yCAE0B,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW;;;;2BAI7D,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB;;;;;;;;8BAQjD,IAAI,CAAC,kBAAkB;;;;;;;sBAO/B,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;mBACpC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;;;;;KAKjC,CAAC;IACJ,CAAC;IAED,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,QAAE,IAAI,CAAC,WAAW,mCAAI,EAAE,EAAE,CAAC,CAAC;QACpD,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { GeneratorOptions } from '../../internal/InternalPasswordControl/generateRandomPassword';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Graph } from '@foxy.io/sdk/customer';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { html, css } from 'lit-element';\n\nimport checkPasswordStrength from 'check-password-strength';\nconst passwordStrength = checkPasswordStrength.passwordStrength;\n\ntype Data = Resource<\n Graph & {\n props: {\n /** When updating the password using Customer API, these values are required to complete the request. */\n password_old?: string;\n password?: string;\n };\n }\n>;\n\nexport class InternalCustomerPortalPasswordResetView extends TranslatableMixin(InternalForm)<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n passwordOld: { attribute: 'password-old' },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n .max-w-25rem {\n max-width: 25rem;\n }\n `,\n ];\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ password: v }) => !!v || 'password:v8n_required',\n ({ password: v }) => !v || v.length <= 50 || 'password:v8n_too_long',\n ({ password: v }) => !v || passwordStrength(v).id >= 2 || 'password:v8n_too_weak',\n ];\n }\n\n passwordOld: string | null = null;\n\n private readonly __generatorOptions: GeneratorOptions = {\n checkStrength: value => passwordStrength(value).id >= 2,\n };\n\n renderBody(): TemplateResult {\n return html`\n <div class=\"m-auto max-w-25rem leading-s\">\n <p class=\"text-xxl font-medium ${this.in('busy') ? 'text-disabled' : 'text-body'}\">\n <foxy-i18n infer=\"\" key=\"title\"></foxy-i18n>\n </p>\n\n <p class=\"text-l ${this.in('busy') ? 'text-disabled' : 'text-secondary'}\">\n <foxy-i18n infer=\"\" key=\"subtitle\"></foxy-i18n>\n </p>\n\n <foxy-internal-password-control\n infer=\"password\"\n class=\"mt-m\"\n show-generator\n .generatorOptions=${this.__generatorOptions}\n >\n </foxy-internal-password-control>\n\n <vaadin-button\n class=\"w-full mt-l\"\n theme=\"primary\"\n ?disabled=${this.disabled || !this.in('idle')}\n @click=${() => this.submit()}\n >\n <foxy-i18n infer=\"\" key=\"submit\"></foxy-i18n>\n </vaadin-button>\n </div>\n `;\n }\n\n submit(): void {\n this.edit({ password_old: this.passwordOld ?? '' });\n super.submit();\n }\n}\n"]}
1
+ {"version":3,"file":"InternalCustomerPortalPasswordResetView.js","sourceRoot":"","sources":["../../../../src/elements/public/CustomerPortal/InternalCustomerPortalPasswordResetView.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,IAAI,EAAE,GAA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AC,CAAC,CAAC,gBAAgB;;;;;;;;8BAQjD,IAAI,CAAC,kBAAkB;;;;;;;sBAO/B,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;mBACpC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;;;;;KAKjC,CAAC;IACJ,CAAC;IAED,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,QAAE,IAAI,CAAC,WAAW,mCAAI,EAAE,EAAE,CAAC,CAAC;QACpD,KAAK,CAAC,MAAM,EAAE,CAAC;IACjB,CAAC;IAES,KAAK,CAAC,MAAM,CAAiB,GAAG,IAAiC;QACzE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;QACrC,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC,MAAM,CAAU,GAAG,IAAI,CAAC,CAAC;QAEtE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,MAAM,CAAO,GAAG,IAAI,CAAC,CAAC;QAE/C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE9B,OAAO,IAA0B,CAAC;IACpC,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { GeneratorOptions } from '../../internal/InternalPasswordControl/generateRandomPassword';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Graph } from '@foxy.io/sdk/customer';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { html, css } from 'lit-element';\n\nimport checkPasswordStrength from 'check-password-strength';\nconst passwordStrength = checkPasswordStrength.passwordStrength;\n\ntype Data = Resource<\n Graph & {\n props: {\n /** When updating the password using Customer API, these values are required to complete the request. */\n password_old?: string;\n password?: string;\n };\n }\n>;\n\nexport class InternalCustomerPortalPasswordResetView extends TranslatableMixin(InternalForm)<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n passwordOld: { attribute: 'password-old' },\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n .max-w-25rem {\n max-width: 25rem;\n }\n `,\n ];\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ password: v }) => !!v || 'password:v8n_required',\n ({ password: v }) => !v || v.length <= 50 || 'password:v8n_too_long',\n ({ password: v }) => !v || passwordStrength(v).id >= 2 || 'password:v8n_too_weak',\n ];\n }\n\n passwordOld: string | null = null;\n\n private readonly __generatorOptions: GeneratorOptions = {\n checkStrength: value => passwordStrength(value).id >= 2,\n };\n\n renderBody(): TemplateResult {\n return html`\n <div class=\"m-auto max-w-25rem leading-s\">\n <p class=\"text-xxl font-medium ${this.in('busy') ? 'text-disabled' : 'text-body'}\">\n <foxy-i18n infer=\"\" key=\"title\"></foxy-i18n>\n </p>\n\n <p class=\"text-l ${this.in('busy') ? 'text-disabled' : 'text-secondary'}\">\n <foxy-i18n infer=\"\" key=\"subtitle\"></foxy-i18n>\n </p>\n\n <foxy-internal-password-control\n infer=\"password\"\n class=\"mt-m\"\n show-generator\n .generatorOptions=${this.__generatorOptions}\n >\n </foxy-internal-password-control>\n\n <vaadin-button\n class=\"w-full mt-l\"\n theme=\"primary\"\n ?disabled=${this.disabled || !this.in('idle')}\n @click=${() => this.submit()}\n >\n <foxy-i18n infer=\"\" key=\"submit\"></foxy-i18n>\n </vaadin-button>\n </div>\n `;\n }\n\n submit(): void {\n this.edit({ password_old: this.passwordOld ?? '' });\n super.submit();\n }\n\n protected async _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult> {\n const request = new Request(...args);\n if (request.method !== 'PATCH') return super._fetch<TResult>(...args);\n\n const body = await request.json();\n const data = await super._fetch<Data>(...args);\n\n data.password_old = body.password_old;\n data.password = body.password;\n\n return data as unknown as TResult;\n }\n}\n"]}
@@ -346,9 +346,12 @@ export class ItemCard extends Base {
346
346
  return `subinfo_${frequency === '.5m' ? 'twice_a_month' : 'recurring'}`;
347
347
  }
348
348
  get __filteredOptions() {
349
- var _a, _b, _c, _d, _e;
350
- const allOptions = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a._embedded) === null || _b === void 0 ? void 0 : _b['fx:item_options'];
351
- const hiddenOptions = (_e = (_d = (_c = this.settings) === null || _c === void 0 ? void 0 : _c.cart_display_config) === null || _d === void 0 ? void 0 : _d.hidden_product_options) !== null && _e !== void 0 ? _e : [];
349
+ var _a, _b, _c, _d;
350
+ const config = (_a = this.settings) === null || _a === void 0 ? void 0 : _a.cart_display_config;
351
+ if ((config === null || config === void 0 ? void 0 : config.show_product_options) === false)
352
+ return [];
353
+ const allOptions = (_c = (_b = this.data) === null || _b === void 0 ? void 0 : _b._embedded) === null || _c === void 0 ? void 0 : _c['fx:item_options'];
354
+ const hiddenOptions = (_d = config === null || config === void 0 ? void 0 : config.hidden_product_options) !== null && _d !== void 0 ? _d : [];
352
355
  return allOptions === null || allOptions === void 0 ? void 0 : allOptions.filter(option => !hiddenOptions.includes(option.name));
353
356
  }
354
357
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ItemCard.js","sourceRoot":"","sources":["../../../../src/elements/public/ItemCard/ItemCard.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAChE,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,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AAC,SAAS,CAAC;YAC5B,MAAM,EAAE,GAAG,UAAU,IAAI,YAAY,EAAE;YACvC,eAAe;YACf,SAAS;SACV,CAAC;IACJ,CAAC;IAED,IAAY,YAAY;;QACtB,MAAM,SAAS,SAAG,IAAI,CAAC,IAAI,0CAAE,sBAAsB,CAAC;QACpD,IAAI,SAAS;YAAE,OAAO,WAAW,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACzF,CAAC;IAED,IAAY,iBAAiB;;QAC3B,MAAM,UAAU,eAAG,IAAI,CAAC,IAAI,0CAAE,SAAS,0CAAG,iBAAiB,CAAC,CAAC;QAC7D,MAAM,aAAa,qBAAG,IAAI,CAAC,QAAQ,0CAAE,mBAAmB,0CAAE,sBAAsB,mCAAI,EAAE,CAAC;QACvF,OAAO,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;IAC5E,CAAC;;AArVuB,sBAAa,GACnC,+wDAA+wD,CAAC","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { TemplateResult } from 'lit-html';\nimport type { Data, Settings } from './types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { parseFrequency } from '../../../utils/parse-frequency';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { decode } from 'html-entities';\nimport { html } from 'lit-html';\n\nconst NS = 'item-card';\nconst Base = ConfigurableMixin(TranslatableMixin(InternalCard, NS));\n\n/**\n * Basic card displaying an item.\n *\n * @element foxy-item-card\n * @since 1.17.0\n */\nexport class ItemCard extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n localeCodes: { type: String, attribute: 'locale-codes' },\n settings: { type: Object },\n };\n }\n\n localeCodes: string | null = null;\n\n settings: Settings | null = null;\n\n private static readonly __placeholder =\n 'data:image/svg+xml,%3Csvg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Crect width=\"40\" height=\"40\" fill=\"%23E8E8E8\"/%3E%3Cpath d=\"M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z\" fill=\"white\"/%3E%3Cpath d=\"M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z\" fill=\"white\"/%3E%3Cpath d=\"M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z\" fill=\"white\"/%3E%3Cpath d=\"M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z\" fill=\"white\"/%3E%3Cpath d=\"M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z\" fill=\"white\"/%3E%3Cpath d=\"M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z\" fill=\"white\"/%3E%3Cpath d=\"M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z\" fill=\"white\"/%3E%3Cpath d=\"M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z\" fill=\"white\"/%3E%3Cpath d=\"M40 40H34.8333L40 34.8333V40Z\" fill=\"white\"/%3E%3Cpath d=\"M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z\" fill=\"white\"/%3E%3Cpath d=\"M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z\" fill=\"white\"/%3E%3Cpath d=\"M0 0H6.37152L0 6.37151V0Z\" fill=\"white\"/%3E%3Cpath d=\"M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z\" fill=\"white\"/%3E%3Cpath d=\"M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z\" fill=\"white\"/%3E%3C/svg%3E';\n\n private readonly __transactionTemplateLoaderId = 'transactionTemplateLoader';\n\n private readonly __defaultTemplateSetLoaderId = 'defaultTemplateSetLoader';\n\n private readonly __localeCodesHelperLoaderId = 'localeCodesLoader';\n\n private readonly __transactionLoaderId = 'transactionLoader';\n\n private readonly __templateSetLoaderId = 'templateSetLoader';\n\n private readonly __storeLoaderId = 'storeLoader';\n\n private readonly __cartLoaderId = 'cartLoader';\n\n renderBody(): TemplateResult {\n const displayConfig = this.settings?.cart_display_config;\n const quantity = this.data?.quantity ?? 0;\n const options = this.__filteredOptions;\n const price = this.data?.price ?? 0;\n const code = this.data?.code ?? '';\n\n const displayedCode = displayConfig ? (displayConfig.show_product_code ? code : '') : code;\n const currencyDisplay = this.__currencyDisplay;\n const currencyCode = this.__currencyCode;\n\n return html`\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__transactionTemplateHref)}\n id=${this.__transactionTemplateLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__defaultTemplateSetHref)}\n id=${this.__defaultTemplateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__localeCodesHelperHref)}\n id=${this.__localeCodesHelperLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__transactionHref)}\n id=${this.__transactionLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__templateSetHref)}\n id=${this.__templateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__storeHref)}\n id=${this.__storeLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__cartHref)}\n id=${this.__cartLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <div\n class=\"flex items-start leading-xs\"\n style=\"gap: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <img\n class=\"relative h-s w-s object-cover rounded-s bg-contrast-20 flex-shrink-0 shadow-xs\"\n src=${ifDefined(this.data?.image)}\n alt=\"\"\n @error=${(evt: Event) => {\n const img = evt.currentTarget as HTMLImageElement;\n img.src = ItemCard.__placeholder;\n }}\n />\n\n <div class=\"flex-1 min-w-0\">\n <div class=\"h-s flex items-center\">\n <div class=\"min-w-0 flex-1 leading-s\">\n <div class=\"flex items-center justify-between\">\n <div class=\"truncate text-m font-medium\">\n ${decode(this.data?.name) || html`<foxy-i18n infer=\"\" key=\"no_code\"></foxy-i18n>`}\n </div>\n <span class=\"text-s text-tertiary whitespace-nowrap\">\n ${quantity} &times;\n <foxy-i18n\n .options=${{ amount: `${price} ${currencyCode}`, currencyDisplay }}\n key=\"price\"\n infer=\"\"\n >\n </foxy-i18n>\n </span>\n </div>\n\n <div class=\"truncate text-secondary text-s\">\n ${displayedCode}\n ${(displayConfig?.show_sub_frequency ?? true) &&\n this.data?.subscription_frequency &&\n !this.hiddenSelector.matches('autorenew-icon', true)\n ? html`\n ${displayedCode ? html`<span> &bull; </span>` : ''}\n <foxy-i18n\n infer=\"\"\n key=${this.__subinfoKey}\n .options=${this.__subinfoOptions}\n >\n </foxy-i18n>\n `\n : ''}\n &ZeroWidthSpace;\n </div>\n </div>\n </div>\n\n ${options && options.length > 0\n ? html`\n <div class=\"mt-m\">\n ${options.map(\n option => html`\n <div data-testclass=\"option\" class=\"flex items-center gap-s text-s leading-s\">\n <div class=\"truncate text-secondary\">\n ${option.name}: <span class=\"font-medium text-body\">${option.value}</span>\n </div>\n\n ${option.price_mod\n ? html`\n <div class=\"border-t border-dashed border-contrast-10 flex-1\"></div>\n <div class=\"whitespace-nowrap text-tertiary\">\n <foxy-i18n\n options=${JSON.stringify({\n amount: `${option.price_mod} ${currencyCode}`,\n signDisplay: 'exceptZero',\n currencyDisplay: currencyDisplay,\n })}\n key=\"price\"\n infer=\"\"\n >\n </foxy-i18n>\n </div>\n `\n : ''}\n </div>\n `\n )}\n </div>\n `\n : ''}\n </div>\n </div>\n `;\n }\n\n get isBodyReady(): boolean {\n const isLoaded = !!this.__currencyDisplay && !!this.__currencyCode;\n return super.isBodyReady && isLoaded;\n }\n\n private get __transactionTemplateHref() {\n try {\n const links = this.data?._links as Partial<Record<string, { href: string }>> | undefined;\n const url = new URL(links?.['fx:subscription']?.href ?? '');\n url.searchParams.set('zoom', 'transaction_template');\n return url.toString();\n } catch {\n //\n }\n }\n\n private get __defaultTemplateSetHref() {\n const templateSetUri = (this.__cart ?? this.__transactionTemplate)?.template_set_uri;\n\n if (templateSetUri === '') {\n try {\n const url = new URL(this.__store?._links['fx:template_sets'].href ?? '');\n url.searchParams.set('code', 'DEFAULT');\n return url.toString();\n } catch {\n //\n }\n }\n }\n\n private get __localeCodesHelperHref() {\n if (this.__defaultTemplateSetHref || this.__templateSetHref) {\n return this.localeCodes ?? void 0;\n }\n }\n\n private get __transactionHref() {\n return this.data?._links['fx:transaction']?.href;\n }\n\n private get __templateSetHref() {\n const cart = this.__cart ?? this.__transactionTemplate;\n if (!cart?.currency_code) return cart?.template_set_uri || void 0;\n }\n\n private get __storeHref() {\n return this.data?._links['fx:store']?.href;\n }\n\n private get __cartHref() {\n const links = this.data?._links as Partial<Record<string, { href: string }>> | undefined;\n return links?.['fx:cart']?.href;\n }\n\n private get __transactionTemplate() {\n type Loader = NucleonElement<Resource<Rels.Subscription, { zoom: 'transaction_template' }>>;\n const selector = `#${this.__transactionTemplateLoaderId}`;\n const loader = this.renderRoot.querySelector<Loader>(selector);\n return loader?.data?._embedded['fx:transaction_template'] ?? null;\n }\n\n private get __defaultTemplateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSets>>;\n const selector = `#${this.__defaultTemplateSetLoaderId}`;\n const loader = this.renderRoot.querySelector<Loader>(selector);\n return loader?.data?._embedded['fx:template_sets'][0] ?? null;\n }\n\n private get __localeCodesHelper() {\n type Loader = NucleonElement<Resource<Rels.LocaleCodes>>;\n const selector = `#${this.__localeCodesHelperLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __transaction() {\n type Loader = NucleonElement<Resource<Rels.Transaction>>;\n const selector = `#${this.__transactionLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __templateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSet>>;\n const selector = `#${this.__templateSetLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __store() {\n type Loader = NucleonElement<Resource<Rels.Store>>;\n const selector = `#${this.__storeLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __cart() {\n type Loader = NucleonElement<Resource<Rels.Cart>>;\n const selector = `#${this.__cartLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __currencyDisplay() {\n const useCode = this.__store?.use_international_currency_symbol;\n\n if (useCode === true) return 'code';\n if (useCode === false) return 'symbol';\n if (this.data && !this.data._links['fx:store']) return 'symbol';\n }\n\n private get __currencyCode() {\n const transaction = this.__transaction;\n\n if (transaction) {\n return transaction.currency_code;\n } else {\n const cart = this.__cart ?? this.__transactionTemplate;\n\n if (cart?.currency_code) {\n return cart.currency_code;\n } else {\n const allLocaleCodes = this.__localeCodesHelper;\n const localeCode = (this.__templateSet ?? this.__defaultTemplateSet)?.locale_code;\n const localeInfo = localeCode ? allLocaleCodes?.values[localeCode] : void 0;\n\n if (localeInfo) return /Currency: ([A-Z]{3})/g.exec(localeInfo)?.[1];\n }\n }\n }\n\n private get __subinfoOptions() {\n const currencyDisplay = this.__currencyDisplay;\n if (currencyDisplay === undefined) return;\n\n const currencyCode = this.__currencyCode;\n if (currencyCode === undefined) return;\n\n const totalOrder = this.__transactionTemplate?.total_order;\n if (totalOrder === undefined) return;\n\n const frequency = this.data?.subscription_frequency;\n if (frequency === undefined) return;\n\n const startDate = this.data?.subscription_start_date;\n if (startDate === undefined) return;\n\n return {\n ...parseFrequency(frequency),\n amount: `${totalOrder} ${currencyCode}`,\n currencyDisplay,\n startDate,\n };\n }\n\n private get __subinfoKey() {\n const frequency = this.data?.subscription_frequency;\n if (frequency) return `subinfo_${frequency === '.5m' ? 'twice_a_month' : 'recurring'}`;\n }\n\n private get __filteredOptions() {\n const allOptions = this.data?._embedded?.['fx:item_options'];\n const hiddenOptions = this.settings?.cart_display_config?.hidden_product_options ?? [];\n return allOptions?.filter(option => !hiddenOptions.includes(option.name));\n }\n}\n"]}
1
+ {"version":3,"file":"ItemCard.js","sourceRoot":"","sources":["../../../../src/elements/public/ItemCard/ItemCard.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAChE,OAAO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KAAK,SAAS;YAAE,OAAO;QAEpC,MAAM,SAAS,SAAG,IAAI,CAAC,IAAI,0CAAE,uBAAuB,CAAC;QACrD,IAAI,SAAS,KAAK,SAAS;YAAE,OAAO;QAEpC,OAAO;YACL,GAAG,cAAc,CAAC,SAAS,CAAC;YAC5B,MAAM,EAAE,GAAG,UAAU,IAAI,YAAY,EAAE;YACvC,eAAe;YACf,SAAS;SACV,CAAC;IACJ,CAAC;IAED,IAAY,YAAY;;QACtB,MAAM,SAAS,SAAG,IAAI,CAAC,IAAI,0CAAE,sBAAsB,CAAC;QACpD,IAAI,SAAS;YAAE,OAAO,WAAW,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACzF,CAAC;IAED,IAAY,iBAAiB;;QAC3B,MAAM,MAAM,SAAG,IAAI,CAAC,QAAQ,0CAAE,mBAAmB,CAAC;QAClD,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,oBAAoB,MAAK,KAAK;YAAE,OAAO,EAAE,CAAC;QAEtD,MAAM,UAAU,eAAG,IAAI,CAAC,IAAI,0CAAE,SAAS,0CAAG,iBAAiB,CAAC,CAAC;QAC7D,MAAM,aAAa,SAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,sBAAsB,mCAAI,EAAE,CAAC;QAC3D,OAAO,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;IAC5E,CAAC;;AAxVuB,sBAAa,GACnC,+wDAA+wD,CAAC","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { NucleonElement } from '../NucleonElement/NucleonElement';\nimport type { TemplateResult } from 'lit-html';\nimport type { Data, Settings } from './types';\nimport type { Resource } from '@foxy.io/sdk/core';\nimport type { Rels } from '@foxy.io/sdk/backend';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { ConfigurableMixin } from '../../../mixins/configurable';\nimport { parseFrequency } from '../../../utils/parse-frequency';\nimport { InternalCard } from '../../internal/InternalCard/InternalCard';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { decode } from 'html-entities';\nimport { html } from 'lit-html';\n\nconst NS = 'item-card';\nconst Base = ConfigurableMixin(TranslatableMixin(InternalCard, NS));\n\n/**\n * Basic card displaying an item.\n *\n * @element foxy-item-card\n * @since 1.17.0\n */\nexport class ItemCard extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n localeCodes: { type: String, attribute: 'locale-codes' },\n settings: { type: Object },\n };\n }\n\n localeCodes: string | null = null;\n\n settings: Settings | null = null;\n\n private static readonly __placeholder =\n 'data:image/svg+xml,%3Csvg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Crect width=\"40\" height=\"40\" fill=\"%23E8E8E8\"/%3E%3Cpath d=\"M31.5143 0H24.5476L0 24.5476V31.5143L11.7046 19.8097L11.9841 17.0782C12.0983 15.9624 13.0131 15.1154 14.1038 15.1154H15.7373V12.1923C15.7373 10.9815 16.6915 10 17.8687 10H21.5143L31.5143 0Z\" fill=\"white\"/%3E%3Cpath d=\"M11.5434 21.3852L0 32.9285V39.8953L11.5822 28.3131C11.172 27.8663 10.9438 27.2444 11.012 26.5782L11.5434 21.3852Z\" fill=\"white\"/%3E%3Cpath d=\"M12.4305 28.879L1.30951 40H8.27631L19.2763 29H13.1316C12.8853 29 12.6495 28.9573 12.4305 28.879Z\" fill=\"white\"/%3E%3Cpath d=\"M28.3113 19.965L28.0159 17.0782C27.9116 16.0591 27.1395 15.2642 26.1754 15.1341L40 1.3095V8.27627L28.3113 19.965Z\" fill=\"white\"/%3E%3Cpath d=\"M20.6905 29L9.69049 40H16.6572L27.9755 28.6817C27.6541 28.8832 27.2756 29 26.8684 29H20.6905Z\" fill=\"white\"/%3E%3Cpath d=\"M28.6572 28C28.9128 27.5952 29.0415 27.1003 28.988 26.5782L28.4426 21.2479L40 9.69053V16.6572L28.6572 28Z\" fill=\"white\"/%3E%3Cpath d=\"M25.0381 40H18.0715L40 18.0715V25.0381L25.0381 40Z\" fill=\"white\"/%3E%3Cpath d=\"M26.4524 40H33.4191L40 33.4191V26.4524L26.4524 40Z\" fill=\"white\"/%3E%3Cpath d=\"M40 40H34.8333L40 34.8333V40Z\" fill=\"white\"/%3E%3Cpath d=\"M16.1666 0H23.1334L0 23.1334V16.1666L16.1666 0Z\" fill=\"white\"/%3E%3Cpath d=\"M14.7524 0H7.78571L0 7.78573V14.7524L14.7524 0Z\" fill=\"white\"/%3E%3Cpath d=\"M0 0H6.37152L0 6.37151V0Z\" fill=\"white\"/%3E%3Cpath d=\"M21.467 11.4615H17.8687C17.4763 11.4615 17.1582 11.7887 17.1582 12.1923V15.1154H22.8418V12.1923C22.8418 11.7887 22.5237 11.4615 22.1313 11.4615H21.467Z\" fill=\"white\"/%3E%3Cpath d=\"M24.7798 15.1154H24.2627V12.1923C24.2627 11.227 23.6562 10.4075 22.8138 10.1148L32.9286 0H39.89L24.7798 15.1154Z\" fill=\"white\"/%3E%3C/svg%3E';\n\n private readonly __transactionTemplateLoaderId = 'transactionTemplateLoader';\n\n private readonly __defaultTemplateSetLoaderId = 'defaultTemplateSetLoader';\n\n private readonly __localeCodesHelperLoaderId = 'localeCodesLoader';\n\n private readonly __transactionLoaderId = 'transactionLoader';\n\n private readonly __templateSetLoaderId = 'templateSetLoader';\n\n private readonly __storeLoaderId = 'storeLoader';\n\n private readonly __cartLoaderId = 'cartLoader';\n\n renderBody(): TemplateResult {\n const displayConfig = this.settings?.cart_display_config;\n const quantity = this.data?.quantity ?? 0;\n const options = this.__filteredOptions;\n const price = this.data?.price ?? 0;\n const code = this.data?.code ?? '';\n\n const displayedCode = displayConfig ? (displayConfig.show_product_code ? code : '') : code;\n const currencyDisplay = this.__currencyDisplay;\n const currencyCode = this.__currencyCode;\n\n return html`\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__transactionTemplateHref)}\n id=${this.__transactionTemplateLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__defaultTemplateSetHref)}\n id=${this.__defaultTemplateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__localeCodesHelperHref)}\n id=${this.__localeCodesHelperLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__transactionHref)}\n id=${this.__transactionLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__templateSetHref)}\n id=${this.__templateSetLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__storeHref)}\n id=${this.__storeLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <foxy-nucleon\n class=\"hidden\"\n infer=\"\"\n href=${ifDefined(this.__cartHref)}\n id=${this.__cartLoaderId}\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n\n <div\n class=\"flex items-start leading-xs\"\n style=\"gap: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n <img\n class=\"relative h-s w-s object-cover rounded-s bg-contrast-20 flex-shrink-0 shadow-xs\"\n src=${ifDefined(this.data?.image)}\n alt=\"\"\n @error=${(evt: Event) => {\n const img = evt.currentTarget as HTMLImageElement;\n img.src = ItemCard.__placeholder;\n }}\n />\n\n <div class=\"flex-1 min-w-0\">\n <div class=\"h-s flex items-center\">\n <div class=\"min-w-0 flex-1 leading-s\">\n <div class=\"flex items-center justify-between\">\n <div class=\"truncate text-m font-medium\">\n ${decode(this.data?.name) || html`<foxy-i18n infer=\"\" key=\"no_code\"></foxy-i18n>`}\n </div>\n <span class=\"text-s text-tertiary whitespace-nowrap\">\n ${quantity} &times;\n <foxy-i18n\n .options=${{ amount: `${price} ${currencyCode}`, currencyDisplay }}\n key=\"price\"\n infer=\"\"\n >\n </foxy-i18n>\n </span>\n </div>\n\n <div class=\"truncate text-secondary text-s\">\n ${displayedCode}\n ${(displayConfig?.show_sub_frequency ?? true) &&\n this.data?.subscription_frequency &&\n !this.hiddenSelector.matches('autorenew-icon', true)\n ? html`\n ${displayedCode ? html`<span> &bull; </span>` : ''}\n <foxy-i18n\n infer=\"\"\n key=${this.__subinfoKey}\n .options=${this.__subinfoOptions}\n >\n </foxy-i18n>\n `\n : ''}\n &ZeroWidthSpace;\n </div>\n </div>\n </div>\n\n ${options && options.length > 0\n ? html`\n <div class=\"mt-m\">\n ${options.map(\n option => html`\n <div data-testclass=\"option\" class=\"flex items-center gap-s text-s leading-s\">\n <div class=\"truncate text-secondary\">\n ${option.name}: <span class=\"font-medium text-body\">${option.value}</span>\n </div>\n\n ${option.price_mod\n ? html`\n <div class=\"border-t border-dashed border-contrast-10 flex-1\"></div>\n <div class=\"whitespace-nowrap text-tertiary\">\n <foxy-i18n\n options=${JSON.stringify({\n amount: `${option.price_mod} ${currencyCode}`,\n signDisplay: 'exceptZero',\n currencyDisplay: currencyDisplay,\n })}\n key=\"price\"\n infer=\"\"\n >\n </foxy-i18n>\n </div>\n `\n : ''}\n </div>\n `\n )}\n </div>\n `\n : ''}\n </div>\n </div>\n `;\n }\n\n get isBodyReady(): boolean {\n const isLoaded = !!this.__currencyDisplay && !!this.__currencyCode;\n return super.isBodyReady && isLoaded;\n }\n\n private get __transactionTemplateHref() {\n try {\n const links = this.data?._links as Partial<Record<string, { href: string }>> | undefined;\n const url = new URL(links?.['fx:subscription']?.href ?? '');\n url.searchParams.set('zoom', 'transaction_template');\n return url.toString();\n } catch {\n //\n }\n }\n\n private get __defaultTemplateSetHref() {\n const templateSetUri = (this.__cart ?? this.__transactionTemplate)?.template_set_uri;\n\n if (templateSetUri === '') {\n try {\n const url = new URL(this.__store?._links['fx:template_sets'].href ?? '');\n url.searchParams.set('code', 'DEFAULT');\n return url.toString();\n } catch {\n //\n }\n }\n }\n\n private get __localeCodesHelperHref() {\n if (this.__defaultTemplateSetHref || this.__templateSetHref) {\n return this.localeCodes ?? void 0;\n }\n }\n\n private get __transactionHref() {\n return this.data?._links['fx:transaction']?.href;\n }\n\n private get __templateSetHref() {\n const cart = this.__cart ?? this.__transactionTemplate;\n if (!cart?.currency_code) return cart?.template_set_uri || void 0;\n }\n\n private get __storeHref() {\n return this.data?._links['fx:store']?.href;\n }\n\n private get __cartHref() {\n const links = this.data?._links as Partial<Record<string, { href: string }>> | undefined;\n return links?.['fx:cart']?.href;\n }\n\n private get __transactionTemplate() {\n type Loader = NucleonElement<Resource<Rels.Subscription, { zoom: 'transaction_template' }>>;\n const selector = `#${this.__transactionTemplateLoaderId}`;\n const loader = this.renderRoot.querySelector<Loader>(selector);\n return loader?.data?._embedded['fx:transaction_template'] ?? null;\n }\n\n private get __defaultTemplateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSets>>;\n const selector = `#${this.__defaultTemplateSetLoaderId}`;\n const loader = this.renderRoot.querySelector<Loader>(selector);\n return loader?.data?._embedded['fx:template_sets'][0] ?? null;\n }\n\n private get __localeCodesHelper() {\n type Loader = NucleonElement<Resource<Rels.LocaleCodes>>;\n const selector = `#${this.__localeCodesHelperLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __transaction() {\n type Loader = NucleonElement<Resource<Rels.Transaction>>;\n const selector = `#${this.__transactionLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __templateSet() {\n type Loader = NucleonElement<Resource<Rels.TemplateSet>>;\n const selector = `#${this.__templateSetLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __store() {\n type Loader = NucleonElement<Resource<Rels.Store>>;\n const selector = `#${this.__storeLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __cart() {\n type Loader = NucleonElement<Resource<Rels.Cart>>;\n const selector = `#${this.__cartLoaderId}`;\n return this.renderRoot.querySelector<Loader>(selector)?.data ?? null;\n }\n\n private get __currencyDisplay() {\n const useCode = this.__store?.use_international_currency_symbol;\n\n if (useCode === true) return 'code';\n if (useCode === false) return 'symbol';\n if (this.data && !this.data._links['fx:store']) return 'symbol';\n }\n\n private get __currencyCode() {\n const transaction = this.__transaction;\n\n if (transaction) {\n return transaction.currency_code;\n } else {\n const cart = this.__cart ?? this.__transactionTemplate;\n\n if (cart?.currency_code) {\n return cart.currency_code;\n } else {\n const allLocaleCodes = this.__localeCodesHelper;\n const localeCode = (this.__templateSet ?? this.__defaultTemplateSet)?.locale_code;\n const localeInfo = localeCode ? allLocaleCodes?.values[localeCode] : void 0;\n\n if (localeInfo) return /Currency: ([A-Z]{3})/g.exec(localeInfo)?.[1];\n }\n }\n }\n\n private get __subinfoOptions() {\n const currencyDisplay = this.__currencyDisplay;\n if (currencyDisplay === undefined) return;\n\n const currencyCode = this.__currencyCode;\n if (currencyCode === undefined) return;\n\n const totalOrder = this.__transactionTemplate?.total_order;\n if (totalOrder === undefined) return;\n\n const frequency = this.data?.subscription_frequency;\n if (frequency === undefined) return;\n\n const startDate = this.data?.subscription_start_date;\n if (startDate === undefined) return;\n\n return {\n ...parseFrequency(frequency),\n amount: `${totalOrder} ${currencyCode}`,\n currencyDisplay,\n startDate,\n };\n }\n\n private get __subinfoKey() {\n const frequency = this.data?.subscription_frequency;\n if (frequency) return `subinfo_${frequency === '.5m' ? 'twice_a_month' : 'recurring'}`;\n }\n\n private get __filteredOptions() {\n const config = this.settings?.cart_display_config;\n if (config?.show_product_options === false) return [];\n\n const allOptions = this.data?._embedded?.['fx:item_options'];\n const hiddenOptions = config?.hidden_product_options ?? [];\n return allOptions?.filter(option => !hiddenOptions.includes(option.name));\n }\n}\n"]}
@@ -14,13 +14,15 @@ declare const Base: typeof InternalForm & import("lit-element").Constructor<impo
14
14
  */
15
15
  export declare class StoreForm extends Base<Data> {
16
16
  static get properties(): PropertyDeclarations;
17
- static get v8n(): NucleonV8N<Data>;
17
+ static get v8n(): NucleonV8N<Data, StoreForm>;
18
18
  /** URL of the `fx:reporting_store_domain_exists` endpoint. */
19
19
  reportingStoreDomainExists: string | null;
20
20
  /** URL of the `fx:customer_password_hash_types` property helper resource. */
21
21
  customerPasswordHashTypes: string | null;
22
22
  /** URL of the `fx:shipping_address_types` property helper resource. */
23
23
  shippingAddressTypes: string | null;
24
+ /** URL of the Store Secrets settings page if you are using this form on multiple pages. */
25
+ storeSecretsPageUrl: string | null;
24
26
  /** hCaptcha site key for signup verification. If provided, requires users to complete a captcha before creating a store. */
25
27
  hCaptchaSiteKey: string | null;
26
28
  /**
@@ -73,15 +75,10 @@ export declare class StoreForm extends Base<Data> {
73
75
  private readonly __smtpConfigSecurityGetValue;
74
76
  private readonly __smtpConfigSecuritySetValue;
75
77
  private readonly __smtpConfigSecurityOptions;
76
- private readonly __webhookKeyGeneratorOptions;
77
- private readonly __webhookKeyApiLegacyGetValue;
78
- private readonly __webhookKeyApiLegacySetValue;
79
- private readonly __webhookKeyCartSigningGetValue;
80
- private readonly __webhookKeyCartSigningSetValue;
81
- private readonly __webhookKeyXmlDatafeedGetValue;
82
- private readonly __webhookKeyXmlDatafeedSetValue;
83
- private readonly __webhookKeySsoGetValue;
84
- private readonly __webhookKeySsoSetValue;
78
+ private readonly __singleWebhookKeyGeneratorOptions;
79
+ private readonly __jsonWebhookKeyGeneratorOptions;
80
+ private readonly __useSingleWebhookKeyGetValue;
81
+ private readonly __useSingleWebhookKeySetValue;
85
82
  private __hCaptchaToken;
86
83
  get headerSubtitleOptions(): Record<string, unknown>;
87
84
  renderBody(): TemplateResult;
@@ -90,8 +87,6 @@ export declare class StoreForm extends Base<Data> {
90
87
  private get __displayIdExamples();
91
88
  private get __journalIdExamples();
92
89
  private get __hCaptcha();
93
- private __getWebhookKey;
94
- private __setWebhookKey;
95
90
  private __getCustomDisplayIdConfig;
96
91
  private __setCustomDisplayIdConfig;
97
92
  private __getTransactionJournalEntriesConfig;
@@ -100,5 +95,6 @@ export declare class StoreForm extends Base<Data> {
100
95
  private __getSmtpConfig;
101
96
  private __setSmtpConfig;
102
97
  private __renderLoader;
98
+ private __renderReadonlyWebhookKey;
103
99
  }
104
100
  export {};