import{o as e}from"./chunk-mlkTr37E.js";import{t}from"./_plugin-vue2_normalizer-BHc2Ljhs.js";import{n}from"./save-DnFLO7qs.js";import{t as r}from"./group-array-lbJyLuhG.js";var i=e(r()),a=t({name:`ShopeeProductImage`,props:{listImage:{type:Array}},data(){return{imageCollapse:[`main`,`description`,`variation`]}},methods:{getLabelImage(e){return this.$t(`IMAGE_LABEL_TYPE.${e}`)},downloadImageType(e){this.listImage.filter(t=>t.type===e).forEach(e=>this.downloadImageUrl(e))},downloadImageUrl({url:e,fileName:t}){(0,n.saveAs)(e,t)}},computed:{listGroupImage(){return(0,i.default)(this.listImage,`type`)}}},function(){var e=this,t=e._self._c;return t(`div`,[e.listImage.length?t(`div`,[t(`Collapse`,{model:{value:e.imageCollapse,callback:function(t){e.imageCollapse=t},expression:`imageCollapse`}},e._l(e.listGroupImage,function(n,r){return t(`Panel`,{key:r,attrs:{name:r}},[t(`b`,[e._v(e._s(e.getLabelImage(r))+` (`+e._s(n.length)+`)`)]),t(`div`,{attrs:{slot:`content`},slot:`content`},[t(`div`,{staticClass:`text-right mb-5`},[t(`Button`,{attrs:{type:`warning`,size:`default`},on:{click:function(t){return e.downloadImageType(r)}}},[t(`span`,[e._v(` `+e._s(e.$t(`DOWNLOAD_ALL_IMAGE_PRODUCT`)))]),e._v(` (`+e._s(n.length)+`) `)])],1),t(`div`,[t(`Row`,{attrs:{gutter:16}},e._l(n,function(n){return t(`Col`,{key:n.url,staticClass:`mb-5`,attrs:{span:6}},[t(`div`,{staticClass:`hand-hover`,staticStyle:{"text-align":`center`},on:{click:function(t){return e.downloadImageUrl(n)}}},[t(`img`,{staticClass:`img-fluid`,attrs:{src:n.url}}),t(`span`,[e._v(` `+e._s(n.fileName))])])])}),1)],1)])])}),1)],1):t(`div`,[e._v(` `+e._s(e.$t(`IMAGE_LIST_EMPTY`))+` `)])])},[],!1,null,null,null,null).exports;export{a as t};