1import{j as e}from"./app-C1iegf7Q.js";import{u,H as f,L as m}from"./inertia-BpyZy4w-.js";import{C as _}from"./criterion-select-CKY8-FHk.js";import{S as y}from"./specimen-editor-uV39xwnt.js";import{B as c}from"./button-BE4q1_FS.js";import{I as l}from"./input-DJt0nBB3.js";import{L as o}from"./label-Czc25Mye.js";import{S as b,e as g,f as w,a as N,c as k}from"./select-Bn8hgKYl.js";import{S as C}from"./switch-DhdMz2rn.js";import{T as d}from"./textarea-CXLxrYIG.js";import{a as S}from"./admin-layout-BhXWbUlP.js";import{A as E}from"./arrow-left-DCX0fhKH.js";/* empty css */import"./template-specimen-Dl-ug0G8.js";import"./sparkles-C0aC1RHI.js";import"./createLucideIcon-wqc1LSWg.js";import"./triangle-alert-C7AVwNi-.js";import"./info-D2ZN_yLm.js";import"./link-2-D0ZKUr8N.js";import"./image-vCg-0Xge.js";import"./index-CGXdj8xB.js";import"./utils-BiuKVCuu.js";import"./index-DdRFMukF.js";import"./index-BdQq_4o_.js";import"./index-Dc_FVRD7.js";import"./index-B0NHTN87.js";import"./index-C48dRAib.js";import"./index-BDqbV96p.js";import"./index-Cja0wFUH.js";import"./index-CL12STDK.js";import"./Combination-Cr5kvm8y.js";import"./index-C_n-C52S.js";import"./index-D4vO54bj.js";import"./index-BRU_LjHB.js";import"./index-XydtsrKA.js";import"./index-Cs5D2gCo.js";import"./index-DyGg2PJd.js";import"./chevron-down-B1YaU0K5.js";import"./check-0O-UND6N.js";import"./chevron-up-CLp5HMgA.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function Ce({exemplar:s,criteria:x,visibilities:p}){const{data:r,setData:n,patch:h,processing:a,errors:t}=u({title:s.title,criterion_code:s.criterion_code??"",content:s.content??"",why_it_works:s.why_it_works??"",specimen:s.specimen??"",visibility:s.visibility,provenance:s.provenance??"",is_active:s.is_active}),v=i=>{i.preventDefault(),h(`/admin/exemplars/${s.uuid}`)};return e.jsxs(S,{children:[e.jsx(f,{title:"Edit Exemplar · Admin"}),e.jsx("div",{className:"px-4 py-5 sm:px-6 sm:py-7",children:e.jsxs("div",{className:"mx-auto max-w-3xl",children:[e.jsxs("div",{className:"mb-5",children:[e.jsxs(m,{href:"/admin/exemplars",className:"mb-2 inline-flex items-center gap-1 text-xs font-medium text-ink-3 hover:text-ink",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," Back to Exemplars"]}),e.jsx("h1",{className:"text-xl font-semibold text-ink",children:"Edit Exemplar"})]}),e.jsxs("form",{onSubmit:v,children:[e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Exemplar"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Remove all real names, employers, and identifying details before saving."}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"title",children:"Title *"}),e.jsx(l,{id:"title",value:r.title,onChange:i=>n("title",i.target.value),required:!0}),t.title&&e.jsx("p",{className:"mt-1 text-xs text-red",children:t.title})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"criterion_code",children:"Endorsement criterion"}),e.jsx(_,{id:"criterion_code",value:r.criterion_code,criteria:x,placeholder:"Which criterion does this evidence?",onChange:i=>n("criterion_code",i)}),e.jsx("p",{className:"mt-1 text-xs text-ink-3",children:"Must match the templates it should back. Journey is derived from this."}),t.criterion_code&&e.jsx("p",{className:"mt-1 text-xs text-red",children:t.criterion_code})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"content",children:"Anonymised content"}),e.jsx(d,{id:"content",value:r.content,onChange:i=>n("content",i.target.value),rows:14,className:"font-mono text-xs"}),t.content&&e.jsx("p",{className:"mt-1 text-xs text-red",children:t.content})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"why_it_works",children:"Why it works (one point per line)"}),e.jsx(d,{id:"why_it_works",value:r.why_it_works,onChange:i=>n("why_it_works",i.target.value),rows:5}),t.why_it_works&&e.jsx("p",{className:"mt-1 text-xs text-red",children:t.why_it_works})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"visibility",children:"Visibility *"}),e.jsxs(b,{value:r.visibility,onValueChange:i=>n("visibility",i),children:[e.jsx(g,{id:"visibility",children:e.jsx(w,{})}),e.jsx(N,{children:Object.entries(p).map(([i,j])=>e.jsx(k,{value:i,children:j},i))})]}),t.visibility&&e.jsx("p",{className:"mt-1 text-xs text-red",children:t.visibility})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"provenance",children:"Provenance"}),e.jsx(l,{id:"provenance",value:r.provenance,onChange:i=>n("provenance",i.target.value)}),t.provenance&&e.jsx("p",{className:"mt-1 text-xs text-red",children:t.provenance})]})]}),r.visibility==="rendered_specimen"&&e.jsx(y,{value:r.specimen,onChange:i=>n("specimen",i),error:t.specimen}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"is_active",children:"Active"}),e.jsx("p",{className:"text-sm text-ink-3",children:"Inactive exemplars are excluded from generation."})]}),e.jsx(C,{id:"is_active",checked:r.is_active,onCheckedChange:i=>n("is_active",i)})]})]})]}),e.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[e.jsx(c,{type:"button",variant:"outline",asChild:!0,children:e.jsx(m,{href:"/admin/exemplars",children:"Cancel"})}),e.jsx(c,{type:"submit",disabled:a,children:a?"Saving...":"Save Changes"})]})]})]})})]})}export{Ce 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.