PageSourceSearch

https://app.engageplatform.ai/_next/static/chunks/160.fa48679167c65729.js

js engageplatform.ai collected 2026-10-05 12:56:59 UTC 26,925 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[160],{33233:function(e,t,i){var l=i(57437),r=i(2265),n=i(33145),d=i(73021),a=i(21770),o=i(88573),s=i(18133),c=i(59757),u=i(91584),w=i(57635),p=i.n(w);t.Z=e=>{var t;let{propertyId:i,onHide:w,refetchProperty:g,refetch:m,showCancel:f=!1,property:h}=e,[y,b]=(0,r.useState)(null),[x,v]=(0,r.useState)(!1),[j,I]=(0,r.useState)(null),[_,E]=(0,r.useState)(!1),[S,k]=(0,r.useState)(new Set),{mediaData:D,refetchMedia:N}=(0,o.iP)(!!i,{and:[{field:"deleted_at",op:"not_null"},{field:"resource_type",op:"=",value:"Property"},{field:"resource_id",op:"=",value:i},{field:"category",op:"=",value:"Image"}]});(0,r.useEffect)(()=>{N&&N()},[N]);let{mutate:R,isPending:C}=(0,a.D)({mutationFn:e=>(0,o.UV)({body:null==e?void 0:e.body}),onSuccess:e=>{g(),m(),N(),I(null),s.Toast.success("Success","Image(s) restored successfully.")},onError:e=>{I(null)}}),z=e=>{1===e.length&&I(e[0]),R({body:{ids:e},type:"Images"})},P=e=>{let t=new Set(S);t.has(e)?t.delete(e):t.add(e),k(t)},L=async()=>{if(0!==S.size){v(!0);try{var e,t;let i=new(p()),l=null==D?void 0:D.filter(e=>S.has(e.id));for(let e=0;e<l.length;e++){let r=l[e];try{let l=r.url,n=await fetch(l);if(!n.ok)continue;let d=await n.blob();if(0===d.size)continue;let a="jpg",o=null===(t=r.url.split(".").pop())||void 0===t?void 0:t.split("?")[0];o&&["jpg","jpeg","png","gif","webp"].includes(o.toLowerCase())&&(a=o.toLowerCase());let s="image_".concat(String(e+1).padStart(3,"0"),".").concat(a);i.file(s,d,{binary:!0})}catch(e){}}let r=await i.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}}),n=window.URL.createObjectURL(r),d=document.createElement("a");d.href=n;let a=((null==h?void 0:null===(e=h.community)||void 0===e?void 0:e.name)||(null==h?void 0:h.address)||"property").replace(/[^a-z0-9]/gi,"_");d.download="".concat(a,"_archived_images_").concat(Date.now(),".zip"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(n)},100)}catch(e){}finally{v(!1)}}},B=async e=>{I(e.id);try{var t,i;let l=e.url,r=await fetch(l);if(!r.ok)throw Error("Download failed");let n=await r.blob();if(0===n.size)throw Error("Empty file");let d="jpg",a=null===(t=e.url.split(".").pop())||void 0===t?void 0:t.split("?")[0];a&&["jpg","jpeg","png","gif","webp"].includes(a.toLowerCase())&&(d=a.toLowerCase());let o=window.URL.createObjectURL(n),s=document.createElement("a");s.href=o;let c=((null==h?void 0:null===(i=h.community)||void 0===i?void 0:i.name)||(null==h?void 0:h.address)||"property").replace(/[^a-z0-9]/gi,"_");s.download="".concat(c,"_archived_image_").concat(Date.now(),".").concat(d),document.body.appendChild(s),s.click(),setTimeout(()=>{document.body.removeChild(s),window.URL.revokeObjectURL(o)},100)}catch(e){}finally{I(null)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(d.u_,{show:!!y,onHide:()=>b(null),size:"lg",centered:!0,className:"prevent-close",children:(0,l.jsxs)(d.u_.Body,{className:"tw-p-0 tw-relative",children:[y&&(0,l.jsx)("div",{className:"tw-flex tw-justify-center tw-items-center",children:(0,l.jsx)("div",{style:{position:"relative",width:"100%",aspectRatio:"3/2",maxHeight:"70vh"},children:(0,l.jsx)(n.default,{src:y,alt:"Preview",fill:!0,style:{objectFit:"contain"},className:"tw-rounded-md"})})}),(0,l.jsx)("button",{className:"tw-absolute tw-top-0 tw-right-0 tw-m-4 tw-rounded-[50%] tw-p-2 tw-flex tw-items-center tw-justify-center tw-p-2 tw-border-0",onClick:()=>b(null),children:(0,l.jsx)(n.default,{src:"/Closedark.svg",width:30,height:30,alt:"X"})})]})}),(0,l.jsxs)("div",{className:"tw-flex tw-flex-col tw-h-full tw-min-h-0",style:{position:"relative"},children:[(0,l.jsx)(u.Z,{isVisible:(x||C)&&null===j}),(0,l.jsxs)("div",{className:"tw-flex tw-flex-col tw-px-4 tw-pb-4 tw-flex-1 tw-overflow-y-auto tw-min-h-0",children:[(0,l.jsxs)("div",{className:"tw-sticky tw-top-0 tw-bg-white tw-mb-4",style:{zIndex:2},children:[(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-justify-between tw-gap-3",style:{paddingTop:16,paddingBottom:16},children:[(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-2",children:[(0,l.jsx)("span",{className:"tw-inline-flex tw-items-center tw-rounded-full tw-bg-gray-100 tw-px-2.5 tw-py-0.5 tw-text-xs tw-font-semibold tw-text-gray-600",children:null!==(t=null==D?void 0:D.length)&&void 0!==t?t:0}),(0,l.jsx)("span",{className:"tw-text-xs tw-text-gray-400",children:"archived images"})]}),(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1.5",children:[_&&(0,l.jsx)("button",{className:"tw-inline-flex tw-items-center tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-600 tw-transition-colors hover:tw-bg-gray-50",style:{border:"1px solid #D1D5DB"},onClick:()=>{S.size===(null==D?void 0:D.length)?k(new Set):k(new Set(null==D?void 0:D.map(e=>e.id)))},children:S.size===(null==D?void 0:D.length)?"Deselect all":"Select all"}),(0,l.jsx)("button",{className:"tw-inline-flex tw-items-center tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-700 tw-transition-colors hover:tw-bg-gray-50",style:{border:"1px solid #D1D5DB"},onClick:()=>{_?(k(new Set),E(!1)):E(!0)},children:_?"Clear":"Select"})]})]}),(0,l.jsx)("div",{style:{borderBottom:"0.5px solid #E5E7EB"}})]}
1),(0,l.jsx)(d.X2,{className:"g-2",children:null==D?void 0:D.map((e,t)=>(0,l.jsx)(c.Z,{img:e,index:t,deleteMedia:z,onImagePreview:b,isSelectMode:_,isSelected:S.has(e.id),onSelect:P,isArchiveMode:!0,enableDragDrop:!1,onDownload:B,isLoading:j===e.id},e.id))})]}),(0,l.jsxs)("div",{className:"tw-shrink-0 tw-flex tw-items-center tw-justify-between tw-gap-3 tw-border-t tw-border-solid tw-border-[#EBEBEB] tw-bg-white tw-px-4 tw-py-3 prevent-close",children:[(0,l.jsx)("div",{className:"tw-flex tw-items-center tw-gap-2",children:_&&S.size>0&&(0,l.jsxs)("button",{type:"button",onClick:L,disabled:x||C,className:"tw-inline-flex tw-items-center tw-gap-1.5 tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-700 tw-transition-colors hover:tw-bg-gray-50 disabled:tw-opacity-40",style:{border:"1px solid #D1D5DB"},children:[(0,l.jsx)(n.default,{src:"/download-icon-black.svg",width:13,height:13,alt:""}),"Download (",S.size,")"]})}),(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-2",children:[_&&S.size>0&&(0,l.jsxs)("button",{type:"button",onClick:()=>{S.size>0&&(z(Array.from(S)),k(new Set),E(!1))},disabled:x||C,className:"tw-h-8 tw-cursor-pointer tw-rounded-md tw-border-0 tw-bg-gray-900 tw-px-4 tw-text-xs tw-font-bold tw-text-white tw-transition-colors hover:tw-bg-gray-700 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",children:["Restore (",S.size,")"]}),(0,l.jsx)("button",{type:"button",onClick:w,disabled:x||C,className:"tw-h-8 tw-cursor-pointer tw-rounded-md tw-border-0 tw-bg-gray-900 tw-px-4 tw-text-xs tw-font-bold tw-text-white tw-transition-colors hover:tw-bg-gray-700 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",children:"Done"})]})]})]})]})}},59757:function(e,t,i){var l=i(57437),r=i(2265),n=i(33145),d=i(73021),a=i(71104),o=i(58710);t.Z=e=>{let{img:t,index:i,reorderMedia:s,deleteMedia:c,isDeletable:u=!0,onImagePreview:w,isSelectMode:p=!1,isSelected:g=!1,onSelect:m,isArchiveMode:f=!1,enableDragDrop:h=!0,onDownload:y,isLoading:b=!1,colXs:x=6,colMd:v=4,colLg:j=3,noCol:I=!1}=e,[_,E]=(0,r.useState)(!1),[S,k]=(0,r.useState)(!1),{attributes:D,listeners:N,setNodeRef:R,transform:C,transition:z,isDragging:P}=(0,a.nB)({id:String(t.id),disabled:!h}),L=S&&!p&&!b,B=(0,l.jsxs)("div",{ref:R,className:"tw-rounded-lg tw-overflow-hidden tw-bg-gray-100",style:{aspectRatio:"4/3",position:"relative",isolation:"isolate",cursor:p?"pointer":h?"grab":"default",transform:o.ux.Transform.toString(C),transition:z,border:"1px solid #E5E7EB",opacity:P?.5:1},...D,...N,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),onClick:()=>{p&&m&&m(t.id)},children:[!_&&!b&&(0,l.jsx)("div",{className:"tw-animate-pulse",style:{position:"absolute",inset:0,background:"#E5E7EB"}}),(0,l.jsx)(n.default,{src:null==t?void 0:t.url,alt:"Property image",fill:!0,style:{objectFit:"cover"},onLoad:()=>E(!0)}),!f&&0===i&&(0,l.jsxs)("div",{style:{position:"absolute",top:8,left:8,zIndex:2,display:"flex",alignItems:"center",gap:4,background:"rgba(255,255,255,0.92)",borderRadius:4,padding:"2px 8px",fontSize:11,fontWeight:600,color:"#374151",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",pointerEvents:"none"},children:[(0,l.jsx)(n.default,{src:"/star.svg",alt:"",width:11,height:11}),"Cover"]}),b&&(0,l.jsx)("div",{style:{position:"absolute",inset:0,zIndex:5,background:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)("div",{className:"tw-animate-spin",style:{width:22,height:22,borderRadius:"50%",border:"2.5px solid #E5E7EB",borderTopColor:"#111827"}})}),L&&(0,l.jsx)("div",{style:{position:"absolute",inset:0,zIndex:1,background:"rgba(0,0,0,0.30)",pointerEvents:"none"}}),L&&(0,l.jsxs)("div",{style:{position:"absolute",top:8,right:8,zIndex:3,display:"flex",flexDirection:"column",gap:4},children:[c&&(!!f||u)&&(0,l.jsx)("button",{type:"button",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:5,background:"#fff",border:"none",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,0.15)"},onClick:e=>{e.stopPropagation(),c([t.id])},title:f?"Restore":"Archive",children:(0,l.jsx)(n.default,{src:f?"/rec
1over.svg":"/remove.svg",alt:"",width:13,height:13})}),(0,l.jsx)("button",{type:"button",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:5,background:"#fff",border:"none",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,0.15)"},onClick:e=>{e.stopPropagation(),w(t.url)},title:"Preview",children:(0,l.jsx)(n.default,{src:"/Eye-fill.svg",alt:"",width:13,height:13})}),y&&(0,l.jsx)("button",{type:"button",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:5,background:"#fff",border:"none",cursor:"pointer",boxShadow:"0 1px 4px rgba(0,0,0,0.15)"},onClick:e=>{e.stopPropagation(),y(t)},title:"Download",children:(0,l.jsx)(n.default,{src:"/download-icon-black.svg",alt:"",width:13,height:13})})]}),p&&(0,l.jsx)("div",{style:{position:"absolute",top:8,right:8,zIndex:3},children:(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:4,border:"2px solid ".concat(g?"#111827":"#D1D5DB"),background:g?"#111827":"rgba(255,255,255,0.9)",transition:"all 0.15s"},children:g&&(0,l.jsx)("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,l.jsx)("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),L&&!f&&0!==i&&s&&(0,l.jsx)("button",{type:"button",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:3,background:"rgba(0,0,0,0.65)",border:"none",borderRadius:4,padding:"6px 14px",fontSize:12,fontWeight:600,color:"#fff",cursor:"pointer",whiteSpace:"nowrap",boxShadow:"0 1px 4px rgba(0,0,0,0.15)"},onMouseEnter:e=>e.currentTarget.style.background="rgba(0,0,0,0.85)",onMouseLeave:e=>e.currentTarget.style.background="rgba(0,0,0,0.65)",onClick:e=>{e.stopPropagation(),s(t)},children:"Set as cover"})]});return I?B:(0,l.jsx)(d.JX,{xs:x,md:v,lg:j,style:{opacity:P?.5:1},children:B})}},40071:function(e,t,i){var l=i(57437),r=i(2265),n=i(85691),d=i(33145),a=i(73021),o=i(21770),s=i(88573),c=i(18133),u=i(59757),w=i(91584),p=i(56518),g=i(57635),m=i.n(g),f=i(40932),h=i(33700),y=i(2443);t.Z=e=>{let{initialImages:t,propertyId:i,isDeletable:g,onHide:b,refetchProperty:x,refetch:v,showCancel:j=!0,property:I}=e,_=(0,p.aF)(),{uploadFiles:E,isUploading:S}=(0,f.z)(),[k,D]=(0,r.useState)(t),[N,R]=(0,r.useState)(null),[C,z]=(0,r.useState)(!1),[P,L]=(0,r.useState)(""),B=(0,r.useRef)(null),[T,F]=(0,r.useState)(!1),[A,U]=(0,r.useState)(new Set),[O,M]=(0,r.useState)(!1),[q,Z]=(0,r.useState)(!1);(0,n.PW)(q);let[V,W]=(0,r.useState)(null);(0,r.useEffect)(()=>{D(e=>{if(!q)return t;if(!(null==t?void 0:t.length)&&e.length)return e;let i=new Set(e.map(e=>e.id)),l=new Set(t.map(e=>e.id)),r=t.filter(e=>!i.has(e.id));return[...e.filter(e=>l.has(e.id)),...r]})},[t,q]);let{mutate:H,isPending:K}=(0,o.D)({mutationFn:e=>(0,s.Cs)({body:null==e?void 0:e.body}),onSuccess:e=>{x(),v(),L(""),W(null),c.Toast.success("Success","".concat((null==e?void 0:e.title)||"Media"," archived successfully."))},onError:e=>{L(""),W(null)}}),X=e=>{1===e.length?W(e[0]):L("image"),H({body:{ids:e},type:"Images"})},G=e=>{let t=new Set(A);t.has(e)?t.delete(e):t.add(e),U(t)},J=async()=>{if(0!==A.size){z(!0);try{var e,t;let i=new(m()),l=k.filter(e=>A.has(e.id));for(let e=0;e<l.length;e++){let r=l[e];try{let l=r.url,n=await fetch(l);if(!n.ok)continue;let d=await n.blob();if(0===d.size)continue;let a="jpg",o=null===(t=r.url.split(".").pop())||void 0===t?void 0:t.split("?")[0];o&&["jpg","jpeg","png","gif","webp"].includes(o.toLowerCase())&&(a=o.toLowerCase());let s="image_".concat(String(e+1).padStart(3,"0"),".").concat(a);i.file(s,d,{binary:!0})}catch(e){}}let r=await i.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}}),n=window.URL.createObjectURL(r),d=document.createElement("a");d.href=n;let a=((null==I?void 0:null===(e=I.community)||void 0===e?void 0:e.name)||(null==I?void 0:I.address)||"property").replace(/[^a-z0-9]/gi,"_");d.download="".concat(a,"_images_").concat(Date.now(),".zip"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(n)},100)}catch(e){}finally{z(!1)}}},$=async e=>{W(e.id);try{var t,i;let l=e.url,r=await fetch(l);if(!r.ok)throw Error("Download failed");let n=await r.blob();if(0===n.size)throw Error("Empty file");let d="jpg",a=null===(t=e.url.split(".").pop())||void 0===t?void 0:t.split("?")[0];a&&["jpg","jpeg","png","gif","webp"].includes(a.toLowerCase())&&(d=a.toLowerCase());let o=window.URL.createObjectURL(n),s=document.createElement("a");s.href=o;let c=((null==I?void 0:null===(i=I.community)||void 0===i?void 0:i.name)||(null==I?void 0:I.address)||"property").replace(/[^a-z0-9]/gi,"_");s.download="".concat(c,"_image_").concat(Date.now(),".").concat(d),document.body.appendChild(s),s.click(),setTimeout(()=>{document.body.removeChild(s),window.URL.revokeObjectURL(o)},100)}catch(e){}finally{W(null)}},Q=(0,y.Dy)((0,y.VT)(y.we,{activationConstraint:{distance:6}})),Y=e=>{D(t=>[e,...t.filter(t=>t.id!==e.id)]),Z(!0)},ee=async()=>
1{if(q){z(!0);try{await (0,s.tm)({media:k.map((e,t)=>({id:e.id,order:t}))}),null==v||v(),x()}catch(l){var e,t,i;c.Toast.error("Error",(null==l?void 0:null===(i=l.response)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:null===(e=t.message)||void 0===e?void 0:e.message)||"Error reordering images."),z(!1);return}z(!1)}b()},et=async e=>{if(0!==e.length){z(!0);try{var t;await E(e,{resourceId:i,resourceType:"Property",category:"Image",title:"images image img",isExternal:!1,watermark:!0,order:(null==k?void 0:k.length)+1,divisionId:null==_?void 0:null===(t=_.branch)||void 0===t?void 0:t.division_id},{mode:"sequential",onSuccess:()=>{z(!1),x(),v(),(null==B?void 0:B.current)&&(B.current.value="")},onError:()=>{z(!1),(null==B?void 0:B.current)&&(B.current.value="")},successMessage:"Image uploaded successfully.",errorMessage:"Error uploading."})}catch(e){z(!1),console.error("Error during upload:",e),(null==B?void 0:B.current)&&(B.current.value="")}finally{L("")}}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.u_,{show:!!N,onHide:()=>R(null),size:"lg",centered:!0,className:"prevent-close",children:(0,l.jsxs)(a.u_.Body,{className:"tw-p-0 tw-relative",children:[N&&(0,l.jsx)("div",{className:"tw-flex tw-justify-center tw-items-center",children:(0,l.jsx)("div",{style:{position:"relative",width:"100%",aspectRatio:"3/2",maxHeight:"70vh"},children:(0,l.jsx)(d.default,{src:N,alt:"Preview",fill:!0,style:{objectFit:"contain"},className:"tw-rounded-md"})})}),(0,l.jsx)("button",{className:"tw-absolute tw-top-0 tw-right-0 tw-m-4 tw-rounded-[50%] tw-p-2 tw-flex tw-items-center tw-justify-center tw-p-2 tw-border-0",onClick:()=>R(null),children:(0,l.jsx)(d.default,{src:"/Closedark.svg",width:30,height:30,alt:"X"})})]})}),(0,l.jsx)("input",{ref:B,multiple:!0,type:"file",accept:".jpg,.jpeg,.png,.gif,.webp",className:"tw-hidden",onChange:e=>{et(Array.from(e.target.files||[]))}}),(0,l.jsxs)("div",{className:"tw-flex tw-flex-col tw-h-full tw-min-h-0",style:{position:"relative"},onDragOver:e=>{!T&&e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation())},onDragEnter:e=>{!T&&e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),M(!0))},onDragLeave:e=>{!T&&e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),M(!1))},onDrop:e=>{if(!T&&e.dataTransfer.types.includes("Files")){e.preventDefault(),e.stopPropagation(),M(!1);let t=Array.from(e.dataTransfer.files).filter(e=>e.type.match(/^image\/(jpg|jpeg|png|gif|webp)$/));t.length>0&&et(t)}},children:[(0,l.jsx)(w.Z,{isVisible:C||S||K&&null===V}),(0,l.jsxs)("div",{className:"tw-flex tw-flex-col tw-px-4 tw-pb-4 tw-flex-1 tw-overflow-y-auto tw-min-h-0",children:[(0,l.jsxs)("div",{className:"tw-sticky tw-top-0 tw-bg-white tw-mb-4",style:{zIndex:10},children:[(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-justify-between tw-gap-3",style:{paddingTop:16,paddingBottom:16},children:[(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-2",children:[(0,l.jsx)("span",{className:"tw-inline-flex tw-items-center tw-rounded-full tw-bg-gray-100 tw-px-2.5 tw-py-0.5 tw-text-xs tw-font-semibold tw-text-gray-600",children:k.length}),(0,l.jsxs)("span",{className:"tw-text-xs tw-text-gray-400",children:[1===k.length?"image":"images"," \xb7 drag to reorder"]})]}),(0,l.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-1.5",children:[T&&(0,l.jsx)("button",{className:"tw-inline-flex tw-items-center tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-600 tw-transition-colors hover:tw-bg-gray-50",style:{border:"1px solid #D1D5DB"},onClick:()=>{A.size===k.length?U(new Set):U(new Set(k.map(e=>e.id)))},children:A.size===k.length?"Deselect all":"Select all"}),(0,l.jsx)("button",{className:"tw-inline-flex tw-items-center tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-700 tw-transition-colors hover:tw-bg-gray-50",style:{border:"1px solid #D1D5DB"},onClick:()=>{T?(U(new Set),F(!1)):F(!0)},children:T?"Clear":"Select"}),(0,l.jsx)("button",{className:"tw-inline-flex tw-items-center tw-gap-1.5 tw-h-8 tw-cursor-pointer tw-rounded-md tw-border-0 tw-bg-gray-900 tw-px-3 tw-text-xs tw-font-semibold tw-text-white tw-transition-colors hover:tw-bg-gray-700 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",disabled:"image"===P||T,onClick:()=>{var e;return null==B?void 0:null===(e=B.current)||void 0===e?void 0:e.click()},children:"+ Add image"})]})]}),(0,l.jsx)("div",{style:{borderBottom:"0.5px solid #E5E7EB"}})]}),(0,l.jsx)(y.LB,{sensors:Q,collisionDetection:y.pE,onDragEnd:e=>{let{active:t,over:i}=e;if(!i||t.id===i.id)return;let l=k.findIndex(e=>String(e.id)===String(t.id)),r=k.findIndex(e=>String(e.id)===String(i.id));l<0||r<0||(D(e=>(0,h.Rp)(e,l,r)),Z(!0))},children:(0,l.jsx)(h.Fo,{items:k.map(e=>String(e.id)),strategy:h.U2,children:(0,l.jsx)("div",{className:"tw-grid tw-gri
1d-cols-2 tw-gap-2 sm:tw-grid-cols-3 md:tw-grid-cols-4",children:null==k?void 0:k.map((e,t)=>(0,l.jsx)(u.Z,{img:e,index:t,images:k,setImages:D,reorderMedia:Y,deleteMedia:X,isDeletable:g,onImagePreview:R,isSelectMode:T,isSelected:A.has(e.id),onSelect:G,enableDragDrop:!T,onDownload:$,isLoading:V===e.id,noCol:!0},e.id))})})})]}),(0,l.jsxs)("div",{className:"tw-shrink-0 tw-flex tw-items-center tw-justify-between tw-gap-3 tw-border-t tw-border-solid tw-border-[#EBEBEB] tw-bg-white tw-px-4 tw-py-3 prevent-close",children:[(0,l.jsx)("div",{className:"tw-flex tw-items-center tw-gap-2",children:T&&A.size>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("button",{type:"button",onClick:()=>{A.size>0&&(X(Array.from(A)),U(new Set),F(!1))},disabled:C||!!P,className:"tw-inline-flex tw-items-center tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-700 tw-transition-colors hover:tw-bg-gray-50 disabled:tw-opacity-40",style:{border:"1px solid #D1D5DB"},children:["Archive (",A.size,")"]}),(0,l.jsxs)("button",{type:"button",onClick:J,disabled:C||!!P,className:"tw-inline-flex tw-items-center tw-gap-1.5 tw-h-8 tw-cursor-pointer tw-rounded-md tw-bg-white tw-px-3 tw-text-xs tw-font-semibold tw-text-gray-700 tw-transition-colors hover:tw-bg-gray-50 disabled:tw-opacity-40",style:{border:"1px solid #D1D5DB"},children:[(0,l.jsx)(d.default,{src:"/download-icon-black.svg",width:13,height:13,alt:""}),"Download (",A.size,")"]})]})}),(0,l.jsx)("button",{type:"button",onClick:ee,disabled:C||!!P,className:"tw-h-8 tw-cursor-pointer tw-rounded-md tw-border-0 tw-bg-gray-900 tw-px-4 tw-text-xs tw-font-bold tw-text-white tw-transition-colors hover:tw-bg-gray-700 disabled:tw-cursor-not-allowed disabled:tw-opacity-40",children:"Save"})]})]})]})}},46596:function(e,t,i){i.d(t,{BW:function(){return o},C5:function(){return s},L:function(){return p},Pi:function(){return u},di:function(){return c},ns:function(){return w}});var l=i(83302),r=i(7234),n=i(71632),d=i(21340);let a=e=>d.zk.withRelation(e),o=async(e,t,i,n)=>{let o={and:[{field:"creator_id",op:"=",value:t}]},s=e=>a(e).filter({and:[{field:"status",op:"=",value:"Active"}]}).addInclude(a("customer").addInclude(a("visa").filter(o)).addInclude(a("id_card").filter(o)).addInclude(a("passport").filter(o))).addInclude(a("title_deed").filter(o)).addInclude(a("poa").filter(o)).addInclude(a("oqood").filter(o)),c=new d.zk;i&&c.filter(i),c.addInclude(a("community").select(["id","name","address"])).addInclude(a("property_type")).addInclude(a("images").sort({order:"asc"})).addInclude(a("videos")).addInclude(a("floor_plan")).addInclude(a("virtual_tour")).addInclude(a("amenities")).addInclude(a("listings").filter([{and:[{field:"status",op:"in",value:["Draft","In Review","Active","Reserved"]},...n?[{field:"type",op:"=",value:n}]:[]]}]).addInclude(a("agent")).addInclude(a("lead").addInclude(a("customer").select(["id","name","phone"]))).addInclude(a("buddy")).addInclude(a("advertiser")).addInclude(a("referrer")).addInclude(a("form_a")).addInclude(a("noc")).addInclude(a("lsa"))).addInclude(s("owner")).addInclude(s("owners"));let u=c.toParams(),{data:w}=await (0,l.kE)(r.Ai.FIND_PROPERTIES,u);return w.data},s=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=new d.zk().filter({and:[{field:"id",op:"=",value:t},{field:"status",op:"in",value:["Verified","In Review","Draft","Reserved"]}]}).select(["id","address","reference","bedrooms","bathrooms","size","unit","community_id"]).addInclude(a("listings").filter([{and:[{field:"status",op:"in",value:["Draft","In Review","Active","Reserved"]},...i?[{field:"type",op:"=",value:i}]:[]]}]).sort({created_at:"desc"}).addInclude(a("lead").filter({and:[{field:"state",op:"=",value:"Open"}]}).select(["id","state","type"])).addInclude(a("agent").select(["id","name","email","away_until"]).addInclude(a("avatar").select(["id","url","resource_id","resource_type"])))).addInclude(a("images").select(["id","resource_id","resource_type","url"])).addInclude(a("community").select(["id","name"])).toParams(),{isLoading:s,data:c,error:u,refetch:w}=(0,n.a)({queryKey:[r.Ai.FIND_PROPERTIES,o],enabled:!!e,queryFn:async()=>{let{data:e}=await (0,l.kE)(r.Ai.FIND_PROPERTIES,o);return e.data}});return{propertyLoading:s,propertyData:null==c?void 0:c[0],propertyError:u,RefetchProperty:w}},c=async(e,t,i,n)=>{let o={and:[{field:"creator_id",op:"=",value:t}]},s=()=>a("customer").addInclude(a("visa").filter(o)).addInclude(a("id_card").filter(o)).addInclude(a("passport").filter(o)),c=(e,t)=>{let i=a(e).filter({and:[{field:"status",op:"=",value:"Active"}]}).addInclude(s());
1return t.forEach(e=>i.addInclude(a(e).filter(o))),i},u=new d.zk;n&&u.filter(n),u.addInclude(a("community").select(["id","name","address"])).addInclude(a("property_type")).addInclude(a("images").sort({order:"asc"})).addInclude(a("videos")).addInclude(a("floor_plan")).addInclude(a("virtual_tour")).addInclude(a("amenities")).addInclude(c("owner",["title_deed","oqood","poa"])).addInclude(c("owners",["title_deed","poa","oqood"]));let w=u.toParams(),{data:p}=await (0,l.kE)(r.Ai.FIND_PROPERTIES+"/"+i,w);return p.data},u=(e,t)=>{let i=["id","url","order","file_type","name","title","resource_id"],o=new d.zk;t&&o.filter(t),o.select(["id","reference"]).addInclude(a("videos").select(i)).addInclude(a("images").select(i)).addInclude(a("floor_plan").select(i)).addInclude(a("virtual_tour").select(i));let s=o.toParams(),{isLoading:c,data:u,error:w,refetch:p,isRefetching:g}=(0,n.a)({queryKey:[r.Ai.FIND_PROPERTIES,s],enabled:!!e,queryFn:async()=>{let{data:e}=await (0,l.kE)(r.Ai.FIND_PROPERTIES,s);return e.data}});return{propertyLoading:c,propertyData:null==u?void 0:u[0],propertyError:w,RefetchProperty:p,isRefetchingProperty:g}},w=(e,t)=>{let i=new d.zk;t&&i.filter(t),i.addInclude(a("amenities"));let o=i.toParams(),{isLoading:s,data:c,error:u,refetch:w,isRefetching:p}=(0,n.a)({queryKey:[r.Ai.FIND_PROPERTIES,o],enabled:!!e,queryFn:async()=>{let{data:e}=await (0,l.kE)(r.Ai.FIND_PROPERTIES,o);return e.data}});return{propertyLoading:s,propertyData:null==c?void 0:c[0],propertyError:u,RefetchProperty:w,isRefetchingProperty:p}},p=e=>{let{propertyId:t,listingType:i="",openOnly:o=!1,closedOnly:s=!1,enabled:c=!0,filters:u={}}=e,w=new d.zk;u&&w.filter(u),w.addInclude(a("agent").select(["id","name","email","away_until"])).addInclude(a("rera_qr_code")).addInclude(a("branch").select(["id","name"])).addInclude(a("listable").select(["id","reference","community_id","location_tree"]).addInclude(a("community").select(["id","name","location_id"]).addInclude(a("location").select(["id","name"])))).select(["id","listable_id","listable_type","agent_id","price","status","created_at","updated_at","type","visibility_status","reference","pf_id","rera_issue_at","rera_expire_at","rera_permit","rera_listing_no","branch_id","sub_type","cms_id"]);let p=w.toParams(),{isLoading:g,data:m,error:f,refetch:h,isRefetching:y}=(0,n.a)({queryKey:[r.yh.LISTINGS,p],enabled:!!t&&c,queryFn:async()=>{let{data:e}=await (0,l.kE)(r.yh.LISTINGS,p);return e.data}});return{data:m,isLoading:g,error:f,refetch:h,isRefetching:y}}},33700:function(e,t,i){i.d(t,{Fo:function(){return l.Fo},Rp:function(){return l.Rp},U2:function(){return l.U2}});var l=i(93662)},43104:function(e,t,i){var l=i(8946);i.o(l,"sortBy")&&i.d(t,{sortBy:function(){return l.sortBy}})},71104:function(e,t,i){i.d(t,{nB:function(){return l.nB}});var l=i(93662)}}]);

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.