PageSourceSearch

https://travwiz.ai/_next/static/chunks/pages/trips/destinations/[id]-192b59a49b6092b5.js

js travwiz.ai collected 2026-10-05 13:09:43 UTC 6,134 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2814],{1804:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/trips/destinations/[id]",function(){return s(4622)}])},4622:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>p});var o=s(7876),a=s(4232),i=s(9099),r=s(5463),n=s(4849),l=s(4795),c=s(7860),d=s(9661),u=s(2963),g=s(9038),_=s(2169);let p=(0,c.A)(()=>{let e=(0,i.useRouter)(),{id:t}=e.query,[s,c]=(0,a.useState)([]),[p,m]=(0,a.useState)(!0),[y,h]=(0,a.useState)(null),[f,v]=(0,a.useState)(""),[x,b]=(0,a.useState)({}),[w,j]=(0,a.useState)(!1),[N,A]=(0,a.useState)("development"),[E,S]=(0,a.useState)("");(0,a.useEffect)(()=>{A("prod");let e=localStorage.getItem("posthog_distinct_id");e&&S(e)},[]),(0,a.useEffect)(()=>{if(!e.isReady||!t)return void console.log("Router not ready or destId not available, skipping fetch");console.log("Router state:",{isReady:e.isReady,destId:t}),(async()=>{console.log("Starting fetchTrips function with destId:",t),m(!0),h(null);try{let e,s=Array.isArray(t)?t[0]:t;console.log("Using destination slug for API call:",s,"type:",typeof s);let o=new URLSearchParams;x.coverage_style&&o.append("coverage_style",x.coverage_style),x.cost_tier&&o.append("cost_tier",x.cost_tier),x.num_days&&o.append("num_days",x.num_days.toString());let a=o.toString()?"?".concat(o.toString()):"",i="/api/system/trips/destination/".concat(s).concat(a);console.log("Fetching trips from: ".concat(i)),console.log("Destination slug type:",typeof s),console.log("About to call authenticatedFetch with full URL...");try{if(e=await (0,d.Ud)(i),console.log("Fetch response status:",e.status),!e.ok)throw console.error("API error: ".concat(e.status," ").concat(e.statusText)),Error("Failed to fetch trips: ".concat(e.statusText))}catch(e){if(e instanceof Error&&"AuthRequiredError"===e.name){console.log("Authentication error detected - modal will be shown by HOC"),m(!1);return}throw e}let r=await e.json();console.log("API response data type:",Array.isArray(r)?"array":typeof r),console.log("API response data:",r);let n=Array.isArray(r)?r:r.trips||[],l=n.map(e=>{var t;return{id:e.id,slug:e.slug||e.id,name:e.name,num_days:e.num_days,cover_pic_url:e.cover_pic_url,destination:e.destination?{cover_pic_url:e.destination.cover_pic_url,name:e.destination.name}:void 0,cover_image:e.cover_image_url||e.cover_pic_url||(null==(t=e.destination)?void 0:t.cover_pic_url),source:e.source||"SYSTEM",coverage_style:e.coverage_style,cost_tier:e.cost_tier,destination_name:e.destination_name,data_origin:e.data_origin,content_status:e.content_status,ai_generation_id:e.ai_generation_id}});c(l),n.length>0&&n[0].destination_name&&v(n[0].destination_name)}catch(e){console.error("Error in fetchTrips function:",e),h("Failed to fetch trips: ".concat(e.message||"Unknown error"))}finally{console.log("fetchTrips function completed"),m(!1)}})()},[e.isReady,t,x]);let C=(e,o)=>{b(t=>({...t,[e]:o})),void 0!==o&&(0,u.r)("engagement_filter_applied",{destination_id:t,destination_name:f,filter_type:e,filter_value:o,results_count:s.length})};return(0,o.jsxs)("div",{className:"h-screen bg-gradient-to-b from-blue-50 to-white flex flex-col overflow-hidden",children:[(0,o.jsx)(r.A,{title:"".concat(f||"Destination"," Trips | TravWiz")}),(0,o.jsx)(n.A,{}),(0,o.jsx)("main",{className:"flex flex-col items-center w-full px-4 pt-2 flex-1 overflow-hidden",children:(0,o.jsxs)("div",{className:"w-full max-w-3xl flex-1 flex flex-col bg-white rounded-lg shadow-md overflow-hidden border border-gray-100",children:[(0,o.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white",children:(0,o.jsx)("h1",{className:"text-xl font-bold text-gray-800",children:f?"Trips in ".concat(f):"Loading destination..."})}),(0,o.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white",children:(0,o.jsxs)("div",{className:"flex justify-between items-center",children:[(0,o.jsxs)("button",{onClick:()=>j(!w),className:"px-3 py-1 bg-gray-100 text-gray-700 rounded-md flex items-center text-sm",children:[(0,o.jsx)(g.YsJ,{className:"mr-1",size:12}),w?"Hide Filters":"Show Filters"]}),Object.keys(x).length>0&&(0,o.jsxs)("button",{onClick:()=>{b({})},className:"px-3 py-1 bg-red-50 text-red-600 rounded-md flex items-center text-sm",children:[(0,o.jsx)(g.QCr,{className:"mr-1",size:12}),"Clear All"]})]})}),w&&(0,o.jsx)("div",{className:"p-3 border-b border-gray-200 bg-gray-50",children:(0,o.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,o.jsx)(_.A,{title:"Days",options:[1,2,3,4,5,7,10,14].map(e=>({value:e.toString(),label:"".concat(e," ").concat(1===e?"day":"days")})),selectedValues:x.num_days?[x.num_days.toString()]:[],onChange:e=>C("num_days",x.num_days===parseInt(e)?void 0:parseInt(e)),initialVisibleCount:3}),(0,o.jsx)(_.A,{title:"Coverage",options:[{value:"ESSENTIAL",label:"Essential"},{value:"BUCKET_LIST",label:"Bucket List"},{value:"LOCAL_EXPERIENCE",label:"Local Experience"}],selectedValues:x.coverage_style?[x.coverage_style]:[],onChange:e=>C("coverage_style",x.coverage_style===e?void 0:e),initialVisibleCount:3}),(0,o.jsx)(_.A,{title:"Cost",options:[{value:"BUDGET",label:"Budget"}
1,{value:"MIDRANGE",label:"Midrange"},{value:"LUXURY",label:"Luxury"}],selectedValues:x.cost_tier?[x.cost_tier]:[],onChange:e=>C("cost_tier",x.cost_tier===e?void 0:e),initialVisibleCount:3})]})}),(0,o.jsx)("div",{className:"p-3 flex-1 overflow-y-auto bg-white border-t border-gray-100",children:(0,o.jsx)(l.A,{title:"",items:s.map(e=>({...e,name:(e.num_days||0)>5?"".concat(e.name," \uD83C\uDF06"):e.name})),loading:p,error:y,onSelectItem:s=>{(0,u.r)("page_trip_card_viewed",{trip_id:s.id,trip_name:s.name,destination_id:t,destination_name:f});let o="/trips/destinations/".concat(t),a=f?"&destination=".concat(encodeURIComponent(f)):"";e.push("/trip/".concat(s.id,"?from=").concat(encodeURIComponent(o)).concat(a))},emptyMessage:Object.keys(x).length>0?"No trips match your filters. Try adjusting your criteria.":"No trips found for this destination.",gridClassName:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 pb-2"})})]})})]})})}},e=>{e.O(0,[4795,8825,4849,7213,636,6593,8792],()=>e(e.s=1804)),_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.