import{_ as b}from"./Layout-C0f8t0-G.js";import{_ as w}from"./AdminNavigation-DiJjvGMz.js";import{_ as v}from"./Breadcrumb--TZgF7yG.js";import{c as l,w as d,a as e,b as c,u as m,l as x,d as n,e as p,o as i,F as C,r as k,t as r,i as f,j as y}from"./app-iLLm8RtX.js";/* empty css            */const A={class:"py-6"},$={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},N={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},P={class:"p-6 text-gray-900"},j={class:"flex justify-between items-center mb-6"},B={class:"overflow-x-auto"},V={class:"min-w-full bg-white border border-gray-200"},D={class:"bg-white divide-y divide-gray-200"},E={class:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},T={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},F={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500"},M={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono"},R={class:"px-6 py-4 whitespace-nowrap text-sm font-medium"},S={class:"flex items-center space-x-2"},L=["onClick"],O=["onClick"],q=["onClick"],z={class:"mt-6 flex justify-between items-center"},G={class:"text-sm text-gray-700"},H={class:"flex space-x-2"},W={__name:"Partners",props:{partners:Object},setup(o){const g=a=>{confirm(`Are you sure you want to reset the access code for ${a.name}? This will generate a new code and invalidate the current one.`)&&y.post(`/admin/partners/${a.id}/reset-code`)},h=a=>{confirm(`Are you sure you want to delete ${a.name}?`)&&y.delete(`/admin/partners/${a.id}`)},_=async a=>{try{await navigator.clipboard.writeText(a),alert("Access code copied to clipboard!")}catch{const s=document.createElement("textarea");s.value=a,document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s),alert("Access code copied to clipboard!")}};return(a,t)=>(i(),l(b,null,{default:d(()=>[e("div",A,[e("div",$,[c(w,{title:"Partner Management"}),c(v,{breadcrumbs:[{name:"Admin",icon:"fas fa-user-shield",url:"/admin"},{name:"Management",icon:"fas fa-cogs"},{name:"Partners",icon:"fas fa-user-tie"}]}),e("div",N,[e("div",P,[e("div",j,[t[1]||(t[1]=e("h2",{class:"text-xl font-bold"},"All Partners",-1)),c(m(x),{href:"/admin/partners/create",class:"bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"},{default:d(()=>[...t[0]||(t[0]=[n(" Add New Partner ",-1)])]),_:1})]),e("div",B,[e("table",V,[t[5]||(t[5]=e("thead",{class:"bg-gray-50"},[e("tr",null,[e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Name"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Email"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Center"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Access Code"),e("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"Actions")])],-1)),e("tbody",D,[(i(!0),p(C,null,k(o.partners.data,s=>(i(),p("tr",{key:s.id},[e("td",E,r(s.name),1),e("td",T,r(s.email),1),e("td",F,r(s.center?.name||"N/A"),1),e("td",M,r(s.access_code),1),e("td",R,[e("div",S,[e("button",{onClick:u=>_(s.access_code),class:"inline-flex items-center px-3 py-1 bg-green-100 hover:bg-green-200 text-green-700 text-xs font-medium rounded-md transition-colors duration-200",title:"Copy Access Code"},[...t[2]||(t[2]=[e("i",{class:"fas fa-copy mr-1"},null,-1),n(" Copy Code ",-1)])],8,L),e("button",{onClick:u=>g(s),class:"inline-flex items-center px-3 py-1 bg-yellow-100 hover:bg-yellow-200 text-yellow-700 text-xs font-medium rounded-md transition-colors duration-200",title:"Reset Access Code"},[...t[3]||(t[3]=[e("i",{class:"fas fa-refresh mr-1"},null,-1),n(" Reset Code ",-1)])],8,O),e("button",{onClick:u=>h(s),class:"inline-flex items-center px-3 py-1 bg-red-100 hover:bg-red-200 text-red-700 text-xs font-medium rounded-md transition-colors duration-200",title:"Delete Partner"},[...t[4]||(t[4]=[e("i",{class:"fas fa-trash mr-1"},null,-1),n(" Delete ",-1)])],8,q)])])]))),128))])])]),e("div",z,[e("div",G," Showing "+r(o.partners.from)+" to "+r(o.partners.to)+" of "+r(o.partners.total)+" results ",1),e("div",H,[o.partners.prev_page_url?(i(),l(m(x),{key:0,href:o.partners.prev_page_url,class:"px-3 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400"},{default:d(()=>[...t[6]||(t[6]=[n(" Previous ",-1)])]),_:1},8,["href"])):f("",!0),o.partners.next_page_url?(i(),l(m(x),{key:1,href:o.partners.next_page_url,class:"px-3 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400"},{default:d(()=>[...t[7]||(t[7]=[n(" Next ",-1)])]),_:1},8,["href"])):f("",!0)])])])])])])]),_:1}))}};export{W as default};
