/opt/canhelp/apps/web/.next/static/chunks/app/admin
NameSizeModeActions
page-e1bbbd0a7f93104a.js2782260644editdlrm
Edit: /opt/canhelp/apps/web/.next/static/chunks/app/admin/page-e1bbbd0a7f93104a.js (278226B)
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{1258:(e,t,a)=>{"use strict";function s(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,a){if(null==e?void 0:e.trim()){let a=null==t?void 0:t.trim();return a?"".concat(e.trim()," ").concat(a[0].toUpperCase(),"."):e.trim()}return s(a)}a.d(t,{E:()=>s,H:()=>l})},1592:(e,t,a)=>{"use strict";a.d(t,{CI:()=>n,Hh:()=>r,Jv:()=>l,wV:()=>i,yK:()=>s});let s=(0,a(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:n,signUp:r,useSession:i}=s},4017:(e,t,a)=>{"use strict";function s(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function l(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function n(e,t){return"el"===t&&e.descriptionEl?e.descriptionEl:"en"===t&&e.descriptionEn?e.descriptionEn:"ru"===t&&e.descriptionRu?e.descriptionRu:e.description}a.d(t,{$g:()=>l,GZ:()=>n,Oj:()=>s})},5940:(e,t,a)=>{"use strict";a.d(t,{Ez:()=>r,V:()=>n});var s=a(4568),l=a(7620);function n(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function r(e){let{icon:t,alt:a="",className:r,fallback:i="\uD83D\uDCE6"}=e,o=(t||"").trim(),[d,c]=(0,l.useState)(!1);(0,l.useEffect)(()=>{c(!1)},[o]);let m=(0,l.useMemo)(()=>n(o)?o.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(o):o:"",[o]),x="/category-icons/package.svg";return n(o)?d&&o!==x?(0,s.jsx)("img",{src:x,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):d&&o===x?(0,s.jsx)("span",{className:r,children:i}):(0,s.jsx)("img",{src:m,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):(0,s.jsx)("span",{className:r,children:o||i})}},6961:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(4568),l=a(7620),n=a(7541),r=a(9664),i=a.n(r),o=a(1592),d=a(9906),c=a(2982),m=a(1258),x=a(4017),u=a(5940);let g={registration_success:["userName","link","siteName","siteUrl"],email_verification:["userName","link","siteName","siteUrl"],password_reset:["userName","link","siteName","siteUrl"],new_offer:["userName","taskTitle","taskId","specialistName","price","link"],new_task:["userName","taskTitle","taskId","customerName","link"],offer_accepted:["userName","taskTitle","price","link"],new_message:["userName","senderName","preview","link"],offer_declined:["userName","taskTitle","taskId","link"],offer_other_accepted:["userName","taskTitle","taskId","link"],task_updated:["userName","taskTitle","taskId","link"],deadline_reminder:["userName","taskTitle","taskId","link"],task_archived:["userName","taskTitle","taskId","link"],referral_reward:["userName","days","planName","link"],plan_activated:["userName","planName","price","expiresAt","link"],plan_upgraded:["userName","oldPlanName","newPlanName","charged","expiresAt","link"],plan_downgrade_scheduled:["userName","currentPlanName","newPlanName","scheduledDate","link"],plan_downgrade_applied:["userName","planName","link"],plan_renewal_reminder:["userName","planName","amount","expiresAt","link"],plan_insufficient_funds:["userName","currentPlanName","requiredAmount","currentBalance","expiresAt","topUpLink"]},p=Array.from(new Set(Object.values(g).flat())),h=[{value:"/category-icons/repairs.svg",label:"Repairs & Construction"},{value:"/category-icons/repairs-alt-wrench.svg",label:"Repairs Alt: Wrench"},{value:"/category-icons/repairs-alt-hard-hat.svg",label:"Repairs Alt: Hard Hat"},{value:"/category-icons/cleaning.svg",label:"Cleaning"},{value:"/category-icons/cleaning-alt-broom.svg",label:"Cleaning Alt: Broom"},{value:"/category-icons/cleaning-alt-sparkles.svg",label:"Cleaning Alt: Sparkles"},{value:"/category-icons/moving.svg",label:"Moving & Transport"},{value:"/category-icons/moving-alt-bus.svg",label:"Moving Alt: Bus"},{value:"/category-icons/moving-alt-train.svg",label:"Moving Alt: Train"},{value:"/category-icons/tutoring.svg",label:"Tutoring & Education"},{value:"/category-icons/tutoring-alt-book-open.svg",label:"Tutoring Alt: Book Open"},{value:"/category-icons/tutoring-alt-notebook.svg",label:"Tutoring Alt: Notebook"},{value:"/category-icons/it.svg",label:"IT & Technology"},{value:"/category-icons/it-alt-monitor.svg",label:"IT Alt: Monitor"},{value:"/category-icons/it-alt-settings.svg",label:"IT Alt: Settings"},{value:"/category-icons/design.svg",label:"Design"},{value:"/category-icons/design-alt-brush.svg",label:"Design Alt: Brush"},{value:"/category-icons/design-alt-paintbrush.svg",label:"Design Alt: Paintbrush"},{value:"/category-icons/beauty.svg",label:"Beauty & Health"},{value:"/category-icons/beauty-alt-heart.svg",label:"Beauty Alt: Heart"},{value:"/category-icons/beauty-alt-stethoscope.svg",label:"Beauty Alt: Stethoscope"},{value:"/category-icons/tech-repair.svg",label:"Device Repair"},{value:"/category-icons/tech-repair-alt-smartphone.svg",label:"Device Repair Alt: Smartphone"},{value:"/category-icons/tech-repair-alt-wrench.svg",label:"Device Repair Alt: Wrench"},{value:"/category-icons/events.svg",label:"Events"},{value:"/category-icons/events-alt-calendar.svg",label:"Events Alt: Calendar"},{value:"/category-icons/events-alt-clock.svg",label:"Events Alt: Clock"},{value:"/category-icons/photo-video.svg",label:"Photo & Video"},{value:"/category-icons/photo-video-alt-image.svg",label:"Photo & Video Alt: Image"},{value:"/category-icons/photo-video-alt-video.svg",label:"Photo & Video Alt: Video"},{value:"/category-icons/pets.svg",label:"Pets"},{value:"/category-icons/pets-alt-dog.svg",label:"Pets Alt: Dog"},{value:"/category-icons/pets-alt-cat.svg",label:"Pets Alt: Cat"},{value:"/category-icons/auto.svg",label:"Automotive"},{value:"/category-icons/auto-alt-carfront.svg",label:"Automotive Alt: Car Front"},{value:"/category-icons/auto-alt-car.svg",label:"Automotive Alt: Car"},{value:"/category-icons/legal.svg",label:"Legal Services"},{value:"/category-icons/legal-alt-gavel.svg",label:"Legal Alt: Gavel"},{value:"/category-icons/legal-alt-landmark.svg",label:"Legal Alt: Landmark"},{value:"/category-icons/accounting.svg",label:"Accounting"},{value:"/category-icons/accounting-alt-receipt.svg",label:"Accounting Alt: Receipt"},{value:"/category-icons/accounting-alt-wallet.svg",label:"Accounting Alt: Wallet"},{value:"/category-icons/other.svg",label:"Other"},{value:"/category-icons/other-alt-briefcase.svg",label:"Other Alt: Briefcase"},{value:"/category-icons/other-alt-search.svg",label:"Other Alt: Search"}];function b(e,t){return e?"en"===t?e.namesEn||e.namesEl||e.slug||"":"ru"===t?e.namesRu||e.namesEl||e.slug||"":"uk"===t?e.namesUk||e.namesEl||e.slug||"":e.namesEl||e.namesEn||e.slug||"":""}function f(e,t){return e?"en"===t?e.nameEn||e.nameEl||e.slug||"":"ru"===t?e.nameRu||e.nameEl||e.slug||"":"uk"===t?e.nameUk||e.nameEl||e.slug||"":e.nameEl||e.nameEn||e.slug||"":""}function y(e){let{value:t,onChange:a,onUpload:l,uploading:n,error:r,presets:i}=e;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2",children:[(0,s.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-green-50",children:(0,s.jsx)(u.Ez,{icon:t,alt:"category icon",className:"h-9 w-9 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"})}),(0,s.jsx)("input",{value:t,onChange:e=>a(e.target.value),className:"flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0",placeholder:"/category-icons/package.svg"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(n?"border-gray-200 bg-gray-100 text-gray-400":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"),children:[n?"Uploading...":"Upload SVG",(0,s.jsx)("input",{type:"file",accept:".svg,image/svg+xml",className:"hidden",disabled:n,onChange:async e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];a&&(await l(a),e.target.value="")}})]}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"or choose from presets"})]}),(0,s.jsx)("p",{className:"text-[11px] text-gray-500",children:"Preset source: /public/category-icons/presets.json"}),r?(0,s.jsx)("p",{className:"text-xs text-red-600",children:r}):null,(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:i.map(e=>{let l=t===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:"flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(l?"border-green-500 bg-green-50 shadow-sm":"border-gray-200 bg-white hover:border-green-300 hover:bg-green-50"),"aria-label":e.label,title:e.label,children:[(0,s.jsx)(u.Ez,{icon:e.value,alt:e.label,className:"h-8 w-8 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"}),(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight",children:e.label})]},e.value)})})]})}function v(e){let{catRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,g]=(0,l.useState)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let h=t.filter(e=>!e.parentId),f=c.toLowerCase(),y=e=>{var t;return!c||b(e,a).toLowerCase().includes(f)||(null!=(t=e.slug)?t:"").toLowerCase().includes(f)};return(0,s.jsxs)("div",{className:"relative",ref:p,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700"),children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:"Поиск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),h.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=b(e,a),o=x===e.id,p=l.filter(e=>!n.includes(e.slug)&&y(e)),h=!n.includes(e.slug)&&y(e),f=l.length>0;return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800",onClick:()=>{f&&!c?g(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[e.icon?(0,s.jsx)(u.Ez,{icon:e.icon,alt:i,className:"h-5 w-5 shrink-0 object-contain text-sm leading-none",fallback:"\uD83D\uDCE6"}):null,(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),f&&!c?(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600",onClick:()=>{r(e.slug),d(!1),m("")},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:b(e,a)})]},e.id))]},e.id)})]})]})}function j(e){let{locRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let p=t.filter(e=>!e.parentId),h=c.toLowerCase(),b=e=>{var t;return!c||f(e,a).toLowerCase().includes(h)||(null!=(t=e.slug)?t:"").toLowerCase().includes(h)};return(0,s.jsxs)("div",{className:"relative",ref:g,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700"),children:[(0,s.jsxs)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:"Поиск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),p.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=f(e,a),o=x===e.id,g=l.length>0,p=l.filter(e=>!n.includes(e.slug)&&b(e)),h=!n.includes(e.slug)&&b(e);return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800",onClick:()=>{g&&!c?u(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"})}),(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),g&&!c?(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600",onClick:()=>{r(e.slug),d(!1),m("")},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:f(e,a)})]},e.id))]},e.id)})]})]})}function N(){var e,t,a,r,u,N,_,S,L,M,T,I,R,P,W,z,F,H,V,O,K,q,G,X,Y,J,$,Q,Z,ee,et,ea,es,el,en;let er=(0,n.useRouter)(),{data:ei,isPending:eo}=(0,o.wV)(),{t:ed,locale:ec}=(0,d.Y)(),[em,ex]=(0,l.useState)("stats"),[eu,eg]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eg(window.innerWidth<1024)},[]);let[ep,eh]=(0,l.useState)(null),[eb,ef]=(0,l.useState)([]),[ey,ev]=(0,l.useState)(1),[ej,eN]=(0,l.useState)(0),[ek,ew]=(0,l.useState)(""),[eC,e_]=(0,l.useState)(""),[eS,eL]=(0,l.useState)(""),[eE,eD]=(0,l.useState)([]),[eM,eA]=(0,l.useState)(1),[eB,eT]=(0,l.useState)(0),[eI,eU]=(0,l.useState)(""),[eR,eP]=(0,l.useState)(""),[eW,ez]=(0,l.useState)(""),[eF,eH]=(0,l.useState)([]),[eV,eO]=(0,l.useState)(1),[eK,eq]=(0,l.useState)(0),[eG,eX]=(0,l.useState)(0),[eY,eJ]=(0,l.useState)([]),[e$,eQ]=(0,l.useState)(1),[eZ,e0]=(0,l.useState)(0),[e1,e2]=(0,l.useState)(!1),[e4,e5]=(0,l.useState)(0),[e3,e6]=(0,l.useState)({}),[e7,e8]=(0,l.useState)({}),[e9,te]=(0,l.useState)(null),[tt,ta]=(0,l.useState)([]),[ts,tl]=(0,l.useState)(1),[tn,tr]=(0,l.useState)(0),[ti,to]=(0,l.useState)(""),[td,tc]=(0,l.useState)(""),[tm,tx]=(0,l.useState)(""),[tu,tg]=(0,l.useState)(""),[tp,th]=(0,l.useState)(null),[tb,tf]=(0,l.useState)(""),[ty,tv]=(0,l.useState)(!1),[tj,tN]=(0,l.useState)([]),[tk,tw]=(0,l.useState)(1),[tC,t_]=(0,l.useState)(0),[tS,tL]=(0,l.useState)([]),[tE,tD]=(0,l.useState)(0),[tM,tA]=(0,l.useState)(1),[tB,tT]=(0,l.useState)(""),[tI,tU]=(0,l.useState)(""),[tR,tP]=(0,l.useState)(""),[tW,tz]=(0,l.useState)(""),[tF,tH]=(0,l.useState)([]),[tV,tO]=(0,l.useState)([]),[tK,tq]=(0,l.useState)(0),[tG,tX]=(0,l.useState)(1),[tY,tJ]=(0,l.useState)(""),[t$,tQ]=(0,l.useState)(""),[tZ,t0]=(0,l.useState)(""),[t1,t2]=(0,l.useState)([]),[t4,t5]=(0,l.useState)("ai"),[t3,t6]=(0,l.useState)([]),[t7,t8]=(0,l.useState)(1),[t9,ae]=(0,l.useState)(0),[at,aa]=(0,l.useState)(""),[as,al]=(0,l.useState)([]),[an,ar]=(0,l.useState)(""),[ai,ao]=(0,l.useState)(""),[ad,ac]=(0,l.useState)([]),[am,ax]=(0,l.useState)([]),[au,ag]=(0,l.useState)([]),[ap,ah]=(0,l.useState)(0),[ab,af]=(0,l.useState)(1),[ay,av]=(0,l.useState)(""),[aj,aN]=(0,l.useState)(""),[ak,aw]=(0,l.useState)(!1),[aC,a_]=(0,l.useState)(!1),[aS,aL]=(0,l.useState)(null),[aE,aD]=(0,l.useState)(!1),[aM,aA]=(0,l.useState)(!1),[aB,aT]=(0,l.useState)("profile"),[aI,aU]=(0,l.useState)(null),[aR,aP]=(0,l.useState)(""),[aW,az]=(0,l.useState)([]),[aF,aH]=(0,l.useState)(!1),[aV,aO]=(0,l.useState)({}),[aK,aq]=(0,l.useState)({}),[aG,aX]=(0,l.useState)({}),[aY,aJ]=(0,l.useState)({}),[a$,aQ]=(0,l.useState)([]),[aZ,a0]=(0,l.useState)(null),[a1,a2]=(0,l.useState)(!1),[a4,a5]=(0,l.useState)([]),[a3,a6]=(0,l.useState)(null),[a7,a8]=(0,l.useState)(!1),[a9,se]=(0,l.useState)(new Set),[st,sa]=(0,l.useState)([]),[ss,sl]=(0,l.useState)(null),[sn,sr]=(0,l.useState)(!1),[si,so]=(0,l.useState)(new Set),[sd,sc]=(0,l.useState)(!1),[sm,sx]=(0,l.useState)(null),[su,sg]=(0,l.useState)(h),[sp,sh]=(0,l.useState)(new Set),[sb,sf]=(0,l.useState)({}),[sy,sv]=(0,l.useState)(new Set),[sj,sN]=(0,l.useState)(null),[sk,sw]=(0,l.useState)(!1),[sC,s_]=(0,l.useState)("general"),[sS,sL]=(0,l.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:"",showPricing:!0}),[sE,sD]=(0,l.useState)(!1),[sM,sA]=(0,l.useState)(!1),[sB,sT]=(0,l.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[sI,sU]=(0,l.useState)(!1),[sR,sP]=(0,l.useState)(!1),[sW,sz]=(0,l.useState)(!1),[sF,sH]=(0,l.useState)(null),[sV,sO]=(0,l.useState)({email_verification:{subject:"Подтвердите ваш email — {{siteName}}",body:""},registration_success:{subject:"Добро пожаловать в {{siteName}}!",body:""},password_reset:{subject:"Восстановление пароля — {{siteName}}",body:""},new_offer:{subject:"Новое предложение по вашей задаче \xab{{taskTitle}}\xbb",body:""},new_task:{subject:"Новая задача: {{taskTitle}}",body:""},offer_accepted:{subject:"Ваше предложение принято: {{taskTitle}}",body:'

Ваше предложение принято! \uD83C\uDF89

Привет, {{userName}}!

Заказчик принял ваше предложение на выполнение задачи:

{{taskTitle}}

Сумма: {{price}}€

Открыть чат →'},new_message:{subject:"Новое сообщение от {{senderName}}",body:'

Новое сообщение

Привет, {{userName}}!

Вам написал(а) {{senderName}}:

"{{preview}}"

Ответить →'},offer_declined:{subject:"Ваше предложение отклонено: {{taskTitle}}",body:'

Ваше предложение отклонено

Привет, {{userName}}!

К сожалению, заказчик отклонил ваше предложение на:

{{taskTitle}}

Найти другие заказы →'},offer_other_accepted:{subject:"Выбран другой исполнитель: {{taskTitle}}",body:'

Выбран другой исполнитель

Привет, {{userName}}!

Заказчик выбрал другого исполнителя для задания:

{{taskTitle}}

Найти другие заказы →'},task_updated:{subject:"Задание обновлено: {{taskTitle}}",body:'

Задание обновлено

Привет, {{userName}}!

Заказчик обновил детали задания:

{{taskTitle}}

Смотреть заказ →'},deadline_reminder:{subject:"Задание истекает завтра: {{taskTitle}}",body:'

Напоминание о дедлайне

Привет, {{userName}}!

Ваше задание истекает через 24 часа. Обновите дедлайн, иначе задание будет автоматически снято с публикации.

{{taskTitle}}

Редактировать задание →'},task_archived:{subject:"Задание снято с публикации: {{taskTitle}}",body:'

Задание переведено в черновик

Привет, {{userName}}!

Ваше задание истекло и было автоматически переведено в черновик. Обновите дедлайн, чтобы опубликовать его снова.

{{taskTitle}}

Редактировать задание →'},referral_reward:{subject:"Вы получили реферальную награду — {{siteName}}",body:'

Вы получили реферальную награду! \uD83C\uDF81

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →'},referral_reward_el:{subject:"Λάβατε ανταμοιβή παραπομπής — {{siteName}}",body:'

Λάβατε ανταμοιβή παραπομπής! \uD83C\uDF81

Γεια {{userName}},

Ένας φίλος εγγράφηκε χρησιμοποιώντας τον σύνδεσμο παραπομπής σας. Στον λογαριασμό σας προστέθηκαν {{days}} ημέρες πρόσβασης στο πλάνο {{planName}}!

+{{days}} ημέρες — {{planName}}

Δες τον λογαριασμό σου →'},referral_reward_en:{subject:"You received a referral reward — {{siteName}}",body:'

You received a referral reward! \uD83C\uDF81

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →'},referral_reward_ru:{subject:"Вы получили реферальную награду — {{siteName}}",body:'

Вы получили реферальную награду! \uD83C\uDF81

Привет, {{userName}}!

Друг зарегистрировался по вашей реферальной ссылке. На ваш аккаунт добавлено {{days}} дней доступа к плану {{planName}}!

+{{days}} дней — {{planName}}

Перейти к аккаунту →'}}),[sK,sq]=(0,l.useState)(null),[sG,sX]=(0,l.useState)("el"),[sY,sJ]=(0,l.useState)(!1),[s$,sQ]=(0,l.useState)(!1),[sZ,s0]=(0,l.useState)({merchantId:"",apiUser:"",apiPassword:"",environment:"test",confirmationUrl:"",cancelUrl:"",enabled:!1}),[s1,s2]=(0,l.useState)(!1),[s4,s5]=(0,l.useState)(!1),[s3,s6]=(0,l.useState)({enabled:!1,planId:"",days:"30"}),[s7,s8]=(0,l.useState)(!1),[s9,le]=(0,l.useState)(!1),[lt,la]=(0,l.useState)({maintenanceMode:!1,indexingEnabled:!0,headScripts:"",siteTitleEl:"",siteTitleEn:"",siteTitleRu:"",siteTitleUk:"",siteDescriptionEl:"",siteDescriptionEn:"",siteDescriptionRu:"",siteDescriptionUk:""}),[ls,ll]=(0,l.useState)(!1),[ln,lr]=(0,l.useState)(!1),[li,lo]=(0,l.useState)("el"),[ld,lc]=(0,l.useState)({telegram:"",instagram:"",facebook:"",twitter:"",youtube:"",tiktok:"",whatsapp:"",viber:""}),[lm,lx]=(0,l.useState)(!1),[lu,lg]=(0,l.useState)(!1),[lp,lh]=(0,l.useState)({botToken:"",adminChatId:"",channelIdEl:"",channelIdEn:"",channelIdRu:"",channelIdUk:"",notifyRegistrations:!1,postNewTasks:!1}),[lb,lf]=(0,l.useState)(!1),[ly,lv]=(0,l.useState)(!1),[lj,lN]=(0,l.useState)(!1),[lk,lw]=(0,l.useState)(!1),[lC,l_]=(0,l.useState)(null),[lS,lL]=(0,l.useState)(null),[lE,lD]=(0,l.useState)(null),[lM,lA]=(0,l.useState)({}),[lB,lT]=(0,l.useState)(!1),[lI,lU]=(0,l.useState)(null),[lR,lP]=(0,l.useState)(!1),[lW,lz]=(0,l.useState)(!1),[lF,lH]=(0,l.useState)([]),[lV,lO]=(0,l.useState)(!1),[lK,lq]=(0,l.useState)([]),[lG,lX]=(0,l.useState)(!1),[lY,lJ]=(0,l.useState)(null),[l$,lQ]=(0,l.useState)(null),[lZ,l0]=(0,l.useState)(null),[l1,l2]=(0,l.useState)(!1),l4=e=>{l0(e),l2(!1)},l5=e=>{l0(e),l2(!0)},[l3,l6]=(0,l.useState)(null),[l7,l8]=(0,l.useState)(!1),[l9,ne]=(0,l.useState)("uk"),[nt,na]=(0,l.useState)("el"),[ns,nl]=(0,l.useState)({}),[nn,nr]=(0,l.useState)(null),[ni,no]=(0,l.useState)(null),[nd,nc]=(0,l.useState)(null),[nm,nx]=(0,l.useState)(!1),[nu,ng]=(0,l.useState)(new Set),[np,nh]=(0,l.useState)("broadcast"),[nb,nf]=(0,l.useState)(""),[ny,nv]=(0,l.useState)(""),[nj,nN]=(0,l.useState)(""),[nk,nw]=(0,l.useState)("general"),[nC,n_]=(0,l.useState)(""),[nS,nL]=(0,l.useState)(!0),[nE,nD]=(0,l.useState)(!1),[nM,nA]=(0,l.useState)(null),[nB,nT]=(0,l.useState)(null),[nI,nU]=(0,l.useState)(!1),nR=!eo&&ei&&(null==(e=ei.user)?void 0:e.role)==="admin";async function nP(){if(ny.trim()){if("user"===np&&!nb.trim())return void nT("Укажите ID пользователя");nD(!0),nT(null),nA(null);try{let e={title:ny.trim(),body:nj.trim()||void 0,type:nk.trim()||void 0,referenceId:nC.trim()||void 0};if("broadcast"===np){let t=await c.V7({...e,onlyActive:nS});nA(t)}else{let t=await c.g1(nb.trim(),e);nA(t)}}catch(e){nT((null==e?void 0:e.message)||"Не удалось отправить push")}finally{nD(!1)}}}async function nW(e,t){let a=t?c.Wi:c.He,s=await a(e).catch(()=>null);s&&ef(t=>t.map(t=>t.id===e?s:t))}function nz(e,t){return e?"THIRD_PARTY_AUTH_ERROR"===e?"Ошибка APNs/Firebase iOS: проверьте Apple APNs Auth Key (.p8) и связку Firebase проекта для iOS-приложения":"UNREGISTERED"===e?"Токен устройства больше не валиден":"INVALID_ARGUMENT"===e?"Некорректный токен или payload":"REQUEST_FAILED"===e?t||"FCM request failed before response":t?"".concat(e,": ").concat(t):e:t||"FCM принял 0 сообщений"}async function nF(){if(aS){aD(!0);try{var e,t,a,s,l,n;let r=await c.wl(aS.id,{firstName:aS.firstName,lastName:aS.lastName,phone:aS.phone||null,bio:aS.bio||null,role:aS.role,planId:aS.planId||null,isActive:aS.isActive,locale:aS.locale,languages:null!=(e=aS.languages)?e:[],personalSiteSlug:aS.personalSiteSlug||null,showContactInfo:null!=(t=aS.showContactInfo)&&t,notifyNewTasks:null!=(a=aS.notifyNewTasks)&&a,notifMessages:null==(s=aS.notifMessages)||s,skills:null!=(l=aS.skills)?l:[],siteSettings:null!=(n=aS.siteSettings)?n:{}});await Promise.all(aW.map(e=>{var t,a,s;return c.oq(e.id,{title:e.title,description:e.description||null,skills:null!=(t=e.skills)?t:[],categories:null!=(a=e.categories)?a:[],locations:null!=(s=e.locations)?s:[],publicationStatus:e.publicationStatus,isActive:e.isActive}).catch(()=>null)})),ef(e=>e.map(e=>e.id===aS.id?r:e)),aL(null)}catch(e){}finally{aD(!1)}}}async function nH(){if(aS){aA(!0);try{let e=await c.uQ(aS.id);aL(t=>t?{...t,emailVerified:e.emailVerified}:t),ef(t=>t.map(t=>t.id===aS.id?{...t,emailVerified:e.emailVerified}:t))}catch(e){}finally{aA(!1)}}}async function nV(){if(!aS)return;let e=Number(aS.topUpAmount);if(e&&!(e<=0)){aw(!0);try{let t=await c.P0(aS.id,{amount:e,description:aS.topUpDescription||void 0});ef(e=>e.map(e=>e.id===aS.id?t.user:e)),aL(e=>e?{...e,...t.user,topUpAmount:"",topUpDescription:""}:e),"balances"===em&&c.g0({page:ab,userId:ay||void 0,kind:aj||void 0}).then(e=>{ag(e.data),ah(e.total)}).catch(()=>{})}catch(e){}finally{aw(!1)}}}async function nO(){if(!aS)return;let e=Number(aS.withdrawAmount);if(e&&!(e<=0)){a_(!0);try{let t=await c.hD(aS.id,{amount:e,description:aS.withdrawDescription||void 0});ef(e=>e.map(e=>e.id===aS.id?t.user:e)),aL(e=>e?{...e,...t.user,withdrawAmount:"",withdrawDescription:""}:e),"balances"===em&&c.g0({page:ab,userId:ay||void 0,kind:aj||void 0}).then(e=>{ag(e.data),ah(e.total)}).catch(()=>{})}catch(e){}finally{a_(!1)}}}async function nK(e){let t=aW.find(t=>t.id===e);if(t){aq(t=>({...t,[e]:!0}));try{var a,s,l;let n=await c.oq(e,{title:t.title,description:t.description||null,skills:null!=(a=t.skills)?a:[],categories:null!=(s=t.categories)?s:[],locations:null!=(l=t.locations)?l:[],publicationStatus:t.publicationStatus,isActive:t.isActive});az(t=>t.map(t=>t.id===e?n:t))}catch(e){}finally{aq(t=>({...t,[e]:!1}))}}}async function nq(e,t){let a=await c.oq(e,{publicationStatus:t,isActive:"active"===t}).catch(()=>null);a&&(eJ(t=>t.map(t=>t.id===e?a:t)),(null==aS?void 0:aS.id)===a.specialistId&&az(t=>t.map(t=>t.id===e?a:t)),c.z5(1,"pending").then(e=>eX(e.total)).catch(()=>{}),c.s_(1,"pending").then(e=>e5(e.total)).catch(()=>{}))}async function nG(e,t,a){let s=e3[t.id],l=e7[t.id];("map"!==a||s)&&("create"!==a||(null==l?void 0:l.trim()))&&(te(t.id),await c.M6(e,t.id,{action:a,..."map"===a?{categoryId:s}:{},..."create"===a?{slug:l.trim()}:{}}).catch(()=>null)&&eJ(n=>n.map(n=>{var r,i,o;return n.id===e?{...n,categorySuggestions:(null!=(i=n.categorySuggestions)?i:[]).filter(e=>e.id!==t.id),..."reject"!==a?{categories:[...new Set([...null!=(o=n.categories)?o:[],"map"===a?null==(r=st.find(e=>e.id===s))?void 0:r.slug:l.trim()])]}:{}}:n})),te(null))}async function nX(e){let t=await c.nf(e).catch(()=>null);if(t){let a=t.task||t;eD(t=>t.map(t=>(t.task||t).id===e?{...t,task:a}:t))}}async function nY(e,t){window.confirm("".concat(ed("admin.tasks.delete.confirm"),'\n"').concat(t,'"'))&&await c.GB(e).catch(()=>null)&&eD(t=>t.filter(t=>{var a;return((null==(a=t.task)?void 0:a.id)||t.id)!==e}))}async function nJ(e,t){let a=await c.eU(e,t).catch(()=>null);a&&eH(t=>t.map(t=>t.id===e?{...t,...a}:t))}function n$(e){a6({parentId:null!=e?e:null,slug:"",nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0,isActive:!0})}async function nQ(){if(a3){a8(!0);try{if(a3.id){let e=await c.Nt(a3.id,a3);a5(t=>t.map(t=>t.id===a3.id?e:t))}else{let e=await c.yJ({slug:a3.slug,nameEl:a3.nameEl,nameEn:a3.nameEn,nameRu:a3.nameRu,nameUk:a3.nameUk,parentId:a3.parentId,order:a3.order});a5(t=>[...t,e])}a6(null)}catch(e){}finally{a8(!1)}}}async function nZ(e,t){window.confirm("".concat(ed("admin.loc.delete.confirm"),'\n"').concat(t,'"'))&&await c.zR(e).catch(()=>null)&&a5(t=>t.filter(t=>t.id!==e))}function n0(e){sx(null),sl({parentId:null!=e?e:null,slug:"",icon:"/category-icons/package.svg",namesEl:"",namesEn:"",namesRu:"",namesUk:"",order:0,isActive:!0})}async function n1(e){if("image/svg+xml"!==e.type)return void sx("Only SVG files are allowed");sc(!0),sx(null);try{let t=new FormData;t.append("file",e);let a=await fetch("".concat("https://api.canhelp.gr","/api/uploads"),{method:"POST",credentials:"include",body:t});if(!a.ok){let e=await a.json().catch(()=>({error:"Upload failed"}));throw Error(e.error||"Upload failed")}let s=await a.json();sl(e=>e?{...e,icon:s.url}:e)}catch(e){sx((null==e?void 0:e.message)||"Upload failed")}finally{sc(!1)}}async function n2(){if(ss){sr(!0);try{if(ss.id){let e=await c.$7(ss.id,ss);sa(t=>t.map(t=>t.id===ss.id?e:t))}else{let e=await c.zZ({slug:ss.slug,icon:ss.icon,namesEl:ss.namesEl,namesEn:ss.namesEn,namesRu:ss.namesRu,namesUk:ss.namesUk,parentId:ss.parentId,order:ss.order});sa(t=>[...t,e])}sl(null)}catch(e){}finally{sr(!1)}}}async function n4(e,t){window.confirm("".concat(ed("admin.cat.delete.confirm"),'\n"').concat(t,'"'))&&await c.K7(e).catch(()=>null)&&sa(t=>t.filter(t=>t.id!==e))}async function n5(e){let t=e.id,a=e.slug;if(sh(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a}),!sb[a]){sv(e=>new Set(e).add(t));try{let e=await c.i_(a);sf(t=>({...t,[a]:e}))}catch(e){}finally{sv(e=>{let a=new Set(e);return a.delete(t),a})}}}async function n3(){if(sj){sw(!0);try{if(sj.id){let e=await c.fP(sj.id,{nameEl:sj.nameEl,nameEn:sj.nameEn,nameRu:sj.nameRu,nameUk:sj.nameUk,order:sj.order});sf(t=>{var a;return{...t,[sj.catSlug]:(null!=(a=t[sj.catSlug])?a:[]).map(t=>t.id===sj.id?e:t)}})}else{let e=await c.S9({categorySlug:sj.catSlug,nameEl:sj.nameEl,nameEn:sj.nameEn,nameRu:sj.nameRu,nameUk:sj.nameUk,order:sj.order});sf(t=>{var a;return{...t,[sj.catSlug]:[...null!=(a=t[sj.catSlug])?a:[],e]}})}sN(null)}catch(e){}finally{sw(!1)}}}async function n6(e,t){(e._skipConfirm||window.confirm('Удалить навык "'.concat(e.nameEl,'"?')))&&(e._skipConfirm||await c.hp(e.id).catch(()=>null))&&sf(a=>{var s;return{...a,[t]:(null!=(s=a[t])?s:[]).filter(t=>t.id!==e.id)}})}async function n7(){if(aZ){a2(!0);try{let e={name:aZ.name,description:aZ.description||void 0,role:aZ.role,tier:aZ.tier,price:aZ.price,oldPrice:aZ.oldPrice||null,currency:aZ.currency,maxTasks:aZ.maxTasks?Number(aZ.maxTasks):null,maxOffers:aZ.maxOffers?Number(aZ.maxOffers):null,maxCards:aZ.maxCards?Number(aZ.maxCards):null,maxMessagesPerDay:aZ.maxMessagesPerDay?Number(aZ.maxMessagesPerDay):null,maxOrdersPerDay:aZ.maxOrdersPerDay?Number(aZ.maxOrdersPerDay):null,maxSkills:aZ.maxSkills?Number(aZ.maxSkills):null,durationDays:aZ.durationDays?Number(aZ.durationDays):null,notifyNewTasks:aZ.notifyNewTasks,searchBoost:aZ.searchBoost,offersMultiplier:aZ.offersMultiplier,canContactFreePlan:aZ.canContactFreePlan,canContactProPlan:aZ.canContactProPlan,canContactAll:aZ.canContactAll,canShowContactInfo:aZ.canShowContactInfo,canViewPhone:aZ.canViewPhone,canUploadVideo:aZ.canUploadVideo,hasFavorites:aZ.hasFavorites,hasGoogleCalendar:aZ.hasGoogleCalendar,hasVerifiedBadge:aZ.hasVerifiedBadge,highlightedReviews:aZ.highlightedReviews,hasPersonalSite:aZ.hasPersonalSite,hasCanHelpNowStatus:aZ.hasCanHelpNowStatus,hasNeedHelpStatus:aZ.hasNeedHelpStatus,hasAutoResponse:aZ.hasAutoResponse,hasAutoMatch:aZ.hasAutoMatch,hasPriceList:aZ.hasPriceList,receiveInstantDispatchFree:aZ.receiveInstantDispatchFree,receiveInstantDispatchPro:aZ.receiveInstantDispatchPro,features:aZ.features?aZ.features.split("\n").map(e=>e.trim()).filter(Boolean):[],isDefault:aZ.isDefault,isActive:aZ.isActive,order:aZ.order};if(aZ.id){let t=await c.td(aZ.id,e);aQ(e=>e.map(e=>e.id===aZ.id?t:e))}else{let t=await c.qT(e);aQ(e=>[...e,t])}aZ.isDefault&&c.OX().then(aQ).catch(()=>{}),a0(null)}catch(e){}finally{a2(!1)}}}async function n8(e,t){window.confirm('Delete plan "'.concat(t,'"?'))&&await c.bR(e).catch(()=>null)&&aQ(t=>t.filter(t=>t.id!==e))}async function n9(){sD(!0);try{await c.CX({"general.siteName":sS.siteName,"general.siteUrl":sS.siteUrl,"general.contactEmail":sS.contactEmail,"general.supportPhone":sS.supportPhone,"general.showPricing":String(sS.showPricing)}),sA(!0),setTimeout(()=>sA(!1),2500)}catch(e){}finally{sD(!1)}}async function re(){sU(!0);try{await c.CX({"smtp.host":sB.host,"smtp.port":sB.port,"smtp.username":sB.username,"smtp.password":sB.password,"smtp.fromName":sB.fromName,"smtp.fromEmail":sB.fromEmail,"smtp.encryption":sB.encryption}),sP(!0),setTimeout(()=>sP(!1),2500)}catch(e){}finally{sU(!1)}}async function rt(e){var t,a;let s="".concat(e,"_").concat(sG),l=null!=(a=null!=(t=sV[s])?t:sV[e])?a:{subject:"",body:""};if(l.subject||l.body){sQ(!0);try{await c.jg(s,l);let t=await c.wc({subject:l.subject,body:l.body,fromLocale:sG});sO(a=>{let n={...a,[s]:l};for(let[a,s]of Object.entries(t))n["".concat(e,"_").concat(a)]=s;return n}),await Promise.all(Object.entries(t).map(t=>{let[a,s]=t;return c.jg("".concat(e,"_").concat(a),s)}))}catch(e){}finally{sQ(!1)}}}async function ra(e){let t="".concat(e,"_").concat(sG);sJ(!0);try{var a;await c.jg(t,null!=(a=sV[t])?a:{subject:"",body:""}),sq(null)}catch(e){}finally{sJ(!1)}}async function rs(){s2(!0);try{await c.CX({"payment.epay.merchantId":sZ.merchantId,"payment.epay.apiUser":sZ.apiUser,"payment.epay.apiPassword":sZ.apiPassword,"payment.epay.environment":sZ.environment,"payment.epay.confirmationUrl":sZ.confirmationUrl,"payment.epay.cancelUrl":sZ.cancelUrl,"payment.epay.enabled":String(sZ.enabled)}),s5(!0),setTimeout(()=>s5(!1),2500)}catch(e){}finally{s2(!1)}}async function rl(){s8(!0);try{await c.CX({referral_enabled:String(s3.enabled),referral_plan_id:s3.planId,referral_days:s3.days}),le(!0),setTimeout(()=>le(!1),2500)}catch(e){}finally{s8(!1)}}async function rn(){ll(!0);try{await c.CX({"seo.maintenanceMode":String(lt.maintenanceMode),"seo.indexingEnabled":String(lt.indexingEnabled),"seo.headScripts":lt.headScripts,"seo.siteTitle.el":lt.siteTitleEl,"seo.siteTitle.en":lt.siteTitleEn,"seo.siteTitle.ru":lt.siteTitleRu,"seo.siteTitle.uk":lt.siteTitleUk,"seo.siteDescription.el":lt.siteDescriptionEl,"seo.siteDescription.en":lt.siteDescriptionEn,"seo.siteDescription.ru":lt.siteDescriptionRu,"seo.siteDescription.uk":lt.siteDescriptionUk}),lr(!0),setTimeout(()=>lr(!1),2500)}catch(e){}finally{ll(!1)}}async function rr(){lx(!0);try{await c.CX({"social.telegram":ld.telegram,"social.instagram":ld.instagram,"social.facebook":ld.facebook,"social.twitter":ld.twitter,"social.youtube":ld.youtube,"social.tiktok":ld.tiktok,"social.whatsapp":ld.whatsapp,"social.viber":ld.viber}),lg(!0),setTimeout(()=>lg(!1),2500)}catch(e){}finally{lx(!1)}}async function ri(){lf(!0);try{await c.CX({"telegram.botToken":lp.botToken,"telegram.adminChatId":lp.adminChatId,"telegram.channelId.el":lp.channelIdEl,"telegram.channelId.en":lp.channelIdEn,"telegram.channelId.ru":lp.channelIdRu,"telegram.channelId.uk":lp.channelIdUk,"telegram.notifyRegistrations":String(lp.notifyRegistrations),"telegram.postNewTasks":String(lp.postNewTasks)}),lv(!0),setTimeout(()=>lv(!1),2500)}catch(e){}finally{lf(!1)}}async function ro(e){var t,a;let s=null!=(t=({admin:lp.adminChatId,el:lp.channelIdEl,en:lp.channelIdEn,ru:lp.channelIdRu,uk:lp.channelIdUk})[e])?t:"";"admin"===e?(lN(!0),l_(null)):(lD(e),lA(t=>{let a={...t};return delete a[e],a}));try{let t=await c.qX(lp.botToken,s),l={ok:t.ok,msg:t.ok?t.botName?"@".concat(t.botName):ed("admin.settings.telegram.test_ok"):null!=(a=t.error)?a:ed("admin.settings.telegram.test_fail")};"admin"===e?l_(l):lA(t=>({...t,[e]:l}))}catch(a){let t={ok:!1,msg:ed("admin.settings.telegram.test_fail")};"admin"===e?l_(t):lA(a=>({...a,[e]:t}))}finally{"admin"===e?lN(!1):lD(null)}}async function rd(){lT(!0),lU(null);try{var e;let t=await c.cl(lp.botToken);lU({ok:t.ok,msg:t.ok?"@".concat(t.botName):null!=(e=t.error)?e:ed("admin.settings.telegram.test_fail")})}catch(e){lU({ok:!1,msg:ed("admin.settings.telegram.test_fail")})}finally{lT(!1)}}if((0,l.useEffect)(()=>{var e;eo||ei||er.push("/login"),!eo&&ei&&(null==(e=ei.user)?void 0:e.role)!=="admin"&&er.push("/")},[ei,eo]),(0,l.useEffect)(()=>{nR&&(c.dE().then(eh).catch(()=>{}),c.bi().then(ac).catch(()=>{}),c.u4().then(ax).catch(()=>{}),c.z5(1,"pending").then(e=>eX(e.total)).catch(()=>{}),c.s_(1,"pending").then(e=>e5(e.total)).catch(()=>{}))},[nR]),(0,l.useEffect)(()=>{nR&&"users"===em&&(nU(!0),c.cS(ey,ek||void 0,eS||void 0).then(e=>{ef(e.data),eN(e.total)}).catch(()=>{}).finally(()=>nU(!1)))},[nR,em,ey,ek,eS]),(0,l.useEffect)(()=>{nR&&"tasks"===em&&(nU(!0),c.Yj(eM,eI||void 0,eW||void 0).then(e=>{eD(e.data),eT(e.total)}).catch(()=>{}).finally(()=>nU(!1)))},[nR,em,eM,eI,eW]),(0,l.useEffect)(()=>{nR&&"reports"===em&&(nU(!0),c.z5(eV).then(e=>{eH(e.data),eq(e.total)}).catch(()=>{}).finally(()=>nU(!1)))},[nR,em,eV]),(0,l.useEffect)(()=>{nR&&"moderation"===em&&(e2(!0),Promise.all([c.s_(e$,"review"),0===st.length?c.KD():Promise.resolve(st)]).then(e=>{let[t,a]=e;eJ(t.data),e0(t.total),0===st.length&&sa(a)}).catch(()=>{}).finally(()=>e2(!1)))},[nR,em,e$]),(0,l.useEffect)(()=>{if(!nR||"support"!==em)return;nU(!0);let e={page:String(ts),limit:"30"};ti&&(e.status=ti),td&&(e.type=td),tm&&(e.q=tm),c.KZ(e).then(e=>{ta(e.data),tr(e.total)}).catch(()=>{}).finally(()=>nU(!1))},[nR,em,ts,ti,td,tm]),(0,l.useEffect)(()=>{nR&&"balances"===em&&(nU(!0),c.g0({page:ab,userId:ay||void 0,kind:aj||void 0}).then(e=>{ag(e.data),ah(e.total)}).catch(()=>{}).finally(()=>nU(!1)))},[nR,em,ab,ay,aj]),(0,l.useEffect)(()=>{nR&&"logs"===em&&("ai"===t4?(nU(!0),c.j_(tk).then(e=>{tN(e.data),t_(e.total)}).catch(()=>{}).finally(()=>nU(!1))):"activity"===t4?c.yO({page:tM,event:tB||void 0,userId:tI||void 0,dateFrom:tR||void 0,dateTo:tW||void 0}).then(e=>{var t;tL(e.data),tD(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tH(e.eventTypes)}).catch(()=>{}):"mail"===t4?c.qt({page:tG,event:tY||void 0,dateFrom:t$||void 0,dateTo:tZ||void 0}).then(e=>{var t;tO(e.data),tq(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&t2(e.eventTypes)}).catch(()=>{}):"notifications"===t4&&c.Br({page:t7,type:at||void 0,dateFrom:an||void 0,dateTo:ai||void 0}).then(e=>{var t;t6(e.data),ae(e.total),(null==(t=e.notifTypes)?void 0:t.length)&&al(e.notifTypes)}).catch(()=>{}))},[nR,em,t4,tk,tM,tB,tI,tR,tW,tG,tY,t$,tZ,t7,at,an,ai]),(0,l.useEffect)(()=>{tA(1)},[tB,tI,tR,tW]),(0,l.useEffect)(()=>{tX(1)},[tY,t$,tZ]),(0,l.useEffect)(()=>{t8(1)},[at,an,ai]),(0,l.useEffect)(()=>{nR&&"plans"===em&&c.OX().then(aQ).catch(()=>{})},[nR,em]),(0,l.useEffect)(()=>{nR&&"translations"===em&&(l8(!0),c.YQ().then(e=>l6(e.tables)).catch(()=>{}).finally(()=>l8(!1)))},[nR,em]),(0,l.useEffect)(()=>{nR&&"backup"===em&&((0,c.Em)("/admin/backup/settings").then(e=>lP(!!e.autoEnabled)).catch(()=>{}),lO(!0),(0,c.Em)("/admin/backup/tables").then(e=>lH(e.tables||[])).catch(()=>{}).finally(()=>lO(!1)),(0,c.Em)("/admin/backup/list").then(e=>lq(e.files||[])).catch(()=>{}))},[nR,em]),(0,l.useEffect)(()=>{nR&&"referrals"===em&&(nx(!0),c.cJ().then(e=>nc(e)).catch(()=>{}).finally(()=>nx(!1)))},[nR,em]),(0,l.useEffect)(()=>{nR&&"users"===em&&0===a$.length&&c.OX().then(aQ).catch(()=>{})},[nR,em]),(0,l.useEffect)(()=>{ev(1)},[ek,eS]),(0,l.useEffect)(()=>{eA(1)},[eI,eW]),(0,l.useEffect)(()=>{af(1)},[ay,aj]),(0,l.useEffect)(()=>{nR&&"locations"===em&&c.k_().then(a5).catch(()=>{})},[nR,em]),(0,l.useEffect)(()=>{nR&&"categories"===em&&c.KD().then(sa).catch(()=>{})},[nR,em]),(0,l.useEffect)(()=>{nR&&fetch("/category-icons/presets.json").then(e=>e.ok?e.json():Promise.reject(Error("Failed to load presets"))).then(e=>{if(!Array.isArray(e))return;let t=e.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.value&&"string"==typeof e.label).filter(e=>e.value.startsWith("/category-icons/"));t.length>0&&sg(t)}).catch(()=>{})},[nR]),(0,l.useEffect)(()=>{nR&&"settings"===em&&(0===a$.length&&c.OX().then(aQ).catch(()=>{}),c.rC().then(e=>{var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p,h,b,f,y,v,j,N,k,w,C,_,S,L,E,D,M,A,B,T,I,U,R,P,W,z,F,H,V,O,K,q,G,X;sL({siteName:null!=(t=e["general.siteName"])?t:"CanHelp",siteUrl:null!=(a=e["general.siteUrl"])?a:"",contactEmail:null!=(s=e["general.contactEmail"])?s:"",supportPhone:null!=(l=e["general.supportPhone"])?l:"",showPricing:"false"!==e["general.showPricing"]}),sT({host:null!=(n=e["smtp.host"])?n:"",port:null!=(r=e["smtp.port"])?r:"587",username:null!=(i=e["smtp.username"])?i:"",password:null!=(o=e["smtp.password"])?o:"",fromName:null!=(d=e["smtp.fromName"])?d:"CanHelp",fromEmail:null!=(c=e["smtp.fromEmail"])?c:"",encryption:null!=(m=e["smtp.encryption"])?m:"tls"}),s0({merchantId:null!=(x=e["payment.epay.merchantId"])?x:"",apiUser:null!=(u=e["payment.epay.apiUser"])?u:"",apiPassword:null!=(g=e["payment.epay.apiPassword"])?g:"",environment:null!=(p=e["payment.epay.environment"])?p:"test",confirmationUrl:null!=(h=e["payment.epay.confirmationUrl"])?h:"",cancelUrl:null!=(b=e["payment.epay.cancelUrl"])?b:"",enabled:"true"===e["payment.epay.enabled"]}),s6({enabled:"true"===e.referral_enabled,planId:null!=(v=null!=(y=null!=(f=e.referral_plan_id)?f:e.referral_customer_plan_id)?y:e.referral_specialist_plan_id)?v:"",days:null!=(k=null!=(N=null!=(j=e.referral_days)?j:e.referral_customer_days)?N:e.referral_specialist_days)?k:"30"}),la({maintenanceMode:"true"===e["seo.maintenanceMode"],indexingEnabled:"false"!==e["seo.indexingEnabled"],headScripts:null!=(w=e["seo.headScripts"])?w:"",siteTitleEl:null!=(_=null!=(C=e["seo.siteTitle.el"])?C:e["seo.siteTitle"])?_:"",siteTitleEn:null!=(S=e["seo.siteTitle.en"])?S:"",siteTitleRu:null!=(L=e["seo.siteTitle.ru"])?L:"",siteTitleUk:null!=(E=e["seo.siteTitle.uk"])?E:"",siteDescriptionEl:null!=(M=null!=(D=e["seo.siteDescription.el"])?D:e["seo.siteDescription"])?M:"",siteDescriptionEn:null!=(A=e["seo.siteDescription.en"])?A:"",siteDescriptionRu:null!=(B=e["seo.siteDescription.ru"])?B:"",siteDescriptionUk:null!=(T=e["seo.siteDescription.uk"])?T:""}),lc({telegram:null!=(I=e["social.telegram"])?I:"",instagram:null!=(U=e["social.instagram"])?U:"",facebook:null!=(R=e["social.facebook"])?R:"",twitter:null!=(P=e["social.twitter"])?P:"",youtube:null!=(W=e["social.youtube"])?W:"",tiktok:null!=(z=e["social.tiktok"])?z:"",whatsapp:null!=(F=e["social.whatsapp"])?F:"",viber:null!=(H=e["social.viber"])?H:""}),lh({botToken:null!=(V=e["telegram.botToken"])?V:"",adminChatId:null!=(O=e["telegram.adminChatId"])?O:"",channelIdEl:null!=(K=e["telegram.channelId.el"])?K:"",channelIdEn:null!=(q=e["telegram.channelId.en"])?q:"",channelIdRu:null!=(G=e["telegram.channelId.ru"])?G:"",channelIdUk:null!=(X=e["telegram.channelId.uk"])?X:"",notifyRegistrations:"true"===e["telegram.notifyRegistrations"],postNewTasks:"true"===e["telegram.postNewTasks"]})}).catch(()=>{}),c.Lp().then(e=>{let t={};for(let a of e)t[a.key]={subject:a.subject,body:a.body};sO(e=>({...e,...t}))}).catch(()=>{}))},[nR,em]),eo)return(0,s.jsx)("div",{className:"text-center py-20 text-gray-500",children:ed("common.loading")});let rc="ru"===ec?"ru-RU":"en"===ec?"en-US":"el-GR",rm=[{key:"stats",label:ed("admin.tab.stats"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})},{key:"users",label:ed("admin.tab.users"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),(0,s.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75"})]})},{key:"tasks",label:ed("admin.tab.tasks"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})},{key:"reports",label:ed("admin.tab.reports"),badge:eG||void 0,icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},{key:"moderation",label:ed("admin.tab.moderation"),badge:e4||void 0,icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.1 0-2 .9-2 2v1H9a1 1 0 00-1 1v5a1 1 0 001 1h6a1 1 0 001-1v-5a1 1 0 00-1-1h-1v-1c0-1.1-.9-2-2-2zm0 0V6m0 12v-2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 20h12"})]})},{key:"categories",label:ed("admin.tab.categories"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})},{key:"locations",label:ed("admin.tab.locations"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})},{key:"balances",label:ed("admin.tab.balances","Balance"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z"})]})},{key:"plans",label:ed("admin.tab.plans"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]})},{key:"logs",label:ed("admin.tab.logs"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("polyline",{points:"4 17 10 11 4 5"}),(0,s.jsx)("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})},{key:"settings",label:ed("admin.tab.settings"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})},{key:"support",label:ed("admin.tab.support","Support"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})})},{key:"push",label:ed("admin.tab.push","Push"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.17V11a6 6 0 10-12 0v3.17a2 2 0 01-.6 1.43L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"backup",label:ed("admin.tab.backup","Backup"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})},{key:"translations",label:ed("admin.tab.translations","Translations"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})})},{key:"dbcheck",label:ed("admin.tab.dbcheck","DB check"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})},{key:"referrals",label:ed("admin.tab.referrals","Referrals"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}],rx={open:"bg-green-100 text-green-700",in_progress:"bg-green-100 text-green-700",completed:"bg-gray-100 text-gray-600",cancelled:"bg-red-100 text-red-600",draft:"bg-yellow-100 text-yellow-700"},ru={pending:"bg-yellow-100 text-yellow-700",reviewed:"bg-green-100 text-green-700",dismissed:"bg-gray-100 text-gray-500"},rg={spam:"bg-green-100 text-green-700",inappropriate:"bg-red-100 text-red-700",fraud:"bg-purple-100 text-purple-700",duplicate:"bg-green-100 text-green-700",other:"bg-gray-100 text-gray-600"},rp=e=>{var t;return null!=(t=e.publicationStatus)?t:e.isActive?"active":"inactive"},rh=eY.filter(e=>"pending"===rp(e)),rb=eY.filter(e=>"active"===rp(e));return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("svg",{className:"w-7 h-7 text-yellow-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z"})}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:ed("admin.title")})]}),(0,s.jsxs)(i(),{href:"/",className:"flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),ed("admin.back_home")]})]}),(0,s.jsxs)("div",{className:"flex gap-6",children:[(0,s.jsx)("aside",{className:"shrink-0 transition-all duration-200 ".concat(eu?"w-12":"w-52"),children:(0,s.jsxs)("nav",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsx)("button",{type:"button",onClick:()=>eg(e=>!e),title:eu?"Развернуть меню":"Свернуть меню",className:"w-full flex items-center justify-center py-2.5 text-gray-400 hover:text-gray-600 hover:bg-gray-50 border-b border-gray-100 transition",children:(0,s.jsx)("svg",{className:"w-4 h-4 transition-transform duration-200 ".concat(eu?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),rm.map(e=>{let{key:t,label:a,icon:l,badge:n}=e;return(0,s.jsxs)("button",{onClick:()=>ex(t),title:eu?a:void 0,className:"w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(em===t?"bg-green-50 text-green-700 border-r-2 border-green-600":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"," ").concat(eu?"justify-center px-3":"gap-3 px-4"),children:[(0,s.jsx)("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:l}),!eu&&(0,s.jsxs)("span",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("span",{children:a}),n?(0,s.jsx)("span",{className:"ml-auto inline-flex min-w-5 h-5 items-center justify-center rounded-full bg-red-100 px-1.5 text-[11px] font-semibold text-red-700",children:n}):null]})]},t)})]})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:["stats"===em&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{label:ed("admin.stats.users"),value:null==ep?void 0:ep.userCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),color:"text-green-600"},{label:ed("admin.stats.specialists"),value:null==ep?void 0:ep.specialistCount,icon:(0,s.jsxs)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),color:"text-purple-600"},{label:ed("admin.stats.tasks"),value:null==ep?void 0:ep.taskCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),color:"text-green-600"},{label:ed("admin.stats.offers"),value:null==ep?void 0:ep.offerCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),color:"text-green-600"},{label:ed("admin.stats.reviews"),value:null==ep?void 0:ep.reviewCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),color:"text-yellow-500"}].map(e=>{let{label:t,value:a,icon:l,color:n}=e;return(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"mb-2 ".concat(n),children:l}),(0,s.jsx)("div",{className:"text-3xl font-bold ".concat(n),children:null!=a?a:"—"}),(0,s.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:t})]},t)})}),(null==ep?void 0:ep.tasksByDay)&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.activity_30d")}),(0,s.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),ed("admin.stats.users_label")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-purple-400 inline-block rounded"}),ed("admin.stats.specialists_label")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),ed("admin.stats.tasks_label")]})]})]}),(0,s.jsx)(U,{series:[{data:ep.usersByDay,color:"#3b82f6",fill:"#3b82f615",label:ed("admin.stats.users_label")},{data:ep.specialistsByDay,color:"#a855f7",fill:"#a855f710",label:ed("admin.stats.specialists_label")},{data:ep.tasksByDay,color:"#22c55e",fill:"#22c55e10",label:ed("admin.stats.tasks_label")}]})]}),(null==ep?void 0:ep.tasksByStatus)&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800 mb-5",children:ed("admin.stats.tasks_by_status")}),(0,s.jsx)("div",{className:"space-y-3",children:(()=>{let e=ep.tasksByStatus.reduce((e,t)=>e+Number(t.count),0)||1,t={open:{label:ed("admin.task_status.open"),bg:"bg-green-50",bar:"bg-green-500"},in_progress:{label:ed("admin.task_status.in_progress"),bg:"bg-green-50",bar:"bg-green-500"},completed:{label:ed("admin.task_status.completed"),bg:"bg-gray-50",bar:"bg-gray-400"},cancelled:{label:ed("admin.task_status.cancelled"),bg:"bg-red-50",bar:"bg-red-400"},draft:{label:ed("admin.task_status.draft"),bg:"bg-yellow-50",bar:"bg-yellow-400"}},a=["open","in_progress","completed","draft","cancelled"];return[...ep.tasksByStatus].sort((e,t)=>a.indexOf(e.status)-a.indexOf(t.status)).map(a=>{var l;let{status:n,count:r}=a,i=null!=(l=t[n])?l:{label:n,bg:"bg-gray-50",bar:"bg-gray-300"},o=Math.round(Number(r)/e*100);return(0,s.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg ".concat(i.bg),children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 w-28 shrink-0",children:i.label}),(0,s.jsx)("div",{className:"flex-1 bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full ".concat(i.bar," transition-all"),style:{width:"".concat(o,"%")}})}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-700 w-8 text-right",children:r}),(0,s.jsxs)("span",{className:"text-xs text-gray-400 w-8",children:[o,"%"]})]},n)})})()})]}),ad.length>0&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.notif_chart_title")}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-orange-500 inline-block rounded"}),ed("admin.stats.notif_label")]})]}),(0,s.jsx)(U,{series:[{data:ad,color:"#f97316",fill:"#f9731615",label:ed("admin.stats.notif_label")}]})]}),am.length>0&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.mail_chart_title")}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),ed("admin.stats.mail_label")]})]}),(0,s.jsx)(U,{series:[{data:am,color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.mail_label")}]})]}),ep&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.tokens_title")}),(0,s.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-violet-500 inline-block rounded"}),ed("admin.stats.tokens_out")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),ed("admin.stats.tokens_in")]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"rounded-lg bg-violet-50 border border-violet-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-violet-600 mb-1",children:ed("admin.stats.tokens_out_label")}),(0,s.jsx)("div",{className:"text-2xl font-bold text-violet-700",children:Number(ep.totalOutputTokens).toLocaleString()})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-sky-50 border border-sky-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-sky-600 mb-1",children:ed("admin.stats.tokens_in_label")}),(0,s.jsx)("div",{className:"text-2xl font-bold text-sky-700",children:Number(ep.totalInputTokens).toLocaleString()})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-emerald-600 mb-1",children:ed("admin.stats.cost_label")}),(0,s.jsxs)("div",{className:"text-2xl font-bold text-emerald-700",children:["$",Number(null!=(a=ep.totalCostUsd)?a:0).toFixed(4)]})]})]}),(null==(t=ep.tokensByMonth)?void 0:t.length)>0&&(0,s.jsx)(B,{dateLocale:rc,series:[{data:ep.tokensByMonth.map(e=>({month:e.month,count:Number(e.output)})),color:"#8b5cf6",fill:"#8b5cf610",label:ed("admin.stats.tokens_out_label")},{data:ep.tokensByMonth.map(e=>({month:e.month,count:Number(e.input)})),color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.tokens_in_label")}]})]})]}),"users"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),ew(eC)},children:[(0,s.jsx)("input",{value:eC,onChange:e=>e_(e.target.value),placeholder:ed("admin.users.search.placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:ed("tasks.search.btn")})]}),(0,s.jsxs)("select",{value:eS,onChange:e=>eL(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all_roles")}),(0,s.jsx)("option",{value:"user",children:ed("admin.user_edit.role.user")}),(0,s.jsx)("option",{value:"admin",children:ed("profile.role.admin")})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.email")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.role")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.plan","Plan")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.registered")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.status")}),(0,s.jsx)("th",{className:"px-4 py-3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nI?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===eb.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):eb.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800",children:(0,m.H)(e.firstName,e.lastName,e.name)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.email}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("admin"===e.role?"bg-red-100 text-red-700":"specialist"===e.role?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"),children:ed("profile.role.".concat(e.role))||e.role})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400 text-xs",children:e.planId?null!=(a=null==(t=a$.find(t=>t.id===e.planId))?void 0:t.name)?a:(0,s.jsxs)("span",{className:"font-mono",children:[e.planId.slice(0,8),"…"]}):(0,s.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(e.createdAt).toLocaleDateString(rc)}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(!1!==e.isActive?"bg-green-100 text-green-700":"bg-red-100 text-red-600"),children:!1!==e.isActive?ed("admin.users.active"):ed("admin.users.inactive")})}),(0,s.jsx)("td",{className:"px-4 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("button",{onClick:()=>{aT("profile"),aP(""),aU(null),az([]),aO({}),aq({}),aX({}),aJ({}),aL({...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}),c.jd(e.id).then(e=>aL(t=>t&&t.id===e.id?{...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}:t)).catch(()=>{})},className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-gray-50 text-gray-600 hover:bg-gray-100 border border-gray-200",children:(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),"admin"!==e.role&&(0,s.jsx)("button",{onClick:()=>nW(e.id,!1!==e.isActive),className:"text-xs px-3 py-1 rounded-lg font-medium ".concat(!1!==e.isActive?"bg-red-50 text-red-600 hover:bg-red-100":"bg-green-50 text-green-600 hover:bg-green-100"),children:!1!==e.isActive?ed("admin.users.deactivate"):ed("admin.users.activate")})]})})]},e.id)})})]}),(0,s.jsx)(E,{page:ey,total:ej,limit:20,onChange:ev,totalLabel:ed("admin.pagination.total")})]})]}),"balances"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,s.jsx)("input",{value:ay,onChange:e=>av(e.target.value),placeholder:ed("admin.balance.filter.user_id","Filter by userId"),className:"flex-1 min-w-72 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsxs)("select",{value:aj,onChange:e=>aN(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.balance.filter.all","All operations")}),(0,s.jsx)("option",{value:"topup",children:ed("admin.balance.kind.topup","Top-up")}),(0,s.jsx)("option",{value:"plan_purchase",children:ed("admin.balance.kind.plan_purchase","Plan charge")}),(0,s.jsx)("option",{value:"admin_topup",children:ed("admin.balance.kind.admin_topup","Admin top-up")}),(0,s.jsx)("option",{value:"admin_adjustment",children:ed("admin.balance.kind.admin_adjustment","Adjustment")})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.operation","Operation")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.amount","Amount")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.result","Balance")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.description","Description")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.date","Date")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nI?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===au.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("admin.balance.empty","No records yet")})}):au.map(e=>{let t="credit"===e.direction,a="topup"===e.kind?ed("admin.balance.kind.topup","Top-up"):"plan_purchase"===e.kind?ed("admin.balance.kind.plan_purchase","Plan charge"):"admin_topup"===e.kind?ed("admin.balance.kind.admin_topup","Admin top-up"):ed("admin.balance.kind.admin_adjustment","Adjustment");return(0,s.jsxs)("tr",{className:"hover:bg-gray-50 align-top",children:[(0,s.jsxs)("td",{className:"px-4 py-3",children:[(0,s.jsx)("div",{className:"font-medium text-gray-800",children:e.userName||"—"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e.userEmail||e.userId})]}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(t?"bg-emerald-50 text-emerald-700":"bg-rose-50 text-rose-700"),children:a})}),(0,s.jsxs)("td",{className:"px-4 py-3 font-semibold ".concat(t?"text-emerald-700":"text-rose-700"),children:[t?"+":"-",Number(e.amount).toFixed(2)," ",e.currency]}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:(0,s.jsxs)("div",{children:[Number(e.balanceBefore).toFixed(2)," → ",Number(e.balanceAfter).toFixed(2)," ",e.currency]})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 max-w-sm",children:e.description||"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rc)})]},e.id)})})]}),(0,s.jsx)(E,{page:ab,total:ap,limit:50,onChange:af,totalLabel:ed("admin.pagination.total")})]})]}),"tasks"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),eU(eR)},children:[(0,s.jsx)("input",{value:eR,onChange:e=>eP(e.target.value),placeholder:ed("admin.tasks.search.placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:ed("tasks.search.btn")})]}),(0,s.jsxs)("select",{value:eW,onChange:e=>ez(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all_statuses")}),["open","in_progress","completed","cancelled","draft"].map(e=>(0,s.jsx)("option",{value:e,children:ed("task.status.".concat(e),e)},e))]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.title")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.customer")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.status")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.budget")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.created")}),(0,s.jsx)("th",{className:"px-4 py-3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nI?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===eE.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):eE.map(e=>{var t,a;let l=e.task||e,n=e.customer;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800 max-w-xs",children:(0,s.jsx)(i(),{href:"/tasks/".concat(l.id),className:"hover:text-green-600 truncate block",target:"_blank",children:"en"===ec&&l.titleEn||"ru"===ec&&l.titleRu||"uk"===ec&&l.titleUk||l.titleEl||l.title})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 text-xs",children:null!=(t=null==n?void 0:n.name)?t:"—"}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(a=rx[l.status])?a:"bg-gray-100 text-gray-600"),children:ed("task.status.".concat(l.status),l.status)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:l.budget?"".concat((0,x.$g)(l.budget),"€"):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(l.createdAt).toLocaleDateString(rc)}),(0,s.jsx)("td",{className:"px-4 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex gap-1.5 justify-end",children:["cancelled"!==l.status&&"completed"!==l.status&&(0,s.jsx)("button",{onClick:()=>nX(l.id),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100",children:ed("admin.tasks.cancel")}),(0,s.jsx)("button",{onClick:()=>nY(l.id,"en"===ec&&l.titleEn||"ru"===ec&&l.titleRu||"uk"===ec&&l.titleUk||l.titleEl||l.title),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100",children:ed("admin.tasks.delete")})]})})]},l.id)})})]}),(0,s.jsx)(E,{page:eM,total:eB,limit:20,onChange:eA,totalLabel:ed("admin.pagination.total")})]})]}),"categories"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:ed("admin.cat.hint")}),(0,s.jsxs)("button",{onClick:()=>n0(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",ed("admin.cat.add_root")]})]}),ss&&(0,s.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[ss.id?ed("admin.cat.edit"):ed("admin.cat.new"),ss.parentId&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",ed("admin.cat.subcategory"),")"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.slug")}),(0,s.jsx)("input",{value:ss.slug,onChange:e=>sl(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. repairs"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.icon")}),(0,s.jsx)(y,{value:ss.icon,onChange:e=>sl(t=>t&&{...t,icon:e}),onUpload:n1,uploading:sd,error:sm,presets:su})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.order")}),(0,s.jsx)("input",{type:"number",value:ss.order,onChange:e=>sl(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,s.jsx)("input",{value:ss.namesEl,onChange:e=>sl(t=>t&&{...t,namesEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,s.jsx)("input",{value:ss.namesEn,onChange:e=>sl(t=>t&&{...t,namesEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,s.jsx)("input",{value:ss.namesRu,onChange:e=>sl(t=>t&&{...t,namesRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,s.jsx)("input",{value:ss.namesUk,onChange:e=>sl(t=>t&&{...t,namesUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),ss.id&&(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mb-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:ss.isActive,onChange:e=>sl(t=>t&&{...t,isActive:e.target.checked})}),ed("admin.cat.active")]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:n2,disabled:sn,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sn?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>sl(null),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===st.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:ed("admin.cat.empty")}):(0,s.jsx)(C,{rows:st,parentId:null,depth:0,locale:ec,expanded:si,onToggle:function(e){so(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p;let h="string"==typeof e.icon?e.icon:"",b=new Set(su.map(e=>e.value)),f=h.startsWith("/category-icons/")&&!b.has(h)?"/category-icons/package.svg":h||"/category-icons/package.svg";sx(null),sl({id:e.id,parentId:null!=(n=e.parentId)?n:null,slug:e.slug,icon:f,namesEl:null!=(i=null!=(r=e.namesEl)?r:null==(t=e.names)?void 0:t.el)?i:"",namesEn:null!=(d=null!=(o=e.namesEn)?o:null==(a=e.names)?void 0:a.en)?d:"",namesRu:null!=(m=null!=(c=e.namesRu)?c:null==(s=e.names)?void 0:s.ru)?m:"",namesUk:null!=(u=null!=(x=e.namesUk)?x:null==(l=e.names)?void 0:l.uk)?u:"",order:null!=(g=e.order)?g:0,isActive:null==(p=e.isActive)||p})},onDelete:n4,onAddChild:n0,skillsExpanded:sp,skillsCache:sb,skillsLoading:sy,onToggleSkills:n5,skillForm:sj,skillSaving:sk,onOpenAddSkill:function(e){sN({catSlug:e,nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0})},onOpenEditSkill:function(e,t){var a,s,l,n,r;sN({id:e.id,catSlug:t,nameEl:null!=(a=e.nameEl)?a:"",nameEn:null!=(s=e.nameEn)?s:"",nameRu:null!=(l=e.nameRu)?l:"",nameUk:null!=(n=e.nameUk)?n:"",order:null!=(r=e.order)?r:0})},onSaveSkill:n3,onDeleteSkill:n6,onCancelSkillForm:()=>sN(null),onSkillFormChange:sN,t:ed})})]}),"locations"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:ed("admin.loc.hint")}),(0,s.jsxs)("button",{onClick:()=>n$(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",ed("admin.loc.add_city")]})]}),a3&&(0,s.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[a3.id?ed("admin.loc.edit"):ed("admin.loc.new"),a3.parentId&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",ed("admin.loc.district"),")"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.slug")}),(0,s.jsx)("input",{value:a3.slug,onChange:e=>a6(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. athens-center"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,s.jsx)("input",{value:a3.nameEl,onChange:e=>a6(t=>t&&{...t,nameEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,s.jsx)("input",{value:a3.nameEn,onChange:e=>a6(t=>t&&{...t,nameEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,s.jsx)("input",{value:a3.nameRu,onChange:e=>a6(t=>t&&{...t,nameRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,s.jsx)("input",{value:a3.nameUk,onChange:e=>a6(t=>t&&{...t,nameUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,s.jsxs)("div",{className:"w-24",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.order")}),(0,s.jsx)("input",{type:"number",value:a3.order,onChange:e=>a6(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),a3.id&&(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mt-4",children:[(0,s.jsx)("input",{type:"checkbox",checked:a3.isActive,onChange:e=>a6(t=>t&&{...t,isActive:e.target.checked})}),ed("admin.cat.active")]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:nQ,disabled:a7,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a7?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>a6(null),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===a4.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:ed("admin.loc.empty")}):(0,s.jsx)(w,{rows:a4,parentId:null,depth:0,locale:ec,expanded:a9,onToggle:function(e){se(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p;a6({id:e.id,parentId:null!=(n=e.parentId)?n:null,slug:e.slug,nameEl:null!=(i=null!=(r=e.nameEl)?r:null==(t=e.names)?void 0:t.el)?i:"",nameEn:null!=(d=null!=(o=e.nameEn)?o:null==(a=e.names)?void 0:a.en)?d:"",nameRu:null!=(m=null!=(c=e.nameRu)?c:null==(s=e.names)?void 0:s.ru)?m:"",nameUk:null!=(u=null!=(x=e.nameUk)?x:null==(l=e.names)?void 0:l.uk)?u:"",order:null!=(g=e.order)?g:0,isActive:null==(p=e.isActive)||p})},onDelete:nZ,onAddChild:n$,t:ed})})]}),"reports"===em&&(0,s.jsxs)("div",{className:"space-y-3",children:[nI?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===eF.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.reports.none")}):eF.map(e=>{var t,a,l;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(a=ru[e.status])?a:"bg-gray-100 text-gray-500"),children:e.status}),(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(l=rg[e.reason])?l:"bg-gray-100 text-gray-600"),children:e.reason}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["task"===e.targetType?ed("admin.reports.target.task"):ed("admin.reports.target.user"),":"," ",e.targetTitle?(0,s.jsx)(i(),{href:"task"===e.targetType?"/tasks/".concat(e.targetId):"/users/".concat(e.targetId),className:"text-green-600 hover:underline font-medium",target:"_blank",children:e.targetTitle}):(0,s.jsxs)("span",{className:"font-mono",children:["#",null==(t=e.targetId)?void 0:t.slice(0,8)]})]})]}),e.reporterName&&(0,s.jsxs)("p",{className:"text-xs text-gray-400 mb-1",children:[ed("admin.col.reporter"),": ",(0,s.jsx)("span",{className:"font-medium text-gray-600",children:e.reporterName})]}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700",children:e.description}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1.5",children:new Date(e.createdAt).toLocaleString(rc)})]}),"pending"===e.status&&(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>nJ(e.id,"reviewed"),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100",children:ed("admin.reports.reviewed")}),(0,s.jsx)("button",{onClick:()=>nJ(e.id,"dismissed"),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200",children:ed("admin.reports.dismiss")})]})]})},e.id)}),(0,s.jsx)(E,{page:eV,total:eK,limit:20,onChange:eO,totalLabel:ed("admin.pagination.total")})]}),"moderation"===em&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:ed("admin.moderation.pending_count","Pending")}),(0,s.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:rh.length}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ed("admin.moderation.pending_hint","New proposals waiting for approval")})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:ed("admin.moderation.active_count","Active")}),(0,s.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:rb.length}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ed("admin.moderation.active_hint","Visible cards that can be blocked")})]})]}),e1?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===eY.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.moderation.none","No specialist cards found")}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:ed("admin.moderation.pending_title","Pending approval")}),(0,s.jsx)("div",{className:"space-y-3",children:0===rh.length?(0,s.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:ed("admin.moderation.pending_empty","No pending proposals right now")}):rh.map(e=>{var t,a,l;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700",children:ed("admin.moderation.pending","Pending")}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:e.title})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:(0,s.jsx)(i(),{href:"/users/".concat(e.specialistId),className:"hover:text-green-600 hover:underline font-medium",children:null!=(a=null!=(t=e.specialistName)?t:e.specialistEmail)?a:e.specialistId})}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:e.description}),(null!=(l=e.categorySuggestions)?l:[]).length>0&&(0,s.jsxs)("div",{className:"mt-3 border-t border-amber-100 pt-3 space-y-2",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-amber-800",children:ed("admin.moderation.category_suggestions","Requested categories")}),e.categorySuggestions.map(t=>{var a,l,n;return(0,s.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-2.5",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-gray-800",children:t.name}),(0,s.jsxs)("div",{className:"mt-2 grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto_auto]",children:[(0,s.jsxs)("select",{value:null!=(l=e3[t.id])?l:"",onChange:e=>e6(a=>({...a,[t.id]:e.target.value})),className:"min-w-0 rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs text-gray-700",children:[(0,s.jsx)("option",{value:"",children:ed("admin.moderation.map_category","Map to existing category")}),st.map(e=>(0,s.jsx)("option",{value:e.id,children:b(e,ec)},e.id))]}),(0,s.jsx)("button",{onClick:()=>nG(e.id,t,"map"),disabled:!e3[t.id]||e9===t.id,className:"rounded-lg bg-green-600 px-2.5 py-1.5 text-xs font-medium text-white disabled:opacity-50",children:ed("admin.moderation.map","Map")}),(0,s.jsx)("button",{onClick:()=>nG(e.id,t,"reject"),disabled:e9===t.id,className:"rounded-lg bg-white px-2.5 py-1.5 text-xs font-medium text-gray-600 ring-1 ring-gray-300 disabled:opacity-50",children:ed("admin.moderation.reject","Reject")})]}),(0,s.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,s.jsx)("input",{value:null!=(n=e7[t.id])?n:"",onChange:e=>e8(a=>({...a,[t.id]:e.target.value})),placeholder:ed("admin.moderation.new_category_slug","New category slug"),className:"min-w-0 flex-1 rounded-lg border border-gray-300 bg-white px-2 py-1.5 text-xs text-gray-700"}),(0,s.jsx)("button",{onClick:()=>nG(e.id,t,"create"),disabled:!(null==(a=e7[t.id])?void 0:a.trim())||e9===t.id,className:"rounded-lg bg-amber-600 px-2.5 py-1.5 text-xs font-medium text-white disabled:opacity-50",children:ed("admin.moderation.create_category","Create category")})]})]},t.id)})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>nq(e.id,"active"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700",children:ed("admin.moderation.approve","Approve")}),(0,s.jsx)("button",{onClick:()=>nq(e.id,"inactive"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-700 hover:bg-gray-200",children:ed("admin.moderation.block","Block")})]})]})},e.id)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:ed("admin.moderation.active_title","Active cards")}),(0,s.jsx)("div",{className:"space-y-3",children:0===rb.length?(0,s.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:ed("admin.moderation.active_empty","No active cards found")}):rb.map(e=>{var t,a;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700",children:ed("admin.moderation.active","Active")}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:e.title})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:(0,s.jsx)(i(),{href:"/users/".concat(e.specialistId),className:"hover:text-green-600 hover:underline font-medium",children:null!=(a=null!=(t=e.specialistName)?t:e.specialistEmail)?a:e.specialistId})}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:e.description})]}),(0,s.jsx)("button",{onClick:()=>nq(e.id,"inactive"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-red-50 text-red-700 hover:bg-red-100",children:ed("admin.moderation.block","Block")})]})},e.id)})})]}),(0,s.jsx)(E,{page:e$,total:eZ,limit:20,onChange:eQ,totalLabel:ed("admin.pagination.total")})]})]}),"logs"===em&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit",children:[{key:"ai",label:ed("admin.logs.subtab.ai")},{key:"activity",label:ed("admin.logs.subtab.activity")},{key:"mail",label:ed("admin.logs.subtab.mail")},{key:"notifications",label:ed("admin.logs.subtab.notifications")}].map(e=>{let{key:t,label:a}=e;return(0,s.jsx)("button",{onClick:()=>t5(t),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(t4===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:a},t)})}),"ai"===t4&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-500",children:[ed("admin.pagination.total"),": ",tC]}),(0,s.jsxs)("button",{onClick:()=>{tw(1),c.j_(1).then(e=>{tN(e.data),t_(e.total)}).catch(()=>{})},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),ed("common.refresh")]})]}),nI?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===tj.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.logs.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.provider")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.model")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.action")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.langs")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.in")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.out")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.total")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.ms")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.logs.status")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tj.map(e=>{var t,a,l,n,r;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rc)}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("anthropic"===e.provider?"bg-purple-100 text-purple-700":"bg-green-100 text-green-700"),children:e.provider})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 font-mono text-xs",children:e.model}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.action}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.fromLocale&&e.toLocale?"".concat(e.fromLocale," → ").concat(e.toLocale):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(t=e.inputTokens)?t:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(a=e.outputTokens)?a:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right font-medium",children:null!=(l=e.totalTokens)?l:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-500",children:null!=(n=e.durationMs)?n:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:e.success?(0,s.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-red-500 flex justify-center",title:null!=(r=e.error)?r:"",children:(0,s.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:tk,total:tC,limit:50,onChange:tw,totalLabel:ed("admin.pagination.total")})]}),"activity"===t4&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.event")}),(0,s.jsxs)("select",{value:tB,onChange:e=>tT(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.activity.all_events")}),tF.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.from")}),(0,s.jsx)("input",{type:"date",value:tR,onChange:e=>tP(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.to")}),(0,s.jsx)("input",{type:"date",value:tW,onChange:e=>tz(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tB||tR||tW||tI)&&(0,s.jsxs)("button",{onClick:()=>{tT(""),tP(""),tz(""),tU("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.activity.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.activity.total"),": ",tE]})]}),0===tS.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.activity.empty")}):(0,s.jsx)("div",{className:"space-y-2",children:tS.map(e=>(0,s.jsx)(A,{entry:e,dateLocale:rc,onFilterUser:e=>{tU(e),tT("")},t:ed},e.id))}),(0,s.jsx)(E,{page:tM,total:tE,limit:50,onChange:tA,totalLabel:ed("admin.pagination.total")})]}),"mail"===t4&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.event")}),(0,s.jsxs)("select",{value:tY,onChange:e=>tJ(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.mail.all_events")}),t1.map(e=>(0,s.jsx)("option",{value:e,children:ed("admin.event.".concat(e.replace(/\./g,"_")),e)},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.from")}),(0,s.jsx)("input",{type:"date",value:t$,onChange:e=>tQ(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.to")}),(0,s.jsx)("input",{type:"date",value:tZ,onChange:e=>t0(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tY||t$||tZ)&&(0,s.jsxs)("button",{onClick:()=>{tJ(""),tQ(""),t0("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.mail.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.mail.total"),": ",tK]})]}),0===tV.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.mail.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.recipient")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.event")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.provider")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.details")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.mail.status")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tV.map(e=>{let t=D(e.details),a="string"==typeof(null==t?void 0:t.provider)?t.provider:"—",l="string"==typeof(null==t?void 0:t.to)?t.to:e.userEmail||"—",n="string"==typeof(null==t?void 0:t.subject)?t.subject:"",r="string"==typeof(null==t?void 0:t.error)?t.error:"",i="email.sent"===e.event||"admin.email.test.sent"===e.event;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50 align-top",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rc)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:l}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700",children:ed("admin.event.".concat(e.event.replace(/\./g,"_")),e.event)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:a}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-md",children:(0,s.jsx)("div",{className:"truncate",title:n||r||void 0,children:n||r||"—"})}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:i?(0,s.jsx)("span",{className:"text-green-600 inline-flex justify-center",title:ed("admin.mail.success"),children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-red-500 inline-flex justify-center",title:r||ed("admin.mail.failed"),children:(0,s.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:tG,total:tK,limit:50,onChange:tX,totalLabel:ed("admin.pagination.total")})]}),"notifications"===t4&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.notif_logs.type")}),(0,s.jsxs)("select",{value:at,onChange:e=>aa(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all")}),as.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.from")}),(0,s.jsx)("input",{type:"date",value:an,onChange:e=>ar(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.to")}),(0,s.jsx)("input",{type:"date",value:ai,onChange:e=>ao(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(at||an||ai)&&(0,s.jsxs)("button",{onClick:()=>{aa(""),ar(""),ao("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.activity.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.pagination.total"),": ",t9]})]}),0===t3.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.notif_logs.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.notif_logs.type")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.notif_logs.title")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.notif_logs.read")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:t3.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rc)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:null!=(a=null!=(t=e.recipientName)?t:e.recipientEmail)?a:e.recipientId}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:e.type})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-xs truncate",children:e.title}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:e.isRead?(0,s.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-gray-400 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"})})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:t7,total:t9,limit:50,onChange:t8,totalLabel:ed("admin.pagination.total")})]})]}),"plans"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h2",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),ed("admin.plans.title")]}),(0,s.jsx)("button",{onClick:function(){a0({name:"",description:"",role:"customer",tier:"free",price:"0",oldPrice:"",currency:"EUR",maxTasks:"",maxOffers:"",maxCards:"",maxMessagesPerDay:"",maxOrdersPerDay:"",maxSkills:"",durationDays:"",searchBoost:0,offersMultiplier:"1.00",features:"",isDefault:!1,isActive:!0,order:0,notifyNewTasks:!1,canContactFreePlan:!1,canContactProPlan:!0,canContactAll:!1,canShowContactInfo:!1,canViewPhone:!1,canUploadVideo:!1,hasFavorites:!1,hasGoogleCalendar:!1,hasVerifiedBadge:!1,highlightedReviews:!1,hasPersonalSite:!1,hasCanHelpNowStatus:!1,hasNeedHelpStatus:!1,hasAutoResponse:!1,hasAutoMatch:!1,hasPriceList:!1,receiveInstantDispatchFree:!1,receiveInstantDispatchPro:!1})},className:"bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium",children:ed("admin.plans.add")})]}),aZ&&(0,s.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:aZ.id?ed("admin.plans.form.edit"):ed("admin.plans.form.new")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.name")}),(0,s.jsx)("input",{value:aZ.name,onChange:e=>a0({...aZ,name:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.price")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:aZ.price,onChange:e=>a0({...aZ,price:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.old_price")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:null!=(r=aZ.oldPrice)?r:"",onChange:e=>a0({...aZ,oldPrice:e.target.value}),placeholder:"—",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.tier")}),(0,s.jsxs)("select",{value:aZ.tier,onChange:e=>a0({...aZ,tier:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"free",children:ed("admin.plans.form.tier.free")}),(0,s.jsx)("option",{value:"pro",children:ed("admin.plans.form.tier.pro")}),(0,s.jsx)("option",{value:"ultimate",children:ed("admin.plans.form.tier.ultimate")})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.description")}),(0,s.jsx)("input",{value:aZ.description,onChange:e=>a0({...aZ,description:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.limits")}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_tasks")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.maxTasks,onChange:e=>a0({...aZ,maxTasks:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_offers")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.maxOffers,onChange:e=>a0({...aZ,maxOffers:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_cards")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.maxCards,onChange:e=>a0({...aZ,maxCards:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_messages_day")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.maxMessagesPerDay,onChange:e=>a0({...aZ,maxMessagesPerDay:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_orders_day")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.maxOrdersPerDay,onChange:e=>a0({...aZ,maxOrdersPerDay:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_skills")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.maxSkills,onChange:e=>a0({...aZ,maxSkills:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.duration_days")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aZ.durationDays,onChange:e=>a0({...aZ,durationDays:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.boost")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.search_boost")}),(0,s.jsx)("input",{type:"number",min:"0",value:aZ.searchBoost,onChange:e=>a0({...aZ,searchBoost:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.offers_multiplier")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:aZ.offersMultiplier,onChange:e=>a0({...aZ,offersMultiplier:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.features")}),(0,s.jsx)("textarea",{rows:3,value:aZ.features,onChange:e=>a0({...aZ,features:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.contact")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["canContactFreePlan",ed("admin.plans.form.can_contact_free")],["canContactProPlan",ed("admin.plans.form.can_contact_pro")],["canContactAll",ed("admin.plans.form.can_contact_all")],["canShowContactInfo",ed("admin.plans.form.can_show_contact")],["canViewPhone",ed("admin.plans.form.can_view_phone")]].map(e=>{let[t,a]=e;return(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aZ[t],onChange:e=>a0({...aZ,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),a]},t)})}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.features")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["notifyNewTasks",ed("admin.plans.form.notify")],["canUploadVideo",ed("admin.plans.form.upload_video")],["hasFavorites",ed("admin.plans.form.favorites")],["hasGoogleCalendar",ed("admin.plans.form.google_calendar")],["hasVerifiedBadge",ed("admin.plans.form.verified_badge")],["highlightedReviews",ed("admin.plans.form.highlighted_reviews")],["hasPersonalSite",ed("admin.plans.form.personal_site")],["hasCanHelpNowStatus",ed("admin.plans.form.can_help_now")],["hasNeedHelpStatus",ed("admin.plans.form.need_help")],["hasAutoResponse",ed("admin.plans.form.auto_response")],["hasAutoMatch",ed("admin.plans.form.auto_match")],["hasPriceList",ed("admin.plans.form.price_list")],["receiveInstantDispatchFree",ed("admin.plans.form.instant_dispatch_free")],["receiveInstantDispatchPro",ed("admin.plans.form.instant_dispatch_pro")]].map(e=>{let[t,a]=e;return(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aZ[t],onChange:e=>a0({...aZ,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),a]},t)})}),(0,s.jsxs)("div",{className:"flex items-center gap-6 pt-1",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aZ.isDefault,onChange:e=>a0({...aZ,isDefault:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),ed("admin.plans.form.default")]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aZ.isActive,onChange:e=>a0({...aZ,isActive:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),ed("admin.plans.form.active")]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-xs text-gray-600",children:ed("admin.plans.form.order")}),(0,s.jsx)("input",{type:"number",value:aZ.order,onChange:e=>a0({...aZ,order:Number(e.target.value)}),className:"w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)("button",{onClick:n7,disabled:a1||!aZ.name,className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a1?"...":ed("common.save")}),(0,s.jsx)("button",{onClick:()=>a0(null),className:"px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:0===a$.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400 text-sm",children:ed("admin.plans.empty")}):(0,s.jsx)("div",{className:"divide-y divide-gray-100",children:a$.sort((e,t)=>{var a,s;return(null!=(a=e.order)?a:0)-(null!=(s=t.order)?s:0)}).map(e=>{var t;return(0,s.jsxs)("div",{className:"flex items-start gap-4 px-4 py-4 ".concat(e.isActive?"":"opacity-50"),children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:e.name}),e.isDefault&&(0,s.jsx)("span",{className:"bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium",children:ed("admin.plans.badge.default")}),!e.isActive&&(0,s.jsx)("span",{className:"bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full",children:ed("admin.plans.badge.inactive")})]}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mt-1 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-semibold text-gray-800",children:[e.oldPrice&&(0,s.jsxs)("span",{className:"font-normal text-gray-400 line-through",children:[e.oldPrice," ",e.currency]}),(0,s.jsxs)("span",{children:[e.price," ",e.currency]})]}),null!=e.maxTasks&&(0,s.jsxs)("span",{children:[ed("admin.plans.tasks"),": ",e.maxTasks]}),null!=e.maxOffers&&(0,s.jsxs)("span",{children:[ed("admin.plans.offers"),": ",e.maxOffers]}),null!=e.maxCards&&(0,s.jsxs)("span",{children:[ed("admin.plans.cards"),": ",e.maxCards]}),e.notifyNewTasks&&(0,s.jsxs)("span",{className:"text-green-700 flex items-center gap-1",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),ed("admin.plans.notify_tasks")]})]}),(null!=(t=e.features)?t:[]).length>0&&(0,s.jsx)("ul",{className:"mt-1.5 space-y-0.5",children:e.features.map((e,t)=>(0,s.jsxs)("li",{className:"text-xs text-gray-600 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-green-500",children:(0,s.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",e]},t))})]}),(0,s.jsxs)("div",{className:"flex gap-1 shrink-0",children:[!e.isDefault&&(0,s.jsx)("button",{onClick:()=>c.td(e.id,{isDefault:!0}).then(()=>c.OX().then(aQ)).catch(()=>{}),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:ed("admin.plans.make_default"),children:(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}),(0,s.jsx)("button",{onClick:()=>{var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p,h,b,f,y,v,j,N,k,w,C,_,S,L,E,D,M;a0({id:e.id,name:e.name,description:null!=(t=e.description)?t:"",role:null!=(a=e.role)?a:"customer",tier:null!=(s=e.tier)?s:"free",price:null!=(l=e.price)?l:"0",oldPrice:null!=(n=e.oldPrice)?n:"",currency:null!=(r=e.currency)?r:"EUR",maxTasks:null!=e.maxTasks?String(e.maxTasks):"",maxOffers:null!=e.maxOffers?String(e.maxOffers):"",maxCards:null!=e.maxCards?String(e.maxCards):"",maxMessagesPerDay:null!=e.maxMessagesPerDay?String(e.maxMessagesPerDay):"",maxOrdersPerDay:null!=e.maxOrdersPerDay?String(e.maxOrdersPerDay):"",maxSkills:null!=e.maxSkills?String(e.maxSkills):"",durationDays:null!=e.durationDays?String(e.durationDays):"",searchBoost:null!=(i=e.searchBoost)?i:0,offersMultiplier:null!=(o=e.offersMultiplier)?o:"1.00",features:(null!=(d=e.features)?d:[]).join("\n"),isDefault:null!=(c=e.isDefault)&&c,isActive:null==(m=e.isActive)||m,order:null!=(x=e.order)?x:0,notifyNewTasks:null!=(u=e.notifyNewTasks)&&u,canContactFreePlan:null!=(g=e.canContactFreePlan)&&g,canContactProPlan:null==(p=e.canContactProPlan)||p,canContactAll:null!=(h=e.canContactAll)&&h,canShowContactInfo:null!=(b=e.canShowContactInfo)&&b,canViewPhone:null!=(f=e.canViewPhone)&&f,canUploadVideo:null!=(y=e.canUploadVideo)&&y,hasFavorites:null!=(v=e.hasFavorites)&&v,hasGoogleCalendar:null!=(j=e.hasGoogleCalendar)&&j,hasVerifiedBadge:null!=(N=e.hasVerifiedBadge)&&N,highlightedReviews:null!=(k=e.highlightedReviews)&&k,hasPersonalSite:null!=(w=e.hasPersonalSite)&&w,hasCanHelpNowStatus:null!=(C=e.hasCanHelpNowStatus)&&C,hasNeedHelpStatus:null!=(_=e.hasNeedHelpStatus)&&_,hasAutoResponse:null!=(S=e.hasAutoResponse)&&S,hasAutoMatch:null!=(L=e.hasAutoMatch)&&L,hasPriceList:null!=(E=e.hasPriceList)&&E,receiveInstantDispatchFree:null!=(D=e.receiveInstantDispatchFree)&&D,receiveInstantDispatchPro:null!=(M=e.receiveInstantDispatchPro)&&M})},className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:ed("common.edit")}),(0,s.jsx)("button",{onClick:()=>n8(e.id,e.name),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:ed("common.delete")})]})]},e.id)})})})]}),"settings"===em&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex gap-1 mb-6 bg-white rounded-xl border border-gray-200 p-1 w-fit",children:["general","smtp","notifications","payment","referral","seo","socials","telegram"].map(e=>{let t={general:ed("admin.settings.tab.general"),smtp:ed("admin.settings.tab.smtp"),notifications:ed("admin.settings.tab.notifications"),payment:ed("admin.settings.tab.payment"),referral:ed("admin.settings.tab.referral"),seo:ed("admin.settings.tab.seo"),socials:ed("admin.settings.tab.socials"),telegram:ed("admin.settings.tab.telegram")};return(0,s.jsx)("button",{onClick:()=>s_(e),className:"px-4 py-2 rounded-lg text-sm font-medium transition ".concat(sC===e?"bg-green-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"),children:t[e]},e)})}),"general"===sC&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-5",children:ed("admin.settings.general.title")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.site_name")}),(0,s.jsx)("input",{value:sS.siteName,onChange:e=>sL(t=>({...t,siteName:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"CanHelp"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.site_url")}),(0,s.jsx)("input",{value:sS.siteUrl,onChange:e=>sL(t=>({...t,siteUrl:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"https://canhelp.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.contact_email")}),(0,s.jsx)("input",{type:"email",value:sS.contactEmail,onChange:e=>sL(t=>({...t,contactEmail:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"contact@canhelp.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.support_phone")}),(0,s.jsx)("input",{value:sS.supportPhone,onChange:e=>sL(t=>({...t,supportPhone:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"+30 21 000 0000"})]}),(0,s.jsxs)("label",{className:"flex cursor-pointer items-center justify-between gap-4 rounded-lg border border-gray-200 px-3 py-3",children:[(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-gray-700",children:ed("admin.settings.general.show_pricing")}),(0,s.jsx)("span",{className:"mt-0.5 block text-xs text-gray-500",children:ed("admin.settings.general.show_pricing_hint")})]}),(0,s.jsx)("input",{type:"checkbox",checked:sS.showPricing,onChange:e=>sL(t=>({...t,showPricing:e.target.checked})),className:"h-5 w-5 accent-green-600"})]}),(0,s.jsx)("button",{onClick:n9,disabled:sE,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:sE?ed("admin.settings.saving"):sM?ed("admin.settings.saved"):ed("common.save")})]})]}),"smtp"===sC&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:ed("admin.settings.smtp.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mb-5",children:ed("admin.settings.smtp.hint")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"col-span-2",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.host")}),(0,s.jsx)("input",{value:sB.host,onChange:e=>sT(t=>({...t,host:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"smtp.gmail.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.port")}),(0,s.jsx)("input",{value:sB.port,onChange:e=>sT(t=>({...t,port:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"587"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.encryption")}),(0,s.jsxs)("select",{value:sB.encryption,onChange:e=>sT(t=>({...t,encryption:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"none",children:ed("admin.settings.smtp.enc.none")}),(0,s.jsx)("option",{value:"tls",children:"STARTTLS (587)"}),(0,s.jsx)("option",{value:"ssl",children:"SSL/TLS (465)"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.username")}),(0,s.jsx)("input",{value:sB.username,onChange:e=>sT(t=>({...t,username:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"user@gmail.com",autoComplete:"off"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.password")}),(0,s.jsx)("input",{type:"password",value:sB.password,onChange:e=>sT(t=>({...t,password:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",autoComplete:"new-password",placeholder:"••••••••••••"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.from_name")}),(0,s.jsx)("input",{value:sB.fromName,onChange:e=>sT(t=>({...t,fromName:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"CanHelp"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.from_email")}),(0,s.jsx)("input",{type:"email",value:sB.fromEmail,onChange:e=>sT(t=>({...t,fromEmail:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"noreply@canhelp.com"})]})]}),(0,s.jsx)("button",{onClick:re,disabled:sI,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:sI?ed("admin.settings.saving"):sR?ed("admin.settings.saved"):ed("common.save")}),(0,s.jsx)("button",{onClick:async()=>{sz(!0),sH(null);try{let e=await c.FI();sH("✓ Sent to ".concat(e.to))}catch(e){sH("✗ Error: ".concat(e.message))}finally{sz(!1),setTimeout(()=>sH(null),5e3)}},disabled:sW,className:"w-full py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 disabled:opacity-50 transition",children:sW?ed("admin.settings.smtp.sending"):(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),ed("admin.settings.smtp.test")]})}),sF&&(0,s.jsx)("p",{className:"text-sm text-center font-medium ".concat(sF.startsWith("✓")?"text-green-600":"text-red-500"),children:sF})]})]}),"payment"===sC&&(0,s.jsxs)("div",{className:"space-y-6 max-w-lg",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[#003087] flex items-center justify-center text-white text-xs font-bold shrink-0",children:"PB"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:"ePay — Piraeus Bank"}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:"Греческий платёжный шлюз"})]})]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500",children:ed("admin.settings.active")}),(0,s.jsx)("button",{type:"button",onClick:()=>s0(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sZ.enabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(sZ.enabled?"translate-x-5":"translate-x-1")})})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.env.label")}),(0,s.jsxs)("select",{value:sZ.environment,onChange:e=>s0(t=>({...t,environment:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"test",children:ed("admin.settings.env.test")}),(0,s.jsx)("option",{value:"production",children:ed("admin.settings.env.prod")})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.merchant_id")}),(0,s.jsx)("input",{value:sZ.merchantId,onChange:e=>s0(t=>({...t,merchantId:e.target.value})),placeholder:ed("admin.settings.merchant_id"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API User"}),(0,s.jsx)("input",{value:sZ.apiUser,onChange:e=>s0(t=>({...t,apiUser:e.target.value})),autoComplete:"off",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Password"}),(0,s.jsx)("input",{type:"password",value:sZ.apiPassword,onChange:e=>s0(t=>({...t,apiPassword:e.target.value})),autoComplete:"new-password",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmation URL (webhook)"}),(0,s.jsx)("input",{value:sZ.confirmationUrl,onChange:e=>s0(t=>({...t,confirmationUrl:e.target.value})),placeholder:"https://yoursite.com/api/payments/epay/confirm",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cancel URL"}),(0,s.jsx)("input",{value:sZ.cancelUrl,onChange:e=>s0(t=>({...t,cancelUrl:e.target.value})),placeholder:"https://yoursite.com/payment/cancelled",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-5",children:[(0,s.jsx)("button",{onClick:rs,disabled:s1,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:s1?ed("admin.settings.saving"):ed("common.save")}),s4&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),(0,s.jsxs)("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-xl text-xs text-amber-700 flex items-start gap-2",children:[(0,s.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,s.jsx)("span",{children:ed("admin.settings.payment.hint")})]})]}),"notifications"===sC&&(0,s.jsxs)("div",{className:"space-y-3 max-w-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2 mb-4 p-3 bg-green-50 border border-green-100 rounded-xl text-sm text-green-700",children:[(0,s.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,s.jsxs)("p",{children:[ed("admin.notif.vars_hint")," ",p.map(e=>{let t="{{".concat(e,"}}");return(0,s.jsx)("code",{className:"mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})]})]}),[{key:"email_verification",label:ed("admin.notif.email_verification"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})},{key:"registration_success",label:ed("admin.notif.registration_success"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"password_reset",label:ed("admin.notif.password_reset"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-amber-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})},{key:"new_offer",label:ed("admin.notif.new_offer"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-purple-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})},{key:"new_task",label:ed("admin.notif.new_task"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-indigo-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})},{key:"offer_accepted",label:ed("admin.notif.offer_accepted"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},{key:"new_message",label:ed("admin.notif.new_message"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-pink-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})},{key:"offer_declined",label:ed("admin.notif.offer_declined"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"offer_other_accepted",label:ed("admin.notif.offer_other_accepted"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})},{key:"task_updated",label:ed("admin.notif.task_updated"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})},{key:"deadline_reminder",label:ed("admin.notif.deadline_reminder"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-yellow-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"task_archived",label:ed("admin.notif.task_archived"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8l1 12a2 2 0 002 2h8a2 2 0 002-2l1-12M10 12v6m4-6v6"})})},{key:"referral_reward",label:ed("admin.notif.referral_reward"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-emerald-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v13m0-13V6a2 2 0 112.83 2.83l-2.83 2.83zm0 0V5.5A2.5 2.5 0 119.27 8H12zm-7 4h14M5 12a2 2 0 110-4h3.586a1 1 0 01.707.293l2.414 2.414M19 12a2 2 0 110-4h-3.586a1 1 0 00-.707.293l-2.414 2.414"})})},{key:"plan_activated",label:ed("admin.email_template.plan_activated"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"plan_upgraded",label:ed("admin.email_template.plan_upgraded"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})},{key:"plan_downgrade_scheduled",label:ed("admin.email_template.plan_downgrade_scheduled"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-orange-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})},{key:"plan_downgrade_applied",label:ed("admin.email_template.plan_downgrade_applied"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})},{key:"plan_renewal_reminder",label:ed("admin.email_template.plan_renewal_reminder"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-yellow-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"plan_insufficient_funds",label:ed("admin.email_template.plan_insufficient_funds"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}].map(e=>{var t,a,l;let{key:n,label:r,icon:i}=e,o="".concat(n,"_").concat(sG),d=null!=(a=null!=(t=sV[o])?t:sV[n])?a:{subject:"",body:""},c=sK===n,m=null!=(l=g[n])?l:[];return(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none",onClick:()=>sq(c?null:n),children:[(0,s.jsx)("span",{className:"text-xl shrink-0",children:i}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"font-medium text-gray-800 text-sm",children:r}),d.subject?(0,s.jsxs)("div",{className:"text-xs text-gray-400 mt-0.5 truncate",children:[ed("admin.notif.tmpl.subject_label"),": ",d.subject]}):(0,s.jsx)("div",{className:"text-xs text-gray-300 mt-0.5 italic",children:ed("admin.notif.tmpl.not_set")})]}),(0,s.jsx)("span",{className:"text-gray-400 transition-transform ".concat(c?"rotate-90":""),children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),c&&(0,s.jsxs)("div",{className:"px-5 pb-5 border-t border-gray-100 pt-4 space-y-3",children:[(0,s.jsx)("div",{className:"flex gap-1 pb-2",children:["el","en","uk","ru"].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>sX(e),className:"px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(sG===e?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:"el"===e?"Ελληνικά":"en"===e?"English":"uk"===e?"Українська":"Русский"},e))}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.notif.tmpl.subject_label")}),(0,s.jsx)("input",{value:d.subject,onChange:e=>sO(t=>{var a;return{...t,[o]:{...null!=(a=t[o])?a:{subject:"",body:""},subject:e.target.value}}}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.notif.tmpl.body_label")}),(0,s.jsx)("textarea",{rows:7,value:d.body,onChange:e=>sO(t=>{var a;return{...t,[o]:{...null!=(a=t[o])?a:{subject:"",body:""},body:e.target.value}}}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y",placeholder:"

Уважаемый {{userName}},

..."})]}),m.length>0&&(0,s.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-amber-800 mb-1",children:ed("admin.notif.vars_hint")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(e=>{let t="{{".concat(e,"}}");return(0,s.jsx)("code",{className:"bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)("button",{onClick:()=>ra(n),disabled:sY||s$,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sY?ed("admin.notif.tmpl.saving"):ed("admin.notif.tmpl.save")}),(0,s.jsxs)("button",{onClick:()=>rt(n),disabled:sY||s$,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})}),s$?ed("admin.notif.tmpl.translating"):ed("admin.notif.tmpl.translate")]}),(0,s.jsx)("button",{onClick:()=>sq(null),className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200",children:ed("admin.notif.tmpl.close")})]})]})]},n)})]}),"referral"===sC&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:ed("admin.settings.referral.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:ed("admin.settings.referral.hint")})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.referral.enabled_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:ed("admin.settings.referral.enabled_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s6(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(s3.enabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(s3.enabled?"translate-x-5":"translate-x-1")})})]}),(0,s.jsxs)("div",{className:"border border-gray-100 rounded-lg p-4 space-y-4",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:ed("admin.settings.referral.shared_section")}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.referral.plan_label")}),(0,s.jsxs)("select",{value:s3.planId,onChange:e=>s6(t=>({...t,planId:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"",children:ed("admin.settings.referral.no_plan")}),a$.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:ed("admin.settings.referral.plan_hint")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.referral.days_label")}),(0,s.jsx)("input",{type:"number",min:"1",max:"365",value:s3.days,onChange:e=>s6(t=>({...t,days:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:ed("admin.settings.referral.days_hint")})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:rl,disabled:s7,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:s7?ed("admin.settings.saving"):ed("common.save")}),s9&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"socials"===sC&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:ed("admin.settings.socials.title")}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:ed("admin.settings.socials.hint")})]}),[{key:"telegram",label:"Telegram",placeholder:"https://t.me/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})},{key:"instagram",label:"Instagram",placeholder:"https://instagram.com/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z"})})},{key:"facebook",label:"Facebook",placeholder:"https://facebook.com/yourpage",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})},{key:"twitter",label:"X (Twitter)",placeholder:"https://x.com/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})},{key:"youtube",label:"YouTube",placeholder:"https://youtube.com/@yourchannel",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})})},{key:"tiktok",label:"TikTok",placeholder:"https://tiktok.com/@yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.73a8.16 8.16 0 0 0 4.77 1.52V6.79a4.85 4.85 0 0 1-1-.1z"})})},{key:"whatsapp",label:"WhatsApp",placeholder:"https://wa.me/30xxxxxxxxxx",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z"})})},{key:"viber",label:"Viber",placeholder:"viber://chat?number=30xxxxxxxxxx",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M11.398.002C8.473.028 4.414.625 2.138 4.15.2 7.044-.054 10.74.009 13.092c.064 2.352.277 4.799 1.97 6.758 1.32 1.527 3.276 2.39 5.262 2.674l.006 1.92c0 .307.368.47.592.257l2.245-2.143c.666.037 1.338.046 2.001.023 3.05-.107 6.238-.671 8.39-2.988 2.27-2.45 2.476-5.915 2.515-9.093.038-3.178-.15-6.648-2.467-9.052C18.337.606 14.323-.024 11.398.002zm.11 1.55c2.73-.023 6.267.538 8.3 2.688 1.878 2.004 2.034 5.155 2.001 8.172-.033 3.017-.245 5.967-2.069 7.944-1.792 1.943-4.607 2.44-7.265 2.533a18.35 18.35 0 0 1-2.198-.051l-.301-.028L7.8 24.51l-.004-2.463-.359-.064c-1.875-.333-3.693-1.152-4.832-2.47-1.377-1.597-1.574-3.702-1.632-5.915-.058-2.213.173-5.593 1.85-8.145C4.519 2.967 8.03 1.576 11.508 1.552zm-.082 2.19a8.79 8.79 0 0 0-2.65.399c-1.567.494-2.953 1.497-3.9 2.786C3.67 8.347 3.19 10.01 3.16 11.704c-.03 1.695.392 3.435 1.465 4.754.767.94 1.833 1.603 2.978 1.95l.004 1.232 1.197-1.143c.545.094 1.102.139 1.655.134 1.614-.015 3.27-.444 4.584-1.46 1.314-1.016 2.14-2.578 2.355-4.217.216-1.64-.017-3.369-.85-4.773-.832-1.403-2.23-2.412-3.773-2.74a8.777 8.777 0 0 0-1.459-.12zm.076 1.56c.39.003.784.049 1.165.14 1.215.27 2.319 1.066 2.975 2.17.657 1.103.843 2.518.66 3.857-.183 1.339-.826 2.596-1.87 3.408-1.044.813-2.41 1.172-3.76 1.185a10.75 10.75 0 0 1-1.675-.131l-.395-.064-1.017.97-.003-1.02-.384-.117c-1.027-.314-1.95-.925-2.574-1.693-.893-1.095-1.225-2.58-1.198-4.017.028-1.437.427-2.866 1.236-3.98.809-1.113 1.959-1.905 3.236-2.296a7.298 7.298 0 0 1 1.609-.412z"})})}].map(e=>{let{key:t,label:a,placeholder:l,icon:n}=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"".concat(ld[t]?"text-green-600":"text-gray-300"),children:n}),a,!ld[t]&&(0,s.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-auto",children:"не заполнено"})]}),(0,s.jsx)("input",{type:"url",value:ld[t],onChange:e=>lc(a=>({...a,[t]:e.target.value})),placeholder:l,className:"w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(ld[t]?"border-green-300 bg-green-50/30":"border-gray-300")})]},t)}),(0,s.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,s.jsx)("button",{onClick:rr,disabled:lm,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:lm?ed("admin.settings.saving"):ed("common.save")}),lu&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"seo"===sC&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:ed("admin.settings.seo.title")}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.seo.maintenance_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:ed("admin.settings.seo.maintenance_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>la(e=>({...e,maintenanceMode:!e.maintenanceMode})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(lt.maintenanceMode?"bg-red-500":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(lt.maintenanceMode?"translate-x-5":"translate-x-1")})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.seo.indexing_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:ed("admin.settings.seo.indexing_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>la(e=>({...e,indexingEnabled:!e.indexingEnabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(lt.indexingEnabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(lt.indexingEnabled?"translate-x-5":"translate-x-1")})})]}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:[ed("admin.settings.seo.site_title_label")," / ",ed("admin.settings.seo.site_description_label")]}),(0,s.jsx)("div",{className:"flex gap-1 mb-3",children:[{code:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"EL"},{code:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"EN"},{code:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"RU"},{code:"uk",flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"UK"}].map(e=>{let{code:t,flag:a,label:l}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>lo(t),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(li===t?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:[a," ",l]},t)})}),(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.settings.seo.site_title_label")}),(0,s.jsx)("input",{value:lt["siteTitle".concat(li.charAt(0).toUpperCase()+li.slice(1))],onChange:e=>la(t=>({...t,["siteTitle".concat(li.charAt(0).toUpperCase()+li.slice(1))]:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3",placeholder:"el"===li?"CanHelp — Κάθε άνθρωπος έχει κάτι να προσφέρει":"en"===li?"CanHelp — Everyone has something valuable to offer":"ru"===li?"CanHelp — Каждый человек может чем-то помочь":"CanHelp — Кожен має навичку, яка може допомогти іншому"}),(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.settings.seo.site_description_label")}),(0,s.jsx)("textarea",{rows:3,value:lt["siteDescription".concat(li.charAt(0).toUpperCase()+li.slice(1))],onChange:e=>la(t=>({...t,["siteDescription".concat(li.charAt(0).toUpperCase()+li.slice(1))]:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none",placeholder:"el"===li?"Η ελληνική πλατφόρμα για online ανάθεση εργασιών...":"en"===li?"The Greek platform for online task delegation...":"ru"===li?"Греческая платформа для онлайн-поиска специалистов...":"Грецька платформа для пошуку фахівців онлайн..."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.seo.head_scripts_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:ed("admin.settings.seo.head_scripts_hint")}),(0,s.jsx)("textarea",{rows:6,value:lt.headScripts,onChange:e=>la(t=>({...t,headScripts:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y",placeholder:"\x3c!-- Google Tag Manager --\x3e\n