import{u as B}from"./widget-jbnupkVY.js";import{B as S,d as U,b as j,v as q,U as D,_ as F}from"./app-QjDgb7aF.js";import{M as P}from"./MkContainer-CNBcUt5w.js";import{b as L,o as z,g as p,i as c,u as a,x as r,a as u,j as s,q as g,p as i,F as E,G as H,J as I,D as N,E as V,t as A}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const G={class:""},h="photos",J=L({__name:"photos",props:{widget:{}},emits:["updateProps"],setup(f,{expose:_,emit:v}){const y={showHeader:{type:"boolean",default:!0},transparent:{type:"boolean",default:!1}},o=f,k=v,{widgetProps:n,configure:w}=B(h,y,o,k),l=S.useChannel("main"),t=u([]),d=u(!0),b=e=>{/^image\/.+$/.test(e.type)&&(t.value.unshift(e),t.value.length>9&&t.value.pop())},C=e=>q.state.disableShowingAnimatedImages?D(e.thumbnailUrl):e.thumbnailUrl;return U("drive/stream",{type:"image/*",limit:9}).then(e=>{t.value=e,d.value=!1}),l.on("driveFileCreated",b),z(()=>{l.dispose()}),_({name:h,configure:w,id:o.widget?o.widget.id:null}),(e,m)=>{const x=V("MkLoading");return s(),p(P,{"show-header":a(n).showHeader,naked:a(n).transparent,class:r([e.$style.root,"mkw-photos"]),"data-transparent":a(n).transparent?!0:null},{header:c(()=>[m[0]||(m[0]=g("i",{class:"ph-camera ph-bold ph-lg"},null,-1)),I(N(a(j).ts._widgets.photos),1)]),default:c(()=>[g("div",G,[d.value?(s(),p(x,{key:0})):(s(),i("div",{key:1,class:r(e.$style.stream)},[(s(!0),i(E,null,H(t.value,(M,$)=>(s(),i("div",{key:$,class:r(e.$style.img),style:A(`background-image: url(${C(M)})`)},null,6))),128))],2))])]),_:1},8,["show-header","naked","class","data-transparent"])}}}),T="_root_xhcjq_1",W="_stream_xhcjq_1",K="_img_xhcjq_4",O={root:T,stream:W,img:K},Q={$style:O},se=F(J,[["__cssModules",Q]]);export{se as default};
//# sourceMappingURL=photos-BuEznI81.js.map
