1import{_ as E}from"./D0uCFGCH.js";import{a as P,_ as I}from"./DXAJt9W4.js";import{_ as w}from"./BBbAKNYK.js";import{u as D,o as F,t as h,aG as k,v as p,h as B,r as N}from"./BS2jnaI2.js";import{S as l}from"./CWsDPZs7.js";import{u as C}from"./CIMC3FfE.js";import{u as b}from"./qjZZq_Ni.js";import{y as A,a1 as L,r as O,O as R,U as s,z as e,P as q,a6 as n,a3 as z}from"./D4JYmFL8.js";import"./D6l86okf.js";import"./B_SYqMDm.js";const ee=A({__name:"[[id]]",async setup(G){let d,_;const{params:u}=D(),m=F(),g=h({name:p().required(),originalname:p().required(),description:p(),statusId:k()}),{data:f}=([d,_]=L(()=>C(`/api/studios/${u.id}`,{method:"POST"},"$T_7zSNgbM3")),d=await d,_(),d),a=O(f.value?.id?f.value:{name:"",originalname:"",description:"",statusId:l.PUBLISHED}),{mutate:U,isPending:V}=b({mutationFn:o=>$fetch("/api/studios",{method:"POST",body:{...o}}),onSuccess:async o=>{m.add({title:"СÑÑÐ´Ð¸Ñ ÑÑпеÑно Ñоздан",icon:"i-ci-check"}),await N({name:"admin-studios-edit-id",params:{id:o.id}})},onError:()=>{m.add({title:"Ðе ÑдалоÑÑ ÑоздаÑÑ ÑÑÑдиÑ",color:"red",icon:"i-ci-error"})}}),{mutate:x,isPending:S}=b({mutationFn:({data:o,id:t})=>$fetch(`/api/studios/${t}`,{method:"PUT",body:{...o}}),onSuccess:()=>{m.add({title:"СÑÑÐ´Ð¸Ñ ÑÑпеÑно обновлена",icon:"i-ci-check"})},onError:()=>{m.add({title:"Ðе ÑдалоÑÑ Ð¾Ð±Ð½Ð¾Ð²Ð¸ÑÑ ÑÑÑдиÑ",color:"red",icon:"i-ci-error"})}});function T(o){u.id?x({data:o.data,id:Number(u.id)}):U(o.data)}return(o,t)=>{const c=E,r=I,v=w,$=B,y=P;
1return q(),R(y,{class:"max-w-md space-y-4",state:e(a),schema:e(g),onSubmit:T},{default:s(()=>[n(r,{name:"name",label:"Ðазвание"},{default:s(()=>[n(c,{modelValue:e(a).name,"onUpdate:modelValue":t[0]||(t[0]=i=>e(a).name=i)},null,8,["modelValue"])]),_:1}),n(r,{name:"originalName",label:"ÐÑигиналÑное название"},{default:s(()=>[n(c,{modelValue:e(a).originalname,"onUpdate:modelValue":t[1]||(t[1]=i=>e(a).originalname=i)},null,8,["modelValue"])]),_:1}),n(r,{name:"description",label:"ÐпиÑание"},{default:s(()=>[n(c,{modelValue:e(a).description,"onUpdate:modelValue":t[2]||(t[2]=i=>e(a).description=i)},null,8,["modelValue"])]),_:1}),n(r,{name:"status_id",label:"СÑаÑÑÑ"},{default:s(()=>[n(v,{modelValue:e(a).statusId,"onUpdate:modelValue":t[3]||(t[3]=i=>e(a).statusId=i),options:[{value:e(l).PUBLISHED,label:"ÐпÑбликован"},{value:e(l).DRAFT,label:"ЧеÑновик"},{value:e(l).READY,label:"ÐоÑов к пÑбликаÑии"},{value:e(l).DELETED,label:"Удален"}]},null,8,["modelValue","options"])]),_:1}),n($,{class:"block min-w-[150px] font-semibold",type:"submit",loading:e(V)||e(S)},{default:s(()=>t[4]||(t[4]=[z(" СоÑ
ÑаниÑÑ ")])),_:1},8,["loading"])]),_:1},8,["state","schema"])}}});export{ee 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.