import{Dn as e,J as t,Kt as n,M as r,O as i,Q as a,Qt as o,R as s,Tn as c,Y as l,Z as u,at as d,fr as f,i as p,it as m,o as h,or as g,r as _,st as v}from"./dist-CoD0k1Bd.js";import{t as y}from"./Label-DKn3cyeE.js";import{t as b}from"./arrow-left-GfHRP_1N.js";import{t as x}from"./Input-C3DwKNOf.js";import{t as S}from"./button-mN_poAXs.js";import{t as C}from"./routes-BZ4t1sNs.js";import{t as w}from"./Heading-CCd5Tysh.js";import{t as T}from"./InputError-BY5lDrFd.js";import{t as E}from"./RichTextEditor-DF426Krt.js";var D={class:`flex flex-col space-y-6`},O={class:`grid gap-2`},k={class:`grid gap-2`},A={key:0,class:`text-xs text-muted-foreground`},j={class:`grid gap-2`},M={class:`grid gap-2`},N={class:`grid gap-4 sm:grid-cols-2`},P={class:`grid gap-2`},F=[`value`],I={class:`grid gap-2`},L={class:`flex justify-end gap-2`},R=v({layout:{breadcrumbs:[{title:`Dashboard`,href:C()},{title:`Kategori Landing`,href:`/kategoris`},{title:`Baru`,href:`/kategoris/create`}]},__name:`Create`,props:{jenisOptions:{}},setup(v){let C=h({nama_kategori:``,judul:``,deskripsi:``,alias:``,jenis:`Redirect`,status:!0}),R=t(()=>C.jenis===`Redirect`),z=()=>C.post(`/kategoris`);return(t,h)=>(n(),a(s,null,[d(g(_),{title:`Kategori Baru`}),l(`div`,D,[l(`div`,null,[d(g(S),{"as-child":``,variant:`ghost`,size:`sm`,class:`mb-2`},{default:c(()=>[d(g(p),{href:`/kategoris`},{default:c(()=>[d(g(b),{class:`size-4`}),h[6]||=m(` Kembali`,-1)]),_:1})]),_:1}),d(w,{title:`Kategori Baru`,description:`Buat kategori landing untuk rotator iklan`})]),l(`form`,{onSubmit:r(z,[`prevent`]),class:`max-w-2xl space-y-6`},[l(`div`,O,[d(g(y),{for:`nama_kategori`},{default:c(()=>[...h[7]||=[m(`Nama Kategori `,-1),l(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),d(g(x),{id:`nama_kategori`,modelValue:g(C).nama_kategori,"onUpdate:modelValue":h[0]||=e=>g(C).nama_kategori=e,required:``},null,8,[`modelValue`]),d(T,{message:g(C).errors.nama_kategori},null,8,[`message`])]),l(`div`,k,[d(g(y),{for:`alias`},{default:c(()=>[...h[8]||=[m(`Alias (URL publik)`,-1)]]),_:1}),d(g(x),{id:`alias`,modelValue:g(C).alias,"onUpdate:modelValue":h[1]||=e=>g(C).alias=e,disabled:R.value,placeholder:R.value?`kode unik digenerate otomatis`:`otomatis dari nama bila kosong`},null,8,[`modelValue`,`disabled`,`placeholder`]),R.value?(n(),a(`p`,A,` Jenis Redirect: kode unik digenerate otomatis (mis. /landing/x7k2m9ab). `)):u(``,!0),d(T,{message:g(C).errors.alias},null,8,[`message`])]),l(`div`,j,[d(g(y),{for:`judul`},{default:c(()=>[...h[9]||=[m(`Judul (halaman perantara)`,-1)]]),_:1}),d(g(x),{id:`judul`,modelValue:g(C).judul,"onUpdate:modelValue":h[2]||=e=>g(C).judul=e},null,8,[`modelValue`])]),l(`div`,M,[d(g(y),{for:`deskripsi`},{default:c(()=>[...h[10]||=[m(`Deskripsi`,-1)]]),_:1}),d(E,{id:`deskripsi`,modelValue:g(C).deskripsi,"onUpdate:modelValue":h[3]||=e=>g(C).deskripsi=e},null,8,[`modelValue`]),h[11]||=l(`p`,{class:`text-xs text-muted-foreground`},`Tampil di halaman landing.`,-1)]),l(`div`,N,[l(`div`,P,[d(g(y),{for:`jenis`},{default:c(()=>[...h[12]||=[m(`Jenis `,-1),l(`span`,{class:`text-destructive`},`*`,-1)]]),_:1}),e(l(`select`,{id:`jenis`,"onUpdate:modelValue":h[4]||=e=>g(C).jenis=e,required:``,class:`mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm`},[(n(!0),a(s,null,o(v.jenisOptions,e=>(n(),a(`option`,{key:e.value,value:e.value},f(e.label),9,F))),128))],512),[[i,g(C).jenis]]),d(T,{message:g(C).errors.jenis},null,8,[`message`])]),l(`div`,I,[d(g(y),{for:`status`},{default:c(()=>[...h[13]||=[m(`Status`,-1)]]),_:1}),e(l(`select`,{id:`status`,"onUpdate:modelValue":h[5]||=e=>g(C).status=e,class:`mt-1 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm`},[...h[14]||=[l(`option`,{value:!0},`Aktif`,-1),l(`option`,{value:!1},`Nonaktif`,-1)]],512),[[i,g(C).status]])])]),l(`div`,L,[d(g(S),{"as-child":``,variant:`outline`,type:`button`},{default:c(()=>[d(g(p),{href:`/kategoris`},{default:c(()=>[...h[15]||=[m(`Batal`,-1)]]),_:1})]),_:1}),d(g(S),{type:`submit`,disabled:g(C).processing},{default:c(()=>[...h[16]||=[m(`Simpan`,-1)]]),_:1},8,[`disabled`])])],32)])],64))}});export{R as default};