PageSourceSearch

https://deqor.ai/build/assets/index-BIfyOcVB.js

js deqor.ai collected 2026-10-05 14:52:32 UTC 21,908 bytes, 2 lines download raw bytes

1import{j as t}from"./vendor-framer-PObMTRK1.js";import{c as Me}from"./app-oL-w_NYe.js";import{r as m,H as He}from"./vendor-inertia-CJ2_joj4.js";import{B as ue}from"./button-C2pWxN6_.js";import{A as qe}from"./admin-layout-mOJaD3-M.js";import{g as Pe}from"./utils-CeJmfsOx.js";import{P as Ve,s as Be,K as Ue,a8 as Ge,E as Ke,a9 as Je,v as We,aa as Qe,m as Ye,X as Re,u as Ze,i as et,y as tt}from"./vendor-lucide-DqLeQ0fo.js";/* empty css            */import"./impersonation-banner-CXEAkC_V.js";const Xe={analysis:"Image Analysis",generation_template:"Generation Templates",use_case:"Use Case Prompts",module:"Module Prompts",floor_plan:"Floor Plan",edit_anything:"Edit Anything"},st={analysis:"bg-brand-400/10 text-brand-400 ring-brand-400/20",generation_template:"bg-gray-100 text-gray-700 ring-gray-200",use_case:"bg-brand-400/10 text-brand-400 ring-brand-400/20",module:"bg-gray-50 text-gray-600 ring-gray-200",floor_plan:"bg-emerald-50 text-emerald-700 ring-emerald-200",edit_anything:"bg-blue-50 text-blue-700 ring-blue-200"};function at(b){const e=Me.c(136),{prompt:c,isNew:j,onSave:v,onClose:p,isSaving:g}=b;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];let o;e[1]!==c?(o={key:"",name:"",category:"use_case",description:"",prompt_template:"",variables:h,is_active:!0,sort_order:0,...c},e[1]=c,e[2]=o):o=e[2];const[s,n]=m.useState(o),[d,ge]=m.useState("");let N;e[3]!==s||e[4]!==d?(N=()=>{d.trim()&&!s.variables?.includes(d.trim())&&(n({...s,variables:[...s.variables||[],d.trim()]}),ge(""))},e[3]=s,e[4]=d,e[5]=N):N=e[5];const f=N;let E;e[6]!==s?(E=r=>{n({...s,variables:(s.variables||[]).filter(O=>O!==r)})},e[6]=s,e[7]=E):E=e[7];const T=E;let A;e[8]!==s?(A=()=>{const O=(s.prompt_template?.match(/\{(\w+)\}/g)||[]).map(rt),ze=[...new Set(O)];n({...s,variables:ze})},e[8]=s,e[9]=A):A=e[9];const k=A,D=s.prompt_template?.length||0,$=j?"Create New Prompt":"Edit Prompt";let C;e[10]!==$?(C=t.jsx("h2",{className:"text-lg font-bold text-gray-900",children:$}),e[10]=$,e[11]=C):C=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Re,{className:"h-5 w-5"}),e[12]=S):S=e[12];let w;e[13]!==p?(w=t.jsx("button",{onClick:p,className:"rounded-lg p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-600",children:S}),e[13]=p,e[14]=w):w=e[14];let x;e[15]!==C||e[16]!==w?(x=t.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-6 py-4",children:[C,w]}),e[15]=C,e[16]=w,e[17]=x):x=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Key (unique ID)"}),e[18]=y):y=e[18];const pe=s.key||"";let _;e[19]!==s?(_=r=>n({...s,key:r.target.value}),e[19]=s,e[20]=_):_=e[20];const he=!j;let P;e[21]!==pe||e[22]!==_||e[23]!==he?(P=t.jsxs("div",{children:[y,t.jsx("input",{type:"text",value:pe,onChange:_,placeholder:"e.g. uc_sky_replacement",className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400",disabled:he})]}),e[21]=pe,e[22]=_,e[23]=he,e[24]=P):P=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Name"}),e[25]=F):F=e[25];const l=s.name||"";let i;e[26]!==s?(i=r=>n({...s,name:r.target.value}),e[26]=s,e[27]=i):i=e[27];let a;e[28]!==l||e[29]!==i?(a=t.jsxs("div",{children:[F,t.jsx("input",{type:"text",value:l,onChange:i,placeholder:"Human-readable name",className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400"})]}),e[28]=l,e[29]=i,e[30]=a):a=e[30];let u;e[31]!==P||e[32]!==a?(u=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[P,a]}),e[31]=P,e[32]=a,e[33]=u):u=e[33];let I;e[34]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Category"}),e[34]=I):I=e[34];const Ee=s.category||"use_case";let L;e[35]!==s?(L=r=>n({...s,category:r.target.value}),e[35]=s,e[36]=L):L=e[36];let fe;e[37]===Symbol.for("react.memo_cache_sentinel")?(fe=Object.entries(Xe).map(lt),e[37]=fe):fe=e[37];let X;e[38]!==Ee||e[39]!==L?(X=t.jsx("select",{value:Ee,onChange:L,className:"w-full appearance-none rounded-lg border border-gray-200 px-3 py-2 pr-8 text-sm focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400",children:fe}),e[38]=Ee,e[39]=L,e[40]=X):X=e[40];let ye;e[41]===Symbol.for("react.memo_cache_sentinel")?(ye=t.jsx(Ze,{className:"pointer-events-none absolute right-2.5 top-2.5 h-4 w-4 text-gray-400"}),e[41]=ye):ye=e[41];let K;e[42]!==X?(K=t.jsxs("div",{children:[I,t.jsxs("div",{className:"relative",children:[X,ye]})]}),e[42]=X,e[43]=K):K=e[43];let be;e[44]===Symbol.for("react.memo_cache_sentinel")?(be=t.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Sort Order"}),e[44]=be):be=e[44];const Te=s.sort_order||0;let R;e[45]!==s?(R=r=>n({...s,sort_order:parseInt(r.target.value)||0}),e[45]=s,e[46]=R):R=e[46];let M;e[47]!==Te||e[48]!==R?(M=t.jsxs("div",{children:[be,t.jsx("input",{type:"number",value:Te,onChange:R,className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400"})]}),e[47]=Te,e[48]=R,e[49]=M):M=e[49];let V;e[50]!==K||e[51]!==M?(V=t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[K,M]}),e[50]=K,e[51]=M,e[52]=V):V=e[52];let je;e[53]===Symbol.for("react.memo_cache_sentinel")?(je=t.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Description"}),e[53]=je):je=e[53];const Ae=s.description||"";let U;e[54]!==s?(U=r=>n({...s,description:r.target.value}),e[54]=s,e[55]=U):U=e[55];let z;e[56]!==Ae||e[57]!==U?(z=t.jsxs("div",{children:[je,t.jsx("input",{type:"text",value:Ae,onChange:U,placeholder:"What does this prompt do?",className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400"})]}),e[56]=Ae,e[57]=U,e[58]=z):z=e[58];let ve;e[59]===Symbol.for("react.memo_cache_sentinel")?(ve=t.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Prompt Template"}),e[59]=ve):ve=e[59];let H;e[60]!==D?(H=t.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[ve,t.jsxs("span",{className:"text-xs text-gray-400",children:[D," chars"]})]}),e[60]=D,e[61]=H):H=e[61];const De=s.prompt_template||"";let q;e[62]!==s?(q=r=>n({...s,prompt_template:r.target.value}),e[62]=s,e[63]=q):q=e[63];const Oe=s.prompt_template||"";let Ne;e[64]!==Oe?(Ne=Oe.split(`
2`),e[64]=Oe,e[65]=Ne):Ne=e[65];const $e=Math.min(20,Math.max(6,Ne.length+2));let B;e[66]!==De||e[67]!==q||e[68]!==$e?(B=t.jsx("textarea",{value:De,onChange:q,placeholder:"Enter the prompt template. Use {variable_name} for placeholders.",rows:$e,className:"w-full rounded-lg border border-gray-200 px-3 py-2 font-mono text-sm leading-relaxed focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400"}),e[66]=De,e[67]=q,e[68]=$e,e[69]=B):B=e[69];let G;e[70]!==H||e[71]!==B?(G=t.jsxs("div",{children:[H,B]}),e[70]=H,e[71]=B,e[72]=G):G=e[72];let we;e[73]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx("label",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500",children:"Variables"}),e[73]=we):we=e[73];let J;e[74]!==k?(J=t.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[we,t.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-brand-400 hover:underline",children:"Auto-detect from template"})]}),e[74]=k,e[75]=J):J=e[75];let W;e[76]!==s.variables?(W=s.variables||[],e[76]=s.variables,e[77]=W):W=e[77];let Q;if(e[78]!==T||e[79]!==W){let r;e[81]!==T?(r=O=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-gray-100 px-2 py-1 text-xs font-mono text-gray-700",children:["{"+O+"}",t.jsx("button",{onClick:()=>T(O),className:"text-gray-400 hover:text-red-500",children:t.jsx(Re,{className:"h-3 w-3"})})]},O),e[81]=T,e[82]=r):r=e[82],Q=W.map(r),e[78]=T,e[79]=W,e[80]=Q}else Q=e[80];let ke;e[83]===Symbol.for("react.memo_cache_sentinel")?(ke=r=>ge(r.target.value),e[83]=ke):ke=e[83];let Y;e[84]!==f?(Y=r=>r.key==="Enter"&&(r.preventDefault(),f()),e[84]=f,e[85]=Y):Y=e[85];let Z;e[86]!==Y||e[87]!==d?(Z=t.jsx("input",{type:"text",value:d,onChange:ke,onKeyDown:Y,placeholder:"Add variable...",className:"w-32 rounded-md border border-gray-200 px-2 py-1 text-xs focus:border-gray-400 focus:outline-none"}),e[86]=Y,e[87]=d,e[88]=Z):Z=e[88];let Ce;e[89]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx(Ve,{className:"h-3.5 w-3.5"}),e[89]=Ce):Ce=e[89];let ee;e[90]!==f?(ee=t.jsx("button",{onClick:f,className:"rounded-md bg-gray-100 p-1 text-gray-500 hover:bg-gray-200",children:Ce}),e[90]=f,e[91]=ee):ee=e[91];let te;e[92]!==Z||e[93]!==ee?(te=t.jsxs("div",{className:"flex items-center gap-1",children:[Z,ee]}),e[92]=Z,e[93]=ee,e[94]=te):te=e[94];let se;e[95]!==Q||e[96]!==te?(se=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Q,te]}),e[95]=Q,e[96]=te,e[97]=se):se=e[97];let ae;e[98]!==J||e[99]!==se?(ae=t.jsxs("div",{children:[J,se]}),e[98]=J,e[99]=se,e[100]=ae):ae=e[100];const Fe=s.is_active??!0;let le;e[101]!==s?(le=r=>n({...s,is_active:r.target.checked}),e[101]=s,e[102]=le):le=e[102];let re;e[103]!==Fe||e[104]!==le?(re=t.jsx("input",{type:"checkbox",checked:Fe,onChange:le,className:"h-4 w-4 roun
2ded border-gray-300 text-gray-900 focus:ring-gray-400"}),e[103]=Fe,e[104]=le,e[105]=re):re=e[105];let Se;e[106]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx("span",{className:"text-sm text-gray-700",children:"Active (used in production)"}),e[106]=Se):Se=e[106];let ne;e[107]!==re?(ne=t.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[re,Se]}),e[107]=re,e[108]=ne):ne=e[108];let ie;e[109]!==u||e[110]!==V||e[111]!==z||e[112]!==G||e[113]!==ae||e[114]!==ne?(ie=t.jsxs("div",{className:"space-y-5 p-6",children:[u,V,z,G,ae,ne]}),e[109]=u,e[110]=V,e[111]=z,e[112]=G,e[113]=ae,e[114]=ne,e[115]=ie):ie=e[115];let ce;e[116]!==g||e[117]!==p?(ce=t.jsx(ue,{variant:"outline",onClick:p,disabled:g,children:"Cancel"}),e[116]=g,e[117]=p,e[118]=ce):ce=e[118];let oe;e[119]!==s||e[120]!==v?(oe=()=>v(s),e[119]=s,e[120]=v,e[121]=oe):oe=e[121];const Ie=g||!s.key||!s.name||!s.prompt_template;let de;e[122]!==g?(de=g?t.jsx(Ue,{className:"mr-2 h-4 w-4 animate-spin"}):t.jsx(et,{className:"mr-2 h-4 w-4"}),e[122]=g,e[123]=de):de=e[123];const Le=j?"Create":"Save Changes";let me;e[124]!==oe||e[125]!==Ie||e[126]!==de||e[127]!==Le?(me=t.jsxs(ue,{onClick:oe,disabled:Ie,children:[de,Le]}),e[124]=oe,e[125]=Ie,e[126]=de,e[127]=Le,e[128]=me):me=e[128];let xe;e[129]!==ce||e[130]!==me?(xe=t.jsxs("div",{className:"flex items-center justify-end gap-3 border-t border-gray-100 px-6 py-4",children:[ce,me]}),e[129]=ce,e[130]=me,e[131]=xe):xe=e[131];let _e;return e[132]!==x||e[133]!==ie||e[134]!==xe?(_e=t.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/50 p-4 pt-16",children:t.jsxs("div",{className:"w-full max-w-3xl rounded-2xl bg-white shadow-2xl",children:[x,ie,xe]})}),e[132]=x,e[133]=ie,e[134]=xe,e[135]=_e):_e=e[135],_e}function lt(b){const[e,c]=b;return t.jsx("option",{value:e,children:c},e)}function rt(b){return b.replace(/[{}]/g,"")}function nt(b){const e=Me.c(14),{prompt:c,onConfirm:j,onCancel:v}=b;let p,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-50",children:t.jsx(tt,{className:"h-6 w-6 text-red-600"})}),g=t.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Delete Prompt"}),e[0]=p,e[1]=g):(p=e[0],g=e[1]);let h;e[2]!==c.name?(h=t.jsxs("p",{className:"mt-1 text-sm text-gray-500",children:["Are you sure you want to delete ",t.jsx("strong",{children:c.name}),"? This action cannot be undone. If this prompt is used in the application, it will fall back to the hardcoded default."]}),e[2]=c.name,e[3]=h):h=e[3];let o;e[4]!==v?(o=t.jsx(ue,{variant:"outline",onClick:v,children:"Cancel"}),e[4]=v,e[5]=o):o=e[5];let s;e[6]!==j?(s=t.jsx(ue,{onClick:j,className:"bg-red-600 text-white hover:bg-red-700",children:"Delete"}),e[6]=j,e[7]=s):s=e[7];let n;e[8]!==o||e[9]!==s?(n=t.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[o,s]}),e[8]=o,e[9]=s,e[10]=n):n=e[10];let d;return e[11]!==h||e[12]!==n?(d=t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:t.jsxs("div",{className:"w-full max-w-md rounded-2xl bg-white p-6 shadow-2xl",children:[p,g,h,n]})}),e[11]=h,e[12]=n,e[13]=d):d=e[13],d}function ut(){const[b,e]=m.useState([]),[c,j]=m.useState(null),[v,p]=m.useState({}),[g,h]=m.useState(!0),[o,s]=m.useState(""),[n,d]=m.useState("all"),[ge,N]=m.useState(null),[f,E]=m.useState(!1),[T,A]=m.useState(!1),[k,D]=m.useState(null),[$,C]=m.useState(null),[S,w]=m.useState(null),x=(l,i="success")=>{w({message:l,type:i}),setTimeout(()=>w(null),3e3)},y=m.useCallback(async()=>{try{const l=new URLSearchParams;n!=="all"&&l.set("category",n),o&&l.set("search",o);const a=await(await fetch(`/api/admin/prompts?${l}`,{headers:{Accept:"application/json"},credentials:"include"})).json();e(a.prompts||[]),j(a.stats||null),p(a.categories||{})}catch{x("Failed to load prompts","error")}finally{h(!1)}},[n,o]);m.useEffect(()=>{y()},[y]);const pe=async l=>{A(!0);try{const i=f?"/api/admin/prompts":`/api/admin/prompts/${l.id}`,u=await fetch(i,{method:f?"POST":"PUT",headers:{"Content-Type":"application/json",Accept:"application/json","X-XSRF-TOKEN":Pe()},credentials:"include",body:JSON.stringify(l)});if(!u.ok){const I=await u.json();throw new Error(I.message||"Failed to save")}x(f?"Prompt created":"Prompt updated"),N(null),y()}catch(i){x(i instanceof Error?i.message:"Save failed","error")}finally{A(!1)}},_=async()=>
2{if(k)try{await fetch(`/api/admin/prompts/${k.id}`,{method:"DELETE",headers:{Accept:"application/json","X-XSRF-TOKEN":Pe()},credentials:"include"}),x("Prompt deleted"),D(null),y()}catch{x("Delete failed","error")}},he=async l=>{try{await fetch(`/api/admin/prompts/${l.id}/toggle`,{method:"POST",headers:{Accept:"application/json","X-XSRF-TOKEN":Pe()},credentials:"include"}),y()}catch{x("Toggle failed","error")}},P=async l=>{try{await fetch(`/api/admin/prompts/${l.id}/duplicate`,{method:"POST",headers:{Accept:"application/json","X-XSRF-TOKEN":Pe()},credentials:"include"}),x("Prompt duplicated"),y()}catch{x("Duplicate failed","error")}},F=b.reduce((l,i)=>{const a=i.category||"other";return l[a]||(l[a]=[]),l[a].push(i),l},{});return t.jsxs(qe,{children:[t.jsx(He,{title:"Admin — Prompts"}),S&&t.jsx("div",{className:`fixed right-4 top-4 z-[100] rounded-lg px-4 py-3 text-sm font-medium text-white shadow-lg ${S.type==="success"?"bg-gray-900":"bg-red-600"}`,children:S.message}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Prompt Management"}),t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage all AI prompts used across the application. Changes take effect immediately."})]}),t.jsxs(ue,{onClick:()=>{N({}),E(!0)},children:[t.jsx(Ve,{className:"mr-2 h-4 w-4"}),"New Prompt"]})]}),c&&t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[t.jsxs("div",{className:"rounded-xl bg-white p-4 ring-1 ring-gray-100",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-400",children:"Total"}),t.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-900",children:c.total})]}),t.jsxs("div",{className:"rounded-xl bg-white p-4 ring-1 ring-gray-100",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-400",children:"Active"}),t.jsx("p",{className:"mt-1 text-2xl font-bold text-brand-400",children:c.active})]}),t.jsxs("div",{className:"rounded-xl bg-white p-4 ring-1 ring-gray-100",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-400",children:"Inactive"}),t.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-400",children:c.total-c.active})]}),t.jsxs("div",{className:"rounded-xl bg-white p-4 ring-1 ring-gray-100",children:[t.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-400",children:"Categories"}),t.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-900",children:Object.keys(c.by_category).length})]})]}),t.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Be,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),t.jsx("input",{type:"text",value:o,onChange:l=>s(l.target.value),placeholder:"Search prompts by name, key, or content...",className:"w-full rounded-lg border border-gray-200 py-2 pl-9 pr-3 text-sm focus:border-gray-400 focus:outline-none focus:ring-1 focus:ring-gray-400"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{onClick:()=>d("all"),className:`rounded-lg px-3 py-2 text-xs font-medium transition-colors ${n==="all"?"bg-gray-900 text-white":"bg-white text-gray-600 ring-1 ring-gray-200 hover:bg-gray-50"}`,children:"All"}),Object.entries(v).map(([l,i])=>t.jsx("button",{onClick:()=>d(l),className:`rounded-lg px-3 py-2 text-xs font-medium transition-colors ${n===l?"bg-gray-900 text-white":"bg-white text-gray-600 ring-1 ring-gray-200 hover:bg-gray-50"}`,children:i},l))]})]}),g?t.jsx("div",{className:"flex items-center justify-center py-20",children:t.jsx(Ue,{className:"h-6 w-6 animate-spin text-gray-400"})}):b.length===0?t.jsxs("div",{className:"rounded-xl bg-white py-16 text-center ring-1 ring-gray-100",children:[t.jsx(Ge,{className:"mx-auto h-10 w-10 text-gray-300"}),t.jsx("p",{className:"mt-3 text-sm font-medium text-gray-500",children:"No prompts found"}),t.jsx("p",{className:"mt-1 text-xs text-gray-400",children:"Create a new prompt or adjust your filters."})]}):t.jsx("div",{className:"space-y-8",children:Object.entries(F).map(([l,i])=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-gray-400",children:[t.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l==="analysis"?"bg-brand-400":l==="generation_template"?"bg-brand-400/70":l==="use_case"?"bg-brand-400/50":"bg-gray-400"}`}),Xe[l]||l,t.jsxs("span",{className:"text-gray-300",children:["(",i.length,")"]})]}),t.jsx("div",{className:"space-y-2",children:i.map(a=>t.jsxs("div",{className:`group rounded-xl bg-white ring-1 transition-all ${a.is_active?"ring-gray-100 hover:ring-gray-200":"bg-gray-50 ring-gray-100 opacity-60"}`,children:[t.jsxs("div",{className:"flex items-center gap-4 px-5 py-3.5",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:a.name}),t.jsx("span",{className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-[10px] font-medium ring-1 ${st[a.category]||"bg-gray-50 text-gray-600 ring-gray-200"}`,children:Xe[a.category]||a.category}),!a.is_active&&t.jsx("span",{className:"inline-flex items-center rounded-md bg-red-50 px-1.5 py-0.5 text-[10px] font-medium text-red-600 ring-1 ring-red-200",children:"Disabled"})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-gray-400",children:[t.jsx("code",{className:"font-mono",children:a.key}),a.description&&t.jsxs(t.Fragment,{children:[" — ",a.description]})]})]}),a.variables&&a.variables.length>0&&t.jsxs("div",{className:"hidden items-center gap-1 lg:flex",children:[a.variables.slice(0,3).map(u=>t.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 font-mono text-[10px] text-gray-500",children:"{"+u+"}"},u)),a.variables.length>3&&t.jsxs("span",{className:"text-[10px] text-gray-400",children:["+",a.variables.length-3]})]}),t.jsxs("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[t.jsx("button",{onClick:()=>C($===a.id?null:a.id),className:"rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600",title:"Preview",children:t.jsx(Ke,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>{N(a),E(!1)},className:"rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600",title:"Edit",children:t.jsx(Je,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>P(a),className:"rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600",title:"Duplicate",children:t.jsx(We,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>he(a),className:"rounded-lg p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600",title:a.is_active?"Deactivate":"Activate",children:a.is_active?t.jsx(Qe,{className:"h-4 w-4"}):t.jsx(Ke,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>D(a),className:"rounded-lg p-1.5 text-gray-400 hover:bg-red-50 hover:text-red-600",title:"Delete",children:t.jsx(Ye,{className:"h-4 w-4"})})]})]}),$===a.id&&t.jsxs("div",{className:"border-t border-gray-100 px-5 py-4",children:[t.jsx("pre",{className:"max-h-80 overflow-auto whitespace-pre-wrap rounded-lg bg-gray-50 p-4 font-mono text-xs leading-relaxed text-gray-700",children:a.prompt_template}),t.jsxs("p",{className:"mt-2 text-[10px] text-gray-400",children:[a.prompt_template.length," characters — Last updated ",new Date(a.updated_at).toLocaleDateString()]})]})]},a.id))})]},l))})]}),ge!==null&&t.jsx(at,{prompt:ge,isNew:f,onSave:pe,onClose:()=>N(null),isSaving:T}),k&&t.jsx(nt,{prompt:k,onConfirm:_,onCancel:()=>D(null)})]})}export{ut 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.