403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/admin.copyrightchain.it/html/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/admin.copyrightchain.it/html/assets/index-B4d7z6yq.js
import{c as d,u as ze,r,j as e,S as Ee,L as g,a as Oe,b as Pe}from"./index-0V3kacYJ.js";/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ue=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],$e=d("activity",Ue);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Le=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],Me=d("circle-plus",Le);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ge=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Re=d("copy",Ge);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ke=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Fe=d("funnel",Ke);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const De=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],qe=d("image",De);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ve=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Be=d("key-round",Ve);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const He=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],re=d("refresh-cw",He);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xe=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],le=d("rocket",Xe);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Je=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ie=d("settings",Je);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qe=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],We=d("share-2",Qe);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ye=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Ze=d("users",Ye),S="https://app.copyrightchain.it/api/ai";async function et(){return(await fetch(`${S}/health`,{method:"GET"})).json()}async function tt(m,a,x){return(await fetch(`${S}/admin/set-keys`,{method:"POST",headers:{"Content-Type":"application/json","X-CCP-Token":m},body:JSON.stringify({openaiApiKey:a,geminiApiKey:x})})).json()}async function ne(m,a,x){return(await fetch(`${S}/text`,{method:"POST",headers:{"Content-Type":"application/json","X-CCP-Token":m},body:JSON.stringify({provider:a,prompt:x})})).json()}async function st(m,a,x,b){return(await fetch(`${S}/image`,{method:"POST",headers:{"Content-Type":"application/json","X-CCP-Token":m},body:JSON.stringify({provider:a,prompt:x,aspect_ratio:b})})).json()}const h="ccp_ai_admin_token";function rt(m){const{notify:a}=ze(),[x,b]=r.useState("stats"),[y,ce]=r.useState("Post"),[T,oe]=r.useState("LinkedIn"),[P,de]=r.useState("1:1"),[f,xe]=r.useState(""),[U,pe]=r.useState("openai"),[$,me]=r.useState("gemini"),[L,M]=r.useState(!1),[G,R]=r.useState(!1),[_,he]=r.useState(""),[A,ue]=r.useState(""),[p,ge]=r.useState(localStorage.getItem(h)||""),[K,F]=r.useState(""),[D,q]=r.useState(""),[o,V]=r.useState(null),[B,H]=r.useState(!1),[X,J]=r.useState(!1),[Q,W]=r.useState([]),[be,Y]=r.useState(!1),[I,fe]=r.useState(""),[j,ke]=r.useState(""),[z,ye]=r.useState(!0),[w,Z]=r.useState(null),[ee,N]=r.useState([]),[je,te]=r.useState(!1),we=async t=>{try{await navigator.clipboard.writeText(t),a("Copiato","success")}catch{a("Copia non riuscita","error")}};async function v(){try{const t=await et();V(t)}catch{V({ok:!1})}}r.useEffect(()=>{v()},[]);const se=r.useMemo(()=>{const t=m.lang==="it"?"Italiano":"English";return`Tipo: ${y}
Canale: ${T}
Lingua: ${t}
Contesto: ${f}`.trim()},[y,T,m.lang,f]);async function Ne(){if(!p)return a("Imposta il token AI in Systems","error");M(!0);try{const t=await ne(p,U,se+`

Genera copy marketing pronto da pubblicare, con CTA e 3 varianti.`);if(!t.ok)throw new Error(t.error||"AI error");he(t.text||"")}catch(t){a((t==null?void 0:t.message)||"Errore generazione testo","error")}finally{M(!1)}}async function ve(){if(!p)return a("Imposta il token AI in Systems","error");R(!0);try{const t=await st(p,$,`Crea un visual marketing professionale. ${se}`,P);if(!t.ok)throw new Error(t.error||"AI error");ue(t.data_url||"")}catch(t){a((t==null?void 0:t.message)||"Errore generazione immagine","error")}finally{R(!1)}}async function Ce(){if(!p)return a("Token AI mancante","error");H(!0);try{localStorage.setItem(h,p);const t=await tt(p,K||void 0,D||void 0);if(!(t!=null&&t.ok))throw new Error((t==null?void 0:t.error)||"Save keys failed");F(""),q(""),await v(),a("Chiavi salvate nel gateway","success")}catch(t){a((t==null?void 0:t.message)||"Errore salvataggio","error")}finally{H(!1)}}async function Se(){if(!p)return a("Token AI mancante","error");J(!0);try{const t=await ne(p,"openai","Rispondi solo con OK.");if(!t.ok)throw new Error(t.error||"Test failed");a("AI OK","success"),await v()}catch(t){a((t==null?void 0:t.message)||"Test AI fallito","error")}finally{J(!1)}}async function E(){const t=localStorage.getItem(h)||"";if(!t){a("Imposta prima il token admin in Systems","error");return}Y(!0);try{const s=await fetch("https://app.copyrightchain.it/api/ai/tower/users",{method:"GET",headers:{"X-CCP-Token":t}}),i=await s.text(),n=i?JSON.parse(i):null;if(console.log("TOWER USERS RESPONSE",n),!s.ok||!(n!=null&&n.ok))throw new Error((n==null?void 0:n.error)||"Errore caricamento utenti Tower");const l=Array.isArray(n.users)?n.users:[];W(l)}catch(s){console.error("LOAD TOWER USERS ERROR",s),a((s==null?void 0:s.message)||"Errore caricamento utenti Tower","error"),W([])}finally{Y(!1)}}async function Te(t,s){const i=localStorage.getItem(h)||"";if(!i){a("Imposta prima il token admin in Systems","error");return}const n=window.prompt(`Importo ABO da caricare per ${s||t}`,"1");if(n===null)return;const l=Number(String(n).replace(",","."));if(!Number.isFinite(l)||l===0){a("Importo non valido","error");return}const C=window.prompt("Causale operazione",`Ricarica manuale Tower per ${s||t}`)||"";try{const c=await fetch("https://app.copyrightchain.it/api/ai/tower/users/credit",{method:"POST",headers:{"Content-Type":"application/json","X-CCP-Token":i},body:JSON.stringify({user_id:t,amount:l,note:C})}),ae=await c.text(),u=ae?JSON.parse(ae):null;if(!c.ok||!(u!=null&&u.ok))throw new Error((u==null?void 0:u.error)||"Errore ricarica ABO");a(`Ricarica completata: ${l}`,"success"),await E()}catch(c){a((c==null?void 0:c.message)||"Errore ricarica ABO","error")}}async function _e(t,s){const i=localStorage.getItem(h)||"";if(!i){a("Imposta prima il token admin in Systems","error");return}const n=window.prompt(`Nuova password temporanea per ${s||t}`,"TempPass2026!");if(n!==null){if(!n||n.length<8){a("Password troppo debole","error");return}try{const l=await fetch("https://app.copyrightchain.it/api/ai/tower/users/reset-password",{method:"POST",headers:{"Content-Type":"application/json","X-CCP-Token":i},body:JSON.stringify({user_id:t,new_password:n})}),C=await l.text(),c=C?JSON.parse(C):null;if(!l.ok||!(c!=null&&c.ok))throw new Error((c==null?void 0:c.error)||"Errore reset password");a("Password reimpostata. Cambio obbligatorio al prossimo login.","success"),await E()}catch(l){a((l==null?void 0:l.message)||"Errore reset password","error")}}}async function Ae(t){const s=localStorage.getItem(h)||"";if(!s){a("Imposta prima il token admin in Systems","error");return}Z(t),N([]),te(!0);try{const i=await fetch(`https://app.copyrightchain.it/api/ai/tower/users/${encodeURIComponent(t.id)}/certificates`,{method:"GET",headers:{"X-CCP-Token":s}}),n=await i.text(),l=n?JSON.parse(n):null;if(!i.ok||!(l!=null&&l.ok))throw new Error((l==null?void 0:l.error)||"Errore caricamento certificati utente");N(Array.isArray(l.certificates)?l.certificates:[])}catch(i){a((i==null?void 0:i.message)||"Errore caricamento certificati utente","error"),N([])}finally{te(!1)}}function Ie(t){const s=localStorage.getItem(h)||"";if(!s){a("Imposta prima il token admin in Systems","error");return}const i=`https://app.copyrightchain.it/api/ai/tower/certificates/file?path=${encodeURIComponent(t)}&token=${encodeURIComponent(s)}`;window.open(i,"_blank","noopener,noreferrer")}const O=({id:t,label:s,icon:i})=>e.jsxs("button",{onClick:()=>b(t),className:`px-5 py-3 rounded-2xl text-[11px] font-black uppercase tracking-widest flex items-center gap-2 transition-all ${x===t?"bg-slate-900 text-white shadow":"text-slate-500 hover:text-slate-900 hover:bg-slate-50"}`,children:[i,s]}),k=r.useMemo(()=>{const t=I.trim().toLowerCase();return Q.filter(s=>{const i=!s.email&&!s.token||String(s.id||"").trim()==="TOK_CLIENTE_1"||String(s.id||"").trim()==="u1"&&String(s.token||"").trim()==="TOK_CLIENTE_1";return z&&i||j&&String(s.plan||"").toLowerCase()!==j.toLowerCase()?!1:t?[s.name||"",s.email||"",s.id||"",s.token||"",s.plan||""].join(" ").toLowerCase().includes(t):!0})},[Q,I,j,z]);return e.jsxs("div",{className:"p-10 space-y-10",children:[e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(O,{id:"stats",label:"Stats",icon:e.jsx($e,{size:16})}),e.jsx(O,{id:"growth",label:"Growth",icon:e.jsx(le,{size:16})}),e.jsx(O,{id:"systems",label:"Systems",icon:e.jsx(ie,{size:16})})]}),x==="stats"&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"bg-white p-10 rounded-[3rem] border border-slate-100 shadow-xl",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-black uppercase tracking-tight",children:"Tower Overview"}),e.jsx("p",{className:"text-slate-500 text-sm mt-3",children:"Questa sezione è per amministrazione interna (Tower). Il cliente non la vede."})]}),e.jsxs("button",{onClick:E,className:"px-4 py-3 rounded-2xl bg-slate-50 border border-slate-100 text-slate-600 font-black uppercase text-[10px] tracking-widest flex items-center gap-2",children:[e.jsx(re,{size:14}),"refresh users"]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Users"}),e.jsx("div",{className:"text-2xl font-black",children:k.length})]}),e.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Certificates"}),e.jsx("div",{className:"text-2xl font-black",children:k.reduce((t,s)=>t+Number(s.cert_count||0),0)})]}),e.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"ABO Balance"}),e.jsx("div",{className:"text-2xl font-black",children:k.reduce((t,s)=>t+Number(s.balance_abo||0),0).toFixed(2)})]}),e.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[e.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"AI Gateway"}),e.jsx("div",{className:"text-2xl font-black",children:o!=null&&o.ok?"OK":"—"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-100 shadow-xl overflow-hidden",children:[e.jsxs("div",{className:"px-8 py-6 border-b border-slate-100 space-y-5",children:[e.jsx("div",{className:"flex items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsxs("h4",{className:"text-xl font-black uppercase tracking-tight flex items-center gap-3",children:[e.jsx(Ze,{size:20,className:"text-blue-600"})," Utenti registrati"]}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:"Utenti reali letti dal gateway Tower."})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"md:col-span-2 relative",children:[e.jsx(Ee,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("input",{value:I,onChange:t=>fe(t.target.value),placeholder:"Cerca per nome, email, ID, token...",className:"w-full pl-12 pr-4 py-4 bg-slate-50 border border-slate-100 rounded-2xl font-bold text-sm outline-none"})]}),e.jsxs("select",{value:j,onChange:t=>ke(t.target.value),className:"w-full p-4 bg-slate-50 border border-slate-100 rounded-2xl font-black text-xs uppercase outline-none",children:[e.jsx("option",{value:"",children:"Tutti i piani"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"pro",children:"Pro"}),e.jsx("option",{value:"free",children:"Free"})]}),e.jsxs("label",{className:"flex items-center gap-3 px-4 py-4 bg-slate-50 border border-slate-100 rounded-2xl text-xs font-black uppercase tracking-widest text-slate-700",children:[e.jsx(Fe,{size:14}),e.jsx("input",{type:"checkbox",checked:z,onChange:t=>ye(t.target.checked)}),"Nascondi sporchi"]})]})]}),be?e.jsxs("div",{className:"p-10 flex items-center justify-center gap-3 text-slate-500 font-bold",children:[e.jsx(g,{size:18,className:"animate-spin"})," Caricamento utenti..."]}):k.length===0?e.jsx("div",{className:"p-10 text-slate-500 font-medium",children:"Nessun utente disponibile con i filtri correnti."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[1100px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Utente"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Email"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"ID"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Token"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Plan"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"ABO"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Certificati"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Azioni"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50",children:k.map(t=>e.jsxs("tr",{className:"hover:bg-slate-50/40",children:[e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"font-black text-slate-900",children:t.name||"—"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-sm font-bold text-slate-700",children:t.email||"—"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-xs font-mono font-black text-slate-600",children:t.id||"—"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-xs font-mono font-black text-slate-600 break-all max-w-[260px]",children:t.token||"—"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("span",{className:"inline-flex px-3 py-1 rounded-full bg-slate-100 text-slate-700 text-[10px] font-black uppercase tracking-widest",children:t.plan||"free"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-sm font-black text-slate-900",children:Number(t.balance_abo||0).toFixed(2)})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-sm font-black text-slate-900",children:Number(t.cert_count||0)})}),e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs("button",{onClick:()=>Te(t.id,t.name||t.email||t.id),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-blue-600 text-white text-[10px] font-black uppercase tracking-widest shadow hover:bg-blue-700",children:[e.jsx(Me,{size:14}),"Ricarica ABO"]}),e.jsx("button",{onClick:()=>_e(t.id,t.name||t.email||t.id),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-slate-900 text-white text-[10px] font-black uppercase tracking-widest shadow hover:bg-slate-800",children:"Reset PW"}),e.jsx("button",{onClick:()=>Ae(t),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-emerald-600 text-white text-[10px] font-black uppercase tracking-widest shadow hover:bg-emerald-700",children:"Certificati"})]})})]},t.id))})]})})]}),w&&e.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-100 shadow-xl overflow-hidden",children:[e.jsxs("div",{className:"px-8 py-6 border-b border-slate-100 flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-xl font-black uppercase tracking-tight",children:"Certificati utente"}),e.jsxs("p",{className:"text-slate-500 text-sm mt-2",children:[w.name||"—"," · ",w.email||w.id]})]}),e.jsx("button",{onClick:()=>{Z(null),N([])},className:"px-4 py-3 rounded-2xl bg-slate-50 border border-slate-100 text-slate-600 font-black uppercase text-[10px] tracking-widest",children:"Chiudi"})]}),je?e.jsxs("div",{className:"p-10 flex items-center justify-center gap-3 text-slate-500 font-bold",children:[e.jsx(g,{size:18,className:"animate-spin"})," Caricamento certificati..."]}):ee.length===0?e.jsx("div",{className:"p-10 text-slate-500 font-medium",children:"Nessun certificato trovato per questo utente."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[1100px]",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"ID"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Titolo/File"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Tipo"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Stato"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Data"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Hash"}),e.jsx("th",{className:"px-6 py-4 text-left text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Azioni"})]})}),e.jsx("tbody",{className:"divide-y divide-slate-50",children:ee.map(t=>e.jsxs("tr",{className:"hover:bg-slate-50/40",children:[e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-xs font-mono font-black text-slate-700",children:(t==null?void 0:t.cert_id)||(t==null?void 0:t.request_id)||"—"})}),e.jsxs("td",{className:"px-6 py-5",children:[e.jsx("div",{className:"font-black text-slate-900",children:(t==null?void 0:t.title)||"—"}),e.jsx("div",{className:"text-xs font-bold text-slate-500 break-all",children:(t==null?void 0:t.original_filename)||"—"})]}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("span",{className:"inline-flex px-3 py-1 rounded-full bg-slate-100 text-slate-700 text-[10px] font-black uppercase tracking-widest",children:(t==null?void 0:t.cert_type)||"base"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("span",{className:`inline-flex px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest ${((t==null?void 0:t.blockchain_status)||"")==="confirmed"?"bg-emerald-50 text-emerald-700":((t==null?void 0:t.blockchain_status)||"")==="pending"?"bg-amber-50 text-amber-700":"bg-slate-100 text-slate-700"}`,children:(t==null?void 0:t.blockchain_status)||((t==null?void 0:t.cert_type)==="base"?"base":"—")})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-sm font-black text-slate-900",children:(t==null?void 0:t.deposit_date)||(t==null?void 0:t.ts)||"—"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsx("div",{className:"text-xs font-mono font-black text-slate-600 break-all max-w-[260px]",children:(t==null?void 0:t.file_hash)||"—"})}),e.jsx("td",{className:"px-6 py-5",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t!=null&&t.verify_url?e.jsx("a",{href:t.verify_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-blue-600 text-white text-[10px] font-black uppercase tracking-widest shadow hover:bg-blue-700",children:"Verifica"}):null,t!=null&&t.certificate_path?e.jsx("button",{onClick:()=>Ie(t.certificate_path),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-slate-900 text-white text-[10px] font-black uppercase tracking-widest shadow hover:bg-slate-800",children:"Apri PDF"}):null]})})]},String((t==null?void 0:t.cert_id)||(t==null?void 0:t.request_id)||Math.random())))})]})})]})]}),x==="growth"&&e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"bg-white p-12 rounded-[4rem] border border-slate-100 shadow-xl space-y-10",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("h3",{className:"text-2xl font-black uppercase tracking-tight flex items-center gap-4",children:[e.jsx(Oe,{size:28,className:"text-indigo-600"})," Growth Hub (Marketing)"]}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-slate-400",children:[e.jsx(We,{size:14}),"solo admin"]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Cosa vuoi promuovere?"}),e.jsx("textarea",{value:f,onChange:t=>xe(t.target.value),className:"w-full p-8 bg-slate-50 border border-slate-100 rounded-[2.5rem] text-sm font-medium h-48 outline-none",placeholder:"Es: Feature OTS + prova gratuita 7 giorni..."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Formato"}),e.jsxs("select",{value:y,onChange:t=>ce(t.target.value),className:"w-full p-5 bg-slate-50 border border-slate-100 rounded-3xl font-black text-xs uppercase outline-none",children:[e.jsx("option",{children:"Post"}),e.jsx("option",{children:"Email"}),e.jsx("option",{children:"Blog"}),e.jsx("option",{children:"Ad"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Canale"}),e.jsxs("select",{value:T,onChange:t=>oe(t.target.value),className:"w-full p-5 bg-slate-50 border border-slate-100 rounded-3xl font-black text-xs uppercase outline-none",children:[e.jsx("option",{value:"LinkedIn",children:"LinkedIn"}),e.jsx("option",{value:"Instagram",children:"Instagram"}),e.jsx("option",{value:"X (Twitter)",children:"X (Twitter)"}),e.jsx("option",{value:"Email",children:"Newsletter"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Aspect Ratio"}),e.jsxs("select",{value:P,onChange:t=>de(t.target.value),className:"w-full p-5 bg-slate-50 border border-slate-100 rounded-3xl font-black text-xs uppercase outline-none",children:[e.jsx("option",{value:"1:1",children:"1:1"}),e.jsx("option",{value:"16:9",children:"16:9"}),e.jsx("option",{value:"9:16",children:"9:16"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Provider"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("select",{value:U,onChange:t=>pe(t.target.value),className:"w-full p-5 bg-slate-50 border border-slate-100 rounded-3xl font-black text-xs uppercase outline-none",children:[e.jsx("option",{value:"openai",children:"Text: OpenAI"}),e.jsx("option",{value:"gemini",children:"Text: Gemini"})]}),e.jsx("select",{value:$,onChange:t=>me(t.target.value),className:"w-full p-5 bg-slate-50 border border-slate-100 rounded-3xl font-black text-xs uppercase outline-none",children:e.jsx("option",{value:"gemini",children:"Image: Gemini"})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx("button",{onClick:Ne,disabled:L||!f,className:"py-6 bg-slate-900 text-white rounded-[2rem] font-black uppercase text-[10px] tracking-widest shadow-2xl flex items-center justify-center gap-3",children:L?e.jsx(g,{size:18,className:"animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(le,{size:18})," Genera Testo"]})}),e.jsx("button",{onClick:ve,disabled:G||!f,className:"py-6 bg-indigo-600 text-white rounded-[2rem] font-black uppercase text-[10px] tracking-widest shadow-2xl flex items-center justify-center gap-3",children:G?e.jsx(g,{size:18,className:"animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(qe,{size:18})," Genera Immagine"]})})]})]})]})]}),(_||A)&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"bg-slate-900 text-white p-10 rounded-[3rem] shadow-2xl flex flex-col",children:[e.jsx("div",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-widest mb-6",children:"Testo generato"}),e.jsx("pre",{className:"text-sm whitespace-pre-wrap flex-1",children:_}),e.jsxs("button",{onClick:()=>we(_),className:"w-full py-4 mt-6 bg-white/5 border border-white/10 rounded-2xl font-black uppercase text-[10px] tracking-widest flex items-center justify-center gap-2 hover:bg-white/10",children:[e.jsx(Re,{size:14}),"Copia"]})]}),e.jsx("div",{className:"bg-white p-3 rounded-[3rem] shadow-2xl border border-slate-100 overflow-hidden",children:A?e.jsx("img",{src:A,className:"w-full h-full object-cover rounded-[2.6rem]",alt:"AI Visual"}):null})]})]}),x==="systems"&&e.jsxs("div",{className:"bg-white p-12 rounded-[4rem] border border-slate-100 shadow-xl space-y-8",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("h3",{className:"text-2xl font-black uppercase tracking-tight flex items-center gap-4",children:[e.jsx(ie,{size:28,className:"text-blue-600"})," Systems (Tecnico)"]}),e.jsxs("button",{onClick:v,className:"px-4 py-3 rounded-2xl bg-slate-50 border border-slate-100 text-slate-600 font-black uppercase text-[10px] tracking-widest flex items-center gap-2",children:[e.jsx(re,{size:14}),"refresh"]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"p-8 bg-slate-50 rounded-[3rem] border border-slate-100 space-y-5",children:[e.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"AI Gateway"}),e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Admin Token"}),e.jsx("input",{value:p,onChange:t=>ge(t.target.value),className:"w-full p-5 bg-white border border-slate-100 rounded-3xl font-black text-xs outline-none",placeholder:"CCP_AI_ADMIN_TOKEN"}),e.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"OpenAI API Key (opzionale)"}),e.jsx("input",{value:K,onChange:t=>F(t.target.value),className:"w-full p-5 bg-white border border-slate-100 rounded-3xl font-black text-xs outline-none",placeholder:"sk-..."}),e.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Gemini API Key (opzionale)"}),e.jsx("input",{value:D,onChange:t=>q(t.target.value),className:"w-full p-5 bg-white border border-slate-100 rounded-3xl font-black text-xs outline-none",placeholder:"AIza..."})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("button",{onClick:Ce,disabled:B,className:"py-5 bg-slate-900 text-white rounded-2xl font-black uppercase text-[10px] tracking-widest shadow-xl flex items-center justify-center gap-2",children:B?e.jsx(g,{size:16,className:"animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(Pe,{size:16}),"Salva"]})}),e.jsx("button",{onClick:Se,disabled:X,className:"py-5 bg-blue-600 text-white rounded-2xl font-black uppercase text-[10px] tracking-widest shadow-xl flex items-center justify-center gap-2",children:X?e.jsx(g,{size:16,className:"animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{size:16}),"Test"]})})]}),e.jsxs("div",{className:"text-xs text-slate-600 leading-relaxed",children:["Stato gateway: ",e.jsx("b",{children:o!=null&&o.ok?"OK":"—"}),e.jsx("br",{}),"OpenAI key nel gateway: ",e.jsx("b",{children:o!=null&&o.has_openai_key?"OK":"NO"}),e.jsx("br",{}),"Gemini key nel gateway: ",e.jsx("b",{children:o!=null&&o.has_gemini_key?"OK":"NO"})]}),e.jsx("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-2xl text-xs text-blue-900 leading-relaxed",children:"Le chiavi AI di produzione sono già caricate sul VPS nel gateway. Questa sezione va considerata come pannello tecnico di override/test e non come configurazione obbligatoria per il funzionamento quotidiano."})]}),e.jsxs("div",{className:"p-8 bg-slate-50 rounded-[3rem] border border-slate-100 space-y-5",children:[e.jsx("div",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Note"}),e.jsx("div",{className:"text-sm text-slate-600 leading-relaxed",children:e.jsxs("ul",{className:"list-disc pl-5 space-y-2",children:[e.jsx("li",{children:"Questa sezione è solo per Tower (admin)."}),e.jsx("li",{children:"Le chiavi di produzione sono già salvate sul VPS nel gateway."}),e.jsx("li",{children:"I campi qui servono solo per override tecnico o test manuali."})]})}),e.jsxs("div",{className:"p-5 bg-white rounded-2xl border border-slate-100 text-xs text-slate-600",children:["Se il gateway non risponde: controlla systemd ",e.jsx("code",{children:"sudo systemctl status ccp-ai-gateway"})," e NGINX ",e.jsx("code",{children:"sudo nginx -t"}),"."]})]})]})]})]})}export{rt as default};

Youez - 2016 - github.com/yon3zu
LinuXploit