PageSourceSearch

https://petwellhk.com/assets/HomePromoPopups-CvK0ytwZ.js

js petwellhk.com collected 2026-10-06 05:23:47 UTC 6,358 bytes, 1 lines download raw bytes

1import{n as K,g as S,r as s,j as t,L as Y}from"./react-vendor-BDHNqS4B.js";import{u as j,D as b,j as N,l as v,m as A}from"./main-m_sUF2N4.js";import{M as G}from"./midAutumnFestival2026-GVaMxjdF.js";import{C as W}from"./chevron-left-Jw0Ezjn9.js";import{C as V,A as U}from"./chevron-right-CpkQxGj-.js";import"./amplify-DYDcjoow.js";import"./query-7-WHkg5t.js";const T=Date.parse("2026-09-27T16:00:00.000Z");function F(a=Date.now()){return a>=T}function w(a=Date.now()){return a<T}const X="/assets/festival-hero-poster-ClUVe9Zl.jpg",Z="/assets/festival-guide-poster-DGiQV1J3.jpg",E="petwell:midAutumnDailyPopup:lastShown:v1",B=350,J=1080,Q=1350,D=12,h=[{src:X,altKey:"midAutumnDailyPopup.page1Alt"},{src:Z,altKey:"midAutumnDailyPopup.page2Alt"}];function M(a=new Date){const n=a.getFullYear(),l=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return`${n}-${l}-${c}`}function q(){try{return localStorage.getItem(E)===M()}catch{return!0}}function x(){try{localStorage.setItem(E,M())}catch{}}function z(a){return a==="/"}const tt=({ready:a=!1})=>{const{t:n}=j(),l=K(),{pathname:c}=S(),[u,m]=s.useState(!1),[r,d]=s.useState(0),g=s.useRef(null),i=s.useRef(null);s.useEffect(()=>{if(!a||!z(c)||!w()||q()){m(!1);return}const e=window.setTimeout(()=>{x(),d(0),m(!0)},B);return()=>window.clearTimeout(e)},[a,c]),s.useEffect(()=>{if(!u)return;const e=g.current;e&&(e.scrollLeft=0)},[u]);const _=e=>{e||x(),m(e)},y=s.useCallback(e=>{const o=g.current,p=Math.max(0,Math.min(h.length-1,e));d(p),o&&o.scrollTo({left:p*o.clientWidth,behavior:"smooth"})},[]),R=s.useCallback(e=>{const{scrollLeft:o,clientWidth:p}=e.currentTarget;if(!p)return;const f=Math.round(o/p);d(Math.max(0,Math.min(h.length-1,f)))},[]),O=()=>{_(!1),l(G)},$=e=>{e.button===0&&(i.current={x:e.clientX,y:e.clientY,moved:!1})},H=e=>{const o=i.current;if(!o||o.moved)return;const p=Math.abs(e.clientX-o.x),f=Math.abs(e.clientY-o.y);(p>D||f>D)&&(o.moved=!0)},L=()=>{const e=i.current;i.current=null,!(!e||e.moved)&&O()},I=()=>{i.current=null};return s.useEffect(()=>{if(!u)return;const e=o=>{o.key==="ArrowLeft"&&(o.preventDefault(),y(r-1)),o.key==="ArrowRight"&&(o.preventDefault(),y(r+1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[u,r,y]),w()?t.jsx(b,{open:u,onOpenChange:_,children:t.jsxs(N,{className:"mid-autumn-daily-popup border-0 bg-transparent p-0 gap-0 overflow-visible shadow-none w-auto max-w-none sm:max-w-none","aria-describedby":"mid-autumn-daily-popup-desc",children:[t.jsx(v,{className:"sr-only",children:n("midAutumnDailyPopup.title")}),t.jsx(A,{id:"mid-autumn-daily-popup-desc",className:"sr-only",children:n("midAutumnDailyPopup.description")}),t.jsxs("div",{className:"mid-autumn-daily-popup__card",children:[t.jsx("div",{ref:g,className:"mid-autumn-daily-popup__track",onScroll:R,onPointerDown:$,onPointerMove:H,onPointerUp:L,onPointerCancel:I,children:h.map(e=>t.jsx("div",{className:"mid-autumn-daily-popup__page",role:"group",children:t.jsx("img",{src:e.src,alt:n(e.altKey),className:"mid-autumn-daily-popup__img",width:J,height:Q,decoding:"async",draggable:!1})},e.src))}),r>0&&t.jsx("button",{type:"button",className:"mid-autumn-daily-popup__nav mid-autumn-daily-popup__nav--prev","aria-label":n("midAutumnDailyPopup.prev",{defaultValue:"上一張"}),onClick:()=>y(r-1),children:t.jsx(W,{className:"h-5 w-5","aria-hidden":!0})}),r<h.length-1&&t.jsx("button",{type:"button",className:"mid-autumn-daily-popup__nav mid-autumn-daily-popup__nav--next","aria-label":n("midAutumnDailyPopup.next",{defaultValue:"下一張"}),onClick:()=>y(r+1),children:t.jsx(V,{className:"h-5 w-5","aria-hidden":!0})}),t.jsx("div",{className:"mid-autumn-daily-popup__dots",role:"tablist","aria-label":n("midAutumnDailyPopup.title"),children:h.map((e,o)=>t.jsx("button",{type:"button",role:"tab","aria-selected":r===o,"aria-label":`${o+1} / ${h.length}`,className:r===o?"mid-autumn-daily-popup__dot mid-autumn-daily-popup__dot--on":"mid-autumn-daily-popup__dot",onClick:()=>y(o)},e.src))})]})]})}):null},et="/assets/paws-port-promo-Bra-kcj-.png",C="petwell:nametagDailyPopup:lastShown:v1",at=900;function k(a=new Date){const n=a.getFullYear(),l=String(a.getMonth()+1).padStart(2,"0"),c=String(a.getDate()).padStart(2,"0");return`${n}-${l}-${c}`}function nt(){try{return localStorage.getItem(C)===k()}catch{return!0}}function P(){try{localStorage.setItem(C,k())}catch{}}function ot(a){return a==="/"}const st=({onSettled:a})=>{const{t:n}=j(),{pathname:l}=S(),[c,u]=s.useState(!1),m=s.useRef(!1),r=s.useRef(a);r.current=a;const d=()=>{var i;m.current||(m.current=!0,(i=r.current)==null||i.call(r))};s.useEffect(()=>{if(!F()||!ot(l)||nt()){u(!1),d();return}const i=window.setTimeout(()=>{P(),u(!0)},at);return()=>window.clearTimeout(i)},[l]);const g=i=>{i||(P(),d()),u(i)};return t.jsx(b,{open:c,onOpenChange:g,children:t.jsx(N,{className:"nametag-daily-popup border-0 bg-transparent p-0 gap-0 overflow-visible shadow-none sm:rounded-[1.25rem] sm:max-w-[22.5rem]","aria-describedby":"nametag-daily-popup-desc",children:t.jsxs("div",{className:"nametag-daily-popup__shell",children:[t.jsx("div",{className:"nametag-daily-popup__art",children:t.jsx("img",{src:et,alt:n("nametagDailyPopup.imageAlt"),className:"nametag-daily-popup__img",width:1080,height:1350,decoding:"async"})}),t.jsxs("div",{className:"nametag-daily-popup__body",children:[t.jsx("p",{className:"nametag-daily-popup__eyebrow",children:n("nametagDailyPopup.eyebrow")}),t.jsx(v,{className:"nametag-daily-popup__title",children:n("nametagDailyPopup.title")}),t.jsxs(A,{id:"nametag-daily-popup-desc",className:"sr-only",children:[n("nametagDailyPopup.tagline")," ",n("nametagDailyPopup.time")," ",n("nametagDailyPopup.urgency")]}),t.jsx("p",{className:"nametag-daily-popup__tagline",children:n("nametagDailyPopup.tagline")}),t.jsx("p",{className:"nametag-daily-popup__time",children:n("nametagDailyPopup.time")}
1),t.jsx("p",{className:"nametag-daily-popup__urgency",children:n("nametagDailyPopup.urgency")}),t.jsxs(Y,{to:"/anti-lost-dog-tag-hk",className:"nametag-daily-popup__cta",onClick:()=>g(!1),children:[n("nametagDailyPopup.cta"),t.jsx(U,{className:"h-4 w-4","aria-hidden":!0})]})]})]})})})},dt=()=>{const[a,n]=s.useState(!1),l=s.useCallback(()=>{n(!0)},[]);return t.jsxs(t.Fragment,{children:[t.jsx(st,{onSettled:l}),t.jsx(tt,{ready:a})]})};export{dt 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.