1import{r as o,j as e,L as i}from"./react-vendor-ohbTzJRI.js";import{A as h}from"./AdminOps-Dc8SvSSU.js";import{b as y}from"./index-D1o2tJ-j.js";import{L as g,M as w,N as j,O as A,o as C,P as k}from"./adminOpsService-BgB3AzEr.js";import{n as E,f as L,aU as T}from"./icons-LAdgFhr5.js";import{u as O,A as P}from"./AdminSectionSubnav-gb-7D0f9.js";import{AdminBillingPanel as B}from"./AdminBillingPage-DS66_rWG.js";import"./qualityScore-CteX2p9K.js";import"./SupportTriagePanel-CyEB7AMV.js";import"./supportTickets-BPr80n27.js";import"./firebase-D8cOeYln.js";import"./roadmaps-CoMmiKDd.js";import"./certificate-DiexGYCs.js";import"./motion-DJMSkCk0.js";function _(){const{user:s,isPlatformAdmin:r}=y(),[a,l]=o.useState({...g}),[S,m]=o.useState(!0),[x,c]=o.useState(!1),[p,b]=o.useState(""),[f,n]=o.useState("");if(o.useEffect(()=>{if(!r){m(!1);return}(async()=>{try{l(await w())}catch{l({...g}),n("تعذر ÙØ±Ø§Ø¡Ø© إعدادات Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª â Ø§ÙÙÙÙ
Ø§ÙØ§ÙØªØ±Ø§Ø¶ÙØ© (Ù
عطÙÙØ©).")}finally{m(!1)}})()},[r]),!r)return e.jsxs("div",{className:"py-12 text-center",dir:"rtl","data-testid":"admin-ads-denied",children:[e.jsx(E,{className:"mx-auto text-amber-500 mb-4",size:48}),e.jsx("h2",{className:"text-xl font-bold text-slate-900 mb-2",children:"ØºÙØ± Ù
تاØ"}),e.jsx("p",{className:"text-slate-600",children:"إعدادات AdSense ÙÙ
سؤÙ٠اÙÙ
ÙØµÙØ© ÙÙØ·."})]});const v=async()=>{if(s!=null&&s.uid){b(""),n(""),c(!0);try{const t={adsEnabled:a.adsEnabled===!0,adsClient:a.adsClient.trim(),adsSlotLessonCompletion:a.adsSlotLessonCompletion.trim(),adsSlotBelowVideo:a.adsSlotBelowVideo.trim()};await A(t,s.uid),l(t),b(j(t)?"تÙ
ØÙظ platform_config/ads â Ø¥Ø¹Ùا٠أسÙ٠اÙÙÙØ¯ÙÙ + بعد Ø§ÙØªÙ
Ø§Ù Ø§ÙØ¯Ø±Ø³ ÙÙÙ
ؤÙÙÙÙÙ.":"تÙ
Ø§ÙØÙØ¸ â Ø§ÙØ¥Ø¹ÙØ§Ùات Ù
Ø®ÙÙØ© ØØªÙ Ø§ÙØªÙعÙÙ ÙÙØ¬Ùد Ù
عرÙÙ Ø§ÙØ¹Ù
ÙÙ ÙØ±Ù
ز ÙØØ¯Ø© ÙØ§ØØ¯ عÙÙ Ø§ÙØ£ÙÙ.")}catch{n("تعذر ØÙظ إعدادات Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª.")}finally{c(!1)}}};if(S)return e.jsx("div",{className:"flex min-h-[20vh] items-center justify-center","aria-busy":"true",children:e.jsx(L,{className:"animate-spin text-emerald-600",size:32})});const u=j(a);return e.jsxs("div",{className:"space-y-4 rounded-2xl border border-slate-200 bg-white p-6",dir:"rtl","data-testid":"admin-ads-panel",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(T,{className:"mt-0.5 shrink-0 text-emerald-600",size:28}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-black text-slate-900",children:"Ø¥Ø¹ÙØ§Ùات AdSense"}),e.jsx("p",{className:"text-sm text-slate-500",children:"ÙØØ¯ØªØ§Ù ÙÙ Ù
شغÙÙ Ø§ÙØ¯Ø±Ùس: Ù
ستطÙ٠أسÙ٠اÙÙÙØ¯ÙÙ + Ø´Ø±ÙØ· بعد Ø§ÙØªÙ
Ø§Ù Ø§ÙØ¯Ø±Ø³ · Ù
Ø®ÙÙ ØØªÙ Ø§ÙØªÙعÙ٠· ÙÙØ²Ù
Ù
عرÙÙ Ø§ÙØ¹Ù
ÙÙ (ca-pub-â¦) ÙØ±Ù
ز ÙØØ¯Ø© ÙØ§ØØ¯ عÙÙ Ø§ÙØ£ÙÙ"})]})]}),e.jsx("p",{className:`rounded-xl border px-3 py-2 text-xs ${u?"border-emerald-100 bg-emerald-50 text-emerald-900":"border-amber-100 bg-amber-50 text-amber-900"}`,"data-testid":"admin-ads-status",children:u?"Ø§ÙØØ§ÙØ©: Ø³ØªØ¸ÙØ± Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª ÙÙØ·Ùاب اÙÙ
جاÙÙÙ٠اÙÙ
سجÙÙÙÙ (Ù
ÙØ¹ÙÙ + رÙ
ÙØ² ÙØ§Ù
ÙØ©).":"Ø§ÙØØ§ÙØ©: Ù
Ø®ÙÙ ØØªÙ Ø§ÙØªÙعÙÙ â Ø§ÙØ§ÙØªØ±Ø§Ø¶Ù Ù
عطÙÙ ÙÙØ§ ÙØ¸Ùر Ø´ÙØ¡ ÙÙØ·Ùاب."}),e.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-xl border border-slate-100 px-3 py-3 text-sm",children:[e.jsxs("span",{children:[e.jsx("span",{className:"font-bold",children:"ØªÙØ¹ÙÙ Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª"}),e.jsx("span",{className:"ms-2 font-mono text-xs text-slate-400",dir:"ltr",children:"adsEnabled"}),e.jsx("span",{className:"mt-0.5 block text-xs text-slate-500",children:"Ø§ÙØªØ±Ø§Ø¶Ùا٠Ù
تÙÙÙÙ â Ø§ÙØ¥Ø¹ÙØ§Ùات Ù
Ø®ÙÙØ© ØØªÙ Ø§ÙØªÙعÙÙ"})]}),e.jsx("input",{type:"checkbox",checked:a.adsEnabled===!0,onChange:t=>l(d=>({...d,adsEnabled:t.target.checked})),"data-testid":"admin-ads-enabled"})]}),e.jsxs("label",{className:"block space-y-1 text-sm",children:[e.jsx("span",{className:"font-bold text-slate-800",children:"Ù
عرÙ٠عÙ
ÙÙ AdSense"}),e.jsx("span",{className:"ms-2 font-mono text-xs text-slate-400",dir:"ltr",children:"adsClient"}),e.jsx("input",{type:"text",dir:"ltr",className:"w-full rounded-xl border border-slate-200 px-3 py-2 font-mono text-sm",placeholder:"ca-pub-xxxxxxxxxxxxxxxx",value:a.adsClient,onChange:t=>l(d=>({...d,adsClient:t.target.value})),"data-testid":"admin-ads-client",autoComplete:"off"})]}),e.jsxs("label",{className:"block space-y-1 text-sm",children:[e.jsx("span",{className:"font-bold text-slate-800",children:"رÙ
ز ÙØØ¯Ø© Ø¥Ø¹ÙØ§Ù Ø§ÙØªÙ
Ø§Ù Ø§ÙØ¯Ø±Ø³"}),e.jsx("span",{className:"ms-2 font-mono text-xs text-slate-400",dir:"ltr",children:"adsSlotLessonCompletion"}),e.jsx("input",{type:"text",dir:"ltr",className:"w-full rounded-xl border border-slate-200 px-3 py-2 font-mono text-sm",placeholder:"1234567890",value:a.adsSlotLessonCompletion,onChange:t=>l(d=>({...d,adsSlotLessonCompletion:t.target.value})),"data-testid":"admin-ads-slot",autoComplete:"off"})]}),e.jsxs("label",{className:"block space-y-1 text-sm",children:[e.jsx("span",{className:"font-bold text-slate-800",children:"رÙ
ز ÙØØ¯Ø© اÙÙ
ستطÙ٠أسÙ٠اÙÙÙØ¯ÙÙ"}),e.jsx("span",{className:"ms-2 font-mono text-xs text-slate-400",dir:"ltr",children:"adsSlotBelowVideo"}),e.jsx("input",{type:"text",dir:"ltr",className:"w-full rounded-xl border border-slate-200 px-3 py-2 font-mono text-sm",placeholder:"1234567890 (أ٠اترÙÙ ÙØ§Ø±ØºØ§Ù ÙØ§Ø³ØªØ®Ø¯Ø§Ù
ÙØØ¯Ø© Ø§ÙØªÙ
Ø§Ù Ø§ÙØ¯Ø±Ø³)",value:a.adsSlotBelowVideo,onChange:t=>l(d=>({...d,adsSlotBelowVideo:t.target.value})),"data-testid":"admin-ads-slot-below-video",autoComplete:"off"}),e.jsx("span",{className:"block text-xs text-slate-500",children:"Ø¥Ù ØªÙØ±Ù ÙØ§Ø±ØºØ§Ù ØªÙØ³ØªØ®Ø¯Ù
ÙØØ¯Ø© Ø§ÙØªÙ
Ø§Ù Ø§ÙØ¯Ø±Ø³ ÙØ¨Ø¯ÙÙ (ÙØ§ÙØ¹ÙØ³ صØÙØ)."})]}),p&&e.jsx("p",{className:"text-sm font-bold text-emerald-700",role:"status",children:p}),f&&e.jsx("p",{className:"text-sm font-bold text-rose-700",role:"alert",children:f}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void v(),className:"rounded-xl bg-emerald-600 px-5 py-2 font-bold text-white disabled:opacity-50","data-testid":"admin-ads-save",children:x?"Ø¬Ø§Ø±Ù Ø§ÙØÙØ¸â¦":"ØÙظ إعدادات Ø§ÙØ¥Ø¹ÙØ§ÙØ§Øª"})]})}const N=[{id:"billing",label:"اÙÙÙØªØ±Ø© / Stripe"},{id:"flags",label:"Ø£Ø¹ÙØ§Ù
اÙÙ
ÙØ²Ø§Øª"},{id:"ads",label:"Ø¥Ø¹ÙØ§Ùات AdSense"},{id:"ops",label:"Ø§ÙØ¹Ù
ÙÙØ§Øª"},{id:"cron",label:"Cron / إعادة خبز"}],R=["certificates","flags"];function Q(){const s=O(N,"billing");return e.jsxs("div",{className:"px-4 py-6 sm:px-6",dir:"rtl","data-testid":"admin-platform-section",children:[e.jsx(P,{tabs:N,defaultTab:"billing",title:"اÙÙ
ÙØµÙØ©",hint:"Ø¬Ø§ÙØ²ÙØ© Stripe (NO-GO Ø¨ÙØ§ Ù
ÙØ§ØªÙØ) · entitlement_grants ÙØ±Ø§Ø¡Ø© · Ø£Ø¹ÙØ§Ù
· AdSense · Ø´ÙØ§Ø¯Ø§Øª · cron â Ø¨Ùا API ÙÙØªØ±Ø© Ø¬Ø¯ÙØ¯"}),s==="billing"&&e.jsx(B,{embedded:!0}),s==="flags"&&e.jsx(h,{embedded:!0,allowedTabs:["flags"],defaultTab:"flags",loginRedirect:"/admin/platform?view=flags"}),s==="ads"&&e.jsx(_,{}),s==="ops"&&e.jsx(h,{embedded:!0,allowedTabs:[...R],defaultTab:"certificates",loginRedirect:"/admin/platform?view=ops"}),s==="cron"&&e.jsxs("div",{className:"space-y-4 rounded-2xl border border-slate-200 bg-white p-6","data-testid":"admin-platform-cron",children:[e.jsx("p",{className:"rounded-xl border border-amber-100 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:"إعادة خبز Ø§ÙØªØºØ·ÙØ© ÙØªØ´ØºÙÙ CRON_SECRET Ù
Ù Ù
ØØ±Ø± Ø§ÙØ¯Ùرات ØªØØª اÙÙ
ØØªÙÙ â ÙØ§ØªØ¨ ÙØ§ØØ¯ ÙØªØ¨ÙÙØ¨Ø§Øª اÙÙ
ØØªÙÙ. ÙØ§ Ù
ÙØ§ØªÙØ Stripe/SendGrid ÙÙØ§."}),e.jsx("p",{className:"text-xs text-slate-500 font-mono",dir:"ltr",children:C()}),e.jsx("p",{className:"text-xs text-slate-500 font-mono",dir:"ltr",children:k}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(i,{to:"/admin/content?view=ops&tab=courses",className:"inline-block rounded-xl bg-emerald-600 px-4 py-2 text-sm font-bold text-white hover:bg-emerald-700","data-testid":"admin-platform-cron-content-cta",children:"ÙØªØ اÙÙ
ØØªÙÙ â Ø§ÙØ¯ÙØ±Ø§Øª / إعادة Ø§ÙØ®Ø¨Ø²"}),e.jsx(i,{to:"/admin/content?view=coverage",className:"inline-block rounded-xl border border-slate-200 bg-slate-50 px-4 py-2 text-sm font-bold text-slate-700 hover:bg-white","data-testid":"admin-platform-cron-coverage-cta",children:"ÙÙØØ© ØªØºØ·ÙØ© اÙÙ
ØØªÙÙ"}),e.jsx(i,{to:"/admin/platform?view=billing",className:"inline-block rounded-xl border border-slate-200 bg-white px-4 py-2 text-sm font-bold text-emerald-800 hover:bg-emerald-50","data-testid":"admin-platform-cron-billing-cta",children:"Ø¬Ø§ÙØ²ÙØ© اÙÙÙØªØ±Ø© (ÙØ±Ø§Ø¡Ø© ÙÙØ·)"})]})]})]})}export{Q as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.