1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6898],{16898:function(t,n,e){e.r(n),e.d(n,{SmartContent:function(){return w},default:function(){return I}});var i=e(26042),o=e(85893),l=e(67294),a=e(69396),r=e(99534),u=e(10253),s=e(68471),c=e(59482),d=e(82656),v=e(62132),m=e(29815),f=function(t){return"moviesArray"===t.programs?"movies":"series"},g=function(t){return"".concat(function(t){var n=t.limit,e=void 0===n?null:n,i=t.period,o=void 0===i?null:i,l=t.genres,a=void 0===l?null:l,r=Number(e)||7,u="period: "+(Number(o)||7)+", limit: "+r;return a&&(u+=", genres: "+JSON.stringify((0,m.Z)(a))),u}(t),', type: "').concat(f(t),'"')},p=function(t){return"".concat(function(t){var n=t.limit,e=void 0===n?null:n,i=t.channels,o=void 0===i?null:i,l=t.genres,a=void 0===l?null:l,r="limit: "+(Number(e)||7);return a&&(r+=", genres: "+JSON.stringify((0,m.Z)(a))),o&&(r+=", channels: "+JSON.stringify((0,m.Z)(o))),r}(t))};var y=e(9669),C=e.n(y),h=e(11752),T=e.n(h),N=e(49770),A=e(66176),R=T()().publicRuntimeConfig,_={"Content-Type":"application/json","x-api-key":"w2REwvDZ1663aOVE0doWz32bwbxHPkJ59aT27AGu"},O=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=(0,N.Z)(n?["".concat(R.STORYBLOK_SMARTCONTENT_API_URL),JSON.stringify({query:t}),{headers:(0,i.Z)({"Access-Content-Allow-Origin":"*"},_)}]:null,(function(t,n,e){return C().post(t,n,e).then((function(t){return t.data}))})),o=e.data,l=e.error;return[o,l]},S=function(t,n){var e="".concat(R.STORYBLOK_SMARTCONTENT_API_LEARN_URL),i={Data:{claroId:"ANONYMOUS_"+n,action:"CONTENT_DETAIL_CLICKED",dateTime:(0,A.ZP)().datetimeISO,key:"nowContentId",values:["".concat(t)],platform:"web"},PartitionKey:"1"};C().put(e,i,{headers:_})},Z=T()().publicRuntimeConfig,M=function(t){var n=(0,l.useContext)(c._W),e=(0,d.qD)().editMode,m=void 0===e?null:e,p=t.filters,y=t.typeComponent,C=t.segments,h=t.actionGTM,T=(0,r.Z)(t,["filters","typeComponent","segments","actionGTM"]),N=p.programs,A=void 0===N?null:N,R=(0,l.useState)(null),_=R[0],M=R[1],E=(0,l.useState)((0,s.gu)()||(null===t||void 0===t?void 0:t._uid))[0],b=(0,u.Z)(O(function(t){var n=f(t);return"{\n \trecResults: recommendationsPopularity(".concat(g(t),"){\n\t\t ").concat(n,"{\n\t\t id,\n\t\t nowContentId,\n\t\t title,\n\t\t rating{\n\t\t\t\t\tdescription\n\t\t }\n\t\t runTime,\n\t\t description{\n\t\t\t\t\tshort\n\t\t }\n\t\t assets{\n\t\t ratio,\n\t\t url,\n\t\t category\n\t\t }\n\t\t }\n\t\t}\n\t}")}(p)),2),w=b[0],I=b[1];(0,l.useEffect)((function(){!(0,s.gu)()&&E&&(0,s.lo)(E)}),[E]),(0,l.useEffect)((function(){if(w){var t,n,e={moviesArray:null===(t=w.data.recResults)||void 0===t?void 0:t.movies,seriesArray:null===(n=w.data.recResults)||void 0===n?void 0:n.series},o=null===e||void 0===e?void 0:e[A],l={moviesArray:["Iconic","Key Art","VOD Art"],programsArray:["Iconic","Key Art","VOD Art"],seriesArray:["Iconic","Key Art","VOD Art"]};M(null===o||void 0===o?void 0:o.map((function(t){var n={url:"".concat(Z.STORYBLOK_URL_DETALHE_SMARTCONTENT).concat(t.nowContentId),isModal:!1,target:"_self",label:"Assista agora",labelGTM:t.title,accessText:t.title,onClick:function(){return S(null===t||void 0===t?void 0:t.nowContentId,E)},actionGTM:h};return{id:t.id,title:t.title,subtitle:t.description.short,link:(0,i.Z)({},n),image:{component:"image",image:{src:function(){var n,e,i=null===t||void 0===t||null===(n=t.assets)||void 0===n?void 0:n.filter((function(t){var n=t.ratio,e=t.category;return("2:3"==n||"3:4"==n)&&(null===l||void 0===l?void 0:l[A].includes(e))})).sort((function(t,n){return t.category===n.category?t.ratio.localeCompare(n.ratio):(null===l||void 0===l?void 0:l[A].indexOf(t.category))<(null===l||void 0===l?void 0:l[A].indexOf(n.category))?-1:1}));return null===i||void 0===i||null===(e=i[0])||void 0===e?void 0:e.url}(),width:266,height:399},alt:"".concat(t.title)}}})))}}),[w,I,A,y]);var k=v.KR[y],L=(0,i.Z)({actionGTM:h,data:_,settings:t.settings,segments:C},T);return!!(A&&(null===A||void 0===A?void 0:A.length)>0&&_)&&(0,c.Vc)(C,n.cookieValue,m)&&(0,o.jsx)(k,(0,a.Z)((0,i.Z)({},L),{layoutShadow:!0,className:"cms-SmartContent cms-SmartContentPopularity cms-".concat(y," has-caption")}))},E=e(14924),b=function(t){var n,e,f,g=(0,l.useContext)(c._W),y=(0,d.qD)().editMode,C=void 0===y?null:y,h=(t.type,t.filters),T=t.typeComponent,N=t.segments,A=t.actionGTM,R=(0,r.Z)(t,["type","filters","typeComponent","segments","actionGTM"]),_=(0,l.useState)(null),Z=_[0],M=_[1],b=(0,l.useState)((0,s.gu)()||(null===t||void 0===t?void 0:t._uid))[0],w=(0,u.Z)(O("{\n\t\t\trecResults: LiveRecommendationsPopularityNearRealTime(".concat(p(h),"){\n\t\t\t\tliveCatalogs{\n\t\t\t\tid\n\t\t\t\tname\n\t\t\t\tshortName\n\t\t\t\tdescription\n\t\t\t\tgenreCategory\n\t\t\t\tchannelName\n\t\t\t\tgenre\n\t\t\t\t\tassets{\n\t\t\t\t\t\turl\n\t\t\t\t\t\tassetId\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tposition\n\t\t\ttotalCount\n\t\t}\n\t}")),2),I=w[0],k=w[1],L=null===I||void 0===I||null===(n=I.data)||void 0===n||null===(e=n.recResults)||void 0===e||null===(f=e.liveCatalogs)||void 0===f?void 0:f.map((function(t){return t.id.split("-")[0]})),x=(0,u.Z)(O(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return"{\n recResults: channelCatalogs(ids: ".concat(JSON.stringify((0,m.Z)(t)),") {\n\t\t\tchannelidClarotvmais\n\t\t\tchannelidLorenz\n\t\t\tname\n\t\t\turl_live\n }\n\t}")}(L),(null===L||void 0===L?void 0:L.length)>0),2),G=x[0],D=x[1];(0,l.useEffect)((function(){!(0,s.gu)()&&b&&(0,s.lo)(b)}),[b]),(0,l.useEffect)((function(){var t,n,e,o=null===I||void 0===I||null===(t=I.data)||void 0===t||null===(n=t.recResults)||void 0===n?void 0:n.liveCatalogs,l=null===G||void 0===G||null===(e=G.data)||void 0===e?void 0:e.recResults;if(!k&&(null===o||void 0===o?void 0:o.length)&&!D&&(null===l||void 0===l?void 0:l.length)){var r=null===l||void 0===l?void 0:l.reduce((function(t,n){return(0,a.Z)((0,i.Z)({},t),(0,E.Z)({},n.channelidLorenz,n.url_live))}),{});M(null===o||void 0===o?void 0:o.map((function(t){var n={url:r[null===t||void 0===t?void 0:t.id.split("-")[0]],isModal:!1,target:"_self",label:"Assista agora",labelGTM:t.name,accessText:t.name,onClick:function(){return S(null===t||void 0===t?void 0:t.id,b)},actionGTM:A};return{id:t.id,title:t.name,subtitle:t.description,channelName:null===t||void 0===t?void 0:t.channelName,link:(0,i.Z)({},n),image:{component:"image",image:{src:function(){var n,e,i=null===t||void 0===t||null===(n=t.assets)||void 0===n?void 0:n.filter((function(t){return"epg360x540"==t.assetId.split("_")[1]}));return null===i||void 0===i||null===(e=i[0])||void 0===e?void 0:e.url}(),width:266,height:399},alt:"".concat(t.name)}}})))}}),[I,k,G,D,T]);var K=v.KR[T],P=(0,i.Z)({actionGTM:A,data:Z,settings:t.settings,segments:N},R);return(0,c.Vc)(N,g.cookieValue,C)&&(0,o.jsx)(K,(0,a.Z)((0,i.Z)({},P),{layoutShadow:!0,className:"cms-SmartContent cms-".concat(T," has-caption")}))},w=function(t){var n=t.type,e=t.data,l={SmartContentPopularity:M,SmartContentPopularityNearRealTime:b}[n];return n?(0,o.jsx)(l,(0,i.Z)({},e)):null},I=(0,l.memo)(w)}}]);
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.