1"use strict";(globalThis.webpackChunkmydish_app||=[]).push([["src_workspaces_offering_src_components_CallLetterDetailContainer_tsx"],{3994(e,a,s){s.r(a),s.d(a,{default:()=>j});var n=s(67664),t=s(9950),l=s(43972),r=s(72772),c=s(55563);var i=s(44414);function o(e){const{onAccountMsg:a="You have this channel",channelText:s="Channel",resolution:n="HD",channelDetails:t}=e,l=e=>e&&e.split(",").length>1?`${s}s ${e}`:`${s} ${e}`;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"channel-banner",children:[!0===e.onAccount&&(0,i.jsx)(c.H,{messages:[{message:(0,i.jsx)(i.Fragment,{children:a}),type:"info"}]}),(0,i.jsxs)("div",{className:"row station",children:[(0,i.jsxs)("div",{className:"col-md-5 col-12",children:[(0,i.jsx)("h1",{className:"stn-name",children:e.stationName}),t?(0,i.jsxs)("div",{className:"stn-channel-details",children:[(0,i.jsxs)("div",{className:"mb-2",children:[(0,i.jsx)("span",{className:"t-18 color-cinder",children:(0,i.jsx)("strong",{children:"Hopper Family:\xa0"})}),(0,i.jsx)("span",{className:"t-18 color-coal",children:l(t.hopper)})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("span",{className:"t-18 color-cinder",children:(0,i.jsx)("strong",{children:"Other Receivers:\xa0"})}),(0,i.jsx)("span",{className:"t-18 color-coal",children:l(t.nonHopper)})]})]}):(0,i.jsxs)("div",{className:"stn-number",children:[(0,i.jsx)("span",{children:`${s} ${e.number}`}),!0===e.hd&&(0,i.jsx)("span",{className:"stn-resolution",children:n})]}),e.description&&(0,i.jsx)("div",{className:"stn-description",children:e.description})]}),(0,i.jsx)("div",{className:"col-md-3 col-6",children:(0,i.jsx)("img",{alt:e.altText,src:e.imagePath})})]})]})})}function d(e){let a=e.reduce((e,a)=>(a.collapsibleMajor&&a.collapsibleMinor?e.push(`${a.collapsibleMajor}-${a.collapsibleMinor}`):a.mapdown?e.push(a.mapdown):!a.source||a.collapsibleMajor||a.collapsibleMinor||a.mapdown||e.push(a.source),e),[]).filter(a=>{const s=e.some(e=>e.collapsibleMajor&&e.collapsibleMinor),n=e.map(e=>e.source),t=e.map(e=>e.mapdown);return!(n.includes(a)&&s||t.includes(a)&&s)}).sort((e,a)=>Number(e)-Number(a));if(0===a.length&&e.some(e=>e.source)){a=[Math.min(...e.filter(e=>e.source).map(e=>e.source)).toString()]}const s=a.join(", "),n=e.filter(e=>e.mapdown).map(e=>e.mapdown),t=Math.min(...e.filter(e=>e.source).map(e=>e.source));return{hopper:s,nonHopper:(0===n.length?[t.toString()]:[...new Set(n)].sort((e,a)=>Number(e)-Number(a))).join(", ")}}function m(e){const a=e=>Object.hasOwn(e,"category")&&Object.hasOwn(e,"name")&&Object.hasOwn(e,"detailsUrl"),s=e.filter(e=>e.offeringPackages.every(a)).map(e=>e.offeringPackages).flat(),n=new Set;return s.filter(e=>{const a=`${e.category}|${e.name}`;return!n.has(a)&&(n.add(a),!0)})}function h(e){const{headingText:a="Here\u2019s where you can get",theme:s="day",detailsLinkLabel:n="See What's Included"}=e,t=e.availablePackages.reduce((e,a)=>{const s=e,n=a.category;return s[n]=[...s[n]||[],a],s},Object.create(null));return(0,i.jsx)(i.Fragment,{children:Object.keys(t).length>0&&(0,i.jsxs)("div",{className:"available-in",children:[(0,i.jsx)("h2",{className:"heading",children:`${a} ${e.stationName}`}),Object.keys(t).map(e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{className:"pkgHeader",children:e}),t[e].map(e=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"pkg-item",children:[(0,i.jsx)("p",{className:"label",children:e.name}),(0,i.jsx)(c.Anchor,{displayAs:"link",arialabel:e.name,id:e.name,href:e.detailsUrl,theme:s,forward:!0,children:n})]})}))]}))]},e.stationName)})}function u(e){const a=Array.isArray(e.details)?e.details[0]:e.details;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.m,{defer:!1,children:[(0,i.jsx)("title",{children:`${a.stationName}`}),(0,i.jsx)("meta",{name:"description",content:a.description})]}),(0,i.jsx)(o,{number:a.number,stationName:a.stationName,description:a.description,hd:a.hd,onAccount:a.onAccount,imagePath:a.imagePath,altText:a.altText,channelDetails:Array.isArray(e.details)?d(e.details):null}),(0,i.jsx)(h,{stationName:a.stationName,availablePackages:Array.isArray(e.details)?m(e.details):e.details.offeringPackages})]})}var p=s(32834);function j(e){const[a,s]=t.useState(null),[r,c]=t.useState("INITIAL"),{invalidCallLetterMsgContentId:o="invalid-call-letter-error"}=e;return t.useEffect(()=>{c("PROCESSING"),async function(){await n.A.get("/mydish-gateway/all-channel-details/{callLetter}?accountNumber=accountNumber".replace("{callLetter}",e.callLetter)).then(e=>{const a=e.data.results;p.zP.includes(e.data.statusCode)?(s(a),c(a?"SUCCESS":"FAILED")):c("FAILED")}).catch(e=>{c(e&&"FAILED")})}()},[]),(0,i.jsxs)(i.Fragment,{children:["FAILED"===r&&(0,i.jsx)(l.A,{contentId:o,campfireUI:!0,args:{callLetter:e.callLetter}}),a&&(0,i.jsx)(u,{...e,details:a})]})}}}]);
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.