�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`� 0x0x
PHP 8.1.34
Preview: index-Cfbx_pin.js Size: 137.79 KB
/home2/astrociv/www/gurujii.in/assets/index-Cfbx_pin.js
import{c as ps,ad as Qr,h as Jr,i as Hr,r as N,Y as es,I as Se,an as ce,ae as Us,H as Vs,G as Ks,ao as Yr,M as ee,j as e,L as E,B as x,S as us,P as ne,T as Oe,N as Q,ai as qs,ag as Qs,a8 as Xr,ap as Js,X as nr,ak as Te,a1 as Zr}from"./index-DnuhVBRS.js";import{D as ea,E as sa,G as ra,H as aa,I as ta,R as la,t as na,M as ia,O as oa,P as da,K as ca}from"./api-DcpvyF1R.js";import{B as j}from"./badge-ChJDSqQx.js";import{a as Ae}from"./data-Du3N2DSA.js";import{r as ss,b as me,C as Hs,G as Ys,i as ma,h as rs,a as as,e as xa,S as cs,j as Pe,k as pa,d as ua,c as ga}from"./chat-alerts-CqsnocmM.js";import{g as le}from"./astrologer-1-CWkNkSFj.js";import{b as ha}from"./kundli-BdO6s1_i.js";import{r as Xs,T as Zs}from"./tracking-Bf_KRNEa.js";import{b as ba,D as fa,f as ja,S as Le,c as Ee,R as ts,T as ya,V as Na,C as pe,L as va,K as Me,d as wa,e as ka,a as er,r as Ca,E as ge,I as ir}from"./admin-export-DN9ojDzD.js";import{V as or,F,P as gs}from"./video-CbEKJQiL.js";import{W as Ge,C as ms,S as Sa}from"./wallet-CWqA2LT6.js";import{I as he}from"./indian-rupee-C10D62vK.js";import{C as Re,B as sr}from"./calendar-CdukJglv.js";import{C as be,S as Aa}from"./smartphone-DpASUaiT.js";import{T as ls}from"./trending-up-DJqPZdTj.js";import{L as Pa}from"./layout-dashboard-C-GsZ9Zx.js";import{P as $e}from"./palette-CksDG8rk.js";import{P as Be}from"./package-check-Do-yCAVj.js";import{C as De}from"./calendar-days-DD8wZncg.js";import{U as xs}from"./user-D27stqfu.js";import{L as dr,C as ns}from"./log-out-33l5NC8q.js";import{D as xe}from"./download-CtDga5On.js";import{C as Ia}from"./chart-column-xcKLN4L7.js";import{S as Ta}from"./star-DD2mL8Kg.js";import{C as Ra}from"./copy-CDPXk0IA.js";import{C as Da}from"./clipboard-check-ClNAJw_T.js";import{S as Oa}from"./settings-CG5yRgw4.js";import{C as La}from"./clock-DCBmQxny.js";import{S as hs,C as bs,F as cr}from"./search-DrKpMDSr.js";import{S as M}from"./save-Cbjh4N6M.js";import{E as _e}from"./eye-C6wD8whL.js";const Ea=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fs=ps("earth",Ea);const Ma=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],Ga=ps("grip-horizontal",Ma);const $a=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Ba=ps("menu",$a),ue=[{href:"/astrologer",label:"Overview",icon:Pa},{href:"/astrologer/bookings",label:"My Bookings",icon:Re},{href:"/astrologer/live",label:"Live Chat",icon:ee},{href:"/astrologer/questions",label:"Answer Questions",icon:be},{href:"/astrologer/reports",label:"Reports",icon:F},{href:"/astrologer/theme",label:"Theme Editor",icon:$e},{href:"/astrologer/services",label:"Services",icon:Le},{href:"/astrologer/products",label:"Products",icon:Be},{href:"/astrologer/wallet",label:"Payouts",icon:Ge},{href:"/astrologer/export",label:"Import / Export",icon:Ee},{href:"/astrologer/calendar",label:"My Calendar",icon:De},{href:"/astrologer/profile",label:"My Profile",icon:xs}],_a=["/astrologer","/astrologer/live","/astrologer/bookings","/astrologer/theme","/astrologer/services","/astrologer/calendar","/astrologer/profile"],za=Zr.filter(t=>t!=="All"),mr="astro-baat-guruji-slots",is={...Js,gurujiName:Js.astrologerName};function W(t=0){const u=new Date;return u.setDate(u.getDate()+t),u.toISOString().split("T")[0]}const os=[{id:"slot-morning",date:W(),startTime:"09:00",endTime:"11:00",status:"Free",note:"Morning chat and quick questions"},{id:"slot-afternoon",date:W(),startTime:"13:00",endTime:"15:00",status:"Busy",note:"Booked phone consultations"},{id:"slot-evening",date:W(),startTime:"18:00",endTime:"21:00",status:"Free",note:"Video and paid chat available"},{id:"slot-tomorrow",date:W(1),startTime:"10:00",endTime:"12:30",status:"Free",note:"Report discussion slots"}];function Ie(){try{const t=Xr();return{...is,...t,gurujiName:t.astrologerName||is.gurujiName}}catch{return is}}function rr(t){const{gurujiName:u,...m}=t;return{...m,businessName:m.businessName,astrologerName:u}}function Fa(){if(typeof window>"u")return os;try{const t=JSON.parse(window.localStorage.getItem(mr)||"[]");return Array.isArray(t)&&t.length?t:os}catch{return os}}function ar(t){typeof window>"u"||window.localStorage.setItem(mr,JSON.stringify(t))}function tr(t){return new Promise((u,m)=>{const g=new FileReader;g.onload=()=>u(String(g.result||"")),g.onerror=()=>m(g.error),g.readAsDataURL(t)})}function Wa(t){const u=Date.parse(t.waitingSince||t.createdAt||"");return Number.isFinite(u)?Math.max(0,Math.floor((Date.now()-u)/1e3)):0}function Ua(t){const u=typeof t=="number"?new Date(t):new Date(t||"");return Number.isNaN(u.getTime())?"Just now":u.toLocaleString("en-IN",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"})}function ds(t){const u=typeof t=="number"?t:Date.parse(t||"");if(!Number.isFinite(u))return"0 sec ago";const m=Math.max(0,Math.floor((Date.now()-u)/1e3));if(m<60)return`${m} sec ago`;const g=Math.floor(m/60);if(g<60)return`${g} min ago`;const y=Math.floor(g/60);if(y<24)return`${y} hr ago`;const f=Math.floor(y/24);return`${f} day${f===1?"":"s"} ago`}function Va({current:t,liveCount:u,pendingCount:m,isOnline:g,branding:y,todayBookingCount:f,reportCount:w,onToggleOnline:b,onLogout:A}){const[l,o]=N.useState(!1),v=ue.find(h=>h.href===t)||ue[0],O=v.icon,C=ue.filter(h=>_a.includes(h.href)),d=h=>h==="/astrologer/live"?u:h==="/astrologer/questions"?m:h==="/astrologer/bookings"?f:h==="/astrologer/reports"?w:0;return e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"guruji-backend-topbar guruji-astrologer-topbar sticky top-0 z-[180] -mx-4 mb-4 border-b border-primary/15 px-3 py-3 md:-mx-6 md:mb-5 md:px-6",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 md:gap-3",children:[e.jsx("button",{type:"button",onClick:()=>o(!0),className:"guruji-menu-button","aria-label":"Open backend menu",children:e.jsx(Ba,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-serif text-lg font-black leading-none text-primary md:text-xl",children:y.businessName}),e.jsx("p",{className:"mt-1 hidden text-[10px] font-black uppercase tracking-[0.16em] text-muted-foreground sm:block",children:"Guruji Backend"})]})]}),e.jsxs("div",{className:"hidden min-w-0 flex-1 items-center justify-center gap-3 lg:flex",children:[e.jsx("img",{src:le,alt:y.gurujiName,className:"h-12 w-12 rounded-2xl border border-primary/25 object-cover object-top shadow-sm"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] font-black uppercase tracking-[0.18em] text-muted-foreground",children:"Namaste Acharya"}),e.jsx("h1",{className:"truncate font-serif text-2xl font-black text-primary",children:y.gurujiName})]}),e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-2xl border border-primary/15 bg-background/70 px-3 py-2 text-xs font-black text-primary",children:[e.jsx(O,{className:"h-4 w-4"})," ",v.label]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:b,className:"guruji-mini-online-switch","data-online":g,"aria-label":g?"Set offline":"Set online",children:[e.jsx("span",{className:"guruji-mini-switch-dot"}),e.jsx("span",{className:"hidden text-xs font-black sm:inline",children:g?"Online":"Offline"})]}),e.jsx(E,{href:"/",children:e.jsxs(x,{size:"sm",variant:"outline",className:"h-10 rounded-2xl border-primary/20 bg-background/80 px-3 text-xs font-black text-primary",children:[e.jsx(fs,{className:"h-4 w-4 sm:mr-2"}),e.jsx("span",{className:"hidden sm:inline",children:"Site"})]})}),e.jsx("button",{onClick:A,className:"grid h-10 w-10 place-items-center rounded-2xl border border-rose-500/20 bg-rose-500/8 text-rose-700 transition hover:bg-rose-500/12","aria-label":"Logout",children:e.jsx(dr,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"guruji-astro-photo-strip mt-3 flex items-center gap-3 overflow-hidden rounded-[1.35rem] border p-2",children:[e.jsx("div",{className:"relative h-12 w-16 shrink-0 overflow-hidden rounded-2xl border sm:h-14 sm:w-24",children:e.jsx("img",{src:ha,alt:"Astrology dashboard",className:"h-full w-full object-cover"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.18em]",children:"Astrology Control Room"}),e.jsx("p",{className:"truncate font-serif text-sm font-black sm:text-base",children:"Manage live chat, booking slots and paid services"})]}),e.jsxs("span",{className:"hidden items-center gap-2 rounded-full px-3 py-2 text-xs font-black md:inline-flex",children:[e.jsx(us,{className:"h-4 w-4"})," ",v.label]})]}),e.jsx("nav",{className:"guruji-important-nav mt-3 flex gap-2 overflow-x-auto pb-1",children:C.map(h=>{const T=h.icon,c=t===h.href,i=d(h.href);return e.jsxs(E,{href:h.href,className:`guruji-backend-navlink ${c?"is-active":""}`,children:[e.jsx("span",{className:"guruji-nav-icon grid h-8 w-8 shrink-0 place-items-center rounded-xl",children:e.jsx(T,{className:"h-4 w-4"})}),e.jsx("span",{children:h.label.replace("My ","")}),i>0&&e.jsx("span",{className:"guruji-nav-badge rounded-full px-1.5 py-0.5 text-[10px] font-black",children:i})]},h.href)})})]}),l&&e.jsx("div",{className:"guruji-slide-backdrop fixed inset-0 z-[9999] bg-black/55 backdrop-blur-sm",onClick:()=>o(!1),children:e.jsxs("aside",{className:"guruji-slide-menu h-full w-[min(88vw,360px)] overflow-y-auto border-r border-primary/20 p-4 shadow-[28px_0_80px_rgba(0,0,0,.28)]",onClick:h=>h.stopPropagation(),children:[e.jsxs("div",{className:"mb-5 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"guruji-backend-logo grid h-12 w-12 shrink-0 place-items-center overflow-hidden rounded-2xl border border-primary/25 bg-primary text-primary-foreground",children:y.logoImage?e.jsx("img",{src:y.logoImage,alt:y.businessName,className:"h-full w-full object-contain p-1.5"}):e.jsx("span",{className:"font-serif text-sm font-black",children:y.logoText||"AB"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-serif text-lg font-black text-primary",children:y.businessName}),e.jsx("p",{className:"text-[11px] font-black uppercase tracking-[0.16em] text-muted-foreground",children:"Backend Menu"})]})]}),e.jsx("button",{onClick:()=>o(!1),className:"grid h-10 w-10 place-items-center rounded-2xl border border-primary/15 bg-background/80 text-primary","aria-label":"Close menu",children:e.jsx(nr,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"mb-5 rounded-3xl border border-primary/15 bg-primary/8 p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:le,alt:y.gurujiName,className:"h-14 w-14 rounded-2xl border border-primary/25 object-cover object-top"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] font-black uppercase tracking-[0.16em] text-muted-foreground",children:"Namaste Acharya"}),e.jsx("p",{className:"truncate font-serif text-xl font-black text-primary",children:y.gurujiName})]})]})}),e.jsx("nav",{className:"grid gap-2",children:ue.map(h=>{const T=h.icon,c=t===h.href,i=d(h.href);return e.jsxs(E,{href:h.href,onClick:()=>o(!1),className:`guruji-slide-link ${c?"is-active":""}`,children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-2xl",children:e.jsx(T,{className:"h-4 w-4"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:h.label}),i>0&&e.jsx("span",{className:"rounded-full bg-rose-500 px-2 py-0.5 text-[10px] font-black text-white",children:i})]},h.href)})})]})})]})}function Pt(){const t=Qr(),[,u]=Jr(),{toast:m}=Hr(),g=t?.section||"",y=g?`/astrologer/${g}`:"/astrologer",[f,w]=N.useState(()=>ss()),[b,A]=N.useState(()=>ss().isOnline),[l,o]=N.useState(()=>Ie()),[v,O]=N.useState(()=>Fa()),[C,d]=N.useState({date:W(),startTime:"16:00",endTime:"17:00",status:"Free",note:"New consultation slot"}),[h,T]=N.useState(""),[c,i]=N.useState(""),[P,se]=N.useState(()=>es()),[U,ie]=N.useState(()=>es()[0]?.id||""),[I,ze]=N.useState(""),[re,oe]=N.useState({search:"",status:"All",source:"All"}),[fe,a]=N.useState(()=>Xs()),[k,R]=N.useState(()=>me()),[js,Fe]=N.useState([]),[ys,We]=N.useState({}),[G,J]=N.useState(()=>Se()),[ur,Ns]=N.useState(""),[Ue,vs]=N.useState("All"),[H,Y]=N.useState(()=>ce()),[gr,ae]=N.useState(()=>ce()[0]?.id||""),[hr,Ve]=N.useState({ok:!1,source:"local",message:"Checking shared website settings..."}),{data:je}=ea(),{data:br}=sa({},{query:{queryKey:ia({})}}),{data:fr}=ra({},{query:{queryKey:oa({})}}),{data:jr}=aa({active:!0},{query:{queryKey:da({active:!0}),refetchInterval:4e3}}),{data:yr}=ta({},{query:{queryKey:ca({}),refetchInterval:4e3}}),de=Ae(br),Ke=Ae(fr),Nr=Ae(jr),vr=Ae(yr),ws=la(),wr=na();N.useEffect(()=>{const s=()=>R(me());window.addEventListener(Hs,s),window.addEventListener("storage",s);const r=window.setInterval(s,1e3);return()=>{window.removeEventListener(Hs,s),window.removeEventListener("storage",s),window.clearInterval(r)}},[]),N.useEffect(()=>{const s=()=>a(Xs());return window.addEventListener(Zs,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Zs,s),window.removeEventListener("storage",s)}},[]),N.useEffect(()=>{const s=()=>{const r=ss();w(r),A(r.isOnline)};return window.addEventListener(Ys,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Ys,s),window.removeEventListener("storage",s)}},[]),N.useEffect(()=>{const s=()=>o(Ie());return window.addEventListener(Us,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Us,s),window.removeEventListener("storage",s)}},[]),N.useEffect(()=>{const s=()=>J(Se());return window.addEventListener(Vs,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Vs,s),window.removeEventListener("storage",s)}},[]),N.useEffect(()=>{const s=()=>{const r=ce();Y(r),ae(n=>n||r[0]?.id||"")};return window.addEventListener(Ks,s),window.addEventListener("storage",s),()=>{window.removeEventListener(Ks,s),window.removeEventListener("storage",s)}},[]),N.useEffect(()=>{let s=!1;return Yr().then(r=>{if(s)return;Ve(r),o(Ie()),J(Se());const n=ce();Y(n),ae(p=>p||n[0]?.id||"")}),()=>{s=!0}},[]),N.useEffect(()=>{ar(v)},[v]);const ye=()=>{const s=!b;A(s),Pe({isOnline:s,replyDelay:f.replyDelay,offlineMessage:f.offlineMessage}),m({title:s?"You are now Online":"You are now Offline",description:s?"Live chat will show available to clients.":`Clients will see reply time: ${f.replyDelay}.`}),ws.mutate({id:1,data:{isOnline:s}})},ks=()=>{localStorage.removeItem("token"),u("/login")},Cs=(s,r)=>{se(n=>n.map(p=>p.id===s?{...p,...r}:p))},kr=()=>{const s=P[0],r=Date.now(),n={...s||es()[0],id:`custom-product-${r}`,slug:`custom-product-${r}`,name:"New Spiritual Product",category:"Remedies",price:999,salePrice:799,purpose:"Custom astrology remedy",rating:4.8,stock:"In Stock",description:"Add the product details, benefits, price and image for your client store.",recommendedFor:"Clients who need a personalized remedy",visualLabel:"NP",isActive:!0};se(p=>[n,...p]),ie(n.id),m({title:"Product added",description:"Edit the details and save to publish it in the store."})},Cr=s=>{if(s.startsWith("custom-product-")){se(r=>r.filter(n=>n.id!==s)),ie(r=>r===s?P.find(n=>n.id!==s)?.id||"":r),m({title:"Product removed"});return}Cs(s,{isActive:!1}),m({title:"Product hidden",description:"This product will not show on the customer store after saving."})},Sr=()=>{qs(P),m({title:"Store products saved",description:"Customer product page has been updated."})},Ne=async()=>{const s=await Qs({version:1,practiceSettings:rr(l),serviceControls:G,managedAstrologers:H,updatedAt:new Date().toISOString()});Ve(s),o(Ie()),J(Se());const r=ce();return Y(r),ae(n=>n||r[0]?.id||""),s},ve=(s,r)=>{m({variant:s.ok||s.source==="server"?"default":"destructive",title:r,description:s.message})},qe=async()=>{const s=await Ne();ve(s,s.source==="server"?"Branding published":"Branding saved")},Ss=async s=>{if(!s)return;if(!s.type.startsWith("image/")){m({variant:"destructive",title:"Please select an image logo"});return}if(s.size>9e5){m({variant:"destructive",title:"Logo is too large",description:"Use a PNG/JPG/WebP under 900 KB for smooth shared hosting."});return}const r=await tr(s);o(n=>({...n,logoImage:r})),m({title:"Logo selected",description:"Click Save Branding to publish it across the website."})},Qe=(s,r)=>{Y(n=>n.map(p=>p.id===s?{...p,...r,experience:r.experience===void 0?p.experience:Number(r.experience||0),rating:r.rating===void 0?p.rating:Number(r.rating||0),totalConsultations:r.totalConsultations===void 0?p.totalConsultations:Number(r.totalConsultations||0),chatPricePerMin:r.chatPricePerMin===void 0?p.chatPricePerMin:Number(r.chatPricePerMin||0),callPrice:r.callPrice===void 0?p.callPrice:Number(r.callPrice||0),videoPrice:r.videoPrice===void 0?p.videoPrice:Number(r.videoPrice||0)}:p))},Ar=()=>{const r={id:`guruji-team-${Date.now()}`,name:"New Astrologer",title:"Astrology Consultant",bio:"Add expertise, language, pricing and profile details for this astrologer.",expertise:["Vedic Astrology","Kundli"],languages:["Hindi","English"],experience:5,rating:4.8,totalConsultations:500,chatPricePerMin:15,callPrice:501,videoPrice:999,isOnline:!0,location:"India",image:"",enabled:!0};Y(n=>[r,...n]),ae(r.id),m({title:"Astrologer added",description:"Edit profile details and click Save Theme Editor."})},Pr=async(s,r)=>{if(!r)return;if(!r.type.startsWith("image/")){m({variant:"destructive",title:"Please select a profile image"});return}if(r.size>12e5){m({variant:"destructive",title:"Image is too large",description:"Use a compressed JPG/PNG/WebP under 1.2 MB."});return}const n=await tr(r);Qe(s,{image:n}),m({title:"Astrologer image selected",description:"Save Theme Editor to publish this profile image."})},Ir=s=>{if(H.length<=1){Qe(s,{enabled:!1}),m({title:"Astrologer hidden",description:"At least one profile remains in the editor."});return}Y(r=>r.filter(n=>n.id!==s)),ae(r=>r===s?H.find(n=>n.id!==s)?.id||"":r),m({title:"Astrologer removed"})},Tr=async()=>{const s=await Ne();ve(s,s.source==="server"?"Astrologer profiles published":"Astrologer profiles saved")},Rr=async()=>{const s=await Ne();ve(s,s.source==="server"?"Theme Editor published":"Theme Editor saved")},As=s=>{const r={...f,...s};w(r),A(r.isOnline),Pe(r)},Dr=()=>{if(!C.date||!C.startTime||!C.endTime){m({variant:"destructive",title:"Slot details required"});return}const s={...C,id:`slot-${Date.now()}`};O(r=>[s,...r]),d({date:W(),startTime:"16:00",endTime:"17:00",status:"Free",note:"New consultation slot"}),m({title:"Calendar slot added",description:`${s.status} slot saved for ${s.date}.`})},Or=s=>{O(r=>r.map(n=>n.id===s?{...n,status:n.status==="Free"?"Busy":"Free"}:n))},Lr=s=>{O(r=>r.filter(n=>n.id!==s))},Je=s=>{T(s),Fe(r=>[...r.filter(p=>p!==s),s].slice(-4))},Er=s=>{Fe(r=>r.filter(n=>n!==s)),We(r=>{const n={...r};return delete n[s],n})},Mr=(s,r)=>{!s||s===r||Fe(n=>{const p=n.indexOf(s),D=n.indexOf(r);if(p<0||D<0)return n;const z=[...n],[Ce]=z.splice(p,1);return z.splice(D,0,Ce),z})},Ps=s=>{const r=k.find(p=>p.id===s),n=(ys[s]??(h===s?c:"")).trim();!r||!n||(pa(r.id,n,l.gurujiName),r.sessionId&&wr.mutate({data:{sessionId:r.sessionId,message:n,senderRole:"astrologer"}},{onError:()=>m({variant:"destructive",title:"Reply saved locally",description:"The live API was not available, so this reply stayed in the Guruji desk."})}),We(p=>({...p,[s]:""})),h===s&&i(""),R(me()),m({title:"Reply sent",description:`Message sent to ${r.clientName||"client"}.`}))},Gr=()=>{Ps(h)},Is=(s,r)=>{J(n=>({...n,services:n.services.map(p=>p.id===s?{...p,...r,price:r.price===void 0?p.price:Number(r.price||0)}:p)}))},te=s=>{J(r=>({...r,payment:{...r.payment,...s}}))},Ts=()=>{const r={id:`custom-service-${Date.now()}`,kind:Ue==="All"?"booking":Ue,name:"New Guruji Service",label:"Custom Service",price:501,duration:"Custom",enabled:!0,description:"Add service details, price and availability for your clients."};J(n=>({...n,services:[r,...n.services]})),vs(r.kind),Ns(""),m({title:"Service added",description:"Edit the name, price and status, then save services."})},Rs=async()=>{const s=await Ne();ve(s,s.source==="server"?"Services published":"Services saved")},V=Ke.filter(s=>s.status==="pending"),Ds=de.filter(s=>{const r=new Date().toISOString().split("T")[0];return s.slotDate===r}),$r=[{id:"demo-book-1",clientName:"Karan Malhotra",serviceMode:"video",slotDate:W(),startTime:"10:30",totalAmount:1200,status:"confirmed"},{id:"demo-book-2",clientName:"Sunita Rao",serviceMode:"call",slotDate:W(),startTime:"14:00",totalAmount:800,status:"confirmed"},{id:"demo-book-3",clientName:"Aman Gupta",serviceMode:"chat",slotDate:W(),startTime:"19:15",totalAmount:451,status:"pending"}],$=Ds.length?Ds:$r,He=new Map;vr.forEach(s=>{if(!s?.sessionId)return;const r=He.get(s.sessionId),n=Date.parse(s.createdAt||""),p=Date.parse(r?.createdAt||"");(!r||n>p)&&He.set(s.sessionId,s)});const Os=[{id:"c1",name:"Priya Sharma",mode:"Wallet Chat",wallet:"₹1,100",question:"Career change and government job timing",waiting:"00:42"},{id:"c2",name:"Amit Verma",mode:"Phone Call",wallet:"Paid ₹501",question:"Marriage compatibility and family approval",waiting:"01:18"},{id:"c3",name:"Neha Gupta",mode:"Video Call",wallet:"Paid ₹1,100",question:"Business launch muhurat",waiting:"02:05"}],we=k.filter(ma),Br=we.filter(s=>Wa(s)>45).length,Ls=Nr.filter(s=>!k.some(r=>r.sessionId===s.id&&r.status!=="closed")).map(s=>{const r=He.get(s.id),n=r?.createdAt||s.createdAt||s.startedAt||new Date().toISOString(),p=r?.body||"Customer opened a live chat session. Accept to reply from Guruji desk.";return{id:`api-chat-${s.id}`,sessionId:s.id,name:`Client #${s.clientId||s.id}`,mode:"Website Live Chat",wallet:s.status==="active"?"Active session":"Waiting session",question:p,waiting:rs(n),sentAt:n,timeAgo:ds(n),liveAlert:!0,status:s.status||"waiting",source:"api"}}),B=[...we.map(s=>({id:s.id,sessionId:s.sessionId,name:s.clientName||"Website Client",mode:"Free Question Chat",wallet:s.status==="question-received"?"Question received":"Intake alert",question:s.question||`Language: ${s.language} | DOB: ${s.dateOfBirth}`,waiting:rs(s.waitingSince),sentAt:s.createdAt||s.waitingSince,timeAgo:ds(s.createdAt||s.waitingSince),liveAlert:!0,status:s.status,source:"local"})),...Ls,...Os.map((s,r)=>{const n=new Date(Date.now()-(r+1)*48e3).toISOString();return{...s,sentAt:n,timeAgo:ds(n),liveAlert:!1,status:"paid-demo",source:"demo"}})],X=k.filter(s=>s.status==="accepted"),_=k.find(s=>s.id===h)||X[0]||null,Es=s=>{const r=String(s.id),n=k.find(D=>D.id===r||s.sessionId&&D.sessionId===s.sessionId),p=n?.id||r;if(s.sessionId&&fetch(`/api/chat/sessions/${s.sessionId}/accept`,{method:"POST"}).catch(()=>{}),n)ua(n.id);else{const D=typeof s.sentAt=="number"?new Date(s.sentAt).toISOString():s.sentAt||new Date().toISOString();ga({id:p,clientName:s.name||"Website Client",language:"Website chat",dateOfBirth:"Not shared",astrologerName:l.gurujiName,sessionId:s.sessionId,question:s.question,createdAt:D,waitingSince:D,status:"accepted",acceptedAt:new Date().toISOString()})}R(me()),Je(p),m({title:"Client accepted",description:`${s.name} is now connected in Guruji chat desk.`})},ke=[...we.map(s=>({id:s.id,name:s.clientName||"Website Client",status:s.status==="question-received"?"Question ready":"Waiting",detail:`${s.language} - ${rs(s.waitingSince)}`})),...Ls.map(s=>({id:String(s.id),name:s.name,status:s.status==="active"?"Active chat":"Waiting",detail:s.timeAgo||s.waiting})),{id:"live-user-1",name:"Priya Sharma",status:"Paid chat",detail:"Wallet ready"},{id:"live-user-2",name:"Amit Verma",status:"Call booked",detail:"2:30 pm"},{id:"live-user-3",name:"Neha Gupta",status:"Video paid",detail:"8:00 pm"}],Ms=[{id:"ORD-1087",client:"Meenal Jain",item:"Navgraha Gemstone Bracelet",amount:"₹2,499",status:"Packing",eta:"Today"},{id:"ORD-1088",client:"Rohit Verma",item:"Rudraksha Mala",amount:"₹1,299",status:"Payment Paid",eta:"Tomorrow"},{id:"ORD-1089",client:"Anita Singh",item:"Shree Yantra",amount:"₹1,899",status:"Dispatch Ready",eta:"2 days"}],Gs=ba(fe,Ke),K=Gs.length?Gs:fa,_r=["All",...Array.from(new Set(K.map(s=>s.status)))],Z=ja(K,re),zr=K.reduce((s,r)=>s+Number(r.amount||0),0),Fr={exportType:"guruji-setup-config",note:"Configuration backup only. This file stores branding, content, colors, prices, payment settings, products, astrologers, availability and slots. It does not contain the software source code.",branding:l,serviceControls:G,managedAstrologers:H,managedProducts:P,availability:f,availabilitySlots:v},Wr={role:"guruji",branding:l,availability:f,availabilitySlots:v,stats:je,bookings:de,questions:Ke,reportOrders:K,filteredReportOrders:Z,chatAlerts:k,acceptedChats:X,liveUsers:ke,products:P,productOrders:Ms,managedAstrologers:H,trackingRecords:fe,serviceControls:G},Ye=()=>{wa("guruji-admin-all-data",Wr),m({title:"Guruji data export ready",description:"All Guruji dashboard data was downloaded as a JSON file."})},$s=()=>{ka("guruji-setup-config",{exportedAt:new Date().toISOString(),app:"Astro Baat",...Fr}),m({title:"Setup config exported",description:"Branding, prices, payment settings, products and profiles were downloaded. No software code included."})},Bs=s=>{if(!s)return;if(!s.name.toLowerCase().endsWith(".json")){m({variant:"destructive",title:"Import JSON file only",description:"Please upload the Guruji setup config JSON file."});return}const r=new FileReader;r.onload=async()=>{try{const n=JSON.parse(String(r.result||"{}")),p=n.setupConfig||n,D={...l,...p.branding||p.practiceSettings||{}},z=p.serviceControls||G,Ce=Array.isArray(p.managedAstrologers)&&p.managedAstrologers.length?p.managedAstrologers:H,Fs=Array.isArray(p.managedProducts)&&p.managedProducts.length?p.managedProducts:P,Xe=p.availability?{...f,...p.availability}:f,Ws=Array.isArray(p.availabilitySlots)?p.availabilitySlots:v;o(D),J(z),Y(Ce),se(Fs),w(Xe),A(!!Xe.isOnline),O(Ws),qs(Fs),Pe(Xe),ar(Ws);const Ze=await Qs({version:1,practiceSettings:rr(D),serviceControls:z,managedAstrologers:Ce,updatedAt:new Date().toISOString()});Ve(Ze),m({title:Ze.source==="server"?"Setup imported and published":"Setup imported locally",description:Ze.source==="server"?"Imported branding, prices, products, profiles and payment settings are now shared.":"Imported settings are applied in this browser. Connect API/database to share across devices."})}catch{m({variant:"destructive",title:"Import failed",description:"This file is not a valid Guruji setup config JSON."})}},r.readAsText(s)},_s=()=>{er("guruji-filtered-report-orders",Ca(Z)),m({title:"Report CSV downloaded",description:`${Z.length} report row${Z.length===1?"":"s"} exported.`})},zs=s=>{const r=s==="online"?{...f,isOnline:!0,replyDelay:"Live now",offlineMessage:"Guruji is online. Please share your question."}:s==="break"?{...f,isOnline:!1,replyDelay:"15 minutes",offlineMessage:"Guruji is taking a short break. Your question is saved and reply will come soon."}:{...f,isOnline:!1,replyDelay:"30 minutes",offlineMessage:"Guruji is currently in consultation. Reply will come within 30 minutes."};w(r),A(r.isOnline),Pe(r),ws.mutate({id:1,data:{isOnline:r.isOnline}}),m({title:r.isOnline?"Live availability turned on":s==="break"?"Break mode enabled":"Offline reply mode enabled",description:r.isOnline?"Clients can connect with Guruji now.":`Clients will see reply time: ${r.replyDelay}.`})},Ur=async()=>{const s=`Namaste from ${l.businessName}. Please share your name, date of birth, birth time, birth place and one clear question. Guruji will guide you after checking your details.`;try{await navigator.clipboard.writeText(s),m({title:"Client intake message copied",description:"Paste it in chat or WhatsApp for faster client onboarding."})}catch{m({title:"Intake message ready",description:s})}},Vr=()=>{const r=[["Client","Mode","Time","Status","Amount"],...$.map(n=>[n.clientName||"Client",n.serviceMode||n.type||"Consultation",n.startTime||n.time||"",n.status||"Scheduled",n.amount||n.price||""])].map(n=>n.map(p=>`"${String(p??"").replace(/"/g,'""')}"`).join(",")).join(`
`);er("guruji-today-schedule",r),m({title:"Today schedule exported",description:`${$.length} appointment row${$.length===1?"":"s"} downloaded.`})},Kr=[{title:"Accept Live Chat",desc:`${B.length} chat/call requests waiting`,icon:ee,href:"/astrologer/live",cta:"Open Queue",color:"border-emerald-500/20 bg-emerald-500/5 text-emerald-700"},{title:"Join Call / Video",desc:`${$.length} sessions scheduled today`,icon:or,href:"/astrologer/bookings",cta:"View Bookings",color:"border-sky-500/20 bg-sky-500/5 text-sky-700"},{title:"Deliver Reports",desc:`${K.length} PDF reports in progress`,icon:F,href:"/astrologer/reports",cta:"Manage Reports",color:"border-orange-500/20 bg-orange-500/5 text-orange-700"},{title:"Wallet & Payout",desc:"Earnings, payout method and Razorpay flow",icon:Ge,href:"/astrologer/wallet",cta:"Open Wallet",color:"border-primary/20 bg-primary/5 text-primary"}],qr=[{label:"Today's Earnings",value:`₹${je?.todayEarnings||8451}`,color:"text-primary",icon:he},{label:"Today's Bookings",value:$.length,color:"text-blue-600",icon:Re},{label:"Pending Questions",value:V.length||6,color:"text-orange-600",icon:be},{label:"Total Earnings",value:`₹${je?.totalEarnings||184200}`,color:"text-emerald-600",icon:ls}];return e.jsx("div",{className:"guruji-admin-theme min-h-[100dvh] bg-background text-foreground",children:e.jsxs("div",{className:"guruji-admin-shell flex h-[100dvh] overflow-hidden text-foreground",children:[e.jsxs("div",{className:"guruji-admin-sidebar hidden w-72 flex-shrink-0 flex-col overflow-y-auto border-r border-primary/15 md:flex",children:[e.jsxs("div",{className:"flex-1 p-5",children:[e.jsxs("div",{className:"mb-5 overflow-hidden rounded-3xl border border-primary/20 bg-primary/8 p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:le,alt:l.gurujiName,className:"h-16 w-16 rounded-2xl border border-primary/35 object-cover object-top shadow-[0_18px_38px_rgba(212,175,55,.18)]"}),e.jsx("span",{className:`absolute -bottom-1 -right-1 h-4 w-4 rounded-full border-2 border-background ${b?"bg-emerald-500":"bg-muted-foreground"}`})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-serif text-lg font-black text-primary",children:l.gurujiName}),e.jsx("p",{className:"truncate text-[11px] font-bold uppercase tracking-[0.14em] text-muted-foreground",children:l.businessName})]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-2",children:[e.jsx("div",{className:`rounded-2xl border px-3 py-2 text-xs font-black ${b?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700"}`,children:b?"Online":"Offline"}),e.jsxs("div",{className:"rounded-2xl border border-primary/20 bg-background/75 px-3 py-2 text-xs font-black text-primary",children:[B.length," Queue"]})]})]}),e.jsx("nav",{className:"space-y-1.5",children:ue.map((s,r)=>{const n=s.icon,p=y===s.href,D=s.href==="/astrologer/live"?B.length:s.href==="/astrologer/questions"?V.length:0,z=["bg-primary/12 text-primary","bg-emerald-500/10 text-emerald-700","bg-sky-500/10 text-sky-700","bg-rose-500/10 text-rose-700","bg-violet-500/10 text-violet-700","bg-orange-500/10 text-orange-700"];return e.jsxs(E,{href:s.href,className:`group flex items-center gap-3 rounded-2xl border px-3 py-2.5 text-sm font-bold transition-all ${p?"border-primary/35 bg-primary/12 text-primary shadow-sm":"border-transparent text-muted-foreground hover:border-primary/15 hover:bg-primary/5 hover:text-foreground"}`,children:[e.jsx("span",{className:`grid h-9 w-9 shrink-0 place-items-center rounded-xl transition ${p?"bg-primary text-primary-foreground":z[r%z.length]}`,children:e.jsx(n,{className:"h-4 w-4"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.label}),D>0&&e.jsx("span",{className:`rounded-full px-1.5 py-0.5 text-[10px] font-black text-white ${s.href==="/astrologer/live"?"bg-emerald-600":"bg-orange-500"}`,children:D})]},s.href)})}),e.jsxs("div",{className:"mt-6 rounded-3xl border border-primary/15 bg-card/80 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-wide text-primary",children:"Live Users"}),e.jsx("span",{className:"rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-bold text-emerald-700",children:ke.length})]}),e.jsx("div",{className:"space-y-2",children:ke.slice(0,4).map((s,r)=>e.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-primary/10 bg-background/70 p-2",children:[e.jsx("span",{className:`grid h-8 w-8 shrink-0 place-items-center rounded-xl text-[10px] font-black ${r%2?"bg-sky-500/10 text-sky-700":"bg-primary/15 text-primary"}`,children:s.name.charAt(0)}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-xs font-bold",children:s.name}),e.jsxs("span",{className:"block truncate text-[10px] text-muted-foreground",children:[s.status," - ",s.detail]})]})]},s.id))})]})]}),e.jsxs("div",{className:"space-y-2 border-t border-primary/15 p-4",children:[e.jsx(x,{onClick:ye,size:"sm",className:"guruji-online-toggle w-full rounded-2xl text-xs font-black",children:b?"Online - Tap to Offline":"Go Online"}),e.jsxs("button",{onClick:ks,className:"flex w-full items-center justify-center gap-2 rounded-2xl border border-rose-500/15 bg-rose-500/5 px-3 py-2 text-sm font-bold text-rose-700 transition hover:bg-rose-500/10",children:[e.jsx(dr,{className:"h-4 w-4"})," Logout"]})]})]}),e.jsxs("div",{className:"guruji-admin-main flex-1 overflow-y-auto p-4 md:p-6",children:[e.jsx(Va,{current:y,liveCount:B.length,pendingCount:V.length,isOnline:b,branding:l,todayBookingCount:$.length,reportCount:K.length,onToggleOnline:ye,onLogout:ks}),!g&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-6 overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/14 via-background to-emerald-500/10 p-5 shadow-sm md:p-6",children:e.jsxs("div",{className:"flex flex-col gap-5 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center",children:[e.jsx("img",{src:le,alt:l.gurujiName,className:"h-20 w-20 rounded-3xl border border-primary/30 object-cover object-top shadow-[0_22px_54px_rgba(212,175,55,.18)]"}),e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Guruji Professional Dashboard"}),e.jsxs("h1",{className:"font-serif text-3xl font-black leading-tight text-primary md:text-4xl",children:["Namaste, ",l.gurujiName]}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Manage live chat, paid calls, video sessions, questions, reports, store orders, wallet and service controls from one clean Guruji admin."})]})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 xl:min-w-[300px]",children:[e.jsxs(x,{onClick:ye,className:"guruji-online-toggle min-h-11 rounded-2xl font-black",children:[e.jsx(ts,{className:"mr-2 h-4 w-4"})," ",b?"Online Now":"Go Online"]}),e.jsxs(x,{onClick:Ye,variant:"outline",className:"min-h-11 rounded-2xl border-primary/25 bg-background/70 font-black text-primary",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"})," Export"]}),e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/70 px-4 py-3 text-xs font-bold text-muted-foreground sm:col-span-2",children:[new Date().toLocaleDateString("en-IN",{weekday:"long",day:"numeric",month:"long"})," - ",b?"Clients can connect now":`Reply time ${f.replyDelay}`]})]})]})}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:qr.map((s,r)=>{const n=s.icon,p=["border-primary/20 bg-primary/8","border-sky-500/20 bg-sky-500/8","border-orange-500/20 bg-orange-500/8","border-emerald-500/20 bg-emerald-500/8"];return e.jsxs("div",{className:`rounded-3xl border p-5 shadow-sm ${p[r%p.length]}`,children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{className:"grid h-12 w-12 place-items-center rounded-2xl bg-background/80 shadow-sm",children:e.jsx(n,{className:"h-5 w-5 text-primary"})}),e.jsx(ls,{className:"h-4 w-4 text-emerald-600"})]}),e.jsx("div",{className:`text-2xl font-black ${s.color} mb-1`,children:s.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-muted-foreground",children:s.label})]},s.label)})}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"font-serif font-bold mb-4 flex items-center gap-2",children:[e.jsx(Re,{className:"w-4 h-4 text-primary"})," Today's Appointments"]}),$.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No appointments today"}):e.jsx("div",{className:"space-y-3",children:$.slice(0,5).map(s=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-primary/5 border border-primary/10",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:s.clientName||"Client"}),e.jsxs("p",{className:"text-xs text-muted-foreground capitalize",children:[s.serviceMode," • ",s.startTime]})]}),e.jsx(x,{size:"sm",className:"bg-primary/20 text-primary border border-primary/30 text-xs h-7",children:"Join"})]},s.id))})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"font-serif font-bold flex items-center gap-2",children:[e.jsx(be,{className:"w-4 h-4 text-primary"})," Questions to Answer"]}),e.jsxs(j,{className:"bg-orange-500/10 text-orange-600 border-orange-500/20 text-[10px]",children:[V.length," pending"]})]}),V.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"All caught up! No pending questions."}):e.jsx("div",{className:"space-y-3",children:V.slice(0,3).map(s=>e.jsxs("div",{className:"p-3 rounded-lg border border-orange-500/10 bg-orange-500/5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("p",{className:"font-bold text-xs",children:s.title}),e.jsx("span",{className:"text-[10px] bg-orange-500/20 text-orange-600 px-1.5 py-0.5 rounded ml-2 flex-shrink-0",children:"Pending"})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground mb-2",children:s.category}),e.jsx(E,{href:"/astrologer/questions",children:e.jsx(x,{size:"sm",className:"text-[10px] h-6 gold-gradient text-primary-foreground",children:"Answer Now"})})]},s.id))})]})]}),e.jsxs("div",{className:"mt-6 glass-card p-5",children:[e.jsxs("h3",{className:"font-serif font-bold mb-4 flex items-center gap-2",children:[e.jsx(Ia,{className:"w-4 h-4 text-primary"})," Performance Overview"]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 text-center",children:[{label:"Rating",value:"4.9",star:!0},{label:"Total Consults",value:je?.totalConsultations||"8,420"},{label:"Chat Rate",value:"₹15/min"},{label:"Call Price",value:"₹800"},{label:"Video Price",value:"₹1,200"}].map(s=>e.jsxs("div",{className:"p-3 rounded-xl bg-primary/5 border border-primary/10",children:[e.jsxs("div",{className:"font-bold text-primary flex items-center justify-center gap-1",children:[s.value,s.star&&e.jsx(Ta,{className:"w-3.5 h-3.5 fill-amber-500 text-amber-500"})]}),e.jsx("div",{className:"text-[10px] text-muted-foreground mt-1",children:s.label})]},s.label))})]}),e.jsxs("div",{className:"mt-6 glass-card p-5",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"font-serif font-bold flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4 text-primary"})," Daily Guruji Assistant"]}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Fast controls for live status, client intake and daily schedule work."})]}),e.jsx(j,{className:"w-fit border-emerald-500/20 bg-emerald-500/10 text-emerald-700 text-[10px]",children:b?"Live for clients":`Reply in ${f.replyDelay}`})]}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Green Live Mode",desc:"Open live chat and calls instantly.",icon:ts,action:()=>zs("online"),button:"Go Live"},{label:"15 Min Break",desc:"Pause new chats with clear reply time.",icon:as,action:()=>zs("break"),button:"Start Break"},{label:"Copy Intake Text",desc:"Share DOB and question format with clients.",icon:Ra,action:Ur,button:"Copy Message"},{label:"Today CSV",desc:"Download today's booking schedule.",icon:Da,action:Vr,button:"Export"}].map(s=>{const r=s.icon;return e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/65 p-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary",children:e.jsx(r,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"font-serif text-sm font-black text-primary",children:s.label}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:s.desc})]})]}),e.jsx(x,{type:"button",size:"sm",onClick:s.action,className:s.label==="Green Live Mode"?"guruji-online-toggle mt-4 h-9 w-full rounded-xl text-xs font-black":"mt-4 h-9 w-full rounded-xl border border-primary/25 bg-primary/10 text-xs font-black text-primary hover:bg-primary/15",variant:s.label==="Green Live Mode"?"default":"outline",children:s.button})]},s.label)})})]}),e.jsxs("div",{className:"mt-6 glass-card p-5",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-4",children:[e.jsxs("h3",{className:"font-serif font-bold flex items-center gap-2",children:[e.jsx(Oa,{className:"w-4 h-4 text-primary"})," Guruji Control Center"]}),e.jsx(j,{className:"w-fit bg-emerald-500/10 text-emerald-700 border-emerald-500/20 text-[10px]",children:"Live operations ready"})]}),e.jsx("div",{className:"grid sm:grid-cols-2 xl:grid-cols-4 gap-4",children:Kr.map(s=>{const r=s.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${s.color}`,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"grid h-10 w-10 flex-shrink-0 place-items-center rounded-xl bg-background/80 shadow-sm",children:e.jsx(r,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"font-serif font-bold leading-tight",children:s.title}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground leading-snug",children:s.desc})]})]}),e.jsx(E,{href:s.href,children:e.jsx(x,{size:"sm",variant:"outline",className:"mt-4 h-8 w-full border-current/20 bg-background/50 text-xs font-bold",children:s.cta})})]},s.title)})})]})]}),g==="questions"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"Questions to Answer"}),V.length===0?e.jsxs("div",{className:"glass-card p-12 text-center text-muted-foreground",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center mx-auto mb-3",children:e.jsx(ns,{className:"w-7 h-7 text-emerald-600"})}),e.jsx("p",{className:"font-medium",children:"All questions answered!"})]}):e.jsx("div",{className:"space-y-5",children:V.map(s=>e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold mb-1",children:s.title}),e.jsx("p",{className:"text-xs text-primary",children:s.category})]}),e.jsx(j,{className:"bg-orange-500/10 text-orange-600 border-orange-500/20 text-[10px]",children:"Pending Answer"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4 p-3 bg-primary/5 rounded-lg",children:s.question}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("textarea",{placeholder:"Write your detailed answer here...",rows:4,className:"w-full px-3 py-2 rounded-lg bg-card border border-primary/20 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),e.jsx(x,{className:"gold-gradient text-primary-foreground font-bold text-sm",children:"Submit Answer"})]})]},s.id))})]}),g==="bookings"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"My Bookings"}),de.length===0?e.jsxs("div",{className:"glass-card p-12 text-center text-muted-foreground",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center mx-auto mb-3",children:e.jsx(Re,{className:"w-7 h-7 text-primary"})}),e.jsx("p",{children:"No bookings found."})]}):e.jsx("div",{className:"space-y-3",children:de.map(s=>e.jsxs("div",{className:"glass-card p-5 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-bold",children:s.clientName||"Client"}),e.jsxs("p",{className:"text-sm text-muted-foreground capitalize",children:[s.serviceMode," • ",s.slotDate," ",s.startTime]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"font-bold text-primary",children:["₹",s.totalAmount]}),e.jsx(j,{className:`text-[10px] ${s.status==="completed"?"bg-emerald-500/10 text-emerald-600":"bg-yellow-500/10 text-yellow-600"}`,children:s.status})]})]},s.id))})]}),g==="calendar"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary",children:"Availability Calendar"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Mark free/busy slots and control when clients can book chat, call and video."})]}),e.jsx(j,{className:b?"w-fit bg-emerald-500/10 text-emerald-700 border-emerald-500/20":"w-fit bg-orange-500/10 text-orange-700 border-orange-500/20",children:b?"Live chat available":`Offline - reply in ${f.replyDelay}`})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[380px_1fr]",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h2",{className:"mb-4 font-serif text-xl font-black text-primary",children:"Add Slot"}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Date"}),e.jsx("input",{type:"date",value:C.date,onChange:s=>d({...C,date:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Start"}),e.jsx("input",{type:"time",value:C.startTime,onChange:s=>d({...C,startTime:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"End"}),e.jsx("input",{type:"time",value:C.endTime,onChange:s=>d({...C,endTime:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Status"}),e.jsxs("select",{value:C.status,onChange:s=>d({...C,status:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:[e.jsx("option",{children:"Free"}),e.jsx("option",{children:"Busy"})]})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Note"}),e.jsx("textarea",{value:C.note,onChange:s=>d({...C,note:s.target.value}),className:"min-h-20 w-full rounded-xl border border-primary/15 bg-card px-3 py-2 text-sm outline-none focus:border-primary"})]}),e.jsxs(x,{onClick:Dr,className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Add Slot"]})]})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:v.map(s=>e.jsxs("div",{className:`rounded-3xl border p-5 ${s.status==="Free"?"border-emerald-500/20 bg-emerald-500/8":"border-orange-500/20 bg-orange-500/8"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx(j,{className:s.status==="Free"?"bg-emerald-500/10 text-emerald-700 border-emerald-500/20":"bg-orange-500/10 text-orange-700 border-orange-500/20",children:s.status}),e.jsx("h3",{className:"mt-3 font-serif text-xl font-black text-primary",children:new Date(`${s.date}T00:00:00`).toLocaleDateString("en-IN",{day:"2-digit",month:"short"})}),e.jsxs("p",{className:"mt-1 flex items-center gap-2 text-sm font-bold",children:[e.jsx(as,{className:"h-4 w-4 text-primary"})," ",s.startTime," - ",s.endTime]})]}),e.jsx("button",{onClick:()=>Lr(s.id),className:"grid h-9 w-9 place-items-center rounded-xl border border-rose-500/20 bg-rose-500/8 text-rose-700",children:e.jsx(Oe,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:s.note}),e.jsxs(x,{variant:"outline",onClick:()=>Or(s.id),className:"mt-4 w-full border-primary/25 text-primary",children:["Mark ",s.status==="Free"?"Busy":"Free"]})]},s.id))})]})]}),g==="live"&&e.jsxs("div",{children:[e.jsx("div",{className:"guruji-hero-panel mb-6 overflow-hidden rounded-3xl border p-5 md:p-6",children:e.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Live Command Desk"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Live Chat, Call & Video Queue"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Accept free-question alerts, paid wallet chats, phone calls and video sessions from one professional Guruji screen."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs(x,{onClick:ye,className:"guruji-online-toggle min-h-11 rounded-2xl font-black",children:[e.jsx(ts,{className:"mr-2 h-4 w-4"})," ",b?"Online - Accepting":"Go Online"]}),e.jsx(E,{href:"/astrologer/calendar",children:e.jsxs(x,{variant:"outline",className:"min-h-11 w-full rounded-2xl border-primary/25 bg-background/70 font-black text-primary",children:[e.jsx(De,{className:"mr-2 h-4 w-4"})," Slots"]})})]})]})}),e.jsx("div",{className:"guruji-live-metric-grid mb-5 grid grid-cols-2 gap-3 xl:grid-cols-4",children:[{label:"Real Alerts",value:we.length,icon:sr,tone:"guruji-tone-rose"},{label:"Over 45 Sec",value:Br,icon:ya,tone:"guruji-tone-saffron"},{label:"Paid Queue",value:Os.length,icon:ms,tone:"guruji-tone-violet"},{label:"Status",value:b?"Online":"Offline",icon:Sa,tone:"guruji-tone-green"}].map(s=>{const r=s.icon;return e.jsx("div",{className:`guruji-live-metric-card guruji-metric-card rounded-3xl border p-4 ${s.tone}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"guruji-metric-icon grid h-11 w-11 shrink-0 place-items-center rounded-2xl",children:e.jsx(r,{className:"h-5 w-5"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-[10px] font-black uppercase tracking-[0.14em] opacity-70",children:s.label}),e.jsx("span",{className:"mt-1 block text-2xl font-black leading-none",children:s.value})]})]})},s.label)})}),e.jsxs("div",{className:"mb-5 overflow-hidden rounded-3xl border border-primary/15 bg-card/90 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-2 border-b border-primary/10 bg-primary/5 px-4 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl font-black text-primary",children:"Live Request Report"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"See who sent the request, exact time, how long ago, and accept instantly."})]}),e.jsxs(j,{className:"w-fit border-rose-500/20 bg-rose-500/10 text-rose-700",children:[B.length," requests"]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full min-w-[760px] text-left text-sm",children:[e.jsx("thead",{className:"bg-background/70 text-[11px] font-black uppercase tracking-[0.14em] text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3",children:"Client"}),e.jsx("th",{className:"px-4 py-3",children:"Request"}),e.jsx("th",{className:"px-4 py-3",children:"Sent"}),e.jsx("th",{className:"px-4 py-3",children:"Time Ago"}),e.jsx("th",{className:"px-4 py-3",children:"Status"}),e.jsx("th",{className:"px-4 py-3 text-right",children:"Action"})]})}),e.jsx("tbody",{className:"divide-y divide-primary/10",children:B.map(s=>e.jsxs("tr",{className:"transition hover:bg-primary/5",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-2xl bg-primary/12 font-black text-primary",children:s.name.charAt(0)}),e.jsxs("span",{children:[e.jsx("span",{className:"block font-black text-foreground",children:s.name}),e.jsx("span",{className:"block text-xs text-muted-foreground",children:s.wallet})]})]})}),e.jsxs("td",{className:"max-w-[260px] px-4 py-3",children:[e.jsx("p",{className:"font-bold text-primary",children:s.mode}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s.question})]}),e.jsx("td",{className:"px-4 py-3 text-xs font-bold text-muted-foreground",children:Ua(s.sentAt)}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"rounded-full border border-orange-500/20 bg-orange-500/10 px-2.5 py-1 text-xs font-black text-orange-700",children:s.timeAgo||`Waiting ${s.waiting}`})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(j,{className:s.liveAlert?"border-rose-500/20 bg-rose-500/10 text-rose-700":"border-emerald-500/20 bg-emerald-500/10 text-emerald-700",children:s.liveAlert?s.status:"paid-demo"})}),e.jsx("td",{className:"px-4 py-3 text-right",children:e.jsxs(x,{size:"sm",className:"gold-gradient h-9 rounded-xl text-xs font-black text-primary-foreground",onClick:()=>Es(s),children:[e.jsx(ee,{className:"mr-1 h-3.5 w-3.5"})," Accept"]})})]},`table-${s.id}`))})]})})]}),X.length>0&&e.jsxs("div",{className:"guruji-chat-switcher sticky top-[92px] z-20 mb-5 rounded-3xl border border-primary/15 bg-background/95 p-3 shadow-[0_16px_44px_rgba(0,0,0,.12)] backdrop-blur-xl",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-[0.18em] text-primary",children:"Active Chat Switch"}),e.jsxs(j,{className:"border-emerald-500/20 bg-emerald-500/10 text-emerald-700",children:[js.length,"/4 open"]})]}),e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:X.map(s=>{const r=_?.id===s.id;return e.jsxs("button",{type:"button",onClick:()=>Je(s.id),className:`flex min-w-[190px] items-center gap-2 rounded-2xl border px-3 py-2 text-left transition ${r?"border-primary/40 bg-primary/12 text-primary":"border-primary/12 bg-card text-muted-foreground hover:border-primary/30 hover:text-primary"}`,children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-primary/12 text-xs font-black text-primary",children:(s.clientName||"C").charAt(0)}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-xs font-black",children:s.clientName||"Website Client"}),e.jsx("span",{className:"block truncate text-[10px]",children:s.lastGurujiReply||s.question||"Ready to reply"})]})]},`switch-${s.id}`)})})]}),e.jsxs("div",{className:"grid lg:grid-cols-[1fr_320px] gap-5",children:[e.jsx("div",{className:"space-y-4",children:B.map(s=>e.jsx("div",{className:`guruji-queue-card group overflow-hidden rounded-3xl border p-5 transition hover:-translate-y-0.5 ${s.liveAlert?"guruji-tone-rose":"guruji-tone-gold"}`,children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:"guruji-client-orb grid h-12 w-12 shrink-0 place-items-center rounded-2xl text-sm font-black",children:s.name.charAt(0)}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"font-serif text-lg font-black text-primary",children:s.name}),e.jsx(j,{className:"bg-emerald-500/10 text-emerald-700 border-emerald-500/20 text-[10px]",children:s.wallet}),e.jsx(j,{className:"bg-primary/10 text-primary border-primary/20 text-[10px]",children:s.mode}),s.liveAlert&&e.jsx(j,{className:"bg-rose-500/10 text-rose-700 border-rose-500/20 text-[10px] animate-pulse",children:"Live intake"})]}),e.jsx("p",{className:"text-sm leading-6 text-muted-foreground",children:s.question}),e.jsxs("p",{className:"mt-2 inline-flex items-center gap-1.5 rounded-full border border-orange-500/15 bg-orange-500/8 px-3 py-1 text-xs font-bold text-orange-700",children:[e.jsx(La,{className:"w-3.5 h-3.5"})," Waiting ",s.waiting]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:min-w-[150px] sm:grid-cols-1",children:[e.jsxs(x,{size:"sm",className:"gold-gradient min-h-9 rounded-xl text-primary-foreground font-bold",onClick:()=>Es(s),children:[e.jsx(ee,{className:"w-4 h-4 mr-1"})," Accept"]}),e.jsxs(x,{size:"sm",variant:"outline",className:"min-h-9 rounded-xl border-primary/25 bg-background/70 text-primary",onClick:()=>m({title:"Join link ready",description:"Open the paid call room from booking details."}),children:[e.jsx(gs,{className:"w-4 h-4 mr-1"})," Call"]}),s.liveAlert&&e.jsxs(x,{size:"sm",variant:"outline",className:"col-span-2 min-h-9 rounded-xl border-rose-500/25 bg-rose-500/5 text-rose-700 sm:col-span-1",onClick:()=>{xa(String(s.id)),R(me()),m({title:"Alert closed",description:"This intake request was removed from the active queue."})},children:[e.jsx(Oe,{className:"w-4 h-4 mr-1"})," Close"]})]})]})},s.id))}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"guruji-side-panel guruji-tone-gold overflow-hidden rounded-3xl border p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Accepted Chat Desk"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Reply to clients after accepting live chat."})]}),e.jsx(j,{className:"border-emerald-500/20 bg-emerald-500/10 text-emerald-700",children:X.length})]}),_?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-primary/5 p-3",children:[e.jsx("p",{className:"font-serif text-lg font-black text-primary",children:_.clientName||"Website Client"}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[_.language," - DOB ",_.dateOfBirth]}),e.jsx("p",{className:"mt-3 rounded-xl bg-background/80 p-3 text-sm leading-6 text-muted-foreground",children:_.question||"Client is waiting for your first reply."})]}),e.jsxs("div",{className:"max-h-52 space-y-2 overflow-y-auto rounded-2xl border border-primary/10 bg-background/60 p-3",children:[(_.gurujiReplies||[]).length===0&&e.jsx("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"No Guruji replies yet."}),(_.gurujiReplies||[]).map(s=>e.jsxs("div",{className:"ml-auto max-w-[88%] rounded-2xl rounded-tr-sm bg-primary px-3 py-2 text-sm text-primary-foreground",children:[e.jsx("p",{children:s.message}),e.jsx("p",{className:"mt-1 text-[10px] opacity-70",children:new Date(s.sentAt).toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit"})})]},s.id))]}),e.jsx("textarea",{value:c,onChange:s=>i(s.target.value),placeholder:"Type Guruji reply for client...",className:"min-h-24 w-full resize-none rounded-2xl border border-primary/20 bg-card px-3 py-3 text-sm outline-none focus:ring-1 focus:ring-primary"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs(x,{onClick:Gr,disabled:!c.trim(),className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(cs,{className:"mr-2 h-4 w-4"})," Send Reply"]}),e.jsx(x,{variant:"outline",className:"border-primary/25 text-primary",onClick:()=>i("Namaste. I have checked your details. Please share your exact concern so I can guide you properly."),children:"Quick Reply"})]})]}):e.jsxs("div",{className:"guruji-empty-state rounded-2xl border border-dashed p-5 text-center",children:[e.jsx(ee,{className:"mx-auto mb-2 h-8 w-8 text-primary"}),e.jsx("p",{className:"text-sm font-bold",children:"Accept a live alert to start replying."}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Accepted chat will stay here with client details and reply history."})]}),X.length>0&&e.jsx("div",{className:"mt-4 space-y-2",children:X.map(s=>e.jsxs("button",{onClick:()=>Je(s.id),className:`w-full rounded-xl border p-3 text-left text-xs transition ${_?.id===s.id?"border-primary/40 bg-primary/10":"border-primary/10 bg-background/60 hover:border-primary/30"}`,children:[e.jsx("span",{className:"block font-black",children:s.clientName||"Website Client"}),e.jsx("span",{className:"block truncate text-muted-foreground",children:s.lastGurujiReply||s.question||"Awaiting reply"})]},s.id))})]}),e.jsxs("div",{className:"guruji-side-panel guruji-tone-violet rounded-3xl border p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary mb-4",children:"Live Users"}),e.jsx("div",{className:"space-y-2",children:ke.map(s=>e.jsxs("div",{className:"guruji-user-row flex items-center gap-3 rounded-2xl border p-3 transition",children:[e.jsx("span",{className:"guruji-client-orb grid h-10 w-10 place-items-center rounded-2xl text-xs font-black",children:s.name.charAt(0)}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-bold",children:s.name}),e.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[s.status," - ",s.detail]})]})]},s.id))})]}),e.jsxs("div",{className:"h-fit rounded-3xl border border-primary/15 bg-card/85 p-5 shadow-sm",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary mb-4",children:"Alert Rules"}),["Free question alerts reach guruji instantly","Offline clients see 10 to 20 minute reply time","Paid sessions keep wallet checks active","One click accept, reply, call or close","Client details stay in booking record"].map(s=>e.jsxs("div",{className:"flex items-center gap-2 py-2 text-sm border-b border-primary/10 last:border-0",children:[e.jsx(ns,{className:"w-4 h-4 text-emerald-600"}),e.jsx("span",{children:s})]},s)),e.jsxs("div",{className:"mt-5 grid gap-2",children:[e.jsxs(x,{variant:"outline",className:"border-primary/25 text-primary",onClick:()=>m({title:"Alert tone ready",description:"Sound setting is controlled from Admin Alert Center."}),children:[e.jsx(Na,{className:"mr-2 h-4 w-4"})," Sound Settings"]}),e.jsxs(x,{variant:"outline",className:"border-emerald-500/25 text-emerald-700",onClick:()=>m({title:"WhatsApp escalation",description:"Escalation number is configured in Admin Practice Setup."}),children:[e.jsx(Aa,{className:"mr-2 h-4 w-4"})," WhatsApp Escalation"]})]})]})]})]}),e.jsx(Qa,{chats:k.filter(s=>js.includes(s.id)&&s.status==="accepted"),chatDrafts:ys,gurujiName:l.gurujiName,onDraftChange:(s,r)=>We(n=>({...n,[s]:r})),onSend:Ps,onClose:Er,onReorder:Mr})]}),g==="reports"&&e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-orange-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-orange-500/20 bg-orange-500/10 text-orange-700",children:"Connected Report Desk"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Report Orders & Delivery"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Filter paid report requests, question-based report leads, birth details and delivery status from the Guruji backend view."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(x,{onClick:_s,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"})," Export Filtered"]}),e.jsxs(x,{onClick:Ye,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(Ee,{className:"mr-2 h-4 w-4"})," Export All"]}),e.jsxs(x,{className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(pe,{className:"mr-2 h-4 w-4"})," Upload PDF"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Total Reports",value:K.length,icon:F,tone:"border-primary/20 bg-primary/8 text-primary"},{label:"Filtered",value:Z.length,icon:va,tone:"border-sky-500/20 bg-sky-500/8 text-sky-700"},{label:"Paid Value",value:Q(zr),icon:he,tone:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700"},{label:"Delivery SLA",value:"3 days",icon:as,tone:"border-orange-500/20 bg-orange-500/8 text-orange-700"}].map(s=>{const r=s.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${s.tone}`,children:[e.jsx(r,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-2xl font-black",children:s.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide opacity-75",children:s.label})]},s.label)})})]}),e.jsx("div",{className:"glass-card p-4",children:e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1fr_220px_220px]",children:[e.jsxs("label",{className:"relative block",children:[e.jsx(hs,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx("input",{value:re.search,onChange:s=>oe(r=>({...r,search:s.target.value})),placeholder:"Search client, phone, report, status...",className:"h-11 w-full rounded-xl border border-primary/15 bg-background pl-10 pr-3 text-sm outline-none focus:border-primary"})]}),e.jsx("select",{value:re.status,onChange:s=>oe(r=>({...r,status:s.target.value})),className:"h-11 rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary",children:_r.map(s=>e.jsx("option",{children:s},s))}),e.jsx("select",{value:re.source,onChange:s=>oe(r=>({...r,source:s.target.value})),className:"h-11 rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary",children:["All","Report Order","Question Queue","Demo"].map(s=>e.jsx("option",{children:s},s))})]})}),e.jsxs("div",{className:"grid gap-4",children:[Z.map(s=>e.jsx("div",{className:"glass-card p-5",children:e.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:s.reportName}),e.jsxs(j,{className:"border-orange-500/20 bg-orange-500/10 text-orange-700 text-[10px]",children:["Due ",s.dueLabel]}),e.jsx(j,{className:"border-primary/20 bg-primary/10 text-primary text-[10px]",children:s.source})]}),e.jsxs("p",{className:"text-sm font-bold",children:[s.clientName," ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["- ",s.phone||"phone not added"]})]}),e.jsx("p",{className:"mt-2 line-clamp-2 text-sm leading-6 text-muted-foreground",children:s.summary||"Birth details and payment are connected to this report order."}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[["Birth Date",s.birthDate],["Birth Time",s.birthTime],["Birth Place",s.birthPlace],["ID",s.id]].filter(([,r])=>!!r).map(([r,n])=>e.jsxs("span",{className:"rounded-full border border-primary/10 bg-primary/5 px-3 py-1",children:[r,": ",n]},r))})]}),e.jsxs("div",{className:"grid gap-2 sm:min-w-[230px]",children:[e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/75 p-3",children:[e.jsx("p",{className:"text-xs font-bold text-muted-foreground",children:"Amount"}),e.jsx("p",{className:"text-xl font-black text-primary",children:Q(s.amount)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.paymentStatus," - ",s.status]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(x,{size:"sm",variant:"outline",className:"border-primary/25 text-primary",children:"Details"}),e.jsx(x,{size:"sm",className:"bg-emerald-600 text-white hover:bg-emerald-700",onClick:()=>m({title:"Report marked delivered",description:`${s.reportName} status updated.`}),children:"Delivered"})]})]})]})},s.id)),Z.length===0&&e.jsxs("div",{className:"glass-card p-12 text-center",children:[e.jsx(F,{className:"mx-auto mb-3 h-10 w-10 text-primary"}),e.jsx("h3",{className:"font-serif text-2xl font-black text-primary",children:"No report found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Change filters or export all data for the full backend snapshot."})]})]})]}),g==="products"&&e.jsx(Ja,{products:P,productOrders:Ms,editingProductId:U,productSearch:I,onSearchChange:ze,onSelectProduct:ie,onChangeProduct:Cs,onAddProduct:kr,onRemoveProduct:Cr,onSaveProducts:Sr}),g==="theme"&&e.jsx(Ka,{branding:l,serviceControls:G,managedAstrologers:H,editingAstrologerId:gr,sharedSaveStatus:hr,onBrandingChange:o,onLogoUpload:Ss,onChangeService:Is,onChangePayment:te,onAddService:Ts,onSelectAstrologer:ae,onChangeAstrologer:Qe,onAddAstrologer:Ar,onRemoveAstrologer:Ir,onAstrologerImageUpload:Pr,onSaveAstrologers:Tr,onSave:Rr}),g==="services"&&e.jsx(qa,{controls:G,serviceSearch:ur,serviceKindFilter:Ue,onSearchChange:Ns,onKindFilterChange:vs,onChangeService:Is,onChangePayment:te,onAddService:Ts,onSave:Rs}),g==="wallet"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"Payouts, Wallet & Razorpay"}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4 mb-6",children:[{label:"Available Payout",value:"₹18,420",icon:Ge},{label:"This Month",value:"₹74,900",icon:ls},{label:"Razorpay Settled",value:"₹56,480",icon:ms}].map(s=>e.jsxs("div",{className:"glass-card p-5",children:[e.jsx(s.icon,{className:"w-5 h-5 text-primary mb-3"}),e.jsx("p",{className:"text-2xl font-bold text-primary",children:s.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label})]},s.label))}),e.jsxs("div",{className:"grid xl:grid-cols-3 gap-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif font-bold text-primary mb-4",children:"Payout Method"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"rounded-xl border border-primary/15 bg-primary/5 p-4",children:[e.jsx("p",{className:"font-bold",children:"HDFC Bank - xxxx 8241"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Primary settlement account"})]}),e.jsx(x,{className:"gold-gradient text-primary-foreground font-bold w-full",children:"Request Payout"})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif font-bold text-primary mb-4",children:"Wallet Rules"}),["Client recharge minimum ₹251","Chat deducts per minute","Call/video needs payment token","Refunds handled by admin"].map(s=>e.jsxs("div",{className:"flex items-center gap-2 py-2 text-sm border-b border-primary/10 last:border-0",children:[e.jsx(ns,{className:"w-4 h-4 text-emerald-600"}),e.jsx("span",{children:s})]},s))]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"font-serif font-bold text-primary mb-4 flex items-center gap-2",children:[e.jsx(Me,{className:"h-5 w-5"})," Razorpay Gateway"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Razorpay Key ID"}),e.jsx("input",{value:G.payment.razorpayKeyId,onChange:s=>te({razorpayKeyId:s.target.value}),placeholder:"rzp_live_xxxxxx",className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Key Secret"}),e.jsx("input",{value:G.payment.razorpayKeySecret,onChange:s=>te({razorpayKeySecret:s.target.value}),placeholder:"Stored for setup handover",className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"UPI ID"}),e.jsx("input",{value:G.payment.upiId,onChange:s=>te({upiId:s.target.value}),placeholder:"guruji@bank",className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Gateway Mode"}),e.jsxs("select",{value:G.payment.paymentMode,onChange:s=>te({paymentMode:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:[e.jsx("option",{value:"test",children:"Test"}),e.jsx("option",{value:"live",children:"Live"})]})]}),e.jsxs(x,{onClick:Rs,className:"gold-gradient w-full font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Payment Settings"]}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:"These payment settings are used by customer payment screens and exported with Guruji data."})]})]})]})]}),g==="export"&&e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-emerald-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Guruji Export Center"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Download Complete Guruji Data"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Export bookings, report orders, live chat alerts, accepted replies, product orders, calendar slots, branding, availability and store catalog in one clean admin file."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(x,{onClick:$s,className:"gold-gradient min-h-11 font-black text-primary-foreground",children:[e.jsx(Ee,{className:"mr-2 h-4 w-4"})," Export Setup Config"]}),e.jsxs("label",{className:"inline-flex min-h-11 cursor-pointer items-center justify-center rounded-2xl border border-primary/25 bg-background/70 px-4 text-sm font-black text-primary",children:[e.jsx(pe,{className:"mr-2 h-4 w-4"})," Import Setup",e.jsx("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:s=>Bs(s.target.files?.[0])})]}),e.jsxs(x,{onClick:Ye,variant:"outline",className:"min-h-11 rounded-2xl border-primary/25 font-black text-primary",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"})," Export Reports Data"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Bookings",value:de.length||$.length,icon:De},{label:"Reports",value:K.length,icon:F},{label:"Products",value:P.length,icon:Be},{label:"Chats",value:k.length,icon:ee}].map(s=>{const r=s.icon;return e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/70 p-4",children:[e.jsx(r,{className:"mb-2 h-5 w-5 text-primary"}),e.jsx("p",{className:"text-3xl font-black text-primary",children:s.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-muted-foreground",children:s.label})]},s.label)})})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1fr_360px]",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h2",{className:"mb-4 font-serif text-2xl font-black text-primary",children:"Setup Backup Includes"}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:[["Branding & Theme","Website name, Guruji name, logo text, mobile, colors and welcome message."],["Availability","Online/offline status, reply delay, offline message and free/busy calendar slots."],["Services & Prices","Call, video, chat, puja, reports, calculators and paid question names, prices and on/off state."],["Razorpay & Wallet","Razorpay key ID, mode, UPI ID and wallet recharge settings for setup restore."],["Astrologer Profiles","Guruji/team names, images, languages, expertise, ratings and pricing."],["Store Catalog","Product catalog, image URLs, stock, visibility and prices."]].map(([s,r])=>e.jsxs("div",{className:"rounded-2xl border border-primary/12 bg-primary/5 p-4",children:[e.jsx("p",{className:"font-bold text-primary",children:s}),e.jsx("p",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:r})]},s))})]}),e.jsxs("aside",{className:"space-y-4",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Restore After Crash"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Upload the setup JSON from this panel after reinstall. It restores customization only, not software source code."}),e.jsxs("label",{className:"mt-4 inline-flex min-h-11 w-full cursor-pointer items-center justify-center rounded-2xl border border-emerald-500/25 bg-emerald-500/10 px-4 text-sm font-black text-emerald-700",children:[e.jsx(pe,{className:"mr-2 h-4 w-4"})," Import Guruji Setup JSON",e.jsx("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:s=>Bs(s.target.files?.[0])})]}),e.jsxs(x,{onClick:$s,className:"mt-3 gold-gradient w-full font-black text-primary-foreground",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"})," Download Setup Backup"]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Quick CSV"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Need only the report delivery sheet? Download the currently filtered report rows as CSV."}),e.jsxs(x,{onClick:_s,variant:"outline",className:"mt-4 w-full border-primary/25 font-bold text-primary",children:[e.jsx(xe,{className:"mr-2 h-4 w-4"})," Export Filtered Reports"]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Connected Screens"}),e.jsx("div",{className:"mt-4 grid gap-2",children:[{href:"/astrologer/reports",label:"Report Filters",icon:F},{href:"/astrologer/products",label:"Store Orders",icon:Be},{href:"/astrologer/calendar",label:"Calendar Slots",icon:De}].map(s=>{const r=s.icon;return e.jsx(E,{href:s.href,children:e.jsxs(x,{variant:"outline",className:"w-full justify-start border-primary/20 text-primary",children:[e.jsx(r,{className:"mr-2 h-4 w-4"})," ",s.label]})},s.href)})})]})]})]})]}),g==="profile"&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary",children:"Profile, Branding & Theme"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Change website name, Guruji name, logo text, colors, availability and service settings."})]}),e.jsxs(x,{onClick:qe,className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Branding"]})]}),e.jsxs("div",{className:"mb-6 grid gap-5 xl:grid-cols-[340px_1fr]",children:[e.jsxs("div",{className:"glass-card overflow-hidden text-center",children:[e.jsxs("div",{className:"p-6 text-white",style:{background:`linear-gradient(135deg, ${l.accentColor}, ${l.primaryColor})`},children:[e.jsx("img",{src:le,alt:l.gurujiName,className:"mx-auto mb-4 h-28 w-28 rounded-[2rem] border-2 border-white/40 object-cover object-top shadow-xl"}),e.jsx("h3",{className:"font-serif text-2xl font-black",children:l.gurujiName}),e.jsx("p",{className:"text-sm text-white/82",children:l.businessName}),e.jsx("div",{className:"mx-auto mt-4 grid h-16 w-16 place-items-center rounded-2xl bg-white/20 font-serif text-xl font-black",children:l.logoImage?e.jsx("img",{src:l.logoImage,alt:l.businessName,className:"max-h-12 max-w-12 object-contain"}):l.logoText||"AB"})]}),e.jsxs("div",{className:"p-5",children:[e.jsx(j,{className:"bg-emerald-500/10 text-emerald-700 border-emerald-500/20",children:"Verified Guruji"}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:"This preview is used for Guruji admin, branding and customer-facing identity."}),e.jsxs("label",{className:"mt-4 inline-flex h-10 cursor-pointer items-center justify-center rounded-2xl border border-primary/25 bg-background px-4 text-xs font-black text-primary",children:[e.jsx(pe,{className:"mr-2 h-4 w-4"})," Upload Website Logo",e.jsx("input",{type:"file",accept:"image/*",className:"sr-only",onChange:s=>Ss(s.target.files?.[0])})]}),l.logoImage&&e.jsx("button",{type:"button",onClick:()=>o({...l,logoImage:""}),className:"mt-3 block w-full text-xs font-bold text-rose-700",children:"Remove logo image"})]})]}),e.jsxs("div",{className:"grid gap-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif font-bold text-primary",children:[e.jsx(fs,{className:"h-5 w-5"})," Website Identity"]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Website / Company Name"}),e.jsx("input",{value:l.businessName,onChange:s=>o({...l,businessName:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Guruji Name"}),e.jsx("input",{value:l.gurujiName,onChange:s=>o({...l,gurujiName:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Logo Text"}),e.jsx("input",{value:l.logoText,maxLength:4,onChange:s=>o({...l,logoText:s.target.value.toUpperCase()}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Mobile Number"}),e.jsx("input",{value:l.mobileNumber,onChange:s=>o({...l,mobileNumber:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"WhatsApp Number"}),e.jsx("input",{value:l.whatsapp,onChange:s=>o({...l,whatsapp:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Support Phone"}),e.jsx("input",{value:l.supportPhone,onChange:s=>o({...l,supportPhone:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Email"}),e.jsx("input",{value:l.email,onChange:s=>o({...l,email:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Business Address"}),e.jsx("input",{value:l.businessAddress,onChange:s=>o({...l,businessAddress:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"City"}),e.jsx("input",{value:l.city,onChange:s=>o({...l,city:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"State"}),e.jsx("input",{value:l.state,onChange:s=>o({...l,state:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Welcome Message"}),e.jsx("textarea",{value:l.welcomeMessage,onChange:s=>o({...l,welcomeMessage:s.target.value}),className:"min-h-20 w-full rounded-xl border border-primary/15 bg-card px-3 py-2 text-sm outline-none focus:border-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Footer / About Note"}),e.jsx("textarea",{value:l.footerNote,onChange:s=>o({...l,footerNote:s.target.value}),className:"min-h-20 w-full rounded-xl border border-primary/15 bg-card px-3 py-2 text-sm outline-none focus:border-primary"})]})]})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif font-bold text-primary",children:[e.jsx($e,{className:"h-5 w-5"})," Theme Colors"]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Primary"}),e.jsx("input",{type:"color",value:l.primaryColor,onChange:s=>o({...l,primaryColor:s.target.value}),className:"h-12 w-full rounded-xl border border-primary/15 bg-card p-1"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Accent"}),e.jsx("input",{type:"color",value:l.accentColor,onChange:s=>o({...l,accentColor:s.target.value}),className:"h-12 w-full rounded-xl border border-primary/15 bg-card p-1"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Glow Gold"}),e.jsx("input",{type:"color",value:l.goldColor,onChange:s=>o({...l,goldColor:s.target.value}),className:"h-12 w-full rounded-xl border border-primary/15 bg-card p-1"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Background"}),e.jsx("input",{type:"color",value:l.backgroundColor,onChange:s=>o({...l,backgroundColor:s.target.value}),className:"h-12 w-full rounded-xl border border-primary/15 bg-card p-1"})]})]}),e.jsx(x,{onClick:qe,className:"mt-4 w-full bg-white text-[#15091f] hover:bg-white/90 font-black",children:"Apply Theme"})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif font-bold text-primary",children:[e.jsx(sr,{className:"h-5 w-5"})," Availability"]}),e.jsxs("button",{onClick:()=>As({isOnline:!f.isOnline}),className:"guruji-online-toggle mb-3 flex w-full items-center justify-between rounded-2xl border p-4 text-left",children:[e.jsxs("span",{children:[e.jsx("span",{className:"block font-black",children:f.isOnline?"Online":"Offline"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:f.isOnline?"Clients can start live chat.":`Reply time ${f.replyDelay}`})]}),e.jsx("span",{className:"guruji-online-dot h-3 w-3 rounded-full"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Offline Reply Delay"}),e.jsx("input",{value:f.replyDelay,onChange:s=>As({replyDelay:s.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]})]})]})]})]}),e.jsxs("div",{className:"grid lg:grid-cols-[340px_1fr] gap-5",children:[e.jsxs("div",{className:"glass-card p-5 text-center",children:[e.jsx("img",{src:le,alt:l.gurujiName,className:"mx-auto mb-4 h-24 w-24 rounded-full border border-primary/25 object-cover object-top"}),e.jsx("h3",{className:"font-serif text-xl font-bold",children:l.gurujiName}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Vedic Astrology, Kundli, Marriage, Vastu"}),e.jsx(j,{className:"mt-3 bg-emerald-500/10 text-emerald-700 border-emerald-500/20",children:"Verified Guruji"})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif font-bold text-primary mb-4",children:"Connected Website Details"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Display Name"}),e.jsx("input",{value:l.gurujiName,onChange:s=>o({...l,gurujiName:s.target.value}),className:"h-10 w-full rounded-md border border-primary/20 bg-card px-3 text-sm outline-none focus:ring-1 focus:ring-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Mobile Number"}),e.jsx("input",{value:l.mobileNumber,onChange:s=>o({...l,mobileNumber:s.target.value}),className:"h-10 w-full rounded-md border border-primary/20 bg-card px-3 text-sm outline-none focus:ring-1 focus:ring-primary"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Chat Rate"}),e.jsx("input",{className:"h-10 w-full rounded-md border border-primary/20 bg-card px-3 text-sm outline-none focus:ring-1 focus:ring-primary",defaultValue:"₹15/min"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Call Price"}),e.jsx("input",{className:"h-10 w-full rounded-md border border-primary/20 bg-card px-3 text-sm outline-none focus:ring-1 focus:ring-primary",defaultValue:"₹800"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Video Price"}),e.jsx("input",{className:"h-10 w-full rounded-md border border-primary/20 bg-card px-3 text-sm outline-none focus:ring-1 focus:ring-primary",defaultValue:"₹1,200"})]}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Languages"}),e.jsx("input",{className:"h-10 w-full rounded-md border border-primary/20 bg-card px-3 text-sm outline-none focus:ring-1 focus:ring-primary",defaultValue:"Hindi, English"})]}),e.jsxs("label",{className:"md:col-span-2 space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-medium",children:"Welcome Message"}),e.jsx("textarea",{value:l.welcomeMessage,onChange:s=>o({...l,welcomeMessage:s.target.value}),className:"min-h-24 w-full rounded-md border border-primary/20 bg-card px-3 py-2 text-sm outline-none focus:ring-1 focus:ring-primary"})]})]}),e.jsxs(x,{onClick:qe,className:"mt-4 gold-gradient text-primary-foreground font-bold",children:[e.jsx(cs,{className:"w-4 h-4 mr-2"})," Save Guruji Settings"]})]})]})]}),y!=="/astrologer/live"&&e.jsxs(E,{href:"/astrologer/live",className:"guruji-live-floating-button","aria-label":"Open live chat queue",children:[e.jsx(ee,{className:"h-6 w-6"}),B.length>0&&e.jsx("span",{children:B.length})]})]})]})})}const lr=["All","booking","report","puja","question","calculator"];function xr(t){return{booking:gs,report:F,puja:cr,question:be,calculator:bs}[t]}function pr(t){return{booking:"border-sky-500/20 bg-sky-500/8 text-sky-700",report:"border-orange-500/20 bg-orange-500/8 text-orange-700",puja:"border-rose-500/20 bg-rose-500/8 text-rose-700",question:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700",calculator:"border-violet-500/20 bg-violet-500/8 text-violet-700"}[t]}function Ka({branding:t,serviceControls:u,managedAstrologers:m,editingAstrologerId:g,sharedSaveStatus:y,onBrandingChange:f,onLogoUpload:w,onChangeService:b,onChangePayment:A,onAddService:l,onSelectAstrologer:o,onChangeAstrologer:v,onAddAstrologer:O,onRemoveAstrologer:C,onAstrologerImageUpload:d,onSaveAstrologers:h,onSave:T}){const c=m.find(a=>a.id===g)||m[0],i=u.services.filter(a=>a.enabled).length,P=u.services.filter(a=>a.kind==="calculator"),se=m.filter(a=>a.enabled).length,[U,ie]=N.useState("branding"),I=a=>f({...t,...a}),ze=[{key:"homepageHeadline",label:"Homepage Heading"},{key:"homepageIntro",label:"Homepage Main Description",rows:3},{key:"homepageSubheadline",label:"Homepage Small Tagline"},{key:"servicesIntro",label:"Services Section Description",rows:2},{key:"bookingIntro",label:"Booking Form Description",rows:2},{key:"chatIntro",label:"Chat Screen Message",rows:2},{key:"reportIntro",label:"Reports Section Description",rows:2},{key:"pujaIntro",label:"Puja Section Description",rows:2},{key:"storeIntro",label:"Store Section Description",rows:2},{key:"welcomeMessage",label:"Welcome Message",rows:3},{key:"footerNote",label:"Footer / About Note",rows:3}],re=[{key:"primaryColor",label:"Brand Gold"},{key:"accentColor",label:"Maroon Accent"},{key:"goldColor",label:"Glow Color"},{key:"backgroundColor",label:"Website Background"},{key:"surfaceColor",label:"Card Surface"},{key:"textColor",label:"Text Color"}],oe=[{id:"branding",label:"Branding",desc:"Logo, name, contact, colors",icon:$e},{id:"content",label:"Editing",desc:"Homepage and page text",icon:F},{id:"services",label:"Services",desc:"Prices, on/off, calculators",icon:Le},{id:"razorpay",label:"Razorpay",desc:"Gateway and UPI setup",icon:Me},{id:"astrologers",label:"Profiles",desc:"Guruji team and photos",icon:xs}],fe=y.source==="server"?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700";return e.jsxs("div",{className:"space-y-6 pb-12",children:[e.jsxs("div",{className:"guruji-theme-editor-hero overflow-hidden rounded-3xl border p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-5 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Complete Website Control"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary md:text-4xl",children:"Guruji Theme Editor"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Change brand name, tagline, logo, colors, website content, service prices, calculator visibility, payment gateway and astrologer profiles from one backend."}),e.jsxs("div",{className:`mt-4 inline-flex max-w-full items-center gap-2 rounded-full border px-3 py-2 text-xs font-black ${fe}`,children:[e.jsx(Ee,{className:"h-4 w-4 shrink-0"}),e.jsxs("span",{className:"truncate",children:[y.source==="server"?"Server Published":"Local Preview"," - ",y.message]})]})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 xl:min-w-[360px]",children:[e.jsxs(x,{onClick:T,className:"gold-gradient min-h-11 rounded-2xl font-black text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Everything"]}),e.jsx(E,{href:"/",children:e.jsxs(x,{variant:"outline",className:"min-h-11 w-full rounded-2xl border-primary/25 bg-background/70 font-black text-primary",children:[e.jsx(fs,{className:"mr-2 h-4 w-4"})," Preview Site"]})})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Brand",value:t.businessName,icon:$e,tone:"guruji-tone-gold"},{label:"Active Services",value:`${i}/${u.services.length}`,icon:Le,tone:"guruji-tone-violet"},{label:"Calculators",value:`${P.filter(a=>a.enabled).length}/${P.length}`,icon:bs,tone:"guruji-tone-saffron"},{label:"Astrologers",value:`${se}/${m.length}`,icon:xs,tone:"guruji-tone-green"}].map(a=>{const k=a.icon;return e.jsxs("div",{className:`guruji-metric-card rounded-3xl border p-4 ${a.tone}`,children:[e.jsx(k,{className:"mb-3 h-5 w-5"}),e.jsx("p",{className:"truncate text-xl font-black",children:a.value}),e.jsx("p",{className:"mt-1 text-[10px] font-black uppercase tracking-[0.16em] opacity-70",children:a.label})]},a.label)})})]}),e.jsx("div",{className:"glass-card p-3",children:e.jsx("div",{className:"grid gap-2 md:grid-cols-5",children:oe.map(a=>{const k=a.icon,R=U===a.id;return e.jsxs("button",{type:"button",onClick:()=>ie(a.id),className:`rounded-2xl border p-3 text-left transition ${R?"border-primary/35 bg-primary/12 text-primary shadow-sm":"border-primary/10 bg-background/65 text-muted-foreground hover:border-primary/25 hover:text-primary"}`,children:[e.jsxs("span",{className:"flex items-center gap-2 font-black",children:[e.jsx("span",{className:`grid h-9 w-9 place-items-center rounded-xl ${R?"bg-primary text-primary-foreground":"bg-primary/10 text-primary"}`,children:e.jsx(k,{className:"h-4 w-4"})}),a.label]}),e.jsx("span",{className:"mt-2 block text-[11px] font-semibold leading-4 opacity-75",children:a.desc})]},a.id)})})}),U==="branding"&&e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[360px_1fr]",children:[e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"glass-card overflow-hidden",children:[e.jsxs("div",{className:"p-6 text-white",style:{background:`linear-gradient(135deg, ${t.accentColor}, ${t.primaryColor})`},children:[e.jsx("div",{className:"mx-auto grid h-20 w-20 place-items-center overflow-hidden rounded-3xl border border-white/35 bg-white/18 font-serif text-2xl font-black shadow-xl",children:t.logoImage?e.jsx("img",{src:t.logoImage,alt:t.businessName,className:"h-full w-full object-contain p-2"}):t.logoText||"AB"}),e.jsx("h2",{className:"mt-4 text-center font-serif text-2xl font-black",children:t.businessName}),e.jsx("p",{className:"mt-1 text-center text-sm text-white/80",children:t.tagline})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("label",{className:"flex min-h-11 cursor-pointer items-center justify-center rounded-2xl border border-primary/25 bg-background px-4 text-sm font-black text-primary",children:[e.jsx(pe,{className:"mr-2 h-4 w-4"})," Upload Logo Image",e.jsx("input",{type:"file",accept:"image/*",className:"sr-only",onChange:a=>w(a.target.files?.[0])})]}),t.logoImage&&e.jsx("button",{type:"button",onClick:()=>I({logoImage:""}),className:"mt-3 w-full text-xs font-black text-rose-700",children:"Remove image logo"})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"mb-4 font-serif text-xl font-black text-primary",children:"Brand Colors"}),e.jsx("div",{className:"grid gap-3",children:re.map(a=>e.jsxs("label",{className:"grid grid-cols-[1fr_76px] items-center gap-3 rounded-2xl border border-primary/12 bg-background/70 p-3 text-sm",children:[e.jsx("span",{className:"font-bold",children:a.label}),e.jsx("input",{type:"color",value:String(t[a.key]||"#D4AF37"),onChange:k=>I({[a.key]:k.target.value}),className:"h-10 w-full rounded-xl border border-primary/15 bg-card p-1"})]},String(a.key)))})]})]}),e.jsx("div",{className:"space-y-5",children:e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Brand, Logo & Contact"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved name and logo replace Astro Baat across the website."})]}),e.jsxs(x,{onClick:T,className:"gold-gradient w-fit font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Brand"]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(S,{label:"Website / Brand Name",value:t.businessName,onChange:a=>I({businessName:a})}),e.jsx(S,{label:"Guruji / Main Astrologer Name",value:t.gurujiName,onChange:a=>I({gurujiName:a})}),e.jsx(S,{label:"Tagline",value:t.tagline,onChange:a=>I({tagline:a})}),e.jsx(S,{label:"Logo Text",value:t.logoText,onChange:a=>I({logoText:a.toUpperCase().slice(0,4)})}),e.jsx(S,{label:"Mobile Number",value:t.mobileNumber,onChange:a=>I({mobileNumber:a})}),e.jsx(S,{label:"WhatsApp Number",value:t.whatsapp,onChange:a=>I({whatsapp:a})}),e.jsx(S,{label:"Support Phone",value:t.supportPhone,onChange:a=>I({supportPhone:a})}),e.jsx(S,{label:"Email",value:t.email,onChange:a=>I({email:a})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(S,{label:"Business Address",value:t.businessAddress,onChange:a=>I({businessAddress:a})})}),e.jsx(S,{label:"City",value:t.city,onChange:a=>I({city:a})}),e.jsx(S,{label:"State",value:t.state,onChange:a=>I({state:a})})]})]})})]}),U==="content"&&e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Text & Page Content Editor"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Edit homepage, booking, chat, report, puja, store and footer text from one place."})]}),e.jsxs(x,{onClick:T,className:"gold-gradient w-fit font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Publish Text"]})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:ze.map(a=>e.jsxs("label",{className:`space-y-1.5 text-sm ${a.rows?"md:col-span-2":""}`,children:[e.jsx("span",{className:"font-bold text-foreground",children:a.label}),a.rows?e.jsx("textarea",{value:String(t[a.key]||""),onChange:k=>I({[a.key]:k.target.value}),rows:a.rows,className:"w-full resize-none rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none transition focus:border-primary"}):e.jsx("input",{value:String(t[a.key]||""),onChange:k=>I({[a.key]:k.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none transition focus:border-primary"})]},String(a.key)))})]}),U==="services"&&e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[1fr_360px]",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Services, Prices & On/Off"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Controls booking, call, video, chat, paid question, puja, reports and calculator tools."})]}),e.jsxs(x,{onClick:l,variant:"outline",className:"w-fit border-primary/25 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Add Service"]})]}),e.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:u.services.map(a=>{const k=xr(a.kind);return e.jsxs("div",{className:`rounded-3xl border p-4 ${a.enabled?"border-primary/15 bg-card/80":"border-orange-500/20 bg-orange-500/5"}`,children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:`grid h-10 w-10 shrink-0 place-items-center rounded-2xl border ${pr(a.kind)}`,children:e.jsx(k,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-black",children:a.name}),e.jsx("p",{className:"text-[11px] font-bold text-muted-foreground",children:Te(a.kind)})]})]}),e.jsx("button",{type:"button",onClick:()=>b(a.id,{enabled:!a.enabled}),className:`rounded-full px-3 py-1 text-[11px] font-black ${a.enabled?"bg-emerald-500/10 text-emerald-700":"bg-orange-500/10 text-orange-700"}`,children:a.enabled?"ON":"OFF"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(L,{label:"Name",value:a.name,onChange:R=>b(a.id,{name:R})}),e.jsx(L,{label:"Price",type:"number",value:a.price,onChange:R=>b(a.id,{price:Number(R||0)})}),e.jsx(L,{label:"Duration",value:a.duration,onChange:R=>b(a.id,{duration:R})}),e.jsx(L,{label:"Button Label",value:a.label,onChange:R=>b(a.id,{label:R})}),e.jsxs("label",{className:"space-y-1.5 text-sm sm:col-span-2",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Description"}),e.jsx("textarea",{value:a.description,onChange:R=>b(a.id,{description:R.target.value}),rows:2,className:"w-full resize-none rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none focus:border-primary"})]})]})]},a.id)})})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"mb-4 font-serif text-xl font-black text-primary",children:"Calculator Visibility"}),e.jsx("div",{className:"grid gap-3",children:P.map(a=>e.jsxs("button",{type:"button",onClick:()=>b(a.id,{enabled:!a.enabled}),className:`flex items-center justify-between rounded-2xl border p-4 text-left ${a.enabled?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/8 text-orange-700"}`,children:[e.jsxs("span",{children:[e.jsx("span",{className:"block font-black",children:a.name}),e.jsx("span",{className:"text-xs opacity-75",children:a.enabled?"Visible to users":"Hidden from calculators page"})]}),e.jsx("span",{className:"rounded-full bg-background/80 px-3 py-1 text-[11px] font-black",children:a.enabled?"ON":"OFF"})]},a.id))})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Services Publish"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"These settings control booking, reports, puja, paid question and calculator visibility on the customer website."}),e.jsxs(x,{onClick:T,className:"mt-4 gold-gradient w-full font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Publish Services"]})]})]})]}),U==="razorpay"&&e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[1fr_420px]",children:[e.jsxs("div",{className:"glass-card p-6",children:[e.jsx(j,{className:"mb-3 border-emerald-500/20 bg-emerald-500/10 text-emerald-700",children:"Payment Setup"}),e.jsx("h2",{className:"font-serif text-3xl font-black text-primary",children:"Razorpay, UPI & Wallet Controls"}),e.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Add live Razorpay keys during setup, keep test mode while previewing, and control wallet recharge details for clients."}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[{label:"Gateway",value:u.payment.paymentMode==="live"?"Live":"Test",icon:ms,tone:"border-primary/20 bg-primary/10 text-primary"},{label:"UPI",value:u.payment.upiId||"Not set",icon:he,tone:"border-emerald-500/20 bg-emerald-500/10 text-emerald-700"},{label:"Wallet",value:t.walletMinRecharge?`${Q(Number(t.walletMinRecharge))} min`:"Enabled",icon:Ge,tone:"border-violet-500/20 bg-violet-500/10 text-violet-700"}].map(a=>{const k=a.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${a.tone}`,children:[e.jsx(k,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"truncate text-lg font-black",children:a.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide opacity-75",children:a.label})]},a.label)})})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(Me,{className:"h-5 w-5"})," Payment Gateway"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(L,{label:"Razorpay Key ID",value:u.payment.razorpayKeyId,onChange:a=>A({razorpayKeyId:a})}),e.jsx(L,{label:"Razorpay Secret",value:u.payment.razorpayKeySecret,onChange:a=>A({razorpayKeySecret:a})}),e.jsx(L,{label:"UPI ID",value:u.payment.upiId,onChange:a=>A({upiId:a})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Mode"}),e.jsxs("select",{value:u.payment.paymentMode,onChange:a=>A({paymentMode:a.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:[e.jsx("option",{value:"test",children:"Test Mode"}),e.jsx("option",{value:"live",children:"Live Mode"})]})]}),e.jsx(S,{label:"Minimum Wallet Recharge",value:t.walletMinRecharge,onChange:a=>I({walletMinRecharge:a})}),e.jsx(S,{label:"Webhook Secret",value:t.webhookSecret,onChange:a=>I({webhookSecret:a})}),e.jsxs(x,{onClick:T,className:"gold-gradient w-full font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Publish Payment"]})]})]})]}),U==="astrologers"&&e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Astrologer Profile Manager"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Add, edit, hide and publish astrologer profiles for booking and public listing."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(x,{onClick:O,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Add Astrologer"]}),e.jsxs(x,{onClick:h,className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Profiles"]})]})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[340px_1fr]",children:[e.jsx("div",{className:"space-y-2",children:m.map(a=>e.jsx("button",{type:"button",onClick:()=>o(a.id),className:`w-full rounded-2xl border p-3 text-left transition ${c?.id===a.id?"border-primary/40 bg-primary/10":"border-primary/12 bg-background/70 hover:border-primary/30"}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-12 w-12 shrink-0 place-items-center overflow-hidden rounded-2xl border border-primary/15 bg-primary/10 text-sm font-black text-primary",children:a.image?e.jsx("img",{src:a.image,alt:a.name,className:"h-full w-full object-cover object-top"}):a.name.charAt(0)}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate font-black",children:a.name}),e.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:a.title})]}),e.jsx(j,{className:a.enabled?"bg-emerald-500/10 text-emerald-700 border-emerald-500/20":"bg-orange-500/10 text-orange-700 border-orange-500/20",children:a.enabled?"ON":"OFF"})]})},a.id))}),c&&e.jsx("div",{className:"rounded-3xl border border-primary/15 bg-background/70 p-4",children:e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[220px_1fr]",children:[e.jsxs("div",{children:[e.jsx("div",{className:"aspect-[4/5] overflow-hidden rounded-3xl border border-primary/20 bg-primary/8",children:c.image?e.jsx("img",{src:c.image,alt:c.name,className:"h-full w-full object-cover object-top"}):e.jsx("div",{className:"grid h-full place-items-center font-serif text-5xl font-black text-primary",children:c.name.charAt(0)})}),e.jsxs("label",{className:"mt-3 flex min-h-10 cursor-pointer items-center justify-center rounded-2xl border border-primary/25 bg-card px-3 text-xs font-black text-primary",children:[e.jsx(ir,{className:"mr-2 h-4 w-4"})," Upload Photo",e.jsx("input",{type:"file",accept:"image/*",className:"sr-only",onChange:a=>d(c.id,a.target.files?.[0])})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[e.jsxs(x,{type:"button",variant:"outline",onClick:()=>v(c.id,{enabled:!c.enabled}),className:"border-primary/20 text-xs font-bold text-primary",children:[c.enabled?e.jsx(ge,{className:"mr-1 h-3.5 w-3.5"}):e.jsx(_e,{className:"mr-1 h-3.5 w-3.5"}),c.enabled?"Hide":"Show"]}),e.jsxs(x,{type:"button",variant:"outline",onClick:()=>C(c.id),className:"border-rose-500/25 text-xs font-bold text-rose-700",children:[e.jsx(Oe,{className:"mr-1 h-3.5 w-3.5"})," Remove"]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(S,{label:"Name",value:c.name,onChange:a=>v(c.id,{name:a})}),e.jsx(S,{label:"Title",value:c.title,onChange:a=>v(c.id,{title:a})}),e.jsx(S,{label:"Expertise",value:c.expertise.join(", "),onChange:a=>v(c.id,{expertise:a.split(",").map(k=>k.trim()).filter(Boolean)})}),e.jsx(S,{label:"Languages",value:c.languages.join(", "),onChange:a=>v(c.id,{languages:a.split(",").map(k=>k.trim()).filter(Boolean)})}),e.jsx(S,{label:"Experience",type:"number",value:c.experience,onChange:a=>v(c.id,{experience:Number(a||0)})}),e.jsx(S,{label:"Rating",type:"number",value:c.rating,onChange:a=>v(c.id,{rating:Number(a||0)})}),e.jsx(S,{label:"Chat Price / Min",type:"number",value:c.chatPricePerMin,onChange:a=>v(c.id,{chatPricePerMin:Number(a||0)})}),e.jsx(S,{label:"Call Price",type:"number",value:c.callPrice,onChange:a=>v(c.id,{callPrice:Number(a||0)})}),e.jsx(S,{label:"Video Price",type:"number",value:c.videoPrice,onChange:a=>v(c.id,{videoPrice:Number(a||0)})}),e.jsx(S,{label:"Location",value:c.location,onChange:a=>v(c.id,{location:a})}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Profile Bio"}),e.jsx("textarea",{value:c.bio,onChange:a=>v(c.id,{bio:a.target.value}),rows:4,className:"w-full resize-none rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none focus:border-primary"})]}),e.jsx("button",{type:"button",onClick:()=>v(c.id,{isOnline:!c.isOnline}),className:`md:col-span-2 rounded-2xl border p-4 text-left font-black ${c.isOnline?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700"}`,children:c.isOnline?"Online - clients can book now":"Offline - show next availability"})]})]})})]})]})]})}function S({label:t,value:u,onChange:m,type:g="text"}){return e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:t}),e.jsx("input",{type:g,value:u,onChange:y=>m(y.target.value),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none transition focus:border-primary"})]})}function qa({controls:t,serviceSearch:u,serviceKindFilter:m,onSearchChange:g,onKindFilterChange:y,onChangeService:f,onChangePayment:w,onAddService:b,onSave:A}){const l=u.trim().toLowerCase(),o=N.useMemo(()=>t.services.filter(d=>{const h=`${d.name} ${d.label} ${d.kind} ${d.description}`.toLowerCase(),T=!l||h.includes(l),c=m==="All"||d.kind===m;return T&&c}),[t.services,l,m]),v=t.services.filter(d=>d.enabled).length,O=t.services.length-v,C=t.services.reduce((d,h)=>d+(h.enabled?Number(h.price||0):0),0);return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/14 via-background to-rose-500/8 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Guruji Services Control"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Manage All Services, Prices & Status"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Control report names, puja dakshina, call/video prices, paid question packages, calculator access and service visibility from one Guruji panel."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(x,{onClick:b,variant:"outline",className:"border-primary/25 bg-background/70 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Add Service"]}),e.jsxs(x,{onClick:A,className:"gold-gradient font-bold text-primary-foreground shadow-[0_14px_34px_rgba(212,175,55,.22)]",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Services"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[{label:"Active Services",value:v,icon:_e,tone:"border-emerald-500/20 bg-emerald-500/10 text-emerald-700"},{label:"Service Off",value:O,icon:ge,tone:"border-orange-500/20 bg-orange-500/10 text-orange-700"},{label:"Enabled Value",value:Q(C),icon:he,tone:"border-primary/20 bg-primary/10 text-primary"}].map(d=>{const h=d.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${d.tone}`,children:[e.jsx(h,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-2xl font-black",children:d.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide opacity-75",children:d.label})]},d.label)})})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[1fr_360px]",children:[e.jsxs("div",{className:"glass-card p-4 md:p-5",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Services"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Rename services, update pricing and turn each item on or off."})]}),e.jsxs("label",{className:"relative block lg:w-72",children:[e.jsx(hs,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx("input",{value:u,onChange:d=>g(d.target.value),placeholder:"Search services...",className:"h-11 w-full rounded-xl border border-primary/15 bg-card pl-10 pr-3 text-sm outline-none focus:border-primary"})]})]}),e.jsx("div",{className:"mb-5 flex gap-2 overflow-x-auto pb-1",children:lr.map(d=>{const h=m===d;return e.jsx("button",{type:"button",onClick:()=>y(d),className:`shrink-0 rounded-full border px-4 py-2 text-xs font-black transition ${h?"border-primary/30 bg-primary/12 text-primary":"border-primary/12 bg-background/70 text-muted-foreground hover:border-primary/30 hover:text-primary"}`,children:d==="All"?"All Services":Te(d)},d)})}),e.jsx("div",{className:"grid gap-4 xl:grid-cols-2",children:o.map(d=>{const h=xr(d.kind),T=pr(d.kind);return e.jsxs("article",{className:`rounded-3xl border bg-card/75 p-4 transition ${d.enabled?"border-primary/16 shadow-sm":"border-orange-500/20 bg-orange-500/5 opacity-85"}`,children:[e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:`grid h-11 w-11 shrink-0 place-items-center rounded-2xl border ${T}`,children:e.jsx(h,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(j,{className:`${T} mb-2 text-[10px]`,children:Te(d.kind)}),e.jsx("input",{value:d.name,onChange:c=>f(d.id,{name:c.target.value}),className:"w-full rounded-xl border border-transparent bg-transparent text-base font-black text-foreground outline-none transition focus:border-primary/20 focus:bg-background focus:px-2 focus:py-1"})]})]}),e.jsx("button",{type:"button",onClick:()=>f(d.id,{enabled:!d.enabled}),className:`shrink-0 rounded-full border px-3 py-1 text-[11px] font-black transition ${d.enabled?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700"}`,children:d.enabled?"ON":"OFF"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(L,{label:"Display Label",value:d.label,onChange:c=>f(d.id,{label:c})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Service Type"}),e.jsx("select",{value:d.kind,onChange:c=>f(d.id,{kind:c.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:lr.filter(c=>c!=="All").map(c=>e.jsx("option",{value:c,children:Te(c)},c))})]}),e.jsx(L,{label:"Price",type:"number",value:d.price,onChange:c=>f(d.id,{price:Number(c||0)})}),e.jsx(L,{label:"Duration / Delivery",value:d.duration,onChange:c=>f(d.id,{duration:c})}),e.jsx("div",{className:"sm:col-span-2",children:e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Description"}),e.jsx("textarea",{value:d.description,onChange:c=>f(d.id,{description:c.target.value}),rows:3,className:"w-full resize-none rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none transition focus:border-primary"})]})})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3 rounded-2xl border border-primary/10 bg-background/65 p-3",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:d.enabled?"Visible to customers":"Hidden from customer flow"}),e.jsx("span",{className:"font-serif text-xl font-black text-primary",children:Q(d.price)})]})]},d.id)})}),o.length===0&&e.jsxs("div",{className:"rounded-3xl border border-dashed border-primary/20 bg-primary/5 p-10 text-center",children:[e.jsx(Le,{className:"mx-auto mb-3 h-10 w-10 text-primary"}),e.jsx("h3",{className:"font-serif text-2xl font-black text-primary",children:"No service found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Change the filter or add a new Guruji service."})]})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(Me,{className:"h-5 w-5"})," Razorpay & Wallet"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(L,{label:"Razorpay Key ID",value:t.payment.razorpayKeyId,placeholder:"rzp_live_xxxxxx",onChange:d=>w({razorpayKeyId:d})}),e.jsx(L,{label:"Razorpay Key Secret",value:t.payment.razorpayKeySecret,placeholder:"Secret for setup handover",onChange:d=>w({razorpayKeySecret:d})}),e.jsx(L,{label:"UPI ID",value:t.payment.upiId,placeholder:"guruji@bank",onChange:d=>w({upiId:d})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Payment Mode"}),e.jsxs("select",{value:t.payment.paymentMode,onChange:d=>w({paymentMode:d.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:[e.jsx("option",{value:"test",children:"Test Mode"}),e.jsx("option",{value:"live",children:"Live Mode"})]})]}),e.jsxs(x,{onClick:A,className:"gold-gradient w-full font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Gateway"]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Connected Customer Screens"}),e.jsx("div",{className:"mt-4 grid gap-2",children:[{href:"/book?mode=call",label:"Call Booking",icon:gs},{href:"/book?mode=video",label:"Video Booking",icon:or},{href:"/reports",label:"Report Orders",icon:F},{href:"/puja",label:"Puja Booking",icon:cr},{href:"/questions",label:"Paid Question",icon:be},{href:"/calculators",label:"Calculators",icon:bs}].map(d=>{const h=d.icon;return e.jsx(E,{href:d.href,children:e.jsxs(x,{variant:"outline",className:"w-full justify-start border-primary/20 text-primary",children:[e.jsx(h,{className:"mr-2 h-4 w-4"})," ",d.label]})},d.href)})})]})]})]})]})}function L({label:t,value:u,onChange:m,type:g="text",placeholder:y}){return e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:t}),e.jsx("input",{type:g,value:u,placeholder:y,onChange:f=>m(f.target.value),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none transition focus:border-primary"})]})}function Qa({chats:t,chatDrafts:u,gurujiName:m,onDraftChange:g,onSend:y,onClose:f,onReorder:w}){return t.length===0?null:e.jsxs("div",{className:"sticky bottom-4 z-30 mt-6 rounded-3xl border border-primary/20 bg-background/95 p-3 shadow-[0_24px_70px_rgba(0,0,0,.24)] backdrop-blur-xl",children:[e.jsxs("div",{className:"mb-3 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Open Guruji Chat Windows"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Max 4 chats at once. Drag a chat header to reorder the desk."})]}),e.jsxs(j,{className:"w-fit border-emerald-500/20 bg-emerald-500/10 text-emerald-700",children:[t.length,"/4 open"]})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:t.map(b=>{const A=u[b.id]||"";return e.jsxs("article",{draggable:!0,onDragStart:l=>l.dataTransfer.setData("text/guruji-chat-id",b.id),onDragOver:l=>l.preventDefault(),onDrop:l=>w(l.dataTransfer.getData("text/guruji-chat-id"),b.id),className:"flex min-h-[380px] flex-col overflow-hidden rounded-3xl border border-primary/15 bg-card shadow-sm transition hover:-translate-y-0.5 hover:border-primary/30",children:[e.jsxs("div",{className:"flex cursor-move items-center justify-between gap-2 border-b border-primary/10 bg-gradient-to-r from-primary/12 via-background to-emerald-500/8 px-3 py-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(Ga,{className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-2xl bg-primary/15 text-xs font-black text-primary",children:(b.clientName||"C").charAt(0)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-black",children:b.clientName||"Website Client"}),e.jsxs("p",{className:"truncate text-[10px] text-muted-foreground",children:[b.language," - DOB ",b.dateOfBirth||"not shared"]})]})]}),e.jsx("button",{type:"button",onClick:()=>f(b.id),className:"grid h-8 w-8 shrink-0 place-items-center rounded-xl border border-rose-500/20 bg-rose-500/8 text-rose-700",children:e.jsx(nr,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto bg-gradient-to-b from-background/70 to-primary/5 p-3",children:[e.jsxs("div",{className:"max-w-[88%] rounded-2xl rounded-tl-sm border border-primary/10 bg-background px-3 py-2 text-xs leading-5 shadow-sm",children:[e.jsx("p",{className:"font-bold text-primary",children:"Client question"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:b.question||"Client is waiting for your first reply."})]}),(b.gurujiReplies||[]).map(l=>e.jsxs("div",{className:"ml-auto max-w-[88%] rounded-2xl rounded-tr-sm bg-primary px-3 py-2 text-xs leading-5 text-primary-foreground shadow-sm",children:[e.jsx("p",{children:l.message}),e.jsxs("p",{className:"mt-1 text-[10px] opacity-75",children:[l.senderName||m," - ",new Date(l.sentAt).toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit"})]})]},l.id))]}),e.jsxs("div",{className:"border-t border-primary/10 bg-card p-3",children:[e.jsx("textarea",{value:A,onChange:l=>g(b.id,l.target.value),placeholder:"Type reply...",rows:3,className:"w-full resize-none rounded-2xl border border-primary/15 bg-background px-3 py-2 text-xs outline-none focus:border-primary"}),e.jsxs("div",{className:"mt-2 grid grid-cols-[1fr_auto] gap-2",children:[e.jsx(x,{size:"sm",onClick:()=>g(b.id,"Namaste. I am checking your details. Please stay connected for guidance."),variant:"outline",className:"rounded-xl border-primary/20 text-xs font-bold text-primary",children:"Quick"}),e.jsxs(x,{size:"sm",onClick:()=>y(b.id),disabled:!A.trim(),className:"gold-gradient rounded-xl text-xs font-bold text-primary-foreground",children:[e.jsx(cs,{className:"mr-1 h-3.5 w-3.5"})," Send"]})]})]})]},b.id)})})]})}function Ja({products:t,productOrders:u,editingProductId:m,productSearch:g,onSearchChange:y,onSelectProduct:f,onChangeProduct:w,onAddProduct:b,onRemoveProduct:A,onSaveProducts:l}){const o=t.find(i=>i.id===m)||t[0],v=g.trim().toLowerCase(),O=N.useMemo(()=>t.filter(i=>{const P=`${i.name} ${i.category} ${i.purpose} ${i.description}`.toLowerCase();return!v||P.includes(v)}),[t,v]),C=t.filter(i=>i.isActive!==!1).length,d=t.length-C,h=t.reduce((i,P)=>i+Number(P.salePrice||0),0),T=i=>{if(!i||!o)return;const P=new FileReader;P.onload=()=>w(o.id,{image:String(P.result||o.image)}),P.readAsDataURL(i)};if(!o)return e.jsxs("div",{className:"glass-card p-10 text-center",children:[e.jsx(Be,{className:"mx-auto mb-3 h-10 w-10 text-primary"}),e.jsx("h1",{className:"font-serif text-2xl font-bold text-primary",children:"Product Manager"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Add your first product to begin selling remedies online."}),e.jsxs(x,{onClick:b,className:"mt-5 gold-gradient font-bold text-primary-foreground",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Add Product"]})]});const c=o.isActive!==!1;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-orange-500/8 p-5 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(j,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Guruji Store Control"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Product Manager"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Edit product content, upload original product images, manage pricing and switch products on or off for the customer store."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(x,{onClick:b,variant:"outline",className:"border-primary/25 bg-background/70 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Add Product"]}),e.jsxs(x,{onClick:l,className:"gold-gradient font-bold text-primary-foreground shadow-[0_14px_34px_rgba(212,175,55,.22)]",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Store"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[{label:"Active Products",value:C,icon:_e,tone:"bg-emerald-500/10 text-emerald-700 border-emerald-500/20"},{label:"Hidden Products",value:d,icon:ge,tone:"bg-orange-500/10 text-orange-700 border-orange-500/20"},{label:"Catalog Value",value:Q(h),icon:he,tone:"bg-primary/10 text-primary border-primary/20"}].map(i=>e.jsxs("div",{className:`rounded-2xl border p-4 ${i.tone}`,children:[e.jsx(i.icon,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-2xl font-black",children:i.value}),e.jsx("p",{className:"text-xs font-bold opacity-75",children:i.label})]},i.label))})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl font-black text-primary",children:"Product Orders"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Track paid product orders, packing and dispatch status."})]}),e.jsxs(j,{className:"w-fit border-primary/20 bg-primary/10 text-primary",children:[u.length," live orders"]})]}),e.jsx("div",{className:"grid gap-3 lg:grid-cols-3",children:u.map(i=>e.jsxs("div",{className:"rounded-2xl border border-primary/12 bg-background/70 p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[e.jsx("span",{className:"font-mono text-xs font-black text-primary",children:i.id}),e.jsx(j,{className:"border-emerald-500/20 bg-emerald-500/10 text-emerald-700 text-[10px]",children:i.status})]}),e.jsx("p",{className:"font-serif text-lg font-black",children:i.item}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i.client}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"font-black text-primary",children:i.amount}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["ETA ",i.eta]})]}),e.jsx(x,{variant:"outline",className:"mt-4 h-9 w-full border-primary/20 text-xs font-bold text-primary",children:"Update Dispatch"})]},i.id))})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[340px_1fr]",children:[e.jsxs("div",{className:"glass-card overflow-hidden p-4",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-serif text-lg font-bold text-primary",children:"All Products"}),e.jsx(j,{className:"border-primary/20 bg-primary/10 text-primary",children:O.length})]}),e.jsxs("label",{className:"relative mb-4 block",children:[e.jsx(hs,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx("input",{value:g,onChange:i=>y(i.target.value),placeholder:"Search product...",className:"h-11 w-full rounded-xl border border-primary/15 bg-card pl-10 pr-3 text-sm outline-none focus:border-primary"})]}),e.jsx("div",{className:"max-h-[660px] space-y-2 overflow-y-auto pr-1",children:O.map(i=>e.jsx("button",{type:"button",onClick:()=>f(i.id),className:`w-full rounded-2xl border p-3 text-left transition-all ${o.id===i.id?"border-primary/45 bg-primary/10 shadow-sm":"border-primary/10 bg-background/55 hover:border-primary/30"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("img",{src:i.image,alt:i.name,className:"h-14 w-14 rounded-xl border border-primary/10 object-cover"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"truncate text-sm font-bold",children:i.name}),i.isActive===!1&&e.jsx(ge,{className:"h-3.5 w-3.5 flex-shrink-0 text-orange-600"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] font-semibold text-muted-foreground",children:[i.category," - ",Q(i.salePrice)]}),e.jsx("p",{className:"mt-1 line-clamp-1 text-[11px] text-muted-foreground",children:i.purpose})]})]})},i.id))})]}),e.jsx("div",{className:"glass-card overflow-hidden",children:e.jsxs("div",{className:"grid lg:grid-cols-[320px_1fr]",children:[e.jsxs("div",{className:"border-b border-primary/10 bg-primary/5 p-5 lg:border-b-0 lg:border-r",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-primary/20 bg-card shadow-sm",children:[e.jsx("img",{src:o.image,alt:o.name,className:"h-80 w-full object-cover"}),e.jsxs("div",{className:"absolute left-4 top-4 flex flex-wrap gap-2",children:[e.jsx(j,{className:c?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700",children:c?"Live in Store":"Hidden"}),e.jsx(j,{className:"border-primary/20 bg-background/80 text-primary",children:o.stock})]})]}),e.jsxs("div",{className:"mt-4 grid gap-2",children:[e.jsx("input",{id:`product-image-${o.id}`,type:"file",accept:"image/*",className:"hidden",onChange:i=>T(i.target.files?.[0])}),e.jsxs("label",{htmlFor:`product-image-${o.id}`,className:"inline-flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl border border-primary/25 bg-background/80 px-4 text-sm font-bold text-primary transition hover:bg-primary/5",children:[e.jsx(ir,{className:"h-4 w-4"})," Upload Product Image"]}),e.jsxs(x,{type:"button",variant:"outline",onClick:()=>w(o.id,{isActive:!c}),className:c?"rounded-2xl border-orange-500/25 bg-orange-500/5 text-orange-700":"rounded-2xl border-emerald-500/25 bg-emerald-500/5 text-emerald-700",children:[c?e.jsx(ge,{className:"mr-2 h-4 w-4"}):e.jsx(_e,{className:"mr-2 h-4 w-4"}),c?"Turn Off Product":"Turn On Product"]}),e.jsxs(x,{type:"button",variant:"outline",onClick:()=>A(o.id),className:"rounded-2xl border-red-500/25 bg-red-500/5 text-red-700",children:[e.jsx(Oe,{className:"mr-2 h-4 w-4"})," ",o.id.startsWith("custom-product-")?"Delete Product":"Hide Product"]})]}),e.jsxs("div",{className:"mt-4 rounded-2xl border border-primary/12 bg-background/70 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-bold text-primary",children:[e.jsx(us,{className:"h-4 w-4"})," Customer Preview"]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:"The image, price, stock and visibility update on the live store after saving."}),e.jsx(E,{href:"/products",children:e.jsx(x,{variant:"outline",className:"mt-3 h-9 w-full rounded-xl border-primary/20 text-xs font-bold text-primary",children:"Open Store"})})]})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Edit Product Details"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Keep details short, clear and client-friendly."})]}),e.jsx(j,{className:"w-fit border-primary/20 bg-primary/10 text-primary",children:o.category})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(q,{label:"Product Name",value:o.name,onChange:i=>w(o.id,{name:i})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Category"}),e.jsx("select",{value:o.category,onChange:i=>w(o.id,{category:i.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:za.map(i=>e.jsx("option",{children:i},i))})]}),e.jsx(q,{label:"Regular Price",type:"number",value:o.price,onChange:i=>w(o.id,{price:Number(i||0)})}),e.jsx(q,{label:"Sale Price",type:"number",value:o.salePrice,onChange:i=>w(o.id,{salePrice:Number(i||0)})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:"Stock Status"}),e.jsx("select",{value:o.stock,onChange:i=>w(o.id,{stock:i.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:["In Stock","Limited Stock","Out of Stock"].map(i=>e.jsx("option",{children:i},i))})]}),e.jsx(q,{label:"Planet",value:o.planet||"",placeholder:"Sun, Moon, Saturn...",onChange:i=>w(o.id,{planet:i})}),e.jsx(q,{label:"Zodiac",value:o.zodiac||"",placeholder:"Leo, Cancer, All Signs...",onChange:i=>w(o.id,{zodiac:i})}),e.jsx(q,{label:"Image URL",value:o.image,placeholder:"Paste product image URL or upload file",onChange:i=>w(o.id,{image:i})}),e.jsx(q,{label:"Purpose",value:o.purpose,placeholder:"Protection, peace, wealth...",onChange:i=>w(o.id,{purpose:i})}),e.jsx(q,{label:"Recommended For",value:o.recommendedFor,onChange:i=>w(o.id,{recommendedFor:i})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(Ha,{label:"Description",value:o.description,onChange:i=>w(o.id,{description:i})})})]}),e.jsx("div",{className:"mt-5 rounded-2xl border border-amber-500/20 bg-amber-500/8 p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-serif text-lg font-bold text-primary",children:o.name}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[Q(o.salePrice)," sale price - ",o.stock]})]}),e.jsxs(x,{onClick:l,className:"gold-gradient min-h-11 font-bold text-primary-foreground",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," Save Product Changes"]})]})})]})]})})]})]})}function q({label:t,value:u,onChange:m,type:g="text",placeholder:y}){return e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:t}),e.jsx("input",{type:g,value:u,placeholder:y,onChange:f=>m(f.target.value),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none transition focus:border-primary"})]})}function Ha({label:t,value:u,onChange:m}){return e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold text-foreground",children:t}),e.jsx("textarea",{value:u,onChange:g=>m(g.target.value),rows:4,className:"w-full resize-none rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none transition focus:border-primary"})]})}export{Pt as default};

