1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5578],{6251:(e,t,a)=>{a.d(t,{A:()=>s});let n=a(52707).A.create({baseURL:"https://salonify.mx/api",headers:{"Content-Type":"application/json"}});n.interceptors.request.use(e=>{{let t=localStorage.getItem("salonify_token");t&&(e.headers.Authorization=`Bearer ${t}`)}return e.data instanceof FormData&&e.headers.delete("Content-Type"),e}),n.interceptors.response.use(e=>e,e=>{if(e.response?.status===401){let t=e.config?.url||"";t.includes("/auth/login")||t.includes("/auth/register")||(localStorage.removeItem("salonify_token"),localStorage.removeItem("salonify_user"),window.location.href="/login")}return Promise.reject(e)});let s=n},43061:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(95155),s=a(19749),o=a(73981);function i(e){let t,a,i=(0,s.c)(8),{variant:r,height:l,className:c}=e,d=void 0===l?36:l,u=void 0===c?"":c,f="dark"===(void 0===r?"light":r)?"/logo-oscuro.png":"/logo-claro.png",m=4*d;return i[0]!==d?(t={height:d,width:"auto",objectFit:"contain"},i[0]=d,i[1]=t):t=i[1],i[2]!==u||i[3]!==d||i[4]!==f||i[5]!==m||i[6]!==t?(a=(0,n.jsx)(o.default,{src:f,alt:"Salonify",width:m,height:d,className:u,style:t,priority:!0}),i[2]=u,i[3]=d,i[4]=f,i[5]=m,i[6]=t,i[7]=a):a=i[7],a}},65530:(e,t,a)=>{a.d(t,{R:()=>l,f:()=>c});var n=a(95155),s=a(12115),o=a(6251),i=a(79797);let r=(0,s.createContext)({notifCount:0,supportCount:0,setNotifCount:()=>{},setSupportCount:()=>{},refresh:()=>{}});function l({children:e}){let{user:t}=(0,i.A)(),[a,l]=(0,s.useState)(0),[c,d]=(0,s.useState)(0),u=(0,s.useRef)(null),f=(0,s.useCallback)(async()=>{try{let[e,t]=await Promise.allSettled([o.A.get("/notifications/unread-count"),o.A.get("/support/unread")]);"fulfilled"===e.status&&l(e.value.data.count??0),"fulfilled"===t.status&&d(t.value.data.count??0)}catch{}},[]);return(0,s.useEffect)(()=>{if(!t){l(0),d(0);return}return f(),u.current=setInterval(f,3e4),()=>{u.current&&clearInterval(u.current)}},[t,f]),(0,n.jsx)(r.Provider,{value:{notifCount:a,supportCount:c,setNotifCount:l,setSupportCount:d,refresh:f},children:e})}function c(){return(0,s.useContext)(r)}},79797:(e,t,a)=>{a.d(t,{O:()=>u,A:()=>m});var n=a(95155),s=a(19749),o=a(12115),i=a(6251),r=a(72338);let l=(0,r.registerPlugin)("PlayIntegrity");async function c(){if(!r.Capacitor.isNativePlatform())return null;try{let e=await fetch("/api/auth/integrity-nonce");if(!e.ok)return null;let{nonce:t}=await e.json(),{token:a}=await l.getToken({nonce:t});return{integrityToken:a,integrityNonce:t}}catch{return null}}let d=(0,o.createContext)(null);function u(e){let t,a,r,l,u,m,h,p,x,g=(0,s.c)(14),{children:y}=e,[v,b]=(0,o.useState)(null),[w,_]=(0,o.useState)(null),[k,j]=(0,o.useState)(!0);g[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e=localStorage.getItem("salonify_token"),t=localStorage.getItem("salonify_user");if(e&&t){let a=JSON.parse(t);_(e),b(a),a.avatar||i.A.get("/auth/me",{headers:{Authorization:`Bearer ${e}`}}).then(e=>{let{data:t}=e;if(t.avatar){let e={...a,avatar:t.avatar};localStorage.setItem("salonify_user",JSON.stringify(e)),b(e)}}).catch(f)}j(!1)},a=[],g[0]=t,g[1]=a):(t=g[0],a=g[1]),(0,o.useEffect)(t,a),g[2]===Symbol.for("react.memo_cache_sentinel")?(r=async(e,t,a)=>{let n=await c(),{data:s}=await i.A.post("/auth/login",{email:e,password:t,...n||(a?{turnstileToken:a}:{})});localStorage.setItem("salonify_token",s.access_token),localStorage.setItem("salonify_user",JSON.stringify(s.user)),_(s.access_token),b(s.user)},g[2]=r):r=g[2];let N=r;g[3]===Symbol.for("react.memo_cache_sentinel")?(l=async(e,t,a,n,s,o)=>{let r=await c(),{data:l}=await i.A.post("/auth/register",{name:e,email:t,password:a,...n&&{role:n},...s&&{phone:s},...r||(o?{turnstileToken:o}:{})});localStorage.setItem("salonify_token",l.access_token),localStorage.setItem("salonify_user",JSON.stringify(l.user)),_(l.access_token),b(l.user)},g[3]=l):l=g[3];let S=l;g[4]===Symbol.for("react.memo_cache_sentinel")?(u=(e,t)=>{localStorage.setItem("salonify_token",e),localStorage.setItem("salonify_user",JSON.stringify(t)),_(e),b(t)},g[4]=u):u=g[4];let E=u;g[5]===Symbol.for("react.memo_cache_sentinel")?(m=e=>{b(t=>{if(!t)return t;let a={...t,...e};return localStorage.setItem("salonify_user",JSON.stringify(a)),a})},g[5]=m):m=g[5];let C=m;g[6]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{localStorage.removeItem("salonify_token"),localStorage.removeItem("salonify_user"),sessionStorage.setItem("logging_out","1"),_(null),b(null),window.location.href="/"},g[6]=h):h=g[6];let A=h;
1return g[7]!==k||g[8]!==w||g[9]!==v?(p={user:v,token:w,login:N,register:S,loginWithToken:E,logout:A,updateUser:C,isLoading:k},g[7]=k,g[8]=w,g[9]=v,g[10]=p):p=g[10],g[11]!==y||g[12]!==p?(x=(0,n.jsx)(d.Provider,{value:p,children:y}),g[11]=y,g[12]=p,g[13]=x):x=g[13],x}function f(){}function m(){let e=(0,o.useContext)(d);if(!e)throw Error("useAuth must be used within AuthProvider");return e}},84422:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(95155),s=a(12115),o=a(82222),i=a(6251),r=a(65530);let l={new_booking_request:"#F5B700",booking_approved:"#22C55E",booking_rejected:"#EF4444",booking_cancelled:"#EF4444",booking_expired:"#EF4444",new_message:"#6A3EF5",venue_registered:"#6A3EF5",subscription_new:"#22C55E",subscription_changed:"#3B82F6",subscription_cancelled:"#EF4444",venue_claim:"#F5B700",venue_approved:"#22C55E",venue_suspended:"#EF4444",venue_rejected:"#F97316"},c={new_booking_request:"\uD83C\uDF89",booking_approved:"â
",booking_rejected:"â",booking_cancelled:"\uD83D\uDEAB",booking_expired:"â°",new_message:"\uD83D\uDCAC",venue_registered:"\uD83C\uDFDBï¸",subscription_new:"\uD83D\uDCB3",subscription_changed:"\uD83D\uDD04",subscription_cancelled:"\uD83D\uDEAB",venue_claim:"\uD83D\uDCCB",venue_approved:"\uD83C\uDF89",venue_suspended:"\uD83D\uDEAB",venue_rejected:"â ï¸"};function d({light:e=!1}){let t=(0,o.useRouter)(),[a,d]=(0,s.useState)(!1),[u,f]=(0,s.useState)([]),[m,h]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),g=(0,s.useRef)(null),{notifCount:y,setNotifCount:v}=(0,r.f)();(0,s.useEffect)(()=>{let e=()=>x(window.innerWidth<640);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let b=(0,s.useCallback)(async()=>{h(!0);try{let e=await i.A.get("/notifications");f(e.data||[])}catch{}finally{h(!1)}},[]);(0,s.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&d(!1)};return a&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a]);let w=async()=>{try{await i.A.patch("/notifications/read-all"),f(e=>e.map(e=>({...e,isRead:!0}))),v(0)}catch{}},_=async e=>{if(!e.isRead)try{await i.A.patch(`/notifications/${e.id}/read`),f(t=>t.map(t=>t.id===e.id?{...t,isRead:!0}:t)),v(Math.max(0,y-1))}catch{}d(!1),e.link&&t.push(e.link)},k=async(e,t)=>{t.stopPropagation();try{await i.A.delete(`/notifications/${e.id}`),f(t=>t.filter(t=>t.id!==e.id)),e.isRead||v(Math.max(0,y-1))}catch{}},j=async()=>{try{await i.A.delete("/notifications"),f([]),v(0)}catch{}},N=y>99?"99+":String(y);return(0,n.jsxs)("div",{className:"relative",ref:g,children:[(0,n.jsxs)("button",{onClick:()=>{a||b(),d(e=>!e)},className:"relative flex items-center justify-center w-9 h-9 rounded-xl transition-colors",style:{background:e?"rgba(255,255,255,0.15)":void 0},"aria-label":"Notificaciones",children:[(0,n.jsx)("svg",{className:"w-5 h-5",style:{color:e?"#fff":"#6B6B6B"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),y>0&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full text-white font-bold",style:{background:"#EF4444",fontSize:"10px",lineHeight:1},children:N})]}),a&&(0,n.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl z-50 overflow-hidden",style:{position:p?"fixed":"absolute",right:p?"8px":"0",top:p?"56px":void 0,marginTop:p?void 0:"8px",width:p?"calc(100vw - 16px)":"380px",maxWidth:p?void 0:"calc(100vw - 24px)",border:"1px solid #E8E8E8"},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid #E8E8E8"},children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-bold text-gray-900",children:"Notificaciones"}),y>0&&(0,n.jsx)("span",{className:"flex items-center justify-center px-2 py-0.5 rounded-full text-white font-bold",style:{background:"#EF4444",fontSize:"11px"},children:N})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[y>0&&(0,n.jsx)("button",{onClick:w,className:"text-xs font-medium transition-colors hover:opacity-70",style:{color:"#6A3EF5"},children:"Marcar le\xeddo"}),u.length>0&&(0,n.jsx)("button",{onClick:j,className:"text-xs font-medium transition-colors hover:opacity-70",style:{color:"#EF4444"},children:"Limpiar todo"})]})]}),(0,n.jsx)("div",{style:{maxHeight:p?"calc(100vh - 130px)":"440px",overflowY:"auto"},children:m?(0,n.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,n.jsx)("div",{className:"w-6 h-6 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"#6A3EF5",borderTopColor:"transparent"}})}):0===u.length?(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,n.jsx)("span",{className:"text-3xl",children:"\uD83D\uDD14"}),(0,n.jsx)("span",{className:"text-sm font-medium",style:{color:"#9B9B9B"},children:"Sin notificaciones"})]}):u.map(e=>{var t;let a,s,o,i,r,d,u=l[e.type]||"#6A3EF5",f=c[e.type]||"\uD83D\uDD14";return(0,n.jsxs)("div",{className:"flex items-stretch",style:{background:e.isRead?"white":"#F3F0FF",borderBottom:"1px solid #F0F0F0"},children:[(0,n.jsxs)("button",{onClick:()=>_(e),className:"flex-1 text-left flex items-start gap-3 px-4 py-3 transition-colors hover:bg-black/[0.03] min-w-0",children:[(0,n.jsx)("div",{className:"flex-shrink-0 flex flex-col items-center gap-1 pt-0.5",children:(0,n.jsx)("div",{className:"w-1 rounded-full self
1-stretch",style:{background:u,minHeight:"36px"}})}),(0,n.jsx)("div",{className:"flex-shrink-0 text-lg leading-none pt-0.5",children:f}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,n.jsx)("span",{className:"text-sm leading-tight",style:{fontWeight:e.isRead?500:700,color:"#1A1A1A"},children:e.title}),!e.isRead&&(0,n.jsx)("span",{className:"flex-shrink-0 w-2 h-2 rounded-full mt-1",style:{background:"#6A3EF5"}})]}),(0,n.jsx)("p",{className:"text-xs mt-0.5 leading-relaxed",style:{color:"#6B6B6B",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.body}),(0,n.jsx)("span",{className:"text-xs mt-1 block",style:{color:"#B0B0B0"},children:(t=e.createdAt,a=new Date,s=new Date(t),d=Math.floor((r=Math.floor((i=Math.floor((o=Math.floor((a.getTime()-s.getTime())/1e3))/60))/60))/24),o<60?"hace un momento":i<60?`hace ${i} min`:r<24?`hace ${r}h`:1===d?"ayer":`hace ${d} d\xedas`)})]})]}),(0,n.jsx)("button",{onClick:t=>k(e,t),className:"flex-shrink-0 flex items-center justify-center w-8 transition-colors hover:bg-red-50 group",title:"Eliminar notificaci\xf3n","aria-label":"Eliminar notificaci\xf3n",children:(0,n.jsx)("svg",{className:"w-3.5 h-3.5 group-hover:text-red-500 transition-colors",style:{color:"#C0C0C0"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},e.id)})})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.