PageSourceSearch

https://thaqalayn.com/_next/static/chunks/451.903a54afdab01259.js

js thaqalayn.com collected 2026-10-09 05:20:53 UTC 18,063 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[451],{80451:(e,t,r)=>{r.r(t),r.d(t,{EditHadithDialog:()=>j,adjustMatnIndexAfterEdit:()=>f});var n=r(95155),a=r(19749),i=r(53108),s=r(45461),l=r(45482),o=r(12115),d=r(47650),u=r(29094),c=r(75430),h=r(58826),x=r(38095);function g({before:e,after:t}){let r=(0,o.useMemo)(()=>(function(e,t){let r=e=>e.match(/\S+|\s+/g)||[],n=r(e),a=r(t),i=n.length,s=a.length,l=Array.from({length:i+1},()=>Array(s+1).fill(0));for(let e=1;e<=i;e++)for(let t=1;t<=s;t++)l[e][t]=n[e-1]===a[t-1]?l[e-1][t-1]+1:Math.max(l[e-1][t],l[e][t-1]);let o=i,d=s,u=[],c=[];for(;o>0||d>0;)o>0&&d>0&&n[o-1]===a[d-1]?(u.push({text:n[o-1],type:"equal"}),c.push({text:a[d-1],type:"equal"}),o--,d--):d>0&&(0===o||l[o][d-1]>=l[o-1][d])?(c.push({text:a[d-1],type:"added"}),d--):(u.push({text:n[o-1],type:"removed"}),o--);u.reverse(),c.reverse();let h=e=>{let t=[];for(let r of e)t.length>0&&t[t.length-1].type===r.type?t[t.length-1].text+=r.text:t.push({...r});return t};return{before:h(u),after:h(c)}})(e,t),[e,t]);return(0,n.jsxs)("div",{className:"mt-2 grid grid-cols-2 gap-2 text-xs",children:[(0,n.jsxs)("div",{className:"p-2 rounded bg-red-500/10 break-words",children:[(0,n.jsx)("span",{className:"font-medium text-red-600 dark:text-red-400",children:"Before: "}),r.before.map((e,t)=>"removed"===e.type?(0,n.jsx)("span",{className:"bg-red-500/25 rounded-sm px-0.5",children:e.text},t):(0,n.jsx)("span",{children:e.text},t))]}),(0,n.jsxs)("div",{className:"p-2 rounded bg-green-500/10 break-words",children:[(0,n.jsx)("span",{className:"font-medium text-green-600 dark:text-green-400",children:"After: "}),r.after.map((e,t)=>"added"===e.type?(0,n.jsx)("span",{className:"bg-green-500/25 rounded-sm px-0.5",children:e.text},t):(0,n.jsx)("span",{children:e.text},t))]})]})}function f(e,t,r){let n=Math.max(0,Math.min(r,e.length)),a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];)a++;if(a>=n)return n;let i=0;for(;i<e.length-a&&i<t.length-a&&e[e.length-i-1]===t[t.length-i-1];)i++;let s=e.length-i;return s>n?a:Math.max(0,Math.min(n+(t.length-i)-s,t.length))}function m(e){let t,r,i,s,l,d,u,c,h,x,g,m,v,j,w,N,k,C,S,_,M,E,H,P,R,I,A,T,$,z,F,L,D,B,U,Y,q=(0,a.c)(111),{text:O,onTextChange:Q,matnIndex:V,onMatnIndexChange:K,dir:W,fontFamily:X,fontSizePx:G,lineHeightPx:J,id:Z,ariaLabel:ee,minHeight:et,className:er}=e,en=void 0===et?400:et,ea=(0,o.useRef)(null),ei=(0,o.useRef)(null),es=(0,o.useRef)(null),el=(0,o.useRef)(null),eo=(0,o.useRef)(null),[ed,eu]=(0,o.useState)(0),[ec,eh]=(0,o.useState)(null),[ex,eg]=(0,o.useState)(0),[ef,em]=(0,o.useState)(!1);q[0]!==J?(t={left:12,top:8,height:J},q[0]=J,q[1]=t):t=q[1];let[ep,eb]=(0,o.useState)(t),ey=`${G}px "${X}"`,ev=Math.max(0,Math.min(V,O.length));q[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{let e=ea.current;if(!e)return;let t=new ResizeObserver(e=>{let[t]=e;eu(Math.max(0,t.contentRect.width-24))});return t.observe(e),()=>t.disconnect()},i=[],q[2]=r,q[3]=i):(r=q[2],i=q[3]),(0,o.useEffect)(r,i),q[4]!==ey?(s=()=>{let e;return e=!1,document.fonts.load(ey).then(()=>{e||eg(y)}).catch(b),()=>{e=!0}},l=[ey],q[4]=ey,q[5]=s,q[6]=l):(s=q[5],l=q[6]),(0,o.useEffect)(s,l),q[7]!==en?(d=()=>{let e=es.current;if(!e)return;let t=e.style.height;e.style.height="0px";let r=Math.max(e.scrollHeight,en);e.style.height=t,eh(r)},q[7]=en,q[8]=d):d=q[8],q[9]!==ed||q[10]!==ex||q[11]!==en||q[12]!==O?(u=[O,ed,ex,en],q[9]=ed,q[10]=ex,q[11]=en,q[12]=O,q[13]=u):u=q[13],(0,o.useLayoutEffect)(d,u);let ej=ec??en;q[14]!==O?(c=e=>{if(e<=0)return 0;if(e>=O.length)return O.length;if(/\s/.test(O[e-1]))return e;let t=e;for(;t>0&&!/\s/.test(O[t-1]);)t--;return t},q[14]=O,q[15]=c):c=q[15];let ew=c;q[16]!==ew||q[17]!==O.length?(h=(e,t)=>{let r=ei.current;if(!r)return null;let n=r.getBoundingClientRect();if(t<=n.top)return 0;if(t>=n.bottom)return O.length;let a=document.caretPositionFromPoint?.(e,t),i=a?null:document.caretRangeFromPoint?.(e,t),s=a?.offsetNode??i?.startContainer??null,l=a?.offset??i?.startOffset;if(void 0===l||!s||!r.contains(s))return null;let o=s instanceof HTMLElement?Array.from(s.childNodes).slice(0,l).reduce(p,0):l;for(;s&&s!==ei.current;){if(s instanceof HTMLElement&&void 0!==s.dataset.co)return Math.max(0,Math.min(ew(Number.parseInt(s.dataset.co,10)+o),O.length));s=s.parentNode}return null},q[16]=ew,q[17]=O.length,q[18]=h):h=q[18];let eN=h,ek=`${J}px`,eC="rtl"===W?"right":"left";q[19]!==W||q[20]!==ey||q[21]!==ek||q[22]!==eC?(x={font:ey,lineHeight:ek,whiteSpace:"pre-wrap",wordBreak:"normal",overflowWrap:"break-word",direction:W,textAlign:eC,padding:"8px 12px",margin:0,border:"none",width:"100%",boxSizing:"border-box",tabSize:8},q[19]=W,q[20]=ey,q[21]=ek,q[22]=eC,q[23]=x):x=q[23];let eS=x;q[24]!==ed||q[25]!==W||q[26]!==J?(g=()=>{let e=ei.current,t=el.current?.firstChild,r=eo.current?.firstChild,n=r??t;if(!e||!n)return void eb({left:"rtl"===W?Math.max(12,ed+12):12,top:8,height:J});let a=document.createRange(),i=n===r?0:n.textContent?.length||0;a.setStart(n,i),a.collapse(!0);let s=a.getClientRects()[0]??a.getBoundingClientRect(),l=e.getBoundingClientRect();eb({left:s.left-l.left,top:s.top-l.top,height:s.height||J})},q[24]=ed,q[25]=W,q[26]=J,q[27]=g):g=q[27];let e_=g;q[28]!==e_?(m=()=>{e_()},q[28]=e_,q[29]=m):m=q[29],q[30]!==ev||q[31]!==ej||q[32]!==ex||q[33]!==O||q[34]!==e_?(v=[O,ev,ej,ex,e_],q[30]=ev,q[31]=ej,q[32]=ex,q[33]=O,q[34]=e_,q[35]=v):v=q[35],(0,o.useLayoutEffect)(m,v),q[36]===Symbol.for("react.memo_cache_sentinel")?(j=(e,t)=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t),em(!1),es.current&&(es.current.style.visibility="visible"),ei.current&&(ei.current.style.pointerEvents="none",ei.current.style.zIndex="0")},q[36]=j):j=q[36];let eM=j;q[37]!==ev||q[38]!==V||q[39]!==K||q[40]!==Q||q[41]!==O?(w=e=>{let t=f(O,e,ev);Q(e),t!==V&&K(t)}
1,q[37]=ev,q[38]=V,q[39]=K,q[40]=Q,q[41]=O,q[42]=w):w=q[42];let eE=w,eH=`relative overflow-y-auto rounded-md border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-950 flex-1 ${er??""}`;q[43]!==en?(N={minHeight:en,maxHeight:en},q[43]=en,q[44]=N):N=q[44],q[45]!==ej?(k={position:"relative",height:ej},q[45]=ej,q[46]=k):k=q[46];let eP=+!!ef,eR=ef?"auto":"none";q[47]!==eS||q[48]!==eP||q[49]!==eR?(C={...eS,zIndex:eP,pointerEvents:eR},q[47]=eS,q[48]=eP,q[49]=eR,q[50]=C):C=q[50],q[51]!==ev||q[52]!==O?(S=O.slice(0,ev),q[51]=ev,q[52]=O,q[53]=S):S=q[53],q[54]!==S?(_=(0,n.jsx)("span",{ref:el,"data-co":0,className:"text-muted-foreground/60",children:S}),q[54]=S,q[55]=_):_=q[55],q[56]!==ev||q[57]!==O?(M=O.slice(ev),q[56]=ev,q[57]=O,q[58]=M):M=q[58],q[59]!==ev||q[60]!==M?(E=(0,n.jsx)("span",{ref:eo,"data-co":ev,className:"text-foreground",children:M}),q[59]=ev,q[60]=M,q[61]=E):E=q[61],q[62]!==W||q[63]!==C||q[64]!==_||q[65]!==E?(H=(0,n.jsxs)("div",{ref:ei,"aria-hidden":"true",className:"absolute inset-0 pointer-events-none",dir:W,style:C,children:[_,E]}),q[62]=W,q[63]=C,q[64]=_,q[65]=E,q[66]=H):H=q[66],q[67]!==eE?(P=e=>eE(e.target.value),q[67]=eE,q[68]=P):P=q[68];let eI=ef?"hidden":"visible";q[69]!==ej||q[70]!==eS||q[71]!==eI?(R={...eS,caretColor:"CanvasText",overflow:"hidden",zIndex:1,height:ej,visibility:eI},q[69]=ej,q[70]=eS,q[71]=eI,q[72]=R):R=q[72],q[73]!==ee||q[74]!==W||q[75]!==Z||q[76]!==P||q[77]!==R||q[78]!==O?(I=(0,n.jsx)("textarea",{ref:es,id:Z,value:O,onChange:P,dir:W,"aria-label":ee,className:"absolute inset-0 bg-transparent text-transparent focus:bg-gray-50 focus:text-foreground dark:focus:bg-gray-950 focus:outline-none resize-none",style:R}),q[73]=ee,q[74]=W,q[75]=Z,q[76]=P,q[77]=R,q[78]=O,q[79]=I):I=q[79];let eA=`Drag to set the start of the hadith content. Current position ${ev} of ${O.length}`;q[80]!==ev||q[81]!==W||q[82]!==K||q[83]!==O?(A=e=>{if("Home"===e.key||"End"===e.key){e.preventDefault(),K("Home"===e.key?0:O.length);return}"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),K("ArrowRight"===e.key&&"ltr"===W||"ArrowLeft"===e.key&&"rtl"===W?function(e,t){let r=Math.max(0,t);for(;r<e.length&&!/\s/.test(e[r]);)r++;for(;r<e.length&&/\s/.test(e[r]);)r++;return r}(O,ev):function(e,t){let r=Math.max(0,t-1);for(;r>0&&/\s/.test(e[r]);)r--;for(;r>0&&!/\s/.test(e[r-1]);)r--;return r}(O,ev)))},q[80]=ev,q[81]=W,q[82]=K,q[83]=O,q[84]=A):A=q[84],q[85]===Symbol.for("react.memo_cache_sentinel")?(T=e=>{e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId),es.current&&(es.current.style.visibility="hidden"),ei.current&&(ei.current.style.pointerEvents="auto",ei.current.style.zIndex="1"),em(!0)},q[85]=T):T=q[85],q[86]!==eN||q[87]!==J||q[88]!==K?($=e=>{if(!e.currentTarget.hasPointerCapture(e.pointerId))return;let t=ea.current;if(t){let r=t.getBoundingClientRect();
1e.clientY<r.top+J&&(t.scrollTop=t.scrollTop-J),e.clientY>r.bottom-J&&(t.scrollTop=t.scrollTop+J)}let r=eN(e.clientX,e.clientY);null!==r&&K(r)},q[86]=eN,q[87]=J,q[88]=K,q[89]=$):$=q[89],q[90]===Symbol.for("react.memo_cache_sentinel")?(z=e=>eM(e.currentTarget,e.pointerId),F=e=>eM(e.currentTarget,e.pointerId),q[90]=z,q[91]=F):(z=q[90],F=q[91]);let eT=ep.left-9,e$=ep.top,ez=Math.max(ep.height,J);return q[92]!==ep.top||q[93]!==eT||q[94]!==ez?(L={position:"absolute",left:eT,top:e$,width:18,height:ez,padding:0,border:0,background:"transparent",cursor:"col-resize",touchAction:"none",zIndex:2},q[92]=ep.top,q[93]=eT,q[94]=ez,q[95]=L):L=q[95],q[96]===Symbol.for("react.memo_cache_sentinel")?(D=(0,n.jsx)("span",{"aria-hidden":"true",style:{display:"block",width:2,height:"100%",margin:"0 auto",backgroundColor:"#f59e0b",borderRadius:9999,boxShadow:"0 0 6px rgba(245,158,11,0.4)"}}),q[96]=D):D=q[96],q[97]!==eA||q[98]!==A||q[99]!==$||q[100]!==L?(B=(0,n.jsx)("button",{type:"button","aria-label":eA,onKeyDown:A,onPointerDown:T,onPointerMove:$,onPointerUp:z,onPointerCancel:F,style:L,children:D}),q[97]=eA,q[98]=A,q[99]=$,q[100]=L,q[101]=B):B=q[101],q[102]!==k||q[103]!==H||q[104]!==I||q[105]!==B?(U=(0,n.jsxs)("div",{style:k,children:[H,I,B]}),q[102]=k,q[103]=H,q[104]=I,q[105]=B,q[106]=U):U=q[106],q[107]!==eH||q[108]!==N||q[109]!==U?(Y=(0,n.jsx)("div",{ref:ea,className:eH,style:N,children:U}),q[107]=eH,q[108]=N,q[109]=U,q[110]=Y):Y=q[110],Y}function p(e,t){return e+(t.textContent?.length||0)}function b(){}function y(e){return e+1}let v=[{value:"en",label:"English"},{value:"ur",label:"Urdu"},{value:"fa",label:"Farsi"}];function j({isOpen:e,onClose:t,hadithId:r,hadithNumber:a}){let[f,p]=(0,o.useState)("en"),[b,y]=(0,o.useState)(""),[w,N]=(0,o.useState)(0),[k,C]=(0,o.useState)(""),[S,_]=(0,o.useState)(0),[M,E]=(0,o.useState)(""),[H,P]=(0,o.useState)(0),[R,I]=(0,o.useState)(""),[A,T]=(0,o.useState)(0),[$,z]=(0,o.useState)(""),[F,L]=(0,o.useState)(null),[D,B]=(0,o.useState)(null),[U,Y]=(0,o.useState)(!1),[q,O]=(0,o.useState)("edit"),Q=x.id.hadith.getHadith.useQuery({hadithId:r,languages:[f,"ar"]},{enabled:e}),V=x.id.admin.getHadithEditHistory.useQuery({hadithId:r},{enabled:e}),K=x.id.useUtils(),W=(0,o.useRef)(!1),X=x.id.admin.updateHadithText.useMutation(),G=Q.data?.data?.hadith,J=G?.[`text_${f}`]??"",Z=G?.[`matn_index_${f}`]??0,ee=G?.text_ar??"",et=G?.matn_index_ar??0,er=`${r}-${f}-${J}-${Z}`,en=`${r}-${ee}-${et}`;(0,o.useEffect)(()=>{G&&F!==er&&(y(J),N(Z),C(J),_(Z),L(er))},[G,er,Z,J,F]),(0,o.useEffect)(()=>{G&&D!==en&&(E(ee),P(et),I(ee),T(et),B(en))},[G,D,en,et,ee]),(0,o.useEffect)(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]);let ea=async()=>{let e=b!==k,t=w!==S,n=M!==R,a=H!==A;if(!e&&!t&&!n&&!a)return void u.oR.info("No changes to save");Y(!0);let i=!1,s=[];try{if(e||t)try{await X.mutateAsync({hadithId:r,language:f,...e?{newText:b}:{},...t?{newMatnIndex:w}:{},note:$||void 0}),C(b),_(w),i=!0}catch(e){s.push(e instanceof Error?e.message:"Failed to update translation")}if(n||a)try{await X.mutateAsync({hadithId:r,language:"ar",...n?{newText:M}:{},...a?{newMatnIndex:H}:{},note:$||void 0}),I(M),T(H),i=!0}catch(e){s.push(e instanceof Error?e.message:"Failed to update Arabic")}i&&(W.current=!0,u.oR.success("Hadith updated successfully"),await Promise.allSettled([Q.refetch(),V.refetch()])),s.length>0?u.oR.error(s.join("\n")):z("")}finally{Y(!1)}},ei=()=>{U||(b===k&&w===S&&M===R&&H===A||window.confirm("You have unsaved changes. Are you sure you want to discard them?"))&&(W.current&&(K.hadith.getHadith.invalidate({hadithId:r}),K.hadith.getHadithsByChapter.invalidate(),K.hadith.getChapterContentMixed.invalidate(),K.admin.getHadithEditHistory.invalidate({hadithId:r}),W.current=!1),L(null),B(null),z(""),O("edit"),t())},es="ur"===f||"fa"===f,el=v.find(e=>e.value===f).label;return(0,d.createPortal)((0,n.jsx)(i.N,{children:e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.P.div,{className:"fixed inset-0 z-50 cursor-pointer bg-black/70",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:ei}),(0,n.jsx)(s.P.div,{className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:350,duration:.25},children:(0,n.jsxs)("div",{className:"pointer-events-auto w-full max-w-5xl max-h-[85vh] overflow-y-auto rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-black shadow-xl",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-gray-200 dark:border-gray-800 px-5 py-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("h2",{className:"text-lg font-semibold text-foreground",children:["Edit Hadith #",a??r]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Edit text and drag the amber marker to set the matn boundary. Formatting: <b>, <strong>, <i>, <em>, <p>, and <br>."})]}),(0,n.jsx)("button",{type:"button",onClick:ei,disabled:U,className:"rounded-full p-1.5 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:(0,n.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,n.jsx)("div",{className:"px-5 py-4 space-y-5",children:"edit"===q?Q.isLoading?(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"animate-pulse h-4 w-1/4 bg-gray-200 dark:bg-gray-800 rounded"}),(0,n.jsx)("div",{className:"animate-pulse h-40 bg-gray-200 dark:bg-gray-800 rounded"})]}):Q.isError?(0,n.jsx)("div",{className:"text-red-500 text-sm",children:"Error loading hadith data"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col xl:flex-row-reverse xl:items-stretch xl:gap-6 gap-4",children:[(0,n.jsxs)("div",{className:"xl:w-1/2 min-w-0 flex flex-col gap-1.5",children:[(0,n.jsx)("label",{htmlFor:"hadith-arabic-editor",className:"text-sm font-medium text-foreground",children:"Arabic"}),(0,n.jsx)(m,{text:M,onTextChange:E,matnIndex:H,onMatnIndexChange:P,dir:"rtl",fontFamily:"Nassim Pro",fontSizePx:18.4,lineHeightPx:35,id:"hadith-arabic-editor",ariaLabel:"Arabic hadith text"})]}),(0,n.jsx)("div",{className:"xl:hidden h-[1px] w-full bg-gray-200 dark:bg-gray-800"}),(0,n.jsxs)("div",{className:"xl:w-1/2 min-w-0 flex flex-col gap-1.5",children:[(0,n.jsxs)(h.l6,{value:f,disabled:U,onValueChange:e=>{e===f||(b===k&&w===S||window.confirm("Discard unsaved changes to this translation?"))&&(p(e),L(null))},children:[(0,n.jsx)(h.bq,{className:"w-[120px] h-7 text-sm font-medium border-none bg-transparent pl-0 pr-1 shadow-none focus:ring-0 hover:text-foreground/80 underline underline-offset-2 decoration-dotted decoration-muted-foreground/40",children:(0,n.jsx)(h.yv,{})}),(0,n.jsx)(h.gC,{children:v.map(e=>(0,n.jsx)(h.eb,{value:e.value,children:e.label},e.value))})]}),(0,n.jsx)(m,{text:b,onTextChange:y,matnIndex:w,onMatnIndexChange:N,dir:es?"rtl":"ltr",fontFamily:"Nassim Pro",fontSizePx:16.8,lineHeightPx:25,id:"hadith-translation-editor",ariaLabel:`${el} hadith text`})]})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)("label",{htmlFor:"hadith-edit-note",className:"text-sm font-medium text-foreground",children:"Note (optional)"}),(0,n.jsx)("input",{id:"hadith-edit-note",type:"text",placeholder:"Reason for the change...",className:"w-full h-10 px-3 text-sm rounded-md border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-950 text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",value:$,onChange:e=>z(e.target.value)})]})]}):(0,n.jsx)("div",{className:"space-y-3",children:V.isLoading?(0,n.jsx)("div",{className:"animate-pulse h-16 bg-gray-200 dark:bg-gray-800 rounded"}):V.data?.edits.length===0?(0,n.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No edits have been made to this hadith."}):V.data?.edits.map(e=>{var t;return(0,n.jsxs)("div",{className:"text-sm border border-gray-200 dark:border-gray-800 rounded-md p-3 space-y-1 bg-gray-50 dark:bg-gray-950",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"font-medium text-foreground",children:{text_en:"English Text",text_ar:"Arabic Text",text_ur:"Urdu Text",text_fa:"Farsi Text",matn_index_en:"English Matn Index",matn_index_ar:"Arabic Matn Index",matn_index_ur:"Urdu Matn Index",matn_index_fa:"Farsi Matn Index"}[t=e.field_name??"unknown"]||t}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:new Date(e.created_at).toLocaleStr
1ing()})]}),(0,n.jsxs)("div",{className:"text-xs text-muted-foreground",children:["by"," ",e.user.name||e.user.username||e.user.email]}),e.note&&(0,n.jsxs)("div",{className:"text-xs italic text-muted-foreground",children:["Note: ",e.note]}),(0,n.jsx)(g,{before:e.before_text,after:e.after_text})]},e.id)})})}),(0,n.jsxs)("div",{className:"flex justify-between border-t border-gray-200 dark:border-gray-800 px-5 py-4",children:[(0,n.jsx)(c.$,{variant:"ghost",size:"sm",disabled:U,onClick:()=>O("edit"===q?"history":"edit"),children:"edit"===q?"View History":"Back to Editor"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(c.$,{variant:"outline",onClick:ei,disabled:U,children:"Cancel"}),"edit"===q&&(0,n.jsx)(c.$,{onClick:ea,disabled:U||Q.isLoading,children:U?"Saving...":"Save Changes"})]})]})]})})]})}),document.body)}}}]);

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.