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