import{_,f as n,o as s,g as c,h as i,v as g,w as l,i as d,p as v,t as h,j as y}from"./app-81c86c8f.js";const f={props:{isLoading:{type:Boolean,required:!0,default:!0},couponDetails:{type:Object,required:!0,default:{}}},methods:{copyCode(t){const e=document.createElement("input");e.value=t,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0),e.select();try{document.execCommand("copy"),this.snack({message:this.$i18n.t("code_copied_to_clipboard")})}catch{this.snack({message:this.$i18n.t("something_went_wrong")})}document.body.removeChild(e)}}},b={key:0},k={class:"position-relative lh-0"},C=["src"];function w(t,e,o,x,B,r){const u=n("v-skeleton-loader"),m=n("v-btn"),p=n("v-card");return s(),c("div",null,[o.isLoading?(s(),c("div",b,[i(u,{type:"image",class:"",height:"200"})])):(s(),g(p,{key:1,elevation:"0",outlined:"",class:"text-center"},{default:l(()=>[d("div",k,[d("img",{class:"mw-100 w-100",src:o.couponDetails.banner,onError:e[0]||(e[0]=a=>t.imageFallback(a))},null,40,C),i(m,{onClick:e[1]||(e[1]=y(a=>r.copyCode(o.couponDetails.code),["stop"])),color:"white",elevation:"0",class:"absolute-bottom-left ms-4 mb-4"},{default:l(()=>[v(h(t.$t("copy_code")),1)]),_:1})])]),_:1}))])}const $=_(f,[["render",w]]);export{$ as C};
