1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8769],{72038:function(t,e,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/notifications",function(){return i(62047)}])},49378:function(t,e,i){"use strict";i.d(e,{TH:function(){return r},aK:function(){return o},aZ:function(){return l},pd:function(){return c},tn:function(){return a}});var s=i(57149);let n=t=>null==t?void 0:t.data;async function r(t){let e=await s.Z.setUrl("/api/notifications").setCallMethod("GET").setParams({...t.archived?{archived:"true"}:{},...t.cursor?{cursor:t.cursor}:{},...t.take?{take:t.take}:{}}).call();return n(e)??{items:[],next_cursor:null}}async function a(){var t;let e=await s.Z.setUrl("/api/notifications/unread-count").setCallMethod("GET").call();return(null===(t=n(e))||void 0===t?void 0:t.count)??0}async function o(t){var e;let i=await s.Z.setUrl("/api/notifications/read").setCallMethod("POST").setBody((null==t?void 0:t.length)?{ids:t}:{}).call();return(null===(e=n(i))||void 0===e?void 0:e.updated)??0}async function l(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return s.Z.setUrl(`/api/notifications/${t}/archive`).setCallMethod("POST").setBody({archived:e}).call()}async function c(){var t;let e=await s.Z.setUrl("/api/notifications/archive-all").setCallMethod("POST").setBody({}).call();return(null===(t=n(e))||void 0===t?void 0:t.updated)??0}},47416:function(t,e,i){"use strict";var s=i(85893);i(67294),e.Z=function(t){let{icon:e,title:i,containerClassname:n,element:r,asH1:a}=t;return(0,s.jsxs)("div",{className:`flex items-center justify-between ${n||""}`,children:[(0,s.jsxs)("div",{className:"flex items-center",children:[!!e&&(0,s.jsx)("div",{className:"flex items-center ml-12",children:e}),a?(0,s.jsx)("h1",{className:"text-[#000000] text-16 leading-28 font-m",children:i}):(0,s.jsx)("h2",{className:"text-[#000000] text-16 leading-28 font-m",children:i})]}),r]})}},5518:function(t,e,i){"use strict";var s=i(85893),n=i(47300),r=i(82941);e.Z=function(t){let{title:e="Ø§Ø·ÙØ§Ø¹Ø§Øª Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ´Ø¯",subTitle:i="ارتباط Ø¨Ø±ÙØ±Ø§Ø± ÙØ´Ø¯. Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.",onRetry:a,isRetrying:o}=t;return(0,s.jsx)(r.Z,{iconSrc:(0,s.jsx)("i",{"aria-hidden":"true",className:"icon-Warning text-56 text-warning"}),title:e,subTitle:i,containerClassname:"py-40",actions:(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(n.z,{variant:"outlined",color:"black",onClick:a,isLoading:o,loadingText:"در ØØ§Ù ØªÙØ§Ø´â¦",rightIcon:(0,s.jsx)("i",{"aria-hidden":"true",className:"icon-Refresh text-20"}),children:"ØªÙØ§Ø´ Ø¯ÙØ¨Ø§Ø±Ù"})})})}},86757:function(t,e,i){"use strict";var s=i(85893);e.Z=function(t){let{widthClass:e,heightClass:i}=t;return(0,s.jsx)("div",{className:` 2 skeleton-shimmer 3 ${e||"w-48"} 4 ${i||"h-48"} 5 `,children:(0,s.jsx)("div",{className:` 6 w-full h-full 7 bg-gray-E9EdF1 8 rounded-full 9 `})})}},2195:function(t,e,i){"use strict";var s=i(85893);e.Z=function(t){let{widthClass:e,heightClass:i,borderRadiusClass:n,marginsClassnames:r,extraClassnames:a}=t;return(0,s.jsx)("div",{className:` 10 skeleton-shimmer 11 ${e||"w-48"} 12 ${i||"h-48"} 13 ${r||""} 14 ${a||""} 15 `,children:(0,s.jsx)("div",{className:` 16 w-full h-full 17 bg-gray-E9EdF1 18 ${n||"rounded-8"} 19 `})})}},44824:function(t,e,i){"use strict";i.d(e,{r:function(){return r}});var s=i(85893),n=i(67294);let r=t=>{var e,i,r;let{checked:a,onChange:o,disabled:l,label:c,labelClassnames:u,inputClassnames:d,name:h,wrapperClassnames:m,formik:x}=t,f=(0,n.useRef)(null);return(0,s.jsxs)("div",{className:` 20 flex items-center gap-x-8 21 ${l?"cursor-not-allowed":"cursor-pointer"} 22 ${m||""} 23 `,children:[c&&(0,s.jsx)("div",{className:`text-14 leading-24 text-black font-r ${u||""}`,children:c}),(0,s.jsxs)("div",{className:`relative w-40 h-24 rounded-50 transition-all ${x&&(null===(e=x.values)||void 0===e?void 0:e[h])||a?d||"bg-primary-main":"bg-gradient-to-b from-[rgba(25,59,103,0.05)] to-[rgba(25,59,103,0.05)] bg-white"}`,onClick:t=>{if(!l){var e,i;null===(e=null==f?void 0:f.current)||void 0===e||null===(i=e.click)||void 0===i||i.call(e)}},children:[(0,s.jsx)("input",{name:h,type:"checkbox",id:"toggleB",checked:x?!!(null==x?void 0:null===(i=x.values)||void 0===i?void 0:i[h]):a,onChange:t=>{x?x.setFieldValue(h,t.target.checked):o&&o(t)},hidden:!0,ref:f}),(0,s.jsx)("div",{className:` 24 absolute w-20 h-20 bg-white shadow-[0px_0px_4px_rgba(0,0,0,0.16)] rounded-full top-2 25 ${x&&(null===(r=x.values)||void 0===r?void 0:r[h])||a?"right-2":"left-2"} 26 `})]})]})}}
26,27230:function(t,e,i){"use strict";i.d(e,{Z:function(){return l}});var s=i(85893),n=i(41664),r=i.n(n);let a={BOOKING_REQUESTED:{icon:"icon-Reserve",tone:"text-primary-main"},BOOKING_NEW_REQUEST:{icon:"icon-Reserve",tone:"text-primary-main"},BOOKING_APPROVED:{icon:"icon-Success",tone:"text-success"},BOOKING_COMPLETED:{icon:"icon-Success",tone:"text-success"},BOOKING_REJECTED:{icon:"icon-Error",tone:"text-error-light"},BOOKING_CANCELLED:{icon:"icon-Error",tone:"text-error-light"},BOOKING_EXPIRED:{icon:"icon-Calendar",tone:"text-gray-959FA7"},REVIEW_RECEIVED:{icon:"icon-Comments",tone:"text-black"},MESSAGE_RECEIVED:{icon:"icon-message",tone:"text-black"},RESIDENCE_PUBLISHED:{icon:"icon-AddHome",tone:"text-success"},RESIDENCE_REJECTED:{icon:"icon-AddHome",tone:"text-error-light"},ACCOUNT_VERIFIED:{icon:"icon-Profile",tone:"text-success"},PAYMENT_APPROVED:{icon:"icon-Wallet",tone:"text-success"},PAYMENT_REJECTED:{icon:"icon-Wallet",tone:"text-error-light"}},o={icon:"icon-Bell",tone:"text-gray-959FA7"};var l=function(t){let{notification:e,onArchive:i,onRead:n}=t,{icon:l,tone:c}=a[e.kind]??o,u=!e.is_read,d=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:`mt-2 flex h-40 w-40 shrink-0 items-center justify-center rounded-full bg-gray-F5F5F7 ${c}`,children:(0,s.jsx)("i",{"aria-hidden":"true",className:`${l} text-20`})}),(0,s.jsxs)("span",{className:"min-w-0 grow",children:[(0,s.jsxs)("span",{className:"mb-4 flex items-center gap-x-8",children:[(0,s.jsx)("span",{className:"text-14 leading-20 font-m text-black",children:e.title}),u&&(0,s.jsx)("span",{className:"h-8 w-8 shrink-0 rounded-full bg-primary-main","aria-hidden":"true"}),(0,s.jsx)("span",{className:"mr-auto shrink-0 text-11 leading-16 font-r text-gray-959FA7",children:function(t){let e=new Date(t).getTime();if(Number.isNaN(e))return"";let i=Math.floor((Date.now()-e)/1e3),s=t=>Math.floor(t).toLocaleString("fa-IR");return i<60?"ÙÙ
ÛÙ ØØ§Ùا":i<3600?`${s(i/60)} دÙÛÙÙ Ù¾ÛØ´`:i<86400?`${s(i/3600)} ساعت Ù¾ÛØ´`:i<604800?`${s(i/86400)} Ø±ÙØ² Ù¾ÛØ´`:new Intl.DateTimeFormat("fa-IR",{day:"numeric",month:"long",year:"numeric"}).format(new Date(t))}(e.created_at)})]}),(0,s.jsx)("span",{className:"block text-13 leading-22 font-r text-gray-6C6A7D",children:e.body}),u&&(0,s.jsx)("span",{className:"sr-only",children:"Ø®ÙØ§ÙØ¯Ù ÙØ´Ø¯Ù"})]})]}),h=`flex grow items-start gap-x-12 rounded-16 p-14 transition-transform duration-150 ease-out active:scale-[0.99] ${u?"bg-primary-main bg-opacity-[4%]":""}`;return(0,s.jsxs)("div",{className:`group flex items-start gap-x-4 rounded-16 border-1 border-solid bg-white ${u?"border-primary-main border-opacity-30 shadow-[0_1px_3px_rgba(24,39,58,0.06)]":"border-gray-F0F0F0"}`,children:[e.link_url?(0,s.jsx)(r(),{href:e.link_url,prefetch:!1,onClick:()=>u&&(null==n?void 0:n(e.id)),className:`${h} grow hover:bg-gray-F5F5F7 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-main`,children:d}):(0,s.jsx)("div",{className:`${h} grow`,children:d}),i&&(0,s.jsx)("button",{type:"button","aria-label":`باÛگاÙÛ \xab${e.title}\xbb`,onClick:()=>i(e.id),className:"mt-12 shrink-0 rounded-8 p-8 text-gray-959FA7 transition-colors hover:bg-gray-F5F5F7 hover:text-black focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-main",children:(0,s.jsx)("i",{"aria-hidden":"true",className:"icon-Hide text-18"})})]})}},62047:function(t,e,i){"use strict";i.r(e),i.d(e,{__N_SSP:function(){return E},default:function(){return j}});var s=i(85893),n=i(67294),r=i(85945),a=i(59403),o=i(48228),l=i(22920),c=i(49378),u=i(47416),d=i(44824),h=i(47300),m=i(82941),x=i(5518),f=i(2195),g=i(86757);function v(){return(0,s.jsxs)("div",{className:"flex items-start gap-x-4 border-b-1 border-solid border-gray-EFEFEF px-12 py-14 last:border-b-0",children:[(0,s.jsx)("div",{className:"mt-2 shrink-0",children:(0,s.jsx)(g.Z,{widthClass:"w-40",heightClass:"h-40"})}),(0,s.jsxs)("div",{className:"min-w-0 grow pr-8",children:[(0,s.jsxs)("div",{className:"mb-8 flex items-center gap-x-8",children:[(0,s.jsx)(f.Z,{widthClass:"w-[45%]",heightClass:"h-14",borderRadiusClass:"rounded-6"}),(0,s.jsx)(f.Z,{widthClass:"w-40",heightClass:"h-10",borderRadiusClass:"rounded-6",marginsClassnames:"mr-auto"})]}),(0,s.jsx)(f.Z,{widthClass:"w-[85%]",heightClass:"h-12",borderRadiusClass:"rounded-6"})]})]})}var p=function(t){let{rows:e=6}=t;return(0,s.jsx)("div",{"aria-hidden":"true",className:"rounded-16 border-1 border-solid border-gray-EFEFEF bg-white p-8",children:Array.from({length:e}).map((t,e)=>(0,s.jsx)(v,{},e))})}
26,b=i(27230),y=function(){let t=(0,r.NL)(),[e,i]=(0,n.useState)(!1),{data:f,isLoading:g,isFetchingNextPage:v,hasNextPage:y,fetchNextPage:N,isError:E,isFetching:j,refetch:C}=(0,a.N)({queryKey:["notifications",e],queryFn:t=>{let{pageParam:i}=t;return(0,c.TH)({archived:e,cursor:i,take:20})},getNextPageParam:t=>t.next_cursor??void 0,keepPreviousData:!0}),w=(0,n.useMemo)(()=>(null==f?void 0:f.pages.flatMap(t=>t.items))??[],[f]),R=w.filter(t=>!t.is_read).length,k=(0,n.useCallback)(()=>{t.invalidateQueries({queryKey:["notifications"]}),t.invalidateQueries({queryKey:["notificationsUnread"]})},[t]),F=(0,o.D)({mutationFn:()=>(0,c.aK)(),onSuccess:k,onError:()=>l.Am.error("Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯. Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.")}),_=(0,n.useCallback)(i=>{let s=["notifications",e],n=t.getQueryData(s);return t.setQueryData(s,t=>t?{...t,pages:t.pages.map(t=>({...t,items:i(t.items)}))}:t),()=>t.setQueryData(s,n)},[t,e]),O=(0,o.D)({mutationFn:t=>(0,c.aK)([t]),onMutate:t=>_(e=>e.map(e=>e.id===t?{...e,is_read:!0}:e)),onError:(t,e,i)=>null==i?void 0:i(),onSuccess:k}),M=(0,o.D)({mutationFn:t=>(0,c.aZ)(t,!e),onMutate:t=>_(e=>e.filter(e=>e.id!==t)),onError:(t,e,i)=>{null==i||i(),l.Am.error("Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯. Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.")},onSuccess:k}),P=(0,o.D)({mutationFn:()=>(0,c.pd)(),onSuccess:k,onError:()=>l.Am.error("Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯. Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.")});return(0,s.jsxs)("div",{className:"pb-40",children:[(0,s.jsx)(u.Z,{title:"Ø§Ø¹ÙØ§Ùات",icon:(0,s.jsx)("i",{"aria-hidden":"true",className:"icon-Bell text-24"}),containerClassname:"mb-16"}),(0,s.jsxs)("div",{className:"mb-16 flex items-center justify-between rounded-12 bg-gray-F8F8F8 px-14 py-10",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-13 leading-20 font-m text-black",children:"ÙÙ
Ø§ÛØ´ باÛگاÙÛâØ´Ø¯ÙâÙØ§"}),(0,s.jsx)("p",{className:"mt-2 text-11 leading-18 font-r text-gray-77828F",children:e?"Ø§Ø¹ÙØ§ÙâÙØ§Û باÛگاÙÛâØ´Ø¯Ù":"ÙÙØ· Ø§Ø¹ÙØ§ÙâÙØ§Û جارÛ"})]}),(0,s.jsx)(d.r,{name:"show-archived",checked:e,onChange:t=>i(t.target.checked)})]}),!e&&w.length>0&&(0,s.jsxs)("div",{className:"mb-12 flex items-center justify-end gap-x-4",children:[R>0&&(0,s.jsx)("button",{type:"button",onClick:()=>F.mutate(),disabled:F.isLoading,className:"rounded-8 px-10 py-6 text-13 leading-20 font-r text-primary-main transition-colors hover:bg-gray-F5F5F7 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-main",children:"Ø®ÙØ§Ùد٠ÙÙ
Ù"}),(0,s.jsx)("button",{type:"button",onClick:()=>P.mutate(),disabled:P.isLoading,className:"rounded-8 px-10 py-6 text-13 leading-20 font-r text-gray-6C6A7D transition-colors hover:bg-gray-F5F5F7 hover:text-black disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-main",children:"باÛگاÙÛ ÙÙ
Ù"})]}),g?(0,s.jsx)(p,{}):E?(0,s.jsx)(x.Z,{title:"Ø§Ø¹ÙØ§ÙâÙØ§ Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ´Ø¯",onRetry:()=>void C(),isRetrying:j}):0===w.length?(0,s.jsx)(m.Z,{title:e?"Ø§Ø¹ÙØ§Ù باÛگاÙÛâØ´Ø¯ÙâØ§Û ÙØ¯Ø§Ø±Ûد":"ÙÙÙØ² Ø§Ø¹ÙØ§ÙÛ Ø¨Ø±Ø§ÛØªØ§Ù ÙÛØ§Ù
دÙ",iconSrc:"/assets/No-notif.svg",containerClassname:"py-[40px]"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col gap-y-8",children:w.map(t=>(0,s.jsx)(b.Z,{notification:t,onRead:t=>O.mutate(t),onArchive:t=>M.mutate(t)},t.id))}),y&&(0,s.jsx)(h.z,{className:"mt-24",isFullWidth:!0,variant:"outlined",color:"black",isLoading:v,loadingText:"در ØØ§Ù Ø¯Ø±ÛØ§Ùت",onClick:()=>N(),children:"ÙÙ
Ø§ÛØ´ Ø¨ÛØ´ØªØ±"})]})]})};let N=()=>(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(y,{})});var E=!0,j=N},59403:function(t,e,i){"use strict";i.d(e,{N:function(){return l}});var s=i(32161),n=i(52924),r=i(9499);class a extends n.z{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:(0,r.Gm)()},e)}getOptimisticResult(t){return t.behavior=(0,r.Gm)(),super.getOptimisticResult(t)}fetchNextPage({pageParam:t,...e}={}
26){return this.fetch({...e,meta:{fetchMore:{direction:"forward",pageParam:t}}})}fetchPreviousPage({pageParam:t,...e}={}){return this.fetch({...e,meta:{fetchMore:{direction:"backward",pageParam:t}}})}createResult(t,e){var i,s,n,a,o,l;let{state:c}=t,u=super.createResult(t,e),{isFetching:d,isRefetching:h}=u,m=d&&(null==(i=c.fetchMeta)?void 0:null==(s=i.fetchMore)?void 0:s.direction)==="forward",x=d&&(null==(n=c.fetchMeta)?void 0:null==(a=n.fetchMore)?void 0:a.direction)==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,r.Qy)(e,null==(o=c.data)?void 0:o.pages),hasPreviousPage:(0,r.ZF)(e,null==(l=c.data)?void 0:l.pages),isFetchingNextPage:m,isFetchingPreviousPage:x,isRefetching:h&&!m&&!x}}}var o=i(67187);function l(t,e,i){let n=(0,s._v)(t,e,i);return(0,o.r)(n,a)}},48228:function(t,e,i){"use strict";i.d(e,{D:function(){return h}});var s=i(67294),n=i(464),r=i(32161),a=i(89886),o=i(30081),l=i(33989);class c extends l.l{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;let i=this.options;this.options=this.client.defaultMutationOptions(t),(0,r.VS)(i,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(e=this.currentMutation)||e.setOptions(this.options)}onUnsubscribe(){if(!this.listeners.length){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:(0,a.R)(),e={...t,isLoading:"loading"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=e}notify(t){o.V.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var e,i,s,n,r,a,o,l;t.onSuccess?(null==(e=(i=this.mutateOptions).onSuccess)||e.call(i,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(s=(n=this.mutateOptions).onSettled)||s.call(n,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(r=(a=this.mutateOptions).onError)||r.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(o=(l=this.mutateOptions).onSettled)||o.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(t=>{t(this.currentResult)})})}}var u=i(85945),d=i(24798);function h(t,e,i){let a=(0,r.lV)(t,e,i),l=(0,u.NL)({context:a.context}),[h]=s.useState(()=>new c(l,a));s.useEffect(()=>{h.setOptions(a)},[h,a]);let x=(0,n.$)(s.useCallback(t=>h.subscribe(o.V.batchCalls(t)),[h]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),f=s.useCallback((t,e)=>{h.mutate(t,e).catch(m)},[h]);if(x.error&&(0,d.L)(h.options.useErrorBoundary,[x.error]))throw x.error;return{...x,mutate:f,mutateAsync:x.mutate}}function m(){}}},function(t){t.O(0,[9774,2888,179],function(){return t(t.s=72038)}),_N_E=t.O()}]);
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.