PageSourceSearch

https://www.bagchee.com/static/js/8329.02a3bf45.chunk.js

js bagchee.com collected 2026-10-02 11:17:21 UTC 13,292 bytes, 3 lines download raw bytes

1/*! For license information please see 8329.02a3bf45.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[8329],{86(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},1360(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},2024(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},2754(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]])},3356(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]])},5815(e,t,a){a.d(t,{b:()=>r});const r=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Sheet1",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export";const s=await a.e(1238).then(a.bind(a,1238)),i=s.utils.json_to_sheet(e),o=s.utils.book_new();s.utils.book_append_sheet(o,i,t),s.writeFile(o,"".concat(r,"_").concat(Date.now(),".xlsx"))}},6533(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},7104(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},7991(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]])},8329(e,t,a){a.r(t),a.d(t,{default:()=>A});var r=a(9379),s=a(5043),i=a(2024),o=a(6533),d=a(9463),l=a(8326),n=a(3356),c=a(7991),h=a(7104),p=a(1360),x=a(2754),m=a(86),g=a(9292),b=a(9855),y=a(7874),u=a(3046
2),f=a(2339),w=a(5815),j=a(5003),v=a(579);const A=()=>{const e=(0,y.Zp)(),{confirm:t}=(0,j.S)(),[a,A]=(0,s.useState)([]),[N,k]=(0,s.useState)(!0),[M,C]=(0,s.useState)({page:1,limit:25,total:0}),[T,z]=(0,s.useState)({pageUrl:"",title:"",metaTitle:""}),D=(0,s.useCallback)(async()=>{k(!0);try{const e="https://www.bagchee.com/api",t=(0,r.A)({page:M.page,limit:M.limit},T),a=await u.A.get("".concat(e,"/meta-tags/list"),{params:t});a.data.status&&(A(a.data.data),C(e=>(0,r.A)((0,r.A)({},e),{},{total:a.data.total||0})))}catch(e){console.error("Fetch Error:",e),f.Ay.error("Failed to load meta tags")}finally{k(!1)}},[M.page,M.limit,T]);(0,s.useEffect)(()=>{D()},[D]);const S=e=>{z((0,r.A)((0,r.A)({},T),{},{[e.target.name]:e.target.value}))},E=e=>{"Enter"===e.key&&(C(e=>(0,r.A)((0,r.A)({},e),{},{page:1})),D())},F=()=>{C(e=>(0,r.A)((0,r.A)({},e),{},{page:1})),D()},U=async()=>{const e=f.Ay.loading("Generating report data...");try{const t="https://www.bagchee.com/api",a=(0,r.A)((0,r.A)({},T),{},{page:1,limit:1e5}),s=await u.A.get("".concat(t,"/meta-tags/list"),{params:a});return s.data.status&&s.data.data?(f.Ay.dismiss(e),s.data.data):[]}catch(t){return f.Ay.error("Failed to fetch report data",{id:e}),[]}},_=Math.ceil(M.total/M.limit),P=(M.page-1)*M.limit+1,H=Math.min(M.page*M.limit,M.total),L="w-full rounded-[4px] px-2 py-1.5 text-xs outline-none text-gray-700 font-montserrat shadow-inner focus:ring-2 focus:ring-blue-300 transition-all";return(0,v.jsxs)("div",{className:"bg-gray-50 min-h-screen p-4 md:p-6 font-body text-text-main",children:[(0,v.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4 mb-4",children:[(0,v.jsxs)("button",{onClick:()=>e("/admin/add-meta-tag"),className:"bg-[#f8f9fa] border border-gray-300 text-gray-700 hover:bg-white px-4 py-2 rounded shadow-sm flex items-center justify-center gap-2 font-montserrat font-bold text-xs uppercase transition-all active:scale-95",children:[(0,v.jsx)(p.A,{size:14,className:"text-red-600"})," Add Meta Tag"]}),(0,v.jsxs)("div",{className:"flex flex-wrap gap-2 w-full md:w-auto justify-end",children:[(0,v.jsxs)("button",{onClick:async()=>{const e=await U();if(!e.length)return;const t=e.map((e,t)=>({"#":t+1,Page:e.pageUrl,Title:e.title,"Meta Title":e.metaTitle}));await(0,w.b)(t,"MetaTags","MetaTags_List"),f.Ay.success("Export successful!")},className:"bg-[#f8f9fa] border border-gray-300 text-gray-700 px-4 py-1.5 rounded shadow-sm hover:bg-white flex items-center gap-2 text-xs font-montserrat font-bold transition-colors",children:[(0,v.jsx)(h.A,{size:14,className:"text-orange-500"})," Export"]}),(0,v.jsxs)("button",{onClick:async()=>{const e=await U();if(!e.length)return;const t=window.open("","","height=600,width=800");t.document.write("<html><head><title>Meta Tags List</title>"),t.document.write("<style>table{width:100%;border-collapse:collapse;font-family:sans-serif;} th,td{border:1px solid #ddd;padding:8px;text-align:left;font-size:12px;} th{background-color:#f2f2f2;}</style>"),t.document.write("</head><body>"),t.document.write("<h2>Meta Tags Report</h2>");let a="<table><thead><tr><th>#</th><th>Page</th><th>Title</th><th>Meta Title</th></tr></thead><tbody>";e.forEach((e,t)=>{a+="<tr>\n        <td>".concat(t+1,"</td>\n        <td>").concat(e.pageUrl,"</td>\n        <td>").concat(e.title,"</td>\n        <td>").concat(e.metaTitle,"</td>\n      </tr>")}),a+="</tbody></table></body></html>",t.document.write(a),t.document.close(),t.print()},className:"bg-[#f8f9fa] border border-gray-300 text-gray-700 px-4 py-1.5 rounded shadow-sm hover:bg-white flex items-center gap-2 text-xs font-montserrat font-bold transition-colors",children:[(0,v.jsx)(x.A,{size:14,className:"text-green-600"})," Print"]}),(0,v.jsx)("button",{onClick:()=>{z({pageUrl:"",title:"",metaTitle:""}),C(e=>(0,r.A)((0,r.A)({},e),{},{page:1})),setTimeout(()=>D(),0)},className:"bg-[#f8f9fa] border border-gray-300 text-gray-500 px-4 py-1.5 rounded shadow-sm hover:text-red-500 hover:border-red-200 flex items-center gap-2 text-xs font-montserrat font-bold transition-all",children:"Clear filters"}),(0,v.jsx)("div",{className:"relative flex items-center",children:(0,v.jsx)("button",{onClick:F,className:"bg-primary text-white p-2 rounded hover:bg-primary-hover transition-colors shadow-sm",children:(0,v.jsx)(g.A,{size:16})})})]})]}),(0,v.jsxs)("div",{className:"bg-white rounded border border-gray-200 overflow-hidden shadow-sm",children:[(0,v.jsx)("div",{className:"overflow-x-auto",children:(0,v.jsxs)("table",{className:"w-full min-w-[900px] border-collapse text-sm",children:[(0,v.jsxs)("thead",{children:[(0,v.jsxs)("tr",{className:"bg-primary text-white border-b border-white/10 font-montserrat font-bold text-[11px]",children:[(0,v.jsx)("th",{className:"p-3 text-center w-20 border-r border-white/20",children:"#"}),(0,v.jsx)("th",{className:"p-3 text-left border-r border-white/20",children:"Page"}),(0,v.jsx)("th",{className:"p-3 text-left border-r border-white/20",children:"Title"}),(0,v.jsx)("th",{className:"p-3 text-left border-r border-white/20",children:"Meta title"}),(0,v.jsx)("th",{className:"p-3 text-center w-24",children:"Actions"})]}),(0,v.jsxs)("tr",{className:"bg-primary border-b border-gray-200",children:[(0,v.jsx)("td",{className:"p-2 border-r border-white/20",children:(0,v.jsx)("div",{className:"flex justify-center",children:(0,v.jsx)("input",{type:"checkbox",className:"h-4 w-4 roun
2ded accent-white cursor-pointer opacity-50"})})}),(0,v.jsx)("td",{className:"p-2 border-r border-white/20",children:(0,v.jsx)("input",{name:"pageUrl",value:T.pageUrl,onChange:S,onKeyDown:E,className:L,placeholder:"Filter Page"})}),(0,v.jsx)("td",{className:"p-2 border-r border-white/20",children:(0,v.jsx)("input",{name:"title",value:T.title,onChange:S,onKeyDown:E,className:L,placeholder:"Filter Title"})}),(0,v.jsx)("td",{className:"p-2 border-r border-white/20",children:(0,v.jsx)("input",{name:"metaTitle",value:T.metaTitle,onChange:S,onKeyDown:E,className:L,placeholder:"Filter Meta Title"})}),(0,v.jsx)("td",{className:"p-2 text-center",children:(0,v.jsx)("button",{onClick:F,className:"text-white hover:rotate-180 transition-transform duration-500",children:(0,v.jsx)(m.A,{size:16})})})]})]}),(0,v.jsx)("tbody",{className:"divide-y divide-gray-100",children:N?(0,v.jsx)("tr",{children:(0,v.jsx)("td",{colSpan:"5",className:"p-10 text-center text-gray-500 font-bold",children:(0,v.jsxs)("div",{className:"flex justify-center items-center gap-2",children:[(0,v.jsx)(i.A,{className:"animate-spin text-primary"})," Loading Data..."]})})}):a.length>0?a.map((a,r)=>(0,v.jsxs)("tr",{className:"hover:bg-blue-50/30 transition-colors text-[13px] group",children:[(0,v.jsx)("td",{className:"p-3 border-r border-gray-100",children:(0,v.jsxs)("div",{className:"flex items-center gap-4 justify-center",children:[(0,v.jsx)("input",{type:"checkbox",className:"h-4 w-4 rounded accent-primary cursor-pointer border-gray-300"}),(0,v.jsx)("span",{className:"text-gray-500 text-xs font-mono",children:(M.page-1)*M.limit+r+1})]})}),(0,v.jsx)("td",{className:"p-3 border-r border-gray-100 text-gray-700 font-medium",children:a.pageUrl}),(0,v.jsx)("td",{className:"p-3 border-r border-gray-100 text-gray-600",children:a.title}),(0,v.jsx)("td",{className:"p-3 border-r border-gray-100 text-gray-600",children:a.metaTitle}),(0,v.jsx)("td",{className:"p-3 text-center",children:(0,v.jsxs)("div",{className:"flex justify-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,v.jsx)("button",{onClick:()=>e("/admin/edit-meta-tag/".concat(a.id)),className:"p-1.5 bg-gray-50 border border-gray-200 rounded text-gray-500 hover:bg-white hover:text-primary hover:border-primary transition-all shadow-sm",title:"Edit",children:(0,v.jsx)(o.A,{size:14})}),(0,v.jsx)("button",{onClick:()=>(async e=>{if(await t())try{const t="https://www.bagchee.com/api";(await u.A.delete("".concat(t,"/meta-tags/delete/").concat(e))).data.status&&(f.Ay.success("Deleted successfully!"),D())}catch(a){f.Ay.error("Delete failed")}})(a.id),className:"p-1.5 bg-gray-50 border border-gray-200 rounded text-gray-500 hover:bg-white hover:text-red-600 hover:border-red-600 transition-all shadow-sm",title:"Delete",children:(0,v.jsx)(b.A,{size:14})})]})})]},a.id)):(0,v.jsx)("tr",{children:(0,v.jsx)("td",{colSpan:"5",className:"p-10 text-center text-gray-400 italic font-montserrat",children:"No matching records found."})})})]})}),(0,v.jsxs)("div",{className:"p-4 bg-gray-50 border-t border-gray-200 flex flex-col md:flex-row justify-between items-center gap-4 font-montserrat",children:[(0,v.jsxs)("div",{className:"text-[11px] text-gray-500 flex items-center gap-2",children:[(0,v.jsx)("span",{className:"font-bold uppercase",children:"Show"}),(0,v.jsxs)("select",{value:M.limit,onChange:e=>C(t=>(0,r.A)((0,r.A)({},t),{},{limit:Number(e.target.value),page:1})),className:"border border-gray-300 rounded p-1 focus:border-primary outline-none bg-white",children:[(0,v.jsx)("option",{value:25,children:"25"}),(0,v.jsx)("option",{value:50,children:"50"}),(0,v.jsx)("option",{value:100,children:"100"})]}),(0,v.jsx)("span",{className:"font-bold uppercase",children:"entries"})]}),(0,v.jsxs)("div",{className:"text-[11px] font-bold text-gray-400 uppercase tracking-widest",children:["Displaying ",M.total>0?P:0," to ",H," of ",M.total," Items"]}),(0,v.jsxs)("div",{className:"flex items-center gap-1",children:[(0,v.jsx)("button",{onClick:()=>C(e=>(0,r.A)((0,r.A)({},e),{},{page:1})),disabled:1===M.page,className:"p-1.5 border border-gray-300 bg-white rounded text-gray-400 hover:text-primary disabled:opacity-50 transition-all",children:(0,v.jsx)(n.A,{size:16})}),(0,v.jsx)("button",{onClick:()=>C(e=>(0,r.A)((0,r.A)({},e),{},{page:Math.max(1,e.page-1)})),disabled:1===M.page,className:"p-1.5 border border-gray-300 bg-white rounded text-gray-400 hover:text-primary disabled:opacity-50 transition-all",children:(0,v.jsx)(d.A,{size:16})}),(0,v.jsx)("div",{className:"w-8 h-8 flex items-center justify-center bg-primary text-white text-xs font-bold rounded shadow-sm",children:M.page}),(0,v.jsx)("button",{onClick:()=>C(e=>(0,r.A)((0,r.A)({},e),{},{page:Math.min(_,e.page+1)})),disabled:M.page===_||0===_,className:"p-1.5 border border-gray-300 bg-white rounded text-gray-400 hover:text-primary disabled:opacity-50 transition-all",children:(0,v.jsx)(l.A,{size:16})}),(0,v.jsx)("button",{onClick:()=>C(e=>(0,r.A)((0,r.A)({},e),{},{page:_})),disabled:M.page===_||0===_,className:"p-1.5 border border-gray-300 bg-white rounded text-gray-400 hover:text-primary disabled:opacity-50 transition-all",children:(0,v.jsx)(c.A,{size:16})})]})]})]})]})}},9855(e,t,a){a.d(t,{A:()=>r});const r=(0,a(7784).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])}}]);
3//# sourceMappingURL=8329.02a3bf45.chunk.js.map

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.