PageSourceSearch

https://sodagift.com/_next/static/chunks/1524-e7ae5e39fddcb5f0.js

js sodagift.com collected 2026-10-02 19:24:43 UTC 5,098 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="66ba9bb1-6eb8-457e-9ad0-0894203ee687",e._sentryDebugIdIdentifier="sentry-dbid-66ba9bb1-6eb8-457e-9ad0-0894203ee687")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1524],{31524:(e,t,n)=>{n.d(t,{y3:()=>h,aQ:()=>m,WQ:()=>c,QH:()=>g});var l=n(9641),i=n(14232),o=n(92532),a=n(26104),u=n(87987),r=n(33586),d=n(29683),s=n(70704),v=n(2062);let c=e=>{let t=d.A.defaults(e,{size:8,requestIf:()=>!0,available:!0}),n=(0,a.r)(),l=(0,s.Pj)(),{redirectToErrorPage:c}=(0,r.u)(),{data:g,isValidating:p,mutate:y,size:m,setSize:f}=(0,o.Ay)((e,n)=>{var l;return t.requestIf()&&(!n||(null==(l=n.content)?void 0:l.length))?"/v3/coupons?available=".concat(t.available,"&page=").concat(e,"&size=").concat(t.size):null},{revalidateFirstPage:!1,dedupingInterval:1e3,onError(e){e.status===u.lw.Status.Unauthorized&&(l.auth.logout(),n.push("/auth")),c(e)}}),h=(0,i.useMemo)(()=>{var e;return null==g||null==(e=g[0])?void 0:e.totalElements},[g]),b=(0,i.useMemo)(()=>{var e,t;return void 0!==g&&m>=(null!=(t=null==(e=g[0])?void 0:e.totalPages)?t:0)},[g,m]),I=(0,i.useMemo)(()=>null==g?void 0:g.map(e=>Array.isArray(null==e?void 0:e.content)?e.content.map(e=>{try{return(0,v.aG)(function(e,t){var n,l,i,o;let a=!!(null==(n=e.destinations)?void 0:n.length)||!!(null==(l=e.itemTypes)?void 0:l.length);return{id:e.id,used:e.used,expiredAt:e.expiredAt,name:e.name,discountPolicy:e.discountPolicy,target:a?{gifteeId:void 0,gifteeName:void 0,destinations:null!=(i=e.destinations)?i:[],itemTypes:null!=(o=e.itemTypes)?o:[]}:void 0,hasExcludedItem:!1,expired:!t&&!e.used,promotionId:e.promotionId,usable:void 0}}(e,t.available))}catch(e){return(0,r.H)(e),null}}).filter(Boolean):[]).flat(),[g,t.available]),w=(0,i.useCallback)(()=>{p||b||f(e=>e+1)},[p,b,f]);return{data:I,total:h,loading:p,nextData:w,forceInvalidate:y}},g=function(){var e,t,n,l,d;let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=null!=(d=c.requestIf)?d:()=>!0,p=(0,a.r)(),y=(0,s.Pj)(),{redirectToErrorPage:m}=(0,r.u)(),f=null==(t=y.user)||null==(e=t.payment)?void 0:e.paymentItem,h=null==f||null==(n=f.item)?void 0:n.id,b=null==f?void 0:f.quantity,I=null==f||null==(l=f.delivery.giftee)?void 0:l.id,{data:w,isValidating:S,mutate:A,size:P,setSize:E}=(0,o.Ay)((e,t)=>{var n;if(!g()||!h||void 0===b||t&&!(null==(n=t.content)?void 0:n.length))return null;let l=new URLSearchParams({itemId:String(h),quantity:String(b),page:String(e),size:String(8)});return void 0!==I&&l.set("gifteeId",String(I)),"/v3/coupons?".concat(l.toString())},{revalidateFirstPage:!1,dedupingInterval:1e3,onError(e){e.status===u.lw.Status.Unauthorized&&(y.auth.logout(),p.push("/auth")),m(e)}}),T=(0,i.useMemo)(()=>{var e,t;return void 0!==w&&P>=(null!=(t=null==(e=w[0])?void 0:e.totalPages)?t:0)},[w,P]),x=(0,i.useMemo)(()=>null==w?void 0:w.map(e=>Array.isArray(null==e?void 0:e.content)?e.content.map(e=>(0,v.aG)(function(e,t){var n,l,i,o;let a=!!(null==(n=e.destinations)?void 0:n.length)||!!(null==(l=e.itemTypes)?void 0:l.length);return{id:e.id,used:e.used,expiredAt:e.expiredAt,name:e.name,discountPolicy:e.discountPolicy,target:a?{gifteeId:void 0,gifteeName:void 0,destinations:null!=(i=e.destinations)?i:[],itemTypes:null!=(o=e.itemTypes)?o:[]}:void 0,hasExcludedItem:!1,expired:!1,promotionId:e.promotionId,usable:(void 0!==t||null==e.gifteeId)&&e.usable}}(e,I))):[]).flat(),[w,I]),_=(0,i.useCallback)(()=>{S||T||E(e=>e+1)},[S,T,E]);return{data:x,loading:S,nextData:_,forceInvalidate:A}};var p=n(27715);async function y(e,t,n){let i=new URLSearchParams({itemId:String(e),quantity:String(t)});void 0!==n&&i.set("gifteeId",String(n));let o=await l.YB.get("/v3/coupons?".concat(i.toString()),{timeout:1e4}),a=null==o?void 0:o.content;if(!Array.isArray(a))throw Error("쿠폰 목록 응답이 페이지 형태가 아닙니다.");if(a.some(e=>
1null===e||"object"!=typeof e))throw Error("쿠폰 목록 응답에 객체가 아닌 원소가 있습니다.");return a}function m(){var e,t,n,l;let o=(0,s.Pj)(),d=(0,a.r)(),v=(0,r.u)(),c=null==(e=o.user)?void 0:e.id,g=null==(t=o.user)?void 0:t.payment,m=null==g?void 0:g.paymentItem,f=null==m||null==(n=m.item)?void 0:n.id,h=null==m?void 0:m.quantity,b=null==m||null==(l=m.delivery.giftee)?void 0:l.id,I=o.auth.isStrictlyLoggedIn&&f&&void 0!==h?"usable-coupons:".concat(c,":").concat(f,":").concat(h,":").concat(null!=b?b:""):null,{data:w,error:S,mutate:A}=(0,p.Ay)(I,()=>y(f,h,b),{revalidateOnFocus:!1,errorRetryCount:3,onError(e){if(e.status===u.lw.Status.Unauthorized){o.auth.logout(),d.push("/auth");return}if(403===e.status){null==v||v.redirectToErrorPage(e);return}(0,r.H)(e)}});return{count:(0,i.useMemo)(()=>null==w?void 0:w.filter(e=>!e.used&&!1!==e.usable&&(void 0!==b||null==e.gifteeId)).length,[w,b]),loading:!!I&&void 0===w&&!S,forceInvalidate:A}}let f=async e=>{await l.YB.post("/v2/coupons",{promotionCode:e})},h=()=>({createCouponAsync:f})}}]);

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.