6 lines
12 KiB
Plaintext
6 lines
12 KiB
Plaintext
"use strict";
|
|
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d8587c24-c014-5b4e-bb01-ca3c3f8c5ab6")}catch(e){}}();
|
|
(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[150],{845:(e,a,s)=>{s.d(a,{Z:()=>m});var n=s(9),c=s.n(n),o=(s(0),s(10)),r=s(99),t=s(720),l=s(8),i=s(398),_=s(72),u="D_afF",d=s(1);const h=s(891),m=e=>{const a=(0,r._x)(),{className:s="",color:n=a.urbanGrey20,text:m,onClick:p}=e,b=(0,o.v9)(l.Y6),v="function"==typeof e.onClose;return(0,d.jsxs)("div",{className:`${(()=>{const e=["D_afz",{D_afA:n===a.urbanGrey20,D_afB:n===a.urbanGrey50Alpha,D_afE:n===a.skyTeal20,[u]:n===a.skyTeal60,[u]:n===a.skyTeal60,D_afC:n===a.white}];return b?c()(e,h.label,{[h.colorUrbanGrey20]:n===a.urbanGrey20,[h.colorUrbanGrey50Alpha]:n===a.urbanGrey50Alpha,[h.colorSkyTeal20]:n===a.skyTeal20,[h.colorSkyTeal60]:n===a.skyTeal60,[h.colorWhite]:n===a.white}):c()(e)})()} ${s}`,onClick:p,children:[(0,d.jsx)(_.Z,{color:n===a.skyTeal60||n===a.urbanGrey50Alpha?a.white:a.urbanGrey60,singleline:!0,children:m}),v&&(0,d.jsx)(i.Z,{className:"D_af_",onClick:a=>{if(e.onClose){const s=e.onClose;a.stopPropagation(),s()}},type:"icon",children:(0,d.jsx)(t.Z,{size:16})})]})}},2213:(e,a,s)=>{s.d(a,{Z:()=>t});var n=s(2),c=(s(0),s(402)),o=s(1);const r=(0,n.ZP)({resolved:{},chunkName:()=>"search-location-general-modal-mobile",isReady(e){const a=this.resolve(e);return!0===this.resolved[a]&&!!s.m[a]},importAsync:()=>Promise.all([s.e(135),s.e(979),s.e(15),s.e(633)]).then(s.bind(s,1822)),requireAsync(e){const a=this.resolve(e);return this.resolved[a]=!1,this.importAsync(e).then((e=>(this.resolved[a]=!0,e)))},requireSync(e){const a=this.resolve(e);return s(a)},resolve:()=>1822},{fallback:(0,o.jsx)("div",{})}),t=(0,c.TE)("SEARCH_LOCATION_GENERAL_MODAL_MOBILE",r)},1632:(e,a,s)=>{s.d(a,{Z:()=>W});var n=s(0),c=s(10),o=s(99),r=s(399),t=s(175),l=s(72),i=s(8),_=s(797),u=s(33),d=s(990),h=s(1);const m=s(2210),p=({searchOption:e})=>{const a=(0,c.I0)(),s=(0,c.v9)(i.Y6),n=(0,c.v9)((e=>(0,_.CJ)(e,{mode:"all_country_location_search"}))),{label:o}=e,p=s?m:void 0;return o?(0,h.jsxs)("div",{className:`D_btT ${p.searchOption}`,onClick:()=>{a((0,u.Vh)({name:"location_filter_country_tapped",type:"action"})),a((0,_.iI)({ccID:null,lat:null,lon:null,marketplaceId:null,mode:"all_country_location_search"}))},children:[n?(0,h.jsx)(t.Z,{className:"D_btV",size:"s"}):(0,h.jsx)(r.Z,{className:"D_btU",crossOrigin:!0,src:d}),(0,h.jsx)(l.Z,{children:o})]}):null};var b=s(397),v=s(764),D=s(21),x=s(24),y=s(105),O=s(2424),j=s(18);const g="https://mweb-cdn.karousell.com/build/current-location-44b3712e04.svg";var f="D_bug",I="D_bui",N="D_buh";const k=s(2211),Z=5e3;function C(e){const{ccID:a,searchOption:{label:s}}=e,o=(0,c.I0)(),d=(0,c.v9)(D.l$),m=(0,c.v9)(i.Y6),p=(0,c.v9)((e=>(0,_.CJ)(e,{mode:"current_location_search"}))),C=(0,c.v9)(_.EK),{country_code:E}=(0,c.v9)(x.S$),[L,A]=(0,n.useState)(!1);(0,n.useEffect)((()=>function(){C&&(o((0,_.j1)()),o((0,y.eG)()))}),[o,C]),(0,n.useEffect)((()=>{C&&("UserNotLocatedInMarketplace"===C.message?o((0,y.LO)({snackbarID:"LOCATION_PICKER_USER_NOT_LOCATED_IN_MARKETPLACE"})):o((0,y.LO)({snackbarID:"LOCATION_PICKER_ERROR"})))}),[o,C]);const $=e=>{const{coords:{latitude:s,longitude:n}}=e;A(!1),o((0,_.iI)({ccID:a,lat:s,lon:n,marketplaceId:null,mode:"current_location_search"}))},R=e=>{A(!1),o((0,y.LO)({snackbarID:"LOCATION_PICKER_PERMISSION_DENIED"}))};return navigator&&navigator.geolocation?(0,h.jsxs)("div",{className:`${f} ${m?k.container:""}`,onClick:()=>{o((0,u.Vh)({name:"location_filter_current_tapped",type:"action"})),A(!0),navigator.geolocation.getCurrentPosition($,R,{timeout:Z})},children:[L||p?(0,h.jsx)(t.Z,{className:N,size:"s"}):(0,h.jsx)(r.Z,{className:I,src:g}),(0,h.jsx)(l.Z,{singleline:!0,children:s||(0,h.jsx)(b.Z,{id:(0,j.ZP)("Listings near me")})}),(0,h.jsx)(v.Z,{message:d((0,j.ZP)("Carousell does not have permission to use your location.")),snackbarID:"LOCATION_PICKER_PERMISSION_DENIED"}),(0,h.jsx)(v.Z,{message:d((0,O.PA)(E)||""),snackbarID:"LOCATION_PICKER_USER_NOT_LOCATED_IN_MARKETPLACE"}),(0,h.jsx)(v.Z,{message:d((0,j.ZP)("Oops! Something went wrong.")),snackbarID:"LOCATION_PICKER_ERROR"})]}):null}var E=s(729);const L="https://mweb-cdn.karousell.com/build/location-area-f954272d42.svg",A="https://mweb-cdn.karousell.com/build/location-mrt-e4be8cac2a.svg",$="https://mweb-cdn.karousell.com/build/location-neighbourhood-553af97d7c.svg",R=s(2212),S={area_location_search:L,district_location_search:"https://mweb-cdn.karousell.com/build/location-district-c1425da8f8.svg",estate_location_search:"https://mweb-cdn.karousell.com/build/location-estate-b30d00fd3d.svg",mrt_location_search:A,mtr_location_search:A,planning_area_location_search:L,sub_district_location_search:$,sub_zone_location_search:$},T=({onClick:e,onMouseLeave:a,onMouseOver:s,searchOption:n})=>{const{label:o,type:t}=n,_=(0,c.I0)(),d=(0,c.v9)(i.Y6)?R:void 0,m=S[t];return o?(0,h.jsxs)("div",{className:`D_buk ${d.searchOption}`,onClick:()=>{e&&(_((0,u.Vh)({name:"location_filter_option_tapped",properties:{context:(0,O.Rv)(t)},type:"action"})),e(n))},onMouseLeave:a,onMouseOver:()=>{s&&s(n)},children:[(0,h.jsxs)("div",{className:"D_bum",children:[m&&(0,h.jsx)(r.Z,{className:"D_bul",crossOrigin:!0,src:m}),(0,h.jsx)(l.Z,{children:o})]}),(0,h.jsx)(E.Z,{className:"D_bun",direction:"right"})]}):null};var G=s(2213),P=s(802);const w=s(2214),M=({onSelect:e,searchOption:a,selectedLocations:s})=>{const n=(0,c.I0)(),o=(0,c.v9)(i.Y6),{location:r}=a;if(!r)return null;const{id:t,display_name:d}=r,m=o?w:void 0;return(0,h.jsx)("div",{className:`D_buo ${m.searchOption}`,children:(0,h.jsx)(P.Z,{variant:"checkbox",selected:!!s?.get(`${t}`),name:d,onChange:a=>{if(e&&r){n((0,u.Vh)({name:"location_filter_popular_tapped",type:"action"}));const s={...r,source:"popular"};n((0,_.nb)({options:[s]})),e(a,s)}},children:(0,h.jsx)(l.Z,{singleline:!0,children:d})})})};var Y=s(957),z=s(1076);const K=s(2215),U=({ccID:e,heading:a})=>{const s=(0,c.I0)(),t=(0,o._x)(),d=(0,c.v9)(i.Y6),m=(0,c.v9)(_.qC);(0,n.useEffect)((()=>{s((0,_.bJ)({isPropertyCollection:(0,O.gp)(e)}))}),[e,s]);const p=e=>()=>{s((0,u.Vh)({name:"location_filter_recent_tapped",type:"action"}));const a=e.map((e=>({...e,source:"recent"})));s((0,_.nb)({options:a})),s((0,_.G8)({options:a}))};if(!m||!m.length)return null;const b=d?K:void 0,v=d?a&&(0,h.jsx)(l.Z,{className:K.header,color:t.urbanGrey50,size:"s",children:a}):a&&(0,h.jsx)(l.Z,{color:t.urbanGrey60,size:"s",weight:"semibold",children:a});return(0,h.jsxs)(h.Fragment,{children:[v,m.map(((e,a)=>{const s=e.reduce(((e,{display_name:a})=>({...e,[a]:a in e?e[a]+1:1})),{}),n=e.map((({display_ancestor_name:e,display_name:a})=>s[a]>1?`${a}, ${e}`:a)).join(`${Y.jR}${Y.aZ}${Y.jR}`);return m?.length?(0,h.jsxs)("div",{className:`D_bup ${b.searchOption}`,onClick:p(e),children:[(0,h.jsx)(r.Z,{className:"D_buq",crossOrigin:!0,src:z}),(0,h.jsx)(l.Z,{overflow:"breakWord",singleline:!0,children:n})]},a):null}))]})};var V=s(16);const B=s(2216),F=()=>{const e=(0,c.I0)(),a=(0,o._x)(),s=(0,c.v9)(D.l$),n=(0,c.v9)(V.XM),d=(0,c.v9)(i.Y6),{country_code:m}=(0,c.v9)(x.S$),p=(0,c.v9)((e=>(0,_.CJ)(e,{mode:"user_marketplace_location_search"}))),b=n?.profile?.marketplace;if(!b)return null;if(m!==b.country.code)return null;const v=d?B:void 0;return b.name?(0,h.jsxs)("div",{className:`D_bu_ ${v.searchOption}`,onClick:()=>{b&&(e((0,u.Vh)({name:"location_filter_profile_tapped",type:"action"})),e((0,_.iI)({ccID:null,lat:null,lon:null,marketplaceId:b.id,mode:"user_marketplace_location_search"})))},children:[p?(0,h.jsx)(t.Z,{className:"D_buE",size:"s"}):(0,h.jsx)(r.Z,{className:"D_buA",crossOrigin:!0,src:"https://mweb-cdn.karousell.com/build/location-profile-15a27dbd40.svg"}),(0,h.jsx)(l.Z,{className:"D_buB",children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(l.Z,{inline:!0,children:b.name}),(y=s((0,j.ZP)("Your profile location")),(0,h.jsx)(l.Z,{className:"D_buC",color:a.urbanGrey60,inline:!0,size:"xs",children:`${Y.RN}${Y.aZ}${Y.RN}${y}`}))]})})]}):null;var y};var J=s(39),q="D_aYV";const H=s(2217);function W(e){const{ccID:a,label:s,onClick:r,onMouseLeave:t,onMouseOver:_,options:u,selectedLocations:d}=e,m=(0,c.I0)(),b=(0,o._x)(),v=(0,c.v9)(i.Y6),[D,x]=(0,n.useState)(null),y=e=>{x(e),m((0,J.Gu)("SEARCH_LOCATION_GENERAL_MODAL_MOBILE"))},O=u?.length&&u[0].type&&"recent_location_search"===u[0].type,j=u.map(((e,n)=>{const{type:c}=e;switch(c){case"current_location_search":return(0,h.jsx)(C,{ccID:a,searchOption:e},n);case"user_marketplace_location_search":return(0,h.jsx)(F,{},n);case"all_country_location_search":return(0,h.jsx)(p,{searchOption:e},n);case"recent_location_search":return(0,h.jsx)(U,{ccID:a,heading:s},n);case"location_filter":return(0,h.jsx)(M,{onSelect:r,searchOption:e,selectedLocations:d},n);case"area_location_search":case"district_location_search":case"estate_location_search":case"mrt_location_search":case"mtr_location_search":case"planning_area_location_search":case"sub_district_location_search":case"sub_zone_location_search":return(0,h.jsx)(T,{onClick:v?void 0:y,onMouseLeave:t,onMouseOver:_,searchOption:e},n);case"barangay_location_search":case"city_location_search":case"suburb_location_search":return null;default:return Sentry.captureMessage(`SearchLocationPickerGroup: Unsupported type: ${c}`),null}})).filter(Boolean);return 0===j.length?null:v?(0,h.jsxs)(h.Fragment,{children:[s&&!O&&(0,h.jsx)(l.Z,{className:H.header,color:b.urbanGrey50,size:"s",children:s}),j]}):(0,h.jsxs)("div",{className:q,children:[s&&!O&&(0,h.jsx)(l.Z,{color:b.urbanGrey60,size:"s",weight:"semibold",children:s}),j,D&&(0,h.jsx)(G.Z,{ccID:a||void 0,onSelect:r,searchOption:D,selectedLocations:d||void 0})]})}},1633:(e,a,s)=>{s.d(a,{Z:()=>D});var n=s(9),c=s.n(n),o=s(0),r=s(10),t=s(72),l=s(99),i=s(397),_=s(8),u=s(33),d=s(802),h=s(18),m=s(797),p=s(100),b=s(957),v=s(1);const D=({ccID:e,onSelect:a,searchParams:s,searchText:n,selectedLocations:D})=>{const x=(0,r.I0)(),y=(0,l._x)(),O=(0,r.v9)(_.Y6),j=(0,r.v9)(m.fA),g=s.reduce(((e,a)=>"key"in a&&"adm_ids"===a.key?[...e,...a.value.split(",").map(Number)]:e),[]),f=(0,p.y1)((a=>{x((0,m.hw)({admIDs:g,ccID:e,query:a}))}),300);(0,o.useEffect)((()=>{f(n)}),[f,n]);const I=e=>{const s=e.reduce(((e,{display_name:a})=>({...e,[a]:a in e?e[a]+1:1})),{});return e.map(((e,o)=>{const{id:r,display_ancestor_name:l,display_name:i}=e,_=s[i]>1;return(0,v.jsx)("div",{className:c()("D_aYI",O?null:(void 0).searchOption),children:(0,v.jsx)(d.Z,{variant:"checkbox",selected:!!D?.get(`${r}`),name:i,onChange:s=>{if(a){x((0,u.Vh)({name:"location_filter_search_result_tapped",type:"action"}));const n={...e,source:"search_result"};x((0,m.nb)({options:[n]})),a(s,n)}},children:(0,v.jsx)(t.Z,{singleline:!0,children:(0,v.jsxs)(v.Fragment,{children:[(0,b.SO)(i,n,{className:"D_aYK"}),_&&(h=l,(0,v.jsx)(t.Z,{className:"D_aYM",color:y.urbanGrey60,inline:!0,size:"xs",children:`${b.RN}${b.aZ}${b.RN}${h}`}))]})})})},`${r}${o}`);var h}))};return j?.length?(0,v.jsx)(v.Fragment,{children:j.map(((e,a)=>{const{adm_name:s,locations:n}=e;return(0,v.jsxs)(o.Fragment,{children:[s&&(0,v.jsx)(t.Z,{className:"D_aYJ",color:O?y.urbanGrey50:y.urbanGrey60,size:"s",weight:O?void 0:"semibold",children:s}),I(n)]},`${s}${a}`)}))}):(0,v.jsx)(t.Z,{className:"D_aYL",children:(0,v.jsx)(i.Z,{id:(0,h.ZP)("No results found")})})}},891:(e,a,s)=>{s.r(a),s.d(a,{colorSkyTeal20:()=>n,colorSkyTeal60:()=>c,colorUrbanGrey20:()=>o,colorUrbanGrey50Alpha:()=>r,colorWhite:()=>t,label:()=>l});var n="D_afJ",c="D_afK",o="D_afH",r="D_afI",t="D_afL",l="D_afG"},2210:(e,a,s)=>{s.r(a),s.d(a,{searchOption:()=>n});var n="D_btW"},2211:(e,a,s)=>{s.r(a),s.d(a,{container:()=>n});var n="D_buj"},2212:(e,a,s)=>{s.r(a),s.d(a,{searchOption:()=>n});var n="D_but"},2217:(e,a,s)=>{s.r(a),s.d(a,{header:()=>n});var n="D_aYW"},2214:(e,a,s)=>{s.r(a),s.d(a,{searchOption:()=>n});var n="D_buu"},2215:(e,a,s)=>{s.r(a),s.d(a,{header:()=>n,searchOption:()=>c});var n="D_bur",c="D_bus"},2216:(e,a,s)=>{s.r(a),s.d(a,{searchOption:()=>n});var n="D_buz"},1076:e=>{e.exports="https://mweb-cdn.karousell.com/build/clock-de0fb8af04.svg"},990:e=>{e.exports="https://mweb-cdn.karousell.com/build/location-marker-9c829f9033.svg"}}]);
|
|
//# sourceMappingURL=https://mdev.llesuorac.com/01857052a1fbff6c7926249973b6164fd2b19d8b/2b5e0b4c1597509d.min.js.map
|
|
//# debugId=d8587c24-c014-5b4e-bb01-ca3c3f8c5ab6
|