UNPKG

mira-app-server

Version:

Mira Server - standalone server application using mira-app-core

2 lines (1 loc) 26.4 kB
import{aJ as A,cS as ne,al as g,a1 as N,bZ as m,ax as h,at as I,dq as i,aG as d,cr as a,cg as le,av as Z,as as t,cc as Y,bN as V,bL as ee,ak as ae,ds as $,dt as Q,cR as se,c8 as M,cz as L,B as ie,aH as r,x as F,cb as W,dr as G,dh as U,dg as X,d1 as re}from"./index-OOzZz4T6.js";import{f as de,e as ue,d as ce,T as pe}from"./TooltipTrigger-BN8IaDgz.js";import{b as me,d as ge,c as fe,T as ye}from"./TabsTrigger-BT8zVtVt.js";import{a as be,C as we}from"./CardContent-Kj1V4j7G.js";import{o as ve,d as Pe,s as K,a as he,b as _e,n as xe,e as ke,S as Se}from"./SchemaForm-BEBLGVyw.js";import"./usePrimitiveElement-CCN0lZVt.js";import"./Collection-xoV-DHwv.js";import"./Input-CZG1tOaA.js";import"./Checkbox-BfEXYDtx.js";import"./SelectValue-BTic8Ggd.js";import"./Switch-QckDRkQW.js";import"./Slider-IdZsXzZo.js";import"./Label-bwL3QO2u.js";import"./PopoverTrigger-xdplOlgm.js";import"./useKbd-kRIii9yh.js";import"./RadioGroupItem-nNNjlV9J.js";const Te=A({__name:"GlowingShadow",props:{width:{type:Number,required:!1,default:480},aspectRatio:{type:String,required:!1,default:"1.5/1"},radius:{type:String,required:!1,default:void 0},style:{type:Object,required:!1},colorMode:{type:String,required:!1,default:"rainbow"},color:{type:String,required:!1,default:"#a855f7"},colors:{type:Array,required:!1,default:()=>["#ef4444","#f59e0b","#22c55e","#3b82f6","#a855f7"]},hueSpeed:{type:Number,required:!1,default:1},animationSpeed:{type:String,required:!1,default:"4s"},cardColor:{type:String,required:!1,default:"hsl(260deg 100% 3%)"},textColor:{type:String,required:!1,default:"hsl(260deg 10% 55%)"},class:{type:String,required:!1}},setup(l,{expose:n}){n();const o=l;function e(c){if(typeof document>"u")return 0;const P=document.createElement("canvas").getContext("2d");if(!P)return 0;P.fillStyle="#000",P.fillStyle=c;const w=P.fillStyle.match(/rgba?\(([^)]+)\)/);if(!w)return 0;const[O,R,j]=w[1].split(",").map(E=>parseFloat(E)),k=O/255,S=R/255,D=j/255,T=Math.max(k,S,D),q=Math.min(k,S,D),z=T-q;let _=0;return z!==0&&(T===k?_=(S-D)/z%6:T===S?_=(D-k)/z+2:_=(k-S)/z+4,_*=60,_<0&&(_+=360)),Math.round(_)}const p=ne().replace(/[^a-zA-Z0-9-]/g,""),f=`glow-multi-hue-${p}`,s=g(()=>e(o.color)),y=g(()=>Array.from(new Set(o.colors.map(c=>e(c))))),v=g(()=>{const c=y.value;if(c.length===0)return"";if(c.length===1)return`@keyframes ${f} { 0% { --hue: ${c[0]}; } 100% { --hue: ${c[0]}; } }`;const P=c.map((x,w)=>`${(w/(c.length-1)*100).toFixed(2)}% { --hue: ${x}; }`).join(" ");return`@keyframes ${f} { ${P} }`}),b=g(()=>{const c={"--card-width":`${o.width}px`,"--card-aspect":o.aspectRatio,"--hue-speed":o.colorMode==="rainbow"?o.hueSpeed:1,"--animation-speed":o.animationSpeed,"--card-color":o.cardColor,"--text-color":o.textColor,"--multi-anim":f};return o.radius&&(c["--card-radius"]=o.radius),o.colorMode==="mono"&&(c["--hue"]=s.value),c}),B={props:o,toHue:e,uid:p,multiAnimName:f,monoHue:s,multiHues:y,multiKeyframes:v,containerStyle:b};return Object.defineProperty(B,"__isScriptSetup",{enumerable:!1,value:!0}),B}}),Ce={class:"glow-content"};function Be(l,n,o,e,p,f){return m(),h("div",{class:ee(["glow-container",[e.props.class,{"is-mono":o.colorMode==="mono","is-multi":o.colorMode==="multi","is-rainbow":o.colorMode==="rainbow"}]]),style:V(e.containerStyle),role:"button",tabindex:"0"},[o.colorMode==="multi"&&e.multiKeyframes?(m(),I(le("style"),{key:0},{default:i(()=>[d(a(e.multiKeyframes),1)]),_:1})):Z("",!0),n[0]||(n[0]=t("span",{class:"glow"},null,-1)),t("div",Ce,[Y(l.$slots,"default",{},void 0,!0)])],6)}const oe=N(Te,[["render",Be],["__scopeId","data-v-31aa7036"],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/glowing-shadow/GlowingShadow.vue"]]),De="3.5/1",ze=A({__name:"GlowingButton",props:{preset:{type:String,required:!1,default:"rainbow"},colorMode:{type:String,required:!1},color:{type:String,required:!1},colors:{type:Array,required:!1},animationSpeed:{type:String,required:!1,default:"4s"},hueSpeed:{type:Number,required:!1,default:1},size:{type:String,required:!1,default:"default"},disabled:{type:Boolean,required:!1,default:!1},class:{type:String,required:!1}},emits:["click"],setup(l,{expose:n,emit:o}){n();const e=l,p=o,f={rainbow:{mode:"rainbow"},mono:{mode:"mono",color:"#a855f7"},multi:{mode:"multi",colors:["#ef4444","#f59e0b","#22c55e","#3b82f6","#a855f7"]},blue:{mode:"mono",color:"#3b82f6"},purple:{mode:"mono",color:"#a855f7"},green:{mode:"mono",color:"#22c55e"},sunset:{mode:"multi",colors:["#f59e0b","#ef4444","#ec4899"]},ocean:{mode:"multi",colors:["#06b6d4","#3b82f6","#6366f1"]}},s=g(()=>{const w=f[e.preset];return{mode:e.colorMode??w.mode,color:e.color??w.color,colors:e.colors??w.colors}}),y={sm:{width:120,fontSize:"13px",radius:"10px"},default:{width:180,fontSize:"15px",radius:"12px"},lg:{width:240,fontSize:"17px",radius:"14px"}},v=g(()=>y[e.size].width),b=g(()=>y[e.size].radius),B=g(()=>({fontSize:y[e.size].fontSize,fontWeight:600})),c=g(()=>({pointerEvents:e.disabled?"none":"auto"}));function P(w){e.disabled||p("click",w)}const x={props:e,emit:p,PRESETS:f,resolved:s,SIZE_MAP:y,width:v,radius:b,aspect:De,contentStyle:B,wrapperStyle:c,onClick:P,get cn(){return ae},get GlowingShadow(){return oe}};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}});function qe(l,n,o,e,p,f){return m(),I(e.GlowingShadow,{class:ee(e.cn("glow-button",{"is-disabled":o.disabled},e.props.class)),style:V(e.wrapperStyle),width:e.width,radius:e.radius,"aspect-ratio":e.aspect,"color-mode":e.resolved.mode,color:e.resolved.color,colors:e.resolved.colors,"hue-speed":o.hueSpeed,"animation-speed":o.animationSpeed,role:"button",tabindex:o.disabled?-1:0,"aria-disabled":o.disabled||void 0,onClick:e.onClick,onKeydown:[n[0]||(n[0]=$(Q(s=>e.onClick(s),["prevent"]),["enter"])),n[1]||(n[1]=$(Q(s=>e.onClick(s),["prevent"]),["space"]))]},{default:i(()=>[t("span",{class:"glow-button-content",style:V(e.contentStyle)},[Y(l.$slots,"default",{},void 0,!0)],4)]),_:3},8,["class","style","width","radius","color-mode","color","colors","hue-speed","animation-speed","tabindex","aria-disabled"])}const Me=N(ze,[["render",qe],["__scopeId","data-v-64406f9f"],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/glowing-button/GlowingButton.vue"]]),Ge=A({__name:"PlaygroundPanel",setup(l,{expose:n}){n();const{t:o}=se(),e=M("notification"),p=g(()=>!!window.electronAPI?.notificationWindow),f=[{type:"info",label:"Info",icon:"info",color:"#3b82f6"},{type:"success",label:"Success",icon:"check_circle",color:"#10b981"},{type:"warning",label:"Warning",icon:"warning",color:"#f59e0b"},{type:"error",label:"Error",icon:"error",color:"#ef4444"}],s=g(()=>[{value:"top-left",label:o("views.playgroundPanel.positionTopLeft")},{value:"top-right",label:o("views.playgroundPanel.positionTopRight")},{value:"bottom-left",label:o("views.playgroundPanel.positionBottomLeft")},{value:"bottom-right",label:o("views.playgroundPanel.positionBottomRight")},{value:"top",label:o("views.playgroundPanel.positionTop")},{value:"bottom",label:o("views.playgroundPanel.positionBottom")},{value:"center",label:o("views.playgroundPanel.positionCenter")}]),y=g(()=>[{value:"slide",label:o("views.playgroundPanel.animationSlide")},{value:"fade",label:o("views.playgroundPanel.animationFade")},{value:"zoom",label:o("views.playgroundPanel.animationZoom")},{value:"bounce",label:o("views.playgroundPanel.animationBounce")},{value:"none",label:o("views.playgroundPanel.animationNone")}]),v=M({title:o("views.playgroundPanel.customNotificationTitle"),body:o("views.playgroundPanel.customNotificationBody"),type:"info",duration:5e3,animation:"slide"});async function b(u){try{await window.electronAPI?.notificationWindow?.show(u)}catch(C){console.error("[Playground] 通知发送失败:",C)}}function B(u){const C={info:{title:o("views.playgroundPanel.infoTitle"),body:o("views.playgroundPanel.infoBody"),type:"info"},success:{title:o("views.playgroundPanel.successTitle"),body:o("views.playgroundPanel.successBody"),type:"success"},warning:{title:o("views.playgroundPanel.warningTitle"),body:o("views.playgroundPanel.warningBody"),type:"warning"},error:{title:o("views.playgroundPanel.errorTitle"),body:o("views.playgroundPanel.errorBody"),type:"error"}};b(C[u||"info"])}function c(u){b({title:o("views.playgroundPanel.positionDemoTitle"),body:o("views.playgroundPanel.positionDemoBody",{position:u}),type:"info",position:u,duration:3e3})}function P(u){b({title:o("views.playgroundPanel.animationDemoTitle"),body:o("views.playgroundPanel.animationDemoBody",{animation:u}),type:"info",animation:u,duration:4e3})}function x(){b({title:o("views.playgroundPanel.importDoneTitle"),body:o("views.playgroundPanel.importDoneBody"),type:"success",actions:[{id:"view",label:o("views.playgroundPanel.viewAction")},{id:"dismiss",label:o("views.playgroundPanel.dismissAction")}],duration:0})}function w(){b({title:o("views.playgroundPanel.customContentTitle"),type:"info",html:`<div style="display:flex;flex-direction:column;gap:6px;"><p style="margin:0;">${o("views.playgroundPanel.customHtmlPrefix")} <b>HTML</b></p><ul style="margin:0;padding-left:18px;color:#9ca3af;font-size:12px;"><li>${o("views.playgroundPanel.htmlInlineCode")} <code style="background:rgba(255,255,255,.1);padding:1px 4px;border-radius:3px;">code</code></li><li>${o("views.playgroundPanel.htmlColoredText")} <span style="color:#10b981;">color</span> ${o("views.playgroundPanel.htmlText")} <span style="color:#f59e0b;">color</span></li><li>${o("views.playgroundPanel.htmlLinkStyle")} <a href="#" style="color:#3b82f6;">link</a></li></ul></div>`,duration:6e3})}function O(u){b({title:u===0?o("views.playgroundPanel.persistentTitle"):o("views.playgroundPanel.msGoneTitle",{n:u}),body:u===0?o("views.playgroundPanel.persistentBody"):o("views.playgroundPanel.msGoneBody",{n:u}),type:"info",duration:u})}function R(){try{window.electronAPI?.notificationWindow?.dismiss()}catch(u){console.error("[Playground] 关闭通知失败:",u)}}function j(){b({title:v.value.title,body:v.value.body,type:v.value.type,duration:v.value.duration,animation:v.value.animation})}const k=g(()=>ve({name:K().min(2,o("views.playgroundPanel.nameMin")).max(50,o("views.playgroundPanel.nameMax")),type:ke(["admin","user","guest"],{message:o("views.playgroundPanel.selectTypeRequired")}),level:xe().min(0).max(100),enabled:_e(),tags:he(K()).optional(),description:K().max(200,o("views.playgroundPanel.descMax")).optional(),birthday:Pe().optional()})),S=g(()=>[{name:"name",label:o("views.playgroundPanel.nameLabel"),type:"text",required:!0,placeholder:o("views.playgroundPanel.namePlaceholder")},{name:"type",label:o("views.playgroundPanel.typeLabel2"),type:"select",required:!0,placeholder:o("views.playgroundPanel.typePlaceholder"),options:[{label:o("views.playgroundPanel.admin"),value:"admin"},{label:o("views.playgroundPanel.user"),value:"user"},{label:o("views.playgroundPanel.guest"),value:"guest"}]},{name:"level",label:o("views.playgroundPanel.levelLabel"),type:"slider",min:0,max:100,step:1},{name:"enabled",label:o("views.playgroundPanel.enabledLabel"),type:"switch",description:o("views.playgroundPanel.enabledDesc")},{name:"tags",label:o("views.playgroundPanel.tagsLabel"),type:"checkbox-group",options:[{label:o("views.playgroundPanel.tagInternal"),value:"internal"},{label:o("views.playgroundPanel.tagPublic"),value:"public"},{label:o("views.playgroundPanel.tagArchived"),value:"archived"}]},{name:"birthday",label:o("views.playgroundPanel.birthdayLabel"),type:"date"},{name:"description",label:o("views.playgroundPanel.descriptionLabel"),type:"textarea",colSpan:2,placeholder:o("views.playgroundPanel.descriptionPlaceholder")}]),D={name:"",type:void 0,level:30,enabled:!0,tags:[],description:""},T=M(!1),q=M("");function z(u){const C=u;T.value=!0,setTimeout(()=>{q.value=JSON.stringify(C,null,2),T.value=!1,L.success(o("views.playgroundPanel.formSubmitSuccess"),{description:o("views.playgroundPanel.formSubmitSuccessDesc")})},600)}function _(){q.value="",L(o("views.playgroundPanel.cancelled"))}function E(u){const C=Object.values(u)[0];L.error(o("views.playgroundPanel.validationFailed"),{description:C||o("views.playgroundPanel.validationFailedDesc")})}const H=M(0);function te(){H.value++,L.success(o("views.playgroundPanel.glowButtonTitle"),{description:o("views.playgroundPanel.glowClickCount",{n:H.value})})}const J={t:o,activeTab:e,isElectron:p,typeDemos:f,positionDemos:s,animationDemos:y,custom:v,notify:b,showByType:B,showByPosition:c,showByAnimation:P,showStructured:x,showHtml:w,showWithDuration:O,dismissCurrent:R,showCustom:j,formSchema:k,formFields:S,formInitialValues:D,formSubmitting:T,formResult:q,onFormSubmit:z,onFormCancel:_,onFormInvalid:E,glowClickCount:H,onGlowClick:te,get Tabs(){return ye},get TabsList(){return fe},get TabsTrigger(){return ge},get TabsContent(){return me},get Button(){return ie},get Card(){return we},get CardContent(){return be},get GlowingShadow(){return oe},get GlowingButton(){return Me},get SchemaForm(){return Se}};return Object.defineProperty(J,"__isScriptSetup",{enumerable:!1,value:!0}),J}}),Le={class:"p-4 space-y-6"},Fe={class:"text-muted-foreground text-sm"},Ie={class:"space-y-3"},Ve={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},Ae={class:"text-xs text-muted-foreground"},Ne={class:"grid grid-cols-2 sm:grid-cols-4 gap-2"},Oe={class:"space-y-3"},Re={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},je={class:"text-xs text-muted-foreground"},Ee={class:"grid grid-cols-2 sm:grid-cols-4 gap-2"},He={class:"space-y-3"},We={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},Ue={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},Ke={class:"space-y-3"},Ze={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},Je={class:"text-xs text-muted-foreground"},$e={class:"flex flex-wrap items-center gap-2"},Qe={class:"space-y-3"},Xe={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},Ye={class:"flex flex-wrap items-center gap-2"},eo={class:"space-y-3"},oo={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},to={class:"rounded-lg border border-border p-3 space-y-3 bg-background/40"},no={class:"grid grid-cols-1 sm:grid-cols-2 gap-3"},lo={class:"block"},ao={class:"text-xs text-muted-foreground"},so=["placeholder"],io={class:"block"},ro={class:"text-xs text-muted-foreground"},uo={class:"block"},co={class:"text-xs text-muted-foreground"},po={value:"slide"},mo={value:"fade"},go={value:"zoom"},fo={value:"bounce"},yo={value:"none"},bo={class:"block"},wo={class:"text-xs text-muted-foreground"},vo=["placeholder"],Po={class:"flex items-center gap-3"},ho={class:"flex items-center gap-2 text-sm"},_o={class:"text-xs text-muted-foreground"},xo={key:1,class:"rounded-lg border border-dashed border-border p-8 text-center"},ko={class:"text-sm text-muted-foreground"},So={class:"space-y-1"},To={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},Co={class:"text-xs text-muted-foreground"},Bo={key:0,class:"space-y-2"},Do={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},zo={class:"rounded-lg border border-border bg-muted/40 p-3 text-xs overflow-auto max-h-60"},qo={class:"space-y-1"},Mo={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},Go={class:"text-xs text-muted-foreground"},Lo={class:"space-y-3"},Fo={class:"text-xs text-muted-foreground"},Io={class:"flex flex-wrap items-center gap-8 py-4"},Vo={class:"space-y-3"},Ao={class:"text-sm font-semibold text-foreground dark:text-muted-foreground"},No={class:"text-xs text-muted-foreground"},Oo={class:"flex flex-wrap items-center gap-6 py-4"},Ro={key:0,class:"text-xs text-muted-foreground"};function jo(l,n,o,e,p,f){return m(),h("div",Le,[t("div",null,[n[9]||(n[9]=t("h3",{class:"text-foreground dark:text-muted-foreground text-lg font-bold leading-tight tracking-[-0.015em] pb-2 pt-4"}," Playground ",-1)),t("p",Fe,a(l.$t("views.playgroundPanel.desc")),1)]),r(e.Tabs,{modelValue:e.activeTab,"onUpdate:modelValue":n[8]||(n[8]=s=>e.activeTab=s),class:"w-full"},{default:i(()=>[r(e.TabsList,{class:"grid w-full grid-cols-3"},{default:i(()=>[r(e.TabsTrigger,{value:"notification",class:"flex items-center gap-2"},{default:i(()=>[n[10]||(n[10]=t("span",{class:"material-icons text-base"},"notifications",-1)),d(" "+a(l.$t("views.playgroundPanel.notification")),1)]),_:1}),r(e.TabsTrigger,{value:"form",class:"flex items-center gap-2"},{default:i(()=>[n[11]||(n[11]=t("span",{class:"material-icons text-base"},"description",-1)),d(" "+a(l.$t("views.playgroundPanel.declarativeForm")),1)]),_:1}),r(e.TabsTrigger,{value:"glow",class:"flex items-center gap-2"},{default:i(()=>[n[12]||(n[12]=t("span",{class:"material-icons text-base"},"auto_awesome",-1)),d(" "+a(l.$t("views.playgroundPanel.glow")),1)]),_:1})]),_:1}),r(e.TabsContent,{value:"notification",class:"space-y-6 mt-4"},{default:i(()=>[e.isElectron?(m(),h(F,{key:0},[t("div",Ie,[t("p",Ve,a(l.$t("views.playgroundPanel.typeTitle")),1),t("p",Ae,a(l.$t("views.playgroundPanel.typeDesc")),1),t("div",Ne,[(m(),h(F,null,W(e.typeDemos,s=>r(e.Button,{key:s.type,variant:"outline",size:"sm",onClick:y=>e.showByType(s.type)},{default:i(()=>[t("span",{class:"material-icons text-base",style:V({color:s.color})},a(s.icon),5),d(" "+a(s.label),1)]),_:2},1032,["onClick"])),64))])]),t("div",Oe,[t("p",Re,a(l.$t("views.playgroundPanel.positionTitle")),1),t("p",je,a(l.$t("views.playgroundPanel.positionDesc")),1),t("div",Ee,[(m(!0),h(F,null,W(e.positionDemos,s=>(m(),I(e.Button,{key:s.value,variant:"outline",size:"sm",onClick:y=>e.showByPosition(s.value)},{default:i(()=>[d(a(s.label),1)]),_:2},1032,["onClick"]))),128))])]),t("div",He,[t("p",We,a(l.$t("views.playgroundPanel.customContent")),1),t("div",Ue,[r(e.Button,{variant:"secondary",size:"sm",onClick:e.showStructured},{default:i(()=>[n[13]||(n[13]=t("span",{class:"material-icons text-base"},"subject",-1)),d(" "+a(l.$t("views.playgroundPanel.structuredFields")),1)]),_:1}),r(e.Button,{variant:"secondary",size:"sm",onClick:e.showHtml},{default:i(()=>[n[14]||(n[14]=t("span",{class:"material-icons text-base"},"code",-1)),d(" "+a(l.$t("views.playgroundPanel.customHtml")),1)]),_:1})])]),t("div",Ke,[t("p",Ze,a(l.$t("views.playgroundPanel.animationTitle")),1),t("p",Je,a(l.$t("views.playgroundPanel.animationDesc")),1),t("div",$e,[(m(!0),h(F,null,W(e.animationDemos,s=>(m(),I(e.Button,{key:s.value,variant:"outline",size:"sm",onClick:y=>e.showByAnimation(s.value)},{default:i(()=>[d(a(s.label),1)]),_:2},1032,["onClick"]))),128))])]),t("div",Qe,[t("p",Xe,a(l.$t("views.playgroundPanel.durationTitle")),1),t("div",Ye,[r(e.Button,{variant:"outline",size:"sm",onClick:n[0]||(n[0]=s=>e.showWithDuration(0))},{default:i(()=>[d(a(l.$t("views.playgroundPanel.persistent")),1)]),_:1}),r(e.Button,{variant:"outline",size:"sm",onClick:n[1]||(n[1]=s=>e.showWithDuration(1500))},{default:i(()=>[d(a(l.$t("views.playgroundPanel.oneHalfSec")),1)]),_:1}),r(e.Button,{variant:"outline",size:"sm",onClick:n[2]||(n[2]=s=>e.showWithDuration(5e3))},{default:i(()=>[d(a(l.$t("views.playgroundPanel.fiveSec")),1)]),_:1}),r(e.Button,{variant:"outline",size:"sm",onClick:e.dismissCurrent},{default:i(()=>[n[15]||(n[15]=t("span",{class:"material-icons text-base"},"close",-1)),d(" "+a(l.$t("views.playgroundPanel.dismissCurrent")),1)]),_:1})])]),t("div",eo,[t("p",oo,a(l.$t("views.playgroundPanel.customParams")),1),t("div",to,[t("div",no,[t("label",lo,[t("span",ao,a(l.$t("views.playgroundPanel.titleLabel")),1),G(t("input",{"onUpdate:modelValue":n[3]||(n[3]=s=>e.custom.title=s),class:"mt-1 w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary",placeholder:l.$t("views.playgroundPanel.titlePlaceholder")},null,8,so),[[U,e.custom.title]])]),t("label",io,[t("span",ro,a(l.$t("views.playgroundPanel.typeLabel")),1),G(t("select",{"onUpdate:modelValue":n[4]||(n[4]=s=>e.custom.type=s),class:"mt-1 w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary"},n[16]||(n[16]=[t("option",{value:"info"},"info",-1),t("option",{value:"success"},"success",-1),t("option",{value:"warning"},"warning",-1),t("option",{value:"error"},"error",-1)]),512),[[X,e.custom.type]])])]),t("label",uo,[t("span",co,a(l.$t("views.playgroundPanel.animationLabel")),1),G(t("select",{"onUpdate:modelValue":n[5]||(n[5]=s=>e.custom.animation=s),class:"mt-1 w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary"},[t("option",po,a(l.$t("views.playgroundPanel.slideOption")),1),t("option",mo,a(l.$t("views.playgroundPanel.fadeOption")),1),t("option",go,a(l.$t("views.playgroundPanel.zoomOption")),1),t("option",fo,a(l.$t("views.playgroundPanel.bounceOption")),1),t("option",yo,a(l.$t("views.playgroundPanel.noneOption")),1)],512),[[X,e.custom.animation]])]),t("label",bo,[t("span",wo,a(l.$t("views.playgroundPanel.bodyLabel")),1),G(t("textarea",{"onUpdate:modelValue":n[6]||(n[6]=s=>e.custom.body=s),rows:"2",class:"mt-1 w-full rounded-md border border-border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary resize-none",placeholder:l.$t("views.playgroundPanel.bodyPlaceholder")},null,8,vo),[[U,e.custom.body]])]),t("div",Po,[t("label",ho,[t("span",_o,a(l.$t("views.playgroundPanel.durationMsLabel")),1),G(t("input",{"onUpdate:modelValue":n[7]||(n[7]=s=>e.custom.duration=s),type:"number",min:"0",step:"500",class:"w-24 rounded-md border border-border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary"},null,512),[[U,e.custom.duration,void 0,{number:!0}]])]),r(e.Button,{size:"sm",onClick:e.showCustom,disabled:!e.custom.title.trim()},{default:i(()=>[n[17]||(n[17]=t("span",{class:"material-icons text-base"},"send",-1)),d(" "+a(l.$t("views.playgroundPanel.send")),1)]),_:1},8,["disabled"])])])])],64)):(m(),h("div",xo,[n[19]||(n[19]=t("span",{class:"material-icons text-4xl text-muted-foreground mb-2 block"},"desktop_access_disabled",-1)),t("p",ko,[d(a(l.$t("views.playgroundPanel.notElectronDesc"))+" ",1),n[18]||(n[18]=t("br",null,null,-1)),d(a(l.$t("views.playgroundPanel.openDesktop")),1)])]))]),_:1}),r(e.TabsContent,{value:"form",class:"space-y-4 mt-4"},{default:i(()=>[t("div",So,[t("p",To,a(l.$t("views.playgroundPanel.formIntro")),1),t("p",Co,a(l.$t("views.playgroundPanel.formIntroDesc")),1)]),r(e.Card,{class:"bg-background/40"},{default:i(()=>[r(e.CardContent,{class:"pt-6"},{default:i(()=>[r(e.SchemaForm,{schema:e.formSchema,fields:e.formFields,"initial-values":e.formInitialValues,title:l.$t("views.playgroundPanel.formTitle"),"form-description":l.$t("views.playgroundPanel.formDesc"),"submit-text":l.$t("views.playgroundPanel.submit"),submitting:e.formSubmitting,onSubmit:e.onFormSubmit,onCancel:e.onFormCancel,onInvalid:e.onFormInvalid},null,8,["schema","fields","title","form-description","submit-text","submitting"])]),_:1})]),_:1}),e.formResult?(m(),h("div",Bo,[t("p",Do,a(l.$t("views.playgroundPanel.resultTitle")),1),t("pre",zo,a(e.formResult),1)])):Z("",!0)]),_:1}),r(e.TabsContent,{value:"glow",class:"space-y-6 mt-4"},{default:i(()=>[t("div",qo,[t("p",Mo,a(l.$t("views.playgroundPanel.glowShadowTitle")),1),t("p",Go,a(l.$t("views.playgroundPanel.glowDesc")),1)]),t("div",Lo,[t("p",Fo,a(l.$t("views.playgroundPanel.glowShadowDesc")),1),t("div",Io,[r(e.GlowingShadow,{width:240},{default:i(()=>[d(a(l.$t("views.playgroundPanel.glowRainbow")),1)]),_:1}),r(e.GlowingShadow,{width:240,"color-mode":"mono",color:"#3b82f6"},{default:i(()=>[d(a(l.$t("views.playgroundPanel.glowMono")),1)]),_:1}),r(e.GlowingShadow,{width:240,"color-mode":"multi",colors:["#ef4444","#22c55e","#3b82f6"]},{default:i(()=>[d(a(l.$t("views.playgroundPanel.glowMulti")),1)]),_:1})])]),t("div",Vo,[t("p",Ao,a(l.$t("views.playgroundPanel.glowButtonTitle")),1),t("p",No,a(l.$t("views.playgroundPanel.glowButtonDesc")),1),t("div",Oo,[r(e.GlowingButton,{preset:"rainbow",onClick:e.onGlowClick},{default:i(()=>[d(a(l.$t("views.playgroundPanel.glowRainbow")),1)]),_:1}),r(e.GlowingButton,{preset:"blue"},{default:i(()=>[d(a(l.$t("views.playgroundPanel.glowMono")),1)]),_:1}),r(e.GlowingButton,{preset:"sunset",size:"lg"},{default:i(()=>n[20]||(n[20]=[d("Sunset")])),_:1}),r(e.GlowingButton,{preset:"ocean",size:"sm"},{default:i(()=>n[21]||(n[21]=[d("Ocean")])),_:1}),r(e.GlowingButton,{preset:"green",disabled:""},{default:i(()=>[d(a(l.$t("views.playgroundPanel.glowDisabled")),1)]),_:1})]),e.glowClickCount>0?(m(),h("p",Ro,a(l.$t("views.playgroundPanel.glowClickCount",{n:e.glowClickCount})),1)):Z("",!0)])]),_:1})]),_:1},8,["modelValue"])])}const Eo=N(Ge,[["render",jo],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/settings/PlaygroundPanel.vue"]]),Ho=A({__name:"PlaygroundView",setup(l,{expose:n}){n();const o=re(),p={router:o,goBack:()=>{o.go(-1)},get Tooltip(){return pe},get TooltipContent(){return ce},get TooltipProvider(){return ue},get TooltipTrigger(){return de},PlaygroundPanel:Eo};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}}),Wo={class:"playground-view h-full flex flex-col bg-muted dark:bg-muted"},Uo={class:"flex items-center justify-between whitespace-nowrap border-b border-solid border-b-slate-200 dark:border-border px-10 py-3 bg-white dark:bg-muted"},Ko={class:"flex items-center gap-4 text-foreground dark:text-muted-foreground"},Zo={class:"flex-1 overflow-y-auto"};function Jo(l,n,o,e,p,f){return m(),h("div",Wo,[t("header",Uo,[t("div",Ko,[r(e.TooltipProvider,null,{default:i(()=>[r(e.Tooltip,null,{default:i(()=>[r(e.TooltipTrigger,{"as-child":""},{default:i(()=>[t("button",{class:"flex h-10 w-10 items-center justify-center rounded-full bg-transparent text-foreground dark:text-muted-foreground hover:bg-muted dark:hover:bg-muted transition-colors",onClick:e.goBack},n[0]||(n[0]=[t("span",{class:"material-icons text-lg"},"arrow_back",-1)]))]),_:1}),r(e.TooltipContent,{side:"bottom"},{default:i(()=>[d(a(l.$t("views.playgroundView.back")),1)]),_:1})]),_:1})]),_:1}),n[1]||(n[1]=t("span",{class:"material-icons text-lg"},"science",-1)),n[2]||(n[2]=t("h2",{class:"text-foreground dark:text-muted-foreground text-lg font-bold leading-tight tracking-[-0.015em]"},"Playground",-1))])]),t("div",Zo,[r(e.PlaygroundPanel)])])}const pt=N(Ho,[["render",Jo],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/PlaygroundView.vue"]]);export{pt as default};