1import{q as ce,r as u,j as e,B as v,f as de,h as A,J as L,Q as P,D as me,c as xe,d as ue,e as he,s as F,aM as S,y as pe}from"./index-CysU2Jg9.js";import{I as b}from"./input-UNMuvhAA.js";import{L as k}from"./label-CLsWIlGF.js";import{T as $}from"./textarea-BId7pPGh.js";import{S as W}from"./switch-COWD1z9F.js";import{S as Y,a as G,b as J,c as Q,d as I}from"./select-D_KGIcT1.js";import{T as _,A as X,a as Z,b as ee,c as se,d as te,e as ae,f as le,g as ie,h as je,i as fe,j as q,k as B,o as M,s as E,u as z}from"./MemberDashboard-nLuHpg9t.js";import{a as ve,b as ge,F as V,c as H,d as be,e as Ne}from"./form-config-DBWkGO_e.js";import{B as U}from"./badge-f1jASh_g.js";import{R as ye}from"./refresh-cw-csMTbmFX.js";import{C as we}from"./calendar-1a5dmTGo.js";import{U as ke}from"./user-Bpl3Gv-J.js";import{f as K}from"./format-DEp8I5i1.js";import{W as Ce}from"./wrench-B8lZnE01.js";import{S as Se}from"./save-u1go4Yuq.js";import"./check-CMDL-7uT.js";import"./use-auth-B4_mJ4CN.js";import"./index-CQ2ZrIkQ.js";import"./wind-CwxRb_eO.js";import"./arrow-left-DtRFkuOL.js";import"./download-DFjGv9mm.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ne=ce("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);function _e(){const[t,r]=u.useState([]),[i,h]=u.useState(!0),[x,g]=u.useState("all"),[j,l]=u.useState(""),[s,o]=u.useState(null),[n,d]=u.useState(null),p=async()=>{h(!0);const{data:a,error:m}=await F.from("form_submissions").select("*").order("created_at",{ascending:!1}).limit(500);if(h(!1),m){S({title:"Failed to load submissions",description:m.message,variant:"destructive"});return}r(a??[])};u.useEffect(()=>{p()},[]);const f=u.useMemo(()=>{const a=new Map;for(const m of t)a.set(m.intent_key,m.intent_label||m.intent_key);return Array.from(a,([m,C])=>({key:m,label:C}))},[t]),y=u.useMemo(()=>{const a=j.trim().toLowerCase();return t.filter(m=>x!=="all"&&m.intent_key!==x?!1:a?(m.submitter_name??"").toLowerCase().includes(a)||(m.submitter_email??"").toLowerCase().includes(a)||(m.submitter_phone??"").toLowerCase().includes(a)||(m.message??"").toLowerCase().includes(a)||(m.intent_label??"").toLowerCase().includes(a):!0)},[t,x,j]),w=async a=>{const{error:m}=await F.from("form_submissions").delete().eq("id",a);if(m){S({title:"Delete failed",description:m.message,variant:"destructive"});return}r(C=>C.filter(T=>T.id!==a)),(s==null?void 0:s.id)===a&&o(null),S({title:"Submission deleted"})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-2xl font-bold",children:"Form submissions"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Every submission from the enquiry form and CSA form. Newest first."})]}),e.jsxs(v,{variant:"outline",size:"sm",onClick:p,className:"gap-2",children:[e.jsx(ye,{className:"h-4 w-4"})," Refresh"]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[220px]",children:[e.jsx(de,{className:"h-4 w-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx(b,{className:"pl-9",placeholder:"Search name, email, phone, messageâ¦",value:j,onChange:a=>l(a.target.value)})]}),e.jsxs(Y,{value:x,onValueChange:g,children:[e.jsx(G,{className:"w-[220px]",children:e.jsx(J,{placeholder:"All intents"})}),e.jsxs(Q,{children:[e.jsxs(I,{value:"all",children:["All intents (",t.length,")"]}),f.map(a=>e.jsx(I,{value:a.key,children:a.label},a.key))]})]})]}),i?e.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[e.jsx(A,{className:"h-5 w-5 animate-spin mr-2"})," Loading submissionsâ¦"]}):y.length===0?e.jsxs("div",{className:"text-center py-16 border border-dashed rounded-2xl text-muted-foreground",children:[e.jsx(ne,{className:"h-8 w-8 mx-auto mb-2 opacity-60"}),"No submissions",x!=="all"||j?" match your filters":" yet","."]}):e.jsx("div",{className:"bg-card border border-border rounded-2xl divide-y divide-border overflow-hidden",children:y.map(a=>e.jsx("button",{onClick:()=>o(a),className:"w-full text-left p-4 hover:bg-accent/50 transition-colors flex items-start gap-3",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[e.jsx(U,{variant:"secondary",className:"text-[10px] uppercase tracking-wide",children:a.intent_label||a.intent_key}),e.jsxs("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e.jsx(we,{className:"h-3 w-3"}),K(new Date(a.created_at),"d MMM yyyy · h:mm a")]})]}),e.jsx("div",{className:"text-sm font-medium truncate",children:a.submitter_name||a.submitter_email||"(no name)"}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-3 flex-wrap mt-0.5",children:[a.submitter_email&&e.jsxs("span",{className:"flex items-center gap-1 truncate max-w-[240px]",children:[e.jsx(L,{className:"h-3 w-3"})," ",a.submitter_email]}),a.submitter_phone&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"h-3 w-3"})," ",a.submitter_phone]})]}),a.message&&e.jsx("div",{className:"text-sm text-muted-foreground mt-1.5 line-clamp-2",children:a.message})]})},a.id))}),e.jsx(me,{open:!!s,onOpenChange:a=>!a&&o(null),children:e.jsx(xe,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:s&&e.jsxs(e.Fragment,{children:[e.jsxs(ue,{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(U,{variant:"secondary",className:"text-[10px] uppercase tracking-wide",children:s.intent_label||s.intent_key}),e.jsx("span",{className:"text-xs text-muted-foreground",children:K(new Date(s.created_at),"EEEE d MMMM yyyy, h:mm a")})]}),e.jsx(he,{className:"font-display text-xl",children:s.submitter_name||s.submitter_email||"Submission"})]}),e.jsxs("div",{className:"space-y-4 pt-2",children:[e.jsxs("div",{className:"grid sm:grid-cols-2 gap-3 text-sm",children:[s.submitter_name&&e.jsx(D,{icon:e.jsx(ke,{className:"h-4 w-4"}),label:"Name",value:s.submitter_name}),s.submitter_email&&e.jsx(D,{icon:e.jsx(L,{className:"h-4 w-4"}),label:"Email",value:e.jsx("a",{href:`mailto:${s.submitter_email}`,className:"text-primary hover:underline",children:s.submitter_email})}),s.submitter_phone&&e.jsx(D,{icon:e.jsx(P,{className:"h-4 w-4"}),label:"Phone",value:e.jsx("a",{href:`tel:${s.submitter_phone}`,className:"text-primary hover:underline",children:s.submitter_phone})}),s.reply_to&&s.reply_to!==s.submitter_email&&e.jsx(D,{icon:e.jsx(L,{className:"h-4 w-4"}),label:"Reply-to",value:s.reply_to})]}),s.message&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold uppercase text-muted-foreground mb-1",children:"Message"}),e.jsx("div",{className:"bg-muted/40 border border-border rounded-xl p-3 text-sm whitespace-pre-wrap",children:s.message})]}),Array.isArray(s.details)&&s.details.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-semibold uppercase text-muted-foreground mb-1",children:"Details"}),e.jsx("dl",{className:"bg-muted/40 border border-border rounded-xl divide-y divide-border",children:s.details.map((a,m)=>e.jsxs("div",{className:"p-3 grid grid-cols-[140px_1fr] gap-3",children:[e.jsx("dt",{className:"text-xs font-medium text-muted-foreground",children:a.label}),e.jsx("dd",{className:"text-sm whitespace-pre-wrap break-words",children:a.value})]},m))})]}),e.jsxs("div",{className:"flex justify-between items-center pt-2",children:[e.jsxs("div",{className:"text-xs text-muted-foreground",children:["ID: ",s.id.slice(0,8)]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>
6d(s.id),className:"text-destructive hover:text-destructive gap-1",children:[e.jsx(_,{className:"h-4 w-4"})," Delete"]})]})]})]})})}),e.jsx(X,{open:!!n,onOpenChange:a=>{a||d(null)},children:e.jsxs(Z,{children:[e.jsxs(ee,{children:[e.jsx(se,{children:"Delete submission"}),e.jsx(te,{children:"Delete this submission? This cannot be undone."})]}),e.jsxs(ae,{children:[e.jsx(le,{children:"Cancel"}),e.jsx(ie,{onClick:()=>{const a=n;d(null),a&&w(a)},children:"Delete"})]})]})})]})}function D({icon:t,label:r,value:i}){return e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"text-muted-foreground mt-0.5",children:t}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase text-muted-foreground",children:r}),e.jsx("div",{className:"text-sm break-words",children:i})]})]})}const R=(t,r,i)=>{if(i<0||i>=t.length)return t;const h=t.slice(),[x]=h.splice(r,1);return h.splice(i,0,x),h};function Ze(){const[t,r]=u.useState("submissions"),[i,h]=u.useState(null),[x,g]=u.useState(!0),[j,l]=u.useState(!1),[s,o]=u.useState(null),[n,d]=u.useState(!1),[p,f]=u.useState(null);u.useEffect(()=>{(async()=>{var N;const c=await ve();h(c),o(((N=c==null?void 0:c.intents[0])==null?void 0:N.key)??null),g(!1)})()},[]);const y=u.useMemo(()=>(i==null?void 0:i.intents.find(c=>c.key===s))??null,[i,s]),w=c=>{i&&(h({...i,intents:c}),d(!0))},a=c=>{!i||!y||w(i.intents.map(N=>N.key===y.key?{...N,...c}:N))},m=()=>{if(!i)return;const c=ge();w([...i.intents,c]),o(c.key)},C=c=>{var O;if(!i)return;const N=i.intents.filter(oe=>oe.key!==c);w(N),s===c&&o(((O=N[0])==null?void 0:O.key)??null)},T=(c,N)=>{i&&w(R(i.intents,c,c+N))},re=async()=>{if(!i)return;l(!0);const{error:c}=await F.from("form_config").update({intents:i.intents}).eq("id",i.id);if(l(!1),c){S({title:"Save failed",description:c.message,variant:"destructive"});return}d(!1),S({title:"Form saved",description:"The global enquiry form has been updated."})};return x?e.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[e.jsx(A,{className:"h-5 w-5 animate-spin mr-2"})," Loading formâ¦"]}):i?e.jsxs(je,{value:t,onValueChange:c=>r(c),className:"space-y-4",children:[e.jsxs(fe,{children:[e.jsxs(q,{value:"submissions",className:"gap-2",children:[e.jsx(ne,{className:"h-4 w-4"})," Submissions"]}),e.jsxs(q,{value:"builder",className:"gap-2",children:[e.jsx(Ce,{className:"h-4 w-4"})," Form builder"]})]}),e.jsx(B,{value:"submissions",className:"mt-0",children:e.jsx(_e,{})}),e.jsx(B,{value:"builder",className:"mt-0",children:x?e.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[e.jsx(A,{className:"h-5 w-5 animate-spin mr-2"})," Loading formâ¦"]}):i?e.jsx(De,{config:i,saving:j,dirty:n,onSave:re,selectedKey:s,setSelectedKey:o,addIntent:m,removeIntent:f,moveIntent:T,selected:y,updateSelected:a}):e.jsx("div",{className:"py-10 text-center text-muted-foreground",children:"No form config found."})}),e.jsx(X,{open:!!p,onOpenChange:c=>{c||f(null)},children:e.jsxs(Z,{children:[e.jsxs(ee,{children:[e.jsx(se,{children:"Remove intent"}),e.jsx(te,{children:"Remove this intent? This cannot be undone until you reload without saving."})]}),e.jsxs(ae,{children:[e.jsx(le,{children:"Cancel"}),e.jsx(ie,{onClick:()=>{const c=p;f(null),c&&C(c)},children:"Remove"})]})]})})]}):e.jsx("div",{className:"py-10 text-center text-muted-foreground",children:"No form config found."})}function De({config:t,saving:r,dirty:i,onSave:h,selectedKey:x,setSelectedKey:g,addIntent:j,removeIntent:l,moveIntent:s,selected:o,updateSelected:n}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-2xl font-bold",children:"Global enquiry form"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure the multi-step enquiry form shown across the site. Add or remove intents, steps, and fields. Each intent has its own notification email."})]}),e.jsxs(v,{onClick:h,disabled:r||!i,className:"gap-2",children:[r?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx(Se,{className:"h-4 w-4"}),i?"Save changes":"Saved"]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[280px_1fr] gap-4",children:[e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-3 space-y-1 h-fit",children:[e.jsxs("div",{className:"flex items-center justify-between px-2 pb-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase text-muted-foreground",children:"Intents"}),e.jsx(v,{size:"icon",variant:"ghost",onClick:j,title:"Add intent",children:e.jsx(M,{className:"h-4 w-4"})})]}),t.intents.map((d,p)=>e.jsxs("div",{className:pe("group flex items-center gap-1 rounded-xl px-2 py-1.5 cursor-pointer",x===d.key?"bg-accent":"hover:bg-accent/50"),onClick:()=>g(d.key),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium truncate",children:d.label||"(no label)"}),e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:d.active?`${d.steps.length} step${d.steps.length===1?"":"s"}`:"Inactive"})]}),e.jsxs("div",{className:"opacity-0 group-hover:opacity-100 flex",children:[e.jsx("button",{className:"p-1 hover:bg-background rounded",onClick:f=>{f.stopPropagation(),s(p,-1)},title:"Move up",children:e.jsx(E,{className:"h-3 w-3"})}),e.jsx("button",{className:"p-1 hover:bg-background rounded",onClick:f=>{f.stopPropagation(),s(p,1)},title:"Move down",children:e.jsx(z,{className:"h-3 w-3"})}),e.jsx("button",{className:"p-1 hover:bg-destructive/10 text-destructive rounded",onClick:f=>{f.stopPropagation(),l(d.key)},title:"Delete",children:e.jsx(_,{className:"h-3 w-3"})})]})]},d.key))]}),e.jsx("div",{className:"bg-card border border-border rounded-2xl p-5 space-y-6",children:o?e.jsx(Ae,{intent:o,onChange:n}):e.jsx("div",{className:"text-muted-foreground text-sm",children:"Select or create an intent to edit."})})]})]})}function Ae({intent:t,onChange:r}){const i=l=>r({steps:l}),h=()=>i([...t.steps,be()]),x=l=>i(t.steps.filter((s,o)=>o!==l)),g=(l,s)=>i(R(t.steps,l,l+s)),j=(l,s)=>i(t.steps.map((o,n)=>n===l?{...o,...s}:o));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(k,{children:"Intent label"}),e.jsx(b,{className:"mt-1",value:t.label,onChange:l=>r({label:l.target.value})})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Internal key"}),e.jsx(b,{className:"mt-1",value:t.key,onChange:l=>r({key:l.target.value})})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(k,{children:"Notification recipient email"}),e.jsx(b,{className:"mt-1",type:"email",placeholder:"[email protected]",value:t.notifyEmail,onChange:l=>r({notifyEmail:l.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Submissions for this intent are sent to this inbox."})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(k,{children:"BCC recipient email (optional)"}),e.jsx(b,{className:"mt-1",type:"email",placeholder:"[email protected]",value:t.notifyBcc??"",onChange:l=>r({notifyBcc:l.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"A second copy is sent to this inbox as a backup â useful if the primary destination is a shared alias that may filter mail."})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsx(k,{children:"Confirmation message (optional)"}),e.jsx($,{className:"mt-1",rows:4,placeholder:'Leave blank to show the default "what you submitted" recap.',value:t.successMessage??"",onChange:l=>r({successMessage:l.target.value})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Shown on the confirmation screen after someone submits this form, instead of the default recap of their answers. Useful for explaining next steps (e.g. invoicing, review timelines) rather than just echoing the form back to them."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{checked:t.active,onCheckedChange:l=>r({active:l})}),e.jsx(k,{children:"Active (visible on the public form)"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"font-display text-lg font-bold",children:"Steps"}),e.jsxs(v,{size:"sm",variant:"outline",onClick:h,className:"gap-1",children:[e.jsx(M,{className:"h-3.5 w-3.5"})," Add step"]})]}),t.steps.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground border border-dashed rounded-xl p-6 text-center",children:"No steps yet. Add a step to get started."}),t.steps.map((l,s)=>e.jsxs("div",{className:"border border-border rounded-xl p-4 space-y-3 bg-background/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{value:l.title,onChange:o=>j(s,{title:o.target.value}),placeholder:"Step title",className:"flex-1"}),e.jsx(v,{size:"icon",variant:"ghost",onClick:()=>g(s,-1),title:"Move up",children:e.jsx(E,{className:"h-4 w-4"})}),e.jsx(v,{size:"icon",variant:"ghost",onClick:()=>g(s,1),title:"Move down",children:e.jsx(z,{className:"h-4 w-4"})}),e.jsx(v,{size:"icon",variant:"ghost",onClick:()=>x(s),title:"Delete step",className:"text-destructive hover:text-destructive",children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsx(Me,{step:l,onChange:o=>j(s,o)})]},l.id)),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["A final ",e.jsx("strong",{children:"Review"})," step is automatically appended on the public form - you don't need to add it."]})]})]})}function Me({step:t,onChange:r}){const i=l=>r({fields:l}),h=()=>i([...t.fields,Ne("text")]),x=l=>i(t.fields.filter((s,o)=>o!==l)),g=(l,s)=>i(R(t.fields,l,l+s)),j=(l,s)=>i(t.fields.map((o,n)=>n===l?{...o,...s}:o));return e.jsxs("div",{className:"space-y-2 pl-3 border-l-2 border-border",children:[t.fields.map((l,s)=>e.jsx(Te,{field:l,onChange:o=>j(s,o),onRemove:()=>x(s),onMoveUp:()=>g(s,-1),onMoveDown:()=>g(s,1)},l.id)),e.jsxs(v,{size:"sm",variant:"ghost",onClick:h,className:"gap-1",children:[e.jsx(M,{className:"h-3.5 w-3.5"})," Add field"]})]})}function Te({field:t,onChange:r,onRemove:i,onMoveUp:h,onMoveDown:x}){const g=V.includes(t.type),j=n=>{const d={type:n};V.includes(n)&&(!t.options||t.options.length===0)&&(d.options=[{value:"Option 1",label:"Option 1"}]),r(d)},l=(n,d)=>
6{const p=(t.options??[]).map((f,y)=>y===n?{...f,...d}:f);r({options:p})},s=()=>r({options:[...t.options??[],{value:"",label:""}]}),o=n=>r({options:(t.options??[]).filter((d,p)=>p!==n)});return e.jsxs("div",{className:"bg-card border border-border rounded-lg p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Y,{value:t.type,onValueChange:n=>j(n),children:[e.jsx(G,{className:"w-[200px]",children:e.jsx(J,{})}),e.jsx(Q,{children:Object.keys(H).map(n=>e.jsx(I,{value:n,children:H[n]},n))})]}),e.jsx(b,{value:t.label,onChange:n=>r({label:n.target.value}),placeholder:"Label",className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(W,{checked:!!t.required,onCheckedChange:n=>r({required:n})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"})]}),e.jsx(v,{size:"icon",variant:"ghost",onClick:h,title:"Move up",children:e.jsx(E,{className:"h-4 w-4"})}),e.jsx(v,{size:"icon",variant:"ghost",onClick:x,title:"Move down",children:e.jsx(z,{className:"h-4 w-4"})}),e.jsx(v,{size:"icon",variant:"ghost",onClick:i,className:"text-destructive hover:text-destructive",title:"Delete field",children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:[e.jsx(b,{value:t.key,onChange:n=>r({key:n.target.value}),placeholder:"Internal key (no spaces)"}),e.jsx(b,{value:t.placeholder??"",onChange:n=>r({placeholder:n.target.value}),placeholder:"Placeholder"}),e.jsx(b,{value:t.helpText??"",onChange:n=>r({helpText:n.target.value}),placeholder:"Help text"})]}),t.type==="info"&&e.jsx($,{value:t.helpText??"",onChange:n=>r({helpText:n.target.value}),placeholder:"Info text shown to the user (also used as help text)",rows:2}),g&&e.jsxs("div",{className:"space-y-1.5 pt-1",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-foreground",children:"Options"}),(t.options??[]).map((n,d)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{value:n.label,onChange:p=>l(d,{label:p.target.value,value:n.value||p.target.value}),placeholder:"Display label",className:"flex-1"}),e.jsx(b,{value:n.value,onChange:p=>l(d,{value:p.target.value}),placeholder:"Value",className:"flex-1"}),e.jsx(v,{size:"icon",variant:"ghost",onClick:()=>o(d),className:"text-destructive hover:text-destructive",children:e.jsx(_,{className:"h-4 w-4"})})]},d)),e.jsxs(v,{size:"sm",variant:"ghost",onClick:s,className:"gap-1",children:[e.jsx(M,{className:"h-3.5 w-3.5"})," Add option"]})]})]})}export{Ze 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.