1import{r as o,j as t,H as U}from"./app-F-Yl4Ad1.js";import{E as K}from"./EncTopBar-Ci6HQTnQ.js";import{L as Y}from"./LastWord-BkrvK-j1.js";import{I as q}from"./TopBar-C3cgS3Mw.js";import{C as G}from"./atoms-BsKP_8XD.js";import{B as J}from"./BookCard-CLQiCWhI.js";import{a as R}from"./sample-data-7cTh_NJc.js";import{a as _,A as C}from"./arabic-count-C7s-S8pq.js";/* empty css */const L=[{k:"all",label:"اÙÙÙÙÙ"},{k:"e23",label:"اÙÙØ±Ù Ù¢-Ù£ÙÙ"},{k:"e45",label:"اÙÙØ±Ù Ù¤-Ù¥ÙÙ"},{k:"e69",label:"اÙÙØ±Ù Ù¦-Ù©ÙÙ"},{k:"e10",label:"اÙÙØ±Ù Ù¡Ù ÙÙ ÙØ£ØØ¯Ø«"}],w=[{k:"all",label:"بدÙÙ ÙÙØªØ±"},{k:"lt1k",label:"Ø£ÙÙ Ù
Ù Ù¡Ù Ù Ù "},{k:"1to5k",label:"Ù¡Ù Ù Ù â Ù¥Ù Ù Ù "},{k:"gt5k",label:"Ø£ÙØ«Ø± Ù
Ù Ù¥Ù Ù Ù "}],E=[{k:"fame",label:"Ø§ÙØªØ±ØªÙب Ø§ÙØ§ÙتراضÙÙÙ"},{k:"count_desc",label:"Ø§ÙØ£Ùثر Ø£ØØ§Ø¯ÙثاÙ"},{k:"count_asc",label:"Ø§ÙØ£ÙÙ Ø£ØØ§Ø¯ÙثاÙ"},{k:"era_asc",label:"Ø§ÙØ£ÙدÙ
زÙ
ÙØ§Ù"},{k:"title",label:"ØØ³Ø¨ Ø§ÙØ§Ø³Ù
"}];function j(n){if(!n)return null;const s=n.replace(/[Ù -Ù©]/g,d=>String("٠١٢٣٤٥٦٧٨٩".indexOf(d))).match(/(\d{1,4})/);return s?parseInt(s[1],10):null}function Q(n){return n?Math.floor((n-1)/100)+1:null}function V(n){return String(n).replace(/\d/g,l=>"٠١٢٣٤٥٦٧٨٩"[parseInt(l,10)])}function m(n){if(!n)return 0;const l=n.replace(/[Ù -Ù©]/g,s=>String("٠١٢٣٤٥٦٧٨٩".indexOf(s)));return parseInt(l.replace(/[^\d]/g,""),10)||0}function oe({books:n=R,totalCount:l=R.length,sections:s=[],scope:d=null}){var I;const u=d==="sunan",p=d==="maktaba",g=u?"ÙØªØ¨ Ø§ÙØ³ÙÙÙÙ":p?"اÙÙ
ÙØªØ¨Ø© Ø§ÙØØ¯ÙØ«ÙÙÙØ©":"ÙØªØ¨Ù Ø§ÙØ³ÙÙÙÙÙØ©Ù اÙÙØ¨ÙÙÙÙØ©",i=u?"اÙÙØªØ¨Ù Ø§ÙØ£ØµÙÙÙ Ø§ÙØ«ÙØ§Ø«Ø©Ù ÙØ§ÙØ«ÙØ§Ø«ÙÙ Ø§ÙØªÙ عÙÙÙØ§ Ù
Ø¯Ø§Ø±Ù Ø§ÙØªØ®Ø±ÙØ¬Ø Ù
٠اÙÙØ±Ù Ø§ÙØ«Ø§Ù٠إÙÙ Ø§ÙØªØ§Ø³Ø¹ اÙÙØ¬Ø±ÙÙÙ.":p?`${l.toLocaleString("en-US")} ${_(l,C.book)} Ù
Ù Ù
صادر Ø§ÙØØ¯ÙØ« اÙÙØ±Ø¹ÙÙÙØ©: Ø´Ø±ÙØØ ÙÙ
Ø³ØªØ®Ø±ÙØ¬Ø§ØªØ ÙØ£Ø¬Ø²Ø§Ø¡Ø ÙÙ
عاجÙ
Ø ÙÙØªØ¨ رجاÙ.`:`${l.toLocaleString("en-US")} ${_(l,C.book)} Ù
Ù ÙØªØ¨ Ø§ÙØØ¯ÙØ«Ø Ù
٠اÙÙØ±Ù Ø§ÙØ«Ø§Ù٠إÙÙ Ø§ÙØ®Ø§Ù
س عشر اÙÙØ¬Ø±ÙÙÙØ Ù
ع ØªÙØ´ÙÙÙ ÙØ§Ù
ÙÙ ÙÙØ£Ø¨Ùاب ÙØ§ÙØ£ØØ§Ø¯ÙØ«.`,v=u?"ÙØªØ¨ Ø§ÙØ³ÙÙÙÙ":p?"اÙÙ
ÙØªØ¨Ø©":"اÙÙØªØ¨",[y,F]=o.useState(!1),[b,W]=o.useState("all"),[c,N]=o.useState("all"),[f,T]=o.useState("all"),[k,$]=o.useState("fame"),z=o.useMemo(()=>n.filter(e=>e.primary).length,[n]),S=o.useMemo(()=>{const e=new Map;for(const r of n)r.section&&e.set(r.section,(e.get(r.section)??0)+1);const x=s.length>0?s.filter(r=>e.has(r)):Array.from(e.keys());return[{k:"all",label:"ÙÙÙÙ Ø§ÙØ£ÙساÙ
"},...x.map(r=>({k:r,label:`${r} (${e.get(r)??0})`}))]},[n,s]),O=o.useMemo(()=>{let e=n.slice();y&&(e=e.filter(r=>r.primary)),b!=="all"&&(e=e.filter(r=>r.section===b)),c!=="all"&&(e=e.filter(r=>{const a=Q(j(r.era));return a?c==="e23"?a>=2&&a<=3:c==="e45"?a>=4&&a<=5:c==="e69"?a>=6&&a<=9:c==="e10"?a>=10:!0:!1})),f!=="all"&&(e=e.filter(r=>{const a=m(r.count);return f==="lt1k"?a<1e3:f==="1to5k"?a>=1e3&&a<=5e3:f==="gt5k"?a>5e3:!0}));const x=r=>n.indexOf(r);return e.sort((r,a)=>{switch(k){case"count_desc":return m(a.count)-m(r.count);case"count_asc":return m(r.count)-m(a.count);case"era_asc":{const M=j(r.era)??9999,B=j(a.era)??9999;return M-B}case"title":return r.title.localeCompare(a.title,"ar");case"fame":default:return x(r)-x(a)}}),e},[n,y,b,c,f,k]),P=L.find(e=>e.k===c).label,A=w.find(e=>e.k===f).label,D=E.find(e=>e.k===k).label,H=((I=S.find(e=>e.k===b))==null?void 0:I.label)??"ÙÙÙÙ Ø§ÙØ£ÙساÙ
";return t.jsxs(t.Fragment,{children:[t.jsx(U,{title:`${g} â Ø§ÙÙ
ÙØ³Ùعة Ø§ÙØØ¯ÙØ«ÙÙÙØ©`}),t.jsxs("div",{dir:"rtl",style:{minHeight:"100vh",background:"var(--bg)"},children:[t.jsx(K,{active:"enc"}),t.jsxs("main",{style:{maxWidth:1200,margin:"0 auto",width:"100%",padding:"48px 28px 80px",display:"flex",flexDirection:"column",gap:40},children:[t.jsxs("header",{style:{display:"flex",flexDirection:"column",gap:10},children:[t.jsx(G,{items:[{t:"اÙÙ
ÙØ³Ùعة",href:"/encyclopedia"},{t:v,last:!0}]}),t.jsx("h1",{style:{margin:0,fontFamily:"var(--font-display)",fontSize:"clamp(36px, 4.5vw, 52px)",fontWeight:500,letterSpacing:"-0.015em",lineHeight:1.2},children:t.jsx(Y,{children:g})}),t.jsx("p",{style:{margin:0,fontFamily:"var(--font-text)",fontSize:17,lineHeight:1.65,color:"var(--fg-2)",maxWidth:"56ch"},children:i})]}),t.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center",padding:"14px 16px",background:"var(--bg-1)",border:"1px solid var(--line)",borderRadius:12},children:[t.jsx(h,{label:"اÙÙØ³Ù
",value:H,options:S.map(e=>({k:e.k,label:e.label,active:e.k===b})),onPick:e=>W(e)}),t.jsx(h,{label:"Ø§ÙØÙØ¨Ø©",value:P,options:L.map(e=>({k:e.k,label:e.label,active:e.k===c})),onPick:e=>N(e)}),t.jsx(h,{label:"عدد Ø§ÙØ£ØØ§Ø¯ÙØ«",value:A,options:w.map(e=>({k:e.k,label:e.label,active:e.k===f})),onPick:e=>T(e)}),t.jsx(h,{label:"Ø§ÙØªØ±ØªÙب",value:D,options:E.map(e=>({k:e.k,label:e.label,active:e.k===k})),onPick:e=>$(e)}),t.jsx("span",{style:{flex:1,minWidth:8}}),!d&&t.jsx(X,{on:y,label:`اÙÙØªØ¨ Ø§ÙØ£ØµÙÙ ÙÙØ· (${V(z)})`,onClick:()=>F(e=>!e)})]}
1),t.jsxs("div",{className:"mob-grid-1",style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},children:[O.map((e,x)=>t.jsx(J,{book:e,index:x+1},e.slug)),O.length===0&&t.jsx("p",{style:{gridColumn:"1 / -1",textAlign:"center",color:"var(--fg-3)",fontSize:14,padding:32},children:"ÙØ§ ØªÙØ¬Ø¯ ÙØªØ¨Ù ØªØ·Ø§Ø¨Ù ÙØ°Ù اÙÙ
رشÙÙØØ§Øª."})]})]})]})]})}function h({label:n,value:l,options:s,onPick:d}){const[u,p]=o.useState(!1),g=o.useRef(null);return o.useEffect(()=>{if(!u)return;const i=v=>{g.current&&!g.current.contains(v.target)&&p(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[u]),t.jsxs("div",{ref:g,style:{position:"relative"},children:[t.jsxs("button",{type:"button",onClick:()=>p(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:8,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:8,padding:"7px 12px",fontFamily:"inherit",color:"var(--fg-1)",cursor:"pointer",fontSize:13},children:[t.jsxs("span",{style:{color:"var(--fg-3)"},children:[n,":"]}),t.jsx("span",{style:{fontWeight:500},children:l}),t.jsx(q,{name:"chevron-d",size:11,color:"var(--fg-3)"})]}),u&&t.jsx("div",{style:{position:"absolute",top:"calc(100% + 6px)",insetInlineStart:0,zIndex:30,minWidth:180,background:"var(--bg-1)",border:"1px solid var(--line)",borderRadius:10,boxShadow:"0 8px 28px rgba(0,0,0,0.10)",padding:4,display:"flex",flexDirection:"column"},children:s.map(i=>t.jsx("button",{type:"button",onClick:()=>{d(i.k),p(!1)},style:{textAlign:"start",padding:"8px 10px",borderRadius:6,background:i.active?"var(--accent-pill-bg)":"transparent",color:i.active?"var(--accent)":"var(--fg-1)",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:13,fontWeight:i.active?500:400},children:i.label},i.k))})]})}function X({on:n,label:l,onClick:s}){return t.jsxs("button",{type:"button",onClick:s,style:{display:"inline-flex",alignItems:"center",gap:8,background:n?"var(--accent-pill-bg)":"var(--bg)",border:`1px solid ${n?"color-mix(in oklch, var(--accent) 35%, var(--line))":"var(--line)"}`,borderRadius:8,padding:"7px 12px",cursor:"pointer",fontFamily:"inherit",color:n?"var(--accent)":"var(--fg-1)",fontSize:13,fontWeight:500},children:[t.jsx("span",{style:{width:24,height:14,borderRadius:99,background:n?"var(--accent)":"var(--line)",position:"relative"},children:t.jsx("span",{style:{position:"absolute",top:1,insetInlineStart:n?11:1,width:12,height:12,borderRadius:99,background:"var(--bg)"}})}),l]})}export{oe 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.