1import{aD as d}from"./main-m_sUF2N4.js";import{m}from"./hongKongDistricts--r8_jlh4.js";const A={lat:22.3193,lon:114.1694},E=48;function g(t,e="Search failed"){var n;if(!t)return e;if(typeof t=="string")return t;const r=t,i=r.errors||typeof r.message=="object"&&((n=r.message)==null?void 0:n.errors)||(Array.isArray(t)?t:null);if(Array.isArray(i)&&i.length>0){const o=i.map(s=>s==null?void 0:s.message).filter(s=>typeof s=="string"&&s.length>0);if(o.length>0)return o.join("; ")}return typeof r.message=="string"&&r.message.length>0&&r.message!=="[object Object]"?r.message:e}async function w(t,e,r={}){const i=r.fallback??"Search failed",n=new URLSearchParams;n.set("type",t);const o=e.location;(o==null?void 0:o.lat)!=null&&n.set("lat",String(o.lat)),(o==null?void 0:o.lon)!=null&&n.set("lon",String(o.lon));const s=(c,a)=>{if(!(a==null||a==="")){if(Array.isArray(a)){a.length&&n.set(c,a.map(String).join(","));return}if(typeof a=="boolean"){n.set(c,a?"true":"false");return}n.set(c,String(a))}};s("q",e.keyword),s("region",e.region),s("district",e.district),s("districts",e.districts),s("sort",e.sortMethod),s("is247",e.is247),s("verified",e.verified),s("fehdLicensed",e.fehdLicensed),s("petAccessArea",e.petAccessArea),s("petEntryPolicy",e.petEntryPolicy),s("includeDevListings",e.includeDevListings),s("limit",e.limit);const l=Array.isArray(e.nextToken)?e.nextToken[0]:e.nextToken;s("nextToken",l);try{const c=await fetch(`${await d()}/api/places/search?${n.toString()}`),a=await c.json().catch(()=>({}));if(!c.ok)throw new Error(a.error||i);return{items:a.items??[],total:a.total??0,nextToken:u(a.nextToken)}}catch(c){throw new Error(g(c,i))}}const h={å
æ:["å
æå"],å
æå:["å
æ"],èç£:["èç£å"],èç£å:["èç£"],屯é:["屯éå"],屯éå:["屯é"],大å:["大åå"],大åå:["大å"],æ²ç°:["æ²ç°å"],æ²ç°å:["æ²ç°"],西貢:["西貢å"],西貢å:["西貢"],深水å:["深水åå"],深水åå:["深水å"],ä¹é¾å:["ä¹é¾åå"],ä¹é¾åå:["ä¹é¾å"],è§å¡:["è§å¡å"],è§å¡å:["è§å¡"],é»å¤§ä»:["é»å¤§ä»å"],é»å¤§ä»å:["é»å¤§ä»"],ç£ä»:["ç£ä»å"],ç£ä»å:["ç£ä»"],é¢å³¶:["é¢å³¶å"],é¢å³¶å:["é¢å³¶"]};function p(t){if(!(t!=null&&t.length))return[];const e=new Set;for(const r of t){const i=r==null?void 0:r.trim();if(!i)continue;e.add(i);const n=h[i];if(n)for(const o of n)e.add(o)}return Array.from(e)}function x(t,e){const r=[...e.districts||[],...e.district?[e.district]:[]],i=p(r);if(i.length>1){t.districts=i;return}const n=i[0];if(n){t.district=n;return}e.region&&e.region!=="All"&&(t.region=e.region)}function I(t){if(!t||t==="all")return;const e=m(t);if(!(!e||e==="Others"))return e}function u(t){if(!t||!Array.isArray(t)||t.length===0)return null;const e=t.filter(r=>typeof r=="number"||typeof r=="string"&&!isNaN(parseFloat(r))).map(r=>typeof r=="string"?parseFloat(r):r);return e.length>0?e:null}function L(t){return u(t)??void 0}function y(t){const e=new Set;return t.filter(r=>e.has(r.id)?!1:(e.add(r.id),!0))}function N(t){return y(t.flat())}function T(t){if(t.length<2)return!1;const e=t[t.length-1],r=new Set(t[t.length-2].items.map(n=>n.id)),i=e.items.map(n=>n.id);return i.length>0&&i.every(n=>r.has(n))}function f(t,e=Date.now()){if(!t||!String(t.ownerSub||"").trim()||t.partnerPlan!=="PREMIUM")return!1;const r=t.partnerPlanExpiresAt;if(r){const i=Date.parse(r);if(!Number.isNaN(i)&&i<=e)return!1}return!0}function k(t,e=Date.now()){const r=[],i=[];for(const n of t)f(n,e)?r.push(n):i.push(n);return[...r,...i]}function D(t,e,r,i=Date.now()){const n=r(t.filter(s=>f(s,i))),o=r(t.filter(s=>!f(s,i)));return[...n,...o].slice(0,e)}const F="dynamo";export{A as H,E as P,x as a,F as b,I as c,N as d,p as e,L as g,T as h,f as i,u as n,D as p,w as r,k as s};
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.