1import{A as P,p as T}from"./Bdkw4dOc.js";import{P as S}from"./BWAH4Jvv.js";import{A as B}from"./CwzGwFW-.js";import{E as D}from"./BRi6NzKG.js";import{c3 as H,c7 as $}from"./k9o2YNRP.js";import{u as R}from"./DbyM-Nxw.js";import{y as E,D as K,as as N,w as V,q,C as t,c as F,j as v,n as J}from"./C-rzekC7.js";import"./BUunClgT.js";import"./BN270mGE.js";import"./BbHctid6.js";import"./VBo6fwn7.js";import"./C3UvKwRZ.js";import"./DCc2OtKR.js";const Q=""+new URL("icon_empty_app.BQbMJBEv.png",import.meta.url).href,G=Object.assign(E({setup(){const{t:l}=H(),p=R(),h=v(!1),c=v({}),r=v({}),d=new Map,i=new Map,z=F(()=>A().length<=0||h.value),_=(e,n)=>"".concat(e!=null?e:"","_").concat(n!=null?n:""),C=e=>{const n=new Set(e.map(s=>_(s.pkgId,s.version)));c.value=Object.fromEntries(Object.entries(c.value).filter(([s])=>n.has(s))),r.value=Object.fromEntries(Object.entries(r.value).filter(([s])=>n.has(s)));for(const s of d.keys())n.has(s)||d.delete(s);for(const s of i.keys())n.has(s)||i.delete(s)},M=()=>{const e={};for(const[a,o]of d.entries()){const g=Number.parseFloat(window.getComputedStyle(o).lineHeight);if(!g){e[a]=!1;continue}e[a]=o.scrollHeight-g*6>1}const n=Object.entries(r.value),s=Object.entries(e);(n.length!==s.length||s.some(([a,o])=>r.value[a]!==o))&&(r.value=e)},f=async()=>{await J(),M()},U=(e,n)=>{n instanceof HTMLParagraphElement?d.set(e,n):d.delete(e)},w=e=>{c.value={...c.value,[e]:!c.value[e]}},O=()=>window.matchMedia("(max-width: 589px)").matches,k=e=>{var u;if(!O())return;const n=Date.now(),s=(u=i.get(e))!=null?u:0;i.set(e,n),n-s<=300&&(i.delete(e),w(e))},x=()=>{f()};function A(e=p.needUpdatedApps){const n=new Map;for(const s of p.installedApps)n.set(s.appid,s.status);return e.filter(s=>n.get(s.pkgId)!==T.AppStatus.Installing)}const I=async e=>{const n=[];for(const s of e)n.push($(s));await Promise.all(n)},L=async()=>{h.value=!0;const e=A(p.needUpdatedApps).map(n=>({id:n.pkgId,version:n.version,name:n.name,sha256:n.pkgHash}));try{if(!e||e.length<=0)throw new Error("the list of applications to be updated is empty");await I(e)}catch(n){console.warn("[Update] installApps failed",n)}finally{h.value=!1,p.refreshInstalledApps(!0)}};return K(()=>{p.refreshInstalledApps(!0),f(),window.addEventListener("resize",x)}),N(()=>{f()}),V(()=>p.needUpdatedApps,e=>{C(e)},{immediate:!0}),q(()=>{i.clear(),window.removeEventListener("resize",x)}),()=>{const{needUpdatedApps:e,needUpdatedAppsCounts:n,isLoading:s,resolveAppData:u}=p;return t("div",{class:"page_container updating_page"},[t(S,null,null),t("div",{class:"page_content"},[t("div",{class:"deck"},[t("div",{class:"title_bar"},[t("p",{class:"text"},[l("lzc_as_m.runtime.components.screens.updating.index.page_title","åºç¨æ´æ°")]),t("div",{class:"interval"},null)]),t("div",{class:"content"},[e.length>0&&t("div",{class:"operate_bars"},[t("div",{class:"interval"},null),t("button",{class:"lzc_ui_button_link",disabled:z.value,onClick:L},[l("lzc_as_m.runtime.components.screens.updating.index.update_all","å
¨é¨æ´æ°"),n>0?" (".concat(n,")"):""])]),t("div",{class:["list",!s&&e.length<=0&&"empty"]},[e.map(a=>(()=>{const o=_(a.pkgId,a.version),g=a.changelog||l("lzc_as_m.runtime.components.screens.updating.index.empty_changelog","ææ åæ´è¯´æ"),m=c.value[o],y=r.value[o]&&!!a.changelog;return t(B,{key:"lzc_as_need_update_app_item_".concat(a.pkgId,"_").concat(a.version),class:"item",data:u(a),rightPanel:()=>t("div",{style:{height:"100%",display:"flex",flexDirection:"column"}},[t(P,{id:a==null?void 0:a.pkgId,version:a==null?void 0:a.version,minOsVersion:a==null?void 0:a.osDependence},null)]),statisticsPanel:()=>{var b;return t("div",{class:"details_panel"},[t("div",{class:"statistics"},[t("span",{class:"version_name"},[l("lzc_as_m.runtime.components.screens.updating.index.app_item_version","çæ¬ {version}",{version:(b=a==null?void 0:a.version)!=null?b:"0.0"})])]),t("div",{class:"changelog_container"},[t("div",{class:["changelog_wrapper",m&&"expanded"],onTouchend:()=>k(o)},[t("p",{ref:j=>U(o,j),class:["changelog",!m&&y&&"collapsed"]},[g])]),y&&t("button",{type:"button",class:"changelog_toggle",onClick:()=>w(o)},[m?l("lzc_as_m.runtime.components.screens.updating.index.collapse_changelog","æ¶èµ·"):l("lzc_as_m.runtime.components.screens.updating.index.expand_changelog","æ´å¤")])])])}},null)})()),!s&&e.length<=0&&t(D,{class:"empty_app_update",icon:Q,text:l("lzc_as_m.runtime.components.screens.updating.index.no_app_updates_available","ææ åºç¨æ´æ°")},null)])])])])])}}}),{__name:"LzcAsScreensUpdating"}),re=E({setup(){return()=>t(G,null,null)}});export{re as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.