PageSourceSearch

https://yousend.co/assets/route-BBn9_PVp.js

js yousend.co collected 2026-10-02 12:07:23 UTC 6,688 bytes, 1 lines download raw bytes

1import{j as e,r}from"./jsx-runtime-IdAWuXfe.js";import{N as v}from"./Navbar-DwPVQbKQ.js";import{c as d,B as C}from"./Button-4BEiKgOb.js";import{a as y,C as S}from"./close-outlined-ZlEOMrpL.js";import{P as k,S as L,a as P}from"./paths-B1mp5hqO.js";import{T as A}from"./TextInput--UTnTxEr.js";import{g as E,C as j,a as F,s as O,b as z,c as I}from"./helpers-D-UgYdxe.js";import{p as q,L as M,y as R,u as _}from"./components-Bkin4nHR.js";import"./app-download-qr-b96-etqe.js";import"./logo-tm-black-QZYzW_wQ.js";import"./variables-BdWIMBHw.js";import"./button-DdMQ2-CW.js";import"./chevron-down-vxdfoShr.js";import"./check-DEMPT9gH.js";import"./listbox-91wt3AGM.js";function N({option:t,compact:s}){const n=t.value!=="ALL";return e.jsxs("div",{className:d("flex items-center gap-2",s&&"gap-2.5"),children:[n?e.jsx("img",{src:k.countryFlag(t.flagCode),alt:t.label,className:"size-6 rounded-full object-cover"}):e.jsx("div",{className:"flex size-6 items-center justify-center rounded-full bg-[#F0F0F0] text-text-high",children:e.jsx("svg",{className:"size-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8,d:"M3 12h18M12 3a15.3 15.3 0 014 9 15.3 15.3 0 01-4 9 15.3 15.3 0 01-4-9 15.3 15.3 0 014-9zm0 0C8.5 3 5.6 6.8 5 12c.6 5.2 3.5 9 7 9s6.4-3.8 7-9c-.6-5.2-3.5-9-7-9z"})})}),e.jsx("span",{className:"truncate text-[16px] leading-6 text-text-high",children:t.label})]})}function B(){const[t,s]=q(),[n,m]=r.useState(t.get("q")||""),[p,x]=r.useState(!1),[o]=y(n,350),u=t.get("country")||"ALL",i=E(u)||j[0];r.useEffect(()=>{m(t.get("q")||"")},[t]),r.useEffect(()=>{const a=new URLSearchParams(t),c=t.get("q")||"";o.trim()?a.set("q",o.trim()):a.delete("q"),c!==(o.trim()||"")&&(a.delete("page"),s(a,{replace:!0}))}
1,[o]);const g=a=>{const c=new URLSearchParams(t);a==="ALL"?c.delete("country"):c.set("country",a),c.delete("page"),s(c,{replace:!0})},l=()=>{m("");const a=new URLSearchParams(t);a.delete("q"),a.delete("page"),s(a,{replace:!0})};return e.jsxs("div",{className:"mt-6 flex w-full flex-col gap-4 md:mt-0 md:flex-row md:gap-6",children:[e.jsx(A,{value:n,onChange:a=>m(a.target.value),onFocus:()=>x(!0),onBlur:()=>x(!1),placeholder:"Search",size:"regular",containerClassName:["w-full [&>div]:bg-white",p?"[&>div]:border-2 [&>div]:border-black":"[&>div]:border [&>div]:border-[#b2b2b2]"].join(" "),className:"text-[16px]",leftAddOns:e.jsx(L,{className:"size-6 shrink-0"}),rightAddOns:n.length?e.jsx("button",{type:"button",onClick:l,"aria-label":"Clear search",className:"shrink-0",children:e.jsx(S,{className:"size-6"})}):void 0}),e.jsx(P,{value:i.value,onChange:g,options:j.map(a=>({value:a.value,label:e.jsx(N,{option:a})})),customSelectedComponent:e.jsx(N,{option:i,compact:!0}),containerClassName:"w-full md:w-[560px] [&>div>button]:h-[56px] [&>div>button]:rounded-[12px] [&>div>button]:border-[#b2b2b2] [&>div>button]:bg-white",listBoxOptionsClassName:"w-[var(--button-width)] rounded-2xl border-0 p-2 shadow-search-article",selectedOptionStyle:"check"})]})}function T(){return e.jsxs("header",{className:"bg-conifer-100",children:[e.jsx("div",{className:"pt-6",children:e.jsx(v,{className:"text-black",logoDark:!0,whiteCTA:!0})}),e.jsxs("div",{className:"mx-auto flex w-full max-w-[1070px] flex-col items-center gap-6 px-5 pb-14 pt-[100px] text-center xl:px-0",children:[e.jsxs("h1",{className:d(["text-[38px] text-primary font-extrabold font-bagoss-standard leading-[90%]","sm:text-[58px]","md:max-w-[640px]","lg:max-w-[640px] lg:text-[84px] lg:-tracking-[2.52px]"]),children:[e.jsx("span",{className:"block",children:"Campaigns &"}),e.jsx("span",{className:"block",children:"Promotions"})]}),e.jsx("p",{className:d(["text-[15px] font-normal leading-[28px]","md:w-[640px] md:text-[18px] md:font-medium md:tracking-[-0.18px]"]),children:"Discover the latest campaigns and promotions — and unlock even more from Yousend."}),e.jsx(B,{})]})]})}function U({post:t}){var n;const s=F(t);return e.jsxs(M,{to:`/campaigns-and-promotions/${t.slug}`,className:d("group block rounded-[20px] bg-[#f7f7f8] px-5 pb-5 pt-6 transition-colors hover:bg-[#f0f0f0] md:px-6 md:pb-6 md:pt-8",s==="expired"&&"opacity-50"),children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("h2",{className:"font-bagoss-standard text-[24px] leading-none text-primary md:text-[28px]",children:O((n=t.title)==null?void 0:n.rendered)}),e.jsx("span",{className:d("inline-flex rounded-full px-2 py-1 text-[12px] font-semibold leading-4",s==="active"?"bg-static-success text-primary":"bg-utility-red text-white"),children:s==="active"?"Active":"Expired"})]}),e.jsx("p",{className:"mt-2 max-w-[760px] text-[14px] leading-6 text-black/60 md:text-[15px]",children:z(t)})]})}),e.jsx("p",{className:"mt-5 text-[14px] leading-6 text-naturalGrey md:mt-6 md:text-[15px]",children:I(t)})]})}const f=8;function D({initialPosts:t}){const[s,n]=r.useState(t),[m,p]=r.useState(1),[x,o]=r.useState(!1),[u,i]=r.useState(t.length===f);r.useEffect(()=>{n(t),p(1),i(t.length===f)},[t]);async function g(){var b;o(!0);const l=m+1,a=new URLSearchParams(window.location.search);a.set("page",String(l));const h=await(await fetch(`/api/campaign-promotions-posts?${a.toString()}`)).json();(b=h.posts)!=null&&b.length?(n(w=>[...w,...h.posts]),p(l),i(h.posts.length===f)):i(!1),o(!1)}return e.jsxs("section",{className:"mx-auto flex w-full max-w-[1070px] flex-col gap-4 px-5 py-10 md:py-14 xl:px-0",children:[s.map(l=>e.jsx(U,{post:l},l.id)),u?e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(C,{className:"h-14 w-[260px]",disabled:x,onClick:g,children:x?"Loading...":"View more"})}):null]})}function G(){return e.jsxs("section",{className:"mx-auto flex w-full max-w-[1070px] flex-col items-center px-5 py-14 text-center xl:px-0",children:[e.jsx("img",{src:"https://res.cloudinary.com/busha-inc/image/upload/v1734403965/centa-marketing-site/Layer_1_2x_1.png",alt:"chat icon",className:"h-auto w-[300px] max-w-full"}),e.jsx("h2",{className:"mt-8 font-bagoss-standard text-[32px] leading-none text-primary",children:"No campaigns found at the moment"}),e.jsx("p",{className:"mt-4 max-w-[420px] text-[18px] font-medium leading-7 tracking-[-0.18px] text-black/60",children:"Please check back later. We are sure to have something for you soon!"})]})}const re=()=>[{title:"Yousend - Campaigns & Promotions"}];function oe(){var n;const t=R(),s=_();return t||e.jsxs("div",{children:[e.jsx(T,{}),(n=s.posts)!=null&&n.length?e.jsx(D,{initialPosts:s.posts}):e.jsx(G,{})]})}
1export{oe as default,re as meta};

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.