PageSourceSearch

https://holidaythai.com/assets/InternationalTravel-DplKzdAk.js

js holidaythai.com collected 2026-10-02 13:53:18 UTC 16,128 bytes, 8 lines download raw bytes

1import{j as e,o as l,l as N,r as m,a as y,S as X,I as J,B as t,X as W,L as Y,b as Z,h as n,T as ee,p as se,q as k,G as L,v as S,M as q,w as z,c as F,g as T,s as A}from"./index-LAef4FAh.js";import{F as ae}from"./filter-DAm06hlt.js";import{G as I}from"./grid-3x3-iDLNX0py.js";import{L as K}from"./list-BWf8knBB.js";function B({viewMode:i="grid"}){return e.jsxs("div",{className:l("bg-card rounded-lg sm:rounded-xl overflow-hidden border border-border",i==="list"&&"flex items-center gap-3 sm:gap-4"),children:[e.jsx(N,{className:l(i==="grid"?"aspect-[4/3] w-full":"w-20 h-20 sm:w-24 sm:h-24 flex-shrink-0")}),e.jsxs("div",{className:l("p-3 sm:p-4",i==="list"&&"flex-1"),children:[e.jsx(N,{className:"h-4 sm:h-5 w-3/4 mb-1.5 sm:mb-2"}),e.jsx(N,{className:"h-3.5 sm:h-4 w-1/2 mb-1.5 sm:mb-2"}),e.jsx(N,{className:"h-4 sm:h-5 w-14 sm:w-16 rounded-full"})]})]})}const P=[{id:"all",label:"ทุกทวีป"},{id:"เอเชีย",label:"เอเชีย"},{id:"ยุโรป",label:"ยุโรป"},{id:"อเมริกาเหนือ",label:"อเมริกาเหนือ"},{id:"อเมริกาใต้",label:"อเมริกาใต้"},{id:"แอฟริกา",label:"แอฟริกา"},{id:"โอเชียเนีย",label:"โอเชียเนีย"}];function ne(){const[i,M]=m.useState(""),[x,b]=m.useState("all"),[d,f]=m.useState("all"),[a,p]=m.useState("grid"),[G,$]=m.useState(!1),[o,H]=m.useState("countries"),{data:c,isLoading:R}=y({queryKey:["international-countries"],queryFn:async()=>{const{data:s,error:r}=await A.from("countries").select("id, short_id, name_th, name_en, slug, code, continent, hero_image_url, summary_th, is_featured").neq("code","TH").eq("status","published").order("is_featured",{ascending:!1}).order("sort_order",{ascending:!0}).order("name_th",{ascending:!0});if(r)throw r;return s}}),{data:u,isLoading:V}=y({queryKey:["international-provinces-states"],queryFn:async()=>{const{data:s,error:r}=await A.from("provinces_states").select(`
2          id, short_id, name_th, name_en, slug, type, hero_image_url, is_featured,
3          countries!inner(name_th, code, short_id)
4        `).neq("countries.code","TH").eq("status","published").order("is_featured",{ascending:!1}).order("sort_order",{ascending:!0});if(r)throw r;return s}}),{data:g,isLoading:D}=y({queryKey:["international-cities-list"],queryFn:async()=>{const{data:s,error:r}=await A.from("international_cities").select(`
5          id, short_id, name_th, name_en, slug, hero_image_url, is_featured,
6          countries(name_th, code, short_id),
7          provinces_states(name_th, short_id)
8        `).eq("status","published").order("is_featured",{ascending:!1}).order("sort_order",{ascending:!0});if(r)throw r;return s}}),w=m.useMemo(()=>c?c.filter(s=>{var h;const r=s.name_th.toLowerCase().includes(i.toLowerCase())||((h=s.name_en)==null?void 0:h.toLowerCase().includes(i.toLowerCase())),j=x==="all"||s.continent===x;return r&&j}):[],[c,i,x]),_=m.useMemo(()=>u?u.filter(s=>{var h;const r=s.name_th.toLowerCase().includes(i.toLowerCase())||((h=s.name_en)==null?void 0:h.toLowerCase().includes(i.toLowerCase())),j=d==="all"||s.countries.code===d;return r&&j}):[],[u,i,d]),C=m.useMemo(()=>g?g.filter(s=>{var h,E;const r=s.name_th.toLowerCase().includes(i.toLowerCase())||((h=s.name_en)==null?void 0:h.toLowerCase().includes(i.toLowerCase())),j=d==="all"||((E=s.countries)==null?void 0:E.code)===d;return r&&j}):[],[g,i,d]),v=()=>{M(""),b("all"),f("all")},O=i||x!=="all"||d!=="all",Q=()=>o==="countries"?w.length:o==="provinces"?_.length:C.length,U=e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 items-center",children:[e.jsxs("div",{className:"relative w-full lg:max-w-md",children:[e.jsx(X,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground"}),e.jsx(J,{type:"text",placeholder:o==="countries"?"ค้นหาประเทศ...":o==="provinces"?"ค้นหาจังหวัด/รัฐ...":"ค้นหาเมือง...",value:i,onChange:s=>M(s.target.value),className:"pl-12 pr-4 h-11 rounded-full border-2 focus:border-primary bg-card"})]}),o==="countries"&&e.jsx("div",{className:"hidden lg:flex flex-wrap gap-2",children:P.slice(0,5).map(s=>e.jsx(t,{variant:x===s.id?"default":"outline",size:"sm",onClick:()=>b(s.id),className:"rounded-full",children:s.label},s.id))}),(o==="provinces"||o==="cities")&&c&&e.jsxs("div",{className:"hidden lg:flex flex-wrap gap-2",children:[e.jsx(t,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>f("all"),className:"rounded-full",children:"ทุกประเทศ"}),c.slice(0,5).map(s=>e.jsx(t,{variant:d===s.code?"default":"outline",size:"sm",onClick:()=>f(s.code),className:"rounded-full",children:s.name_th},s.id))]}),e.jsxs(t,{variant:"outline",size:"sm",onClick:()=>$(!G),className:"lg:hidden rounded-full",children:[e.jsx(ae,{className:"h-4 w-4 mr-2"}),"ตัวกรอง"]}),O&&e.jsxs(t,{variant:"ghost",size:"sm",onClick:v,className:"rounded-full",children:[e.jsx(W,{className:"h-4 w-4 mr-1"}),"ล้าง"]}),e.jsxs("div",{className:"hidden lg:flex border border-border rounded-lg overflow-hidden ml-auto",children:[e.jsx(t,{variant:a==="grid"?"secondary":"ghost",size:"icon",className:"rounded-none h-9 w-9",onClick:()=>p("grid"),children:e.jsx(I,{className:"h-4 w-4"})}),e.jsx(t,{variant:a==="list"?"secondary":"ghost",size:"icon",className:"rounded-none h-9 w-9",onClick:()=>p("list"),children:e.jsx(K,{className:"h-4 w-4"})})]})]});return e.jsxs(Y,{searchBar:U,children:[e.jsx(Z,{title:"เที่ยวต่างประเทศ - ประเทศ เมือง สถานที่ท่องเที่ยวยอดนิยม 2026",description:"ค้นพบประเทศ เมือง และสถานที่ท่องเที่ยวยอดนิยมทั่วโลก ญี่ปุ่น เกาหลี สิงคโปร์ ข้อมูลท่องเที่ยว ที่พัก อัพเดท 2026",keywords:"เที่ยวต่างประเทศ,ท่องเที่ยวต่างประเทศ,ญี่ปุ่น,เกาหลี,สิงคโปร์"}),e.jsx("section",{className:"relative py-12 md:py-16 bg-gradient-to-br from-ocean-light via-background to-primary-light",children:e.jsx("div",{className:"container-wide",children:e.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[e.jsx(n,{variant:"secondary",className:"mb-4",children:"✈️ เที่ยวต่างประเทศ"}),e.jsx("h1",{className:"font-display text-3xl md:text-5xl font-bold text-foreground mb-4",children:"ค้นพบโลกกว้าง"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:"ค้นหาประเทศ จังหวัด/รัฐ และเมืองยอดนิยมจากทั่วโลก พร้อมข้อมูลการท่องเที่ยว"})]})})}),G&&e.jsxs("div",{className:"lg:hidden px-4 py-4 bg-muted border-b border-border",children:[o==="countries"&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"font-medium mb-3",children:"ทวีป"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:P.map(s=>e.jsx(t,{variant:x===s.id?"default":"outline",size:"sm",onClick:()=>b(s.id),children:s.label},s.id))})]}),(o==="provinces"||o==="cities")&&c&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"font-medium mb-3",children:"ประเทศ"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(t,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>f("all"),children:"ทุกประเทศ"}),c.map(s=>e.jsx(t,{variant:d===s.code?"default":"outline",size:"sm",onClick:()=>f(s.code),children:s.name_th},s.id))]})]})]}),e.jsx("section",{className:"py-8 md:py-12",children:e.jsx("div",{className:"container-wide",children:e.jsxs(ee,{value:o,onValueChange:H,className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs(se,{className:"grid w-full md:w-auto grid-cols-3",children:[e.jsxs(k,{value:"countries",className:"gap-2",children:[e.jsx(L,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"ประเทศ"}),e.jsx(n,{variant:"secondary",className:"ml-1",children:(c==null?void 0:c.length)||0})]}),e.jsxs(k,{value:"provinces",className:"gap-2",children:[e.jsx(S,{className:"h-4 w-4"}
8),e.jsx("span",{className:"hidden sm:inline",children:"จังหวัด/รัฐ"}),e.jsx(n,{variant:"secondary",className:"ml-1",children:(u==null?void 0:u.length)||0})]}),e.jsxs(k,{value:"cities",className:"gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"เมือง"}),e.jsx(n,{variant:"secondary",className:"ml-1",children:(g==null?void 0:g.length)||0})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground",children:["พบ ",Q()," รายการ"]}),e.jsxs("div",{className:"lg:hidden flex border border-border rounded-lg overflow-hidden",children:[e.jsx(t,{variant:a==="grid"?"secondary":"ghost",size:"icon",className:"rounded-none h-8 w-8",onClick:()=>p("grid"),children:e.jsx(I,{className:"h-4 w-4"})}),e.jsx(t,{variant:a==="list"?"secondary":"ghost",size:"icon",className:"rounded-none h-8 w-8",onClick:()=>p("list"),children:e.jsx(K,{className:"h-4 w-4"})})]})]})]}),e.jsx(z,{value:"countries",children:R?e.jsx("div",{className:l(a==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6":"space-y-4"),children:Array.from({length:8}).map((s,r)=>e.jsx(B,{viewMode:a},r))}):w.length===0?e.jsxs("div",{className:"text-center py-24",children:[e.jsx(L,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-foreground mb-2",children:"ไม่พบประเทศ"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"ลองเปลี่ยนคำค้นหาหรือตัวกรอง"}),e.jsx(t,{variant:"outline",onClick:v,children:"ล้างตัวกรอง"})]}):e.jsx("div",{className:l(a==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6":"space-y-4"),children:w.map(s=>e.jsxs(F,{to:`/countries/${s.short_id}`,className:l("group block bg-card rounded-xl overflow-hidden border border-border hover:shadow-card-hover transition-all duration-300",a==="list"&&"flex items-center gap-4"),children:[e.jsxs("div",{className:l("relative overflow-hidden",a==="grid"?"aspect-[4/3]":"w-24 h-24 flex-shrink-0"),children:[s.hero_image_url?e.jsx("img",{src:T(s.hero_image_url),alt:s.name_th,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:e.jsx(L,{className:"h-8 w-8 text-muted-foreground"})}),s.is_featured&&a==="grid"&&e.jsx(n,{className:"absolute top-3 left-3 bg-primary",children:"แนะนำ"})]}),e.jsxs("div",{className:l("p-4",a==="list"&&"flex-1"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-display font-semibold text-foreground group-hover:text-primary transition-colors",children:s.name_th}),e.jsx(n,{variant:"outline",className:"text-xs",children:s.code})]}),s.name_en&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.name_en}),s.continent&&e.jsx(n,{variant:"secondary",className:"mt-2 text-xs",children:s.continent}),s.summary_th&&a==="list"&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-1",children:s.summary_th})]})]},s.id))})}),e.jsx(z,{value:"provinces",children:V?e.jsx("div",{className:l(a==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6":"space-y-4"),children:Array.from({length:8}).map((s,r)=>e.jsx(B,{viewMode:a},r))}):_.length===0?e.jsxs("div",{className:"text-center py-24",children:[e.jsx(S,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-foreground mb-2",children:"ไม่พบจังหวัด/รัฐ"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"ลองเปลี่ยนคำค้นหาหรือตัวกรอง"}),e.jsx(t,{variant:"outline",onClick:v,children:"ล้างตัวกรอง"})]}):e.jsx("div",{className:l(a==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6":"space-y-4"),children:_.map(s=>e.jsxs(F,{to:`/cities/${s.short_id}`,className:l("group block bg-card rounded-xl overflow-hidden border border-border hover:shadow-card-hover transition-all duration-300",a==="list"&&"flex items-center gap-4"),children:[e.jsxs("div",{className:l("relative overflow-hidden",a==="grid"?"aspect-[4/3]":"w-24 h-24 flex-shrink-0"),children:[s.hero_image_url?e.jsx("img",{src:T(s.hero_image_url),alt:s.name_th,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:e.jsx(S,{className:"h-8 w-8 text-muted-foreground"})}),s.is_featured&&a==="grid"&&e.jsx(n,{className:"absolute top-3 left-3 bg-primary",children:"แนะนำ"})]}),e.jsxs("div",{className:l("p-4",a==="list"&&"flex-1"),children:[e.jsx("h3",{className:"font-display font-semibold text-foreground group-hover:text-primary transition-colors",children:s.name_th}),s.name_en&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.name_en}),e.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[e.jsx(n,{variant:"secondary",className:"text-xs",children:s.countries.name_th}),s.type&&e.jsx(n,{variant:"outline",className:"text-xs",children:s.type})]})]})]},s.id))})}),e.jsx(z,{value:"cities",children:D?e.jsx("div",{className:l(a==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6":"space-y-4"),children:Array.from({length:8}).map((s,r)=>e.jsx(B,{viewMode:a},r))}):C.length===0?e.jsxs("div",{className:"text-center py-24",children:[e.jsx(q,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-medium text-foreground mb-2",children:"ไม่พบเมือง"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"ลองเปลี่ยนคำค้นหาหรือตัวกรอง"}),e.jsx(t,{variant:"outline",onClick:v,children:"ล้างตัวกรอง"})]}):e.jsx("div",{className:l(a==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6":"space-y-4"),children:C.map(s=>e.jsxs(F,{to:`/international-cities/${s.short_id}`,className:l("group block bg-card rounded-xl overflow-hidden border border-border hover:shadow-card-hover transition-all duration-300",a==="list"&&"flex items-center gap-4"),children:[e.jsxs("div",{className:l("relative overflow-hidden",a==="grid"?"aspect-[4/3]":"w-24 h-24 flex-shrink-0"),children:[s.hero_image_url?e.jsx("img",{src:T(s.hero_image_url),alt:s.name_th,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):e.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:e.jsx(q,{className:"h-8 w-8 text-muted-foreground"})}),s.is_featured&&a==="grid"&&e.jsx(n,{className:"absolute top-3 left-3 bg-primary",children:"แนะนำ"})]}),e.jsxs("div",{className:l("p-4",a==="list"&&"flex-1"),children:[e.jsx("h3",{className:"font-display font-semibold text-foreground group-hover:text-primary transition-colors",children:s.name_th}),s.name_en&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.name_en}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[s.countries&&e.jsx(n,{variant:"secondary",className:"text-xs",children:s.countries.name_th}),s.provinces_states&&e.jsx(n,{variant:"outline",className:"text-xs",children:s.provinces_states.name_th})]})]})]},s.id))})})]})})})]})}export{ne as default};

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.