1(function(){try{var ve=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},x=new ve.Error().stack;x&&(ve._sentryDebugIds=ve._sentryDebugIds||{},ve._sentryDebugIds[x]="1b6f77bc-a1f3-4368-8992-785abc1091dd",ve._sentryDebugIdIdentifier="sentry-dbid-1b6f77bc-a1f3-4368-8992-785abc1091dd")}catch{}})();var _global=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};_global.SENTRY_RELEASE={id:"121133ff69627762a39b5ac5410d0c21b75da453"},(self.webpackChunk_maestro_io_client=self.webpackChunk_maestro_io_client||[]).push([[1997],{53998:(ve,x,t)=>{t.d(x,{A:()=>gn});var e=t(224191),n=t(467783),a=t(777045),d=t(463302),f=t(346002),E=t(365179),y=t(318946),l=t(558613),I=t(341138),v=t(368909),m=t(729172),A=t(199749),p=t(472661),h=t(89649),i=t(323995),r=t(857632),o=t(424024),u=t(789069),c=t(362688),s=t.n(c),g=t(63696),P=t(941083),O=t(886550),C=t(252992),W=t(976060),w=t(189338),T=t(73473),Y=t(579226),ie=t(795991),se=t(46630),q=t(619545),Z=t(86138),te=t(588666),Ne=t(566042),fe=t(195722),_e=t(238787),Le=t(460918),ct=t(903583),gt=t.n(ct),Nt=t(734082),j=t(283722),H=t(575349),J=t(545290),B=t(312854),U=t(429195),oe=t(243412);const Pe=O.Ay.div` 2 ${J.AM} 3 width: 100%; 4 height: 56.25vw; 5 z-index: 1; 6 background: ${ue=>(0,B.pL)({hex:(0,U.AOI)(ue),maxBrightness:.1,percentage:.1})}; 7 & > * { 8 width: 100%; 9 } 10`,we=O.Ay.div` 11 position: relative; 12 padding: 10px 0; 13`,Ee=(0,O.Ay)(H.A)` 14 ${({disabled:ue})=>ue&&` 15 pointer-events: none; 16 opacity: 0.5; 17 `} 18`,pt=(0,O.Ay)(j.Ay).attrs(({right:ue})=>({name:ue?"arrowRight":"arrowLeft"}))` 19 ${J.AM} 20 position: absolute; 21 height: 100%; 22 padding: 0 10px; 23 top: 0; 24 z-index: ${oe.M.layer.modalAnchored}; 25 cursor: pointer; 26 ${({right:ue})=>ue?(0,O.AH)` 27 right: 0; 28 `:(0,O.AH)` 29 left: 0; 30 `} 31 & svg { 32 width: 10px; 33 height: 18px; 34 } 35`,$=O.Ay.div` 36 background: ${U.Hw0}; 37 ${J.AM} 38 ${({padding:ue})=>ue&&(0,O.AH)`padding: ${ue};`} 39 ${({center:ue})=>ue?(0,O.AH)` 40 flex: 1; 41 `:(0,O.AH)` 42 border-right: 0.5px solid ${U.ywe}; 43 `} 44`,K=(0,O.Ay)(j.Ay).attrs(ue=>({color:ue.isActive?(0,U.SP6)(ue):(0,U.mz9)(ue),name:"channelSelector"}))` 45 ${J.AM} 46 ${({isActive:ue})=>ue?J.Qr:J.bo} 47 border-radius: 5px; 48 width: 48px; 49 height: 34px; 50 cursor: pointer; 51`;function G({center:ue,className:Re,closeChannelSelectOnOutsideClick:Xe,isVisible:Zt,padding:on}){const Ht=(0,e.useDispatch)(),_n=(0,e.useSelector)(Nt.VC),Rn=(0,e.useSelector)(E.RpG),eo=(0,e.useSelector)(E.S5i),to=(0,g.useMemo)(()=>_n&&(gt()(Zt)?Rn:Zt),[Zt,Rn]),pn=()=>{Ht((0,y.vE)())};return(0,g.useEffect)(()=>{let Wn=0;return eo&&Xe&&to&&(Wn=setTimeout(()=>{Ht((0,y.a0)(!0))},100)),()=>{clearTimeout(Wn),Ht((0,y.a0)(!1))}},[Xe,to,eo]),to?g.createElement($,{center:ue,className:Re,padding:on},g.createElement(K,{className:C.zB,isActive:eo,onClick:pn})):null}var pe=t(531877),re=t(731694),ge=t(359785),le=t(694712),ce=t(816970),ne=t(408782),Ke=t(152544),Ce=t(41989),Fe=t(835896),vt=t(256746),rt=t(704288),Pt=Object.defineProperty,Vt=Object.defineProperties,bt=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,Ie=(ue,Re,Xe)=>Re in ue?Pt(ue,Re,{enumerable:!0,configurable:!0,writable:!0,value:Xe}):ue[Re]=Xe,he=(ue,Re)=>{for(var Xe in Re||(Re={}))Dt.call(Re,Xe)&&Ie(ue,Xe,Re[Xe]);if(Ae)for(var Xe of Ae(Re))Yt.call(Re,Xe)&&Ie(ue,Xe,Re[Xe]);return ue},de=(ue,Re)=>Vt(ue,bt(Re));const Te={className:s().string,renderer:s().object.isRequired},Se={className:""},Ue=ue=>{const{className:Re,renderer:Xe}=ue,Zt=(0,g.useMemo)(()=>({_id:"fake_id",data:{},renderer:Xe,slug:"fake_slug"}),[Xe]);return g.createElement(ie.GL,de(he({},ie.Nr),{className:Re,doc:Zt}))};
51Ue.propTypes=Te,Ue.defaultProps=Se;const be=Ue;var Et=t(154789),ze=t(272568);const yt=()=>{const ue=(0,e.useSelector)(ze.Q),{t:Re}=(0,Ce._h)(),Xe=(0,e.useDispatch)(),Zt=g.useCallback(()=>{Xe((0,ze.$l)())},[Xe]);return ue?g.createElement(Hn,null,g.createElement(It,null,Re("START_CREATING_YOUR_INTERACTIVE_EXPERIENCE")),g.createElement(Qt,{onClick:Zt},"+ ",Re("LABEL_ADD_BLOCK"))):null},Qt=(0,O.Ay)(Et._s)` 52 padding: 0 20px; 53`,Hn=O.Ay.div` 54 width: 100%; 55 height: 100%; 56 display: flex; 57 flex-direction: column; 58 justify-content: center; 59 align-items: center; 60 gap: 20px; 61 ${J.GA} 62 text-align: center; 63`,It=O.Ay.span` 64 ${Ke.II} 65 color: ${U.SP6}; 66`,Bt=yt;var At=Object.defineProperty,xt=(ue,Re,Xe)=>Re in ue?At(ue,Re,{enumerable:!0,configurable:!0,writable:!0,value:Xe}):ue[Re]=Xe,qe=(ue,Re,Xe)=>(xt(ue,typeof Re!="symbol"?Re+"":Re,Xe),Xe);const Jt={width:0},Q={},We=250,_t=(ue,Re)=>Re?ue?Jt:Q:ue?{display:"none"}:{},ae=O.Ay.div` 67 display: flex; 68 justify-content: center; 69 align-items: center; 70 padding-top: 10px; 71 padding-bottom: 13px; 72 background-color: ${U.Hw0}; 73`,Be=(0,O.Ay)(Fe.A)` 74 background-color: ${U.O49}; 75 color: ${U.SP6}; 76 display: flex; 77 flex-flow: column nowrap; 78 flex: 1; 79 height: 100%; 80 overflow: hidden; 81 position: relative; 82 ${ue=>ue.isMobilePanelEmbedLayout?J.Xz:J.rR} 83 filter: blur(${ue=>ue.blur?"2px":"0px"}); 84 border: none; 85 border-left: 1px solid ${U.Hw0}; 86 border-radius: 10px; 87`,et=O.Ay.div` 88 display: flex; 89 flex-flow: column nowrap; 90 flex-grow: 1; 91 overflow: hidden; 92 padding-bottom: 34px; 93 position: relative; 94`,nt=O.Ay.div` 95 display: flex; 96 flex-wrap: nowrap; 97`,Ut=(0,O.Ay)(Ne.A)` 98 flex-shrink: 0; 99 height: 100%; 100`,Kt=O.Ay.div` 101 display: flex; 102 flex-grow: 1; 103 overflow: hidden; 104 ${(0,J.nD)`overflow: auto;`} 105 ${J.bo}; 106`,ot=O.Ay.div` 107 position: absolute; 108 bottom: 0; 109 left: 0; 110 right: 0; 111 display: flex; 112 align-items: center; 113 justify-content: center; 114 height: 34px; 115 background-color: ${ue=>(0,B.B3)((0,U.O49)(ue),.4)}; 116 backdrop-filter: blur(24px); 117 z-index: 1; 118`,Ye=ue=>(0,O.Ay)(ue)` 119 display: flex; 120 flex: 1; 121 min-height: 0; 122`,Gt=Ye(ie.Ay),Lt=Ye(be),tn=16,kt=O.Ay.div` 123 position: fixed; 124 top: ${tn}px; 125 bottom: ${tn}px; 126 left: ${({adminBarWidth:ue})=>ue||U.Rfo}px; 127 right: ${({sidebarWidth:ue})=>(ue||0)+tn}px; 128 background: ${({blur:ue})=>ue?"transparent":"rgba(0, 0, 0, 0.5)"}; 129 border-radius: 12px; 130 z-index: 3; 131 cursor: pointer; 132 visibility: hidden; 133 opacity: 0; 134 transition: opacity 0.25s ease-out, visibility 0s linear 0.25s; 135 ${({state:ue})=>(ue==="entered"||ue==="entering")&&(0,O.AH)` 136 visibility: visible; 137 opacity: 1; 138 transition: opacity 0.25s ease-out, visibility 0s linear 0s; 139 `} 140`,jt=O.Ay.div` 141 position: fixed; 142 top: ${tn}px; 143 bottom: 80px; 144 right: calc(min(${({sidebarWidth:ue})=>ue||0}px, 25vw) + ${tn+8}px); 145 z-index: 4; 146 pointer-events: none; 147 visibility: hidden; 148 ${({state:ue})=>(ue==="entered"||ue==="entering")&&(0,O.AH)` 149 visibility: visible; 150 pointer-events: auto; 151 `} 152`,qn=(0,O.i7)` 153 from { 154 opacity: 0; 155 } 156 157 to { 158 opacity: 1; 159 } 160`,hn=O.Ay.div` 161 animation: 0.3s ease-out ${qn}; 162 background-color: rgba(0, 0, 0, ${ue=>ue.invisible?"0":"0.5"}); 163 position: absolute; 164 height: 100%; 165 width: 100%; 166 pointer-events: none; 167`,Eo=O.Ay.div` 168 position: absolute; 169 height: 100%; 170`,Oo=O.Ay.div` 171 display: flex; 172 flex-flow: column nowrap; 173 align-items: stretch; 174 pointer-events: none; 175 flex: 1; 176 min-width: 0; 177 max-width: 100%; 178`,Dn=O.Ay.div` 179 display: flex; 180 flex-flow: column nowrap; 181 width: 100%; 182`,Bn=O.Ay.div` 183 height: 19px; 184 margin: 15.5px 0px; 185 display: flex; 186 align-items: center; 187 justify-content: flex-end; 188`,Gn=(0,O.Ay)(j.Ay).attrs(()=>({color:U._e_,name:"cancel-thin"}))` 189 line-height: 0; 190 cursor: pointer; 191 z-index: 2; 192 transition: opacity 1s, max-height 1s, overflow 1s; 193 background: ${(0,B.B3)("#070707",.3)}; 194 width: 19px; 195 height: 19px; 196 margin-right: 12px; 197 display: flex; 198 justify-content: center; 199 align-items: center; 200 border-radius: 3px; 201 ${({collapsed:ue})=>(0,J.nD)` 202 opacity: ${ue?0:1}; 203 max-height: ${ue?0:50}px; 204 overflow: ${ue?"hidden":"visible"}; 205 `} 206`;class Mn extends g.Component{constructor(){super(...arguments),qe(this,"selectPanel",Re=>{this.props.onSetActivePanel(Re)}),qe(this,"renderCard",()=>null),qe(this,"renderCustomPanel",({id:Re,doc:Xe}={},Zt)=>{const{isMobileLayout:on,hidden:Ht}=this.props;return Re?g.createElement(te.A,{key:Re,collection:"objects",hidden:Ht||Zt,id:Re}):Xe&&g.createElement(te.O,{active:!0,doc:Xe,hidden:Ht||Zt,isMobileLayout:on})}),qe(this,"renderPanel",()=>{var Re,Xe,Zt,on,Ht,_n;const{customPanels:Rn,editing:eo,previewPanelRenderer:to,mockPanelRenderer:pn,onCloseCustomPanel:Wn,layoutActivePanels:Fn}=this.props,{panelType:Po}
206=to||{},no=[vt.kG,vt.nw,vt.pt,vt.o1,vt.hI,vt.z4,vt.SG,vt.vb].includes(Po),Co=(()=>no?g.Fragment:Oo)(),yn=this.getActivePanelId(),Yn=yn===vt.DO,oo=this.getActivatedPanels(),Sn=oo.find(Qn=>Qn.id===yn),Bo=((Re=Sn?.renderer)==null?void 0:Re.panelType)||((Xe=Sn?.data)==null?void 0:Xe.kind),xo=oo.filter(Qn=>Qn.id===yn),ao=Fn?.find(Qn=>Qn.id===yn||Qn._id===yn),Lo=((Zt=ao?.renderer)==null?void 0:Zt.panelType)||((on=ao?.data)==null?void 0:on.kind)||Bo;if(eo&&!Yn&&(pn||to&&to.panelType===Lo))return g.createElement(Co,null,g.createElement(le.A,{renderer:pn||to,useMockPanel:!to}));const uo=Rn[Rn.length-1],Uo=((_n=(Ht=uo?.doc)==null?void 0:Ht.data)==null?void 0:_n.kind)==="profile",Ko=!xo.length&&!uo&&!Yn;return g.createElement(g.Fragment,null,Ko?g.createElement(Bt,null):xo.map(Qn=>{const{id:Mo}=Qn;return g.createElement(te.A,{key:Mo,collection:"objects",fade:!0,hidden:this.hidePanels,id:Mo})}),uo&&g.createElement(Dn,null,!Uo&&g.createElement(Bn,null,g.createElement(Gn,{onClick:()=>Wn()})),this.renderCustomPanel(uo,this.hidePanels)),Yn&&g.createElement(Dn,null,g.createElement(rt.default,null)))}),qe(this,"getActivatedPanels",()=>{const{items:Re}=this;return(0,pe.Du)(Re,"id").filter(Xe=>(0,Le.rg)(Xe))}),qe(this,"getActivePanelId",()=>{const{customPanels:Re,activePanel:Xe}=this.props;return Re[Re.length-1]&&"custom-panel"||Xe}),qe(this,"renderSidebarBody",()=>{const{isMobileLayout:Re,layoutActivePanels:Xe}=this.props,Zt=this.getActivatedPanels(),on=Re&&Xe?.length>=1,Ht=!this.hidePanels&&(Zt.length>1||on);return g.createElement(et,null,this.renderCard(),Ht&&this.renderPanelHeader(),g.createElement(Kt,{className:`${C.hT} ${C.s2}`},this.renderPanel()))})}componentWillUnmount(){this.props.onSetActivePanel(null)}get items(){const{renderer:Re}=this.props;return Re?.items||[]}get hidePanels(){const{hidden:Re,isMobileLayout:Xe,isCardOpen:Zt,customPanels:on,adReplacesPanels:Ht}=this.props,_n=on[on.length-1],Rn=!!_n?.overCard;return Re||Xe&&Zt&&!Rn||Ht}renderPanelHeader(){const{isMobileLayout:Re,layoutActivePanels:Xe,previewPanelRenderer:Zt,mockPanelRenderer:on}=this.props,Ht=Zt||on,_n=this.getActivePanelId(),eo=Xe?.length>=2||Ht&&Xe?.length>=1;return Ht&&!eo?g.createElement(ae,null,g.createElement(_e.vE,{isActive:!0,name:on?.iconName||Zt?.iconName||(0,fe.sW)(Ht.panelType,!0,"")})):this.hidePanels?null:g.createElement(nt,null,g.createElement(G,{center:!Xe?.length,padding:"6px 8px 7px 8px"}),Xe?.length>0?g.createElement(Ut,{activeId:_n,isMobileLayout:Re,onSelect:this.selectPanel}):null)}renderSidebarFooter(){const{isMobileLayout:Re}=this.props;return Re?null:g.createElement(T.Ay,{feature:T.Xj.HIDE_MAESTRO_LOGO}
206,Xe=>Xe?null:g.createElement(ot,null,g.createElement(w.A,{className:"h-full",glow:!0})))}renderDefault(){const{className:Re,closePanels:Xe,customPanels:Zt,editing:on,hidden:Ht,isDesktopLayout:_n,isLogoTarget:Rn,isMobilePanelEmbedLayout:eo,inEditMode:to,renderer:pn,otherRegionEditing:Wn,disablePanels:Fn,panelState:Po,isSidebarModalOpened:no,isChannelSelectorSidebarButtonVisible:wo,isMobileLayout:Co,enablePanels:yn}=this.props,{items:Yn}=this;if(!(Yn.length||Zt.length||pn?.cardId)&&!to&&!(Co&&wo))return null;const oo=Po.state!=="showing",Sn=this.renderSidebarFooter(),Bo=on?Xe:yn;return g.createElement(Be,{blur:no,className:Re,editing:on,hidden:!wo&&oo,id:re.bT,isMobilePanelEmbedLayout:eo,onEdit:Bo,style:_t(Ht,_n),testId:"editSidebarLanding",titleKey:"ADMIN_SIDEBAR_SHEET_TITLE"},this.renderSidebarBody(),Sn,Wn&&g.createElement(Eo,{onClick:Rn?void 0:Fn},g.createElement(hn,{invisible:Rn})))}render(){const{adminBarWidth:Re,blur:Xe,closePanels:Zt,editing:on,disablePanels:Ht,sidebarWidth:_n}=this.props;return g.createElement(g.Fragment,null,this.renderDefault(),g.createElement(P.eB,{in:on,timeout:We*.9},Rn=>g.createElement(g.Fragment,null,g.createElement(kt,{adminBarWidth:Re,blur:Xe,onClick:Ht,sidebarWidth:_n,state:Rn}),g.createElement(jt,{state:Rn,sidebarWidth:_n},g.createElement(ne.A,{onStopEditing:Zt,state:Rn})))))}}qe(Mn,"propTypes",{activePanel:s().string,adminBarWidth:s().number.isRequired,blur:s().bool.isRequired,className:s().string,closePanels:s().func.isRequired,customPanels:s().arrayOf(s().object).isRequired,disablePanels:s().func.isRequired,editing:s().bool,enablePanels:s().func.isRequired,hidden:s().bool,inEditMode:s().bool.isRequired,isCardOpen:s().bool.isRequired,isChannelSelectorSidebarButtonVisible:s().bool.isRequired,isDesktopLayout:s().bool.isRequired,isLogoTarget:s().bool.isRequired,isMobileLayout:s().bool.isRequired,isMobilePanelEmbedLayout:s().bool.isRequired,isSidebarModalOpened:s().bool.isRequired,layoutActivePanels:s().array,mockCardRenderer:s().object,mockPanelRenderer:s().object,onCloseCustomPanel:s().func.isRequired,onSetActivePanel:s().func.isRequired,otherRegionEditing:s().bool,panelState:s().object,previewCardRenderer:s().object,previewPanelRenderer:s().object,renderer:s().shape({items:s().arrayOf(s().shape({arrayId:s().string.isRequired,id:s().string.isRequired})).isRequired}),sidebarWidth:s().number,titleTextColor:s().string}),qe(Mn,"defaultProps",{activePanel:null,className:"",editing:!1,hidden:!1,layoutActivePanels:[],mockCardRenderer:null,mockPanelRenderer:null,otherRegionEditing:!1,panelState:null,previewCardRenderer:null,previewPanelRenderer:null,renderer:null,sidebarWidth:0,titleTextColor:U._e_});const Un=(0,Ce.lF)(Mn),so=ue=>({activePanel:(0,E.zJ3)(ue),adminBarWidth:(0,f.pw)(ue),blur:(0,f.l_)(ue),customPanels:(0,o.L_)(ue),editing:(0,f.uH)(ue)===a.NU.SIDEBAR,inEditMode:(0,f.Q)(ue),isCardOpen:(0,I.Ux)(ue),isChannelSelectorSidebarButtonVisible:(0,E.RpG)(ue),isDesktopLayout:(0,v.LH)(ue),isLogoTarget:(0,f.uH)(ue)===a.NU.LOGO,isMobileLayout:(0,v.VC)(ue),isMobilePanelEmbedLayout:(0,A.a0)(ue),isSidebarModalOpened:(0,h.xE)(ue),isSidebarVisible:(0,A.pZ)(ue),layoutActivePanels:(0,A.En)(ue),mockCardRenderer:(0,f.IJ)(ue),mockPanelRenderer:(0,f.yD)(ue),otherRegionEditing:!!((0,f.Q)(ue)&&(0,f.uH)(ue)&&(0,f.uH)(ue)!==a.NU.SIDEBAR),panelState:(0,A.sn)(ue),previewCardRenderer:(0,f.SK)(ue),previewPanelRenderer:(0,f.Wz)(ue),renderer:(0,i.g)(ue,r.tx),sidebarWidth:(0,m.TD)(ue),titleTextColor:(0,u.$L)(ue)}),To=ue=>({closePanels:()=>ue((0,n.wB)()),disablePanels:()=>ue((0,n.kT)()),enablePanels:()=>ue((0,n.$l)()),onCloseCustomPanel:()=>ue((0,p.Zv)()),onLogout:()=>{ue((0,p.Zv)()),ue((0,d.je)())},onSetActivePanel:Re=>ue((0,y.lI)(Re))}),gn=(0,l.A)()((0,e.connect)(so,To)(Un))},79215:(ve,x,t)=>{t.d(x,{A:()=>o});var e=t(990220),n=t(63696),a=t(218938),d=t(124659),f=t(160788),E=Object.defineProperty,y=Object.defineProperties,l=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,A=(u,c,s)=>c in u?E(u,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[c]=s,p=(u,c)=>{for(var s in c||(c={}))v.call(c,s)&&A(u,s,c[s]);if(I)for(var s of I(c))m.call(c,s)&&A(u,s,c[s]);return u},h=(u,c)=>y(u,l(c));const i=e.Uo||`${e.Ls}/quest/v2`,o=()=>
206{const u=(0,f.A)(a.mC),[c,s]=(0,n.useState)([]),g=(0,n.useMemo)(()=>u?`${i}/rewards`:null,[u]),{data:P,loaded:O}=(0,d.A)({headers:{Authorization:`Bearer ${u}`},method:"GET",url:g});return(0,n.useEffect)(()=>{if(O&&P&&P.questRewards){const W=(P.questRewards||[]).filter(({rewardType:w})=>["prize-service-specific","prize"].includes(w));s(W)}else s([])},[P,O]),O?{data:P?h(p({},P),{questRewards:c}):null,loaded:O}:{loaded:!1,data:null}}},491568:(ve,x,t)=>{t.d(x,{D2:()=>l,Ex:()=>A,Io:()=>m,U1:()=>n,Xo:()=>I,ab:()=>h,b8:()=>a,fJ:()=>f,gQ:()=>r,op:()=>E,r6:()=>d,si:()=>i,vw:()=>e,wZ:()=>y,yU:()=>p});const e="address/SET_ACCOUNT_ADDRESS_FIELD",n="address/RESET_ACCOUNT_ADDRESS_REDUCER",a="address/SAVE_ADDRESS",d="address/UPDATE_ADDRESS",f="address/DELETE_ADDRESS",E="address/FETCH_ACCOUNT_ADDRESSES",y="address/SET_ACCOUNT_ADDRESSES",l="address/SET_ACCOUNT_ADDRESS_LOADING",I=()=>({type:n}),v=o=>({payload:o,type:e}),m=o=>({payload:o,type:l}),A=o=>({payload:o,type:a}),p=o=>({payload:o,type:d}),h=o=>({payload:o,type:f}),i=o=>({payload:o,type:E});function r(o){return{payload:o,type:y}}},949074:(ve,x,t)=>{t.d(x,{deleteAddress:()=>I.ab,fetchAccountAddresses:()=>I.si,getAccountAddresses:()=>c,getAccountAddressesLoading:()=>s,saga:()=>r,saveAddress:()=>I.Ex,updateAddress:()=>I.yU});var e=t(100035),n=t(1076),a=t(990220),d=t(16357);const f=async({primaryToken:g,address:P,name:O})=>{await d.A.post(`${a.Nw}/address`,{name:O,address:P},{headers:{Authorization:`Bearer ${g}`,"Content-Type":"application/json","x-maestro-client-id":a.Cn}})},E=async g=>{const{data:P}=await d.A.get(`${a.Nw}/address`,{headers:{Authorization:`Bearer ${g}`,"Content-Type":"application/json","x-maestro-client-id":a.Cn}});return P},y=async({primaryToken:g,addressId:P,address:O,name:C})=>{await d.A.put(`${a.Nw}/address/${P}`,{name:C,address:O},{headers:{Authorization:`Bearer ${g}`,"Content-Type":"application/json","x-maestro-client-id":a.Cn}})},l=async({primaryToken:g,addressId:P})=>{await d.A.delete(`${a.Nw}/address/${P}`,{headers:{Authorization:`Bearer ${g}`,"Content-Type":"application/json","x-maestro-client-id":a.Cn}})};var I=t(491568),v=t(80247);const m=function*(){yield(0,e.yJ)((0,I.Xo)())},A=function*({payload:g}){const{primaryToken:P,address:O,name:C}=g;try{yield(0,e.T1)(f,{primaryToken:P,address:O,name:C}),yield(0,e.yJ)((0,I.si)(P))}catch(W){v.error(W,"error creating address in saga")}},p=function*({payload:g}){const{primaryToken:P,address:O,name:C,addressId:W}=g;try{yield(0,e.T1)(y,{primaryToken:P,address:O,name:C,addressId:W}),yield(0,e.yJ)((0,I.si)(P))}catch(w){v.error(w,"error updating address in saga")}},h=function*({payload:g}){const{primaryToken:P,addressId:O}=g;try{yield(0,e.T1)(l,{primaryToken:P,addressId:O}),yield(0,e.yJ)((0,I.si)(P))}catch(C){v.error(C,"error deleting address in saga")}},i=function*({payload:g}){try{yield(0,e.yJ)((0,I.Io)(!0));const P=yield(0,e.T1)(E,g);yield(0,e.yJ)((0,I.gQ)(P)),yield(0,e.yJ)((0,I.Io)(!1))}catch(P){yield(0,e.yJ)((0,I.Io)(!1)),v.error(P,"error fetching addresses in saga")}};function*r(){yield(0,e.jP)(n.mn,m),yield(0,e.jP)(I.b8,A),yield(0,e.jP)(I.r6,p),yield(0,e.jP)(I.fJ,h),yield(0,e.jP)(I.op,i)}var o=t(23351);const u=({accountAddress:g})=>g.accountAddress.address.complete,c=({accountAddress:g})=>g.accountAddresses,s=({accountAddress:g})=>g.loading},23351:(ve,x,t)=>{t.d(x,{A:()=>h});var e=t(491568),n=Object.defineProperty,a=Object.defineProperties,d=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,l=(i,r,o)=>r in i?n(i,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[r]=o,I=(i,r)=>{for(var o in r||(r={}))E.call(r,o)&&l(i,o,r[o]);if(f)for(var o of f(r))y.call(r,o)&&l(i,o,r[o]);return i},v=(i,r)=>a(i,d(r));const m={accountAddresses:[],loading:!1,accountAddress:{accountId:"",address:{firstName:"",lastName:"",address1:"",address2:"",city:"",state:"",postalCode:"",countryCode:"",phoneNumber:"",complete:!1},name:""}},A=()=>I({},m),h=(i=m,r)=>{switch(r.type){case e.U1:return v(I({},i),{accountAddress:[]});case e.vw:return v(I({},i),{accountAddress:r.payload});case e.D2:return v(I({},i),{loading:r.payload});case e.wZ:return v(I({},i),{accountAddresses:r.payload});default:return i}}},294776:(ve,x,t)=>{t.d(x,{VQ:()=>n,tr:()=>d});const e="customerProfile/UPDATE_CUSTOMER_INFO",n="customerProfile/SET_CUSTOMER_INFO",a="customerProfile/GET_CUSTOMER_INFO",d=f=>({payload:f,type:n})},763698:(ve,x,t)=>{t.d(x,{getAccessInstructions:()=>
206l.ET,getSupportInfo:()=>l.Gf,saga:()=>A,setCustomerInfo:()=>I.tr});var e=t(208847),n=t(100035),a=t(1076),d=t(60058),f=t(38731),E=t(392799),y=t(463302),l=t(504933),I=t(294776);const v=function*({payload:p}){if(!/site_setting/.test(p.path))return;const h=p.value;if(!h)return;const{accessInstructions:i,support:r}=h;if(!r||typeof i!="string")return;const o={accessInstructions:i,support:r};yield(0,n.yJ)((0,I.tr)(o))},m=function*({payload:p}){if(!p)return;const{roles:h}=p,i=h.some(o=>o.scope==="*"&&o.write),r=h.some(o=>o.scope===y.Nv.Creator);if(i||r){const o=yield(0,n.Lt)(),u=(0,l.Mj)(o);if(!u)return;const c=yield(0,n.T1)(f.o,["site_setting",u]);(0,d.CJ)(o,"site_setting",u)||(yield(0,n.yJ)((0,E.subscribe)(c)))}},A=function*(){yield(0,n.jP)(a.q6,m),yield(0,n.jP)(E.UPDATE_DOCUMENT,v)}},208847:(ve,x,t)=>{t.d(x,{A:()=>m});var e=t(294776),n=Object.defineProperty,a=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,E=(A,p,h)=>p in A?n(A,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):A[p]=h,y=(A,p)=>{for(var h in p||(p={}))d.call(p,h)&&E(A,h,p[h]);if(a)for(var h of a(p))f.call(p,h)&&E(A,h,p[h]);return A};const l={accessInstructions:"",support:{email:"",URL:""}},I=()=>y({},l),m=(A=l,p)=>{switch(p.type){case e.VQ:return y(y({},A),p.payload);default:return A}}},504933:(ve,x,t)=>{t.d(x,{ET:()=>m,Gf:()=>A,Mj:()=>p,PY:()=>o,_b:()=>r});var e=t(980672),n=t(393982),a=t(419297),d=t(359785),f=Object.defineProperty,E=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,I=(u,c,s)=>c in u?f(u,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[c]=s,v=(u,c)=>{for(var s in c||(c={}))y.call(c,s)&&I(u,s,c[s]);if(E)for(var s of E(c))l.call(c,s)&&I(u,s,c[s]);return u};const m=u=>u.customerProfile.accessInstructions,A=(0,e.Mz)(u=>
206u.customerProfile.support,u=>u),p=u=>u.app.site.settingsId,h={email:"",URL:""},i=(0,e.Mz)(u=>{var c,s,g;return(g=(s=(c=u.app.site)==null?void 0:c.settings)==null?void 0:s.customerProfile)==null?void 0:g.support},u=>u?v(v({},h),u):h),r=(0,e.Mz)(A,u=>(0,n.G7)(u,a.Xj.MAESTRO_SUPPORT),(u,c)=>!c&&!u.email),o=(0,e.Mz)(i,u=>(0,n.G7)(u,a.Xj.MAESTRO_SUPPORT),(u,c)=>c?d.yx:u.URL?u.URL:u.email?`mailto:${u.email}`:null)},33375:(ve,x,t)=>{t.d(x,{$t:()=>s,B6:()=>v,E0:()=>m,Nq:()=>h,Qx:()=>y,Sp:()=>l,VM:()=>o,Vm:()=>A,ZI:()=>p,ej:()=>u,p6:()=>I,v9:()=>c,wQ:()=>i,xt:()=>r});var e=Object.defineProperty,n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,f=(g,P,O)=>P in g?e(g,P,{enumerable:!0,configurable:!0,writable:!0,value:O}):g[P]=O,E=(g,P)=>{for(var O in P||(P={}))a.call(P,O)&&f(g,O,P[O]);if(n)for(var O of n(P))d.call(P,O)&&f(g,O,P[O]);return g};const y="profile/UPDATE_USER_PROFILE",l="profile/CLEAR_USER_PROFILE",I="profile/GET_USER_PROFILE",v="profile/SET_USER_PROFILE",m="profile/UPDATE_USER_PASSWORD",A="profile/CONFIRM_PASSWORD_UPDATED",p="profile/PASSWORD_UPDATE_ERROR";function h(g){return{payload:E({},g),type:y}}function i(g){return{payload:E({},g),type:v}}function r(){return{payload:{},type:l}}function o(){return{payload:null,type:I}}function u(g){return{payload:E({},g),type:m}}function c(){return{type:A}}function s(){return{type:p}}},785481:(ve,x,t)=>{t.d(x,{sr:()=>u.sr,wI:()=>u.wI,dM:()=>u.dM,J3:()=>u.J3,Sp:()=>u.Sp,i7:()=>u.i7,fn:()=>o,Nq:()=>e.Nq});var e=t(33375),n=t(225068),a=t(100035),d=t(365179),f=t(218938),E=t(1076),y=t(16357),l=t(990220);function I(c,s){const g={Authorization:`Bearer ${c}`,"x-maestro-client-id":s};return(0,y.A)({headers:g,method:"GET",url:`${l.sA}`})}function v(c,s,g){const P={Authorization:`Bearer ${s}
206`,"x-maestro-client-id":g};return(0,y.A)({data:c,headers:P,method:"PUT",url:`${l.sA}`})}const m=async c=>{const s=`${l.fh}/password`;return(0,y.A)({data:{password:c.newPassword,oldPassword:c.oldPassword},headers:{Authorization:`Bearer ${c.accessToken}`,"x-maestro-client-id":c.siteId},method:"PUT",url:s})};var A=t(80247);function*p(){const c=yield(0,a.Lt)(),s=(0,f.mC)(c),g=(0,d.V2d)(c);if(s)try{const P=yield(0,a.T1)(I,s,g);yield(0,a.yJ)((0,e.wQ)(P.data))}catch(P){A.error(P,"error in get user profile saga")}}function*h(){yield(0,a.yJ)((0,e.xt)())}function*i(c){const{payload:s}=c,g=yield(0,a.Lt)(),P=(0,f.mC)(g),O=(0,d.V2d)(g);if(P)try{yield(0,a.T1)(v,s,P,O),yield(0,a.yJ)((0,E.vN)(s.name))}catch{A.error("userProfile saga error: updateUserProfileSaga")}}function*r(c){const{oldPassword:s,newPassword:g}=c.payload,P=yield(0,a.Lt)(),O=(0,f.mC)(P),C=(0,d.V2d)(P);if(O)try{yield(0,a.T1)(m,{oldPassword:s,newPassword:g,siteId:C,accessToken:O}),yield(0,a.yJ)((0,e.v9)())}catch(W){A.log(W),yield(0,a.yJ)((0,e.$t)())}}function*o(){yield(0,a.jP)(e.p6,p),yield(0,a.jP)(E.mn,h),yield(0,a.jP)(e.Qx,i),yield(0,a.jP)(e.E0,r)}var u=t(735898)},24864:(ve,x,t)=>{t.d(x,{E:()=>e});var e=(n=>(n[n.INITIAL=0]="INITIAL",n[n.LOADING=1]="LOADING",n[n.SUCCESS=2]="SUCCESS",n[n.ERROR=3]="ERROR",n))(e||{})},225068:(ve,x,t)=>{t.d(x,{A:()=>h});var e=t(33375),n=t(24864),a=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,I=(i,r,o)=>r in i?a(i,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[r]=o,v=(i,r)=>{for(var o in r||(r={}))y.call(r,o)&&I(i,o,r[o]);if(E)for(var o of E(r))l.call(r,o)&&I(i,o,r[o]);return i},m=(i,r)=>d(i,f(r));const A={accountId:null,icon:null,name:null,passwordUpdateState:n.E.INITIAL},p=()=>v({},A);function h(i=A,r){switch(r.type){case e.Sp:return{accountId:null,icon:null,name:null,passwordUpdateState:n.E.INITIAL};case e.B6:return v(v({},i),r.payload);case e.Qx:return v(v({},i),r.payload);case e.E0:return m(v({},i),{passwordUpdateState:n.E.LOADING});case e.Vm:return m(v({},i),{passwordUpdateState:n.E.SUCCESS});case e.ZI:return m(v({},i),{passwordUpdateState:n.E.ERROR});default:return i}}},735898:(ve,x,t)=>{t.d(x,{J3:()=>p,Sp:()=>l,dM:()=>A,i7:()=>v,sr:()=>h,to:()=>r,wI:()=>m});var e=t(218938),n=t(1076),a=t(980672),d=t(990220),f=t(976633),E=t.n(f),y=t(209095);const l=(0,a.Mz)(o=>o.userProfile,o=>o),I=o=>o.userProfile.icon,v=o=>{const u=o.userProfile.icon,c=(0,y.JB)(o);for(const s in c)if(c[s].url===u&&(!c[s].isAdmin||(0,e.N6)(o)||(0,e.fk)(o)))return!0;return!1},m=o=>o.userProfile.accountId,A=o=>{const u=(0,e.sF)(o);if(u&&(0,e.FP)(o)===n.Ph.UBISOFT){const c=(0,e.fs)(u,n.Ph.UBISOFT);if(c)return`https://ubisoft-avatars.akamaized.net/${c}/default_256_256.png?appId=${d.nM}`}return v(o)?I(o):E()},p=o=>{const u=o.userProfile.name;return u||(o.auth.account?o.auth.account.name:"")},h=o=>o.userProfile.passwordUpdateState||null,i=o=>`${m(o)}:adminbar:expanded`,r=o=>{var u;return((u=o.auth.account)==null?void 0:u.tags)||[]}},664786:(ve,x,t)=>{t.d(x,{Vo:()=>y,W8:()=>l,bU:()=>h,hF:()=>v,jM:()=>A,sk:()=>I,yF:()=>m});var e=Object.defineProperty,n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,f=(i,r,o)=>r in i?e(i,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[r]=o,E=(i,r)=>{for(var o in r||(r={}))a.call(r,o)&&f(i,o,r[o]);if(n)for(var o of n(r))d.call(r,o)&&f(i,o,r[o]);return i};const y="flex flex-col gap-3 rounded bg-[var(--surface-3)] p-0",l="rounded border border-[var(--surface-6)] bg-[var(--surface-4)] p-4",I="flex w-full flex-col gap-4",v="rounded border border-[var(--surface-6)] bg-[var(--surface-4)] overflow-hidden",m="w-full min-h-[260px] px-4 pt-4 pb-2",A="flex gap-2 px-4 pb-4 pt-2",p={addCardFormPadding:"16px",savedCardCollapsedPadding:"12px 16px",savedCardExpandedPadding:"16px"};function h(i){return E(E({},p),i)}},869972:(ve,x,t)=>{t.d(x,{A:()=>Ga});var e=t(63696),n=t(848452),a=t(579226),d=t(429195),f=t(545290),E=t(203720),y=t(886550),l=t(401618);const I=(0,y.Ay)(E.W).attrs({"data-testid":"upEditButton"})``,v=y.Ay.div` 207 display: flex; 208 flex-flow: column nowrap; 209 flex: 1; 210 min-height: 0; 211 ${(0,f.nD)`padding-bottom: ${l.lI}px;`} 212`,m=y.Ay.div` 213 ${f.AM} 214 flex-direction: column; 215 padding: 20px 15px 0px 15px; 216 ${b=>(0,y.AH)` 217 background: linear-gradient(180deg, 218 ${(0,d.mrt)(b)}50 0%, 219 ${(0,d.mrt)(b)}10 20%, 220 transparent 70%); 221 `}; 222 flex-shrink: 0; 223`,A=y.Ay.div` 224 ${f.AM} 225 width: 100%; 226 margin-top: 20px; 227 flex-shrink: 0; 228`,p=y.Ay.div` 229 background: url(${b=>b.src}); 230 background-size: cover; 231 background-position: center; 232 background-repeat: no-repeat; 233 width: 100px; 234 height: 100px; 235 border-radius: 50%; 236`;var h=t(362688),i=t.n(h),r=t(283722),o=t(86138),u=t(955807),c=t(241076),s=t(498685),g=t(312854);const P=y.Ay.div` 237 color: white; 238 ${f.fX} 239 margin-right: 8px; 240`,O=y.Ay.div` 241 background: url(${b=>b.src}); 242 background-position: center; 243 background-size: cover; 244 width: 50px; 245 height: 50px; 246`,C=y.Ay.div` 247 background: ${d.AOI}; 248 ${f.C6} 249 padding: 10px 15px; 250`,W=y.Ay.div` 251 ${f.f3} 252 opacity: 0.5; 253 margin-top: 8px; 254 & > * { 255 display: inline-block; 256 padding-right: 5px; 257 } 258`,w=y.Ay.div` 259 flex: 1; 260 overflow: auto; 261 background: ${d.AOI}; 262 padding: 10px; 263`,T=y.Ay.div` 264 align-items: center; 265 display: flex; 266 justify-content: start; 267 padding: 10px; 268`,Y=y.Ay.div` 269 background: ${d.O49}; 270 border: ${b=>b.active?"1px":"0"} solid ${d.mrt}; 271 margin-bottom: 8px; 272`,ie=y.Ay.div` 273 ${f.C6} 274 background: ${b=>b.active?(0,d.mrt)(b):(0,d.O49)(b)}; 275 color: ${b=>b.active?(0,d.SP6)(b):(0,g.bw)((0,d.O49)(b))}; 276 padding: 15px; 277 &:hover { 278 ${f.Qr} 279 cursor: pointer; 280 } 281`,se=y.Ay.div` 282 ${f._i} 283 text-transform: uppercase; 284`,q=y.Ay.div` 285 opacity: 0.5; 286`,Z=y.Ay.div` 287 text-transform: none; 288`,te=y.Ay.div` 289 font-size: 18px; 290 padding: 12px 0 20px; 291 & > * { 292 padding-left: 5px; 293 } 294`,Ne=y.Ay.span` 295 color: ${d.SP6}; 296`;var fe=Object.defineProperty,_e=Object.defineProperties,Le=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,j=(b,_,F)=>_ in b?fe(b,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):b[_]=F,H=(b,_)=>{for(var F in _||(_={}))gt.call(_,F)&&j(b,F,_[F]);if(ct)for(var F of ct(_))Nt.call(_,F)&&j(b,F,_[F]);return b},J=(b,_)=>_e(b,Le(_));const B=({active:b,claimDate:_,name:F,onClick:Ge})=>e.createElement(ie,{active:b,onClick:Ge}
296,F,_&&e.createElement(W,null,e.createElement(o.A,{stringKey:"CLAIMED"}),e.createElement(c.A,{target:_})));B.propTypes={active:i().bool.isRequired,claimDate:i().number,name:i().string.isRequired,onClick:i().func.isRequired},B.defaultProps={claimDate:null};const U=({claimCode:b,image:_,reward:F})=>e.createElement(e.Fragment,null,e.createElement(T,null,e.createElement(P,null,_?e.createElement(O,{src:_}):e.createElement(r.Ay,{name:"award"})),e.createElement(se,null,e.createElement(q,null,e.createElement(o.A,{stringKey:"REWARD"})),e.createElement(Z,null,F))),b&&e.createElement(C,null,b));U.propTypes={claimCode:i().string,image:i().string,reward:i().string.isRequired},U.defaultProps={claimCode:null,image:null};const oe=({iconName:b,stringKey:_})=>e.createElement(te,null,e.createElement(r.Ay,{name:b}),e.createElement(Ne,null,e.createElement(o.A,{stringKey:_})));oe.propTypes={iconName:i().string.isRequired,stringKey:i().string.isRequired};const Pe=()=>{const{loaded:b,data:_}=(0,s.zR)(),[F,Ge]=(0,e.useState)([]),[xe,$e]=(0,e.useState)([]),[je,He]=(0,e.useState)({}),tt=(0,e.useCallback)((it,Ve)=>{const dt=[it,Ve].join(":");He(J(H({},je),{[dt]:!je[dt]}))},[je,F,xe]);return(0,e.useEffect)(()=>{b&&_?(Ge(_.questRewards),$e(_.raffleRewards)):(Ge([]),$e([]))},[b,_]),e.createElement(w,null,F.length>0&&e.createElement(e.Fragment,null,e.createElement(oe,{iconName:"award",stringKey:"REWARDS_YOUVE_RECEIVED"}),e.createElement(u.A,{keyField:"questId",list:F},(it,Ve)=>{const dt=!!je[`quests:${Ve.questId}`];return e.createElement(Y,{key:it,active:dt},e.createElement(B,{active:dt,claimDate:Ve.claimDate,name:Ve.rewardDescription,onClick:()=>tt("quests",Ve.questId)}),dt&&e.createElement(U,{claimCode:Ve.claimCode,image:Ve.image,reward:Ve.reward}))})),xe.length>0&&e.createElement(e.Fragment,null,e.createElement(oe,{iconName:"ticket",stringKey:"RAFFLES_YOUVE_WON"}),e.createElement(u.A,{keyField:"broadcastId",list:xe},(it,Ve)=>{const dt=!!je[`raffles:${Ve.broadcastId}`];return e.createElement(Y,{key:it,active:dt},e.createElement(B,{active:dt,claimDate:Ve.claimDate,name:Ve.raffleReward,onClick:()=>tt("raffles",Ve.broadcastId)}),dt&&e.createElement(U,{reward:Ve.raffleReward}))})))};Pe.propTypes={};const we=Pe;var Ee=t(224191),pt=t(785481),$=t(365179),K=t(463302),G=t(887944),pe=t(272568),re=t(976633),ge=t.n(re),le=t(217274),ce=t(152544),ne=t(41989),Ke=Object.defineProperty,Ce=(b,_,F)=>_ in b?Ke(b,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):b[_]=F,Fe=(b,_,F)=>(Ce(b,typeof _!="symbol"?_+"":_,F),F);const vt=y.Ay.div` 297 width: 100%; 298 margin-bottom: 23px; 299`,rt=y.Ay.div` 300 ${ce.vJ} 301 color: var(--text-100); 302 text-transform: uppercase; 303 margin: 10px 0px; 304`;class Pt extends e.Component{render(){const{currentProfileImages:_,selected:F,selectImage:Ge,currentImage:xe,t:$e}=this.props,je=_[F],He=it=>it.slice(it.lastIndexOf("/")).replace(/\?\w+/g,""),tt=_;return e.createElement(vt,null,e.createElement(rt,null,$e("SELECT_A_PROFILE_PICTURE")),e.createElement(le.A,{filterAdmin:!0,highlight:it=>je?je.url===it.url:He(it.url||it.image)===He(xe),images:tt,onSelect:(it,Ve)=>Ge(Ve)}))}}Fe(Pt,"propTypes",{currentImage:i().string,currentProfileImages:i().arrayOf(i().shape({isAdmin:i().bool,url:i().string})).isRequired,selected:i().number,selectImage:i().func.isRequired}),Fe(Pt,"defaultProps",{currentImage:ge(),selected:null});const Vt=(0,ne.lF)(Pt),bt=b=>({currentProfileImages:(0,$.JB8)(b),isChatModerator:(0,K.fk)(b),isUserAdmin:(0,K.N6)(b),siteId:(0,$.V2d)(b)}),Ae=b=>({handleSave:_=>b((0,pe.W3)(pe.XF.USER_PROFILES,_))}),Dt=(0,Ee.connect)(bt,Ae)(Vt);var Yt=t(538177),Ie=t(33375),he=t(24864),de=t(463377),Te=t(712991),Se=t(407128),Ue=t(150729);const be=y.Ay.div` 305 align-items: center; 306 display: flex; 307 flex-direction: row; 308 font-family: Noto Sans; 309 font-size: 12px; 310 font-style: normal; 311 font-weight: 400; 312 line-height: 16px; 313 margin-bottom: 4px; 314`,Et=(0,y.Ay)(Se.A)` 315 margin-left: 5px; 316 317 div { 318 padding: 0; 319 } 320 321 div > label > div { 322 font-weight: 500; 323 } 324`,ze=(0,y.Ay)(r.Ay)` 325 svg { 326 width: 16px; 327 height: 16px; 328 } 329 330 circle { 331 fill: ${d.mrt} !important; 332 } 333`,yt=(0,y.Ay)(Ue.A)` 334 height: unset !important; 335 margin-top: 10px; 336 337 pre { 338 font-size: 14px; 339 } 340 341 > div { 342 min-height: unset !important; 343 padding-top: 8px; 344 padding-bottom: 8px; 345 } 346 347 position: relative; 348`,Qt=y.Ay.div` 349 margin-top: 4px; 350`;var Hn=Object.defineProperty,It=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,Jt=(b,_,F)=>_ in b?Hn(b,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):b[_]=F,Q=(b,_)=>{for(var F in _||(_={}))xt.call(_,F)&&Jt(b,F,_[F]);if(At)for(var F of At(_))qe.call(_,F)&&Jt(b,F,_[F]);return b},We=(b,_)=>It(b,Bt(_));const ae=()=>{const[b,_]=(0,e.useState)(""),[F,Ge]=(0,e.useState)(""),[xe,$e]=(0,e.useState)(""),[je,He]=(0,e.useState)(!1),[tt,it]=(0,e.useState)(!1),Ve=(0,Ee.useDispatch)(),dt=(0,e.useContext)(y.Dx),[N,R]=(0,e.useState)(!1),[k,X]=(0,e.useState)(!1),{t:ye}=(0,ne._h)(),{isARightPassword:me,passwordError:Je}=(0,Te.A)(F),[at,De]=(0,e.useState)(""),ut={disabled:!1,expandTextKey:"ADM
350IN_LABEL_PASSWORD_TOGGLE_BUTTON",subtitle:"***********"},Rt=Ln=>{He(!!Ln.newPassword&&!!Ln.confirmPassword&&Ln.newPassword!==Ln.confirmPassword)},Tt=()=>{De(Je)},sn=Ln=>{_(Ln),it(!1)},fn=Ln=>{Ge(Ln),Rt({newPassword:Ln,confirmPassword:xe})},bn=Ln=>{$e(Ln),Rt({newPassword:F,confirmPassword:Ln})},An=Ln=>{Ln.preventDefault()},Kn=()=>{R(!N)},xn=()=>{Ve((0,Ie.ej)({newPassword:F,oldPassword:b}))},ho=()=>{He(!1),it(!1)},yo=(0,Ee.useSelector)(pt.sr);return(0,e.useEffect)(()=>{X(!b||!F||!xe||je||tt||!me)},[b,F,xe,me]),(0,e.useEffect)(()=>{yo===he.E.ERROR&&it(!0),yo===he.E.SUCCESS&&R(!N)},[yo]),e.createElement(Qt,null,e.createElement(rt,null,ye("PASSWORD")),yo===he.E.SUCCESS&&e.createElement(be,null,e.createElement(ze,{admin:!0,name:"circledCheckmark",theme:dt})," ",e.createElement(Et,{color:dt.site.colors.accentPrimary,labelKey:"PASSWORD_CHANGE_SUCCESS",textSize:"h6"})),e.createElement(yt,We(Q({},ut),{forceToggle:N,onClose:ho}),e.createElement(Yt.Ay,{addCloseButton:!0,addCloseButtonClick:Kn,disabled:k,headerKey:"ADMIN_LABEL_PASSWORD_TOGGLE_BUTTON",loading:yo===he.E.LOADING,onSubmit:xn,submitKey:"SUBMIT"},e.createElement(de.A.Root,{error:tt},e.createElement(de.A.FieldSet,null,e.createElement(de.A.Legend,null,ye("CURRENT_PASSWORD")),e.createElement(de.A.PasswordInput,{autoFocus:!0,name:"currentPassword",onChange:sn,value:b})),tt&&e.createElement(de.A.SupportingText,null,ye("INVALID_CURRENT_PASSWORD"))),e.createElement(de.A.Root,{error:!!at},e.createElement(de.A.FieldSet,null,e.createElement(de.A.Legend,null,ye("NEW_PASSWORD")),e.createElement(de.A.PasswordInput,{autoFocus:!0,name:"password",onBlur:Tt,onChange:fn,onPaste:An,value:F})),at&&e.createElement(de.A.SupportingText,null,at)),e.createElement(de.A.Root,{error:je},e.createElement(de.A.FieldSet,null,e.createElement(de.A.Legend,null,ye("CONFIRM_PASSWORD")),e.createElement(de.A.PasswordInput,{autoFocus:!0,name:"password",onChange:bn,onPaste:An,value:xe})),e.createElement(de.A.SupportingText,{role:""},ye("PASSWORD_MUST_MATCH")),je&&e.createElement(de.A.SupportingText,null,ye("PASSWORD_MISMATCH"))))))};var Be=t(252992),et=t(679706),nt=Object.defineProperty,Ut=Object.getOwnPropertySymbols,Kt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,Ye=(b,_,F)=>_ in b?nt(b,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):b[_]=F,Gt=(b,_)=>{for(var F in _||(_={}))Kt.call(_,F)&&Ye(b,F,_[F]);if(Ut)for(var F of Ut(_))ot.call(_,F)&&Ye(b,F,_[F]);return b},Lt=(b,_,F)=>(Ye(b,typeof _!="symbol"?_+"":_,F),F);const tn=y.Ay.div` 351 padding: 20px; 352 overflow: scroll; 353 & legend { 354 color: var(--text-100); 355 } 356 ${(0,f.nD)` 357 padding-bottom: ${l.lI}px; 358 `} 359`,kt=(0,y.Ay)(E.W).attrs({"data-testid":"upDoneButton"})` 360 width: 100px; 361`,jt=(0,y.Ay)(r.Ay)` 362 & > svg { 363 width: 18px; 364 height: 18px; 365 } 366`,qn=y.Ay.div` 367 display: flex; 368 justify-content: space-between; 369 align-items: center; 370`,hn=(0,y.Ay)(de.A.InputIcon)` 371 cursor: pointer; 372 padding: 5px; 373 border-radius: 50%; 374 ${b=>b.disabled&&(0,y.AH)`pointer-events: none;`} 375 color: ${b=>b.disabled?d.mrt:d.ywe}; 376 &:hover { 377 background-color: ${d.mrt}; 378 svg { 379 path { 380 fill: ${d.Jzj}; 381 } 382 } 383 } 384`,Eo=y.Ay.div``,Oo=(b,_,F)=>({currentImage:_.icon||b?.image||F,name:_.name||""});class Dn extends e.Component{constructor(){super(...arguments),Lt(this,"state",Gt({imageSelected:null,initialName:"",nameInputDisabled:!0},Oo(this.props.userData,this.props.userProfile,this.props.userAvatar))),Lt(this,"nameInputRef",null),Lt(this,"setNameInputRef",_=>{this.nameInputRef=_}),Lt(this,"focusNameInput",()=>{this.nameInputRef&&this.nameInputRef.focus()}),Lt(this,"selectImage",_=>{this.setState({imageSelected:_})}),Lt(this,"handleSave",()=>{const{onEngage:_,toggleEditPage:F}=this.props;_({data:{kind:"profile"}},{action:"submit_edit_profile"}),this.updateProfile(),F(!1)}),Lt(this,"handleTextChange",_=>{this.setState({name:_})}),Lt(this,"handleClickUpdateNameButton",_=>{_.preventDefault(),this.setState(F=>({nameInputDisabled:!F.nameInputDisabled}))}),Lt(this,"updateProfile",({justUpdateName:_}={})=>{const{name:F,imageSelected:Ge,initialName:xe}=this.state,{onSave:$e,userProfile:je,profileImages:He}=this.props,tt=He[Ge],it=F.trim(),Ve=_?je.icon:tt?.url||tt?.image||je.icon;$e({accountId:je.accountId,icon:Ve||void 0,name:it||xe})})}componentDidMount(){const{name:_}=this.state;this.setState({initialName:_})}componentDidUpdate(_,F){F.nameInputDisabled!==this.state.nameInputDisabled&&!this.state.nameInputDisabled&&this.focusNameInput()}render(){const{currentImage:_,imageSelected:F,name:Ge,nameInputDisabled:xe}=this.state,{profileImages:$e,profileSettings:je,toggleEditPage:He,thirdPartyAuthProviders:tt,userData:it,t:Ve}=this.props,dt=$e[F],N=tt?.length>0;return e.createElement(tn,null,e.createElement(qn,null,e.createElement(jt,{admin:!0,name:"adminbarLt",onClick:He}),e.createElement(kt,{onClick:this.handleSave}
384,e.createElement(o.A,{stringKey:"DONE"}))),e.createElement(A,null,e.createElement(p,{src:dt?.url||_})),e.createElement(de.A.Root,{error:!Ge.trim()},e.createElement(de.A.FieldSet,null,e.createElement(de.A.Legend,null,Ve("NAME")),e.createElement(de.A.TextInput,{ref:this.setNameInputRef,className:Be.of,"data-testid":"upNameInput",disabled:!je.changeName||xe,name:"name",onChange:this.handleTextChange,onFocus:this.handleFocus,value:Ge}),e.createElement(hn,{"data-testid":"upPencilButton",disabled:!je.changeName,name:xe?"pencil":"checkmark",onClick:this.handleClickUpdateNameButton})),!Ge.trim()&&e.createElement(de.A.SupportingText,null,Ve("EMPTY_NAME"))),e.createElement(Eo,null,e.createElement(Dt,{currentImage:_,images:$e,selected:F,selectImage:this.selectImage}),!N&&e.createElement(e.Fragment,null,e.createElement(et.A,null),e.createElement(rt,null,Ve("EMAIL")),e.createElement(de.A.FieldSet,null,e.createElement(de.A.Legend,null,Ve("EMAIL")),e.createElement(de.A.InputIcon,{name:"mail"}),e.createElement(de.A.TextInput,{disabled:!0,name:"email",readOnly:!0,type:"email",value:it.email})),e.createElement(et.A,null),e.createElement(ae,null))))}}Lt(Dn,"propTypes",{onEngage:i().func.isRequired,onSave:i().func.isRequired,profileImages:i().arrayOf(i().object).isRequired,profileSettings:i().shape({changeName:i().bool,profileImages:i().arrayOf(i().object)}).isRequired,thirdPartyAuthProviders:i().arrayOf(i().object).isRequired,toggleEditPage:i().func.isRequired,userAvatar:i().string.isRequired,userData:i().shape({email:i().string,name:i().string}).isRequired,userProfile:i().shape({accountId:i().string,icon:i().string,name:i().string}).isRequired});const Bn=(0,ne.lF)(Dn),Gn=b=>({profileImages:(0,$.JB8)(b),profileSettings:(0,$.oDB)(b),thirdPartyAuthProviders:(0,K.sF)(b),userAvatar:(0,pt.dM)(b),userData:(0,K.Fz)(b),userProfile:(0,pt.Sp)(b)}),Mn=b=>({onEngage:(_,F)=>b((0,G.Qo)("engage",_,F)),onSave:_=>b((0,pt.Nq)(_))}),Un=(0,Ee.connect)(Gn,Mn)(Bn);var so=t(430141),To=t(323353),gn=t(33149),ue=t(942662),Re=t(551321);function Xe({onClose:b,onEditProfile:_}){const{t:F}=(0,ne._h)();return e.createElement("header",{className:"flex w-full items-center gap-2"},e.createElement("h2",{className:"min-w-0 flex-1 truncate font-[family-name:var(--site-font-headline)] text-[1.25rem] font-semibold leading-[1.5rem] text-[var(--text-100)]"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_TITLE"})),e.createElement(Re.$,{className:"h-6 shrink-0 rounded-full border-0 bg-[var(--surface-6)] px-3.5 text-xs font-medium leading-4 text-[var(--text-100)] hover:bg-[var(--surface-6)]",context:"site","data-testid":"upEditButton",onClick:_,type:"button",variant:"secondary"},e.createElement(o.A,{stringKey:"EDIT_PROFILE"})),e.createElement(Re.$,{"aria-label":F("ADMIN_ACTION_CLOSE"),className:"flex size-[14px] shrink-0 items-center justify-center border-0 bg-transparent p-0 text-[var(--text-100)] hover:bg-transparent",context:"site",onClick:b,type:"button",variant:"ghost"},e.createElement(ue.Cross,{className:"block size-[14px] [&_svg]:size-[14px]"})))}var Zt=t(242689),on=t.n(Zt),Ht=t(218938),_n=t(735898);const Rn=new Set(["VIP","Member","Subscriber"]);function eo({createdDate:b,onLogout:_,userAvatar:F,userName:Ge}){const{t:xe}=(0,ne._h)(),$e=(0,Ee.useSelector)(Ht.qo),je=(0,Ee.useSelector)(Ht.Rk),He=(0,Ee.useSelector)(_n.to),tt=(0,e.useMemo)(()=>{const it=[],Ve=je?.some(X=>X.scope==="*"&&X.write),dt=je?.some(X=>X.scope==="Producer"),N=je?.some(X=>X.scope==="Chat_Moderator"),R=je?.some(X=>X.scope==="Creator");let k="";return Ve?k=xe("ADMIN_INVITE_TAB_SITE_ADMIN"):dt?k=xe("ADMIN_LABEL_PRODUCER"):N?k=xe("ADMIN_LABEL_CHAT_MODERATOR"):R&&(k=xe("ADMIN_LABEL_CREATOR")),k&&it.push(k),He.forEach(X=>{Rn.has(X)&&!it.includes(X)&&it.push(X)}),it},[je,He,xe]);return e.createElement("section",{className:"flex gap-4"},e.createElement("div",{className:"size-[102px] shrink-0 rounded-full bg-cover bg-center bg-no-repeat",style:{backgroundImage:`url(${F})`},role:"img","aria-label":Ge}),e.createElement("div",{className:"flex min-w-0 flex-1 flex-col gap-2 pt-1"},e.createElement("h3",{className:"truncate text-xl font-semibold capitalize text-[var(--text-100)]"},Ge),tt.length>0&&e.createElement("div",{className:"flex flex-wrap gap-1.5"},tt.map(it=>e.createElement("span",{key:it,className:(0,gn.cn)("rounded-full bg-[var(--surface-6)] px-2.5 py-0.5","text-[10px] font-medium leading-3 text-[var(--text-200)]")},it))),$e&&e.createElement("p",{className:"truncate text-xs font-medium text-[var(--text-200)]"},$e),e.createElement("p",{className:"text-xs font-medium text-[var(--text-300)]"}
384,e.createElement(o.A,{stringKey:"USER_PROFILE_MEMBER_SINCE"})," ",on()(b).format("MMM D, YYYY")),e.createElement(Re.$,{className:"h-6 w-fit shrink-0 rounded-full border-0 bg-[var(--surface-6)] px-3.5 text-xs font-medium leading-4 text-[var(--text-100)] hover:bg-[var(--surface-6)]",context:"site","data-testid":"upLogOutButton",onClick:_,type:"button",variant:"secondary"},e.createElement(o.A,{stringKey:"ACTION_LOG_OUT"}))))}var to=t(504933),pn=t(465701),Wn=t(763910),Fn=t(514245);function Po(b){return b===Fn.Q.vodPurchase||b===Fn.Q.vodRental}function no(b){const _=[],F=[],Ge=[],xe=[];return b.forEach($e=>{const{entitlement:je}=$e,He=je.type;if(He===Fn.Q.vodPurchase){Ge.push($e);return}if(He===Fn.Q.vodRental){xe.push($e);return}if(He===Fn.Q.subscription||je.recurrence&&je.recurrence!==Fn.q.once){_.push($e);return}(He===Fn.Q.ticket||!Po(He)&&(!je.recurrence||je.recurrence===Fn.q.once))&&F.push($e)}),{memberships:_,tickets:F,videoPurchases:Ge,videoRentals:xe}}function wo(b,_){const F=new Set,Ge=[];return[...b,..._].forEach(xe=>{var $e,je;const He=(je=xe._id)!=null?je:($e=xe.entitlement)==null?void 0:$e._id;!He||F.has(He)||(F.add(He),Ge.push(xe))}),Ge}function Co(){const b=(0,Ee.useSelector)(Wn.jg),_=(0,Ee.useSelector)(Wn.m3);return(0,e.useMemo)(()=>{const F=[...new Set((b||[]).filter($e=>$e?._id))],Ge=(_||[]).filter($e=>$e.status!==pn.dU.canceled),xe=wo(Ge,F);return no(xe)},[_,b])}function yn({title:b,count:_,className:F}){return e.createElement("div",{className:(0,gn.cn)("flex items-start gap-1 text-sm font-medium leading-4",F)},e.createElement("span",{className:"text-[var(--text-100)]"},b),e.createElement("span",{className:"text-[var(--text-300)]"},"(",_,")"))}var Yn=t(825711),oo=t(306812),Sn=t(415530),Bo=t(89649),xo=t(711678),ao=t(816970),Lo=t(171751);function Io(b){return b>1e12?b:b*1e3}function uo(b){return b?(b>1e12?on()(b):on().unix(b)).format("MMMM D, YYYY"):""}function Uo({accountEntitlement:b,onCancelSubscription:_,onClose:F}){const Ge=(0,Ee.useDispatch)(),{t:xe}=(0,ne._h)(),$e=(0,Ee.useSelector)(Sn.p9),je=!!($e&&$e===b._id),{entitlement:He,dateGranted:tt,dateCanceled:it,currentPeriodEnd:Ve,grantedMethod:dt,presentmentCurrency:N,status:R}=b,k=R===pn.dU.cancelScheduled,X=dt===pn.TV.purchased,ye=uo(tt),me=(0,e.useMemo)(()=>{const Tt=(0,ao.xh)(He,N||"usd");if(!Tt.value||!N)return"\u2014";const sn=(0,Lo.$g)(N,Tt.value),fn=He.recurrence&&oo.I[He.recurrence],bn=fn?xe(fn):"";return bn?`${sn} / ${bn}`:sn},[He,N,xe]),Je=(0,e.useMemo)(()=>X?null:dt===pn.TV.customerService?xe("LABEL_MANUALLY_GRANTED"):xe("USER_ACCOUNT_MEMBERSHIP_GRANTED"),[dt,X,xe]),at=me!=="\u2014"||!Je,De=uo(Ve)||"\u2014",ut=uo(it??Ve)||"\u2014",Rt=()=>{if(_){_(b);return}if(F?.(),!b._id||!b.entitlement._id){Ge((0,Bo.kh)("USER_ACCOUNT_UNABLE_TO_CANCEL_SUBSCRIPTION"));return}const Tt=b.grantedMethod===pn.TV.purchased&&Ve?on().unix(Ve).format("MMM DD, YYYY"):void 0,sn=xe(Tt?"ADMIN_LABEL_CANCEL_SUBSCRIPTION_CONFIRMATION_SUBTITLE":"ADMIN_LABEL_CANCEL_SUBSCRIPTION_CONFIRMATION_IMMEDIATE");Ge((0,Bo.to)({kind:xo.V.confirmation,data:{onConfirmClick:()=>{Ge((0,Sn.M2)({accountEntitlementId:b._id,refund:!1,scheduled:Sn.uS.EndOfBilling,subscriptionId:b.entitlement._id}))},promptStringKey:"ADMIN_LABEL_CANCEL_SUBSCRIPTION_CONFIRMATION",subtitle:Tt?`${sn} ${Tt}`:sn}}))};return e.createElement("article",{className:"rounded border border-[var(--surface-6)] bg-[var(--surface-4)] p-5"},e.createElement("div",{className:"flex items-start justify-between gap-3"},e.createElement(Yn.OeC,{className:"h-[22px] w-[29px] shrink-0 text-[var(--text-300)]","aria-hidden":!0}),e.createElement(Re.$,{className:"h-6 shrink-0 rounded-full border-0 bg-[var(--surface-6)] px-3.5 !text-[0.625rem] !font-medium !leading-[0.75rem] text-[var(--text-100)] hover:bg-[var(--surface-6)]",context:"site",disabled:je||k,onClick:Rt,type:"button",variant:"secondary"},xe(k?"USER_ACCOUNT_ACTION_CANCELLATION_SCHEDULED":"ADMIN_ACTION_CANCEL"))),e.createElement("div",{className:"mt-4 flex min-w-0 flex-col gap-1"},e.createElement("h4",{className:"text-sm font-bold leading-4 text-[var(--text-100)]"},He.name),ye&&e.createElement("p",{className:"text-xs font-medium leading-[14px] text-[var(--text-200)]"},xe("USER_ACCOUNT_MEMBERSHIP_JOINED",{date:ye}))),e.createElement("div",{className:"mt-5 flex w-full items-start justify-between gap-6"},e.createElement("div",{className:"flex min-w-0 flex-col gap-1"},e.createElement("span",{className:"text-xs font-medium leading-[14px] text-[var(--text-200)]"},xe("USER_ACCOUNT_LABEL_PRICE")),at&&e.createElement("span",{className:"text-xs font-medium leading-4 text-[var(--text-100)]"},me),Je&&e.createElement("span",{className:"text-xs font-medium leading-[14px] text-[var(--text-300)]"},Je)),e.createElement("div",{className:"flex shrink-0 flex-col items-end gap-1 text-right"},e.createElement("span",{className:"text-xs font-medium leading-[14px] text-[var(--text-200)]"},xe(k?"USER_ACCOUNT_LABEL_CANCELS_ON":"USER_ACCOUNT_LABEL_RENEWAL_DATE")),e.createElement("span",{className:"text-xs font-medium leading-4 text-[var(--text-100)]"}
384,k?ut:De))))}var Ko=t(733529),Qn=t(990220),Mo=t(124659);const _o=new Map;function oa(b){return _o.get(b)}function Va(b,_){_o.set(b,_)}function Qo(){_o.clear()}const Jo=b=>b;function aa({entitlementPurchaseSummary:b,grantedMethod:_,subscriptionId:F}){var Ge;const xe=F?oa(F):void 0,$e=_===pn.TV.purchased&&!b&&!!F&&!xe,[je,He]=(0,e.useState)(xe);(0,e.useEffect)(()=>{if(!F)return;const R=oa(F);He(R)},[F]);const tt=(0,e.useMemo)(()=>$e&&F?`${Qn.ww}/subscription/${F}/purchase-summary`:null,[$e,F]),{data:it,loaded:Ve}=(0,Mo.A)({blockRequest:!$e,transform:Jo,url:tt});(0,e.useEffect)(()=>{it&&F&&(Va(F,it),He(it))},[it,F]);const dt=(Ge=b??je)!=null?Ge:void 0;return{isPaymentSummaryLoading:_===pn.TV.purchased&&!b&&!!F&&!dt&&$e&&!Ve,purchaseSummary:dt}}const ra={amex:"American Express",discover:"Discover",mastercard:"Mastercard",visa:"Visa"};function lo(b,_){if(_){const Ge=_.toLowerCase();return ra[Ge]||_.charAt(0).toUpperCase()+_.slice(1)}const F=b?.trim();return!F||F.toLowerCase()==="card"?"Card":F}function Wo(b,_){var F;const{entitlement:Ge,presentmentCurrency:xe}=b,$e=xe||((F=_?.currency)==null?void 0:F.toLowerCase())||"usd",je=(0,ao.xh)(Ge,$e);let He=null;return je.value?He=je.value:_?.price&&(He=_.price),He?(0,Lo.$g)($e,He):null}function ha(b,_){return b||_?.receiptNumber||_?.name||null}function sa(b,_,F){var Ge;const{grantedMethod:xe}=b;if(xe===pn.TV.accessCode)return F;const $e=_?.paymentMethod;return $e?((Ge=$e.type)==null?void 0:Ge.toLowerCase())==="free"||!$e.cardLastDigits?F:`${lo($e.type,$e.cardBrand)} ****${$e.cardLastDigits}`:"\u2014"}var kn=t(577864);function ya({className:b}){return e.createElement("span",{className:(0,gn.cn)("inline-flex h-4 w-7 items-center justify-end",b),"data-testid":"payment-method-loading","aria-hidden":!0},e.createElement(kn.A,{color:"var(--text-100)",dotSize:8,loading:!0}))}function Aa({accountEntitlement:b}){var _;const{t:F}=(0,ne._h)(),{entitlement:Ge,dateGranted:xe,grantedMethod:$e,purchaseSummary:je}=b,{isPaymentSummaryLoading:He,purchaseSummary:tt}=aa({entitlementPurchaseSummary:je,grantedMethod:$e,subscriptionId:Ge._id}),it=(0,e.useMemo)(()=>{if($e===pn.TV.accessCode){const X=ha(b.accessCode,tt);return X?F("USER_ACCOUNT_TICKET_ACCESS_CODE",{code:X}):F("USER_ACCOUNT_TICKET_ACCESS_CODE_ONLY")}const k=Wo(b,tt);return k?F("USER_ACCOUNT_TICKET_PURCHASE",{price:k}):null},[b,$e,tt,F]),Ve=uo(xe),dt=$e===pn.TV.accessCode?F("USER_ACCOUNT_TICKET_GRANTED_ON"):F("USER_ACCOUNT_TICKET_PURCHASED"),N=(0,e.useMemo)(()=>sa(b,tt,F("FREE")),[b,tt,F]),R=(0,e.useMemo)(()=>{var k,X;const ye=(X=(k=tt?.paymentMethod)==null?void 0:k.cardBrand)==null?void 0:X.toLowerCase();if(ye)return Ko.J[ye]},[(_=tt?.paymentMethod)==null?void 0:_.cardBrand]);return e.createElement("article",{className:"relative rounded border border-[var(--surface-6)] bg-[var(--surface-4)]","data-testid":"userAccountTicketCard"},e.createElement("svg",{"aria-hidden":!0,className:"pointer-events-none absolute left-0 top-1/2 z-[1] -translate-x-1/2 -translate-y-1/2",height:20,width:20,viewBox:"0 0 20 20"},e.createElement("circle",{cx:10,cy:10,r:10,fill:"var(--surface-3)"}),e.createElement("path",{d:"M 10 0 A 10 10 0 0 1 10 20",fill:"none",stroke:"var(--surface-6)",strokeWidth:1})),e.createElement("div",{className:"grid min-h-[124px] grid-cols-[minmax(0,1fr)_auto] gap-x-6 gap-y-6 p-5"},e.createElement("div",{className:"min-w-0"},e.createElement("h4",{className:"line-clamp-2 text-sm font-bold leading-4 text-[var(--text-100)]"},Ge.name),it&&e.createElement("p",{className:"mt-1 text-xs font-medium leading-4 text-[var(--text-200)]"},it)),e.createElement("div",{className:"flex items-end justify-end self-stretch"},!He&&R&&e.createElement("img",{alt:"",className:"h-auto w-[28px] shrink-0",src:R})),Ve?e.createElement("div",{className:"text-xs font-medium"},e.createElement("p",{className:"leading-[14px] text-[var(--text-200)]"},dt),e.createElement("p",{className:"leading-4 text-[var(--text-100)]"},Ve)):e.createElement("span",{"aria-hidden":!0}),e.createElement("div",{className:"text-right text-xs font-medium"},e.createElement("p",{className:"leading-[14px] text-[var(--text-200)]"},F("USER_ACCOUNT_LABEL_PAYMENT_METHOD")),e.createElement("p",{className:"leading-4 text-[var(--text-100)]"},He?e.createElement("span",{className:"inline-flex justify-end"},e.createElement(ya,null)):N))))}var Jn=t(243888);const la="vod-purchase-",Xo="vod-rental-";function Oa(b){return b?b.startsWith(la)?b.slice(la.length)||null:b.startsWith(Xo)&&b.slice(Xo.length)||null:null}var jo=t(689103);function No(b,_,F=Date.now()){var Ge,xe;const{rentalState:$e,dateGranted:je,entitlement:He}=b,tt=He.rentalPolicy,it=je?Io(je):null,Ve=$e?.firstPlayedAt?Io($e.firstPlayedAt):null;if(Ve&&tt?.watchWindowHours){const dt=Ve+tt.watchWindowHours*jo.C_;if(F>=dt)return _("USER_ACCOUNT_RENTAL_STATUS_WATCHED");const N=(0,jo.jP)(_,"rentalActive",{rentalExpiresAt:dt},F);return N?.kind==="twoLine"?N.bottomText:(Ge=N?.text)!=null?Ge:null}if(!Ve&&it&&tt?.startWindowDays){const dt=it+tt.startWindowDays*jo.ec;if(F>=dt)return _("USER_ACCOUNT_RENTAL_STATUS_START_WINDOW_EXPIRED");const N=(0,jo.jP)(_,"rentalNotStarted",{rentalStartBy:dt},F);return N?.kind==="twoLine"?N.bottomText:(xe=N?.text)!=null?xe:null}return null}function Ho({accountEntitlement:b}){const[_,F]=(0,e.useState)(()=>Date.now()),{t:Ge}=(0,ne._h)(),{entitlement:xe,dateGranted:$e,grantedMethod:je,presentmentCurrency:He}=b,tt=xe.type===Fn.Q.vodRental,it=Oa(xe.sku),{video:Ve,loaded:dt}=(0,Jn.A)(it);(0,e.useEffect)(()=>
384{if(!tt)return()=>{};const me=window.setInterval(()=>{F(Date.now())},60*1e3);return()=>{window.clearInterval(me)}},[tt]);const N=dt&&Ve?.title||xe.name,R=dt&&Ve?.thumbnail?Ve.thumbnail:null,k=(0,e.useMemo)(()=>{const me=(0,ao.xh)(xe,He||"usd"),Je=me.value&&He?(0,Lo.$g)(He,me.value):"",at=Ge(tt?"USER_ACCOUNT_VOD_RENTAL":"USER_ACCOUNT_VOD_PURCHASE");return je!==pn.TV.purchased||!Je?at:`${at} \u2022 ${Je}`},[xe,je,tt,He,Ge]),X=uo($e),ye=tt?No(b,Ge,_):null;return e.createElement("article",{className:"flex gap-4 rounded bg-[var(--surface-4)] p-4"},e.createElement("div",{className:(0,gn.cn)("h-20 max-w-[138px] w-[138px] shrink-0 overflow-hidden rounded bg-[var(--surface-5)] bg-cover bg-center",!R&&"bg-[var(--surface-6)]"),style:R?{backgroundImage:`url(${R})`}:void 0,role:"img","aria-label":N}),e.createElement("div",{className:"flex min-w-0 flex-1 flex-col justify-between gap-2"},e.createElement("div",null,e.createElement("h4",{className:"line-clamp-2 text-sm font-bold leading-4 text-[var(--text-100)]"},N),e.createElement("p",{className:"mt-1 text-xs font-medium leading-4 text-[var(--text-200)]"},k),X&&e.createElement("p",{className:"mt-1 text-xs font-medium leading-4 text-[var(--text-300)]"},X)),ye&&e.createElement("p",{className:"self-end text-xs font-medium text-[var(--text-200)]"},ye)))}function mn({onClose:b}){const{t:_}=(0,ne._h)(),{memberships:F,tickets:Ge,videoPurchases:xe,videoRentals:$e}=Co(),je=(0,Ee.useSelector)(to.PY),He=xe.length>0,tt=$e.length>0,it=!F.length&&!Ge.length&&!He&&!tt;return e.createElement("div",{className:"flex flex-col gap-6 pt-4"},je&&e.createElement("p",{className:"text-xs font-medium leading-4 text-[var(--text-200)]"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_HELP_PREFIX"})," ",e.createElement("a",{className:"text-[var(--accent-primary)] underline",href:je,rel:"noopener noreferrer",target:je.startsWith("mailto:")?void 0:"_blank"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_HELP_LINK"}))),it&&e.createElement("p",{className:"text-sm text-[var(--text-300)]"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_PURCHASE_HISTORY_EMPTY"})),F.length>0&&e.createElement("section",{className:"flex flex-col gap-4"},e.createElement(yn,{count:F.length,title:_("USER_ACCOUNT_SECTION_MEMBERSHIPS")}),F.map(Ve=>{var dt;return e.createElement(Uo,{key:(dt=Ve._id)!=null?dt:Ve.entitlement._id,accountEntitlement:Ve,onClose:b})})),Ge.length>0&&e.createElement("section",{className:"flex flex-col gap-4"},e.createElement(yn,{count:Ge.length,title:_("USER_ACCOUNT_SECTION_TICKETS")}),Ge.map(Ve=>{var dt;return e.createElement(Aa,{key:(dt=Ve._id)!=null?dt:Ve.entitlement._id,accountEntitlement:Ve})})),He&&e.createElement("section",{className:"flex flex-col gap-4"},e.createElement(yn,{count:xe.length,title:_("USER_ACCOUNT_SECTION_VIDEO_PURCHASES")}),xe.map(Ve=>{var dt;return e.createElement(Ho,{key:(dt=Ve._id)!=null?dt:Ve.entitlement._id,accountEntitlement:Ve})})),tt&&e.createElement("section",{className:"flex flex-col gap-4"},e.createElement(yn,{count:$e.length,title:_("USER_ACCOUNT_SECTION_VIDEO_RENTALS")}),$e.map(Ve=>{var dt;return e.createElement(Ho,{key:(dt=Ve._id)!=null?dt:Ve.entitlement._id,accountEntitlement:Ve})})))}var io=t(897110),mo=t(789069),Pa=t(122030),$o=t(664786);const Zo={cardBackground:"var(--surface-4)",addCardFormBackgroun
384d:"var(--surface-4)"};function ia({onClose:b}){const _=(0,Ee.useDispatch)(),F=(0,Ee.useSelector)(Sn.yn),Ge=(0,Ee.useSelector)(Sn.KX);return(0,e.useEffect)(()=>{_((0,Sn.k6)())},[_]),e.createElement("section",{className:"flex flex-col gap-4"},e.createElement("h3",{className:"text-sm font-medium text-[var(--text-100)]"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_WALLET_PAYMENT_METHODS"})),e.createElement("div",{className:$o.Vo},e.createElement(Pa.A,{addCard:!0,onClose:b,defaultPaymentId:Ge??"",hideTitle:!0,payObjects:F,profileWalletColors:Zo,profileWalletLayout:!0,shouldRenderMakePrimaryPaymentMethodCheckbox:!0})))}var La=t(490396),Ia=t(928997),Go=t(949074),ko=t(864244),qo=Object.defineProperty,ca=Object.defineProperties,Ma=Object.getOwnPropertyDescriptors,_a=Object.getOwnPropertySymbols,Fa=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,da=(b,_,F)=>_ in b?qo(b,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):b[_]=F,Sa=(b,_)=>{for(var F in _||(_={}))Fa.call(_,F)&&da(b,F,_[F]);if(_a)for(var F of _a(_))Ra.call(_,F)&&da(b,F,_[F]);return b},ba=(b,_)=>ca(b,Ma(_));const Ka="h-6 shrink-0 rounded-full border-0 bg-[var(--surface-6)] px-3.5 !text-[0.625rem] !font-medium !leading-[0.75rem] text-[var(--text-100)] hover:bg-[var(--surface-6)]",Wa="min-w-0 flex-1",ja="h-10 w-10 shrink-0 px-0";function ua(b,_){if(b._id)return b._id;const{address:F}=b;return F?`${F.address1}-${F.postalCode}-${F.countryCode}-${_}`:`address-${_}`}function Ha(b){const{address:_}=b;if(!_)return[];const F=[_.address1,_.address2].filter(Boolean).join(", "),Ge=[_.city,_.state,_.postalCode].filter(Boolean).join(", "),xe=_.countryCode;return[F,Ge,xe].filter(Boolean)}function Ta(){const{t:b}=(0,ne._h)(),_=(0,Ee.useDispatch)(),F=(0,Ee.useSelector)(Go.getAccountAddresses),Ge=(0,Ee.useSelector)(Go.getAccountAddressesLoading),xe=(0,Ee.useSelector)(K.mC),$e=(0,Ee.useSelector)(ko.getShippingAddress),je=(0,Ee.useSelector)(ko.getIsShippingAddressComplete),[He,tt]=(0,e.useState)(null),[it,Ve]=(0,e.useState)(!1);(0,e.useEffect)(()=>{xe&&_((0,Go.fetchAccountAddresses)(xe))},[_,xe]);const dt=it||He!==null,N=(0,e.useMemo)(()=>F.find(De=>De._id===He),[F,He]),R=(0,e.useMemo)(()=>{if(it||!N?.address)return;const{address:De,name:ut}=N;return{name:ut||[De.firstName,De.lastName].filter(Boolean).join(" "),phone:De.phoneNumber,address:{line1:De.address1,line2:De.address2||void 0,city:De.city,state:De.state,postal_code:De.postalCode,country:De.countryCode}}}
384,[N,it]),k=it?"add-address":`edit-address-${He}`,X=(0,e.useCallback)(()=>{_((0,ko.resetShippingAddressReducer)()),tt(null),Ve(!0)},[_]),ye=(0,e.useCallback)(()=>{if(!xe||!je||!$e)return;const De=[$e.firstName,$e.lastName].filter(Boolean).join(" "),ut={address:ba(Sa({},$e),{complete:!0}),name:De||$e.firstName||"",primaryToken:xe};_(He?(0,Go.updateAddress)(ba(Sa({},ut),{addressId:He})):(0,Go.saveAddress)(ut)),Ve(!1),tt(null)},[_,He,xe,$e,je]),me=(0,e.useCallback)(()=>{_((0,ko.resetShippingAddressReducer)()),Ve(!1),tt(null)},[_]),Je=(0,e.useCallback)(De=>{_((0,ko.resetShippingAddressReducer)()),Ve(!1),tt(De)},[_]),at=(0,e.useCallback)(()=>{!xe||!He||(_((0,ko.resetShippingAddressReducer)()),Ve(!1),tt(null),_((0,Go.deleteAddress)({primaryToken:xe,addressId:He})))},[_,He,xe]);return e.createElement("section",{className:"flex flex-col gap-4"},e.createElement("h3",{className:"text-sm font-medium text-[var(--text-100)]"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_WALLET_ADDRESSES"})),e.createElement("div",{className:$o.Vo},Ge&&F.length===0?e.createElement("p",{className:"text-xs text-[var(--text-300)]"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_ADDRESSES_LOADING"})):e.createElement("ul",{className:"flex flex-col gap-3"},F.map((De,ut)=>{var Rt;const Tt=Ha(De);return e.createElement("li",{key:ua(De,ut),className:$o.W8},e.createElement("div",{className:"flex items-start justify-between gap-3"},e.createElement("div",{className:"min-w-0 flex-1"},e.createElement("p",{className:"text-sm font-bold leading-4 text-[var(--text-100)]"},De.name),Tt.map(sn=>e.createElement("p",{key:sn,className:"mt-1 text-xs font-medium leading-4 text-[var(--text-200)]"},sn)),((Rt=De.address)==null?void 0:Rt.phoneNumber)&&e.createElement("p",{className:"mt-1 text-xs font-medium leading-4 text-[var(--text-200)]"},De.address.phoneNumber)),De._id&&e.createElement(Re.$,{className:Ka,context:"site",onClick:()=>Je(De._id),type:"button",variant:"secondary"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_ADDRESS_EDIT"}))))})),dt?e.createElement("div",{className:$o.hF},e.createElement(Ia.A,{key:k,className:$o.yF,defaultValues:R,mode:"shipping",useSavedContacts:!1}),e.createElement("div",{className:$o.jM},e.createElement(Re.$,{className:Wa,context:"site",disabled:!je,onClick:ye,type:"button"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_ADDRESS_SAVE"})),e.createElement(Re.$,{className:Wa,context:"site",onClick:me,type:"button",variant:"secondary"},e.createElement(o.A,{stringKey:"ADMIN_ACTION_CANCEL"})),He&&e.createElement(Re.$,{"aria-label":b("USER_ACCOUNT_ADDRESS_DELETE"),className:ja,context:"site",onClick:at,type:"button",variant:"destructive"},e.createElement(Yn.TBR,{"aria-hidden":!0,className:"size-4"})))):e.createElement(La.A,{onClick:X,profileWalletLayout:!0,stringKey:"USER_ACCOUNT_ADDRESS_ADD"})))}function wa({onClose:b}){const _=(0,Ee.useSelector)(mo.zy);return e.createElement("div",{className:"flex flex-col gap-8 pt-4"},e.createElement(io.A,{apiKey:String(Qn.eQ),theme:_},e.createElement(ia,{onClose:b}),e.createElement(Ta,null)))}function Vo({createdDate:b,onClose:_,onEditProfile:F,onLogout:Ge,userAvatar:xe,userName:$e}){const[je,He]=(0,e.useState)("purchase-history"),tt=(0,Ee.useSelector)(K.N6),it=()=>{_(),Ge()};return e.createElement("div",{className:"box-border flex min-h-0 w-full flex-1 flex-col gap-6 bg-[var(--surface-3)] p-[30px]"},e.createElement(Xe,{onClose:_,onEditProfile:F}),e.createElement(eo,{createdDate:b,onLogout:it,userAvatar:xe,userName:$e}),!tt&&e.createElement(so.tU,{className:"flex min-h-0 flex-1 flex-col",onValueChange:He,value:je},e.createElement(so.j7,{className:(0,gn.cn)(To.E,"w-full shrink-0")},e.createElement(so.Xi,{className:To._,"data-testid":"userAccountPurchaseHistoryTab",value:"purchase-history"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_TAB_PURCHASE_HISTORY"})),e.createElement(so.Xi,{className:To._,"data-testid":"userAccountWalletTab",value:"wallet"},e.createElement(o.A,{stringKey:"USER_ACCOUNT_TAB_WALLET"}))),e.createElement(so.av,{className:"mt-0 min-h-0 flex-1 overflow-y-auto",value:"purchase-history"},e.createElement(mn,{onClose:_})),e.createElement(so.av,{className:"mt-0 min-h-0 flex-1 overflow-y-auto",value:"wallet"},e.createElement(wa,{onClose:_}))))}const Ga=({createdDate:b,data:_,doc:F,hidden:Ge,onClosePanel:xe,onClosePanelMobile:$e,onOpenPanel:je,onLogout:He,trackEngage:tt,userAvatar:it,userName:Ve})=>{const[dt,N]=(0,e.useState)(!1),[R]=(0,e.useState)(_?.initialPage==="REWARDS"?"REWARDS":"INFO"),k=(0,e.useCallback)((ye=!0)=>{ye&&tt({data:{kind:"profile"}},{action:dt?"cancel_edit_profile":"edit_profile"}),N(me=>!me)},[tt,dt]),X=$e||xe;return(0,e.useEffect)(()=>{je?.()},[je]),R==="REWARDS"?e.createElement(e.Fragment,null,e.createElement(n.A,{doc:F,kingdom:"panel",visible:!Ge}),e.createElement(v,null,e.createElement(a.A,{className:"flex-1 min-h-0"},e.createElement(we,null)))):e.createElement(e.Fragment,null,e.createElement(n.A,{doc:F,kingdom:"panel",visible:!Ge}),dt?e.createElement(Un,{toggleEditPage:k}):e.createElement(v,null,e.createElement(a.A,{className:"flex min-h-0 flex-1 flex-col"},e.createElement(Vo,{createdDate:b,onClose:X,onEditProfile:()=>k(!1),onLogout:He,userAvatar:it,userName:Ve}))))}},438228:(ve,x,t)=>{t.d(x,{A:()=>y});
384var e=t(63696),n=t(800886),a=t(171751);const d=100,f=(l,I)=>{if(!(l&&l.key))return;const{key:v}=l,m=(0,a.Th)(l.val());I&&I({key:v,payload:m})},y=({channel:l,limit:I=d,onMessage:v,onRemoved:m,onUpdated:A,property:p="messages"})=>{const h=l?`channels:v2/${l}/${p}`:null,i=(0,e.useMemo)(()=>h?n.db.database().ref(h).limitToLast(I):null,[h]);(0,e.useEffect)(()=>{if(!i||!A)return;const r=o=>{f(o,A)};return i.on("child_changed",r),()=>{i.off("child_changed",r)}},[h,I,A]),(0,e.useEffect)(()=>{if(!i||!v)return;const r=o=>{f(o,v)};return i.on("child_added",r),()=>{i.off("child_added",r)}},[h,I,v]),(0,e.useEffect)(()=>{if(!i||!m)return;const r=o=>{f(o,m)};return i.on("child_removed",r),()=>{i.off("child_removed",r)}},[h,I,m])}},784355:(ve,x,t)=>{t.d(x,{A:()=>o});var e=t(38731),n=t(718264),a=t.n(n),d=t(776637),f=t.n(d),E=t(63696),y=t(674132),l=t(642675),I=t(160788),v=Object.defineProperty,m=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(u,c,s)=>c in u?v(u,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[c]=s,i=(u,c)=>{for(var s in c||(c={}))A.call(c,s)&&h(u,s,c[s]);if(m)for(var s of m(c))p.call(c,s)&&h(u,s,c[s]);return u};const o=({collection:u,idField:c="id",keyField:s="id",items:g})=>{const P=(0,l.A)(),O=(0,E.useMemo)(()=>(g||[]).map((w,T)=>{const Y=w[c]||null,ie=w[s]||null,se=Y&&(0,e.o)([u,Y])||null;return{id:Y,index:T,key:ie,path:se}}),[u,f()(g)]);(0,E.useEffect)(()=>{for(const{path:w}of O)w&&P((0,y.B1)(w));return()=>{for(const{path:w}of O)w&&P((0,y.al)(w))}},[f()(O)]);const C=(0,I.A)(w=>O.map(({id:T,index:Y,key:ie,path:se})=>se?{data:se&&T&&(0,y.YE)(w,u,T)||null,id:T,index:Y,key:ie,loaded:!!(se&&T&&(0,y.pY)(w,u,T))}:{data:null,id:T,index:Y,key:ie,loaded:!1}),a());return(0,E.useMemo)(()=>{const w=C.map(({data:T,id:Y})=>i({id:Y},T));return{rawData:C,loadedDocuments:w}},[f()(C)])}},103742:(ve,x,t)=>{t.d(x,{A:()=>A});var e=t(38731),n=t(718264),a=t.n(n),d=t(63696),f=t(674132),E=t(642675),y=t(160788);const l=new Set;let I=!1;const v=p=>{if(I)return;I=!0;const h=()=>{if(I=!1,l.size===0)return;const i=Array.from(l);l.clear(),p((0,f.Y2)(i))};typeof queueMicrotask=="function"?queueMicrotask(h):setTimeout(h,0)},A=(p,h)=>{const i=(0,d.useMemo)(()=>h&&(0,e.o)([p,h])||null,[p,h]),r=(0,E.A)();(0,d.useEffect)(()=>{if(i)return l.delete(i),r((0,f.B1)(i)),()=>{l.add(i),v(r)}},[i]);const o=(0,y.A)(c=>i&&h&&(0,f.pY)(c,p,h),a());return[(0,y.A)(c=>i&&h&&(0,f.YE)(c,p,h),a()),!!o]}},399597:(ve,x,t)=>{t.d(x,{A:()=>m});var e=t(38731),n=t(718264),a=t.n(n),d=t(776637),f=t.n(d),E=t(63696),y=t(674132),l=t(642675),I=t(160788);const m=A=>{const p=(0,E.useMemo)(()=>A.map(({collection:o,id:u})=>({collection:o,id:u,path:u&&(0,e.o)([o,u])||null})),[f()(A)]),h=(0,l.A)();(0,E.useEffect)(()=>{for(const{path:o}of p)o&&h((0,y.B1)(o));return()=>{for(const{path:o}of p)o&&h((0,y.al)(o))}},[f()(p)]);const i=(0,I.A)(o=>p.map(({collection:u,id:c,path:s})=>!!(s&&c&&(0,y.pY)(o,u,c))),a());return[(0,I.A)(o=>p.map(({collection:u,id:c,path:s})=>s&&c?(0,y.YE)(o,u,c):null),a()),i]}},392799:(ve,x,t)=>{t.r(x),t.d(x,{APPLY_LISTENER_CHANGES:()=>l,CLEANUP_PATH:()=>v,DECREMENT_LISTENER:()=>y,INCREMENT_LISTENER:()=>E,SUBSCRIBE:()=>n,UNSUBSCRIBE:()=>a,UNSUBSCRIBE_BATCH:()=>d,UNSUBSCRIBE_COLLECTION:()=>f,UPDATE_DOCUMENT:()=>I,applyListenerChanges:()=>o,cleanupPath:()=>p,decrementListener:()=>A,incrementListener:()=>m,subscribe:()=>h,unsubscribe:()=>i,unsubscribeBatch:()=>r,unsubscribeCollection:()=>u,updateDocument:()=>c});var e=t(304006);const n="realtime/SUBSCRIBE",a="realtime/UNSUBSCRIBE",d="realtime/UNSUBSCRIBE_BATCH",f="realtime/UNSUBSCRIBE_COLLECTIO",E="realtime/INCREMENT_LISTENER",y="realtime/DECREMENT_LISTENER",l="realtime/APPLY_LISTENER_CHANGES",I="realtime/UPDATE_DOCUMENT",v="realtime/CLEANUP_PATH",m=(0,e.dQ)(E,s=>({payload:s})),A=(0,e.dQ)(y,s=>({payload:s})),p=(0,e.dQ)(v,s=>({payload:s})),h=(0,e.dQ)(n,s=>({payload:s})),i=(0,e.dQ)(a,s=>({payload:s})),r=(0,e.dQ)(d,s=>({payload:s})),o=(0,e.dQ)(l,s=>({payload:s})),u=(0,e.dQ)(f,s=>({payload:s})),c=(0,e.dQ)(I,({path:s,value:g})=>({payload:{path:s,value:g}}))},89907:(ve,x,t)=>{t.r(x),t.d(x,{configureRealtimeBridge:()=>y,notify:()=>E,subscribe:()=>f});var e=t(392799),n=t(60058);const a=new Set;let d=null;const f=(l,I)=>{const v=d?.();v?.dispatch((0,e.subscribe)(l));const m=[l,p=>{try{I(p)}catch{}}];a.add(m);const A=v?(0,n.WU)(v.getState())[l]:void 0;return A&&m[1](A),()=>{d?.().dispatch((0,e.unsubscribe)(l)),a.delete(m)}},E=(l,I)=>{a.forEach(([v,m])=>{v===l&&m(I)})},y=l=>{d=l}}
384,674132:(ve,x,t)=>{t.d(x,{_o:()=>e.UPDATE_DOCUMENT,YE:()=>n.YE,pY:()=>n.pY,fn:()=>g,B1:()=>e.subscribe,al:()=>e.unsubscribe,Y2:()=>e.unsubscribeBatch});var e=t(392799),n=t(60058),a=t(647020),d=t(627245),f=t(552063),E=t(800886),y=t(908681),l=t(100035),I=t(171751),v=t(218938),m=t(890279),A=t(89907),p=t(80247);const h=d.A.database.Reference,i=P=>(0,y.Od)(O=>{const C=P.on("value",W=>{O({value:W?(0,I.Th)(W.val()):null})});return()=>{P.off("value",C)}},y.u2.sliding(1)),r=function*(P,O){const C=yield(0,l.Lt)(),W=(0,v.mC)(C),w=P.split("/").find(Boolean);return w?yield(0,l.T1)(m.M,w,O,W):O},o=function*(P){let O=null;try{const C=yield(0,l.T1)(E.cX,P);for(O=yield(0,l.T1)(i,C);;){const{value:W}=yield(0,l.s)(O);if(!W)continue;const w=yield(0,l.T1)(r,P,W);(0,m.x)(w)||(yield(0,l.yJ)((0,e.updateDocument)({path:P,value:w})),(0,A.notify)(P,w))}}catch(C){p.error(C)}finally{(yield(0,l.KW)())&&O?.close()}},u=(P,O)=>P.realtime.listeners[O]||0,c=function*(P,O){const C=yield(0,l.Lt)(),{type:W}=O;if(W===e.SUBSCRIBE){const w=O.payload;if(u(C,w)===0){const T=yield(0,l.cH)(o,w);P.set(w,T)}yield(0,l.yJ)((0,e.incrementListener)(w))}else if(W===e.UNSUBSCRIBE){const w=O.payload,T=u(C,w);if(T===1){const Y=P.get(w);Y&&(yield(0,l.ZT)(Y),yield(0,l.yJ)((0,e.cleanupPath)(w)),P.delete(w))}else T>1&&(yield(0,l.yJ)((0,e.decrementListener)(w)))}else if(W===e.UNSUBSCRIBE_BATCH){const w=O.payload,T=[],Y=[];for(const ie of w){const se=u(C,ie);if(se===1){T.push(ie);const q=P.get(ie);q&&(yield(0,l.ZT)(q),P.delete(ie))}else se>1&&Y.push(ie)}(T.length>0||Y.length>0)&&(yield(0,l.yJ)((0,e.applyListenerChanges)({cleanup:T,decrement:Y})))}else if(W===e.UNSUBSCRIBE_COLLECTION){const w=O.payload;for(const[T,Y]of P)T.indexOf(`${w}/`)===0&&Y&&(yield(0,l.ZT)(Y),yield(0,l.yJ)((0,e.cleanupPath)(T)),P.delete(T))}},g=function*(){const P=new Map,O=yield(0,l.wE)([e.SUBSCRIBE,e.UNSUBSCRIBE,e.UNSUBSCRIBE_BATCH,e.UNSUBSCRIBE_COLLECTION],y.u2.expanding(64));for(;;){const C=yield(0,l.s)(O);yield(0,l.T1)(c,P,C)}}},647020:(ve,x,t)=>{t.d(x,{A:()=>r});var e=t(304006),n=t(392799),a=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,I=(o,u,c)=>u in o?a(o,u,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[u]=c,v=(o,u)=>{for(var c in u||(u={}))y.call(u,c)&&I(o,c,u[c]);if(E)for(var c of E(u))l.call(u,c)&&I(o,c,u[c]);return o},m=(o,u)=>d(o,f(u)),A=o=>typeof o=="symbol"?o:o+"",p=(o,u)=>{var c={};for(var s in o)y.call(o,s)&&u.indexOf(s)<0&&(c[s]=o[s]);if(o!=null&&E)for(var s of E(o))u.indexOf(s)<0&&l.call(o,s)&&(c[s]=o[s]);return c};const h=()=>({documents:{},listeners:{}}),r=(0,e.T1)(n,h,(o,u)=>{switch(u.type){case n.CLEANUP_PATH:{const c=u.payload,s=o.documents,{[c]:g}=s,P=p(s,[A(c)]),O=o.listeners,{[c]:C}=O,W=p(O,[A(c)]);return m(v({},o),{documents:P,listeners:W})}case n.INCREMENT_LISTENER:{const c=u.payload;return m(v({},o),{listeners:m(v({},o.listeners),{[c]:(o.listeners[c]||0)+1})})}case n.DECREMENT_LISTENER:{const c=u.payload;return m(v({},o),{listeners:m(v({},o.listeners),{[c]:Math.max(o.listeners[c],1)-1})})}case n.APPLY_LISTENER_CHANGES:{const{decrement:c,cleanup:s}=u.payload;if(c.length===0&&s.length===0)return o;const g=v({},o.listeners),P=s.length>0?v({},o.documents):o.documents;for(const O of s)delete g[O],delete P[O];for(const O of c)g[O]=Math.max(g[O]||0,1)-1;return m(v({},o),{listeners:g,documents:P})}case n.UPDATE_DOCUMENT:{const{path:c,value:s}=u.payload,g=o.documents,{[c]:P}=g,O=p(g,[A(c)]);return P===void 0&&s===void 0?o:m(v({},o),{documents:v(v({},O),s!==void 0&&{[c]:s})})}default:return o}})},60058:(ve,x,t)=>{t.d(x,{$U:()=>I,CJ:()=>v,Mv:()=>l,WU:()=>a,YE:()=>f,pY:()=>d,rN:()=>y});var e=t(980672),n=t(816970);const a=m=>m.realtime.documents,d=(m,A,p)=>
384m.realtime.documents[(0,n.hI)(A,p)]!==void 0,f=(0,e.Mz)((m,A,p)=>m.realtime.documents[(0,n.hI)(A,p)],m=>m===void 0?null:m),E=(m,A)=>Object.entries(m).reduce((p,[h,i])=>(h.startsWith(A)&&(p[h]=i),p),{}),y=(0,e.Mz)(a,m=>E(m,"streamprovideraccount")),l=(0,e.Mz)(a,m=>E(m,"video")),I=(0,e.Mz)(a,m=>E(m,"stream")),v=(m,A,p)=>m.realtime.listeners[(0,n.hI)(A,p)]!==void 0},387632:(ve,x,t)=>{t.d(x,{A:()=>I});var e=t(63696),n=t(103742),a=t(776637),d=t.n(a),f=t(224191),E=t.n(f),y=t(209095),l=t(298116);function I({children:v=null,id:m=null,onValue:A}){const h=(0,f.useSelector)(y.L3)[l.Xj.PAGES_V3]?"pages":"objects",[i,r]=(0,n.A)(h,m);return(0,e.useEffect)(()=>{A?.(i,r)},[d()(i),r,A]),e.createElement(e.Fragment,null,(typeof v=="function"?v(i,r):v)||null)}},275669:(ve,x,t)=>{t.d(x,{A:()=>y,a:()=>f});var e=t(63696),n=t(273277),a=t(642675),d=t(160788);const f=50,y=()=>{const l=(0,a.A)(),I=(0,d.A)(n.Io),v=(0,d.A)(n.kV),m=(0,d.A)(n.ko),A=I.parents.length,p=!(v>0&&A>=v),h=(0,e.useCallback)(()=>{m||!p||l((0,n.lk)(A,f))},[l,m,p,A]),i=(0,e.useCallback)(r=>{l((0,n.c)(r))},[l]);return{loadedCount:A,isLoadingMore:m,canLoadMore:p,loadMore:h,search:i}}},955640:(ve,x,t)=>{t.d(x,{c:()=>l});var e=t(63696),n=t(224191),a=t.n(n),d=t(273277),f=t(776637),E=t.n(f),y=t(253251);const l=I=>{const v=(0,n.useSelector)(d.Dc),m=(0,n.useSelector)(d.hV),A=(0,n.useSelector)(d.Io),p=(0,e.useMemo)(()=>I===v._id?v:I===m._id?m:A,[I,E()(v),E()(m),E()(A)]),h=!!p._id&&p._id===A._id,i=e.useCallback(o=>(0,y.FX)(A,o),[E()(A)]),r=e.useCallback(o=>(0,y.Nn)(A,o),[E()(A)]);return{navigationData:p,getSlugById:r,getPathBySlug:i,isDefaultNavigation:h}}},995688:(ve,x,t)=>{t.d(x,{A:()=>I});var e=t(63696),n=t(160788),a=t(199749),d=t(734082),f=t(365179),E=t(424024),y=t(654581);const I=()=>{const v=(0,n.A)(E.L_),m=(0,n.A)(a.a0),A=(0,n.A)(a.wr),p=(0,n.A)(d.LH),h=(0,n.A)(a.yR),i=(0,n.A)(d.Yg),r=(0,n.A)(f.nin),o=(0,n.A)(f.DyV),u=(0,n.A)(a.jE),c=(0,n.A)(a.zV),s=(0,n.A)(d.VC),g=(0,n.A)(y.fX),P=(0,e.useMemo)(()=>s&&!h||m,[h,s,m]),O=(0,e.useMemo)(()=>P&&(g||!i)&&!m&&!u&&!c,[i,P,m,g,u,c]),C=(0,e.useMemo)(()=>!c&&!o&&(!(h||A)&&!(r&&!v.length)&&p||m),[v.length,h,r,o,A,p,m,c]);return{showMobile:P,showMobileLayout:O,showSidebar:C}}},230152:(ve,x,t)=>{t.d(x,{A:()=>l});var e=t(63696),n=t(224191),a=t.n(n),d=t(272568),f=t(300024),E=t(45597);const l=()=>{const I=(0,n.useDispatch)(),v=(0,n.useSelector)(d.S);return e.useCallback(m=>{I((0,E.sx)({event:f.n.NAVBAR,properties:{element:m.element,menu:m.menu||v}}))},[I,v])}},364233:(ve,x,t)=>{t.r(x),t.d(x,{ADD_PENDING_NAVIGATION_ACTION:()=>E,CLEAR_PENDING_NAVIGATION_ACTIONS:()=>y,DISMISS_PENDING_NAVIGATION_ACTIONS:()=>d,RESUME_PENDING_NAVIGATION_ACTIONS:()=>f,SET_IS_USER_ACTION_REQUESTED_TO_UNBLOCK_NAVIGATION:()=>a,SET_NAVIGATION_BLOCKED:()=>n,addPendingNavigationAction:()=>A,clearPendingNavigationActions:()=>p,dismissPendingNavigationActions:()=>v,resumePendingNavigationActions:()=>m,setIsUserActionRequestedToUnblockNavigation:()=>I,setNavigationBlocked:()=>l});var e=t(304006);const n="navigation/SET_NAVIGATION_BLOCKED",a="navigation/SET_IS_USER_ACTION_REQUESTED_TO_UNBLOCK_NAVIGATION",d="navigation/DISMISS_PENDING_NAVIGATION_ACTIONS",f="navigation/RESUME_PENDING_NAVIGATION_ACTIONS",E="navigation/ADD_NAVIGATION_ACTION",y="navigation/CLEAR_PENDING_NAVIGATION_ACTIONS",l=(0,e.dQ)(n,h=>({payload:h})),I=(0,e.dQ)(a,h=>({payload:h})),v=(0,e.dQ)(d),m=(0,e.dQ)(f),A=(0,e.dQ)(E,h=>({payload:h})),p=(0,e.dQ)(y)},425615:(ve,x,t)=>{t.d(x,{Cd:()=>e.DISMISS_PENDING_NAVIGATION_ACTIONS,p4:()=>e.RESUME_PENDING_NAVIGATION_ACTIONS,$g:()=>e.addPendingNavigationAction,C5:()=>e.clearPendingNavigationActions,YC:()=>e.setIsUserActionRequestedToUnblockNavigation,Jb:()=>e.setNavigationBlocked});var e=t(364233),n=t(980672);const a=(0,n.Mz)(f=>f.navigation.isUserActionRequested,f=>f);var d=t(81010)},81010:(ve,x,t)=>{t.d(x,{A:()=>h});var e=t(304006),n=t(364233),a=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,I=(i,r,o)=>r in i?a(i,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[r]=o,v=(i,r)=>{for(var o in r||(r={}))y.call(r,o)&&I(i,o,r[o]);if(E)for(var o of E(r))l.call(r,o)&&I(i,o,r[o]);return i},m=(i,r)=>d(i,f(r));const A=()=>({isBlocked:!1,isUserActionRequested:!1,pendingNavigationActions:[]}),h=(0,e.T1)(n,A,(i,r)=>{switch(r.type){case n.SET_NAVIGATION_BLOCKED:return m(v({},i),{isBlocked:r.payload});case n.SET_IS_USER_ACTION_REQUESTED_TO_UNBLOCK_NAVIGATION:return m(v({},i),{isUserActionRequested:r.payload});case n.CLEAR_PENDING_NAVIGATION_ACTIONS:return m(v({},i),{pendingNavigationActions:[]});case n.ADD_PENDING_NAVIGATION_ACTION:return m(v({},i),{pendingNavigationActions:[...i.pendingNavigationActions,r.payload]});default:return i}})},422913:(ve,x,t)=>{t.r(x),t.d(x,{ADD_FOLDER_TO_CUSTOM_NAVIGATION:()=>C,ADD_ITEM_TO_CUSTOM_NAVIGATION:()=>O,ADD_LINK_TO_NAVIGATION:()=>v,APPEND_DEFAULT_NAVIGATION_PARENTS:()=>Ee,CREATE_CUSTOM_NAVIGATION:()=>g,CREATE_CUSTOM_NAVIGATION_LOADING:()=>P,DELETE_NAVIGATION:()=>a,FETCH_ALL_NAVIGATIONS:()=>A,FETCH_DEFAULT_NAVIGATION_PAGE:()=>we,FETCH_DEFAULT_NAVIGATION_SEARCH:()=>K,FETCH_FULL_DEFAULT_NAVIGATION:()=>G,INSERT_ITEM_INTO_DEFAULT_NAVIGATION:()=>r,MOVE_NAVIGATION_ITEM:()=>o,REMOVE_ITEM_FROM_CUSTOM_NAVIGATION:()=>W,REMOVE_ITEM_FROM_NAVIGATIONS:()=>p,REMOVE_LINK_FROM_NAVIGATION:()=>m,REMOVE_NAVIGATION_FOLDER:()=>s,REVERT_NAVIGATION_MOVE:()=>u,SET_CREATE_LINK_FOR_CUSTOM_NAVIGATION:()=>w,SET_DEFAULT_NAVIGATION_SEARCH_RESULTS:()=>re,SET_DEFAULT_NAVIGATION_TOTAL:()=>pt,SET_EDITABLE_FOLDER_ID_IN_NAVIGATION_BLOCK:()=>f,SET_EDITABLE_FOLDER_ID_IN_SITE_NAVIGATION:()=>d,SET_HAS_FULL_DEFAULT_NAVIGATION:()=>pe,SET_LOADING_MORE_NAVIGATION:()=>$,SET_NAVIGATIONS:()=>I,SET_NAVIGATION_APPLIED_IN_THE_PAGE:()=>l,SET_NAVIGATION_SELECTED_IN_THE_DROPDOWN:()=>y,SET_SEARCH_TEXT:()=>E,UPDATE_NAVIGATION:()=>n,UPDATE_PAGE_IN_NAVIGATIONS:()=>h,UPDATE_SITE_STRUCTURE:()=>i,UPSERT_NAVIGATION_FOLDER:()=>c,addFolderToCustomNavigation:()=>Nt,addItemToCustomNavigation:()=>gt,addLinkToNavigation:()=>_e,appendDefaultNavigationParents:()=>le,createCustomNavigation:()=>ct,deleteNavigation:()=>Y,fetchAllNavigations:()=>J,fetchDefaultNavigationPage:()=>ge,fetchDefaultNavigationSearch:()=>Ke,fetchFullDefaultNavigation:()=>Ce,insertItemIntoDefaultNavigation:()=>Pe,moveNavigationItem:()=>rt,removeItemFromCustomNavigation:()=>j,removeItemFromNavigations:()=>B,removeLinkFromNavigation:()=>Le,removeNavigationFolder:()=>
384bt,revertNavigationMove:()=>Pt,setCreateCustomNavigationLoading:()=>Ne,setCreateLinkForCustomNavigation:()=>H,setDefaultNavigationSearchResults:()=>vt,setDefaultNavigationTotal:()=>ce,setEditableFolderIdInNavigationBlock:()=>se,setEditableFolderIdInSiteNavigation:()=>ie,setHasFullDefaultNavigation:()=>Fe,setLoadingMoreNavigation:()=>ne,setNavigationAppliedInThePage:()=>te,setNavigationSelectedInTheDropdown:()=>Z,setNavigations:()=>fe,setSearchText:()=>q,updateNavigation:()=>T,updatePageInNavigations:()=>U,updateSiteStructure:()=>oe,upsertNavigationFolder:()=>Vt});var e=t(304006);const n="navigationv2/UPDATE_NAVIGATION",a="navigationv2/DELETE_NAVIGATION",d="navigationv2/SET_EDITABLE_FOLDER_ID_IN_SITE_NAVIGATION",f="navigationv2/SET_EDITABLE_FOLDER_ID_IN_NAVIGATION_BLOCK",E="navigationv2/SET_SEARCH_TEXT",y="navigationv2/SET_NAVIGATION_SELECTED_IN_THE_DROPDOWN",l="navigationv2/SET_NAVIGATION_APPLIED_IN_THE_PAGE",I="navigationv2/SET_NAVIGATIONS",v="navigationv2/ADD_LINK_TO_NAVIGATION",m="navigationv2/REMOVE_LINK_FROM_NAVIGATION",A="navigationv2/FETCH_ALL_NAVIGATIONS",p="navigationv2/REMOVE_ITEM_FROM_NAVIGATIONS",h="navigationv2/UPDATE_PAGE_IN_NAVIGATIONS",i="navigationv2/UPDATE_SITE_STRUCTURE",r="navigationv2/INSERT_ITEM_INTO_DEFAULT_NAVIGATION",o="navigationv2/MOVE_NAVIGATION_ITEM",u="navigationv2/REVERT_NAVIGATION_MOVE",c="navigationv2/UPSERT_NAVIGATION_FOLDER",s="navigationv2/REMOVE_NAVIGATION_FOLDER",g="navigationv2/CREATE_CUSTOM_NAVIGATION",P="navigationv2/CREATE_CUSTOM_NAVIGATION_LOADING",O="navigationv2/ADD_ITEM_TO_CUSTOM_NAVIGATION",C="navigationv2/ADD_FOLDER_TO_CUSTOM_NAVIGATION",W="navigationv2/REMOVE_ITEM_FROM_CUSTOM_NAVIGATION",w="navigationv2/SET_CREATE_LINK_FOR_CUSTOM_NAVIGATION",T=(0,e.dQ)(n,Ae=>({payload:Ae})),Y=(0,e.dQ)(a,Ae=>({payload:Ae})),ie=(0,e.dQ)(d,Ae=>({payload:Ae})),se=(0,e.dQ)(f,Ae=>({payload:Ae})),q=(0,e.dQ)(E,Ae=>({payload:Ae})),Z=(0,e.dQ)(y,Ae=>({payload:Ae})),te=(0,e.dQ)(l,(Ae,Dt)=>({payload:{navigationId:Ae,pageId:Dt}})),Ne=(0,e.dQ)(P,Ae=>({payload:Ae})),fe=(0,e.dQ)(I,Ae=>({payload:Ae})),_e=(0,e.dQ)(v,(Ae,Dt)=>({payload:{navigationId:Ae,link:Dt}})),Le=(0,e.dQ)(m,(Ae,Dt)=>({payload:{navigationId:Ae,linkId:Dt}})),ct=(0,e.dQ)(g,({navigationToCopyDataFrom:Ae,navName:Dt})=>({payload:{navigationToCopyDataFrom:Ae,navName:Dt}})),gt=(0,e.dQ)(O,(Ae,Dt)=>({payload:{newParent:Ae,navigationId:Dt}})),Nt=(0,e.dQ)(C,Ae=>({payload:Ae})),j=(0,e.dQ)(W,(Ae,Dt)=>({payload:{navigationId:Ae,itemId:Dt}})),H=(0,e.dQ)(w,({isAddingLink:Ae,linkName:Dt})=>({payload:{isAddingLink:Ae,linkName:Dt}})),J=(0,e.dQ)(A,()=>({payload:{}})),B=(0,e.dQ)(p,Ae=>({payload:Ae})),U=(0,e.dQ)(h,(Ae,Dt,Yt,Ie)=>({payload:{pageId:Ae,newName:Dt,newSlug:Yt,newPrivate:Ie}})),oe=(0,e.dQ)(i,Ae=>({payload:Ae})),Pe=(0,e.dQ)(r,(Ae,Dt)=>({payload:{navItem:Ae,navigationParentId:Dt}})),we="navigationv2/FETCH_DEFAULT_NAVIGATION_PAGE",Ee="navigationv2/APPEND_DEFAULT_NAVIGATION_PARENTS",pt="navigationv2/SET_DEFAULT_NAVIGATION_TOTAL",$="navigationv2/SET_LOADING_MORE_NAVIGATION",K="navigationv2/FETCH_DEFAULT_NAVIGATION_SEARCH",G="navigationv2/FETCH_FULL_DEFAULT_NAVIGATION",pe="navigationv2/SET_HAS_FULL_DEFAULT_NAVIGATION",re="navigationv2/SET_DEFAULT_NAVIGATION_SEARCH_RESULTS",ge=(0,e.dQ)(we,(Ae,Dt)=>({payload:{offset:Ae,limit:Dt}})),le=(0,e.dQ)(Ee,Ae=>({payload:Ae}
384)),ce=(0,e.dQ)(pt,Ae=>({payload:Ae})),ne=(0,e.dQ)($,Ae=>({payload:Ae})),Ke=(0,e.dQ)(K,Ae=>({payload:Ae})),Ce=(0,e.dQ)(G,()=>({payload:void 0})),Fe=(0,e.dQ)(pe,Ae=>({payload:Ae})),vt=(0,e.dQ)(re,Ae=>({payload:Ae})),rt=(0,e.dQ)(o,Ae=>({payload:Ae})),Pt=(0,e.dQ)(u,Ae=>({payload:Ae})),Vt=(0,e.dQ)(c,Ae=>({payload:Ae})),bt=(0,e.dQ)(s,Ae=>({payload:Ae}))},191922:(ve,x,t)=>{t.d(x,{$3:()=>A,B3:()=>o,DR:()=>c,Le:()=>p,MH:()=>m,OE:()=>u,PD:()=>s,UK:()=>v,xn:()=>i,zy:()=>r});var e=t(990220),n=t(445525),a=Object.defineProperty,d=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,y=(g,P,O)=>P in g?a(g,P,{enumerable:!0,configurable:!0,writable:!0,value:O}):g[P]=O,l=(g,P)=>{for(var O in P||(P={}))f.call(P,O)&&y(g,O,P[O]);if(d)for(var O of d(P))E.call(P,O)&&y(g,O,P[O]);return g},I=(g,P)=>{var O={};for(var C in g)f.call(g,C)&&P.indexOf(C)<0&&(O[C]=g[C]);if(g!=null&&d)for(var C of d(g))P.indexOf(C)<0&&E.call(g,C)&&(O[C]=g[C]);return O};const v=async({primaryToken:g,siteId:P,navigation:O})=>{const C=O,{_id:W}=C,w=I(C,["_id"]);return(await(0,n.Ay)({primaryToken:g,siteId:P}).patch(`${e.pj}/${W}`,w)).data},m=async({primaryToken:g,siteId:P,navigation:O})=>(await(0,n.Ay)({primaryToken:g,siteId:P}).post(`${e.pj}/`,O)).data,A=async({primaryToken:g,siteId:P,navigationId:O})=>(await(0,n.Ay)({primaryToken:g,siteId:P}).delete(`${e.pj}/${O}`)).data,p=async({primaryToken:g,siteId:P})=>(await(0,n.Ay)({primaryToken:g,siteId:P}).get(`${e.pj}/`)).data,h=async({primaryToken:g,siteId:P})=>(await maestroApiRequest({primaryToken:g,siteId:P}).get(`${NAVIGATION_SERVICE_BASE_URL}/default/navigation`)).data,i=async({primaryToken:g,siteId:P,navigationId:O})=>(await(0,n.Ay)({primaryToken:g,siteId:P}).get(`${e.pj}/${O}`)).data,r=async({primaryToken:g,siteId:P,limit:O,offset:C,search:W})=>{const w={limit:O,offset:C};return W&&(w.search=W),(await(0,n.Ay)({primaryToken:g,siteId:P}).get(`${e.pj}/default/navigation`,{params:w})).data},o=async({primaryToken:g,siteId:P,navigationId:O,op:C,viewOffset:W,viewLimit:w})=>(await(0,n.Ay)({primaryToken:g,siteId:P}).post(`${e.pj}/move`,l(l(l({navigationId:O},C),W!==void 0&&{viewOffset:W}),w!==void 0&&{viewLimit:w}))).data,u=async({primaryToken:g,siteId:P,navigationId:O,folderId:C,name:W,slug:w,insertBeforeId:T,viewOffset:Y,viewLimit:ie})=>(await(0,n.Ay)({primaryToken:g,siteId:P}).post(`${e.pj}/folder`,l(l(l({navigationId:O,folderId:C,name:W,slug:w},T!=null&&{insertBeforeId:T}),Y!==void 0&&{viewOffset:Y}),ie!==void 0&&{viewLimit:ie}))).data,c=async({primaryToken:g,siteId:P,navigationId:O,folderId:C,viewOffset:W,viewLimit:w})=>{const T={};return W!==void 0&&(T.viewOffset=W),w!==void 0&&(T.viewLimit=w),(await(0,n.Ay)({primaryToken:g,siteId:P}).delete(`${e.pj}/${O}/folder/${C}`,{params:T})).data},s=async({primaryToken:g,siteId:P,navigationId:O,pageId:C})=>{await(0,n.Ay)({primaryToken:g,siteId:P}).post(`${e.pj}/apply/${O}`,{pageId:C})}},273277:(ve,x,t)=>{t.d(x,{I5:()=>e.addFolderToCustomNavigation,zm:()=>e.addItemToCustomNavigation,bO:()=>e.addLinkToNavigation,U5:()=>e.createCustomNavigation,_Q:()=>e.deleteNavigation,jf:()=>e.fetchAllNavigations,lk:()=>e.fetchDefaultNavigationPage,c:()=>e.fetchDefaultNavigationSearch,ML:()=>n.ML,J1:()=>n.J1,TL:()=>n.TL,Io:()=>n.Io,KY:()=>n.KY,kV:()=>n.kV,w$:()=>n.w$,qi:()=>n.qi,ko:()=>n.ko,hV:()=>n.hV,Dc:()=>n.Dc,mL:()=>n.mL,Kk:()=>n.Kk,G6:()=>e.insertItemIntoDefaultNavigation,Dl:()=>e.moveNavigationItem,n4:()=>e.removeItemFromCustomNavigation,hg:()=>e.removeItemFromNavigations,Nv:()=>e.removeLinkFromNavigation,vu:()=>e.removeNavigationFolder,on:()=>e.revertNavigationMove,fn:()=>Ee,vi:()=>e.setCreateLinkForCustomNavigation,eS:()=>e.setDefaultNavigationSearchResults,uE:()=>e.setDefaultNavigationTotal,A7:()=>e.setEditableFolderIdInNavigationBlock,mS:()=>e.setEditableFolderIdInSiteNavigation,BN:()=>e.setNavigationAppliedInThePage,th:()=>e.setNavigationSelectedInTheDropdown,i1:()=>e.setNavigations,Uz:()=>e.setSearchText,e9:()=>e.updateNavigation,lZ:()=>e.updatePageInNavigations,cN:()=>e.updateSiteStructure,uG:()=>e.upsertNavigationFolder});var e=t(422913),n=t(37456),a=t(100035),d=t(304006),f=t(463302),E=t(400781),y=t(30842),l=t(816970),I=t(253251),v=t(89649),m=t
384(711678),A=t(171751),p=t(191922),h=t(275669),i=t(80247),r=Object.defineProperty,o=Object.defineProperties,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,P=($,K,G)=>K in $?r($,K,{enumerable:!0,configurable:!0,writable:!0,value:G}):$[K]=G,O=($,K)=>{for(var G in K||(K={}))s.call(K,G)&&P($,G,K[G]);if(c)for(var G of c(K))g.call(K,G)&&P($,G,K[G]);return $},C=($,K)=>o($,u(K));const W=(0,d.N$)({updateNavigation:e.updateNavigation},function*({payload:$}){try{const K=yield(0,a.Lt)(),G=(0,f.mC)(K),pe=(0,E.V2)(K);yield(0,a.T1)(p.UK,{primaryToken:G,siteId:pe,navigation:$})}catch(K){i.error("updateNavigationSaga failed. error:",K)}}),w=(0,d.N$)({setNavigationAppliedInThePage:e.setNavigationAppliedInThePage},function*({payload:$}){try{const K=yield(0,a.Lt)(),G=(0,f.mC)(K),pe=(0,E.V2)(K),{navigationId:re,pageId:ge}=$;yield(0,a.T1)(p.PD,{primaryToken:G,siteId:pe,navigationId:re,pageId:ge})}catch(K){i.error("setNavigationAppliedInThePageSaga failed. error:",K)}}),T=(0,d.N$)({addLinkToNavigation:e.addLinkToNavigation},function*({payload:{navigationId:$,link:K}}){try{const G=yield(0,a.Lt)(),re=(0,n.mL)(G).find(ge=>ge._id===$);if(!re)return;yield(0,a.yJ)((0,e.updateNavigation)({_id:$,externalLinks:[...re.externalLinks,K]}))}catch(G){i.error("addLinkToNavigationSaga failed. error:",G)}}),Y=(0,d.N$)({removeLinkFromNavigation:e.removeLinkFromNavigation},function*({payload:{navigationId:$,linkId:K}}){try{const G=yield(0,a.Lt)(),re=(0,n.mL)(G).find(ge=>ge._id===$);if(!re)return;yield(0,a.yJ)((0,e.updateNavigation)({_id:$,externalLinks:re.externalLinks.filter(ge=>ge.id!==K)}))}catch(G){i.error("removeLinkFromNavigationSaga failed. error:",G)}}),ie=(0,d.N$)({createCustomNavigation:e.createCustomNavigation},function*({payload:{navName:$,navigationToCopyDataFrom:K}}){try{yield(0,a.yJ)((0,e.setCreateCustomNavigationLoading)(!0));const G=yield(0,a.Lt)(),pe=(0,f.mC)(G),re=(0,E.V2)(G),ge=(0,n.mL)(G),le=K?`Copy of ${K.name}`.slice(0,I.mR):$||"Custom Navigation",ne={name:(0,I.bD)(ge,le),siteId:re,parents:K?.parents||[],externalLinks:K?.externalLinks||[],type:y.YR.custom},Ke=yield(0,a.T1)(p.MH,{primaryToken:pe,siteId:re,navigation:ne});yield(0,a.yJ)((0,e.setNavigations)([...ge,Ke])),yield(0,a.yJ)((0,e.setNavigationSelectedInTheDropdown)(Ke._id))}catch(G){i.error("createCustomNavigationSaga failed. error:",G)}finally{yield(0,a.yJ)((0,e.setCreateCustomNavigationLoading)(!1))}}),se=(0,d.N$)({deleteNavigation:e.deleteNavigation},function*({payload:$}){try{const K=yield(0,a.Lt)(),G=(0,f.mC)(K),pe=(0,E.V2)(K),re=(0,n.mL)(K),ge=yield(0,a.T1)(p.$3,{primaryToken:G,siteId:pe,navigationId:$});if(!ge.result&&ge.pages.length){yield(0,a.yJ)((0,v.to)({data:{pages:ge.pages,feature:"navigation"},kind:m.V.activeOnPageModal}));return}yield(0,a.yJ)((0,e.setNavigations)(re.filter(le=>le._id!==$)))}catch(K){i.error("deleteNavigationSaga failed. error:",K)}}),q=($,K)=>{const G=K.find(pe=>pe.type===y.YR.default);return{_id:$._id||G?._id,name:$.name||G?.name||"",siteId:$.siteId||G?.siteId||"",type:y.YR.default,externalLinks:$.externalLinks||G?.externalLinks||[],parents:$.parents}},Z=function*(){try{const $=yield(0,a.Lt)(),K=(0,f.mC)($),G=(0,E.V2)($),pe=yield(0,a.T1)(p.zy,{primaryToken:K,siteId:G,limit:h.a,offset:0}),re=(0,n.mL)(yield(0,a.Lt)()),ge=q(pe,re),le=re.filter(ce=>ce.type!==y.YR.default);yield(0,a.yJ)((0,e.setNavigations)([ge,...le])),yield(0,a.yJ)((0,e.setDefaultNavigationTotal)(pe.total))}catch($){i.warn("fetchDefaultNavigationSaga failed (will retry on panel open):",$)}},te=(0,d.N$)({fetchDefaultNavigationPage:e.fetchDefaultNavigationPage},function*({payload:{offset:$,limit:K}}){try{const G=yield(0,a.Lt)();if((0,n.ko)(G))return;yield(0,a.yJ)((0,e.setLoadingMoreNavigation)(!0));const pe=(0,f.mC)(G),re=(0,E.V2)(G),ge=yield(0,a.T1)(p.zy,{primaryToken:pe,siteId:re,limit:K,offset:$});if($===0){const le=(0,n.mL)(yield(0,a.Lt)()),ce=q(ge,le),ne=le.filter(Ke=>Ke.type!==y.YR.default);yield(0,a.yJ)((0,e.setNavigations)([ce,...ne])),yield(0,a.yJ)((0,e.setDefaultNavigationTotal)(ge.total))}else yield(0,a.yJ)((0,e.appendDefaultNavigationParents)(ge.parents)),yield(0,a.yJ)((0,e.setDefaultNavigationTotal)(ge.total))}catch(G){i.error("fetchMoreDefaultNavigationSaga failed:",G)}finally{yield(0,a.yJ)((0,e.setLoadingMoreNavigation)(!1))}}),Ne=(0,d.N$)({fetchDefaultNavigationSearch:e.fetchDefaultNavigationSearch},function*({payload:$}){try{yield(0,a.yJ)((0,e.setLoadingMoreNavigation)(!0));const K=yield(0,a.Lt)();if(!$){yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(null));return}yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(null));const G=(0,f.mC)(K),pe=(0,E.V2)(K),re=yield(0,a.T1)(p.zy,{primaryToken:G,siteId:pe,limit:h.a,offset:0,search:$||void 0});yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(re.parents))}catch(K){i.error("fetchDefaultNavigationSearchSaga failed:",K)}finally{yield(0,a.yJ)((0,e.setLoadingMoreNavigation)(!1))}}),fe=(0,d.N$)({addItemToCustomNavigation:e.addItemToCustomNavigation},function*({payload:{newParent:$,navigationId:K}}){try{const G=yield(0,a.Lt)(),re=(0,n.mL)(G).find(ge=>ge._id===K);if(!re)return;yield(0,a.yJ)((0,e.updateNavigation)({_id:K,parents:[...re.parents,$]}))}catch(G){i.error("addItemToCustomNavigationSaga failed. error:",G)}}),_e=(0,d.N$)({addFolderToCustomNavigation:e.addFolderToCustomNavigation},function*({payload:$}){try{const K=yield(0,a.Lt)(),G=(0,n.Dc)(K);if(!G?._id)return;const pe=(0,I.CI)(G,$?(0,I.Mr)($):"New Folder");yield(0,a.yJ)((0,e.upsertNavigationFolder)({navigationId:G._id,folderId:(0,l.Xs)(),name:pe,slug:(0,A.Yv)(pe)}))}catch(K){i.error("addFolderToCustomNavigationSaga failed. error:",K)}}),Le=(0,d.N$)({removeItemFromCustomNavigation:e.removeItemFromCustomNavigation},function*({payload:{navigationId:$,itemId:K}}){try{const G=yield(0,a.Lt)(),re=(0,n.mL)(G).find(le=>le._id===$);if(!re)return;const ge=(0,I._I)(structuredClone(re),K);yield(0,a.yJ)((0,e.updateNavigation)({_id:$,parents:ge.parents}))}catch(G){i.error("removeItemFromCustomNavigationSaga failed. error:",G)}}),ct=function*($){try{return yield(0,a.T1)(p.xn,$)}catch(K){return i.warn("hydrateCustomNavigationSaga failed for navigationId:",$.navigationId,K),null}},gt=(0,d.N$)({fetchAllNavigations:e.fetchAllNavigations},function*(){try{const $=yield(0,a.Lt)(),K=(0,f.mC)($),G=(0,E.V2)($),pe=(0,n.hV)($),re=yield(0,a.T1)(p.Le,{primaryToken:K,siteId:G}),ge=yield(0,a.Q7)(re.filter(Ce=>Ce.type!==y.YR.default&&Ce._id).map(Ce=>(0,a.T1)(ct,{primaryToken:K,siteId:G,navigationId:Ce._id}))),le=new Map(ge.filter(Ce=>Ce!==null).map(Ce=>[Ce._id,Ce])),ce=(0,n.Io)(yield(0,a.Lt)()),Ke=re.map(Ce=>{var Fe;return Ce.type===y.YR.default&&((Fe=ce?.parents)!=null&&Fe.length)?C(O({},Ce),{parents:ce.parents}):le.get(Ce._id)||Ce}).sort((Ce,Fe)=>Ce._id===pe._id?-1:Fe._id===pe._id?1:Ce.type===y.YR.default?-1:Fe.type===y.YR.default?1:0);yield(0,a.yJ)((0,e.setNavigations)(Ke)),yield(0,a.yJ)((0,e.setNavigationSelectedInTheDropdown)(pe._id))}catch($){i.error("fetchAllNavigations failed. error:",$)}}),Nt=(0,d.N$)({removeItemFromNavigations:e.removeItemFromNavigations},function*({payload:$}){try{const K=yield(0,a.Lt)(),G=(0,n.KY)(K);if(G?.length){const ge=(0,I._I)({parents:structuredClone(G)},$).parents;yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(ge))}const pe=(0,n.mL)(K);if(!pe||!pe.length)return;const re=pe.map(ge=>(0,I._I)(structuredClone(ge),$));yield(0,a.yJ)((0,e.setNavigations)(re))}catch(K){i.error("removeItemFromNavigationsSaga failed. error:",K)}}),j=(0,d.N$)({updatePageInNavigations:e.updatePageInNavigations},function*({payload:{pageId:$,newName:K,newSlug:G,newPrivate:pe}}){try{const re=yield(0,a.Lt)(),ge=(0,n.mL)(re);if(!ge||!ge.length)return;const le=ge.map(ce=>C(O({},ce),{parents:ce.parents.map(ne=>ne.id===$?C(O({},ne),{name:K,slug:G,private:pe}):C(O({},ne),{children:ne.children.map(Ke=>Ke.id===$?C(O({},Ke),{name:K,slug:G,private:pe}):Ke)}))}));yield(0,a.yJ)((0,e.setNavigations)(le))}catch(re){i.error("updatePageInNavigationsSaga failed. error:",re)}}),H=(0,d.N$)({setObject:E.wt},function*({payload:$}){var K;try{const G=yield(0,a.Lt)(),{object:pe,loaded:re}=$;if(!pe||!re||pe.collection!=="pages")return;const ge=(K=pe.data)==null?void 0:K.navigationId;if(!ge||(0,n.mL)(G).some(Ce=>Ce._id===ge))return;const le=(0,f.mC)(G),ce=(0,E.V2)(G);if(!ce)throw new Error("missing site id");const ne=yield(0,a.T1)(p.xn,{primaryToken:le,siteId:ce,navigationId:ge}),Ke=(0,n.mL)(yield(0,a.Lt)());if(Ke.some(Ce=>Ce._id===ge))return;yield(0,a.yJ)((0,e.setNavigations)([...Ke,ne]))}catch(G){i.error("handlePageSwitchSaga failed. error:",G)}}),J=(0,d.N$)({moveNavigationItem:e.moveNavigationItem},function*({payload:{navigationId:$,op:K,viewOffset:G,viewLimit:pe}}){try{const re=yield(0,a.Lt)(),ge=(0,f.mC)(re),le=(0,E.V2)(re),ce=yield(0,a.T1)(p.B3,{primaryToken:ge,siteId:le,navigationId:$,op:K,viewOffset:G,viewLimit:pe}),Ke=(0,n.mL)(yield(0,a.Lt)()).map(Ce=>{var Fe;return Ce._id===$?C(O({},Ce),{parents:ce.parents,externalLinks:(Fe=ce.externalLinks)!=null?Fe:Ce.externalLinks}):Ce});yield(0,a.yJ)((0,e.setNavigations)(Ke)),typeof ce.total=="number"&&(yield(0,a.yJ)((0,e.setDefaultNavigationTotal)(ce.total)))}catch(re){i.error("moveNavigationItemSaga failed. error:",re),yield(0,a.yJ)((0,e.revertN
384avigationMove)($)),yield(0,a.yJ)((0,v.to)({kind:m.V.adminConfirmation,data:{onConfirmClick:()=>{},titleKey:"ADMIN_SITE_STRUCTURE_DRAG_AND_DROP_ERROR_TITLE",subtitleKey:"ADMIN_SITE_STRUCTURE_DRAG_AND_DROP_ERROR_SUBTITLE"}}))}}),B=$=>{var K,G;return Math.min(I.CU,Math.max(h.a,((G=(K=$.parents)==null?void 0:K.length)!=null?G:0)+1))},U=function*($,K,G,pe){const re=(0,n.mL)(yield(0,a.Lt)());yield(0,a.yJ)((0,e.setNavigations)(re.map(ge=>{var le;return ge._id===$?C(O({},ge),{parents:(0,I.F6)(ge.parents,K.parents,G),externalLinks:(le=K.externalLinks)!=null?le:ge.externalLinks}):ge}))),pe===y.YR.default&&typeof K.total=="number"&&(yield(0,a.yJ)((0,e.setDefaultNavigationTotal)(K.total)))},oe=(0,d.N$)({upsertNavigationFolder:e.upsertNavigationFolder},function*({payload:{navigationId:$,folderId:K,name:G,slug:pe,insertBeforeId:re}}){const ge=yield(0,a.Lt)(),le=(0,n.mL)(ge),ce=le.find(Ce=>Ce._id===$);if(!ce)return;const ne=(0,n.KY)(ge),Ke=ce.type===y.YR.default&&!!ne?.some(Ce=>Ce.id===K);try{const Ce=(0,f.mC)(ge),Fe=(0,E.V2)(ge);yield(0,a.yJ)((0,e.setNavigations)(le.map(Pt=>Pt._id===$?(0,I.l1)(Pt,{folderId:K,insertBeforeId:re,name:G,slug:pe}):Pt))),Ke&&(yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(ne.map(Pt=>Pt.id===K?C(O({},Pt),{name:G,slug:pe}):Pt))));const vt=B(ce),rt=yield(0,a.T1)(p.OE,{primaryToken:Ce,siteId:Fe,navigationId:$,folderId:K,name:G,slug:pe,insertBeforeId:re,viewOffset:0,viewLimit:vt});yield*U($,rt,vt,ce.type)}catch(Ce){i.error("upsertNavigationFolderSaga failed. error:",Ce),yield(0,a.yJ)((0,e.setNavigations)(le)),Ke&&(yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(ne))),yield(0,a.yJ)((0,e.setEditableFolderIdInSiteNavigation)("")),yield(0,a.yJ)((0,e.setEditableFolderIdInNavigationBlock)("")),yield(0,a.yJ)((0,v.to)({kind:m.V.adminConfirmation,data:{onConfirmClick:()=>{},titleKey:"ADMIN_SITE_STRUCTURE_FOLDER_SAVE_ERROR_TITLE",subtitleKey:"ADMIN_SITE_STRUCTURE_FOLDER_SAVE_ERROR_SUBTITLE"}}))}}),Pe=(0,d.N$)({removeNavigationFolder:e.removeNavigationFolder},function*({payload:{navigationId:$,folderId:K}}){const G=yield(0,a.Lt)(),pe=(0,n.mL)(G),re=pe.find(ce=>ce._id===$);if(!re)return;const ge=(0,n.KY)(G),le=re.type===y.YR.default&&!!ge?.length;try{const ce=(0,f.mC)(G),ne=(0,E.V2)(G),Ke=B(re);if(yield(0,a.yJ)((0,e.setNavigations)(pe.map(Fe=>Fe._id===$?(0,I._I)(structuredClone(Fe),K):Fe))),le){const Fe=(0,I._I)({parents:structuredClone(ge)},K).parents;yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(Fe))}const Ce=yield(0,a.T1)(p.DR,{primaryToken:ce,siteId:ne,navigationId:$,folderId:K,viewOffset:0,viewLimit:Ke});yield*U($,Ce,Ke,re.type)}catch(ce){i.error("removeNavigationFolderSaga failed. error:",ce),yield(0,a.yJ)((0,e.setNavigations)(pe)),le&&(yield(0,a.yJ)((0,e.setDefaultNavigationSearchResults)(ge))),yield(0,a.yJ)((0,v.to)({kind:m.V.adminConfirmation,data:{onConfirmClick:()=>{}
384,titleKey:"ADMIN_SITE_STRUCTURE_FOLDER_DELETE_ERROR_TITLE",subtitleKey:"ADMIN_SITE_STRUCTURE_FOLDER_DELETE_ERROR_SUBTITLE"}}))}}),Ee=function*(){yield(0,a.Zy)(Z),yield(0,a.p8)(E.ZX,H),yield(0,a.jP)(e.UPDATE_NAVIGATION,W),yield(0,a.jP)(e.MOVE_NAVIGATION_ITEM,J),yield(0,a.jP)(e.UPSERT_NAVIGATION_FOLDER,oe),yield(0,a.jP)(e.REMOVE_NAVIGATION_FOLDER,Pe),yield(0,a.jP)(e.SET_NAVIGATION_APPLIED_IN_THE_PAGE,w),yield(0,a.jP)(e.ADD_LINK_TO_NAVIGATION,T),yield(0,a.jP)(e.REMOVE_LINK_FROM_NAVIGATION,Y),yield(0,a.jP)(e.CREATE_CUSTOM_NAVIGATION,ie),yield(0,a.jP)(e.DELETE_NAVIGATION,se),yield(0,a.jP)(e.ADD_ITEM_TO_CUSTOM_NAVIGATION,fe),yield(0,a.jP)(e.ADD_FOLDER_TO_CUSTOM_NAVIGATION,_e),yield(0,a.jP)(e.REMOVE_ITEM_FROM_CUSTOM_NAVIGATION,Le),yield(0,a.jP)(e.FETCH_ALL_NAVIGATIONS,gt),yield(0,a.jP)(e.REMOVE_ITEM_FROM_NAVIGATIONS,Nt),yield(0,a.jP)(e.UPDATE_PAGE_IN_NAVIGATIONS,j),yield(0,a.IJ)(e.FETCH_DEFAULT_NAVIGATION_PAGE,te),yield(0,a.p8)(e.FETCH_DEFAULT_NAVIGATION_SEARCH,Ne)};var pt=t(509786)},509786:(ve,x,t)=>{t.d(x,{A:()=>i});var e=t(304006),n=t(990220),a=t(422913),d=Object.defineProperty,f=Object.defineProperties,E=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,v=(r,o,u)=>o in r?d(r,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[o]=u,m=(r,o)=>{for(var u in o||(o={}))l.call(o,u)&&v(r,u,o[u]);if(y)for(var u of y(o))I.call(o,u)&&v(r,u,o[u]);return r},A=(r,o)=>f(r,E(o));const p=()=>({navigations:n.$U?[n.$U]:[],editableFolderIdInSiteNavigation:"",editableFolderIdInNavigationBlock:"",searchText:"",navigationSelectedInTheDropdown:"",links:{isAddingLinkToCustomNavigation:!1,autoFilledLinkName:""},customNavigationCreationLoading:!1,areAllNavigationsAlreadyFetched:!1,defaultNavigationTotal:0,defaultNavigationSearchResults:null,isLoadingMoreNavigation:!1,hasFullDefaultNavigation:!1}),i=(0,e.T1)(a,p,(r,o)=>{switch(o.type){case a.UPDATE_NAVIGATION:{const u=r.navigations.map(c=>c._id===o.payload._id?m(m({},c),o.payload):c);return A(m({},r),{navigations:u})}case a.SET_NAVIGATION_SELECTED_IN_THE_DROPDOWN:return A(m({},r),{navigationSelectedInTheDropdown:o.payload});case a.SET_EDITABLE_FOLDER_ID_IN_SITE_NAVIGATION:return A(m({},r),{editableFolderIdInSiteNavigation:o.payload});case a.SET_EDITABLE_FOLDER_ID_IN_NAVIGATION_BLOCK:return A(m({},r),{editableFolderIdInNavigationBlock:o.payload});case a.SET_SEARCH_TEXT:return A(m({},r),{searchText:o.payload});case a.SET_NAVIGATIONS:return A(m({},r),{navigations:o.payload});case a.REVERT_NAVIGATION_MOVE:{const u=r.navigations.map(c=>{var s,g;return c._id===o.payload?A(m({},c),{parents:[...(s=c.parents)!=null?s:[]],externalLinks:[...(g=c.externalLinks)!=null?g:[]]}):c});return A(m({},r),{navigations:u})}case a.UPDATE_SITE_STRUCTURE:{const u=r.navigations.filter(c=>c.type!=="default");return A(m({},r),{navigations:[o.payload,...u]})}case a.INSERT_ITEM_INTO_DEFAULT_NAVIGATION:{const{navItem:u,navigationParentId:c}=o.payload,s=r.navigations.map(g=>{var P,O;return g.type!=="default"?g:c?A(m({},g),{parents:((P=g.parents)!=null?P:[]).map(C=>{var W;return C.id===c?A(m({},C),{children:[u,...(W=C.children)!=null?W:[]]}):C})}):A(m({},g),{parents:[u,...(O=g.parents)!=null?O:[]]})});return A(m({},r),{navigations:s})}case a.SET_CREATE_LINK_FOR_CUSTOM_NAVIGATION:{const{isAddingLink:u,linkName:c}=o.payload;return A(m({},r),{links:{isAddingLinkToCustomNavigation:u,autoFilledLinkName:c}})}case a.CREATE_CUSTOM_NAVIGATION_LOADING:return A(m({},r),{customNavigationCreationLoading:o.payload});case a.FETCH_ALL_NAVIGATIONS:return A(m({},r),{areAllNavigationsAlreadyFetched:!0});case a.APPEND_DEFAULT_NAVIGATION_PARENTS:{const u=r.navigations.map(c=>{if(c.type!=="default")return c;const s=new Set(c.parents.map(P=>P.id)),g=o.payload.filter(P=>!s.has(P.id));return g.length===0?c:A(m({},c),{parents:[...c.parents,...g]})});return A(m({},r),{navigations:u})}case a.SET_DEFAULT_NAVIGATION_TOTAL:return A(m({},r),{defaultNavigationTotal:o.payload});case a.SET_DEFAULT_NAVIGATION_SEARCH_RESULTS:return A(m({},r),{defaultNavigationSearchResults:o.payload});case a.SET_LOADING_MORE_NAVIGATION:return A(m({},r),{isLoadingMoreNavigation:o.payload});case a.SET_HAS_FULL_DEFAULT_NAVIGATION:return A(m({},r),{hasFullDefaultNavigation:o.payload});default:return r}})},37456:(ve,x,t)=>{t.d(x,{Dc:()=>I,Io:()=>E,J1:()=>p,KY:()=>o,Kk:()=>A,ML:()=>i,TL:()=>h,hV:()=>l,kV:()=>r,ko:()=>u,mL:()=>a,qi:()=>v,w$:()=>m});var e=t(990220),n=t(980672);const a=s=>s.navigationv2.navigations,d=s=>
384{var g,P;return(P=(g=s.app.object)==null?void 0:g.data)==null?void 0:P.navigationId},f={name:"",parents:[],externalLinks:[],siteId:"",type:"default"},E=(0,n.Mz)(a,s=>s.find(P=>P.type==="default")||e.$U||f),y=(s,g,P)=>(()=>P?s.find(C=>C._id===P):g)()||e.$U||g,l=(0,n.Mz)(a,E,d,y),I=(0,n.Mz)(a,l,s=>s.navigationv2.navigationSelectedInTheDropdown,(s,g,P)=>s.find(O=>O._id===P)||g),v=s=>s.navigationv2.editableFolderIdInSiteNavigation,m=s=>s.navigationv2.editableFolderIdInNavigationBlock,A=s=>s.navigationv2.searchText,p=s=>s.navigationv2.links,h=s=>s.navigationv2.customNavigationCreationLoading,i=s=>s.navigationv2.areAllNavigationsAlreadyFetched,r=s=>s.navigationv2.defaultNavigationTotal,o=s=>s.navigationv2.defaultNavigationSearchResults,u=s=>s.navigationv2.isLoadingMoreNavigation,c=s=>s.navigationv2.hasFullDefaultNavigation},253251:(ve,x,t)=>{t.d(x,{CI:()=>Y,CL:()=>fe,CU:()=>W,F6:()=>T,FX:()=>Le,KK:()=>C,Lg:()=>u,Mr:()=>se,Nn:()=>gt,WL:()=>q,_I:()=>te,bD:()=>P,cP:()=>g,eM:()=>Nt,hB:()=>ct,is:()=>O,kH:()=>c,kz:()=>i,l1:()=>w,mR:()=>s,sr:()=>o,tG:()=>_e,wg:()=>Ne});var e=t(30842),n=t(171751),a=t(990220),d=t(755939),f=Object.defineProperty,E=Object.defineProperties,y=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,m=(j,H,J)=>H in j?f(j,H,{enumerable:!0,configurable:!0,writable:!0,value:J}):j[H]=J,A=(j,H)=>{for(var J in H||(H={}))I.call(H,J)&&m(j,J,H[J]);if(l)for(var J of l(H))v.call(H,J)&&m(j,J,H[J]);return j},p=(j,H)=>E(j,y(H));const h=3,i=25,r=(j,H)=>{var J,B,U,oe;for(let Pe=0;Pe<j.length;Pe++){if(j[Pe].id===H)return{parentId:null,nextSiblingId:(B=(J=j[Pe+1])==null?void 0:J.id)!=null?B:null};const we=j[Pe].children;for(let Ee=0;Ee<we.length;Ee++)if(we[Ee].id===H)return{parentId:j[Pe].id,nextSiblingId:(oe=(U=we[Ee+1])==null?void 0:U.id)!=null?oe:null}}return null},o=(j,H,J)=>{var B;const U=r(j,J),oe=r(H,J);return oe?{itemId:J,fromParentId:(B=U?.parentId)!=null?B:null,toParentId:oe.parentId,insertBeforeId:oe.nextSiblingId}:null},u=(j,H)=>{var J,B;const U=j.findIndex(oe=>oe.id===H);return U===-1?null:{itemId:H,fromParentId:null,toParentId:null,insertBeforeId:(B=(J=j[U+1])==null?void 0:J.id)!=null?B:null}},c=3,s=25,g=(j,H)=>{for(const J of j.parents){if(J.id===H)return{found:!0,isParent:!0,item:J};for(const B of J.children)if(B.id===H)return{found:!0,isParent:!1,item:B}}},P=(j,H)=>{if(!j.some(Pe=>Pe.name===H))return H;let B=1,U="",oe=!1;for(;!oe;){B++,U=`${H} ${B}`;const Pe=U;oe=!j.some(Ee=>Ee.name===Pe)}return U},O=j=>{const H=new Map,J=new Map,{parents:B}=j;for(const U of B){const{id:oe,children:Pe}=U;H.set(oe,U);for(const we of Pe){const{id:Ee}=we;J.set(Ee,we)}}return{parentHashMap:H,childHashMap:J}},C=j=>j===e.xA.folder?"folder-open":j===e.xA.channel||j===d.g.VIDEO_PAGE?"video-queue":"grid-09",W=500,w=(j,{folderId:H,insertBeforeId:J,name:B,slug:U})=>{var oe;const Pe=(oe=j.parents)!=null?oe:[];if(Pe.some($=>$.id===H))return p(A({},j),{parents:Pe.map($=>$.id===H?p(A({},$),{name:B,slug:U}):$)});const we={id:H,name:B,slug:U,type:e.xA.folder,children:[]},Ee=J!=null?Pe.findIndex($=>$.id===J):-1,pt=Ee===-1?0:Ee;return p(A({},j),{parents:[...Pe.slice(0,pt),we,...Pe.slice(pt)]})},T=(j,H,J)=>{if(J!==void 0&&H.length<J)return H;const B=new Set(H.map(U=>U.id));return[...H,...(j??[]).filter(U=>!B.has(U.id))]},Y=(j,H,J)=>{const B=(0,n.Yv)(H);let U=B,oe=H;const Pe=Ee=>{const pt=j.parents.some(K=>K.slug===Ee&&K.id!==J),$=j.parents.some(K=>K.children.some(G=>G.slug===Ee&&G.id!==J));return pt||$};if(!Pe(B))return oe;let we=1;do we++,U=`${B}-${we}`,oe=`${H} ${we}`;while(Pe(U));return oe},ie=j=>j.replace(/[^a-zA-Z0-9 -]/g,""),se=j=>ie(j).trim().slice(0,i).trim(),q=j=>{const H=se(j);return H.length===0?"New Folder":H.length<h?`Folder ${H}`:H},Z=(j,H)=>{const J=j.parents.map(B=>{if(B.id===H.id)return A(A({},B),H);const U=B.children.map(oe=>oe.id===H.id?A(A({},oe),H):oe);return p(A({},B),{children:U})});return p(A({},j),{parents:J})},te=(j,H)=>{const J=j.parents.findIndex(U=>U.id===H);if(J!==-1){const oe=j.parents[J].children.map(Pe=>p(A({},Pe),{type:e.Sy[Pe.type],children:[]}));return j.parents.splice(J,1,...oe),j}const B=j.parents.find(U=>U.children.some(oe=>oe.id===H));return B&&(B.children=B.children.filter(U=>U.id!==H)),j},Ne=({destinationParent:j,dragItem:H})=>{const J=j,B=H;return!(J?.type===e.xA.channel||B.type===e.xA.folder&&J!==null)},fe=j=>p(A({},j),{parents:j.parents.filter(H=>!H.private).map(H=>p(A({},H),{children:H.children.filter(J=>!J.private)}))}),_e=(j,H)=>H?`/${j}/${H}`:`/${j}`,Le=(j,H)=>{for(const J of j.parents){const B=J.children.find(U=>U.slug===H);if(B)return`/${J.slug}/${B.slug}`}return`/${H}`},ct=(j,H,J)=>j?.some(U=>U.slug===H)?Le(J,H):null,gt=(j,H)=>{const{parents:J}=j;for(const B of J){if(B.id===H)return B.slug;for(const U of B.children){const{id:oe,slug:Pe}=U;if(oe===H)return Pe}}return""},Nt=j=>{const H=a.SW?window.location.pathname:window.location.pathname.replace(`/${j}`,"");return H.startsWith("/")?H.substring(1):H}},634611:(ve,x,t)=>{t.d(x,{Cb:()=>I,F7:()=>y,Qm:()=>p,Xq:()=>A,_h:()=>v,p7:()=>m,yj:()=>l});var e=t(886550),n=t(619545),a=t(545290),d=t(429195),f=t(957006),E=t(835896);const y=(0,e.Ay)(E.A)` 385 padding: 8px 20px; 386 flex: 1; 387 height: 100%; 388 display: flex; 389 min-height: 60px; 390`,l=e.Ay.div` 391 display: ${h=>h.disabled?"none":"flex"}; 392 flex-flow: row wrap; 393 align-items: center; 394 flex: 1; 395 justify-content: flex-end; 396`,I=e.Ay.div` 397 display: flex; 398 flex-flow: row wrap; 399 align-items: center; 400 /* max-width: calc(100% + 16px); */ 401 position: relative; 402 margin-left: -16px; 403 width: 100%; 404 height: 100%; 405 justify-content: start; 406 gap: 10px; 407`,v=(0,e.Ay)(n.A)` 408 display: flex; 409 align-items: center; 410 flex-shrink: 0; 411 ${a.xj}; 412 && { 413 color: ${d._A5}; 414 } 415 &:hover { 416 color: ${d.mrt}; 417 } 418 overflow: hidden; 419 max-width: 100%; 420 text-overflow: ellipsis; 421 display: block; 422`,m=(0,e.Ay)(n.A)` 423 color: ${d.mrt}; 424 display: flex; 425 align-items: center; 426 flex-shrink: 0; 427 max-height: 100%; 428 width: auto; 429 max-width: 250px; 430 ${a.xj} 431 overflow: ${({isImageLink:h})=>h?"visible":"hidden"}; 432 max-width: 100%; 433 text-overflow: ellipsis; 434 display: block; 435`,A=(0,e.Ay)(f.A)` 436 object-fit: contain; 437 max-height: 100%; 438 max-width: 100px; 439`,p=e.Ay.div` 440 display: flex; 441 align-items: center; 442 justify-content: center; 443 height: 60px; 444`},527899:(ve,x,t)=>{t.d(x,{Ao:()=>v,F7:()=>I,M0:()=>m,P4:()=>h,iV:()=>A,qY:()=>p,vG:()=>i});var e=t(886550),n=t(429195),a=t(545290),d=t(283722),f=t(619545),E=t(312854),y=t(835896);const l=(0,e.AH)` 445 display: block; 446 line-height: normal; 447`,I=(0,e.Ay)(y.A)` 448 padding: 0 20px; 449 padding-top: 17px; 450 min-width: 120px; 451 height: 100%; 452 display: flex; 453`,v=(0,e.Ay)(f.A).attrs({plain:!0})`${l}`,m=e.Ay.div` 454 display: ${r=>r.disabled?"none":"flex"}; 455 flex-flow: row wrap; 456 align-items: center; 457 margin-bottom: 16px; 458 min-height: 53px; 459`,A=e.Ay.div` 460 display: flex; 461 align-items: center; 462 flex-flow: row wrap; 463 font-size: 24px; 464 position: relative; 465 & > ${v} { 466 margin-bottom: 6px; 467 margin-top: 6px; 468 } 469 & > ${v}:not(:last-child) { 470 margin-right: ${n.Emp}; 471 } 472`,p=(0,e.Ay)(d.Ay).attrs(r=>({color:(0,n.Jzj)(r),radius:"25px"}))` 473 ${a.j7} 474 ${a.AM} 475 background: ${n.mrt}; 476 font-size: 15px; 477 color: ${n.Jzj}; 478 & svg { 479 width: 15px; 480 height: 15px; 481 & path { 482 fill: ${n.Jzj}; 483 } 484 } 485 &:hover { 486 background: ${n.g0s}; 487 color:${r=>(0,E.bw)((0,n.g0s)(r))}; 488 & path { 489 fill: ${r=>(0,E.bw)((0,n.g0s)(r))}; 490 } 491 } 492`,h=e.Ay.div` 493 ${a._i} 494 color: ${n.mrt}; 495`,i=(0,e.Ay)(f.A).attrs({plain:!0})` 496 &&, &.plain { 497 ${a.WL} 498 ${a.f3} 499 max-width: 95%; 500 margin-right: 10px; 501 ${a.AM} 502 border-radius: 20px; 503 min-height: 25px; 504 max-height: 25px; 505 padding: 10px 13px; 506 background: ${n.mrt}; 507 color: ${n.Jzj}; 508 min-width: max-content; 509 &:hover { 510 background: ${n.g0s}; 511 color:${r=>(0,E.bw)((0,n.g0s)(r))}; 512 } 513 } 514`},973079:(ve,x,t)=>{t.d(x,{A:()=>te});
514var e=t(63696),n=t(886550),a=t(892451),d=t(558613),f=t(228333),E=t(417224),y=t(41989),l=t(224191),I=t(365179),v=t(346002),m=t(403981);function A({className:Ne="",isAdmin:fe,startTime:_e,title:Le}){const{endUserT:ct}=(0,y.T9)(),gt=(0,l.useSelector)(I.x6f),Nt=(0,l.useSelector)(v.Q),[j,H]=e.useState(!1),J=ct([y.Rq.countdownTitle,{pageId:gt}])||Le,B=()=>{H(!0)},U=()=>{H(!1)},oe=()=>{const pt=_e;return new Date(_e)<new Date||!pt?e.createElement(m.Or,null):pt?e.createElement(m.PX,{className:Ne,message:J,startTime:_e}):null},Pe=()=>e.createElement(E.A,{className:Ne,message:Nt?Le:J,onCloseCountdownModal:U,openCountdownModal:j,startTime:_e}),we=()=>fe?Pe():oe();return!(fe&&Nt||_e)?null:e.createElement(m.F7,{onEdit:B,testId:"editModeCountdown",titleKey:"ADMIN_LABEL_COUNTDOWN"},we())}var p=t(559750),h=t(384959),i=t(286005),r=t(731694),o=t(777045),u=t(463302),c=t(368909),s=t(287483),g=t(429195),P=t(341476),O=t(763910),C=Object.defineProperty,W=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,Y=(Ne,fe,_e)=>fe in Ne?C(Ne,fe,{enumerable:!0,configurable:!0,writable:!0,value:_e}):Ne[fe]=_e,ie=(Ne,fe)=>{for(var _e in fe||(fe={}))w.call(fe,_e)&&Y(Ne,_e,fe[_e]);if(W)for(var _e of W(fe))T.call(fe,_e)&&Y(Ne,_e,fe[_e]);return Ne};const se=(0,n.Ay)(a.P.div)` 515 z-index: ${({$isScrollOnTop:Ne})=>Ne?2:3}; 516 align-items: center; 517 display: flex; 518 flex-flow: row nowrap; 519 ${({$isLanding:Ne,$isScrollOnTop:fe})=>Ne?(0,n.AH)` 520 transition: background 0.5s; 521 background: ${fe?"transparent":g.F_r}; 522 position: sticky; 523 top: 0; 524 `:(0,n.AH)` 525 background: transparent; 526 `}; 527`,q=()=>{},Z=({className:Ne})=>{const fe=(0,l.useSelector)(v.Q),_e=(0,l.useSelector)(vt=>(0,v.yN)(vt,o.NU.COUNTDOWN)),Le=(0,l.useSelector)(I.Y9x),ct=(0,l.useSelector)(I.PwZ),gt=(0,l.useSelector)(s.OL),Nt=(0,l.useSelector)(I.ouN),j=(0,l.useSelector)(u.N6),H=(0,l.useSelector)(v.L0),J=(0,l.useSelector)(I.nin),B=(0,l.useSelector)(c.Yg),U=(0,l.useSelector)(c.VC),oe=(0,l.useSelector)(v.JQ),Pe=(0,l.useSelector)(v.Wt),we=(0,l.useSelector)(v.bW),Ee=(0,l.useSelector)(v.Ph),pt=(0,l.useSelector)(v.e_),$=(0,l.useSelector)(v.ve)||"",K=(0,l.useSelector)(I.DyV),G=(0,l.useSelector)(O.Rr),pe=K&&G,[re,ge]=(0,e.useState)(!0),le=fe&&_e?_e:{title:Le,startTime:ct},ce=(0,e.useCallback)(vt=>{const rt=!vt?.scrollTop;ge(Pt=>Pt===rt?Pt:rt)},[]);(0,e.useEffect)(()=>{const vt=document.getElementById(r.DW);if(!vt)return;const rt=Pt=>{ce(Pt.target)};return ce(vt),vt.addEventListener("scroll",rt),()=>{vt.removeEventListener("scroll",rt)}},[ce]);const Ke=(fe||H||Nt||pe)&&!gt,Ce=(le?.startTime||j||pe)&&!(U&&B),Fe={logoHeight:oe,logoLink:Pe,logoMobileHeight:we,logoMobileUrl:Ee,logoTitle:pt,logoUrl:$};return Ke?(0,P.UH)()?e.createElement(i.r,{countdownTitle:le?.title||"",fullscreenActive:gt,gateLogo:"",gateLogoLink:"",gateLogoTitle:"",hasHeader:Nt,isAdmin:j,isAdminViewingAccessTab:!1,isChannelGateEnabled:!1,isEditMode:fe,isGateActive:!1,isInAccessMenu:H,isLanding:J,isLandscape:B,isMobileLayout:U,logoLink:Pe||"",logoTitle:pt||"",logoUrl:$||"",shouldShowLogin:!1,startTime:le?.startTime||""}):e.createElement(se,{animate:{opacity:1},className:Ne,id:r.yG,initial:{opacity:0}
527,$isLanding:J,$isScrollOnTop:re,transition:{duration:.4,ease:"easeOut"}},e.createElement(f.A,{data:ie({},Fe),"data-testid":"change-logo-button"}),e.createElement(p.A,null),Ce&&e.createElement(A,{isAdmin:j,startTime:le?.startTime||"",title:le?.title||""}),e.createElement(h.A,{isHeader:!0,onLogInClick:q,onProfileClick:q})):null},te=(0,d.A)()(Z)},403981:(ve,x,t)=>{t.d(x,{F7:()=>y,Or:()=>E,PX:()=>I});var e=t(886550),n=t(835896),a=t(429195),d=t(166143),f=t(143213);const E=e.Ay.div` 528 min-width: 150px !important; 529 height: ${a.R7t}; 530`,y=(0,e.Ay)(n.A)` 531 height: 100%; 532 min-width: 150px; 533`,l=(0,e.Ay)(d.Ay)` 534 margin-bottom: 24px; 535`,I=(0,e.Ay)(f.Ay)` 536 visibility: ${v=>v.hidden?"hidden":"visible"}; 537`},228333:(ve,x,t)=>{t.d(x,{A:()=>K});var e=t(63696),n=t(224191),a=t(886550),d=t(892451),f=t(619545),E=t(86138),y=t(166143),l=t(13155),I=t(196063),v=t(777045),m=t(991272),A=t(359250),p=t(429195),h=t(152544),i=Object.defineProperty,r=Object.defineProperties,o=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,g=(le,ce,ne)=>ce in le?i(le,ce,{enumerable:!0,configurable:!0,writable:!0,value:ne}):le[ce]=ne,P=(le,ce)=>{for(var ne in ce||(ce={}))c.call(ce,ne)&&g(le,ne,ce[ne]);if(u)for(var ne of u(ce))s.call(ce,ne)&&g(le,ne,ce[ne]);return le},O=(le,ce)=>r(le,o(ce));const C=20,W=40,w=30,T=16,Y=28,ie=22;function se({anchorRect:le,data:ce,isOpen:ne,onClose:Ke,onChange:Ce}){const{logoHeight:Fe,logoLink:vt,logoMobileHeight:rt,logoMobileUrl:Pt,logoTitle:Vt,logoUrl:bt}=ce||{},Ae=bt!==v.gX?bt:null,Dt=Pt!==v.gX?Pt:null,Yt=yt=>{Ce(O(P({},ce),{logoLink:yt}))},Ie=yt=>{Ce(O(P({},ce),{logoUrl:yt}))},he=yt=>{Ce(O(P({},ce),{logoMobileUrl:yt}))},de=yt=>{Ce(O(P({},ce),{logoTitle:yt}))},Te=yt=>{Ce(O(P({},ce),{logoHeight:yt[0]}))},Se=yt=>{Ce(O(P({},ce),{logoMobileHeight:yt[0]}))},Ue=()=>{Ce(O(P({},ce),{logoUrl:v.gX}))},be=()=>{Ce(O(P({},ce),{logoMobileUrl:v.gX}))},Et=Fe??w,ze=rt??ie;return e.createElement(I.A,{anchorPlacementOrder:["below"],anchorRect:le,isOpen:ne,onClose:Ke,titleKey:"ADMIN_LABEL_LOGO_SETTINGS",width:"360px"},e.createElement(q,null,e.createElement(m.A,null,e.createElement(E.A,{stringKey:"ADMIN_LABEL_INPUT_TEXT"})),e.createElement(Z,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_TEXT_DESCRIPTION"})),e.createElement(te,{inputTestId:"logoTextInput",onChange:de,placeholderKey:"ADMIN_LOGO_FIELD_TITLE_PLACEHOLDER",value:Vt}),e.createElement(m.A,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_IMAGE_DESKTOP_LABEL"})),e.createElement(Z,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_IMAGE_DESCRIPTION"})),e.createElement(l.Ay,{acceptedTypes:"image/jpeg, image/png, image/tiff, image/bmp, image/gif, image/jpg",dimensionRequirements:{exactDimensions:!1,pixelHeight:150,pixelWidth:500},height:180,imagePreview:Ae,imagePreviewPadding:40,onClearImage:Ue,onFileSubmit:Ie,testIdRemove:"removeDesktopLogoButton",testIdSearchLibrary:"desktopLogoLibraryButton"}),e.createElement(Ne,null,e.createElement(fe,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_HEIGHT_LABEL"})),e.createElement(_e,null,Et,"px")),e.createElement(Le,null,e.createElement(A.A,{variant:"admin",min:C,max:W,step:1,value:[Et],onValueChange:Te})),e.createElement(m.A,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_IMAGE_MOBILE_LABEL"})),e.createElement(Z,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_IMAGE_MOBILE_DESCRIPTION"})),e.createElement(l.Ay,{acceptedTypes:"image/jpeg, image/png, image/tiff, image/bmp, image/gif, image/jpg",dimensionRequirements:{exactDimensions:!1,pixelHeight:150,pixelWidth:500},height:180,imagePreview:Dt,imagePreviewPadding:40,onClearImage:be,onFileSubmit:he,testIdRemove:"removeMobileLogoButton",testIdSearchLibrary:"mobileLogoLibraryButton"}),e.createElement(Ne,null,e.createElement(fe,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_HEIGHT_LABEL"})),e.createElement(_e,null,ze,"px")),e.createElement(Le,null,e.createElement(A.A,{variant:"admin",min:T,max:Y,step:1,value:[ze],onValueChange:Se})),e.createElement(m.A,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_LINK_LABEL"}
537)),e.createElement(Z,null,e.createElement(E.A,{stringKey:"ADMIN_LOGO_LINK_DESCRIPTION"})),e.createElement(y.Ay,{inputTestId:"logoLinkInput",onChange:Yt,placeholderKey:"ADMIN_LOGO_FIELD_URL_PLACEHOLDER",value:vt})))}const q=a.Ay.div` 538 display: flex; 539 flex-direction: column; 540 width: 100%; 541`,Z=a.Ay.span` 542 ${h.Z0} 543 color: ${p.zkP}; 544 margin-bottom: 12px; 545`,te=(0,a.Ay)(y.Ay)` 546 margin-bottom: 24px; 547`,Ne=a.Ay.div` 548 display: flex; 549 justify-content: space-between; 550 align-items: center; 551 margin-bottom: 8px; 552`,fe=(0,a.Ay)(m.A)` 553 margin-bottom: 0; 554`,_e=a.Ay.span` 555 ${h.Z0} 556 color: ${p.o0B}; 557`,Le=a.Ay.div` 558 margin-bottom: 24px; 559`,ct=a.Ay.img` 560 object-fit: contain; 561 max-width: 100%; 562 max-height: 100%; 563`;var gt=t(272568),Nt=t(252992),j=t(467783),H=t(903402),J=t(365179),B=t(41989),U=t(346002),oe=t(835896),Pe=t(463302),we=t(368909),Ee=t(341476);const pt=30,$=22;function K(le){const ce=(0,n.useDispatch)(),{endUserT:ne}=(0,B.T9)(),Ke=(0,n.useSelector)(J.x6f),Ce=(0,e.useRef)(null),[Fe,vt]=(0,e.useState)(!1),[rt,Pt]=(0,e.useState)(void 0),[Vt,bt]=(0,e.useState)(!0),Ae=(0,n.useSelector)(Pe.N6),Dt=(0,n.useSelector)(U.Q),Yt=(0,n.useSelector)(we.VC),Ie=(0,e.useCallback)(()=>{if(Ce.current){const qe=Ce.current.getBoundingClientRect();Pt({top:qe.top,left:qe.left,bottom:qe.bottom,right:qe.right,width:qe.width,height:qe.height})}vt(!0)},[]),he=(0,e.useCallback)(()=>{vt(!1)},[]),de=()=>ce((0,H.rY)("headerLogo")),Te=(0,e.useCallback)(qe=>{ce((0,j.xY)(gt.NU.LOGO,qe))},[ce]),{data:Se}=le,Ue=()=>Yt&&Se.logoMobileUrl&&Se.logoMobileUrl!==gt.gX?Se.logoMobileUrl:Se.logoUrl,be=()=>Yt?Se.logoMobileHeight||$:Se.logoHeight||pt,Et=Ue(),ze=be(),yt=(qe,Jt)=>{if(!Jt||Jt===gt.gX||!Vt)return null;const Q=()=>{bt(!1)},We=qe||"logo",_t=ze?{height:`${ze}px`}:void 0;return e.createElement(ge,{alt:We,className:Nt.KN,onError:Q,src:Jt,style:_t,initial:{opacity:0}
563,animate:{opacity:1},transition:{duration:.4,ease:"easeOut"}})},Qt=!!(Et!==gt.gX&&Et),Hn=Qt&&Vt,It=ne([B.Rq.logoTitle,{pageId:Ke}])||Se.logoTitle,Bt=()=>e.createElement(e.Fragment,null,e.createElement(se,{anchorRect:rt,data:Se,isOpen:Fe,onClose:he,onChange:Te}),e.createElement(pe,{hasImage:Hn,isAdmin:Ae},yt(Dt?Se.logoTitle:It,Se.logoUrl))),At=()=>{const qe=Se.logoLink||"/";return e.createElement(pe,{hasImage:Hn,isAdmin:Ae},Qt&&e.createElement(re,{href:qe,onClick:de,plain:!0},yt(It,Et)))},xt=()=>Ae&&Dt?Bt():At();return e.createElement(G,{ref:Ce,isAdmin:Ae,testId:"editModeLogo",titleKey:"ADMIN_LABEL_LOGO",onEdit:Ie,hasImage:Hn,isEditing:Dt},xt())}const G=(0,a.Ay)(oe.A)` 564 height: 100%; 565 display: flex; 566 justify-content: flex-start; 567 align-items: center; 568 padding-left: ${(0,Ee.UH)()?"20px":"var(--content-padding-inline, 16px)"}; 569 570 ${({isEditing:le})=>le&&(0,a.AH)` 571 min-width: 90px; 572 `} 573 574 ${({isEditing:le,hasImage:ce})=>le&&!ce&&(0,a.AH)` 575 min-height: 75px; 576 `} 577`,pe=a.Ay.div` 578 max-width: ${(0,Ee.UH)()?"200px":"360px"}; 579 display: flex; 580 align-items: center; 581 justify-content: flex-start; 582 flex-shrink: 0; 583 width: ${le=>!le.hasImage&&le.isAdmin?"100px":"auto"}; 584`,re=(0,a.Ay)(f.A)` 585 display: flex; 586 align-items: center; 587 pointer-events: ${le=>le.disabled?"none":"auto"}; 588`,ge=(0,a.Ay)((0,d.P)(ct))``},559750:(ve,x,t)=>{t.d(x,{A:()=>va});var e=t(63696),n=t(224191),a=t(835896),d=t(886550);const f=(0,d.Ay)(a.A)` 589 display: flex; 590 flex-grow: 1; 591 min-width: 0; 592 height: 100%; 593 position: relative; 594`;var E=t(463302),y=t(365179),l=t(731694),I=t(776637),v=t.n(I),m=t(41989),A=t(547670),p=t(663280),h=t(217748),i=t.n(h),r=t(253251),o=t(429195),u=t(400781),c=t(272568),s=t(273277),g=t(30842),P=t(314571),O=t(697683),C=t(196063),W=t(275669),w=t(143e3),T=t(152544),Y=t(545290);const ie=d.Ay.div` 595 display: flex; 596 flex-direction: row; 597 align-items: center; 598 justify-content: flex-start; 599 gap: 15px; 600 height: 33px; 601 padding: 4px 6px; 602 width: 100%; 603 box-sizing: border-box; 604 605 ${({isParent:S})=>!S&&(0,d.AH)` 606 padding-left: 33px; 607 position: relative; 608 609 &::before { 610 content: ''; 611 position: absolute; 612 left: 19px; 613 top: -3px; 614 bottom: -3px; 615 border-left: 1px solid ${o.dmy}; 616 width: 0; 617 } 618 `}; 619`,se=d.Ay.div` 620 color: ${o.o0B}; 621 ${T.z6}; 622 margin-right: 6px; 623 624 ${Y.Gr} 625 flex: 1; 626 min-width: 0; 627`,Z=({isParent:S,item:V})=>{const z=(0,e.useMemo)(()=>(0,r.KK)(V.type),[V.type]);return e.createElement(ie,{"data-testid":l.AI,id:l.AI,isParent:S},e.createElement(w.ar,{iconName:z,isParent:S}),e.createElement(se,null,V.name))};var te=t(89649),Ne=t(711678),fe=t(39258),_e=t(942695),Le=t(619545);const ct=d.Ay.div` 628 display: flex; 629 flex-direction: row; 630 justify-content: space-between; 631 align-items: center; 632 align-self: stretch; 633 634 width: 100%; 635 height: 33px; 636 padding: 0px 10px 0px 6px; 637 border-radius: 50px; 638 639 background: transparent; 640 641 &:hover { 642 background: ${o.kjY}; 643 span { 644 display: block; 645 } 646 svg { 647 cursor: pointer; 648 } 649 } 650`,gt=d.Ay.div` 651 display: flex; 652 flex-direction: row; 653 align-items: center; 654 gap: 4px; 655`,Nt=(0,d.Ay)(Le.A)` 656 ${T.z6}; 657 color: ${o.o0B}; 658 659 display: inline-block; 660 ${Y.Gr} 661 max-width: ${({maxLength:S})=>S}ch; 662 663 text-decoration: none; 664 &:hover { 665 text-decoration: underline; 666 } 667`,j=(0,_e.A)((0,d.Ay)(fe.A).attrs(()=>({name:"trash",color:o.IO}))` 668 display: none; 669 svg { 670 width: 20px; 671 height: 20px; 672 } 673 `,{admin:!0,tooltipArrowCss:"left: 81.5%;",tooltipCss:(0,d.AH)` 674 width: fit-content; 675 height: auto; 676 white-space: normal; 677 text-align: left; 678 padding: 10px; 679 color: ${o.zkP}; 680 ${T.Z0} 681 margin-right: 50px; 682 `});var H=t(816970),J=t(50426),B=t(498685),U=t(166143);const oe=d.Ay.form` 683 display: flex; 684 flex-direction: column; 685 gap: 1px; 686 background: ${o.dHK}; 687`,Pe=d.Ay.div` 688 display: flex; 689 flex-direction: row; 690 align-items: center; 691 justify-content: space-between; 692 padding: 0px 10px 0px 6px; 693 border-radius: 4px 4px 0 0; 694 height: 34px; 695 gap: 4px; 696 background: ${o.k6P}; 697`,we=(0,d.Ay)(U.Ay)` 698 padding: 0; 699 flex: 1; 700 height: 34px; 701 & input { 702 height: 34px; 703 color: ${o.o0B}; 704 ${T.z6}; 705 padding: 0; 706 padding-right: 5px; 707 flex: 1; 708 background: transparent; 709 } 710`,Ee=d.Ay.div` 711 display: flex; 712 flex-direction: column; 713 padding: 10px 16px; 714 align-items: center; 715 align-self: stretch; 716 min-height: 34px; 717 border-radius: 0 0 4px 4px; 718 width: 100%; 719 gap: 2px; 720 background: ${o.YJk}; 721`,pt=d.Ay.div` 722 display: flex; 723 flex-direction: row; 724 align-items: center; 725 width: 100%; 726 727 & > div { 728 padding: 0; 729 } 730`,$=(0,d.AH)` 731 color: ${S=>S.linkUrlStatus==="invalid"?(0,o.__g)(S):S.linkUrlStatus==="valid"?(0,o.jEq)(S):S.linkUrlStatus==="typing"&&S.value?(0,o.o0B)(S):(0,o.sRE)(S)}; 732`,K=d.Ay.span` 733 ${T.Vg}; 734 display: inline-block; 735 ${$} 736`,G=(0,d.Ay)(U.Ay)` 737 width: 100%; 738 & input { 739 padding: 0; 740 height: fit-content; 741 width: 100%; 742 ${Y.WL} 743 background: transparent; 744 ${$} 745 ${T.Vg} 746 ${S=>S.value?(0,d.AH)` 747 text-decoration-line: underline; 748 `:(0,d.AH)` 749 text-decoration-line: none; 750 `} 751 752 &::placeholder { 753 color: ${o.sRE}; 754 ${T.Vg} 755 } 756 &::-webkit-input-placeholder { /* WebKit browsers */ 757 color: ${o.sRE}; 758 } 759 &::-moz-placeholder { /* Mozilla Firefox 19+ */ 760 color: ${o.sRE}; 761 opacity: 1; /* Fix for Firefox */ 762 } 763 } 764 765 766`,pe=d.Ay.div` 767 display: flex; 768 flex-direction: row; 769 align-items: center; 770 height: 12px; 771 width: 100%; 772 gap: 5px; 773`,re=d.Ay.span` 774 color: ${o.sRE}; 775 776 ${T.Vg}; 777`,ge=(0,d.Ay)(fe.A).attrs(S=>({color:(0,o.Yk7)(S),name:"linkOutline"}))` 778 padding: 0px 6px; 779 transform: translateY(-1px); 780 svg { 781 width: 18px; 782 height: 18px; 783 } 784`,le=(0,d.Ay)(fe.A).attrs(S=>({color:(0,o.IO)(S),name:"warning"}))` 785 transform: translateY(-2px); 786 svg { 787 width: 12px; 788 height: 12px; 789 } 790`,ce=(0,d.Ay)(fe.A).attrs(S=>({color:(0,o.IO)(S),name:"trashV2"}))` 791 svg { 792 width: 16px; 793 height: 16px; 794 &:hover > path { 795 fill: ${o.mz9}; 796 } 797 } 798 cursor: pointer; 799 800 &:hover { 801 & path { 802 fill: ${o.Yk7}; 803 } 804 } 805`,ne=(0,d.Ay)(fe.A).attrs(S=>({color:(0,o.IO)(S),name:"checkmarkCircle"}))` 806 svg { 807 width: 16px; 808 height: 16px; 809 &:hover > path { 810 fill: ${o.mz9}; 811 } 812 } 813 cursor: pointer; 814 815 &:hover { 816 & path { 817 fill: ${o.Yk7}; 818 } 819 } 820`,Ke=r.kz,Fe=({closeItself:S,handleLinkUrlChange:V,isSaveButtonDisabled:z,linkName:Ze,linkUrl:ke,linkUrlStatus:st,navigationId:Ct,setLinkName:lt})=>{const{t:ht}=(0,m._h)(),ft=(0,n.useDispatch)(),qt=(0,e.useRef)(null),[Xt,vn,On]=(0,B.M0)(ke,500),ln=(0,e.useCallback)(()=>{z||(ft((0,s.bO)(Ct,{id:(0,H.Xs)(),name:Ze,url:On})),lt(""),V(""),S())},[z,Ze,ke,Ct,S,ft]),mt=(0,e.useCallback)(nn=>{lt(nn.slice(0,Ke))},[lt]),un=nn=>{nn.preventDefault(),ln()};return e.useEffect(()=>{var nn;(nn=qt.current)==null||nn.focus()},[]),e.useEffect(()=>{ke&&vn((0,H.TH)(ke))},[ke]),e.useEffect(()=>{Xt!==ke&&V(Xt)},[Xt,V,ke]),e.createElement(oe,{"data-testid":l.nA,id:l.nA,onSubmit:un},e.createElement(Pe,null,e.createElement(ge,null),e.createElement(we,{"data-testid":l._4,onChange:mt,placeholderKey:"ADM
820IN_NAVIGATION_BLOCK_EXTERNAL_LINKS_INPUT_NAME_PLACEHOLDER",setInputRef:qt,value:Ze}),e.createElement(ce,{"data-testid":l.z1,onClick:S,tabIndex:-1}),e.createElement("button",{tabIndex:-1,type:"submit"},e.createElement(ne,{"data-testid":l.c$,tabIndex:-1}))),e.createElement(Ee,null,e.createElement(pt,null,e.createElement(K,{linkUrlStatus:st,value:ke},J.D),e.createElement(G,{"data-testid":l.QP,linkUrlStatus:st,onChange:vn,placeholderKey:"ADMIN_NAVIGATION_BLOCK_EXTERNAL_LINKS_INPUT_URL_PLACEHOLDER",value:(0,H.Nj)(On)})),st==="invalid"&&e.createElement(pe,null,e.createElement(le,null),e.createElement(re,null,ht("ADMIN_NAVIGATION_BLOCK_EXTERNAL_LINKS_INPUT_ERROR_MESSAGE")))))},rt=({link:S,navigationId:V})=>{const z=(0,n.useDispatch)(),Ze=(0,e.useCallback)(()=>{z((0,te.to)({kind:Ne.V.adminConfirmation,data:{onConfirmClick:()=>{z((0,s.Nv)(V,S.id)),z((0,te.y_)("adminConfirmation"))},titleKey:"DELETE_LINK_CONFIRMATION"}}))},[z,V,S.id]);return e.createElement(ct,{"data-testid":l.DJ,id:l.DJ},e.createElement(gt,null,e.createElement(ge,null),e.createElement(Nt,{href:S.url,maxLength:Ke},S.name)),e.createElement(j,{onClick:Ze,tooltipKey:"DELETE_LINK"}))},Pt=d.Ay.div` 821 width: 100%; 822 gap: 20px; 823 824 margin-top: 30px; 825`,Vt=d.Ay.div` 826 color: ${o.zkP}; 827 ${T.z6}; 828 829 margin-bottom: 15px; 830`,bt=d.Ay.div` 831 display: flex; 832 flex-direction: column; 833 gap: 2.5px; 834`,Dt=()=>{const{t:S}=(0,m._h)(),V=(0,n.useSelector)(s.Io);return e.createElement(Pt,{"data-testid":l.k3,id:l.k3},e.createElement(Vt,null,S("EXTERNAL_LINKS")),e.createElement(bt,null,V.externalLinks.map(z=>e.createElement(rt,{key:z.url,link:z,navigationId:V._id}))))};var Yt=t(594661);const he=()=>{const[S,V]=(0,e.useState)(""),{linkUrl:z,setLinkUrl:Ze,linkUrlStatus:ke,setLinkUrlStatus:st,onChange:Ct}=(0,J.A)(""),lt=(0,e.useMemo)(()=>ke!=="valid"||S.trim()==="",[ke,S]);return{linkName:S,setLinkName:V,linkUrl:z,setLinkUrl:Ze,linkUrlStatus:ke,setLinkUrlStatus:st,handleLinkUrlChange:Ct,isSaveButtonDisabled:lt}};var de=t(154789);const Te=d.Ay.div` 835 position: relative; 836 width: 100%; 837`,Se=d.Ay.div` 838 display: flex; 839 flex-direction: column; 840 width: 100%; 841 gap: 5px; 842 background: ${o.dHK}; 843`,Ue=d.Ay.div` 844 width: 100%; 845 height: ${({height:S})=>S||30}px; 846 position: relative; 847 848 &::after { 849 content: ''; 850 position: absolute; 851 top: 0; 852 left: 0; 853 right: 0; 854 bottom: 0; 855 background: linear-gradient(to bottom, rgba(0, 0, 0, 0), ${o.dHK}); 856 pointer-events: none; 857 } 858`,be=(0,d.Ay)(de.$n)` 859 display: flex; 860 align-items: center; 861 justify-content: center; 862 863 height: 40px; 864 padding: 12px 24px 12px 16px; 865 gap: 8px; 866 border: 1px solid ${o.dmy}; 867 background-color: transparent !important; 868 width: 100%; 869 margin-top: 5px; 870 871 &:hover { 872 background-color: transparent !important; 873 border: 1px solid ${o.Qod}; 874 } 875 876 color: ${o.o0B}; 877 ${T.z6} 878 879 & svg, & svg > path, 880 &:hover svg, &:hover svg > path { 881 fill: none; 882 } 883`,Et=d.Ay.div` 884 display: flex; 885 flex-direction: row; 886 justify-content: space-between; 887 align-items: center; 888 height: 34px; 889 max-height: 34px; 890 padding: 0px 10px 0px 6px; 891 border-radius: 4px 4px 0 0; 892 gap: 4px; 893 background: ${o.k6P}; 894`,ze=(0,d.Ay)(U.Ay)` 895 color: ${o.o0B}; 896 ${T.z6}; 897 height: 34px; 898 padding: 0; 899`,yt=d.Ay.div` 900 display: flex; 901 flex-direction: column; 902 padding: 10px 16px; 903 align-items: center; 904 align-self: stretch; 905 min-height: 34px; 906 z-index: 2; 907 border-radius: 0 0 4px 4px; 908 width: 100%; 909 gap: 2px; 910 background: ${o.YJk}; 911 912 & > div { 913 padding: 0; 914 } 915`,Qt=d.Ay.div` 916 display: flex; 917 flex-direction: row; 918 align-items: center; 919 height: 12px; 920 width: 100%; 921 gap: 5px; 922`,Hn=d.Ay.span` 923 color: ${o.sRE}; 924 925 ${T.Vg}; 926`,It=(0,d.Ay)(de.$n)` 927 margin-top: 30px; 928 929 display: flex; 930 height: 40px; 931 padding: 12px 24px; 932 justify-content: center; 933 align-items: center; 934 margin-left: auto; 935`,Bt=d.Ay.div` 936 position: absolute; 937 bottom: 100%; 938 width: 100%; 939`;var At=t(346002),xt=t(551321);const Jt=()=>{const{t:S}=(0,m._h)(),V=(0,n.useDispatch)(),z=(0,n.useSelector)(s.Dc),Ze=(0,n.useSelector)(s.hV),ke=(0,n.useSelector)(At.Fe),st=(0,n.use
939Selector)(u.iM),Ct=(0,e.useMemo)(()=>Ze._id===z._id,[Ze._id,z._id]),lt=(0,e.useCallback)(()=>{Ct||(V((0,s.BN)(z._id,st._id)),ke&&V((0,c.NI)(ke._id,(0,p.Ay)(ke,ht=>i()(ht,"data.navigation_id",z._id)))))},[z._id,st._id,Ct,V,ke]);return e.createElement("div",{className:"flex justify-end mt-6"},e.createElement(xt.$,{context:"admin",className:"h-10 rounded-full font-bold",disabled:Ct,onClick:lt},S("ADMIN_NAVIGATION_BLOCK_APPLY")))},We=()=>{const{t:S}=(0,m._h)(),[V,z]=(0,Yt.A)(!1),Ze=(0,n.useSelector)(s.Io),{linkName:ke,linkUrl:st,linkUrlStatus:Ct,setLinkName:lt,handleLinkUrlChange:ht,isSaveButtonDisabled:ft}=he();return e.createElement(Te,{"data-testid":l.Ng,id:l.Ng},e.createElement(Se,null,V&&e.createElement(Bt,null,e.createElement(Fe,{closeItself:z,handleLinkUrlChange:ht,isSaveButtonDisabled:ft,linkName:ke,linkUrl:st,linkUrlStatus:Ct,navigationId:Ze._id,setLinkName:lt})),e.createElement(be,{onClick:z},e.createElement(ge,null),S("ADD_EXTERNAL_LINK")),e.createElement(Jt,null)))};var _t=t(269010),ae=t(74846);const Be=d.Ay.div` 940 width: 100%; 941 position: sticky; 942 top: 0; 943 margin-top: 16px; 944 margin-bottom: 20px; 945 z-index: 2; 946 947 & input { 948 width: 80%; 949 } 950 951 & .${ae.Ir} { 952 height: 56px; 953 width: 100%; 954 display: flex; 955 align-items: center; 956 padding: 16px; 957 background: ${o.k6P}; 958 } 959 960 & .${ae.OX} { 961 background-color: ${o.dHK}; 962 border: 1px solid ${o.kjY}; 963 border-top: none; 964 border-radius: 0 0 4px 4px; 965 box-shadow: none; 966 } 967 968 & .${ae.HH} { 969 height: 40px; 970 background-color: ${o.dHK}; 971 color: ${o.o0B}; 972 973 ${T.z6}; 974 &:hover { 975 background-color: ${o.kjY}; 976 } 977 } 978 979 & .${ae.HH}.first-row { 980 height: 40px; 981 982 color: ${o.zkP}; 983 ${T.Vg}; 984 &:hover { 985 background-color: ${o.dHK}; 986 } 987 cursor: default; 988 } 989 990 & .${ae.HH}.last-row { 991 background-color: ${o.k6P}; 992 &:hover { 993 background-color: ${o.k6P}; 994 } 995 } 996 997 & .${ae.HH}.is-editing { 998 background-color: ${o.k6P}; 999 &:hover { 1000 background-color: ${o.k6P}; 1001 } 1002 } 1003 `;var et=Object.defineProperty,nt=Object.defineProperties,Ut=Object.getOwnPropertyDescriptors,Kt=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Gt=(S,V,z)=>V in S?et(S,V,{enumerable:!0,configurable:!0,writable:!0,value:z}):S[V]=z,Lt=(S,V)=>{for(var z in V||(V={}))ot.call(V,z)&&Gt(S,z,V[z]);if(Kt)for(var z of Kt(V))Ye.call(V,z)&&Gt(S,z,V[z]);return S},tn=(S,V)=>nt(S,Ut(V));const jt=e.forwardRef((S,V)=>{const{t:z}=(0,m._h)(),Ze=(0,n.useDispatch)(),ke=(0,n.useSelector)(s.mL),st=(0,n.useSelector)(s.Dc),Ct=(0,n.useSelector)(s.hV),[lt,ht]=(0,e.useState)(null),[ft,qt]=(0,e.useState)([]),Xt=mt=>mt.type==="default"?l.nZ:st._id===mt._id?l.oy:l.ve;(0,e.useEffect)(()=>{qt([{name:z("ADMIN_NAVIGATION_BLOCK_DROPDOWN_SELECT"),_id:"",disableSelection:!0}
1003,...ke.map(mt=>tn(Lt({},mt),{isEditing:lt===mt._id,"data-testid":Xt(mt),setEditableCustomNavId:()=>ht(un=>un===mt._id?null:mt._id),renameCustomNavigation:un=>{Ze((0,s.e9)({_id:mt._id,name:un}))},isApplied:mt._id===Ct._id})),{name:z("ADMIN_NAVIGATION_BLOCK_DROPDOWN_CREATE_CUSTOM_NAVIGATION"),_id:"","data-testid":l.J_}])},[v()(ke),lt,Ct._id]);const vn=(0,e.useCallback)(mt=>mt?mt.name:"",[]),On=(0,e.useCallback)(mt=>{mt?._id&&Ze((0,s.th)(mt._id))},[]),ln=mt=>{const un=(()=>mt.length===0?"Custom Navigation":mt.length<r.kH?`Custom Navigation ${mt}`:mt)();qt(nn=>(nn[nn.length-1]=tn(Lt({},nn[nn.length-1]),{name:mt===""?z("ADMIN_NAVIGATION_BLOCK_DROPDOWN_CREATE_CUSTOM_NAVIGATION"):z("ADMIN_NAVIGATION_BLOCK_DROPDOWN_CREATE_CUSTOM_NAVIGATION_DYNAMIC",{navName:mt}),navName:un}),nn))};return e.createElement(Be,{ref:V,"data-testid":l.ZY,id:l.ZY},e.createElement(_t.ms,{arrowOffset:"12px",dropdownMaxHeight:"25vh !important",getOptionLabel:vn,isSearchable:!0,isSiteNavigation:!0,onChange:On,onInputChange:ln,options:ft,padding:"0",value:st,valueKey:"name"}))});var qn=t(846177),hn=t.n(qn),Eo=t(283722);const Oo=d.Ay.div` 1004 width: 100%; 1005`,Dn=d.Ay.div` 1006 background: ${o.dHK}; 1007 margin-top: 10px; 1008 width: 100%; 1009 gap: 8px; 1010 1011 & input { 1012 width: 90%; 1013 } 1014 1015 & .${ae.Ir} { 1016 height: 34px; 1017 width: 100%; 1018 display: flex; 1019 align-items: center; 1020 padding: 16px; 1021 background: ${o.k6P}; 1022 } 1023 1024 & .${ae.OX} { 1025 background-color: ${o.dHK}; 1026 border: 1px solid ${o.kjY}; 1027 border-bottom: none; 1028 border-radius: 4px 4px 0 0; 1029 box-shadow: none; 1030 } 1031 1032 & .${ae.HH} { 1033 height: 40px; 1034 background-color: ${o.dHK}; 1035 color: ${o.o0B}; 1036 1037 ${T.z6}; 1038 &:hover { 1039 background-color: ${o.kjY}; 1040 } 1041 } 1042 1043 & .${ae.zt} { 1044 color: ${o.sRE}; 1045 ${T.z6}; 1046 } 1047 1048 & .${ae.HH}.first-row { 1049 height: 42px; 1050 1051 color: ${o.zkP}; 1052 ${T.Vg}; 1053 &:hover { 1054 background-color: ${o.dHK}; 1055 } 1056 cursor: default; 1057 1058 & > div { 1059 transform: translateX(5px); 1060 } 1061 } 1062 1063 & .${ae.HH}.create-folder { 1064 background-color: ${o.k6P}; 1065 &:hover { 1066 background-color: ${o.k6P}; 1067 } 1068 } 1069 1070 & .${ae.HH}.create-link { 1071 background-color: ${o.k6P}; 1072 &:hover { 1073 background-color: ${o.k6P}; 1074 } 1075 } 1076 1077 & .${ae.lm} { 1078 margin: -16px; 1079 padding: 16px 16px 16px 41px; 1080 width: calc(100% + 32px); 1081 1082 & > div { 1083 width: 85%; 1084 } 1085 } 1086`,Bn=(0,d.Ay)(Eo.Ay).attrs(S=>({name:"plus",color:(0,o.o0B)(S)}))` 1087 position: absolute; 1088 left: 35px; 1089 top: 50%; 1090 transform: translateY(-50%); 1091 z-index: 1; 1092 width: 20px; 1093 height: 20px; 1094 display: flex; 1095 align-items: center; 1096 justify-content: center; 1097 pointer-events: none; 1098`;var Gn=t(18631);const Mn=d.Ay.div` 1099 background: ${o.dHK}; 1100 padding-right: 10px; 1101 width: 375px; 1102 height: 100%; 1103 border-radius: 10px; 1104 padding: 30px; 1105 position: relative; 1106 max-height: calc(61vh + 65px); 1107 overflow-x: visible; 1108 z-index: 3; 1109`,Un=d.Ay.div` 1110 display: flex; 1111 flex-direction: column; 1112 align-items: flex-start; 1113 flex: 1; 1114 min-height: 300px; 1115`,so=d.Ay.div` 1116 display: flex; 1117 flex-direction: row; 1118 justify-content: space-between; 1119 align-items: center; 1120 width: 100%; 1121`,To=d.Ay.span` 1122 ${T.p6} 1123 1124 color: ${o.o0B}; 1125`,gn=d.Ay.div` 1126 display: flex; 1127 flex-direction: row; 1128 align-items: center; 1129 gap: 8px; 1130 align-self: stretch; 1131 1132 margin-top: 30px; 1133 margin-bottom: 14px; 1134`,ue=d.Ay.span` 1135 ${T.Z1} 1136 1137 color: ${o.o0B}; 1138`,Re=d.Ay.span` 1139 ${T.Z0} 1140 1141 color: ${o.zkP}; 1142`,Xe=d.Ay.div` 1143 user-select: none; 1144 display: flex; 1145 flex-direction: column; 1146 align-items: flex-start; 1147 gap: 6px; 1148 width: 100%; 1149`,Zt=d.Ay.span` 1150 ${T.z6} 1151 1152 color: ${o.zkP}; 1153 margin-bottom: 5px; 1154`,on=d.Ay.div` 1155 padding: 0px 10px 0px 8px; 1156 width: 100%; 1157`,Ht=d.Ay.div` 1158 position: relative; 1159 width: 100%; 1160 display: flex; 1161 flex-direction: column; 1162 height: 100%; 1163 margin-top: 4px; 1164 1165 & > div { 1166 padding: 0; 1167 overflow-x: hidden !important; 1168 overflow-y: auto !important; 1169 } 1170`,_n=d.Ay.div` 1171 display: flex; 1172 flex-direction: row; 1173 align-items: center; 1174`,Rn=(0,d.Ay)(Gn.A)` 1175 & > div div:after, > div div:before { 1176 background: ${o.IO}; 1177 } 1178 margin-right: 8px; 1179 transform: scale(0.8); 1180`,eo=d.Ay.div` 1181 width: 100%; 1182 display: flex; 1183 justify-content: center; 1184`,to=d.Ay.div` 1185 display: flex; 1186 flex-direction: column; 1187 width: 100%; 1188 flex: 1; 1189 min-height: 0; 1190 1191 ${({disabled:S})=>S&&` 1192 opacity: 0.5; 1193 pointer-events: none; 1194 user-select: none; 1195 `} 1196`,Wn=S=>
1196{const V=(0,n.useSelector)(s.Dc),z=(0,n.useSelector)(s.Io),Ze=S||z,{parentHashMap:ke,childHashMap:st}=e.useMemo(()=>(0,r.is)(V),[V]),{parentHashMap:Ct,childHashMap:lt}=e.useMemo(()=>(0,r.is)(Ze),[Ze]);return{defaultParentHashMap:Ct,defaultChildHashMap:lt,selectedParentHashMap:ke,selectedChildHashMap:st}};var Fn=Object.defineProperty,Po=Object.defineProperties,no=Object.getOwnPropertyDescriptors,wo=Object.getOwnPropertySymbols,Co=Object.prototype.hasOwnProperty,yn=Object.prototype.propertyIsEnumerable,Yn=(S,V,z)=>V in S?Fn(S,V,{enumerable:!0,configurable:!0,writable:!0,value:z}):S[V]=z,oo=(S,V)=>{for(var z in V||(V={}))Co.call(V,z)&&Yn(S,z,V[z]);if(wo)for(var z of wo(V))yn.call(V,z)&&Yn(S,z,V[z]);return S},Sn=(S,V)=>Po(S,no(V));const xo=()=>{const{t:S}=(0,m._h)(),V=(0,n.useDispatch)(),z=(0,n.useSelector)(s.Dc),Ze=(0,n.useSelector)(s.Io),ke=(0,n.useSelector)(s.KY),{loadMore:st,isLoadingMore:Ct,search:lt}=(0,W.A)(),[ht,ft]=(0,e.useState)(""),qt=(0,e.useMemo)(()=>Sn(oo({},Ze),{parents:ht?ke||[]:Ze.parents}),[Ze,ht,ke]),{defaultParentHashMap:Xt,defaultChildHashMap:vn,selectedParentHashMap:On,selectedChildHashMap:ln}=Wn(qt),mt=(0,e.useMemo)(()=>hn()(lt,300),[lt]);(0,e.useEffect)(()=>()=>mt.cancel(),[mt]);const un=(0,e.useCallback)(St=>(0,r.KK)(St),[]),nn=(0,e.useCallback)(St=>St?St.name:"",[]),jn=(0,e.useCallback)(St=>{if(!St.id)return;const zt=Sn(oo({},St),{children:[]});delete zt.icon,V((0,s.zm)(zt,z._id))},[z]),Tn=(0,e.useMemo)(()=>{const St=[];for(const[zt,ro]of Xt)On.has(zt)||ln.has(zt)||ro.private||St.push(ro);for(const[zt,ro]of vn)On.has(zt)||ln.has(zt)||ro.private||St.push(ro);return St},[Xt,vn,On,ln]),[zn,Ao]=(0,e.useState)([]);(0,e.useEffect)(()=>{Ao([{name:S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_SELECT"),slug:"",id:"",type:"",icon:""},{name:S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_CREATE_FOLDER"),slug:"",id:"",type:"",icon:"","data-testid":l.zA},{name:S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_CREATE_LINK"),slug:"",id:"",type:"",icon:"","data-testid":l.VF},...Tn.map(St=>({name:St.name,slug:St.slug,type:St.type,icon:un(St.type),id:St.id,"data-testid":l.TF}))])},[Tn]);const vo=St=>{ft(St);
1196const zt=(0,r.Mr)(St),ro=(0,r.WL)(zt),Fo=zt;mt(St);const ka=1,Ba=2;Ao(Ca=>(Ca[ka]=Sn(oo({},Ca[ka]),{name:zt===""?S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_CREATE_FOLDER"):S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_CREATE_FOLDER_DYNAMIC",{folderName:zt}),folderName:ro,linkName:Fo}),Ca[Ba]=Sn(oo({},Ca[Ba]),{name:zt===""?S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_CREATE_LINK"):S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_CREATE_LINK_DYNAMIC",{linkName:zt}),folderName:ro,linkName:Fo}),Ca))},Cn=(0,e.useCallback)(St=>{St&&(mt.cancel(),ft(""))},[mt]);return e.createElement(Oo,{"data-testid":l.QN,id:l.QN},e.createElement(Dn,null,e.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"}},e.createElement(Rn,{maxWidth:"unset"}),e.createElement(Bn,null),e.createElement(_t.ms,{disableSelection:!0,dropdownMaxHeight:"24vh !important",dropUp:!0,externallyFiltered:!0,getOptionLabel:nn,isCustomNavigation:!0,isLoadingMore:Ct,isSearchable:!0,onChange:jn,onInputChange:vo,onMenuScrollToBottom:st,onToggleDropdown:Cn,options:zn,padding:"0",placeholder:S("ADMIN_NAVIGATION_BLOCK_CUSTOM_DROPDOWN_PLACEHOLDER"),valueKey:"navigationTitle"})),e.createElement(Jt,null)))};var ao=t(881051),Lo=t(294255),Io=t(171751);const uo=d.Ay.div` 1197 display: none; 1198 flex-direction: row; 1199 align-items: center; 1200 gap: 4px; 1201 cursor: pointer; 1202`,Uo=d.Ay.div` 1203 display: flex; 1204 padding: 0px 10px 0px 8px; 1205 box-sizing: border-box; 1206 justify-content: space-between; 1207 align-items: center; 1208 flex: 1 0 0; 1209 min-width: 0; 1210 border-radius: 50px; 1211 width: 100%; 1212 height: 34px; 1213 min-height: 34px; 1214 cursor: pointer; 1215 &:hover { 1216 background: ${({isEditing:S})=>S?o.k6P:o.kjY}; 1217 } 1218 background: ${({isEditing:S})=>S?o.k6P:"transparent"}; 1219`,Ko=d.Ay.div` 1220 display: flex; 1221 flex-direction: row; 1222 align-items: center; 1223 margin-left: 6px; 1224 gap: 6px; 1225 width: 100%; 1226 min-width: 0; 1227`,Qn=(0,d.AH)` 1228 color: ${o.o0B}; 1229 ${T.z6}; 1230`,Mo=d.Ay.span` 1231 ${Qn} 1232 ${Y.Gr} 1233 display: block; 1234 flex: 1; 1235 min-width: 0; 1236`,_o=(0,d.Ay)(U.Ay)` 1237 1238 & input { 1239 width: 100%; 1240 height: 100%; 1241 padding: 0; 1242 padding-right: 3px; 1243 margin-right: 6px; 1244 ${Qn}; 1245 } 1246`,oa=d.Ay.div` 1247 display: flex; 1248 flex-direction: row; 1249 align-items: center; 1250 justify-content: space-between; 1251 width: 100%; 1252`,Va=d.Ay.span` 1253 color: ${o.sRE}; 1254 1255 ${T.Vg}; 1256`,Qo=(0,d.Ay)(fe.A).attrs(()=>({name:"removeIconOutline",color:o.sRE}))` 1257 display: flex; 1258 width: 16px; 1259 height: 16px; 1260 1261 & > svg { 1262 path { 1263 fill: ${o.Yk7}; 1264 } 1265 } 1266 1267 margin-left: 6px; 1268 margin-right: 11.5px; 1269 transform: translateY(-4px); 1270`;var Jo=Object.defineProperty,aa=Object.getOwnPropertySymbols,ra=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable,Wo=(S,V,z)=>V in S?Jo(S,V,{enumerable:!0,configurable:!0,writable:!0,value:z}):S[V]=z,ha=(S,V)=>{for(var z in V||(V={}))ra.call(V,z)&&Wo(S,z,V[z]);if(aa)for(var z of aa(V))lo.call(V,z)&&Wo(S,z,V[z]);return S};const sa=r.kz,ya=({navigationItem:S})=>{const{t:V}=(0,m._h)(),z=(0,n.useDispatch)(),Ze=(0,n.useSelector)(s.Dc),st=(0,n.useSelector)(s.w$)===S.id,[Ct,lt]=(0,e.useState)(S.name),ht=(0,e.useMemo)(()=>(0,r.KK)(S.type),[S.type]),ft=Ze.parents.some(Cn=>Cn.id===S.id),qt=(0,e.useMemo)(()=>{var Cn;const zt=((Cn=S.children)==null?void 0:Cn.length)>0;return ft&&zt},[ft,v()(S)]),Xt=(0,e.useCallback)(Cn=>{lt(Cn.slice(0,sa))},[]),vn=(0,e.useCallback)(()=>{const Cn=(0,r.WL)(Ct),St=(0,r.CI)(Ze,Cn,S.id),zt=(0,Io.Yv)(St);z((0,s.A7)("")),lt(St),Ze._id&&(S.name===St&&S.slug===zt||z((0,s.uG)({navigationId:Ze._id,folderId:S.id,name:St,slug:zt})))},[z,Ct,S,Ze]),On=(0,e.useCallback)(Cn=>{Cn.key==="Enter"&&vn()},[vn]),ln=(0,e.useCallback)(()=>{st&&vn()},[st,vn]),mt=(0,e.useCallback)((Cn,St)=>{const zt=document.getElementById(l.Xo);if(!zt)return;const ro=St.getBoundingClientRect(),Fo=zt.getBoundingClientRect();Cn.style.position="absolute",Cn.style.top=`${ro.top-Fo.top}px`,Cn.style.left=`${Fo.width+8}px`},[]),{isOpen:un,containerRef:nn,positionMenu:jn,toggleMenu:Tn}=(0,ao.A)(mt,{ignoreIDs:[]}),zn=(0,e.useCallback)(Cn=>{Cn.stopPropagation(),Tn(),z((0,s.A7)(S.id))},[Tn,S.id,z]),Ao=(0,e.useCallback)(()=>{z((0,te.to)({kind:Ne.V.adminConfirmation,data:ha({onConfirmClick:()=>{z((0,s.n4)(Ze._id,S.id)),z((0,te.y_)("adminConfirmation"))}
1270,titleKey:"ADMIN_NAVIGATION_BLOCK_CARDS_MENU_CUSTOM_NAVIGATION_ITEM_DELETE_TITLE"},qt&&{subtitleKey:"ADMIN_NAVIGATION_BLOCK_CARDS_MENU_CUSTOM_NAVIGATION_ITEM_DELETE_SUBTITLE"})})),Tn()},[Tn,z,qt,S.id,Ze._id]),vo=(0,e.useMemo)(()=>S.type===g.xA.folder?[{id:"folder-rename",name:V("ADMIN_NAVIGATION_BLOCK_CUSTOM_MENU_ITEM_ACTIONS_RENAME"),icon:"pencil",dataTestId:l.l_,handler:zn},{id:"page-remove_from_custom_navigation",name:V("ADMIN_NAVIGATION_BLOCK_CUSTOM_MENU_ITEM_ACTIONS_REMOVE"),icon:"trashV2",dataTestId:l.jE,handler:Ao}]:[{id:"page-remove_from_custom_navigation",name:V("ADMIN_NAVIGATION_BLOCK_CUSTOM_MENU_ITEM_ACTIONS_REMOVE"),icon:"trashV2",dataTestId:l.jE,handler:Ao}],[S.type,zn,Ao]);return e.createElement(Uo,{ref:nn,"data-testid":l.QJ,id:l.QJ,isEditing:st},e.createElement(Ko,null,e.createElement(w.ar,{iconName:ht,isParent:ft}),st?e.createElement(_o,{autoFocus:!0,onBlur:ln,onChange:Xt,onKeyDown:On,padding:"0",value:Ct}):e.createElement(Mo,null,S.name)),e.createElement(Lo.A,{cardsMenuId:l.Ik,isAdmin:!0,isFloatMenuOpen:un,menuActions:vo,portalTarget:document.getElementById(l.Xo),positionMenu:jn,threeDotsMenuId:l.yJ,toggleMenu:Tn}))},Aa=(0,d.Ay)(fe.A).attrs(()=>({name:"link",color:o.Yk7}))` 1271 display: flex; 1272 width: 18px; 1273 height: 18px; 1274 1275 & > svg { 1276 width: 18px; 1277 height: 18px; 1278 } 1279 1280 transform: translateY(-2px); 1281`,Jn=(0,d.Ay)(Le.A)` 1282 ${Qn}; 1283 ${Y.Gr} 1284 display: inline-block; 1285 max-width: ${({maxLength:S})=>S}ch; 1286 text-decoration: none; 1287 1288 &:hover { 1289 text-decoration: underline; 1290 } 1291`,Xo=({link:S})=>{const{t:V}=(0,m._h)(),z=(0,n.useDispatch)(),Ze=(0,n.useSelector)(s.Dc),ke=(0,e.useCallback)((Xt,vn)=>{const On=document.getElementById(l.Xo);if(!On)return;const ln=vn.getBoundingClientRect(),mt=On.getBoundingClientRect();Xt.style.position="absolute",Xt.style.top=`${ln.top-mt.top}px`,Xt.style.left=`${mt.width+8}px`},[]),{isOpen:st,containerRef:Ct,positionMenu:lt,toggleMenu:ht}=(0,ao.A)(ke,{ignoreIDs:[]}),ft=(0,e.useCallback)(()=>{z((0,s.Nv)(Ze._id,S.id))},[z,S.id,Ze._id]),qt=(0,e.useMemo)(()=>[{id:"link-remove_from_custom_navigation",name:V("ADMIN_NAVIGATION_BLOCK_CUSTOM_MENU_ITEM_ACTIONS_REMOVE"),icon:"trashV2",dataTestId:l.jE,handler:ft}],[ft]);return e.createElement(Uo,{ref:Ct},e.createElement(Ko,null,e.createElement(Aa,null),e.createElement(Jn,{href:S.url,maxLength:Ke},S.name)),e.createElement(Lo.A,{cardsMenuId:l.WF,isAdmin:!0,isFloatMenuOpen:st,menuActions:qt,portalTarget:document.getElementById(l.Xo),positionMenu:lt,threeDotsMenuId:l.xO,toggleMenu:ht}))},jo=({anchorRect:S,isOpen:V,onClose:z})=>{const{t:Ze}=(0,m._h)(),ke=(0,n.useDispatch)(),st=(0,n.useSelector)(u.iM),Ct=(0,n.useSelector)(s.Dc),lt=(0,e.useMemo)(()=>(0,r.CL)(Ct),[Ct]),ht=lt.type,{isAddingLinkToCustomNavigation:ft,autoFilledLinkName:qt}=(0,n.useSelector)(s.J1),Xt=(0,n.useSelector)(s.TL),vn=(0,n.useSelector)(s.ML),On=(0,n.useSelector)(y.T29),ln=(0,n.useSelector)(s.w$),{linkName:mt,linkUrl:un,linkUrlStatus:nn,setLinkName:jn,handleLinkUrlChange:Tn,isSaveButtonDisabled:zn}=he(),{loadMore:Ao,isLoadingMore:vo}=(0,W.A)(),Cn=(0,e.useRef)(null);(0,e.useEffect)(()=>{const Me=Cn.current;if(!Me)return;const wt=Ot=>Ot.stopPropagation();return Me.addEventListener("mousedown",wt),()=>Me.removeEventListener("mousedown",wt)},[]),(0,e.useEffect)(()=>{vn||ke((0,s.jf)())},[]);const St=(0,e.useMemo)(()=>lt.parents.flatMap(Me=>[Me,...Me.children]),[lt]),zt=(0,e.useMemo)(()=>new Set(lt.parents.map(Me=>Me.id)),[lt.parents]);(0,e.useEffect)(()=>{jn(qt)},[qt]);const ro=(0,e.useCallback)(()=>e.createElement(Xe,{"data-testid":l.Yh,id:l.Yh},St.map(Me=>e.createElement(Z,{key:Me.id,isParent:zt.has(Me.id),item:Me})),vo&&e.createElement(eo,null,e.createElement(A.y,null)),e.createElement(Dt,null)),[St,zt,vo]),Fo=({items:Me,dragItem:wt})=>{if(!lt._id)return;const Ot=(0,r.sr)(lt.parents,Me,wt.id);Ot&&ke((0,s.Dl)({navigationId:lt._id,op:Ot}))},ka=e.useCallback(({item:Me})=>Me.id!==ln,[ln]),Ba=(0,e.useCallback)(Me=>{const wt=Me.item;return e.createElement(_n,null,e.createElement(Rn,{"data-testid":l.lh,maxWidth:"unset"}),e.createElement(ya,{navigationItem:wt}))},[]),Ca=(0,e.useCallback)(()=>lt.parents.length?e.createElement(Ht,null,e.createElement(P.A,{disableDrag:ka,maxDepth:2,onChange:Fo,onConfirmChange:r.wg,renderItem:Ba,source:"navigation_block-parents",treeData:lt.parents})):null,[lt.parents,Fo,Ba]),nr=(0,e.useCallback)(({items:Me,dragItem:wt})=>
1291{if(!lt._id)return;const Ot=(0,r.Lg)(Me,wt.id);Ot&&ke((0,s.Dl)({navigationId:lt._id,op:Ot}))},[lt._id,ke]),or=(0,e.useCallback)(Me=>{const wt=Me.item;return e.createElement(_n,null,e.createElement(Rn,{"data-testid":l.lh,maxWidth:"unset"}),e.createElement(Xo,{link:wt}))},[]),sr=(0,e.useCallback)(()=>lt.externalLinks.length?e.createElement(Ht,null,e.createElement(P.A,{maxDepth:1,onChange:nr,onConfirmChange:void 0,renderItem:or,source:"navigation_block-links",treeData:lt.externalLinks})):null,[lt.externalLinks,nr,or]),D=()=>{const Me=()=>{ke((0,s.vi)({isAddingLink:!1,linkName:""}))};return e.createElement(Xe,{"data-testid":l.KW,id:l.KW},e.createElement(Zt,null,Ze("ADMIN_NAVIGATION_BLOCK_CUSTOM_SECTION_TITLE")),Ca(),sr(),ft&&e.createElement(on,null,e.createElement(Fe,{closeItself:Me,handleLinkUrlChange:Tn,isSaveButtonDisabled:zn,linkName:mt,linkUrl:un,linkUrlStatus:nn,navigationId:lt._id,setLinkName:jn})))},M=()=>Xt?e.createElement(eo,null,e.createElement(A.y,null)):ht===g.YR.default?ro():ht===g.YR.custom?D():null,L=()=>Xt?null:ht===g.YR.default?e.createElement(We,null):ht===g.YR.custom?e.createElement(xo,null):null,ee=(0,e.useCallback)(Me=>{ke((0,c.NI)(st._id,(0,p.Ay)(st,wt=>i()(wt,"data.regions.navigation.state",Me?"on":"off"))))},[v()(st)]),Qe=(0,e.useCallback)(Me=>{var wt,Ot;if(ht!==g.YR.default)return;const Wt=(Ot=(wt=Me?.elements)==null?void 0:wt.call(Me))==null?void 0:Ot.viewport;Wt&&Wt.scrollTop+Wt.clientHeight+50>=Wt.scrollHeight&&Ao()},[ht,Ao]);return e.createElement(C.A,{anchorPlacementOrder:["below"],anchorRect:S,isOpen:V,modalId:l.Xo,onClose:z,onScroll:Qe,titleKey:"ADMIN_NAVIGATION_BLOCK_TITLE",width:"450px",maxHeight:`calc(100vh - 32px - ${o.uF$}px - ${o.HM7}px - 20px)`},e.createElement(so,null,e.createElement(ue,null,Ze("ADMIN_NAVIGATION_BLOCK_TOGGLE_LABEL")),e.createElement(O.A,{checked:On,"data-testid":l.yB,id:l.yB,onChange:ee})),e.createElement(to,{disabled:!On},e.createElement(Re,null,Ze("ADMIN_NAVIGATION_BLOCK_INFO")),!Xt&&e.createElement(jt,null),e.createElement(Un,{ref:Cn},M()),L()))};var No=t(341476),Ho=t(807081),mn=t(59857),io=t(115007);const mo=(0,d.AH)` 1292 @keyframes fadeIn { 1293 from { 1294 transform: translateY(-30px); 1295 } 1296 to { 1297 transform: translateY(0); 1298 } 1299 } 1300 animation: fadeIn 0.1s; 1301`,Pa=(0,d.AH)` 1302 @keyframes fadeIn { 1303 from { 1304 transform: translateX(-25px); 1305 } 1306 to { 1307 transform: translateX(0); 1308 } 1309 } 1310 animation: fadeIn 0.2s; 1311`,$o=d.Ay.div` 1312 display: flex; 1313 flex-direction: column; 1314 align-items: flex-start; 1315 background-color: ${o.F_r}; 1316 border-radius: 10px; 1317 border: 1px solid ${o.AOI}; 1318 max-height: 50vh; 1319 /* Keep the menu inside the viewport so long item names (e.g. tournament 1320 match titles) don't get clipped off the right edge. */ 1321 max-width: min(420px, calc(100vw - 32px)); 1322 overflow-y: auto; 1323 ${({hasChildren:S})=>S&&(0,d.AH)` 1324 flex-direction: row; 1325 `} 1326 ${mo} 1327`,Zo=d.Ay.div` 1328 padding-top: 16px; 1329 position: fixed; 1330 z-index: 1; 1331 transform: translate(0); 1332`,ia=d.Ay.div` 1333 display: flex; 1334 flex-direction: column; 1335`,La=d.Ay.div` 1336 ${({needBottom:S})=>S&&(0,d.AH)` 1337 border-bottom: 1px solid ${o.Hw0}; 1338 `} 1339 width: 100%; 1340`,Ia=(0,d.Ay)(ia)` 1341 height: 100%; 1342 width: 100%; 1343 align-items: flex-start; 1344 align-self: stretch; 1345 1346 ${({applyBorder:S})=>S&&(0,d.AH)` 1347 border-right: 1px solid ${o.Hw0}; 1348 `} 1349`,Go=(0,d.Ay)(io.N1).attrs(S=>({color:(0,o.ywe)(S)}))` 1350 height: 1px; 1351 width: 100%; 1352 margin-bottom: 0px; 1353`,ko=(0,d.Ay)(ia)` 1354 align-items: flex-start; 1355 align-self: stretch; 1356 ${({applyBorder:S})=>S&&(0,d.AH)` 1357 padding-left: 15px; 1358 border-left: 1px solid ${o.Hw0}; 1359 `} 1360 ${Pa} 1361`,qo=(0,d.Ay)(Le.A)` 1362 color: ${({$isCurrentPage:S})=>S?o.SP6:o.XO2}; 1363 ${T.hN} 1364 text-decoration: none; 1365 cursor: default; 1366 display: flex; 1367 flex-direction: row; 1368 padding: 16px 28px; 1369 border-radius: 10px; 1370 width: 100%; 1371 overflow: hidden; 1372 /* Long titles get an ellipsis instead of getting clipped silently. */ 1373 white-space: nowrap; 1374 text-overflow: ellipsis; 1375 1376 &:hover { 1377 ${({$isFolder:S})=>!S&&(0,d.AH)` 1378 cursor: pointer; 1379 `} 1380 color: ${o.SP6}; 1381 transition: color 0.3s; 1382 background-color: ${o.Hw0}; 1383 } 1384`,ca=(0,d.Ay)(Eo.Ay).attrs({name:"arrowRight"})` 1385 margin-left: 7px; 1386 display: flex; 1387 align-items: center; 1388 svg { 1389 height: 10px; 1390 path { 1391 fill: ${o.XO2}; 1392 } 1393 } 1394`,Ma=(0,d.Ay)(Eo.Ay).attrs(S=>({name:"downArrow"}))` 1395 margin-left: 7px; 1396 svg { 1397 width: 18px; 1398 path { 1399 fill: ${o.XO2}; 1400 } 1401 } 1402 ${({flipped:S})=>S?(0,d.AH)` 1403 transform: scaleY(-1); 1404 transition: transform 0.4s; 1405 `:(0,d.AH)` 1406 transform: scaleY(1); 1407 transition: transform 0.4s; 1408 `} 1409`,Fa=({parent:S,onMouseEnter:V})=>
1409{const z=(0,n.useSelector)(u.x6),Ze=S?.id===z,{name:ke,children:st,type:Ct}=S,lt=Ct===g.xA.folder,ht=st.length>0,ft=(0,mn.t4)(),qt=lt?{href:void 0,onClick:void 0,onMouseEnter:void 0,onFocus:void 0}:ft({id:S.id,slug:S.slug}),Xt=()=>{var vn;(vn=qt.onMouseEnter)==null||vn.call(qt),V()};return e.createElement(qo,{$isCurrentPage:Ze,$isFolder:lt,"data-testid":l.v4,href:qt.href,onClick:qt.onClick,onFocus:qt.onFocus,onMouseEnter:Xt},ke,ht&&e.createElement(ca,null))},Ra=null,da=200,Sa=7,ba=55,Ka=80,Wa=(S,V,z=!1)=>{let Ze=z?Ka+da:da,ke=Ra;for(let st=0;st<S.length;st++)if(Ze+=S[st],ke+=ba,Ze+ke>V)return st;return S.length},ja=(S,V)=>{const z=[];if(S.length>0)for(const Ze of S){const ke=Ze.name.length*Sa;z.push(ke)}if(V.length>0)for(const Ze of V){const ke=Ze.name.length*Sa;z.push(ke)}return z},ua="others-nav-parent";var Ha=t(955640);const Ta=(0,e.createContext)(null),wa=({navigationId:S,children:V})=>{const[z,Ze]=e.useState(null),{getPathBySlug:ke,getSlugById:st,navigationData:Ct,isDefaultNavigation:lt}=(0,Ha.c)(S),ht=e.useMemo(()=>({navigationData:Ct,getPathBySlug:ke,getSlugById:st,floatMenuId:z,setFloatMenuId:Ze,isDefaultNavigation:lt}),[Ct,ke,z,Ze,lt]);return e.createElement(Ta.Provider,{value:ht},V)},Vo=()=>{const S=(0,e.useContext)(Ta);if(!S)throw new Error("useNavigationBarContext must be used within a NavigationBarContext.Provider");return S},qa=wa;var Ga=Object.defineProperty,b=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,Ge=(S,V,z)=>V in S?Ga(S,V,{enumerable:!0,configurable:!0,writable:!0,value:z}):S[V]=z,xe=(S,V)=>{for(var z in V||(V={}))_.call(V,z)&&Ge(S,z,V[z]);if(b)for(var z of b(V))F.call(V,z)&&Ge(S,z,V[z]);return S};const je=({moreParents:S,externalLinks:V=[],parent:z})=>{const Ze=(0,n.useSelector)(u.x6),ke=St=>Ze===St,st=(0,mn.t4)(),{setFloatMenuId:Ct,getPathBySlug:lt,isDefaultNavigation:ht}=Vo(),[ft,qt]=(0,e.useState)([]),Xt=(0,n.useSelector)(u.ni),{loadMore:vn,isLoadingMore:On}=(0,W.A)(),ln=(0,e.useRef)(null),mt=(0,e.useCallback)(St=>{if(!ht||!S.length)return;const zt=St.currentTarget;zt.scrollTop+zt.clientHeight+50>=zt.scrollHeight&&vn()},[ht,S.length,vn]),{applyChildBoarder:un,applyParentBoarder:nn}=(0,e.useMemo)(()=>({applyChildBoarder:S.length+V.length<ft.length,applyParentBoarder:!!ft.length&&S.length+V.length>=ft.length}),[S.length,V.length,ft.length]),jn=()=>{qt([]),Ct(null)},Tn=(0,e.useCallback)(()=>ft.length?e.createElement(ko,{applyBorder:un},ft?.map((St,zt)=>e.createElement(qo,xe({key:`submenu-item-${zt}`,$isCurrentPage:ke(St.id),"data-testid":l.v4},st({id:St.id,slug:St.slug})),St.name))):null,[un,ft,st,ke]),zn=(0,e.useCallback)((St,zt=!1)=>!St||!V.length?null:e.createElement(Ia,{applyBorder:nn,forLinks:!!V.length&&!!ft.length},zt&&e.createElement(Go,null),V.map((ro,Fo)=>e.createElement(qo,{key:`floating-child-submenu-${Fo}`,"data-testid":l.v4,href:ro.url,target:"_blank"},ro.name))),[ft,un,V,Xt,ke]),Ao=(0,e.useMemo)(()=>S.sort((zt,ro)=>zt.children.length>ro.children.length?-1:zt.children.length<ro.children.length?1:0),[S]),vo=()=>{Ct(z?.id||ua)},Cn=St=>()=>{!ft.length&&!St.children.length||qt(St.children)};return e.createElement(Zo,{onMouseEnter:vo,onMouseLeave:jn},e.createElement($o,{hasChildren:!!ft.length,ref:ln,onScroll:mt},e.createElement(La,{hasChildren:!!ft.length,hidden:!S.length,needBottom:!ft.length},e.createElement(Ia,{applyBorder:nn},Ao.map((St,zt)=>e.createElement(Fa,{key:zt,"data-testid":l.v4,onMouseEnter:Cn(St),parent:St})),On&&e.createElement("div",{className:"flex w-full justify-center py-3"},e.createElement(A.y,null))),zn(!!ft.length,!0)),e.createElement(La,{forLinks:!!V.length&&!!ft.length,hidden:!V.length||!!ft.length},zn(!ft.length)),Tn()))};var He=Object.defineProperty,tt=Object.getOwnPropertySymbols,it=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,dt=(S,V,z)=>V in S?He(S,V,{enumerable:!0,configurable:!0,writable:!0,value:z}):S[V]=z,N=(S,V)=>{for(var z in V||(V={}))it.call(V,z)&&dt(S,z,V[z]);if(tt)for(var z of tt(V))Ve.call(V,z)&&dt(S,z,V[z]);return S};const k=({navParent:S})=>{const V=(0,n.useSelector)(u.x6),z=ht=>V===ht,{setFloatMenuId:Ze}=Vo(),ke=(0,mn.t4)(),st=()=>{var ht;
1409const ft=(ht=S?.id)!=null?ht:ua;Ze(ft)},Ct=()=>{Ze(null)};if(!S)return null;const{children:lt}=S;return lt.length?e.createElement(Zo,{onMouseEnter:st,onMouseLeave:Ct},e.createElement($o,{hasChildren:!1},lt.map((ht,ft)=>e.createElement(qo,N({key:`floating-nav-submenu-item-${ft}`,$isCurrentPage:z(ht.id),"data-testid":l.v4},ke({id:ht.id,slug:ht.slug})),ht.name)))):null},X=d.Ay.div` 1410 display: flex; 1411 padding: 20px 50px; 1412 align-items: flex-start; 1413 white-space: nowrap; 1414 width: 100%; 1415 gap: 40px; 1416 position: relative; 1417 1418 @media (max-width: 1200px) { 1419 gap: ${(0,No.UH)()?"40px":"20px"}; 1420 } 1421 1422 ${(0,No.UH)()?` 1423 justify-content: center; 1424 `:""} 1425`,ye=d.Ay.div` 1426 transform: translate(0); 1427`,me=d.Ay.div` 1428 display: flex; 1429 align-items: center; 1430 flex-grow: 1; 1431 min-width: 0; 1432`,Je=(0,d.Ay)(Le.A)` 1433 ${T.QA} 1434 color: ${({$isCurrentPage:S})=>S?o.SP6:o.XO2}; 1435 text-decoration: none; 1436 position: relative; 1437 cursor: ${({$isFolder:S})=>S?"default":"pointer"}; 1438 height: 100%; 1439 display: flex; 1440 flex-direction: row; 1441 align-items: center; 1442 :hover { 1443 color: ${o.SP6}; 1444 transition: color 0.2s; 1445 } 1446 ${(0,No.UH)()?` 1447 :focus { 1448 &::after { 1449 content: ''; 1450 position: absolute; 1451 top: -8px; 1452 bottom: -8px; 1453 left: -16px; 1454 right: -16px; 1455 background: rgba(255, 255, 255, 0.1); 1456 border-radius: 4px; 1457 z-index: -1; 1458 } 1459 } 1460 `:""} 1461`,at=(0,d.Ay)(io.N1).attrs(S=>({color:(0,o.ywe)(S)}))` 1462 height: 14px; 1463 width: 1px; 1464 margin-bottom: 0px; 1465`;var De=Object.defineProperty,ut=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,sn=(S,V,z)=>V in S?De(S,V,{enumerable:!0,configurable:!0,writable:!0,value:z}):S[V]=z,fn=(S,V)=>{for(var z in V||(V={}))Rt.call(V,z)&&sn(S,z,V[z]);if(ut)for(var z of ut(V))Tt.call(V,z)&&sn(S,z,V[z]);return S};const An=({parent:S,moreParents:V=[],externalLinks:z=[],index:Ze,totalNavs:ke})=>{var st;const{setFloatMenuId:Ct,floatMenuId:lt}=Vo(),ht=(0,e.useMemo)(()=>!!V.length||!!z.length,[v()(V),v()(z)]),{t:ft}=(0,m._h)(),qt=ht?ft("MORE"):S?.name||"",Xt=((st=S?.children)==null?void 0:st.length)>0,vn=(0,n.useSelector)(y.s0s),On=S?.id===vn,ln=S?.id&<===S.id||lt===ua&&ht,mt=()=>{var vo;if(!Xt&&S)return;const Cn=(vo=S?.id)!=null?vo:ua;Ct(Cn)},un=()=>{Ct(null)},nn=(0,e.useCallback)(()=>ht?e.createElement(je,{externalLinks:z,moreParents:V,parent:S}):e.createElement(k,{navParent:S}),[ht,v()(V),v()(z),v()(S)]),jn=S?.type==="folder",Tn=(0,mn.t4)(),zn=S&&!jn?Tn({id:S.id,slug:S.slug}):{href:void 0,onClick:void 0,onMouseEnter:void 0,onFocus:void 0},Ao=()=>{var vo;(vo=zn.onMouseEnter)==null||vo.call(zn),mt()};return e.createElement(ye,{"data-testid":ht?l.Zm:l.v4},e.createElement(Je,fn({$isCurrentPage:On,$isFolder:jn,className:"focusable",href:zn.href,onClick:zn.onClick,onFocus:zn.onFocus,onMouseEnter:Ao,onMouseLeave:un,tabIndex:-1},(0,No.UH)()?(0,No.NY)(ke||0,Ze||0):{}),qt,!!(Xt||ht)&&e.createElement(Ma,{flipped:ln})),ln&&e.createElement("span",null,nn()))},Kn=new Map,xn=70,yo=(S,V)=>{const[z,Ze]=(0,e.useState)(0),ke=(0,e.useRef)(null),st=(0,e.useRef)(null),Ct=v()([S,V])||"",lt=Kn.get(Ct)||null,[ht,ft]=(0,e.useState)(lt),[qt,Xt]=(0,e.useState)(!lt),vn=(0,e.useCallback)(ln=>{ke.current=ln,st.current&&(st.current.disconnect(),st.current=null),ln&&(st.current=new ResizeObserver(mt=>{for(const un of mt)Ze(un.contentRect.width)}),st.current.observe(ln))},[]);(0,e.useEffect)(()=>{const ln=Kn.get(Ct);ln?(ft(ln),Xt(!1)):(ft(null),Xt(!0))},[Ct]),(0,e.useEffect)(()=>{if(!qt)return;const ln=ke.current;if(!ln||z===0)return;const mt=requestAnimationFrame(()=>{const nn=Array.from(ln.children).map(jn=>jn.getBoundingClientRect().width);Kn.set(Ct,nn),ft(nn),Xt(!1)});return()=>cancelAnimationFrame(mt)},[qt,z,Ct]);const On=S.length+V.length;return(0,e.useMemo)(()=>{if(qt||!ht)return{maxParents:S,reachedParentLimit:!1,moreParents:[],maxLinks:V,moreLinks:[],maxAmountOfNavItems:On,setContainerRef:vn,ready:!1};const ln=ke.current?getComputedStyle(ke.current):null,mt=ln?parseFloat(ln.gap)||0:40;let un=0,nn=0;for(let Tn=0;Tn<ht.length&&Tn<On;Tn++){const zn=ht[Tn],Ao=Tn>0?mt:0,vo=un+Ao+zn,St=Tn<On-1?mt+xn:0;if(vo+St>z)break;un=vo,nn++}nn>=On&&(nn=On);const jn=nn;return{maxParents:S.slice(0,jn),reachedParentLimit:S.length>=jn,moreParents:S.slice(jn),maxLinks:V.slice(0,jn),moreLinks:V.slice(jn),maxAmountOfNavItems:jn,setContainerRef:vn,ready:!0}},[qt,ht,z,Ct,vn])},Ln=()=>{const{navigationData:S}=Vo(),{parents:V,externalLinks:z}=(0,e.useMemo)(()=>(0,No.ug)((0,r.CL)(S)),[S]);(0,Ho.A)({sectionId:l.Vz,index:0});const{maxLinks:Ze,maxParents:ke,moreLinks:st,moreParents:Ct,reachedParentLimit:lt,maxAmountOfNavItems:ht,setContainerRef:ft,ready:qt}=yo(V,z),Xt=(0,e.useCallback)(()=>{const mt=Ct.length+z.length>0;return e.createElement(e.Fragment,null,ke.map((un,nn)=>e.createElement(An,{key:un.id,index:nn,parent:un})),mt&&e.createElement(An,{externalLinks:z,moreParents:Ct}))}
1465,[v()(Ct),v()(z),v()(ke)]),vn=(0,e.useCallback)(()=>e.createElement(e.Fragment,null,Ze.map(mt=>e.createElement(Je,{key:mt.id,$isFolder:!1,href:mt.url,target:"_blank"},mt.name)),!!st.length&&e.createElement(An,{externalLinks:st})),[v()(Ze),v()(st)]),On=(0,e.useCallback)(()=>{const mt=ht-ke.length,un=Ze.slice(0,mt),nn=[...Ze.slice(mt,Ze.length),...st],jn=nn.length>0;return e.createElement(e.Fragment,null,ke.map((Tn,zn)=>e.createElement(An,{key:Tn.id,index:zn,parent:Tn,totalNavs:ke.length})),!!z.length&&e.createElement(e.Fragment,null,e.createElement(at,null),un.slice().map((Tn,zn)=>e.createElement(Je,{key:String(zn),$isFolder:!1,href:Tn.url,target:"_blank"},Tn.name))),jn&&e.createElement(An,{externalLinks:nn}))},[v()(ke),v()(Ze),v()(st),ht]),ln=()=>lt?Xt():z.length&&!V.length?vn():On();return e.createElement(me,{className:l.Vz,"data-testid":l.Vz,id:l.Vz},e.createElement(X,{ref:ft,style:qt?void 0:{visibility:"hidden"}},ln()))},ma=()=>{const S=(0,n.useSelector)(s.hV);return e.createElement(qa,{navigationId:S._id},e.createElement(Ln,null))},va=()=>{const S=(0,e.useRef)(null),[V,z]=(0,e.useState)(!1),[Ze,ke]=(0,e.useState)(void 0),st=(0,n.useDispatch)(),Ct=(0,n.useSelector)(E.N6),lt=(0,n.useSelector)(E.Rc),ht=(0,n.useSelector)(y.T29),ft=(0,e.useCallback)(()=>{if(st((0,s.th)("")),S.current){const Xt=S.current.getBoundingClientRect();ke({top:Xt.top,left:Xt.left,bottom:Xt.bottom,right:Xt.right,width:Xt.width,height:Xt.height})}z(!0)},[st]),qt=(0,e.useCallback)(()=>{z(!1)},[]);return e.createElement(f,{ref:S,isAdmin:Ct,onEdit:lt?void 0:ft,testId:"editNavigationLanding",titleKey:"NAVIGATION"},ht&&e.createElement(ma,null),e.createElement(jo,{anchorRect:Ze,isOpen:V,onClose:qt}))}},556566:(ve,x,t)=>{t.d(x,{A:()=>W});var e=t(63696),n=t(41989),a=t(224191),d=t(365179),f=t(312854),E=t(870349),y=t(429195),l=t(152544),I=t(886550),v=t(401618);const m=I.Ay.div` 1466 display: flex; 1467 flex-direction: column; 1468 position: fixed; 1469 z-index: 2; 1470 bottom: ${({isChannel:w})=>w?0:v.lI}px; 1471 border-radius: 20px 20px 0px 0px; 1472 background: ${y.AOI}; 1473 box-shadow: 0px -2px 54px 0px rgba(0, 0, 0, 0.90); 1474 width: 100vw; 1475 left: 0; 1476 1477 max-height: 0; 1478 overflow: hidden; 1479 1480 ${({isOpen:w})=>w&&(0,I.AH)` 1481 max-height: calc(100vh - ${v.lI}px - 48px); // 40px of mobile tab + 48px required in design to show the content behind the bottom sheet 1482 transition: max-height 0.3s ease-in-out; 1483 `}; 1484`,A=I.Ay.div` 1485 position: fixed; 1486 z-index: 2; 1487 inset: 0; 1488 background-color: ${w=>(0,f.B3)((0,y.AOI)(w),.5)}; 1489`,p=(0,I.Ay)(E.Jn)` 1490 position: absolute; 1491 top: 20px; 1492 right: 20px; 1493 display: flex; 1494 padding: 0; 1495 justify-content: center; 1496 align-items: center; 1497 width: fit-content; 1498 height: fit-content; 1499 background-color: unset; 1500 z-index: 1; 1501 1502 & svg { 1503 width: 20px; 1504 height: 20px; 1505 1506 & path { 1507 fill: ${y.mz9}; 1508 } 1509 } 1510`,h=I.Ay.header` 1511 display: flex; 1512 padding: 26px 20px 20px 20px; 1513 align-items: center; 1514 border-bottom: 1px solid ${y.Hw0}; 1515 min-height: 36px; 1516 align-items: center; 1517 justify-content: center; 1518 1519 &:empty { 1520 display: none; 1521 } 1522`,i=I.Ay.div` 1523 overflow-y: auto; 1524 padding: 20px; 1525`,r=I.Ay.h2` 1526 all: unset; 1527 ${l.hN} 1528 color: ${y.SP6}; 1529`;var o=Object.defineProperty,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,g=(w,T,Y)=>T in w?o(w,T,{enumerable:!0,configurable:!0,writable:!0,value:Y}):w[T]=Y,P=(w,T)=>{for(var Y in T||(T={}))c.call(T,Y)&&g(w,Y,T[Y]);if(u)for(var Y of u(T))s.call(T,Y)&&g(w,Y,T[Y]);return w},O=(w,T)=>{var Y={};for(var ie in w)c.call(w,ie)&&T.indexOf(ie)<0&&(Y[ie]=w[ie]);if(w!=null&&u)for(var ie of u(w))T.indexOf(ie)<0&&s.call(w,ie)&&(Y[ie]=w[ie]);return Y};const W=w=>{var T=w,{isOpen:Y,onClose:ie,children:se,titleKey:q}=T,Z=O(T,["isOpen","onClose","children","titleKey"]);const te=(0,a.useSelector)(d.DS2),{t:Ne}=(0,n._h)();return e.createElement(e.Fragment,null,Y&&e.createElement(A,{onClick:ie}),e.createElement(m,P({isChannel:te,isOpen:Y},Z),e.createElement(h,null,q&&e.createElement(r,null,Ne(q))),e.createElement(p,{onClick:ie}),e.createElement(i,null,se)))}},401618:(ve,x,t)=>{t.d(x,{BD:()=>I,TW:()=>f,WI:()=>l,Y3:()=>v,fA:()=>y,lI:()=>d,n_:()=>E});var e=t(283722),n=t(429195),a=t(886550);const d=54,f=a.Ay.div` 1530 display: flex; 1531 flex-direction: row; 1532 align-items: center; 1533 justify-content: space-evenly; 1534 width: 100%; 1535 height: ${d}px; 1536 background: ${n.O49}; 1537 position: fixed; 1538 bottom: 0; 1539 left: 0; 1540 right: 0; 1541 border-top: 1px solid ${n.Hw0}; 1542 z-index: 1; 1543`,E=(0,a.Ay)(e.Ay).attrs(m=>({color:m.isActive?(0,n.mrt)(m):(0,n.SP6)(m),name:"mobileProfileFilled"}))` 1544 & svg { 1545 width: 28px; 1546 height: 28px; 1547 & path { 1548 fill: ${m=>m.isActive?(0,n.mrt)(m):"none"}; 1549 ${m=>m.isActive?"stroke: none;":(0,a.AH)` 1550 stroke: ${(0,n.SP6)(m)}}; 1551 stroke-width: 2px; 1552 `} 1553 } 1554 } 1555`,y=(0,a.Ay)(e.Ay).attrs(m=>({color:m.isActive?(0,n.mrt)(m):(0,n.SP6)(m),name:"mobileHomeOutline"}))` 1556 & svg { 1557 width: 28px; 1558 height: 28px; 1559 & path { 1560 stroke: ${m=>m.isActive?(0,n.mrt)(m):(0,n.SP6)(m)}; 1561 fill: ${m=>m.isActive?(0,n.mrt)(m):void 0}; 1562 } 1563 } 1564`,l=(0,a.Ay)(e.Ay).attrs(m=>({name:m.isActive?"closeThin":"mobileSearch"}))` 1565 width: 40px; 1566 height: 40px; 1567 display: flex; 1568 align-items: center; 1569 justify-content: center; 1570 & svg { 1571 width: ${m=>m.isActive?"16px":"28px"}; 1572 height: ${m=>m.isActive?"16px":"28px"}; 1573 & path { 1574 fill: ${m=>m.isActive?(0,n.mrt)(m):(0,n.SP6)(m)}; 1575 } 1576 } 1577`,I=a.Ay.button` 1578 display: flex; 1579 flex-direction: column; 1580 align-items: center; 1581 justify-content: center; 1582 flex: 1; 1583 -webkit-tap-highlight-color: transparent; 1584`,v=a.Ay.div` 1585 background: url(${m=>m.src}); 1586 background-position: center; 1587 background-size: cover; 1588 background-repeat: no-repeat; 1589 border-radius: 28px; 1590 height: 28px; 1591 width: 28px; 1592 margin-left: ${n.Xh2}; 1593 position: relative; 1594 border: ${m=>m.isActive?`2px solid ${(0,n.mrt)(m)}`:"none"}; 1595`},33202:(ve,x,t)=>{t.d(x,{A:()=>C});var e=t(957006),n=t(63696),a=t(886550),d=t(224191),f=t.n(d),E=t(776637),y=t.n(E),l=t(346002),I=t(365179),v=t(199749),m=t(763910),A=t(734082),p=t(932043),h=t(777045),i=t(41989),r=Object.defineProperty,o=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,s=(se,q,Z)=>q in se?r(se,q,{enumerable:!0,configurable:!0,writable:!0,value:Z}):se[q]=Z,g=(se,q)=>{for(var Z in q||(q={}))u.call(q,Z)&&s(se,Z,q[Z]);if(o)for(var Z of o(q))c.call(q,Z)&&s(se,Z,q[Z]);return se},P=(se,q)=>{var Z={};for(var te in se)u.call(se,te)&&q.indexOf(te)<0&&(Z[te]=se[te]);if(se!=null&&o)for(var te of o(se))q.indexOf(te)<0&&c.call(se,te)&&(Z[te]=se[te]);return Z};function O(se,q,Z){if(!se)return{desktopImage:q,mobileImage:Z};if(se?.type===p.Fh.color)return null;const te=se?.desktopImage||q,Ne=se?.mobileImage||Z;return{desktopImage:te,mobileImage:Ne}}function C({channelLoaded:se=!0,className:q}){const{t:Z}=(0,i._h)(),te=(0,d.useSelector)(l.l_),Ne=(0,d.useSelector)(I.AHq),fe=(0,d.useSelector)(A.VC),_e=(0,d.useSelector)(l.L0),Le=(0,d.useSelector)(l.h3),ct=(0,d.useSelector)(v.wr),gt=(0,d.useSelector)(v.zV),Nt=(0,d.useSelector)(m.ME),j=(0,d.useSelector)(I.Bnl),H=(0,d.useSelector)(I.pXH),{background:J}
1595=(0,d.useSelector)((0,m.wv)(Z)),B=O(J,H,j),[U,oe]=(0,n.useState)({activeBackground:"",activeOldBackground:"",currentChannelBackgroundImage:Ne,currentSubscriptionBackgroundMobileImage:B?.mobileImage,currentSubscriptionBackgroundWebImage:B?.desktopImage});(0,n.useEffect)(()=>{const pt=!fe&&Nt?B?.desktopImage:void 0,$=fe&&Nt?B?.mobileImage:void 0,G=pt||$||(!Nt&&Ne?Ne:void 0),pe=!fe&&Nt?U.currentSubscriptionBackgroundWebImage:void 0,re=fe&&Nt?U.currentSubscriptionBackgroundMobileImage:void 0,ge=!Nt&&U.currentChannelBackgroundImage?U.currentChannelBackgroundImage:void 0;oe({activeBackground:G,activeOldBackground:pe||re||ge,currentChannelBackgroundImage:Ne,currentSubscriptionBackgroundMobileImage:$,currentSubscriptionBackgroundWebImage:pt})},[Ne,H,j,fe,Nt,y()(J)]);const Pe=U.activeBackground&&!ct,we=U.activeBackground&&U.activeOldBackground&&!ct;return gt||_e||Le===h.aZ.earnings?null:n.createElement(n.Fragment,null,Pe&&n.createElement(Y,{key:U.activeBackground,blur:te,className:q,loaded:se,src:U.activeBackground}),we&&U.activeOldBackground!==U.activeBackground?n.createElement(ie,{key:U.activeOldBackground,src:U.activeOldBackground}):null)}const W=(0,a.i7)` 1596 from { 1597 opacity: 0; 1598 } 1599 to { 1600 opacity: 1; 1601 } 1602`,w=300,T=(0,a.i7)` 1603 from { 1604 opacity: 1; 1605 } 1606 to { 1607 opacity: 0; 1608 } 1609`,Y=(0,a.Ay)(se=>{var q=se,{loaded:Z}=q,te=P(q,["loaded"]);return n.createElement(e.A,g({},te))})` 1610 object-fit: cover; 1611 margin: 0 !important; 1612 opacity: 0; 1613 ${se=>se.loaded?(0,a.AH)`animation: ${W} ${w}ms linear`:""}; 1614 animation-fill-mode: forwards; 1615 position: absolute; 1616 inset: 0; 1617 width: 100%; 1618 height: 100%; 1619 ${({blur:se})=>se&&"filter: blur(10px);"} 1620`,ie=(0,a.Ay)(e.A)` 1621 position: absolute; 1622 inset: 0; 1623 width: 100%; 1624 height: 100%; 1625 object-fit: cover; 1626 animation: ${T} ${w}ms linear; 1627 animation-fill-mode: forwards; 1628`},177412:(ve,x,t)=>{t.d(x,{A:()=>pt});var e=t(63696),n=t(498685),a=t(224191),d=t(365179),f=t(804797),E=t(287483),y=t(763910),l=t(648086),I=t(731694),v=t(579226),m=t(387632),A=t(886550),p=t(802630),h=t(545290),i=t(429195),r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=($,K)=>{var G={};for(var pe in $)o.call($,pe)&&K.indexOf(pe)<0&&(G[pe]=$[pe]);if($!=null&&r)for(var pe of r($))K.indexOf(pe)<0&&u.call($,pe)&&(G[pe]=$[pe]);return G};const s=A.Ay.div` 1629 position: relative; 1630 background-color: ${$=>{var K=$,{transparentBackground:G}=K,pe=c(K,["transparentBackground"]);return G?"transparent":(0,i.O49)(pe)}}; 1631 height: 100%; 1632 overflow: hidden; 1633 ${(0,h.nD)` 1634 padding: 0; 1635 position: relative; 1636 overflow: ${$=>$.isChannelGateOn?"hidden":"visible"}; 1637 height: ${$=>$.isChannelGateOn?"100%":"fit-content"}; 1638 `} 1639 ${({backgroundImage:$})=>$&&"background: transparent;"} 1640`,g=A.Ay.div` 1641 position: relative; 1642 display: flex; 1643 flex-flow: column nowrap; 1644 min-height: 100%; 1645 ${(0,h.nD)` 1646 ${h.on} 1647 ${$=>!$.skipMobilePlayerReservation&&(0,A.AH)` 1648 aspect-ratio: 16 / 9; 1649 `} 1650 `}; 1651 width: 100%; 1652 > *:not(:first-child) { 1653 margin-top: ${i.Emp}; 1654 } 1655 ${(0,h.nD)` 1656 && { 1657 overflow: visible; 1658 } 1659 `}; 1660 ${$=>$.isVideoOnlyMode?` 1661 &:focus, &:hover, &:focus { 1662 overflow: hidden; 1663 }`:""}; 1664 1665 ${$=>!$.isChannelGateOn&&!$.backgroundImage&&!$.isEmbedded&&(0,A.AH)` 1666 background-color: ${i.O49}; 1667 `}; 1668`,P=(0,A.Ay)(p.A)` 1669 flex-grow: 1; 1670`,O=A.Ay.div` 1671 ${h.TF} 1672`,C=A.Ay.div` 1673 position: absolute; 1674 width: 100%; 1675 height: 100%; 1676 background: linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%); 1677 margin: 0 !important; 1678 pointer-events: none; 1679`;var W=t(964746),w=t(654368),T=t(855919),Y=t(361648),ie=t(463302),se=t(368909),q=t(393982),Z=t(990220),te=t(171751),Ne=t(445525),fe=t(16357),_e=t(572448),Le=t(950111),ct=t(754280),gt=t(80247);const Nt=($,K,G)=>{const pe=(0,a.useSelector)(q.DS),[re,ge]=(0,e.useState)(null),le=(0,a.useSelector)(se.CI),ce=(0,a.useSelector)(d.NYY),ne=(0,a.useSelector)(ie.mC),Ke=(0,a.useSelector)(d.V2d),Ce=(0,a.useSelector)(Le.hE),Fe=(0,_e.A)(),vt=(0,ct.g3)(Ce),rt=(()=>{var bt;if(vt)return vt;switch(Fe.kind){case"page":return Fe.slug;case"video":return(bt=Fe.videoId)!=null?bt:null;case"home":return null;default:return null}})(),Pt=(0,e.useRef)(rt);Pt.current=rt;const Vt=(0,e.useRef)({targetObjectSlug:rt,homeId:ce});(0,e.useEffect)(()=>{const bt=Fe.kind==="home",Ae=rt!==Vt.current.targetObjectSlug||bt&&ce!==Vt.current.homeId;Vt.current={targetObjectSlug:rt,homeId:ce},Ae&&!G&&$(null,!1)},[rt,ce,$,Fe.kind,G]),(0,e.useEffect)(()=>{const bt=rt;let Ae=()=>{};const Dt=rt?re:ce;if(!(rt||Dt))return;const Yt=pe?Z.iz:Z._e,Ie=rt?`${Yt}/content/slug/${rt}`:`${Yt}/content/id/${Dt}`;return(async()=>{var he;let de=!1;try{const{data:Te}=await(0,Ne.Ay)({freshInstance:!0,primaryToken:ne,siteId:Ke}
1679).get(Ie,{headers:{"x-maestro-device-id":le},cancelToken:new fe.A.CancelToken(be=>{Ae=()=>{de=!0,be()}})}),{channel:Se}=(0,te.Th)(Te);if(Pt.current!==bt)return;$(Se._id?Se:null,!0),ge(Se?._id||null),(he=K.current)==null||he.scrollTo({top:0})}catch(Te){if(de)return;gt.error("Error fetching page content: ",Te)}})(),Ae},[ne,rt,Ce,ce,Ke,le,pe,$,K])};var j=t(989247),H=t(46630),J=t(748706),B=t(362523),U=t(419297),oe=t(11411),Pe=t(106654),we=t(784567);const Ee=e.memo(({className:$})=>{var K;const G=(0,n.wA)(),[pe,re]=(0,e.useState)(!1),ge=(0,e.useRef)(null),le=(0,e.useRef)(null);e.useEffect(()=>{var It;const Bt=(It=ge.current)==null?void 0:It.osInstance();Bt&&(le.current=Bt.elements().viewport)},[]);const ce=(0,a.useSelector)(d.AHq),ne=(0,a.useSelector)(d.iMf),Ke=(0,a.useSelector)(It=>{var Bt,At,xt,qe;return((qe=(xt=(At=(Bt=It.app.object)==null?void 0:Bt.data)==null?void 0:At.gate)==null?void 0:xt.gate)==null?void 0:qe.background)||null}),Ce=(0,a.useSelector)(y.ME),Fe=(0,a.useSelector)(E.wr),vt=(0,a.useSelector)(E.jE),rt=(0,a.useSelector)(E.zV),Pt=(0,a.useSelector)(E.Rc),Vt=(0,a.useSelector)(se.VC),bt=(0,a.useSelector)(d.Vki),Ae=(0,e.useRef)(bt);Ae.current=bt;const Dt=(0,a.useSelector)(Le.hE),Yt=(0,j.A)(),Ie=(0,oe.Ay)({feature:U.Xj.VIDEO_PAGE_TYPES_V1,type:"feature"}),he=e.useMemo(()=>(0,ct.g3)(Dt),[Dt]),de=e.useMemo(()=>{var It;if(ne?.type!==W.PageType.VIDEO_PAGE||!he)return!1;const Bt=String((It=ne.slug)!=null?It:""),At=(0,Pe.Qw)(ne);return he!==Bt&&he!==At},[ne,he]),Te=(0,e.useCallback)(It=>G((0,f.Eu)(It)),[]),Se=(0,e.useCallback)(It=>{if(!It)return;const Bt={key:`${It._id}-${Date.now()}`,broadcastId:It.broadcast.id,payload:{overlay:It,stateMachines:[],riveProperties:[]},timeRemaining:It.duration};if(It.contents.kind==="rive"){const At=typeof It.contents.url=="string"?It.contents.url:void 0,xt=It.contents.variables||{};Promise.all([t.e(8779),t.e(5058)]).then(t.bind(t,175058)).then(({introspectRiveFile:qe})=>qe({src:At,variableMap:xt})).then(({artboardSize:qe,riveProperties:Jt,stateMachines:Q})=>{Bt.payload={overlay:It,stateMachines:Q,riveProperties:Jt,artboardSize:qe},G((0,f.Eu)(Bt))}).catch(qe=>{G((0,B.v)(qe instanceof Error?qe:new Error(String(qe)),`Failed to load rive overlay ${It._id}`))})}else It.contents.kind==="html"&&G((0,f.Eu)(Bt))},[]),Ue=(0,e.useCallback)((It,Bt)=>{const At=Bt===!1&&It==null&&Ae.current;typeof Bt=="boolean"&&!At&&re(xt=>xt!==Bt?Bt:xt),Yt(It||null,Bt||!1)},[Yt]),be=e.useMemo(()=>{var It,Bt;return(Bt=(It=ne?.data)==null?void 0:It.content)==null?void 0:Bt.find(At=>At.kind==="video")},[(K=ne?.data)==null?void 0:K.content]),{live:Et,offline:ze}=be?.data||{},yt=!!(Et?.liveStreams||ze?.mode==="tv"&&ze?.video),Qt=(0,e.useCallback)(It=>{const Bt=It.target,At=Bt.type==="text",xt=Bt.type==="textarea";if(!(At||xt||Bt.isContentEditable)&&yt)switch(It.nativeEvent.code){case"Space":case"ArrowLeft":case"ArrowRight":case"ArrowDown":case"ArrowUp":It.preventDefault();break;default:}},[yt]);Nt(Ue,le,bt);const Hn=pe&&Fe||Ce&&!ce;return e.createElement(s,{isMobile:Vt,backgroundImage:!!ce,className:$,isChannelGateOn:Ce,transparentBackground:Hn},e.createElement(v.A,{ref:ge,className:"h-full w-full",id:I.DW,"data-testid":"PageContainer",onKeyDown:Qt},e.createElement(g,{backgroundImage:!!ce,isChannelGateOn:Ce,isVideoOnlyMode:Pt,skipMobilePlayerReservation:ne?.type===W.PageType.LANDING||ne?.type===W.PageType.VIDEO_PAGE&&Ie,isEmbedded:Fe||vt||rt},Ke?.useGradientMask&&Ce&&e.createElement(C,null),bt||ne?(()=>{if(Fe)return e.createElement(w.A,null);if(de)return e.createElement(we.A,null);switch(ne?.type){case W.PageType.CHANNEL:return Vt?be?e.createElement(J.A,{item:be,index:0}):(G((0,B.v)(new Error("Channel page mobile view: No video block found"),"Channel page mobile view error")),null):e.createElement(T.A,null);case W.PageType.LANDING:return e.createElement(T.A,null);case W.PageType.VIDEO_PAGE:{if(Ie)return e.createElement(T.A,null);const Bt=(0,Pe.Qw)(ne)||null;return e.createElement(Y.A,{videoId:Bt,playlistId:null,playlistTag:null})}default:return e.createElement(O,null,JSON.stringify(ne?.data))}})():e.createElement(P,null),ne?._id&&!de&&e.createElement(m.A,{id:ne._id,onValue:Ue}),ne&&!de&&e.createElement(l.A,{channel:`objects:${ne._id}:broadcast`,onMessage:Te}),ne&&!de&&e.createElement(H.A,{collection:"Overlay",id:ne._id,onValue:Se}),ne&&!de&&e.createElement(H.A,{collection:"Overlay",id:Z.Cn,onValue:Se}))))});
1679Ee.displayName="Content";const pt=Ee},638288:(ve,x,t)=>{t.d(x,{A:()=>Bt});var e=t(63696),n=t(224191),a=t(400781),d=t(365179),f=t(368909),E=t(108985),y=t.n(E),l=t(558613),I=t(887944),v=t(463302),m=t(903402),A=t(287483),p=t(346002);function h(){const At=(0,n.useDispatch)();return{enabled:(0,n.useSelector)(d.nGo),footerLinks:(0,n.useSelector)(p.v8),fullscreenActive:(0,n.useSelector)(A.OL),hashtag:(0,n.useSelector)(p.Z5),isAdmin:(0,n.useSelector)(v.N6),socials:(0,n.useSelector)(p.ai),sponsors:(0,n.useSelector)(p.Z0),tweetMessage:(0,n.useSelector)(p.Xr),onEngage:(xt,qe)=>{At((0,I.VH)("engage",xt,qe)),At((0,m.bn)(xt.data.name))}}}var i=t(73473),r=t(816970),o=t(934193),u=t(886550),c=t(777766),s=t(660770),g=t(429195),P=t(545290);const O=u.Ay.div` 1680 display: flex; 1681 flex-direction: column; 1682 position: relative; 1683 max-width: 100%; 1684 background: ${g.O49}; 1685 padding-bottom: 60px; 1686 /* Ensure footer sits above page block backgrounds (like hero banner bleed) */ 1687 z-index: 1; 1688 & > div:first-child { 1689 border-bottom: 1px solid ${g.Hw0}; 1690 } 1691`,C=u.Ay.div` 1692 display: flex; 1693 justify-content: space-between; 1694 align-items: center; 1695 ${({hideLine:At})=>At&&"border-bottom: none !important;"} 1696 & > :last-child { 1697 margin-left: auto; 1698 margin-right: 0 !important; 1699 } 1700 & > :first-child + * { 1701 margin-left: 0; 1702 } 1703 height: 100%; 1704`,W=u.Ay.div` 1705 display: flex; 1706 justify-content: flex-end; 1707`,w=(0,u.Ay)(c.A)` 1708 ${P.xj} 1709 color: ${g.mrt}; 1710 & > * > a:hover { 1711 opacity: 1.0; 1712 color: ${g.mrt}; 1713 } 1714 & a { 1715 margin-right: 0 !important; 1716 } 1717`,T=u.Ay.div` 1718 display: flex; 1719 flex-wrap: wrap; 1720 align-items: center; 1721 justify-content: flex-end; 1722 flex: 1; 1723`,Y=u.Ay.div` 1724 display: flex; 1725 flex-direction: column; 1726 flex-wrap: wrap; 1727`,ie=u.Ay.div` 1728 color: ${g.SP6}; 1729 align-items: center; 1730 display: flex; 1731 ${P.xj} 1732 position: relative; 1733 padding-right: 20px; 1734 &:empty { 1735 display: none; 1736 } 1737`,se=(0,u.Ay)(s.A).attrs({compact:!0,dropUp:!0})``;var q=t(955807),Z=t(883210),te=t(731694),Ne=t(498685),fe=t(11411),_e=t(272568),Le=t(527899);function ct({onHashtagEngage:At,onSocialEngage:xt,hashtag:qe,isAdmin:Jt,socials:Q,tweetMessage:We}){const[_t,ae]=e.useState(!1),Be=(0,Ne.I4)({feature:fe.Xj.SIMPLE_MODE,type:"feature"}),et=(0,n.useSelector)(_e.Q),nt=()=>ae(!1),Ut=()=>ae(!0),Kt=()=>e.createElement(Z.A,{hashtag:qe,isActionModalOpen:_t,onCloseActionModal:nt,socials:Q,tweetMessage:We}),ot=()=>e.createElement(Le.M0,{disabled:!(Q?.length||qe)},qe&&e.createElement(Le.vG,{onClick:At},`#${qe}`),e.createElement(Le.iV,{id:te.dK},!!Q?.length&&e.createElement(q.A,{keyField:"arrayId",list:Q},(Gt,{icon:Lt,name:tn,title:kt,url:jt})=>e.createElement(Le.Ao,{key:Gt,href:jt,onClick:()=>xt({name:Lt,url:jt})},Lt?e.createElement(Le.qY,{name:Lt,title:tn||kt||""}):e.createElement(Le.P4,null,tn||kt))))),Ye=()=>(Be?Jt:et)?Kt():ot();return e.createElement(Le.F7,{onEdit:Ut,testId:"editSocialLanding",titleKey:"SOCIAL_LABEL"},Ye())}var gt=t(732039),Nt=t(16357),j=t(619545),H=t(957006),J=t(835896);const B=(0,u.Ay)(J.A)` 1738 padding: 0 20px; 1739 padding-top: 17px; 1740 height: 100%; 1741 display: flex; 1742 flex-grow: 1; 1743`,U=u.Ay.div` 1744 display: ${At=>At.disabled?"none":"flex"}; 1745 flex-flow: row wrap; 1746 align-items: center; 1747 justify-content: end; 1748 width: 100%; 1749 margin-bottom: 11px; 1750`,oe=u.Ay.div` 1751 border: 2px solid ${At=>At.hasPendingChanges?"gold":"transparent"}; 1752 align-items: center; 1753 display: flex; 1754 flex-flow: row wrap; 1755 position: relative; 1756`,Pe=(0,u.Ay)(j.A)` 1757 max-width: 150px; 1758 &:not(:last-child) { 1759 margin-right: ${g.Sm7}; 1760 } 1761`,we=(0,u.Ay)(H.A)` 1762 max-height: 60px; 1763 object-fit: contain; 1764 max-width: 150px; 1765`,Ee=u.Ay.div` 1766 max-height: 60px; 1767 object-fit: contain; 1768 max-width: 150px; 1769 & > svg { 1770 width: 100%; 1771 & > path { 1772 fill: ${g.mz9}; 1773 } 1774 } 1775`,$=({handleSponsorsEngage:At,image:xt,link:qe,name:Jt})=>{const Q=e.useMemo(()=>/\.svg$/.test(xt),[xt]),[We,_t]=e.useState("");return e.useEffect(()=>{Q&&Nt.A.get(xt).then(({data:ae})=>{_t(ae)}
1775)},[xt]),e.createElement(Pe,{href:qe,onClick:At},Q?e.createElement(Ee,{dangerouslySetInnerHTML:{__html:We}}):e.createElement(we,{alt:Jt,src:xt}))};function K({isAdmin:At,onSponsorEngage:xt,sponsors:qe}){const[Jt,Q]=e.useState(!1),We=(0,n.useSelector)(_e.Q),_t=(0,Ne.I4)({feature:fe.Xj.SIMPLE_MODE,type:"feature"}),ae=()=>Q(!1),Be=()=>Q(!0),et=()=>e.createElement(gt.A,{data:qe,isActionModalOpen:Jt,onCloseActionModal:ae}),nt=ot=>()=>{xt(ot)},Ut=()=>e.createElement(e.Fragment,null,!!(qe?.length||At)&&e.createElement(U,{disabled:!qe.length},e.createElement(oe,{id:te.qp},e.createElement(q.A,{keyField:"arrayId",list:qe},(ot,{image:Ye,name:Gt,link:Lt})=>e.createElement($,{key:`sponsor-image-${ot}`,handleSponsorsEngage:nt({image:Ye,name:Gt,link:Lt}),image:Ye,link:Lt,name:Gt}))))),Kt=()=>(_t?At:We)?et():Ut();return e.createElement(B,{onEdit:Be,testId:"editSponsorsLanding",titleKey:"ADMIN_FOOTER_SPONSORS_TITLE"},Kt())}const G=(0,l.A)()(K);var pe=t(723792),re=t(379462),ge=t(634611);function le({onFooterEngage:At,footerLinks:xt}){const qe=(0,n.useSelector)(v.N6),Jt=(0,n.useSelector)(_e.Q),Q=(0,Ne.I4)({feature:fe.Xj.SIMPLE_MODE,type:"feature"}),[We,_t]=e.useState(!1),ae=()=>_t(!1),Be=()=>_t(!0),et=()=>e.createElement(re.A,{footerLinks:xt,isActionModalOpen:We,onCloseActionModal:ae}),nt=()=>e.createElement(ge.yj,{disabled:!xt.length},e.createElement(ge.Cb,{id:te.yz},e.createElement(pe.A,{list:xt},(Kt,ot)=>{const{url:Ye,image:Gt,name:Lt,text:tn,kind:kt}=ot,jt=kt==="image_link",qn=jt?ge.p7:ge._h,hn=()=>At({image:Gt,name:Lt,url:Ye});return e.createElement(qn,{key:Kt,href:Ye,isImageLink:jt,onClick:hn,plain:!0},jt?e.createElement(ge.Qm,null,e.createElement(ge.Xq,{src:Gt})):tn)}))),Ut=()=>(Q?qe:Jt)?et():nt();return e.createElement(ge.F7,{onEdit:Be,testId:"editFooterLanding",titleKey:"ADMIN_LABEL_FOOTER"},Ut())}const ce="https://twitter.com/intent/tweet";function ne({className:At=""}){const{enabled:xt,footerLinks:qe,fullscreenActive:Jt,hashtag:Q="",isAdmin:We,onEngage:_t,socials:ae,sponsors:Be,tweetMessage:et=""}=h(),nt=({name:Ye,image:Gt,url:Lt})=>{_t({data:{kind:"footer_link",name:Ye}},{kind:Gt?"image":"text",url:Lt})},Ut=({image:Ye,link:Gt})=>{_t({data:{kind:"sponsor",name:Ye}},{url:Gt})},Kt=()=>{_t({data:{kind:"hashtag",name:Q}});const Ye=y().stringify({hashtags:Q,text:et.trim(),url:(0,o.Gl)()});(0,r.PB)(650,400,`${ce}?${Ye}`,"Twitter")},ot=({name:Ye,url:Gt})=>{_t({data:{kind:"social",name:Ye}},{url:Gt})};return xt?e.createElement(O,{className:At,id:"FOOTER_CONTENT_ROOT_NODE"},!Jt&&e.createElement(e.Fragment,null,e.createElement(C,{hideLine:!Q&&!ae?.length&&!Be?.length},e.createElement(ct,{hashtag:Q,isAdmin:We,onHashtagEngage:Kt,onSocialEngage:ot,socials:ae,tweetMessage:et}),e.createElement(G,{isAdmin:We,onSponsorEngage:Ut,sponsors:Be})),e.createElement(W,null,e.createElement(T,null,e.createElement(le,{footerLinks:qe||[],onFooterEngage:nt}),e.createElement(i.Ay,{feature:i.Xj.HIDE_COPYRIGHT},Ye=>Ye?null:e.createElement(w,null)),e.createElement(ie,null,e.createElement(se,null)))))):null}const Ke=(0,l.A)()(ne);var Ce=t(426127),Fe=t(199749),vt=t(42012),rt=t(754280),Pt=t(341476),Vt=t(765582),bt=t(585227),Ae=t(41989),Dt=t(301845),Yt=t(283722),Ie=t(152544);const he=u.Ay.div` 1776 display: flex; 1777 width: 60vw; 1778 column-gap: 14px; 1779 align-items: center; 1780 padding: 12px 16px 12px 12px; 1781 border-radius: 10px; 1782 background-color: ${g.AOI}; 1783`,de=u.Ay.span` 1784 ${Ie.hN} 1785 color: ${g.XO2}; 1786 text-align: center; 1787`,Te=(0,u.Ay)(Yt.Ay).attrs({name:"rotate"})` 1788 & svg { 1789 width: 40px; 1790 height: 40px; 1791 1792 & path { 1793 stroke: ${g.mrt}; 1794 } 1795 } 1796`,Se=u.Ay.div` 1797 position: absolute; 1798 inset: 0; 1799 display: flex; 1800 align-items: center; 1801 justify-content: center; 1802`,Ue=u.Ay.div` 1803 height: 100vh; 1804 width: 100vw; 1805 background: rgba(0, 0, 0, 0.5); 1806 backdrop-filter: blur(5px); 1807`,be=u.Ay.div` 1808 transform: rotate(90deg); 1809`,Et=u.Ay.div` 1810 position: fixed; 1811 top: 0; 1812 bottom: 0; 1813 left: 0; 1814 right: 0; 1815 height: 100vw; 1816 width: 100vh; 1817 display: flex; 1818 justify-content: center; 1819 align-items: center; 1820`,ze=()=>{const{t:At}=(0,Ae._h)();return e.createElement(Dt.ZL,null,e.createElement(Et,null,e.createElement(be,null,e.createElement(Ue,null),e.createElement(Se,null,e.createElement(he,null,e.createElement(Te,null),e.createElement(de,null,At("LANDING_PAGE_LANDSCAPE_MESSAGE")))))))},yt=(0,e.memo)(ze);var Qt=t(641998),Hn=t(113785);const Bt=({children:At})=>
1820{const xt=(0,n.useSelector)(f.LH),qe=(0,n.useSelector)(Fe.q6),Jt=(0,n.useSelector)(Fe.jE),Q=(0,n.useSelector)(Ce.ME),We=(0,n.useSelector)(Fe.yR),_t=(0,n.useSelector)(Fe.zV),ae=(0,n.useSelector)(Fe.OL),Be=(0,n.useSelector)(a.cN),et=(0,n.useSelector)(f.Yg),nt=(0,n.useSelector)(a.ni),Ut=(0,n.useSelector)(d.DyV),Kt=(0,n.useSelector)(d.DS2),ot=(0,n.useSelector)(vt.hE),Ye=(0,rt.$x)(ot),Gt=e.useMemo(()=>xt&&!We&&!qe&&!Jt&&!_t&&!ae&&!Q,[xt,We,qe,Jt,_t,ae,Q]),Lt=()=>{if(Q)return null;const jt=tn();return jt||e.createElement(e.Fragment,null,At)},tn=()=>{if(!(0,Pt.UH)())return null;switch(kt()){case"login":return e.createElement(Vt.d,null);case"profile":return e.createElement(bt.R,null);default:return null}},kt=()=>!(0,Pt.UH)()||!ot?null:ot?.includes("login")?"login":ot?.includes("profile")?"profile":null;return e.createElement(Qt.mc,null,xt&&!kt()&&e.createElement(e.Fragment,null,e.createElement(Hn.A,null),!Kt&&e.createElement(Qt.h9,null)),e.createElement(Qt.P7,null),Lt(),Gt&&Be&&e.createElement(Ke,null),nt&&!Ut&&!Ye&&et&&e.createElement(yt,null))}},641998:(ve,x,t)=>{t.d(x,{P7:()=>l,h9:()=>y,mc:()=>E});var e=t(973079),n=t(429195),a=t(886550),d=t(545290),f=t(299863);const E=a.Ay.div` 1821 display: flex; 1822 flex-direction: column; 1823 flex: 1; 1824 ${(0,d.wc)`height: 100%;`}; 1825`,y=(0,a.Ay)(e.A)` 1826 height: ${n.R7t}; 1827 width: 100%; 1828 max-width: 100%; 1829 flex-shrink: 0; 1830 display: flex; 1831 align-items: center; 1832 margin: 0 !important; 1833 /* 1834 * The runtime paywall (<Paywall />) uses a negative top margin 1835 * (\`-${n.R7t}\`) to bleed its background behind this 1836 * header. Without an explicit stacking context the header would render 1837 * underneath the paywall's absolute background layer. 1838 * 1839 * \`z-index: 4\` matches the value the admin-side AccessGate's StyledHeader 1840 * uses for the same reason — keeping both surfaces in sync so the header 1841 * chrome (logo / nav / countdown / login) stays painted on top of the 1842 * paywall's hero background. 1843 */ 1844 position: relative; 1845 z-index: 4; 1846`,l=(0,a.Ay)(f.A)` 1847 flex-grow: 1; 1848 z-index: 1; 1849 ${d.wt}; 1850`},939576:(ve,x,t)=>{t.d(x,{A:()=>p});var e=t(63696),n=t(498685),a=t(731694),d=t(346002),f=t(463302),E=t(835896),y=t(11411),l=t(575845),I=t(449222),v=t(886550);const m=(0,v.Ay)(E.A)` 1851 ${({hasContent:h})=>!h&&` 1852 flex: 1; 1853 display: flex; 1854 flex-direction: column; 1855 `}; 1856 margin: 0 !important; 1857 padding: 0; 1858 & > * { 1859 padding: 0; 1860 margin: 0; 1861 } 1862`,A=e.memo(()=>{const h=(0,n.d4)(d.TY),i=!!(h&&h?.length),r=(0,n.d4)(f.N6),o=(0,n.d4)(d.Q),u=(0,y.Ay)({feature:y.Xj.SIMPLE_MODE,type:"feature"}),c=e.useCallback(()=>(u?r:o)?e.createElement(l.A,null):e.createElement(I.A,null),[r,o,u]);return e.createElement(m,{testId:"editModeLandingContent",as:i?"section":E.A,"data-testid":"editModeLandingContent",hasContent:i,id:a.a7,titleKey:"ADMIN_LABEL_LANDING_PAGE_CONTENT"},c())});A.displayName="PageContentGrid";const p=A},613568:(ve,x,t)=>{t.d(x,{A:()=>y});var e=t(63696),n=t(71119),a=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,E=(l,I)=>{var v={};for(var m in l)d.call(l,m)&&I.indexOf(m)<0&&(v[m]=l[m]);if(l!=null&&a)for(var m of a(l))I.indexOf(m)<0&&f.call(l,m)&&(v[m]=l[m]);return v};function y(l="",I={}){var v=I,{useStringKeys:m=!1}=v,A=E(v,["useStringKeys"]);const{copiedMsg:p=m?"COPIED":"Copied",copyMsg:h=m?"LABEL_COPY":"Copy"}=A,{copyToClipboard:i}=(0,n.A)(l),[r,o]=(0,e.useState)(!1),u=(0,e.useRef)(-1),c=()=>{clearTimeout(u.current),u.current=setTimeout(()=>{o(!1)},3e3)},s=(0,e.useCallback)(()=>{i(),o(!0),c()},[i]);return(0,e.useEffect)(()=>()=>{clearTimeout(u.current)},[]),[s,r?p:h]}},939925:(ve,x,t)=>{t.d(x,{k:()=>f});var e=t(461980),n=t.n(e),a=t(63696),d=t(754280);const f=()=>{const E=(0,e.useNavigate)(),y=(0,e.useLocation)();return(0,a.useCallback)(l=>{const I=new URLSearchParams(y.search);(0,d.v0)(I);const v=(0,d.z4)(I),m=y.hash||"",A=(0,d.KF)(l);E(`${A}${v}${m}`)},[E,y.search,y.hash])}},124188:(ve,x,t)=>{t.d(x,{J:()=>n});var e=t(103742);const n=a=>{var d;const[f]=(0,e.A)("epg",a);return!!((d=f?.asset)!=null&&d.live)}},969790:(ve,x,t)=>{t.d(x,{A:()=>f});var e=t(63696),n=t(232834),a=t(967787);const f=()=>{const E=(0,a.A)(),[y,l]=(0,e.useState)(!1),[I,v]=(0,e.useState)(!1);(0,n.A)(v,3e3,I,!1),(0,n.A)(l,3e3,y,!1);const m=(0,e.useRef)(null),A=(0,e.useRef)(null),p=(0,e.useCallback)(h=>{const i=h.currentTarget.id;let r=m.current;i!=="streamKey"?(r=A.current,v(!0)):l(!0),r&&E(r)},[]);return{inputStreamKeyRef:m,inputStreamUrlRef:A,keyCopied:y,onCopy:p,urlCopied:I}}},317605:(ve,x,t)=>{t.d(x,{A:()=>o});var e=t(103742),n=t(63696),a=t(776637),d=t.n(a),f=t(962832),E=t.n(f),y=t(243888),l=Object.defineProperty,I=Object.defineProperties,v=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(u,c,s)=>c in u?l(u,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[c]=s,i=(u,c)=>{for(var s in c||(c={}))A.call(c,s)&&h(u,s,c[s]);if(m)for(var s of m(c))p.call(c,s)&&h(u,s,c[s]);return u},r=(u,c)=>I(u,v(c));function o(u){const[c,s]=(0,e.A)("playlist",u),g=(0,n.useMemo)(()=>E()(c,"members[0].id"),[d()(c),s]),{video:P,loaded:O}=(0,y.A)(g),C=(0,n.useMemo)(()=>
1862{if(!(P&&P.thumbnail))return c;const w=P.thumbnail;return w?r(i({},c),{thumbnail:w}):c},[u,d()(c),d()(P),s,O]);return n.useMemo(()=>s&&u?{loaded:!0,playlist:C,firstVideo:P}:{loaded:!1,playlist:null},[u,d()(C),s])}},826361:(ve,x,t)=>{t.d(x,{F:()=>d});var e=t(63696),n=t(990220),a=t(754280);const d=()=>{const f=(0,e.useRef)(!1);(0,e.useEffect)(()=>{if(f.current)return;const E=new URLSearchParams(window.location.search),y=E.get("v");if(!y)return;f.current=!0,(0,a.v0)(E);const l=(0,a.z4)(E),I=window.location.hash||"",v=`${n.o2}${(0,a.KF)(y)}`.replace(/\/+/g,"/");window.location.replace(`${window.location.origin}${v}${l}${I}`)},[])}},139351:(ve,x,t)=>{t.d(x,{A:()=>m});var e=t(63696),n=t(103742),a=t(224191),d=t.n(a),f=t(365179),E=t(508602),y=t(467783),l=t(617469),I=t(124188),v=t(400781);function m(){const A=(0,a.useDispatch)(),[p,h]=(0,e.useState)(!1),[i,r]=(0,e.useState)(!1),o=(0,a.useSelector)(l.pk),u=(0,a.useSelector)(l.JB),c=(0,a.useSelector)(l.gz),s=(0,a.useSelector)(l.YK),[g,P]=(0,e.useState)("offline"),O=(0,a.useSelector)(l.BL),C=(0,a.useSelector)(v.RW),W=(0,a.useSelector)(f.can),[w]=(0,n.A)("stream",W),T=(0,I.J)(C),Y=c===E.e.IDLE||c===E.e.PENDING,ie=s?!1:!w?.activeSessionId||Y,se=i,q=()=>A((0,y.Cq)()),Z=()=>A((0,y.PZ)()),te=T&&!u;(0,e.useEffect)(()=>{P(u&&T||te?"online":"offline")},[u,T,te]),(0,e.useEffect)(()=>{A((0,y.Wv)(!0))},[]),(0,e.useEffect)(()=>{u||(r(!1),h(!1))},[u]),(0,e.useEffect)(()=>{T&&h(!1)},[T]),(0,e.useEffect)(()=>{o&&(h(!1),r(!1),P("offline"))},[o]);const Ne=(0,e.useCallback)(()=>p?null:(h(!0),q()),[p,h,q]),fe=(0,e.useCallback)(()=>i?null:(r(!0),Z()),[i,r,Z]);return{activeSessionId:w?.activeSessionId||"",endStream:fe,ingestUrl:w?.ingestUrl||"",isEnding:i,isGoOfflineButtonDisabled:se,isGoLiveButtonDisabled:ie,isPublished:u,isStarting:p,isStreamCreationInProgress:O,startStream:Ne,streamKey:w?.streamKey||"",streamStatus:g}}},655958:(ve,x,t)=>{t.d(x,{b:()=>E});var e=t(224191),n=t.n(e),a=t(633337),d=t(498685),f=t(400781);const E=()=>{var y,l,I;const v=(0,e.useSelector)(a.$z),[m]=(0,d.Cg)("video",v),A=(0,e.useSelector)(f.RW),[p]=(0,d.Cg)("epg",A),h=(y=p?.asset)==null?void 0:y.contentId,i=p?.modified,[r]=(0,d.Cg)("livebroadcast",m?.liveBroadcastId);return((l=p?.asset)==null?void 0:l.contentType)==="video"&&((I=p?.asset)!=null&&I.startTime)?p.asset.startTime:h===v&&i?i:r?.startTime}},887756:(ve,x,t)=>{t.d(x,{A:()=>l});var e=t(63696),n=t(224191),a=t.n(n),d=t(400781),f=t(463302),E=t(551258);const l=()=>{const I=(0,n.useSelector)(d.V2),v=(0,n.useSelector)(f.mC)||"",m=e.useCallback(p=>(0,E.Ry)({primaryToken:v,siteId:I,video:p}
1862),[v,I]),A=e.useCallback(p=>(0,E.wX)({primaryToken:v,siteId:I,playlist:p}),[v,I]);return{upsertVideo:m,upsertPlaylist:A}}},591228:(ve,x,t)=>{t.d(x,{U:()=>l});var e=t(63696),n=t(16357),a=t(463302),d=t(400781),f=t(946568),E=t(160788),y=t(80247);const l=()=>{const[I,v]=(0,e.useState)([]),m=(0,E.A)(a.mC),A=(0,E.A)(d.V2);return(0,e.useEffect)(()=>{if(!m||!A)return;let p=()=>{};return(0,f.$J)({primaryToken:m,siteId:A},h=>{p=h}).then(h=>v([...new Set(h)])).catch(h=>{n.A.isCancel(h)||y.error("Failed to fetch video tags",h)}),p},[m,A]),I}},243888:(ve,x,t)=>{t.d(x,{A:()=>E});var e=t(103742),n=t(63696),a=t(776637),d=t.n(a),f=t(476765);function E(y){const[l,I]=(0,e.A)("video",y),v=(0,f.xU)(l);return(0,n.useMemo)(()=>y&&I?{loaded:!0,video:v}:{loaded:!1,video:null},[y,d()(v),I])}},702767:(ve,x,t)=>{t.r(x),t.d(x,{DEVICE_KICKED_AT:()=>E,ENABLE_DEVICE_LIMIT:()=>d,SET_PLAYLIST_DATA:()=>a,SET_VIDEO_SIZE:()=>n,SHOW_VIDEO_MODAL:()=>f,setDeviceKickedAt:()=>v,setDeviceLimitEnabled:()=>I,setVideoSize:()=>y,showVideoModal:()=>l});var e=t(304006);const n="videoPlayer/SET_VIDEO_SIZE",a="videoPlayer/SET_PLAYLIST_DATA",d="videoPlayer/ENABLE_DEVICE_LIMIT",f="videoPlayer/SHOW_VIDEO_MODAL",E="videoPlayer/DEVICE_KICKED_AT",y=(0,e.dQ)(n,m=>({payload:m})),l=(0,e.dQ)(f,m=>({payload:m})),I=(0,e.dQ)(d,m=>({payload:m})),v=(0,e.dQ)(E,m=>({payload:m}))},946568:(ve,x,t)=>{t.d(x,{$J:()=>i,DH:()=>h,Ln:()=>o,Ls:()=>A,UQ:()=>u});var e=t(16357),n=t(990220),a=t(445525),d=t(80247),f=Object.defineProperty,E=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,I=(c,s,g)=>s in c?f(c,s,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[s]=g,v=(c,s)=>{for(var g in s||(s={}))y.call(s,g)&&I(c,g,s[g]);if(E)for(var g of E(s))l.call(s,g)&&I(c,g,s[g]);return c};const m=async({id:c,deviceId:s,kind:g,siteId:P,token:O})=>{var C;try{const{data:W}=await maestroApiRequest({primaryToken:O,siteId:P}).get(`${CANIPLAY_SERVICE_BASE_URL}/${c}`,{headers:{"x-maestro-device-id":`${s}`},params:{kind:g}});return W.deviceCheck?v(v({},W?.contentCheck),W?.deviceCheck):W.contentCheck?v({},W.contentCheck):W}catch(W){if(((C=W.response)==null?void 0:C.status)===401)throw d.warn("Account not authorized for content"),W;return null}},A=async(c,s,g,P)=>{const{data:O}=await(0,a.Ay)({primaryToken:g,siteId:P}).post(`${n.GE}/kick`,{deviceIdToKick:s},{headers:{"x-maestro-client-id":P,"x-maestro-device-id":c,Authorization:`Bearer ${g}`}});return O},p=async({id:c,siteId:s,token:g})=>{try{const{data:P}=await maestroApiRequest({primaryToken:g,siteId:s}).get(`${PLAYLIST_SERVICE_BASE_URL}/${c}`);return P}catch(P){return d.error(P),null}},h=async({filters:c,primaryToken:s,siteId:g},P)=>{const{data:O}=await(0,a.Ay)({primaryToken:s,siteId:g}).get(n.S9,{cancelToken:P&&new e.A.CancelToken(P),params:c});return O},i=async({primaryToken:c,siteId:s},g)=>{if(!c||!s)throw new Error("Missing primaryToken or siteId");const{data:P}=await(0,a.Ay)({primaryToken:c,siteId:s,freshInstance:!0}).get(`${n.S9}/tags/site`,{cancelToken:g&&new e.A.CancelToken(g)});return P},r=async({primaryToken:c,siteId:s,tag:g})=>{if(!c||!s||!g)throw new Error("Invalid params");const{data:P}=await maestroApiRequest({primaryToken:c,siteId:s,freshInstance:!0}).get(`${VIDEO_SERVICE_BASE_URL}/tags/videos`,{params:{tagName:g}});return P},o=async(c,s,g)=>{await(0,e.A)({headers:{Authorization:`Bearer ${s}
1862`,"x-maestro-client-id":g},method:"DELETE",url:`${n.S9}/${c}`})},u=async({primaryToken:c,siteId:s,url:g},P)=>{if(!c||!s)throw new Error("Missing primaryToken or siteId");const{data:O}=await(0,a.Ay)({primaryToken:c,siteId:s,freshInstance:!0}).get(`${n.S9}/metadata`,{params:{url:g},cancelToken:P&&new e.A.CancelToken(P),timeout:a.Zc});return O}},669865:(ve,x,t)=>{t.d(x,{KE:()=>n.KE,OA:()=>n.OA,l9:()=>d.l9,rh:()=>d.KE,Q2:()=>a.Q2,$A:()=>d.$A,$V:()=>d.$V,fn:()=>o,dZ:()=>e.setDeviceKickedAt,nO:()=>e.setVideoSize});var e=t(702767),n=t(504714),a=t(756720),d=t(616618),f=t(115356),E=t(100035),y=t(304006),l=t(530668),I=t(392799),v=t(274216);const m=(0,y.N$)({setViewMode:l.fd},function*({payload:u}){u===null&&(0,v.Eh)("")});var A=t(365179),p=t(60058);const h=function*(){const u=yield(0,E.Lt)(),c=(0,A.V2d)(u);(0,p.CJ)(u,"disable-device-limit",c)||(yield(0,E.yJ)((0,I.subscribe)(`disable-device-limit/${c}`)))},i=(0,y.N$)({updateDocument:I.updateDocument},function*({payload:u}){const{path:c,value:s}=u;/^disable-device-limit/.test(c)&&typeof s=="boolean"&&(yield(0,E.yJ)((0,e.setDeviceLimitEnabled)(!s)))}),o=function*(){yield(0,y.jP)(l.$J,m),yield(0,y.jP)(I.UPDATE_DOCUMENT,i),yield(0,E.Zy)(h)}},504714:(ve,x,t)=>{t.d(x,{KE:()=>d,OA:()=>y,bb:()=>e,dT:()=>n});var e=(l=>(l.flv="video/x-flv",l.mp4="video/mp4",l.m3u8="vnd.apple.mpegURL",l.ts="video/MP2T",l["3gp"]="video/3gpp",l.mov="video/quicktime",l.avi="video/x-msvideo",l.wmv="video/x-ms-wmv",l))(e||{}),n=(l=>(l[l.ENABLED=1]="ENABLED",l[l.DISABLED=0]="DISABLED",l))(n||{}),a=(l=>(l.fullscreen="FullscreenToggle",l.volume="VolumeSlider",l.closeVod="VodClose",l.concurrents="Concurrents",l))(a||{}),d=(l=>(l.video="video",l.tv="tv",l.videoSpotlight="videoSpotlight",l))(d||{}),f=(l=>(l.video="video",l.channel="channel",l))(f||{}),E=(l=>(l.FULL="full",l.PREVIEW="preview",l.PREVIEW_OVER="preview_over",l))(E||{}),y=(l=>(l.livestream="livestream",l.vod="vod",l))(y||{})},836992:(ve,x,t)=>{t.r(x),t.d(x,{MANUALLY_REQUEST_NEW_STREAM:()=>f,SET_LIVESTREAM_ERROR:()=>n,SET_LIVESTREAM_METADATA:()=>a,SET_METADATA_STATUS:()=>d,SET_STREAM_CONTENT_DETAILS:()=>E,requestNewStream:()=>v,setLivestreamError:()=>y,setLivestreamMetadata:()=>l,setMetadataStatus:()=>I,setStreamContentDetails:()=>m});var e=t(304006);const n="livestream/SET_LIVESTREAM_ERROR",a="livestream/SET_LIVESTREAM_METADATA",d="livestream/SET_METADATA_STATUS",f="livestream/MANUALLY_REQUEST_NEW_STREAM",E="livestream/SET_STREAM_CONTENT_DETAILS",y=(0,e.dQ)(n,A=>({payload:A})),l=(0,e.dQ)(a,A=>({payload:A})),I=(0,e.dQ)(d,A=>({payload:A})),v=(0,e.dQ)(f),m=(0,e.dQ)(E,A=>({payload:A}))},508602:(ve,x,t)=>{t.d(x,{N:()=>n,e:()=>e});var e=(a=>(a.IDLE="idle",a.PENDING="pending",a.RESOLVED="resolved",a.REJECTED="rejected",a))(e||{});const n={THIRD_PARTY:"thirdPartySoftware"}},633337:(ve,x,t)=>{t.d(x,{aH:()=>s,Ac:()=>c,$z:()=>n.$z,ei:()=>o,hG:()=>n.hG,bK:()=>n.bK,oV:()=>n.oV,zt:()=>n.zt,JB:()=>n.JB,YK:()=>n.YK,BL:()=>n.BL,$T:()=>i,um:()=>p,YV:()=>e.requestNewStream,fn:()=>Yt,gm:()=>e.setStreamContentDetails,NB:()=>h});var e=t(836992),n=t(617469),a=t(123611),d=t.n(a),f=t(16357),E=t(732091),y=t.n(E),l=t(990220),I=t(445525);const v=async({content:Ie,maestroStreamId:he,source:de,token:Te,insights:Se})=>{y()(he,"missing stream id");const Ue=`${l.r5}${d().join("/start/",he)}`,be={Authorization:`Bearer ${Te}`,"x-maestro-client-id":l.Cn};return(await f.A.post(Ue,{content:Ie,insights:Se,source:de},{headers:be})).data},m=async({maestroStreamId:Ie,source:he,token:de})=>{y()(Ie,"missing stream id");const Te=`${l.r5}${d().join("/stop/",Ie)}`,Se={Authorization:`Bearer ${de}`,"content-type":"application/json; charset=utf-8","x-maestro-client-id":l.Cn};return(await f.A.post(Te,{source:he},{headers:Se})).data},A=async({liveBroadcastId:Ie,title:he,thumbnail:de,token:Te})=>{const Se=`${l.S9}/metadata/${Ie}`;await f.A.post(Se,{title:he,thumbnail:de},{headers:{Authorization:`Bearer ${Te}`,"x-maestro-client-id":l.Cn}})},p=async(Ie,he)=>{const{data:de}=await f.A.post(`${l.jg}/account`,Ie,{headers:{Authorization:`Bearer ${he}`,"x-maestro-client-id":l.Cn}});return de},h=async(Ie,he)=>{const{data:de}=await f.A.post(`${l.jg}/verifyAccount`,Ie,{headers:{Authorization:`Bearer ${he}
1862`,"x-maestro-client-id":l.Cn}});if(!de?.result)throw new Error("Validation failed");return de},i=async()=>{const{data:Ie}=await f.A.get(`${l.jg}/canUseAccount`,{headers:{"x-maestro-client-id":l.Cn}});return Ie.results},r=async({maestroStreamId:Ie,token:he})=>{await f.A.post(`${l.r5}/activate/${Ie}`,{},{headers:{Authorization:`Bearer ${he}`,"x-maestro-client-id":l.Cn}})},o=async({maestroStreamId:Ie,token:he})=>{const{data:de}=await f.A.get(`${l.r5}/secureUrl/${Ie}`,{headers:{Authorization:`Bearer ${he}`,"x-maestro-client-id":l.Cn}});return de.signedUrl},u=async({channelId:Ie,token:he})=>{await f.A.post(`${l.r5}/create/${Ie}`,{},{headers:{Authorization:`Bearer ${he}`,"x-maestro-client-id":l.Cn}})},c=async(Ie,he,de)=>{const{data:Te}=await f.A.post(`${l.r5}/decrypt/${Ie}`,de,{headers:{Authorization:`Bearer ${he}`,"x-maestro-client-id":l.Cn}});return Te},s=async(Ie,he,de)=>{const{data:Te}=await f.A.post(`${l.jg}/account/decrypt/${Ie}`,de,{headers:{Authorization:`Bearer ${he}`,"x-maestro-client-id":l.Cn}});return Te},g=async({providerStreamId:Ie,token:he,provider:de})=>{await(0,I.Ay)({primaryToken:he,siteId:l.Cn}).post(`${l.r5}/poll/${Ie}`,{provider:de})};var P=t(392743),O=t(304006),C=t(100035),W=t(467783),w=t(392799),T=t(400781),Y=t(463302),ie=t(9507),se=t(218938),q=t(299500),Z=t(300024),te=t(767738),Ne=t(36701),fe=t(487122);function*_e(){const Ie=yield(0,C.Lt)(),he=yield(0,Ne.Uh)(Ie),de=(0,n.fx)(Ie);return yield(0,C.T1)(fe.pK,{event:{ontology:{class:"livestream",family:"Unscheduled Livestream",kingdom:"admin",order:de,phylum:"start",metadata:{}},url:window.location.href},eventBase:he})}const Le=(0,O.N$)({goLiveWithMaestroLivestream:W.Cq},function*(){try{const Ie=yield(0,C.Lt)(),he=(0,n.fx)(Ie),de=(0,se.mC)(Ie),Te=(0,n.QA)(Ie),Se=(0,n.oV)(Ie),Ue=(0,n.hG)(Ie),be=(0,n.bK)(Ie);if(!de||!Te)return;if((yield(0,C.T1)(v,{content:Ue?{contentId:Ue,contentName:be,contentType:Se}:void 0,insights:yield(0,C.T1)(_e),maestroStreamId:he,source:Te,token:de})).status==="failed")throw new Error("Failed status");yield(0,C.yJ)((0,e.setLivestreamError)(null)),yield(0,C.yJ)((0,te.sx)({event:Z.n.ADMIN_WENT_LIVE,properties:{streamId:he,contentType:Se,contentId:Ue,contentName:be}})),yield(0,C.yJ)((0,ie.ns)(Z.n.STREAM,{id:he,kind:"start"},{}))}catch{yield(0,C.yJ)((0,q.eB)("ADMIN_ERROR_STREAM_ONLINE_FAILED")),yield(0,C.yJ)((0,e.setLivestreamError)(Date.now()))}});var ct=t(777045),gt=t(508602),Nt=t(80247);const j=(0,O.N$)({goOfflineWithMaestroLivestream:W.PZ},function*(){try{const Ie=yield(0,C.Lt)(),he=(0,n.fx)(Ie),de=(0,se.mC)(Ie),Te=(0,n.QA)(Ie);if(!de)return;yield(0,C.T1)(m,{maestroStreamId:he,source:Te,token:de}),Te===gt.N.THIRD_PARTY&&(yield(0,C.yJ)((0,W.Wv)(!0)),yield(0,C.yJ)((0,W.gl)(ct.hJ.MAESTRO_STREAM))),yield(0,C.yJ)((0,ie.ns)(Z.n.STREAM,{id:he,kind:"stop"},{})),yield(0,C.yJ)((0,e.setMetadataStatus)(gt.e.IDLE))}catch(Ie){Nt.error(`goOffline error: ${Ie.message}`),yield(0,C.yJ)((0,e.setMetadataStatus)(gt.e.REJECTED)),yield(0,C.yJ)((0,e.setLivestreamError)(Date.now()))}});var H=t(80247),J=Object.defineProperty,B=Object.defineProperties,U=Object.getOwnPropertyDescriptors,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,Ee=(Ie,he,de)=>he in Ie?J(Ie,he,{enumerable:!0,configurable:!0,writable:!0,value:de}):Ie[he]=de,pt=(Ie,he)=>{for(var de in he||(he={}))Pe.call(he,de)&&Ee(Ie,de,he[de]);if(oe)for(var de of oe(he))we.call(he,de)&&Ee(Ie,de,he[de]);return Ie},$=(Ie,he)=>B(Ie,U(he));const K=(0,O.N$)({setLivestreamMetadata:e.setLivestreamMetadata},function*({payload:Ie}){try{const he=yield(0,C.Lt)(),de=(0,se.mC)(he),Te=(0,n.Xy)(he),{title:Se,thumbnail:Ue}=Ie;if(!de||!Te)return;yield(0,C.yJ)((0,e.setMetadataStatus)(gt.e.PENDING));const be={title:Se,thumbnail:Ue,token:de};yield(0,C.T1)(A,$(pt({},be),{liveBroadcastId:Te})),yield(0,C.yJ)((0,e.setMetadataStatus)(gt.e.RESOLVED))}catch(he){H.error("addMetadata error",he),yield(0,C.yJ)((0,e.setMetadataStatus)(gt.e.REJECTED)),yield(0,C.yJ)((0,q.eB)("ADMIN_ERROR_ADD_STREAM_METADATA"))}});var G=t(318946),pe=t(60058),re=t(365179),ge=t(964746),le=t(298116),ce=t(816970),ne=t(80247);const Ke=(0,ce.QU)(u),Ce=(0,O.N$)({setObject:G.wt,setSite:G.x2,updateDocument:w.updateDocument,requestNewStream:e.requestNewStream},function*({type:Ie,payload:he}){var de;try{const Te=yield(0,C.Lt)(),Se=(0,se.N6)(Te),Ue=(0,se.mC)(Te),be=(0,re.iMf)(Te),Et=(0,re.cYw)(Te);if(!Ue||!Se||!be||(Et&&!(0,pe.CJ)(Te,"streamprovideraccount",Et)&&(yield(0,C.yJ)((0,w.subscribe)(`streamprovideraccount/${Et}`))),Ie===w.UPDATE_DOCUMENT&&he.path.indexOf("stream/")!==0)||be.type!==ge.PageType.CHANNEL)return;const ze=be._id,yt=(de=be.renderers)==null?void 0:de.livestream,Qt=(0,n.IU)(Te),It=(0,re.mu1)(Te).settings.defaultStreamingProvider||"mux",Bt=(0,le.G7)(Te,le.Xj.GENERATE_CAPTIONS),At=(0,n.JB)(Te),xt=(0,le.G7)(Te,le.Xj.STREAMING)&&yt?.status!=="creating"&&!At,qe=(()=>Qt?!!(Et&&Qt.providerAccountId!==Et||Qt.provider!==It||It==="wowza"&&(Bt&&Qt.baseLanguage!==be.baseLanguage||Bt!==!!Qt.hasCaptions)):!1)(),Jt=yt?.streamId,Q=!yt||yt.status!=="error"&&!Jt;if(xt&&(qe||Q||Ie===e.MANUALLY_REQUEST_NEW_STREAM)){yield(0,C.T1)(Ke,{channelId:ze,token:Ue});return}Jt&&!(0,pe.CJ)(Te,"stream",Jt)&&(yield(0,C.yJ)((0,w.subscribe)(`stream/${Jt}`)))}catch(Te){ne.log("prepareChannelStream() error",Te)}});var Fe=t(711678),vt=t(80247);const rt=(0,O.N$)({logInSuccess:Y.X1,updateDocument:w.updateDocument,setObject:G.wt},function*(Ie){try{const he=yield(0,C.Lt)(),de=(0,se.N6)(he),Te=(0,n.fx)(he),Se=(0,n.YK)(he);let Ue;if(Ie.type===w.UPDATE_DOCUMENT){const{path:be,value:Et}=Ie.payload;if(!/^stream/.test(be))return;const ze=be.split("/").length>=2?be.split("/")[1]:null;if(!(Qt=>Te&&ze&&Te.match(ze)&&Qt)(Et))return;Ue=Et}else Ue=(0,n.IU)(he);
1862if(!Ue)return;de&&Se&&Ue.encoderConnected===!1&&(yield(0,C.yJ)((0,q.y_)(Fe.V.streamEncoderState)),yield(0,C.yJ)((0,q.to)({kind:Fe.V.streamEncoderState,data:{backgroundStyle:{pointerEvents:"none",zIndex:"unset"},transparentBackground:!0}})))}catch(he){vt.error("livestreamUpdateSaga:",he)}}),Pt=(()=>{const Ie=(0,ce.QU)(r);return(0,O.N$)({setAdminMode:W.gl},function*({payload:he}){try{if(he?.modeName!==ct.hJ.MAESTRO_STREAM)return;const de=yield(0,C.Lt)(),Te=(0,se.mC)(de),Se=(0,n.fx)(de);if(!Se)return;yield(0,C.T1)(Ie,{token:Te,maestroStreamId:Se})}catch(de){yield(0,C.yJ)((0,q.kh)("ADMIN_STREAM_KEY_GET_ERROR",de?.message||"UNKNOWN"))}})})();var Vt=t(272568),bt=t(80247);const Ae=(0,O.N$)({},function*(){for(;;){yield(0,C.cb)(5e3);try{const Ie=yield(0,C.Lt)();if(!(0,Vt.lX)(Ie))continue;const de=(0,n.IU)(Ie);if(!de)continue;const Te=(0,se.mC)(Ie),{toggleTime:Se,idleActiveToggleTime:Ue,provider:be,providerStreamId:Et}=de;if(!Te||!be||!Et)continue;let ze=!1;if(!Se&&!Ue?ze=!1:ze=Date.now()-Math.max(Se??0,Ue??0)<5e3,ze)continue;yield(0,C.T1)(g,{providerStreamId:Et,token:Te,provider:be})}catch(Ie){bt.error("pollLivestreamSaga:",Ie)}}});function*Dt(){yield(0,O.p8)(W.WG,Le),yield(0,O.p8)(W.rT,j),yield(0,O.p8)(e.SET_LIVESTREAM_METADATA,K),yield(0,O.jP)([T.ZX,T.Z3,w.UPDATE_DOCUMENT,e.MANUALLY_REQUEST_NEW_STREAM],Ce),yield(0,O.jP)([w.UPDATE_DOCUMENT,Y.rN,T.ZX],rt),yield(0,C.Zy)(Ae),yield(0,O.p8)(W.hX,Pt)}const Yt=Dt},392743:(ve,x,t)=>{t.d(x,{A:()=>h});var e=t(304006),n=t(836992),a=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,I=(i,r,o)=>r in i?a(i,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[r]=o,v=(i,r)=>{for(var o in r||(r={}))y.call(r,o)&&I(i,o,r[o]);if(E)for(var o of E(r))l.call(r,o)&&I(i,o,r[o]);return i},m=(i,r)=>d(i,f(r));const A=()=>({error:null,metadataStatus:null,streamContent:null}),h=(0,e.T1)(n,A,(i,r)=>{switch(r.type){case n.SET_LIVESTREAM_ERROR:return m(v({},i),{error:r.payload});case n.SET_METADATA_STATUS:return m(v({},i),{metadataStatus:r.payload});case n.SET_STREAM_CONTENT_DETAILS:return m(v({},i),{streamContent:r.payload});default:return i}})},617469:(ve,x,t)=>{t.d(x,{$z:()=>p,BL:()=>P,IU:()=>I,JB:()=>v,QA:()=>s,Xy:()=>u,YK:()=>g,bK:()=>C,fx:()=>l,gz:()=>o,hG:()=>W,oV:()=>w,pk:()=>r,zt:()=>O});var e=t(980672),n=t(60058),a=t(365179),d=t(272568),f=t(816970),E=t(508602);const y=(0,e.Mz)(T=>(0,a.iMf)(T),T=>{var Y;return(Y=T?.renderers)==null?void 0:Y.livestream}),l=(0,e.Mz)(y,T=>T?.streamId),I=(0,e.Mz)(n.$U,l,(T,Y)=>Y?T[(0,f.hI)("stream",Y)]:null),v=(0,e.Mz)(y,T=>!!T?.livestreamPublished),m=T=>T.admin.livestreamPreviewActive,A=(0,e.Mz)(T=>(0,a.Bmc)(T),T=>T?.defaultStreamingProvider||"mux"),p=(0,e.Mz)(y,T=>T?.videoId),h=(0,e.Mz)(p,n.Mv,(T,Y)=>T?Y[(0,f.hI)("video",T)]:null),i=(0,e.Mz)(l,T=>!!T),r=T=>T.livestream.error,o=T=>T.livestream.metadataStatus,u=(0,e.Mz)(h,T=>T?.liveBroadcastId),c=(0,e.Mz)(y,T=>T?.source),s=(0,e.Mz)(c,T=>(0,d.V0)(T),(T,Y)=>{if(T)return T;if(Y)return E.N.THIRD_PARTY}),g=(0,e.Mz)(v,s,(T,Y)=>T&&Y===E.N.THIRD_PARTY),P=(0,e.Mz)(y,T=>T?.status==="creating"),O=(0,e.Mz)([T=>(0,a.cYw)(T),T=>(0,a.LVO)(T),T=>(0,n.rN)(T)],(T,Y,ie)=>{if(!T)return;const se=ie[(0,f.hI)("streamprovideraccount",T)];if(se?.providerName===Y)return se}),C=T=>{var Y,ie;return(ie=(Y=T.livestream)==null?void 0:Y.streamContent)==null?void 0:ie.contentName},W=T=>{var Y,ie;return(ie=(Y=T.livestream)==null?void 0:Y.streamContent)==null?void 0:ie.contentId},w=T=>{var Y,ie;return(ie=(Y=T.livestream)==null?void 0:Y.streamContent)==null?void 0:ie.contentType}},756720:(ve,x,t)=>{t.d(x,{PC:()=>p,Q2:()=>I});var e=t(993729),n=t(613166),a=Object.defineProperty,d=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,y=(h,i,r)=>i in h?a(h,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):h[i]=r,l=(h,i)=>{for(var r in i||(i={}))f.call(i,r)&&y(h,r,i[r]);if(d)for(var r of d(i))E.call(i,r)&&y(h,r,i[r]);return h};const I=(0,n.f)(()=>(h=!0)=>{var i;return{showControls:void 0,cc:!1,lastPausedTimestamp:null,muted:h,playing:!1,volume:(i=(0,e.v)().readStatic("site:volume"))!=null?i:1}
1862}),v={deviceLimitEnabled:!0,locationKey:"",seenScheduledVod:!1,sessionId:null,userSelectedVod:!1},m={modalId:null},p={epg:{},size:l({},{height:0,width:0}),videoModal:l({},m),viewer:l({},v),activeVideoKey:null,deviceKickedAt:null}},109751:(ve,x,t)=>{t.d(x,{W9:()=>m,D6:()=>p,gq:()=>A});var e=t(63696),n=t(224191),a=t(400781),d=t(463302),f=t(463702),E=t(990220),y=t(445525),l=t(16357);const I=async({id:h,siteId:i,token:r,captureCanceler:o})=>{try{const{data:u}=await(0,y.Ay)({primaryToken:r??"",siteId:i}).get(`${E.bc}/${h}`,{cancelToken:o?new l.A.CancelToken(o):void 0});return u}catch(u){const c=u instanceof Error?u.message:String(u);throw new Error(`Failed to fetch playlist: ${c}`)}},v=async({tag:h,siteId:i,token:r,captureCanceler:o})=>{try{const{data:u}=await(0,y.Ay)({primaryToken:r??"",siteId:i}).get(`${E.S9}/tags/videos`,{params:{tagName:h},cancelToken:o?new l.A.CancelToken(o):void 0});return Array.isArray(u)?{creator:"",members:u.map(c=>({id:c._id,schema:"video"})),owner:"",siteId:i,title:h}:null}catch(u){const c=u instanceof Error?u.message:String(u);throw new Error(`Failed to fetch tag playlist: ${c}`)}},m=h=>{var i;const[r,o]=(0,e.useState)(),[u,c]=(0,e.useState)(""),s=(i=(0,n.useSelector)(d.mC))!=null?i:void 0,g=(0,n.useSelector)(a.V2);return(0,e.useEffect)(()=>{let P=()=>{};if(o(void 0),c(""),!!h)return I({id:h,siteId:g,token:s,captureCanceler:O=>{P=O}}).then(O=>{O&&o(O),c("")}).catch(O=>{c(O.message)}),()=>{P()}},[h,g,s]),{playlist:r,error:u}},A=h=>{var i;
1862const[r,o]=(0,e.useState)(),u=(i=(0,n.useSelector)(d.mC))!=null?i:void 0,c=(0,n.useSelector)(a.V2);return(0,e.useEffect)(()=>{let s=()=>{};if(o(void 0),!!h)return v({tag:h,siteId:c,token:u,captureCanceler:g=>{s=g}}).then(g=>{g&&o(g)}),()=>{s()}},[h,c,u]),r},p=(h,i)=>{var r;const[o,u]=(0,e.useState)();(0,e.useEffect)(()=>{if(!h?.members.length){u(void 0);return}if(i){const P=h.members.findIndex(O=>O.id===i);u(P>=0?P:0);return}u(0)},[h,i]);const c=(0,e.useCallback)(()=>{!h||h.members.length===0||u((P=-1)=>(P+1)%h.members.length)},[h]),s=o===void 0||(r=h?.members[o])==null?void 0:r.id;return[(0,f.H)(s),c]}},115356:(ve,x,t)=>{t.d(x,{Ay:()=>o});var e=t(304006),n=t(318946),a=t(489306),d=t(756720),f=t(702767),E=Object.defineProperty,y=Object.defineProperties,l=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,A=(u,c,s)=>c in u?E(u,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[c]=s,p=(u,c)=>{for(var s in c||(c={}))v.call(c,s)&&A(u,s,c[s]);if(I)for(var s of I(c))m.call(c,s)&&A(u,s,c[s]);return u},h=(u,c)=>y(u,l(c));const i=()=>p({},d.PC),o=(0,e.T1)(h(p({},f),{replace:a.HC,beforePageChange:n.N4,setObject:n.wt}),i,(u,c)=>{switch(c.type){case f.SET_VIDEO_SIZE:{const{height:s,width:g}=c.payload;return h(p({},u),{size:{height:s,width:g}})}case f.SHOW_VIDEO_MODAL:{const{modalId:s}=c.payload;return h(p({},u),{videoModal:h(p({},u.videoModal),{modalId:s})})}case f.ENABLE_DEVICE_LIMIT:return h(p({},u),{viewer:h(p({},u.viewer),{deviceLimitEnabled:c.payload})});case f.DEVICE_KICKED_AT:return h(p({},u),{deviceKickedAt:c.payload});default:return u}})},616618:(ve,x,t)=>{t.d(x,{$A:()=>h,$V:()=>m,KE:()=>v,RY:()=>l,c0:()=>I,l9:()=>i});var e=t(980672),n=t(950111),a=t(346002),d=t(964746),f=t(476765),E=t(298662);const y=(0,e.Mz)(r=>r.video.epg,r=>r),l=r=>Number((0,n.$Z)(r).mute)===1,I=({video:{videoModal:{modalId:r}}})=>r,v=(0,e.Mz)([r=>r,r=>(0,a.Sg)(r)],(r,o)=>o?A(o,r)||p(o,r):!1),m=r=>r===d.PlayerTypes.youtube||r===d.PlayerTypes.twitch,A=(r,o)=>{var u,c,s,g,P,O,C,W;const w=(u=r.data.content)==null?void 0:u.find(Le=>Le.kind==="video");if((((c=w?.data.live)==null?void 0:c.liveStreams)||[]).some(Le=>m(Le?.player)||(0,f.bW)(Le?._id,o))||(((s=w?.data.live)==null?void 0:s.schedule)||[]).some(Le=>{var ct,gt;return m((ct=Le?.video)==null?void 0:ct.player)||((gt=Le?.video)!=null&>._id?(0,f.bW)(Le.video._id,o):!1)}))return!0;const q=(g=w?.data.offline)==null?void 0:g.video;if(m(q?.player))return!0;const Z=q?._id;if(Z&&(0,f.bW)(Z,o))return!0;const te=(P=w?.data.offline)==null?void 0:P.playlist;if((O=te?.members)!=null&&O.some(Le=>m(Le?.player)||(0,f.bW)(Le?.id,o)))return!0;const Ne=te?._id;return!!(Ne&&(0,f.cR)(Ne,o)||(((W=(C=w?.data)==null?void 0:C.offline)==null?void 0:W.videoContent)||[]).some(Le=>{var ct,gt;return m((ct=Le?.video)==null?void 0:ct.player)||(0,f.bW)((gt=Le?.video)==null?void 0:gt._id,o)}))},p=(r,o)=>{var u;const c=(u=r?.data)==null?void 0:u.content;return c?c.filter(C=>C.kind===E.b).some(C=>{var W;return(W=C?.data)!=null&&W.videoId?(0,f.bW)(C.data.videoId,o):!1})?!0:c.filter(C=>C.kind===E.Fd).some(C=>{var W,w;return((w=(W=C?.playlist)==null?void 0:W.members)==null?void 0:w.some(T=>m(T?.player)||(0,f.bW)(T?.id,o)))||C.playlist&&(0,f.cR)(C.playlist._id,o)}):!1},h=r=>!!r.video.viewer.deviceLimitEnabled,i=r=>r.video.deviceKickedAt},38090:(ve,x,t)=>{t.d(x,{r:()=>v,z:()=>I});var e=t(63696),n=t(224191),a=t.n(n),d=t(463302),f=t(400781),E=t(946568);const y=25,l=300,I=(m={})=>{var A,p;const h=(A=m.pageSize)!=null?A:y,i=(p=m.debounceMs)!=null?p:l,r=(0,n.useSelector)(d.mC),o=(0,n.useSelector)(f.V2),[u,c]=e.useState(""),[s,g]=e.useState([]),[P,O]=e.useState(0),[C,W]=e.useState(!0),[w,T]=e.useState(!1),Y=e.useRef(0),ie=e.useRef(()=>{}),se=e.useCallback(async(Z,te)=>{if(!r||!o)return;ie.current();const Ne=++Y.current;T(!0);try{const fe={limit:String(h),offset:String(te),sortBy:"modified",sortDirection:"-1"},_e=Z.trim();_e&&(fe.search=_e);const{results:Le}=await(0,E.DH)({primaryToken:r,siteId:o,filters:fe},ct=>{ie.current=ct});if(Ne!==Y.current)return;g(ct=>
1862te===0?Le:[...ct,...Le]),W(Le.length===h),O(te+Le.length)}catch{}finally{Ne===Y.current&&T(!1)}},[r,o,h]);e.useEffect(()=>{const Z=setTimeout(()=>{se(u,0)},u?i:0);return()=>clearTimeout(Z)},[u,i,se]);const q=e.useCallback(()=>{w||!C||se(u,P)},[w,C,se,u,P]);return{isLoadingMore:w,loadMore:q,setQuery:c,videos:s}},v=m=>{const A=(0,n.useSelector)(d.mC),p=(0,n.useSelector)(f.V2),[h,i]=e.useState(null);return e.useEffect(()=>{if(!m){i(null);return}if(!A||!p)return;let r=!1;return(0,E.DH)({primaryToken:A,siteId:p,filters:{_id:m,limit:"1"}}).then(({results:o})=>{var u;r||i((u=o[0])!=null?u:null)}).catch(()=>{}),()=>{r=!0}},[m,A,p]),h}},476765:(ve,x,t)=>{t.d(x,{DP:()=>ct,Pq:()=>g,RS:()=>s,bW:()=>j,cR:()=>H,eI:()=>u,g3:()=>Nt,pW:()=>gt,ww:()=>se,xU:()=>J});var e=t(313459),n=t.n(e),a=t(964746),d=t(60058),f=Object.defineProperty,E=Object.defineProperties,y=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,m=(B,U,oe)=>U in B?f(B,U,{enumerable:!0,configurable:!0,writable:!0,value:oe}):B[U]=oe,A=(B,U)=>{for(var oe in U||(U={}))I.call(U,oe)&&m(B,oe,U[oe]);if(l)for(var oe of l(U))v.call(U,oe)&&m(B,oe,U[oe]);return B},p=(B,U)=>E(B,y(U));const h="player.twitch.tv",i=()=>!0,r=[/^https:\/\/storage.googleapis.com\/maestro_video_uploads\//,/^https:\/\/maestro-videos-transcoded.storage.googleapis.com\//,/^https:\/\/static\.gcp\.maestro\.io\//,/^https:\/\/static\.maestro\.io\//,/^https:\/\/stream\.mux\.com\//,/^https:\/\/phenixrts.com\/video\/maestro\.io\//,/^https:\/\/cdn3\.wowza\.com/],o=[/^https:\/\/bcovlive-[a-z0-9]*\.akamaihd\.net/],u=B=>r.some(U=>U.test(B)),c=/(?:youtube\.com|youtu\.be|twitch\.tv)/i,s=B=>B?c.test(B):!1,g=B=>{if(!B)return!1;try{const{hostname:U}=new URL(B);return U==="twitch.tv"||U.endsWith(".twitch.tv")}catch{return!1}},P=/<iframe\b[^>]*?\ssrc\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,O=B=>{var U,oe,Pe;if(!B)return!1;const we=B.match(P);if(!we)return!1;const Ee=((Pe=(oe=(U=we[1])!=null?U:we[2])!=null?oe:we[3])!=null?Pe:"").trim();if(!Ee)return!1;const pt=Ee.startsWith("//")?`https:${Ee}`:Ee;try{const{protocol:$,hostname:K}=new URL(pt);return $!=="http:"&&$!=="https:"?!1:!!K}catch{return!1}},C=/<iframe\b[^>]*>[\s\S]*?<\/iframe\s*>/i,W=/<iframe\b([^>]*)>/i,Y=`[^\\s"'=<>\`/]+(?:\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s"'<>\`]+))?`,ie=new RegExp(`^\\s*(?:${Y}(?:\\s+${Y})*)?\\s*$`),se=B=>{if(!O(B))return!1;const U=B.trim();if(!C.test(U))return!1;const oe=U.match(W);return oe?ie.test(oe[1]):!1},q=B=>B.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),Z=B=>{var U,oe,Pe;const we=B?.match(P);return we&&((Pe=(oe=(U=we[1])!=null?U:we[2])!=null?oe:we[3])!=null?Pe:"").trim()||null},te=B=>{const U=B.trim();if(!U||U.startsWith("/"))return null;try{const oe=U.includes("://")?U:`https://${U}`,{hostname:Pe}=new URL(oe);return Pe||null}catch{const we=U.replace(/^https?:\/\//i,"").split("/")[0].split(":")[0].trim();return!we||/[/?#]/.test(we)?null:we}},Ne=B=>{var U,oe,Pe,we,Ee;const pt=((Ee=(we=(Pe=(oe=(U=window.INIT)==null?void 0:U.SITE)==null?void 0:oe.settings)==null?void 0:Pe.domain)==null?void 0:we.url)==null?void 0:Ee.split("/")[0])||"",$=/maestro\.tv|maestro\.io|localhost/.test(document.domain)?[document.domain,pt]:[pt];return B&&$.push(B),n()($.filter(Boolean))},fe=B=>{try{const U=B.startsWith("//")?`https:${B}`:q(B);return new URL(U).hostname===h}catch{return!1}},_e=(B,U)=>{const oe=B.startsWith("//"),Pe=q(B),we=oe&&Pe.startsWith("//")?`https:${Pe}`:Pe,Ee=new URL(we),pt=Ee.searchParams.getAll("parent").map(te).filter(G=>!!G),$=Ne(U),K=n()([...pt,...$]);
1862return Ee.searchParams.delete("parent"),K.forEach(G=>{Ee.searchParams.append("parent",G)}),oe?`//${Ee.host}${Ee.pathname}${Ee.search}`:Ee.toString()},Le=(B,U)=>B.replace(P,(oe,Pe,we,Ee)=>Pe!==void 0?oe.replace(`"${Pe}"`,()=>`"${U}"`):we!==void 0?oe.replace(`'${we}'`,()=>`'${U}'`):oe.replace(Ee,()=>U)),ct=B=>{const U=Z(B);return!!(U&&fe(U))},gt=(B,U)=>{const oe=Z(B);if(!oe||!fe(oe))return B;const Pe=_e(oe,U?.wrapperHost);return Pe===oe||Pe===q(oe)?B:Le(B,Pe)},Nt=B=>o.some(U=>U.test(B)),j=(B,U)=>{if(!B)return!1;const oe=(0,d.YE)(U,"video",B);return oe&&[a.PlayerTypes.youtube,a.PlayerTypes.twitch].includes(oe?.player)},H=(B,U)=>{var oe;if(!B)return!1;const Pe=(0,d.YE)(U,"playlist",B);if(!((oe=Pe?.members)!=null&&oe.length))return!1;for(const we of Pe.members)if(j(we.id,U))return!0;return!1},J=B=>{try{if(!B||B.thumbnail||B.player!==a.PlayerTypes.youtube||!B.url)return B;const U=new URL(B.url).searchParams.get("v");return p(A({},B),{thumbnail:`https://i.ytimg.com/vi/${U}/sddefault.jpg`})}catch{return B}}},506172:(ve,x,t)=>{t.r(x),t.d(x,{COMPLETE_VIDEO_DOWNLOAD:()=>d,FAIL_VIDEO_DOWNLOAD:()=>f,REQUEST_VIDEO_DOWNLOAD:()=>n,START_VIDEO_DOWNLOAD:()=>a,completeVideoDownload:()=>l,failVideoDownload:()=>I,requestVideoDownload:()=>E,startVideoDownload:()=>y});var e=t(304006);const n="video-download/REQUEST",a="video-download/START",d="video-download/COMPLETE",f="video-download/FAIL",E=(0,e.dQ)(n,v=>({payload:{video:v}})),y=(0,e.dQ)(a,v=>({payload:{videoId:v}})),l=(0,e.dQ)(d,(v,m)=>({payload:{byteSize:m,videoId:v}})),I=(0,e.dQ)(f,v=>({payload:{videoId:v}}))},432611:(ve,x,t)=>{t.d(x,{A:()=>d,G:()=>a});var e=t(16357),n=t(990220);const a=async({primaryToken:f,siteId:E,videoId:y})=>{const{data:l}=await e.A.get(`${n.S9}/${y}`,{headers:{Authorization:`Bearer ${f}`,"x-maestro-client-id":E}});return l},d=async({primaryToken:f,siteId:E,videoId:y})=>{await(0,e.A)({headers:{Authorization:`Bearer ${f}`,"x-maestro-client-id":E},method:"post",url:`${n.S9}/${y}/static`})}},846849:(ve,x,t)=>{t.d(x,{A:()=>r});var e=t(304006),n=t(506172);const a=()=>({downloading:{},fileSizes:{}});var d=Object.defineProperty,f=Object.defineProperties,E=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,v=(o,u,c)=>u in o?d(o,u,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[u]=c,m=(o,u)=>{for(var c in u||(u={}))l.call(u,c)&&v(o,c,u[c]);if(y)for(var c of y(u))I.call(u,c)&&v(o,c,u[c]);return o},A=(o,u)=>f(o,E(u)),p=o=>typeof o=="symbol"?o:o+"",h=(o,u)=>{var c={};for(var s in o)l.call(o,s)&&u.indexOf(s)<0&&(c[s]=o[s]);if(o!=null&&y)for(var s of y(o))u.indexOf(s)<0&&I.call(o,s)&&(c[s]=o[s]);return c};const r=(0,e.T1)(n,a,(o,u)=>{var c;switch(u.type){case n.START_VIDEO_DOWNLOAD:return A(m({},o),{downloading:A(m({},o.downloading),{[u.payload.videoId]:!0})});case n.COMPLETE_VIDEO_DOWNLOAD:{const{byteSize:s,videoId:g}=u.payload,P=o.downloading,{[g]:O}=P,C=h(P,[p(g)]);return A(m({},o),{downloading:C,fileSizes:s!=null?A(m({},o.fileSizes),{[g]:s}):o.fileSizes})}case n.FAIL_VIDEO_DOWNLOAD:{const s=o.downloading,{[c=u.payload.videoId]:g}=s,P=h(s,[p(c)]);return A(m({},o),{downloading:P})}default:return o}})},419955:(ve,x,t)=>{t.d(x,{A:()=>I});var e=t(100035),n=t(304006),a=t(463302),d=t(365179),f=t(562075),E=t(506172),y=t(432611);const l=(0,n.N$)({requestVideoDownload:E.requestVideoDownload},function*({payload:{video:v}}){var m;const A=v._id;if(!A)return;const p=yield(0,e.Lt)(),h=(0,a.mC)(p),i=(0,d.V2d)(p);if(!h||!i)return;const r=(m=v.staticAssetDownload)==null?void 0:m.url;if(r){(0,f.z)(r);return}yield(0,e.yJ)((0,E.startVideoDownload)(A));try{yield(0,e.T1)(y.A,{primaryToken:h,siteId:i,videoId:A})}catch{yield(0,e.yJ)((0,E.failVideoDownload)(A))}});function*I(){yield(0,n.jP)(E.REQUEST_VIDEO_DOWNLOAD,l)}},744233:(ve,x,t)=>{t.d(x,{GZ:()=>a,c_:()=>d});var e=t(980672);const n=f=>f.videoDownload,a=(0,e.Mz)(n,f=>f.downloading),d=(0,e.Mz)(n,f=>f.fileSizes)},551258:(ve,x,t)=>{t.d(x,{Ry:()=>p,wX:()=>h});var e=t(990220),n=t(445525),a=t(80247),d=Object.defineProperty,f=Object.defineProperties,E=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,v=(r,o,u)=>o in r?d(r,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[o]=u,m=(r,o)=>{for(var u in o||(o={}))l.call(o,u)&&v(r,u,o[u]);if(y)for(var u of y(o))I.call(o,u)&&v(r,u,o[u]);return r},A=(r,o)=>f(r,E(o));const p=async({newId:r,primaryToken:o,siteId:u,video:c})=>{const{_id:s}=c,{data:g}=await(0,n.Ay)({primaryToken:o,siteId:u}).post(s?`${e.S9}/${s}`:e.S9,A(m({},c),{_id:s||r}),{timeout:n.Zc});return g},h=async({playlist:r,primaryToken:o,siteId:u})=>{const{_id:c}=r,{data:s}=await(0,n.Ay)({primaryToken:o,siteId:u}).post(c?`${e.bc}/${c}`:e.bc,r);return s},i=async({youtubeUrl:r,siteId:o,primaryToken:u})=>{try{const{data:c}=await maestroApiRequest({primaryToken:u,siteId:o}).post(`${PLAYLIST_SERVICE_BASE_URL}/external/import/youtube`,{skipInsert:!0,url:r});return c}catch(c){throw a.error(c),new Error(`Failed to import youtube playlist: ${c}`)}}},219117:(ve,x,t)=>{t.r(x),t.d(x,{CREATE_FILES:()=>n,REMOVE_FILE:()=>d,UPDATE_FILES:()=>a,createFiles:()=>f,deleteFile:()=>y,updateFiles:()=>E});var e=t(304006);const n="video-upload/CREATE_FILES",a="video-upload/UPDATE_FILES",d="video-upload/REMOVE_FILE",f=(0,e.dQ)(n,l=>({payload:l})),E=(0,e.dQ)(a,l=>({payload:l})),y=(0,e.dQ)(d,l=>({payload:{fileId:l}}))},312614:(ve,x,t)=>{t.d(x,{FI:()=>l,Nh:()=>I,pu:()=>v,pw:()=>m});var e=t(755203),n=t(445525),a=t(156221),d=t(218938),f=t(990220),E=t(16357);const y=()=>{},l=async(A,p,h,i)=>{let r=y;return(0,e.t)(A.type).then(({fileName:o,signedUploadUrl:u})=>{const c=new XMLHttpRequest;c.open("PUT",u),c.setRequestHeader("Content-type",A.type),r=()=>c.abort(),c.onerror=s=>{c.onloadend=null,h?.(s)},c.onloadend=()=>{r=y,p?.(o)},c.upload.onprogress=({loaded:s,total:g})=>i?.(100*s/g),c.send(A)}).catch(o=>h?.(o,"Couldn't get signed upload url")),()=>r()},I=async(A,p)=>{const h=(0,d.mC)((0,a.M)().getState());if(!h)throw new Error("User must be signed in");await(0,n.Ay)({freshInstance:!0,primaryToken:h,siteId:f.Cn}).post(`${f.S9}/transcode/${A}`,{fileName:p})},v=async A=>{const p=(0,d.mC)((0,a.M)().getState());if(!p)throw new Error("User must be signed in");const{data:h}=await(0,n.Ay)({freshInstance:!0,primaryToken:p,siteId:f.Cn}).post(`${f.S9}/iframe`,{htmlData:A},{timeout:n.Zc});return h.url},m=async A=>
1862{if(!(0,d.mC)((0,a.M)().getState()))throw new Error("User must be signed in");const{data:h}=await E.A.get(A);return h}},79617:(ve,x,t)=>{t.d(x,{h:()=>Nt});var e=t(63696),n=t(16357),a=t(964746),d=t(463302),f=t(365179),E=t(498685),y=t(816970),l=t(946568),I=t(551258),v=t(219117),m=t(839111),A=t(134249),p=t(674132),h=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,s=(j,H,J)=>H in j?h(j,H,{enumerable:!0,configurable:!0,writable:!0,value:J}):j[H]=J,g=(j,H)=>{for(var J in H||(H={}))u.call(H,J)&&s(j,J,H[J]);if(o)for(var J of o(H))c.call(H,J)&&s(j,J,H[J]);return j},P=(j,H)=>i(j,r(H));const O=j=>{const H=(0,E.wA)(),{documents:J}=(0,E.d4)(oe=>oe.realtime),B=(0,e.useRef)(new Set);return(0,e.useEffect)(()=>{const oe=setTimeout(()=>{const Pe=new Map;B.current.forEach(we=>{const Ee=`video/${we}`,pt=J?.[Ee];pt?.uploadStatus===a.TranscodingStatuses.complete&&(H((0,p.al)(Ee)),B.current.delete(we),Pe.set(we,{url:pt.url,durationSeconds:pt.durationSeconds}))}),j(we=>we.map(Ee=>{if(Pe.has(Ee._id)){const{url:pt,durationSeconds:$}=Pe.get(Ee._id);return P(g({},Ee),{url:pt,uploadStatus:a.TranscodingStatuses.complete,durationSeconds:$??0})}return Ee}))},1e3);return()=>clearTimeout(oe)},[J,j]),{watchTranscodingVideo:(0,e.useCallback)(oe=>{B.current.has(oe)||(B.current.add(oe),H((0,p.B1)(`video/${oe}`)))},[])}};var C=t(312614),W=t(80247),w=Object.defineProperty,T=Object.defineProperties,Y=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,Z=(j,H,J)=>H in j?w(j,H,{enumerable:!0,configurable:!0,writable:!0,value:J}):j[H]=J,te=(j,H)=>{for(var J in H||(H={}))se.call(H,J)&&Z(j,J,H[J]);if(ie)for(var J of ie(H))q.call(H,J)&&Z(j,J,H[J]);return j},Ne=(j,H)=>T(j,Y(H)),fe=(j,H)=>{var J={};for(var B in j)se.call(j,B)&&H.indexOf(B)<0&&(J[B]=j[B]);if(j!=null&&ie)for(var B of ie(j))H.indexOf(B)<0&&q.call(j,B)&&(J[B]=j[B]);return J};const _e=10,Le=10,ct=50,gt={sortBy:"modified",sortDirection:"-1"},Nt=()=>{const j=(0,e.useMemo)(()=>{let Se=()=>{};return Ue=>(Se(),(0,l.DH)(Ue,be=>{Se=be}))},[l.DH]),H=(0,e.useMemo)(()=>(0,y.QU)((0,y.SY)(I.Ry,Le)),[I.Ry]),[J,B]=(0,e.useState)(!0),[U,oe]=(0,e.useState)(!1),[Pe,we]=(0,e.useState)([]),[Ee,pt]=(0,e.useState)(0),[$,K]=(0,e.useState)(!0),[G,pe]=(0,e.useState)(gt),re=(0,e.useRef)(0),ge=(0,e.useRef)({}),le=(0,e.useRef)({}),ce=(0,E.d4)(Se=>Se.videoUpload.files),ne=(0,E.d4)(d.mC),Ke=(0,E.d4)(d.N6),Ce=(0,E.d4)(f.V2d),Fe=(0,E.wA)(),vt=(0,E.d4)(d.F6),rt=(0,e.useCallback)(Se=>{if(!ne)throw new Error("User must be logged in.");if(!Se.length)return Promise.resolve();const Ue=[];return we(be=>{const Et=[];for(const{newId:ze,video:yt}of Se)Ue.push(H({newId:ze,primaryToken:ne,siteId:Ce,video:yt})),ze&&Et.push(Ne(te({},yt),{durationSeconds:0,siteId:Ce,_id:ze}));return be.forEach(ze=>{const yt=Se.find(Qt=>Qt.video._id===ze._id);if(!yt){Et.push(ze);return}Et.push(te(te({},ze),yt.video))}),Et}),Promise.all(Ue).catch(be=>{W.error("Error creating videos",be)})},[ne,Ce]),Pt=(0,e.useCallback)(Se=>{Fe((0,v.createFiles)(Se.map(Ue=>{const be=(0,y.jo)();return ge.current[be]=Ue.blob,{description:Ue.description||"",id:be,localFileName:Ue.localFileName||Ue.blob.name,player:a.PlayerTypes.file,size:Ue.blob.size,tags:Ue.tags||[],title:Ue.title||Ue.blob.name,uploadingStatus:m.p.QUEUED}})))},[]),Vt=(0,e.useCallback)(Se=>{var Ue,be;delete ge.current[Se],Fe((0,v.deleteFile)(Se)),(be=(Ue=le.current)[Se])==null||be.call(Ue),delete le.current[Se]},[]),bt=(0,e.useCallback)(Se=>Fe((0,v.updateFiles)([{id:Se,uploadingStatus:m.p.QUEUED}])),[]),Ae=(0,e.useCallback)(async Se=>{const Ue=[],be=[];for(const Et of Se){const ze=Et,{newId:yt}=ze,Qt=fe(ze,["newId"]);"id"in Qt&&ce.some(Hn=>Hn.id===Qt.id)?Ue.push(Qt):be.push({newId:yt,video:Qt})}Ue.length&&Fe((0,v.updateFiles)(Ue)),be.length&&await rt(be)},[rt,ce]),Dt=(0,e.useCallback)(()=>pe(gt),[]),Yt=(0,e.useCallback)(async(Se,Ue=ct)=>{if(!ne||!Ke)return;const be=++re.current;oe(!0);try{const{results:Et}=await j({filters:Ne(te({},G),{limit:String(Ue),offset:String(Se)}),primaryToken:ne,siteId:Ce});if(be!==re.current)return;const ze=Et||[];we(yt=>Se===0?ze:[...yt,...ze]),K(ze.length===Ue),pt(Se+ze.length)}catch(Et){n.A.isCancel(Et)||W.error("Failed to fetch videos",Et)}finally{be===re.current&&oe(!1)}},[G,ne,Ke,Ce,j]),Ie=(0,e.useCallback)(()=>{J||U||!$||Yt(Ee)},[J,U,$,Ee,Yt]),he=(0,e.useCallback)(()=>Yt(0,Math.max(Ee,ct)),[Ee,Yt]);(0,e.useEffect)(()=>{B(!0),we([]),pt(0),K(!0);const Se=setTimeout(async()=>{await Yt(0),B(!1)},300);return()=>clearTimeout(Se)},[Yt]);const de=(0,e.useRef)([]);(0,e.useEffect)(()=>{const Se=setInterval(()=>{if(!de.current.length)return;const{current:Ue}=de;de.current=[],Fe((0,v.updateFiles)(Ue))},1e3);return()=>clearInterval(Se)},[]),(0,e.useEffect)(()=>{(async()=>
1862{if(!ne)return;let Se=0;const Ue=[];await(async()=>{for(const be of ce)if(be.uploadingStatus===m.p.UPLOADING&&(Se+=1),Se===_e)return;for(const be of ce)if(be.uploadingStatus===m.p.QUEUED&&(Se+=1,Ue.push({id:be.id,uploadingStatus:m.p.UPLOADING}),(0,A.T)(be.id,0),le.current[be.id]=await(0,C.FI)(ge.current[be.id],async Et=>{(0,A.T)(be.id),de.current.push({bucketFileName:Et,id:be.id,uploadingStatus:m.p.COMPLETE})},(Et,ze)=>{W.error({file:be,error:Et,message:ze}),de.current.push({id:be.id,uploadingStatus:m.p.ERROR})},Et=>(0,A.T)(be.id,Et)),Se===_e))return})(),Ue.length&&Fe((0,v.updateFiles)(Ue))})()},[ce,ne]);const{watchTranscodingVideo:Te}=O(we);return(0,e.useEffect)(()=>{const Se=setTimeout(async()=>{if(!ne)return;let Ue=!1;const be=[],Et=new Map;for(const ze of ce)ze.bucketFileName&&(Et.set(ze.id,ze.bucketFileName),Vt(ze.id),Ue=!0,be.push({newId:ze.id,video:{creator:vt||"",description:ze.description,durationSeconds:0,owner:vt||"",subscriptions:ze.subscriptions,tags:ze.tags,thumbnail:ze.thumbnail,title:ze.title,type:a.VideoTypes.vod,url:"https://pending.transcode.maestro.io",player:ze.player,uploadStatus:a.TranscodingStatuses.pending,siteId:Ce}}));await rt(be),await new Promise(ze=>setTimeout(ze,1e3)),await Promise.all(ce.map(async ze=>{const yt=Et.get(ze.id);yt&&(Te(ze.id),await(0,C.Nh)(ze.id,yt))})),Ue&&he()},300);return()=>clearTimeout(Se)},[ce,ne,Vt,he,rt,Te]),{addFiles:Pt,editVideoMetadata:Ae,files:ce,hasMore:$,isLoadingMore:U,loading:J,loadMore:Ie,removeFile:Vt,filters:G,setFilters:pe,videos:Pe,refresh:he,resetFilters:Dt,retryUpload:bt}}},134249:(ve,x,t)=>{t.d(x,{N:()=>d,T:()=>a});var e=t(63696);const n=new Map,a=(f,E)=>{if(E===void 0){n.delete(f);return}n.set(f,E)},d=(f,E,y=100)=>{const[l,I]=(0,e.useState)(f?n.get(f):void 0);return(0,e.useEffect)(()=>{if(!E||!f)return;const v=setInterval(()=>I(n.get(f)),y);return()=>clearInterval(v)},[f,y,E]),l}},311342:(ve,x,t)=>{t.d(x,{V:()=>p});var e=t(304006),n=t(219117),a=t(839111),d=Object.defineProperty,f=Object.defineProperties,E=Object.getOwnPropertyDescriptors,y=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,v=(h,i,r)=>i in h?d(h,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):h[i]=r,m=(h,i)=>{for(var r in i||(i={}))l.call(i,r)&&v(h,r,i[r]);if(y)for(var r of y(i))I.call(i,r)&&v(h,r,i[r]);return h},A=(h,i)=>f(h,E(i));const p=(0,e.T1)(n,a.$,(h,i)=>{switch(i.type){case n.CREATE_FILES:return A(m({},h),{files:[...h.files,...i.payload]});case n.REMOVE_FILE:return A(m({},h),{files:h.files.filter(({id:r})=>r!==i.payload.fileId)});case n.UPDATE_FILES:return A(m({},h),{files:h.files.map(r=>{const o=i.payload.find(u=>u.id===r.id);return o?m(m({},r),o):r})});default:return h}})},839111:(ve,x,t)=>{t.d(x,{$:()=>n,p:()=>e});var e=(a=>(a.COMPLETE="complete",a.ERROR="error",a.UPLOADING="uploading",a.QUEUED="queued",a))(e||{});const n=()=>({files:[]})},867907:(ve,x,t)=>{t.d(x,{A:()=>p});var e=t(734082),n=t(729172),a=t(224191),d=t(63696),f=t(886550),E=t(223468),y=t(545290);const l=(0,f.Ay)(E.A)` 1863 ${(0,y.PD)` 1864 border-radius: 5px; 1865 overflow: hidden; 1866 `} 1867`,I=f.Ay.div` 1868 position: absolute; 1869 width: 100%; 1870 height: 100%; 1871 top: 0; 1872 left: 0; 1873 display: flex; 1874 justify-content: center; 1875 align-self: center; 1876 align-items: center; 1877`,v=f.Ay.div` 1878 position: relative; 1879 width: ${h=>h.width}; 1880 height: ${h=>h.height}; 1881 display: flex; 1882 flex-direction: column; 1883`;class m extends d.Component{constructor(){super(...arguments),this.container=null,this.intervalId=null,this.state={height:"0px",width:"0px"},this.ref=i=>{i!==this.container&&(this.container=i,this.updateSize())},this.updateSize=()=>{if(!this.container)return;const{aspectRatio:i,offsetHeight:r}=this.props,o=this.container.offsetWidth,u=this.container.offsetHeight+r,c=Math.min(u,o/i),s=Math.min(o,u*i),{height:g,width:P}=this.state;if(s===o){const O=`${c-r}px`,C="100%";(g!==O||P!==C)&&this.setState({height:O,width:C})}if(c===u){const O="100%",C=`${s}px`;(g!==O||P!==C)&&this.setState({height:O,width:C})}}}componentDidMount(){this.intervalId=setInterval(this.updateSize,1e3)}componentWillUnmount(){clearInterval(this.intervalId)}
1883render(){const{children:i,className:r,isLandscape:o,videoHeight:u,enabled:c,disabled:s}=this.props,{height:g,width:P}=this.state;return d.createElement(l,{className:r,disabled:o||s,maxHeight:u},d.createElement(I,{ref:this.ref},d.createElement(v,{height:c?g:"100%",width:c?P:"100%"},i)))}}m.defaultProps={aspectRatio:16/9,className:void 0,disabled:!1,enabled:!1,offsetHeight:0};const A=h=>({isLandscape:(0,e.VC)(h)&&(0,e.Yg)(h),videoHeight:(0,n.f7)(h)}),p=(0,a.connect)(A)(m)},710738:(ve,x,t)=>{t.d(x,{A:()=>_t});var e=t(63696),n=t(224191),a=t(886550),d=t(33149),f=t(990220),E=t(368909),y=t(400781),l=t(365179),I=t(272568),v=t(346002),m=t(393982),A=t(269920),p=t(533028),h=t(243888),i=t(463302),r=t(426127),o=t(299500),u=t(711678),c=t(675824),s=t(415530),g=t(899821),P=t(41989),O=t(463702),C=t(342161),W=t(680095),w=t(349875),T=t(391723),Y=t(551321),ie=t(283722),se=t(40780),q=t(520527),Z=t(554457),te=t(428441),Ne=t(706223),fe=t(144265),_e=t(60058),Le=t(476765),ct=t(359785),gt=t(794690),Nt=t(514245),j=t(463296),H=t(488291),J=t(196063),B=t(430141),U=t(808201),oe=t(89649),Pe=Object.defineProperty,we=Object.defineProperties,Ee=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,$=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,G=(ae,Be,et)=>Be in ae?Pe(ae,Be,{enumerable:!0,configurable:!0,writable:!0,value:et}):ae[Be]=et,pe=(ae,Be)=>{for(var et in Be||(Be={}))$.call(Be,et)&&G(ae,et,Be[et]);if(pt)for(var et of pt(Be))K.call(Be,et)&&G(ae,et,Be[et]);return ae},re=(ae,Be)=>we(ae,Ee(Be));const ge="text-admin-text-100 text-base font-bold",ce=({item:ae,isOpen:Be,onClose:et,onChange:nt})=>{const{t:Ut}=(0,P._h)(),Kt=(0,n.useDispatch)(),{isCustomColor:ot}=(0,H.A)(ae.background.color),{handleChange:Ye}=(0,p.A)({item:ae,onChange:nt}),Gt=(0,n.useSelector)(l.tom),Lt=(0,h.A)(Gt??null),tn=Lt.loaded?Lt.video:null,kt=(0,e.useCallback)(()=>{tn&&(et(),Kt((0,oe.to)({kind:u.V.videoSettingsV1,data:{videos:[tn],initialTab:"paywall"}})))},[Kt,et,tn]),jt=(0,e.useCallback)(Mn=>{const Un=re(pe({},ae.background),{color:Mn,customColor:ot(Mn)?Mn:ae.background.customColor});nt(re(pe({},ae),{background:Un}))},[ae,nt,ot]),qn=(0,e.useCallback)(Mn=>Un=>{if(Mn==="background.type"&&Un==="image"&&ae.background.type==="color"){const so=(0,T.Nv)(ae.background.color,ae.background.customColor);nt(re(pe({},ae),{background:so}));return}if(Mn==="background.type"&&Un==="color"&&ae.background.type==="image"){nt(re(pe({},ae),{background:{type:"color",color:ae.background.color,customColor:ae.background.customColor}}));return}Ye(Mn)(Un)},[ae,nt,Ye]),hn=(0,e.useCallback)(Mn=>{const Un=typeof Mn=="string"?Mn:Mn.horizontal;nt(re(pe({},ae),{alignment:re(pe({},ae.alignment),{horizontal:Un})}))},[ae,nt]),Eo=(0,e.useMemo)(()=>Ye("image.show"),[Ye]),Oo=(0,e.useMemo)(()=>Ye("label.show"),[Ye]),Dn=(0,e.useMemo)(()=>Ye("title.show"),[Ye]),Bn=(0,e.useMemo)(()=>Ye("description.show"),[Ye]),Gn=(0,e.useMemo)(()=>Ye("spacing"),[Ye]);return e.createElement(J.A,{isOpen:Be,titleKey:"ADMIN_LABEL_VIDEO_GATE_SETTINGS",onClose:et,width:"375px",padding:"30px 20px 40px 20px",itemSpacing:"30px"},e.createElement(B.tU,{defaultValue:"design",className:"flex flex-col flex-1 gap-[30px]"},e.createElement(B.j7,{className:(0,d.cn)(U.A,"grid grid-cols-2")},e.createElement(B.Xi,{value:"design",className:(0,d.cn)(U.c,"flex-1")},Ut("ADMIN_LABEL_DESIGN")),e.createElement(B.Xi,{value:"access-control",className:(0,d.cn)(U.c,"flex-1")},Ut("ACCESS_CONTROL"))),e.createElement(B.av,{value:"design",className:"mt-0"},e.createElement("div",{className:"flex flex-col gap-5"},e.createElement("div",{className:"flex flex-col gap-6"},e.createElement("div",{className:"flex flex-col gap-4"},e.createElement("div",{className:ge},Ut("ADMIN_LABEL_DISPLAY")),e.createElement("div",{className:"flex flex-col gap-4"},e.createElement(j.S,{checked:ae.image.show,labelKey:"ADMIN_LABEL_SUPPORTING_IMAGE",onCheckedChange:Eo}),e.createElement(j.S,{checked:ae.label.show,labelKey:"ADMIN_LABEL",onCheckedChange:Oo}),e.createElement(j.S,{checked:ae.title.show,labelKey:"ADMIN_LABEL_TITLE",onCheckedChange:Dn}),e.createElement(j.S,{checked:ae.description.show,labelKey:"ADM
1883IN_LABEL_DESCRIPTION",onCheckedChange:Bn}))),e.createElement(C.BS,{spacing:ae.spacing,onChange:Gn,disabledFields:["top"]})),e.createElement(C.ss,{layout:ae.alignment.horizontal,onChange:hn}),e.createElement(C.S4,{background:ae.background,onChange:qn,onColorChange:jt,desktopDimensions:T.QG.desktop,mobileDimensions:T.QG.mobile}))),e.createElement(B.av,{value:"access-control",className:"mt-0"},e.createElement("div",{className:"flex flex-col gap-[30px]"},e.createElement("div",{className:"text-admin-text-200 text-sm"},Ut("ADMIN_PAYWALL_ACCESS_CONTROL_HINT")),e.createElement(Y.$,{context:"admin",variant:"default",className:"w-full",disabled:!tn,onClick:kt},Ut("ADMIN_LABEL_GO_TO_VIDEO_SETTINGS"))))))};var ne=t(710522),Ke=t(252992),Ce=t(744161),Fe=t(842671),vt=t(970587),rt=t(342023);const Pt={width:"24px"},bt=()=>{const{endUserT:ae}=(0,P.T9)(),{setAccessCode:Be,loggedIn:et,hasError:nt,loading:Ut,handleSubmit:Kt}=(0,rt.A)();return e.createElement("form",{"data-testid":"accessCodeGateSection",onSubmit:Kt,className:"flex flex-col items-start gap-2"},e.createElement(vt.J,{className:`${Ke.mz} text-sm font-bold uppercase text-[var(--text-100)]`},ae([P.Rq.gateEnterCode],["ENTER_CODE"])),e.createElement(Ce.A,{className:Ke.OA,hasError:nt,loggedIn:et,setAccessCode:Be}),nt&&e.createElement("span",{className:"text-sm text-[var(--alert-error)]"},ae([P.Rq.gateInvalidAccessCode],["INVALID_ACCESS_CODE"])),e.createElement(Y.$,{className:`${Ke.XD} h-10 px-6 rounded-full uppercase font-bold`,disabled:Ut,type:"submit"},Ut?e.createElement(Fe.A,{style:Pt}):ae([P.Rq.globalActionSubmit],["SUBMIT"])))},Dt=({id:ae,text:Be})=>e.createElement("div",{id:ae,"data-testid":"paywall-rental-expired-notice",className:"flex min-w-0 flex-1 flex-row items-start gap-2"},e.createElement(ie.Ay,{name:"info",className:"mt-px shrink-0 [&_svg]:!h-[18px] [&_svg]:!w-[18px]",color:"var(--highlight-secondary)"}),e.createElement("p",{className:"min-w-0 text-pretty text-xs font-bold leading-tight text-[var(--text-100)]"},Be));var Yt=t(73782),Ie=t(689103);const he=({children:ae})=>e.createElement("div",{className:"flex flex-row items-center gap-2"},e.createElement(ie.Ay,{name:"checkmark",className:"[&_svg]:!h-[26px] [&_svg]:!w-[26px]",color:"var(--highlight-primary)"}),e.createElement("span",{className:"text-base leading-[18px] font-bold text-[var(--text-100)]"},ae)),de=({topLine:ae,bottomLine:Be})=>e.createElement("div",{className:"flex flex-row items-center gap-2"},e.createElement(ie.Ay,{name:"clock",className:"[&_svg]:!h-[26px] [&_svg]:!w-[26px]",color:"var(--highlight-secondary)"}),e.createElement("div",{className:"flex flex-col items-start justify-center gap-[2px]"},e.createElement("span",{className:"text-xs leading-[14px] font-medium text-[var(--text-300)]"},ae),e.createElement("span",{className:"text-base leading-[18px] font-bold text-[var(--text-100)]"},Be))),Se=({entitlement:ae,rentalTimer:Be})=>{const{t:et}=(0,P._h)(),nt=(0,Ie.jP)(et,ae,Be);return nt?nt.kind==="singleLine"?e.createElement(he,null,nt.text):e.createElement(de,{topLine:nt.topText,bottomLine:nt.bottomText}):null};var Ue=Object.defineProperty,be=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,Hn=(ae,Be,et)=>Be in ae?Ue(ae,Be,{enumerable:!0,configurable:!0,writable:!0,value:et}):ae[Be]=et,It=(ae,Be)=>{for(var et in Be||(Be={}))yt.call(Be,et)&&Hn(ae,et,Be[et]);if(ze)for(var et of ze(Be))Qt.call(Be,et)&&Hn(ae,et,Be[et]);return ae},Bt=(ae,Be)=>be(ae,Et(Be));const At="paywall-ticket-only-access-notice",xt="paywall-rental-expired-notice",qe=60,Jt=(0,a.Ay)(C.GR)` 1884 ${({isMobile:ae})=>!ae&&` 1885 & ${Ne.x} > div { 1886 top: ${T.uF}px !important; 1887 } 1888 `} 1889`,Q=({prefix:ae,action:Be,onClick:et})=>e.createElement("div",{className:"text-base"},e.createElement("span",{className:"mr-1.5 text-text-300"},ae),e.createElement(Y.$,{context:"site",variant:"link",className:"h-auto p-0 text-base",onClick:et},Be)),_t=()=>{var ae,Be,et,nt,Ut,Kt;const{t:ot}=(0,P._h)(),Ye=(0,n.useDispatch)(),Gt=(0,n.useSelector)((0,r._2)(ot)),Lt=(0,n.use
1889Selector)((0,r.CG)(ot)),tn=(0,n.useSelector)(I.kL),kt=(0,n.useSelector)(v.YA),jt=(0,n.useSelector)(r.x9),qn=(0,n.useSelector)(E.VC),hn=(0,n.useSelector)(v.Q),Eo=(0,n.useSelector)(r.sT),{setGatePaywall:Oo}=(0,A.A)(),Dn=(0,n.useSelector)(i.x3),Bn=(0,n.useSelector)(y.bg),Gn=(0,n.useSelector)(l.tom),Mn=(0,n.useSelector)(m.LD),Un=(0,n.useSelector)(m.fP),so=(0,n.useSelector)(l.x6f),To=(0,n.useSelector)(l.LeP),gn=(0,O.H)(Gn,"video",Mn?{videoPageId:so,slug:To}:void 0),ue=(0,n.useSelector)(r.v),Re=(0,n.useSelector)(r.hY),Xe=(0,n.useSelector)(mn=>Gn?(0,_e.YE)(mn,"video",Gn):null),Zt=(0,h.A)(Gn??null),on=Zt.loaded?Zt.video:null,[Ht,_n]=(0,e.useState)(!1),[Rn,eo]=(0,e.useState)(!1),to=(0,e.useMemo)(()=>{var mn,io;const mo=(mn=(0,Le.xU)(gn?.video))==null?void 0:mn.thumbnail,Pa=(io=(0,Le.xU)(Xe))==null?void 0:io.thumbnail;return mo||Pa||ct.kD},[gn,Xe]),pn=(0,e.useMemo)(()=>{var mn;return(0,gt.il)(((mn=jt?.gate)==null?void 0:mn.subscriptions)||[])},[(ae=jt?.gate)==null?void 0:ae.subscriptions]),Wn=(0,e.useMemo)(()=>{var mn,io,mo;return((mo=(io=(mn=jt?.gate)==null?void 0:mn.subscriptions)==null?void 0:io.length)!=null?mo:0)>0&&pn.length===0},[(Be=jt?.gate)==null?void 0:Be.subscriptions,pn.length]),Fn=(0,e.useMemo)(()=>{var mn,io;return((io=(mn=jt?.gate)==null?void 0:mn.subscriptions)!=null?io:[]).filter(mo=>mo.type===Nt.Q.ticket).map(mo=>typeof mo.name=="string"?mo.name.trim():"").filter(mo=>mo.length>0)},[(et=jt?.gate)==null?void 0:et.subscriptions]),Po=(0,e.useCallback)(()=>{pn.length&&Ye((0,o.to)({kind:u.V.vodCheckout,data:{description:Bn,image:to,locked:!0,selectedSubscriptionId:(0,gt.P$)(pn[0]),subscriptions:pn,title:Bn||pn[0].name}}))},[pn,Ye,Bn,to]),no=gn?.result==="OK"||gn?.result==="UNAUTHORIZED",wo=no?(nt=gn?.access)!=null?nt:gn?.playbackAccess:void 0,Co=no?gn?.rentalTimer:void 0,yn=(0,ne.Uc)(Gn,wo,Co,ue,Re,Gt,Lt),Yn=(0,fe.o)(yn),oo=Wn&&!hn&&Dn&&!Lt&&Yn.kind==="render"&&Yn.labelKey==="PAYWALL_CTA_GET_ACCESS",Sn=yn==="rentalExpired"&&!hn&&Dn,Bo=Wn&&!hn&&!Lt,xo=(0,e.useMemo)(()=>{var mn;return Fn.length>1?{line1:ot("PAYWALL_TICKET_ONLY_MULTI_LINE_1",{ticketNames:Fn.join(", ")}),line2:ot("PAYWALL_TICKET_ONLY_MULTI_LINE_2")}:{line1:ot("PAYWALL_TICKET_ONLY_SINGLE_LINE_1",{ticketName:(mn=Fn[0])!=null?mn:ot("PAYWALL_TICKET_ONLY_SINGLE_ORIGINAL_QUALIFIER")}),line2:ot("PAYWALL_TICKET_ONLY_SINGLE_LINE_2")}},[Fn,ot]),ao=Dn&&Lt&&Wn&&Yn.kind==="render"&&Yn.labelKey==="PAYWALL_CTA_GET_ACCESS"?{kind:"render",labelKey:"PAYWALL_CTA_WATCH_NOW"}:Yn,Lo=ao.kind==="render"?ao.labelKey:"PAYWALL_CTA_GET_ACCESS",Io=(0,e.useCallback)(()=>{Ye((0,r.Bt)())},[Ye]),uo=(0,e.useCallback)(()=>{Ye((0,o.JT)())},[Ye]),Uo=(0,e.useCallback)(()=>{_n(!0)},[]),Ko=(0,e.useCallback)(()=>{_n(!1),Ye((0,s.JU)()),Ye((0,g.lg)()),Ye((0,c.mj)(null))},[Ye]),Qn=(0,e.useCallback)(()=>{Ye((0,i.je)()),Ye((0,o.JT)())},[Ye]),Mo=(0,e.useCallback)(()=>{if(hn){if(!on)return;Ye((0,o.to)({kind:u.V.videoSettingsV1,data:{videos:[on],initialTab:"paywall"}}));return}if(!oo&&!Sn){if(!Dn){eo(!0),Ye((0,o.JT)());return}if((0,ne.by)(yn)){Io();return}if(Dn&&Lt&&Wn){Io();return}Po()}},[on,Ye,yn,hn,Dn,Io,Po,Wn,Lt,oo,Sn]);e.useEffect(()=>{if(!(!Dn||!Rn)&&(eo(!1),!(0,ne.by)(yn))){if(Wn&&Lt){Io();return}Po()}},[yn,Dn,Io,Po,Rn,Wn,Lt]);const _o=(0,e.useMemo)(()=>{var mn,io;return(io=(mn=kt?.paywall)==null?void 0:mn.hero)!=null?io:(0,ne.a$)(tn,ot)},[(Ut=kt?.paywall)==null?void 0:Ut.hero,tn,ot]),oa=(0,e.useCallback)(mn=>{Oo(mn)},[Oo]),[Va,Qo]=(0,e.useState)(()=>hn&&!Un);(0,e.useEffect)(()=>{Qo(hn&&!Un)},[hn,Un]);const Jo=hn&&Va,aa=(0,e.useCallback)(()=>Qo(!0),[]),ra=(0,e.useCallback)(()=>Qo(!1),[]),{handleChange:lo}=(0,p.A)({item:_o,onChange:oa}),Wo=(0,e.useMemo)(()=>lo("label.rawData"),[lo]),ha=(0,e.useMemo)(()=>lo("title.rawData"),[lo]),sa=(0,e.useMemo)(()=>lo("description.rawData"),[lo]),kn=(0,e.useMemo)(()=>lo("image.url"),[lo]),ya=(0,e.useMemo)(()=>lo("image.height"),[lo]),Aa=qn?T._w.mobile:T._w.desktop,{alignment:Jn,background:la,image:Xo,label:Oa,title:jo,description:No,spacing:Ho}=_o;return ao.kind==="bypass"&&!Eo?null:e.createElement(Jt,{testId:"paywall",titleKey:"LABEL_VIDEO_GATE",isMobile:qn,onEdit:aa,style:{minHeight:`${Aa}px`,height:"100%",["--edit-border-inset-top"]:qn?0:`${T.uF}px`,width:"100%",overflow:"hidden"}},e.createElement("div",{className:"absolute inset-0"},e.createElement(C.fv,{background:la,horizontalAlignment:Jn.horizontal,disableBottomFade:!0})),e.createElement(C.ZO,{spacing:qn?Bt(It({},Ho),{left:20,right:20,top:0,bottom:20}):Bt(It({},Ho),{top:0,bottom:f.c0?Math.min((Kt=Ho.bottom)!=null?Kt:0,qe):Ho.bottom}),className:(0,d.cn)("relative h-full flex items-end",Jn.horizontal==="left"&&"justify-start",Jn.horizontal==="center"&&"justify-center",Jn.horizontal==="right"&&"justify-end")},e.createElement(W.A,{alignment:Jn.horizontal,widthClassName:Jn.horizontal==="center"?"w-full @xl:w-[90%] @4xl:w-[80%] @7xl:w-[55%]":"w-full @xl:w-[85%] @4xl:w-[70%] @7xl:w-[40%]",labelElement:Oa.show?e.createElement("div",{className:"[&_.mce-content-body]:text-accent"}
1889,e.createElement(q.A,{blockTitleKey:"ADMIN_LABEL",data:Oa.rawData,onChange:Wo,useRawDataV2:!0,toolbarButtons:te.z7.titleEditor})):null,imageElement:Xo.show?e.createElement(w.A,{image:Xo,onChangeUrl:kn,onChangeHeight:ya}):null,titleElement:jo.show?e.createElement(q.A,{blockTitleKey:"ADMIN_LABEL_TITLE",data:jo.rawData,onChange:ha,useRawDataV2:!0,htmlTag:"h1",maxLength:50,toolbarButtons:te.z7.titleEditor}):null,descriptionElement:No.show?e.createElement(q.A,{blockTitleKey:"ADMIN_LABEL_DESCRIPTION",data:No.rawData,onChange:sa,useRawDataV2:!0,maxLength:500,toolbarButtons:te.z7.bodyEditor}):null,primaryCtaElement:e.createElement("div",{className:(0,d.cn)("flex flex-col",Jn.horizontal==="left"&&"items-start",Jn.horizontal==="center"&&"items-center",Jn.horizontal==="right"&&"items-end")},!Ht&&e.createElement("div",{className:(0,d.cn)("flex min-w-0 w-full flex-row flex-wrap items-center gap-x-4 gap-y-2",Jn.horizontal==="left"&&"justify-start",Jn.horizontal==="center"&&"justify-center",Jn.horizontal==="right"&&"justify-end")},e.createElement("div",{className:"shrink-0"},e.createElement(Z.A,{testId:"paywall-cta-editable-area",blockTitleKey:"ADMIN_LABEL_PAYWALL_SETTINGS",isEditing:hn,onClick:hn?Mo:void 0},e.createElement(se.A,{disabled:oo||Sn,"aria-describedby":(0,d.cn)(oo&&At,Sn&&xt)||void 0,onClick:hn?void 0:Mo},ao.kind==="render"&&ao.labelKey==="PAYWALL_CTA_CONTINUE_WATCHING"&&e.createElement(ie.Ay,{name:"playLarge",className:"[&_svg]:!h-[14.32px] [&_svg]:!w-[12.41px]",color:"var(--highlight-primary)"}),ot(Lo)))),Bo?e.createElement(Yt.A,{id:At,line1:xo.line1,line2:xo.line2}):null,Sn?e.createElement(Dt,{id:xt,text:ot("PAYWALL_RENTAL_EXPIRED_NOTICE")}):null,e.createElement("div",{className:"shrink-0 [&:empty]:hidden"},e.createElement(Se,{entitlement:yn,rentalTimer:Co}))),e.createElement("div",{className:(0,d.cn)("flex flex-col gap-2.5",Ht?"mt-2.5":"mt-[30px]",Jn.horizontal==="left"&&"items-start",Jn.horizontal==="center"&&"items-center",Jn.horizontal==="right"&&"items-end")},Ht?e.createElement("div",{className:"flex flex-col gap-2.5"},e.createElement(Y.$,{variant:"secondary",size:"sm",type:"button",className:"self-start gap-[3px] mb-[20px] rounded-full uppercase font-bold leading-[14px]",onClick:Ko},e.createElement(ie.Ay,{name:"left-open"}),ot("BACK")),e.createElement(bt,null)):e.createElement(e.Fragment,null,!Dn&&e.createElement(Q,{prefix:ot("ALREADY_PURCHASED_QUESTION"),action:ot("ACTION_LOG_IN"),onClick:uo}),e.createElement(Q,{prefix:ot("HAVE_AN_ACCESS_CODE"),action:ot("ENTER_CODE"),onClick:Uo}),Dn&&e.createElement(Q,{prefix:ot("BOUGHT_TICKET_DIFFERENT_ACCOUNT"),action:ot("SWITCH_ACCOUNT"),onClick:Qn}))))}),e.createElement(ce,{isOpen:Jo,onClose:ra,item:_o,onChange:oa})))}},73782:(ve,x,t)=>{t.d(x,{A:()=>d});var e=t(63696),n=t(283722);const d=({id:f,line1:E,line2:y})=>e.createElement("div",{id:f,"data-testid":"paywall-ticket-only-notice",className:"flex min-w-0 flex-1 flex-row items-start gap-2"},e.createElement(n.Ay,{name:"info",className:"mt-px shrink-0 [&_svg]:!h-[18px] [&_svg]:!w-[18px]",color:"var(--highlight-secondary)"}),e.createElement("p",{className:"min-w-0 text-pretty text-xs font-bold leading-tight text-[var(--text-100)]"},E," ",y))},689103:(ve,x,t)=>{t.d(x,{C_:()=>n,ec:()=>e,jP:()=>d});const e=1e3*60*60*24,n=1e3*60*60,a=1e3*60,d=(f,E,y,l=Date.now())=>{var I;if(!y)return null;const v=(I=y.grantedAt)!=null?I:y.purchasedAt;if(E==="purchase"&&v!=null){const m=Math.floor((l-v)/e);return m<=0?{kind:"singleLine",text:f("PAYWALL_LABEL_PURCHASED_TODAY")}:m===1?{kind:"singleLine",text:f("PAYWALL_LABEL_PURCHASED_ONE_DAY_AGO")}:{kind:"singleLine",text:f("PAYWALL_LABEL_PURCHASED_X_DAYS_AGO",{days:String(m)})}}if(E==="rentalNotStarted"&&y.rentalStartBy){const m=y.rentalStartBy-l;if(m<=0)return null;const A=f("PAYWALL_LABEL_YOUR_RENTAL"),p=Math.ceil(m/a);if(p<60)return{kind:"twoLine",topText:A,bottomText:p<=1?f("PAYWALL_LABEL_START_WITHIN_O
1889NE_MINUTE"):f("PAYWALL_LABEL_START_WITHIN_X_MINUTES",{minutes:String(p)})};const h=Math.ceil(m/n);if(h<24)return{kind:"twoLine",topText:A,bottomText:h<=1?f("PAYWALL_LABEL_START_WITHIN_ONE_HOUR"):f("PAYWALL_LABEL_START_WITHIN_X_HOURS",{hours:String(h)})};const i=Math.ceil(m/e);return{kind:"twoLine",topText:A,bottomText:i<=1?f("PAYWALL_LABEL_START_WITHIN_ONE_DAY"):f("PAYWALL_LABEL_START_WITHIN_X_DAYS",{days:String(i)})}}if(E==="rentalActive"){const m=y.remainingMs!==void 0?y.remainingMs:y.rentalExpiresAt!==void 0?y.rentalExpiresAt-l:void 0;if(m===void 0||m<=0)return null;const A=Math.ceil(m/a);if(A<60)return{kind:"twoLine",topText:f("PAYWALL_LABEL_YOUR_RENTAL"),bottomText:A<=1?f("PAYWALL_LABEL_ONE_MINUTE_LEFT"):f("PAYWALL_LABEL_X_MINUTES_LEFT",{minutes:String(A)})};const p=Math.ceil(m/n);return{kind:"twoLine",topText:f("PAYWALL_LABEL_YOUR_RENTAL"),bottomText:p<=1?f("PAYWALL_LABEL_ONE_HOUR_LEFT"):f("PAYWALL_LABEL_X_HOURS_LEFT",{hours:String(p)})}}return null}},710522:(ve,x,t)=>{t.d(x,{Uc:()=>g,a$:()=>c,by:()=>P});var e=t(391723),n=t(883895),a=t(438749),d=t(514245),f=Object.defineProperty,E=Object.defineProperties,y=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,m=(O,C,W)=>C in O?f(O,C,{enumerable:!0,configurable:!0,writable:!0,value:W}):O[C]=W,A=(O,C)=>{for(var W in C||(C={}))I.call(C,W)&&m(O,W,C[W]);if(l)for(var W of l(C))v.call(C,W)&&m(O,W,C[W]);return O},p=(O,C)=>E(O,y(C)),h=(O,C)=>{var W={};for(var w in O)I.call(O,w)&&C.indexOf(w)<0&&(W[w]=O[w]);if(O!=null&&l)for(var w of l(O))C.indexOf(w)<0&&v.call(O,w)&&(W[w]=O[w]);return W};const i="paywall",r=({text:O,fontSize:C,lineHeight:W,fontWeight:w,color:T})=>({type:"extended-text",text:O,style:`font-size: ${C}px; line-height: ${W}px; font-weight: ${w}; color: ${T};`,version:1,detail:0,format:0,mode:"normal"}),o=O=>JSON.stringify({root:{type:"root",direction:"ltr",format:"left",indent:0,version:1,children:[(0,n.MS)({tag:"h1",children:[r({text:O("ADMIN_PAYWALL_DEFAULT_TITLE"),fontSize:32,lineHeight:36,fontWeight:600,color:a._z.text100})]}),(0,n.ml)([r({text:O("ADMIN_PAYWALL_DEFAULT_SUBTITLE"),fontSize:16,lineHeight:18,fontWeight:700,color:a._z.text100})])]}}),u=O=>(0,n.ck)([r({text:O("ADMIN_PAYWALL_DEFAULT_DESCRIPTION"),fontSize:14,lineHeight:20,fontWeight:400,color:a._z.text200})]),c=(O,C,W)=>{const w=(0,e.qh)(O,C,W),{primaryCta:T,secondaryCta:Y,background:ie}=w,se=h(w,["primaryCta","secondaryCta","background"]);return p(A({},se),{background:ie.type==="image"?p(A({},ie),{image:p(A({},ie.image),{gradientMask:"gradient"})}):ie,title:p(A({},se.title),{rawData:o(C)}),description:p(A({},se.description),{rawData:u(C)})})},s=(O,C)=>{var W;const w=Date.now();if(O==="none")return"none";if(O==="full"&&C){if(C.rentalStartBy!==void 0)return"rentalNotStarted";if(C.remainingMs!==void 0)return C.remainingMs<=0?"rentalExpired":"rentalActive";if(C.rentalExpiresAt!==void 0)return C.rentalExpiresAt<=w?"rentalExpired":"rentalActive";if(C.rentalStartedAt!==void 0)return"rentalActive";if(((W=C.grantedAt)!=null?W:C.purchasedAt)!=null)return"purchase"}switch(O){case"rental_not_started":return"rentalNotStarted";case"rental_in_progress":return"rentalActive";case"rental_expired":return"rentalExpired";default:return"none"}},g=(O,C,W,w,T,Y,ie)=>{const se=s(C,W);if(se!=="none")return se;const q=w;return O&&q?.videoId===O&&(q.vodMonetizationType===d.Q.vodPurchase||q.vodMonetizationType===d.Q.vodRental)?q.vodMonetizationType===d.Q.vodPurchase?"purchase":"rentalNotStarted":O&&T?.videoId===O&&(T.vodMonetizationType===d.Q.vodPurchase||T.vodMonetizationType===d.Q.vodRental)?T.vodMonetizationType===d.Q.vodPurchase?"purchase":"rentalNotStarted":O&&C==="full"&&Y===!0?"purchase":O&&ie===!0&&Y!==!0&&(C==="full"||C==="no_entitlement")?"membership":"none"},P=O=>O==="rentalNotStarted"||O==="rentalActive"||O==="purchase"},912712:(ve,x,t)=>{t.d(x,{A:()=>dt});var e=t(63696),n=t(196063),a=t(34729),d=t(463296),f=t(392971),E=t(41989),y=t(532793);const I=({item:N,onSettingsChange:R})=>{const{t:k}=(0,E._h)(),{footer:X}=N.data,ye=e.useMemo(()=>{var at,De,ut,Rt,Tt;
1889return[{labelKey:"ADMIN_LABEL_TITLE",checked:(at=X?.showTitle)!=null?at:!1,path:"footer.showTitle"},{labelKey:"ADMIN_LABEL_DESCRIPTION",checked:(De=X?.showDescription)!=null?De:!1,path:"footer.showDescription"},{labelKey:"ADMIN_LABEL_TAGS",checked:(ut=X?.showTags)!=null?ut:!1,path:"footer.showTags"},{labelKey:"ADMIN_LABEL_VIEWS",checked:(Rt=X?.showViews)!=null?Rt:!1,path:"footer.showViews"},{labelKey:"ADMIN_LABEL_SHARE",checked:(Tt=X?.showShare)!=null?Tt:!1,path:"footer.showShare"}]},[X]),me=e.useCallback(at=>De=>R?.(at)(De),[R]),Je=e.useCallback(at=>{R?.("footer.alignment")(at)},[R]);return e.createElement(a.wn,{gap:30},e.createElement(a.wn,{gap:16},e.createElement(a._x,null,k("ADMIN_LABEL_VIDEO_FOOTER_DISPLAY")),e.createElement(a.wn,{gap:5},ye.map(({labelKey:at,checked:De,path:ut})=>e.createElement(d.A,{key:ut,checked:De,labelKey:at,onCheckedChange:me(ut)}))),e.createElement(a.wn,{gap:16},e.createElement(a._x,null,k("ADMIN_LABEL_VIDEO_FOOTER_ALIGNMENT")),e.createElement(f.Ay,{options:y.Zq,value:X?.alignment||y.C1.Left,onChange:Je}))))};var v=t(886550),m=t(429195),A=t(152544);const p=v.Ay.div` 1890 ${A.Ns}; 1891 color: ${m._e_}; 1892`,h=v.Ay.span` 1893 ${A.Ns}; 1894 color: ${m.zkP}; 1895`,i=v.Ay.div` 1896 display: flex; 1897 flex-direction: ${({direction:N})=>N||"column"}; 1898 padding: 10px 16px 10px 12px; 1899 border-radius: 4px; 1900 background-color: ${m.k6P}; 1901 justify-content: space-between; 1902 align-items: center; 1903 gap: ${({gap:N})=>N||0}px; 1904`,r=v.Ay.div` 1905 ${A.EE}; 1906 color: ${m.o0B}; 1907 background-color: ${m.dHK}; 1908 padding: 4px 12px 4px 12px; 1909 border-radius: 50px; 1910 text-wrap: nowrap; 1911 overflow: hidden; 1912 text-align: center; 1913`,o=v.Ay.div` 1914 display: flex; 1915 flex-direction: row; 1916 width: 100%; 1917 flex: 1; 1918 min-width: 0; 1919 align-items: center; 1920 justify-content: flex-start; 1921 gap: 4px; 1922`,u=v.Ay.div` 1923 display: flex; 1924 flex-direction: row; 1925 align-items: center; 1926 justify-content: center; 1927 gap: 8px; 1928`,c=v.Ay.div` 1929 display: flex; 1930 flex-direction: row; 1931 gap: ${({gap:N})=>N}px; 1932 align-items: center; 1933 justify-content: center; 1934`;var s=t(379953);const P=({iconName:N,title:R,numericValue:k})=>e.createElement(o,null,e.createElement(r,null,k),e.createElement(c,{gap:10},e.createElement(s.A.Icon,{name:N}),e.createElement(s.A.TextName,null,R)));var O=t(22393),C=t(139351);const w=()=>{const{t:N}=(0,E._h)(),{activeSessionId:R,streamStatus:k}=(0,C.A)();return e.createElement(i,{direction:"row"},e.createElement(P,{iconName:"adminbarStreaming",title:N("ADMIN_LABEL_LIVE_STREAM"),numericValue:1}),e.createElement(u,null,e.createElement(h,null,N("ADMIN_LABEL_STATUS_COLON")),e.createElement(O.A,{activeSessionId:R,streamStatus:k})))};var T=t(835896),Y=t(545290);const ie={bottom:20,left:60,right:60,top:10},se=(0,v.Ay)(T.A)` 1935 ${({isVideoEmbed:N,isTheaterEmbed:R,isChannel:k})=>k&&!N&&!R?"padding-inline: var(--content-padding-inline, 16px); padding-bottom: 10px;":"padding-bottom: 0;"} 1936 background: ${({isChromaKeyModeActive:N})=>N?m.nuX:"transparent"}; 1937 width: 100%; 1938 height: 100%; 1939 ${(0,Y.nD)`padding: 0;`} 1940`,q=v.Ay.div.attrs(()=>({spacing:ie}))` 1941 display: flex; 1942 flex-direction: column; 1943 align-items: ${({alignment:N})=>N==="left"?"flex-start":N==="right"?"flex-end":"center"}; 1944 text-align: ${({alignment:N})=>N==="left"?"left":N==="right"?"right":"center"}; 1945 justify-content: center; 1946 position: relative; 1947 gap: 6px; 1948 ${Y.oA} 1949 ${(0,Y.nD)` 1950 padding: 10px 16px; 1951 `} 1952`,Z=v.Ay.div` 1953 display: flex; 1954 flex-direction: column; 1955 gap: ${({gap:N})=>N}px; 1956 width: 100%; 1957`;var te=t(502007),Ne=t(818339),fe=t.n(Ne),_e=t(154789);const Le=v.Ay.div` 1958 display: flex; 1959 flex-direction: column; 1960 width: 100%; 1961`,ct=v.Ay.div` 1962 display: grid; 1963 grid-template-columns: minmax(0, 4fr) max-content 1fr; 1964 align-items: center; 1965 padding: 10px 5px; 1966`,gt=v.Ay.div` 1967 display: flex; 1968 align-items: center; 1969 justify-content: ${({align:N})=>N==="center"?"space-between":N==="right"?"center":"flex-start"}; 1970 ${A.f7} 1971 color: ${m.zkP}; 1972`,Nt=v.Ay.div` 1973 display: flex; 1974 flex-direction: column; 1975 gap: 10px; 1976`,j=v.Ay.div` 1977 display: flex; 1978 flex-direction: column; 1979 gap: 4px; 1980 justify-content: center; 1981 align-items: flex-start; 1982 padding: 0 10px; 1983 height: 100%; 1984 width: fit-content; 1985`,H=v.Ay.div` 1986 ${A.f7} 1987 color: ${m.o0B}; 1988 white-space: nowrap; 1989`,J=v.Ay.div` 1990 ${A.f7} 1991 color: ${m.sRE}; 1992 font-size: 0.75rem; 1993 white-space: nowrap; 1994`,B=(0,v.Ay)(_e.Q8).attrs(N=>({color:(0,m.Qod)(N),spacing:"0 0 0 10px"}))` 1995 cursor: pointer; 1996 transition: opacity 0.2s; 1997 1998 &:hover { 1999 opacity: 0.8; 2000 } 2001`;var U=t(283722);const oe=(0,v.Ay)(s.A.Content)` 2002 align-items: center; 2003 gap: 12px; 2004 min-width: 0; 2005 padding-left: 10px; 2006 border-right: 1px solid ${m.dHK}; 2007 height: 100%; 2008 width: auto; 2009 overflow: visible; 2010`,Pe=(0,v.Ay)(s.A.TextContainer)` 2011 flex: 1; 2012 min-width: 0; 2013`,we=(0,v.Ay)(s.A.TextName)` 2014 ${A.f7} 2015 color: ${m.o0B}; 2016 overflow: hidden; 2017 text-overflow: ellipsis; 2018 white-space: nowrap; 2019 line-height: normal; 2020 letter-spacing: normal; 2021 padding-bottom: 0; 2022 min-width: 0; 2023 max-width: 100%; 2024`,Ee=(0,v.Ay)(s.A.TextDescription)` 2025 ${A.f7} 2026 color: ${m.sRE}; 2027 display: block; 2028`,pt=(0,v.Ay)(s.A.Actions)` 2029 gap: 8px; 2030 height: 100%; 2031 align-items: center; 2032 justify-content: center; 2033`,$=v.Ay.div` 2034 width: 80px; 2035 height: 45px; 2036 flex-shrink: 0; 2037 flex: 0 0 auto; 2038 border-radius: 4px; 2039 overflow: hidden; 2040 background-color: ${m.dsC}; 2041 ${({thumbnail:N})=>N?(0,v.AH)` 2042 background: url(${N}) center center / cover no-repeat; 2043 `:""} 2044 display: flex; 2045 align-items: center; 2046 justify-content: center; 2047 position: relative; 2048 text-align: center; 2049 z-index: 2; 2050`,K=(0,v.Ay)(_e.Ay)` 2051 display: flex; 2052 align-items: center; 2053 justify-content: center; 2054 gap: 8px; 2055 padding: 12px 24px; 2056 border-radius: 4px; 2057 border: 1px solid ${m.dmy}; 2058 background-color: transparent; 2059 color: ${m.o0B}; 2060 width: 100%; 2061 height: 40px; 2062 ${A.Jp} 2063 2064 &:hover { 2065 background-color: ${m.Qod}; 2066 } 2067`,G=(0,v.Ay)(U.Ay).attrs({name:"plus"})` 2068 width: 16px; 2069 height: 16px; 2070`,pe=v.Ay.div` 2071 ${A.f7} 2072 color: ${m.sRE}; 2073 display: flex; 2074 align-items: center; 2075 justify-content: center; 2076 width: 100%; 2077 height: 60px; 2078 padding-left: 6px; 2079 padding-right: 12px; 2080 border-radius: 4px; 2081 background-color: ${m.dsC}; 2082`;var re=t(224191),ge=t(191443),le=t(243888),ce=t(317605),ne=t(89649),Ke=t(711678),Ce=Object.defineProperty,Fe=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable,bt=(N,R,k)=>R in N?Ce(N,R,{enumerable:!0,configurable:!0,writable:!0,value:k}):N[R]=k,Ae=(N,R)=>{for(var k in R||(R={}
2082))Pt.call(R,k)&&bt(N,k,R[k]);if(rt)for(var k of rt(R))Vt.call(R,k)&&bt(N,k,R[k]);return N},Dt=(N,R)=>Fe(N,vt(R));const Yt=N=>[...N].sort((R,k)=>{if(!R.startTime)return 1;if(!k.startTime)return-1;const X=new Date(R.startTime).getTime(),ye=new Date(k.startTime).getTime();return X-ye}),Ie=1e5,he=(N,R,k)=>{const X=R.toString();return Dt(Ae({},N),{startTime:X,seriesStartTime:N.startTime,occurrenceStartTime:X,occurrenceTimestamp:R.getTime(),isRecurrenceInstance:k})},de=(N,R,k)=>{const X=[];for(const ye of N){if(!ye.startTime)continue;const me=new Date(ye.startTime);if(isNaN(me.getTime()))continue;if(ye.repeat!=="daily"&&ye.repeat!=="weekly"){const Rt=me.getTime();Rt>=R&&Rt<=k&&X.push(he(ye,me,!1));continue}const Je=ye.repeat==="weekly"?"week":"day",at=fe()(me);let De=0;const ut=fe()(R).diff(at,Je);for(ut>0&&at.add(ut,Je);at.valueOf()<R&&De<Ie;)at.add(1,Je),De++;for(;at.valueOf()<=k&&De<Ie;)X.push(he(ye,at.toDate(),!0)),at.add(1,Je),De++}return X},Te=(N,R)=>{const k={},X=ye=>{const me=new Date(ye);if(isNaN(me.getTime()))return;const Je=new Date(me.getFullYear(),me.getMonth(),me.getDate()).getTime();k[Je]=(k[Je]||0)+1};return R?(de(N,R.start,R.end).forEach(ye=>X(ye.occurrenceTimestamp)),k):(N.forEach(ye=>{if(!ye.startTime)return;const me=new Date(ye.startTime);isNaN(me.getTime())||X(me.getTime())}),k)},Se=(N,R)=>{const k=new Date(R.year,R.month,R.day,0,0,0,0).getTime(),X=new Date(R.year,R.month,R.day,23,59,59,999).getTime();return de(N,k,X)},Ue=(N,R)=>{if(N)return N;const k=new Date;return{startTime:new Date(R.year,R.month,R.day,k.getHours(),k.getMinutes(),k.getSeconds()).toString()}},be=N=>{if(N==null)return"";const R=Math.floor(N/3600),k=Math.floor(N%3600/60),X=Math.floor(N%60);return R>0?`${R}:${k.toString().padStart(2,"0")}:${X.toString().padStart(2,"0")}`:`${k}:${X.toString().padStart(2,"0")}`},Et=(N,R)=>{if(!N)return"";const k=R||Intl.DateTimeFormat().resolvedOptions().timeZone,X=fe()(N).tz(k);if(!X.isValid())return"";const ye=X.format("h:mm A"),me=X.format("z");return`${ye} (${me})`},yt=()=>{const N=e.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,[]);return{formatTime:e.useCallback(k=>Et(k,N),[N]),formatDuration:be,sortScheduleByStartTime:Yt,buildScheduledDatesMap:Te,filterScheduleByDate:Se,createScheduleItemForDate:Ue}};var Qt=t(359785);const It=({item:N,onEdit:R,onDelete:k})=>{var X,ye;const{t:me}=(0,E._h)(),Je=(0,re.useDispatch)(),at=N.kind==="video"?(X=N.video)==null?void 0:X._id:null,De=N.kind==="playlist"?(ye=N.playlist)==null?void 0:ye._id:null,{formatTime:ut,formatDuration:Rt}=yt(),{video:Tt,loaded:sn}=(0,le.A)(at||null),{playlist:fn,loaded:bn}=(0,ce.A)(De||null),An=e.useMemo(()=>N.kind==="video"&&Tt&&sn?{title:Tt.title||N.title,thumbnail:Tt.thumbnail||Qt.kD,duration:Tt.durationSeconds||N.duration}:N.kind==="playlist"&&fn&&bn?{title:fn.title||N.title,thumbnail:fn.thumbnail||Qt.kD,duration:N.duration}:{title:N.title,thumbnail:Qt.kD,duration:N.duration},[N,Tt,sn,fn,bn]),Kn=e.useCallback(yo=>{switch(yo){case"none":return me("ADMIN_SCHEDULED_CONTENT_REPEATING_X",{x:me("ONCE")});case"daily":return me("ADMIN_SCHEDULED_CONTENT_REPEATING_X",{x:me("DAILY")});case"weekly":return me("ADMIN_SCHEDULED_CONTENT_REPEATING_X",{x:me("WEEKLY")});default:return me("ADMIN_SCHEDULED_CONTENT_REPEATING_X",{x:yo})}},[me]),xn=e.useCallback(()=>{R(N)},[R,N]),ho=e.useCallback(()=>{Je((0,ne.to)({kind:Ke.V.adminConfirmation,data:{onConfirmClick:()=>{k(N),Je((0,ne.y_)("adminConfirmation"))},titleKey:"ADMIN_SCHEDULED_CONTENT_DELETE_CONFIRMATION_TITLE",subtitleKey:"ADMIN_LABEL_REMOVE_ENTITLEMENT_SUBTITLE_MODAL"}}))},[Je,k,N]);return e.createElement(ge.A,{thumbnail:An.thumbnail,title:An.title,durationFormatted:An.duration?Rt(An.duration):void 0,middleSlot:e.createElement(j,null,N.startTime&&e.createElement(H,null,ut(N.startTime)),e.createElement(J,null,Kn(N.repeat))),onEdit:xn,onRemove:ho})},At=({onDelete:N,onEdit:R,scheduledContent:k,selectedDate:X})=>{const{t:ye}=(0,E._h)(),[me,Je]=e.useState("asc"),at=e.useCallback(()=>{const Rt=new Date,Tt=new Date(X.year,X.month,X.day);return Rt.getDate()===Tt.getDate()&&Rt.getMonth()===Tt.getMonth()&&Rt.getFullYear()===Tt.getFullYear()?ye("ADMIN_LABEL_TODAYS_UPCOMING_EVENTS"):fe()(Tt).format("dddd, MMMM Do")},[X,ye]),De=e.useCallback(()=>{Je(Rt=>Rt==="asc"?"desc":"asc")},[]),ut=e.useMemo(()=>{const Rt=Date.now();return[...k.filter(fn=>{const bn=fn.startTime?new Date(fn.startTime).getTime():NaN;return isNaN(bn)?!1:bn+(fn.duration||0)*1e3>Rt})].sort((fn,bn)=>{const An=fn.startTime?new Date(fn.startTime).getTime():0,Kn=bn.startTime?new Date(bn.startTime).getTime():0;return me==="asc"?An-Kn:Kn-An})},[k,me]);return e.createElement(Le,null,e.createElement(ct,null,e.createElement(gt,{align:"left"},at()),e.createElement(gt,{align:"center"}
2082,ye("ADMIN_LABEL_SCHEDULE"),e.createElement(B,{onClick:De,up:me==="desc"})),e.createElement(gt,{align:"right"},ye("ADMIN_LABEL_ACTIONS"))),e.createElement(Nt,null,ut.length===0&&e.createElement(pe,null,ye("ADMIN_LABEL_NO_SCHEDULED_CONTENT")),ut.map((Rt,Tt)=>e.createElement(It,{key:Tt,item:Rt,onEdit:R,onDelete:N}))))};var xt=t(594661),qe=t(161781),Jt=Object.defineProperty,Q=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,ae=(N,R,k)=>R in N?Jt(N,R,{enumerable:!0,configurable:!0,writable:!0,value:k}):N[R]=k,Be=(N,R)=>{for(var k in R||(R={}))We.call(R,k)&&ae(N,k,R[k]);if(Q)for(var k of Q(R))_t.call(R,k)&&ae(N,k,R[k]);return N};const nt=({schedule:N=[],onChange:R})=>{const{t:k}=(0,E._h)(),[X,ye]=e.useState(()=>{const S=new Date;return{day:S.getDate(),month:S.getMonth(),year:S.getFullYear()}}),[me,Je]=e.useState(()=>{const S=new Date;return{month:S.getMonth(),year:S.getFullYear()}}),[at,De]=(0,xt.A)(!1),[ut,Rt]=e.useState(null),{buildScheduledDatesMap:Tt,filterScheduleByDate:sn,sortScheduleByStartTime:fn,createScheduleItemForDate:bn}=yt(),An=e.useMemo(()=>{const S=new Date(me.year,me.month-1,1);S.setDate(S.getDate()-7),S.setHours(0,0,0,0);const V=new Date(me.year,me.month+2,0);return V.setDate(V.getDate()+7),V.setHours(23,59,59,999),Tt(N,{start:S.getTime(),end:V.getTime()})},[N,me,Tt]),Kn=e.useMemo(()=>sn(N,X),[N,X]),xn=e.useMemo(()=>{if(ut)return Be(Be({},ut),bn(ut,X));const S=new Date(Date.now()+60*60*1e3);return{startTime:new Date(X.year,X.month,X.day,S.getHours(),S.getMinutes()).toString()}},[ut,X]),ho=e.useCallback(S=>{ye(S),Je({month:S.month,year:S.year})},[]),yo=e.useCallback(S=>{const V=new Date(S);Je({month:V.getMonth(),year:V.getFullYear()})},[]),Ln=e.useCallback(S=>{let V;ut?(V=N.map(z=>z.arrayId===ut.arrayId?Be(Be({},z),S):z),Rt(null)):V=[...N,S],R(fn(V)),De()},[N,R,De,ut,fn]),ma=e.useCallback(S=>{const V=Be({},S);delete V.seriesStartTime,delete V.occurrenceStartTime,delete V.occurrenceTimestamp,delete V.isRecurrenceInstance,Rt(V),De()},[De]),Xa=e.useCallback(()=>{Rt(null),De()},[De]),va=e.useCallback(S=>{R(N.filter(V=>V.arrayId!==S?.arrayId))},[N,R]);return e.createElement(i,{direction:"column",gap:20},e.createElement(P,{iconName:"calendar",title:k("ADMIN_LABEL_SCHEDULED_CONTENT"),numericValue:2}),e.createElement(Z,{gap:16},e.createElement(te.A,{selectedDate:X,onDateSelect:ho,onMonthChange:yo,markedDates:An,disablePastDates:!0})),e.createElement(At,{selectedDate:X,scheduledContent:Kn,onEdit:ma,onDelete:va}),e.createElement(K,{onClick:De},e.createElement(G,null),k("ADMIN_LABEL_SCHEDULE_CONTENT")),at&&e.createElement(qe.A,{initialItem:xn,itemType:"video",onAdd:Ln,onClose:Xa}))};var Ut=t(942662),Kt=t(13155);const ot=v.Ay.div` 2083 display: flex; 2084 flex-direction: column; 2085 gap: 24px; 2086 width: 100%; 2087`,Ye=v.Ay.span` 2088 ${A.Ns} 2089 color: ${m.o0B}; 2090`,Gt=v.Ay.div` 2091 display: flex; 2092 align-items: center; 2093 justify-content: center; 2094 width: 100%; 2095 flex-direction: row; 2096 gap: 4px; 2097`,Lt=v.Ay.div` 2098 display: flex; 2099 flex-direction: column; 2100 align-items: flex-start; 2101 justify-content: center; 2102 gap: 16px; 2103 width: 100%; 2104`,tn=v.Ay.div` 2105 display: flex; 2106 flex-direction: row; 2107 align-items: center; 2108 justify-content: center; 2109 width: 100%; 2110 padding: 2px 14px; 2111 border-radius: 5px; 2112 height: 40px; 2113 gap: 10px; 2114 background-color: ${m.dHK}; 2115 cursor: pointer; 2116 2117 ${({selected:N})=>N&&(0,v.AH)` 2118 background-color: ${m.kjY}; 2119 border: 1px solid ${m.Qod}; 2120 `}; 2121`,kt=(0,v.Ay)(U.Ay)` 2122 width: 18px; 2123 height: 18px; 2124`,jt=v.Ay.span` 2125 ${A.Z0} 2126 color: ${m.o0B}; 2127`,qn=(0,v.Ay)(Kt.Ay).attrs({height:310})` 2128 width: 100%; 2129`,hn=v.Ay.div` 2130 display: flex; 2131 flex-direction: column; 2132 align-items: center; 2133 justify-content: center; 2134 width: 100%; 2135 gap: 16px; 2136`,Oo=({offline:N,onChange:R,disabled:k})=>{const X=e.useCallback(me=>{R({mode:"image",image:me,kind:"video"})},[R]),ye=e.useCallback(()=>{R({mode:"image",image:"",kind:"video"})},[R]);return e.createElement(qn,{imagePreview:N.image,onClearImage:ye,onFileSubmit:X,disabled:k})};var Dn=t(925374),Bn=t(248494),Gn=t(784567),Mn=t(400781),Un=t(463702),so=t(393982),To=t(109751);const gn=(0,e.createContext)({}),ue=({children:N,item:R})=>{var k,X,ye,me,Je,at;const De=(0,e.useMemo)(()=>{var xn;return((xn=R?.data.offline)==null?void 0:xn.kind)||"video"},[(k=R?.data.offline)==null?void 0:k.kind]),ut=(0,e.useMemo)(()=>{var xn;return(xn=R?.data.offline)==null?void 0:xn.image},[(X=R?.data.offline)==null?void 0:X.image]),Rt=(0,e.useMemo)(()=>{var xn,ho;
2136return(ho=(xn=R?.data.offline)==null?void 0:xn.video)==null?void 0:ho._id},[(me=(ye=R?.data.offline)==null?void 0:ye.video)==null?void 0:me._id]),Tt=(0,e.useMemo)(()=>{var xn,ho;return(ho=(xn=R?.data.offline)==null?void 0:xn.playlist)==null?void 0:ho._id},[(at=(Je=R?.data.offline)==null?void 0:Je.playlist)==null?void 0:at._id]),{canIPlayResult:sn,playlist:fn,playNextPlaylistItem:bn,error:An}=Xe(Tt||Rt,De),Kn=(0,e.useMemo)(()=>({item:R,offlineImage:ut,offlinePlaylist:fn,offlinePlaylistPlayNext:bn,offlineVideo:sn?.video,offlineContentError:An}),[R,ut,fn,bn,sn?.video,An]);return e.createElement(gn.Provider,{value:Kn},N)},Re=()=>(0,e.useContext)(gn),Xe=(N,R)=>{const{t:k}=(0,E._h)(),X=(0,re.useSelector)(so.LD),ye=(0,re.useSelector)(Mn.x6),me=(0,re.useSelector)(Mn.Le),Je=(0,Un.H)(R==="playlist"?void 0:N,"video",X?{videoPageId:ye,slug:me}:void 0),{playlist:at,error:De}=(0,To.W9)(R==="playlist"?N??void 0:void 0),[ut,Rt]=(0,To.D6)(at),Tt=Je?.result==="UNAUTHORIZED"?k("ADMIN_LABEL_ERROR_FETCHING_CONTENT"):void 0,sn=ut?.result==="UNAUTHORIZED"?k("ADMIN_LABEL_ERROR_FETCHING_CONTENT"):void 0,fn=De?k("ADMIN_LABEL_ERROR_FETCHING_CONTENT"):void 0;return{error:Tt||fn||sn,canIPlayResult:ut??Je,playlist:at,playNextPlaylistItem:Rt}};var Zt=t(208312);const Ht=({offline:N,onChange:R})=>{var k;const{t:X}=(0,E._h)(),[ye,me]=(0,xt.A)(!1),{formatDuration:Je}=yt(),{offlineVideo:at,offlineContentError:De}=Re(),ut=e.useCallback(sn=>{sn._id&&(R({mode:"tv",video:{_id:sn._id},kind:"video"}),me())},[R,me]),Rt=e.useCallback(()=>{R({mode:"tv",video:void 0,kind:"video"})},[R]);return!((k=N.video)==null?void 0:k._id)||De?e.createElement(e.Fragment,null,e.createElement(hn,null,e.createElement(pe,null,De?e.createElement(Zt.A,{errorMessage:De}):e.createElement(e.Fragment,null,X("ADMIN_LABEL_NO_OFFLINE_CONTENT"))),e.createElement(K,{onClick:me},e.createElement(G,null),X("LABEL_ADD_VIDEO"))),ye&&e.createElement(Dn.VideoLibraryModalV2,{onClose:me,onSelectItem:ut,type:Bn.A.OFFLINE_CONTENT})):at?e.createElement(e.Fragment,null,e.createElement(ge.A,{thumbnail:at.thumbnail||Qt.kD,title:at.title,durationFormatted:at.durationSeconds?Je(at.durationSeconds):void 0,onEdit:me,onRemove:Rt}),ye&&e.createElement(Dn.VideoLibraryModalV2,{onClose:me,onSelectItem:ut,type:Bn.A.OFFLINE_CONTENT})):e.createElement(Gn.A,null)};var _n=t(258313);const eo=({offline:N,onChange:R})=>{var k;const{t:X}=(0,E._h)(),[ye,me]=(0,xt.A)(!1),{offlineVideo:Je,offlineContentError:at}=Re(),De=(k=N.playlist)==null?void 0:k._id,ut=e.useCallback(Tt=>{Tt._id&&(R({mode:"tv",playlist:{_id:Tt._id},kind:"playlist"}),me())},[R,me]),Rt=e.useCallback(()=>{R({mode:"tv",playlist:void 0,kind:"playlist"})},[R]);return!De||at?e.createElement(e.Fragment,null,e.createElement(hn,null,e.createElement(pe,null,at?e.createElement(Zt.A,{errorMessage:at}):e.createElement(e.Fragment,null,X("ADMIN_LABEL_NO_PLAYLIST_CONTENT"))),e.createElement(K,{onClick:me},e.createElement(G,null),X("LABEL_ADD_PLAYLIST"))),ye&&e.createElement(_n.A,{onClose:me,onSelectItem:ut})):Je?e.createElement(e.Fragment,null,e.createElement(ge.A,{thumbnail:Je.thumbnail||Qt.kD,title:Je.title,onEdit:me,onRemove:Rt}),ye&&e.createElement(_n.A,{onClose:me,onSelectItem:ut})):e.createElement(Gn.A,null)},pn=({offline:N,onChange:R})=>{const{t:k}=(0,E._h)(),[X,ye]=e.useState(N.mode==="image"?"image":N.kind),me=e.useCallback(De=>()=>{switch(ye(De),De){case"image":R({mode:"image",kind:"video"});break;case"video":R({mode:"tv",kind:"video"});break;case"playlist":R({mode:"tv",kind:"playlist"});break}},[R]),Je=e.useMemo(()=>[{Icon:Ut.Image,label:k("ADMIN_LABEL_IMAGE"),onClick:me("image"),value:"image"},{Icon:Ut.VideoCamera,label:k("ADMIN_LABEL_VIDEO"),onClick:me("video"),value:"video"},{Icon:Ut.Playlist,label:k("ADMIN_LABEL_PLAYLIST"),onClick:me("playlist"),value:"playlist"}],[me,k]),at=e.useCallback(()=>{switch(X){case"image":return e.createElement(Oo,{offline:N,onChange:R,disabled:X!=="image"});case"video":return e.createElement(Ht,{offline:N,onChange:R});case"playlist":return e.createElement(eo,{offline:N,onChange:R});default:return null}},[X,N,R]);return e.createElement(i,{direction:"column",gap:20},e.createElement(P,{iconName:"webcamSlash",title:k("ADMIN_LABEL_PAGE_OFFLINE"),numericValue:3}),e.createElement(ot,null,e.createElement(Lt,null,e.createElement(Ye,null,k("LABEL_CONTENT")),e.createElement(Gt,null,Je.map(De=>e.createElement(tn,{key:De.value,selected:X===De.value,onClick:De.onClick},e.createElement(De.Icon,{className:"size-[18px] text-[var(--admin-highlight-primary)]"}),e.createElement(jt,null,De.label))))),at()))},Wn={mode:"image",kind:"video"},Po=({item:N,onSettingsChange:R})=>{var k;const{t:X}=(0,E._h)(),{live:ye,offline:me=Wn}=N.data,Je=(k=ye?.schedule)!=null?k:[],at=ut=>{R("live.schedule")(ut)},De=ut=>{R("offline")(ut)};return e.createElement(a.wn,{gap:12},e.createElement(p,null,X("ADMIN_LABEL_CHANNEL_BLOCK_SETTINGS_DESCRIPTION")),e.createElement(w,null),e.createElement(nt,{schedule:Je,onChange:at}),e.createElement(pn,{offline:me??Wn,onChange:De}))};var no=t(365179);const Co=({anchorRect:N,item:R,handleCloseSettings:k,handleChange:X,isSettingsOpen:ye})=>{const me=(0,re.useSelector)(no.DyV),Je=(0,re.useSelector)(no.DS2);return e.createElement(n.A,{anchorPlacementOrder:N?["right","left","below","above"]:void 0,anchorRect:N,isOpen:ye,onClose:k,titleKey:"ADM
2136IN_LABEL_VIDEO_SETTINGS",width:Je?"528px":void 0,maxHeight:Je?"85vh":void 0,topOffset:Je?"50%":void 0},me&&e.createElement(I,{item:R,onSettingsChange:X}),Je&&e.createElement(Po,{item:R,onSettingsChange:X}))};var yn=t(669865),Yn=t(141220),oo=t(341476),Sn=t(557623),Bo=t(870349);const xo=v.Ay.div` 2137 width: 100%; 2138 display: flex; 2139 flex-direction: column; 2140 gap: 10px; 2141`,ao=v.Ay.h1.attrs({maxLines:2})` 2142 margin: 0; 2143 font-size: 24px; 2144 line-height: 24px; 2145 color: ${m.SP6}; 2146 font-family: ${m.qwO}; 2147 flex: 1; 2148 min-width: 0; 2149 2150 ${Y.FE} 2151`,Lo=v.Ay.div` 2152 display: grid; 2153 grid-template-columns: auto 1fr auto; 2154 align-items: center; 2155 gap: 10px; 2156 width: 100%; 2157 2158 &:empty { 2159 display: none; 2160 } 2161`,Io=v.Ay.div` 2162 grid-row: 1; 2163 grid-column: ${({alignment:N})=>N==="right"?3:N==="center"?"1 / -1":1}; 2164 justify-self: ${({alignment:N})=>N==="right"?"end":N==="center"?"center":"start"}; 2165 display: ${({alignment:N})=>N==="center"?"flex":"block"}; 2166 justify-content: center; 2167 text-align: ${({alignment:N})=>N==="center"?"center":"inherit"}; 2168`,uo=v.Ay.div` 2169 grid-row: 1; 2170 grid-column: ${({alignment:N})=>N==="right"?1:3}; 2171 justify-self: ${({alignment:N})=>N==="right"?"start":"end"}; 2172 z-index: 1; 2173 2174`,Uo=(0,v.Ay)(Bo.Ay).attrs(N=>({textColor:(0,m.SP6)(N)}))` 2175 border-radius: 100px; 2176 padding: auto 16px; 2177 height: 24px; 2178 background-color: ${m.ywe}; 2179 max-width: 90px; 2180 ${A.t} 2181 2182 display: flex; 2183 align-items: center; 2184 justify-content: center; 2185 gap: 8px; 2186 2187 &:hover { 2188 background: ${m.mrt}; 2189 } 2190 2191 ${(0,Y.nD)` 2192 color: ${m.XO2} !important; 2193 `} 2194`,Ko=(0,v.Ay)(U.Ay).attrs({name:"share"})` 2195 & svg { 2196 width: 16px; 2197 height: 16px; 2198 2199 & path { 2200 fill: ${m.UW1}; 2201 } 2202 } 2203`,Qn=v.Ay.div` 2204 display: flex; 2205 flex-wrap: wrap; 2206 align-items: center; 2207 column-gap: 12px; 2208 row-gap: 8px; 2209 width: 100%; 2210`,Mo=v.Ay.div` 2211 display: flex; 2212 flex-direction: column; 2213 justify-content: center; 2214 align-items: flex-start; 2215`,_o=(0,v.Ay)(s.A.Actions)` 2216 width: 100%; 2217 background: transparent; 2218 align-items: flex-end; 2219 justify-content: space-between; 2220`,oa=(0,v.Ay)(s.A.Content)` 2221 align-items: flex-end; 2222`,Qo=({showTitle:N,title:R})=>N?e.createElement(ao,{"data-testid":"-video-title"},R):null;var Jo=t(881285),aa=t(613568),ra=t(887944);const Wo=({footer:N,video:R,spot:k})=>{const{t:X}=(0,E._h)(),ye=(0,ra.mC)(R._id),[me,Je]=(0,aa.A)(ye,{copyMsg:"LABEL_SHARE_LINK"}),at=e.useCallback(ut=>{const Rt=R?.url;(0,ra.bU)("control",{id:R._id,kind:"share",spot:k,title:R.title},{kind:R.player,platform:ut,url:Rt})},[R,k]),De=e.useCallback(()=>{me(),at("web")},[me,at]);return N.showShare?e.createElement(uo,{alignment:N.alignment},e.createElement(Uo,{onClick:De,tooltipKey:Je},e.createElement(Ko,null),X("SHARE"))):null},sa=({footer:N,video:R,spot:k})=>{const X=e.useCallback(()=>{var ye,me;return N.alignment==="right"?e.createElement(Qn,{alignment:N.alignment},N.showViews&&e.createElement(Jo.A,{videoId:(ye=R._id)!=null?ye:""}),e.createElement(Qo,{title:R.title,showTitle:N.showTitle})):e.createElement(Qn,{alignment:N.alignment},e.createElement(Qo,{title:R.title,showTitle:N.showTitle}),N.showViews&&e.createElement(Jo.A,{videoId:(me=R._id)!=null?me:""}))},[N.alignment,N.showTitle,N.showViews,R._id,R.title]);return e.createElement(Lo,{alignment:N.alignment},e.createElement(Io,{alignment:N.alignment},X()),e.createElement(Wo,{footer:N,video:R,spot:k}))};var kn=t(718048),ya=t(221574);const Aa=2,la=({footer:N,description:R})=>{const{t:k}=(0,ya._h)(),{item:X}=Re(),ye=e.useCallback(()=>{X?.arrayId&&requestAnimationFrame(()=>{const me=document.querySelector(`[data-testid="video-block-${X.arrayId}"]`);me?.scrollIntoView({behavior:"smooth",block:"start"})})},[X?.arrayId]);return N.showDescription?e.createElement(kn.A,{text:R,maxLines:Aa,alignment:N.alignment,onCollapse:ye,expandText:k("SHOW_MORE_DOTS"),collapseText:k("SHOW_LESS"),"data-testid":"description-wrapper"}):null};var Xo=t(160788),Oa=t(734082);const No=({footer:N,video:R,spot:k})=>{var X,ye,me;return e.createElement(Mo,null,N.showTags&&e.createElement(Sn.A,{listTags:(X=R.tags)!=null?X:[]}),e.createElement(Z,{gap:10},e.createElement(Qo,{title:R.title,showTitle:N.showTitle}),e.createElement(_o,null,e.createElement(oa,null,N.showViews&&e.createElement(Jo.A,{videoId:(ye=R._id)!=null?ye:""})),e.createElement(Wo,{footer:N,video:R,spot:k})),e.createElement(la,{description:(me=R.description)!=null?me:"",footer:N})))},mn=({video:N,spot:R,footer:k})=>{var X,ye;
2222const me=(0,Xo.A)(Oa.VC);return k?me?e.createElement(No,{footer:k,video:N,spot:R}):e.createElement(xo,null,k.showTags&&e.createElement(Sn.A,{listTags:(X=N.tags)!=null?X:[]}),e.createElement(sa,{footer:k,video:N,spot:R}),e.createElement(la,{footer:k,description:(ye=N.description)!=null?ye:""})):null};var io=t(778925),mo=t(816970);const Pa=v.Ay.div` 2223 width: 100%; 2224 height: 100%; 2225 padding: 0; 2226 z-index: 1; 2227`,$o=v.Ay.div` 2228 position: relative; 2229 width: 100%; 2230 height: 100%; 2231`,Zo=(0,v.Ay)(io.N)` 2232 flex-grow: 1; 2233 ${(0,Y.PD)` 2234 ${({isVideoEmbed:N})=>N?"background: black;":"border-radius: 5px;"} 2235 overflow: hidden; 2236 min-height: 0; 2237 margin: ${mo.nr?0:"0 0 auto 0"} !important; 2238 `} 2239 ${(0,Y.nD)` 2240 position: absolute; 2241 top: 0; 2242 left: 0; 2243 width: 100%; 2244 margin: 0; 2245 `} 2246`,ia=v.Ay.div` 2247 position: relative; 2248 width: 100%; 2249 ${(0,Y.nD)`aspect-ratio: 16 / 9;`} 2250`;var La=t(106654),Ia=t(734630);const ko=({item:N})=>{const R=(0,re.useSelector)(no.iMf),X=(0,La.Qw)(R)||void 0,{canIPlayResult:ye}=Xe(X),me=ye?.video,Je=e.useMemo(()=>N?.data.footer,[N?.data.footer]);return(0,Yn.bE)(me?._id),me?(0,oo.UH)()?e.createElement(e.Fragment,null,e.createElement(ia,null,e.createElement(Zo,{isVideoEmbed:!1,video:me,scheduledVideoStartTime:null,spot:yn.KE.video,"data-testid":"video-page-video-player"})),e.createElement(q,{alignment:Je?.alignment||y.C1.Left},e.createElement(mn,{footer:Je,spot:yn.KE.video,video:me}))):e.createElement(e.Fragment,null,e.createElement(ia,null,e.createElement(Zo,{isVideoEmbed:!1,video:me,scheduledVideoStartTime:null,spot:yn.KE.video,"data-testid":"video-page-video-player"})),e.createElement(q,{alignment:Je?.alignment||y.C1.Left},e.createElement(mn,{footer:Je,spot:yn.KE.video,video:me}))):e.createElement(Ia.A,{type:"video","data-testid":"video-page-video-player-skeleton"})};var qo=t(272568),ca=t(199749),Ma=t(189934),_a=t(368909),Fa=t(64465),Ra=t(65072),da=t(907698),Sa=t(641998),ba=t(73782),Ka=t(223468),Wa=t(551321),ja=t(939925),ua=t(773671),Ha=t(729172);const wa=()=>{var N;const R=(0,re.useSelector)(ca.zV),k=(0,re.useSelector)(no.RWC),X=(0,re.useSelector)(qo.V0),ye=(0,re.useSelector)(qo.lX),me=(0,re.useSelector)(_a.VC),Je=(0,re.useSelector)(Fa.ME),at=(0,re.useSelector)(Ha.f7),{epgContent:De,activateNextAsset:ut,epgLoaded:Rt}=(0,Ma.M)(k),{offlineVideo:Tt,offlinePlaylistPlayNext:sn,offlinePlaylist:fn}=Re(),{t:bn}=(0,E._h)(),An=(0,ja.k)(),Kn=!!De?.live,xn=(N=De?.contentId)!=null?N:void 0,ho=De?.contentType,yo=(0,Ma.a)(De),{canIPlayResult:Ln}=Xe(xn,ho);(0,Yn.bE)(Tt?._id);const ma=Ln?.result==="UNAUTHORIZED"&&ho===ua.c.video&&!!xn,Xa=(0,e.useCallback)(()=>{xn&&An(xn)},[xn,An]);if(me&&Je)return e.createElement(Sa.P7,null);const va=X&&ye,S=Rt&&!Kn&&!X&&!ye&&!ma,V=(0,oo.UH)()?!Rt||Kn&&!Tt&&!ma:!va&&!S&&!ma&&(!Rt||!Ln?.video);return e.createElement($o,null,S&&e.createElement(e.Fragment,null,e.createElement(da.A,null),e.createElement(Ra.A,{video:Tt,onVideoEnd:sn,loop:fn===void 0})),va&&e.createElement(Zo,{isVideoEmbed:!1,streamPreviewMode:!0}),V&&e.createElement(Ia.A,{type:"video"}),ma&&e.createElement(Ka.A,{disabled:me,maxHeight:at},e.createElement(Wa.$,{type:"button",onClick:Xa,"data-testid":"channel-video-access-denied",variant:"ghost",className:"flex h-full w-full cursor-pointer items-center justify-center rounded-none bg-black p-6 text-left hover:bg-black"},e.createElement("div",{className:"max-w-md"},e.createElement(ba.A,{line1:bn("VIDEO_ACCESS_DENIED_LINE_1"),line2:bn("VIDEO_ACCESS_DENIED_LINE_2")})))),!va&&!S&&Ln?.video&&e.createElement(Zo,{scheduledVideoStartTime:yo?De.startTime:null,onVideoComplete:yo?ut:void 0,isVideoEmbed:R,video:Ln.video,spot:yn.KE.video}))};var Vo=t(346002);const Ga=({item:N})=>{const{offlinePlaylistPlayNext:R,offlinePlaylist:k,offlineVideo:X}=Re(),ye=(0,re.useSelector)(no.DS2),me=(0,re.useSelector)(Vo.Q);return ye?me?e.createElement(Ra.A,{video:X,onVideoEnd:R,loop:k===void 0}):e.createElement(wa,null):e.createElement(ko,{item:N})};var b=t(533028),_=Object.defineProperty,F=Object.defineProperties,Ge=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,He=(N,R,k)=>R in N?_(N,R,{enumerable:!0,configurable:!0,writable:!0,value:k}):N[R]=k,tt=(N,R)=>{for(var k in R||(R={}))$e.call(R,k)&&He(N,k,R[k]);if(xe)for(var k of xe(R))je.call(R,k)&&He(N,k,R[k]);return N},it=(N,R)=>F(N,Ge(R));const dt=({item:N,onEdit:R})=>{const k=e.useCallback(An=>{R(it(tt({},N),{data:An}))},[N,R]),{handleChange:X,handleCloseSettings:ye,handleOpenSettings:me,isSettingsOpen:Je}=(0,b.A)({item:N.data,onChange:k}),[at,De]=e.useState(void 0),ut=e.useCallback((An,Kn)=>{De(Kn),me()},[me]),Rt=e.useCallback(()=>{De(void 0),ye()},[ye]),Tt=(0,re.useSelector)(ca.zV),sn=(0,re.useSelector)(ca.jE),fn=(0,re.useSelector)(no.DS2),bn=(0,re.useSelector)(ca.Z2);return e.createElement(ue,{item:N},e.createElement(se,{testId:`video-block-${N.arrayId}
2250`,titleKey:"ADMIN_LABEL_VIDEO",onEdit:ut,isVideoEmbed:Tt,isTheaterEmbed:sn,isChannel:fn,isChromaKeyModeActive:bn},e.createElement(Ga,{item:N}),e.createElement(Co,{item:N,handleCloseSettings:Rt,handleChange:X,isSettingsOpen:Je,anchorRect:at})))}},325732:(ve,x,t)=>{t.d(x,{A:()=>Jt});var e=t(533028),n=t(63696),a=t(224191),d=t(368909),f=t(86138),E=t(34729),y=t(854870),l=t(532793),I=t(697683),v=t(463296),m=t(72688),A=t(488291),p=t(269010),h=t(41989),i=t(613166),r=t(196063),o=t(945201),u=t(886550),c=t(13155),s=t(407128);const g=u.Ay.div` 2251 display: flex; 2252 align-items: center; 2253 justify-content: space-between; 2254`,P=(0,u.Ay)(s.A)` 2255 margin-bottom: 16px; 2256`,O=u.Ay.section` 2257 display: flex; 2258 flex-direction: column; 2259`,C=(0,u.Ay)(c.Ay).attrs(()=>({canDrop:!0,dimensionRequirements:{pixelHeight:1080,pixelWidth:1920},height:177,padding:"0"}))``,W=(0,u.Ay)(c.Ay).attrs(()=>({canDrop:!0,dimensionRequirements:{pixelHeight:1200,pixelWidth:750},height:177,padding:"0"}))``,w=(0,h.gV)(Q=>(0,i.R)(()=>({inline:Q("ADMIN_VIDEO_SPOTLIGHT_IN_LINE"),videoPage:Q("ADMIN_VIDEO_SPOTLIGHT_VIDEO_PAGE")}))),T=(0,h.gV)(Q=>(0,i.R)(()=>[{label:w(Q).inline,value:"inline"},{label:w(Q).videoPage,value:"videoPage"}])),ie=({item:Q,isOpen:We,onClose:_t,onChange:ae})=>{const{t:Be}=(0,h._h)(),{isCustomColor:et}=(0,A.A)(Q.background.color),{handleChange:nt}=(0,e.A)({item:Q,onChange:ae}),Ut=n.useCallback(()=>{nt("background.image.desktop")("")},[nt]),Kt=n.useCallback(()=>{nt("background.image.mobile")("")},[nt]),ot=n.useCallback(Ye=>{const Gt=structuredClone(Q);Gt.background.color=Ye,et(Ye)&&(Gt.background.customColor=Ye),ae(Gt)},[Q,ae,et]);return n.createElement(r.A,{isOpen:We,onClose:_t,titleKey:"ADMIN_LABEL_VIDEO_SPOTLIGHT_SETTINGS"},n.createElement(E.wn,{gap:30},n.createElement(E.wn,{gap:16},n.createElement(f.A,{component:E._x,stringKey:"ADMIN_LABEL_DISPLAY"}),n.createElement(E.wn,{gap:15},n.createElement(v.S,{checked:Q.title.show,labelKey:"ADMIN_LABEL_TITLE",onCheckedChange:nt("title.show")}),n.createElement(v.S,{checked:Q.description.show,labelKey:"ADMIN_LABEL_DESCRIPTION",onCheckedChange:nt("description.show")}),n.createElement(v.S,{checked:Q.tags.show,labelKey:"ADMIN_LABEL_TAGS",onCheckedChange:nt("tags.show")}),n.createElement(v.S,{checked:Q.uploadDate.show,labelKey:"ADMIN_LABEL_UPLOAD_DATE",onCheckedChange:nt("uploadDate.show")})),n.createElement(o.A,{labelKey:"SPACING",onChange:nt("spacing"),padding:"0",value:Q.spacing})),n.createElement(E.wn,{gap:16},n.createElement(f.A,{component:E._x,stringKey:"ADMIN_LABEL_PLAYER_BEHAVIOR"}),n.createElement(p.Ay,{admin:!0,isSearchable:!1,onChange:nt("playerBehavior"),options:T(Be),padding:"0",value:{value:Q.playerBehavior,label:w(Be)[Q.playerBehavior]}})),n.createElement(E.wn,{gap:16},n.createElement(f.A,{component:E._x,stringKey:"ADMIN_LABEL_LAYOUT"}),n.createElement(y._I,{onChange:nt("layout"),options:l.iF,value:Q.layout,wrapText:!0})),n.createElement(E.wn,{gap:16},n.createElement(f.A,{component:E._x,stringKey:"ADMIN_LABEL_TEXT_ALIGNMENT"}),n.createElement(y._I,{onChange:nt("alignment"),options:l.Zq,value:Q.alignment})),n.createElement(E.wn,{gap:20},n.createElement(g,null,n.createElement(f.A,{component:E._x,stringKey:"ADMIN_SETTINGS_DESIGN_PAGE_BACKGROUND_IMAGE"}),n.createElement(I.A,{checked:Q.background.image.show,onChange:nt("background.image.show")})),Q.background.image.show&&n.createElement(n.Fragment,null,n.createElement(O,null,n.createElement(P,{labelKey:"ADMIN_LABEL_DESKTOP",padding:"0"}),n.createElement(C,{imagePreview:Q.background.image.desktop,onClearImage:Ut,onFileSubmit:nt("background.image.desktop")})),n.createElement(O,null,n.createElement(P,{labelKey:"ADMIN_LABEL_MOBILE",padding:"0"}),n.createElement(W,{imagePreview:Q.background.image.mobile,onClearImage:Kt,onFileSubmit:nt("background.image.mobile")}))),n.createElement(f.A,{component:E._x,stringKey:"ADMIN_LABEL_BACKGROUND_COLOR"}),n.createElement(m.A,{color:Q.background.color,lastCustomColor:Q.background.customColor,onChange:ot}))))};var se=t(925374),q=t(248494),Z=t(498685),te=t(272568),Ne=t(483561),fe=t(341476),_e=t(669865);const ct=({video:Q})=>n.createElement(Ne.j,{autoPlay:!(0,fe.UH)(),scheduledVideoStartTime:null,spot:_e.KE.videoSpotlight,video:Q,width:"100%"});var gt=t(927860),Nt=t(429195),j=t(152544),H=t(283722),J=t(156794),B=t(545290);const U=u.Ay.div` 2260 min-width: calc((100% - ${B.lV}) / 2); 2261 aspect-ratio: 16 / 9; 2262 ${(0,B.PD)` 2263 display: flex; 2264 justify-content: center; 2265 `}; 2266 2267 ${({isEditing:Q})=>Q&&(0,u.AH)`pointer-events: none;`} 2268 2269 & #video-overlay { 2270 width: 100%; 2271 } 2272`,oe=u.Ay.div` 2273 aspect-ratio: 16 / 9; 2274 border-radius: 10px; 2275 background-color: ${Nt.k6P}; 2276 width: 100%; 2277 display: flex; 2278 justify-content: center; 2279 align-items: center; 2280 flex-direction: column; 2281 column-gap: 10px; 2282 2283 ${j.z6} 2284 color: ${Nt.sRE}; 2285`,Pe=(0,u.Ay)(H.Ay)` 2286 & svg { 2287 width: 34px; 2288 height: 34px; 2289 2290 & path { 2291 fill: ${Nt.Yk7} 2292 } 2293 } 2294`,we=(0,u.Ay)(J.A)` 2295 width: 100%; 2296`,pt=({thumbnail:Q,videoId:We})=>n.createElement(we,{tag:We}
2296,n.createElement(gt.A,{renderPlayIcon:!0,src:Q})),K=({item:Q,arrayId:We,loaded:_t,video:ae})=>{const Be=(0,a.useSelector)(te.Q),et=!Q.videoId,nt=_t&&ae,Ut=n.useCallback(()=>et?n.createElement(oe,null,Be&&n.createElement(n.Fragment,null,n.createElement(Pe,{name:"addVideo"}),n.createElement(f.A,{stringKey:"ADMIN_LABEL_ADD_A_VIDEO"}))):nt?Q.playerBehavior==="inline"?n.createElement(ct,{arrayId:We,video:ae}):n.createElement(pt,{thumbnail:ae.thumbnail||"",videoId:Q.videoId}):null,[et,nt,Q.playerBehavior,ae,Be,We]);return n.createElement(U,{isEditing:Be},Ut())};var G=t(964746),pe=t(242689),re=t.n(pe),ge=t(946568),le=t(400781),ce=t(463302),ne=t(557623);const Ke=u.Ay.div` 2297 display: flex; 2298 flex-direction: column; 2299 justify-content: center; 2300 gap: 20px; 2301 min-width: calc((100% - ${B.lV}) / 2); 2302 text-align: ${({alignment:Q})=>Q}; 2303 padding: 20px 0; 2304`,Ce=u.Ay.h2` 2305 ${(0,B.PD)`${j.tY}`} 2306 ${(0,B.nD)`${j.ZD}`} 2307 margin: 0; 2308 color: ${Nt.SP6}; 2309`,Fe=u.Ay.h5` 2310 ${(0,B.PD)`${j.j_}`} 2311 ${(0,B.nD)`${j.QA}`} 2312 margin: 0; 2313 color: ${Nt.XO2}; 2314 ${B.FE}; 2315 white-space: pre-wrap; 2316`,vt=Q=>{switch(Q){case"right":return"flex-end";case"center":return"center";case"left":return"flex-start";default:return"unset"}},rt=(0,u.Ay)(ne.A)` 2317 justify-content: ${({alignment:Q})=>vt(Q)}; 2318`,Pt=u.Ay.span` 2319 ${(0,B.PD)`${j.p_}`} 2320 ${(0,B.nD)`${j.f7}`} 2321 color: ${Nt._A5}; 2322`;var Vt=t(559243);const Ae=({item:Q,video:We,loaded:_t})=>{const{endUserT:ae}=(0,h.T9)(),Be=(0,a.useSelector)(le.V2),et=(0,a.useSelector)(ce.mC),[nt,Ut]=n.useState(""),Kt=_t&&We,ot=!Q.videoId;n.useEffect(()=>{if(ot){Ut(Vt.fC);return}if(Kt){if(We.created&&We.player&&![G.PlayerTypes.youtube,G.PlayerTypes.twitch].includes(We.player)){Ut(re()(new Date(We.created)).fromNow());return}!Be||!et||!We.url||(0,ge.UQ)({primaryToken:et,siteId:Be,url:We.url}).then(kt=>{kt.publishedDate&&Ut(re()(new Date(kt.publishedDate)).fromNow())}).catch(()=>{We.created&&Ut(re()(new Date(We.created)).fromNow())})}},[ot,Kt,We,Be,et]);const Ye=(0,n.useCallback)(()=>{if(!Q.title.show)return null;let kt;return ot&&(kt=Vt.p3),Kt&&(kt=ae([h.Rq.videoTitle,{videoId:We._id}])||We.title),n.createElement(Ce,{"data-testid":"videoItemTitle"},kt)},[ot,Q.title.show,We?.title,Kt,ae]),Gt=(0,n.useCallback)(()=>{if(!Q.description.show)return null;let kt;ot&&(kt=Vt.h1),Kt&&(kt=ae([h.Rq.videoDescription,{videoId:We._id}])||We.description);const jt=(0,fe.UH)()?3:8;return n.createElement(Fe,{maxLines:jt},kt)},[ot,Q.description.show,We?.description,Kt,ae]),Lt=(0,n.useCallback)(()=>{if(!Q.tags.show||(0,fe.UH)())return null;let kt;return ot&&(kt=Vt.MQ),Kt&&(kt=(We.tags||[]).map(jt=>ae([h.Rq.videoTag,{tag:jt}])||jt)),n.createElement(rt,{alignment:Q.alignment,listTags:kt||[]})},[ot,Q.tags.show,Q.alignment,We?.tags,Kt,ae]),tn=(0,n.useCallback)(()=>!Q.uploadDate.show||(0,fe.UH)()?null:n.createElement(Pt,null,nt),[Q.uploadDate.show,nt]);return n.createElement(Ke,{alignment:Q.alignment},Ye(),Gt(),Lt(),tn())};var Dt=t(554457),Yt=t(835896);const Ie=Q=>{switch(Q){case"right":return"row-reverse";case"stacked":return"column";default:return"unset"}},he=(0,u.Ay)(Yt.A)` 2323 ${B.oA} 2324 position: relative; 2325 display: flex; 2326 background-color: ${({backgroundColor:Q})=>(0,Nt.v1G)(Q)}; 2327 justify-content: center; 2328`,de=(0,u.Ay)(Dt.A)` 2329 display: flex; 2330 width: 100%; 2331 ${(0,B.nD)` 2332 flex-direction: column; 2333 gap: 40px; 2334 `} 2335 ${(0,B.PD)` 2336 gap: ${B.lV}; 2337 flex-direction: ${({layout:Q})=>Ie(Q)}; 2338 ${({layout:Q})=>Q!=="stacked"&&"align-items: center;"} 2339 ${({layout:Q})=>Q==="stacked"&&"width: min-content; min-width: 50vw;"} 2340 ${({layout:Q,hasTextContent:We})=>!We&&Q==="stacked"&&"gap: 0;"} 2341 `}; 2342`,Te=(0,u.Ay)(J.A)` 2343 aspect-ratio: 16 / 9; 2344`,Se=u.Ay.img` 2345 width: 100%; 2346 height: 100%; 2347 position: absolute; 2348 top: 0; 2349 left: 0; 2350 object-fit: cover; 2351`;var Ue=t(807081),be=Object.defineProperty,Et=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,It=(Q,We,_t)=>We in Q?be(Q,We,{enumerable:!0,configurable:!0,writable:!0,value:_t}):Q[We]=_t,Bt=(Q,We)=>{for(var _t in We||(We={}))Qt.call(We,_t)&&It(Q,_t,We[_t]);if(yt)for(var _t of yt(We))Hn.call(We,_t)&&It(Q,_t,We[_t]);return Q},At=(Q,We)=>Et(Q,ze(We));const Jt=({item:Q,onEdit:We,onRemove:_t,onMoveDown:ae,onMoveUp:Be,index:et})=>{var nt,Ut;const Kt=(0,a.useSelector)(d.VC),ot=(0,a.useSelector)(te.Q),[Ye,Gt]=n.useState(!1),[Lt,tn]=(0,Z.Cg)("video",Q.data.videoId),kt=!Q.data.videoId;(0,Ue.A)({sectionId:`video-spotlight-${Q.arrayId}`,index:(et||0)+1});const jt=(nt=Q.canRemove)!=null?nt:!0,qn=(Ut=Q.canReorder)!=null?Ut:!0,hn=n.useCallback(gn=>{We(At(Bt({},Q),{data:gn}))},[Q,We]),{handleChange:Eo,handleCloseSettings:Oo,handleOpenSettings:Dn,isSettingsOpen:Bn}=(0,e.A)({item:Q.data,onChange:hn}),Gn=n.useMemo(()=>Kt&&Q.data.background.image.mobile?Q.data.background.image.mobile:!Kt&&Q.data.background.image.desktop?Q.data.background.image.desktop:null,[Kt,Q.data.background.image.mobile,Q.data.background.image.desktop]),Mn=n.useCallback(()=>{ot&&Gt(!0)},[ot]),Un=n.useCallback(()=>{Gt(!1)},[]),so=n.useCallback(gn=>{Eo("videoId")(gn._id),Un()},[Eo,Un]),To=n.useMemo(()=>Q.data.uploadDate.show||Q.data.title.show||Q.data.description.show||Q.data.tags.show,[Q.data.uploadDate.show,Q.data.title.show,Q.data.description.show,Q.data.tags.show]);return!kt&&tn&&!Lt||Lt?.archived?null:n.createElement(he,{backgroundColor:Q.data.background.color,spacing:Q.data.spacing,testId:`video-spotlight-${Q.arrayId}`,className:`video-spotlight-${Q.arrayId}`,titleKey:"LABEL_VIDEO_SPOTLIGHT",onEdit:Dn,onRemove:_t,onMoveDown:ae,onMoveUp:Be,canRemove:jt,canMoveUp:qn,canMoveDown:qn},Q.data.background.image.show&&Gn&&(tn||kt)&&n.createElement(Se,{loading:"lazy",src:Gn,alt:"Video Spotlight Backgroun
2351d Image"}),n.createElement(de,{isEditing:ot,hasTextContent:To,layout:Q.data.layout,borderStyle:"dashed",blockTitleKey:"ADMIN_LABEL_VIDEO",keepBorder:Bn,"data-testid":"video-spotlight-editor-modal",onClick:Mn},n.createElement(K,{item:Q.data,arrayId:Q.arrayId,loaded:tn,video:Lt}),n.createElement(Ae,{item:Q.data,loaded:tn,video:Lt})),Ye&&n.createElement(se.VideoLibraryModalV2,{onSelectItem:so,type:q.A.OFFLINE_CONTENT,onClose:Un,onDismiss:Un}),n.createElement(ie,{isOpen:Bn,onClose:Oo,item:Q.data,onChange:hn}))}},559243:(ve,x,t)=>{t.d(x,{MQ:()=>E,fC:()=>y,h1:()=>f,lU:()=>l,p3:()=>d});var e=t(532793),n=t(429195),a=t(545290);const d="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus quam ullamcorper facilisi tortor, leo gravida accumsan, nunc.",f="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Arcu, metus, et tortor massa sapien proin. At dignissim amet, ante urna tempus, vitae pellentesque nisi, sit. Justo malesuada nisi, phasellus orci dictumst nunc.",E=["loremipsum","loremipsum","loremipsum","loremipsum","loremipsum"],y="10 Days Ago",l=(I=!1)=>({videoId:"",tags:{show:!0},uploadDate:{show:!0},title:{show:!0},description:{show:!0},background:{color:"surface1",customColor:n.azv,image:{show:!1,mobile:"",desktop:""}},alignment:e.C1.Left,layout:"left",playerBehavior:"videoPage",spacing:(0,a.fn)(I)})},225499:(ve,x,t)=>{t.d(x,{n:()=>r});var e=t(63696),n=t(224191),a=t.n(n),d=t(515903),f=t(206334),E=t(669958),y=t(886550),l=t(545290),I=Object.defineProperty,v=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,p=(o,u,c)=>u in o?I(o,u,{enumerable:!0,configurable:!0,writable:!0,value:c}):o[u]=c,h=(o,u)=>{for(var c in u||(u={}))m.call(u,c)&&p(o,c,u[c]);if(v)for(var c of v(u))A.call(u,c)&&p(o,c,u[c]);return o};const i=y.Ay.div` 2352 width: 100%; 2353 height: 100%; 2354 position: absolute; 2355 top: 0; 2356 left: 0; 2357 ${(0,l.wc)` 2358 height: min(100%, 100dvh); 2359 `} 2360`,r=()=>{const o=(0,n.useSelector)(f.JI),u=(0,n.useSelector)(f.rb),c=(0,e.useMemo)(()=>o||u,[o,u]);return e.createElement(i,h({},{[E.y]:!0}),e.createElement(d.m,null),e.createElement(d.A,{overlay:c}))}},515903:(ve,x,t)=>{t.d(x,{A:()=>C,m:()=>w});var e=t(63696),n=t(941083),a=t(224191),d=t(206334),f=t(418816),E=t(186165),y=t(886550),l=t(545290),I=t(98174);const v=250,m=y.Ay.div` 2361 position: absolute; 2362 cursor: pointer; 2363 top: 0; 2364 right: 0; 2365 left: 0; 2366 bottom: 0; 2367 z-index: 1; 2368`,A=y.Ay.iframe.attrs(()=>({allowtransparency:!0}))` 2369 position: absolute; 2370 left: 0; 2371 right: 0; 2372 bottom: 0; 2373 top: 0; 2374 width: 100%; 2375 height: 100%; 2376 z-index: 1; 2377`,p=(0,y.i7)` 2378 from { 2379 opacity: 0; 2380 transform: translateX(-100%); 2381 } 2382 to { 2383 opacity: 1; 2384 transform: none; 2385 } 2386`,h=(0,y.i7)` 2387 from { 2388 opacity: 1; 2389 transform: none; 2390 } 2391 to { 2392 opacity: 0; 2393 transform: translateX(100%); 2394 } 2395`,i=y.Ay.div` 2396 ${({position:T})=>{if(T){const Y=(0,I.Z)(T);return(0,y.AH)` 2397 position: ${Y.position}; 2398 top: ${Y.top}; 2399 right: ${Y.right}; 2400 bottom: ${Y.bottom}; 2401 left: ${Y.left}; 2402 padding: ${Y.padding}; 2403 transform: ${Y.transform}; 2404 margin-left: ${Y.marginLeft}; 2405 margin-top: ${Y.marginTop}; 2406 `}return(0,y.AH)` 2407 position: absolute; 2408 left: 0; 2409 bottom: 0; 2410 `}} 2411 ${({showVideoControls:T})=>T?(0,y.AH)` 2412 margin-bottom: 55px; 2413 ${(0,l.nD)` 2414 margin-bottom: 2px; 2415 `} 2416 `:""}; 2417 ${({limitOverlayWidth:T})=>T?(0,y.AH)` 2418 margin: 0px 0px 55px 20px; 2419 max-width: 545px; 2420 min-width: 490px; 2421 width: 55%; 2422 ${(0,l.nD)` 2423 margin: 0 2px; 2424 width: 99%; 2425 min-width: auto; 2426 `} 2427 `:""}; 2428 ${({showVideoControlsMobile:T})=>T?(0,l.nD)` 2429 margin-bottom: 55px;`:""}; 2430 z-index: 2; 2431 &.entering { 2432 animation: ${p} ${v}ms ease-out; 2433 } 2434 &.exiting { 2435 animation: ${h} ${v}ms ease-in; 2436 opacity: 0; 2437 } 2438`,r=new Set(["poll","poll_results","trivia","lower_third","shopify"]),o=new Set(["poll","poll_results","trivia","shopify"]),u=new Set(["shopify"]),c=T=>r.has(T),s=T=>o.has(T),g=T=>u.has(T),P=T=>T?(0,E.zW)(T)?T.overlay.contents.kind:(0,E.k8)(T)?T.data.kind:(0,E.Ky)(T)?T.renderer.overlayType:"":"",O=T=>{if((0,E.zW)(T))return T.overlay.contents.position},C=({overlay:T})=>{const Y=(0,a.useSelector)(d.ZA);if(Y){const se=P(Y);return e.createElement(i,{"data-testid":"broadcast-overlay-wrapper",limitOverlayWidth:s(se),showVideoControls:c(se),showVideoControlsMobile:g(se)},e.createElement(f.A,{broadcastOverlay:Y,editing:!0}))}if(!T)return null;const ie=P(T.payload);return e.createElement(n.F,{component:null},e.createElement(n.eB,{key:T?.key||T?.broadcastId,timeout:v},se=>e.createElement(i,{className:se,limitOverlayWidth:s(ie),position:O(T.payload),showVideoControls:c(ie),showVideoControlsMobile:g(ie)},e.createElement(f.A,{broadcastOverlay:T,editing:!1}))))};var W=t(365179);const w=()=>{const T=(0,a.useSelector)(W.suJ);return T?e.createElement(A,{src:T}):null}},483561:(ve,x,t)=>{t.d(x,{j:()=>p});var e=t(63696),n=t(731694),a=t(68291),d=t(113194),f=t(990220),E=Object.defineProperty,y=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,v=(h,i,r)=>i in h?E(h,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):h[i]=r,m=(h,i)=>{for(var r in i||(i={}))l.call(i,r)&&v(h,r,i[r]);if(y)for(var r of y(i))I.call(i,r)&&v(h,r,i[r]);return h};const A=!0,p=h=>{const i=e.createElement(a.A,m({activeVideoElementId:n.st},h));return A?e.createElement(d.x$,{receiverApplicationId:f.gk},i):i}},274216:(ve,x,t)=>{t.d(x,{Eh:()=>r,I8:()=>o,UF:()=>i,Vl:()=>u,lh:()=>h,s:()=>A});var e=t(63696),n=t(731694),a=Object.defineProperty,d=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,y=(c,s,g)=>s in c?a(c,s,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[s]=g,l=(c,s)=>{for(var g in s||(s={}))f.call(s,g)&&y(c,g,s[g]);if(d)for(var g of d(s))E.call(s,g)&&y(c,g,s[g]);return c},I=(c,s)=>{var g={};for(var P in c)f.call(c,P)&&s.indexOf(P)<0&&(g[P]=c[P]);if(c!=null&&d)for(var P of d(c))s.indexOf(P)<0&&E.call(c,P)&&(g[P]=c[P]);return g};const v=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],m=()=>{const c={controls:null,onExit:null};return(s,g)=>(c.onExit=!1,g&&(c.onExit=!0),s&&(c.controls=s==="fullscreen"),c.onExit===!0&&(c.controls=!1),c.controls)},A=()=>{var c;const s=P=>{if(P instanceof HTMLVideoElement)return P;if(P.shadowRoot)for(const O of P.shadowRoot.children){const C=s(O);if(C)return C}for(const O of P.children){const C=s(O);if(C)return C}},g=document.getElementById(n.st);return g&&(c=s(g))!=null?c:null},p=m(),h=(c,s,g={})=>{var P=g,{navigationUI:O="hide"}=P,C=I(P,["navigationUI"]);const W={FullscreenRequest:document.getElementById(s),TheaterRequest:document.documentElement},w=c==="fullscreen"?W.FullscreenRequest:W.TheaterRequest,T=A();if(!w)return;const Y=l({navigationUI:O},C);w.requestFullscreen?w.requestFullscreen(Y):w.mozRequestFullScreen?w.mozRequestFullScreen(Y):w.webkitRequestFullscreen?w.webkitRequestFullscreen(Y):T?.webkitEnterFullscreen?T?.webkitEnterFullscreen():w.msRequestFullscreen&&w.msRequestFullscreen(Y),p(c)},i=()=>{const c=A();return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||c?.webkitSupportsFullscreen||document.mozFullScreenEnabled||document.msFullscreenEnabled)},r=c=>{document.fullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),p(c,"exitFullScreen")},o=()=>{const c=document;return(c.fullscreenElement||c.webkitFullscreenElement||c.mozFullScreenElement||c.msFullscreenElement||null)!==null},u=c=>(0,e.useEffect)(()=>(v.forEach(s=>{document.addEventListener(s,c,!1)}),()=>{v.forEach(s=>{document.removeEventListener(s,c)})}),[c])},557623:(ve,x,t)=>{t.d(x,{A:()=>o});
2438var e=t(63696),n=t(886550),a=t(312854),d=t(429195),f=t(545290),E=t(152544),y=Object.defineProperty,l=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,m=(u,c,s)=>c in u?y(u,c,{enumerable:!0,configurable:!0,writable:!0,value:s}):u[c]=s,A=(u,c)=>{for(var s in c||(c={}))I.call(c,s)&&m(u,s,c[s]);if(l)for(var s of l(c))v.call(c,s)&&m(u,s,c[s]);return u},p=(u,c)=>{var s={};for(var g in u)I.call(u,g)&&c.indexOf(g)<0&&(s[g]=u[g]);if(u!=null&&l)for(var g of l(u))c.indexOf(g)<0&&v.call(u,g)&&(s[g]=u[g]);return s};const h=n.Ay.ul` 2439 display: flex; 2440 list-style-type: none; 2441 flex-wrap: nowrap; 2442 gap: 5px; 2443 margin: 0px; 2444 ${f.wt} 2445 overflow: auto hidden; 2446`,i=n.Ay.li` 2447 padding: 2px 10px; 2448 height: 24px; 2449 ${E.f7} 2450 2451 border-radius: 5px; 2452 color: ${d.mrt}; 2453 background: ${u=>(0,a.B3)((0,d.mrt)(u),.1)}; 2454 white-space: nowrap; 2455 2456 display: flex; 2457 align-items: center; 2458 justify-content: center; 2459`,o=u=>{var c=u,{listTags:s}=c,g=p(c,["listTags"]);return s.length?e.createElement(h,A({},g),s.map((P,O)=>e.createElement(i,{key:`${P}-${O}`},"#",P))):null}},136856:(ve,x,t)=>{t.d(x,{A:()=>O});var e=t(63696),n=t(886550),a=t(224191),d=t(429195),f=t(545290),E=t(400781),y=t(887944),l=t(89006),I=t(86138),v=t(527899),m=t(365179),A=t(964746);const p=n.Ay.div` 2460 display: flex; 2461 align-items: center; 2462 margin-left: auto; 2463 & > div:not(:last-child) { 2464 margin-right: 5px; 2465 } 2466`,h=n.Ay.span` 2467 font-size: 14px; 2468 margin-right: 10px; 2469 color: ${d._A5}; 2470 font-size: 16px; 2471`,i=(0,n.Ay)(v.qY)` 2472 cursor: pointer; 2473`,o=({onShareTracking:C,referralUrl:W,playerType:w})=>{const T=(0,a.useSelector)(m.FDd),Y=(0,a.useSelector)(m.Cd_),ie=(0,e.useCallback)(()=>{C("facebook")},[C]),se=(0,e.useCallback)(()=>{C("twitter")},[C]);return!T&&!Y||[A.PlayerTypes.youtube,A.PlayerTypes.twitch].includes(w)?null:e.createElement(p,null,e.createElement(I.A,{component:h,stringKey:"SHARE"}),T&&e.createElement(l.uI,{beforeOnClick:ie,url:W},e.createElement(i,{name:"facebook",title:"facebook"})),Y&&e.createElement(l.r6,{beforeOnClick:se,url:W},e.createElement(i,{name:"twitter",title:"twitter"})))};var u=t(557623);const c=n.Ay.div` 2474 margin-top: 20px !important; 2475 width: 100%; 2476 align-self: center; 2477 padding-inline: 20px; 2478 ${(0,f.nD)` 2479 margin-top: 0px !important; 2480 padding-top: 10px; 2481 background: ${d.O49}; 2482 `} 2483`,s=n.Ay.h1.attrs({maxLines:2})` 2484 margin: 0; 2485 font-size: 24px; 2486 line-height: 24px; 2487 color: ${d.SP6}; 2488 font-family: ${d.qwO}; 2489 ${(0,f.nD)` 2490 font-size: 18px; 2491 `} 2492 ${f.FE} 2493`,g=n.Ay.div` 2494 display: flex; 2495 align-items: center; 2496 gap: 10px; 2497 ${(0,f.nD)` 2498 flex-wrap: wrap; 2499 padding 0 10px; 2500 & > * { 2501 width: 100%; 2502 } 2503 `}; 2504 2505 &:empty { 2506 display: none; 2507 } 2508`,O=({video:C,spot:W})=>{var w;const T=(w=C.tags)!=null?w:[],Y=(0,a.useSelector)(E.N5),ie=(0,y.mC)(C._id),se=(0,e.useCallback)(q=>{const Z=C?.url;(0,y.bU)("control",{id:C._id,kind:"share",spot:W,title:C.title},{kind:C.player,platform:q,url:Z})},[C,W]);return e.createElement(c,null,T.length!==0&&e.createElement(u.A,{listTags:T}),e.createElement(g,null,Y&&e.createElement(s,null,C.title),e.createElement(o,{onShareTracking:se,playerType:C.player,referralUrl:ie})))}},778925:(ve,x,t)=>{t.d(x,{N:()=>re,A:()=>ge});var e=t(558613),n=t(63696),a=t(224191),d=t(669865),f=t(545290),E=t(886550),y=t(429195),l=t(867907);const I=(0,E.Ay)(l.A)` 2509 width: 100%; 2510`,v=E.Ay.div` 2511 display: flex; 2512 flex-direction: column; 2513 height: fit-content; 2514 ${(0,f.wc)`height: 100%;`} 2515 2516 display: flex; 2517 align-items: center; 2518 2519 position: relative; 2520 margin-bottom: 0 !important; 2521`,m=E.Ay.div` 2522 display: flex; 2523 width: 100%; 2524 height: 100%; 2525 flex-flow: column nowrap; 2526 flex-grow: 1; 2527 position: relative; 2528 overflow: hidden; 2529 background: ${le=>le.isChromaKeyMode?y.nuX:"black"}; 2530 ${(0,f.PD)` 2531 border-radius: 5px; 2532 `} 2533 > * { 2534 flex-grow: 1; 2535 } 2536 iframe { 2537 display: block; 2538 } 2539 ${(0,f.nD)` 2540 overflow: visible; 2541 `}; 2542`,A=(0,E.i7)` 2543 from { 2544 opacity: 0; 2545 transform: translateX(-100%); 2546 } 2547 to { 2548 opacity: 1; 2549 transform: none; 2550 } 2551`,p=(0,E.i7)` 2552 from { 2553 opacity: 1; 2554 transform: none; 2555 } 2556 to { 2557 opacity: 0; 2558 transform: translateX(100%); 2559 } 2560`;var h=t(287483),i=t(368909),r=t(2496),o=t(365179),u=t(225499),c=t(483561),s=t(734082),g=t(362688),P=t.n(g),O=t(848452),C=t(887944),W=t(89649),w=t(498685),T=t(860954),Y=t(283722),ie=t(143213),se=t(41989),q=t(774344),Z=t(312854);const te="64px",Ne=E.Ay.div` 2561 display: flex; 2562 flex-flow: column nowrap; 2563 align-items: center; 2564 justify-content: center; 2565 position: relative; 2566 z-index: 2; 2567 background-color: rgba(0, 0, 0, 0.8); 2568 padding: 20px; 2569 position: absolute; 2570 width: 100%; 2571`,fe=E.Ay.div` 2572 cursor: pointer; 2573 display: flex; 2574 flex-direction: row; 2575 justify-content: center; 2576 overflow: hidden; 2577 min-height: ${te}; 2578 align-items: center; 2579 border: 1px solid rgba(255, 255, 255, 0.2); 2580`,_e=E.Ay.div` 2581 display: flex; 2582 justify-content: center; 2583 flex-direction: column; 2584 padding: 8px; 2585 width: 190px; 2586 height: ${te}; 2587 border-left: 1px solid rgba(255, 255, 255, 0.2); 2588`,Le=E.Ay.div` 2589 display: flex; 2590 justify-content: flex-start; 2591 align-items: flex-start; 2592`,ct=(0,E.Ay)(Y.Ay).attrs(le=>({color:(0,y.SP6)(le),name:"bell"}))`
2593 width: 20px; 2594 height: 20px; 2595 align-items: center; 2596 display: flex; 2597 margin-right: 8px; 2598 padding: 5px; 2599 justify-content: center; 2600 background-color: rgba(255,255,255,0.2);; 2601 fill: white; 2602 cursor: pointer; 2603`,gt=(0,E.Ay)(q.A)` 2604 ${f.f3} 2605 text-align:center; 2606`,Nt=(0,E.Ay)(q.A)` 2607 ${f.Q} 2608 display: flex; 2609 align-item: center; 2610 justify-content: center; 2611 text-align:center; 2612`,j=E.Ay.div` 2613 color: white; 2614 min-width: 50px; 2615 height: ${te}; 2616 display: flex; 2617 ${f.f3} 2618 justify-content: center; 2619 align-items: center; 2620 text-align: center; 2621 text-transform: uppercase; 2622 flex-direction: column; 2623 padding: 10px; 2624 border: 1px solid ${le=>(0,Z.B3)((0,y.SP6)(le),.2)}; 2625 border-right: none; 2626`,H=E.Ay.div` 2627 ${f.Q} 2628 color: white; 2629 display: flex; 2630 min-width: 22px; 2631`,J=E.Ay.div` 2632 opacity: .6; 2633 flex-shrink: 0; 2634 padding: 0 5px; 2635`,B=E.Ay.div` 2636 ${f._i} 2637 text-align: center; 2638 width: 50%; 2639 margin-bottom: 16px; 2640 text-transform: uppercase; 2641 color: white; 2642`,U=(0,E.Ay)(Y.Ay).attrs({name:"cancel-thin"})` 2643 color: ${y.SP6}; 2644 position: absolute; 2645 right: 8px; 2646 top: 8px; 2647`,oe=le=>{const ce=new Date(le),ne=ce.getHours()%12||12,Ke=ce.getHours()<12?"AM":"PM",Ce=ce.getMinutes().toString().padStart(2,"0");return`${ne}:${Ce} ${Ke}`},Pe=({className:le,onCancelClick:ce})=>{const{startTime:ne,title:Ke}=(0,w.d4)(o.oMq),[Ce,Fe]=(0,n.useState)(!0),vt=(0,w.d4)(o.TXH),rt=(0,w.wA)(),Pt=Yt=>rt((0,W.to)({data:Yt,kind:"addToCalendar"})),Vt=Yt=>rt((0,C.R4)("engage",Yt,{})),bt=(0,w.d4)(T.Bq)||window.location.href,{t:Ae}=(0,se._h)(),Dt=(0,n.useCallback)(()=>{Pt({description:Ae("ADMIN_OVERLAY_COUNTDOWN_AT_X",{x:bt}),endTime:oe(Date.parse(ne)+1e3*60*60),engagementTrackingAction:(0,C.R4)("engaged",{kind:"countdown",title:Ke},{action:"add to calendar"}),location:bt,startTime:ne,title:Ke}),Vt({kind:"countdown",title:Ke})},[bt,Pt,Vt,Ke,ne]);return!(0,ie.WP)(ne,vt)||!Ce?null:n.createElement(Ne,null,n.createElement(O.A,{doc:{kind:"countdown",title:Ke},kingdom:"header",visible:!0}),n.createElement(U,{onClick:ce}),n.createElement(B,null,Ke),n.createElement(fe,{className:le,onClick:()=>Dt({href:bt,message:Ke,onAddToCalendar:Pt,onEngage:Vt,startTime:ne})},n.createElement(j,null,n.createElement(gt,{show:"month",timestamp:new Date(ne)}),n.createElement(Nt,{show:"day",timestamp:new Date(ne)})),n.createElement(_e,null,n.createElement(ie.sN,{className:le,rerenderCallback:Fe,serverOffset:vt,startTime:ne}))))};Pe.propTypes={className:P().string,onCancelClick:P().func.isRequired},Pe.defaultProps={className:""};const we=Pe;var Ee=t(42012),pt=t(754280);const $=()=>{const[le,ce]=(0,n.useState)(!1),ne=(0,a.useSelector)(s.VC),Ke=(0,a.useSelector)(o.DyV),Ce=(0,a.useSelector)(Ee.hE),Fe=(0,a.useSelector)(Ee.$Z),vt=(0,n.useCallback)(()=>ce(!0),[]),rt=(0,pt.$x)(Ce),Pt=!!(Fe&&(Fe.v||Fe.p));return ne&&!le&&!!!(Ke||rt||Pt)?n.createElement(we,{onCancelClick:vt}):null};var K=t(940457);const G=250,pe=le=>{var ce;const ne=(0,a.useDispatch)(),Ke=(0,a.useSelector)(h.Z2),Ce=(0,a.useSelector)(o.S5i),Fe=(0,a.useSelector)(i.VC),vt=(0,a.useSelector)(o.J5o),[rt,Pt]=(0,r.A)();(0,n.useEffect)(()=>(ne((0,d.nO)(Pt)),()=>{ne((0,d.nO)({width:0,height:0}))}),[Pt]);const Vt=Fe&&Ce,bt=le.streamPreviewMode?void 0:le.video,Ae=bt?.player==="youtube"?vt:!0;return n.createElement(v,{hidden:Vt},n.createElement(I,null,n.createElement(m,{ref:rt,"data-content-id":(ce=bt?._id)!=null?ce:"stream-preview-player-wrapper",isChromaKeyMode:Ke,className:le.className},le.streamPreviewMode?n.createElement(K.A,null):n.createElement(n.Fragment,null,n.createElement($,null),n.createElement(u.n,null),n.createElement(c.j,{autoPlay:Ae,width:String(Pt.width),video:le.video,scheduledVideoStartTime:le.scheduledVideoStartTime,spot:le.spot,onVideoComplete:le.onVideoComplete,loop:le.loop})))))},re=(0,e.A)()(pe),ge=re},366188:(ve,x,t)=>{t.d(x,{Ay:()=>v,B4:()=>m,Kt:()=>A,eA:()=>l});var e=t(63696),n=Object.defineProperty,a=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,E=(p,h,i)=>h in p?n(p,h,{enumerable:!0,configurable:!0,writable:!0,value:i}):p[h]=i,y=(p,h)=>{for(var i in h||(h={}
2647))d.call(h,i)&&E(p,i,h[i]);if(a)for(var i of a(h))f.call(h,i)&&E(p,i,h[i]);return p};const l={label:"off",value:-1},I=(0,e.createContext)(null),v=I.Provider,m=()=>(0,e.useContext)(I),A=(p=300)=>{const{playerState:{highFrequencyPlaybackState:h}}=m(),[i,r]=(0,e.useState)(h.current);return(0,e.useEffect)(()=>{const o=()=>{const c=h.current;r(y({},c))};o();const u=setInterval(o,p);return()=>{clearInterval(u)}},[p]),i}},68291:(ve,x,t)=>{t.d(x,{A:()=>sr});var e=t(63696),n=t(964746),a=t(816970),d=t(670788),f=t.n(d),E=t(558613),y=t(783969),l=t(86138),I=t(252992),v=t(341476),m=t(323929),A=t(41989),p=t(886550),h=t(870349),i=t(429195),r=t(545290),o=t(985406);const u=(0,p.Ay)(h.K0).attrs(D=>({admin:!0,background:i._e_,hoverBackground:i.azv,hoverTextColor:i._e_,radius:"33px",textColor:i.azv}))` 2648 cursor: pointer; 2649 ${r.j7} 2650 font-size: 16px; 2651 line-height: 0; 2652 padding: 9px; 2653 & svg { 2654 margin-left: 2px; 2655 width: 33px; 2656 height: 33px; 2657 } 2658 2659 ${(0,v.UH)()&&o.X_} 2660`;var c=Object.defineProperty,s=Object.defineProperties,g=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,W=(D,M,L)=>M in D?c(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,w=(D,M)=>{for(var L in M||(M={}))O.call(M,L)&&W(D,L,M[L]);if(P)for(var L of P(M))C.call(M,L)&&W(D,L,M[L]);return D},T=(D,M)=>s(D,g(M));function Y({className:D="",isPlaying:M,togglePlay:L}){const{handleKeyPress:ee}=(0,m.L)(),{t:Qe}=(0,A._h)(),Me=`ADMIN_LABEL_${M?"PAUSE":"PLAY"}`;return e.createElement(u,T(w({"aria-label":Qe(Me),className:`${D} ${I.iJ} focusable`,role:"button","data-testid":"video-play-pause-button",onClick:L,onKeyDown:ee(v.zw.OK,L)},(0,v.xX)()),{name:M?"pause":"playLarge",tooltipAlign:"right",tooltipKey:Me,useAbsolutePosition:!0}))}var ie=t(274216);const se=(0,p.Ay)(h.WC).attrs(D=>({admin:!0,textColor:i._e_,hoverBackground:i._e_,hoverTextColor:i.azv}))` 2661 padding: 5px; 2662 & svg { 2663 width: 19px !important; 2664 height: 13px !important; 2665 } 2666`;function q({className:D="",isFullscreen:M,isMobileLayout:L,toggleFullscreen:ee}){const Qe=(0,e.useMemo)(()=>`${D} ${I.DM}`,[D]);return(0,ie.UF)()?e.createElement(se,{className:Qe,name:M?"exitFullscreen":"fullscreen",onClick:ee,tooltipAlign:"left",tooltipKey:M?"ACTION_DISABLE_FULLSCREEN":"ACTION_FULLSCREEN",tooltipPosition:L?"bottom":"top",useAbsolutePosition:!0}):null}function Z({className:D="",isFull:M,isFullscreen:L,isMobileLayout:ee,setViewMode:Qe,theaterModeActive:Me,trackVideo:wt,video:Ot,videoKind:Wt=n.PlayerTypes.file,videoTitle:en="",spot:Ft}){const Oe=(0,e.useMemo)(()=>`${D} ${I.d5}`,[D]),Mt=(0,e.useMemo)(()=>M&&Me,[M,Me]),$n=()=>{const wn=Ot._id,an=Ot?.url||"";if(wt("control",{id:wn,kind:"fullscreen",spot:Ft,title:en},{action:Mt?"disable":"enable",kind:Wt,url:an}),Qe(Mt?null:"theater"),!Mt){(0,ie.lh)("theater",wn||"");return}(0,ie.Eh)("theater")};return!(0,ie.UF)()||ee||L?null:e.createElement(h.WC,{admin:!0,className:Oe,hoverBackground:i._e_,hoverTextColor:i.azv,name:"theater",onClick:$n,textColor:i._e_,tooltipAlign:"left",tooltipKey:Mt?"ACTION_DISABLE_THEATER_MODE":"ACTION_THEATER_MODE",useAbsolutePosition:!0})}var te=t(431414),Ne=t(376223),fe=t(366188),_e=t(152544);const Le=p.Ay.span` 2667 &:after { 2668 content: "/"; 2669 } 2670 padding: 0 5px; 2671`,ct=p.Ay.div` 2672 ${_e.Z0} 2673 color: ${i.SP6}; 2674 line-height: 15px; 2675 display: flex; 2676 padding: 0 10px; 2677 align-items: center; 2678`;function gt({className:D,videoDuration:M}){const{playedSeconds:L}=(0,fe.Kt)();return e.createElement(ct,{className:D},e.createElement(Ne.A,{seconds:L}),e.createElement(Le,null),e.createElement(Ne.A,{seconds:M}))}const Nt=p.Ay.div.attrs({innerBackground:"linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #0E0F11 100%)",innerBackgroundHeight:"100px"})` 2679 position: absolute; 2680 bottom: 0; 2681 display: flex; 2682 align-items: flex-end; 2683 width: 100%; 2684 z-index: 2; 2685 ${r.yY} 2686`,j=p.Ay.div` 2687 display: flex; 2688 flex-direction: column; 2689 justify-content: center; 2690 padding: 10px 20px; 2691 width: 100%; 2692 ${({isLandscape:D})=>(0,r.nD)` 2693 padding: ${D?"20px 40px":"20px"}; 2694 `}; 2695`,H=(0,p.Ay)(gt)` 2696 color: ${i._e_}; 2697 ${(0,r.nD)` 2698 margin-bottom: 9px; 2699 `} 2700`,J=(0,p.Ay)(te.A).attrs(()=>
2700({progressColor:i._e_,trackBackground:i.azv}))``,B=p.Ay.div` 2701 flex: 1 !important; 2702 pointer-events: none !important; 2703 & ~ * { 2704 margin-left: 5px; 2705 } 2706`,U=p.Ay.div` 2707 display: flex; 2708`,oe=p.Ay.div.attrs({innerBackground:"linear-gradient(180deg, #0E0F11 0%, rgba(0, 0, 0, 0) 100%)",innerBackgroundHeight:"100px"})` 2709 position: absolute; 2710 display: flex; 2711 align-items: center; 2712 width: 100%; 2713 top: 0; 2714 left: 0; 2715 z-index: 3; 2716 pointer-events: none; 2717 &:after { 2718 align-self: flex-start; 2719 } 2720 & > * { 2721 pointer-events: all; 2722 ${({isLandscape:D,showControls:M})=>(0,p.AH)` 2723 margin-top: ${D?30:10}px; 2724 &:first-child { 2725 margin-left: ${D?35:15}px; 2726 } 2727 &:last-child { 2728 margin-right: ${D?35:15}px; 2729 } 2730 ${!M&&"pointer-events: none;"} 2731 `} 2732 } 2733 ${r.yY} 2734`,Pe=p.Ay.div` 2735 ${(0,r.PD)` 2736 padding-left: 43px; 2737 `} 2738`,we=p.Ay.div` 2739 display: flex; 2740 align-items: center; 2741 flex: 1; 2742 ${({isLandscape:D})=>(0,p.AH)` 2743 ${(0,r.nD)` 2744 max-height: 10px; 2745 min-width: 100%; 2746 align-items: flex-end; 2747 & ${J} { 2748 min-width: 100%; 2749 & + div { 2750 margin-bottom: -5px; 2751 ${D&&` 2752 margin-bottom: 24px; 2753 margin-left: -20px; 2754 `} 2755 } 2756 } 2757 `} 2758 `} 2759`;function Ee({isLive:D,isMobileLayout:M,isPlaying:L,seekTo:ee,videoDuration:Qe}){const[Me,wt]=(0,e.useState)(!1),[Ot,Wt]=(0,e.useState)(!1),[en,Ft]=(0,e.useState)(0),Oe=Math.ceil(Qe||0),{loadedSeconds:Mt,playedSeconds:$n}=(0,fe.Kt)(),wn=Math.ceil(Mt),an=fo=>{ee(fo),wt(!1)},Vn=()=>{wt(!0),Wt(!1)};return(0,e.useEffect)(()=>{Me||Wt(!0)},[$n]),D?null:e.createElement(J,{max:Oe,onAfterChange:an,onBeforeChange:Vn,onChange:Ft,secondaryValue:wn,showThumb:M||!L,value:Ot?$n:en})}var pt=t(846177),$=t.n(pt),K=t(283722),G=t(942695);const pe=(0,G.A)((0,p.Ay)(K.Ay).attrs(()=>({color:i._e_}))` 2760 ${r.Hr} 2761 cursor: pointer; 2762 & svg { 2763 width: 19px; 2764 height: 16px; 2765 } 2766`,{admin:!0}),re=p.Ay.div` 2767 display: flex; 2768 align-items: center; 2769 overflow: hidden; 2770`,ge=p.Ay.div` 2771 display: flex; 2772 align-items: center; 2773 ${({hovering:D,isMobile:M,vertical:L})=>{const ee=L?"height":"width",Qe=L?"width":"height";return(0,p.AH)` 2774 ${L&&"flex-direction: column-reverse;"} 2775 & ${re} { 2776 transition: 0.5s ${ee}, 0.5s max-${ee}; 2777 min-${Qe}: max-content; 2778 ${ee}: 0; 2779 max-${ee}: 0px; 2780 ${Qe}: 19px; 2781 padding-${L?"bottom":"left"}: ${M?15:5}px; 2782 ${L&&` 2783 flex-direction: column; 2784 justify-content: flex-end; 2785 `} 2786 } 2787 ${D?` 2788 & ${re} { 2789 ${ee}: 75px; 2790 max-${ee}: 75px; 2791 ${M&&` 2792 ${ee}: 115px; 2793 max-${ee}: 115px; 2794 `} 2795 } 2796 `:` 2797 & ${re} { 2798 & > div > div:after { 2799 display: none !important; 2800 } 2801 } 2802 `} 2803 `}} 2804`,le=new Set(["iframe_video","livestream_new"]);function ce({className:D,changeVolume:M,isLandscape:L,isMobileLayout:ee,isPlaying:Qe,muted:Me=!1,toggleMute:wt,videoKind:Ot=n.PlayerTypes.file,vertical:Wt,volume:en}){const Ft=(0,e.useMemo)(()=>Me?0:en,[Me,en]),[Oe,Mt]=(0,e.useState)(!1),$n=(0,e.useCallback)($()(()=>{Mt(!1)},3e3),[Mt]),wn=()=>{Mt(!0),$n()},an=()=>{Mt(!1)},Vn=(0,e.useMemo)(()=>!en||Me?"volumeMuted":en<.5?"volumeLow":"volumeHigh",[en,Me]),fo=()=>{if(ee){Oe?an():wn();return}wt()},po=Ro=>{wn(),M(Ro)};return le.has(Ot)?null:e.createElement(ge,{hovering:Oe,isMobile:ee,landscape:ee&&L,onMouseEnter:wn,onMouseLeave:an,vertical:Wt},e.createElement(pe,{admin:!0,name:Vn,onClick:fo,tooltipAlign:ee?"left":"right",tooltipKey:`ADMIN_LABEL_${Me?"UNMUTE":"MUTE"}`,useAbsolutePosition:!0,vertical:Wt}),e.createElement(re,null,e.createElement(te.A,{className:D,decreaseKey:"ArrowDown",fixedLength:!0,increaseKey:"ArrowUp",max:1,navigationStep:.1,onChange:po,progressColor:i._e_,showThumb:ee||!Qe,sliderLength:ee&&L?"95px":ee?"90px":"60px",trackBackground:i.azv,value:Ft,vertical:Wt})))}var ne=t(204388);function Ke({adActive:D,isMobileLayout:M,airplayIsConnected:L,onPlaybackUpdate:ee,setAirplayIsConnected:Qe,videoUrl:Me}){const{t:wt}=(0,A._h)(),[Ot,Wt]=(0,e.useState)(ne.Sb),[en,Ft]=(0,e.useState)(null),[Oe,Mt]=(0,e.useState)(!0),$n=(0,e.useCallback)($()(()=>{ee({playing:!0})},3e3),[]),wn=()=>{var an;(an=en?.webkitShowPlaybackTargetPicker)==null||an.call(en)};return(0,e.useEffect)(()=>
2804{if(!Oe||L)return $n(),$n.cancel;Mt(!1)},[L]),(0,e.useEffect)(()=>{const an=(0,ie.s)();if(Ft(an),an&&ne.Sb)return an.webkitCurrentPlaybackTargetIsWireless!==L&&Qe(an.webkitCurrentPlaybackTargetIsWireless),an.onwebkitplaybacktargetavailabilitychanged=({availability:Vn})=>{switch(Vn){case"available":Wt(!0);return;case"not-available":Wt(!1);return;default:return}},an.onwebkitcurrentplaybacktargetiswirelesschanged=()=>{Qe(an.webkitCurrentPlaybackTargetIsWireless)},()=>{an.onwebkitplaybacktargetavailabilitychanged=void 0,an.onwebkitcurrentplaybacktargetiswirelesschanged=void 0}},[Me]),(0,e.useEffect)(()=>{L&&Wt(!0)},[L]),(0,e.useEffect)(()=>{const an=setInterval(()=>{const Vn=(0,ie.s)();if(Vn&&!L&&Ot){const fo=Vn.playbackRate;Vn.playbackRate=fo+1e-22,Vn.playbackRate=fo}},2e3);return()=>{clearInterval(an)}},[L,Ot]),Ot&&!D?e.createElement(h.rZ,{admin:!0,"aria-label":wt(L?"LABEL_DISABLE_AIRPLAY":"LABEL_AIRPLAY"),"data-testid":"video-airplay-button",hovering:L,name:L?"airplayDisconnect":"airplay",onClick:wn,role:"button",tooltipAlign:"left",tooltipKey:L?"LABEL_DISABLE_AIRPLAY":"LABEL_AIRPLAY",tooltipPosition:M?"bottom":"top",useAbsolutePosition:!0}):null}var Ce=t(177203),Fe=t(887944),vt=t(89006);const rt=(0,p.AH)` 2805 ${r.AM} 2806 text-align: center; 2807`,Pt=(0,p.AH)` 2808 ${rt} 2809 & svg > path { 2810 fill: ${i.SP6}; 2811 } 2812`,Vt=(0,p.AH)` 2813 & svg { 2814 width: 20px; 2815 height: 20px; 2816 ${(0,r.nD)` 2817 width: 33px; 2818 height: 33px; 2819 `} 2820 } 2821`,bt=(0,p.AH)` 2822 ${rt} 2823 ${r.AM} 2824 ${r.j7} 2825 background: ${({disabled:D})=>D?i._A5:i.SP6}; 2826 & svg { 2827 width: 14px; 2828 height: 14px; 2829 ${(0,r.nD)` 2830 width: 22px; 2831 height: 22px; 2832 `} 2833 } 2834 & svg path { 2835 fill: ${i.O49}; 2836 } 2837`,Ae=p.Ay.div` 2838 ${_e.Z0} 2839 display: flex; 2840 flex-direction: column; 2841 align-items: center; 2842 width: 80px; 2843 max-width: 80px; 2844 cursor: pointer; 2845 & > *:last-child { 2846 ${r.WL} 2847 margin-top: 17px; 2848 max-width: 100%; 2849 } 2850 & > *[role="button"]:first-child { 2851 width: 100%; 2852 height: 100%; 2853 ${r.AM} 2854 } 2855`,Dt=p.Ay.span` 2856 ${_e.Z0} 2857 color: ${i.XO2}; 2858`,Yt=(0,G.A)((0,p.Ay)(K.Ay).attrs(D=>({color:(0,i.SP6)(D),name:"adminbarLink",radius:"20px"}))` 2859 ${bt} 2860 ${(0,r.nD)` 2861 min-width: 33px; 2862 min-height: 33px; 2863 max-width: 33px; 2864 max-height: 33px; 2865 `} 2866`,{admin:!0,tooltipKey:"LINK",tooltipPosition:"left"}),Ie=(0,G.A)((0,p.Ay)(K.Ay).attrs(D=>({color:(0,i.SP6)(D),name:"adminbarDeveloper",radius:"20px"}))` 2867 ${bt} 2868 ${(0,r.nD)` 2869 min-width: 33px; 2870 min-height: 33px; 2871 max-width: 33px; 2872 max-height: 33px; 2873 `} 2874`,{admin:!0,tooltipKey:"ADMIN_LABEL_EMBED_CODE",tooltipPosition:"left"}),he=(0,G.A)((0,p.Ay)(K.Ay).attrs({name:"fbCircleColored"})`${Vt}`,{tooltipKey:"ADMIN_ACTION_FACEBOOK_SHARE",tooltipPosition:"left"}),de=(0,G.A)((0,p.Ay)(K.Ay).attrs({name:"twitterCircleColored"})`${Vt}`,{admin:!0,tooltipKey:"ADMIN_ACTION_TWITTER_SHARE",tooltipPosition:"left"});var Te=t(224191),Se=t(734082);function Ue({children:D,onClick:M,titleKey:L}){return(0,Te.useSelector)(Se.VC)?e.createElement(Ae,{onClick:M},D,e.createElement(l.A,{component:Dt,stringKey:L})):e.createElement(e.Fragment,null,D)}function be({isTextModalOpen:D,onDesktopModalClose:M,setForceShowControls:L,socialsData:{facebook:ee,twitter:Qe}={},trackVideo:Me,video:wt,videoKind:Ot=n.PlayerTypes.file,videoTitle:Wt="",spot:en}){const Ft=(0,Fe.mC)(wt._id),Oe=Mt=>{const $n=wt?.url;Me("control",{id:wt._id,kind:"share",spot:en,title:Wt},{kind:Ot,platform:Mt,url:$n})};return(0,e.useEffect)(()=>{D||(M?.(),L(!1))},[D]),e.createElement(e.Fragment,null,ee?.active&&e.createElement(Ue,{onClick:()=>Oe("facebook"),titleKey:"ADMIN_ACTION_FACEBOOK_SHARE"},e.createElement(vt.uI,{beforeOnClick:()=>Oe("facebook"),url:Ft},e.createElement(he,{admin:!0}))),Qe?.active&&e.createElement(Ue,{onClick:async()=>Oe("twitter"),titleKey:"ADMIN_ACTION_TWITTER_SHARE"},e.createElement(vt.r6,{beforeOnClick:async()=>Oe("twitter"),url:Ft},e.createElement(de,{admin:!0}))))}const Et=p.Ay.div` 2875 display: flex; 2876 flex-direction: column; 2877 & > *:last-child { 2878 margin-top: 17px; 2879 } 2880`,ze=(0,p.Ay)(h.T5).attrs(D=>({textColor:(0,i.SP6)(D),hoverBackground:(0,i.SP6)(D),hoverTextColor:(0,i.cES)(D),name:"share",variant:"transparent"}))` 2881 min-width: 25px; 2882 width: 25px; 2883 z-index: 1; 2884 & svg { 2885 margin-left: -1px; 2886 width: 14px; 2887 height: 14px; 2888 & path { 2889 fill: ${({hovering:D})=>D?i.cES:i.SP6} !important; 2890 } 2891 } 2892`,yt=p.Ay.div` 2893 ${(0,r.PD)` 2894 &:hover { 2895 display: flex; 2896 } 2897 `} 2898 ${(0,r.nD)` 2899 ${r.gA} 2900 max-height: 100px; 2901 overflow-y: auto; 2902 justify-content: initial; 2903 `} 2904 display: ${({hovering:D})=>D?"flex":"none"}; 2905 flex-direction: column; 2906 align-items: center; 2907 width: 100%; 2908 justify-content: center; 2909 position: absolute; 2910 ${({dropBottom:D})=>{const M=D?"top":"bottom";return(0,p.AH)` 2911 ${M}: 100%; 2912 padding-${M}: 26px; 2913 margin-${M}: -20px; 2914 `}} 2915 border-radius: 5px; 2916 & > * { 2917 cursor: pointer; 2918 margin: 8px 0; 2919 } 2920`,Qt=p.Ay.div` 2921 position: relative; 2922 display: flex; 2923 flex-direction: column; 2924 z-index: 99; 2925 margin-left: 12px; 2926 ${(0,r.PD)` 2927 &:hover > ${yt} { 2928 display: flex; 2929 } 2930 &:hover > ${ze} { 2931 & svg path { 2932 fill: ${i.Jzj}; 2933 } 2934 } 2935 `} 2936`;var Hn=Object.defineProperty,It=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,Jt=(D,M,L)=>M in D?Hn(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,Q=(D,M)=>{for(var L in M||(M={}))xt.call(M,L)&&Jt(D,L,M[L]);if(At)for(var L of At(M))qe.call(M,L)&&Jt(D,L,M[L]);return D},We=(D,M)=>It(D,Bt(M));function _t(D){const{className:M,isMobileLayout:L,showVideoModal:ee}=D,[Qe,Me]=(0,e.useState)(!1),[wt,Ot]=(0,e.useState)(!1),Wt=(0,e.useMemo)(()=>Qe||wt||D.videoModalId==="shareModal",[Qe,wt]),en=(0,Ce.A)({onExit:()=>Ot(!1),active:Wt}),Ft=()=>Ot(!0),Oe=()=>Ot(!1),Mt=()=>Ot(Vn=>!Vn),$n=(0,e.useCallback)(()=>Me(!0),[Me]),wn=(0,e.useCallback)(()=>Me(!1),[Me]),an=()=>ee("shareModal");return e.createElement(Qt,{ref:en,className:`${M} ${I.wp}`,onClick:L?an:Mt,onMouseEnter:L?void 0:Ft,onMouseLeave:L?void 0:Oe},!L&&e.createElement(yt,{dropBottom:L,hovering:Wt}
2936,e.createElement(be,We(Q({},D),{onDesktopModalClose:wn,onEmbedClick:$n,onOpenLinkClick:$n}))),e.createElement(ze,{hovering:Wt}))}var ae=t(113194),Be=Object.defineProperty,et=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,Kt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,Ye=(D,M,L)=>M in D?Be(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,Gt=(D,M)=>{for(var L in M||(M={}))Kt.call(M,L)&&Ye(D,L,M[L]);if(Ut)for(var L of Ut(M))ot.call(M,L)&&Ye(D,L,M[L]);return D},Lt=(D,M)=>et(D,nt(M));function tn(){var D,M,L,ee,Qe,Me,wt,Ot,Wt,en;const Ft=(0,ae.A2)(),Oe=(0,ae.pB)(),[Mt,$n]=(0,e.useState)(Ft.currentTime),[wn,an]=(0,e.useState)(Ft.isMuted),[Vn,fo]=(0,e.useState)(Ft.isPaused),po=(0,e.useMemo)(()=>{var Pn,En,cn,Xn;return Oe.connected||((Xn=(cn=(En=(Pn=window.cast)==null?void 0:Pn.framework)==null?void 0:En.CastContext)==null?void 0:cn.getInstance())==null?void 0:Xn.getCastState())==="CONNECTED"},[Oe.connected,(ee=(L=(M=(D=window.cast)==null?void 0:D.framework)==null?void 0:M.CastContext)==null?void 0:L.getInstance())==null?void 0:ee.getCastState()]),Ro=()=>{var Pn,En,cn,Xn,$t,rn;(rn=(Xn=(cn=(En=(Pn=window.cast)==null?void 0:Pn.framework)==null?void 0:En.CastContext)==null?void 0:cn.getInstance)==null?void 0:($t=Xn.call(cn)).endCurrentSession)==null||rn.call($t,!0)};(0,e.useEffect)(()=>{var Pn,En,cn,Xn,$t,rn;const In=(rn=($t=(Xn=(cn=(En=(Pn=window.cast)==null?void 0:Pn.framework)==null?void 0:En.CastContext)==null?void 0:cn.getInstance())==null?void 0:Xn.getCurrentSession())==null?void 0:$t.getMediaSession())==null?void 0:rn.playerState;if(!In||In==="IDLE")return;const Zn=new window.cast.framework.RemotePlayer,zo=new window.cast.framework.RemotePlayerController(Zn);if(!zo)return;fo(In==="PAUSED");function So(dn){$n(dn.value)}zo.addEventListener(window.cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,So);function Ua(dn){an(dn.value)}zo.addEventListener(window.cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,Ua);function za(dn){fo(dn.value)}return zo.addEventListener(window.cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,za),()=>{zo.removeEventListener(window.cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,So),zo.removeEventListener(window.cast.framework.RemotePlayerEventType.IS_MUTED_CHANGED,Ua),zo.removeEventListener(window.cast.framework.RemotePlayerEventType.IS_PAUSED_CHANGED,za)}},[(en=(Wt=(Ot=(wt=(Me=(Qe=window.cast)==null?void 0:Qe.framework)==null?void 0:Me.CastContext)==null?void 0:wt.getInstance())==null?void 0:Ot.getCurrentSession())==null?void 0:Wt.getMediaSession())==null?void 0:en.playerState]);const[Nn,ea]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{const Pn=()=>{var cn,Xn,$t,rn,In;const Zn=po||typeof((In=(rn=($t=(Xn=(cn=window.cast)==null?void 0:cn.framework)==null?void 0:Xn.CastContext)==null?void 0:$t.getInstance)==null?void 0:rn.call($t))==null?void 0:In.requestSession)=="function";Zn!==Nn&&ea(Zn)};Pn();const En=setInterval(Pn,1e3);return()=>{clearInterval(En)}},[po,Nn]),Lt(Gt({},Oe),{available:Nn,connected:po,initialized:(0,e.useMemo)(()=>{var Pn;return Oe.initialized||!!((Pn=window.cast)!=null&&Pn.framework)},[Oe.initialized]),requestCasting:()=>{var Pn,En,cn,Xn,$t,rn;(rn=($t=(Xn=(cn=(En=(Pn=window.cast)==null?void 0:Pn.framework)==null?void 0:En.CastContext)==null?void 0:cn.getInstance)==null?void 0:Xn.call(cn))==null?void 0:$t.requestSession)==null||rn.call($t)},stopCasting:Ro,castPlayer:Lt(Gt({},Ft),{currentTime:Mt,isMuted:wn,isPaused:Vn,seek:Pn=>{const En=new window.cast.framework.RemotePlayer,cn=new window.cast.framework.RemotePlayerController(En);En&&cn&&(En.currentTime=Pn,cn.seek())},togglePlay:()=>{const Pn=new window.cast.framework.RemotePlayer,En=new window.cast.framework.RemotePlayerController(Pn);En?.playOrPause()}})})}var kt=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable,hn=(D,M)=>{var L={};for(var ee in D)jt.call(D,ee)&&M.indexOf(ee)<0&&(L[ee]=D[ee]);if(D!=null&&kt)for(var ee of kt(D))M.indexOf(ee)<0&&qn.call(D,ee)&&(L[ee]=D[ee]);return L};const Eo=(0,p.Ay)(h.Ay).attrs(D=>{var M=D,{disabled:L}=M,ee=hn(M,["disabled"]);return{admin:!0,containerCss:` 2937 ${L&&"display: none;"}
2938 `,background:"transparent",textColor:i._e_,hoverBackground:i._e_,hoverTextColor:i.azv,variant:"transparent"}})` 2939 position: relative; 2940 padding: 0; 2941 min-width: 31px; 2942 & google-cast-launcher { 2943 position: absolute; 2944 overflow: hidden; 2945 min-width: 100%; 2946 max-height: 100%; 2947 top: 0; 2948 left: 0; 2949 opacity: 0; 2950 ${({connected:D})=>D&&(0,p.AH)` 2951 max-width: 0; 2952 max-height: 0; 2953 min-width: 0; 2954 min-height: 0; 2955 pointer-events: none; 2956 visibility: hidden; 2957 top: -99999999px; 2958 left: -99999999px; 2959 z-index: -99999999px; 2960 `} 2961 } 2962`,Oo=(0,p.Ay)(K.Ay).attrs(D=>({color:i.azv}))` 2963 ${({connected:D})=>D&&(0,p.AH)` 2964 & svg path { 2965 fill: ${i.azv}; 2966 } 2967 `} 2968`;function Dn({isMobileLayout:D}){const M=tn(),{t:L}=(0,A._h)(),[ee,Qe]=(0,e.useState)(M.connected),Me=(0,e.useCallback)($()(Qe,500),[]);return(0,e.useEffect)(()=>(Me(M.connected),Me.cancel),[M.connected]),M.initialized?e.createElement(Eo,{"aria-label":L(M.connected?"LABEL_STOP_CASTING":"LABEL_CHROMECAST"),connected:ee,"data-testid":"video-chromecast-button",disabled:!M.available,hovering:M.connected,onClick:M.connected?M.stopCasting:M.requestCasting,tooltipAlign:"left",tooltipKey:M.connected?"LABEL_STOP_CASTING":"LABEL_CHROMECAST",tooltipPosition:D?"bottom":"top",useAbsolutePosition:!0},e.createElement(Oo,{connected:M.connected,name:M.connected?"chromecastDisconnect":"chromecast"})):null}var Bn=t(365179),Gn=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,Un=Object.prototype.propertyIsEnumerable,so=(D,M)=>{var L={};for(var ee in D)Mn.call(D,ee)&&M.indexOf(ee)<0&&(L[ee]=D[ee]);if(D!=null&&Gn)for(var ee of Gn(D))M.indexOf(ee)<0&&Un.call(D,ee)&&(L[ee]=D[ee]);return L};const To=p.Ay.span` 2969 ${_e.Ns} 2970 ${r.WL} 2971 margin-left: 11px; 2972 color: ${D=>{var M=D,{color:L}=M,ee=so(M,["color"]);return L||(0,i.SP6)(ee)}}; 2973 opacity: 0.7; 2974`,gn=(0,p.Ay)(K.Ay).attrs(D=>({color:D.color||(0,i.SP6)(D),name:"eyeFilled"}))` 2975 margin-left: 6px; 2976 & svg { 2977 width: 21px; 2978 height: 11px; 2979 } 2980`,ue=p.Ay.div` 2981 visibility: ${({visible:D})=>D?"visible":"hidden"}; 2982 display: flex; 2983 align-items: center; 2984 margin-left: 10px; 2985`;function Re({className:D,color:M}){const{concurrents:L}=(0,fe.B4)(),ee=(0,Te.useSelector)(Bn.FgX),{t:Qe}=(0,A._h)(),Me=(0,Te.useSelector)(Bn.UWw)&&L>=ee;return e.createElement(ue,{className:`${D} ${I.dT}`,visible:Me},e.createElement(gn,{color:M}),e.createElement(To,{color:M},L.toLocaleString()," ",Qe(L===1?"ADMIN_LABEL_VIEWER":"ADMIN_LABEL_VIEWERS")))}var Xe=t(498685),Zt=t(368909),on=t(150273),Ht=t(438749),_n=t(955807),Rn=t(979577),eo=t(229128);const to=Ht.n0.colors.surface1,pn=Ht.n0.colors.surface1,Wn=Ht.n0.colors.surface2,Fn=Ht.n0.colors.surface4,Po=Ht.n0.colors.text200,no=Ht.n0.colors.text100,wo=Ht.n0.colors.surface5,Co=Ht.n0.colors.surface4;function yn({onClose:D,open:M}){const{subtitleOptions:L,selectedSubtitle:ee,setSelectedSubtitle:Qe}=(0,fe.B4)(),Me=(0,Te.useSelector)(Zt.VC),{isDocumentInFullScreen:wt}=(0,on.D)(),Ot=Me&&!wt;return M?e.createElement(Rn.A,{wrap:Ot,wrapper:eo.A},Ot&&e.createElement(oo,{onClick:D}),e.createElement(Yn,null,e.createElement(l.A,{component:Sn,stringKey:"ADMIN_LABEL_SUBTITLES"}),e.createElement(Bo,null,e.createElement(_n.A,{keyField:"label",list:L},(Wt,en)=>{const Ft=ee.value===en.value,Oe=Mt=>{Mt.button===0&&(Qe(en),D())};return e.createElement(Lo,{key:Wt,isSelected:Ft,onClick:Oe},Ft&&e.createElement(Io,{name:"checked"}),e.createElement(uo,null,en.label))})),Me&&e.createElement(ao,{onClick:D},e.createElement(Io,{name:"closeThin"}),e.createElement(l.A,{component:uo,stringKey:"ADMIN_ACTION_CANCEL"})))):null}const Yn=p.Ay.div` 2986 display: flex; 2987 flex-direction: column; 2988 cursor: default; 2989 ${(0,r.PD)` 2990 border-radius: 4px; 2991 max-height: 260px; 2992 min-width: 200px; 2993 background: ${to}; 2994 position: absolute; 2995 bottom: calc(100% + 13px); 2996 right: 0; 2997 `} 2998 ${(0,r.nD)` 2999 width: 100%; 3000 max-height: 390px; 3001 background: ${Wn}; 3002 position: fixed; 3003 bottom: 0; 3004 left: 0; 3005 z-index: 2; 3006 `} 3007 ${(0,r.Q3)` 3008 padding-bottom: 30px; 3009 `} 3010`,oo=p.Ay.div` 3011 position: fixed; 3012 left: 0; 3013 top: 0; 3014 width: 100vw; 3015 height: 100vh; 3016 z-index: 1; 3017 background: ${pn}; 3018 opacity: 0.77; 3019`,Sn=p.Ay.span` 3020 ${_e.Ns} 3021 weight: 700; 3022 padding-inline: 16px; 3023 border-bottom: 1px solid; 3024 color: ${no}; 3025 text-align: left; 3026 ${(0,r.PD)` 3027 padding-block: 14px; 3028 line-height: 16px; 3029 border-color: ${wo}; 3030 `} 3031 ${(0,r.nD)` 3032 padding-block: 16px; 3033 font-size: 16px; 3034 line-height: 18px; 3035 border-color: ${Co}; 3036 `} 3037`,Bo=p.Ay.section` 3038 ${r.gA} 3039 scrollbar-color: ${i._e_} transparent; 3040 & ::-webkit-scrollbar-thumb { 3041 background: ${i._e_}; 3042 } 3043 & ::-webkit-scrollbar {
3044 width: 4px; 3045 } 3046 flex: 1; 3047`,xo=(0,p.AH)` 3048 display: flex; 3049 cursor: pointer; 3050 ${_e.Ns} 3051 color: ${Po}; 3052 &:hover { 3053 background: ${Fn}; 3054 color: ${no}; 3055 } 3056`,ao=p.Ay.div` 3057 ${xo} 3058 border-top: 1px solid ${Co}; 3059`,Lo=p.Ay.div` 3060 ${xo} 3061 ${({isSelected:D})=>D?` 3062 background: ${Fn}; 3063 color: ${no}; 3064 `:"--language-name-margin-left: 40px;"} 3065`,Io=(0,p.Ay)(K.Ay)` 3066 min-width: 40px; 3067 min-height: 40px; 3068 display: flex; 3069 justify-content: center; 3070 align-items: center; 3071 color: ${i._e_}; 3072 & svg { 3073 width: 12px; 3074 height: 9.5px; 3075 } 3076`,uo=p.Ay.span` 3077 display: flex; 3078 padding: 12px 8px; 3079 margin-left: var(--language-name-margin-left, 0); 3080`,Uo=i._e_,Ko="transparent",Qn=p.Ay.button` 3081 padding: 5px; 3082 border: 0; 3083 outline: 0; 3084 position: relative; 3085 background: ${Ko}; 3086 color: ${Uo}; 3087 border-radius: 4px; 3088 &:hover${({active:D})=>D&&", &"} { 3089 background: ${Uo}; 3090 color: ${i.azv}; 3091 } 3092 & svg { 3093 width: 23px; 3094 height: 15px; 3095 } 3096`;function Mo({setShowControls:D}){const{selectedSubtitle:M,subtitleOptions:L}=(0,fe.B4)(),[ee,Qe]=(0,e.useState)(!1),Me=(0,Te.useSelector)(Zt.VC),{isDocumentInFullScreen:wt}=(0,on.D)(),Ot=Me&&!wt,Wt=(0,e.useMemo)(()=>ee||M.value!==fe.eA.value,[M,ee]),en=()=>{Qe(!1),D(!1)},Ft=()=>{Qe(Mt=>!Mt),D(!1)},Oe=(0,Xe.Bc)({onExit:()=>{Ot||en()},active:ee});return!L?.length||L.length===1&&L[0].label===fe.eA.label?null:e.createElement(Qn,{ref:Oe,active:Wt,onClick:Ft},e.createElement(K.Ay,{name:"captions"}),e.createElement(yn,{onClose:en,open:ee}))}var _o=t(757504),oa=t(21853),Va=t.n(oa),Qo=t(807081),Jo=Object.defineProperty,aa=Object.defineProperties,ra=Object.getOwnPropertyDescriptors,lo=Object.getOwnPropertySymbols,Wo=Object.prototype.hasOwnProperty,ha=Object.prototype.propertyIsEnumerable,sa=(D,M,L)=>M in D?Jo(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,kn=(D,M)=>{for(var L in M||(M={}))Wo.call(M,L)&&sa(D,L,M[L]);if(lo)for(var L of lo(M))ha.call(M,L)&&sa(D,L,M[L]);return D},ya=(D,M)=>aa(D,ra(M)),Aa=(D,M)=>{var L={};for(var ee in D)Wo.call(D,ee)&&M.indexOf(ee)<0&&(L[ee]=D[ee]);if(D!=null&&lo)for(var ee of lo(D))M.indexOf(ee)<0&&ha.call(D,ee)&&(L[ee]=D[ee]);return L};function Jn(D){var M=D,{className:L}=M,ee=Aa(M,["className"]);const{isLandscape:Qe,isLive:Me,isMobileLayout:wt,videoDuration:Ot,setForceShowControls:Wt,showControls:en,socialsData:{facebook:Ft,twitter:Oe}}=ee,Mt=Ft?.active||Oe?.active;(0,Qo.A)({sectionId:"video-controls-overlay"}),(0,e.useEffect)(()=>{(0,v.UH)()&&Va().focus("video-controls-overlay",!0)},[]);const $n=()=>e.createElement(e.Fragment,null,e.createElement(Pe,null,e.createElement(Ee,kn({},ee))),e.createElement(we,null,e.createElement(Y,kn({},ee)),Me&&e.createElement(_o.A.Default,null),!Me&&e.createElement(U,null,e.createElement(H,{videoDuration:Ot}),e.createElement(ce,kn({},ee))),e.createElement(Re,ya(kn({},ee),{color:"white"})),e.createElement(B,null),Me&&e.createElement(ce,kn({},ee)),e.createElement(Z,kn({},ee)),e.createElement(q,kn({},ee)),e.createElement(Dn,kn({},ee)),e.createElement(Ke,kn({},ee)),Mt&&e.createElement(_t,kn({},ee)),e.createElement(Mo,{setShowControls:Wt}))),wn=()=>e.createElement(e.Fragment,null,e.createElement(Pe,null,!Me&&e.createElement(U,null,e.createElement(H,{videoDuration:Ot}))),e.createElement(we,{isLandscape:Qe},e.createElement(Ee,kn({},ee)),Me&&e.createElement(B,null)));return e.createElement(e.Fragment,null,wt&&e.createElement(oe,{isLandscape:Qe,showControls:en},Me&&e.createElement(_o.A.Default,null),e.createElement(Re,{className:L,color:"white"}),e.createElement(B,null),e.createElement(q,kn({},ee)),e.createElement(Dn,kn({},ee)),e.createElement(Ke,kn({},ee)),e.createElement(_t,kn({},ee)),e.createElement(Mo,{setShowControls:Wt})),e.createElement(Nt,{className:`${L} video-controls-overlay`},e.createElement(j,kn({className:"focusable",isLandscape:Qe,tabIndex:-1},(0,v.bM)()),wt?wn():$n())))}const la=p.Ay.div` 3097 ${r.AM} 3098 flex-direction: column; 3099 position: absolute; 3100 top: 0; 3101 left: 0; 3102 background: ${i.O49}; 3103 width: 100%; 3104 height: 100%; 3105`,Xo=p.Ay.div` 3106 ${r.AM} 3107 flex-direction: column; 3108 width: 50%; 3109 height: 100%; 3110 position: relative; 3111`,Oa=p.Ay.div` 3112 ${_e.Ns} 3113 color: ${i.SP6}; 3114 position: absolute; 3115 top: 50%; 3116 transform: translateY(60%); 3117 max-height: calc(100% - 100px); 3118 height: 146px; 3119 white-space: pre-wrap; 3120 ${(0,r.PD)`${_e.HU}`} 3121 & span:first-child { 3122 &:after { 3123 content: " "; 3124 } 3125 } 3126`,jo=p.Ay.span` 3127 &:before, &:after { 3128 content: '"'; 3129 } 3130`,No=p.Ay.svg` 3131 height: calc(100% - 100px); 3132 width: 100%; 3133 max-width: 198px; 3134 max-height: 146px; 3135`;function Ho({deviceName:D}){return e.createElement(la,{"data-testid":"video-casting-view"},e.createElement(Xo,null,e.createElement(No,{fill:"none",viewBox:"0 0 204 149",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{height:"128.254",rx:"10",stroke:i._e_,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"6",width:"197.652",x:"3",y:"3"}),e.createElement("line",{stroke:i._e_,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"6",x1:"50.3613",x2:"153.29",y1:"145.442",y2:"145.442"})),e.createElement(Oa,null,e.createElement(l.A,{stringKey:D?"LABEL_CASTING_TO":"LABEL_CASTING"}),D&&e.createElement(jo,{"data-testid":"video-casting-device-name"},D))))}var mn=t(222241);const io=p.Ay.div` 3136 ${r.AM} 3137 ${_e.Z0} 3138 color: ${i.zkP}; 3139 width: 100%; 3140 height: 100%; 3141 position: relative; 3142 flex-direction: column; 3143 & > *:first-child { 3144 margin-bottom: 19px; 3145 margin-top: -19px; 3146 &:after { 3147 content: ":"; 3148 } 3149 } 3150`;var mo=Object.defineProperty,Pa=Object.getOwnPropertySymbols,$o=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,ia=(D,M,L)=>M in D?mo(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,La=(D,M)=>{for(var L in M||(M={}))$o.call(M,L)&&ia(D,L,M[L]);if(Pa)for(var L of Pa(M))Zo.call(M,L)&&ia(D,L,M[L]);return D};function Ia(D){return e.createElement(io,null,e.createElement(l.A,{stringKey:"SHARE"}),e.createElement(mn.A,{maxItems:4},e.createElement(be,La({},D))))}var Go=t(638662),ko=t(154789);const qo=p.Ay.div` 3151 position: absolute; 3152 background: rgba(0,0,0,0.8); 3153 width: 100%; 3154 height: 100%; 3155 top: 0; 3156 left: 0; 3157 z-index: 3; 3158`,ca=(0,p.Ay)(ko.Jn).attrs({containerCss:` 3159 position: absolute; 3160 top: 13px; 3161 right: 16px; 3162 z-index: 1; 3163 `})``;var Ma=Object.defineProperty,_a=Object.getOwnPropertySymbols,Fa=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,da=(D,M,L)=>M in D?Ma(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,Sa=(D,M)=>{for(var L in M||(M={}))Fa.call(M,L)&&da(D,L,M[L]);if(_a)for(var L of _a(M))Ra.call(M,L)&&da(D,L,M[L]);return D};const ba={shareModal:Ia};function Ka(D){const{showVideoModal:M,videoModalId:L,isFullscreen:ee}=D,Qe=(0,e.useMemo)(()=>L&&ba[L],[L]),Me=()=>M();return Qe?e.createElement(qo,null,e.createElement(ca,{onClick:Me}),e.createElement(Qe,Sa({},D)),ee&&e.createElement(Go.A,null)):null}var Wa=t(685727),ja=t.n(Wa),ua=t(616040),Ha=t(231809),Ta=t(731694),wa=t(616618),Vo=t(199749),qa=t(702767),Ga=t(530668),b=t(654105);function _(){var D,M;const L=(0,Te.useDispatch)(),{playerState:ee}=(0,fe.B4)();return{socialsData:(0,Te.useSelector)(Bn.UON),fullscreenActive:(0,Te.useSelector)(Vo.OL),isLandscape:(0,Te.useSelector)(Se.Yg),isLive:ee.isLive,isMobileLayout:(0,Te.useSelector)(Se.VC),isPlaying:ee.playing,isTextModalOpen:(0,Te.useSelector)(Qe=>(0,b.UN)(Qe,"selectableText")),videoMIMEType:ee.videoMIMEType,spot:ee.spot,panelState:(0,Te.useSelector)(Vo.sn),theaterModeActive:(0,Te.useSelector)(Vo.q6),video:ee.video,videoDuration:ee.duration,videoKind:(D=ee.video)==null?void 0:D.player,videoModalId:(0,Te.useSelector)(wa.c0),videoOffset:ee.offset,videoTitle:(M=ee.video.title)!=null?M:null,videoUrl:ee.video.url,muted:ee.muted,volume:ee.volume,onPlaybackUpdate:Qe=>{ee.onPlaybackUpdate(Qe)},seekVideo:(0,e.useCallback)(Qe=>{ee.seekVideo(Qe.playedSeconds)}
3163,[ee.seekVideo]),setViewMode:Qe=>{L((0,Ga.fd)(Qe))},showVideoModal:(Qe=null)=>{L((0,qa.showVideoModal)({modalId:Qe}))},trackVideo:(0,e.useCallback)((...Qe)=>L((0,Fe.bU)(...Qe)),[])}}var F=t(11411),Ge=t(952681),xe=t(118362),$e=t(669865),je=t(42012),He=t(754280);const tt={decreaseVolume:"ArrowDown",increaseVolume:"ArrowUp",mute:"KeyM",playPause:"Space",seekBack:"ArrowLeft",seekForward:"ArrowRight"},it=p.Ay.div` 3164 height: 100%; 3165 z-index: 0; 3166 position: relative; 3167 ${r.Hr} 3168 & video::cue { 3169 font-family: 'Roboto', sans-serif; 3170 font-style: normal; 3171 font-weight: 500; 3172 font-size: ${({isFullscreen:D})=>D?"30px":"20px"}; 3173 color: ${i._e_}; 3174 text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.64); 3175 } 3176 @media (max-width: 430px) { 3177 & video::cue { 3178 font-size: 15px; 3179 } 3180 } 3181 ${(0,r.wc)` 3182 & video::cue { 3183 font-size: 20px; 3184 } 3185 `} 3186 ${(0,r.BI)` 3187 & video::cue { 3188 font-size: 30px; 3189 } 3190 `} 3191 ${(0,r.q1)` 3192 & video::cue { 3193 font-size: 40px; 3194 } 3195 `} 3196`,Ve=p.Ay.div` 3197 ${r.Hr} 3198 display: flex; 3199 position: relative; 3200 z-index: 1; 3201 flex-direction: column; 3202 height: 100%; 3203 transition: opacity 0.75s; 3204 ${({showControls:D})=>D?` 3205 `:` 3206 opacity: 0; 3207 cursor: none; 3208 pointer-events: none; 3209 `} 3210`,dt=p.Ay.div` 3211 width: 100%; 3212 flex: 1; 3213 display: flex; 3214 justify-content: center; 3215 align-items: center; 3216 transition: opacity 0.75s; 3217 z-index: 1; 3218 position: relative; 3219 ${r.Hr} 3220 ${({isPlaying:D,isMobile:M,showControls:L})=>` 3221 opacity: ${!M&&D&&!L?0:1}; 3222 `} 3223`,N=(0,p.Ay)(K.Ay).attrs(D=>({color:i._e_}))` 3224 z-index: 3; 3225 ${r.Hr} 3226 & svg { 3227 cursor: pointer; 3228 width: 35px; 3229 height: 35px; 3230 } 3231 3232 ${(0,v.UH)()&&(0,p.AH)` 3233 &:focus { 3234 width: 100px; 3235 height: 100px; 3236 border-radius: 50%; 3237 position: absolute; 3238 display: flex; 3239 align-items: center; 3240 justify-content: center; 3241 background-color: ${i.mrt}; 3242 } 3243 `} 3244`,R=p.Ay.div` 3245 position: absolute; 3246 width: 100%; 3247 height: 100%; 3248 ${r.Hr} 3249`,k=p.Ay.button` 3250 ${r.Hr} 3251 position: absolute; 3252 z-index: 999; 3253 width: 100%; 3254 height: 100%; 3255 top: 0; 3256 left: 0; 3257 ${({disabled:D})=>D&&"pointer-events: none;"} 3258`;function X({showControls:D=!1}){const[M,L]=(0,e.useState)(!1),ee=()=>{L(!0)};return(0,e.useEffect)(()=>{L(D)},[D]),e.createElement(k,{disabled:M,onClick:ee})}var ye=Object.defineProperty,me=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,Rt=(D,M,L)=>M in D?ye(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,Tt=(D,M)=>{for(var L in M||(M={}))De.call(M,L)&&Rt(D,L,M[L]);if(at)for(var L of at(M))ut.call(M,L)&&Rt(D,L,M[L]);return D},sn=(D,M)=>me(D,Je(M));function fn({children:D,className:M,hideMuteWarning:L=!1,isShowingNativeControls:ee,keyboardControls:Qe=tt,seekStepSeconds:Me=10,volumeStep:wt=.1}){const{playerState:{highFrequencyPlaybackState:Ot,playerType:Wt}}=(0,fe.B4)(),en=_(),{connected:Ft,deviceName:Oe,castPlayer:Mt}=tn(),$n=(0,F.Ay)({feature:F.Xj.HIDE_ADS_PLAYER,type:"feature"}),{handleKeyPress:wn}=(0,m.L)(),{showToast:an,renderToasts:Vn}=(0,Ge.d)(),{registerBackHandler:fo}=(0,xe.P)(),po=(0,Te.useSelector)(Bn.DyV),Ro=(0,Te.useSelector)(je.hE),Nn=(0,Te.useSelector)(je.$Z),ea=(0,e.useMemo)(()=>(0,He.$x)(Ro),[Ro]),Pn=!!(Nn&&(Nn.v||Nn.p)),En=po||ea||Pn,cn=(0,e.useRef)({connected:Ft,currentTime:Mt.currentTime,seek:Mt.seek,setVolume:Mt.setVolume}),Xn=Ft?sn(Tt({},en),{currentTime:Mt.currentTime,isPlaying:!Mt.isPaused,muted:Mt.isMuted,videoTitle:Mt.title}):en,{fullscreenActive:$t,isLive:rn,isMobileLayout:In,isPlaying:Zn,muted:zo,onPlaybackUpdate:So,seekVideo:Ua,setViewMode:za,trackVideo:dn,video:ta,videoDuration:bo,videoKind:Do,videoMIMEType:ar,videoTitle:co,volume:Na,videoUrl:Yo,spot:pa}=Xn,dr=(0,e.useRef)(bo),[ur,pr]=(0,e.useState)(!1),[fr,gr]=(0,e.useState)(!1),[Er,Ya]=(0,e.useState)(!1),[hr,yr]=(0,e.useState)(!1),{isDocumentInFullScreen:er}=(0,on.D)(),fa=ta.url||"",ga=ta._id,Ar=ee&&[n.PlayerTypes.youtube,n.PlayerTypes.twitch,n.PlayerTypes.vimeo,n.PlayerTypes.iframe].includes(Wt),Da=hr||(Ar?!1:!Zn||Er);(0,e.useEffect)(()=>{(0,v.UH)()&&pa===$e.KE.tv&&Ja()},[]),(0,e.useEffect)(()=>{(0,v.UH)()&&En&&Ja()},[En]);const xa=er&&$t;(0,e.useEffect)(()=>{(0,v.UH)()&&xa&&Zn&&fo(Or)},[xa,Zn]);const rr=(0,e.useCallback)($()(()=>{Zn&&Ya(!1)},3e3),[Zn]),Ea=(0,e.useCallback)(()=>{Ya(!0),rr()},[Ya,rr,In]),lr=(0,e.useCallback)(()=>{Ya(!0),In&&rr()},[Ya,rr,In]),tr=(0,e.useCallback)(()=>Ya(!1),[Ya]),mr=(0,e.useCallback)(()=>
3258{if(Da){tr();return}lr()},[lr,tr,Da]),ir=(0,e.useCallback)(go=>{Ea();const na=ja()(go,0,1);dn("control",{id:ga,kind:"volume",spot:pa,title:co},{kind:Do,url:fa}),So({muted:na===0,volume:na}),cn.current.setVolume(na)},[Ea,ga,fa,dn,So]),cr=(0,e.useCallback)(()=>{Ft&&Mt.toggleMute(),dn("control",{id:ga,kind:"volume",spot:pa,title:co},{kind:Do,url:fa}),So({muted:!zo})},[Ea,ga,fa,Ft,dn,So]),$a=(0,e.useCallback)(go=>{dn("control",{id:ga,kind:go?"pause":"play",spot:pa,title:co},{[go?"atTime":"fromTime"]:Ot.current.playedSeconds||0,kind:Do,url:fa})},[Ot,Do,pa,co,ga,fa]),Qa=(0,e.useCallback)(go=>{go?.stopPropagation(),Ea(),Ft&&Mt.togglePlay(),$a(Zn),Zn||tr(),So({playing:!Zn})},[Ea,tr,So,$a,Ft,Zn]);(0,e.useEffect)(()=>{$a(!1)},[$a]),(0,e.useEffect)(()=>{er||za(null)},[er]);const Za=(0,e.useCallback)(go=>{Ea();const na=ja()(go,0,dr.current);cn.current.connected&&(cn.current.currentTime=na,cn.current.seek(na)),dn("control",{id:ga,kind:"seek",spot:pa,title:co},{fromTime:Ot.current.playedSeconds||0,kind:Do,toTime:na,url:fa}),Ua({playedSeconds:na})},[Ea,ga,fa,dn,Ua,Ot]),Ja=(0,e.useCallback)(()=>{if(Ea(),dn("control",{id:ga,kind:"true_fullscreen",spot:pa,title:co},{action:xa?"disable":"enable",kind:Do,url:fa}),za(xa?null:"fullscreen"),!xa){(0,ie.lh)("fullscreen",Ta.jf);return}(0,ie.Eh)("fullscreen"),(0,ie.Eh)("theater")},[Ea,ga,fa,xa,dn]),Or=(0,e.useCallback)(()=>(Ja(),Qa(),!0),[Ja,$a]),Pr=()=>{cr()},Ir=({nativeEvent:{code:go}})=>{switch(Ea(),go){case Qe.decreaseVolume:ir(Na-wt);break;case Qe.increaseVolume:ir(Na+wt);break;case Qe.playPause:Qa();break;case Qe.mute:cr();break;case Qe.seekBack:rn||Za(Ot.current.playedSeconds-Me);break;case Qe.seekForward:rn||Za(Ot.current.playedSeconds+Me);break}},Sr=go=>{switch((0,v.GR)(go.keyCode)){case v.zw.LEFT:case v.zw.RWD:rn||Za(Ot.current.playedSeconds-Me);break;case v.zw.RIGHT:case v.zw.FWD:rn||Za(Ot.current.playedSeconds+Me);break;case v.zw.PLAY_PAUSE:Qa();break;case v.zw.PLAY:$a(!1),So({playing:!0});break;case v.zw.PAUSE:$a(!0),So({playing:!1});break;case v.zw.STOP:$a(!0),So({playing:!1}),Za(0);break}};(0,e.useEffect)(()=>{if(Ft&&Yo){const go=new chrome.cast.media.MediaInfo(Yo,ar),na={autoplay:!0,duration:en.videoDuration,isMuted:en.muted,media:go,currentTime:Ot.current.playedSeconds,activeTrackIds:[],customData:{},tracks:null};Mt.loadMedia(na)}},[Ft,Yo]),(0,e.useEffect)(()=>{const go=cn.current.currentTime;!Ft&&go>0&&Ua({playedSeconds:go})},[Ft,cn.current.currentTime]),(0,e.useEffect)(()=>{cn.current.connected=Ft},[Ft]),(0,e.useEffect)(()=>{Mt.currentTime&&(cn.current.currentTime=Mt.currentTime)},[Mt.currentTime]),(0,e.useEffect)(()=>{cn.current.seek=Mt.seek},[Mt.seek]),(0,e.useEffect)(()=>{cn.current.setVolume=Mt.setVolume},[Mt.setVolume]),(0,e.useEffect)(()=>{dr.current=bo},[bo]);const vr={adActive:fr,airplayIsConnected:ur,changeVolume:ir,isFull:er,isFullscreen:xa,seekTo:Za,setAirplayIsConnected:pr,setForceShowControls:yr,showControls:Da,toggleFullscreen:Ja,toggleMute:cr,togglePlay:Qa},Tr=()=>(0,v.UH)()?er:!0,Cr=()=>{(0,v.UH)()&&([n.PlayerTypes.youtube,n.PlayerTypes.twitch].includes(Wt)?an({content:"Youtube video currently not supported on smart tv"}):(Qa(),Ja()))};return e.createElement(it,Tt({className:M,id:Ta.jf,isFullscreen:xa,isPlaying:Zn,onClick:In&&!Da?mr:void 0,onKeyDown:(0,v.UH)()?Sr:Ir,onMouseLeave:tr,onMouseMove:In?void 0:lr,showControls:Da},(0,v.UH)()?{}:{tabIndex:-1}),zo&&!L&&e.createElement(ua.A,{handleClick:Pr,mobile:In}),!$n&&Do&&[n.PlayerTypes.file,n.PlayerTypes.livestream].includes(Do)&&e.createElement(Ha.A,{onAdActiveChange:gr,videoId:ta._id}),Da&&e.createElement(Ve,{className:"video-controls",id:Ta.Ze,showControls:Da},e.createElement(dt,{isMobile:In,isPlaying:Zn,onClick:In?mr:Qa,showControls:Da},e.createElement(N,{className:"focusable",name:Zn?"pause":"playLarge",onClick:In?Qa:void 0,onKeyDown:wn(v.zw.OK,Cr),tabIndex:-1}),e.createElement(R,{onDoubleClick:Ja})),Tr()&&e.createElement(Jn,Tt(Tt({},Xn),vr)),In&&e.createElement(X,{showControls:Da})),(Ft||ur)&&e.createElement(Ho,{deviceName:Oe}),e.createElement(Ka,Tt(Tt({},Xn),vr)),!In&&xa&&e.createElement(Go.A,null),Vn(),D)}var bn=t(776637),An=t.n(bn),Kn=t(504714),xn=t(346002),ho=t(736608),yo=t(990220),Ln=t(711952),ma=t(89649),Xa=t(934193),va=t(993729),S=t(141220),V=t(80247),z=Object.defineProperty,Ze=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,ht=(D,M,L)=>M in D?z(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,ft=(D,M)=>{for(var L in M||(M={}))Ct.call(M,L)&&ht(D,L,M[L]);if(st)for(var L of st(M))lt.call(M,L)&&ht(D,L,M[L]);return D},qt=(D,M)=>Ze(D,ke(M));function Xt({scheduledVideoStartTime:D,spot:M,video:L,onVideoComplete:ee}){var Qe,Me;const wt=(0,Te.useDispatch)(),Ot=(0,e.useRef)(),{muted:Wt,setMuted:en}=(0,S.zh)(),Ft=L.type===n.VideoTypes.livestream,Oe=Ft||D!==null,Mt=[n.PlayerTypes.file,n.PlayerTypes.livestream].includes(L?.player),$n=(0,Te.useSelector)(Bn.gB3),[wn,an]=(0,e.useState)({offset:D?vn(D):null,durationSeconds:void 0,videoId:L._id}),[Vn,fo]=(0,e.useState)((0,$e.Q2)(Wt)),po=(0,e.useRef)({loaded:0,loadedSeconds:0,played:0,playedSeconds:0});L._id!==wn.videoId&&(Object.assign(po.current,{loaded:0,loadedSeconds:0,played:0,playedSeconds:0}),an({offset:null,durationSeconds:void 0,videoId:L._id}),fo($t=>(0,$e.Q2)($t.muted)));const Ro=(0,e.useCallback)($t=>{an(rn=>qt(ft({},rn),{offset:$t}))},[]),Nn={cc:Vn.cc?Kn.dT.ENABLED:Kn.dT.DISABLED,facebookId:(0,Te.useSelector)(Ln.WV),forceMute:(0,Te.useSelector)(wa.RY),hasError:wn.hasError,hideMuteWarning:L.player===n.PlayerTypes.iframe,isChromaKeyMode:(0,Te.useSelector)(Vo.Z2),isEditMode:(0,Te.useSelector)(xn.Q),isLivestreamPreview:(0,Te.useSelector)(xn.lX),isShowingNativeControls:(0,v.UH)()?!1:!Mt,muted:Vn.muted,offset:Number(wn.offset),parentOrigin:(0,Te.useSelector)(ho.Bq)||yo.Q$,playerType:(Qe=L.player)!=null?Qe:n.PlayerTypes.file,playing:Vn.playing,spot:M,video:L,volume:Vn.volume,onPlaybackUpdate:(0,e.useCallback)($t=>{fo(rn=>ft(ft({},rn),$t))},[]),updateHighFrequencyState:(0,e.useCallback)(({loaded:$t,loadedSeconds:rn,played:In,playedSeconds:Zn})=>{$t!==void 0&&(po.current.loaded=$t),rn!==void 0&&(po.current.loadedSeconds=rn),In!==void 0&&(po.current.played=In),Zn!==void 0&&(po.current.playedSeconds=Zn)},[]),seekVideo:Ro,onVideoComplete:ee};(0,e.useEffect)(()=>
3258{if(!D||!Vn.playing)return;const $t=setInterval(()=>{const rn=vn(D);Math.abs(rn-po.current.playedSeconds)>5&&Ro(rn)},500);return()=>{clearInterval($t)}},[D,Vn,Ro]);const ea=wn.durationSeconds;(0,e.useEffect)(()=>{!Ft||!Mt||!ea||Math.abs(ea-po.current.playedSeconds)>5&&Ro(ea)},[Ft,Mt,ea,Ro]);const{muted:Pn,volume:En}=Vn;(0,e.useEffect)(()=>{typeof En=="number"&&!Number.isNaN(En)&&(0,va.v)().write("site:volume",En),Pn!==void 0&&((0,va.v)().write("site:muted",!!Pn),en(Pn))},[Pn,En]);const cn=L.url,Xn=(0,e.useMemo)(()=>{try{const $t=(0,Xa.jC)(cn)||"m3u8";return Kn.bb[$t]||Kn.bb.m3u8}catch{return Kn.bb.m3u8}},[cn]);return qt(ft({},Nn),{isFacebook:(0,e.useMemo)(()=>{const $t=Nn.playerType;return $t==="facebook_video"||$t==="facebook_live"},[Nn.playerType]),playerClassName:Oe?"live":"onDemand",isLive:Oe,videoMIMEType:Xn,highFrequencyPlaybackState:po,twitchOptions:(0,e.useMemo)(()=>Nn.playerType==="twitch"?{parent:[...$n]}:{},[Nn.playerType,$n]),duration:L.durationSeconds||wn.durationSeconds||0,onDuration:(0,e.useCallback)($t=>{$t&&an(rn=>qt(ft({},rn),{durationSeconds:$t}))},[]),onError:(0,e.useCallback)(($t,rn)=>{const In=rn?.details||"";V.warn(`Video player error: ${In}`),V.warn(rn||$t),`${$t}`.includes("was not found")&&(wt((0,ma.AF)("This video is unavailable")),ee?.()),rn?.fatal&&ee?.()},[Nn.playerType,(Me=Nn.video)==null?void 0:Me.url,ee]),onPause:(0,e.useCallback)(()=>{Nn.onPlaybackUpdate({playing:!1})},[Nn.onPlaybackUpdate]),onPlay:(0,e.useCallback)(()=>{Nn.onPlaybackUpdate({playing:!0})},[Nn.onPlaybackUpdate,Nn.playing]),onVolumeChange:(0,e.useCallback)($t=>()=>{Nn.muted&&!$t.muted?Nn.onPlaybackUpdate({muted:!1,volume:$t.volume}):!Nn.muted&&$t.muted?Nn.onPlaybackUpdate({muted:!0,volume:$t.volume}):(clearTimeout(Ot.current),Ot.current=setTimeout(()=>{Nn.onPlaybackUpdate({volume:$t.volume})},500))},[Nn.muted,Nn.onPlaybackUpdate])})}const vn=D=>Math.floor((Date.now()-D)/1e3);var On=t(46630);function ln({onLoad:D}){const M=(0,Te.useSelector)(Bn.x6f),L=(0,Te.useSelector)(Bn.UWw),ee=(0,e.useCallback)(Qe=>{Qe!=null&&D(Qe)},[D]);return M&&L?e.createElement(On.A,{collection:"concurrents:v2:sessions",id:`channels:${M}`,onValue:ee}):null}var mt=t(660353),un=t(860954);const nn=p.Ay.div` 3259 display: flex; 3260 align-items: center; 3261 justify-content: center; 3262`,jn=p.Ay.div` 3263 position: absolute; 3264 z-index: -1; 3265 width: 100%; 3266 height: 100%; 3267 top: 0; 3268 left: 0; 3269 display: flex; 3270 justify-content: center; 3271 align-self: center; 3272 align-items: center; 3273`,Tn=p.Ay.div` 3274 position: relative; 3275 background: rgba(0,0,0,.1); 3276 overflow: hidden; 3277`;var zn=Object.defineProperty,Ao=Object.defineProperties,vo=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,ro=(D,M,L)=>M in D?zn(D,M,{enumerable:!0,configurable:!0,writable:!0,value:L}):D[M]=L,Fo=(D,M)=>{for(var L in M||(M={}))St.call(M,L)&&ro(D,L,M[L]);if(Cn)for(var L of Cn(M))zt.call(M,L)&&ro(D,L,M[L]);return D},ka=(D,M)=>Ao(D,vo(M));const Ba=[n.PlayerTypes.youtube,n.PlayerTypes.twitch],Ca="https://www.youtube-nocookie.com",nr=a.nr&&!/iPad|iPhone|iPod/.test(navigator.userAgent);function or({activeVideoElementId:D,width:M="100%",video:L,scheduledVideoStartTime:ee,spot:Qe,onVideoComplete:Me,loop:wt,autoPlay:Ot=!0}){const{connected:Wt}=tn(),[en,Ft]=(0,e.useState)(!0),Oe=Xt({video:L,scheduledVideoStartTime:ee,spot:Qe,onVideoComplete:Me}),Mt=(0,Te.useSelector)(Bn.gL8);(0,mt.v)({video:L,isVideoPlaying:Oe.playing,scheduledVideoStartTime:ee,spot:Qe});const $n=(0,Te.useSelector)(un.Yz),wn=(0,e.useRef)();(0,e.useEffect)(()=>{wn.current!==L._id&&((0,un.Jm)({action:un.Np.VIDEO_CONTENT_READY,vod:L,pageInfo:$n}),wn.current=L._id)},[$n,L]);const[an,Vn]=(0,e.useState)(null),[fo,po]=(0,e.useState)(!1),[Ro,Nn]=(0,e.useState)(Oe.volume),[ea,Pn]=(0,e.useState)([fe.eA]),[En,cn]=(0,e.useState)(ea[0]),[Xn,$t]=(0,e.useState)(1),rn=(0,e.useRef)();(0,e.useEffect)(()=>{rn.current!==L._id&&(Oe.playing||(rn.current=L._id,Oe.onPlaybackUpdate({playing:Ot})))},[Oe,L._id,Ot]),(0,e.useEffect)(()=>{po(!1)},[An()(Oe.video)]),(0,e.useEffect)(()=>{if(!an||!fo)return;const dn=Number.isFinite(Oe.offset)?Oe.offset:0;an.seekTo(dn,"seconds")},[Oe.offset]);const{playerType:In}=Oe,Zn=(0,e.useCallback)(dn=>{Vn(ta=>{if(dn===ta)return ta;const bo=dn?.getInternalPlayer();return bo instanceof HTMLVideoElement&&(bo.oncontextmenu=Do=>Do.preventDefault(),In!==n.PlayerTypes.file&&!Ba.includes(In)&&(bo.onvolumechange||(bo.onvolumechange=Oe.onVolumeChange(bo)))),dn})},[Oe.onVolumeChange,In]);(0,e.useEffect)(()=>
3277{if(!Ba.includes(In))return;const dn=setInterval(()=>{var ta,bo,Do,ar;const co=an?.getInternalPlayer();if(!co)return;let Na,Yo;switch(In){case n.PlayerTypes.youtube:Na=(ta=co?.isMuted)==null?void 0:ta.call(co);const pa=(bo=co?.getVolume)==null?void 0:bo.call(co);Yo=pa?pa/100:0;break;case n.PlayerTypes.twitch:Na=(Do=co?.getMuted)==null?void 0:Do.call(co),Yo=(ar=co?.getVolume)==null?void 0:ar.call(co);break;default:break}Oe.muted!==Na&&!f()(Na)?Oe.volume!==Yo&&!f()(Yo)?Oe.onPlaybackUpdate({muted:Na,volume:Yo}):Oe.onPlaybackUpdate({muted:Na}):Oe.volume!==Yo&&!f()(Yo)&&Oe.onPlaybackUpdate({volume:Yo})},500);return()=>{dn&&clearInterval(dn)}},[an,In,Oe.muted,Oe.volume,Oe.onPlaybackUpdate]);const zo=(0,e.useCallback)(()=>{fo||po(!0)},[fo]);(0,e.useEffect)(()=>{if(Wt){Nn(Oe.volume);return}en||setTimeout(()=>{Oe.onPlaybackUpdate({volume:Ro})},3e3),Ft(!1)},[Wt,en]);const So=Number(Oe.isShowingNativeControls),Ua=(0,e.useMemo)(()=>{const dn={facebook:{appId:Oe.facebookId},file:{attributes:{controls:So,controlsList:"nodownload",disablePictureInPicture:!0},forceDisableHls:nr&&Oe.playerType===n.PlayerTypes.file,forceVideo:!1,tracks:[]},options:Oe.twitchOptions,twitch:{options:{controls:Oe.isShowingNativeControls}},youtube:{playerVars:{cc_load_policy:Number(Oe.cc),controls:So,origin:Oe.parentOrigin}}};return Mt?ka(Fo({},dn),{youtube:ka(Fo({},dn.youtube),{embedOptions:{host:Ca}})}):dn},[Oe.facebookId,So,Oe.playerType,Oe.twitchOptions,Oe.isShowingNativeControls,Oe.cc,Oe.parentOrigin,Mt]),za=(0,e.useMemo)(()=>{const dn=Oe.isFacebook?{}:{left:0,position:"absolute",top:0};return Oe.isShowingNativeControls||(dn.zIndex=-1),dn},[Oe.isFacebook,Oe.isShowingNativeControls]);return e.createElement(fe.Ay,{value:{concurrents:Xn,subtitleOptions:ea,selectedSubtitle:En,setSelectedSubtitle:cn,setSubtitleOptions:Pn,playerState:Oe}},e.createElement(ln,{onLoad:$t}),e.createElement(fn,{hideMuteWarning:Oe.hideMuteWarning||!Ot&&!Oe.playing,isShowingNativeControls:Oe.isShowingNativeControls},(()=>{var dn;if(Oe.hasError)return e.createElement(nn,null,e.createElement(l.A,{stringKey:"ERROR_VIDEO_PLAYBACK"}));const ta=Oe.isFacebook?jn:e.Fragment,bo=Oe.isFacebook?"auto":"100%",Do=Oe.isFacebook?M:"100%";return e.createElement(ta,null,!Oe.isChromaKeyMode&&Oe.video&&e.createElement(y.k,{key:(dn=Oe.video)==null?void 0:dn._id,className:Oe.playerClassName,config:Ua,controls:Oe.isShowingNativeControls,forwardRef:Zn,height:bo,id:D,light:!1,loop:!!wt,muted:Wt||Oe.muted||Oe.forceMute,onDuration:Oe.onDuration,onEnded:Oe.onVideoComplete,onError:Oe.onError,onPause:Oe.onPause,onPlay:Oe.onPlay,onProgress:Oe.updateHighFrequencyState,onReady:zo,playerType:Oe.playerType,playing:Oe.playing,playsinline:!0,selectedSubtitle:En,style:za,url:L.url&&!L.url.includes("token=")?`${L.url}${L.url.includes("?")?"&":"?"}v=${L._id}`:L.url,volume:Oe.forceMute||Wt?0:Oe.volume,width:Do,wrapper:Tn}))})()))}const sr=(0,E.A)()(or)},783969:(ve,x,t)=>{t.d(x,{k:()=>ie});var e=t(63696),n=t(964566),a=t.n(n),d=t(964746),f=t(463302),E=t(224191),y=Object.defineProperty,l=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,m=(q,Z,te)=>Z in q?y(q,Z,{enumerable:!0,configurable:!0,writable:!0,value:te}):q[Z]=te,A=(q,Z)=>{for(var te in Z||(Z={}))I.call(Z,te)&&m(q,te,Z[te]);if(l)for(var te of l(Z))v.call(Z,te)&&m(q,te,Z[te]);return q};const p="Iframe-player-",h=e.forwardRef((q,Z)=>e.createElement("iframe",A({ref:Z},q)));class i extends a(){constructor(){super(...arguments),this.container=null,this.currentTime=0,this.loadTimeout=null,this.playerID=p+o(),this.playTime=null,this.state={loaded:!1},this.getSecondsLoaded=()=>1/0,this.postAccountDataToIframe=()=>{var Z,te;this.state.loaded&&((te=(Z=this.container)==null?void 0:Z.contentWindow)==null||te.postMessage({account:{_id:this.props.userId},location:window.location.href},"*"))},this.ref=Z=>{!this.container&&Z&&this.setState({loaded:!0}),this.container=Z}}
3277static canEnablePIP(){return!1}componentDidMount(){this.load()}componentDidUpdate(Z){Z.url!==this.props.url&&this.load()}componentWillUnmount(){this.loadTimeout&&clearTimeout(this.loadTimeout)}getCurrentTime(){let Z=0;return this.playTime&&(Z=(Date.now()-this.playTime)/1e3),this.currentTime+Z}getDuration(){return 1/0}load(){const{onReady:Z}=this.props,{loaded:te}=this.state;if(te){Z&&Z(this);return}this.loadTimeout=setTimeout(()=>{this.load()},100)}mute(){}pause(){this.currentTime=this.getCurrentTime(),this.playTime=null,this.props.onPause&&this.props.onPause()}play(){this.playTime=Date.now(),this.props.onPlay&&this.props.onPlay()}render(){const Z={height:"100%",width:"100%"},te={alignItems:"center",background:"rgba(255,255,255,0.3)",display:"flex",height:"100%",justifyContent:"center",width:"100%"},Ne={borderStyle:"double",borderWidth:"0px 0px 0px 50px",color:"gray",height:"60px"},{url:fe,playing:_e}=this.props,{loaded:Le}=this.state;return _e||!Le?e.createElement(h,{ref:this.ref,allow:"encrypted-media",allowFullScreen:!0,frameBorder:"0",id:this.playerID,onLoad:this.postAccountDataToIframe,scrolling:"no",src:_e&&typeof fe=="string"?fe.replace(/^iframe:/i,""):void 0,style:Z}):e.createElement("div",{style:Z},e.createElement("div",{style:te},e.createElement("div",{className:"pause",style:Ne})))}stop(){var Z,te;this.currentTime=this.getCurrentTime(),this.playTime=null,(te=(Z=this.props).onPaus)==null||te.call(Z)}unmute(){}}i.displayName="Iframe";const r=q=>({userId:(0,f.F6)(q)});function o(){return Math.random().toString(36).substr(2,5)}const u=(0,E.connect)(r,null,null,{forwardRef:!0})(i);var c=Object.defineProperty,s=Object.defineProperties,g=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,W=(q,Z,te)=>Z in q?c(q,Z,{enumerable:!0,configurable:!0,writable:!0,value:te}):q[Z]=te,w=(q,Z)=>{for(var te in Z||(Z={}))O.call(Z,te)&&W(q,te,Z[te]);if(P)for(var te of P(Z))C.call(Z,te)&&W(q,te,Z[te]);return q},T=(q,Z)=>s(q,g(Z)),Y=(q,Z)=>{var te={};for(var Ne in q)O.call(q,Ne)&&Z.indexOf(Ne)<0&&(te[Ne]=q[Ne]);if(q!=null&&P)for(var Ne of P(q))Z.indexOf(Ne)<0&&C.call(q,Ne)&&(te[Ne]=q[Ne]);return te};if(typeof window<"u"&&window.TimeRanges){const q=window.TimeRanges.prototype.start,Z=window.TimeRanges.prototype.end;window.TimeRanges.prototype.start=function(te){return this.length===0||te>=this.length?0:q.call(this,te)},window.TimeRanges.prototype.end=function(te){return this.length===0||te>=this.length?0:Z.call(this,te)}}const ie=(0,e.memo)(q=>{var Z=q,{playerType:te,config:Ne,forwardRef:fe}=Z,_e=Y(Z,["playerType","config","forwardRef"]),Le;switch(te){case d.PlayerTypes.iframe:return e.createElement(u,w({ref:fe},_e));case d.PlayerTypes.dailymotion:case d.PlayerTypes.facebook:case d.PlayerTypes.mixcloud:case d.PlayerTypes.soundcloud:case d.PlayerTypes.streamable:case d.PlayerTypes.youtube:case d.PlayerTypes.vimeo:case d.PlayerTypes.wistia:case d.PlayerTypes.twitch:return e.createElement(a(),T(w({ref:fe},_e),{config:Ne}));case d.PlayerTypes.livestream:case d.PlayerTypes.file:default:const ct=typeof _e.url=="string"?se(_e.url):void 0;return e.createElement(a(),T(w({ref:fe},_e),{config:(Le=ct?.config)!=null?Le:Ne,url:ct?.url}))}}),se=q=>{if(!/^https\:\/\/stream\.mux\.com/.test(q))return{url:q};const te=new URL(q),Ne=`${te.origin}${te.pathname.replace(/\.m3u8$/,"")}`,fe=te.searchParams,_e=fe.get("token");fe.delete("token");const Le={poster:""};_e&&(Le["playback-token"]=_e);const ct=fe.toString();return ct&&(Le["extra-source-params"]=ct),{url:Ne,config:{mux:{version:"3",attributes:Le}}}}}}]);
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.