PageSourceSearch

https://mandalabookpoint.com/_next/static/chunks/321fzjcz9jvi9.js

js mandalabookpoint.com collected 2026-10-02 07:30:17 UTC 15,780 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,4581,e=>{"use strict";let t=e.i(47167).default.env.NEXT_PUBLIC_API_URL||"/api";class r extends Error{constructor(e,t){super(e),this.status=t,this.name="ApiError"}}async function a(e,o={}){let s=`${t}${e}`,n={credentials:"include",headers:{"Content-Type":"application/json",...o.headers},...o};n.body&&"object"==typeof n.body&&(n.body=JSON.stringify(n.body));try{let e,t=await fetch(s,n),a=await t.text();try{e=a?JSON.parse(a):{}}catch(e){throw new r(t.ok?"Invalid server response":a||`Request failed (${t.status})`,t.status||0)}if(!t.ok)throw new r(e.error||e.message||"An error occurred",t.status);return e}catch(e){if(e instanceof r)throw e;throw new r(e.message||"Network error",0)}}e.s(["api",0,{books:{getAll:()=>a("/books"),getById:e=>a(`/books/${e}`),getByCategoryId:e=>a(`/books?categoryId=${e}`),search:e=>a(`/books/search?q=${encodeURIComponent(e)}`),create:e=>a("/books",{method:"POST",body:e}),update:(e,t)=>a(`/books/${e}`,{method:"PUT",body:t}),delete:e=>a(`/books/${e}`,{method:"DELETE"})},blog:{getAll:()=>a("/blog"),getBySlug:e=>a(`/blog/${e}`),create:e=>a("/blog",{method:"POST",body:e}),update:(e,t)=>a(`/blog/${e}`,{method:"PUT",body:t}),delete:e=>a(`/blog/${e}`,{method:"DELETE"})},categories:{getAll:()=>a("/categories"),getById:e=>a(`/categories/${e}`),getBySlug:e=>a(`/categories/slug/${e}`),create:e=>a("/categories",{method:"POST",body:e}),update:(e,t)=>a(`/categories/${e}`,{method:"PUT",body:t}),delete:e=>a(`/categories/${e}`,{method:"DELETE"})},reviews:{getAll:()=>a("/reviews"),getByBookId:e=>a(`/reviews?bookId=${e}`),create:e=>a("/reviews",{method:"POST",body:e})},users:{getAll:()=>a("/users"),getById:e=>a(`/users/${e}`),getByEmail:e=>a(`/users/email/${e}`),create:e=>a("/users",{method:"POST",body:e}),update:(e,t)=>a(`/users/${e}`,{method:"PUT",body:t})},newsletter:{getAll:()=>a("/newsletter"),subscribe:e=>a("/newsletter/subscribe",{method:"POST",body:{email:e}})},popups:{getAll:()=>a("/popups"),getActive:()=>a("/popups?active=true"),create:e=>a("/popups",{method:"POST",body:e}),update:(e,t)=>a(`/popups/${e}`,{method:"PUT",body:t}),delete:e=>a(`/popups/${e}`,{method:"DELETE"})},orders:{getAll:()=>a("/orders"),getById:e=>a(`/orders/${e}`),create:e=>a("/orders",{method:"POST",body:e}),update:(e,t)=>a(`/orders/${e}`,{method:"PUT",body:t})},auth:{register:(e,t,r)=>a("/auth/register",{method:"POST",body:{email:e,password:t,name:r}}),login:(e,t)=>a("/auth/login",{method:"POST",body:{email:e,password:t}})},payment:{create:e=>a("/payment/create",{method:"POST",body:e}),generatePage:e=>a("/payment/generate-page",{method:"POST",body:e}),getStatus:(e,t)=>{let r=new URLSearchParams;return e&&r.set("transactionId",e),t&&r.set("orderId",t),a(`/payment/status?${r.toString()}`)},getStatusByOrder:e=>a(`/payment/status?orderId=${e}`)}}])},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={formatUrl:function(){return l},formatWithValidation:function(){return c},urlObjectKeys:function(){return i}};for(var o in a)Object.defineProperty(r,o,{enumerable:!0,get:a[o]});let s=e.r(90809)._(e.r(98183)),n=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,a=e.protocol||"",o=e.pathname||"",l=e.hash||"",i=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:r&&(c=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(c+=":"+e.port)),i&&"object"==typeof i&&(i=String(s.urlQueryToSearchParams(i)));let d=e.search||i&&`?${i}`||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||n.test(a))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),o=o.replace(/[?#]/g,encodeURIComponent),d=d.replace("#","%23"),`${a}${c}${o}${d}${l}`}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return l(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let a=e.r(71645);function o(e,t){let r=(0,a.useRef)(null),o=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=s(e,a)),t&&(o.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
1dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return s}});let a=e.r(18967),o=e.r(52817);function s(e){if(!(0,a.isAbsoluteUrl)(e))return!0;try{let t=(0,a.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return y},useLinkStatus:function(){return x}};for(var o in a)Object.defineProperty(r,o,{enumerable:!0,get:a[o]});let s=e.r(90809),n=e.r(43476),l=s._(e.r(71645)),i=e.r(95057),c=e.r(8372),d=e.r(18581),u=e.r(18967),h=e.r(5550);e.r(33525);let p=e.r(88540),f=e.r(91949),m=e.r(73668),g=e.r(9396);function y(t){var r,a;let o,s,y,[x,j]=(0,l.useOptimistic)(f.IDLE_LINK_STATUS),v=(0,l.useRef)(null),{href:k,as:N,children:S,prefetch:P=null,passHref:T,replace:w,shallow:$,scroll:C,onClick:O,onMouseEnter:E,onTouchStart:L,legacyBehavior:_=!1,onNavigate:A,transitionTypes:I,ref:R,unstable_dynamicOnHover:B,...U}=t;o=S,_&&("string"==typeof o||"number"==typeof o)&&(o=(0,n.jsx)("a",{children:o}));let M=l.default.useContext(c.AppRouterContext),D=!1!==P,z=!1!==P?null===(a=P)||"auto"===a?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,F="string"==typeof(r=N||k)?r:(0,i.formatUrl)(r);if(_){if(o?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});s=l.default.Children.only(o)}let K=_?s&&"object"==typeof s&&s.ref:R,X=l.default.useCallback(e=>(null!==M&&(v.current=(0,f.mountLinkInstance)(e,F,M,z,D,j)),()=>{v.current&&((0,f.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,f.unmountPrefetchableInstance)(e)}),[D,F,M,z,j]),W={ref:(0,d.useMergedRef)(X,K),onClick(t){_||"function"!=typeof O||O(t),_&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(t),!M||t.defaultPrevented||function(t,r,a,o,s,n,i){if("u">typeof window){let c,{nodeName:d}=t.currentTarget;if("A"===d.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),n){let e=!1;if(n({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);l.default.startTransition(()=>{u(r,o?"replace":"push",!1===s?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,a.current,i)})}}(t,F,v,w,C,A,I)},onMouseEnter(e){_||"function"!=typeof E||E(e),_&&s.props&&"function"==typeof s.props.onMouseEnter&&s.props.onMouseEnter(e),M&&D&&(0,f.onNavigationIntent)(e.currentTarget,!0===B)},onTouchStart:function(e){_||"function"!=typeof L||L(e),_&&s.props&&"function"==typeof s.props.onTouchStart&&s.props.onTouchStart(e),M&&D&&(0,f.onNavigationIntent)(e.currentTarget,!0===B)}};return(0,u.isAbsoluteUrl)(F)?W.href=F:_&&!T&&("a"!==s.type||"href"in s.props)||(W.href=(0,h.addBasePath)(F)),y=_?l.default.cloneElement(s,W):(0,n.jsx)("a",{...U,...W,children:o}),(0,n.jsx)(b.Provider,{value:x,children:y})}e.r(84508);let b=(0,l.createContext)(f.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},92161,75254,37727,e=>{"use strict";var t=e.i(71645);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,t.forwardRef)(({color:e="currentColor",size:o=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:l="",children:i,iconNode:c,...d},u)=>(0,t.createElement)("svg",{ref:u,...a,width:o,height:o,stroke:e,strokeWidth:n?24*Number(s)/Number(o):s,className:r("lucide",l),...d},[...c.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(i)?i:[i]])),s=(e,a)=>{let s=(0,t.forwardRef)(({className:s,...n},l)=>(0,t.createElement)(o,{ref:l,iconNode:a,className:r(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,s),...n}));return s.displayName=`${e}`,s};e.s(["default",0,s],75254);let n=s("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);e.s(["Menu",0,n],92161);let l=s("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
1],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,l],37727)},3470,e=>{"use strict";var t=e.i(43476),r=e.i(22016),a=e.i(18566),o=e.i(71645),s=e.i(23543),n=e.i(92161),l=e.i(37727),i=e.i(75254);let c=(0,i.default)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]),d=(0,i.default)("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);var u=e.i(95766);e.s(["default",0,function({isAuthenticated:e,user:i}){let h=(0,a.useRouter)(),{getCartItemCount:p}=(0,s.useCart)(),[f,m]=(0,o.useState)(!1),g=p(),y=()=>{localStorage.removeItem("user"),window.location.reload()};return(0,t.jsxs)("header",{className:"header",children:[(0,t.jsxs)("div",{className:"header-container",children:[(0,t.jsx)("div",{className:"header-logo",children:(0,t.jsx)(r.default,{href:"/",className:"logo-link",onClick:()=>m(!1),children:(0,t.jsx)("span",{className:"logo-text",children:u.default.siteName})})}),(0,t.jsxs)("nav",{className:`header-nav ${f?"open":""}`,children:[(0,t.jsx)(r.default,{href:"/",className:"nav-link",onClick:()=>m(!1),children:"Home"}),(0,t.jsx)(r.default,{href:"/books",className:"nav-link",onClick:()=>m(!1),children:"Browse Books"}),(0,t.jsx)(r.default,{href:"/blog",className:"nav-link",onClick:()=>m(!1),children:"Blog"}),(0,t.jsx)(r.default,{href:"/about",className:"nav-link",onClick:()=>m(!1),children:"About"}),(0,t.jsx)("div",{className:"mobile-nav-actions",children:e&&i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"user-info-mobile",children:(0,t.jsx)("span",{className:"user-name-mobile",children:i.name})}),(0,t.jsxs)("button",{className:"btn-logout-mobile",onClick:()=>{y(),m(!1)},children:[(0,t.jsx)(c,{size:18}),(0,t.jsx)("span",{children:"Logout"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{href:"/login",className:"btn-login-mobile",onClick:()=>m(!1),children:"Login"}),(0,t.jsx)(r.default,{href:"/register",className:"btn-register-mobile",onClick:()=>m(!1),children:"Sign Up"})]})})]}),(0,t.jsxs)("div",{className:"header-actions",children:[(0,t.jsxs)("form",{className:"header-search desktop-only",onSubmit:e=>{e.preventDefault(),h.push(`/books?search=${e.target.elements.search.value}`)},children:[(0,t.jsx)("input",{type:"text",name:"search",placeholder:"Search for books or authors...",className:"header-search-input"}),(0,t.jsx)("button",{type:"submit",className:"header-search-btn",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,t.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})})]}),(0,t.jsxs)(r.default,{href:"/cart",id:"cart-icon",className:"cart-link",onClick:()=>m(!1),children:[(0,t.jsx)(d,{size:20}),g>0&&(0,t.jsx)("span",{className:"cart-badge",children:g})]}),e&&i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"user-info desktop-only",children:(0,t.jsx)("span",{className:"user-name",children:i.name})}),(0,t.jsxs)("button",{className:"btn-logout desktop-only",onClick:y,children:[(0,t.jsx)(c,{size:18}),(0,t.jsx)("span",{children:"Logout"})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.default,{href:"/login",className:"btn-login desktop-only",children:"Login"}),(0,t.jsx)(r.default,{href:"/register",className:"btn-register desktop-only",children:"Sign Up"})]})]}),(0,t.jsx)("button",{className:"menu-toggle",onClick:()=>m(!f),"aria-label":"Toggle menu","aria-expanded":f,children:f?(0,t.jsx)(l.X,{size:24}):(0,t.jsx)(n.Menu,{size:24})})]}),f&&(0,t.jsx)("div",{className:"menu-overlay",onClick:()=>m(!1),"aria-hidden":"true"})]})}],3470)},46227,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(22016),o=e.i(3470),s=e.i(94449),n=e.i(4581),l=e.i(95766);e.s(["default",0,function(){let{isAuthenticated:e,user:i}=(0,s.useAuth)(),[c,d]=(0,r.useState)([]),[u,h]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async()=>{try{h(!0);let e=await n.api.blog.getAll();d(e)}catch(e){console.error("Error fetching blog posts:",e)}finally{h(!1)}})()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.default,{isAuthenticated:e,user:i}),(0,t.jsxs)("main",{className:"container",style:{padding:"60px 0"},children:[(0,t.jsx)("section",{className:"hero-modern",style:{minHeight:"auto",padding:"40px 24px"},children:(0,t.jsxs)("div",{className:"hero-content-modern",children:[(0,t.jsx)("div",{className:"hero-badge",children:"Blog"}),(0,t.jsxs)("h1",{className:"hero-title-modern",children:["Insights, updates,",(0,t.jsx)("span",{className:"hero-highlight",children:" and reading tips"})]}),(0,t.jsxs)("p",{className:"hero-subtitle-modern",children:["Stories from the ",l.default.siteName," team about books, reading culture, product updates, and more."]})]})}),(0,t.jsx)("section",{style:{padding:"40px 24px 0"},children:u?(0,t.jsx)("p",{children:"Loading posts..."}):0===c.length?(0,t.jsx)("p",{children:"No blog posts have been published yet."}):(0,t.jsx)("div",{className:"featured-grid",children:c.map(e=>(0,t.jsx)("article",{className:"featured-card",children:(0,t.jsxs)("div",{className:"featured-card-content",children:[(0,t.jsx)("div",{className:"featured-badge",children:new Date(e.publishedAt).toLocaleDateString()}),(0,t.jsx)("h2",{className:"featured-card-title",children:(0,t.jsx)(a.default,{href:`/blog/${e.slug}`,children:e.title})}),(0,t.jsx)("p",{className:"featured-card-author",children:e.author||l.default.siteName}),(0,t.jsx)("p",{className:"featured-card-description",children:e.excerpt||(e.content?`${e.content.substring(0,150)}...`:"")}),(0,t.jsx)("div",{className:"featured-card-footer",children:(0,t.jsx)(a.default,{href:`/blog/${e.slug}`,className:"featured-card-link",children:"Read Article"})})]})},e.id))})})]})]})}])}]);

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.