import{e as E,j as P,c,a as s,m as v,f as o,d as g,t as n,h as _,y,z as x,D as A,i as d,o as u,q as $}from"./DpdQcRr7.js";import"./BcpEzrWT.js";const V={class:"container mx-auto p-8"},C={class:"box"},B={class:"content"},z={class:"is-size-5"},N={class:"columns"},D={class:"column"},S={class:"box"},T={class:"column"},U={class:"box"},M={class:"is-size-7"},R={key:0,class:"box has-background-primary-light"},j={class:"field"},q={key:0,class:"help"},F={class:"field"},K={class:"field has-addons"},W={class:"control is-expanded"},G={class:"control is-expanded"},H={key:0,class:"help"},J={key:1,class:"notification is-warning"},X=E({__name:"electron-test",setup(L){const{isElectron:r,isBrowser:w,hasElectronAPI:b}=$(),f=d(""),p=d(""),l=d("test-key"),i=d("test-value"),a=d("");P(()=>{f.value=navigator.userAgent});const h=async()=>{if(window.electronAPI)try{const e=await window.electronAPI.app.getName(),t=await window.electronAPI.app.getVersion();p.value=`${e} v${t}`}catch(e){p.value=`エラー: ${e}`}},k=async()=>{if(window.electronAPI)try{await window.electronAPI.store.set(l.value,i.value),a.value=`保存成功: ${l.value} = ${i.value}`}catch(e){a.value=`エラー: ${e}`}},I=async()=>{if(window.electronAPI)try{const e=await window.electronAPI.store.get(l.value);a.value=`読込成功: ${l.value} = ${e}`,i.value=e||""}catch(e){a.value=`エラー: ${e}`}};return(e,t)=>(u(),c("div",V,[s("div",C,[t[12]||(t[12]=s("h1",{class:"title"},"Electron判定テスト",-1)),s("div",B,[s("div",{class:v(["notification",o(r)?"is-primary":"is-info"])},[s("p",z,[t[2]||(t[2]=s("strong",null,"実行環境:",-1)),g(" "+n(o(r)?"Electronアプリ":"Webブラウザ"),1)])],2),s("div",N,[s("div",D,[s("div",S,[t[6]||(t[6]=s("h2",{class:"subtitle"},"判定結果",-1)),s("ul",null,[s("li",null,[t[3]||(t[3]=s("strong",null,"isElectron:",-1)),s("span",{class:v(["tag",o(r)?"is-success":"is-danger"])},n(o(r)),3)]),s("li",null,[t[4]||(t[4]=s("strong",null,"isBrowser:",-1)),s("span",{class:v(["tag",o(w)?"is-success":"is-danger"])},n(o(w)),3)]),s("li",null,[t[5]||(t[5]=s("strong",null,"hasElectronAPI:",-1)),s("span",{class:v(["tag",o(b)?"is-success":"is-danger"])},n(o(b)),3)])])])]),s("div",T,[s("div",U,[t[7]||(t[7]=s("h2",{class:"subtitle"},"User Agent",-1)),s("p",M,n(o(f)),1)])])]),o(r)?(u(),c("div",R,[t[10]||(t[10]=s("h2",{class:"subtitle"},"Electron専用機能",-1)),s("div",j,[t[8]||(t[8]=s("label",{class:"label"},"アプリ情報",-1)),s("div",{class:"control"},[s("button",{class:"button is-primary",onClick:h}," アプリ情報を取得 ")]),o(p)?(u(),c("p",q,n(o(p)),1)):_("",!0)]),s("div",F,[t[9]||(t[9]=s("label",{class:"label"},"ストアテスト",-1)),s("div",K,[s("div",W,[y(s("input",{"onUpdate:modelValue":t[0]||(t[0]=m=>A(l)?l.value=m:null),class:"input",type:"text",placeholder:"キー"},null,512),[[x,o(l)]])]),s("div",G,[y(s("input",{"onUpdate:modelValue":t[1]||(t[1]=m=>A(i)?i.value=m:null),class:"input",type:"text",placeholder:"値"},null,512),[[x,o(i)]])]),s("div",{class:"control"},[s("button",{class:"button is-info",onClick:k}," 保存 ")]),s("div",{class:"control"},[s("button",{class:"button is-link",onClick:I}," 読込 ")])]),o(a)?(u(),c("p",H,n(o(a)),1)):_("",!0)])])):(u(),c("div",J,[...t[11]||(t[11]=[s("p",null,[g(" この機能はElectronアプリ内でのみ利用できます。"),s("br"),g(" デスクトップアプリをダウンロードしてお試しください。 ")],-1)])]))])])]))}});export{X as default};
