PageSourceSearch

https://unicef.se/_next/static/chunks/15363ze0spv99.js

js unicef.se collected 2026-10-02 03:25:34 UTC 12,867 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="0b7adea6-3c36-4a8b-a907-def8326c8b4a")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,260716,e=>{"use strict";var t=e.i(840733),a=e.i(337642),r=e.i(275885);let s=t.z.object({transaction:t.z.string()}),o=t.z.object({"thank-you-page":t.z.literal("true")});e.s(["BaseCartService",0,class{client;previewThankYouPageDonorEmail;constructor(e){this.client=e,this.previewThankYouPageDonorEmail="[email protected]",this.shouldFetchCartPayload=e=>s.safeParse(e).success,this.shouldPreviewThankYouPage=async(e,t)=>!!o.safeParse(e).success&&t,this.fetchCartPayloadWithRetries=async(e,t)=>{let s,o=0;do{if((s=await this.fetchCartPayload(t,o))&&s.status!==a.PaymentTransactionStatus.PENDING)break;++o<e?await this.delay(1e3):r.captureException(Error(`Failed to get final order state after ${o} retries for transaction ${t}`))}while(o<e)return s},this.delay=e=>new Promise(t=>setTimeout(t,e))}shouldFetchCartPayload;shouldPreviewThankYouPage;fetchCartPayloadWithRetries;async fetchCartPayload(e,t){try{return(await this.client.get("",{params:{transactionId:e,attempt:t}})).data}catch(e){throw r.captureException(e),e}}delay}])},286444,e=>{"use strict";var t=e.i(275885),a=e.i(430559);e.i(205500);var r=e.i(556450),s=e.i(337642),o=e.i(260716);class i extends o.BaseCartService{constructor(e){super(e)}async createCart(e){try{return(await this.client.post("",e,{})).data}catch(e){throw this.handleCustomStructuredErrors(e),t.captureException(e),e}}handleCustomStructuredErrors(e){if(!(a.default.isAxiosError(e)&&e.response))return;let t=e.response.data;if(t.code===s.StructuredErrorType.PRODUCTS_OUT_OF_STOCK)throw new s.OutOfStockProductsError(t.details.outOfStockVariantIds)}}let n=new i(a.default.create({baseURL:`${r.backendApiUrl}/carts`}));e.s(["cartService",0,n])},915046,e=>{"use strict";var t,a=e.i(391398),r=e.i(97844),s=e.i(5674),o=e.i(191788),i=e.i(85414),n=e.i(580333),l=e.i(337642),c=e.i(275885),u=e.i(286444),d=e.i(203828);e.i(205500);var m=e.i(501670),h=e.i(899463),S=e.i(615425),y=e.i(600635);let E=({orderId:e,image:t,text:s,bodyEmbeddedBlockEntries:i})=>{let{pushEcommerceEvent:l,eventFactory:c}=(0,h.useDataLayer)(),{cart:d,actions:E}=(0,n.useCart)(),[p]=(0,o.useState)(d.donor.email);return(0,o.useEffect)(()=>{(0,m.isBrowser)()&&d.donor.email!==u.cartService.previewThankYouPageDonorEmail&&l(c.createPurchaseEventForGS(e,d.donor.donorType,d.payment.method,d.donor.email,d.items))},[]),(0,o.useEffect)(()=>{E.reset()},[]),(0,a.jsxs)("div",{className:"mt-4 mb-4 md:my-10",children:[t&&(0,a.jsx)(S.DonationImage,{image:t}),s&&(0,a.jsxs)("div",{"data-testid":"thank-you-text",className:"pt-3 min-h-[200px]",children:[(0,a.jsx)(y.RichTextWithContainer,{document:s,embeddedBlockEntries:i}),(0,a.jsx)(r.Container,{children:p&&(0,a.jsxs)("p",{className:"text-body my-2",children:["Vi har skickat en bekräftelse till din epost: ",p]})})]})]})};var p=e.i(710597),P=e.i(428566),C=e.i(173802),v=e.i(503645),f=e.i(168489),x=e.i(958678),T=e.i(543304),g=e.i(448245);let k=(0,f.default)(()=>e.A(397023),{loadableGenerated:{modules:[283056]},ssr:!1}),j=e=>{e instanceof v.PaymentResultError&&e.meta?.resultCode==="Refused"||c.captureException(e)};var I=((t=I||{}).PENDING="PENDING",t.SUCCESS="SUCCESS",t.FAILED="FAILED",t);let b=({giftShopThankYouPageEntry:e,bodyEmbeddedBlockEntries:t})=>{let c,m=(0,d.useRouter)(),{payment:h}=(0,i.usePayment)(),{cart:S,actions:y,form:v}=(0,n.useCart)(),f=(0,C.useFlags)(),[I,b]=(0,o.useState)("PENDING"),[N,A]=(0,o.useState)(),[w,D]=(0,o.useState)(),_=S.payment.method===l.PaymentType.Invoice,U=h?.paymentMethod===l.PaymentType.Invoice,F=!h&&!_&&!U&&"FAILED"!==I;(0,o.useEffect)(()=>{u.cartService.shouldPreviewThankYouPage(m.query,m.isPreview).then(e=>{e&&(v.setValue("donor.email",u.cartService.previewThankYouPageDonorEmail),(0,g.clearStoredUtmParameters)(),b("SUCCESS"))})},[v,m.query,m.isPreview]);let R=(0,o.useCallback)(async e=>{u.cartService.fetchCartPayloadWithRetries(f.WEB_SWISH_TRANSACTION_COMPLETED_MAX_RETRIES,e).then(e=>{e.status===l.PaymentTransactionStatus.SUCCESS?((0,p.restoreCartForm)(v,e.cartPayload),(0,g.clearStoredUtmParameters)(),D(e.pspReferenceId),b("SUCCESS")):e.status===l.PaymentTransactionStatus.FAILED&&((0,p.restoreCartForm)(v,e.cartPayload),b("FAILED"))}).catch(e=>{console.log(e),b("FAILED")})},[f.WEB_SWISH_TRANSACTION_COMPLETED_MAX_RETRIES,v]);return(0,o.useEffect)(()=>{u.cartService.shouldFetchCartPayload(m.query)&&R(m.query.transaction)},[v,R,m]),(0,o.useEffect)(()=>{U&&_&&((0,g.clearStoredUtmParameters)(),b("SUCCESS"))},[U,_,y]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.GiftshopCheckoutNav,{backTo:F?void 0:"SUCCESS"===I?s.GiftshopCheckoutNavBackTo.Gavoshop:s.GiftshopCheckoutNavBackTo.Kassa}),(0,a.jsxs)("main",{className:"flex-auto bg-[#f4f4f4]","data-testid":"gift-shop-checkout-page",children:[(0,a.jsx)(x.default,{children:(0,a.jsx)("meta",{name:"robots",content:"noindex"})}),"SUCCESS"!==I&&(0,a.jsx)(r.Container,{custom:!0,className:"py-10",children:(0,a.jsxs)("div",{className:"col-span-12 text-center",children:["PENDING"===I&&h&&!_&&!U&&(0,a.jsx)(k,{payment:h,method:S.payment.method,onSuccess:e=>{(0,g.clearStoredUtmParameters)(),b("SUCCESS"),D(e)},onError:(e,t)=>
2{console.error(t),b("FAILED"),A(e),j(t)},returnUrl:((c=new URL(window.location.origin)).pathname="/gavoshop/betala",c.href)}),"FAILED"===I&&(0,a.jsx)(P.FailedPayment,{message:N||"",restartPayment:()=>{b("PENDING"),A(void 0)},restartPaymentDisabled:!1}),F&&(0,a.jsx)(T.Spinner,{text:"Vänligen vänta, vi behandlar din betalning!"})]})}),"SUCCESS"===I&&(0,a.jsx)(E,{bodyEmbeddedBlockEntries:t,image:e.image,text:e.richText?.json,orderId:(U?h.orderNumber:w)||h?.checkoutId||""})]})]})};b.getHeader=()=>(0,a.jsx)(a.Fragment,{}),e.s(["__N_SSG",0,!0,"default",0,b,"handleSentryError",0,j],915046)},439757,e=>{"use strict";var t,a=e.i(391398),r=e.i(226832);let s=async(e,...t)=>{let a=t[0],s=[],o=!1,i=0;for(;!o;){let t=await (0,r.ctfQuery)({...a,variables:{skip:i}}),n=t.data;i+=n[e]?.items.length||0,s=[...s,t],i>=n[e]?.total&&(o=!0)}return s};var o=e.i(761110),i=e.i(240072),n=e.i(337642),l=e.i(86899),c=e.i(203828),u=e.i(173802),d=e.i(448245),m=e.i(168489),h=e.i(958678),S=e.i(915046),y=e.i(191788),E=e.i(209393),p=e.i(85414),P=e.i(601910),C=e.i(139830),v=e.i(187460),f=e.i(97844),x=e.i(5674),T=e.i(428566),g=e.i(543304),k=e.i(615425),j=e.i(600635);let I=({text:e,email:t,image:r,bodyEmbeddedBlockEntries:s})=>{let{form:o}=(0,E.useDonation)(),[i]=(0,y.useState)(t);return(0,y.useEffect)(()=>{o.reset()},[]),(0,a.jsxs)("div",{className:"mt-4 mb-4 md:my-10",children:[r&&(0,a.jsx)(k.DonationImage,{image:r}),e&&(0,a.jsxs)("div",{"data-testid":"thank-you-text",className:"pt-3 min-h-[200px]",children:[(0,a.jsx)(j.RichTextWithContainer,{document:e,embeddedBlockEntries:s}),(0,a.jsx)(f.Container,{children:i&&(0,a.jsxs)("p",{className:"text-body my-2",children:["Vi har skickat en bekräftelse till din epost: ",i]})})]})]})};var b=e.i(14778);let N=(0,m.default)(()=>e.A(397023),{loadableGenerated:{modules:[283056]},ssr:!1});var A=((t=A||{}).PENDING="PENDING",t.SUCCESS="SUCCESS",t.FAILED="FAILED",t);let w=({donationThankYouPageEntry:e,bodyEmbeddedBlockEntries:t})=>{let r,s=(0,c.useRouter)(),o=(0,u.useFlags)(),{payment:i}=(0,p.usePayment)(),{donation:l,form:m}=(0,E.useDonation)(),k=(0,P.useEmptyDonationForm)(),[j,A]=(0,y.useState)("PENDING"),[w,D]=(0,y.useState)(),_=l.payment.method===n.PaymentType.Invoice,U=i?.paymentMethod===n.PaymentType.Invoice,F=!i&&!_&&!U&&"FAILED"!==j,R=Array.isArray(s.query.route)?s.query.route.slice(0,-1).join("/"):s.query.route;(0,y.useEffect)(()=>{v.donationService.shouldPreviewThankYouPage(s.query,s.isPreview).then(e=>{e&&(m.setValue("donor.email",v.donationService.previewThankYouPageDonorEmail),(0,d.clearStoredUtmParameters)(),A("SUCCESS"))})},[m,s.query,s.isPreview]);let L=(0,y.useCallback)(async e=>{v.donationService.fetchDonationPayloadWithRetries(o.WEB_SWISH_TRANSACTION_COMPLETED_MAX_RETRIES,e).then(e=>{e.status===n.PaymentTransactionStatus.SUCCESS?((0,C.restoreDonationForm)(m,e.donationPayload,k),(0,d.clearStoredUtmParameters)(),(0,b.clearStoredCustomAmounts)(R),A("SUCCESS")):e.status===n.PaymentTransactionStatus.FAILED&&((0,C.restoreDonationForm)(m,e.donationPayload,k),(0,b.clearStoredCustomAmounts)(R),A("FAILED"))}).catch(e=>{console.error(e),A("FAILED")})},[k,o.WEB_SWISH_TRANSACTION_COMPLETED_MAX_RETRIES,m]);return(0,y.useEffect)(()=>{v.donationService.shouldFetchCartPayload(s.query)&&L(s.query.transaction)},[m,L,s]),(0,y.useEffect)(()=>{U&&_&&((0,d.clearStoredUtmParameters)(),(0,b.clearStoredCustomAmounts)(R),A("SUCCESS"))},[U,_]),(0,a.jsxs)("main",{className:"flex-auto bg-[#f4f4f4]","data-testid":"donation-checkout-page",children:[(0,a.jsx)(x.CheckoutNav,{backToUrl:`/${R}?scrollTo=initial`,backToText:"Tillbaka"}),(0,a.jsx)(h.default,{children:(0,a.jsx)("meta",{name:"robots",content:"noindex"})}),"SUCCESS"!==j&&(0,a.jsx)(f.Container,{custom:!0,className:"py-10",children:(0,a.jsxs)("div",{className:"col-span-12 text-center",children:["PENDING"===j&&i&&!_&&!U&&(0,a.jsx)(N,{payment:i,method:i.paymentMethod,onSuccess:()=>{(0,d.clearStoredUtmParameters)(),(0,b.clearStoredCustomAmounts)(R),A("SUCCESS")},onError:(e,t)=>{console.error(t),A("FAILED"),D(e),(0,S.handleSentryError)(t)},returnUrl:((r=new URL(window.location.origin)).pathname=window.location.pathname,r.href)}),"FAILED"===j&&(0,a.jsx)(T.FailedPayment,{message:w||"",restartPayment:()=>{A("PENDING"),D(void 0)},restartPaymentDisabled:!1}),F&&(0,a.jsx)(g.Spinner,{text:"Vänligen vänta, vi behandlar din betalning!"})]})}),"SUCCESS"===j&&(0,a.jsx)(I,{email:l.donor.email,bodyEmbeddedBlockEntries:t,image:e.image,text:e.richText?.json})]})},D=e=>{let t=(0,c.useRouter)(),r=(Array.isArray(t.query.route)?t.query.route.slice(0,-1).join("/"):t.query.route)??"";return(0,a.jsx)(E.DonationContextProvider,{path:r,children:(0,a.jsx)(w,{...e})})},_=["404"];function U(e){return e.isBetala&&e.donationBetalaProps?(0,a.jsx)(D,{...e.donationBetalaProps}):(0,a.jsx)(l.XRay,{entry:e?.entry,children:(0,a.jsx)(i.EntryComponent,{entry:e?.entry,batch:e?.batch})})}let F=async()=>(await s("entryCollection",{query:n.contentful.operations.GET_PAGES_SLUGS})).flatMap(e=>e.data.entryCollection?.items).filter(e=>e?.slug&&!_.includes(e?.slug)),R=async e=>{let t=(0,n.getPathArr)((0,n.buildPathFromPage)(e)),a=[];a.push(t);let r=await q(e,!1);for(let e=0;e<r;e++)a.push([...t,"alla",`${e+1}`]);return a},L=async()=>{let e=await F(),t=[];for(let a of e){let e=await R(a);t.push(...e)}return t},G="do-not-match",q=async(e,t)=>{let a={authorExpertId:G,categoryId:G,tags:[G]};switch(e.__typename){case"AuthorExpert":a.authorExpertId=e.sys.id;break;case"Tag":a.tags=[e?.slug];break;case"Category":a.categoryId=e.sys.id;break;default:return 0}let{data:s}=await (0,r.ctfQuery)({query:n.contentful.operations.GET_ARTICLE_COLLECTION_TOTAL,variables:{preview:t,...a}});return Math.ceil((s.articleCollection?.total||0)/o.BATCH_LENGTH)};U.getHeader=e=>e?.isBetala?(0,a.jsx)(a.Fragment,{}):null,e.s(["__N_SSG",0,!0,"default",0,U,"generateAllRoutes",0,L,"generateRoutes",0,R,"getAllPages",0,F,"getMaxAllowedBatches",0,q],439757)},905286,(e,t,a)=>{let r="/[[...route]]";(window.__NEXT_P=window.__NEXT_P||[]).push([r,()=>e.r(439757)]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push([r])})},648761,e=>{e.v(t=>Promise.all(["static/chunks/0w-k5gkqz-f~m.js"].map(t=>e.l(t))).then(()=>t(493594)))},828805,e=>{e.v(t=>Promise.all(["static/chunks/0ol1pnpd9uivv.js"].map(t=>e.l(t))).then(()=>t(879466)))},551195,e=>{e.v(t=>Promise.all(["static/chunks/0hde7~9ibbe19.js"].map(t=>e.l(t))).then(()=>t(880043)))},999038,e=>{e.v(t=>Promise.all(["static/chunks/0~dx567aq3cps.js"].map(t=>e.l(t))).then(()=>t(321787)))},401390,e=>{e.v(t=>Promise.all(["static/chunks/17a5-nm-clqyp.js"].map(t=>e.l(t))).then(()=>t(609051)))},849644,e=>{e.v(t=>Promise.all(["static/chunks/15d9uxbrv-6lu.js"].map(t=>e.l(t))).then(()=>t(496683)))},63555,e=>{e.v(t=>Promise.all(["static/chunks/0hfkb-1~j2q2c.js"].map(t=>e.l(t))).then(()=>t(525147)))},552597,e=>{e.v(t=>Promise.all(["static/chunks/0p.r~hyhuh9bu.js"].map(t=>e.l(t))).then(()=>t(915260)))},548060,e=>{e.v(t=>Promise.all(["static/chunks/0v~3yi0pqdrap.js"].map(t=>e.l(t))).then(()=>t(893148)))},246888,e=>{e.v(t=>Promise.all(["static/chunks/0zd3oka2svrn0.js"].map(t=>e.l(t))).then(()=>t(460405)))},791631,e=>{e.v(t=>Promise.all(["static/chunks/10z9fd-mraibm.css","static/chunks/003fhdd7phfud.js"].map(t=>e.l(t))).then(()=>t(427779)))},397023,e=>{e.v(t=>Promise.all(["static/chunks/0ex3qvlv35jwm.js"].map(t=>e.l(t))).then(()=>t(283056)))}]);
3
4//# debugId=0b7adea6-3c36-4a8b-a907-def8326c8b4a

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.