Directory Contents

Dirs: 0 × Files: 147
Name Size Perms Modified Actions
6.66 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.46 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
21.60 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
166 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
5.13 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.43 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
85 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.47 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
155 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.46 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.41 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.40 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.63 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.34 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.30 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
365 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
312 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
738 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.17 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.13 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.10 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
221 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
500 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
306 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
495 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
337 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.06 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.81 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
252 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.45 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
120 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
129 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
131 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
174 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.99 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.24 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.22 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
81 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.26 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.31 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
407 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
300 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
165 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
232 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
209 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.11 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
233 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.09 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.18 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
252 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
335 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.15 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
82 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
238 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
259 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.73 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
88 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
84 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.56 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.09 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
368.72 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
70.25 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
32.06 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
19.09 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
92.81 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
137.79 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
21.54 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
10.82 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
22.04 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
16.81 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
42.67 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
135.29 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
232 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
51.00 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
18.79 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
7.52 KB lrw-r--r-- 2026-06-06 12:45:10
Edit Download
4.15 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
42.87 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
16.20 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
16.65 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
36.20 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
292 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
557 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
79 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.45 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
884 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.19 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
85 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
317 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
352 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
140 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
202 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
372 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
24.59 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
255 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.53 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
81 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.32 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.77 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.63 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
427 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
506 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
32.09 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.19 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
617 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
158 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.01 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
81 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.37 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
83 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.53 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
298 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.90 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.13 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
201 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.24 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.37 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.67 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
328 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
808 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
483 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.98 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
398 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
473 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
642 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
85 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.45 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.06 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
86 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.98 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
871 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
176 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
402 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
239 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
192 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
343 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
307 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
78 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.08 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.36 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
808 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.45 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
86 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
718 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.33 MB lrw-r--r-- 2026-06-29 09:44:41
Edit Download
1.94 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
263 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI