From 70b0218bf07b98e8d6831d52537ca03e35bb3f19 Mon Sep 17 00:00:00 2001 From: Aishwarya Mathuria Date: Thu, 5 Jun 2025 14:38:50 +0530 Subject: [PATCH 01/14] MWPW 173620 | Accessibility | Card-horizontal block heading role change for accessibility (#4257) * Update card-horizontal.js * Update card-horizontal.js * Update card-horizontal.js --- libs/blocks/card-horizontal/card-horizontal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/blocks/card-horizontal/card-horizontal.js b/libs/blocks/card-horizontal/card-horizontal.js index e47adbfc5a..3c76db6970 100644 --- a/libs/blocks/card-horizontal/card-horizontal.js +++ b/libs/blocks/card-horizontal/card-horizontal.js @@ -43,6 +43,7 @@ function decorateContent(block) { const headings = content?.querySelectorAll('h1, h2, h3, h4, h5, h6'); const heading = headings?.[headings.length - 1]; heading?.classList?.add('heading-xs'); + heading?.setAttribute('role', 'presentation'); const paragraphs = content.querySelectorAll(':scope > p'); paragraphs.forEach((item) => item.classList.add('body-xs')); const image = decorateImage(block); From ac6cca97f24d25bf7df345df49838e62f30e0b01 Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Thu, 5 Jun 2025 03:08:57 -0600 Subject: [PATCH 02/14] Using productCode instead productFamily. (#4291) Co-authored-by: Mariia Lukianets --- libs/blocks/merch/merch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index f12d91c828..c693d9ead0 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -842,17 +842,17 @@ export async function buildCta(el, params) { }); } - // Adding aria-label for checkout-link using productFamily and customerSegment as placeholder key. + // Adding aria-label for checkout-link using productCode and customerSegment as placeholder key. if (el.ariaLabel) { // If Milo aria-label available from sharepoint doc, just use it. cta.setAttribute('aria-label', el.ariaLabel); } else if (!cta.ariaLabel) { cta.onceSettled().then(async () => { - const productFamily = cta.value[0]?.productArrangement?.productFamily; + const productCode = cta.value[0]?.productArrangement?.productCode; const { marketSegment, customerSegment } = cta; const segment = marketSegment === 'EDU' ? marketSegment : customerSegment; let ariaLabel = cta.textContent; - ariaLabel = productFamily ? `${ariaLabel} - ${await replaceKey(productFamily, getConfig())}` : ariaLabel; + ariaLabel = productCode ? `${ariaLabel} - ${await replaceKey(productCode, getConfig())}` : ariaLabel; ariaLabel = segment ? `${ariaLabel} - ${await replaceKey(segment, getConfig())}` : ariaLabel; cta.setAttribute('aria-label', ariaLabel); }); From 6f2b4eeed97282470036be223cd5702350dfb5c7 Mon Sep 17 00:00:00 2001 From: Bandana Laishram Date: Thu, 5 Jun 2025 14:39:04 +0530 Subject: [PATCH 03/14] Localnav link group support (#4319) * Fixing css issue for localnav and showing linkgroup description on localnav * Css fix for description --- libs/blocks/global-navigation/base.css | 15 +++++++-------- .../global-navigation/global-navigation.css | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libs/blocks/global-navigation/base.css b/libs/blocks/global-navigation/base.css index 35d757e1fc..79ce3d70c8 100644 --- a/libs/blocks/global-navigation/base.css +++ b/libs/blocks/global-navigation/base.css @@ -132,8 +132,7 @@ header.new-nav .feds-nav > section.feds-navItem > .feds-popup .has-subheader .fe display: block; } -.feds-navLink-image, -.feds-navLink-description { +.feds-navLink-image { display: none; } @@ -150,6 +149,12 @@ header.global-navigation.ready { pointer-events: none; } +.feds-navLink-description { + display: flex; + font-size: 12px; + color: var(--feds-color-navLink-description); +} + /* Desktop styles */ @media (min-width: 900px) { .feds-navLink, @@ -246,12 +251,6 @@ header.global-navigation.ready { max-width: 25px; } - .feds-navLink-description { - display: flex; - font-size: 12px; - color: var(--feds-color-navLink-description); - } - .feds-navLink:hover .feds-navLink-description, .feds-navLink:focus .feds-navLink-description { color: var(--feds-color-navLink-description); diff --git a/libs/blocks/global-navigation/global-navigation.css b/libs/blocks/global-navigation/global-navigation.css index 65c9301edf..378847ce30 100644 --- a/libs/blocks/global-navigation/global-navigation.css +++ b/libs/blocks/global-navigation/global-navigation.css @@ -1286,7 +1286,7 @@ header.new-nav .feds-breadcrumbs li:first-child:not(:nth-last-child(-n+3)):after .feds-localnav .feds-localnav-items .feds-navLink-content .feds-navLink-title, .feds-localnav .feds-localnav-items li .feds-navLink { - white-space: break-spaces; + white-space: normal; } .feds-localnav .feds-localnav-items .feds-navItem--centered { From 9d18393790300c8e67708fe5d18a064c8378a3dd Mon Sep 17 00:00:00 2001 From: Prince Patel Date: Thu, 5 Jun 2025 14:39:10 +0530 Subject: [PATCH 04/14] subheader referred as a link (#4095) * remove href * check menu item * add log * add debugger * revert * fix accessibility * fix indent * undo spacings * remove indent * MWPW-171997 fix accessibility issue * undo unwanted changes * move fix specific to popupitems * remove href from subheader so nvda dont read it as clickable * remove tabindex -1 * undo last change * update anchor tag to div with heading level 3 role * keep a as selector * make heading 3 focusable * skip sub header from focus as it is no longer a link --- libs/blocks/global-navigation/global-navigation.css | 3 ++- .../global-navigation/utilities/keyboard/utils.js | 2 +- libs/blocks/global-navigation/utilities/menu/menu.js | 12 +++++++++++- libs/blocks/global-navigation/utilities/utilities.js | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libs/blocks/global-navigation/global-navigation.css b/libs/blocks/global-navigation/global-navigation.css index 378847ce30..5732aa578c 100644 --- a/libs/blocks/global-navigation/global-navigation.css +++ b/libs/blocks/global-navigation/global-navigation.css @@ -1081,7 +1081,8 @@ header.new-nav .feds-nav > section.feds-navItem > .feds-popup .tab-content .feds border-right: 1px solid var(--feds-borderColor-link-v2); } -header.new-nav .feds-nav > section.feds-navItem > .feds-popup .tab-content a.feds-navLink { +header.new-nav .feds-nav > section.feds-navItem > .feds-popup .tab-content a.feds-navLink, +header.new-nav .feds-nav > section.feds-navItem > .feds-popup .tab-content .feds-navLink--header { translate: 0 12px; opacity: 0; animation: slideup 0.6s ease, fadein 0.8s ease; diff --git a/libs/blocks/global-navigation/utilities/keyboard/utils.js b/libs/blocks/global-navigation/utilities/keyboard/utils.js index 374a475e7f..4955c114e8 100644 --- a/libs/blocks/global-navigation/utilities/keyboard/utils.js +++ b/libs/blocks/global-navigation/utilities/keyboard/utils.js @@ -60,7 +60,7 @@ selectors.profileDropdown = ` `; selectors.popupItems = ` - ${selectors.navLink}, + ${selectors.navLink}:not(.feds-navLink--header), ${selectors.promoLink}, ${selectors.imagePromo}, ${selectors.cta}, diff --git a/libs/blocks/global-navigation/utilities/menu/menu.js b/libs/blocks/global-navigation/utilities/menu/menu.js index b8d50d5ebb..633f5706ff 100644 --- a/libs/blocks/global-navigation/utilities/menu/menu.js +++ b/libs/blocks/global-navigation/utilities/menu/menu.js @@ -76,13 +76,23 @@ const decorateLinkGroup = (elem, index) => { ${descriptionElem} ` : ''; - const linkGroup = toFragment` ${imageElem} ${contentElem} `; + if (linkGroup.classList.contains('feds-navLink--header')) { + linkGroup = toFragment`
+ ${imageElem} + ${contentElem} +
`; + } if (link?.target) linkGroup.target = link.target; return linkGroup; diff --git a/libs/blocks/global-navigation/utilities/utilities.js b/libs/blocks/global-navigation/utilities/utilities.js index ef300dfd1f..45bd5bb489 100644 --- a/libs/blocks/global-navigation/utilities/utilities.js +++ b/libs/blocks/global-navigation/utilities/utilities.js @@ -532,7 +532,7 @@ const parseTabsFromMenuSection = (section) => { const daallTab = headline?.getAttribute('daa-ll'); const daalhTabContent = section.querySelector('.feds-menu-items')?.getAttribute('daa-lh'); const content = section.querySelector('.feds-menu-items') ?? section; - const links = [...content.querySelectorAll('a.feds-navLink, .feds-cta--secondary')].map((x) => x.outerHTML).join(''); + const links = [...content.querySelectorAll('a.feds-navLink, .feds-navLink.feds-navLink--header, .feds-cta--secondary')].map((x) => x.outerHTML).join(''); return { name, links, daallTab, daalhTabContent }; }; From e2f2303ff707e5b3a58ffc812961f58c9f443546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Kosanovi=C4=87?= Date: Thu, 5 Jun 2025 11:09:17 +0200 Subject: [PATCH 05/14] [MWPW-170341] - table bold text break fix (#4106) * [MWPW-170341] - table bold text break fix * [MWPW-170341] - expand clause for text wrap * [MWPW-170341] - without timeout solution * [MWPW-170341] - shorten code * [MWPW-170341] - optimize * [MWPW-170341] - expand tag query * [MWPW-170341] - update logic * [MWPW-170341] - remove code * [MWPW-170341] - revert to previous solution, remove refs to curtain tags * [MWPW-170341] - logic optimization * [MWPW-170341] - shorten code --- libs/blocks/table/table.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/blocks/table/table.js b/libs/blocks/table/table.js index 56dbb3764e..29f30ac98b 100644 --- a/libs/blocks/table/table.js +++ b/libs/blocks/table/table.js @@ -384,6 +384,14 @@ function handleSection(sectionParams) { sectionRowTitle.setAttribute('scope', 'row'); } } + + rowCols.forEach((col) => { + if (col.querySelector(':scope > :is(strong, em, del, code, sub, sup)') + && col.childNodes.length > 1 && !col.querySelector('picture')) { + col.replaceChildren(createTag('p', {}, [...col.childNodes])); + } + }); + return expandSection; } From fb371c667b2bb529c88434e02fdb7a5353fb77a3 Mon Sep 17 00:00:00 2001 From: Bozo Jovicic <37440641+bozojovicic@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:09:25 +0200 Subject: [PATCH 06/14] =?UTF-8?q?MWPW-173608=20[M@S]=20Mnemonics=20filed?= =?UTF-8?q?=20disappear=20from=20card=20preview=20when=20=E2=80=A6=20(#417?= =?UTF-8?q?0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * MWPW-173608 [M@S] Mnemonics filed disappear from card preview when editing card * MWPW-173608 [M@S] Mnemonics filed disappear from card preview when editing card * build mas * Trigger Build * Trigger Build * MWPW-173608 [M@S] Mnemonics filed disappear from card preview when editing card * Trigger Build * MWPW-173608 [M@S] Mnemonics filed disappear from card preview when editing card * MWPW-173608 [M@S] Mnemonics filed disappear from card preview when editing card * Build mas * Trigger Build * Trigger Build * Trigger Build --------- Co-authored-by: Bozo Jovicic --- libs/deps/mas/merch-card.js | 41 +++++++++++++------------ libs/features/mas/dist/mas.js | 4 +-- libs/features/mas/src/hydrate.js | 5 +++ libs/features/mas/src/variants/plans.js | 4 +-- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/libs/deps/mas/merch-card.js b/libs/deps/mas/merch-card.js index 02ad521f5b..ce404f04ed 100644 --- a/libs/deps/mas/merch-card.js +++ b/libs/deps/mas/merch-card.js @@ -1,4 +1,4 @@ -var He=Object.defineProperty;var Zt=o=>{throw TypeError(o)};var Ue=(o,e,t)=>e in o?He(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var d=(o,e,t)=>Ue(o,typeof e!="symbol"?e+"":e,t),Ot=(o,e,t)=>e.has(o)||Zt("Cannot "+t);var s=(o,e,t)=>(Ot(o,e,"read from private field"),t?t.call(o):e.get(o)),p=(o,e,t)=>e.has(o)?Zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),m=(o,e,t,r)=>(Ot(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t),A=(o,e,t)=>(Ot(o,e,"access private method"),t);import{LitElement as Hr}from"../lit-all.min.js";import{css as te,unsafeCSS as Jt}from"../lit-all.min.js";var P="(max-width: 767px)",Et="(max-width: 1199px)",u="(min-width: 768px)",g="(min-width: 1200px)",T="(min-width: 1600px)";var ee=te` +var He=Object.defineProperty;var Zt=o=>{throw TypeError(o)};var Ue=(o,e,t)=>e in o?He(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var l=(o,e,t)=>Ue(o,typeof e!="symbol"?e+"":e,t),Ot=(o,e,t)=>e.has(o)||Zt("Cannot "+t);var s=(o,e,t)=>(Ot(o,e,"read from private field"),t?t.call(o):e.get(o)),p=(o,e,t)=>e.has(o)?Zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),m=(o,e,t,r)=>(Ot(o,e,"write to private field"),r?r.call(o,t):e.set(o,t),t),A=(o,e,t)=>(Ot(o,e,"access private method"),t);import{LitElement as Hr}from"../lit-all.min.js";import{css as te,unsafeCSS as Jt}from"../lit-all.min.js";var P="(max-width: 767px)",Et="(max-width: 1199px)",u="(min-width: 768px)",g="(min-width: 1200px)",T="(min-width: 1600px)";var ee=te` :host { --consonant-merch-card-background-color: #fff; --consonant-merch-card-border: 1px solid var(--consonant-merch-card-border-color); @@ -253,7 +253,7 @@ var He=Object.defineProperty;var Zt=o=>{throw TypeError(o)};var Ue=(o,e,t)=>e in } `];import{LitElement as Fe,html as oe,css as qe}from"../lit-all.min.js";var q=class extends Fe{constructor(){super(),this.size="m",this.alt="",this.loading="lazy"}render(){let{href:e}=this;return e?oe` ${this.alt} - `:oe` ${this.alt}`}};d(q,"properties",{size:{type:String,attribute:!0},src:{type:String,attribute:!0},alt:{type:String,attribute:!0},href:{type:String,attribute:!0},loading:{type:String,attribute:!0}}),d(q,"styles",qe` + `:oe` ${this.alt}`}};l(q,"properties",{size:{type:String,attribute:!0},src:{type:String,attribute:!0},alt:{type:String,attribute:!0},href:{type:String,attribute:!0},loading:{type:String,attribute:!0}}),l(q,"styles",qe` :host { --img-width: 32px; --img-height: 32px; @@ -295,7 +295,7 @@ var He=Object.defineProperty;var Zt=o=>{throw TypeError(o)};var Ue=(o,e,t)=>e in /> `}};d(W,"properties",{planType:{type:String,attribute:"plan-type",reflect:!0},checked:{type:Boolean,reflect:!0}}),d(W,"styles",Ye` + `}};l(W,"properties",{planType:{type:String,attribute:"plan-type",reflect:!0},checked:{type:Boolean,reflect:!0}}),l(W,"styles",Ye` :host { display: flex; gap: 9px; @@ -323,7 +323,7 @@ var He=Object.defineProperty;var Zt=o=>{throw TypeError(o)};var Ue=(o,e,t)=>e in :host([plan-type='M2M']) ::slotted(p[data-plan-type='M2M']) { display: block; } - `);customElements.define("merch-addon",W);import{html as Tt}from"../lit-all.min.js";var X,ht=class ht{constructor(e){d(this,"card");p(this,X);this.card=e,this.insertVariantStyle()}getContainer(){return m(this,X,s(this,X)??this.card.closest('[class*="-merch-cards"]')??this.card.parentElement),s(this,X)}insertVariantStyle(){if(!ht.styleMap[this.card.variant]){ht.styleMap[this.card.variant]=!0;let e=document.createElement("style");e.innerHTML=this.getGlobalCSS(),document.head.appendChild(e)}}updateCardElementMinHeight(e,t){if(!e)return;let r=`--consonant-merch-card-${this.card.variant}-${t}-height`,a=Math.max(0,parseInt(window.getComputedStyle(e).height)||0),n=parseInt(this.getContainer().style.getPropertyValue(r))||0;a>n&&this.getContainer().style.setProperty(r,`${a}px`)}get badge(){let e;if(!(!this.card.badgeBackgroundColor||!this.card.badgeColor||!this.card.badgeText))return this.evergreen&&(e=`border: 1px solid ${this.card.badgeBackgroundColor}; border-right: none;`),Tt` + `);customElements.define("merch-addon",W);import{html as Tt}from"../lit-all.min.js";var X,ht=class ht{constructor(e){l(this,"card");p(this,X);this.card=e,this.insertVariantStyle()}getContainer(){return m(this,X,s(this,X)??this.card.closest('[class*="-merch-cards"]')??this.card.parentElement),s(this,X)}insertVariantStyle(){if(!ht.styleMap[this.card.variant]){ht.styleMap[this.card.variant]=!0;let e=document.createElement("style");e.innerHTML=this.getGlobalCSS(),document.head.appendChild(e)}}updateCardElementMinHeight(e,t){if(!e)return;let r=`--consonant-merch-card-${this.card.variant}-${t}-height`,a=Math.max(0,parseInt(window.getComputedStyle(e).height)||0),n=parseInt(this.getContainer().style.getPropertyValue(r))||0;a>n&&this.getContainer().style.setProperty(r,`${a}px`)}get badge(){let e;if(!(!this.card.badgeBackgroundColor||!this.card.badgeColor||!this.card.badgeText))return this.evergreen&&(e=`border: 1px solid ${this.card.badgeBackgroundColor}; border-right: none;`),Tt`
{throw TypeError(o)};var Ue=(o,e,t)=>e in ${this.badge}
`}getGlobalCSS(){return""}get theme(){return document.querySelector("sp-theme")}get evergreen(){return this.card.classList.contains("intro-pricing")}get promoBottom(){return this.card.classList.contains("promo-bottom")}get headingSelector(){return'[slot="heading-xs"]'}get secureLabelFooter(){let e=this.card.secureLabel?Tt`${this.card.secureLabel}`:"";return Tt`
${e}
`}async adjustTitleWidth(){let e=this.card.getBoundingClientRect().width,t=this.card.badgeElement?.getBoundingClientRect().width||0;e===0||t===0||this.card.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(e-t-16)}px`)}postCardUpdateHook(){}connectedCallbackHook(){}disconnectedCallbackHook(){}renderLayout(){}get aemFragmentMapping(){return kt(this.card.variant)}};X=new WeakMap,d(ht,"styleMap",{});var f=ht;import{html as Dt,css as Ke}from"../lit-all.min.js";var xe=` + >`:"";return Tt`
${e}
`}async adjustTitleWidth(){let e=this.card.getBoundingClientRect().width,t=this.card.badgeElement?.getBoundingClientRect().width||0;e===0||t===0||this.card.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(e-t-16)}px`)}postCardUpdateHook(){}connectedCallbackHook(){}disconnectedCallbackHook(){}renderLayout(){}get aemFragmentMapping(){return kt(this.card.variant)}};X=new WeakMap,l(ht,"styleMap",{});var f=ht;import{html as Dt,css as Ke}from"../lit-all.min.js";var xe=` :root { --consonant-merch-card-catalog-width: 276px; --consonant-merch-card-catalog-icon-size: 40px; @@ -424,7 +424,7 @@ merch-card[variant="catalog"] .payment-details { font-style: italic; font-weight: 400; line-height: var(--consonant-merch-card-body-line-height); -}`;var be={badge:!0,ctas:{slot:"footer",size:"m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},prices:{tag:"h3",slot:"heading-xs"},size:["wide","super-wide"],title:{tag:"h3",slot:"heading-xs"}},Q=class extends f{constructor(t){super(t);d(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(se,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});d(this,"toggleActionMenu",t=>{if(!this.actionMenuContentSlot||!t||t.type!=="click"&&t.code!=="Space"&&t.code!=="Enter")return;t.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let r=this.actionMenuContentSlot.classList.contains("hidden");r||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!r).toString())});d(this,"toggleActionMenuFromCard",t=>{let r=t?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(r||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",r),this.setAriaExpanded(this.actionMenu,"false"))});d(this,"hideActionMenu",t=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")})}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return Dt`
+}`;var be={badge:!0,ctas:{slot:"footer",size:"m"},description:{tag:"div",slot:"body-xs"},mnemonics:{size:"l"},prices:{tag:"h3",slot:"heading-xs"},size:["wide","super-wide"],title:{tag:"h3",slot:"heading-xs"}},Q=class extends f{constructor(t){super(t);l(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(se,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});l(this,"toggleActionMenu",t=>{if(!this.actionMenuContentSlot||!t||t.type!=="click"&&t.code!=="Space"&&t.code!=="Enter")return;t.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let r=this.actionMenuContentSlot.classList.contains("hidden");r||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!r).toString())});l(this,"toggleActionMenuFromCard",t=>{let r=t?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(r||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",r),this.setAriaExpanded(this.actionMenu,"false"))});l(this,"hideActionMenu",t=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")})}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return Dt`
${this.badge}
`:""}
${this.secureLabelFooter} - `}getGlobalCSS(){return xe}setAriaExpanded(t,r){t.setAttribute("aria-expanded",r)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard)}};d(Q,"variantStyle",Ke` + `}getGlobalCSS(){return xe}setAriaExpanded(t,r){t.setAttribute("aria-expanded",r)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard)}};l(Q,"variantStyle",Ke` :host([variant='catalog']) { min-height: 330px; width: var(--consonant-merch-card-catalog-width); @@ -939,7 +939,7 @@ merch-card .footer-row-cell:nth-child(7) { merch-card .footer-row-cell:nth-child(8) { min-height: var(--consonant-merch-card-footer-row-8-min-height); } -`;var Xe=32,J=class extends f{constructor(t){super(t);d(this,"getRowMinHeightPropertyName",t=>`--consonant-merch-card-footer-row-${t}-min-height`);d(this,"getMiniCompareFooter",()=>{let t=this.card.secureLabel?Z` +`;var Xe=32,J=class extends f{constructor(t){super(t);l(this,"getRowMinHeightPropertyName",t=>`--consonant-merch-card-footer-row-${t}-min-height`);l(this,"getMiniCompareFooter",()=>{let t=this.card.secureLabel?Z` ${this.card.secureLabel} ${this.getMiniCompareFooter()} - `}async postCardUpdateHook(){await Promise.all(this.card.prices.map(t=>t.onceSettled())),await this.adjustAddon(),j()?this.removeEmptyRows():(this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}};d(J,"variantStyle",We` + `}async postCardUpdateHook(){await Promise.all(this.card.prices.map(t=>t.onceSettled())),await this.adjustAddon(),j()?this.removeEmptyRows():(this.adjustMiniCompareBodySlots(),this.adjustMiniCompareFooterRows())}};l(J,"variantStyle",We` :host([variant='mini-compare-chart']) > slot:not([name='icons']) { display: block; } @@ -1291,7 +1291,7 @@ merch-card[variant^="plans"]:not([size]) { ${this.card.checkboxLabel} - `:""}get icons(){return this.card.querySelector('[slot="icons"]')?Lt``:""}connectedCallbackHook(){let e=St();e?.addEventListener&&e.addEventListener("change",this.adaptForMobile)}disconnectedCallbackHook(){let e=St();e?.removeEventListener&&e.removeEventListener("change",this.adaptForMobile)}renderLayout(){return Lt` ${this.badge} + `:""}connectedCallbackHook(){let e=St();e?.addEventListener&&e.addEventListener("change",this.adaptForMobile)}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?"":Lt``}disconnectedCallbackHook(){let e=St();e?.removeEventListener&&e.removeEventListener("change",this.adaptForMobile)}renderLayout(){return Lt` ${this.badge}
${this.icons} @@ -1311,7 +1311,7 @@ merch-card[variant^="plans"]:not([size]) {
- ${this.secureLabelFooter}`}};d(k,"variantStyle",Qe` + ${this.secureLabelFooter}`}};l(k,"variantStyle",Qe` :host([variant^='plans']) { min-height: 273px; border: 1px solid var(--merch-card-custom-border-color, #dadada); @@ -1471,7 +1471,7 @@ merch-card[variant^="plans"]:not([size]) {
- ${this.secureLabelFooter}`}connectedCallbackHook(){window.addEventListener("resize",this.postCardUpdateHook)}disconnectedCallbackHook(){window.removeEventListener("resize",this.postCardUpdateHook)}postCardUpdateHook(){this.card.isConnected&&(this.adjustAddon(),j()||this.adjustProductBodySlots(),this.adjustTitleWidth())}get headingXSSlot(){return this.card.shadowRoot.querySelector('slot[name="heading-xs"]').assignedElements()[0]}get mainPrice(){return this.card.querySelector(`[slot="heading-xs"] ${x}[data-template="price"]`)}toggleAddon(e){let t=this.mainPrice,r=this.headingXSSlot;if(!t&&r){let a=e?.getAttribute("plan-type"),n=null;if(e&&a&&(n=e.querySelector(`p[data-plan-type="${a}"]`)?.querySelector('span[is="inline-price"]')),this.card.querySelectorAll('p[slot="heading-xs"]').forEach(c=>c.remove()),e.checked){if(n){let c=b("p",{class:"addon-heading-xs-price-addon",slot:"heading-xs"},n.innerHTML);this.card.appendChild(c)}}else{let c=b("p",{class:"card-heading",id:"free",slot:"heading-xs"},"Free");this.card.appendChild(c)}}}async adjustAddon(){await this.card.updateComplete;let e=this.card.addon;if(!e)return;let t=this.mainPrice,r=this.card.planType;t&&(await t.onceSettled(),r=t.value?.[0]?.planType),r&&(e.planType=r)}};d(I,"variantStyle",Ze` + ${this.secureLabelFooter}`}connectedCallbackHook(){window.addEventListener("resize",this.postCardUpdateHook)}disconnectedCallbackHook(){window.removeEventListener("resize",this.postCardUpdateHook)}postCardUpdateHook(){this.card.isConnected&&(this.adjustAddon(),j()||this.adjustProductBodySlots(),this.adjustTitleWidth())}get headingXSSlot(){return this.card.shadowRoot.querySelector('slot[name="heading-xs"]').assignedElements()[0]}get mainPrice(){return this.card.querySelector(`[slot="heading-xs"] ${x}[data-template="price"]`)}toggleAddon(e){let t=this.mainPrice,r=this.headingXSSlot;if(!t&&r){let a=e?.getAttribute("plan-type"),n=null;if(e&&a&&(n=e.querySelector(`p[data-plan-type="${a}"]`)?.querySelector('span[is="inline-price"]')),this.card.querySelectorAll('p[slot="heading-xs"]').forEach(c=>c.remove()),e.checked){if(n){let c=b("p",{class:"addon-heading-xs-price-addon",slot:"heading-xs"},n.innerHTML);this.card.appendChild(c)}}else{let c=b("p",{class:"card-heading",id:"free",slot:"heading-xs"},"Free");this.card.appendChild(c)}}}async adjustAddon(){await this.card.updateComplete;let e=this.card.addon;if(!e)return;let t=this.mainPrice,r=this.card.planType;t&&(await t.onceSettled(),r=t.value?.[0]?.planType),r&&(e.planType=r)}};l(I,"variantStyle",Ze` :host([variant='product']) > slot:not([name='icons']) { display: block; } @@ -1561,7 +1561,7 @@ merch-card[variant^="plans"]:not([size]) { ${this.promoBottom?Ht``:""}

- ${this.secureLabelFooter}`}};d(tt,"variantStyle",Je` + ${this.secureLabelFooter}`}};l(tt,"variantStyle",Je` :host([variant='segment']) { min-height: 214px; } @@ -1633,7 +1633,7 @@ merch-card[variant="special-offers"] span[is="inline-price"][data-template="stri
${this.secureLabelFooter} `} - `}};d(et,"variantStyle",tr` + `}};l(et,"variantStyle",tr` :host([variant='special-offers']) { min-height: 439px; } @@ -2174,9 +2174,9 @@ sr-only { border: 0; } `;document.head.appendChild(Me);var pt=class o extends Error{constructor(e,t,r){if(super(e,{cause:r}),this.name="MasError",t.response){let a=t.response.headers?.get(me);a&&(t.requestId=a),t.response.status&&(t.status=t.response.status,t.statusText=t.response.statusText),t.response.url&&(t.url=t.response.url)}delete t.response,this.context=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}toString(){let e=Object.entries(this.context||{}).map(([r,a])=>`${r}: ${JSON.stringify(a)}`).join(", "),t=`${this.name}: ${this.message}`;return e&&(t+=` (${e})`),this.cause&&(t+=` -Caused by: ${this.cause}`),t}};async function Pe(o,e={},t=2,r=100){let a;for(let n=0;n<=t;n++)try{return await fetch(o,e)}catch(c){if(a=c,n>t)break;await new Promise(i=>setTimeout(i,r*(n+1)))}throw a}var Ne=new CSSStyleSheet;Ne.replaceSync(":host { display: contents; }");var ze="fragment",Oe="author",Mt="aem-fragment",_,Gt=class{constructor(){p(this,_,new Map)}clear(){s(this,_).clear()}addByRequestedId(e,t){s(this,_).set(e,t)}add(...e){e.forEach(t=>{let{id:r}=t;r&&s(this,_).set(r,t)})}has(e){return s(this,_).has(e)}get(e){return s(this,_).get(e)}remove(e){s(this,_).delete(e)}};_=new WeakMap;var gt=new Gt,ut,C,L,rt,ot,z,E,R,ft,xt,jt,Vt=class extends HTMLElement{constructor(){super();p(this,xt);d(this,"cache",gt);p(this,ut);p(this,C,null);p(this,L,null);p(this,rt,!1);p(this,ot,null);p(this,z,null);p(this,E);p(this,R);p(this,ft,!1);this.attachShadow({mode:"open"}),this.shadowRoot.adoptedStyleSheets=[Ne]}static get observedAttributes(){return[ze,Oe]}attributeChangedCallback(t,r,a){t===ze&&m(this,E,a),t===Oe&&m(this,ft,["","true"].includes(a))}connectedCallback(){if(!s(this,R)){if(m(this,z,Y(this)),m(this,ut,s(this,z).log.module(Mt)),m(this,ot,`${Mt}:${s(this,E)}${it}`),performance.mark(s(this,ot)),!s(this,E)){A(this,xt,jt).call(this,{message:"Missing fragment id"});return}this.refresh(!1)}}async getFragmentById(t,r,a){let n=`${Mt}:${r}${pe}`,c;try{if(c=await Pe(t,{cache:"default",credentials:"omit"}),!c?.ok){let{startTime:i,duration:l}=performance.measure(n,a);throw new pt("Unexpected fragment response",{response:c,startTime:i,duration:l,...s(this,z).duration})}return c.json()}catch{let{startTime:l,duration:h}=performance.measure(n,a);throw c||(c={url:t}),new pt("Failed to fetch fragment",{response:c,startTime:l,duration:h,...s(this,z).duration})}}async refresh(t=!0){if(!(s(this,R)&&!await Promise.race([s(this,R),Promise.resolve(!1)])))return t&>.remove(s(this,E)),m(this,R,this.fetchData().then(()=>{let{references:r,referencesTree:a,placeholders:n}=s(this,C)||{};return this.dispatchEvent(new CustomEvent(G,{detail:{...this.data,stale:s(this,rt),references:r,referencesTree:a,placeholders:n},bubbles:!0,composed:!0})),!0}).catch(r=>s(this,C)?(gt.addByRequestedId(s(this,E),s(this,C)),!0):(A(this,xt,jt).call(this,r),!1))),s(this,R)}async fetchData(){this.classList.remove("error"),m(this,L,null);let t=gt.get(s(this,E));if(t){m(this,C,t);return}m(this,rt,!0);let{masIOUrl:r,wcsApiKey:a,locale:n}=s(this,z).settings,c=`${r}/fragment?id=${s(this,E)}&api_key=${a}&locale=${n}`;t=await this.getFragmentById(c,s(this,E),s(this,ot)),gt.addByRequestedId(s(this,E),t),m(this,C,t),m(this,rt,!1)}get updateComplete(){return s(this,R)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,L)?s(this,L):(s(this,ft)?this.transformAuthorData():this.transformPublishData(),s(this,L))}transformAuthorData(){let{fields:t,id:r,tags:a,settings:n={}}=s(this,C);m(this,L,t.reduce((c,{name:i,multiple:l,values:h})=>(c.fields[i]=l?h:h[0],c),{fields:{},id:r,tags:a,settings:n}))}transformPublishData(){let{fields:t,id:r,tags:a,settings:n={}}=s(this,C);m(this,L,Object.entries(t).reduce((c,[i,l])=>(c.fields[i]=l?.mimeType?l.value:l??"",c),{fields:{},id:r,tags:a,settings:n}))}};ut=new WeakMap,C=new WeakMap,L=new WeakMap,rt=new WeakMap,ot=new WeakMap,z=new WeakMap,E=new WeakMap,R=new WeakMap,ft=new WeakMap,xt=new WeakSet,jt=function({message:t,context:r}){this.classList.add("error"),s(this,ut).error(`aem-fragment: ${t}`,r),this.dispatchEvent(new CustomEvent(V,{detail:{message:t,...r},bubbles:!0,composed:!0}))};customElements.define(Mt,Vt);import{LitElement as er,html as rr,css as or}from"../lit-all.min.js";var at=class extends er{constructor(){super(),this.color="",this.variant="",this.backgroundColor="",this.borderColor="",this.text=this.textContent}connectedCallback(){this.borderColor&&this.borderColor!=="Transparent"?this.style.setProperty("--merch-badge-border",`1px solid var(--${this.borderColor})`):this.style.setProperty("--merch-badge-border",`1px solid var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-background-color",`var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-color",this.color),this.style.setProperty("--merch-badge-padding","2px 10px 3px 10px"),this.style.setProperty("--merch-badge-border-radius","4px 0 0 4px"),this.style.setProperty("--merch-badge-font-size","var(--consonant-merch-card-body-xs-font-size)"),this.textContent="",super.connectedCallback()}render(){return rr`
+Caused by: ${this.cause}`),t}};async function Pe(o,e={},t=2,r=100){let a;for(let n=0;n<=t;n++)try{return await fetch(o,e)}catch(c){if(a=c,n>t)break;await new Promise(i=>setTimeout(i,r*(n+1)))}throw a}var Ne=new CSSStyleSheet;Ne.replaceSync(":host { display: contents; }");var ze="fragment",Oe="author",Mt="aem-fragment",_,Gt=class{constructor(){p(this,_,new Map)}clear(){s(this,_).clear()}addByRequestedId(e,t){s(this,_).set(e,t)}add(...e){e.forEach(t=>{let{id:r}=t;r&&s(this,_).set(r,t)})}has(e){return s(this,_).has(e)}get(e){return s(this,_).get(e)}remove(e){s(this,_).delete(e)}};_=new WeakMap;var gt=new Gt,ut,C,L,rt,ot,z,E,R,ft,xt,jt,Vt=class extends HTMLElement{constructor(){super();p(this,xt);l(this,"cache",gt);p(this,ut);p(this,C,null);p(this,L,null);p(this,rt,!1);p(this,ot,null);p(this,z,null);p(this,E);p(this,R);p(this,ft,!1);this.attachShadow({mode:"open"}),this.shadowRoot.adoptedStyleSheets=[Ne]}static get observedAttributes(){return[ze,Oe]}attributeChangedCallback(t,r,a){t===ze&&m(this,E,a),t===Oe&&m(this,ft,["","true"].includes(a))}connectedCallback(){if(!s(this,R)){if(m(this,z,Y(this)),m(this,ut,s(this,z).log.module(Mt)),m(this,ot,`${Mt}:${s(this,E)}${it}`),performance.mark(s(this,ot)),!s(this,E)){A(this,xt,jt).call(this,{message:"Missing fragment id"});return}this.refresh(!1)}}async getFragmentById(t,r,a){let n=`${Mt}:${r}${pe}`,c;try{if(c=await Pe(t,{cache:"default",credentials:"omit"}),!c?.ok){let{startTime:i,duration:d}=performance.measure(n,a);throw new pt("Unexpected fragment response",{response:c,startTime:i,duration:d,...s(this,z).duration})}return c.json()}catch{let{startTime:d,duration:h}=performance.measure(n,a);throw c||(c={url:t}),new pt("Failed to fetch fragment",{response:c,startTime:d,duration:h,...s(this,z).duration})}}async refresh(t=!0){if(!(s(this,R)&&!await Promise.race([s(this,R),Promise.resolve(!1)])))return t&>.remove(s(this,E)),m(this,R,this.fetchData().then(()=>{let{references:r,referencesTree:a,placeholders:n}=s(this,C)||{};return this.dispatchEvent(new CustomEvent(G,{detail:{...this.data,stale:s(this,rt),references:r,referencesTree:a,placeholders:n},bubbles:!0,composed:!0})),!0}).catch(r=>s(this,C)?(gt.addByRequestedId(s(this,E),s(this,C)),!0):(A(this,xt,jt).call(this,r),!1))),s(this,R)}async fetchData(){this.classList.remove("error"),m(this,L,null);let t=gt.get(s(this,E));if(t){m(this,C,t);return}m(this,rt,!0);let{masIOUrl:r,wcsApiKey:a,locale:n}=s(this,z).settings,c=`${r}/fragment?id=${s(this,E)}&api_key=${a}&locale=${n}`;t=await this.getFragmentById(c,s(this,E),s(this,ot)),gt.addByRequestedId(s(this,E),t),m(this,C,t),m(this,rt,!1)}get updateComplete(){return s(this,R)??Promise.reject(new Error("AEM fragment cannot be loaded"))}get data(){return s(this,L)?s(this,L):(s(this,ft)?this.transformAuthorData():this.transformPublishData(),s(this,L))}transformAuthorData(){let{fields:t,id:r,tags:a,settings:n={}}=s(this,C);m(this,L,t.reduce((c,{name:i,multiple:d,values:h})=>(c.fields[i]=d?h:h[0],c),{fields:{},id:r,tags:a,settings:n}))}transformPublishData(){let{fields:t,id:r,tags:a,settings:n={}}=s(this,C);m(this,L,Object.entries(t).reduce((c,[i,d])=>(c.fields[i]=d?.mimeType?d.value:d??"",c),{fields:{},id:r,tags:a,settings:n}))}};ut=new WeakMap,C=new WeakMap,L=new WeakMap,rt=new WeakMap,ot=new WeakMap,z=new WeakMap,E=new WeakMap,R=new WeakMap,ft=new WeakMap,xt=new WeakSet,jt=function({message:t,context:r}){this.classList.add("error"),s(this,ut).error(`aem-fragment: ${t}`,r),this.dispatchEvent(new CustomEvent(V,{detail:{message:t,...r},bubbles:!0,composed:!0}))};customElements.define(Mt,Vt);import{LitElement as er,html as rr,css as or}from"../lit-all.min.js";var at=class extends er{constructor(){super(),this.color="",this.variant="",this.backgroundColor="",this.borderColor="",this.text=this.textContent}connectedCallback(){this.borderColor&&this.borderColor!=="Transparent"?this.style.setProperty("--merch-badge-border",`1px solid var(--${this.borderColor})`):this.style.setProperty("--merch-badge-border",`1px solid var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-background-color",`var(--${this.backgroundColor})`),this.style.setProperty("--merch-badge-color",this.color),this.style.setProperty("--merch-badge-padding","2px 10px 3px 10px"),this.style.setProperty("--merch-badge-border-radius","4px 0 0 4px"),this.style.setProperty("--merch-badge-font-size","var(--consonant-merch-card-body-xs-font-size)"),this.textContent="",super.connectedCallback()}render(){return rr`
${this.text} -
`}};d(at,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"}}),d(at,"styles",or` +
`}};l(at,"properties",{color:{type:String},variant:{type:String},backgroundColor:{type:String,attribute:"background-color"},borderColor:{type:String,attribute:"border-color"}}),l(at,"styles",or` :host { display: block; background-color: var(--merch-badge-background-color); @@ -2192,7 +2192,7 @@ Caused by: ${this.cause}`),t}};async function Pe(o,e={},t=2,r=100){let a;for(let `);customElements.define("merch-badge",at);import{html as ar,css as nr,LitElement as cr}from"../lit-all.min.js";var bt=class extends cr{constructor(){super()}render(){return ar` ${this.description} - `}};d(bt,"styles",nr` + `}};l(bt,"styles",nr` :host { display: flex; flex-wrap: nowrap; @@ -2217,11 +2217,11 @@ Caused by: ${this.cause}`),t}};async function Pe(o,e={},t=2,r=100){let a;for(let :host .hidden { display: none; } - `),d(bt,"properties",{description:{type:String,attribute:!0}});customElements.define("merch-mnemonic-list",bt);import{html as Yt,css as ir,LitElement as sr}from"../lit-all.min.js";var vt=class extends sr{updated(){this.hideSeeMoreEls()}hideSeeMoreEls(){this.isMobile&&this.rows.forEach((e,t)=>{t>=5&&(e.style.display=this.showAll?"flex":"none")})}constructor(){super(),this.showAll=!1,this.mobileRows=this.mobileRows===void 0?5:this.mobileRows}toggle(){this.showAll=!this.showAll,this.dispatchEvent(new CustomEvent("hide-see-more-elements",{bubbles:!0,composed:!0})),this.requestUpdate()}render(){return Yt` + `),l(bt,"properties",{description:{type:String,attribute:!0}});customElements.define("merch-mnemonic-list",bt);import{html as Yt,css as ir,LitElement as sr}from"../lit-all.min.js";var vt=class extends sr{updated(){this.hideSeeMoreEls()}hideSeeMoreEls(){this.isMobile&&this.rows.forEach((e,t)=>{t>=5&&(e.style.display=this.showAll?"flex":"none")})}constructor(){super(),this.showAll=!1,this.mobileRows=this.mobileRows===void 0?5:this.mobileRows}toggle(){this.showAll=!this.showAll,this.dispatchEvent(new CustomEvent("hide-see-more-elements",{bubbles:!0,composed:!0})),this.requestUpdate()}render(){return Yt` ${this.isMobile&&this.rows.length>this.mobileRows?Yt`
${this.showAll?"- See less":"+ See more"} -
`:Yt``}`}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}get rows(){return this.querySelectorAll("merch-mnemonic-list")}};d(vt,"styles",ir` +
`:Yt``}`}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}get rows(){return this.querySelectorAll("merch-mnemonic-list")}};l(vt,"styles",ir` :host { display: flex; flex-wrap: wrap; @@ -2250,4 +2250,5 @@ Caused by: ${this.cause}`),t}};async function Pe(o,e={},t=2,r=100){let a;for(let text-decoration: underline; color: var(--link-color-dark); } - `),d(vt,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",vt);function dr(o){return`https://${o==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var yt,D=class D extends HTMLAnchorElement{constructor(){super();p(this,yt,!1);this.setAttribute("is",D.is)}get isUptLink(){return!0}initializeWcsData(t,r){this.setAttribute("data-wcs-osi",t),r&&this.setAttribute("data-promotion-code",r),m(this,yt,!0),this.composePromoTermsUrl()}attributeChangedCallback(t,r,a){s(this,yt)&&this.composePromoTermsUrl()}composePromoTermsUrl(){let t=this.getAttribute("data-wcs-osi");if(!t){let v=this.closest("merch-card").querySelector("aem-fragment").getAttribute("fragment");console.error(`Missing 'data-wcs-osi' attribute on upt-link. Fragment: ${v}`);return}let r=Y(),a=[t],n=this.getAttribute("data-promotion-code"),{country:c,language:i,env:l}=r.settings,h={country:c,language:i,wcsOsi:a,promotionCode:n},S=r.resolveOfferSelectors(h);Promise.all(S).then(([[v]])=>{let N=`locale=${i}_${c}&country=${c}&offer_id=${v.offerId}`;n&&(N+=`&promotion_code=${encodeURIComponent(n)}`),this.href=`${dr(l)}?${N}`}).catch(v=>{console.error(`Could not resolve offer selectors for id: ${t}.`,v.message)})}static createFrom(t){let r=new D;for(let a of t.attributes)a.name!=="is"&&(a.name==="class"&&a.value.includes("upt-link")?r.setAttribute("class",a.value.replace("upt-link","").trim()):r.setAttribute(a.name,a.value));return r.innerHTML=t.innerHTML,r.setAttribute("tabindex",0),r}};yt=new WeakMap,d(D,"is","upt-link"),d(D,"tag","a"),d(D,"observedAttributes",["data-wcs-osi","data-promotion-code"]);var O=D;window.customElements.get(O.is)||window.customElements.define(O.is,O,{extends:O.tag});var lr="#000000",Kt="#F8D904",hr="#EAEAEA",mr="#31A547",pr=/(accent|primary|secondary)(-(outline|link))?/,gr="mas:product_code/",ur="daa-ll",Pt="daa-lh",fr=["XL","L","M","S"],Wt="...";function w(o,e,t,r){let a=r[o];if(e[o]&&a){let n={slot:a?.slot},c=e[o];if(a.maxCount&&typeof c=="string"){let[l,h]=Mr(c,a.maxCount,a.withSuffix);l!==c&&(n.title=h,c=l)}let i=b(a.tag,n,c);t.append(i)}}function xr(o,e,t){o.mnemonicIcon?.map((a,n)=>({icon:a,alt:o.mnemonicAlt[n]??"",link:o.mnemonicLink[n]??""}))?.forEach(({icon:a,alt:n,link:c})=>{if(c&&!/^https?:/.test(c))try{c=new URL(`https://${c}`).href.toString()}catch{c="#"}let i={slot:"icons",src:a,loading:e.loading,size:t?.size??"l"};n&&(i.alt=n),c&&(i.href=c);let l=b("merch-icon",i);e.append(l)})}function br(o,e,t){if(t.badge?.slot){if(o.badge?.length&&!o.badge?.startsWith("${o.badge}`}w("badge",o,e,t)}else o.badge?(e.setAttribute("badge-text",o.badge),e.setAttribute("badge-color",o.badgeColor||lr),e.setAttribute("badge-background-color",o.badgeBackgroundColor||Kt),e.setAttribute("border-color",o.badgeBackgroundColor||Kt)):e.setAttribute("border-color",o.borderColor||hr)}function vr(o,e,t){if(t.trialBadge&&o.trialBadge){if(!o.trialBadge.startsWith("${o.trialBadge}`}w("trialBadge",o,e,t)}}function yr(o,e,t){t?.includes(o.size)&&e.setAttribute("size",o.size)}function Er(o,e,t){w("cardTitle",o,e,{cardTitle:t})}function wr(o,e,t){w("subtitle",o,e,t)}function Sr(o,e,t,r){if(!o.backgroundColor||o.backgroundColor.toLowerCase()==="default"){e.style.removeProperty("--merch-card-custom-background-color"),e.removeAttribute("background-color");return}t?.[o.backgroundColor]?(e.style.setProperty("--merch-card-custom-background-color",`var(${t[o.backgroundColor]})`),e.setAttribute("background-color",o.backgroundColor)):r?.attribute&&o.backgroundColor&&(e.setAttribute(r.attribute,o.backgroundColor),e.style.removeProperty("--merch-card-custom-background-color"))}function Ar(o,e,t){let r=t?.borderColor,a="--merch-card-custom-border-color";o.borderColor?.toLowerCase()==="transparent"?(e.style.removeProperty(a),t?.allowedBorderColors?.includes(t?.badge?.default)&&e.style.setProperty(a,"transparent")):o.borderColor&&r&&(/-gradient/.test(o.borderColor)?(e.setAttribute("gradient-border","true"),e.style.removeProperty(a)):e.style.setProperty(a,`var(--${o.borderColor})`))}function Tr(o,e,t){if(o.backgroundImage){let r={loading:e.loading??"lazy",src:o.backgroundImage};if(o.backgroundImageAltText?r.alt=o.backgroundImageAltText:r.role="none",!t)return;if(t?.attribute){e.setAttribute(t.attribute,o.backgroundImage);return}e.append(b(t.tag,{slot:t.slot},b("img",r)))}}function kr(o,e,t){w("prices",o,e,t)}function Cr(o,e,t){w("promoText",o,e,t),w("description",o,e,t),w("callout",o,e,t),w("quantitySelect",o,e,t),w("whatsIncluded",o,e,t)}function _r(o,e,t){if(!t.addon)return;let r=o.addon?.replace(/[{}]/g,"");if(!r||/disabled/.test(r))return;let a=b("merch-addon",{slot:"addon"},r);[...a.querySelectorAll(x)].forEach(n=>{let c=n.parentElement;c?.nodeName==="P"&&c.setAttribute("data-plan-type","")}),e.append(a)}function Lr(o,e,t){o.addonConfirmation&&w("addonConfirmation",o,e,t)}function Rr(o,e,t,r){o.showStockCheckbox&&t.stockOffer&&(e.setAttribute("checkbox-label",r?.stockCheckboxLabel?r.stockCheckboxLabel:""),e.setAttribute("stock-offer-osis",r?.stockOfferOsis?r.stockOfferOsis:"")),r?.secureLabel&&t?.secureLabel&&e.setAttribute("secure-label",r.secureLabel)}function Mr(o,e,t=!0){try{let r=typeof o!="string"?"":o,a=$e(r);if(a.length<=e)return[r,a];let n=0,c=!1,i=t?e-Wt.length<1?1:e-Wt.length:e,l=[];for(let v of r){if(n++,v==="<")if(c=!0,r[n]==="/")l.pop();else{let N="";for(let F of r.substring(n)){if(F===" "||F===">")break;N+=F}l.push(N)}if(v==="/"&&r[n]===">"&&l.pop(),v===">"){c=!1;continue}if(!c&&(i--,i===0))break}let h=r.substring(0,n).trim();if(l.length>0){l[0]==="p"&&l.shift();for(let v of l.reverse())h+=``}return[`${h}${t?Wt:""}`,a]}catch{let a=typeof o=="string"?o:"",n=$e(a);return[a,n]}}function $e(o){if(!o)return"";let e="",t=!1;for(let r of o){if(r==="<"&&(t=!0),r===">"){t=!1;continue}t||(e+=r)}return e}function Pr(o,e){e.querySelectorAll("a.upt-link").forEach(r=>{let a=O.createFrom(r);r.replaceWith(a),a.initializeWcsData(o.osi,o.promoCode)})}function zr(o,e,t,r,a){let n=o;a?n=customElements.get("checkout-button").createCheckoutButton({},o.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let S of o.attributes)["class","is"].includes(S.name)||n.setAttribute(S.name,S.value);n.firstElementChild?.classList.add("spectrum-Button-label");let c=e.ctas.size??"M",i=`spectrum-Button--${r}`,l=fr.includes(c)?`spectrum-Button--size${c}`:"spectrum-Button--sizeM",h=["spectrum-Button",i,l];return t&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function Or(o,e,t,r,a){let n=o;a&&(n=customElements.get("checkout-button").createCheckoutButton(o.dataset),n.connectedCallback(),n.render());let c="fill";t&&(c="outline");let i=b("sp-button",{treatment:c,variant:r,tabIndex:0,size:e.ctas.size??"m",...o.dataset.analyticsId&&{"data-analytics-id":o.dataset.analyticsId}},o.innerHTML);return i.source=n,(a?n.onceSettled():Promise.resolve(n)).then(l=>{i.setAttribute("data-navigation-url",l.href)}),i.addEventListener("click",l=>{l.defaultPrevented||n.click()}),i}function Nr(o,e,t){let r=o;return t&&(r=customElements.get("checkout-link").createCheckoutLink(o.dataset,o.innerHTML)),r.classList.add("con-button"),e&&r.classList.add("blue"),r}function $r(o,e,t,r){if(o.ctas){let{slot:a}=t.ctas,n=b("div",{slot:a},o.ctas),c=[...n.querySelectorAll("a")].map(i=>{let l=i.hasAttribute("data-wcs-osi")&&!!i.getAttribute("data-wcs-osi"),h=pr.exec(i.className)?.[0]??"accent",S=h.includes("accent"),v=h.includes("primary"),N=h.includes("secondary"),F=h.includes("-outline"),Be=h.includes("-link");if(i.classList.remove("accent","primary","secondary"),e.consonant)return Nr(i,S,l);if(Be)return i;let ct;return S?ct="accent":v?ct="primary":N&&(ct="secondary"),e.spectrum==="swc"?Or(i,t,F,ct,l):zr(i,t,F,ct,l)});n.innerHTML="",n.append(...c),e.append(n)}}function Ir(o,e){let{tags:t}=o,r=t?.find(n=>n.startsWith(gr))?.split("/").pop();if(!r)return;e.setAttribute(Pt,r),[...e.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...e.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,c)=>{n.setAttribute(ur,`${n.dataset.analyticsId}-${c+1}`)})}function Dr(o){o.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([e,t])=>{o.querySelectorAll(`a.${e}`).forEach(r=>{r.classList.remove(e),r.classList.add("spectrum-Link",`spectrum-Link--${t}`)})})}function Br(o){o.querySelectorAll("[slot]").forEach(r=>{r.remove()}),o.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Pt].forEach(r=>o.removeAttribute(r));let t=["wide-strip","thin-strip"];o.classList.remove(...t)}async function Ie(o,e){if(!o){let i=e?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${i}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${i}).`)}if(!o.fields){let i=o.id||"unknown",l=e?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${i}' (merchCard id: ${l}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${i}' (merchCard id: ${l}) is missing 'fields'.`)}let{id:t,fields:r,settings:a={}}=o,{variant:n}=r;if(!n)throw new Error(`hydrate: no variant found in payload ${t}`);Br(e),e.settings=a,e.id??(e.id=o.id),e.variant=n,await e.updateComplete;let{aemFragmentMapping:c}=e.variantLayout;if(!c)throw new Error(`hydrate: variant mapping not found for ${t}`);c.style==="consonant"&&e.setAttribute("consonant",!0),xr(r,e,c.mnemonics),br(r,e,c),vr(r,e,c),yr(r,e,c.size),Er(r,e,c.title),wr(r,e,c),kr(r,e,c),Tr(r,e,c.backgroundImage),Sr(r,e,c.allowedColors,c.backgroundColor),Ar(r,e,c),Cr(r,e,c),_r(r,e,c),Lr(r,e,c),Rr(r,e,c,a),Pr(r,e),$r(r,e,c,n),Ir(r,e),Dr(e)}var Qt="merch-card",Ur=":ready",Fr=":error",Xt=2e4,zt="merch-card:";function De(o,e){let t=o.closest(Qt);if(!t)return e;t.variantLayout?.priceOptionsProvider?.(o,e)}function qr(o){o.providers.has(De)||o.providers.price(De)}var nt,U,M,H,B=class extends Hr{constructor(){super();p(this,M);d(this,"customerSegment");d(this,"marketSegment");d(this,"variantLayout");p(this,nt);p(this,U);d(this,"readyEventDispatched",!1);this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this)}firstUpdated(){this.variantLayout=qt(this,!1),this.variantLayout?.connectedCallbackHook(),this.aemFragment?.updateComplete.catch(t=>{A(this,M,H).call(this,t,{},!1),this.style.display="none"})}willUpdate(t){(t.has("variant")||!this.variantLayout)&&(this.variantLayout=qt(this),this.variantLayout.connectedCallbackHook())}updated(t){(t.has("badgeBackgroundColor")||t.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),t.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayout?.postCardUpdateHook(t)}catch(r){A(this,M,H).call(this,`Error in postCardUpdateHook: ${r.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}get prices(){return Array.from(this.querySelectorAll('span[is="inline-price"][data-wcs-osi]'))}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get price(){return this.headingmMSlot?.querySelector(x)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(wt)??[]]}async toggleStockOffer({target:t}){if(!this.stockOfferOsis)return;let r=this.checkoutLinks;if(r.length!==0)for(let a of r){await a.onceSettled();let n=a.value?.[0]?.planType;if(!n)return;let c=this.stockOfferOsis[n];if(!c)return;let i=a.dataset.wcsOsi.split(",").filter(l=>l!==c);t.checked&&i.push(c),a.dataset.wcsOsi=i.join(",")}}changeHandler(t){t.target.tagName==="MERCH-ADDON"&&this.toggleAddon(t.target)}toggleAddon(t){let r=this.checkoutLinks;if(this.variantLayout?.toggleAddon?.(t),r.length!==0)for(let a of r){let{offerType:n,planType:c}=a.value?.[0];if(!n||!c)return;let i=t.getOsi(c,n),l=a.dataset.wcsOsi.split(",").filter(h=>h!==i);t.checked&&l.push(i),a.dataset.wcsOsi=l.join(",")}}handleQuantitySelection(t){let r=this.checkoutLinks;for(let a of r)a.dataset.quantity=t.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(t){let r={...this.filters};Object.keys(r).forEach(a=>{if(t){r[a].order=Math.min(r[a].order||2,2);return}let n=r[a].order;n===1||isNaN(n)||(r[a].order=Number(n)+1)}),this.filters=r}includes(t){return this.textContent.match(new RegExp(t,"i"))!==null}connectedCallback(){super.connectedCallback(),m(this,U,Y()),qr(s(this,U)),m(this,nt,s(this,U).Log.module(Qt)),this.id??(this.id=this.querySelector("aem-fragment")?.getAttribute("fragment")),performance.mark(`${zt}${this.id}${it}`),this.addEventListener(Nt,this.handleQuantitySelection),this.addEventListener($t,this.handleAddonAndQuantityUpdate),this.addEventListener(ce,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.addEventListener(V,this.handleAemFragmentEvents),this.addEventListener(G,this.handleAemFragmentEvents),this.addEventListener("change",this.changeHandler),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(Nt,this.handleQuantitySelection),this.removeEventListener(V,this.handleAemFragmentEvents),this.removeEventListener(G,this.handleAemFragmentEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener($t,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(t){if(this.isConnected&&(t.type===V&&A(this,M,H).call(this,`AEM fragment cannot be loaded: ${t.detail.message}`,t.detail),t.type===G&&t.target.nodeName==="AEM-FRAGMENT")){let r=t.detail;Ie(r,this).then(()=>this.checkReady()).catch(a=>s(this,nt).error(a))}}async checkReady(){if(!this.isConnected)return;let t=new Promise(c=>setTimeout(()=>c("timeout"),Xt));if(this.aemFragment){let c=await Promise.race([this.aemFragment.updateComplete,t]);if(c===!1){let i=c==="timeout"?`AEM fragment was not resolved within ${Xt} timeout`:"AEM fragment cannot be loaded";A(this,M,H).call(this,i,{},!1);return}}let r=[...this.querySelectorAll(ne)];r.push(...[...this.querySelectorAll(ae)].map(c=>c.source));let a=Promise.all(r.map(c=>c.onceSettled().catch(()=>c))).then(c=>c.every(i=>i.classList.contains("placeholder-resolved"))),n=await Promise.race([a,t]);if(n===!0)return performance.mark(`${zt}${this.id}${Ur}`),this.readyEventDispatched||(this.readyEventDispatched=!0,this.dispatchEvent(new CustomEvent(le,{bubbles:!0,composed:!0}))),this;{let{duration:c,startTime:i}=performance.measure(`${zt}${this.id}${Fr}`,`${zt}${this.id}${it}`),l={duration:c,startTime:i,...s(this,U).duration};n==="timeout"?A(this,M,H).call(this,`Contains offers that were not resolved within ${Xt} timeout`,l):A(this,M,H).call(this,"Contains unresolved offers",l)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let t=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(wt)).length===2&&t&&t.parentElement.classList.add("footer-column")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||(this.dispatchEvent(new CustomEvent(ie,{bubbles:!0})),this.displayFooterElementsInColumn())}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:t,items:r}}){if(!t||!r?.length)return;let a=this.checkoutLinks.find(h=>h.getAttribute("data-modal-id")===t);if(!a)return;let c=new URL(a.getAttribute("href")).searchParams.get("pa"),i=r.find(h=>h.productArrangementCode===c)?.quantity,l=!!r.find(h=>h.productArrangementCode!==c);if(i&&this.quantitySelect?.dispatchEvent(new CustomEvent(de,{detail:{quantity:i},bubbles:!0,composed:!0})),this.addonCheckbox?.checked!==l){this.toggleStockOffer({target:this.addonCheckbox});let h=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(h,"target",{writable:!1,value:{checked:l}}),this.addonCheckbox.handleChange(h)}}};nt=new WeakMap,U=new WeakMap,M=new WeakSet,H=function(t,r={},a=!0){s(this,nt).error(`merch-card: ${t}`,r),this.failed=!0,a&&this.dispatchEvent(new CustomEvent(he,{detail:{...r,message:t},bubbles:!0,composed:!0}))},d(B,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:t=>{if(!t)return;let[r,a,n]=t.split(",");return{PUF:r,ABM:a,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:t=>Object.fromEntries(t.split(",").map(r=>{let[a,n,c]=r.split(":"),i=Number(n);return[a,{order:isNaN(i)?void 0:i,size:c}]})),toAttribute:t=>Object.entries(t).map(([r,{order:a,size:n}])=>[r,a,n].filter(c=>c!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Pt,reflect:!0},loading:{type:String}}),d(B,"styles",[ee,...re()]),d(B,"registerVariant",y),d(B,"getFragmentMapping",kt);customElements.define(Qt,B);export{B as MerchCard}; + `),l(vt,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",vt);function dr(o){return`https://${o==="PRODUCTION"?"www.adobe.com":"www.stage.adobe.com"}/offers/promo-terms.html`}var yt,D=class D extends HTMLAnchorElement{constructor(){super();p(this,yt,!1);this.setAttribute("is",D.is)}get isUptLink(){return!0}initializeWcsData(t,r){this.setAttribute("data-wcs-osi",t),r&&this.setAttribute("data-promotion-code",r),m(this,yt,!0),this.composePromoTermsUrl()}attributeChangedCallback(t,r,a){s(this,yt)&&this.composePromoTermsUrl()}composePromoTermsUrl(){let t=this.getAttribute("data-wcs-osi");if(!t){let v=this.closest("merch-card").querySelector("aem-fragment").getAttribute("fragment");console.error(`Missing 'data-wcs-osi' attribute on upt-link. Fragment: ${v}`);return}let r=Y(),a=[t],n=this.getAttribute("data-promotion-code"),{country:c,language:i,env:d}=r.settings,h={country:c,language:i,wcsOsi:a,promotionCode:n},w=r.resolveOfferSelectors(h);Promise.all(w).then(([[v]])=>{let N=`locale=${i}_${c}&country=${c}&offer_id=${v.offerId}`;n&&(N+=`&promotion_code=${encodeURIComponent(n)}`),this.href=`${dr(d)}?${N}`}).catch(v=>{console.error(`Could not resolve offer selectors for id: ${t}.`,v.message)})}static createFrom(t){let r=new D;for(let a of t.attributes)a.name!=="is"&&(a.name==="class"&&a.value.includes("upt-link")?r.setAttribute("class",a.value.replace("upt-link","").trim()):r.setAttribute(a.name,a.value));return r.innerHTML=t.innerHTML,r.setAttribute("tabindex",0),r}};yt=new WeakMap,l(D,"is","upt-link"),l(D,"tag","a"),l(D,"observedAttributes",["data-wcs-osi","data-promotion-code"]);var O=D;window.customElements.get(O.is)||window.customElements.define(O.is,O,{extends:O.tag});var lr="#000000",Kt="#F8D904",hr="#EAEAEA",mr="#31A547",pr=/(accent|primary|secondary)(-(outline|link))?/,gr="mas:product_code/",ur="daa-ll",Pt="daa-lh",fr=["XL","L","M","S"],Wt="...";function S(o,e,t,r){let a=r[o];if(e[o]&&a){let n={slot:a?.slot},c=e[o];if(a.maxCount&&typeof c=="string"){let[d,h]=Mr(c,a.maxCount,a.withSuffix);d!==c&&(n.title=h,c=d)}let i=b(a.tag,n,c);t.append(i)}}function xr(o,e,t){let r=o.mnemonicIcon?.map((n,c)=>({icon:n,alt:o.mnemonicAlt[c]??"",link:o.mnemonicLink[c]??""}));r?.forEach(({icon:n,alt:c,link:i})=>{if(i&&!/^https?:/.test(i))try{i=new URL(`https://${i}`).href.toString()}catch{i="#"}let d={slot:"icons",src:n,loading:e.loading,size:t?.size??"l"};c&&(d.alt=c),i&&(d.href=i);let h=b("merch-icon",d);e.append(h)});let a=e.shadowRoot.querySelector('slot[name="icons"]');!r?.length&&a&&a.remove()}function br(o,e,t){if(t.badge?.slot){if(o.badge?.length&&!o.badge?.startsWith("${o.badge}`}S("badge",o,e,t)}else o.badge?(e.setAttribute("badge-text",o.badge),e.setAttribute("badge-color",o.badgeColor||lr),e.setAttribute("badge-background-color",o.badgeBackgroundColor||Kt),e.setAttribute("border-color",o.badgeBackgroundColor||Kt)):e.setAttribute("border-color",o.borderColor||hr)}function vr(o,e,t){if(t.trialBadge&&o.trialBadge){if(!o.trialBadge.startsWith("${o.trialBadge}`}S("trialBadge",o,e,t)}}function yr(o,e,t){t?.includes(o.size)&&e.setAttribute("size",o.size)}function Er(o,e,t){S("cardTitle",o,e,{cardTitle:t})}function wr(o,e,t){S("subtitle",o,e,t)}function Sr(o,e,t,r){if(!o.backgroundColor||o.backgroundColor.toLowerCase()==="default"){e.style.removeProperty("--merch-card-custom-background-color"),e.removeAttribute("background-color");return}t?.[o.backgroundColor]?(e.style.setProperty("--merch-card-custom-background-color",`var(${t[o.backgroundColor]})`),e.setAttribute("background-color",o.backgroundColor)):r?.attribute&&o.backgroundColor&&(e.setAttribute(r.attribute,o.backgroundColor),e.style.removeProperty("--merch-card-custom-background-color"))}function Ar(o,e,t){let r=t?.borderColor,a="--merch-card-custom-border-color";o.borderColor?.toLowerCase()==="transparent"?(e.style.removeProperty(a),t?.allowedBorderColors?.includes(t?.badge?.default)&&e.style.setProperty(a,"transparent")):o.borderColor&&r&&(/-gradient/.test(o.borderColor)?(e.setAttribute("gradient-border","true"),e.style.removeProperty(a)):e.style.setProperty(a,`var(--${o.borderColor})`))}function Tr(o,e,t){if(o.backgroundImage){let r={loading:e.loading??"lazy",src:o.backgroundImage};if(o.backgroundImageAltText?r.alt=o.backgroundImageAltText:r.role="none",!t)return;if(t?.attribute){e.setAttribute(t.attribute,o.backgroundImage);return}e.append(b(t.tag,{slot:t.slot},b("img",r)))}}function kr(o,e,t){S("prices",o,e,t)}function Cr(o,e,t){S("promoText",o,e,t),S("description",o,e,t),S("callout",o,e,t),S("quantitySelect",o,e,t),S("whatsIncluded",o,e,t)}function _r(o,e,t){if(!t.addon)return;let r=o.addon?.replace(/[{}]/g,"");if(!r||/disabled/.test(r))return;let a=b("merch-addon",{slot:"addon"},r);[...a.querySelectorAll(x)].forEach(n=>{let c=n.parentElement;c?.nodeName==="P"&&c.setAttribute("data-plan-type","")}),e.append(a)}function Lr(o,e,t){o.addonConfirmation&&S("addonConfirmation",o,e,t)}function Rr(o,e,t,r){o.showStockCheckbox&&t.stockOffer&&(e.setAttribute("checkbox-label",r?.stockCheckboxLabel?r.stockCheckboxLabel:""),e.setAttribute("stock-offer-osis",r?.stockOfferOsis?r.stockOfferOsis:"")),r?.secureLabel&&t?.secureLabel&&e.setAttribute("secure-label",r.secureLabel)}function Mr(o,e,t=!0){try{let r=typeof o!="string"?"":o,a=$e(r);if(a.length<=e)return[r,a];let n=0,c=!1,i=t?e-Wt.length<1?1:e-Wt.length:e,d=[];for(let v of r){if(n++,v==="<")if(c=!0,r[n]==="/")d.pop();else{let N="";for(let F of r.substring(n)){if(F===" "||F===">")break;N+=F}d.push(N)}if(v==="/"&&r[n]===">"&&d.pop(),v===">"){c=!1;continue}if(!c&&(i--,i===0))break}let h=r.substring(0,n).trim();if(d.length>0){d[0]==="p"&&d.shift();for(let v of d.reverse())h+=``}return[`${h}${t?Wt:""}`,a]}catch{let a=typeof o=="string"?o:"",n=$e(a);return[a,n]}}function $e(o){if(!o)return"";let e="",t=!1;for(let r of o){if(r==="<"&&(t=!0),r===">"){t=!1;continue}t||(e+=r)}return e}function Pr(o,e){e.querySelectorAll("a.upt-link").forEach(r=>{let a=O.createFrom(r);r.replaceWith(a),a.initializeWcsData(o.osi,o.promoCode)})}function zr(o,e,t,r,a){let n=o;a?n=customElements.get("checkout-button").createCheckoutButton({},o.innerHTML):n.innerHTML=`${n.textContent}`,n.setAttribute("tabindex",0);for(let w of o.attributes)["class","is"].includes(w.name)||n.setAttribute(w.name,w.value);n.firstElementChild?.classList.add("spectrum-Button-label");let c=e.ctas.size??"M",i=`spectrum-Button--${r}`,d=fr.includes(c)?`spectrum-Button--size${c}`:"spectrum-Button--sizeM",h=["spectrum-Button",i,d];return t&&h.push("spectrum-Button--outline"),n.classList.add(...h),n}function Or(o,e,t,r,a){let n=o;a&&(n=customElements.get("checkout-button").createCheckoutButton(o.dataset),n.connectedCallback(),n.render());let c="fill";t&&(c="outline");let i=b("sp-button",{treatment:c,variant:r,tabIndex:0,size:e.ctas.size??"m",...o.dataset.analyticsId&&{"data-analytics-id":o.dataset.analyticsId}},o.innerHTML);return i.source=n,(a?n.onceSettled():Promise.resolve(n)).then(d=>{i.setAttribute("data-navigation-url",d.href)}),i.addEventListener("click",d=>{d.defaultPrevented||n.click()}),i}function Nr(o,e,t){let r=o;return t&&(r=customElements.get("checkout-link").createCheckoutLink(o.dataset,o.innerHTML)),r.classList.add("con-button"),e&&r.classList.add("blue"),r}function $r(o,e,t,r){if(o.ctas){let{slot:a}=t.ctas,n=b("div",{slot:a},o.ctas),c=[...n.querySelectorAll("a")].map(i=>{let d=i.hasAttribute("data-wcs-osi")&&!!i.getAttribute("data-wcs-osi"),h=pr.exec(i.className)?.[0]??"accent",w=h.includes("accent"),v=h.includes("primary"),N=h.includes("secondary"),F=h.includes("-outline"),Be=h.includes("-link");if(i.classList.remove("accent","primary","secondary"),e.consonant)return Nr(i,w,d);if(Be)return i;let ct;return w?ct="accent":v?ct="primary":N&&(ct="secondary"),e.spectrum==="swc"?Or(i,t,F,ct,d):zr(i,t,F,ct,d)});n.innerHTML="",n.append(...c),e.append(n)}}function Ir(o,e){let{tags:t}=o,r=t?.find(n=>n.startsWith(gr))?.split("/").pop();if(!r)return;e.setAttribute(Pt,r),[...e.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...e.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((n,c)=>{n.setAttribute(ur,`${n.dataset.analyticsId}-${c+1}`)})}function Dr(o){o.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([e,t])=>{o.querySelectorAll(`a.${e}`).forEach(r=>{r.classList.remove(e),r.classList.add("spectrum-Link",`spectrum-Link--${t}`)})})}function Br(o){o.querySelectorAll("[slot]").forEach(r=>{r.remove()}),o.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Pt].forEach(r=>o.removeAttribute(r));let t=["wide-strip","thin-strip"];o.classList.remove(...t)}async function Ie(o,e){if(!o){let i=e?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${i}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${i}).`)}if(!o.fields){let i=o.id||"unknown",d=e?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${i}' (merchCard id: ${d}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${i}' (merchCard id: ${d}) is missing 'fields'.`)}let{id:t,fields:r,settings:a={}}=o,{variant:n}=r;if(!n)throw new Error(`hydrate: no variant found in payload ${t}`);Br(e),e.settings=a,e.id??(e.id=o.id),e.variant=n,await e.updateComplete;let{aemFragmentMapping:c}=e.variantLayout;if(!c)throw new Error(`hydrate: variant mapping not found for ${t}`);c.style==="consonant"&&e.setAttribute("consonant",!0),xr(r,e,c.mnemonics),br(r,e,c),vr(r,e,c),yr(r,e,c.size),Er(r,e,c.title),wr(r,e,c),kr(r,e,c),Tr(r,e,c.backgroundImage),Sr(r,e,c.allowedColors,c.backgroundColor),Ar(r,e,c),Cr(r,e,c),_r(r,e,c),Lr(r,e,c),Rr(r,e,c,a),Pr(r,e),$r(r,e,c,n),Ir(r,e),Dr(e)}var Qt="merch-card",Ur=":ready",Fr=":error",Xt=2e4,zt="merch-card:";function De(o,e){let t=o.closest(Qt);if(!t)return e;t.variantLayout?.priceOptionsProvider?.(o,e)}function qr(o){o.providers.has(De)||o.providers.price(De)}var nt,U,M,H,B=class extends Hr{constructor(){super();p(this,M);l(this,"customerSegment");l(this,"marketSegment");l(this,"variantLayout");p(this,nt);p(this,U);l(this,"readyEventDispatched",!1);this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this)}firstUpdated(){this.variantLayout=qt(this,!1),this.variantLayout?.connectedCallbackHook(),this.aemFragment?.updateComplete.catch(t=>{A(this,M,H).call(this,t,{},!1),this.style.display="none"})}willUpdate(t){(t.has("variant")||!this.variantLayout)&&(this.variantLayout=qt(this),this.variantLayout.connectedCallbackHook())}updated(t){(t.has("badgeBackgroundColor")||t.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),t.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayout?.postCardUpdateHook(t)}catch(r){A(this,M,H).call(this,`Error in postCardUpdateHook: ${r.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}get prices(){return Array.from(this.querySelectorAll('span[is="inline-price"][data-wcs-osi]'))}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get price(){return this.headingmMSlot?.querySelector(x)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(wt)??[]]}async toggleStockOffer({target:t}){if(!this.stockOfferOsis)return;let r=this.checkoutLinks;if(r.length!==0)for(let a of r){await a.onceSettled();let n=a.value?.[0]?.planType;if(!n)return;let c=this.stockOfferOsis[n];if(!c)return;let i=a.dataset.wcsOsi.split(",").filter(d=>d!==c);t.checked&&i.push(c),a.dataset.wcsOsi=i.join(",")}}changeHandler(t){t.target.tagName==="MERCH-ADDON"&&this.toggleAddon(t.target)}toggleAddon(t){let r=this.checkoutLinks;if(this.variantLayout?.toggleAddon?.(t),r.length!==0)for(let a of r){let{offerType:n,planType:c}=a.value?.[0];if(!n||!c)return;let i=t.getOsi(c,n),d=a.dataset.wcsOsi.split(",").filter(h=>h!==i);t.checked&&d.push(i),a.dataset.wcsOsi=d.join(",")}}handleQuantitySelection(t){let r=this.checkoutLinks;for(let a of r)a.dataset.quantity=t.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(t){let r={...this.filters};Object.keys(r).forEach(a=>{if(t){r[a].order=Math.min(r[a].order||2,2);return}let n=r[a].order;n===1||isNaN(n)||(r[a].order=Number(n)+1)}),this.filters=r}includes(t){return this.textContent.match(new RegExp(t,"i"))!==null}connectedCallback(){super.connectedCallback(),m(this,U,Y()),qr(s(this,U)),m(this,nt,s(this,U).Log.module(Qt)),this.id??(this.id=this.querySelector("aem-fragment")?.getAttribute("fragment")),performance.mark(`${zt}${this.id}${it}`),this.addEventListener(Nt,this.handleQuantitySelection),this.addEventListener($t,this.handleAddonAndQuantityUpdate),this.addEventListener(ce,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.addEventListener(V,this.handleAemFragmentEvents),this.addEventListener(G,this.handleAemFragmentEvents),this.addEventListener("change",this.changeHandler),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(Nt,this.handleQuantitySelection),this.removeEventListener(V,this.handleAemFragmentEvents),this.removeEventListener(G,this.handleAemFragmentEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener($t,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(t){if(this.isConnected&&(t.type===V&&A(this,M,H).call(this,`AEM fragment cannot be loaded: ${t.detail.message}`,t.detail),t.type===G&&t.target.nodeName==="AEM-FRAGMENT")){let r=t.detail;Ie(r,this).then(()=>this.checkReady()).catch(a=>s(this,nt).error(a))}}async checkReady(){if(!this.isConnected)return;let t=new Promise(c=>setTimeout(()=>c("timeout"),Xt));if(this.aemFragment){let c=await Promise.race([this.aemFragment.updateComplete,t]);if(c===!1){let i=c==="timeout"?`AEM fragment was not resolved within ${Xt} timeout`:"AEM fragment cannot be loaded";A(this,M,H).call(this,i,{},!1);return}}let r=[...this.querySelectorAll(ne)];r.push(...[...this.querySelectorAll(ae)].map(c=>c.source));let a=Promise.all(r.map(c=>c.onceSettled().catch(()=>c))).then(c=>c.every(i=>i.classList.contains("placeholder-resolved"))),n=await Promise.race([a,t]);if(n===!0)return performance.mark(`${zt}${this.id}${Ur}`),this.readyEventDispatched||(this.readyEventDispatched=!0,this.dispatchEvent(new CustomEvent(le,{bubbles:!0,composed:!0}))),this;{let{duration:c,startTime:i}=performance.measure(`${zt}${this.id}${Fr}`,`${zt}${this.id}${it}`),d={duration:c,startTime:i,...s(this,U).duration};n==="timeout"?A(this,M,H).call(this,`Contains offers that were not resolved within ${Xt} timeout`,d):A(this,M,H).call(this,"Contains unresolved offers",d)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let t=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(wt)).length===2&&t&&t.parentElement.classList.add("footer-column")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||(this.dispatchEvent(new CustomEvent(ie,{bubbles:!0})),this.displayFooterElementsInColumn())}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:t,items:r}}){if(!t||!r?.length)return;let a=this.checkoutLinks.find(h=>h.getAttribute("data-modal-id")===t);if(!a)return;let c=new URL(a.getAttribute("href")).searchParams.get("pa"),i=r.find(h=>h.productArrangementCode===c)?.quantity,d=!!r.find(h=>h.productArrangementCode!==c);if(i&&this.quantitySelect?.dispatchEvent(new CustomEvent(de,{detail:{quantity:i},bubbles:!0,composed:!0})),this.addonCheckbox?.checked!==d){this.toggleStockOffer({target:this.addonCheckbox});let h=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(h,"target",{writable:!1,value:{checked:d}}),this.addonCheckbox.handleChange(h)}}};nt=new WeakMap,U=new WeakMap,M=new WeakSet,H=function(t,r={},a=!0){s(this,nt).error(`merch-card: ${t}`,r),this.failed=!0,a&&this.dispatchEvent(new CustomEvent(he,{detail:{...r,message:t},bubbles:!0,composed:!0}))},l(B,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:t=>{if(!t)return;let[r,a,n]=t.split(",");return{PUF:r,ABM:a,M2M:n}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:t=>Object.fromEntries(t.split(",").map(r=>{let[a,n,c]=r.split(":"),i=Number(n);return[a,{order:isNaN(i)?void 0:i,size:c}]})),toAttribute:t=>Object.entries(t).map(([r,{order:a,size:n}])=>[r,a,n].filter(c=>c!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Pt,reflect:!0},loading:{type:String}}),l(B,"styles",[ee,...re()]),l(B,"registerVariant",y),l(B,"getFragmentMapping",kt);customElements.define(Qt,B);export{B as MerchCard}; +//# sourceMappingURL=merch-card.js.map diff --git a/libs/features/mas/dist/mas.js b/libs/features/mas/dist/mas.js index 7464d5e28d..572a2f72bf 100644 --- a/libs/features/mas/dist/mas.js +++ b/libs/features/mas/dist/mas.js @@ -1301,7 +1301,7 @@ merch-card[variant^="plans"]:not([size]) { ${this.card.checkboxLabel} - `:""}get icons(){return this.card.querySelector('[slot="icons"]')?g``:""}connectedCallbackHook(){let t=co();t?.addEventListener&&t.addEventListener("change",this.adaptForMobile)}disconnectedCallbackHook(){let t=co();t?.removeEventListener&&t.removeEventListener("change",this.adaptForMobile)}renderLayout(){return g` ${this.badge} + `:""}get icons(){return!this.card.querySelector('[slot="icons"]')&&!this.card.getAttribute("id")?"":g``}connectedCallbackHook(){let t=co();t?.addEventListener&&t.addEventListener("change",this.adaptForMobile)}disconnectedCallbackHook(){let t=co();t?.removeEventListener&&t.removeEventListener("change",this.adaptForMobile)}renderLayout(){return g` ${this.badge}
${this.icons} @@ -2259,7 +2259,7 @@ sr-only { text-decoration: underline; color: var(--link-color-dark); } - `),u(Rr,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",Rr);var Kh="#000000",wi="#F8D904",Qh="#EAEAEA",Zh="#31A547",Jh=/(accent|primary|secondary)(-(outline|link))?/,ed="mas:product_code/",td="daa-ll",Lo="daa-lh",rd=["XL","L","M","S"],_i="...";function ce(e,t,r,o){let n=o[e];if(t[e]&&n){let i={slot:n?.slot},a=t[e];if(n.maxCount&&typeof a=="string"){let[c,l]=xd(a,n.maxCount,n.withSuffix);c!==a&&(i.title=l,a=c)}let s=te(n.tag,i,a);r.append(s)}}function od(e,t,r){e.mnemonicIcon?.map((n,i)=>({icon:n,alt:e.mnemonicAlt[i]??"",link:e.mnemonicLink[i]??""}))?.forEach(({icon:n,alt:i,link:a})=>{if(a&&!/^https?:/.test(a))try{a=new URL(`https://${a}`).href.toString()}catch{a="#"}let s={slot:"icons",src:n,loading:t.loading,size:r?.size??"l"};i&&(s.alt=i),a&&(s.href=a);let c=te("merch-icon",s);t.append(c)})}function nd(e,t,r){if(r.badge?.slot){if(e.badge?.length&&!e.badge?.startsWith("${e.badge}`}ce("badge",e,t,r)}else e.badge?(t.setAttribute("badge-text",e.badge),t.setAttribute("badge-color",e.badgeColor||Kh),t.setAttribute("badge-background-color",e.badgeBackgroundColor||wi),t.setAttribute("border-color",e.badgeBackgroundColor||wi)):t.setAttribute("border-color",e.borderColor||Qh)}function id(e,t,r){if(r.trialBadge&&e.trialBadge){if(!e.trialBadge.startsWith("${e.trialBadge}`}ce("trialBadge",e,t,r)}}function ad(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function sd(e,t,r){ce("cardTitle",e,t,{cardTitle:r})}function cd(e,t,r){ce("subtitle",e,t,r)}function ld(e,t,r,o){if(!e.backgroundColor||e.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}r?.[e.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${r[e.backgroundColor]})`),t.setAttribute("background-color",e.backgroundColor)):o?.attribute&&e.backgroundColor&&(t.setAttribute(o.attribute,e.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function hd(e,t,r){let o=r?.borderColor,n="--merch-card-custom-border-color";e.borderColor?.toLowerCase()==="transparent"?(t.style.removeProperty(n),r?.allowedBorderColors?.includes(r?.badge?.default)&&t.style.setProperty(n,"transparent")):e.borderColor&&o&&(/-gradient/.test(e.borderColor)?(t.setAttribute("gradient-border","true"),t.style.removeProperty(n)):t.style.setProperty(n,`var(--${e.borderColor})`))}function dd(e,t,r){if(e.backgroundImage){let o={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?o.alt=e.backgroundImageAltText:o.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(te(r.tag,{slot:r.slot},te("img",o)))}}function pd(e,t,r){ce("prices",e,t,r)}function md(e,t,r){ce("promoText",e,t,r),ce("description",e,t,r),ce("callout",e,t,r),ce("quantitySelect",e,t,r),ce("whatsIncluded",e,t,r)}function ud(e,t,r){if(!r.addon)return;let o=e.addon?.replace(/[{}]/g,"");if(!o||/disabled/.test(o))return;let n=te("merch-addon",{slot:"addon"},o);[...n.querySelectorAll(Y)].forEach(i=>{let a=i.parentElement;a?.nodeName==="P"&&a.setAttribute("data-plan-type","")}),t.append(n)}function fd(e,t,r){e.addonConfirmation&&ce("addonConfirmation",e,t,r)}function gd(e,t,r,o){e.showStockCheckbox&&r.stockOffer&&(t.setAttribute("checkbox-label",o?.stockCheckboxLabel?o.stockCheckboxLabel:""),t.setAttribute("stock-offer-osis",o?.stockOfferOsis?o.stockOfferOsis:"")),o?.secureLabel&&r?.secureLabel&&t.setAttribute("secure-label",o.secureLabel)}function xd(e,t,r=!0){try{let o=typeof e!="string"?"":e,n=vc(o);if(n.length<=t)return[o,n];let i=0,a=!1,s=r?t-_i.length<1?1:t-_i.length:t,c=[];for(let d of o){if(i++,d==="<")if(a=!0,o[i]==="/")c.pop();else{let p="";for(let m of o.substring(i)){if(m===" "||m===">")break;p+=m}c.push(p)}if(d==="/"&&o[i]===">"&&c.pop(),d===">"){a=!1;continue}if(!a&&(s--,s===0))break}let l=o.substring(0,i).trim();if(c.length>0){c[0]==="p"&&c.shift();for(let d of c.reverse())l+=``}return[`${l}${r?_i:""}`,n]}catch{let n=typeof e=="string"?e:"",i=vc(n);return[n,i]}}function vc(e){if(!e)return"";let t="",r=!1;for(let o of e){if(o==="<"&&(r=!0),o===">"){r=!1;continue}r||(t+=o)}return t}function bd(e,t){t.querySelectorAll("a.upt-link").forEach(o=>{let n=Re.createFrom(o);o.replaceWith(n),n.initializeWcsData(e.osi,e.promoCode)})}function vd(e,t,r,o,n){let i=e;n?i=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML):i.innerHTML=`${i.textContent}`,i.setAttribute("tabindex",0);for(let h of e.attributes)["class","is"].includes(h.name)||i.setAttribute(h.name,h.value);i.firstElementChild?.classList.add("spectrum-Button-label");let a=t.ctas.size??"M",s=`spectrum-Button--${o}`,c=rd.includes(a)?`spectrum-Button--size${a}`:"spectrum-Button--sizeM",l=["spectrum-Button",s,c];return r&&l.push("spectrum-Button--outline"),i.classList.add(...l),i}function yd(e,t,r,o,n){let i=e;n&&(i=customElements.get("checkout-button").createCheckoutButton(e.dataset),i.connectedCallback(),i.render());let a="fill";r&&(a="outline");let s=te("sp-button",{treatment:a,variant:o,tabIndex:0,size:t.ctas.size??"m",...e.dataset.analyticsId&&{"data-analytics-id":e.dataset.analyticsId}},e.innerHTML);return s.source=i,(n?i.onceSettled():Promise.resolve(i)).then(c=>{s.setAttribute("data-navigation-url",c.href)}),s.addEventListener("click",c=>{c.defaultPrevented||i.click()}),s}function Ed(e,t,r){let o=e;return r&&(o=customElements.get("checkout-link").createCheckoutLink(e.dataset,e.innerHTML)),o.classList.add("con-button"),t&&o.classList.add("blue"),o}function Ad(e,t,r,o){if(e.ctas){let{slot:n}=r.ctas,i=te("div",{slot:n},e.ctas),a=[...i.querySelectorAll("a")].map(s=>{let c=s.hasAttribute("data-wcs-osi")&&!!s.getAttribute("data-wcs-osi"),l=Jh.exec(s.className)?.[0]??"accent",h=l.includes("accent"),d=l.includes("primary"),p=l.includes("secondary"),m=l.includes("-outline"),x=l.includes("-link");if(s.classList.remove("accent","primary","secondary"),t.consonant)return Ed(s,h,c);if(x)return s;let f;return h?f="accent":d?f="primary":p&&(f="secondary"),t.spectrum==="swc"?yd(s,r,m,f,c):vd(s,r,m,f,c)});i.innerHTML="",i.append(...a),t.append(i)}}function wd(e,t){let{tags:r}=e,o=r?.find(i=>i.startsWith(ed))?.split("/").pop();if(!o)return;t.setAttribute(Lo,o),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((i,a)=>{i.setAttribute(td,`${i.dataset.analyticsId}-${a+1}`)})}function _d(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(o=>{o.classList.remove(t),o.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}function Sd(e){e.querySelectorAll("[slot]").forEach(o=>{o.remove()}),e.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Lo].forEach(o=>e.removeAttribute(o));let r=["wide-strip","thin-strip"];e.classList.remove(...r)}async function yc(e,t){if(!e){let s=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${s}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${s}).`)}if(!e.fields){let s=e.id||"unknown",c=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${s}' (merchCard id: ${c}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${s}' (merchCard id: ${c}) is missing 'fields'.`)}let{id:r,fields:o,settings:n={}}=e,{variant:i}=o;if(!i)throw new Error(`hydrate: no variant found in payload ${r}`);Sd(t),t.settings=n,t.id??(t.id=e.id),t.variant=i,await t.updateComplete;let{aemFragmentMapping:a}=t.variantLayout;if(!a)throw new Error(`hydrate: variant mapping not found for ${r}`);a.style==="consonant"&&t.setAttribute("consonant",!0),od(o,t,a.mnemonics),nd(o,t,a),id(o,t,a),ad(o,t,a.size),sd(o,t,a.title),cd(o,t,a),pd(o,t,a),dd(o,t,a.backgroundImage),ld(o,t,a.allowedColors,a.backgroundColor),hd(o,t,a),md(o,t,a),ud(o,t,a),fd(o,t,a),gd(o,t,a,n),bd(o,t),Ad(o,t,a,i),wd(o,t),_d(t)}var Ti="merch-card",Td=":ready",Cd=":error",Si=2e4,Ro="merch-card:";function Ec(e,t){let r=e.closest(Ti);if(!r)return t;r.variantLayout?.priceOptionsProvider?.(e,t)}function Pd(e){e.providers.has(Ec)||e.providers.price(Ec)}var Ft,st,Se,at,it=class extends M{constructor(){super();P(this,Se);u(this,"customerSegment");u(this,"marketSegment");u(this,"variantLayout");P(this,Ft);P(this,st);u(this,"readyEventDispatched",!1);this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this)}firstUpdated(){this.variantLayout=vi(this,!1),this.variantLayout?.connectedCallbackHook(),this.aemFragment?.updateComplete.catch(r=>{le(this,Se,at).call(this,r,{},!1),this.style.display="none"})}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout=vi(this),this.variantLayout.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),r.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayout?.postCardUpdateHook(r)}catch(o){le(this,Se,at).call(this,`Error in postCardUpdateHook: ${o.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}get prices(){return Array.from(this.querySelectorAll('span[is="inline-price"][data-wcs-osi]'))}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get price(){return this.headingmMSlot?.querySelector(Y)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(De)??[]]}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let o=this.checkoutLinks;if(o.length!==0)for(let n of o){await n.onceSettled();let i=n.value?.[0]?.planType;if(!i)return;let a=this.stockOfferOsis[i];if(!a)return;let s=n.dataset.wcsOsi.split(",").filter(c=>c!==a);r.checked&&s.push(a),n.dataset.wcsOsi=s.join(",")}}changeHandler(r){r.target.tagName==="MERCH-ADDON"&&this.toggleAddon(r.target)}toggleAddon(r){let o=this.checkoutLinks;if(this.variantLayout?.toggleAddon?.(r),o.length!==0)for(let n of o){let{offerType:i,planType:a}=n.value?.[0];if(!i||!a)return;let s=r.getOsi(a,i),c=n.dataset.wcsOsi.split(",").filter(l=>l!==s);r.checked&&c.push(s),n.dataset.wcsOsi=c.join(",")}}handleQuantitySelection(r){let o=this.checkoutLinks;for(let n of o)n.dataset.quantity=r.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(r){let o={...this.filters};Object.keys(o).forEach(n=>{if(r){o[n].order=Math.min(o[n].order||2,2);return}let i=o[n].order;i===1||isNaN(i)||(o[n].order=Number(i)+1)}),this.filters=o}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){super.connectedCallback(),k(this,st,_t()),Pd(b(this,st)),k(this,Ft,b(this,st).Log.module(Ti)),this.id??(this.id=this.querySelector("aem-fragment")?.getAttribute("fragment")),performance.mark(`${Ro}${this.id}${ke}`),this.addEventListener(me,this.handleQuantitySelection),this.addEventListener(Mr,this.handleAddonAndQuantityUpdate),this.addEventListener(Yt,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.addEventListener(ze,this.handleAemFragmentEvents),this.addEventListener(Be,this.handleAemFragmentEvents),this.addEventListener("change",this.changeHandler),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(me,this.handleQuantitySelection),this.removeEventListener(ze,this.handleAemFragmentEvents),this.removeEventListener(Be,this.handleAemFragmentEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(Mr,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(r){if(this.isConnected&&(r.type===ze&&le(this,Se,at).call(this,`AEM fragment cannot be loaded: ${r.detail.message}`,r.detail),r.type===Be&&r.target.nodeName==="AEM-FRAGMENT")){let o=r.detail;yc(o,this).then(()=>this.checkReady()).catch(n=>b(this,Ft).error(n))}}async checkReady(){if(!this.isConnected)return;let r=new Promise(a=>setTimeout(()=>a("timeout"),Si));if(this.aemFragment){let a=await Promise.race([this.aemFragment.updateComplete,r]);if(a===!1){let s=a==="timeout"?`AEM fragment was not resolved within ${Si} timeout`:"AEM fragment cannot be loaded";le(this,Se,at).call(this,s,{},!1);return}}let o=[...this.querySelectorAll(Wt)];o.push(...[...this.querySelectorAll(Io)].map(a=>a.source));let n=Promise.all(o.map(a=>a.onceSettled().catch(()=>a))).then(a=>a.every(s=>s.classList.contains("placeholder-resolved"))),i=await Promise.race([n,r]);if(i===!0)return performance.mark(`${Ro}${this.id}${Td}`),this.readyEventDispatched||(this.readyEventDispatched=!0,this.dispatchEvent(new CustomEvent(Bo,{bubbles:!0,composed:!0}))),this;{let{duration:a,startTime:s}=performance.measure(`${Ro}${this.id}${Cd}`,`${Ro}${this.id}${ke}`),c={duration:a,startTime:s,...b(this,st).duration};i==="timeout"?le(this,Se,at).call(this,`Contains offers that were not resolved within ${Si} timeout`,c):le(this,Se,at).call(this,"Contains unresolved offers",c)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(De)).length===2&&r&&r.parentElement.classList.add("footer-column")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||(this.dispatchEvent(new CustomEvent(Ho,{bubbles:!0})),this.displayFooterElementsInColumn())}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:r,items:o}}){if(!r||!o?.length)return;let n=this.checkoutLinks.find(l=>l.getAttribute("data-modal-id")===r);if(!n)return;let a=new URL(n.getAttribute("href")).searchParams.get("pa"),s=o.find(l=>l.productArrangementCode===a)?.quantity,c=!!o.find(l=>l.productArrangementCode!==a);if(s&&this.quantitySelect?.dispatchEvent(new CustomEvent(gt,{detail:{quantity:s},bubbles:!0,composed:!0})),this.addonCheckbox?.checked!==c){this.toggleStockOffer({target:this.addonCheckbox});let l=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(l,"target",{writable:!1,value:{checked:c}}),this.addonCheckbox.handleChange(l)}}};Ft=new WeakMap,st=new WeakMap,Se=new WeakSet,at=function(r,o={},n=!0){b(this,Ft).error(`merch-card: ${r}`,o),this.failed=!0,n&&this.dispatchEvent(new CustomEvent(zo,{detail:{...o,message:r},bubbles:!0,composed:!0}))},u(it,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:r=>{if(!r)return;let[o,n,i]=r.split(",");return{PUF:o,ABM:n,M2M:i}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(o=>{let[n,i,a]=o.split(":"),s=Number(i);return[n,{order:isNaN(s)?void 0:s,size:a}]})),toAttribute:r=>Object.entries(r).map(([o,{order:n,size:i}])=>[o,n,i].filter(a=>a!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Lo,reflect:!0},loading:{type:String}}),u(it,"styles",[tc,...rc()]),u(it,"registerVariant",q),u(it,"getFragmentMapping",So);customElements.define(Ti,it);var Gt,Or=class extends M{constructor(){super();P(this,Gt);this.defaults={},this.variant="plans"}saveContainerDefaultValues(){let r=this.closest(this.getAttribute("container")),o=r?.querySelector('[slot="description"]:not(merch-offer > *)')?.cloneNode(!0),n=r?.badgeText;return{description:o,badgeText:n}}getSlottedElement(r,o){return(o||this.closest(this.getAttribute("container"))).querySelector(`[slot="${r}"]:not(merch-offer > *)`)}updateSlot(r,o){let n=this.getSlottedElement(r,o);if(!n)return;let i=this.selectedOffer.getOptionValue(r)?this.selectedOffer.getOptionValue(r):this.defaults[r];i&&n.replaceWith(i.cloneNode(!0))}handleOfferSelection(r){let o=r.detail;this.selectOffer(o)}handleOfferSelectionByQuantity(r){let o=r.detail.option,n=Number.parseInt(o),i=this.findAppropriateOffer(n);this.selectOffer(i),this.getSlottedElement("cta").setAttribute("data-quantity",n)}selectOffer(r){if(!r)return;let o=this.selectedOffer;o&&(o.selected=!1),r.selected=!0,this.selectedOffer=r,this.planType=r.planType,this.updateContainer(),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(Do,{detail:this,bubbles:!0}))})}findAppropriateOffer(r){let o=null;return this.offers.find(i=>{let a=Number.parseInt(i.getAttribute("value"));if(a===r)return!0;if(a>r)return!1;o=i})||o}updateBadgeText(r){this.selectedOffer.badgeText===""?r.badgeText=null:this.selectedOffer.badgeText?r.badgeText=this.selectedOffer.badgeText:r.badgeText=this.defaults.badgeText}updateContainer(){let r=this.closest(this.getAttribute("container"));!r||!this.selectedOffer||(this.updateSlot("cta",r),this.updateSlot("secondary-cta",r),this.updateSlot("price",r),!this.manageableMode&&(this.updateSlot("description",r),this.updateBadgeText(r)))}render(){return g`
`}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.handleFocusin),this.addEventListener("click",this.handleFocusin),this.addEventListener(ft,this.handleOfferSelectReady);let r=this.closest("merch-quantity-select");this.manageableMode=r,this.offers=[...this.querySelectorAll("merch-offer")],k(this,Gt,this.handleOfferSelectionByQuantity.bind(this)),this.manageableMode?r.addEventListener(me,b(this,Gt)):this.defaults=this.saveContainerDefaultValues(),this.selectedOffer=this.offers[0],this.planType&&this.updateContainer()}get miniCompareMobileCard(){return this.merchCard?.variant==="mini-compare-chart"&&this.isMobile}get merchCard(){return this.closest("merch-card")}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(me,b(this,Gt)),this.removeEventListener(ft,this.handleOfferSelectReady),this.removeEventListener("focusin",this.handleFocusin),this.removeEventListener("click",this.handleFocusin)}get price(){return this.querySelector('merch-offer[aria-selected] [is="inline-price"]')}get customerSegment(){return this.selectedOffer?.customerSegment}get marketSegment(){return this.selectedOffer?.marketSegment}handleFocusin(r){r.target?.nodeName==="MERCH-OFFER"&&(r.preventDefault(),r.stopImmediatePropagation(),this.selectOffer(r.target))}async handleOfferSelectReady(){this.planType||this.querySelector("merch-offer:not([plan-type])")||(this.planType=this.selectedOffer.planType,await this.updateComplete,this.selectOffer(this.selectedOffer??this.querySelector("merch-offer[aria-selected]")??this.querySelector("merch-offer")),this.dispatchEvent(new CustomEvent(Yt,{bubbles:!0})))}};Gt=new WeakMap,u(Or,"styles",y` + `),u(Rr,"properties",{heading:{type:String,attribute:!0},mobileRows:{type:Number,attribute:!0}});customElements.define("merch-whats-included",Rr);var Kh="#000000",wi="#F8D904",Qh="#EAEAEA",Zh="#31A547",Jh=/(accent|primary|secondary)(-(outline|link))?/,ed="mas:product_code/",td="daa-ll",Lo="daa-lh",rd=["XL","L","M","S"],_i="...";function ce(e,t,r,o){let n=o[e];if(t[e]&&n){let i={slot:n?.slot},a=t[e];if(n.maxCount&&typeof a=="string"){let[c,l]=xd(a,n.maxCount,n.withSuffix);c!==a&&(i.title=l,a=c)}let s=te(n.tag,i,a);r.append(s)}}function od(e,t,r){let o=e.mnemonicIcon?.map((i,a)=>({icon:i,alt:e.mnemonicAlt[a]??"",link:e.mnemonicLink[a]??""}));o?.forEach(({icon:i,alt:a,link:s})=>{if(s&&!/^https?:/.test(s))try{s=new URL(`https://${s}`).href.toString()}catch{s="#"}let c={slot:"icons",src:i,loading:t.loading,size:r?.size??"l"};a&&(c.alt=a),s&&(c.href=s);let l=te("merch-icon",c);t.append(l)});let n=t.shadowRoot.querySelector('slot[name="icons"]');!o?.length&&n&&n.remove()}function nd(e,t,r){if(r.badge?.slot){if(e.badge?.length&&!e.badge?.startsWith("${e.badge}`}ce("badge",e,t,r)}else e.badge?(t.setAttribute("badge-text",e.badge),t.setAttribute("badge-color",e.badgeColor||Kh),t.setAttribute("badge-background-color",e.badgeBackgroundColor||wi),t.setAttribute("border-color",e.badgeBackgroundColor||wi)):t.setAttribute("border-color",e.borderColor||Qh)}function id(e,t,r){if(r.trialBadge&&e.trialBadge){if(!e.trialBadge.startsWith("${e.trialBadge}`}ce("trialBadge",e,t,r)}}function ad(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function sd(e,t,r){ce("cardTitle",e,t,{cardTitle:r})}function cd(e,t,r){ce("subtitle",e,t,r)}function ld(e,t,r,o){if(!e.backgroundColor||e.backgroundColor.toLowerCase()==="default"){t.style.removeProperty("--merch-card-custom-background-color"),t.removeAttribute("background-color");return}r?.[e.backgroundColor]?(t.style.setProperty("--merch-card-custom-background-color",`var(${r[e.backgroundColor]})`),t.setAttribute("background-color",e.backgroundColor)):o?.attribute&&e.backgroundColor&&(t.setAttribute(o.attribute,e.backgroundColor),t.style.removeProperty("--merch-card-custom-background-color"))}function hd(e,t,r){let o=r?.borderColor,n="--merch-card-custom-border-color";e.borderColor?.toLowerCase()==="transparent"?(t.style.removeProperty(n),r?.allowedBorderColors?.includes(r?.badge?.default)&&t.style.setProperty(n,"transparent")):e.borderColor&&o&&(/-gradient/.test(e.borderColor)?(t.setAttribute("gradient-border","true"),t.style.removeProperty(n)):t.style.setProperty(n,`var(--${e.borderColor})`))}function dd(e,t,r){if(e.backgroundImage){let o={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?o.alt=e.backgroundImageAltText:o.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(te(r.tag,{slot:r.slot},te("img",o)))}}function pd(e,t,r){ce("prices",e,t,r)}function md(e,t,r){ce("promoText",e,t,r),ce("description",e,t,r),ce("callout",e,t,r),ce("quantitySelect",e,t,r),ce("whatsIncluded",e,t,r)}function ud(e,t,r){if(!r.addon)return;let o=e.addon?.replace(/[{}]/g,"");if(!o||/disabled/.test(o))return;let n=te("merch-addon",{slot:"addon"},o);[...n.querySelectorAll(Y)].forEach(i=>{let a=i.parentElement;a?.nodeName==="P"&&a.setAttribute("data-plan-type","")}),t.append(n)}function fd(e,t,r){e.addonConfirmation&&ce("addonConfirmation",e,t,r)}function gd(e,t,r,o){e.showStockCheckbox&&r.stockOffer&&(t.setAttribute("checkbox-label",o?.stockCheckboxLabel?o.stockCheckboxLabel:""),t.setAttribute("stock-offer-osis",o?.stockOfferOsis?o.stockOfferOsis:"")),o?.secureLabel&&r?.secureLabel&&t.setAttribute("secure-label",o.secureLabel)}function xd(e,t,r=!0){try{let o=typeof e!="string"?"":e,n=vc(o);if(n.length<=t)return[o,n];let i=0,a=!1,s=r?t-_i.length<1?1:t-_i.length:t,c=[];for(let d of o){if(i++,d==="<")if(a=!0,o[i]==="/")c.pop();else{let p="";for(let m of o.substring(i)){if(m===" "||m===">")break;p+=m}c.push(p)}if(d==="/"&&o[i]===">"&&c.pop(),d===">"){a=!1;continue}if(!a&&(s--,s===0))break}let l=o.substring(0,i).trim();if(c.length>0){c[0]==="p"&&c.shift();for(let d of c.reverse())l+=``}return[`${l}${r?_i:""}`,n]}catch{let n=typeof e=="string"?e:"",i=vc(n);return[n,i]}}function vc(e){if(!e)return"";let t="",r=!1;for(let o of e){if(o==="<"&&(r=!0),o===">"){r=!1;continue}r||(t+=o)}return t}function bd(e,t){t.querySelectorAll("a.upt-link").forEach(o=>{let n=Re.createFrom(o);o.replaceWith(n),n.initializeWcsData(e.osi,e.promoCode)})}function vd(e,t,r,o,n){let i=e;n?i=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML):i.innerHTML=`${i.textContent}`,i.setAttribute("tabindex",0);for(let h of e.attributes)["class","is"].includes(h.name)||i.setAttribute(h.name,h.value);i.firstElementChild?.classList.add("spectrum-Button-label");let a=t.ctas.size??"M",s=`spectrum-Button--${o}`,c=rd.includes(a)?`spectrum-Button--size${a}`:"spectrum-Button--sizeM",l=["spectrum-Button",s,c];return r&&l.push("spectrum-Button--outline"),i.classList.add(...l),i}function yd(e,t,r,o,n){let i=e;n&&(i=customElements.get("checkout-button").createCheckoutButton(e.dataset),i.connectedCallback(),i.render());let a="fill";r&&(a="outline");let s=te("sp-button",{treatment:a,variant:o,tabIndex:0,size:t.ctas.size??"m",...e.dataset.analyticsId&&{"data-analytics-id":e.dataset.analyticsId}},e.innerHTML);return s.source=i,(n?i.onceSettled():Promise.resolve(i)).then(c=>{s.setAttribute("data-navigation-url",c.href)}),s.addEventListener("click",c=>{c.defaultPrevented||i.click()}),s}function Ed(e,t,r){let o=e;return r&&(o=customElements.get("checkout-link").createCheckoutLink(e.dataset,e.innerHTML)),o.classList.add("con-button"),t&&o.classList.add("blue"),o}function Ad(e,t,r,o){if(e.ctas){let{slot:n}=r.ctas,i=te("div",{slot:n},e.ctas),a=[...i.querySelectorAll("a")].map(s=>{let c=s.hasAttribute("data-wcs-osi")&&!!s.getAttribute("data-wcs-osi"),l=Jh.exec(s.className)?.[0]??"accent",h=l.includes("accent"),d=l.includes("primary"),p=l.includes("secondary"),m=l.includes("-outline"),x=l.includes("-link");if(s.classList.remove("accent","primary","secondary"),t.consonant)return Ed(s,h,c);if(x)return s;let f;return h?f="accent":d?f="primary":p&&(f="secondary"),t.spectrum==="swc"?yd(s,r,m,f,c):vd(s,r,m,f,c)});i.innerHTML="",i.append(...a),t.append(i)}}function wd(e,t){let{tags:r}=e,o=r?.find(i=>i.startsWith(ed))?.split("/").pop();if(!o)return;t.setAttribute(Lo,o),[...t.shadowRoot.querySelectorAll("a[data-analytics-id],button[data-analytics-id]"),...t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]")].forEach((i,a)=>{i.setAttribute(td,`${i.dataset.analyticsId}-${a+1}`)})}function _d(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(o=>{o.classList.remove(t),o.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}function Sd(e){e.querySelectorAll("[slot]").forEach(o=>{o.remove()}),e.variant=void 0,["checkbox-label","stock-offer-osis","secure-label","background-image","background-color","border-color","badge-background-color","badge-color","badge-text","gradient-border","size",Lo].forEach(o=>e.removeAttribute(o));let r=["wide-strip","thin-strip"];e.classList.remove(...r)}async function yc(e,t){if(!e){let s=t?.id||"unknown";throw console.error(`hydrate: Fragment is undefined. Cannot hydrate card (merchCard id: ${s}).`),new Error(`hydrate: Fragment is undefined for card (merchCard id: ${s}).`)}if(!e.fields){let s=e.id||"unknown",c=t?.id||"unknown";throw console.error(`hydrate: Fragment for card ID '${s}' (merchCard id: ${c}) is missing 'fields'. Cannot hydrate.`),new Error(`hydrate: Fragment for card ID '${s}' (merchCard id: ${c}) is missing 'fields'.`)}let{id:r,fields:o,settings:n={}}=e,{variant:i}=o;if(!i)throw new Error(`hydrate: no variant found in payload ${r}`);Sd(t),t.settings=n,t.id??(t.id=e.id),t.variant=i,await t.updateComplete;let{aemFragmentMapping:a}=t.variantLayout;if(!a)throw new Error(`hydrate: variant mapping not found for ${r}`);a.style==="consonant"&&t.setAttribute("consonant",!0),od(o,t,a.mnemonics),nd(o,t,a),id(o,t,a),ad(o,t,a.size),sd(o,t,a.title),cd(o,t,a),pd(o,t,a),dd(o,t,a.backgroundImage),ld(o,t,a.allowedColors,a.backgroundColor),hd(o,t,a),md(o,t,a),ud(o,t,a),fd(o,t,a),gd(o,t,a,n),bd(o,t),Ad(o,t,a,i),wd(o,t),_d(t)}var Ti="merch-card",Td=":ready",Cd=":error",Si=2e4,Ro="merch-card:";function Ec(e,t){let r=e.closest(Ti);if(!r)return t;r.variantLayout?.priceOptionsProvider?.(e,t)}function Pd(e){e.providers.has(Ec)||e.providers.price(Ec)}var Ft,st,Se,at,it=class extends M{constructor(){super();P(this,Se);u(this,"customerSegment");u(this,"marketSegment");u(this,"variantLayout");P(this,Ft);P(this,st);u(this,"readyEventDispatched",!1);this.id=null,this.failed=!1,this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this)}firstUpdated(){this.variantLayout=vi(this,!1),this.variantLayout?.connectedCallbackHook(),this.aemFragment?.updateComplete.catch(r=>{le(this,Se,at).call(this,r,{},!1),this.style.display="none"})}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout=vi(this),this.variantLayout.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),r.has("backgroundColor")&&this.style.setProperty("--merch-card-custom-background-color",this.backgroundColor?`var(--${this.backgroundColor})`:"");try{this.variantLayout?.postCardUpdateHook(r)}catch(o){le(this,Se,at).call(this,`Error in postCardUpdateHook: ${o.message}`,{},!1)}}get theme(){return this.closest("sp-theme")}get dir(){return this.closest("[dir]")?.getAttribute("dir")??"ltr"}get prices(){return Array.from(this.querySelectorAll('span[is="inline-price"][data-wcs-osi]'))}render(){if(!(!this.isConnected||!this.variantLayout||this.style.display==="none"))return this.variantLayout.renderLayout()}get computedBorderStyle(){return["ccd-slice","ccd-suggested","ah-promoted-plans"].includes(this.variant)?"":`1px solid ${this.borderColor?this.borderColor:this.badgeBackgroundColor}`}get badgeElement(){return this.shadowRoot.getElementById("badge")}get headingmMSlot(){return this.shadowRoot.querySelector('slot[name="heading-m"]').assignedElements()[0]}get footerSlot(){return this.shadowRoot.querySelector('slot[name="footer"]')?.assignedElements()[0]}get price(){return this.headingmMSlot?.querySelector(Y)}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll(De)??[]]}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let o=this.checkoutLinks;if(o.length!==0)for(let n of o){await n.onceSettled();let i=n.value?.[0]?.planType;if(!i)return;let a=this.stockOfferOsis[i];if(!a)return;let s=n.dataset.wcsOsi.split(",").filter(c=>c!==a);r.checked&&s.push(a),n.dataset.wcsOsi=s.join(",")}}changeHandler(r){r.target.tagName==="MERCH-ADDON"&&this.toggleAddon(r.target)}toggleAddon(r){let o=this.checkoutLinks;if(this.variantLayout?.toggleAddon?.(r),o.length!==0)for(let n of o){let{offerType:i,planType:a}=n.value?.[0];if(!i||!a)return;let s=r.getOsi(a,i),c=n.dataset.wcsOsi.split(",").filter(l=>l!==s);r.checked&&c.push(s),n.dataset.wcsOsi=c.join(",")}}handleQuantitySelection(r){let o=this.checkoutLinks;for(let n of o)n.dataset.quantity=r.detail.option}get titleElement(){return this.querySelector(this.variantLayout?.headingSelector||".card-heading")}get title(){return this.titleElement?.textContent?.trim()}get description(){return this.querySelector('[slot="body-xs"]')?.textContent?.trim()}updateFilters(r){let o={...this.filters};Object.keys(o).forEach(n=>{if(r){o[n].order=Math.min(o[n].order||2,2);return}let i=o[n].order;i===1||isNaN(i)||(o[n].order=Number(i)+1)}),this.filters=o}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){super.connectedCallback(),k(this,st,_t()),Pd(b(this,st)),k(this,Ft,b(this,st).Log.module(Ti)),this.id??(this.id=this.querySelector("aem-fragment")?.getAttribute("fragment")),performance.mark(`${Ro}${this.id}${ke}`),this.addEventListener(me,this.handleQuantitySelection),this.addEventListener(Mr,this.handleAddonAndQuantityUpdate),this.addEventListener(Yt,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.addEventListener(ze,this.handleAemFragmentEvents),this.addEventListener(Be,this.handleAemFragmentEvents),this.addEventListener("change",this.changeHandler),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(me,this.handleQuantitySelection),this.removeEventListener(ze,this.handleAemFragmentEvents),this.removeEventListener(Be,this.handleAemFragmentEvents),this.removeEventListener("change",this.changeHandler),this.removeEventListener(Mr,this.handleAddonAndQuantityUpdate)}async handleAemFragmentEvents(r){if(this.isConnected&&(r.type===ze&&le(this,Se,at).call(this,`AEM fragment cannot be loaded: ${r.detail.message}`,r.detail),r.type===Be&&r.target.nodeName==="AEM-FRAGMENT")){let o=r.detail;yc(o,this).then(()=>this.checkReady()).catch(n=>b(this,Ft).error(n))}}async checkReady(){if(!this.isConnected)return;let r=new Promise(a=>setTimeout(()=>a("timeout"),Si));if(this.aemFragment){let a=await Promise.race([this.aemFragment.updateComplete,r]);if(a===!1){let s=a==="timeout"?`AEM fragment was not resolved within ${Si} timeout`:"AEM fragment cannot be loaded";le(this,Se,at).call(this,s,{},!1);return}}let o=[...this.querySelectorAll(Wt)];o.push(...[...this.querySelectorAll(Io)].map(a=>a.source));let n=Promise.all(o.map(a=>a.onceSettled().catch(()=>a))).then(a=>a.every(s=>s.classList.contains("placeholder-resolved"))),i=await Promise.race([n,r]);if(i===!0)return performance.mark(`${Ro}${this.id}${Td}`),this.readyEventDispatched||(this.readyEventDispatched=!0,this.dispatchEvent(new CustomEvent(Bo,{bubbles:!0,composed:!0}))),this;{let{duration:a,startTime:s}=performance.measure(`${Ro}${this.id}${Cd}`,`${Ro}${this.id}${ke}`),c={duration:a,startTime:s,...b(this,st).duration};i==="timeout"?le(this,Se,at).call(this,`Contains offers that were not resolved within ${Si} timeout`,c):le(this,Se,at).call(this,"Contains unresolved offers",c)}}get aemFragment(){return this.querySelector("aem-fragment")}get addon(){return this.querySelector("merch-addon")}get quantitySelect(){return this.querySelector("merch-quantity-select")}get addonCheckbox(){return this.querySelector("merch-addon")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll(De)).length===2&&r&&r.parentElement.classList.add("footer-column")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||(this.dispatchEvent(new CustomEvent(Ho,{bubbles:!0})),this.displayFooterElementsInColumn())}get dynamicPrice(){return this.querySelector('[slot="price"]')}handleAddonAndQuantityUpdate({detail:{id:r,items:o}}){if(!r||!o?.length)return;let n=this.checkoutLinks.find(l=>l.getAttribute("data-modal-id")===r);if(!n)return;let a=new URL(n.getAttribute("href")).searchParams.get("pa"),s=o.find(l=>l.productArrangementCode===a)?.quantity,c=!!o.find(l=>l.productArrangementCode!==a);if(s&&this.quantitySelect?.dispatchEvent(new CustomEvent(gt,{detail:{quantity:s},bubbles:!0,composed:!0})),this.addonCheckbox?.checked!==c){this.toggleStockOffer({target:this.addonCheckbox});let l=new Event("change",{bubbles:!0,cancelable:!0});Object.defineProperty(l,"target",{writable:!1,value:{checked:c}}),this.addonCheckbox.handleChange(l)}}};Ft=new WeakMap,st=new WeakMap,Se=new WeakSet,at=function(r,o={},n=!0){b(this,Ft).error(`merch-card: ${r}`,o),this.failed=!0,n&&this.dispatchEvent(new CustomEvent(zo,{detail:{...o,message:r},bubbles:!0,composed:!0}))},u(it,"properties",{id:{type:String,attribute:"id",reflect:!0},name:{type:String,attribute:"name",reflect:!0},variant:{type:String,reflect:!0},size:{type:String,attribute:"size",reflect:!0},badgeColor:{type:String,attribute:"badge-color",reflect:!0},borderColor:{type:String,attribute:"border-color",reflect:!0},backgroundColor:{type:String,attribute:"background-color",reflect:!0},badgeBackgroundColor:{type:String,attribute:"badge-background-color",reflect:!0},backgroundImage:{type:String,attribute:"background-image",reflect:!0},badgeText:{type:String,attribute:"badge-text"},actionMenu:{type:Boolean,attribute:"action-menu"},actionMenuLabel:{type:String,attribute:"action-menu-label"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},failed:{type:Boolean,attribute:"failed",reflect:!0},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},addonTitle:{type:String,attribute:"addon-title"},addonOffers:{type:Object,attribute:"addon-offers"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},planType:{type:String,attribute:"plan-type",reflect:!0},settings:{type:Object,attribute:!1},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:r=>{if(!r)return;let[o,n,i]=r.split(",");return{PUF:o,ABM:n,M2M:i}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(o=>{let[n,i,a]=o.split(":"),s=Number(i);return[n,{order:isNaN(s)?void 0:s,size:a}]})),toAttribute:r=>Object.entries(r).map(([o,{order:n,size:i}])=>[o,n,i].filter(a=>a!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:Lo,reflect:!0},loading:{type:String}}),u(it,"styles",[tc,...rc()]),u(it,"registerVariant",q),u(it,"getFragmentMapping",So);customElements.define(Ti,it);var Gt,Or=class extends M{constructor(){super();P(this,Gt);this.defaults={},this.variant="plans"}saveContainerDefaultValues(){let r=this.closest(this.getAttribute("container")),o=r?.querySelector('[slot="description"]:not(merch-offer > *)')?.cloneNode(!0),n=r?.badgeText;return{description:o,badgeText:n}}getSlottedElement(r,o){return(o||this.closest(this.getAttribute("container"))).querySelector(`[slot="${r}"]:not(merch-offer > *)`)}updateSlot(r,o){let n=this.getSlottedElement(r,o);if(!n)return;let i=this.selectedOffer.getOptionValue(r)?this.selectedOffer.getOptionValue(r):this.defaults[r];i&&n.replaceWith(i.cloneNode(!0))}handleOfferSelection(r){let o=r.detail;this.selectOffer(o)}handleOfferSelectionByQuantity(r){let o=r.detail.option,n=Number.parseInt(o),i=this.findAppropriateOffer(n);this.selectOffer(i),this.getSlottedElement("cta").setAttribute("data-quantity",n)}selectOffer(r){if(!r)return;let o=this.selectedOffer;o&&(o.selected=!1),r.selected=!0,this.selectedOffer=r,this.planType=r.planType,this.updateContainer(),this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(Do,{detail:this,bubbles:!0}))})}findAppropriateOffer(r){let o=null;return this.offers.find(i=>{let a=Number.parseInt(i.getAttribute("value"));if(a===r)return!0;if(a>r)return!1;o=i})||o}updateBadgeText(r){this.selectedOffer.badgeText===""?r.badgeText=null:this.selectedOffer.badgeText?r.badgeText=this.selectedOffer.badgeText:r.badgeText=this.defaults.badgeText}updateContainer(){let r=this.closest(this.getAttribute("container"));!r||!this.selectedOffer||(this.updateSlot("cta",r),this.updateSlot("secondary-cta",r),this.updateSlot("price",r),!this.manageableMode&&(this.updateSlot("description",r),this.updateBadgeText(r)))}render(){return g`
`}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.handleFocusin),this.addEventListener("click",this.handleFocusin),this.addEventListener(ft,this.handleOfferSelectReady);let r=this.closest("merch-quantity-select");this.manageableMode=r,this.offers=[...this.querySelectorAll("merch-offer")],k(this,Gt,this.handleOfferSelectionByQuantity.bind(this)),this.manageableMode?r.addEventListener(me,b(this,Gt)):this.defaults=this.saveContainerDefaultValues(),this.selectedOffer=this.offers[0],this.planType&&this.updateContainer()}get miniCompareMobileCard(){return this.merchCard?.variant==="mini-compare-chart"&&this.isMobile}get merchCard(){return this.closest("merch-card")}get isMobile(){return window.matchMedia("(max-width: 767px)").matches}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(me,b(this,Gt)),this.removeEventListener(ft,this.handleOfferSelectReady),this.removeEventListener("focusin",this.handleFocusin),this.removeEventListener("click",this.handleFocusin)}get price(){return this.querySelector('merch-offer[aria-selected] [is="inline-price"]')}get customerSegment(){return this.selectedOffer?.customerSegment}get marketSegment(){return this.selectedOffer?.marketSegment}handleFocusin(r){r.target?.nodeName==="MERCH-OFFER"&&(r.preventDefault(),r.stopImmediatePropagation(),this.selectOffer(r.target))}async handleOfferSelectReady(){this.planType||this.querySelector("merch-offer:not([plan-type])")||(this.planType=this.selectedOffer.planType,await this.updateComplete,this.selectOffer(this.selectedOffer??this.querySelector("merch-offer[aria-selected]")??this.querySelector("merch-offer")),this.dispatchEvent(new CustomEvent(Yt,{bubbles:!0})))}};Gt=new WeakMap,u(Or,"styles",y` :host { display: inline-block; } diff --git a/libs/features/mas/src/hydrate.js b/libs/features/mas/src/hydrate.js index e333f8486e..dbb2565751 100644 --- a/libs/features/mas/src/hydrate.js +++ b/libs/features/mas/src/hydrate.js @@ -65,6 +65,11 @@ export function processMnemonics(fields, merchCard, mnemonicsConfig) { const merchIcon = createTag('merch-icon', attrs); merchCard.append(merchIcon); }); + + const slotIcons = merchCard.shadowRoot.querySelector('slot[name="icons"]'); + if (!mnemonics?.length && slotIcons) { + slotIcons.remove(); + } } function processBadge(fields, merchCard, mapping) { diff --git a/libs/features/mas/src/variants/plans.js b/libs/features/mas/src/variants/plans.js index 14643f6f21..ab020bea09 100644 --- a/libs/features/mas/src/variants/plans.js +++ b/libs/features/mas/src/variants/plans.js @@ -179,8 +179,8 @@ export class Plans extends VariantLayout { } get icons() { - if (!this.card.querySelector('[slot="icons"]')) return ''; - return html``; + if (!this.card.querySelector('[slot="icons"]') && !this.card.getAttribute('id')) return ''; + return html``; } connectedCallbackHook() { From a63425d3942d5c60776e490451654e2bf13f7e7d Mon Sep 17 00:00:00 2001 From: Sino Kholkhojaev <132879006+skholkhojaev@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:09:33 +0200 Subject: [PATCH 07/14] Mwpw 173540 preflight preview publish (#4214) * fix: Preview and Publish column gets hidden because it gets rendered out of viewport * fix: Preflight general Tab now only shows unique links * added a max length to links * fixed the icon not appearing * changed the max-width * re added deleted lines * ignores the CaaS links and does not include it in the final raport * made css more specific & code improvment * Remove unnecessary whitespace in preflight.css * Update grid layout in preflight.css --- libs/blocks/preflight/panels/general.js | 9 ++++++--- libs/blocks/preflight/preflight.css | 10 +++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libs/blocks/preflight/panels/general.js b/libs/blocks/preflight/panels/general.js index 2aa6a3b060..e91fb253b3 100644 --- a/libs/blocks/preflight/panels/general.js +++ b/libs/blocks/preflight/panels/general.js @@ -9,6 +9,7 @@ const NOT_FOUND = { }; const DA_DOMAIN = 'da.live'; const nonEDSContent = 'Non AEM EDS Content'; +const EXCLUDED_PATHS = ['/tools/caas']; const content = signal({}); @@ -69,12 +70,14 @@ function getUrl(el) { } function findLinks(selector) { - const hrefs = []; + const hrefs = new Set(); return [...document.body.querySelectorAll(selector)] .reduce((links, el) => { const url = getUrl(el); - if (!hrefs.includes(url.href)) { - hrefs.push(url.href); + const baseUrl = `${url.origin}${url.pathname}`; + if (EXCLUDED_PATHS.some((path) => url.pathname.includes(path))) return links; + if (!hrefs.has(baseUrl)) { + hrefs.add(baseUrl); links.push({ url, edit: null, preview: 'Fetching', live: 'Fetching' }); } return links; diff --git a/libs/blocks/preflight/preflight.css b/libs/blocks/preflight/preflight.css index 2f0b6e4a11..52745127d1 100644 --- a/libs/blocks/preflight/preflight.css +++ b/libs/blocks/preflight/preflight.css @@ -94,7 +94,7 @@ p.preflight-content-heading-edit { .preflight-group-row { display: grid; - grid-template-columns: 1fr 80px 140px 140px; + grid-template-columns: minmax(0, 1fr) 80px 140px 140px; padding: 12px 24px; align-items: center; } @@ -134,6 +134,14 @@ p.preflight-content-heading-edit { cursor: pointer; } +.preflight-group-row p:first-child a { + display: inline-block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 100%; +} + .preflight-group-row.preflight-group-heading:hover { cursor: pointer; } From ccf1f64183de43443201dead68bd0fbd1080bfba Mon Sep 17 00:00:00 2001 From: Dev Ashish Saradhana <41122199+Deva309@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:39:40 +0530 Subject: [PATCH 08/14] [MWPW-173984] - Added fix for dark theme for promo (#4245) * Added fix for promo in dark mode * Added fix for promo in dark mode * Revert previous commit --------- Co-authored-by: Dev Ashish Sardana --- libs/blocks/global-navigation/dark-nav.css | 40 ++++++++++------------ 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/libs/blocks/global-navigation/dark-nav.css b/libs/blocks/global-navigation/dark-nav.css index 2f6a12a2b5..a322cb63d9 100644 --- a/libs/blocks/global-navigation/dark-nav.css +++ b/libs/blocks/global-navigation/dark-nav.css @@ -213,31 +213,22 @@ header.global-navigation.feds--dark, background: #1b1b1b; } -@media (min-width: 900px) { - .feds--dark .feds-promo { - border: 1px solid var(--feds-borderColor); - background: var(--feds-background-promo); - } - - .feds--dark .feds-promo--dark, - .feds--dark .feds-promo--dark a:not(.feds-cta) { - color: var(--feds-color-headline); - } - - .feds--dark .feds-promo-link { - color: var(--feds-color-blue-link); - } +.feds--dark .feds-promo { + border: 1px solid var(--feds-borderColor); + background: var(--feds-background-promo); +} - .feds--dark .feds-promo-link:hover { - color: var(--feds-color-link--hover); - } +.feds--dark .feds-promo--dark, +.feds--dark .feds-promo--dark a:not(.feds-cta) { + color: var(--feds-color-headline); } -@media (min-width: 1200px) { - .feds--dark .feds-crossCloudMenu-wrapper { - border-top: solid 1px var(--feds-borderColor); - background-color: var(--feds-background-popup); - } +.feds--dark .feds-promo-link { + color: var(--feds-color-blue-link); +} + +.feds--dark .feds-promo-link:hover { + color: var(--feds-color-link--hover); } /* dropdown.css */ @@ -303,4 +294,9 @@ header.global-navigation.feds--dark { .global-footer.feds--dark { background: var(--feds-background-footer--desktop); } + + .feds--dark .feds-crossCloudMenu-wrapper { + border-top: solid 1px var(--feds-borderColor); + background-color: var(--feds-background-popup); + } } From ed9300e4dbd5aed3dc0b7e8f199ec74d962f8566 Mon Sep 17 00:00:00 2001 From: Aishwarya Mathuria Date: Thu, 5 Jun 2025 14:39:47 +0530 Subject: [PATCH 09/14] MWPW-174127 | Accessibility | Set heading role for half height card (#4263) Set heading role for half height card --- libs/blocks/card/card.js | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/blocks/card/card.js b/libs/blocks/card/card.js index 3ce13cc8fd..8a6b6e52a9 100644 --- a/libs/blocks/card/card.js +++ b/libs/blocks/card/card.js @@ -42,6 +42,7 @@ const addInner = (el, cardType, card) => { } if (cardType === HALF_HEIGHT) { + title?.setAttribute('role', 'presentation'); text?.remove(); } From c60e72b8e247730cca9f564152c9fe8d93cfbaf8 Mon Sep 17 00:00:00 2001 From: Megan Thomas Date: Thu, 5 Jun 2025 02:09:54 -0700 Subject: [PATCH 10/14] MWPW-168547 Fix autofill on Marketo multi-step form (#4267) * MWPW-168547 Fix autofill on Marketo multi-step form * descriptive time variable --- libs/blocks/marketo/marketo-multi.js | 26 +++++++++++++++++--- libs/blocks/marketo/marketo.css | 21 ++++++++++++++-- test/blocks/marketo/marketo-multi.test.js | 30 ++++++++++++++++++++++- 3 files changed, 71 insertions(+), 6 deletions(-) diff --git a/libs/blocks/marketo/marketo-multi.js b/libs/blocks/marketo/marketo-multi.js index 27aa613ef6..d925350c00 100644 --- a/libs/blocks/marketo/marketo-multi.js +++ b/libs/blocks/marketo/marketo-multi.js @@ -13,6 +13,18 @@ const VALIDATION_STEP = { mktoFormsCompanyType: '3', }; +export function updateTabIndex(formEl, stepToAdd, stepToRemove) { + const fieldsToAdd = formEl.querySelectorAll(`.mktoFormRowTop[data-validate="${stepToAdd}"]:not(.mktoHidden) input, + .mktoFormRowTop[data-validate="${stepToAdd}"]:not(.mktoHidden) select, + .mktoFormRowTop[data-validate="${stepToAdd}"]:not(.mktoHidden) textarea`); + fieldsToAdd.forEach((f) => { f.tabIndex = 0; }); + + const fieldsToRemove = formEl.querySelectorAll(`.mktoFormRowTop[data-validate="${stepToRemove}"]:not(.mktoHidden) input, + .mktoFormRowTop[data-validate="${stepToRemove}"]:not(.mktoHidden) select, + .mktoFormRowTop[data-validate="${stepToRemove}"]:not(.mktoHidden) textarea`); + fieldsToRemove.forEach((f) => { f.tabIndex = -1; }); +} + function updateStepDetails(formEl, step, totalSteps) { formEl.classList.add('hide-errors'); formEl.classList.remove('show-warnings'); @@ -31,6 +43,7 @@ function showPreviousStep(formEl, totalSteps) { const backBtn = formEl.querySelector('.back-btn'); updateStepDetails(formEl, previousStep, totalSteps); + updateTabIndex(formEl, previousStep, currentStep); if (previousStep === 1) backBtn?.remove(); } @@ -46,6 +59,7 @@ const showNextStep = (formEl, currentStep, totalSteps) => { } updateStepDetails(formEl, nextStep, totalSteps); + updateTabIndex(formEl, nextStep, currentStep); }; export const formValidate = (formEl) => { @@ -61,11 +75,13 @@ export const formValidate = (formEl) => { return currentStep === totalSteps; }; -function setValidationSteps(formEl, totalSteps) { +function setValidationSteps(formEl, totalSteps, currentStep) { formEl.querySelectorAll('.mktoFormRowTop').forEach((row) => { const rowAttr = row.getAttribute('data-mktofield') || row.getAttribute('data-mkto_vis_src'); const step = VALIDATION_STEP[rowAttr] ? Math.min(VALIDATION_STEP[rowAttr], totalSteps) : 1; row.dataset.validate = rowAttr?.startsWith('adobe-privacy') ? totalSteps : step; + const fields = row.querySelectorAll('input, select, textarea'); + if (fields.length) fields.forEach((f) => { f.tabIndex = step === currentStep ? 0 : -1; }); }); } @@ -74,7 +90,7 @@ function onRender(formEl, totalSteps) { const submitButton = formEl.querySelector('#mktoButton_new'); submitButton?.classList.toggle('mktoHidden', currentStep !== totalSteps); formEl.querySelector('.step-details .step').textContent = `Step ${currentStep} of ${totalSteps}`; - setValidationSteps(formEl, totalSteps); + setValidationSteps(formEl, totalSteps, currentStep); } const readyForm = (form, totalSteps) => { @@ -88,9 +104,13 @@ const readyForm = (form, totalSteps) => { const stepDetails = createTag('div', { class: 'step-details' }, stepEl); formEl.append(nextContainer, stepDetails); - const debouncedOnRender = debounce(() => onRender(formEl, totalSteps), 10); + const debouncedOnRender = debounce(() => onRender(formEl, totalSteps), 50); const observer = new MutationObserver(debouncedOnRender); + const fieldLoadTimeOnSlowDevice = 12000; observer.observe(formEl, { childList: true, subtree: true }); + setTimeout(() => { + observer.disconnect(); + }, fieldLoadTimeOnSlowDevice); debouncedOnRender(); }; diff --git a/libs/blocks/marketo/marketo.css b/libs/blocks/marketo/marketo.css index f9c2b4cd29..b21790be1a 100644 --- a/libs/blocks/marketo/marketo.css +++ b/libs/blocks/marketo/marketo.css @@ -91,21 +91,35 @@ .marketo .mktoFormRowTop { display: contents; + visibility: visible; + position: static; + pointer-events: auto; } .marketo.multi-step .mktoFormRow.mktoFormRowTop[data-validate="2"], .marketo.multi-step .mktoFormRow.mktoFormRowTop[data-validate="3"] { - display: none; + display: block; + visibility: hidden; + position: absolute; + left: -100000px; + pointer-events: none; } .marketo.multi-step .mktoForm[data-step="2"] .mktoFormRow.mktoFormRowTop[data-validate="2"], .marketo.multi-step .mktoForm[data-step="3"] .mktoFormRow.mktoFormRowTop[data-validate="3"] { display: contents; + visibility: visible; + position: static; + pointer-events: auto; } .marketo.multi-step .mktoForm[data-step="2"] .mktoFormRow.mktoFormRowTop[data-validate="1"], .marketo.multi-step .mktoForm[data-step="3"] .mktoFormRow.mktoFormRowTop[data-validate="1"] { - display: none; + display: block; + visibility: hidden; + position: absolute; + left: -100000px; + pointer-events: none; } .marketo.multi-step .mktoForm[data-step="1"] .mktoFormRow.mktoFormRowTop.adobe-privacy, @@ -116,6 +130,9 @@ .marketo.multi-step .mktoForm[data-step="3"] .mktoFormRow.mktoFormRowTop.adobe-privacy, .marketo.multi-step.multi-2 .mktoForm[data-step="2"] .mktoFormRow.mktoFormRowTop.adobe-privacy { display: grid; + visibility: visible; + position: static; + pointer-events: auto; } .marketo.multi-step .step-details { diff --git a/test/blocks/marketo/marketo-multi.test.js b/test/blocks/marketo/marketo-multi.test.js index 68a9ff9683..439a1ba217 100644 --- a/test/blocks/marketo/marketo-multi.test.js +++ b/test/blocks/marketo/marketo-multi.test.js @@ -1,7 +1,7 @@ import { readFile } from '@web/test-runner-commands'; import { expect } from '@esm-bundle/chai'; import sinon, { stub } from 'sinon'; -import init, { formValidate } from '../../../libs/blocks/marketo/marketo-multi.js'; +import init, { formValidate, updateTabIndex } from '../../../libs/blocks/marketo/marketo-multi.js'; const innerHTML = await readFile({ path: './mocks/multi-step-2.html' }); @@ -75,4 +75,32 @@ describe('marketo multi-step', () => { expect(formEl.querySelector('.back-btn')).to.be.null; expect(formEl.querySelector('.step-details .step').textContent).to.equal('Step 1 of 2'); }); + + it('sets initial tabindex for fields', () => { + const formEl = document.querySelector('form'); + const step1Field = formEl.querySelector('.mktoFormRowTop[data-validate="1"] input'); + const step2Field = formEl.querySelector('.mktoFormRowTop[data-validate="2"] input'); + expect(step1Field.tabIndex).to.equal(0); + expect(step2Field.tabIndex).to.equal(-1); + }); + + it('updates tabindex when switching steps', () => { + const formEl = document.querySelector('form'); + const step1Field = formEl.querySelector('.mktoFormRowTop[data-validate="1"] input'); + const step2Field = formEl.querySelector('.mktoFormRowTop[data-validate="2"] input'); + + // Initial state + expect(step1Field.tabIndex).to.equal(0); + expect(step2Field.tabIndex).to.equal(-1); + + // Switch to step 2 + updateTabIndex(formEl, 2, 1); + expect(step1Field.tabIndex).to.equal(-1); + expect(step2Field.tabIndex).to.equal(0); + + // Switch back to step 1 + updateTabIndex(formEl, 1, 2); + expect(step1Field.tabIndex).to.equal(0); + expect(step2Field.tabIndex).to.equal(-1); + }); }); From f03485eb1f0f574363cf0754c8a52c17b1090fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Kosanovi=C4=87?= Date: Thu, 5 Jun 2025 11:10:02 +0200 Subject: [PATCH 11/14] [MWPW-171655] - table icon missalignement fix (#4270) --- libs/blocks/table/table.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/blocks/table/table.css b/libs/blocks/table/table.css index f6187b621e..a53370ae04 100644 --- a/libs/blocks/table/table.css +++ b/libs/blocks/table/table.css @@ -82,6 +82,10 @@ margin-right: 8px; } +.table .col picture { + display: flex; +} + .section.table-section, .section.table-merch-section { background: var(--color-white); From 833de5c90b21e4a44a1f06abc975dd386181ea45 Mon Sep 17 00:00:00 2001 From: Dev Ashish Saradhana <41122199+Deva309@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:40:09 +0530 Subject: [PATCH 12/14] [MWPW-174313] - Added missing parent role for localnav A11Y (#4285) Added missing parent role for localnav A11Y Co-authored-by: Dev Ashish Sardana --- libs/blocks/global-navigation/global-navigation.js | 2 +- libs/blocks/global-navigation/utilities/utilities.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index 6fcd200a71..f701a720cb 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -513,7 +513,7 @@ class Gnav { const localNavBtn = toFragment``; const localNavCurtain = toFragment`
`; // Skip keyboard navigation on localnav items if it is closed - localNav.append(localNavBtn, localNavCurtain, toFragment`
`, toFragment`.`); + localNav.append(localNavBtn, localNavCurtain, toFragment`
`, toFragment`.`); const itemWrapper = localNav.querySelector('.feds-localnav-items'); const localNavTitle = document.querySelector('.feds-localnav-title'); diff --git a/libs/blocks/global-navigation/utilities/utilities.js b/libs/blocks/global-navigation/utilities/utilities.js index 45bd5bb489..86ec4a8c51 100644 --- a/libs/blocks/global-navigation/utilities/utilities.js +++ b/libs/blocks/global-navigation/utilities/utilities.js @@ -381,7 +381,6 @@ export function closeAllDropdowns({ if (animatedElement && animationType) { animatedElement.addEventListener(`${animationType}end`, closeAllOpenElements, { once: true }); - animatedElement.setAttribute('aria-expanded', 'false'); } else { closeAllOpenElements(); } From 32a8d3e5e20e64a9b20db569eea2b611ce2ff30e Mon Sep 17 00:00:00 2001 From: Ratko Zagorac <90400759+zagi25@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:11:39 +0200 Subject: [PATCH 13/14] MWPW-170541: Add support for rtl (#4307) * MWPW-170541: Add support for rtl * MWPW-170541: PR feedback --- libs/blocks/action-scroller/action-scroller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/blocks/action-scroller/action-scroller.js b/libs/blocks/action-scroller/action-scroller.js index 9532d7c5df..5a5ba4cb6b 100644 --- a/libs/blocks/action-scroller/action-scroller.js +++ b/libs/blocks/action-scroller/action-scroller.js @@ -49,7 +49,8 @@ export function hideNavigation(el) { const elHasWidth = !!el.clientWidth; const scrollWidth = itemWidth * columns + gridGap * (columns - 1) + 2 * padding; const screenWidth = window.innerWidth < 1200 ? window.innerWidth : 1200; - const horizontalScroll = Math.ceil(el.scrollLeft) === Math.ceil(el.scrollWidth - el.clientWidth); + const scrollLeft = Math.ceil(Math.abs(el.scrollLeft)); + const horizontalScroll = scrollLeft === Math.ceil(el.scrollWidth - el.clientWidth); return elHasWidth ? horizontalScroll : scrollWidth < screenWidth; } @@ -89,9 +90,10 @@ function handleBtnState( } function handleNavigation(el) { + const isRtl = document.documentElement.dir === 'rtl'; const prev = createTag('div', { class: 'nav-grad previous' }, PREVBUTTON); const next = createTag('div', { class: 'nav-grad next' }, NEXTBUTTON); - const buttons = [prev, next]; + const buttons = isRtl ? [next, prev] : [prev, next]; buttons.forEach((btn) => { const button = btn.childNodes[0]; button.addEventListener('click', () => handleScroll(el, button.classList)); From 37843922a197517355103f98e729cbbd1a917324 Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Thu, 5 Jun 2025 05:40:38 -0600 Subject: [PATCH 14/14] Revert "Using productCode instead productFamily." (#4325) Revert "Using productCode instead productFamily. (#4291)" This reverts commit ac6cca97f24d25bf7df345df49838e62f30e0b01. --- libs/blocks/merch/merch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/blocks/merch/merch.js b/libs/blocks/merch/merch.js index c693d9ead0..f12d91c828 100644 --- a/libs/blocks/merch/merch.js +++ b/libs/blocks/merch/merch.js @@ -842,17 +842,17 @@ export async function buildCta(el, params) { }); } - // Adding aria-label for checkout-link using productCode and customerSegment as placeholder key. + // Adding aria-label for checkout-link using productFamily and customerSegment as placeholder key. if (el.ariaLabel) { // If Milo aria-label available from sharepoint doc, just use it. cta.setAttribute('aria-label', el.ariaLabel); } else if (!cta.ariaLabel) { cta.onceSettled().then(async () => { - const productCode = cta.value[0]?.productArrangement?.productCode; + const productFamily = cta.value[0]?.productArrangement?.productFamily; const { marketSegment, customerSegment } = cta; const segment = marketSegment === 'EDU' ? marketSegment : customerSegment; let ariaLabel = cta.textContent; - ariaLabel = productCode ? `${ariaLabel} - ${await replaceKey(productCode, getConfig())}` : ariaLabel; + ariaLabel = productFamily ? `${ariaLabel} - ${await replaceKey(productFamily, getConfig())}` : ariaLabel; ariaLabel = segment ? `${ariaLabel} - ${await replaceKey(segment, getConfig())}` : ariaLabel; cta.setAttribute('aria-label', ariaLabel); });