1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7714],{10703:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/footer-tools",function(){return o(39973)}])},39973:function(e,t,o){"use strict";o.r(t),o.d(t,{__N_SSP:function(){return x},default:function(){return p}});var l=o(85893),n=o(67294),i=o(9008),s=o.n(i),r=o(41664),a=o.n(r),d=o(33299),c=o(43034),x=!0;function p(e){let{adminEmail:t}=e,[o,i]=(0,n.useState)([]),[r,x]=(0,n.useState)([]),[p,f]=(0,n.useState)(!0),[g,m]=(0,n.useState)(!1),[h,y]=(0,n.useState)({type:"",text:""}),[j,b]=(0,n.useState)(""),[v,C]=(0,n.useState)("All");(0,n.useEffect)(()=>{let e=async()=>{try{let e=await fetch("/api/footer-tools-config"),t=await e.json();t.success&&(i(t.data.column1||[]),x(t.data.column2||[]))}catch(e){console.error("Error loading config:",e),y({type:"error",text:"Failed to load current configuration"})}finally{f(!1)}};e()},[]);let S=c.w.filter(e=>{if(!e)return!1;let t=e.title.toLowerCase().includes(j.toLowerCase()),o="All"===v||e.category===v;return t&&o}),T=e=>o.some(t=>t.slug===e)||r.some(t=>t.slug===e),k=(e,t)=>{if(T(e.slug)){y({type:"error",text:"This tool is already selected"}),setTimeout(()=>y({type:"",text:""}),3e3);return}let l={title:e.title,slug:e.slug};if(1===t){if(o.length>=10){y({type:"error",text:"Column 1 already has 10 tools (maximum)"}),setTimeout(()=>y({type:"",text:""}),3e3);return}i([...o,l])}else{if(r.length>=10){y({type:"error",text:"Column 2 already has 10 tools (maximum)"}),setTimeout(()=>y({type:"",text:""}),3e3);return}x([...r,l])}},B=(e,t)=>{1===t?i(o.filter(t=>t.slug!==e)):x(r.filter(t=>t.slug!==e))},w=(e,t)=>{if(1===t){if(r.length>=10){y({type:"error",text:"Column 2 already has 10 tools (maximum)"}),setTimeout(()=>y({type:"",text:""}),3e3);return}i(o.filter(t=>t.slug!==e.slug)),x([...r,e])}else{if(o.length>=10){y({type:"error",text:"Column 1 already has 10 tools (maximum)"}),setTimeout(()=>y({type:"",text:""}),3e3);return}x(r.filter(t=>t.slug!==e.slug)),i([...o,e])}},A=async()=>{m(!0),y({type:"",text:""});try{let e=await fetch("/api/footer-tools-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({column1:o,column2:r})}),t=await e.json();t.success?y({type:"success",text:t.message}):y({type:"error",text:t.error||"Failed to save configuration"})}catch(e){console.error("Error saving config:",e),y({type:"error",text:"Failed to save configuration"})}finally{m(!1)}};return p?(0,l.jsx)("div",{style:u.container,children:(0,l.jsx)("div",{style:u.loading,children:"Loading..."})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s(),{children:[(0,l.jsx)("title",{children:"Admin - Footer Free AI Tools"}),(0,l.jsx)("meta",{name:"robots",content:"noindex, nofollow, noarchive, nosnippet, noimageindex"}),(0,l.jsx)("meta",{name:"googlebot",content:"noindex, nofollow"}),(0,l.jsx)("meta",{name:"bingbot",content:"noindex, nofollow"})]}),(0,l.jsxs)("div",{style:u.container,children:[(0,l.jsxs)("div",{style:u.header,children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{style:u.title,children:"Footer Free AI Tools Manager"}),(0,l.jsxs)("p",{style:u.subtitle,children:["Signed in as ",(0,l.jsx)("strong",{children:t}),". Select up to ",10," tools for each column in the footer. Total tools available: ",c.w.filter(Boolean).length]}),(0,l.jsx)("p",{style:{...u.subtitle,marginTop:"8px",marginBottom:0},children:(0,l.jsx)(a(),{href:"/admin/users/",style:{color:"#1976D2",textDecoration:"none"},children:"Users & bookmarks dashboard â"})})]}),(0,l.jsx)("button",{type:"button",onClick:()=>(0,d.signOut)({callbackUrl:"/"}),style:u.logoutButton,children:"Sign out"})]}),h.text&&(0,l.jsx)("div",{style:{...u.message,backgroundColor:"success"===h.type?"#d4edda":"#f8d7da",color:"success"===h.type?"#155724":"#721c24"},children:h.text}),(0,l.jsxs)("div",{style:u.filters,children:[(0,l.jsx)("input",{type:"text",placeholder:"Search tools...",value:j,onChange:e=>b(e.target.value),style:u.searchInput}),(0,l.jsxs)("select",{value:v,onChange:e=>C(e.target.value),style:u.select,children:[(0,l.jsx)("option",{value:"All",children:"All Categories"}),c.R.map(e=>(0,l.jsx)("option",{value:e,children:e},e))]})]}),(0,l.jsxs)("div",{style:u.mainContent,children:[(0,l.jsxs)("div",{style:u.availableTools,children:[(0,l.jsxs)("h2",{style:u.sectionTitle,children:["Available Tools (",S.length,")"]}),(0,l.jsx)("div",{style:u.toolsList,children:S.map(e=>{if(!e)return null;let t=T(e.slug);return(0,l.jsxs)("div",{style:{...u.toolItem,opacity:t?.5:1,backgroundColor:t?"#f0f0f0":"#fff"},children:[(0,l.jsxs)("div",{style:u.toolInfo,children:[(0,l.jsx)("span",{style:u.toolTitle,children:e.title}),(0,l.jsx)("span",{style:u.toolCategory,children:e.category})]}),!t&&(0,l.jsxs)("div",{style:u.toolActions,children:[(0,l.jsx)("button",{onClick:()=>k(e,1),style:u.addButton,title:"Add to Column 1",children:"+Col 1"}),(0,l.jsx)("button",{onClick:()=>k(e,2),style:u.addButton,title:"Add to Column 2",children:"+Col 2"})]}),t&&(0,l.jsx)("span",{style:u.selectedBadge,children:"Selected"})]},e.slug)})})]}),(0,l.jsxs)("div",{style:u.selectedTools,children:[(0,l.jsxs)("div",{style:u.column,children:[(0,l.jsxs)("h2",{style:u.sectionTitle,children:["Column 1 (",o.length,"/",10,")"]}),(0,l.jsxs)("div",{style:u.columnList,children:[o.map((e,t)=>(0,l.jsxs)("div",{style:u.selectedItem,children:[(0,l.jsxs)("span",{style:u.itemIndex,children:[t+1,"."]}),(0,l.jsx)("span",{style:u.itemTitle,children:e.title}),(0,l.jsxs)("div",{style:u.itemActions,children:[(0,l.jsx)("button",{onClick:()=>w(e,1),style:u.moveButton,title:"Move to Column 2",children:"â"}),(0,l.jsx)("button",{onClick:()=>B(e.slug,1),style:u.removeButton,title:"Remove",children:"\xd7"})]})]},e.slug)),0===o.length&&(0,l.jsx)("p",{style:u.emptyMessage,children:"No tools selected"})]})]}),(0,l.jsxs)("div",{style:u.column,children:[(0,l.jsxs)("h2",{style:u.sectionTitle,children:["Column 2 (",r.length,"/",10,")"]}),(0,l.jsxs)("div",{style:u.columnList,children:[r.map((e,t)=>(0,l.jsxs)("div",{style:u.selectedItem,children:[(0,l.jsxs)("span",{style:u.itemIndex,children:[t+1,"."]}),(0,l.jsx)("span",{style:u.itemTitle,children:e.title}),(0,l.jsxs)("div",{style:u.itemActions,children:[(0,l.jsx)("button",{onClick:()=>w(e,2),style:u.moveButton,title:"Move to Column 1",children:"â"}),(0,l.jsx)("button",{onClick:()=>B(e.slug,2),style:u.removeButton,title:"Remove",children:"\xd7"})]})]},e.slug)),0===r.length&&(0,l.jsx)("p",{style:u.emptyMessage,children:"No tools selected"})]})]})]})]}),(0,l.jsx)("div",{style:u.saveSection,children:(0,l.jsx)("button",{onClick:A,disabled:g,style:u.saveButton,children:g?"Saving...":"Save Configuration"})})]})]})}let u={container:{maxWidth:"1400px",margin:"0 auto",padding:"20px",fontFamily:"system-ui, -apple-system, sans-serif"},header:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"20px",flexWrap:"wrap",gap:"16px"},logoutButton:{padding:"10px 20px",backgroundColor:"#dc3545",color:"#fff",border:"none",borderRadius:"8px",fontSize:"14px",fontWeight:"500",cursor:"pointer"},loading:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",fontSize:"18px"},title:{fontSize:"28px",fontWeight:"700",marginBottom:"8px",color:"#1a1a1a"},subtitle:{color:"#666",marginBottom:"0"},message:{padding:"12px 16px",borderRadius:"8px",marginBottom:"20px",fontWeight:"500"},filters:{display:"flex",gap:"12px",marginBottom:"20px",flexWrap:"wrap"},searchInput:{padding:"10px 16px",border:"1px solid #ddd",borderRadius:"8px",fontSize:"14px",minWidth:"250px"},select:{padding:"10px 16px",border:"1px solid #ddd",borderRadius:"8px",fontSize:"14px",backgroundColor:"#fff",cursor:"pointer"},mainContent:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"24px"},availableTools:{backgroundColor:"#f9f9f9",borderRadius:"12px",padding:"20px"},sectionTitle:{fontSize:"18px",fontWeight:"600",marginBottom:"16
1px",color:"#333"},toolsList:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"600px",overflowY:"auto"},toolItem:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",backgroundColor:"#fff",borderRadius:"8px",border:"1px solid #eee"},toolInfo:{display:"flex",flexDirection:"column",gap:"4px"},toolTitle:{fontWeight:"500",color:"#333"},toolCategory:{fontSize:"12px",color:"#888"},toolActions:{display:"flex",gap:"8px"},addButton:{padding:"6px 12px",backgroundColor:"#4CAF50",color:"#fff",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"12px",fontWeight:"500"},selectedBadge:{fontSize:"12px",color:"#888",fontStyle:"italic"},selectedTools:{display:"flex",flexDirection:"column",gap:"20px"},column:{backgroundColor:"#fff",borderRadius:"12px",padding:"20px",border:"2px solid #e0e0e0"},columnList:{display:"flex",flexDirection:"column",gap:"8px",minHeight:"200px"},selectedItem:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 12px",backgroundColor:"#f5f5f5",borderRadius:"6px"},itemIndex:{color:"#888",fontWeight:"500",minWidth:"24px"},itemTitle:{flex:1,fontWeight:"500",color:"#333"},itemActions:{display:"flex",gap:"6px"},moveButton:{padding:"4px 10px",backgroundColor:"#2196F3",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"14px"},removeButton:{padding:"4px 10px",backgroundColor:"#f44336",color:"#fff",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"14px"},emptyMessage:{color:"#999",textAlign:"center",padding:"20px",fontStyle:"italic"},saveSection:{marginTop:"24px",textAlign:"center"},saveButton:{padding:"14px 40px",backgroundColor:"#1976D2",color:"#fff",border:"none",borderRadius:"8px",fontSize:"16px",fontWeight:"600",cursor:"pointer"}}}},function(e){e.O(0,[3996,3034,9774,2888,179],function(){return e(e.s=10703)}),_N_E=e.O()}]);
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.