{"version":3,"file":"products-be35fb22.js","sources":["../../client/packages/design-system/src/cards/DProductCard.vue","../../client/packages/design-system/src/atoms/DVideo.vue","../../client/packages/design-system/src/overlays/DVideoModal.vue","../../client/packages/design-system/src/molecules/DCTA.vue","../../client/packages/utils/src/map/products.ts"],"sourcesContent":["\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import type {ProductListItem} from \"@songfinch/types\";\n\nexport const sortedProducts = (products: ProductListItem[], sortIds: string[]) => {\n if (!products) return undefined;\n if (!sortIds) return products;\n\n // Reverse the sortIds and sort backwards \n // so that products that are not in sortIds are at the end\n const reverseSortIds = [...sortIds].reverse();\n\n const sortedProducts = (products).sort((a, b) => {\n const indexA = reverseSortIds.indexOf(a.name);\n const indexB = reverseSortIds.indexOf(b.name);\n return indexB - indexA;\n });\n\n return sortedProducts;\n};\n\nexport const filterProductsByIds = (products: ProductListItem[], includeIds: string[]) => {\n if (!products) return undefined;\n if (!includeIds) return products;\n\n return sortedProducts(products.filter((product) => includeIds.includes(product.name)), includeIds);\n};\n"],"names":["emit","__emit","props","__props","digitalDelievery","computed","normalizeDescription","description","firstElement","_a","stockTag","normalizeProductStockTag","videoPlayer","ref","srcType","videoTrackEvent","inject","trackVideo","type","e","percentagePlayed","_b","_c","_d","_e","trackingObject","_f","_g","togglePlay","onMounted","onBeforeUnmount","close","modalActive","openModal","closeModal","useModal","openMediaVideo","trackClickEvent","sortedProducts","products","sortIds","reverseSortIds","a","b","indexA","filterProductsByIds","includeIds","product"],"mappings":"k0CAeI,MAAMA,EAAOC,EAEPC,EAAQC,EAaRC,EAAmBC,EAAS,IACvB,CAAC,UAAW,WAAW,EAAE,SAASH,EAAM,QAAQ,YAAY,CACtE,EAEKI,EAAwBC,GAAgC,OAGpD,MAAAC,EAFS,IAAI,YACA,gBAAgBD,EAAa,WAAW,EAClC,KAAK,kBAGvB,QAFME,EAAAD,GAAA,YAAAA,EAAc,cAAd,YAAAC,EAA2B,SAAUF,CA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