1try{!function(){var 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]="05ef66cd-6a17-42ca-9edb-b20f24c613ac",e._sentryDebugIdIdentifier="sentry-dbid-05ef66cd-6a17-42ca-9edb-b20f24c613ac")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1967],{15307:function(e,t,n){n.d(t,{Z:function(){return b}});var i=n(19916),l=n(88515),o=n(85849),a=n(49095),u=n(69102),r=n(48702),c=n(62806),d=n(67242),s=n(87830),f=n(66574),w=n(25553),g=n(49395),m=n(25460),p=n(83884),v=n(32147),_=n(39897),y=n(32969),h=n(49161);function b(e){var t;let{reward:n,rewards:b,projectSlug:x,buttonText:I="Selecionar recompensa",size:j="default",projectStatus:q,campaignEndDate:P,className:k}=e,[A,L]=(0,l.useTransition)(),{cart:C,isLoading:E,mutate:N}=(0,m.Z)(),{mutate:R}=(0,a.kY)(),S=null!==(t=null==C?void 0:C.rewards)&&void 0!==t?t:[];(0,l.useEffect)(()=>{let e=e=>{e.persisted&&(N(),(0,r.xo)(R))};return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[N,R]);let B=(0,c.ox)(C),T=(0,l.useMemo)(()=>({rewardItems:n?[{rewardId:n.id,quantity:1}]:void 0,projectSlug:x||""}),[n,x]),D=(0,g.H)({currentCart:null!=C?C:null,newProjectSlug:x||"",newItemPayload:T,newItemValue:null==n?void 0:n.value}),{startPledgeCheckout:V}=(0,h.s)({cart:null!=C?C:null,projectSlug:x,showReplacementDialog:D.showDialog}),Z=(0,s.p2)(q,10,A,b,n,S,P),z=async(e,t)=>{if(Z)try{await V({unauthenticatedPath:"/checkout/reward/".concat(t,"?type=reward&id=").concat(null==e?void 0:e.id),addToCart:async()=>{var n,i,l,a,d,s;let w=(0,c.ac)(S,e),g=await (0,o.R9)({rewardItems:w,projectSlug:t});if((null==g?void 0:g.httpStatus)!==200)throw Error(null==g?void 0:g.msg);let m=(0,f.ns)();e&&t&&((null==m?void 0:m.googleAnalyticsId)||(null==m?void 0:m.metaPixelId))&&(0,f.Kc)({googleAnalyticsId:null!==(n=null==m?void 0:m.googleAnalyticsId)&&void 0!==n?n:null,metaPixelId:null!==(i=null==m?void 0:m.metaPixelId)&&void 0!==i?i:null,itemId:e.id,itemName:null!==(l=e.name)&&void 0!==l?l:e.id,value:(null!==(a=e.value)&&void 0!==a?a:0)/100,quantity:1}),e&&t&&(0,u.Kc)({item_id:e.id,item_name:null!==(d=e.name)&&void 0!==d?d:e.id,item_variant:"reward",price:(null!==(s=e.value)&&void 0!==s?s:0)/100,project_id:t,creator_username:""}),N(),(0,r.xo)(R)}})}catch(e){(0,v.Am)({description:(0,d.e$)(e),variant:"destructive"})}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.z,{className:(0,w.cn)("mt-6 w-full",k),colorScheme:"green",size:j,onClick:()=>L(()=>z(n,x)),disabled:!Z||E&&!C,children:A?(0,i.jsx)(_.Z,{className:"h-4 w-4"}):I}),C&&B&&(0,i.jsx)(y.Z,{...D.dialogProps})]})}},49161:function(e,t,n){n.d(t,{s:function(){return a}});var i=n(96994),l=n(62806),o=n(88411);function a(e){let{cart:t,projectSlug:n,showReplacementDialog:a}=e,u=(0,i.useRouter)(),{isAuthenticated:r}=(0,o.a)();return{startPledgeCheckout:async e=>{let{unauthenticatedPath:i,addToCart:o}=e;return r?(0,l.ox)(t)&&(null==t?void 0:t.projectSlug)&&t.projectSlug!==n?a():(await o(),u.push("/cart")):u.push("/sign-in?next=".concat(encodeURIComponent(i))),!0}}}},96971:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(19916),l=n(25553),o=n(31459);function a(e){let{imageUrl:t,fallbackImageUrl:n,className:a,square:u=!1,wrapperClassName:r,remountEntityId:c}=e,d=t||n;return(0,i.jsx)("div",{className:(0,l.cn)("mx-auto w-full lg:mx-0",u?"flex h-full min-h-0 items-start justify-center":"h-full",r),children:(0,i.jsx)("div",{className:(0,l.cn)("relative",u?"aspect-square max-h-full w-full min-w-0 max-w-full shrink-0":"w-full max-lg:aspect-square lg:h-full",a),children:d?(0,i.jsx)(o.default,{src:d,alt:"Reward",variant:"w720",quality:85,sizes:"100%",fill:!0,className:"rounded-lg object-cover",remountEntityId:c}):(0,i.jsx)("div",{className:"absolute inset-0 rounded-lg bg-gray-100"})})})}},66574:function(e,t,n){n.d(t,{$y:function(){return v},AW:function(){return a},CB:function(){return f},Kc:function(){return _},L9:function(){return s},Qc:function(){return h},Z_:function(){return y},aH:function(){return g},bJ:function(){return r},ns:function(){return p},u8:function(){return d},x_:function(){return u},y1:function(){return m}});let i=null,l=new Set,o=!1,a="!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');",u="window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());";function r(e){if(!e)return!1;if(!o&&"function"!=typeof window.fbq){let e=document.createElement("script");e.id="fb-pixel-loader-dynamic",e.text=a,document.head.appendChild(e),o=!0}
1return"function"==typeof window.fbq&&(l.has(e)||(window.fbq("init",e),l.add(e)),!0)}function c(e,t,n){r(e)&&window.fbq("track",t,n)}function d(e,t){return!!r(e)&&(t.initedRef.current=!0,c(e,"PageView",{page_location:window.location.href,page_title:document.title,...t.extraParams}),!0)}function s(){window._catarseAllowPageView=!0}function f(e,t){var n,i,l;let o=null!==(n=null==t?void 0:t.page_path)&&void 0!==n?n:"/".concat(e);window.dataLayer=null!==(i=window.dataLayer)&&void 0!==i?i:[],s(),window.dataLayer.push({event:"page_view",page_path:o,page_location:window.location.href,page_title:null!==(l=null==t?void 0:t.page_title)&&void 0!==l?l:document.title,project_slug:e})}let w=new Set(["page_view","scroll","click","view_search_results","video_start","video_progress","video_complete","file_download","user_engagement","session_start"]);function g(){if(window._catarseGtagIntercepted)return;window._catarseGtagIntercepted=!0;let e=window.dataLayer;if(!e)return;let t=e.push.bind(e);e.push=function(){for(var n=arguments.length,i=Array(n),l=0;l<n;l++)i[l]=arguments[l];let o=i.filter(e=>{let t=e&&"object"==typeof e?"string"==typeof e.event?e.event:"event"===e[0]&&"string"==typeof e[1]?e[1]:null:null;if(!t||!w.has(t))return!0;let n=p();return null==n||!n.googleAnalyticsId||"page_view"===t&&function(){let e=!!window._catarseAllowPageView;return window._catarseAllowPageView=!1,e}()});return 0===o.length?e.length:t(...o)}}function m(e){var t,n;i={metaPixelId:null!==(t=e.metaPixelId)&&void 0!==t?t:null,googleAnalyticsId:null!==(n=e.googleAnalyticsId)&&void 0!==n?n:null}}function p(){var e,t;return i?{metaPixelId:null!==(e=i.metaPixelId)&&void 0!==e?e:null,googleAnalyticsId:null!==(t=i.googleAnalyticsId)&&void 0!==t?t:null}:null}function v(e){var t,n;let{googleAnalyticsId:i,metaPixelId:l,itemId:o,itemName:a,value:u,currency:r}=e,d=null!==(t=e.contentType)&&void 0!==t?t:"project";i&&"function"==typeof window.gtag&&window.gtag("event","view_item",{send_to:i,currency:null!=r?r:"BRL",value:null!=u?u:0,items:[{item_id:o,item_name:a,item_category:d,quantity:1,price:null!=u?u:0}]}),l&&c(l,"ViewContent",{content_ids:[o],content_name:a,content_type:null!==(n=e.contentType)&&void 0!==n?n:"product",value:u,currency:null!=r?r:"BRL"})}function _(e){let{googleAnalyticsId:t,metaPixelId:n,itemId:i,itemName:l,value:o=0,currency:a="BRL",quantity:u=1}=e;t&&"function"==typeof window.gtag&&window.gtag("event","add_to_cart",{send_to:t,currency:a,value:o*u,items:[{item_id:i,item_name:l,price:o,quantity:u}]}),n&&c(n,"AddToCart",{content_ids:[i],content_name:l,content_type:"product",value:o*u,currency:a,num_items:u})}function y(e){let{googleAnalyticsId:t,metaPixelId:n,value:i=0,currency:l="BRL",items:o=[]}=e;t&&"function"==typeof window.gtag&&window.gtag("event","begin_checkout",{send_to:t,currency:l,value:i,items:o.length?o:void 0}),n&&c(n,"InitiateCheckout",{value:i,currency:l,num_items:o.reduce((e,t)=>e+t.quantity,0)})}function h(e){let{googleAnalyticsId:t,metaPixelId:n,transactionId:i,value:l,currency:o="BRL",items:a=[]}=e;t&&"function"==typeof window.gtag&&window.gtag("event","purchase",{send_to:t,transaction_id:i,value:l,currency:o,items:a.length?a:void 0}),n&&c(n,"Purchase",{content_ids:a.map(e=>e.item_id),content_type:"product",num_items:a.reduce((e,t)=>e+t.quantity,0),value:l,currency:o})}}}]);
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.