import{H as m,I as u,_,B as f,c as t,o as s,x as w,w as b,J as h,K as p,z as $,a as g}from"./main.qxCxIqDs.js";const k={components:{TabSwitcher:m},data(){return{meta:{stickers:[]},path:""}},computed:{pack(){return this.$store.state.instance.stickers||[]}},methods:{clear(){this.meta={stickers:[]}},pick(a,r){const i=this.$store;fetch(a).then(c=>{c.blob().then(l=>{const d=new File([l],r,{mimetype:"image/png"}),o=new FormData;o.append("file",d),u.uploadMedia({store:i,formData:o}).then(e=>{this.$emit("uploaded",e),this.clear()},e=>{console.warn("Can't attach sticker"),console.warn(e),this.$emit("upload-failed","default")})})})}}},v={class:"sticker-picker"},C=["image-tooltip","image"],y=["onClick"],B=["src"];function x(a,r,i,c,l,d){const o=f("tab-switcher");return s(),t("div",v,[w(o,{class:"tab-switcher","render-only-focused":!0,"scrollable-tabs":""},{default:b(()=>[(s(!0),t(h,null,p(a.pack,e=>(s(),t("div",{key:e.path,"image-tooltip":e.meta.title,image:e.path+e.meta.tabIcon,class:"sticker-picker-content"},[(s(!0),t(h,null,p(e.meta.stickers,n=>(s(),t("div",{key:n,class:"sticker",onClick:$(F=>a.pick(e.path+n,e.meta.title),["stop","prevent"])},[g("img",{src:e.path+n},null,8,B)],8,y))),128))],8,C))),128))]),_:1})])}const D=_(k,[["render",x]]);export{D as default};
//# sourceMappingURL=sticker_picker.B0j2YsOB.js.map
