1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9936],{22053:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/residences/[id]/edit",function(){return s(2765)}])},44824:function(e,t,s){"use strict";s.d(t,{r:function(){return i}});var n=s(85893),r=s(67294);let i=e=>{var t,s,i;let{checked:a,onChange:l,disabled:d,label:c,labelClassnames:o,inputClassnames:x,name:u,wrapperClassnames:m,formik:h}=e,g=(0,r.useRef)(null);return(0,n.jsxs)("div",{className:` 2 flex items-center gap-x-8 3 ${d?"cursor-not-allowed":"cursor-pointer"} 4 ${m||""} 5 `,children:[c&&(0,n.jsx)("div",{className:`text-14 leading-24 text-black font-r ${o||""}`,children:c}),(0,n.jsxs)("div",{className:`relative w-40 h-24 rounded-50 transition-all ${h&&(null===(t=h.values)||void 0===t?void 0:t[u])||a?x||"bg-primary-main":"bg-gradient-to-b from-[rgba(25,59,103,0.05)] to-[rgba(25,59,103,0.05)] bg-white"}`,onClick:e=>{if(!d){var t,s;null===(t=null==g?void 0:g.current)||void 0===t||null===(s=t.click)||void 0===s||s.call(t)}},children:[(0,n.jsx)("input",{name:u,type:"checkbox",id:"toggleB",checked:h?!!(null==h?void 0:null===(s=h.values)||void 0===s?void 0:s[u]):a,onChange:e=>{h?h.setFieldValue(u,e.target.checked):l&&l(e)},hidden:!0,ref:g}),(0,n.jsx)("div",{className:` 6 absolute w-20 h-20 bg-white shadow-[0px_0px_4px_rgba(0,0,0,0.16)] rounded-full top-2 7 ${h&&(null===(i=h.values)||void 0===i?void 0:i[u])||a?"right-2":"left-2"} 8 `})]})]})}},2765:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return R},default:function(){return O}});var n=s(85893),r=s(25675),i=s.n(r),a=s(67294),l=s(41664),d=s.n(l),c=s(11163),o=s(57846),x=s(2901),u=s(76282),m=s(35321),h=s(16412),g=s(68220),p=s(80129),f=s(77087),v=s(44824),b=s(45551),j=s(68398);let y=e=>null!=e&&""!==String(e).trim(),N={SUIT:"ÙÛÙØ§ Ù Ø³ÙØ¦Ûت",BOOMGARDI:"بÙÙ âگردÛ",HOTEL:"ÙØªÙ"},F=[{title:"٠عرÙÛ Ø§ÙØ§Ù تگاÙ",keys:["details","specs","address"]},{title:"ÙØ¶Ø§ Ù Ø§Ù Ú©Ø§ÙØ§Øª",keys:["capacity","amenities"]},{title:"ÙØ±Ø® Ù ÙÙØ§ÙÛÙ",keys:["pricing","rules"]},{title:"تصاÙÛØ± ٠٠دارک",keys:["images","documents"]}];function k(e){var t;let{draft:s}=e,r=(null===(t=s.defects)||void 0===t?void 0:t.filter(e=>!e.resolvedAt))??[],i=s.suspendedAt?{text:"٠عÙ٠شدÙ",className:"bg-warning bg-opacity-20 text-[#9A6800]"}:r.length>0?{text:"Ø¯Ø§Ø±Ø§Û ÙÙØµ",className:"bg-error-light bg-opacity-10 text-error-light"}:"DEACTIVATED"===s.state?{text:"ØºÛØ±ÙعاÙ",className:"bg-gray-F3F5F7 text-gray-77828F"}:"PENDING"===s.state?{text:"در Ø§ÙØªØ¸Ø§Ø± تاÛÛØ¯",className:"bg-warning bg-opacity-20 text-[#9A6800]"}:"DRAFT"===s.state?{text:"Ù¾ÛØ´âÙÙÛØ³",className:"bg-gray-F3F5F7 text-gray-77828F"}:s.published?{text:"ÙØ¹Ø§Ù",className:"bg-success bg-opacity-10 text-[#0A8F0A]"}:{text:"ÙÙ Ø§ÛØ´ داد٠ÙÙ ÛâØ´ÙØ¯",className:"bg-gray-F3F5F7 text-gray-77828F"};return(0,n.jsx)("span",{className:`shrink-0 rounded-50 px-12 py-4 text-12 leading-20 font-m ${i.className}`,children:i.text})}function w(e){let{title:t,onBack:s}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("header",{className:"fixed top-0 right-0 left-0 z-5 flex items-center gap-x-10 border-b-1 border-solid border-gray-F0F0F0 bg-white bg-opacity-95 px-14 py-10 backdrop-blur-xl md:hidden",children:[(0,n.jsx)("button",{type:"button",onClick:s,"aria-label":"بازگشت",className:"-mr-4 flex h-36 w-36 shrink-0 items-center justify-center rounded-full text-gray-6C6A7D transition-[background-color,transform] duration-150 hover:bg-gray-F8F8F8 active:scale-90",children:(0,n.jsx)("i",{"aria-hidden":"true",className:"icon-FlashRight text-20"})}),(0,n.jsx)("p",{className:"truncate text-15 leading-24 font-b text-black",children:t})]}),(0,n.jsx)("div",{"aria-hidden":"true",className:"h-56 md:hidden"})]})}function $(e){var t,s,r,a;let{draft:l}=e,c=null===(t=l.images)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.url,x=(null===(r=l.reference)||void 0===r?void 0:r.startsWith("ODOO-"))&&Number(l.reference.slice(5))||l.id;return(0,n.jsxs)("div",{className:"rounded-20 border border-gray-DBDFE5 bg-white p-16 shadow-[0_1px_3px_rgba(24,39,58,0.04)]",children:[(0,n.jsxs)("div",{className:"flex items-start gap-x-14",children:[(0,n.jsx)("div",{className:"w-72 h-72 md:w-88 md:h-88 shrink-0 rounded-16 overflow-hidden bg-gray-F3F5F7 grid place-items-center",children:c?(0,n.jsx)(i(),{src:c,alt:"",width:80,height:80,className:"w-full h-full object-cover"}):(0,n.jsx)("i",{"aria-hidden":"true",className:"icon-Photo text-24 text-gray-A9B1BC"})}),(0,n.jsxs)("div",{className:"min-w-0 grow",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-x-10",children:[(0,n.jsx)("h1",{className:"text-16 md:text-18 leading-28 font-b text-black truncate",children:y(l.name)&&l.name!==o.j2?l.name:"Ø§ÙØ§Ù تگا٠بدÙÙ ÙØ§Ù "}),(0,n.jsx)(k,{draft:l})]}),(0,n.jsxs)("p",{className:"text-12 leading-20 font-l text-gray-77828F mt-6",children:["کد ",(0,g.YS)(x),(null===(a=l.location)||void 0===a?void 0:a.name)?`Ø ${l.location.name}`:""]})]})]}),(0,n.jsxs)("div",{className:"mt-14 flex flex-wrap items-center gap-8 border-t-1 border-solid border-gray-F3F5F7 pt-14",children:[l.published&&(0,n.jsxs)(d(),{href:(0,f.$)({residenceId:x}),prefetch:!1,className:"h-[36px] px-12 rounded-10 border border-gray-DBDFE5 text-12 font-m text-black inline-flex items-center justify-center gap-x-6 hover:border-gray-A9B1BC transition-colors",children:[(0,n.jsx)("i",{"aria-hidden":"true",className:"icon-See text-14"}),"Ù Ø´Ø§ÙØ¯Ù در Ø³Ø§ÛØª"]}),(0,n.jsxs)(d(),{href:"/residences/calendar",prefetch:!1,className:"h-[32px] px-12 rounded-10 border border-gray-DBDFE5 text-12 font-m text-black inline-flex items-center gap-x-6 hover:border-gray-A9B1BC transition-colors",children:[(0,n.jsx)("i",{"aria-hidden":"true",className:"icon-Calendar text-14"}),"تÙÙÛÙ Ù ÙØ±Ø® Ø±ÙØ²Ø§ÙÙ"]})]})]})}function A(e){var t;let{draft:s,onGoToStep:r}=e,i=(null===(t=s.defects)||void 0===t?void 0:t.filter(e=>!e.resolvedAt&&!e.reviewRequestedAt))??[];return(0,n.jsxs)("div",{className:"flex flex-col gap-y-10",children:[!!s.suspendedAt&&(0,n.jsxs)(g.UW,{tone:"error",children:["اÛÙ Ø§ÙØ§Ù ØªÚ¯Ø§Ù ØªÙØ³Ø· Ú©Ø§Ø±Ø´ÙØ§Ø³ ٠عÙ٠شد٠٠در Ø³Ø§ÛØª ÙÙ Ø§ÛØ´ داد٠ÙÙ ÛâØ´ÙØ¯.",s.suspensionReason?` دÙÛÙ: ${s.suspensionReason}`:""]}),i.length>0&&(0,n.jsx)(g.UW,{tone:"warning",children:(0,n.jsxs)("div",{className:"flex flex-col gap-y-8",children:[(0,n.jsxs)("span",{className:"font-m",children:["Ú©Ø§Ø±Ø´ÙØ§Ø³ ",(0,g.YS)(i.length)," ÙÙØµ رÙÛ Ø§ÛÙ Ø§ÙØ§Ù تگا٠ثبت کرد٠است."]}),(0,n.jsx)("ul",{className:"flex flex-col gap-y-6",children:i.map(e=>{let t=p.aW[e.section];return(0,n.jsxs)("li",{className:"flex items-start justify-between gap-x-10 text-12 leading-20",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("b",{className:"font-m",children:p.bc[e.section]}),"MANDATORY"===e.severity&&(0,n.jsx)("span",{className:"text-error-light",children:" (اجبارÛ)"})," â ",e.description]}),void 0!==t&&(0,n.jsx)("button",{type:"button",onClick:()=>r(t),className:"shrink-0 font-m text-primary-dark underline",children:"Ø±ÙØ¹ ÙÙØµ"})]},e.id)})})]})}),!!s.pendingChangesSubmittedAt&&(0,n.jsx)(h.c$,{pending:s.pendingChanges,onGoToStep:r})]})}function _(e){let{index:t,draft:s,onOpen:r}=e,i=o.Ss[t],a=i.isComplete(s);return(0,n.jsxs)("button",{type:"button",onClick:r,className:"w-full flex items-center gap-x-12 px-14 py-13 text-right transition-colors hover:bg-gray-F8F8F8 focus-visible:outline-none focus-visible:bg-gray-F8F8F8",children:[(0,n.jsx)("span",{className:"w-40 h-40 shrink-0 rounded-12 bg-gray-F3F5F7 grid place-items-center",children:(0,n.jsx)("i",{"aria-hidden":"true",className:`${i.icon} text-20 text-gray-77828F`})}),(0,n.jsxs)("span",{className:"min-w-0 grow",children:[(0,n.jsxs)("span",{className:"flex items-center gap-x-8",children:[(0,n.jsx)("span",{className:"text-14 leading-24 font-m text-black",children:i.short}),!a&&!i.optional&&(0,n.jsx)("span",{className:"shrink-0 rounded-50 bg-warning bg-opacity-20 px-8 py-1 text-11 leading-18 font-m text-[#9A6800]",children:"ÙØ§Ùص"})]}),(0,n.jsx)("span",{className:"block truncate text-12 leading-20 font-l text-gray-77828F mt-2",children:function(e,t){var s,n,r,i,a,l;switch(e){case"details":{let e=N[t.type]??"â";return[e,t.region].filter(y).join("Ø ")||"تک٠ÛÙ ÙØ´Ø¯Ù"}case"specs":return y(t.name)&&t.name!==o.j2?t.name:"بدÙÙ ÙØ§Ù ";case"address":{let e=[null===(s=t.location)||void 0===s?void 0:null===(n=s.parent)||void 0===n?void 0:n.name,null===(r=t.location)||void 0===r?void 0:r.name].filter(
8Boolean).join("Ø ");return[e,t.address].filter(y).join(" â ")||"ثبت ÙØ´Ø¯Ù"}case"capacity":{let e=(null===(i=t.rooms)||void 0===i?void 0:i.filter(e=>"ÙØ¶Ø§Û Ù
شترک"!==e.name).length)??0,s=t.capacity?`${(0,g.YS)(t.capacity)} ÙÙØ±`:"ظرÙÛØª ثبت ÙØ´Ø¯Ù";return e>0?`${s}Ø ${(0,g.YS)(e)} اتاÙ`:s}case"amenities":{let e=(null===(a=t.amenities)||void 0===a?void 0:a.length)??0;return e>0?`${(0,g.YS)(e)} Ù
ÙØ±Ø¯ Ø§ÙØªØ®Ø§Ø¨ شدÙ`:"ÙÙÙØ² Ø§ÙØªØ®Ø§Ø¨ ÙØ´Ø¯Ù"}case"pricing":return t.weekPrice?`${(0,g.db)(t.weekPrice)} تÙÙ
ا٠در شب`:"ÙØ±Ø®Û ثبت ÙØ´Ø¯Ù";case"images":{let e=(null===(l=t.images)||void 0===l?void 0:l.length)??0;if(0===e)return"بدÙ٠تصÙÛØ±";return e<o.yz?`${(0,g.YS)(e)} تصÙÛØ± â Ø¯Ø³ØªâÚ©Ù
${(0,g.YS)(o.yz)} تا ÙØ§Ø²Ù
است`:`${(0,g.YS)(e)} تصÙÛØ±`}case"documents":{let e=[t.hostNationalCardUrl,t.documentUrl].filter(y).length;return 2===e?"Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û Ø´Ø¯Ù":0===e?"Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ´Ø¯Ù":"ÙØ§Ùص"}case"rules":{let e=t.checkinFrom?`ÙØ±Ùد ${t.checkinFrom}`:null,s=t.checkout?`Ø®Ø±ÙØ¬ ${t.checkout}`:null;return[e,s].filter(Boolean).join("Ø ")||"ثبت ÙØ´Ø¯Ù"}default:return""}}(i.key,s)})]}),(0,n.jsx)("i",{"aria-hidden":"true",className:"icon-FlashLeft shrink-0 text-16 text-gray-A9B1BC"})]})}function S(e){let{draft:t}=e,{save:s,saveState:r}=(0,u.a)();return(0,n.jsx)("div",{className:"rounded-20 border border-gray-DBDFE5 bg-white p-14 md:p-16",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-x-14",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"رزر٠آÙÛ"}),(0,n.jsxs)("p",{className:"text-12 leading-20 font-l text-gray-77828F mt-2",children:[t.isFast?"Ù
ÙÙ
ا٠بدÙ٠تأÛÛØ¯ Ø´Ù
ا رزر٠را ÙØ·Ø¹Û Ù
ÛâÚ©ÙØ¯.":"ÙØ± Ø¯Ø±Ø®ÙØ§Ø³Øª رزر٠Ù
ÙØªØ¸Ø± تأÛÛØ¯ Ø´Ù
ا Ù
ÛâÙ
Ø§ÙØ¯."," ","Ø¨Ø±Ø§Û ÛÚ© ØªØ§Ø±ÛØ® خاص Ù
ÛâØªÙØ§ÙÛØ¯ از تÙÙÛÙ
Ø§Ø³ØªØ«ÙØ§ Ø¨Ú¯Ø°Ø§Ø±ÛØ¯."]})]}),(0,n.jsx)("div",{className:"shrink-0 pt-2",children:(0,n.jsx)(v.r,{name:"isFast",checked:!!t.isFast,disabled:"saving"===r,onChange:e=>{let t=e.target.checked;s(e=>(0,p.AA)(e,t)).then(e=>{e&&b.Z.message([{type:j.L.SUCCESS,title:t?"رزر٠آÙÛ ÙØ¹Ø§Ù شد":"رزر٠آÙÛ ØºÛØ±Ùعا٠شد"}])})}})})]})})}function C(){let{draft:e,goTo:t}=(0,u.a)();return e?(0,n.jsxs)("div",{className:"flex flex-col gap-y-24 pb-40",children:[(0,n.jsx)($,{draft:e}),(0,n.jsx)(A,{draft:e,onGoToStep:t}),e.published&&(0,n.jsx)(S,{draft:e}),F.map(s=>(0,n.jsxs)("section",{children:[(0,n.jsx)("h2",{className:"text-13 leading-22 font-m text-gray-77828F mb-10 px-4",children:s.title}),(0,n.jsx)("div",{className:"rounded-20 border border-gray-DBDFE5 bg-white overflow-hidden divide-y divide-gray-F3F5F7",children:s.keys.map(s=>{let r=o.Ss.findIndex(e=>e.key===s);return -1===r?null:(0,n.jsx)(_,{index:r,draft:e,onOpen:()=>t(r)},s)})})]},s.title))]}):(0,n.jsx)(g.nj,{})}function B(){var e;let t=(0,c.useRouter)(),{openSection:s,index:r,isLoading:i,loadError:a,reload:l,draft:d,residenceId:h,backToHub:p}=(0,u.a)();if(h&&i&&!d)return(0,n.jsx)(g.nj,{});if(h&&a)return(0,n.jsx)(m.A_,{message:"Ø§Ø·ÙØ§Ø¹Ø§Øª اÛÙ Ø§ÙØ§Ù
ØªÚ¯Ø§Ù Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ´Ø¯. Ù
Ù
ک٠است ØØ°Ù شد٠باشد ÛØ§ Ù
تعÙÙ Ø¨Ù ØØ³Ø§Ø¨ دÛÚ¯Ø±Û Ø¨Ø§Ø´Ø¯.",onRetry:()=>void l()});if(!s)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w,{title:"ÙÛØ±Ø§ÛØ´ Ø§ÙØ§Ù
تگاÙ",onBack:()=>t.push("/residences/list")}),(0,n.jsx)(C,{})]});let f=x.W[r]??x.W[0];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w,{title:(null===(e=o.Ss[r])||void 0===e?void 0:e.title)||"ÙÛØ±Ø§ÛØ´",onBack:()=>p()}),(0,n.jsx)(f,{},s)]})}function D(){var e;let t=(0,c.useRouter)(),s=(0,a.useMemo)(()=>{var e;let s=Number(null===(e=t.query)||void 0===e?void 0:e.id);return Number.isFinite(s)&&s>0?s:void 0},[null===(e=t.query)||void 0===e?void 0:e.id]);return s?(0,n.jsx)(u.A,{mode:"edit",residenceId:s,children:(0,n.jsx)("div",{className:"px-16 md:px-0 pt-16 md:pt-0 max-w-[720px] mx-auto",children:(0,n.jsx)(B,{})})}):(0,n.jsx)(g.nj,{})}let E=()=>(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(D,{})});var R=!0,O=E},77087:function(e,t,s){"use strict";function n(e){let{residenceId:t,startDate:s,endDate:n,guestsCount:r}=e;return`/rentals/${t}${s&&n?`?start=${s}&end=${n}`:""}${r&&s&&n?`&guests_count=${r}`:r?`?guests_count=${r}`:""}`}s.d(t,{$:function(){return n}})}},function(e){e.O(0,[8220,578,7208,9774,2888,179],function(){return e(e.s=22053)}),_N_E=e.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.