import{D as m}from"./chunk-QYQ7WNYU.js";import{La as s,a as n,b as o}from"./chunk-HC2G7LSI.js";var p=(()=>{let r=class r{static getDotDiscount(e){let t=e?.dotDiscount;if(t){let i=JSON.parse(t.text);return o(n({},t),{config:o(n({},i),{text:i.text,type:i.type?i.type:"CLASSIC"})})}}static getModelName(e,t){return this.productNameRemoveMemory(this.productNameRemoveDualSim(this.productNameRemoveBrand(e,t)))}static productNameRemoveBrand(e,t){return e.brand&&t.displayName.indexOf(e.brand.name)>-1?t.displayName.replace(e.brand.name,"").trim():t.displayName}static productNameRemoveDualSim(e){return e.replace(/\(?dual sim\)?/i,"").trim()}static productNameRemoveMemory(e){return e.split(" ").filter(t=>!t.toUpperCase().includes("GB")&&!t.toUpperCase().includes("MB")).join(" ")}getActiveVariant(e,t){return t?e.variants?.find(i=>i.id===t):e.variants?.[0]}getBadges(e){return e.badge?Object.values(e.badge).filter(t=>!!t):[]}static outOfStock(e,t){return e==="noStock"||e==="expired"||t===m.error}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=s({token:r,factory:r.\u0275fac});let a=r;return a})();export{p as a};