PageSourceSearch

https://opopular.com.br/_next/static/chunks/module-providers-pages.4a2d9d82f82a59d8.js

js opopular.com.br collected 2026-09-24 17:09:01 UTC 5,932 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[272],{9859:function(t,e,n){n.r(e),n.d(e,{PagesContext:function(){return u}});var r=n(2078),a=n(7189),o=n(7294),i=n(1163),c=n(8717),s=n(5893),u=(0,o.createContext)({}),l=function(t){var e=t.children,n=(0,i.useRouter)(),l=(0,o.useContext)(a.ServerSidePropsContext),p=(0,o.useState)([]),f=p[0],d=p[1],h=(0,o.useState)(l.domain),g=h[0];h[1];var v=(0,o.useState)({}),m=v[0],y=v[1],S=(0,o.useState)({}),x=S[0],b=S[1],E=(0,o.useState)([]),k=E[0],T=E[1],C=(0,o.useState)(!1),w=C[0],B=C[1],D=(0,o.useState)({type:"",departmentSlug:""}),P=D[0],L=D[1],A=(0,o.useState)(l.navigation),U=A[0],F=A[1],G=(0,o.useState)({}),O=G[0],_=G[1],j=(0,o.useState)(""),I=j[0],N=j[1],Z=(0,o.useState)({}),M=Z[0],H=Z[1],R=(0,o.useState)(""),J=R[0],K=R[1],W=(0,c.o9)(),Y=function(){B(!0),(0,r._p)(l.pageSlots,W).then(function(t){L(l.pageType),F(l.navigation),d(l.article),y(l.page),b(l.pageSlots),T(t),_(l.site),N(l.site.extid),H(l.siteSlots),K(l.site.name),B(!1)}).catch(function(t){console.log("[Fetch error :: loadArticle]",t),B(!1)})},q=function(){B(!0),(0,r._p)(l.pageSlots,W).then(function(t){L(l.pageType),F(l.navigation),d([]),y(l.page),b(l.pageSlots),T(t),_(l.site),N(l.site.extid),H(l.siteSlots),K(l.site.name),B(!1)}).catch(function(t){console.log("[Fetch error :: loadDepartment]",t),B(!1)})},z=function(){B(!0),(0,r._p)(l.siteSlots,W).then(function(t){L(l.pageType),F(l.navigation),d([]),y(l.page),b(l.siteSlots),T(t),_(l.site),N(l.site.extid),H(l.siteSlots),K(l.site.name),B(!1)}).catch(function(t){console.log("[Fetch error :: loadHome]",t),B(!1)})};return(0,o.useEffect)(function(){"article"===l.pageType.type?Y():"department"===l.pageType.type?q():"home"===l.pageType.type&&z()},[n.asPath]),(0,s.jsx)(u.Provider,{value:{articles:f,domain:g,navigation:U,pageData:m,pageList:x,pageListData:k,pageLoading:w,pageType:P,siteData:O,siteExtId:I,siteList:M,siteName:J},children:e})};e.default=l},2078:function(t,e,n){n.d(e,{_p:function(){return g},v9:function(){return v}});var r,a,o=n(29),i=n(7794),c=n.n(i),s=n(2437),u=n.n(s),l=n(4887),p=n(1263),f=n(4987),d=(r=(0,o.Z)(c().mark(function t(e,n,r){var a,o,i,s,u,l=arguments;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=l.length>3&&void 0!==l[3]?l[3]:3,o=l.length>4&&void 0!==l[4]?l[4]:3e3,i=0,s=null;case 4:if(!(i<a)){t.next=20;break}return t.prev=5,t.delegateYield(c().mark(function t(){var a,i,u,l;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=(a=new AbortController).signal,u=setTimeout(function(){a.abort()},o),l=void 0,!(void 0===n.email||!n.email)){t.next=10;break}return t.next=7,fetch(e,{method:"GET",headers:{"Content-Type":"application/json"},signal:i});case 7:l=t.sent,t.next=14;break;case 10:if(r.includes("1.")){t.next=14;break}return t.next=13,fetch(e,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"},signal:i});case 13:l=t.sent;case 14:if(clearTimeout(u),l.ok){t.next=17;break}throw Error("HTTP error! status: ".concat(l.status));case 17:return t.next=19,l.json();case 19:if(s=t.sent,console.log("[DEBUG] Sucesso: ",s),!s){t.next=23;break}return t.abrupt("return",{v:s});case 23:case"end":return t.stop()}},t)})(),"t0",7);case 7:if("object"!=typeof(u=t.t0)){t.next=10;break}return t.abrupt("return",u.v);case 10:t.next=17;break;case 12:t.prev=12,t.t1=t.catch(5),p.C.log("[DEBUG] Tentativa falhou: ",t.t1),console.log("[DEBUG] Tentativa para o id falhou: ",r),console.log("[DEBUG] Tentativa falhou: ",t.t1);case 17:i++,t.next=4;break;case 20:throw Error("Failed to fetch after ".concat(a," attempts"));case 21:case"end":return t.stop()}},t,null,[[5,12]])})),function(t,e,n){return r.apply(this,arguments)}),h=function(t){var e=[];return t.forEach(function(t){return"fulfilled"===t.status&&t.value.forEach(function(t){return e.push(t)})}),e},g=(a=(0,o.Z)(c().mark(function t(e,n){var r,a,o,i,s,l,g,v,m,y,S,x,b=arguments;return c().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:for(r=b.length>2&&void 0!==b[2]?b[2]:"",a=Object.keys(e),o=[],i=[],l=new(u())(window.navigator.userAgent).match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i)?"MOBILE":"DESKTOP",g={email:null==n?void 0:n.emailUsuario,product:"OPOPULAR",deviceType:l,sessionId:null==n?void 0:n.id},a.forEach(function(t){return e[t].forEach(function(t){return t&&o.push((0,f.np)(t))})}),v=0,m=o;v<m.length;v++)y=m[v],p.C.log("[DEBUG] (loadByContentList) postFetchApi: ","".concat(r,"/siteApi/contentId/").concat(y),g),i.push(d("".concat(r,"/siteApi/contentId/").concat(y),g,y));return t.prev=9,t.next=12,Promise.allSettled(i);case 12:return x=h(t.sent),p.C.log("[DEBUG] (loadByContentList) fulfilledSlots: ",x),t.abrupt("return",x);case 18:return t.prev=18,t.t0=t.catch(9),p.C.log("[DEBUG] (loadByContentList) [Fetch error :: loadByContentList]: ",t.t0),t.abrupt("return",[]);case 22:case"end":return t.stop()}},t,null,[[9,18]])})),function(t,e){return a.apply(this,arguments)}),v=function(t,e){var n="".concat(l.Z.stringify(t)),r="/siteApi/filter/".concat(t.policyId,"?").concat(n);(0,f.a8)(r).then(function(t){return e(t)}).catch(function(t){return console.log("[Fetch Error :: loadDataByCidFilter]: ",t)})}},4987:function(t,e,n){n.d(e,{a8:function(){return s},np:function(){return c}});var r=n(29),a=n(7794),o=n.n(a);n(9669),n(6486);var i,c=function(t){var e=[{from:"contentid/",to:""},{from:"policy:/",to:""},{from:"policy:",to:""}],n=t||"";return null==e||e.map(function(t){n=n.replace(t.from,t.to)}),n},s=(i=(0,r.Z)(o().mark(function t(e){var n;return o().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(e);case 3:return n=t.sent,t.abrupt("return",n.json());case 7:return t.prev=7,t.t0=t.catch(0),console.log("e",t.t0),t.abrupt("return",[]);case 11:case"end":return t.stop()}},t,null,[[0,7]])})),function(t){return i.apply(this,arguments)})}}]);
2//# sourceMappingURL=module-providers-pages.4a2d9d82f82a59d8.js.map

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.