1import{K as k,r as m,j as e,v as x,q as h}from"./index-42OYDF60.js";import{u as w}from"./useMutation-TEeOEsok.js";import{a as E}from"./usePageSeo-BJOptz5i.js";import{B as o}from"./button-EfpS49lo.js";import{I as l}from"./input-D0IjS33j.js";import{T as L}from"./textarea-D06DcQsJ.js";import{L as i}from"./label-BNvpn1fK.js";import{S as O}from"./switch-CrYu0Slx.js";import{C as q}from"./card-4WvPeLS0.js";import{e as D,f as P,i as T,j as I,k as K}from"./dialog-BPqr1XfL.js";import{P as Q}from"./plus-UlO-Lz9K.js";import{S as R}from"./search-C7Y2SfZe.js";import{E as A}from"./external-link-CXhpZ2p_.js";import{P as F}from"./pencil-DccT4vhR.js";import{T as U}from"./trash-2-B3_ksNI2.js";import"./index-CXOUwLiy.js";const z={path:"",label:"",title:"",description:"",keywords:"",canonical:"",og_image:"",og_type:"website",noindex:!1},ie=()=>{var v,N;const c=k(),{data:C=[],isLoading:u}=E(),[d,_]=m.useState(""),[a,t]=m.useState(null),[p,g]=m.useState(!1),j=w({mutationFn:async s=>{var y,b;const n={path:(y=s.path)==null?void 0:y.trim(),label:((b=s.label)==null?void 0:b.trim())||s.path,title:s.title||null,description:s.description||null,keywords:s.keywords||null,canonical:s.canonical||null,og_image:s.og_image||null,og_type:s.og_type||"website",noindex:!!s.noindex};if(s.id){const{error:r}=await x.from("page_seo").update(n).eq("id",s.id);if(r)throw r}else{const{error:r}=await x.from("page_seo").insert(n);if(r)throw r}},onSuccess:()=>{c.invalidateQueries({queryKey:["page_seo_all"]}),c.invalidateQueries({queryKey:["page_seo"]}),h.success("SEO সà¦à¦°à¦à§à¦·à¦£ হয়à§à¦à§"),t(null)},onError:s=>h.error(s.message||"সà¦à¦°à¦à§à¦·à¦£à§ সমসà§à¦¯à¦¾")}),S=w({mutationFn:async s=>{const{error:n}=await x.from("page_seo").delete().eq("id",s);if(n)throw n},onSuccess:()=>{c.invalidateQueries({queryKey:["page_seo_all"]}),h.success("মà§à¦à§ ফà§à¦²à¦¾ হয়à§à¦à§")}}),f=C.filter(s=>!d||s.path.toLowerCase().includes(d.toLowerCase())||s.label.toLowerCase().includes(d.toLowerCase()));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"SEO মà§à¦¯à¦¾à¦¨à§à¦à¦®à§à¦¨à§à¦"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"পà§à¦°à¦¤à¦¿à¦à¦¿ পà§à¦à§à¦° SEO à¦à¦¾à¦à¦à§à¦², ডà§à¦¸à¦à§à¦°à¦¿à¦ªà¦¶à¦¨, keywords, og-image ঠnoindex à¦à¦à¦¾à¦¨ থà§à¦à§ সমà§à¦ªà§à¦°à§à¦£ à¦à¦¾à¦¸à§à¦à¦®à¦¾à¦à¦ à¦à¦°à§à¦¨à¥¤"})]}),e.jsxs(o,{onClick:()=>{t({...z}),g(!0)},children:[e.jsx(Q,{className:"h-4 w-4"})," নতà§à¦¨ পà§à¦ SEO"]})]}),e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(R,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(l,{value:d,onChange:s=>_(s.target.value),placeholder:"পà§à¦ পাথ বা লà§à¦¬à§à¦² à¦à§à¦à¦à§à¦¨...",className:"pl-9"})]}),e.jsxs("div",{className:"grid gap-3",children:[u&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"লà§à¦¡ হà¦à§à¦à§..."}),f.map(s=>e.jsx(q,{className:"p-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-md bg-primary/10 px-2 py-0.5 text-xs font-mono text-primary",children:s.path}),e.jsx("span",{className:"text-sm font-semibold",children:s.label}),s.noindex&&e.jsx("span",{className:"rounded bg-destructive/10 px-2 py-0.5 text-[10px] font-bold text-destructive",children:"NOINDEX"}),e.jsx("a",{href:s.path,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground",children:e.jsx(A,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"mt-1 truncate text-sm font-medium",children:s.title||e.jsx("span",{className:"text-muted-foreground italic",children:"no title"})}),e.jsx("div",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.description})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(o,{size:"sm",variant:"outline",onClick:()=>{t(s),g(!1)},children:[e.jsx(F,{className:"h-3.5 w-3.5"})," à¦à¦¡à¦¿à¦"]}),e.jsx(o,{size:"sm",variant:"outline",onClick:()=>{confirm("মà§à¦à¦¬à§à¦¨?")&&S.mutate(s.id)},children:e.jsx(U,{className:"h-3.5 w-3.5"})})]})]})},s.id)),!u&&f.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"à¦à§à¦¨ à¦à¦¨à§à¦à§à¦°à¦¿ পাà¦à¦¯à¦¼à¦¾ যায়নি।"})]}),e.jsx(D,{open:!!a,onOpenChange:s=>!s&&t(null),children:e.jsxs(P,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsx(T,{children:e.jsx(I,{children:p?"নতà§à¦¨ পà§à¦ SEO":`SEO à¦à¦¡à¦¿à¦ â ${a==null?void 0:a.path}`})}),a&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(i,{children:"পাথ (URL)"}),e.jsx(l,{value:a.path||"",onChange:s=>t({...a,path:s.target.value}),placeholder:"/about",disabled:!p})]}),e.jsxs("div",{children:[e.jsx(i,{children:"লà§à¦¬à§à¦²"}),e.jsx(l,{value:a.label||"",onChange:s=>t({...a,label:s.target.value}),placeholder:"About"})]})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["à¦à¦¾à¦à¦à§à¦² ",e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(recommended < 60 chars â ",((v=a.title)==null?void 0:v.length)||0,")"]})]}),e.jsx(l,{value:a.title||"",onChange:s=>t({...a,title:s.target.value})})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["মà§à¦à¦¾ ডà§à¦¸à¦à§à¦°à¦¿à¦ªà¦¶à¦¨ ",e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(recommended < 160 chars â ",((N=a.description)==null?void 0:N.length)||0,")"]})]}),e.jsx(L,{rows:3,value:a.description||"",onChange:s=>t({...a,description:s.target.value})})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["Keywords ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(à¦à¦®à¦¾ দিয়ৠà¦à¦²à¦¾à¦¦à¦¾)"})]}),e.jsx(l,{value:a.keywords||"",onChange:s=>t({...a,keywords:s.target.value}),placeholder:"telemedicine, doctor, bangladesh"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Canonical URL"}),e.jsx(l,{value:a.canonical||"",onChange:s=>t({...a,canonical:s.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{children:[e.jsx(i,{children:"OG Type"}),e.jsx(l,{value:a.og_type||"",onChange:s=>t({...a,og_type:s.target.value}),placeholder:"website"})]})]}),e.jsxs("div",{children:[e.jsxs(i,{children:["OG Image URL ",e.jsx("span",{className:"text-xs text-muted-foreground",children:"(1200Ã630 recommended)"})]}),e.jsx(l,{value:a.og_image||"",onChange:s=>t({...a,og_image:s.target.value}),placeholder:"https://..."}),a.og_image&&e.jsx("img",{src:a.og_image,alt:"og preview",className:"mt-2 max-h-40 rounded border"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold",children:"Noindex"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"à¦à¦ পà§à¦ সারà§à¦ à¦à¦à§à¦à¦¿à¦¨ থà§à¦à§ লà§à¦à¦¾à¦¨"})]}),e.jsx(O,{checked:!!a.noindex,onCheckedChange:s=>t({...a,noindex:s})})]})]}),e.jsxs(K,{children:[e.jsx(o,{variant:"outline",onClick:()=>t(null),children:"বাতিল"}),e.jsx(o,{onClick:()=>a&&j.mutate(a),disabled:j.isPending||!(a!=null&&a.path),children:"সà¦à¦°à¦à§à¦·à¦£"})]})]})})]})};export{ie 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.