From 55d78dcbf6d77bd0256037c3f0cbd39176c921fa Mon Sep 17 00:00:00 2001 From: Raghav Sharma <118168183+sharmrj@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:04:24 +0530 Subject: [PATCH 01/10] MWPW-161639 Removed a workflow that's no longer necessary (#3211) Removed a workflow that's no longer necessary --- .github/workflows/check-feds-files.js | 64 ------------------------- .github/workflows/check-feds-files.yaml | 25 ---------- 2 files changed, 89 deletions(-) delete mode 100644 .github/workflows/check-feds-files.js delete mode 100644 .github/workflows/check-feds-files.yaml diff --git a/.github/workflows/check-feds-files.js b/.github/workflows/check-feds-files.js deleted file mode 100644 index 4b84020a4b..0000000000 --- a/.github/workflows/check-feds-files.js +++ /dev/null @@ -1,64 +0,0 @@ -const { slackNotification, getLocalConfigs } = require('./helpers.js'); - -const fedsFolders = [ - 'libs/blocks/global-navigation', - 'libs/blocks/global-footer', - 'libs/blocks/modal', - 'libs/navigation', - 'libs/scripts/delayed', - 'libs/utils/utils', - 'libs/utils/locales', - 'libs/utils/federated', - 'libs/martech/attributes', -]; - -const safely = (fn) => { - return (...args) => { - try { - fn(...args); - } catch (e) { - console.error(e); - } - }; -} - -const main = safely(async ({ github, context }) => { - const number = context.issue?.number || process.env.ISSUE; - const owner = context.repo.owner; - const repo = context.repo.repo; - const { data: files } = await github.rest.pulls.listFiles({ - owner, - repo, - pull_number: number, - }); - - const affectedFedsFiles = files - .map(({ filename }) => filename) - .filter(filename => fedsFolders.some(x => filename.startsWith(x))); - - const message = `> PR affects:\n> \`\`\`${affectedFedsFiles.join('\n')}\`\`\``; - const webhook = process.env.FEDS_WATCH_HOOK; - - if (!affectedFedsFiles.length) { - console.log("No affected Feds Files. Exiting"); - return; - } - slackNotification(message, webhook) - .then((resp) => { - if (resp.ok) console.log('message posted on slack'); - else throw new Error(resp); - }) - .catch(console.error); -}); - -if (process.env.LOCAL_RUN) { - const { github, context } = getLocalConfigs(); - main({ - github, - context, - }); -} - - - -module.exports = main diff --git a/.github/workflows/check-feds-files.yaml b/.github/workflows/check-feds-files.yaml deleted file mode 100644 index 7c4d3db821..0000000000 --- a/.github/workflows/check-feds-files.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: Feds File Watch - -on: - pull_request_target: - types: [opened, labeled] - -env: - FEDS_WATCH_HOOK: ${{ secrets.FEDS_WATCH_HOOK }} - -jobs: - send_alert: - if: github.repository_owner == 'adobecom' - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.ref }} - - - name: Send Slack messages if a PR contains feds related files. - uses: actions/github-script@v7 - with: - script: | - const main = require('./.github/workflows/check-feds-files.js') - main({ github, context }) From 4e7c9969b411e07a3043480a510101d7f205c969 Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:34:31 +0200 Subject: [PATCH 02/10] [MWPW-165978] Make codecov tests more reliable (#3588) * codecov test changes * hotfix * hotfix --- codecov.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codecov.yaml b/codecov.yaml index fe402a2177..1a77e99654 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -3,8 +3,11 @@ coverage: patch: default: target: 90% - threshold: 0.1% + threshold: 0.5% project: default: target: auto - threshold: 0.1% + threshold: 0.5% + ignore: + - "!libs/" + - "libs/deps/" From fc51d091d1b48b75797558382207d966ade163e2 Mon Sep 17 00:00:00 2001 From: Sean Choi Date: Mon, 3 Feb 2025 03:34:39 -0700 Subject: [PATCH 03/10] MWPW-166640: Fixing action-menu focusable in merch-card (#3557) * Bring the tabIndex back for each card in card collection. * Moving focusable action-item logic into block/merch-card.js * bring the hide action menu content on focusOut back. * Unit test update. --- libs/blocks/merch-card/merch-card.js | 11 +++++ libs/deps/mas/mas.js | 4 +- libs/deps/mas/merch-card.js | 18 ++++---- libs/features/mas/dist/mas.js | 4 +- libs/features/mas/src/variants/catalog.js | 12 ------ .../mas/test/merch-card.catalog.test.html.js | 1 - test/blocks/merch-card/merch-card.test.js | 17 ++++++++ .../mocks/catalog-action-menu-only.html | 43 +++++++++++++++++++ 8 files changed, 84 insertions(+), 26 deletions(-) create mode 100644 test/blocks/merch-card/mocks/catalog-action-menu-only.html diff --git a/libs/blocks/merch-card/merch-card.js b/libs/blocks/merch-card/merch-card.js index c6db91be91..bfc4b327fe 100644 --- a/libs/blocks/merch-card/merch-card.js +++ b/libs/blocks/merch-card/merch-card.js @@ -626,6 +626,17 @@ export default async function init(el) { actionMenuContent.innerHTML, ), ); + merchCard.addEventListener('focusin', () => { + const actionMenu = merchCard.shadowRoot.querySelector('.action-menu'); + actionMenu.classList.add('always-visible'); + }); + merchCard.addEventListener('focusout', (e) => { + if (!e.target.href || e.target.src || e.target.parentElement.classList.contains('card-heading')) { + return; + } + const actionMenu = merchCard.shadowRoot.querySelector('.action-menu'); + actionMenu.classList.remove('always-visible'); + }); } let ctas = el.querySelector('p > strong a, p > em a')?.closest('p'); if (!ctas) { diff --git a/libs/deps/mas/mas.js b/libs/deps/mas/mas.js index ff69a700fc..eb07d00c36 100644 --- a/libs/deps/mas/mas.js +++ b/libs/deps/mas/mas.js @@ -349,7 +349,7 @@ merch-card[variant="catalog"] .payment-details { font-style: italic; font-weight: 400; line-height: var(--consonant-merch-card-body-line-height); -}`;var jn={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"}},nt=class extends I{constructor(r){super(r);p(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(kn,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});p(this,"toggleActionMenu",r=>{if(!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter")return;r.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let n=this.actionMenuContentSlot.classList.contains("hidden");n||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!n).toString())});p(this,"toggleActionMenuFromCard",r=>{let n=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(n||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",n),this.setAriaExpanded(this.actionMenu,"false"))});p(this,"hideActionMenu",r=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")});p(this,"focusEventHandler",r=>{this.actionMenu&&(this.actionMenu.classList.add("always-visible"),(r.relatedTarget?.nodeName==="MERCH-CARD-COLLECTION"||r.relatedTarget?.nodeName==="MERCH-CARD"&&r.target.nodeName!=="MERCH-ICON")&&this.actionMenu.classList.remove("always-visible"))})}get aemFragmentMapping(){return jn}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return x`
+}`;var jn={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"}},nt=class extends I{constructor(r){super(r);p(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(kn,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});p(this,"toggleActionMenu",r=>{if(!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter")return;r.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let n=this.actionMenuContentSlot.classList.contains("hidden");n||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!n).toString())});p(this,"toggleActionMenuFromCard",r=>{let n=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(n||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",n),this.setAriaExpanded(this.actionMenu,"false"))});p(this,"hideActionMenu",r=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")})}get aemFragmentMapping(){return jn}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return x`
${this.badge}
`:""}
${this.secureLabelFooter} - `}getGlobalCSS(){return Fo}setAriaExpanded(r,n){r.setAttribute("aria-expanded",n)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.addEventListener("focusout",this.focusEventHandler)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.removeEventListener("focusout",this.focusEventHandler)}};p(nt,"variantStyle",C` + `}getGlobalCSS(){return Fo}setAriaExpanded(r,n){r.setAttribute("aria-expanded",n)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard)}};p(nt,"variantStyle",C` :host([variant='catalog']) { min-height: 330px; width: var(--consonant-merch-card-catalog-width); diff --git a/libs/deps/mas/merch-card.js b/libs/deps/mas/merch-card.js index c05b8979b1..58c43f6604 100644 --- a/libs/deps/mas/merch-card.js +++ b/libs/deps/mas/merch-card.js @@ -288,7 +288,7 @@ var Eo=Object.defineProperty;var mr=e=>{throw TypeError(e)};var wo=(e,t,r)=>t 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 t=this.card.secureLabel?Ue`${this.card.secureLabel}`:"";return Ue`
${t}
`}async adjustTitleWidth(){let t=this.card.getBoundingClientRect().width,r=this.card.badgeElement?.getBoundingClientRect().width||0;t===0||r===0||this.card.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(t-r-16)}px`)}postCardUpdateHook(){}connectedCallbackHook(){}disconnectedCallbackHook(){}renderLayout(){}get aemFragmentMapping(){}};ne=new WeakMap,p(ve,"styleMap",{});var S=ve;import{html as xt,css as To}from"../lit-all.min.js";function k(e,t={},r=null,n=null){let o=n?document.createElement(e,{is:n}):document.createElement(e);r instanceof HTMLElement?o.appendChild(r):o.innerHTML=r;for(let[i,a]of Object.entries(t))o.setAttribute(i,a);return o}function Ge(){return window.matchMedia("(max-width: 767px)").matches}function br(){return window.matchMedia("(max-width: 1024px)").matches}var ut="wcms:commerce:ready";var vr="merch-offer-select:ready",yr="merch-card:ready",Er="merch-card:action-menu-toggle";var pt="merch-storage:change",ft="merch-quantity-selector:change";var ze="aem:load",Fe="aem:error",wr="mas:ready",Sr="mas:error",Ar="placeholder-failed",Tr="placeholder-pending",_r="placeholder-resolved";var Lr="mas:failed",Cr="mas:resolved",Pr="mas/commerce";var F="failed",Y="pending",$="resolved",gt={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"};var Nr=` + >`:"";return Ue`
${t}
`}async adjustTitleWidth(){let t=this.card.getBoundingClientRect().width,r=this.card.badgeElement?.getBoundingClientRect().width||0;t===0||r===0||this.card.style.setProperty("--consonant-merch-card-heading-xs-max-width",`${Math.round(t-r-16)}px`)}postCardUpdateHook(){}connectedCallbackHook(){}disconnectedCallbackHook(){}renderLayout(){}get aemFragmentMapping(){}};ne=new WeakMap,p(ve,"styleMap",{});var S=ve;import{html as xt,css as To}from"../lit-all.min.js";function k(e,t={},r=null,n=null){let o=n?document.createElement(e,{is:n}):document.createElement(e);r instanceof HTMLElement?o.appendChild(r):o.innerHTML=r;for(let[i,a]of Object.entries(t))o.setAttribute(i,a);return o}function Ge(){return window.matchMedia("(max-width: 767px)").matches}function br(){return window.matchMedia("(max-width: 1024px)").matches}var ut="wcms:commerce:ready";var vr="merch-offer-select:ready",yr="merch-card:ready",Er="merch-card:action-menu-toggle";var pt="merch-storage:change",ft="merch-quantity-selector:change";var ze="aem:load",Fe="aem:error",wr="mas:ready",Sr="mas:error",Ar="placeholder-failed",Tr="placeholder-pending",_r="placeholder-resolved";var Lr="mas:failed",Pr="mas:resolved",Cr="mas/commerce";var F="failed",Y="pending",$="resolved",gt={DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"};var Nr=` :root { --consonant-merch-card-catalog-width: 276px; --consonant-merch-card-catalog-icon-size: 40px; @@ -374,7 +374,7 @@ merch-card[variant="catalog"] .payment-details { font-style: italic; font-weight: 400; line-height: var(--consonant-merch-card-body-line-height); -}`;var bt={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"}},oe=class extends S{constructor(r){super(r);p(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(Er,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});p(this,"toggleActionMenu",r=>{if(!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter")return;r.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let n=this.actionMenuContentSlot.classList.contains("hidden");n||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!n).toString())});p(this,"toggleActionMenuFromCard",r=>{let n=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(n||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",n),this.setAriaExpanded(this.actionMenu,"false"))});p(this,"hideActionMenu",r=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")});p(this,"focusEventHandler",r=>{this.actionMenu&&(this.actionMenu.classList.add("always-visible"),(r.relatedTarget?.nodeName==="MERCH-CARD-COLLECTION"||r.relatedTarget?.nodeName==="MERCH-CARD"&&r.target.nodeName!=="MERCH-ICON")&&this.actionMenu.classList.remove("always-visible"))})}get aemFragmentMapping(){return bt}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return xt`
+}`;var bt={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"}},oe=class extends S{constructor(r){super(r);p(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(Er,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});p(this,"toggleActionMenu",r=>{if(!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter")return;r.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let n=this.actionMenuContentSlot.classList.contains("hidden");n||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!n).toString())});p(this,"toggleActionMenuFromCard",r=>{let n=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(n||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",n),this.setAriaExpanded(this.actionMenu,"false"))});p(this,"hideActionMenu",r=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")})}get aemFragmentMapping(){return bt}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return xt`
${this.badge}
`:""}
${this.secureLabelFooter} - `}getGlobalCSS(){return Nr}setAriaExpanded(r,n){r.setAttribute("aria-expanded",n)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.addEventListener("focusout",this.focusEventHandler)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.removeEventListener("focusout",this.focusEventHandler)}};p(oe,"variantStyle",To` + `}getGlobalCSS(){return Nr}setAriaExpanded(r,n){r.setAttribute("aria-expanded",n)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard)}};p(oe,"variantStyle",To` :host([variant='catalog']) { min-height: 330px; width: var(--consonant-merch-card-catalog-width); @@ -958,7 +958,7 @@ merch-card .footer-row-cell:nth-child(8) { :host([variant='mini-compare-chart']) slot[name='footer-rows'] { justify-content: flex-start; } - `);import{html as je,css as Co}from"../lit-all.min.js";var kr=` + `);import{html as je,css as Po}from"../lit-all.min.js";var kr=` :root { --consonant-merch-card-plans-width: 300px; --consonant-merch-card-plans-icon-size: 40px; @@ -1028,7 +1028,7 @@ merch-card[variant="plans"] [slot="quantity-select"] { ${this.stockCheckbox}
- ${this.secureLabelFooter}`}};p(se,"variantStyle",Co` + ${this.secureLabelFooter}`}};p(se,"variantStyle",Po` :host([variant='plans']) { min-height: 348px; } @@ -1036,7 +1036,7 @@ merch-card[variant="plans"] [slot="quantity-select"] { :host([variant='plans']) ::slotted([slot='heading-xs']) { max-width: var(--consonant-merch-card-heading-xs-max-width, 100%); } - `);import{html as vt,css as Po}from"../lit-all.min.js";var Br=` + `);import{html as vt,css as Co}from"../lit-all.min.js";var Br=` :root { --consonant-merch-card-product-width: 300px; } @@ -1084,7 +1084,7 @@ merch-card[variant="plans"] [slot="quantity-select"] {
- ${this.secureLabelFooter}`}connectedCallbackHook(){window.addEventListener("resize",this.postCardUpdateHook)}disconnectedCallbackHook(){window.removeEventListener("resize",this.postCardUpdateHook)}postCardUpdateHook(){this.card.isConnected&&(Ge()||this.adjustProductBodySlots(),this.adjustTitleWidth())}};p(W,"variantStyle",Po` + ${this.secureLabelFooter}`}connectedCallbackHook(){window.addEventListener("resize",this.postCardUpdateHook)}disconnectedCallbackHook(){window.removeEventListener("resize",this.postCardUpdateHook)}postCardUpdateHook(){this.card.isConnected&&(Ge()||this.adjustProductBodySlots(),this.adjustTitleWidth())}};p(W,"variantStyle",Co` :host([variant='product']) > slot:not([name='icons']) { display: block; } @@ -2133,6 +2133,6 @@ merch-sidenav-checkbox-group h3 { margin: 0px; } -`;document.head.appendChild(jr);var Ee;(function(e){e.V2="UCv2",e.V3="UCv3"})(Ee||(Ee={}));var we;(function(e){e.CHECKOUT="checkout",e.CHECKOUT_EMAIL="checkout/email",e.SEGMENTATION="segmentation",e.BUNDLE="bundle",e.COMMITMENT="commitment",e.RECOMMENDATION="recommendation",e.EMAIL="email",e.PAYMENT="payment",e.CHANGE_PLAN_TEAM_PLANS="change-plan/team-upgrade/plans",e.CHANGE_PLAN_TEAM_PAYMENT="change-plan/team-upgrade/payment"})(we||(we={}));var _t;(function(e){e.BASE="BASE",e.TRIAL="TRIAL",e.PROMOTION="PROMOTION"})(_t||(_t={}));var P;(function(e){e.MONTH="MONTH",e.YEAR="YEAR",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.PERPETUAL="PERPETUAL",e.TERM_LICENSE="TERM_LICENSE",e.ACCESS_PASS="ACCESS_PASS",e.THREE_MONTHS="THREE_MONTHS",e.SIX_MONTHS="SIX_MONTHS"})(P||(P={}));var _;(function(e){e.ANNUAL="ANNUAL",e.MONTHLY="MONTHLY",e.TWO_YEARS="TWO_YEARS",e.THREE_YEARS="THREE_YEARS",e.P1D="P1D",e.P1Y="P1Y",e.P3Y="P3Y",e.P10Y="P10Y",e.P15Y="P15Y",e.P3D="P3D",e.P7D="P7D",e.P30D="P30D",e.HALF_YEARLY="HALF_YEARLY",e.QUARTERLY="QUARTERLY"})(_||(_={}));var Lt;(function(e){e.INDIVIDUAL="INDIVIDUAL",e.TEAM="TEAM",e.ENTERPRISE="ENTERPRISE"})(Lt||(Lt={}));var Ct;(function(e){e.COM="COM",e.EDU="EDU",e.GOV="GOV"})(Ct||(Ct={}));var Pt;(function(e){e.DIRECT="DIRECT",e.INDIRECT="INDIRECT"})(Pt||(Pt={}));var Nt;(function(e){e.ENTERPRISE_PRODUCT="ENTERPRISE_PRODUCT",e.ETLA="ETLA",e.RETAIL="RETAIL",e.VIP="VIP",e.VIPMP="VIPMP",e.FREE="FREE"})(Nt||(Nt={}));var Yr="tacocat.js";var Wr=e=>`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function ue(e,t={},{metadata:r=!0,search:n=!0,storage:o=!0}={}){let i;if(n&&i==null){let a=new URLSearchParams(window.location.search),s=Se(n)?n:e;i=a.get(s)}if(o&&i==null){let a=Se(o)?o:e;i=window.sessionStorage.getItem(a)??window.localStorage.getItem(a)}if(r&&i==null){let a=Do(Se(r)?r:e);i=document.documentElement.querySelector(`meta[name="${a}"]`)?.content}return i??t[e]}var pe=()=>{};var qr=e=>typeof e=="boolean",Ae=e=>typeof e=="function",Rt=e=>typeof e=="number",Xr=e=>e!=null&&typeof e=="object";var Se=e=>typeof e=="string";var Te=e=>Rt(e)&&Number.isFinite(e)&&e>0;function O(e,t){if(qr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Do(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}var Uo=Date.now(),Ot=()=>`(+${Date.now()-Uo}ms)`,Ye=new Set,Go=O(ue("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Kr(e){let t=`[${Yr}/${e}]`,r=(a,s,...c)=>a?!0:(o(s,...c),!1),n=Go?(a,...s)=>{console.debug(`${t} ${a}`,...s,Ot())}:()=>{},o=(a,...s)=>{let c=`${t} ${a}`;Ye.forEach(([l])=>l(c,...s))};return{assert:r,debug:n,error:o,warn:(a,...s)=>{let c=`${t} ${a}`;Ye.forEach(([,l])=>l(c,...s))}}}function zo(e,t){let r=[e,t];return Ye.add(r),()=>{Ye.delete(r)}}zo((e,...t)=>{console.error(e,...t,Ot())},(e,...t)=>{console.warn(e,...t,Ot())});var Zr="ABM",Qr="PUF",Jr="M2M",en="PERPETUAL",tn="P3Y",Fo="TAX_INCLUSIVE_DETAILS",$o="TAX_EXCLUSIVE",rn={ABM:Zr,PUF:Qr,M2M:Jr,PERPETUAL:en,P3Y:tn},sh={[Zr]:{commitment:P.YEAR,term:_.MONTHLY},[Qr]:{commitment:P.YEAR,term:_.ANNUAL},[Jr]:{commitment:P.MONTH,term:_.MONTHLY},[en]:{commitment:P.PERPETUAL,term:void 0},[tn]:{commitment:P.THREE_MONTHS,term:_.P3Y}};function Mt(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:o,priceWithoutDiscountAndTax:i,taxDisplay:a}=t;if(a!==Fo)return e;let s={...e,priceDetails:{...t,price:o??r,priceWithoutDiscount:i??n,taxDisplay:$o}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var Ht=function(e,t){return Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Ht(e,t)};function _e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ht(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var v=function(){return v=Object.assign||function(t){for(var r,n=1,o=arguments.length;n0}),r=[],n=0,o=t;n1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Yo,function(c,l,h,f,u,g){if(l)t.minimumIntegerDigits=h.length;else{if(f&&u)throw new Error("We currently do not support maximum integer digits");if(g)throw new Error("We currently do not support exact integer digits")}return""});continue}if(un.test(o.stem)){t.minimumIntegerDigits=o.stem.length;continue}if(cn.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(cn,function(c,l,h,f,u,g){return h==="*"?t.minimumFractionDigits=l.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:u&&g?(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length+g.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var i=o.options[0];i==="w"?t=v(v({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=v(v({},t),ln(i)));continue}if(dn.test(o.stem)){t=v(v({},t),ln(o.stem));continue}var a=pn(o.stem);a&&(t=v(v({},t),a));var s=Wo(o.stem);s&&(t=v(v({},t),s))}return t}var Ce={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function gn(e,t){for(var r="",n=0;n>1),c="a",l=qo(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=c;for(;a-- >0;)r=l+r}else o==="J"?r+="H":r+=o}return r}function qo(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var o=Ce[n||""]||Ce[r||""]||Ce["".concat(r,"-001")]||Ce["001"];return o[0]}var Bt,Xo=new RegExp("^".concat(kt.source,"*")),Ko=new RegExp("".concat(kt.source,"*$"));function y(e,t){return{start:e,end:t}}var Zo=!!String.prototype.startsWith,Qo=!!String.fromCodePoint,Jo=!!Object.fromEntries,ei=!!String.prototype.codePointAt,ti=!!String.prototype.trimStart,ri=!!String.prototype.trimEnd,ni=!!Number.isSafeInteger,oi=ni?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ut=!0;try{xn=En("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ut=((Bt=xn.exec("a"))===null||Bt===void 0?void 0:Bt[0])==="a"}catch{Ut=!1}var xn,bn=Zo?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Gt=Qo?String.fromCodePoint:function(){for(var t=[],r=0;ri;){if(a=t[i++],a>1114111)throw RangeError(a+" is not a valid code point");n+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return n},vn=Jo?Object.fromEntries:function(t){for(var r={},n=0,o=t;n=n)){var o=t.charCodeAt(r),i;return o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?o:(o-55296<<10)+(i-56320)+65536}},ii=ti?function(t){return t.trimStart()}:function(t){return t.replace(Xo,"")},ai=ri?function(t){return t.trimEnd()}:function(t){return t.replace(Ko,"")};function En(e,t){return new RegExp(e,t)}var zt;Ut?(Dt=En("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),zt=function(t,r){var n;Dt.lastIndex=r;var o=Dt.exec(t);return(n=o[1])!==null&&n!==void 0?n:""}):zt=function(t,r){for(var n=[];;){var o=yn(t,r);if(o===void 0||Sn(o)||li(o))break;n.push(o),r+=o>=65536?2:1}return Gt.apply(void 0,n)};var Dt,wn=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var o=[];!this.isEOF();){var i=this.char();if(i===123){var a=this.parseArgument(t,n);if(a.err)return a;o.push(a.val)}else{if(i===125&&t>0)break;if(i===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),o.push({type:w.pound,location:y(s,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(x.UNMATCHED_CLOSING_TAG,y(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ft(this.peek()||0)){var a=this.parseTag(t,r);if(a.err)return a;o.push(a.val)}else{var a=this.parseLiteral(t,r);if(a.err)return a;o.push(a.val)}}}return{val:o,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:w.literal,value:"<".concat(o,"/>"),location:y(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,r,!0);if(i.err)return i;var a=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:w.tag,value:o,children:a,location:y(n,this.clonePosition())},err:null}:this.error(x.INVALID_TAG,y(s,this.clonePosition())))}else return this.error(x.UNCLOSED_TAG,y(n,this.clonePosition()))}else return this.error(x.INVALID_TAG,y(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ci(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),o="";;){var i=this.tryParseQuote(r);if(i){o+=i;continue}var a=this.tryParseUnquoted(t,r);if(a){o+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){o+=s;continue}break}var c=y(n,this.clonePosition());return{val:{type:w.literal,value:o,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!si(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Gt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Gt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(x.EMPTY_ARGUMENT,y(n,this.clonePosition()));var o=this.parseIdentifierIfPossible().value;if(!o)return this.error(x.MALFORMED_ARGUMENT,y(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:w.argument,value:o,location:y(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(n,this.clonePosition())):this.parseArgumentOptions(t,r,o,n);default:return this.error(x.MALFORMED_ARGUMENT,y(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=zt(this.message,r),o=r+n.length;this.bumpTo(o);var i=this.clonePosition(),a=y(t,i);return{value:n,location:a}},e.prototype.parseArgumentOptions=function(t,r,n,o){var i,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(x.EXPECT_ARGUMENT_TYPE,y(a,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var u=ai(f.val);if(u.length===0)return this.error(x.EXPECT_ARGUMENT_STYLE,y(this.clonePosition(),this.clonePosition()));var g=y(h,this.clonePosition());l={style:u,styleLocation:g}}var b=this.tryParseArgumentClose(o);if(b.err)return b;var E=y(o,this.clonePosition());if(l&&bn(l?.style,"::",0)){var R=ii(l.style.slice(2));if(s==="number"){var f=this.parseNumberSkeletonFromString(R,l.styleLocation);return f.err?f:{val:{type:w.number,value:n,location:E,style:f.val},err:null}}else{if(R.length===0)return this.error(x.EXPECT_DATE_TIME_SKELETON,E);var G=R;this.locale&&(G=gn(R,this.locale));var u={type:q.dateTime,pattern:G,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?an(G):{}},B=s==="date"?w.date:w.time;return{val:{type:B,value:n,location:E,style:u},err:null}}}return{val:{type:s==="number"?w.number:s==="date"?w.date:w.time,value:n,location:E,style:(i=l?.style)!==null&&i!==void 0?i:null},err:null}}case"plural":case"selectordinal":case"select":{var M=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(x.EXPECT_SELECT_ARGUMENT_OPTIONS,y(M,v({},M)));this.bumpSpace();var V=this.parseIdentifierIfPossible(),D=0;if(s!=="select"&&V.value==="offset"){if(!this.bumpIf(":"))return this.error(x.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,y(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(x.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),V=this.parseIdentifierIfPossible(),D=f.val}var j=this.tryParsePluralOrSelectOptions(t,s,r,V);if(j.err)return j;var b=this.tryParseArgumentClose(o);if(b.err)return b;var ke=y(o,this.clonePosition());return s==="select"?{val:{type:w.select,value:n,options:vn(j.val),location:ke},err:null}:{val:{type:w.plural,value:n,options:vn(j.val),offset:D,pluralType:s==="plural"?"cardinal":"ordinal",location:ke},err:null}}default:return this.error(x.INVALID_ARGUMENT_TYPE,y(a,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var o=this.clonePosition();if(!this.bumpUntil("'"))return this.error(x.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,y(o,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=mn(t)}catch{return this.error(x.INVALID_NUMBER_SKELETON,r)}return{val:{type:q.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?fn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,o){for(var i,a=!1,s=[],c=new Set,l=o.value,h=o.location;;){if(l.length===0){var f=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(x.EXPECT_PLURAL_ARGUMENT_SELECTOR,x.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;h=y(f,this.clonePosition()),l=this.message.slice(f.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?x.DUPLICATE_SELECT_ARGUMENT_SELECTOR:x.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);l==="other"&&(a=!0),this.bumpSpace();var g=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?x.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:x.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,y(this.clonePosition(),this.clonePosition()));var b=this.parseMessage(t+1,r,n);if(b.err)return b;var E=this.tryParseArgumentClose(g);if(E.err)return E;s.push([l,{value:b.val,location:y(g,this.clonePosition())}]),c.add(l),this.bumpSpace(),i=this.parseIdentifierIfPossible(),l=i.value,h=i.location}return s.length===0?this.error(r==="select"?x.EXPECT_SELECT_ARGUMENT_SELECTOR:x.EXPECT_PLURAL_ARGUMENT_SELECTOR,y(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(x.MISSING_OTHER_CLAUSE,y(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,o=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)i=!0,a=a*10+(s-48),this.bump();else break}var c=y(o,this.clonePosition());return i?(a*=n,oi(a)?{val:a,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=yn(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(bn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Sn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Ft(e){return e>=97&&e<=122||e>=65&&e<=90}function si(e){return Ft(e)||e===47}function ci(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Sn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function li(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function $t(e){e.forEach(function(t){if(delete t.location,Ze(t)||Qe(t))for(var r in t.options)delete t.options[r].location,$t(t.options[r].value);else qe(t)&&et(t.style)||(Xe(t)||Ke(t))&&Le(t.style)?delete t.style.location:Je(t)&&$t(t.children)})}function An(e,t){t===void 0&&(t={}),t=v({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new wn(e,t).parse();if(r.err){var n=SyntaxError(x[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||$t(r.val),r.val}function Pe(e,t){var r=t&&t.cache?t.cache:fi,n=t&&t.serializer?t.serializer:pi,o=t&&t.strategy?t.strategy:mi;return o(e,{cache:r,serializer:n})}function hi(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Tn(e,t,r,n){var o=hi(n)?n:r(n),i=t.get(o);return typeof i>"u"&&(i=e.call(this,n),t.set(o,i)),i}function _n(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,n),t.set(o,i)),i}function Vt(e,t,r,n,o){return r.bind(t,e,n,o)}function mi(e,t){var r=e.length===1?Tn:_n;return Vt(e,this,r,t.cache.create(),t.serializer)}function di(e,t){return Vt(e,this,_n,t.cache.create(),t.serializer)}function ui(e,t){return Vt(e,this,Tn,t.cache.create(),t.serializer)}var pi=function(){return JSON.stringify(arguments)};function jt(){this.cache=Object.create(null)}jt.prototype.get=function(e){return this.cache[e]};jt.prototype.set=function(e,t){this.cache[e]=t};var fi={create:function(){return new jt}},tt={variadic:di,monadic:ui};var X;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(X||(X={}));var Ne=function(e){_e(t,e);function t(r,n,o){var i=e.call(this,r)||this;return i.code=n,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Yt=function(e){_e(t,e);function t(r,n,o,i){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(o).join('", "'),'"'),X.INVALID_VALUE,i)||this}return t}(Ne);var Ln=function(e){_e(t,e);function t(r,n,o){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),X.INVALID_VALUE,o)||this}return t}(Ne);var Cn=function(e){_e(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),X.MISSING_VALUE,n)||this}return t}(Ne);var C;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(C||(C={}));function gi(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==C.literal||r.type!==C.literal?t.push(r):n.value+=r.value,t},[])}function xi(e){return typeof e=="function"}function Re(e,t,r,n,o,i,a){if(e.length===1&&It(e[0]))return[{type:C.literal,value:e[0].value}];for(var s=[],c=0,l=e;c`${e??""}`.replace(/[&<>'"]/g,t=>({"&":"&","<":"<",">":">","'":"'",'"':"""})[t]??t)??"";function ue(e,t={},{metadata:r=!0,search:n=!0,storage:o=!0}={}){let i;if(n&&i==null){let a=new URLSearchParams(window.location.search),s=Se(n)?n:e;i=a.get(s)}if(o&&i==null){let a=Se(o)?o:e;i=window.sessionStorage.getItem(a)??window.localStorage.getItem(a)}if(r&&i==null){let a=Do(Se(r)?r:e);i=document.documentElement.querySelector(`meta[name="${a}"]`)?.content}return i??t[e]}var pe=()=>{};var qr=e=>typeof e=="boolean",Ae=e=>typeof e=="function",Rt=e=>typeof e=="number",Xr=e=>e!=null&&typeof e=="object";var Se=e=>typeof e=="string";var Te=e=>Rt(e)&&Number.isFinite(e)&&e>0;function O(e,t){if(qr(e))return e;let r=String(e);return r==="1"||r==="true"?!0:r==="0"||r==="false"?!1:t}function Do(e=""){return String(e).replace(/(\p{Lowercase_Letter})(\p{Uppercase_Letter})/gu,(t,r,n)=>`${r}-${n}`).replace(/\W+/gu,"-").toLowerCase()}var Uo=Date.now(),Ot=()=>`(+${Date.now()-Uo}ms)`,Ye=new Set,Go=O(ue("tacocat.debug",{},{metadata:!1}),typeof process<"u"&&process.env?.DEBUG);function Kr(e){let t=`[${Yr}/${e}]`,r=(a,s,...c)=>a?!0:(o(s,...c),!1),n=Go?(a,...s)=>{console.debug(`${t} ${a}`,...s,Ot())}:()=>{},o=(a,...s)=>{let c=`${t} ${a}`;Ye.forEach(([l])=>l(c,...s))};return{assert:r,debug:n,error:o,warn:(a,...s)=>{let c=`${t} ${a}`;Ye.forEach(([,l])=>l(c,...s))}}}function zo(e,t){let r=[e,t];return Ye.add(r),()=>{Ye.delete(r)}}zo((e,...t)=>{console.error(e,...t,Ot())},(e,...t)=>{console.warn(e,...t,Ot())});var Zr="ABM",Qr="PUF",Jr="M2M",en="PERPETUAL",tn="P3Y",Fo="TAX_INCLUSIVE_DETAILS",$o="TAX_EXCLUSIVE",rn={ABM:Zr,PUF:Qr,M2M:Jr,PERPETUAL:en,P3Y:tn},sh={[Zr]:{commitment:C.YEAR,term:_.MONTHLY},[Qr]:{commitment:C.YEAR,term:_.ANNUAL},[Jr]:{commitment:C.MONTH,term:_.MONTHLY},[en]:{commitment:C.PERPETUAL,term:void 0},[tn]:{commitment:C.THREE_MONTHS,term:_.P3Y}};function Mt(e){let{priceDetails:t}=e,{price:r,priceWithoutDiscount:n,priceWithoutTax:o,priceWithoutDiscountAndTax:i,taxDisplay:a}=t;if(a!==Fo)return e;let s={...e,priceDetails:{...t,price:o??r,priceWithoutDiscount:i??n,taxDisplay:$o}};return s.offerType==="TRIAL"&&s.priceDetails.price===0&&(s.priceDetails.price=s.priceDetails.priceWithoutDiscount),s}var Ht=function(e,t){return Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Ht(e,t)};function _e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ht(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var v=function(){return v=Object.assign||function(t){for(var r,n=1,o=arguments.length;n0}),r=[],n=0,o=t;n1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Yo,function(c,l,h,f,u,g){if(l)t.minimumIntegerDigits=h.length;else{if(f&&u)throw new Error("We currently do not support maximum integer digits");if(g)throw new Error("We currently do not support exact integer digits")}return""});continue}if(un.test(o.stem)){t.minimumIntegerDigits=o.stem.length;continue}if(cn.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(cn,function(c,l,h,f,u,g){return h==="*"?t.minimumFractionDigits=l.length:f&&f[0]==="#"?t.maximumFractionDigits=f.length:u&&g?(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length+g.length):(t.minimumFractionDigits=l.length,t.maximumFractionDigits=l.length),""});var i=o.options[0];i==="w"?t=v(v({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=v(v({},t),ln(i)));continue}if(dn.test(o.stem)){t=v(v({},t),ln(o.stem));continue}var a=pn(o.stem);a&&(t=v(v({},t),a));var s=Wo(o.stem);s&&(t=v(v({},t),s))}return t}var Pe={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function gn(e,t){for(var r="",n=0;n>1),c="a",l=qo(t);for((l=="H"||l=="k")&&(s=0);s-- >0;)r+=c;for(;a-- >0;)r=l+r}else o==="J"?r+="H":r+=o}return r}function qo(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r=e.language,n;r!=="root"&&(n=e.maximize().region);var o=Pe[n||""]||Pe[r||""]||Pe["".concat(r,"-001")]||Pe["001"];return o[0]}var Bt,Xo=new RegExp("^".concat(kt.source,"*")),Ko=new RegExp("".concat(kt.source,"*$"));function y(e,t){return{start:e,end:t}}var Zo=!!String.prototype.startsWith,Qo=!!String.fromCodePoint,Jo=!!Object.fromEntries,ei=!!String.prototype.codePointAt,ti=!!String.prototype.trimStart,ri=!!String.prototype.trimEnd,ni=!!Number.isSafeInteger,oi=ni?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ut=!0;try{xn=En("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),Ut=((Bt=xn.exec("a"))===null||Bt===void 0?void 0:Bt[0])==="a"}catch{Ut=!1}var xn,bn=Zo?function(t,r,n){return t.startsWith(r,n)}:function(t,r,n){return t.slice(n,n+r.length)===r},Gt=Qo?String.fromCodePoint:function(){for(var t=[],r=0;ri;){if(a=t[i++],a>1114111)throw RangeError(a+" is not a valid code point");n+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return n},vn=Jo?Object.fromEntries:function(t){for(var r={},n=0,o=t;n=n)){var o=t.charCodeAt(r),i;return o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?o:(o-55296<<10)+(i-56320)+65536}},ii=ti?function(t){return t.trimStart()}:function(t){return t.replace(Xo,"")},ai=ri?function(t){return t.trimEnd()}:function(t){return t.replace(Ko,"")};function En(e,t){return new RegExp(e,t)}var zt;Ut?(Dt=En("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),zt=function(t,r){var n;Dt.lastIndex=r;var o=Dt.exec(t);return(n=o[1])!==null&&n!==void 0?n:""}):zt=function(t,r){for(var n=[];;){var o=yn(t,r);if(o===void 0||Sn(o)||li(o))break;n.push(o),r+=o>=65536?2:1}return Gt.apply(void 0,n)};var Dt,wn=function(){function e(t,r){r===void 0&&(r={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,r,n){for(var o=[];!this.isEOF();){var i=this.char();if(i===123){var a=this.parseArgument(t,n);if(a.err)return a;o.push(a.val)}else{if(i===125&&t>0)break;if(i===35&&(r==="plural"||r==="selectordinal")){var s=this.clonePosition();this.bump(),o.push({type:w.pound,location:y(s,this.clonePosition())})}else if(i===60&&!this.ignoreTag&&this.peek()===47){if(n)break;return this.error(x.UNMATCHED_CLOSING_TAG,y(this.clonePosition(),this.clonePosition()))}else if(i===60&&!this.ignoreTag&&Ft(this.peek()||0)){var a=this.parseTag(t,r);if(a.err)return a;o.push(a.val)}else{var a=this.parseLiteral(t,r);if(a.err)return a;o.push(a.val)}}}return{val:o,err:null}},e.prototype.parseTag=function(t,r){var n=this.clonePosition();this.bump();var o=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:w.literal,value:"<".concat(o,"/>"),location:y(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,r,!0);if(i.err)return i;var a=i.val,s=this.clonePosition();if(this.bumpIf("")?{val:{type:w.tag,value:o,children:a,location:y(n,this.clonePosition())},err:null}:this.error(x.INVALID_TAG,y(s,this.clonePosition())))}else return this.error(x.UNCLOSED_TAG,y(n,this.clonePosition()))}else return this.error(x.INVALID_TAG,y(n,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&ci(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,r){for(var n=this.clonePosition(),o="";;){var i=this.tryParseQuote(r);if(i){o+=i;continue}var a=this.tryParseUnquoted(t,r);if(a){o+=a;continue}var s=this.tryParseLeftAngleBracket();if(s){o+=s;continue}break}var c=y(n,this.clonePosition());return{val:{type:w.literal,value:o,location:c},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!si(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var r=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(n===39)if(this.peek()===39)r.push(39),this.bump();else{this.bump();break}else r.push(n);this.bump()}return Gt.apply(void 0,r)},e.prototype.tryParseUnquoted=function(t,r){if(this.isEOF())return null;var n=this.char();return n===60||n===123||n===35&&(r==="plural"||r==="selectordinal")||n===125&&t>0?null:(this.bump(),Gt(n))},e.prototype.parseArgument=function(t,r){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(n,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(x.EMPTY_ARGUMENT,y(n,this.clonePosition()));var o=this.parseIdentifierIfPossible().value;if(!o)return this.error(x.MALFORMED_ARGUMENT,y(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:w.argument,value:o,location:y(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(n,this.clonePosition())):this.parseArgumentOptions(t,r,o,n);default:return this.error(x.MALFORMED_ARGUMENT,y(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),r=this.offset(),n=zt(this.message,r),o=r+n.length;this.bumpTo(o);var i=this.clonePosition(),a=y(t,i);return{value:n,location:a}},e.prototype.parseArgumentOptions=function(t,r,n,o){var i,a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,c=this.clonePosition();switch(s){case"":return this.error(x.EXPECT_ARGUMENT_TYPE,y(a,c));case"number":case"date":case"time":{this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition(),f=this.parseSimpleArgStyleIfPossible();if(f.err)return f;var u=ai(f.val);if(u.length===0)return this.error(x.EXPECT_ARGUMENT_STYLE,y(this.clonePosition(),this.clonePosition()));var g=y(h,this.clonePosition());l={style:u,styleLocation:g}}var b=this.tryParseArgumentClose(o);if(b.err)return b;var E=y(o,this.clonePosition());if(l&&bn(l?.style,"::",0)){var R=ii(l.style.slice(2));if(s==="number"){var f=this.parseNumberSkeletonFromString(R,l.styleLocation);return f.err?f:{val:{type:w.number,value:n,location:E,style:f.val},err:null}}else{if(R.length===0)return this.error(x.EXPECT_DATE_TIME_SKELETON,E);var G=R;this.locale&&(G=gn(R,this.locale));var u={type:q.dateTime,pattern:G,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?an(G):{}},B=s==="date"?w.date:w.time;return{val:{type:B,value:n,location:E,style:u},err:null}}}return{val:{type:s==="number"?w.number:s==="date"?w.date:w.time,value:n,location:E,style:(i=l?.style)!==null&&i!==void 0?i:null},err:null}}case"plural":case"selectordinal":case"select":{var M=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(x.EXPECT_SELECT_ARGUMENT_OPTIONS,y(M,v({},M)));this.bumpSpace();var V=this.parseIdentifierIfPossible(),D=0;if(s!=="select"&&V.value==="offset"){if(!this.bumpIf(":"))return this.error(x.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,y(this.clonePosition(),this.clonePosition()));this.bumpSpace();var f=this.tryParseDecimalInteger(x.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,x.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(f.err)return f;this.bumpSpace(),V=this.parseIdentifierIfPossible(),D=f.val}var j=this.tryParsePluralOrSelectOptions(t,s,r,V);if(j.err)return j;var b=this.tryParseArgumentClose(o);if(b.err)return b;var ke=y(o,this.clonePosition());return s==="select"?{val:{type:w.select,value:n,options:vn(j.val),location:ke},err:null}:{val:{type:w.plural,value:n,options:vn(j.val),offset:D,pluralType:s==="plural"?"cardinal":"ordinal",location:ke},err:null}}default:return this.error(x.INVALID_ARGUMENT_TYPE,y(a,c))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(x.EXPECT_ARGUMENT_CLOSING_BRACE,y(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,r=this.clonePosition();!this.isEOF();){var n=this.char();switch(n){case 39:{this.bump();var o=this.clonePosition();if(!this.bumpUntil("'"))return this.error(x.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,y(o,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(r.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(r.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,r){var n=[];try{n=mn(t)}catch{return this.error(x.INVALID_NUMBER_SKELETON,r)}return{val:{type:q.number,tokens:n,location:r,parsedOptions:this.shouldParseSkeletons?fn(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,r,n,o){for(var i,a=!1,s=[],c=new Set,l=o.value,h=o.location;;){if(l.length===0){var f=this.clonePosition();if(r!=="select"&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(x.EXPECT_PLURAL_ARGUMENT_SELECTOR,x.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;h=y(f,this.clonePosition()),l=this.message.slice(f.offset,this.offset())}else break}if(c.has(l))return this.error(r==="select"?x.DUPLICATE_SELECT_ARGUMENT_SELECTOR:x.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);l==="other"&&(a=!0),this.bumpSpace();var g=this.clonePosition();if(!this.bumpIf("{"))return this.error(r==="select"?x.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:x.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,y(this.clonePosition(),this.clonePosition()));var b=this.parseMessage(t+1,r,n);if(b.err)return b;var E=this.tryParseArgumentClose(g);if(E.err)return E;s.push([l,{value:b.val,location:y(g,this.clonePosition())}]),c.add(l),this.bumpSpace(),i=this.parseIdentifierIfPossible(),l=i.value,h=i.location}return s.length===0?this.error(r==="select"?x.EXPECT_SELECT_ARGUMENT_SELECTOR:x.EXPECT_PLURAL_ARGUMENT_SELECTOR,y(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(x.MISSING_OTHER_CLAUSE,y(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(t,r){var n=1,o=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,a=0;!this.isEOF();){var s=this.char();if(s>=48&&s<=57)i=!0,a=a*10+(s-48),this.bump();else break}var c=y(o,this.clonePosition());return i?(a*=n,oi(a)?{val:a,err:null}:this.error(r,c)):this.error(t,c)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var r=yn(this.message,t);if(r===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return r},e.prototype.error=function(t,r){return{val:null,err:{kind:t,message:this.message,location:r}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(bn(this.message,t,this.offset())){for(var r=0;r=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var r=this.offset();if(r===t)break;if(r>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Sn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),r=this.offset(),n=this.message.charCodeAt(r+(t>=65536?2:1));return n??null},e}();function Ft(e){return e>=97&&e<=122||e>=65&&e<=90}function si(e){return Ft(e)||e===47}function ci(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Sn(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function li(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function $t(e){e.forEach(function(t){if(delete t.location,Ze(t)||Qe(t))for(var r in t.options)delete t.options[r].location,$t(t.options[r].value);else qe(t)&&et(t.style)||(Xe(t)||Ke(t))&&Le(t.style)?delete t.style.location:Je(t)&&$t(t.children)})}function An(e,t){t===void 0&&(t={}),t=v({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new wn(e,t).parse();if(r.err){var n=SyntaxError(x[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return t?.captureLocation||$t(r.val),r.val}function Ce(e,t){var r=t&&t.cache?t.cache:fi,n=t&&t.serializer?t.serializer:pi,o=t&&t.strategy?t.strategy:mi;return o(e,{cache:r,serializer:n})}function hi(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Tn(e,t,r,n){var o=hi(n)?n:r(n),i=t.get(o);return typeof i>"u"&&(i=e.call(this,n),t.set(o,i)),i}function _n(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,n),t.set(o,i)),i}function Vt(e,t,r,n,o){return r.bind(t,e,n,o)}function mi(e,t){var r=e.length===1?Tn:_n;return Vt(e,this,r,t.cache.create(),t.serializer)}function di(e,t){return Vt(e,this,_n,t.cache.create(),t.serializer)}function ui(e,t){return Vt(e,this,Tn,t.cache.create(),t.serializer)}var pi=function(){return JSON.stringify(arguments)};function jt(){this.cache=Object.create(null)}jt.prototype.get=function(e){return this.cache[e]};jt.prototype.set=function(e,t){this.cache[e]=t};var fi={create:function(){return new jt}},tt={variadic:di,monadic:ui};var X;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(X||(X={}));var Ne=function(e){_e(t,e);function t(r,n,o){var i=e.call(this,r)||this;return i.code=n,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Yt=function(e){_e(t,e);function t(r,n,o,i){return e.call(this,'Invalid values for "'.concat(r,'": "').concat(n,'". Options are "').concat(Object.keys(o).join('", "'),'"'),X.INVALID_VALUE,i)||this}return t}(Ne);var Ln=function(e){_e(t,e);function t(r,n,o){return e.call(this,'Value for "'.concat(r,'" must be of type ').concat(n),X.INVALID_VALUE,o)||this}return t}(Ne);var Pn=function(e){_e(t,e);function t(r,n){return e.call(this,'The intl string context variable "'.concat(r,'" was not provided to the string "').concat(n,'"'),X.MISSING_VALUE,n)||this}return t}(Ne);var P;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(P||(P={}));function gi(e){return e.length<2?e:e.reduce(function(t,r){var n=t[t.length-1];return!n||n.type!==P.literal||r.type!==P.literal?t.push(r):n.value+=r.value,t},[])}function xi(e){return typeof e=="function"}function Re(e,t,r,n,o,i,a){if(e.length===1&&It(e[0]))return[{type:P.literal,value:e[0].value}];for(var s=[],c=0,l=e;c0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=An,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var Nn=Pn;var Ei=/[0-9\-+#]/,wi=/[^\d\-+#]/g;function Rn(e){return e.search(Ei)}function Si(e="#.##"){let t={},r=e.length,n=Rn(e);t.prefix=n>0?e.substring(0,n):"";let o=Rn(e.split("").reverse().join("")),i=r-o,a=e.substring(i,i+1),s=i+(a==="."||a===","?1:0);t.suffix=o>0?e.substring(s,r):"",t.mask=e.substring(n,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(wi);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}function Ai(e,t,r){let n=!1,o={value:e};e<0&&(n=!0,o.value=-o.value),o.sign=n?"-":"",o.value=Number(o.value).toFixed(t.fraction&&t.fraction.length),o.value=Number(o.value).toString();let i=t.fraction&&t.fraction.lastIndexOf("0"),[a="0",s=""]=o.value.split(".");return(!s||s&&s.length<=i)&&(s=i<0?"":(+("0."+s)).toFixed(i+1).replace("0.","")),o.integer=a,o.fraction=s,Ti(o,t),(o.result==="0"||o.result==="")&&(n=!1,o.sign=""),!n&&t.maskHasPositiveSign?o.sign="+":n&&t.maskHasPositiveSign?o.sign="-":n&&(o.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),o}function Ti(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),o=n&&n.indexOf("0");if(o>-1)for(;e.integer.lengthe*12,Bn=(e,t)=>{let{start:r,end:n,displaySummary:{amount:o,duration:i,minProductQuantity:a,outcomeType:s}={}}=e;if(!(o&&i&&s&&a))return!1;let c=t?new Date(t):new Date;if(!r||!n)return!1;let l=new Date(r),h=new Date(n);return c>=l&&c<=h},K={MONTH:"MONTH",YEAR:"YEAR"},Ci={[_.ANNUAL]:12,[_.MONTHLY]:1,[_.THREE_YEARS]:36,[_.TWO_YEARS]:24},Xt=(e,t)=>({accept:e,round:t}),Pi=[Xt(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),Xt(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),Xt(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],Kt={[P.YEAR]:{[_.MONTHLY]:K.MONTH,[_.ANNUAL]:K.YEAR},[P.MONTH]:{[_.MONTHLY]:K.MONTH}},Ni=(e,t)=>e.indexOf(`'${t}'`)===0,Ri=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+Mi(e)),r},Oi=e=>{let t=Hi(e),r=Ni(e,t),n=e.replace(/'.*?'/,""),o=In.test(n)||kn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:o}},Dn=e=>e.replace(In,Hn).replace(kn,Hn),Mi=e=>e.match(/#(.?)#/)?.[1]===Mn?Li:Mn,Hi=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function fe({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},o,i=a=>a){let{currencySymbol:a,isCurrencyFirst:s,hasCurrencySpace:c}=Oi(e),l=r?Un(e):"",h=Ri(e,r),f=r?2:0,u=i(t,{currencySymbol:a}),g=n?u.toLocaleString("hi-IN",{minimumFractionDigits:f,maximumFractionDigits:f}):On(h,u),b=r?g.lastIndexOf(l):g.length,E=g.substring(0,b),R=g.substring(b+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,g).replace(/SYMBOL/,a),currencySymbol:a,decimals:R,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:s,recurrenceTerm:o}}var Gn=e=>{let{commitment:t,term:r,usePrecision:n}=e,o=Ci[r]??1;return fe(e,o>1?K.MONTH:Kt[t]?.[r],i=>{let a={divisor:o,price:i,usePrecision:n},{round:s}=Pi.find(({accept:c})=>c(a));if(!s)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return s(a)})},zn=({commitment:e,term:t,...r})=>fe(r,Kt[e]?.[t]),Fn=e=>{let{commitment:t,instant:r,price:n,originalPrice:o,priceWithoutDiscount:i,promotion:a,quantity:s=1,term:c}=e;if(t===P.YEAR&&c===_.MONTHLY){if(!a)return fe(e,K.YEAR,qt);let{displaySummary:{outcomeType:l,duration:h,minProductQuantity:f=1}={}}=a;switch(l){case"PERCENTAGE_DISCOUNT":if(s>=f&&Bn(a,r)){let u=parseInt(h.replace("P","").replace("M",""));if(isNaN(u))return qt(n);let g=s*o*u,b=s*i*(12-u),E=Math.floor((g+b)*100)/100;return fe({...e,price:E},K.YEAR)}default:return fe(e,K.YEAR,()=>qt(i??n))}}return fe(e,Kt[t]?.[c])};var Ii={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},ki=Kr("ConsonantTemplates/price"),Bi=/<\/?[^>]+(>|$)/g,L={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",containerAnnualPrefix:"price-annual-prefix",containerAnnualSuffix:"price-annual-suffix",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},Z={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Di="TAX_EXCLUSIVE",Ui=e=>Xr(e)?Object.entries(e).filter(([,t])=>Se(t)||Rt(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+Wr(n)+'"'}`,""):"",N=(e,t,r,n=!1)=>`${n?Dn(t):t??""}`;function Gi(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:o,hasCurrencySpace:i,integer:a,isCurrencyFirst:s,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:h},f={}){let u=N(L.currencySymbol,r),g=N(L.currencySpace,i?" ":""),b="";return s&&(b+=u+g),b+=N(L.integer,a),b+=N(L.decimalsDelimiter,o),b+=N(L.decimals,n),s||(b+=g+u),b+=N(L.recurrence,c,null,!0),b+=N(L.unitType,l,null,!0),b+=N(L.taxInclusivity,h,!0),N(e,b,{...f,"aria-label":t})}var I=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1,instant:n=void 0}={})=>({country:o,displayFormatted:i=!0,displayRecurrence:a=!0,displayPerUnit:s=!1,displayTax:c=!1,language:l,literals:h={},quantity:f=1}={},{commitment:u,offerSelectorIds:g,formatString:b,price:E,priceWithoutDiscount:R,taxDisplay:G,taxTerm:B,term:M,usePrecision:V,promotion:D}={},j={})=>{Object.entries({country:o,formatString:b,language:l,price:E}).forEach(([U,ct])=>{if(ct==null)throw new Error(`Argument "${U}" is missing for osi ${g?.toString()}, country ${o}, language ${l}`)});let ke={...Ii,...h},uo=`${l.toLowerCase()}-${o.toUpperCase()}`;function ee(U,ct){let lt=ke[U];if(lt==null)return"";try{return new Nn(lt.replace(Bi,""),uo).format(ct)}catch{return ki.error("Failed to format literal:",lt),""}}let po=t&&R?R:E,sr=e?Gn:zn;r&&(sr=Fn);let{accessiblePrice:fo,recurrenceTerm:it,...cr}=sr({commitment:u,formatString:b,instant:n,isIndianPrice:o==="IN",originalPrice:E,priceWithoutDiscount:R,price:e?E:po,promotion:D,quantity:f,term:M,usePrecision:V}),te=fo,at="";if(O(a)&&it){let U=ee(Z.recurrenceAriaLabel,{recurrenceTerm:it});U&&(te+=" "+U),at=ee(Z.recurrenceLabel,{recurrenceTerm:it})}let st="";if(O(s)){st=ee(Z.perUnitLabel,{perUnit:"LICENSE"});let U=ee(Z.perUnitAriaLabel,{perUnit:"LICENSE"});U&&(te+=" "+U)}let xe="";O(c)&&B&&(xe=ee(G===Di?Z.taxExclusiveLabel:Z.taxInclusiveLabel,{taxTerm:B}),xe&&(te+=" "+xe)),t&&(te=ee(Z.strikethroughAriaLabel,{strikethroughPrice:te}));let be=L.container;if(e&&(be+=" "+L.containerOptical),t&&(be+=" "+L.containerStrikethrough),r&&(be+=" "+L.containerAnnual),O(i))return Gi(be,{...cr,accessibleLabel:te,recurrenceLabel:at,perUnitLabel:st,taxInclusivityLabel:xe},j);let{currencySymbol:lr,decimals:go,decimalsDelimiter:xo,hasCurrencySpace:hr,integer:bo,isCurrencyFirst:vo}=cr,re=[bo,xo,go];vo?(re.unshift(hr?"\xA0":""),re.unshift(lr)):(re.push(hr?"\xA0":""),re.push(lr)),re.push(at,st,xe);let yo=re.join("");return N(be,yo,j)},$n=()=>(e,t,r)=>{let o=(e.displayOldPrice===void 0||O(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${I()(e,t,r)}${o?" "+I({displayStrikethrough:!0})(e,t,r):""}`},Vn=()=>(e,t,r)=>{let{instant:n}=e;try{n||(n=new URLSearchParams(document.location.search).get("instant")),n&&(n=new Date(n))}catch{n=void 0}let o={...e,displayTax:!1,displayPerUnit:!1};return`${(e.displayOldPrice===void 0||O(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price?I({displayStrikethrough:!0})(o,t,r)+" ":""}${I()(e,t,r)}${N(L.containerAnnualPrefix," (")}${I({displayAnnual:!0,instant:n})(o,t,r)}${N(L.containerAnnualSuffix,")")}`},jn=()=>(e,t,r)=>{let n={...e,displayTax:!1,displayPerUnit:!1};return`${I()(e,t,r)}${N(L.containerAnnualPrefix," (")}${I({displayAnnual:!0})(n,t,r)}${N(L.containerAnnualSuffix,")")}`};var zi=I(),Fi=$n(),$i=I({displayOptical:!0}),Vi=I({displayStrikethrough:!0}),ji=I({displayAnnual:!0}),Yi=jn(),Wi=Vn();var qi=(e,t)=>{if(!(!Te(e)||!Te(t)))return Math.floor((t-e)/t*100)},Yn=()=>(e,t)=>{let{price:r,priceWithoutDiscount:n}=t,o=qi(r,n);return o===void 0?'':`${o}%`};var Xi=Yn();var{freeze:Oe}=Object,Zt=Oe({...Ee}),Qt=Oe({...we}),Jt={STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"},vd=Oe({...P}),yd=Oe({...rn}),Ed=Oe({..._});var qn="mas-commerce-service";function Xn(e,{once:t=!1}={}){let r=null;function n(){let o=document.querySelector(qn);o!==r&&(r=o,o&&e(o))}return document.addEventListener(ut,n,{once:t}),Me(n),()=>document.removeEventListener(ut,n)}function Kn(e,{country:t,forceTaxExclusive:r,perpetual:n}){let o;if(e.length<2)o=e;else{let i=t==="GB"||n?"EN":"MULT",[a,s]=e;o=[a.language===i?a:s]}return r&&(o=o.map(Mt)),o}var Me=e=>window.setTimeout(e);function Q(){return document.getElementsByTagName(qn)?.[0]}var J={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:1,tags:"acom",isProdDomain:!1},Zn=1e3,Qn=new Set;function Qi(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function Jn(e){if(e==null)return;let t=typeof e;if(t==="function")return e.name?`function ${e.name}`:"function";if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:o,status:i}=e;return[n,i,o].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!J.serializableTypes.includes(r))return r}return e}function Ji(e,t){if(!J.ignoredProperties.includes(e))return Jn(t)}var er={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,n=[],o=[],i=t;r.forEach(l=>{l!=null&&(Qi(l)?n:o).push(l)}),n.length&&(i+=" "+n.map(Jn).join(" "));let{pathname:a,search:s}=window.location,c=`${J.delimiter}page=${a}${s}`;c.length>Zn&&(c=`${c.slice(0,Zn)}`),i+=c,o.length&&(i+=`${J.delimiter}facts=`,i+=JSON.stringify(o,Ji)),Qn.has(i)||(Qn.add(i),window.lana?.log(i,J))}};function eo(e){Object.assign(J,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in J&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var ea=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Zt.V3,checkoutWorkflowStep:Qt.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:Jt.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:gt.PUBLISHED,wcsBufferLimit:1});var tr=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});var rr={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},ta=Date.now(),nr=new Set,or=new Set,to=new Map,ro={append({level:e,message:t,params:r,timestamp:n,source:o}){console[e](`${n}ms [${o}] %c${t}`,"font-weight: bold;",...r)}},no={filter:({level:e})=>e!==rr.DEBUG},ra={filter:()=>!1};function na(e,t,r,n,o){return{level:e,message:t,namespace:r,get params(){return n.length===1&&Ae(n[0])&&(n=n[0](),Array.isArray(n)||(n=[n])),n},source:o,timestamp:Date.now()-ta}}function oa(e){[...or].every(t=>t(e))&&nr.forEach(t=>t(e))}function oo(e){let t=(to.get(e)??0)+1;to.set(e,t);let r=`${e} #${t}`,n={id:r,namespace:e,module:o=>oo(`${n.namespace}/${o}`),updateConfig:eo};return Object.values(rr).forEach(o=>{n[o]=(i,...a)=>oa(na(o,i,e,a,r))}),Object.seal(n)}function rt(...e){e.forEach(t=>{let{append:r,filter:n}=t;Ae(n)&&or.add(n),Ae(r)&&nr.add(r)})}function ia(e={}){let{name:t}=e,r=O(ue("commerce.debug",{search:!0,storage:!0}),t===tr.LOCAL);return rt(r?ro:no),t===tr.PROD&&rt(er),ir}function aa(){nr.clear(),or.clear()}var ir={...oo(Pr),Level:rr,Plugins:{consoleAppender:ro,debugFilter:no,quietFilter:ra,lanaAppender:er},init:ia,reset:aa,use:rt};var sa={[F]:Ar,[Y]:Tr,[$]:_r},ca={[F]:Lr,[$]:Cr},nt=class{constructor(t){p(this,"changes",new Map);p(this,"connected",!1);p(this,"dispose",pe);p(this,"error");p(this,"log");p(this,"options");p(this,"promises",[]);p(this,"state",Y);p(this,"timer",null);p(this,"value");p(this,"version",0);p(this,"wrapperElement");this.wrapperElement=t}update(){[F,Y,$].forEach(t=>{this.wrapperElement.classList.toggle(sa[t],t===this.state)})}notify(){(this.state===$||this.state===F)&&(this.state===$?this.promises.forEach(({resolve:t})=>t(this.wrapperElement)):this.state===F&&this.promises.forEach(({reject:t})=>t(this.error)),this.promises=[]),this.wrapperElement.dispatchEvent(new CustomEvent(ca[this.state],{bubbles:!0}))}attributeChangedCallback(t,r,n){this.changes.set(t,n),this.requestUpdate()}connectedCallback(){this.dispose=Xn(()=>this.requestUpdate(!0))}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement})),this.dispose(),this.dispose=pe}onceSettled(){let{error:t,promises:r,state:n}=this;return $===n?Promise.resolve(this.wrapperElement):F===n?Promise.reject(t):new Promise((o,i)=>{r.push({resolve:o,reject:i})})}toggleResolved(t,r,n){return t!==this.version?!1:(n!==void 0&&(this.options=n),this.state=$,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),Me(()=>this.notify()),!0)}toggleFailed(t,r,n){return t!==this.version?!1:(n!==void 0&&(this.options=n),this.error=r,this.state=F,this.update(),this.log?.error("Failed:",{element:this.wrapperElement,error:r}),Me(()=>this.notify()),!0)}togglePending(t){return this.version++,t&&(this.options=t),this.state=Y,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Q()||this.timer)return;let r=ir.module("mas-element"),{error:n,options:o,state:i,value:a,version:s}=this;this.state=Y,this.timer=Me(async()=>{this.timer=null;let c=null;if(this.changes.size&&(c=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:c}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:c})),c||t)try{await this.wrapperElement.render?.()===!1&&this.state===Y&&this.version===s&&(this.state=i,this.error=n,this.value=a,this.update(),this.notify())}catch(l){r.error("Failed to render mas-element: ",l),this.toggleFailed(this.version,l,o)}})}};function io(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function ao(e,t={}){let{tag:r,is:n}=e,o=document.createElement(r,{is:n});return o.setAttribute("is",n),Object.assign(o.dataset,io(t)),o}function so(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,io(t)),e):null}var la="download",ha="upgrade";function co(e,t={},r=""){let n=Q();if(!n)return null;let{checkoutMarketSegment:o,checkoutWorkflow:i,checkoutWorkflowStep:a,entitlement:s,upgrade:c,modal:l,perpetual:h,promotionCode:f,quantity:u,wcsOsi:g,extraOptions:b}=n.collectCheckoutOptions(t),E=ao(e,{checkoutMarketSegment:o,checkoutWorkflow:i,checkoutWorkflowStep:a,entitlement:s,upgrade:c,modal:l,perpetual:h,promotionCode:f,quantity:u,wcsOsi:g,extraOptions:b});return r&&(E.innerHTML=`${r}`),E}function lo(e){return class extends e{constructor(){super(...arguments);p(this,"checkoutActionHandler");p(this,"masElement",new nt(this))}attributeChangedCallback(n,o,i){this.masElement.attributeChangedCallback(n,o,i)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.clickHandler)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.clickHandler)}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}requestUpdate(n=!1){return this.masElement.requestUpdate(n)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}async render(n={}){if(!this.isConnected)return!1;let o=Q();if(!o)return!1;this.dataset.imsCountry||o.imsCountryPromise.then(f=>{f&&(this.dataset.imsCountry=f)},pe),n.imsCountry=null;let i=o.collectCheckoutOptions(n,this);if(!i.wcsOsi.length)return!1;let a;try{a=JSON.parse(i.extraOptions??"{}")}catch(f){this.masElement.log?.error("cannot parse exta checkout options",f)}let s=this.masElement.togglePending(i);this.setCheckoutUrl("");let c=o.resolveOfferSelectors(i),l=await Promise.all(c);l=l.map(f=>Kn(f,i)),i.country=this.dataset.imsCountry||i.country;let h=await o.buildCheckoutAction?.(l.flat(),{...a,...i},this);return this.renderOffers(l.flat(),i,{},h,s)}renderOffers(n,o,i={},a=void 0,s=void 0){if(!this.isConnected)return!1;let c=Q();if(!c)return!1;if(o={...JSON.parse(this.dataset.extraOptions??"null"),...o,...i},s??(s=this.masElement.togglePending(o)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),a){this.classList.remove(la,ha),this.masElement.toggleResolved(s,n,o);let{url:h,text:f,className:u,handler:g}=a;return h&&this.setCheckoutUrl(h),f&&(this.firstElementChild.innerHTML=f),u&&this.classList.add(...u.split(" ")),g&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=g.bind(this)),!0}else if(n.length){if(this.masElement.toggleResolved(s,n,o)){let h=c.buildCheckoutURL(n,o);return this.setCheckoutUrl(h),!0}}else{let h=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(s,h,o))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(n){}updateOptions(n={}){let o=Q();if(!o)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:a,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:h,perpetual:f,promotionCode:u,quantity:g,wcsOsi:b}=o.collectCheckoutOptions(n);return so(this,{checkoutMarketSegment:i,checkoutWorkflow:a,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:h,perpetual:f,promotionCode:u,quantity:g,wcsOsi:b}),!0}}}var He=class He extends lo(HTMLButtonElement){static createCheckoutButton(t={},r=""){return co(He,t,r)}setCheckoutUrl(t){this.setAttribute("data-href",t)}get href(){return this.getAttribute("data-href")}get isCheckoutButton(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}this.href&&(window.location.href=this.href)}};p(He,"is","checkout-button"),p(He,"tag","button");var ge=He;window.customElements.get(ge.is)||window.customElements.define(ge.is,ge,{extends:ge.tag});var ma="#000000",da="#F8D904",ua=/(accent|primary|secondary)(-(outline|link))?/,pa="mas:product_code/",fa="daa-ll",ot="daa-lh",ga=["XL","L","M","S"];function xa(e,t,r){e.mnemonicIcon?.map((o,i)=>({icon:o,alt:e.mnemonicAlt[i]??"",link:e.mnemonicLink[i]??""}))?.forEach(({icon:o,alt:i,link:a})=>{if(a&&!/^https?:/.test(a))try{a=new URL(`https://${a}`).href.toString()}catch{a="#"}let s={slot:"icons",src:o,loading:t.loading,size:r?.size??"l"};i&&(s.alt=i),a&&(s.href=a);let c=k("merch-icon",s);t.append(c)})}function ba(e,t){e.badge&&(t.setAttribute("badge-text",e.badge),t.setAttribute("badge-color",e.badgeColor||ma),t.setAttribute("badge-background-color",e.badgeBackgroundColor||da))}function va(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function ya(e,t,r){e.cardTitle&&r&&t.append(k(r.tag,{slot:r.slot},e.cardTitle))}function Ea(e,t,r){e.subtitle&&r&&t.append(k(r.tag,{slot:r.slot},e.subtitle))}function wa(e,t,r){if(e.backgroundImage){let n={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?n.alt=e.backgroundImageAltText:n.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(k(r.tag,{slot:r.slot},k("img",n)))}}function Sa(e,t,r){if(e.prices&&r){let n=k(r.tag,{slot:r.slot},e.prices);t.append(n)}}function Aa(e,t,r){if(e.description&&r){let n=k(r.tag,{slot:r.slot},e.description);t.append(n)}}function Ta(e,t,r,n){let i=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML);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--${n}`,c=ga.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 _a(e,t,r,n){let o="fill";r&&(o="outline");let i=k("sp-button",{treatment:o,variant:n,tabIndex:0,size:t.ctas.size??"m"},e);return i.addEventListener("click",a=>{a.target!==e&&(a.stopPropagation(),e.click())}),i}function La(e,t){return e.classList.add("con-button"),t&&e.classList.add("blue"),e}function Ca(e,t,r,n){if(e.ctas){let{slot:o}=r.ctas,i=k("div",{slot:o},e.ctas),a=[...i.querySelectorAll("a")].map(s=>{let c=s.parentElement.tagName==="STRONG";if(t.consonant)return La(s,c);let l=ua.exec(s.className)?.[0]??"accent",h=l.includes("accent"),f=l.includes("primary"),u=l.includes("secondary"),g=l.includes("-outline");if(l.includes("-link"))return s;let E;return h||c?E="accent":f?E="primary":u&&(E="secondary"),t.spectrum==="swc"?_a(s,r,g,E):Ta(s,r,g,E)});i.innerHTML="",i.append(...a),t.append(i)}}function Pa(e,t){let{tags:r}=e,n=r?.find(o=>o.startsWith(pa))?.split("/").pop();n&&(t.setAttribute(ot,n),t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]").forEach((o,i)=>{o.setAttribute(fa,`${o.dataset.analyticsId}-${i+1}`)}))}function Na(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(n=>{n.classList.remove(t),n.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}async function ho(e,t){let{fields:r}=e,{variant:n}=r;if(!n)return;t.querySelectorAll("[slot]").forEach(i=>{i.remove()}),t.removeAttribute("background-image"),t.removeAttribute("badge-background-color"),t.removeAttribute("badge-color"),t.removeAttribute("badge-text"),t.removeAttribute("size"),t.classList.remove("wide-strip"),t.classList.remove("thin-strip"),t.removeAttribute(ot),t.variant=n,await t.updateComplete;let{aemFragmentMapping:o}=t.variantLayout;o&&(xa(r,t,o.mnemonics),ba(r,t),va(r,t,o.size),ya(r,t,o.title),Ea(r,t,o.subtitle),Sa(r,t,o.prices),wa(r,t,o.backgroundImage),Aa(r,t,o.description),Ca(r,t,o,n),Pa(r,t),Na(t))}var Oa="merch-card",Ma=":start",Ha=":ready",Ia=1e4,mo="merch-card:",Ie,ar,d=class extends Ra{constructor(){super();Be(this,Ie);p(this,"customerSegment");p(this,"marketSegment");p(this,"variantLayout");this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this)}static getFragmentMapping(r){return $r[r]}firstUpdated(){this.variantLayout=Tt(this,!1),this.variantLayout?.connectedCallbackHook(),this.aemFragment?.updateComplete.catch(()=>{this.style.display="none"})}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout=Tt(this),this.variantLayout.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),this.variantLayout?.postCardUpdateHook(r)}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["twp","ccd-slice","ccd-suggested"].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('span[is="inline-price"]')}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll('a[is="checkout-link"]')??[]]}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let n=this.checkoutLinks;if(n.length!==0)for(let o of n){await o.onceSettled();let i=o.value?.[0]?.planType;if(!i)return;let a=this.stockOfferOsis[i];if(!a)return;let s=o.dataset.wcsOsi.split(",").filter(c=>c!==a);r.checked&&s.push(a),o.dataset.wcsOsi=s.join(",")}}handleQuantitySelection(r){let n=this.checkoutLinks;for(let o of n)o.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 n={...this.filters};Object.keys(n).forEach(o=>{if(r){n[o].order=Math.min(n[o].order||2,2);return}let i=n[o].order;i===1||isNaN(i)||(n[o].order=Number(i)+1)}),this.filters=n}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){super.connectedCallback();let r=this.querySelector("aem-fragment")?.getAttribute("fragment");performance.mark(`${mo}${r}${Ma}`),this.addEventListener(ft,this.handleQuantitySelection),this.addEventListener(vr,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.storageOptions?.addEventListener("change",this.handleStorageChange),this.addEventListener(Fe,this.handleAemFragmentEvents),this.addEventListener(ze,this.handleAemFragmentEvents),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(ft,this.handleQuantitySelection),this.storageOptions?.removeEventListener(pt,this.handleStorageChange),this.removeEventListener(Fe,this.handleAemFragmentEvents),this.removeEventListener(ze,this.handleAemFragmentEvents)}async handleAemFragmentEvents(r){if(r.type===Fe&&dt(this,Ie,ar).call(this,"AEM fragment cannot be loaded"),r.type===ze&&r.target.nodeName==="AEM-FRAGMENT"){let n=r.detail;await ho(n,this),this.checkReady()}}async checkReady(){let r=Promise.all([...this.querySelectorAll('span[is="inline-price"][data-wcs-osi],a[is="checkout-link"][data-wcs-osi]')].map(i=>i.onceSettled().catch(()=>i))).then(i=>i.every(a=>a.classList.contains("placeholder-resolved"))),n=new Promise(i=>setTimeout(()=>i(!1),Ia));if(await Promise.race([r,n])===!0){performance.mark(`${mo}${this.id}${Ha}`),this.dispatchEvent(new CustomEvent(wr,{bubbles:!0,composed:!0}));return}dt(this,Ie,ar).call(this,"Contains unresolved offers")}get aemFragment(){return this.querySelector("aem-fragment")}get storageOptions(){return this.querySelector("sp-radio-group#storage")}get storageSpecificOfferSelect(){let r=this.storageOptions?.selected;if(r){let n=this.querySelector(`merch-offer-select[storage="${r}"]`);if(n)return n}return this.querySelector("merch-offer-select")}get offerSelect(){return this.storageOptions?this.storageSpecificOfferSelect:this.querySelector("merch-offer-select")}get quantitySelect(){return this.querySelector("merch-quantity-select")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll('a[is="checkout-link"].con-button')).length===2&&r&&r.parentElement.classList.add("footer-column")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||(this.dispatchEvent(new CustomEvent(yr,{bubbles:!0})),this.displayFooterElementsInColumn())}handleStorageChange(){let r=this.closest("merch-card")?.offerSelect.cloneNode(!0);r&&this.dispatchEvent(new CustomEvent(pt,{detail:{offerSelect:r},bubbles:!0}))}get dynamicPrice(){return this.querySelector('[slot="price"]')}selectMerchOffer(r){if(r===this.merchOffer)return;this.merchOffer=r;let n=this.dynamicPrice;if(r.price&&n){let o=r.price.cloneNode(!0);n.onceSettled?n.onceSettled().then(()=>{n.replaceWith(o)}):n.replaceWith(o)}}};Ie=new WeakSet,ar=function(r){this.dispatchEvent(new CustomEvent(Sr,{detail:r,bubbles:!0,composed:!0}))},p(d,"properties",{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},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"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:r=>{let[n,o,i]=r.split(",");return{PUF:n,ABM:o,M2M:i}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(n=>{let[o,i,a]=n.split(":"),s=Number(i);return[o,{order:isNaN(s)?void 0:s,size:a}]})),toAttribute:r=>Object.entries(r).map(([n,{order:o,size:i}])=>[n,o,i].filter(a=>a!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:ot,reflect:!0},loading:{type:String}}),p(d,"styles",[gr,Vr(),...xr()]);customElements.define(Oa,d); +`,X.MISSING_INTL_API,a);var V=r.getPluralRules(t,{type:h.pluralType}).select(u-(h.offset||0));M=h.options[V]||h.options.other}if(!M)throw new Yt(h.value,u,Object.keys(h.options),a);s.push.apply(s,Re(M.value,t,r,n,o,u-(h.offset||0)));continue}}return gi(s)}function bi(e,t){return t?v(v(v({},e||{}),t||{}),Object.keys(e).reduce(function(r,n){return r[n]=v(v({},e[n]),t[n]||{}),r},{})):e}function vi(e,t){return t?Object.keys(e).reduce(function(r,n){return r[n]=bi(e[n],t[n]),r},v({},e)):e}function Wt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}function yi(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Ce(function(){for(var t,r=[],n=0;n0?new Intl.Locale(r[0]):new Intl.Locale(typeof t=="string"?t:t[0])},e.__parse=An,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();var Nn=Cn;var Ei=/[0-9\-+#]/,wi=/[^\d\-+#]/g;function Rn(e){return e.search(Ei)}function Si(e="#.##"){let t={},r=e.length,n=Rn(e);t.prefix=n>0?e.substring(0,n):"";let o=Rn(e.split("").reverse().join("")),i=r-o,a=e.substring(i,i+1),s=i+(a==="."||a===","?1:0);t.suffix=o>0?e.substring(s,r):"",t.mask=e.substring(n,s),t.maskHasNegativeSign=t.mask.charAt(0)==="-",t.maskHasPositiveSign=t.mask.charAt(0)==="+";let c=t.mask.match(wi);return t.decimal=c&&c[c.length-1]||".",t.separator=c&&c[1]&&c[0]||",",c=t.mask.split(t.decimal),t.integer=c[0],t.fraction=c[1],t}function Ai(e,t,r){let n=!1,o={value:e};e<0&&(n=!0,o.value=-o.value),o.sign=n?"-":"",o.value=Number(o.value).toFixed(t.fraction&&t.fraction.length),o.value=Number(o.value).toString();let i=t.fraction&&t.fraction.lastIndexOf("0"),[a="0",s=""]=o.value.split(".");return(!s||s&&s.length<=i)&&(s=i<0?"":(+("0."+s)).toFixed(i+1).replace("0.","")),o.integer=a,o.fraction=s,Ti(o,t),(o.result==="0"||o.result==="")&&(n=!1,o.sign=""),!n&&t.maskHasPositiveSign?o.sign="+":n&&t.maskHasPositiveSign?o.sign="-":n&&(o.sign=r&&r.enforceMaskSign&&!t.maskHasNegativeSign?"":"-"),o}function Ti(e,t){e.result="";let r=t.integer.split(t.separator),n=r.join(""),o=n&&n.indexOf("0");if(o>-1)for(;e.integer.lengthe*12,Bn=(e,t)=>{let{start:r,end:n,displaySummary:{amount:o,duration:i,minProductQuantity:a,outcomeType:s}={}}=e;if(!(o&&i&&s&&a))return!1;let c=t?new Date(t):new Date;if(!r||!n)return!1;let l=new Date(r),h=new Date(n);return c>=l&&c<=h},K={MONTH:"MONTH",YEAR:"YEAR"},Pi={[_.ANNUAL]:12,[_.MONTHLY]:1,[_.THREE_YEARS]:36,[_.TWO_YEARS]:24},Xt=(e,t)=>({accept:e,round:t}),Ci=[Xt(({divisor:e,price:t})=>t%e==0,({divisor:e,price:t})=>t/e),Xt(({usePrecision:e})=>e,({divisor:e,price:t})=>Math.round(t/e*100)/100),Xt(()=>!0,({divisor:e,price:t})=>Math.ceil(Math.floor(t*100/e)/100))],Kt={[C.YEAR]:{[_.MONTHLY]:K.MONTH,[_.ANNUAL]:K.YEAR},[C.MONTH]:{[_.MONTHLY]:K.MONTH}},Ni=(e,t)=>e.indexOf(`'${t}'`)===0,Ri=(e,t=!0)=>{let r=e.replace(/'.*?'/,"").trim(),n=Un(r);return!!n?t||(r=r.replace(/[,\.]0+/,n)):r=r.replace(/\s?(#.*0)(?!\s)?/,"$&"+Mi(e)),r},Oi=e=>{let t=Hi(e),r=Ni(e,t),n=e.replace(/'.*?'/,""),o=In.test(n)||kn.test(n);return{currencySymbol:t,isCurrencyFirst:r,hasCurrencySpace:o}},Dn=e=>e.replace(In,Hn).replace(kn,Hn),Mi=e=>e.match(/#(.?)#/)?.[1]===Mn?Li:Mn,Hi=e=>e.match(/'(.*?)'/)?.[1]??"",Un=e=>e.match(/0(.?)0/)?.[1]??"";function fe({formatString:e,price:t,usePrecision:r,isIndianPrice:n=!1},o,i=a=>a){let{currencySymbol:a,isCurrencyFirst:s,hasCurrencySpace:c}=Oi(e),l=r?Un(e):"",h=Ri(e,r),f=r?2:0,u=i(t,{currencySymbol:a}),g=n?u.toLocaleString("hi-IN",{minimumFractionDigits:f,maximumFractionDigits:f}):On(h,u),b=r?g.lastIndexOf(l):g.length,E=g.substring(0,b),R=g.substring(b+1);return{accessiblePrice:e.replace(/'.*?'/,"SYMBOL").replace(/#.*0/,g).replace(/SYMBOL/,a),currencySymbol:a,decimals:R,decimalsDelimiter:l,hasCurrencySpace:c,integer:E,isCurrencyFirst:s,recurrenceTerm:o}}var Gn=e=>{let{commitment:t,term:r,usePrecision:n}=e,o=Pi[r]??1;return fe(e,o>1?K.MONTH:Kt[t]?.[r],i=>{let a={divisor:o,price:i,usePrecision:n},{round:s}=Ci.find(({accept:c})=>c(a));if(!s)throw new Error(`Missing rounding rule for: ${JSON.stringify(a)}`);return s(a)})},zn=({commitment:e,term:t,...r})=>fe(r,Kt[e]?.[t]),Fn=e=>{let{commitment:t,instant:r,price:n,originalPrice:o,priceWithoutDiscount:i,promotion:a,quantity:s=1,term:c}=e;if(t===C.YEAR&&c===_.MONTHLY){if(!a)return fe(e,K.YEAR,qt);let{displaySummary:{outcomeType:l,duration:h,minProductQuantity:f=1}={}}=a;switch(l){case"PERCENTAGE_DISCOUNT":if(s>=f&&Bn(a,r)){let u=parseInt(h.replace("P","").replace("M",""));if(isNaN(u))return qt(n);let g=s*o*u,b=s*i*(12-u),E=Math.floor((g+b)*100)/100;return fe({...e,price:E},K.YEAR)}default:return fe(e,K.YEAR,()=>qt(i??n))}}return fe(e,Kt[t]?.[c])};var Ii={recurrenceLabel:"{recurrenceTerm, select, MONTH {/mo} YEAR {/yr} other {}}",recurrenceAriaLabel:"{recurrenceTerm, select, MONTH {per month} YEAR {per year} other {}}",perUnitLabel:"{perUnit, select, LICENSE {per license} other {}}",perUnitAriaLabel:"{perUnit, select, LICENSE {per license} other {}}",freeLabel:"Free",freeAriaLabel:"Free",taxExclusiveLabel:"{taxTerm, select, GST {excl. GST} VAT {excl. VAT} TAX {excl. tax} IVA {excl. IVA} SST {excl. SST} KDV {excl. KDV} other {}}",taxInclusiveLabel:"{taxTerm, select, GST {incl. GST} VAT {incl. VAT} TAX {incl. tax} IVA {incl. IVA} SST {incl. SST} KDV {incl. KDV} other {}}",alternativePriceAriaLabel:"Alternatively at {alternativePrice}",strikethroughAriaLabel:"Regularly at {strikethroughPrice}"},ki=Kr("ConsonantTemplates/price"),Bi=/<\/?[^>]+(>|$)/g,L={container:"price",containerOptical:"price-optical",containerStrikethrough:"price-strikethrough",containerAnnual:"price-annual",containerAnnualPrefix:"price-annual-prefix",containerAnnualSuffix:"price-annual-suffix",disabled:"disabled",currencySpace:"price-currency-space",currencySymbol:"price-currency-symbol",decimals:"price-decimals",decimalsDelimiter:"price-decimals-delimiter",integer:"price-integer",recurrence:"price-recurrence",taxInclusivity:"price-tax-inclusivity",unitType:"price-unit-type"},Z={perUnitLabel:"perUnitLabel",perUnitAriaLabel:"perUnitAriaLabel",recurrenceLabel:"recurrenceLabel",recurrenceAriaLabel:"recurrenceAriaLabel",taxExclusiveLabel:"taxExclusiveLabel",taxInclusiveLabel:"taxInclusiveLabel",strikethroughAriaLabel:"strikethroughAriaLabel"},Di="TAX_EXCLUSIVE",Ui=e=>Xr(e)?Object.entries(e).filter(([,t])=>Se(t)||Rt(t)||t===!0).reduce((t,[r,n])=>t+` ${r}${n===!0?"":'="'+Wr(n)+'"'}`,""):"",N=(e,t,r,n=!1)=>`${n?Dn(t):t??""}`;function Gi(e,{accessibleLabel:t,currencySymbol:r,decimals:n,decimalsDelimiter:o,hasCurrencySpace:i,integer:a,isCurrencyFirst:s,recurrenceLabel:c,perUnitLabel:l,taxInclusivityLabel:h},f={}){let u=N(L.currencySymbol,r),g=N(L.currencySpace,i?" ":""),b="";return s&&(b+=u+g),b+=N(L.integer,a),b+=N(L.decimalsDelimiter,o),b+=N(L.decimals,n),s||(b+=g+u),b+=N(L.recurrence,c,null,!0),b+=N(L.unitType,l,null,!0),b+=N(L.taxInclusivity,h,!0),N(e,b,{...f,"aria-label":t})}var I=({displayOptical:e=!1,displayStrikethrough:t=!1,displayAnnual:r=!1,instant:n=void 0}={})=>({country:o,displayFormatted:i=!0,displayRecurrence:a=!0,displayPerUnit:s=!1,displayTax:c=!1,language:l,literals:h={},quantity:f=1}={},{commitment:u,offerSelectorIds:g,formatString:b,price:E,priceWithoutDiscount:R,taxDisplay:G,taxTerm:B,term:M,usePrecision:V,promotion:D}={},j={})=>{Object.entries({country:o,formatString:b,language:l,price:E}).forEach(([U,ct])=>{if(ct==null)throw new Error(`Argument "${U}" is missing for osi ${g?.toString()}, country ${o}, language ${l}`)});let ke={...Ii,...h},uo=`${l.toLowerCase()}-${o.toUpperCase()}`;function ee(U,ct){let lt=ke[U];if(lt==null)return"";try{return new Nn(lt.replace(Bi,""),uo).format(ct)}catch{return ki.error("Failed to format literal:",lt),""}}let po=t&&R?R:E,sr=e?Gn:zn;r&&(sr=Fn);let{accessiblePrice:fo,recurrenceTerm:it,...cr}=sr({commitment:u,formatString:b,instant:n,isIndianPrice:o==="IN",originalPrice:E,priceWithoutDiscount:R,price:e?E:po,promotion:D,quantity:f,term:M,usePrecision:V}),te=fo,at="";if(O(a)&&it){let U=ee(Z.recurrenceAriaLabel,{recurrenceTerm:it});U&&(te+=" "+U),at=ee(Z.recurrenceLabel,{recurrenceTerm:it})}let st="";if(O(s)){st=ee(Z.perUnitLabel,{perUnit:"LICENSE"});let U=ee(Z.perUnitAriaLabel,{perUnit:"LICENSE"});U&&(te+=" "+U)}let xe="";O(c)&&B&&(xe=ee(G===Di?Z.taxExclusiveLabel:Z.taxInclusiveLabel,{taxTerm:B}),xe&&(te+=" "+xe)),t&&(te=ee(Z.strikethroughAriaLabel,{strikethroughPrice:te}));let be=L.container;if(e&&(be+=" "+L.containerOptical),t&&(be+=" "+L.containerStrikethrough),r&&(be+=" "+L.containerAnnual),O(i))return Gi(be,{...cr,accessibleLabel:te,recurrenceLabel:at,perUnitLabel:st,taxInclusivityLabel:xe},j);let{currencySymbol:lr,decimals:go,decimalsDelimiter:xo,hasCurrencySpace:hr,integer:bo,isCurrencyFirst:vo}=cr,re=[bo,xo,go];vo?(re.unshift(hr?"\xA0":""),re.unshift(lr)):(re.push(hr?"\xA0":""),re.push(lr)),re.push(at,st,xe);let yo=re.join("");return N(be,yo,j)},$n=()=>(e,t,r)=>{let o=(e.displayOldPrice===void 0||O(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price;return`${I()(e,t,r)}${o?" "+I({displayStrikethrough:!0})(e,t,r):""}`},Vn=()=>(e,t,r)=>{let{instant:n}=e;try{n||(n=new URLSearchParams(document.location.search).get("instant")),n&&(n=new Date(n))}catch{n=void 0}let o={...e,displayTax:!1,displayPerUnit:!1};return`${(e.displayOldPrice===void 0||O(e.displayOldPrice))&&t.priceWithoutDiscount&&t.priceWithoutDiscount!=t.price?I({displayStrikethrough:!0})(o,t,r)+" ":""}${I()(e,t,r)}${N(L.containerAnnualPrefix," (")}${I({displayAnnual:!0,instant:n})(o,t,r)}${N(L.containerAnnualSuffix,")")}`},jn=()=>(e,t,r)=>{let n={...e,displayTax:!1,displayPerUnit:!1};return`${I()(e,t,r)}${N(L.containerAnnualPrefix," (")}${I({displayAnnual:!0})(n,t,r)}${N(L.containerAnnualSuffix,")")}`};var zi=I(),Fi=$n(),$i=I({displayOptical:!0}),Vi=I({displayStrikethrough:!0}),ji=I({displayAnnual:!0}),Yi=jn(),Wi=Vn();var qi=(e,t)=>{if(!(!Te(e)||!Te(t)))return Math.floor((t-e)/t*100)},Yn=()=>(e,t)=>{let{price:r,priceWithoutDiscount:n}=t,o=qi(r,n);return o===void 0?'':`${o}%`};var Xi=Yn();var{freeze:Oe}=Object,Zt=Oe({...Ee}),Qt=Oe({...we}),Jt={STAGE:"STAGE",PRODUCTION:"PRODUCTION",LOCAL:"LOCAL"},vd=Oe({...C}),yd=Oe({...rn}),Ed=Oe({..._});var qn="mas-commerce-service";function Xn(e,{once:t=!1}={}){let r=null;function n(){let o=document.querySelector(qn);o!==r&&(r=o,o&&e(o))}return document.addEventListener(ut,n,{once:t}),Me(n),()=>document.removeEventListener(ut,n)}function Kn(e,{country:t,forceTaxExclusive:r,perpetual:n}){let o;if(e.length<2)o=e;else{let i=t==="GB"||n?"EN":"MULT",[a,s]=e;o=[a.language===i?a:s]}return r&&(o=o.map(Mt)),o}var Me=e=>window.setTimeout(e);function Q(){return document.getElementsByTagName(qn)?.[0]}var J={clientId:"merch-at-scale",delimiter:"\xB6",ignoredProperties:["analytics","literals"],serializableTypes:["Array","Object"],sampleRate:1,tags:"acom",isProdDomain:!1},Zn=1e3,Qn=new Set;function Qi(e){return e instanceof Error||typeof e?.originatingRequest=="string"}function Jn(e){if(e==null)return;let t=typeof e;if(t==="function")return e.name?`function ${e.name}`:"function";if(t==="object"){if(e instanceof Error)return e.message;if(typeof e.originatingRequest=="string"){let{message:n,originatingRequest:o,status:i}=e;return[n,i,o].filter(Boolean).join(" ")}let r=e[Symbol.toStringTag]??Object.getPrototypeOf(e).constructor.name;if(!J.serializableTypes.includes(r))return r}return e}function Ji(e,t){if(!J.ignoredProperties.includes(e))return Jn(t)}var er={append(e){if(e.level!=="error")return;let{message:t,params:r}=e,n=[],o=[],i=t;r.forEach(l=>{l!=null&&(Qi(l)?n:o).push(l)}),n.length&&(i+=" "+n.map(Jn).join(" "));let{pathname:a,search:s}=window.location,c=`${J.delimiter}page=${a}${s}`;c.length>Zn&&(c=`${c.slice(0,Zn)}`),i+=c,o.length&&(i+=`${J.delimiter}facts=`,i+=JSON.stringify(o,Ji)),Qn.has(i)||(Qn.add(i),window.lana?.log(i,J))}};function eo(e){Object.assign(J,Object.fromEntries(Object.entries(e).filter(([t,r])=>t in J&&r!==""&&r!==null&&r!==void 0&&!Number.isNaN(r))))}var ea=Object.freeze({checkoutClientId:"adobe_com",checkoutWorkflow:Zt.V3,checkoutWorkflowStep:Qt.EMAIL,country:"US",displayOldPrice:!0,displayPerUnit:!1,displayRecurrence:!0,displayTax:!1,env:Jt.PRODUCTION,forceTaxExclusive:!1,language:"en",entitlement:!1,extraOptions:{},modal:!1,promotionCode:"",quantity:1,wcsApiKey:"wcms-commerce-ims-ro-user-milo",wcsBufferDelay:1,wcsURL:"https://www.adobe.com/web_commerce_artifact",landscape:gt.PUBLISHED,wcsBufferLimit:1});var tr=Object.freeze({LOCAL:"local",PROD:"prod",STAGE:"stage"});var rr={DEBUG:"debug",ERROR:"error",INFO:"info",WARN:"warn"},ta=Date.now(),nr=new Set,or=new Set,to=new Map,ro={append({level:e,message:t,params:r,timestamp:n,source:o}){console[e](`${n}ms [${o}] %c${t}`,"font-weight: bold;",...r)}},no={filter:({level:e})=>e!==rr.DEBUG},ra={filter:()=>!1};function na(e,t,r,n,o){return{level:e,message:t,namespace:r,get params(){return n.length===1&&Ae(n[0])&&(n=n[0](),Array.isArray(n)||(n=[n])),n},source:o,timestamp:Date.now()-ta}}function oa(e){[...or].every(t=>t(e))&&nr.forEach(t=>t(e))}function oo(e){let t=(to.get(e)??0)+1;to.set(e,t);let r=`${e} #${t}`,n={id:r,namespace:e,module:o=>oo(`${n.namespace}/${o}`),updateConfig:eo};return Object.values(rr).forEach(o=>{n[o]=(i,...a)=>oa(na(o,i,e,a,r))}),Object.seal(n)}function rt(...e){e.forEach(t=>{let{append:r,filter:n}=t;Ae(n)&&or.add(n),Ae(r)&&nr.add(r)})}function ia(e={}){let{name:t}=e,r=O(ue("commerce.debug",{search:!0,storage:!0}),t===tr.LOCAL);return rt(r?ro:no),t===tr.PROD&&rt(er),ir}function aa(){nr.clear(),or.clear()}var ir={...oo(Cr),Level:rr,Plugins:{consoleAppender:ro,debugFilter:no,quietFilter:ra,lanaAppender:er},init:ia,reset:aa,use:rt};var sa={[F]:Ar,[Y]:Tr,[$]:_r},ca={[F]:Lr,[$]:Pr},nt=class{constructor(t){p(this,"changes",new Map);p(this,"connected",!1);p(this,"dispose",pe);p(this,"error");p(this,"log");p(this,"options");p(this,"promises",[]);p(this,"state",Y);p(this,"timer",null);p(this,"value");p(this,"version",0);p(this,"wrapperElement");this.wrapperElement=t}update(){[F,Y,$].forEach(t=>{this.wrapperElement.classList.toggle(sa[t],t===this.state)})}notify(){(this.state===$||this.state===F)&&(this.state===$?this.promises.forEach(({resolve:t})=>t(this.wrapperElement)):this.state===F&&this.promises.forEach(({reject:t})=>t(this.error)),this.promises=[]),this.wrapperElement.dispatchEvent(new CustomEvent(ca[this.state],{bubbles:!0}))}attributeChangedCallback(t,r,n){this.changes.set(t,n),this.requestUpdate()}connectedCallback(){this.dispose=Xn(()=>this.requestUpdate(!0))}disconnectedCallback(){this.connected&&(this.connected=!1,this.log?.debug("Disconnected:",{element:this.wrapperElement})),this.dispose(),this.dispose=pe}onceSettled(){let{error:t,promises:r,state:n}=this;return $===n?Promise.resolve(this.wrapperElement):F===n?Promise.reject(t):new Promise((o,i)=>{r.push({resolve:o,reject:i})})}toggleResolved(t,r,n){return t!==this.version?!1:(n!==void 0&&(this.options=n),this.state=$,this.value=r,this.update(),this.log?.debug("Resolved:",{element:this.wrapperElement,value:r}),Me(()=>this.notify()),!0)}toggleFailed(t,r,n){return t!==this.version?!1:(n!==void 0&&(this.options=n),this.error=r,this.state=F,this.update(),this.log?.error("Failed:",{element:this.wrapperElement,error:r}),Me(()=>this.notify()),!0)}togglePending(t){return this.version++,t&&(this.options=t),this.state=Y,this.update(),this.log?.debug("Pending:",{osi:this.wrapperElement?.options?.wcsOsi}),this.version}requestUpdate(t=!1){if(!this.wrapperElement.isConnected||!Q()||this.timer)return;let r=ir.module("mas-element"),{error:n,options:o,state:i,value:a,version:s}=this;this.state=Y,this.timer=Me(async()=>{this.timer=null;let c=null;if(this.changes.size&&(c=Object.fromEntries(this.changes.entries()),this.changes.clear()),this.connected?this.log?.debug("Updated:",{element:this.wrapperElement,changes:c}):(this.connected=!0,this.log?.debug("Connected:",{element:this.wrapperElement,changes:c})),c||t)try{await this.wrapperElement.render?.()===!1&&this.state===Y&&this.version===s&&(this.state=i,this.error=n,this.value=a,this.update(),this.notify())}catch(l){r.error("Failed to render mas-element: ",l),this.toggleFailed(this.version,l,o)}})}};function io(e={}){return Object.entries(e).forEach(([t,r])=>{(r==null||r===""||r?.length===0)&&delete e[t]}),e}function ao(e,t={}){let{tag:r,is:n}=e,o=document.createElement(r,{is:n});return o.setAttribute("is",n),Object.assign(o.dataset,io(t)),o}function so(e,t={}){return e instanceof HTMLElement?(Object.assign(e.dataset,io(t)),e):null}var la="download",ha="upgrade";function co(e,t={},r=""){let n=Q();if(!n)return null;let{checkoutMarketSegment:o,checkoutWorkflow:i,checkoutWorkflowStep:a,entitlement:s,upgrade:c,modal:l,perpetual:h,promotionCode:f,quantity:u,wcsOsi:g,extraOptions:b}=n.collectCheckoutOptions(t),E=ao(e,{checkoutMarketSegment:o,checkoutWorkflow:i,checkoutWorkflowStep:a,entitlement:s,upgrade:c,modal:l,perpetual:h,promotionCode:f,quantity:u,wcsOsi:g,extraOptions:b});return r&&(E.innerHTML=`${r}`),E}function lo(e){return class extends e{constructor(){super(...arguments);p(this,"checkoutActionHandler");p(this,"masElement",new nt(this))}attributeChangedCallback(n,o,i){this.masElement.attributeChangedCallback(n,o,i)}connectedCallback(){this.masElement.connectedCallback(),this.addEventListener("click",this.clickHandler)}disconnectedCallback(){this.masElement.disconnectedCallback(),this.removeEventListener("click",this.clickHandler)}onceSettled(){return this.masElement.onceSettled()}get value(){return this.masElement.value}get options(){return this.masElement.options}requestUpdate(n=!1){return this.masElement.requestUpdate(n)}static get observedAttributes(){return["data-checkout-workflow","data-checkout-workflow-step","data-extra-options","data-ims-country","data-perpetual","data-promotion-code","data-quantity","data-template","data-wcs-osi","data-entitlement","data-upgrade","data-modal"]}async render(n={}){if(!this.isConnected)return!1;let o=Q();if(!o)return!1;this.dataset.imsCountry||o.imsCountryPromise.then(f=>{f&&(this.dataset.imsCountry=f)},pe),n.imsCountry=null;let i=o.collectCheckoutOptions(n,this);if(!i.wcsOsi.length)return!1;let a;try{a=JSON.parse(i.extraOptions??"{}")}catch(f){this.masElement.log?.error("cannot parse exta checkout options",f)}let s=this.masElement.togglePending(i);this.setCheckoutUrl("");let c=o.resolveOfferSelectors(i),l=await Promise.all(c);l=l.map(f=>Kn(f,i)),i.country=this.dataset.imsCountry||i.country;let h=await o.buildCheckoutAction?.(l.flat(),{...a,...i},this);return this.renderOffers(l.flat(),i,{},h,s)}renderOffers(n,o,i={},a=void 0,s=void 0){if(!this.isConnected)return!1;let c=Q();if(!c)return!1;if(o={...JSON.parse(this.dataset.extraOptions??"null"),...o,...i},s??(s=this.masElement.togglePending(o)),this.checkoutActionHandler&&(this.checkoutActionHandler=void 0),a){this.classList.remove(la,ha),this.masElement.toggleResolved(s,n,o);let{url:h,text:f,className:u,handler:g}=a;return h&&this.setCheckoutUrl(h),f&&(this.firstElementChild.innerHTML=f),u&&this.classList.add(...u.split(" ")),g&&(this.setCheckoutUrl("#"),this.checkoutActionHandler=g.bind(this)),!0}else if(n.length){if(this.masElement.toggleResolved(s,n,o)){let h=c.buildCheckoutURL(n,o);return this.setCheckoutUrl(h),!0}}else{let h=new Error(`Not provided: ${o?.wcsOsi??"-"}`);if(this.masElement.toggleFailed(s,h,o))return this.setCheckoutUrl("#"),!0}}setCheckoutUrl(){}clickHandler(n){}updateOptions(n={}){let o=Q();if(!o)return!1;let{checkoutMarketSegment:i,checkoutWorkflow:a,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:h,perpetual:f,promotionCode:u,quantity:g,wcsOsi:b}=o.collectCheckoutOptions(n);return so(this,{checkoutMarketSegment:i,checkoutWorkflow:a,checkoutWorkflowStep:s,entitlement:c,upgrade:l,modal:h,perpetual:f,promotionCode:u,quantity:g,wcsOsi:b}),!0}}}var He=class He extends lo(HTMLButtonElement){static createCheckoutButton(t={},r=""){return co(He,t,r)}setCheckoutUrl(t){this.setAttribute("data-href",t)}get href(){return this.getAttribute("data-href")}get isCheckoutButton(){return!0}clickHandler(t){if(this.checkoutActionHandler){this.checkoutActionHandler?.(t);return}this.href&&(window.location.href=this.href)}};p(He,"is","checkout-button"),p(He,"tag","button");var ge=He;window.customElements.get(ge.is)||window.customElements.define(ge.is,ge,{extends:ge.tag});var ma="#000000",da="#F8D904",ua=/(accent|primary|secondary)(-(outline|link))?/,pa="mas:product_code/",fa="daa-ll",ot="daa-lh",ga=["XL","L","M","S"];function xa(e,t,r){e.mnemonicIcon?.map((o,i)=>({icon:o,alt:e.mnemonicAlt[i]??"",link:e.mnemonicLink[i]??""}))?.forEach(({icon:o,alt:i,link:a})=>{if(a&&!/^https?:/.test(a))try{a=new URL(`https://${a}`).href.toString()}catch{a="#"}let s={slot:"icons",src:o,loading:t.loading,size:r?.size??"l"};i&&(s.alt=i),a&&(s.href=a);let c=k("merch-icon",s);t.append(c)})}function ba(e,t){e.badge&&(t.setAttribute("badge-text",e.badge),t.setAttribute("badge-color",e.badgeColor||ma),t.setAttribute("badge-background-color",e.badgeBackgroundColor||da))}function va(e,t,r){r?.includes(e.size)&&t.setAttribute("size",e.size)}function ya(e,t,r){e.cardTitle&&r&&t.append(k(r.tag,{slot:r.slot},e.cardTitle))}function Ea(e,t,r){e.subtitle&&r&&t.append(k(r.tag,{slot:r.slot},e.subtitle))}function wa(e,t,r){if(e.backgroundImage){let n={loading:t.loading??"lazy",src:e.backgroundImage};if(e.backgroundImageAltText?n.alt=e.backgroundImageAltText:n.role="none",!r)return;if(r?.attribute){t.setAttribute(r.attribute,e.backgroundImage);return}t.append(k(r.tag,{slot:r.slot},k("img",n)))}}function Sa(e,t,r){if(e.prices&&r){let n=k(r.tag,{slot:r.slot},e.prices);t.append(n)}}function Aa(e,t,r){if(e.description&&r){let n=k(r.tag,{slot:r.slot},e.description);t.append(n)}}function Ta(e,t,r,n){let i=customElements.get("checkout-button").createCheckoutButton({},e.innerHTML);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--${n}`,c=ga.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 _a(e,t,r,n){let o="fill";r&&(o="outline");let i=k("sp-button",{treatment:o,variant:n,tabIndex:0,size:t.ctas.size??"m"},e);return i.addEventListener("click",a=>{a.target!==e&&(a.stopPropagation(),e.click())}),i}function La(e,t){return e.classList.add("con-button"),t&&e.classList.add("blue"),e}function Pa(e,t,r,n){if(e.ctas){let{slot:o}=r.ctas,i=k("div",{slot:o},e.ctas),a=[...i.querySelectorAll("a")].map(s=>{let c=s.parentElement.tagName==="STRONG";if(t.consonant)return La(s,c);let l=ua.exec(s.className)?.[0]??"accent",h=l.includes("accent"),f=l.includes("primary"),u=l.includes("secondary"),g=l.includes("-outline");if(l.includes("-link"))return s;let E;return h||c?E="accent":f?E="primary":u&&(E="secondary"),t.spectrum==="swc"?_a(s,r,g,E):Ta(s,r,g,E)});i.innerHTML="",i.append(...a),t.append(i)}}function Ca(e,t){let{tags:r}=e,n=r?.find(o=>o.startsWith(pa))?.split("/").pop();n&&(t.setAttribute(ot,n),t.querySelectorAll("a[data-analytics-id],button[data-analytics-id]").forEach((o,i)=>{o.setAttribute(fa,`${o.dataset.analyticsId}-${i+1}`)}))}function Na(e){e.spectrum==="css"&&[["primary-link","primary"],["secondary-link","secondary"]].forEach(([t,r])=>{e.querySelectorAll(`a.${t}`).forEach(n=>{n.classList.remove(t),n.classList.add("spectrum-Link",`spectrum-Link--${r}`)})})}async function ho(e,t){let{fields:r}=e,{variant:n}=r;if(!n)return;t.querySelectorAll("[slot]").forEach(i=>{i.remove()}),t.removeAttribute("background-image"),t.removeAttribute("badge-background-color"),t.removeAttribute("badge-color"),t.removeAttribute("badge-text"),t.removeAttribute("size"),t.classList.remove("wide-strip"),t.classList.remove("thin-strip"),t.removeAttribute(ot),t.variant=n,await t.updateComplete;let{aemFragmentMapping:o}=t.variantLayout;o&&(xa(r,t,o.mnemonics),ba(r,t),va(r,t,o.size),ya(r,t,o.title),Ea(r,t,o.subtitle),Sa(r,t,o.prices),wa(r,t,o.backgroundImage),Aa(r,t,o.description),Pa(r,t,o,n),Ca(r,t),Na(t))}var Oa="merch-card",Ma=":start",Ha=":ready",Ia=1e4,mo="merch-card:",Ie,ar,d=class extends Ra{constructor(){super();Be(this,Ie);p(this,"customerSegment");p(this,"marketSegment");p(this,"variantLayout");this.filters={},this.types="",this.selected=!1,this.spectrum="css",this.loading="lazy",this.handleAemFragmentEvents=this.handleAemFragmentEvents.bind(this)}static getFragmentMapping(r){return $r[r]}firstUpdated(){this.variantLayout=Tt(this,!1),this.variantLayout?.connectedCallbackHook(),this.aemFragment?.updateComplete.catch(()=>{this.style.display="none"})}willUpdate(r){(r.has("variant")||!this.variantLayout)&&(this.variantLayout=Tt(this),this.variantLayout.connectedCallbackHook())}updated(r){(r.has("badgeBackgroundColor")||r.has("borderColor"))&&this.style.setProperty("--consonant-merch-card-border",this.computedBorderStyle),this.variantLayout?.postCardUpdateHook(r)}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["twp","ccd-slice","ccd-suggested"].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('span[is="inline-price"]')}get checkoutLinks(){return[...this.footerSlot?.querySelectorAll('a[is="checkout-link"]')??[]]}async toggleStockOffer({target:r}){if(!this.stockOfferOsis)return;let n=this.checkoutLinks;if(n.length!==0)for(let o of n){await o.onceSettled();let i=o.value?.[0]?.planType;if(!i)return;let a=this.stockOfferOsis[i];if(!a)return;let s=o.dataset.wcsOsi.split(",").filter(c=>c!==a);r.checked&&s.push(a),o.dataset.wcsOsi=s.join(",")}}handleQuantitySelection(r){let n=this.checkoutLinks;for(let o of n)o.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 n={...this.filters};Object.keys(n).forEach(o=>{if(r){n[o].order=Math.min(n[o].order||2,2);return}let i=n[o].order;i===1||isNaN(i)||(n[o].order=Number(i)+1)}),this.filters=n}includes(r){return this.textContent.match(new RegExp(r,"i"))!==null}connectedCallback(){super.connectedCallback();let r=this.querySelector("aem-fragment")?.getAttribute("fragment");performance.mark(`${mo}${r}${Ma}`),this.addEventListener(ft,this.handleQuantitySelection),this.addEventListener(vr,this.merchCardReady,{once:!0}),this.updateComplete.then(()=>{this.merchCardReady()}),this.storageOptions?.addEventListener("change",this.handleStorageChange),this.addEventListener(Fe,this.handleAemFragmentEvents),this.addEventListener(ze,this.handleAemFragmentEvents),this.aemFragment||setTimeout(()=>this.checkReady(),0)}disconnectedCallback(){super.disconnectedCallback(),this.variantLayout?.disconnectedCallbackHook(),this.removeEventListener(ft,this.handleQuantitySelection),this.storageOptions?.removeEventListener(pt,this.handleStorageChange),this.removeEventListener(Fe,this.handleAemFragmentEvents),this.removeEventListener(ze,this.handleAemFragmentEvents)}async handleAemFragmentEvents(r){if(r.type===Fe&&dt(this,Ie,ar).call(this,"AEM fragment cannot be loaded"),r.type===ze&&r.target.nodeName==="AEM-FRAGMENT"){let n=r.detail;await ho(n,this),this.checkReady()}}async checkReady(){let r=Promise.all([...this.querySelectorAll('span[is="inline-price"][data-wcs-osi],a[is="checkout-link"][data-wcs-osi]')].map(i=>i.onceSettled().catch(()=>i))).then(i=>i.every(a=>a.classList.contains("placeholder-resolved"))),n=new Promise(i=>setTimeout(()=>i(!1),Ia));if(await Promise.race([r,n])===!0){performance.mark(`${mo}${this.id}${Ha}`),this.dispatchEvent(new CustomEvent(wr,{bubbles:!0,composed:!0}));return}dt(this,Ie,ar).call(this,"Contains unresolved offers")}get aemFragment(){return this.querySelector("aem-fragment")}get storageOptions(){return this.querySelector("sp-radio-group#storage")}get storageSpecificOfferSelect(){let r=this.storageOptions?.selected;if(r){let n=this.querySelector(`merch-offer-select[storage="${r}"]`);if(n)return n}return this.querySelector("merch-offer-select")}get offerSelect(){return this.storageOptions?this.storageSpecificOfferSelect:this.querySelector("merch-offer-select")}get quantitySelect(){return this.querySelector("merch-quantity-select")}displayFooterElementsInColumn(){if(!this.classList.contains("product"))return;let r=this.shadowRoot.querySelector(".secure-transaction-label");(this.footerSlot?.querySelectorAll('a[is="checkout-link"].con-button')).length===2&&r&&r.parentElement.classList.add("footer-column")}merchCardReady(){this.offerSelect&&!this.offerSelect.planType||(this.dispatchEvent(new CustomEvent(yr,{bubbles:!0})),this.displayFooterElementsInColumn())}handleStorageChange(){let r=this.closest("merch-card")?.offerSelect.cloneNode(!0);r&&this.dispatchEvent(new CustomEvent(pt,{detail:{offerSelect:r},bubbles:!0}))}get dynamicPrice(){return this.querySelector('[slot="price"]')}selectMerchOffer(r){if(r===this.merchOffer)return;this.merchOffer=r;let n=this.dynamicPrice;if(r.price&&n){let o=r.price.cloneNode(!0);n.onceSettled?n.onceSettled().then(()=>{n.replaceWith(o)}):n.replaceWith(o)}}};Ie=new WeakSet,ar=function(r){this.dispatchEvent(new CustomEvent(Sr,{detail:r,bubbles:!0,composed:!0}))},p(d,"properties",{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},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"},customHr:{type:Boolean,attribute:"custom-hr"},consonant:{type:Boolean,attribute:"consonant"},spectrum:{type:String,attribute:"spectrum"},detailBg:{type:String,attribute:"detail-bg"},secureLabel:{type:String,attribute:"secure-label"},checkboxLabel:{type:String,attribute:"checkbox-label"},selected:{type:Boolean,attribute:"aria-selected",reflect:!0},storageOption:{type:String,attribute:"storage",reflect:!0},stockOfferOsis:{type:Object,attribute:"stock-offer-osis",converter:{fromAttribute:r=>{let[n,o,i]=r.split(",");return{PUF:n,ABM:o,M2M:i}}}},filters:{type:String,reflect:!0,converter:{fromAttribute:r=>Object.fromEntries(r.split(",").map(n=>{let[o,i,a]=n.split(":"),s=Number(i);return[o,{order:isNaN(s)?void 0:s,size:a}]})),toAttribute:r=>Object.entries(r).map(([n,{order:o,size:i}])=>[n,o,i].filter(a=>a!=null).join(":")).join(",")}},types:{type:String,attribute:"types",reflect:!0},merchOffer:{type:Object},analyticsId:{type:String,attribute:ot,reflect:!0},loading:{type:String}}),p(d,"styles",[gr,Vr(),...xr()]);customElements.define(Oa,d); diff --git a/libs/features/mas/dist/mas.js b/libs/features/mas/dist/mas.js index ff69a700fc..eb07d00c36 100644 --- a/libs/features/mas/dist/mas.js +++ b/libs/features/mas/dist/mas.js @@ -349,7 +349,7 @@ merch-card[variant="catalog"] .payment-details { font-style: italic; font-weight: 400; line-height: var(--consonant-merch-card-body-line-height); -}`;var jn={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"}},nt=class extends I{constructor(r){super(r);p(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(kn,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});p(this,"toggleActionMenu",r=>{if(!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter")return;r.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let n=this.actionMenuContentSlot.classList.contains("hidden");n||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!n).toString())});p(this,"toggleActionMenuFromCard",r=>{let n=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(n||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",n),this.setAriaExpanded(this.actionMenu,"false"))});p(this,"hideActionMenu",r=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")});p(this,"focusEventHandler",r=>{this.actionMenu&&(this.actionMenu.classList.add("always-visible"),(r.relatedTarget?.nodeName==="MERCH-CARD-COLLECTION"||r.relatedTarget?.nodeName==="MERCH-CARD"&&r.target.nodeName!=="MERCH-ICON")&&this.actionMenu.classList.remove("always-visible"))})}get aemFragmentMapping(){return jn}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return x`
+}`;var jn={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"}},nt=class extends I{constructor(r){super(r);p(this,"dispatchActionMenuToggle",()=>{this.card.dispatchEvent(new CustomEvent(kn,{bubbles:!0,composed:!0,detail:{card:this.card.name,type:"action-menu"}}))});p(this,"toggleActionMenu",r=>{if(!this.actionMenuContentSlot||!r||r.type!=="click"&&r.code!=="Space"&&r.code!=="Enter")return;r.preventDefault(),this.actionMenuContentSlot.classList.toggle("hidden");let n=this.actionMenuContentSlot.classList.contains("hidden");n||this.dispatchActionMenuToggle(),this.setAriaExpanded(this.actionMenu,(!n).toString())});p(this,"toggleActionMenuFromCard",r=>{let n=r?.type==="mouseleave"?!0:void 0;this.card.blur(),this.actionMenu?.classList.remove("always-visible"),this.actionMenuContentSlot&&(n||this.dispatchActionMenuToggle(),this.actionMenuContentSlot.classList.toggle("hidden",n),this.setAriaExpanded(this.actionMenu,"false"))});p(this,"hideActionMenu",r=>{this.actionMenuContentSlot?.classList.add("hidden"),this.setAriaExpanded(this.actionMenu,"false")})}get aemFragmentMapping(){return jn}get actionMenu(){return this.card.shadowRoot.querySelector(".action-menu")}get actionMenuContentSlot(){return this.card.shadowRoot.querySelector('slot[name="action-menu-content"]')}renderLayout(){return x`
${this.badge}
`:""}
${this.secureLabelFooter} - `}getGlobalCSS(){return Fo}setAriaExpanded(r,n){r.setAttribute("aria-expanded",n)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.addEventListener("focusout",this.focusEventHandler)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard),this.card.removeEventListener("focusout",this.focusEventHandler)}};p(nt,"variantStyle",C` + `}getGlobalCSS(){return Fo}setAriaExpanded(r,n){r.setAttribute("aria-expanded",n)}connectedCallbackHook(){this.card.addEventListener("mouseleave",this.toggleActionMenuFromCard)}disconnectedCallbackHook(){this.card.removeEventListener("mouseleave",this.toggleActionMenuFromCard)}};p(nt,"variantStyle",C` :host([variant='catalog']) { min-height: 330px; width: var(--consonant-merch-card-catalog-width); diff --git a/libs/features/mas/src/variants/catalog.js b/libs/features/mas/src/variants/catalog.js index 6b72fec541..f671007474 100644 --- a/libs/features/mas/src/variants/catalog.js +++ b/libs/features/mas/src/variants/catalog.js @@ -117,28 +117,16 @@ export class Catalog extends VariantLayout { this.setAriaExpanded(this.actionMenu, 'false'); } - focusEventHandler = (e) => { - if (!this.actionMenu) return; - - this.actionMenu.classList.add('always-visible'); - if (e.relatedTarget?.nodeName === 'MERCH-CARD-COLLECTION' - || (e.relatedTarget?.nodeName === 'MERCH-CARD' && e.target.nodeName !== 'MERCH-ICON')) { - this.actionMenu.classList.remove('always-visible'); - } - }; - setAriaExpanded(element, value) { element.setAttribute('aria-expanded', value); } connectedCallbackHook() { this.card.addEventListener('mouseleave', this.toggleActionMenuFromCard); - this.card.addEventListener('focusout', this.focusEventHandler); } disconnectedCallbackHook() { this.card.removeEventListener('mouseleave', this.toggleActionMenuFromCard); - this.card.removeEventListener('focusout', this.focusEventHandler); } static variantStyle = css` diff --git a/libs/features/mas/test/merch-card.catalog.test.html.js b/libs/features/mas/test/merch-card.catalog.test.html.js index d63297bf03..9c604d62a3 100644 --- a/libs/features/mas/test/merch-card.catalog.test.html.js +++ b/libs/features/mas/test/merch-card.catalog.test.html.js @@ -54,7 +54,6 @@ runTests(async () => { const catalogCard = document.querySelector( 'merch-card[variant="catalog"]', ); - const mouseoverEvent = new MouseEvent('mouseover', { bubbles: true }); const mouseleaveEvent = new MouseEvent('mouseleave', { bubbles: true }); const focusoutEvent = new Event('focusout'); catalogCard.dispatchEvent(mouseleaveEvent); diff --git a/test/blocks/merch-card/merch-card.test.js b/test/blocks/merch-card/merch-card.test.js index b0e1eea7f8..b3fc2a7fc0 100644 --- a/test/blocks/merch-card/merch-card.test.js +++ b/test/blocks/merch-card/merch-card.test.js @@ -1,3 +1,4 @@ +import { sendKeys, setViewport } from '@web/test-runner-commands'; import { expect } from '@esm-bundle/chai'; import { decorateLinks, loadStyle, setConfig } from '../../../libs/utils/utils.js'; import { mockFetch, readMockText } from '../merch/mocks/fetch.js'; @@ -168,6 +169,22 @@ describe('Catalog Card', () => { }); }); + it('Action menu visible', async () => { + document.body.innerHTML = await readMockText('/test/blocks/merch-card/mocks/catalog-action-menu-only.html'); + await setViewport({ width: 1025, height: 640 }); + const merchCard = await init(document.querySelector('.merch-card.ribbon')); + const actionMenu = merchCard.shadowRoot.querySelector('.action-menu'); + merchCard.dispatchEvent(new Event('focusin')); + expect(actionMenu.classList.contains('always-visible')).to.be.true; + await sendKeys({ press: 'Tab' }); + await sendKeys({ press: 'Tab' }); + await sendKeys({ press: 'Tab' }); + await sendKeys({ press: 'Tab' }); + await sendKeys({ press: 'Tab' }); + await sendKeys({ press: 'Tab' }); + expect(actionMenu.classList.contains('always-visible')).to.be.false; + }); + it('Supports Catalog card without badge', async () => { document.body.innerHTML = await readMockText('/test/blocks/merch-card/mocks/catalog.html'); const merchCard = await init(document.querySelector('.merch-card.catalog.empty-badge')); diff --git a/test/blocks/merch-card/mocks/catalog-action-menu-only.html b/test/blocks/merch-card/mocks/catalog-action-menu-only.html new file mode 100644 index 0000000000..9f50b5b1ff --- /dev/null +++ b/test/blocks/merch-card/mocks/catalog-action-menu-only.html @@ -0,0 +1,43 @@ + +
+
+
+
#EDCC2D, #000000
+
LOREM IPSUM DOLOR
+
+
+
+

Best for:

+
    +
  • Photo editing
  • +
  • Compositing
  • +
  • Drawing and painting
  • +
  • Graphic design
  • +
+

Storage:

+

100 GB of cloud storage

+

See system requirements

+
+
+
+
+ + + + + + +

Get 10% off Photoshop.

+

INDIVIDUALS

+
this promo is great see terms
+

Create gorgeous images, rich graphics, and incredible art. Save 10% for the first year. Ends Mar 20.

+

See terms

+

Learn More Save now

+
+
+
+
From 4624e9b607dd6b6da956158d56fe8af3e9374308 Mon Sep 17 00:00:00 2001 From: Dev Ashish Saradhana <41122199+Deva309@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:04:46 +0530 Subject: [PATCH 04/10] [MWPW-166884] - PEP Bug fix (#3601) * PEP Bug fix * Fixed reveiw comments * Fixed reveiw comments --- libs/features/webapp-prompt/webapp-prompt.js | 15 ++++++- .../webapp-prompt/mocks/pep-prompt-content.js | 7 ++-- test/features/webapp-prompt/test-utilities.js | 1 + .../webapp-prompt/webapp-prompt.test.js | 39 +++++++++++++++++-- 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/libs/features/webapp-prompt/webapp-prompt.js b/libs/features/webapp-prompt/webapp-prompt.js index 130f406e0c..517f2a713f 100644 --- a/libs/features/webapp-prompt/webapp-prompt.js +++ b/libs/features/webapp-prompt/webapp-prompt.js @@ -156,7 +156,7 @@ export class AppPrompt { this.parent.prepend(this.template); this.elements.closeIcon.focus(); - this.redirectFn = this.initRedirect(this.options['pause-on-hover'] === 'on'); + this.cleanupFn = this.initRedirect(this.options['pause-on-hover'] === 'on'); }; doesEntitlementMatch = async () => { @@ -309,6 +309,17 @@ export class AppPrompt { // Start the timeout initially startTimeout(); + + return () => { + clearTimeout(timeoutId); + if (withPause) { + const appPromptElem = document.querySelector(CONFIG.selectors.prompt); + if (appPromptElem) { + appPromptElem.removeEventListener('mouseenter', stopTimeout); + appPromptElem.removeEventListener('mouseleave', startTimeout); + } + } + }; }; isDismissedPrompt = () => AppPrompt.getDismissedPrompts().includes(this.id); @@ -321,8 +332,8 @@ export class AppPrompt { close = ({ saveDismissal = true, dismissalActions = true } = {}) => { const appPromptElem = document.querySelector(CONFIG.selectors.prompt); + this.cleanupFn(); appPromptElem?.remove(); - clearTimeout(this.redirectFn); if (saveDismissal) this.setDismissedPrompt(); document.removeEventListener('keydown', this.handleKeyDown); this.anchor?.focus(); diff --git a/test/features/webapp-prompt/mocks/pep-prompt-content.js b/test/features/webapp-prompt/mocks/pep-prompt-content.js index ad6b9cb6f5..ef7cda2664 100644 --- a/test/features/webapp-prompt/mocks/pep-prompt-content.js +++ b/test/features/webapp-prompt/mocks/pep-prompt-content.js @@ -7,6 +7,7 @@ export default ({ animationDuration, tooltipMessage, tooltipDuration, + pauseOnHover, }) => `

@@ -52,9 +53,9 @@ export default ({

dismissal-tooltip-duration
${tooltipDuration}
`} -
+ ${pauseOnHover === 'on' && `
pause-on-hover
-
on
-
+
${pauseOnHover}
+
`}
`; diff --git a/test/features/webapp-prompt/test-utilities.js b/test/features/webapp-prompt/test-utilities.js index 8c134d6058..e4e9ff749c 100644 --- a/test/features/webapp-prompt/test-utilities.js +++ b/test/features/webapp-prompt/test-utilities.js @@ -26,6 +26,7 @@ export const defaultConfig = { loaderDuration: 7500, redirectUrl: '#soup', productName: 'photoshop', + pauseOnHover: 'off', ...DISMISSAL_CONFIG, }; diff --git a/test/features/webapp-prompt/webapp-prompt.test.js b/test/features/webapp-prompt/webapp-prompt.test.js index 0fb7d61d5e..9caef729b6 100644 --- a/test/features/webapp-prompt/webapp-prompt.test.js +++ b/test/features/webapp-prompt/webapp-prompt.test.js @@ -144,31 +144,52 @@ describe('PEP', () => { describe('PEP interaction tests', () => { it('should close PEP on Escape key', async () => { + const clock = sinon.useFakeTimers(); await initPep({}); document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); + clock.tick(10000); expect(document.querySelector(allSelectors.pepWrapper)).to.not.exist; + expect(window.location.hash).to.not.equal('#soup'); + clock.uninstall(); }); it('should close PEP on clicking the close icon', async () => { + const clock = sinon.useFakeTimers(); await initPep({}); document.querySelector(allSelectors.closeIcon).click(); + clock.tick(10000); expect(document.querySelector(allSelectors.pepWrapper)).to.not.exist; + expect(window.location.hash).to.not.equal('#soup'); + clock.uninstall(); }); it('should close PEP on clicking the CTA', async () => { + const clock = sinon.useFakeTimers(); await initPep({}); document.querySelector(allSelectors.cta).click(); + clock.tick(10000); expect(document.querySelector(allSelectors.pepWrapper)).to.not.exist; + expect(window.location.hash).to.not.equal('#soup'); + clock.uninstall(); }); it('should close PEP on clicking the anchor element', async () => { + const clock = sinon.useFakeTimers(); await initPep({}); document.querySelector(allSelectors.appSwitcher).click(); + clock.tick(10000); expect(document.querySelector(allSelectors.pepWrapper)).to.not.exist; + expect(window.location.hash).to.not.equal('#soup'); + clock.uninstall(); }); - it('stops the PEP timer when PEP content is hovered', async () => { + it('stops the PEP timer when mouseenter event occur on PEP content with feature pause on hover', async () => { + sinon.restore(); const clock = sinon.useFakeTimers(); + stub(window, 'fetch').callsFake(async (url) => { + if (url.includes('pep-prompt-content.plain.html')) return mockRes({ payload: pepPromptContent({ ...defaultConfig, pauseOnHover: 'on' }) }); + return null; + }); await initPep({}); document.querySelector(allSelectors.pepWrapper).dispatchEvent(new Event('mouseenter')); clock.tick(10000); @@ -179,13 +200,23 @@ describe('PEP', () => { it('redirects when the PEP timer runs out', async () => { const clock = sinon.useFakeTimers(); await initPep({}); - expect(window.location.hash).to.not.equal('soup'); - clock.tick(10000); - expect(window.location.hash).to.equal('#soup'); + clock.uninstall(); + }); + it('redirects when the PEP timer runs out with pause on hover', async () => { + sinon.restore(); + const clock = sinon.useFakeTimers(); + stub(window, 'fetch').callsFake(async (url) => { + if (url.includes('pep-prompt-content.plain.html')) return mockRes({ payload: pepPromptContent({ ...defaultConfig, pauseOnHover: 'on' }) }); + return null; + }); + await initPep({}); + expect(window.location.hash).to.not.equal('soup'); + clock.tick(10000); + expect(window.location.hash).to.equal('#soup'); clock.uninstall(); }); }); From 2c06dd964266c5cf6ea888aa0115d92663db901f Mon Sep 17 00:00:00 2001 From: sonawanesnehal3 <152426902+sonawanesnehal3@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:04:53 +0530 Subject: [PATCH 05/10] MWPW-158537 : Upgrade Universal Nav to version 1.4 (#3604) * Unav upgrade 1.4 * Adding scopes for ProfileSwitching * Enabling new mobile tray experience * Updated for unav reload for mobile tray * Fixing profile switching * Adding unit tests * Adding UT * IDACTMGT-17106 and addressing review comments * Adding fix for MWPW-166074 * Adding additional checks * Adding additional checks --------- Co-authored-by: Snehal Sonawane Co-authored-by: Snehal Sonawane --- .../global-navigation/global-navigation.css | 1 - .../global-navigation/global-navigation.js | 37 ++++++++++++++----- libs/utils/utils.js | 2 +- .../global-navigation.test.js | 30 +++++++++++++++ .../global-navigation/test-utilities.js | 2 +- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/libs/blocks/global-navigation/global-navigation.css b/libs/blocks/global-navigation/global-navigation.css index dad2da2b13..f4552eb6d2 100644 --- a/libs/blocks/global-navigation/global-navigation.css +++ b/libs/blocks/global-navigation/global-navigation.css @@ -406,7 +406,6 @@ header.global-navigation { .feds-utilities .unav-comp-app-switcher-popover, /* App Switcher */ .feds-utilities .spectrum-Dialog-content, /* Notifications */ -.feds-utilities .unav-comp-external-profile, /* Profile */ .feds-utilities .unav-comp-help-popover, /* Help */ .feds-utilities .unc-overlay-container { /* Tooltips */ transform: translate3d(0,0,0); /* Fix Safari issues w/ position: sticky */ diff --git a/libs/blocks/global-navigation/global-navigation.js b/libs/blocks/global-navigation/global-navigation.js index 62e2d7e2bf..94be57cfc8 100644 --- a/libs/blocks/global-navigation/global-navigation.js +++ b/libs/blocks/global-navigation/global-navigation.js @@ -78,17 +78,32 @@ export const CONFIG = { name: 'profile', attributes: { isSignUpRequired: false, + messageEventListener: (event) => { + const { name, payload, executeDefaultAction } = event.detail; + if (!name || name !== 'System' || !payload || typeof executeDefaultAction !== 'function') return; + switch (payload.subType) { + case 'AppInitiated': + window.adobeProfile?.getUserProfile() + .then((data) => { setUserProfile(data); }) + .catch(() => { setUserProfile({}); }); + break; + case 'SignOut': + executeDefaultAction(); + break; + case 'ProfileSwitch': + Promise.resolve(executeDefaultAction()).then((profile) => { + if (profile) window.location.reload(); + }); + break; + default: + break; + } + }, componentLoaderConfig: { config: { enableLocalSection: true, + enableProfileSwitcher: true, miniAppContext: { - onMessage: (name, payload) => { - if (name === 'System' && payload.subType === 'AppInitiated') { - window.adobeProfile?.getUserProfile() - .then((data) => { setUserProfile(data); }) - .catch(() => { setUserProfile({}); }); - } - }, logger: { trace: () => {}, debug: () => {}, @@ -129,6 +144,7 @@ export const CONFIG = { callbacks: getConfig().jarvis?.callbacks, }, }, + cart: { name: 'cart' }, }, }, }; @@ -262,7 +278,7 @@ const closeOnClickOutside = (e, isLocalNav, navWrapper) => { const newMobileNav = getMetadata('mobile-gnav-v2') !== 'false'; if (!isDesktop.matches && !newMobileNav) return; - const openElemSelector = `${selectors.globalNav} [aria-expanded = "true"], ${selectors.localNav} [aria-expanded = "true"]`; + const openElemSelector = `${selectors.globalNav} [aria-expanded = "true"]:not(.universal-nav-container *), ${selectors.localNav} [aria-expanded = "true"]`; const isClickedElemOpen = [...document.querySelectorAll(openElemSelector)] .find((openItem) => openItem.parentElement.contains(e.target)); @@ -645,7 +661,7 @@ class Gnav { return 'linux'; }; - const unavVersion = new URLSearchParams(window.location.search).get('unavVersion') || '1.3'; + const unavVersion = new URLSearchParams(window.location.search).get('unavVersion') || '1.4'; await Promise.all([ loadScript(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.js`), loadStyles(`https://${environment}.adobeccstatic.com/unav/${unavVersion}/UniversalNav.css`, true), @@ -745,6 +761,7 @@ class Gnav { }, children: getChildren(), isSectionDividerRequired: getConfig()?.unav?.showSectionDivider, + showTrayExperience: (!isDesktop.matches), }); // Exposing UNAV config for consumers @@ -752,7 +769,7 @@ class Gnav { await window.UniversalNav(CONFIG.universalNav.universalNavConfig); this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); isDesktop.addEventListener('change', () => { - window.UniversalNav.reload(CONFIG.universalNav.universalNavConfig); + window.UniversalNav.reload(getConfiguration()); }); }; diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 4effacdb59..c63bd65f0f 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -1023,7 +1023,7 @@ export async function loadIms() { return; } const [unavMeta, ahomeMeta] = [getMetadata('universal-nav')?.trim(), getMetadata('adobe-home-redirect')]; - const defaultScope = `AdobeID,openid,gnav${unavMeta && unavMeta !== 'off' ? ',pps.read,firefly_api,additional_info.roles,read_organizations' : ''}`; + const defaultScope = `AdobeID,openid,gnav${unavMeta && unavMeta !== 'off' ? ',pps.read,firefly_api,additional_info.roles,read_organizations,account_cluster.read' : ''}`; const timeout = setTimeout(() => reject(new Error('IMS timeout')), imsTimeout || 5000); window.adobeid = { client_id: imsClientId, diff --git a/test/blocks/global-navigation/global-navigation.test.js b/test/blocks/global-navigation/global-navigation.test.js index 04f517ac7c..f7352f2d5b 100644 --- a/test/blocks/global-navigation/global-navigation.test.js +++ b/test/blocks/global-navigation/global-navigation.test.js @@ -398,6 +398,7 @@ describe('global navigation', () => { }); window.UniversalNav = sinon.spy(() => Promise.resolve()); window.UniversalNav.reload = sinon.spy(() => Promise.resolve()); + window.adobeProfile = { getUserProfile: sinon.spy(() => Promise.resolve({})) }; // eslint-disable-next-line no-underscore-dangle window._satellite = { track: sinon.spy() }; window.alloy = () => new Promise((resolve) => { @@ -432,6 +433,27 @@ describe('global navigation', () => { expect(window.UniversalNav.reload.getCall(0)).to.exist; }); + it('should handle message events correctly', async () => { + // eslint-disable-next-line max-len + const mockEvent = (name, payload) => ({ detail: { name, payload, executeDefaultAction: sinon.spy(() => Promise.resolve(null)) } }); + await createFullGlobalNavigation({ unavContent: 'on' }); + const messageEventListener = window.UniversalNav.getCall(0).args[0].children + .map((c) => c.attributes.messageEventListener) + .find((listener) => listener); + + const appInitiatedEvent = mockEvent('System', { subType: 'AppInitiated' }); + messageEventListener(appInitiatedEvent); + expect(window.adobeProfile.getUserProfile.called).to.be.true; + + const signOutEvent = mockEvent('System', { subType: 'SignOut' }); + messageEventListener(signOutEvent); + expect(signOutEvent.detail.executeDefaultAction.called).to.be.true; + + const profileSwitch = mockEvent('System', { subType: 'ProfileSwitch' }); + messageEventListener(profileSwitch); + expect(profileSwitch.detail.executeDefaultAction.called).to.be.true; + }); + it('should send the correct analytics events', async () => { await createFullGlobalNavigation({ unavContent: 'on' }); const analyticsFn = window.UniversalNav.getCall(0) @@ -486,6 +508,14 @@ describe('global navigation', () => { expect(getUniversalNavLocale({ prefix: data.prefix })).to.equal(data.expectedLocale); } }); + + it('should pass enableProfileSwitcher to the profile component configuration', async () => { + await createFullGlobalNavigation({ unavContent: 'on' }); + const profileConfig = window.UniversalNav.getCall(0).args[0].children + .find((c) => c.name === 'profile').attributes.componentLoaderConfig.config; + + expect(profileConfig.enableProfileSwitcher).to.be.true; + }); }); describe('small desktop', () => { diff --git a/test/blocks/global-navigation/test-utilities.js b/test/blocks/global-navigation/test-utilities.js index a32b195f48..0cd594ed52 100644 --- a/test/blocks/global-navigation/test-utilities.js +++ b/test/blocks/global-navigation/test-utilities.js @@ -80,7 +80,7 @@ export const analyticsTestData = { 'unc|click|markUnread': 'Mark Notification as unread', }; -export const unavVersion = '1.3'; +export const unavVersion = '1.4'; export const addMetaDataV2 = (value) => { const metaTag = document.createElement('meta'); From 661c750c70496b5450973af5acc2c9156b458785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Kosanovi=C4=87?= Date: Mon, 3 Feb 2025 11:35:00 +0100 Subject: [PATCH 06/10] [MWPW-164362] Table icon focus (#3456) * [MWPW-164362] table icon focus * [MWPW-164362] icon focus fix * [MWPW-164362] code removal * [MWPW-164362] pr comments fix * [MWPW-164362] revert table.css * [MWPW-164362] tooltip focus area increase * [MWPW-164362] fixes issue when icon is used inline * [MWPW-164362] css optimization * [MWPW-164362] adjusting margins for added width * [MWPW-164362] hover area color change * [MWPW-164362] tooltip top/bottom position fix --- libs/blocks/table/table.css | 17 ++++++++++------- libs/features/icons/icons.css | 14 ++++++++++++-- libs/styles/styles.css | 4 ++++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/libs/blocks/table/table.css b/libs/blocks/table/table.css index 103693b023..60d84fb6b7 100644 --- a/libs/blocks/table/table.css +++ b/libs/blocks/table/table.css @@ -323,25 +323,28 @@ /* icons */ .table:not(.merch) .row .col span.milo-tooltip { - margin-left: var(--spacing-xs); - margin-right: 0; + margin-right: -4px; } [dir='rtl'] .table:not(.merch) .row .col span.milo-tooltip { - margin-left: 0; - margin-right: var(--spacing-xs); + margin-right: 0; + margin-left: -4px; +} + +.table .milo-tooltip svg { + top: unset; } .table .icon-milo-info { height: 16px; } -.table .icon-milo-info:hover { +.table .icon-info:hover { cursor: pointer; } -.table .icon-milo-info:hover path, -.table .active .icon-milo-info path { +.table .icon-info:hover path, +.table .active .icon-info path { color: var(--hover-border-color); } diff --git a/libs/features/icons/icons.css b/libs/features/icons/icons.css index dda8bfdab4..636b92e0f4 100644 --- a/libs/features/icons/icons.css +++ b/libs/features/icons/icons.css @@ -2,6 +2,11 @@ position: relative; text-decoration: none; border-bottom: none; + min-width: 24px; + display: inline-flex; + min-height: 24px; + align-items: center; + justify-content: center; } .milo-tooltip::before { @@ -34,6 +39,11 @@ z-index: 10; } +.milo-tooltip.top::after, +.milo-tooltip.bottom::after { + margin-left: -8px; +} + .milo-tooltip.left::before { left: initial; margin: initial; @@ -51,7 +61,7 @@ } .milo-tooltip.top::before { - left: 50%; + left: calc(50% - 11px); transform: translateX(-50%) translateY(-100%); top: -10px; margin-bottom: 15px; @@ -66,7 +76,7 @@ } .milo-tooltip.bottom::before { - left: 50%; + left: calc(50% - 11px); transform: translateX(-50%); top: 100%; margin-top: 12px; diff --git a/libs/styles/styles.css b/libs/styles/styles.css index 3ded7f2dc0..14d2d4627f 100644 --- a/libs/styles/styles.css +++ b/libs/styles/styles.css @@ -574,6 +574,10 @@ span.icon.margin-inline-end { margin-inline-end: 8px; } span.icon.margin-inline-start { margin-inline-start: 8px; } +span.icon.milo-tooltip.margin-inline-end { margin-inline-end: 3px; } + +span.icon.milo-tooltip.margin-inline-start { margin-inline-start: 3px; } + .button-l .con-button span.icon.margin-left, .con-button.button-l span.icon.margin-left { margin-left: 12px; } From db010d8c74bc705d7069fd2540871f54ca48cbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Kosanovi=C4=87?= Date: Mon, 3 Feb 2025 11:35:07 +0100 Subject: [PATCH 07/10] [MWPW-165791] Table select aria-label and column cell role added (#3513) * [MWPW-165791] Table select aria-label and column cell role added * [MWPW-165791] test coverage fix * [MWPW-165791] future proofing function, mocking placeholders for test * [MWPW-165791] move contentRoot to config setup * [MWPW-165791] change of approach for cell, expandable icon a11y fixed * [MWPW-165791] adding end of file * [MWPW-165791] aria label code optimization * [MWPW-165791] lint issue fix * [MWPW-165791] optimization * [MWPW-165791] default table nala a11y added * [MWPW-165791] aria label tooltip added --- libs/blocks/table/table.js | 27 +++++++++++++++++++---- libs/features/icons/icons.js | 1 + nala/blocks/table/table.test.js | 5 +++++ test/blocks/table/mocks/placeholders.json | 8 +++++++ test/blocks/table/table.test.js | 18 ++++++++++++++- 5 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 test/blocks/table/mocks/placeholders.json diff --git a/libs/blocks/table/table.js b/libs/blocks/table/table.js index 9fc9959037..c2cf55ad21 100644 --- a/libs/blocks/table/table.js +++ b/libs/blocks/table/table.js @@ -1,7 +1,8 @@ /* eslint-disable no-plusplus */ -import { createTag, MILO_EVENTS } from '../../utils/utils.js'; +import { createTag, getConfig, MILO_EVENTS } from '../../utils/utils.js'; import { decorateButtons } from '../../utils/decorate.js'; import { debounce } from '../../utils/action.js'; +import { replaceKeyArray } from '../../features/placeholders.js'; const DESKTOP_SIZE = 900; const MOBILE_SIZE = 768; @@ -90,10 +91,9 @@ function handleHeading(table, headingCols) { const describedBy = `${headerBody?.id ?? ''} ${headerPricing?.id ?? ''}`.trim(); trackingHeader.setAttribute('aria-describedby', describedBy); - col.removeAttribute('role'); + col.setAttribute('role', 'columnheader'); } - nodeToApplyRoleScope.setAttribute('role', 'columnheader'); nodeToApplyRoleScope.setAttribute('scope', 'col'); }); } @@ -153,6 +153,24 @@ function handleAddOnContent(table) { table.addEventListener('mas:resolved', debounce(() => { handleEqualHeight(table, '.row-heading'); })); } +async function setAriaLabelForIcons(el) { + const config = getConfig(); + const expendableIcons = el.querySelectorAll('.icon.expand[role="button"]'); + const selectFilters = el.parentElement.querySelectorAll('.filters .filter'); + const ariaLabelElements = [...selectFilters, ...expendableIcons]; + + if (!ariaLabelElements.length) { + return; + } + + const ariaLabels = await replaceKeyArray(['toggle-row', 'choose-table-column'], config); + + ariaLabelElements.forEach((element) => { + const labelIndex = element.classList.contains('filter') ? 1 : 0; + element.setAttribute('aria-label', ariaLabels[labelIndex]); + }); +} + function handleHighlight(table) { const isHighlightTable = table.classList.contains('highlight'); const firstRow = table.querySelector('.row-1'); @@ -255,7 +273,7 @@ function handleSection(sectionParams) { } if (isCollapseTable) { - const iconTag = createTag('span', { class: 'icon expand' }); + const iconTag = createTag('span', { class: 'icon expand', role: 'button' }); if (!sectionHeadTitle.querySelector('.icon.expand')) { sectionHeadTitle.prepend(iconTag); } @@ -602,6 +620,7 @@ export default function init(el) { }); isDecorated = true; + setAriaLabelForIcons(el); }; window.addEventListener(MILO_EVENTS.DEFERRED, () => { diff --git a/libs/features/icons/icons.js b/libs/features/icons/icons.js index 6d01b9c10c..5dfe057844 100644 --- a/libs/features/icons/icons.js +++ b/libs/features/icons/icons.js @@ -47,6 +47,7 @@ function decorateToolTip(icon) { const place = conf.pop()?.trim().toLowerCase() || 'right'; icon.className = `icon icon-info milo-tooltip ${place}`; icon.setAttribute('tabindex', '0'); + icon.setAttribute('aria-label', content); icon.setAttribute('role', 'button'); wrapper.parentElement.replaceChild(icon, wrapper); } diff --git a/nala/blocks/table/table.test.js b/nala/blocks/table/table.test.js index cf1ef914df..127cab9239 100644 --- a/nala/blocks/table/table.test.js +++ b/nala/blocks/table/table.test.js @@ -1,6 +1,7 @@ import { expect, test } from '@playwright/test'; import { features } from './table.spec.js'; import TableBlock from './table.page.js'; +import { runAccessibilityTest } from '../../libs/accessibility.js'; let table; @@ -32,6 +33,10 @@ test.describe('Milo Table block feature test suite', () => { await table.verifyHeaderRow(data); await table.verifySectionRow(data); }); + + await test.step('step-3: Verify the accessibility test on the table (default) block', async () => { + await runAccessibilityTest({ page, testScope: table.table }); + }); }); // Test 1 : Table (highlight) diff --git a/test/blocks/table/mocks/placeholders.json b/test/blocks/table/mocks/placeholders.json new file mode 100644 index 0000000000..1ff68100ae --- /dev/null +++ b/test/blocks/table/mocks/placeholders.json @@ -0,0 +1,8 @@ +{ + "data": [ + { + "key": "choose-table-column", + "value": "choose table column" + } + ] +} diff --git a/test/blocks/table/table.test.js b/test/blocks/table/table.test.js index 0245bba663..6b0d400cda 100644 --- a/test/blocks/table/table.test.js +++ b/test/blocks/table/table.test.js @@ -1,10 +1,15 @@ import { readFile, sendMouse, sendKeys, resetMouse } from '@web/test-runner-commands'; import { expect } from 'chai'; -import { MILO_EVENTS } from '../../../libs/utils/utils.js'; +import { getConfig, MILO_EVENTS, setConfig } from '../../../libs/utils/utils.js'; import { delay, waitForElement } from '../../helpers/waitfor.js'; +import { replaceKey } from '../../../libs/features/placeholders.js'; document.body.innerHTML = await readFile({ path: './mocks/body.html' }); const { default: init } = await import('../../../libs/blocks/table/table.js'); +const locales = { '': { ietf: 'en-US', tk: 'hah7vzn.css' } }; +const conf = { locales, contentRoot: '/test/blocks/table/mocks' }; +setConfig(conf); +const config = getConfig(); describe('table and tablemetadata', () => { beforeEach(() => { @@ -111,5 +116,16 @@ describe('table and tablemetadata', () => { expect(tooltipHeading.childNodes.length).to.equal(2); expect(tooltipHeading.querySelector('.milo-tooltip, .icon-tooltip')).to.exist; }); + + it('should apply aria-label to all selects within .filters on mobile', async () => { + window.innerWidth = 375; + window.dispatchEvent(new Event('resize')); + const ariaLabel = await replaceKey('choose-table-column', config); + const selectElements = document.querySelectorAll('.filters select'); + + selectElements.forEach((selectElement) => { + expect(selectElement.getAttribute('aria-label')).to.equal(ariaLabel); + }); + }); }); }); From 6d7af52c05bb85343664f454f3d922c0df45be70 Mon Sep 17 00:00:00 2001 From: Megan Thomas Date: Mon, 3 Feb 2025 02:35:15 -0800 Subject: [PATCH 08/10] MWPW-165428 Fix georouting tab scroll (#3572) --- libs/blocks/tabs/tabs.css | 5 +++++ libs/blocks/tabs/tabs.js | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/blocks/tabs/tabs.css b/libs/blocks/tabs/tabs.css index 0497dbd858..1755e23fa9 100644 --- a/libs/blocks/tabs/tabs.css +++ b/libs/blocks/tabs/tabs.css @@ -554,4 +554,9 @@ .tabs.stacked-mobile.quiet div[role="tablist"] button { margin-inline-start: 0; } + + .tabs[class*='stacked-mobile'] .paddle { + background: unset; + border: none; + } } diff --git a/libs/blocks/tabs/tabs.js b/libs/blocks/tabs/tabs.js index b614ac2dcc..d973d55379 100644 --- a/libs/blocks/tabs/tabs.js +++ b/libs/blocks/tabs/tabs.js @@ -67,7 +67,8 @@ function changeTabs(e) { const parent = target.parentNode; const content = parent.parentNode.parentNode.lastElementChild; const targetContent = content.querySelector(`#${target.getAttribute('aria-controls')}`); - const blockId = target.closest('.tabs').id; + const tabsBlock = target.closest('.tabs'); + const blockId = tabsBlock.id; parent .querySelectorAll(`[aria-selected="true"][data-block-id="${blockId}"]`) .forEach((t) => t.setAttribute('aria-selected', false)); @@ -77,7 +78,7 @@ function changeTabs(e) { .querySelectorAll(`[role="tabpanel"][data-block-id="${blockId}"]`) .forEach((p) => p.setAttribute('hidden', true)); targetContent.removeAttribute('hidden'); - scrollStackedMobile(targetContent); + if (tabsBlock.classList.contains('stacked-mobile')) scrollStackedMobile(targetContent); } function getStringKeyName(str) { From 8d3bac8b504a1a99b663c4522664a90af65a33bf Mon Sep 17 00:00:00 2001 From: Brandon Marshall Date: Mon, 3 Feb 2025 20:15:19 +0000 Subject: [PATCH 09/10] MWPW-164405 Show multiple success sections (#3526) --- libs/blocks/marketo/marketo.js | 47 ++++++++++------------ test/blocks/marketo/marketo.test.html | 14 ++++++- test/blocks/marketo/marketo.test.js | 3 +- test/blocks/marketo/mocks/marketo-utils.js | 1 + 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/libs/blocks/marketo/marketo.js b/libs/blocks/marketo/marketo.js index 7f27eeae7c..9f2a9b54ed 100644 --- a/libs/blocks/marketo/marketo.js +++ b/libs/blocks/marketo/marketo.js @@ -22,6 +22,7 @@ import { getConfig, createIntersectionObserver, SLD, + MILO_EVENTS, } from '../../utils/utils.js'; const ROOT_MARGIN = 50; @@ -54,6 +55,7 @@ export const decorateURL = (destination, baseURL = window.location) => { let destinationUrl = new URL(destination, baseURL.origin); const { hostname, pathname, search, hash } = destinationUrl; + /* c8 ignore next 3 */ if (!hostname) { throw new Error('URL does not have a valid host'); } @@ -94,36 +96,31 @@ export const setPreferences = (formData) => { Object.entries(formData).forEach(([key, value]) => setPreference(key, value)); }; -const showSuccessSection = (formData, scroll = true) => { - const show = (el) => { - el.classList.remove('hide-block'); - if (scroll) el.scrollIntoView({ behavior: 'smooth' }); +const showSuccessSection = (formData) => { + const show = (sections) => { + sections.forEach((section) => section.classList.remove('hide-block')); + sections[0]?.scrollIntoView({ behavior: 'smooth' }); }; const successClass = formData[SUCCESS_SECTION]?.toLowerCase().replaceAll(' ', '-'); if (!successClass) { window.lana?.log('Error showing Marketo success section', { tags: 'warn,marketo' }); return; } - const section = document.querySelector(`.section.${successClass}`); - if (section) { - show(section); - return; - } - // For Marquee use case - const maxIntervals = 6; - let count = 0; - const interval = setInterval(() => { - const el = document.querySelector(`.section.${successClass}`); - if (el) { - clearInterval(interval); - show(el); - } - count += 1; - if (count > maxIntervals) { - clearInterval(interval); - window.lana?.log('Error showing Marketo success section', { tags: 'warn,marketo' }); - } - }, 500); + + let successSections = document.querySelectorAll(`.section.${successClass}`); + show(successSections); + document.addEventListener( + MILO_EVENTS.DEFERRED, + () => { + successSections = document.querySelectorAll(`.section.${successClass}`); + show(successSections); + /* c8 ignore next 3 */ + if (!document.querySelector(`.section.${successClass}`)) { + window.lana?.log(`Error showing Marketo success section ${successClass}`, { tags: 'warn,marketo' }); + } + }, + false, + ); }; export const formSuccess = (formEl, formData) => { @@ -229,7 +226,7 @@ export default function init(el) { if (formData[SUCCESS_TYPE] === 'section' && ungated) { el.classList.add('hide-block'); - showSuccessSection(formData, true); + showSuccessSection(formData); return; } diff --git a/test/blocks/marketo/marketo.test.html b/test/blocks/marketo/marketo.test.html index fb0d633c09..f63e7657e3 100644 --- a/test/blocks/marketo/marketo.test.html +++ b/test/blocks/marketo/marketo.test.html @@ -59,6 +59,15 @@

Fill out the form to view the repo

+
+

Form Success 2

+ +