PageSourceSearch

https://www.chesterzoo.org/_next/static/chunks/7020.593fe1e09e692085.js

js chesterzoo.org collected 2026-09-24 08:43:56 UTC 7,982 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7020],{97020:function(e,a,s){s.r(a),s.d(a,{default:function(){return f}});var t=s(57437),r=s(2265),i=s(39343),n=s(71686),l=s(54477),o=s(96625),d=s(15329),c=s(57854),m={src:"/_next/static/media/giftaid-logo.20c5bc3f.svg",height:100,width:284,blurWidth:0,blurHeight:0},x=s(66648),u=s(16463);let h="This field is required",p={TYPE:"type",AMOUNT:"amount",MONTHLY:"monthly"};function f(e){let{oneOffPaymentFormId:a,monthlyPaymentFormId:s,oneOffDonationDescription:f,monthlyDonationDescription:y}=e,g=(0,u.useSearchParams)(),w=(0,u.useRouter)(),v=(0,u.usePathname)(),{TYPE:j,AMOUNT:b,MONTHLY:N}=p,L=g.get(j),A=g.get(b),C=L===N,T=Array.from(g.entries()),E={};T.forEach(e=>{let[a,s]=e;E[a.toLowerCase()]=s});let Z={};["donationAmount","firstName","lastName","email","addressLine1","addressLine2","addressCityTown","addressPostcode","donationReason","addressCounty"].forEach(e=>{let a=E[e.toLowerCase()];void 0!==a&&(Z[e]=a)}),A&&(Z.donationAmount=A);let P=(0,r.useRef)(null),[k,O]=(0,r.useState)(null),{register:I,handleSubmit:q,formState:{errors:S}}=(0,i.cI)({defaultValues:Z});(0,r.useEffect)(()=>{if(!Object.keys(S).length){O(null);return}let e=Object.entries(S).filter(e=>{let[a,s]=e;return s.message===h});if(e){let a=e.map(e=>e[0].replace(/([A-Z])/g," $1").toLowerCase());O({type:"error",text:"The following fields are required:<br> ".concat(a.join(", "))})}},[Object.keys(S).length]);let G=async e=>{let t="https://www.chesterzoo.org/donate";window&&!window.location.hostname.includes("localhost")&&(t="".concat(window.location.origin).concat(v));let{donationAmount:r,firstName:i,lastName:n,email:l,addressLine1:o,addressLine2:d,addressCityTown:c,addressPostcode:m,addressCounty:x,donationReason:u,newsletterConsent:h}=e,p=await fetch("/api/donate?formId=".concat(C?s:a),{method:"POST",body:JSON.stringify({values:{donationType:C?"Monthly":"OneOff",donationAmount:r,description:C?y:f,firstName:i,lastName:n,email:l,addressLine1:o,addressLine2:d,addressCounty:x,addressCityTown:c,addressPostcode:m,giftAid:e.giftAidConsent,donationReason:u,newsletterConsent:h},referrerUrl:t})}),{paymentProviderUrl:g}=await p.json();g?(w.push(g),O({type:"success",text:"Success"})):O({type:"error",text:"Error"})};return(0,t.jsxs)("div",{className:"donate-form",children:[(0,t.jsx)("div",{className:"page-header page-header-standard relative",children:(0,t.jsx)("div",{className:"relative flex flex-col grow justify-end pt-36 pb-8 lg:pt-40",children:(0,t.jsx)("div",{className:"container",children:(0,t.jsx)(l.Z,{className:"leading-none text-center md:max-w-2xl lg:max-w-3xl xl:max-w-none mx-auto",level:"h1",size:"heading-3",transform:"uppercase",margin:"mb-3 md:mb-6 xl:mb-4",children:"Your ".concat(C?"monthly":"one off"," Donation")})})})}),(0,t.jsx)("div",{className:"container",children:(0,t.jsx)("div",{className:"grid lg:grid-cols-12 lg:gap-x-4 2xl:gap-x-6",children:(0,t.jsxs)("div",{className:"lg:col-start-2 lg:col-span-10 xl:col-start-3 xl:col-span-8 p-6 xl:pt-9 xl:px-9 text-primary-dark-1 bg-primary-light rounded-3xl",children:[k&&(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)(d.Z,{messageObject:k})}),(0,t.jsxs)("form",{className:"flex flex-wrap gap-3",onSubmit:q(G),ref:P,children:[(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(c.Z,{label:"Donation Amount",id:"donationAmount",errors:S.donationAmount,type:"number",step:"0.01",register:{...I("donationAmount",{required:h,min:{value:1,message:"The minimum donation amount is 1"},max:{value:1e4,message:"The maximum donation amount is 10000"},pattern:{value:/^\d+(\.\d{1,2})?$/,message:"Please enter a valid donation amount (up to 2 decimal places)"}})},displayLabel:!0,showError:!0,isPriceInput:!0})}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(c.Z,{label:"First Name",id:"firstName",type:"text",errors:S.firstName,register:{...I("firstName",{required:h,maxLength:{value:100,message:"First name cannot exceed 100 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(c.Z,{label:"Last Name",id:"lastName",type:"text",errors:S.lastName,register:{...I("lastName",{required:h,maxLength:{value:100,message:"Last name cannot exceed 100 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(c.Z,{label:"Email Address",id:"email",type:"email",errors:S.email,register:{...I("email",{required:h,pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Please enter a valid email"},maxLength:{value:200,message:"E-mail cannot exceed 200 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(c.Z,{label:"Address Line 1",id:"addressLine1",type:"text",errors:S.addressLine1,register:{...I("addressLine1",{required:h,maxLength:{value:100,message:"Address line 1 cannot exceed 100 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(c.Z,{label:"Address Line 2",id:"addressLine2",type:"text",errors:S.addressLine2,register:{...I("addressLine2",{maxLength:{value:100,message:"Address line 2 cannot exceed 100 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(c.Z,{label:"Town/City",id:"addressCityTown",type:"text",errors:S.addressCityTown,register:{...I("addressCityTown",{maxLength:{value:60,message:"Town/City name cannot exceed 60 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(c.Z,{label:"Postcode",id:"addressPostcode",type:"text",errors:S.addressPostcode,register:{...I("addressPostcode",{required:h,maxLength:{value:10,message:"Postcode cannot exceed 10 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(c.Z,{label:"County",id:"addressCounty",type:"text",errors:S.addressCounty,register:{...I("addressCounty",{maxLength:{value:50,message:"Address line 2 cannot exceed 50 characters"}})},displayLabel:!0,showError:!0})}),(0,t.jsxs)("div",{className:"w-full flex items-start gap-x-2 md:gap-x-4 py-4 md:py-6",children:[(0,t.jsx)(x.default,{className:"w-[30%]",src:m,alt:"Gift aid logo",width:300,height:100,loading:"lazy"}),(0,t.jsxs)("div",{className:"flex flex-col gap-y-1 md:gap-y-3",children:[(0,t.jsx)("p",{className:"body-sm",children:"If you are a UK taxpayer, tick the Gift Aid box and increase the value of your donation by 25p for every \xa31 you give, at no extra cost to you"}),(0,t.jsx)("div",{className:"field-input !p-3 !md:p-5 my-4 md:my-6",children:(0,t.jsx)(o.Z,{label:"Tick here to add Gift Aid to your donation if you are a UK taxpayer",id:"giftAidConsent",errors:S.giftAidConsent,register:I("giftAidConsent")})}),(0,t.jsxs)("p",{className:"body-sm italic opacity-80",children:['"I want to Gift Aid my donation and any donations I make in the future or have made in the past four years.'," ",(0,t.jsx)("br",{})," ",(0,t.jsx)("br",{}),'I am a UK taxpayer and understand that if I pay less Income Tax and/or Capital Gains Tax than the amount of Gift Aid claimed on all my donations in that tax year it is my responsibility to pay any difference."']})]})]}),(0,t.jsx)("div",{className:"w-full",children:(0,t.jsx)(c.Z,{label:"Why have you chosen to donate?",id:"donationReason",errors:S.donationReason,register:I("donationReason"),isTextarea:!0})}),(0,t.jsx)("div",{className:"flex justify-center w-full pt-1 md:pt-3",children:(0,t.jsx)(o.Z,{label:"Stay up to date with the latest zoo news, upcoming events, discounts and offers, fundraising appeals, surveys and research to improve the zoo, competitions, and ways to get the most out of your visit.",id:"newsletterConsent",errors:S.newsletterConsent,"aria-invalid":S.newsletterConsent?"true":"false",register:I("newsletterConsent")})}),(0,t.jsx)("div",{className:"flex justify-center w-full pt-4",children:(0,t.jsx)(n.default,{type:"primary",buttonType:"submit",text:"Go to payment"})})]})]})})})]})}}}]);

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.