(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{1283:(e,t,n)=>{"use strict";n.d(t,{PointsTracker:()=>l});var r=n(12115),a=n(36489),i=n(2950),o=n(86600);function l(){return!function(){var e;let{data:t}=(0,a.useSession)(),n=function(){let{showPointsNotification:e}=(0,i.E)();return e}(),l=(0,r.useRef)(null),s=(0,r.useRef)(!1),c=null==t||null==(e=t.user)?void 0:e.id,d=c?"playmo_last_points_".concat(c):null,{data:u}=(0,o.C)(c?"/api/user/profile":null,{staleTime:6e4,revalidateOnFocus:!1});(0,r.useEffect)(()=>{if(c&&(null==u?void 0:u.data))try{var e,t,r,a,i,o;if(null===l.current&&d&&1){let e=localStorage.getItem(d);null!==e&&(l.current=parseInt(e,10))}let c=null!=(o=null!=(i=null!=(a=null==(t=u.data)||null==(e=t.points)?void 0:e.totalPoints)?a:null==(r=u.data)?void 0:r.totalPoints)?i:u.totalPoints)?o:0;if(!s.current){if(null!==l.current&&c!==l.current){let e=c-l.current;0!==e&&n(e)}l.current=c,d&&localStorage.setItem(d,c.toString()),s.current=!0;return}if(null!==l.current&&c!==l.current){let e=c-l.current;0!==e&&n(e),l.current=c,d&&localStorage.setItem(d,c.toString())}}catch(e){console.error("[PointsTracker] Error tracking points:",e)}},[c,u,n,d])}(),null}},2950:(e,t,n)=>{"use strict";n.d(t,{E:()=>l,PointsNotificationProvider:()=>o});var r=n(95155),a=n(12115);let i=(0,a.createContext)(void 0);function o(e){let{children:t}=e,[n,o]=(0,a.useState)([]),[l]=(0,a.useState)(()=>"undefined"!=typeof Audio?new Audio("/sounds/notification.mp3"):null),s=(0,a.useCallback)(e=>{let t="notification-".concat(Date.now(),"-").concat(Math.random()),n={id:t,points:e};o(e=>[...e,n]),l&&(l.currentTime=0,l.play().catch(e=>console.log("Audio playback failed:",e))),setTimeout(()=>{o(e=>e.filter(e=>e.id!==t))},3200)},[l]),c=(0,a.useCallback)(e=>{o(t=>t.filter(t=>t.id!==e))},[]);return(0,a.useEffect)(()=>{let e=e=>{let t=e.detail;t&&"number"==typeof t.points&&s(t.points)};return window.addEventListener("newPoints",e),()=>window.removeEventListener("newPoints",e)},[s]),(0,r.jsx)(i.Provider,{value:{notifications:n,showPointsNotification:s,dismissNotification:c},children:t})}function l(){let e=(0,a.useContext)(i);if(!e)throw Error("usePointsNotification must be used within PointsNotificationProvider");return e}},3998:(e,t,n)=>{"use strict";n.d(t,{$:()=>s});var r=n(95155);n(12115);var a=n(32467),i=n(83101),o=n(64269);let l=(0,i.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function s(e){let{className:t,variant:n,size:i,asChild:s=!1,...c}=e,d=s?a.DX:"button";return(0,r.jsx)(d,{"data-slot":"button",className:(0,o.cn)(l({variant:n,size:i,className:t})),...c})}},7420:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(95155);function a(e){let{className:t,variant:n="short",...a}=e;return"full"===n?(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 169.26 53.85",className:t,...a,children:(0,r.jsx)("g",{id:"Layer_2","data-name":"Layer 2",children:(0,r.jsxs)("g",{id:"Layer_1-2","data-name":"Layer 1",children:[(0,r.jsx)("path",{d:"M0,26.2V9.62A9.32,9.32,0,0,1,14,1.55L28.34,9.84l14.37,8.29a9.32,9.32,0,0,1,0,16.14l-14.37,8.3L14,50.86A9.32,9.32,0,0,1,0,42.79Z",fill:"currentColor"}),(0,r.jsx)("circle",{cx:"143.34",cy:"27.93",r:"25.92",fill:"currentColor"}),(0,r.jsx)("path",{d:"M111,7.61v37.2a7.6,7.6,0,0,1-7.6,7.6H61.36a7.61,7.61,0,0,1-7.6-7.6V7.66A7.6,7.6,0,0,1,64.86.91l14,7.23a7.59,7.59,0,0,0,7,0L99.94.85A7.6,7.6,0,0,1,111,7.61Z",fill:"currentColor"}),(0,r.jsx)("ellipse",{cx:"72.81",cy:"30.22",rx:"7.44",ry:"2.29",fill:"#ffffff"}),(0,r.jsx)("circle",{cx:"93.25",cy:"30.22",r:"6.18",fill:"#ffffff"})]})})}):(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 57.26 52.41",className:t,...a,children:(0,r.jsx)("g",{id:"Layer_2","data-name":"Layer 2",children:(0,r.jsxs)("g",{id:"Layer_1-2","data-name":"Layer 1",children:[(0,r.jsx)("path",{d:"M57.26,7.61v37.2a7.6,7.6,0,0,1-7.6,7.6H7.6A7.6,7.6,0,0,1,0,44.81V7.66A7.6,7.6,0,0,1,11.09.91l14,7.23a7.61,7.61,0,0,0,7,0L46.18.85A7.6,7.6,0,0,1,57.26,7.61Z",fill:"currentColor"}),(0,r.jsx)("ellipse",{cx:"19.04",cy:"30.22",rx:"7.44",ry:"2.29",fill:"#ffffff"}),(0,r.jsx)("circle",{cx:"39.48",cy:"30.22",r:"6.18",fill:"#ffffff"})]})})})}n(12115)},13673:()=>{},14734:(e,t,n)=>{"use strict";n.d(t,{F:()=>l});var r=n(12115),a=n(9829),i=n(36489),o=n(95704);function l(){var e;let{data:t}=(0,i.useSession)(),[n,l]=(0,r.useState)(null),[s,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(null),m=(0,r.useRef)(null);return(0,r.useEffect)(()=>{(async()=>{try{var e;let t=await fetch("/api/settings/socket-status"),n=await t.json();u(null==(e=n.socketEnabled)||e),console.log("\uD83D\uDD0C Socket enabled status:",n.socketEnabled)}catch(e){console.error("Error checking socket status:",e),u(!0)}})()},[]),(0,r.useEffect)(()=>{if(!(null==t?void 0:t.user)||null===d)return;if(!1===d)return void console.log("\uD83D\uDD0C Socket.IO disabled by admin - SSE will be used instead");let e=window.location.hostname.includes("app.github.dev")||window.location.hostname.includes("github.dev"),r=window.location.origin;console.log("\uD83D\uDD0C Socket URL Detection:"),console.log("  - isCodespace:",e),console.log("  - NODE_ENV:","production"),console.log("  - NEXT_PUBLIC_SITE_URL:",o.env.NEXT_PUBLIC_SITE_URL),console.log("  - window.location.origin:",window.location.origin),console.log("  - window.location.hostname:",window.location.hostname),console.log("  - Final socketUrl:",r);let i=(0,a.io)(r,{path:"/api/socket/io",addTrailingSlash:!1,transports:["polling","websocket"],timeout:1e4,reconnection:!0,reconnectionAttempts:3,reconnectionDelay:5e3,reconnectionDelayMax:1e4,randomizationFactor:0,forceNew:!0});return i.on("connect",()=>{console.log("✅ Socket connected:",i.id),c(!0),t.user.id&&i.emit("joinUserRoom",t.user.id)}),i.on("disconnect",e=>{console.log("❌ Socket disconnected:",e),c(!1),"io server disconnect"===e&&(m.current=setTimeout(()=>{i.connect()},5e3))}),i.on("connect_error",e=>{console.error("\uD83D\uDD25 Socket connection error:",e.message),c(!1)}),i.io.on("reconnect_failed",()=>{console.log("❌ Socket reconnection failed after all attempts. Stopping socket."),c(!1)}),l(i),()=>{m.current&&clearTimeout(m.current),null==n||n.disconnect()}},[null==t||null==(e=t.user)?void 0:e.id,d]),{socket:n,isConnected:s,joinUserRoom:()=>{n&&(null==t?void 0:t.user.id)&&n.emit("joinUserRoom",t.user.id)},leaveUserRoom:()=>{n&&(null==t?void 0:t.user.id)&&n.emit("leaveUserRoom",t.user.id)},joinCafeRoom:e=>{n&&n.emit("joinCafeRoom",e)},leaveCafeRoom:e=>{n&&n.emit("leaveCafeRoom",e)},joinEventRoom:e=>{n&&n.emit("joinEventRoom",e)},leaveEventRoom:e=>{n&&n.emit("leaveEventRoom",e)}}}},16485:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},20063:(e,t,n)=>{"use strict";var r=n(47260);n.o(r,"redirect")&&n.d(t,{redirect:function(){return r.redirect}}),n.o(r,"useParams")&&n.d(t,{useParams:function(){return r.useParams}}),n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},21873:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},21936:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,86709,23)),Promise.resolve().then(n.t.bind(n,96168,23)),Promise.resolve().then(n.t.bind(n,33944,23)),Promise.resolve().then(n.bind(n,18720)),Promise.resolve().then(n.t.bind(n,13673,23)),Promise.resolve().then(n.t.bind(n,23825,23)),Promise.resolve().then(n.bind(n,1283)),Promise.resolve().then(n.bind(n,63103)),Promise.resolve().then(n.bind(n,36758)),Promise.resolve().then(n.bind(n,23082)),Promise.resolve().then(n.bind(n,73348)),Promise.resolve().then(n.bind(n,81192)),Promise.resolve().then(n.bind(n,2950))},23082:(e,t,n)=>{"use strict";n.d(t,{SessionProvider:()=>i});var r=n(95155),a=n(36489);function i(e){let{children:t,session:n}=e;return(0,r.jsx)(a.SessionProvider,{session:n,children:t})}},23825:()=>{},25112:(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var r=n(12115),a=n(36489);function i(){var e;let{data:t}=(0,a.useSession)(),[n,i]=(0,r.useState)(!1),[o,l]=(0,r.useState)(null),[s,c]=(0,r.useState)(null),d=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e;if(!(null==t||null==(e=t.user)?void 0:e.id))return;console.log("\uD83D\uDCE1 Setting up SSE connection for user:",t.user.id);let n=new EventSource("/api/notifications/sse");return d.current=n,n.onopen=()=>{console.log("✅ SSE connection established"),i(!0),c(null)},n.onmessage=e=>{try{let t=JSON.parse(e.data);console.log("\uD83D\uDD14 SSE notification received:",t),l(t),"notification"===t.type&&window.dispatchEvent(new CustomEvent("newNotification",{detail:t})),"points"===t.type&&window.dispatchEvent(new CustomEvent("newPoints",{detail:t}))}catch(e){console.error("❌ Error parsing SSE message:",e)}},n.onerror=e=>{console.error("❌ SSE connection error:",e),i(!1),c("اتصال real-time قطع شد")},()=>{console.log("\uD83E\uDDF9 Cleaning up SSE connection"),n.close(),i(!1)}},[null==t||null==(e=t.user)?void 0:e.id]),{isConnected:n,lastNotification:o,connectionError:s}}},32467:(e,t,n)=>{"use strict";n.d(t,{DX:()=>l,TL:()=>o});var r=n(12115),a=n(94446),i=n(95155);function o(e){let t=function(e){let t=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){var o;let e,l,s=(o=n,(l=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(l=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),c=function(e,t){let n={...t};for(let r in t){let a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(n[r]=a):"style"===r?n[r]={...a,...i}:"className"===r&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props);return n.type!==r.Fragment&&(c.ref=t?(0,a.t)(t,s):s),r.cloneElement(n,c)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:a,...o}=e,l=r.Children.toArray(a),s=l.find(c);if(s){let e=s.props.children,a=l.map(t=>t!==s?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,i.jsx)(t,{...o,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,a):null})}return(0,i.jsx)(t,{...o,ref:n,children:a})});return n.displayName=`${e}.Slot`,n}var l=o("Slot"),s=Symbol("radix.slottable");function c(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===s}},33944:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_c29908",variable:"__variable_c29908"}},36758:(e,t,n)=>{"use strict";n.d(t,{GlobalNotificationManager:()=>d});var r=n(95155),a=n(36489),i=n(12115),o=n(14734),l=n(25112),s=n(18720);function c(e){let{userId:t}=e,{socket:n,isConnected:r}=(0,o.F)(),{isConnected:a}=(0,l.h)(),{playNotificationSound:c}=function(){let e=(0,i.useRef)(null),t=(0,i.useRef)(!1),n=(0,i.useCallback)(()=>{if(!t.current)try{e.current=new(window.AudioContext||window.webkitAudioContext),t.current=!0,console.log("\uD83D\uDD0A Audio context initialized")}catch(e){console.error("Failed to initialize audio context:",e)}},[]);return(0,i.useEffect)(()=>{let e=()=>{n(),document.removeEventListener("click",e),document.removeEventListener("touchstart",e),document.removeEventListener("keydown",e)};return document.addEventListener("click",e),document.addEventListener("touchstart",e),document.addEventListener("keydown",e),()=>{document.removeEventListener("click",e),document.removeEventListener("touchstart",e),document.removeEventListener("keydown",e)}},[n]),{playNotificationSound:(0,i.useCallback)(()=>{e.current||n();let t=e.current;if(!t)return void console.warn("\uD83D\uDD07 Audio context not available");try{"suspended"===t.state&&t.resume();let e=t.currentTime,n=t.createOscillator(),r=t.createOscillator(),a=t.createOscillator(),i=t.createOscillator(),o=t.createGain(),l=t.createGain(),s=t.createGain(),c=t.createGain(),d=t.createGain();n.frequency.value=880,r.frequency.value=1318.5,a.frequency.value=1760,i.frequency.value=2637,n.type="triangle",r.type="sine",a.type="sine",i.type="sine",n.connect(o),r.connect(l),a.connect(s),i.connect(c),o.connect(d),l.connect(d),s.connect(d),c.connect(d),d.connect(t.destination),o.gain.setValueAtTime(0,e),o.gain.linearRampToValueAtTime(.6,e+.01),l.gain.setValueAtTime(0,e),l.gain.linearRampToValueAtTime(.5,e+.01),s.gain.setValueAtTime(0,e),s.gain.linearRampToValueAtTime(.4,e+.01),c.gain.setValueAtTime(0,e),c.gain.linearRampToValueAtTime(.25,e+.01),o.gain.exponentialRampToValueAtTime(.001,e+.8),l.gain.exponentialRampToValueAtTime(.001,e+.7),s.gain.exponentialRampToValueAtTime(.001,e+.6),c.gain.exponentialRampToValueAtTime(.001,e+.4),d.gain.setValueAtTime(.8,e),setTimeout(()=>{if("closed"===t.state)return;let e=t.currentTime,n=t.createOscillator(),r=t.createOscillator(),a=t.createOscillator(),i=t.createGain(),o=t.createGain(),l=t.createGain(),s=t.createGain();n.frequency.value=1318.5,r.frequency.value=1760,a.frequency.value=2637,n.type="sine",r.type="sine",a.type="sine",n.connect(i),r.connect(o),a.connect(l),i.connect(s),o.connect(s),l.connect(s),s.connect(t.destination),i.gain.setValueAtTime(0,e),i.gain.linearRampToValueAtTime(.5,e+.01),i.gain.exponentialRampToValueAtTime(.001,e+.4),o.gain.setValueAtTime(0,e),o.gain.linearRampToValueAtTime(.4,e+.01),o.gain.exponentialRampToValueAtTime(.001,e+.35),l.gain.setValueAtTime(0,e),l.gain.linearRampToValueAtTime(.25,e+.01),l.gain.exponentialRampToValueAtTime(.001,e+.25),s.gain.setValueAtTime(.7,e),n.start(e),r.start(e),a.start(e),n.stop(e+.4),r.stop(e+.35),a.stop(e+.25)},150),n.start(e),r.start(e),a.start(e),i.start(e),n.stop(e+.8),r.stop(e+.7),a.stop(e+.6),i.stop(e+.4),console.log("\uD83D\uDD14 Notification sound played")}catch(e){console.error("Failed to play notification sound:",e)}},[n])}}(),d=(0,i.useCallback)((e,t,n)=>{let r=(null==t?void 0:t.toLowerCase())||"",a=(null==n?void 0:n.toLowerCase())||"";return r.includes("لغو")||r.includes("کنسل")||r.includes("حذف")||a.includes("لغو شد")||a.includes("کنسل شد")||a.includes("لغو کرد")?"❌":r.includes("ثبت")||r.includes("تایید")||r.includes("موفق")||a.includes("ثبت شد")||a.includes("تایید شد")||r.includes("رزرو جدید")?"✅":({BOOKING:"\uD83D\uDCC5",EVENT:"\uD83C\uDFAE",SYSTEM:"\uD83D\uDD14",FRIEND_REQUEST:"\uD83D\uDC65",PAYMENT:"\uD83D\uDCB3",REVIEW:"⭐"})[e]||"\uD83D\uDD14"},[]),u=(0,i.useCallback)(e=>{c(),(0,s.o)(e.title,{description:e.message,icon:d(e.type,e.title,e.message),duration:"SYSTEM"===e.type?3e3:5e3,position:"top-left"})},[c,d]);return(0,i.useEffect)(()=>{console.log("\uD83D\uDD14 EnhancedNotificationManager status:",{userId:t,socketConnected:r,sseConnected:a,hasSocket:!!n})},[t,r,a,n]),(0,i.useEffect)(()=>{if(!n||!r)return void console.log("⏳ Socket.IO not ready yet, waiting...",{hasSocket:!!n,isConnected:r});console.log("✅ Socket.IO connected, setting up notification listeners for user:",t),n.emit("joinUserRoom",t);let e=async e=>{u(e),console.log("\uD83D\uDCF1 Socket.IO notification received and displayed")},a=e=>{c(),(0,s.o)("درخواست دوستی از ".concat(e.fromUserName),{description:"می‌توانید از طریق پروفایل پاسخ دهید",icon:"\uD83D\uDC65",duration:8e3,position:"top-left"})},i=e=>{c(),(0,s.o)("".concat(e.userName," درخواست دوستی شما را پذیرفت"),{description:"حالا می‌توانید با هم در رویدادها شرکت کنید",icon:"✅",duration:5e3,position:"top-left"})};return n.on("notification",e),n.on("friendRequestReceived",a),n.on("friendRequestAccepted",i),()=>{n.off("notification",e),n.off("friendRequestReceived",a),n.off("friendRequestAccepted",i),n.emit("leaveUserRoom",t)}},[n,r,t,c,u]),(0,i.useEffect)(()=>{let e=e=>{let t=e.detail;t&&"notification"===t.type&&(u({...t,type:t.notificationType||t.type}),console.log("\uD83D\uDCE1 SSE notification received and displayed"))};return window.addEventListener("newNotification",e),()=>{window.removeEventListener("newNotification",e)}},[u]),null}function d(){var e;let{data:t}=(0,a.useSession)();return(null==t||null==(e=t.user)?void 0:e.id)?(0,r.jsx)(c,{userId:t.user.id}):null}},39867:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},63103:(e,t,n)=>{"use strict";n.d(t,{MobileNavigation:()=>m});var r=n(95155),a=n(20063),i=n(12115),o=n(52619),l=n.n(o),s=n(16485),c=n(21873),d=n(7420);let u=e=>{let{href:t,icon:n,label:a,isActive:i,activeColorClass:o,activeBgClass:s}=e;return(0,r.jsxs)(l(),{href:t,className:"relative flex flex-col items-center justify-center py-2 px-1 rounded-2xl transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] ".concat(i?"".concat(o," ").concat(s):"text-gray-500 hover:text-gray-600 hover:bg-gray-100"),children:[(0,r.jsxs)("div",{className:"relative transition-transform duration-300 ".concat(i?"scale-110 -translate-y-0.5":""),children:[(0,r.jsx)(n,{className:"w-6 h-6 transition-all duration-300",strokeWidth:i?2.5:2}),i&&(0,r.jsx)("div",{className:"absolute inset-0 bg-current opacity-20 blur-md rounded-full -z-10"})]}),(0,r.jsx)("span",{className:"text-[10px] mt-1 transition-all duration-300 ".concat(i?"font-bold scale-105":"font-medium"),children:a})]})};function m(){let e=(0,a.usePathname)(),t=null==e?void 0:e.includes("/auth/");return((0,i.useMemo)(()=>{let t="/"===e,n="/events"===e,r="/cafes"===e;return!t&&!n&&!r},[e]),(0,i.useEffect)(()=>{if(t)return;let e=document.body;return e.classList.add("mobile-bottom-nav-padding"),()=>{e.classList.remove("mobile-bottom-nav-padding")}},[t]),t)?null:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"md:hidden fixed bottom-0 left-0 right-0 bg-white/90 backdrop-blur-xl border-t border-purple-100/80 z-50 pb-safe",children:(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-2 py-1 px-6 relative z-10",children:[(0,r.jsx)(u,{href:"/events",icon:s.A,label:"رویدادها",isActive:"/events"===e,activeColorClass:"text-orange-500",activeBgClass:"bg-orange-50"}),(0,r.jsxs)(l(),{href:"/",className:"relative flex flex-col items-center justify-center py-1 px-1 rounded-2xl transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)] ".concat("/"===e?"text-amber-600 bg-amber-50/80":"text-gray-500 hover:text-gray-600 hover:bg-gray-100"),children:[(0,r.jsx)("div",{className:"relative transition-transform duration-300 ".concat("/"===e?"scale-110 -translate-y-0.5":""),children:(0,r.jsx)("div",{className:"p-1.5 rounded-xl transition-all duration-300 ".concat("/"===e?"bg-[#ffa515] shadow-md ring-2 ring-amber-400/50":"bg-[#ffa515] opacity-90 hover:opacity-100"),children:(0,r.jsx)(d.W,{className:"w-5 h-5 text-black"})})}),(0,r.jsx)("span",{className:"text-[10px] mt-1 transition-all duration-300 ".concat("/"===e?"font-bold scale-105 text-amber-600":"font-medium"),children:"آرشـین‌ها"})]}),(0,r.jsx)(u,{href:"/cafes",icon:c.A,label:"کافه‌ها",isActive:"/cafes"===e,activeColorClass:"text-emerald-600",activeBgClass:"bg-emerald-50"})]})})})}},64269:(e,t,n)=>{"use strict";n.d(t,{cn:()=>i});var r=n(2821),a=n(75889);function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.QP)((0,r.$)(t))}n(33018)},65229:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},71847:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(12115);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim()};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let l=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:s,className:c="",children:d,iconNode:u,...m}=e;return(0,r.createElement)("svg",{ref:t,...o,width:a,height:a,stroke:n,strokeWidth:s?24*Number(l)/Number(a):l,className:i("lucide",c),...!d&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(m)&&{"aria-hidden":"true"},...m},[...u.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),s=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:s,...c}=n;return(0,r.createElement)(l,{ref:o,iconNode:t,className:i("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),s),...c})});return n.displayName=a(e),n}},73348:(e,t,n)=>{"use strict";n.d(t,{InstallPrompt:()=>c});var r=n(95155),a=n(12115),i=n(3998),o=n(39867),l=n(65229);let s=(0,n(71847).A)("share",[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]]);function c(){let[e,t]=(0,a.useState)(!1),[n,c]=(0,a.useState)(null),[d,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t(!0)},[]),(0,a.useEffect)(()=>{if(!e||!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||window.innerWidth<1024)||window.matchMedia("(display-mode: standalone)").matches||"standalone"in window.navigator&&!0===window.navigator.standalone)return;let t=localStorage.getItem("installPromptDismissedAt");if(!(t&&Date.now()-Number(t)<864e5)){if(/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1){let e=setTimeout(()=>{u(!0)},3e3);return()=>clearTimeout(e)}{let e=e=>{e.preventDefault(),c(e),u(!0)};return window.addEventListener("beforeinstallprompt",e),()=>{window.removeEventListener("beforeinstallprompt",e)}}}},[e]);let m=async()=>{if(!n)return;await n.prompt();let e=await n.userChoice;(null==e?void 0:e.outcome)==="accepted"&&(u(!1),localStorage.removeItem("installPromptDismissedAt")),c(null)},f=()=>{u(!1),localStorage.setItem("installPromptDismissedAt",Date.now().toString())},v="undefined"!=typeof navigator&&(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||window.innerWidth<1024);if(!e||!d||!v)return null;let g="undefined"!=typeof navigator&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),p="undefined"!=typeof navigator&&(/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),h=g&&(/FBAN|FBAV|Instagram|Telegram|Bale|Line|Twitter|MicroMessenger/i.test(navigator.userAgent)||!navigator.userAgent.includes("Safari")&&/WebKit/i.test(navigator.userAgent));return(0,r.jsx)("aside",{"aria-label":"نصب اپلیکیشن",className:"fixed bottom-24 left-4 right-4 max-w-sm mx-auto z-[60] animate-slide-up",children:(0,r.jsxs)("div",{className:"bg-white/95 dark:bg-gray-900/95 backdrop-blur-md border border-gray-200 dark:border-gray-800 rounded-2xl shadow-2xl p-4",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-xl bg-[#ffa515] flex items-center justify-center shrink-0 shadow-md",children:(0,r.jsx)(o.A,{className:"w-5 h-5 text-black"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-bold text-sm text-gray-900 dark:text-gray-100",children:"نصب Playmo"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"دسترسی سریع‌تر از صفحه اصلی"})]})]}),(0,r.jsx)(i.$,{variant:"ghost",size:"sm",onClick:f,"aria-label":"بستن",className:"h-7 w-7 p-0 rounded-full text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",children:(0,r.jsx)(l.A,{className:"w-4 h-4"})})]}),g?h?(0,r.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,r.jsxs)("div",{className:"text-xs text-amber-800 dark:text-amber-200 bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-800/40 rounded-xl p-3 leading-relaxed",children:["برای نصب، لطفاً این صفحه را در مرورگر ",(0,r.jsx)("strong",{children:"Safari"})," باز کنید (از طریق منوی سه نقطه یا اشتراک‌گذاری)."]}),(0,r.jsx)(i.$,{onClick:f,size:"sm",className:"w-full text-xs font-medium bg-[#ffa515] hover:bg-[#e69513] text-black rounded-xl",children:"متوجه شدم"})]}):(0,r.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,r.jsxs)("div",{className:"text-xs text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-800/50 rounded-xl p-3 border border-gray-100 dark:border-gray-800/60 leading-relaxed space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("span",{children:["۱. در ",p?"نوار بالای مرورگر":"نوار پایین مرورگر"," دکمه"]}),(0,r.jsx)("span",{className:"inline-flex items-center justify-center p-1 bg-white dark:bg-gray-700 rounded border shadow-xs text-blue-600 dark:text-blue-400",children:(0,r.jsx)(s,{className:"w-3.5 h-3.5"})}),(0,r.jsx)("span",{children:"(Share) را لمس کنید."})]}),(0,r.jsxs)("div",{children:["۲. سپس گزینه ",(0,r.jsx)("strong",{children:"Add to Home Screen"})," (افزودن به صفحه اصلی) را انتخاب کنید."]})]}),(0,r.jsx)(i.$,{onClick:f,size:"sm",className:"w-full text-xs font-medium bg-[#ffa515] hover:bg-[#e69513] text-black rounded-xl",children:"متوجه شدم"})]}):(0,r.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,r.jsx)(i.$,{onClick:m,size:"sm",className:"flex-1 text-xs font-medium bg-[#ffa515] hover:bg-[#e69513] text-black rounded-xl",children:"نصب کن"}),(0,r.jsx)(i.$,{onClick:f,variant:"outline",size:"sm",className:"flex-1 text-xs rounded-xl border-gray-200 dark:border-gray-700",children:"بعداً"})]})]})})}},81192:(e,t,n)=>{"use strict";n.d(t,{NajvaSubscriber:()=>a});var r=n(12115);function a(){let e=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let t=async t=>{if(!e.current)try{(await fetch("/api/user/push-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})})).ok&&(e.current=!0,console.log("✅ Najva push token synced successfully"))}catch(e){console.error("❌ Error syncing Najva push token:",e)}},n=()=>{window.NAJVA&&(window.NAJVA.najvaUserSubscribed=e=>{console.log("\uD83D\uDD14 New Najva subscription:",e),t(e)},(async()=>{try{let e=await window.NAJVA.getUserToken();e&&t(e)}catch(e){}})())};if(window.NAJVA)n();else{let e=0,t=setInterval(()=>{e++,window.NAJVA?(n(),clearInterval(t)):e>=50&&clearInterval(t)},500);return()=>clearInterval(t)}},[]),null}},83101:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var r=n(2821);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=r.$,o=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return i(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:o,defaultVariants:l}=t,s=Object.keys(o).map(e=>{let t=null==n?void 0:n[e],r=null==l?void 0:l[e];if(null===t)return null;let i=a(t)||a(r);return o[e][i]}),c=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return i(e,s,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...l,...c}[t]):({...l,...c})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}},86600:(e,t,n)=>{"use strict";n.d(t,{C:()=>o});var r=n(12115);let a={},i={};function o(e,t){var n,o;let l=null!=(n=null==t?void 0:t.staleTime)?n:6e4,s=null==(o=null==t?void 0:t.revalidateOnFocus)||o,c=null==t?void 0:t.refreshInterval,[d,u]=(0,r.useState)(()=>e&&a[e]?a[e].data:null),[m,f]=(0,r.useState)(null),[v,g]=(0,r.useState)(()=>!!e&&!a[e]),[p,h]=(0,r.useState)(!1),x=(0,r.useCallback)(async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return;let n=a[e],r=!n||Date.now()-n.timestamp>=l;if(!t&&!r)return n.data!==d&&u(n.data),g(!1),n.data;n||g(!0),h(!0);try{i[e]||(i[e]=fetch(e).then(async e=>{if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));return await e.json()}).finally(()=>{delete i[e]}));let t=await i[e];return a[e]={data:t,timestamp:Date.now()},u(t),f(null),t}catch(t){console.error("Error fetching URL: ".concat(e),t),f(t)}finally{g(!1),h(!1)}},[e,l,d]);(0,r.useEffect)(()=>{e&&(a[e]?(u(a[e].data),g(!1)):(u(null),g(!0)),x())},[e,l]),(0,r.useEffect)(()=>{if(!e||!s)return;let t=()=>{x()};return window.addEventListener("focus",t),()=>{window.removeEventListener("focus",t)}},[e,s,x]),(0,r.useEffect)(()=>{if(!e||!c)return;let t=setInterval(()=>{x(!0)},c);return()=>clearInterval(t)},[e,c,x]);let y=(0,r.useCallback)(function(t){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(e){if(void 0!==t){let n="function"==typeof t?t(d):t;a[e]={data:n,timestamp:Date.now()},u(n)}n&&x(!0)}},[e,d,x]);return{data:d,error:m,isLoading:v,isValidating:p,mutate:y}}},86709:e=>{e.exports={style:{fontFamily:"'Vazirmatn', 'Vazirmatn Fallback'",fontStyle:"normal"},className:"__className_450711",variable:"__variable_450711"}},94446:(e,t,n)=>{"use strict";n.d(t,{s:()=>o,t:()=>i});var r=n(12115);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function i(...e){return t=>{let n=!1,r=e.map(e=>{let r=a(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():a(e[t],null)}}}}function o(...e){return r.useCallback(i(...e),e)}},96168:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_246ccd",variable:"__variable_246ccd"}}},e=>{e.O(0,[6179,2978,454,9268,9017,2619,6489,8720,9829,8441,1255,7358],()=>e(e.s=21936)),_N_E=e.O()}]);