PageSourceSearch

https://waqfeya.com/_next/static/chunks/0ql8ig37_5hwa.js

js waqfeya.com collected 2026-10-02 04:26:25 UTC 14,373 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93479,e=>{"use strict";var t=e.i(43476),r=e.i(75157);e.s(["Input",0,function({className:e,type:n,...s}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...s})}])},87486,e=>{"use strict";var t=e.i(43476),r=e.i(25913),n=e.i(75157);let s=(0,r.cva)("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",...a}){return(0,t.jsx)("span",{"data-slot":"badge","data-variant":r,className:(0,n.cn)(s({variant:r}),e),...a})}])},15288,e=>{"use strict";var t=e.i(43476),r=e.i(75157);e.s(["Card",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...n})},"CardContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...n})},"CardFooter",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...n})}])},54513,e=>{"use strict";var t=e.i(71645),r=Object.defineProperty,n=new Map,s=new WeakMap,a=0,i=void 0;t.Component,e.s(["useInView",0,function({threshold:e,delay:r,trackVisibility:o,rootMargin:l,root:d,triggerOnce:c,skip:u,initialInView:f,fallbackInView:m,onChange:x}={}){var h;let[p,g]=t.useState(null),b=t.useRef(x),[v,y]=t.useState({inView:!!f,entry:void 0});b.current=x,t.useEffect(()=>{let t;if(!u&&p)return t=function(e,t,r={},o=i){if(void 0===window.IntersectionObserver&&void 0!==o){let n=e.getBoundingClientRect();return t(o,{isIntersecting:o,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:n,intersectionRect:n,rootBounds:n}),()=>{}}let{id:l,observer:d,elements:c}=function(e){let t=Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{var r;return`${t}_${"root"===t?!(r=e.root)?"0":(s.has(r)||(a+=1,s.set(r,a.toString())),s.get(r)):e[t]}`}).toString(),r=n.get(t);if(!r){let s,a=new Map,i=new IntersectionObserver(t=>{t.forEach(t=>{var r;let n=t.isIntersecting&&s.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=n),null==(r=a.get(t.target))||r.forEach(e
1=>{e(n,t)})})},e);s=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:i,elements:a},n.set(t,r)}return r}(r),u=c.get(e)||[];return c.has(e)||c.set(e,u),u.push(t),d.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(c.delete(e),d.unobserve(e)),0===c.size&&(d.disconnect(),n.delete(l))}}(p,(e,r)=>{y({inView:e,entry:r}),b.current&&b.current(e,r),r.isIntersecting&&c&&t&&(t(),t=void 0)},{root:d,rootMargin:l,threshold:e,trackVisibility:o,delay:r},m),()=>{t&&t()}},[Array.isArray(e)?e.toString():e,p,d,l,c,u,o,m,r]);let j=null==(h=v.entry)?void 0:h.target,w=t.useRef(void 0);p||!j||c||u||w.current===j||(w.current=j,y({inView:!!f,entry:void 0}));let k=[g,v.inView,v.entry];return k.ref=k[0],k.inView=k[1],k.entry=k[2],k}])},39900,e=>{"use strict";let t=(0,e.i(33550).default)("outline","user","User",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]]);e.s(["IconUser",0,t],39900)},57772,e=>{"use strict";let t=(0,e.i(33550).default)("outline","x","X",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);e.s(["IconX",0,t],57772)},48735,e=>{"use strict";var t=e.i(43476),r=e.i(22016),n=e.i(71645),s=e.i(15288),a=e.i(87486),i=e.i(960),o=e.i(75157);function l({count:e,selected:r}){return(0,t.jsx)(a.Badge,{variant:"secondary",className:(0,o.cn)("h-[22px] min-w-7 shrink-0 px-2 text-[0.72rem] font-semibold",r?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"),children:e})}function d({label:e,selected:n,onClick:s,href:a}){let i=(0,o.cn)("inline-flex shrink-0 items-center rounded-full border px-3 py-1.5 text-[0.85rem] font-medium transition-colors",n?"border-primary bg-primary text-primary-foreground":"border-border bg-card text-foreground hover:bg-muted/60");return a?(0,t.jsx)(r.default,{href:a,className:i,children:e}):(0,t.jsx)("button",{type:"button",onClick:s,className:i,children:e})}e.s(["CenturySidebar",0,({selectedPermalink:e,onSelect:a,variant:c="filter",navBasePath:u="/centuries",allLabel:f="الكل",title:m="تصفية بالقرن",countField:x="authorCount",fetchUrl:h})=>{let[p,g]=(0,n.useState)([]),[b,v]=(0,n.useState)(!0),y=(0,n.useRef)(null),j="navigate"===c,w=!j;(0,n.useEffect)(()=>{let e=h??"/authors/centuries-api";v(!0),fetch(e).then(e=>e.json()).then(e=>g(function(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e&&"data"in e){let t=e.data;return Array.isArray(t)?t:[]}return[]}(e))).catch(console.error).finally(()=>v(!1))},[h]),(0,n.useEffect)(()=>{j&&y.current&&y.current.scrollIntoView({block:"nearest"})},[j,e,p,b]);let k=e=>(0,o.cn)("flex w-full items-center justify-between gap-3 border-b border-border px-4 py-3 text-start transition-colors last:border-b-0",e?"bg-primary text-primary-foreground hover:bg-primary":"text-foreground hover:bg-muted/50");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mb-4 flex gap-2 overflow-x-auto overscroll-x-contain pb-3 [-webkit-overflow-scrolling:touch] [touch-action:pan-x] md:hidden",children:[w?(0,t.jsx)(d,{label:f,selected:null===e,onClick:()=>a?.(null)}):null,b?Array.from({length:6}).map((e,r)=>(0,t.jsx)(i.Skeleton,{className:"h-8 w-20 shrink-0 rounded-full"},r)):p.map(r=>{let n=e===r.permalink;return(0,t.jsx)(d,{label:r.name,selected:n,onClick:j?void 0:()=>a?.(r),href:j?`${u}/${r.permalink}`:void 0},r._id)})]}),(0,t.jsxs)(s.Card,{className:"hidden w-[230px] shrink-0 flex-col self-start overflow-hidden rounded-2xl border-border py-0 shadow-md md:sticky md:top-[90px] md:flex md:max-h-[calc(100vh-100px)]",children:[(0,t.jsx)("div",{className:"flex shrink-0 items-center justify-center bg-muted px-5 py-3.5",children:(0,t.jsx)("h2",{className:"text-center text-[0.95rem] font-bold tracking-wide",children:m})}),(0,t.jsxs)("nav",{className:"min-h-0 flex-1 overflow-y-auto",children:[w?(0,t.jsx)("button",{type:"button",onClick:()=>a?.(null),className:k(null===e),children:(0,t.jsx)("span",{className:(0,o.cn)("min-w-0 flex-1 text-end text-[0.92rem]",null===e?"font-bold":"font-medium"),children:f})}):null,b?Array.from({length:8}).map((e,r)=>(0,t.jsx)("div",{className:"flex justify-end border-b border-border px-4 py-3",children:(0,t.jsx)(i.Skeleton,{className:"h-5 w-[70%]"})},r)):p.map(n=>{let s=e===n.permalink,i=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,o.cn)("min-w-0 flex-1 truncate text-end text-[0.9rem]",s?"font-bold":"font-medium"),children:n.name}
1),(0,t.jsx)(l,{count:n[x],selected:s})]});return j?(0,t.jsx)(r.default,{ref:s?y:void 0,href:`${u}/${n.permalink}`,className:k(s),children:i},n._id):(0,t.jsx)("button",{type:"button",onClick:()=>a?.(n),className:k(s),children:i},n._id)})]})]})]})}])},58254,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(98107),s=e.i(39900),a=e.i(22016),i=e.i(54513),o=e.i(32781),l=e.i(72436),d=e.i(75157);let c=["#556cd6","#19857b","#e53935","#8e24aa","#00897b","#d84315","#3949ab","#00796b","#c62828","#6a1b9a","#2e7d32","#1565c0"];e.s(["AuthorsList",0,({centuryPermalink:e=null,searchQuery:u=""})=>{let[f,m]=(0,r.useState)(1),[x,h]=(0,r.useState)([]),[p,g]=(0,r.useState)(!1),[b,v]=(0,r.useState)(!0),[y,j]=(0,r.useState)(null),w=(0,r.useRef)({centuryPermalink:e,searchQuery:u}),k=(0,r.useRef)(!1),{ref:N,inView:C}=(0,i.useInView)(),S=(0,r.useCallback)(async(e,t,r,n)=>{g(!0),j(null);try{let s=[],a=!1;if(r.length>=2){let t=`https://waqfeya-backend-r9rw8.ondigitalocean.app/author/search/${encodeURIComponent(r)}?page=${e}&pageSize=30`,n=await fetch(t,{cache:"no-store"});if(!n.ok)throw Error(n.statusText);let i=await n.json();s=i?.data??[],a=i?.pagination?.hasNext??!1}else if(t){let r=await fetch(`/authors/century-authors-api?permalink=${t}&page=${e}&pageSize=30`);if(!r.ok)throw Error(r.statusText);let n=await r.json();s=n?.data??[],a=n?.hasMore??!1}else{let t=await fetch(`/authors/api?page=${e-1}`);if(!t.ok)throw Error(t.statusText);a=(s=await t.json()).length>0}if(w.current.centuryPermalink!==t||w.current.searchQuery!==r)return;0===s.length?(v(!1),n||h([])):(h(e=>n?[...e,...s]:s),v(a),m(e))}catch(e){j(e instanceof Error?e.message:"حدث خطأ"),n||h([]),v(!1)}finally{g(!1)}},[]);return((0,r.useEffect)(()=>{w.current={centuryPermalink:e,searchQuery:u},k.current=!0,h([]),m(1),v(!0),j(null),S(1,e,u,!1).finally(()=>{k.current=!1})},[e,u,S]),(0,r.useEffect)(()=>{!k.current&&C&&b&&!p&&x.length>0&&S(f+1,e,u,!0)},[C,b,p,f,x.length]),p||0!==x.length||y)?(0,t.jsxs)("div",{className:"min-w-0 w-full flex-1",children:[(0,t.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 sm:gap-4 md:grid-cols-4",children:x.map(({_id:e,name:r,permalink:i,bookCount:o})=>{let u=function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return c[Math.abs(t)%c.length]}(r);return(0,t.jsx)(a.default,{href:`/authors/${i}`,className:"group no-underline",children:(0,t.jsxs)("div",{className:(0,d.cn)("flex cursor-pointer flex-col items-center rounded-2xl border border-border bg-card p-3 text-center transition-all sm:p-4","hover:-translate-y-0.5 hover:shadow-lg"),style:{"--author-color":u},onMouseEnter:e=>{e.currentTarget.style.borderColor=u,e.currentTarget.style.boxShadow=`0 4px 20px ${u}33`},onMouseLeave:e=>{e.currentTarget.style.borderColor="",e.currentTarget.style.boxShadow=""},children:[(0,t.jsx)("div",{className:"mb-3 flex size-12 items-center justify-center rounded-full border-2 sm:size-14",style:{backgroundColor:`${u}18`,borderColor:`${u}44`,boxShadow:`0 4px 12px ${u}33`},children:(0,t.jsx)(s.IconUser,{size:26,color:u})}),(0,t.jsx)("span",{className:"author-name mb-2 line-clamp-3 break-words text-[0.8rem] font-semibold leading-snug text-foreground transition-colors group-hover:text-[var(--author-color)] sm:text-[0.9rem]",children:r}),"number"==typeof o&&o>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Separator,{className:"mb-2 w-full"}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(n.IconBooks,{size:13}),(0,t.jsxs)("span",{className:"text-[0.72rem]",children:[o," كتاب"]})]})]})]})},e)})}),b&&(0,t.jsx)("div",{ref:N,className:"h-5"}),p&&(0,t.jsx)("div",{className:"my-8 flex justify-center",children:(0,t.jsx)(o.Loader2,{className:"size-7 animate-spin text-primary"})}),y&&(0,t.jsx)("p",{className:"mt-4 text-center text-destructive",children:y})]}):(0,t.jsx)("div",{className:"min-w-0 flex-1 py-12 text-center text-muted-foreground",children:(0,t.jsx)("p",{children:u?`لا توجد نتائج للبحث عن "${u}"`:"لا يوجد مؤلفون في هذا القرن"})})}])},5074,e=>{"use strict";var t=e.i(43476),r=e.i(48719),n=e.i(57772),s=e.i(71645),a=e.i(48735),i=e.i(58254),o=e.i(93479);e.s(["AuthorsPageClient",0,()=>
1{let[e,l]=(0,s.useState)(null),[d,c]=(0,s.useState)(""),[u,f]=(0,s.useState)("");return(0,s.useEffect)(()=>{let e=setTimeout(()=>f(d.trim()),400);return()=>clearTimeout(e)},[d]),(0,t.jsxs)("div",{dir:"rtl",className:"mt-4",children:[(0,t.jsxs)("div",{className:"relative mb-4",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute start-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:d?(0,t.jsx)("button",{type:"button",className:"pointer-events-auto flex cursor-pointer hover:text-foreground",onClick:()=>{c(""),f("")},"aria-label":"مسح البحث",children:(0,t.jsx)(n.IconX,{size:18})}):(0,t.jsx)(r.IconSearch,{size:18})}),(0,t.jsx)(o.Input,{placeholder:"ابحث عن مؤلف...",value:d,onChange:e=>{var t;c(t=e.target.value),t.trim()&&l(null)},className:"min-h-11 rounded-full bg-card ps-10 pe-4 text-[0.9375rem]"})]}),(0,t.jsxs)("div",{className:"flex flex-col items-stretch gap-0 md:flex-row md:items-start md:gap-6",children:[!u&&(0,t.jsx)(a.CenturySidebar,{selectedPermalink:e?.permalink??null,onSelect:l,allLabel:"جميع المؤلفين"}),(0,t.jsx)(i.AuthorsList,{centuryPermalink:e?.permalink??null,searchQuery:u})]})]})}])}]);

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.