PageSourceSearch

https://advisor.pirate.travel/js/AdvisorTripPreviewPage-BgoQGg3M.js

js pirate.travel collected 2026-10-09 04:51:18 UTC 3,022 bytes, 1 lines download raw bytes

1import{j as e}from"./chunk-Cl_8PWDN.js";import{f as b,g as j,r,L as y}from"./chunk-Bzo9Tunx.js";import{R as N,u as k,v as $}from"./chunk-mAyixyGg.js";function S(){const{tripId:t=""}=b(),c=j(),i=r.useRef(null),[n,p]=r.useState("fit"),[o,a]=r.useState("loading"),[m,w]=r.useState(0),u=c.state?.returnTo,f=c.pathname.startsWith("/_dev/trips/")?"/_dev/trips":"/trips",h=u?.startsWith(`${f}/${t}/`)?u:`${f}/${t}/overview`;r.useEffect(()=>{const s=l=>{if(l.origin!==window.location.origin||l.source!==i.current?.contentWindow)return;const d=l.data;d.tripId===t&&(d.type==="portal-preview:ready"&&a("ready"),d.type==="portal-preview:error"&&a("error"))};return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[t]),r.useEffect(()=>{if(o!=="loading")return;const s=window.setTimeout(()=>a("error"),12e3);return()=>window.clearTimeout(s)},[m,o]);const v=()=>{a("loading"),i.current?.contentWindow?.postMessage({type:"portal-preview:refresh",tripId:t},window.location.origin)},g=()=>{a("loading"),w(s=>s+1)};return e.jsxs("div",{className:"advisor flex h-screen flex-col bg-stone-200","data-app-surface":"advisor",children:[e.jsxs("header",{className:"z-10 flex flex-wrap items-center gap-3 border-b border-stone-300 bg-[#f5f0e7] px-4 py-3 shadow-sm md:px-8",children:[e.jsx(y,{to:h,className:"advisor-action-secondary",children:"← Back to editing"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("strong",{className:"block text-sm text-stone-900",children:"Advisor preview"}),e.jsx("span",{className:"text-xs text-stone-500",children:"Saved client-facing content · interactions disabled"})]}),o==="error"?e.jsx("button",{type:"button",className:"advisor-action-secondary",onClick:g,children:"Retry"}):null,e.jsxs("button",{type:"button",className:"advisor-action-secondary gap-2",onClick:v,disabled:o==="loading",children:[e.jsx(N,{className:`size-4 motion-reduce:animate-none ${o==="loading"?"animate-spin":""}`,"aria-hidden":"true"})," Refresh"]}),e.jsxs("div",{className:"flex border border-stone-400",role:"group","aria-label":"Preview width",children:[e.jsx(x,{active:n==="fit",onClick:()=>p("fit"),icon:e.jsx(k,{className:"size-4"}),label:"Fit"}),e.jsx(x,{active:n==="phone",onClick:()=>p("phone"),icon:e.jsx($,{className:"size-4"}),label:"Phone"})]})]}),e.jsx("main",{className:"min-h-0 flex-1 overflow-hidden p-3 [container-type:inline-size] md:p-5",children:e.jsx("div",{className:`mx-auto h-full overflow-hidden bg-white shadow-xl transition-[width] motion-reduce:transition-none ${n==="phone"?"w-[min(390px,100cqi)]":"w-full"}`,children:e.jsx("iframe",{ref:i,title:"Client trip page preview",src:`/portal/preview/${t}`,className:"h-full w-full border-0"},m)})})]})}function x({active:t,onClick:c,icon:i,label:n}){return e.jsxs("button",{type:"button","aria-pressed":t,onClick:c,className:`flex min-h-10 items-center gap-2 px-3 text-xs font-bold uppercase tracking-wider ${t?"bg-stone-900 text-white":"bg-transparent text-stone-700"}`,children:[i,n]})}export{S 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.