1import{q as n,al as a,at as r,c6 as l,c7 as c,t as d,y as p,z as u}from"./index-CDuIdEW2.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};o.SENTRY_RELEASE={id:"89111495d7cb7c15a5c8314648da4182a45ba6ad"};var t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="ee175b54-3d13-435c-8b14-7804034ea221",o._sentryDebugIdIdentifier="sentry-dbid-ee175b54-3d13-435c-8b14-7804034ea221")}catch(e){}})();const m={name:"ComoPointShop",components:{SkeletonLoader:r,CloseIcon:a},data(){return{isLoading:!1,isPurchasing:!1,pointShopItems:[],pendingItem:null}},computed:{...u({email:o=>o.customer.email,phone:o=>o.customer.phone,identifierType:o=>o.customer.identifierType,memberPoints:o=>o.customer.como.memberPoints}),...p({auth:"customer/auth",venueValue:"venue/venueValue"}),accountId(){return this.venueValue("accountId")},venueId(){return this.venueValue("id")},customerIdentifier(){return this.identifierType==="phone"?{phone:this.phone}:{email:this.email}},pivotY(){return d()?1:.5}},methods:{closeModal(){this.pendingItem=null,this.$modal.hide("como-point-shop")},async fetchPointShopItems(){this.isLoading=!0;try{const o={...this.customerIdentifier,accountId:this.accountId,venueId:this.venueId,identifierType:this.identifierType},{data:t}=await c(o);this.pointShopItems=t.items||[]}catch(o){throw new Error("API ".concat(o))}finally{this.isLoading=!1}},confirmPurchase(o){o.price>this.memberPoints||(this.pendingItem=o)},cancelPurchase(){this.pendingItem=null},async executePurchase(){if(this.pendingItem){this.isPurchasing=!0;try{const o={...this.customerIdentifier,accountId:this.accountId,venueId:this.venueId,identifierType:this.identifierType,pointShopItemId:this.pendingItem.id};await l(o),this.closeModal(),this.$emit("reward-purchased"),this.$notify({group:"PiggyRewards",duration:1e3,title:this.$t("comoPointShop.rewardPurchased")})}catch(o){throw new Error("API ".concat(o))}finally{this.isPurchasing=!1}}}}};var h=function(){var t=this,e=t._self._c;return e("modal",{class:{"mobile-item-modal":t.pivotY===1},attrs:{name:"como-point-shop",height:"auto",width:"575",maxWidth:575,adaptive:!0,scrollable:!0,clickToClose:!t.pendingItem,reset:!0,transition:"pop-out",pivotY:t.pivotY},on:{"before-open":t.fetchPointShopItems}},[e("div",{staticClass:"item-modal-content relative flex flex-col w-full"},[e("div",{staticClass:"item-modal-body"},[e("div",{staticClass:"item-modal-details flex-auto p-6 pb-1 overflow-y-auto"},[e("div",{staticClass:"flex justify-between items-center border-b border-solid border-gray-200 pb-3 mb-3"},[e("div",{staticClass:"flex items-center gap-2"},[t.pendingItem?e("button",{staticClass:"text-primary focus:outline-none",on:{click:t.cancelPurchase}},[e("svg",{staticClass:"size-4",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"}},[e("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}})])]):t._e(),e("h4",{staticClass:"text-heading font-heading text-lg font-bold"}
1,[t._v(" "+t._s(t.pendingItem?t.$t("comoPointShop.confirmTitle"):t.$t("comoPointShop.title"))+" ")])]),t.pendingItem?t._e():e("button",{staticClass:"text-primary focus:outline-none",attrs:{type:"button","aria-label":"Close"},on:{click:t.closeModal}},[e("close-icon")],1)]),t.pendingItem?e("div",{staticClass:"pb-3"},[e("div",{staticClass:"flex items-center gap-3 border rounded-lg p-3 shadow-sm mb-4"},[t.pendingItem.imageUrl?e("img",{staticClass:"h-16 w-16 shrink-0 rounded-md object-cover",attrs:{src:t.pendingItem.imageUrl,alt:"reward"},on:{error:function(s){s.target.style.display="none"}}}):t._e(),e("div",{staticClass:"flex flex-col flex-1 min-w-0"},[e("p",{staticClass:"text-heading font-heading text-sm font-bold truncate"},[t._v(" "+t._s(t.pendingItem.name)+" ")]),e("p",{staticClass:"text-xs text-primary line-clamp-1 mb-1"},[t._v(" "+t._s(t.pendingItem.description)+" ")]),e("p",{staticClass:"text-xs text-subheading font-bold"},[t._v(" "+t._s(t.pendingItem.price/100)+" "+t._s(t.$t("comoPointShop.points"))+" ")])])]),e("p",{staticClass:"text-sm text-heading mb-5"},[t._v(" "+t._s(t.pendingItem.price/100)+" "+t._s(t.$t("comoPointShop.willBeDeducted"))+" "+t._s(t.$t("comoPointShop.irreversibleWarning"))+" ")]),e("div",{staticClass:"flex gap-3"},[e("base-button",{staticClass:"flex-1 rounded-md border px-4 py-2 text-sm font-bold text-heading",attrs:{variant:"secondaryActions","button-text":t.$t("comoPointShop.cancel"),"is-border-transparent":!0},on:{clicked:t.cancelPurchase}}),e("base-button",{staticClass:"flex-1 border-button-primary text-button bg-button font-button clip-path-button rounded-button rounded-md px-4 py-2 text-sm font-bold shadow disabled:opacity-50",attrs:{"button-text":t.isPurchasing?t.$t("comoPointShop.purchasing"):t.$t("comoPointShop.c
1onfirm"),disabled:t.isPurchasing},on:{clicked:t.executePurchase}})],1)]):e("div",[t.isLoading?e("div",{staticClass:"flex flex-col gap-3"},t._l(3,function(s){return e("skeleton-loader",{key:s,staticClass:"h-20 w-[97%] rounded"})}),1):e("ul",{staticClass:"flex flex-col gap-3 pb-3"},[t._l(t.pointShopItems,function(s){return e("li",{key:s.id,staticClass:"flex flex-row items-center gap-3 border rounded-lg p-3 shadow-sm"},[s.imageUrl?e("img",{staticClass:"h-16 w-16 shrink-0 rounded-md object-cover",attrs:{src:s.imageUrl,alt:"reward"},on:{error:function(i){i.target.style.display="none"}}}):t._e(),e("div",{staticClass:"flex flex-col flex-1 min-w-0"},[e("p",{staticClass:"text-heading font-heading text-sm font-bold truncate"},[t._v(" "+t._s(s.name)+" ")]),e("p",{staticClass:"text-xs text-primary line-clamp-1 mb-1"},[t._v(" "+t._s(s.description)+" ")]),e("p",{staticClass:"text-xs text-subheading font-bold"},[t._v(" "+t._s(s.price/100)+" "+t._s(t.$t("comoPointShop.points"))+" ")])]),e("span",{class:["border-button-primary flex-shrink-0 text-button font-button clip-path-button rounded-button rounded-md px-3 py-2 text-xs font-bold shadow",s.price>t.memberPoints?"bg-button opacity-40 cursor-not-allowed":"bg-button cursor-pointer"],on:{click:function(i){return t.confirmPurchase(s)}}},[t._v(" "+t._s(t.$t("comoPointShop.redeem"))+" ")])])}),t.pointShopItems.length?t._e():e("li",{staticClass:"flex items-center justify-center h-24 text-sm text-primary"},[t._v(" "+t._s(t.$t("comoPointShop.noItemsAvailable"))+" ")])],2)])])])])])},f=[],b=n(m,h,f,!1,null,null);const x=b.exports;export{x as default}; 2//# sourceMappingURL=ComoPointShop-Dgh_gSTF.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.