1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="80645151-6d7e-46a6-9442-51770b5ef0eb",e._sentryDebugIdIdentifier="sentry-dbid-80645151-6d7e-46a6-9442-51770b5ef0eb")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7886],{67886:(e,s,a)=>{a.r(s),a.d(s,{EditWordChoiceDialog:()=>h});var l=a(95155),n=a(3998),t=a(51834),i=a(65142),r=a(84156),c=a(31120),d=a(6191),o=a(71360),m=a(12115);function h(e){let{open:s,title:a,wordChoice:h,replacements:x,onOpenChange:f,onSave:u}=e,[j,p]=(0,m.useState)(h),[g,v]=(0,m.useState)(x||[]),[N,b]=(0,m.useState)(""),[y,C]=(0,m.useState)(!1);(0,m.useEffect)(()=>{s&&(p(h),v(x||[]),b(""),C(!1))},[s,h,x]);let w=()=>{if(!N.trim())return;let e=N.toLowerCase().replace(/\s+/g,"_");p(s=>({...s,[e]:[]})),b(""),C(!1)},k=(e,s,a)=>{v(l=>l.map((l,n)=>n===e?{...l,[s]:a}:l))};return(0,l.jsx)(t.lG,{open:s,onOpenChange:e=>{e||f(!1)},children:(0,l.jsxs)(t.Cf,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[(0,l.jsx)(t.c7,{children:(0,l.jsxs)(t.L3,{children:["Edit ",a]})}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto py-2",children:(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("div",{className:"flex items-center justify-between gap-2 border-b pb-2",children:(0,l.jsx)("div",{className:"flex items-center gap-2 flex-1",children:y?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.p,{value:N,onChange:e=>b(e.target.value),placeholder:"Enter category name",className:"flex-1 text-sm h-8",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),w())}}),(0,l.jsx)(n.$,{variant:"outline",size:"sm",onClick:w,className:"h-8",children:"Add"}),(0,l.jsx)(n.$,{variant:"ghost",size:"sm",onClick:()=>C(!1),className:"h-8",children:"Cancel"})]}):(0,l.jsxs)(n.$,{variant:"outline",size:"sm",onClick:()=>C(!0),className:"h-8",children:[(0,l.jsx)(r.k,{icon:d.A,className:"h-4 w-4 mr-1"}),"Add Category"]})})}),Object.entries(j).map(e=>{let[s,a]=e;return(0,l.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between p-2 border-b",children:[(0,l.jsx)("h4",{className:"text-sm font-medium capitalize",children:s}),(0,l.jsx)(n.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{p(e=>{let{[s]:a,...l}=e;return l})},children:(0,l.jsx)(r.k,{icon:o.A,className:"h-4 w-4"})})]}),(0,l.jsx)("div",{className:"p-2",children:(0,l.jsx)(c.T,{defaultValue:(null==a?void 0:a.join(", "))||"",placeholder:"Enter words separated by commas",className:"resize-none min-h-[40px] text-sm",onChange:e=>{var a;return a=e.target.value,void p(e=>({...e,[s]:a?a.split(",").map(e=>e.trim()):[]}))}})})]},s)}),(0,l.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between p-2 border-b",children:[(0,l.jsx)("h4",{className:"text-sm font-medium",children:"Word Replacements"}),(0,l.jsxs)(n.$,{variant:"ghost",size:"sm",onClick:()=>{v(e=>[...e,{instead_of:"",use:""}])},className:"h-8",children:[(0,l.jsx)(r.k,{icon:d.A,className:"h-4 w-4 mr-1"}),"Add"]})]}),(0,l.jsx)("div",{className:"p-2 space-y-2",children:g.map((e,s)=>(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,l.jsx)(i.p,{value:e.instead_of,onChange:e=>k(s,"instead_of",e.target.value),placeholder:"Instead of...",className:"flex-1 text-sm h-8"}),(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:"â"}),(0,l.jsx)(i.p,{value:e.use,onChange:e=>k(s,"use",e.target.value),placeholder:"Use...",className:"flex-1 text-sm h-8"})]}),(0,l.jsx)(n.$,{variant:"ghost",size:"icon",onClick:()=>{v(e=>e.filter((e,a)=>a!==s))},className:"h-8 w-8",children:(0,l.jsx)(r.k,{icon:o.A,className:"h-4 w-4"})})]},s))})]})]})}),(0,l.jsx)(t.Es,{className:"border-t p-2",children:(0,l.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,l.jsx)(n.$,{size:"sm",variant:"outline",onClick:()=>f(!1),children:"Cancel"}),(0,l.jsx)(n.$,{size:"sm",onClick:()=>{u({wordChoice:j,replacements:g.filter(e=>""!==e.instead_of.trim()&&""!==e.use.trim())}),f(!1)},children:"Save Changes"})]})})]})})}}}]);
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.