Skip to content

Commit

Permalink
MWPW-159257 refactor mas enablement (#3012)
Browse files Browse the repository at this point in the history
* initial commit

* slots, styles and basic layout

* more changes

* Update merch-card.ccd-suggested.test.html

* Update merch-twp-d2p.test.html

* unit tests, strip slot and more

* fixed review comments

* review comments fixed

* RTL background image support

* Initial @adobecom/mas-js version.

* a

* Update merch-card.ccd-suggested.test.html

* a

* dark mode, unit tests and rtl

* simplified styles

* updated deps

* Update variant-layout.js

* dark theme ut

* Update merch-card.ccd-suggested.test.html.js

* Update variant-layout.js

* card mapping

* MWPW-158200: Merch card Dark mode

* updated deps

* MWPW-159257 refactor mas enablement

- move of wcms-commerce -> mas-commerce-service
- move of some public functions to mas-commerce-service,
- remove mas.js code for initialization, everything needs to go through the component,
- split of settings code with locale settings, make milo locale settings an explicit function,
- unit tests,
- updates of docs, especially  mas.js.html with that component

* MWPW-159257 fix unit test + register co

* review comments fixed

* MWPW-159257 some feedbacks, more coverage

* draft

* bump pkg version

* MWPW-160085: WIP

* wip

* fix cta mapping for suggested card

* ccd-suggested fixes

* dark theme update

* remove css var

* fix size attribute in hydrate

* MWPW-159257 remove init & reset concept

- also removed typescript stuff,
- refactor mixin to simple aggregated MasElement,
- refactor how things are initialised"

* update docs

* merge changes, add more docs

* update docs

* MWPW-159257 remove init & reset concept

- also removed typescript stuff,
- refactor mixin to simple aggregated MasElement,
- refactor how things are initialised,
- make merch block working with this

* update docs

* merge changes, add more docs

* update docs

* fix docu

* merge

* re-enable notification test

* ost

* add doc

* various fixes

* MWPW-159257 move to relative path

* MWPW-159257 various fixes

* rename promise -> readyPromise

not documenting it as i'm not sure it's needed by consumers

* MWPW-159257 enhance coverage

* MWPW-159257 yet more coverage

* MWPW-159257 final?

* MWPW-159257 non reported cov issues

* prob. some issue in cov reporting as its used several times

* MWPW-159257 review fixes

* yet some over c8 ignore

* MWPW-159257 removing it.only & built docs

* MWPW-159257 unwrap single condition block

* MWPW-159257: [M@S] Support override env/landscape

Milo only consumes WCS prod.
However with this PR, on local and stage environments, `allow-override`
parameter will be added to `mas-commerce-service` allowing to override
the commerce env/landscape via query parameters.

* PR feedback

* reduce codecov requirement

---------

Co-authored-by: Axel Cureno Basurto <[email protected]>
Co-authored-by: Ilyas Türkben <[email protected]>
Co-authored-by: Mariia Lukianets <[email protected]>
  • Loading branch information
4 people authored Oct 22, 2024
1 parent 332c3a5 commit 9bd25e6
Show file tree
Hide file tree
Showing 111 changed files with 13,765 additions and 12,489 deletions.
140 changes: 121 additions & 19 deletions libs/blocks/merch/merch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const PRICE_TEMPLATE_OPTICAL = 'optical';
export const PRICE_TEMPLATE_REGULAR = 'price';
export const PRICE_TEMPLATE_STRIKETHROUGH = 'strikethrough';
export const PRICE_TEMPLATE_ANNUAL = 'annual';

const PRICE_TEMPLATE_MAPPING = new Map([
['priceDiscount', PRICE_TEMPLATE_DISCOUNT],
[PRICE_TEMPLATE_DISCOUNT, PRICE_TEMPLATE_DISCOUNT],
Expand Down Expand Up @@ -44,6 +45,105 @@ export const CC_SINGLE_APPS = [
['XD'],
];

const GeoMap = {
ar: 'AR_es',
be_en: 'BE_en',
be_fr: 'BE_fr',
be_nl: 'BE_nl',
br: 'BR_pt',
ca: 'CA_en',
ch_de: 'CH_de',
ch_fr: 'CH_fr',
ch_it: 'CH_it',
cl: 'CL_es',
co: 'CO_es',
la: 'DO_es',
mx: 'MX_es',
pe: 'PE_es',
africa: 'MU_en',
dk: 'DK_da',
de: 'DE_de',
ee: 'EE_et',
eg_ar: 'EG_ar',
eg_en: 'EG_en',
es: 'ES_es',
fr: 'FR_fr',
gr_el: 'GR_el',
gr_en: 'GR_en',
ie: 'IE_en',
il_he: 'IL_iw',
it: 'IT_it',
lv: 'LV_lv',
lt: 'LT_lt',
lu_de: 'LU_de',
lu_en: 'LU_en',
lu_fr: 'LU_fr',
my_en: 'MY_en',
my_ms: 'MY_ms',
hu: 'HU_hu',
mt: 'MT_en',
mena_en: 'DZ_en',
mena_ar: 'DZ_ar',
nl: 'NL_nl',
no: 'NO_nb',
pl: 'PL_pl',
pt: 'PT_pt',
ro: 'RO_ro',
si: 'SI_sl',
sk: 'SK_sk',
fi: 'FI_fi',
se: 'SE_sv',
tr: 'TR_tr',
uk: 'GB_en',
at: 'AT_de',
cz: 'CZ_cs',
bg: 'BG_bg',
ru: 'RU_ru',
ua: 'UA_uk',
au: 'AU_en',
in_en: 'IN_en',
in_hi: 'IN_hi',
id_en: 'ID_en',
id_id: 'ID_in',
nz: 'NZ_en',
sa_ar: 'SA_ar',
sa_en: 'SA_en',
sg: 'SG_en',
cn: 'CN_zh-Hans',
tw: 'TW_zh-Hant',
hk_zh: 'HK_zh-hant',
jp: 'JP_ja',
kr: 'KR_ko',
za: 'ZA_en',
ng: 'NG_en',
cr: 'CR_es',
ec: 'EC_es',
pr: 'US_es', // not a typo, should be US
gt: 'GT_es',
cis_en: 'AZ_en',
cis_ru: 'AZ_ru',
sea: 'SG_en',
th_en: 'TH_en',
th_th: 'TH_th',
};

export function getMiloLocaleSettings(locale) {
const localePrefix = locale?.prefix || 'US_en';
const geo = localePrefix.replace('/', '') ?? '';
let [country = 'US', language = 'en'] = (
GeoMap[geo] ?? geo
).split('_', 2);

country = country.toUpperCase();
language = language.toLowerCase();

return {
language,
country,
locale: `${language}_${country}`,
};
}

/* Optional checkout link params that are appended to checkout urls as is */
export const CHECKOUT_ALLOWED_KEYS = [
'af',
Expand Down Expand Up @@ -433,33 +533,35 @@ export async function getCheckoutAction(offers, options, imsSignedInPromise, el)
/**
* Activates commerce service and returns a promise resolving to its ready-to-use instance.
*/
export async function initService(force = false) {
export async function initService(force = false, attributes = {}) {
if (force) {
initService.promise = undefined;
document.head.querySelector('mas-commerce-service')?.remove();
fetchEntitlements.promise = undefined;
fetchCheckoutLinkConfigs.promise = undefined;
}
const { env, commerce = {}, locale } = getConfig();
const { commerce, env: miloEnv, locale: miloLocale } = getConfig();
initService.promise = initService.promise ?? polyfills().then(async () => {
const { hostname, searchParams } = new URL(window.location.href);
let commerceLibPath = '../../deps/mas/commerce.js';
if (/hlx\.(page|live)$|localhost$|www\.stage\.adobe\.com$/.test(hostname)) {
const maslibs = searchParams.get('maslibs');
if (maslibs) {
commerceLibPath = `${getMasBase(hostname, maslibs)}/libs/commerce.js`;
await import('../../deps/mas/commerce.js');
const { language, locale } = getMiloLocaleSettings(miloLocale);
let service = document.head.querySelector('mas-commerce-service');
if (!service) {
service = createTag('mas-commerce-service', {
locale,
language,
...attributes,
...commerce,
});
if (miloEnv?.name !== 'prod') {
service.setAttribute('allow-override', '');
}
service.registerCheckoutAction(getCheckoutAction);
document.head.append(service);
await service.readyPromise;
service.imsSignedInPromise?.then((isSignedIn) => {
if (isSignedIn) fetchEntitlements();
});
}
const commerceLib = await import(commerceLibPath);
const service = await commerceLib.init(() => ({
env,
commerce,
locale,
}), () => ({ getCheckoutAction, force }));
service.imsSignedInPromise.then((isSignedIn) => {
if (isSignedIn) {
fetchEntitlements();
}
});
return service;
});
return initService.promise;
Expand Down
8 changes: 5 additions & 3 deletions libs/blocks/ost/ost.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export const createLinkMarkup = (

export async function loadOstEnv() {
/* c8 ignore next */
const { Log, Defaults, getLocaleSettings } = await import('../../deps/mas/commerce.js');
const { Log, Defaults } = await import('../../deps/mas/commerce.js');
const { getMiloLocaleSettings } = await import('../merch/merch.js');

const searchParameters = new URLSearchParams(window.location.search);
const ostSearchParameters = new URLSearchParams();
Expand Down Expand Up @@ -157,7 +158,7 @@ export async function loadOstEnv() {
const referrer = searchParameters.get('referrer');
const repo = searchParameters.get('repo');

let { country, language } = getLocaleSettings();
let { country, language } = getMiloLocaleSettings();
const { locales } = getConfig();
const log = Log.module('ost');
const metadata = {};
Expand All @@ -170,7 +171,8 @@ export async function loadOstEnv() {
const json = await res.json();
url = new URL(json.preview.url);
const locale = getLocale(locales, url.pathname);
({ country, language } = getLocaleSettings({ locale }));
/* c8 ignore next 1 */
({ country, language } = getMiloLocaleSettings(locale));
} catch (error) {
log.error('Unable to fetch page status:', error);
}
Expand Down
4 changes: 2 additions & 2 deletions libs/deps/mas/commerce.js

Large diffs are not rendered by default.

312 changes: 213 additions & 99 deletions libs/deps/mas/mas.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions libs/deps/mas/merch-card-collection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor(e,t){this.key=Symbol("match-media-key"),this.matches=!1,this.host=e,this.host.addController(this),this.media=window.matchMedia(t),this.matches=this.media.matches,this.onChange=this.onChange.bind(this),e.addController(this)}hostConnected(){var e;(e=this.media)==null||e.addEventListener("change",this.onChange)}hostDisconnected(){var e;(e=this.media)==null||e.removeEventListener("change",this.onChange)}onChange(e){this.matches!==e.matches&&(this.matches=e.matches,this.host.requestUpdate(this.key,!this.matches))}};var f="hashchange";function R(r=window.location.hash){let e=[],t=r.replace(/^#/,"").split("&");for(let o of t){let[i,c=""]=o.split("=");i&&e.push([i,decodeURIComponent(c.replace(/\+/g," "))])}return Object.fromEntries(e)}function p(r){let e=new URLSearchParams(window.location.hash.slice(1));Object.entries(r).forEach(([i,c])=>{c?e.set(i,c):e.delete(i)}),e.sort();let t=e.toString();if(t===window.location.hash)return;let o=window.scrollY||document.documentElement.scrollTop;window.location.hash=t,window.scrollTo(0,o)}function T(r){let e=()=>{if(window.location.hash&&!window.location.hash.includes("="))return;let t=R(window.location.hash);r(t)};return e(),window.addEventListener(f,e),()=>{window.removeEventListener(f,e)}}var x="merch-card-collection:sort",g="merch-card-collection:showmore";var C=(r,e={})=>{r.querySelectorAll("span[data-placeholder]").forEach(t=>{let{placeholder:o}=t.dataset;t.innerText=e[o]??""})};var _="(max-width: 1199px)",b="(min-width: 768px)",w="(min-width: 1200px)";import{css as A,unsafeCSS as y}from"../lit-all.min.js";var S=A`
import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor(e,t){this.key=Symbol("match-media-key"),this.matches=!1,this.host=e,this.host.addController(this),this.media=window.matchMedia(t),this.matches=this.media.matches,this.onChange=this.onChange.bind(this),e.addController(this)}hostConnected(){var e;(e=this.media)==null||e.addEventListener("change",this.onChange)}hostDisconnected(){var e;(e=this.media)==null||e.removeEventListener("change",this.onChange)}onChange(e){this.matches!==e.matches&&(this.matches=e.matches,this.host.requestUpdate(this.key,!this.matches))}};var f="hashchange";function S(r=window.location.hash){let e=[],t=r.replace(/^#/,"").split("&");for(let o of t){let[i,c=""]=o.split("=");i&&e.push([i,decodeURIComponent(c.replace(/\+/g," "))])}return Object.fromEntries(e)}function p(r){let e=new URLSearchParams(window.location.hash.slice(1));Object.entries(r).forEach(([i,c])=>{c?e.set(i,c):e.delete(i)}),e.sort();let t=e.toString();if(t===window.location.hash)return;let o=window.scrollY||document.documentElement.scrollTop;window.location.hash=t,window.scrollTo(0,o)}function T(r){let e=()=>{if(window.location.hash&&!window.location.hash.includes("="))return;let t=S(window.location.hash);r(t)};return e(),window.addEventListener(f,e),()=>{window.removeEventListener(f,e)}}var x="merch-card-collection:sort",g="merch-card-collection:showmore";var C=(r,e={})=>{r.querySelectorAll("span[data-placeholder]").forEach(t=>{let{placeholder:o}=t.dataset;t.innerText=e[o]??""})};var _="(max-width: 1199px)",b="(min-width: 768px)",y="(min-width: 1200px)";import{css as A,unsafeCSS as w}from"../lit-all.min.js";var R=A`
#header,
#resultText,
#footer {
Expand Down Expand Up @@ -65,7 +65,7 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
}
/* tablets */
@media screen and ${y(b)} {
@media screen and ${w(b)} {
#header {
grid-template-columns: 1fr fit-content(100%) fit-content(100%);
}
Expand All @@ -84,7 +84,7 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
}
/* Laptop */
@media screen and ${y(w)} {
@media screen and ${w(y)} {
#resultText {
grid-column: span 2;
order: -3;
Expand All @@ -96,9 +96,9 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
justify-content: end;
}
}
`;var u=(r,e)=>r.querySelector(`[slot="${e}"]`).textContent.trim();var M="merch-card-collection",n={alphabetical:"alphabetical",authored:"authored"},O={filters:["noResultText","resultText","resultsText"],mobile:["noSearchResultsMobileText","searchResultMobileText","searchResultsMobileText"],desktop:["noSearchResultsText","searchResultText","searchResultsText"]},v=(r,{filter:e})=>r.filter(t=>t.filters.hasOwnProperty(e)),L=(r,{types:e})=>e?(e=e.split(","),r.filter(t=>e.some(o=>t.types.includes(o)))):r,D=r=>r.sort((e,t)=>(e.title??"").localeCompare(t.title??"","en",{sensitivity:"base"})),H=(r,{filter:e})=>r.sort((t,o)=>o.filters[e]?.order==null||isNaN(o.filters[e]?.order)?-1:t.filters[e]?.order==null||isNaN(t.filters[e]?.order)?1:t.filters[e].order-o.filters[e].order),B=(r,{search:e})=>e?.length?(e=e.toLowerCase(),r.filter(t=>(t.title??"").toLowerCase().includes(e))):r,E=class extends N{static properties={filter:{type:String,attribute:"filter",reflect:!0},filtered:{type:String,attribute:"filtered"},search:{type:String,attribute:"search",reflect:!0},sort:{type:String,attribute:"sort",default:n.authored,reflect:!0},types:{type:String,attribute:"types",reflect:!0},limit:{type:Number,attribute:"limit"},page:{type:Number,attribute:"page",reflect:!0},singleApp:{type:String,attribute:"single-app",reflect:!0},hasMore:{type:Boolean},displayResult:{type:Boolean,attribute:"display-result"},resultCount:{type:Number},sidenav:{type:Object}};mobileAndTablet=new m(this,_);constructor(){super(),this.filter="all",this.hasMore=!1,this.resultCount=void 0,this.displayResult=!1}render(){return l`${this.header}
`;var d=(r,e)=>r.querySelector(`[slot="${e}"]`).textContent.trim();var M="merch-card-collection",n={alphabetical:"alphabetical",authored:"authored"},O={filters:["noResultText","resultText","resultsText"],mobile:["noSearchResultsMobileText","searchResultMobileText","searchResultsMobileText"],desktop:["noSearchResultsText","searchResultText","searchResultsText"]},v=(r,{filter:e})=>r.filter(t=>t.filters.hasOwnProperty(e)),L=(r,{types:e})=>e?(e=e.split(","),r.filter(t=>e.some(o=>t.types.includes(o)))):r,D=r=>r.sort((e,t)=>(e.title??"").localeCompare(t.title??"","en",{sensitivity:"base"})),H=(r,{filter:e})=>r.sort((t,o)=>o.filters[e]?.order==null||isNaN(o.filters[e]?.order)?-1:t.filters[e]?.order==null||isNaN(t.filters[e]?.order)?1:t.filters[e].order-o.filters[e].order),B=(r,{search:e})=>e?.length?(e=e.toLowerCase(),r.filter(t=>(t.title??"").toLowerCase().includes(e))):r,E=class extends N{static properties={filter:{type:String,attribute:"filter",reflect:!0},filtered:{type:String,attribute:"filtered"},search:{type:String,attribute:"search",reflect:!0},sort:{type:String,attribute:"sort",default:n.authored,reflect:!0},types:{type:String,attribute:"types",reflect:!0},limit:{type:Number,attribute:"limit"},page:{type:Number,attribute:"page",reflect:!0},singleApp:{type:String,attribute:"single-app",reflect:!0},hasMore:{type:Boolean},displayResult:{type:Boolean,attribute:"display-result"},resultCount:{type:Number},sidenav:{type:Object}};mobileAndTablet=new m(this,_);constructor(){super(),this.filter="all",this.hasMore=!1,this.resultCount=void 0,this.displayResult=!1}render(){return l`${this.header}
<slot></slot>
${this.footer}`}updated(e){if(!this.querySelector("merch-card"))return;let t=window.scrollY||document.documentElement.scrollTop,o=[...this.children].filter(s=>s.tagName==="MERCH-CARD");if(o.length===0)return;e.has("singleApp")&&this.singleApp&&o.forEach(s=>{s.updateFilters(s.name===this.singleApp)});let i=this.sort===n.alphabetical?D:H,h=[v,L,B,i].reduce((s,a)=>a(s,this),o).map((s,a)=>[s,a]);if(this.resultCount=h.length,this.page&&this.limit){let s=this.page*this.limit;this.hasMore=h.length>s,h=h.filter(([,a])=>a<s)}let d=new Map(h);o.forEach(s=>{if(d.has(s)){let a=d.get(s);s.style.order=a,s.setAttribute("tabindex",a+1),s.size=s.filters[this.filter]?.size,s.style.removeProperty("display"),s.requestUpdate()}else s.style.display="none",s.size=void 0,s.style.removeProperty("order")}),window.scrollTo(0,t),this.updateComplete.then(()=>{let s=this.shadowRoot.getElementById("resultText")?.firstElementChild?.assignedElements?.()?.[0];s&&C(s,{resultCount:this.resultCount,searchTerm:this.search,filter:this.sidenav?.filters.selectedText})})}connectedCallback(){super.connectedCallback(),this.filtered?(this.filter=this.filtered,this.page=1):this.startDeeplink(),this.sidenav=document.querySelector("merch-sidenav")}disconnectedCallback(){super.disconnectedCallback(),this.stopDeeplink?.()}get header(){if(!this.filtered)return l`<div id="header">
${this.footer}`}updated(e){if(!this.querySelector("merch-card"))return;let t=window.scrollY||document.documentElement.scrollTop,o=[...this.children].filter(s=>s.tagName==="MERCH-CARD");if(o.length===0)return;e.has("singleApp")&&this.singleApp&&o.forEach(s=>{s.updateFilters(s.name===this.singleApp)});let i=this.sort===n.alphabetical?D:H,h=[v,L,B,i].reduce((s,a)=>a(s,this),o).map((s,a)=>[s,a]);if(this.resultCount=h.length,this.page&&this.limit){let s=this.page*this.limit;this.hasMore=h.length>s,h=h.filter(([,a])=>a<s)}let u=new Map(h);o.forEach(s=>{if(u.has(s)){let a=u.get(s);s.style.order=a,s.setAttribute("tabindex",a+1),s.size=s.filters[this.filter]?.size,s.style.removeProperty("display"),s.requestUpdate()}else s.style.display="none",s.size=void 0,s.style.removeProperty("order")}),window.scrollTo(0,t),this.updateComplete.then(()=>{let s=this.shadowRoot.getElementById("resultText")?.firstElementChild?.assignedElements?.()?.[0];s&&C(s,{resultCount:this.resultCount,searchTerm:this.search,filter:this.sidenav?.filters.selectedText})})}connectedCallback(){super.connectedCallback(),this.filtered?(this.filter=this.filtered,this.page=1):this.startDeeplink(),this.sidenav=document.querySelector("merch-sidenav")}disconnectedCallback(){super.disconnectedCallback(),this.stopDeeplink?.()}get header(){if(!this.filtered)return l`<div id="header">
<sp-theme theme="spectrum" color="light" scale="medium">
${this.searchBar} ${this.filtersButton} ${this.sortButton}
</sp-theme>
Expand All @@ -122,13 +122,13 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
treatment="outline"
@click="${this.openFilters}"
><slot name="filtersText"></slot
></sp-action-button>`:""}get searchBar(){let e=u(this,"searchText");return this.mobileAndTablet.matches?l`<merch-search deeplink="search">
></sp-action-button>`:""}get searchBar(){let e=d(this,"searchText");return this.mobileAndTablet.matches?l`<merch-search deeplink="search">
<sp-search
id="searchBar"
@submit="${this.searchSubmit}"
placeholder="${e}"
></sp-search>
</merch-search>`:""}get sortButton(){let e=u(this,"sortText"),t=u(this,"popularityText"),o=u(this,"alphabeticallyText");if(!(e&&t&&o))return;let i=this.sort===n.alphabetical;return l`
</merch-search>`:""}get sortButton(){let e=d(this,"sortText"),t=d(this,"popularityText"),o=d(this,"alphabeticallyText");if(!(e&&t&&o))return;let i=this.sort===n.alphabetical;return l`
<sp-action-menu
id="sortButton"
size="m"
Expand All @@ -147,4 +147,4 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
>${o}</sp-menu-item
>
</sp-action-menu>
`}sortChanged(e){e.target.value===n.authored?p({sort:void 0}):p({sort:e.target.value}),this.dispatchEvent(new CustomEvent(x,{bubbles:!0,composed:!0,detail:{value:e.target.value}}))}async showMore(){this.dispatchEvent(new CustomEvent(g,{bubbles:!0,composed:!0}));let e=this.page+1;p({page:e}),this.page=e,await this.updateComplete}startDeeplink(){this.stopDeeplink=T(({category:e,filter:t,types:o,sort:i,search:c,single_app:h,page:d})=>{t=t||e,!this.filtered&&t&&t!==this.filter&&setTimeout(()=>{p({page:void 0}),this.page=1},1),this.filtered||(this.filter=t??this.filter),this.types=o??"",this.search=c??"",this.singleApp=h,this.sort=i,this.page=Number(d)||1})}openFilters(e){this.sidenav?.showModal(e)}static styles=[S]};E.SortOrder=n;customElements.define(M,E);export{E as MerchCardCollection};
`}sortChanged(e){e.target.value===n.authored?p({sort:void 0}):p({sort:e.target.value}),this.dispatchEvent(new CustomEvent(x,{bubbles:!0,composed:!0,detail:{value:e.target.value}}))}async showMore(){this.dispatchEvent(new CustomEvent(g,{bubbles:!0,composed:!0}));let e=this.page+1;p({page:e}),this.page=e,await this.updateComplete}startDeeplink(){this.stopDeeplink=T(({category:e,filter:t,types:o,sort:i,search:c,single_app:h,page:u})=>{t=t||e,!this.filtered&&t&&t!==this.filter&&setTimeout(()=>{p({page:void 0}),this.page=1},1),this.filtered||(this.filter=t??this.filter),this.types=o??"",this.search=c??"",this.singleApp=h,this.sort=i,this.page=Number(u)||1})}openFilters(e){this.sidenav?.showModal(e)}static styles=[R]};E.SortOrder=n;customElements.define(M,E);export{E as MerchCardCollection};
Loading

0 comments on commit 9bd25e6

Please sign in to comment.