1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2141],{58671:(e,t,r)=>{Promise.resolve().then(r.bind(r,43863)),Promise.resolve().then(r.bind(r,70983))},70983:(e,t,r)=>{"use strict";r.d(t,{default:()=>y});var a=r(95155),l=r(3298),n=r(26549),s=r(77258),o=r(85998),i=r(65229),d=r(60235),c=r(39867),m=r(12115),u=r(95058),h=r(11131),p=r(29978),x=r(8640),v=r(96093),f=r(27594),g=r(62146),b=r(31332),w=r(39997),j=r(69739);let{useSession:N}=(0,h.M)(),y=e=>{let{movieId:t,movieInfo:r}=e,{data:h}=N(),{onOpen:y}=(0,p.X)(),k=!!h,S=r.imdb_id,_=r.id,D=n.o_&&n.r2,[C,A]=(0,m.useState)(()=>"true"===localStorage.getItem("watchHistoryPaused")),{addItem:E}=(0,u.C)("history",C),{addItem:O,removeItem:P,isInList:I}=(0,u.C)("watchlist",!1),[z,T]=(0,m.useState)(!1),[W,M]=(0,m.useState)(!1),[R,L]=(0,m.useState)(!0),[X,F]=(0,m.useState)(!n.Wm),[H,U]=(0,m.useState)(!1),[K,V,B]=(0,l.y)("currentProvider",n.j_),Y=(0,j.NK)(D,j.Ad),Z=(0,j.N$)(Y.servers,D),G=(0,m.useMemo)(()=>D?[...Z.movie,...n.ip]:[...n.ip],[Z.movie,D]),{orderedProviders:J,draggedName:$,startDragging:q,moveOver:Q,stopDragging:ee,dropOn:et,hasCustomOrder:er,resetOrder:ea,placeFirst:el}=(0,b.JK)(G,"vidbox:server-order:movie",n.o_),en=G.find(e=>e.name===(null==K?void 0:K.name))||n.j_,es=(0,m.useRef)(null),eo=(0,m.useRef)(!1),[ei,ed]=(0,m.useState)(!1),[ec,em]=(0,m.useState)(!0);(0,m.useEffect)(()=>{F(!n.Wm),U(!1),L(!0)},[t]),(0,m.useEffect)(()=>{if(!t||!r||C)return;let e=setTimeout(()=>{E({mediaId:t,mediaType:"movie",title:r.title,backdrop_path:r.backdrop_path,addedAt:new Date().toISOString(),watchedAt:new Date().toISOString(),createdAt:new Date().toISOString()})},1e3);return()=>clearTimeout(e)},[t,r,C,E]),(0,m.useEffect)(()=>{ed((0,s.WW)(t,"movie"))},[t]),(0,m.useEffect)(()=>{if(B||!Y.hydrated)return;let e=G.find(e=>e.name===(null==K?void 0:K.name));e?e!==K&&V(e):V(n.j_)},[K,Y.hydrated,B,G,V]);let eu=e=>{e&&(V(e),M(!1),L(!0))},eh=n.fI&&!n.Wm&&X&&!H,ep=(e,t)=>{if(B||!e)return"";let r="imdb"===e.idType?S:_;if(!r)return"";try{if((0,j.Xe)(e))return(0,j.S8)(e,{id:r,tmdbId:_,imdbId:S});let t=e.url;return e.urlFormat?t=t.replace("{id}",r.toString()):t+=r.toString(),e.extraParams&&(t+=e.extraParams),t}catch(e){return console.error("Error generating provider URL:",e),""}},ex=(0,m.useMemo)(()=>{if(B)return[];try{return[...n.ip,...Z.movie].map(e=>({name:e.name,src:ep(e,t)})).filter(e=>!!e.src)}catch(e){return[]}},[Z.movie,B,t,S,_]);return(0,m.useEffect)(()=>{let e=setTimeout(()=>{let e=[];return ex.slice(0,12).forEach(t=>{let{src:r}=t;try{let t=new URL(r),a=document.createElement("link");a.rel="preconnect",a.href=t.origin,a.crossOrigin="",document.head.appendChild(a),e.push(a);let l=document.createElement("link");l.rel="dns-prefetch",l.href=t.origin,document.head.appendChild(l),e.push(l)}catch(e){}}),()=>e.forEach(e=>e.remove())},0);return()=>clearTimeout(e)},[ex]),(0,m.useEffect)(()=>{if(!R||B||(null==K?void 0:K.name)!=="Max")return;let e=window.setTimeout(()=>{L(!1)},3500);return()=>window.clearTimeout(e)},[null==K?void 0:K.name,R,B]),(0,a.jsx)("div",{className:"min-h-screen pt-16",children:(0,a.jsxs)("div",{className:"mx-auto max-w-screen-xl px-4",children:[(0,a.jsxs)("h1",{className:"truncate pb-5 text-center text-xl font-semibold",children:["Now Watching: ",(0,a.jsx)("span",{className:"font-bold",children:r.title})]}),(0,a.jsxs)("div",{className:(0,s.cn)("mx-auto mb-2 flex w-full items-center rounded-lg text-white shadow-lg backdrop-blur-sm lg:w-3/4 lg:pl-6",ec?"":"hidden"),style:{background:"linear-gradient(90deg, #ff0000 0%, #ff4444 50%, #ff6666 100%)"},children:[(0,a.jsxs)("div",{className:"flex w-full items-center justify-center gap-x-2 p-2 text-sm",children:[(0,a.jsx)(o.A,{className:"h-3 w-3 fill-white"}),(0,a.jsx)("span",{className:"text-[7px] xs:text-[12px] sm:text-[12px] md:text-sm lg:text-base",children:"Please switch to other servers if default server doesnt work."})]}),(0,a.jsx)(i.A,{className:"h-8 w-8 cursor-pointer justify-end pr-2",onClick:()=>em(!1)})]}),(0,a.jsxs)("div",{className:"relative mx-auto h-[400px] w-full rounded-lg bg-black shadow-lg md:aspect-video md:h-full lg:w-3/4 ".concat(W?"overflow-hidden lg:overflow-visible":"overflow-hidden"),children:[(0,a.jsxs)("button",{onClick:()=>M(!W),className:"absolute left-0 right-0 top-0 z-20 mx-auto flex h-10 w-40 items-center justify-center gap-x-2 rounded-b-[12px] bg-gradient-to-r from-blue-600 to-purple-600 text-white transition-all hover:from-blue-700 hover:to-purple-700 shadow-lg hover:shadow-xl backdrop-blur-sm border border-white/20",children:[W?(0,a.jsx)(i.A,{}):(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 md:h-7 md:w-7",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{fill:"currentColor",d:"M20 3H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-5 5h-2V6h2zm4 0h-2V6h2zm1 5H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm-5 5h-2v-2h2zm4 0h-2v-2h2z"})}
1),W?"Close":"Select a server"]}),!B&&(0,a.jsx)("div",{className:"server-sheet-scroll absolute left-0 right-0 top-12 z-30 mx-auto w-fit max-w-[95vw] max-h-[306px] overflow-y-scroll rounded-xl sm:rounded-2xl bg-black/95 backdrop-blur-xl border border-white/10 p-3 sm:p-4 md:p-6 lg:max-h-[460px] text-white transition-all duration-300 shadow-2xl ".concat(W?"scale-100 opacity-100":"pointer-events-none scale-95 opacity-0"),children:(0,a.jsxs)("div",{onTouchStart:e=>{let t=e.touches&&e.touches[0];t&&(es.current={x:t.clientX,y:t.clientY},eo.current=!1)},onTouchMove:e=>{if(!es.current)return;let t=e.touches&&e.touches[0];if(!t)return;let r=Math.abs(t.clientX-es.current.x),a=Math.abs(t.clientY-es.current.y);(r>8||a>8)&&(eo.current=!0)},onTouchEnd:()=>{es.current=null},style:{scrollbarWidth:"thin",scrollbarColor:"#6b7280 transparent",touchAction:"pan-y"},children:[(0,a.jsx)(b.PZ,{enabled:n.o_,visible:er,onReset:ea}),(0,a.jsxs)("div",{className:(0,s.cn)("grid grid-cols-3 gap-2 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6",$&&"[&_*]:!transition-none"),children:[(0,a.jsx)(w.R,{enabled:D,servers:Y.servers,saveServer:Y.saveServer,deleteServer:Y.deleteServer,onSaved:(e,t)=>{t&&e.movie&&el(e.name)},onDeleted:e=>{(null==K?void 0:K.name)===e.name&&(V(n.j_),L(!0))}}),J.map(e=>(0,a.jsxs)("div",{"data-server-name":e.name,onDragOver:e=>{n.o_&&e.preventDefault()},onDragEnter:()=>{n.o_&&Q(e.name)},onDrop:t=>{t.preventDefault(),et(e.name)},className:(0,s.cn)("relative",$===e.name&&"opacity-0"),children:[(0,a.jsxs)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),eu(e)},onTouchEnd:t=>{eo.current||(t.preventDefault(),t.stopPropagation(),eu(e))},className:"group relative w-full rounded-lg sm:rounded-xl px-2 py-2 sm:px-3 sm:py-3 text-xs sm:text-sm font-medium transition-all duration-200 hover:scale-105 active:scale-95 touch-manipulation select-none ".concat(n.o_?"pl-6 sm:pl-7":""," ").concat((null==K?void 0:K.name)===e.name?"bg-gradient-to-r from-blue-600 to-purple-600 shadow-lg shadow-blue-500/25 ring-1 sm:ring-2 ring-blue-400/50":"bg-white/5 border border-white/10 hover:bg-white/10 hover:border-white/20 hover:shadow-lg hover:shadow-white/5"),children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1 sm:gap-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("img",{src:e.countryUrl,alt:"Country",className:"w-4 h-3 sm:w-5 sm:h-4 md:w-6 md:h-4 rounded-sm object-cover shadow-sm"}),(null==K?void 0:K.name)===e.name&&(0,a.jsx)("div",{className:"absolute -top-0.5 -right-0.5 sm:-top-1 sm:-right-1 w-3 h-3 sm:w-4 sm:h-4 bg-green-500 rounded-full flex items-center justify-center",children:(0,a.jsx)("svg",{className:"w-2 h-2 sm:w-2.5 sm:h-2.5 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]}),(0,a.jsx)("span",{className:"text-[10px] sm:text-xs font-semibold text-center leading-tight",children:e.name})]}),(null==K?void 0:K.name)===e.name&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-lg sm:rounded-xl bg-gradient-to-r from-red-600/20 to-red-700/20 animate-pulse"})]}),(0,a.jsx)(b.aX,{providerName:e.name,enabled:n.o_,startDragging:q,moveOver:Q,stopDragging:ee,dropOn:et})]},e.name))]})]})}),!X&&(0,a.jsx)(f.H,{backdropPath:r.backdrop_path,posterPath:r.poster_path,title:r.title,onContinue:()=>{F(!0),L(!0)}}),X&&R&&!B&&r&&(0,a.jsx)(x.G,{posterUrl:(0,v.W9)(r.poster_path,r.backdrop_path),title:r.title}),eh&&(0,a.jsx)("button",{type:"button","aria-label":"Continue to player",className:"absolute inset-0 z-[18] cursor-default border-0 bg-transparent p-0 focus:outline-none",onClick:()=>{U(!0),window.open(n.Zh,"_blank","noopener,noreferrer")}}),X&&!B&&(0,a.jsxs)("div",{className:"absolute left-0 top-0 h-full w-full overflow-hidden rounded-lg bg-black",children:[ex.slice(0,12).map(e=>{let{name:t,src:r}=e,l=en.name===t;return(0,a.jsx)("iframe",{src:l?r:"about:blank",onLoad:()=>{l&&L(!1)},className:"absolute left-0 top-0 h-full w-full bg-black transition-opacity duration-200 ".concat(l?"opacity-100 z-10":"opacity-0 pointer-events-none"," ").concat(W?"pointer-events-none":""),allowFullScreen:!0,allow:l?"autoplay; encrypted-media;
1 picture-in-picture":"",referrerPolicy:"origin","data-provider-name":t},"preload-".concat(t))}),en&&!ex.slice(0,12).some(e=>e.name===en.name)&&(0,a.jsx)("iframe",{src:ep(en,t),onLoad:()=>L(!1),className:"absolute left-0 top-0 h-full w-full bg-black z-10 ".concat(W?"pointer-events-none":"pointer-events-auto"),allowFullScreen:!0,allow:"autoplay; encrypted-media; picture-in-picture",referrerPolicy:"origin"},"active-fallback-".concat(en.name))]})]}),(0,a.jsxs)("div",{className:"relative z-10 mx-auto -mt-[5px] flex w-full items-center justify-center gap-x-4 rounded-b-lg bg-gray-900 py-1 text-sm text-white lg:w-3/4",children:[k?(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-x-1 rounded-md transition-all",onClick:()=>{k&&(z?(P(t,"movie"),T(!1)):(O({mediaId:t,mediaType:"movie",title:r.title,backdrop_path:r.backdrop_path,_id:"",addedAt:new Date().toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),T(!0)))},children:[(0,a.jsx)(d.A,{className:(0,s.cn)("h-4 w-4 rounded",z&&"fill-white")}),(0,a.jsx)("span",{className:"hidden lg:block",children:z?"Remove from Watchlist":"Add to Watchlist"})]}):(0,a.jsxs)("button",{onClick:y,className:"flex cursor-pointer items-center gap-x-1 rounded-md transition-all",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"hidden lg:block",children:"Add to Watchlist"})]}),(0,a.jsx)(g.DownloadDirectAdLink,{href:(0,n.K6)(t,"movie"),children:(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-x-1 rounded-md transition-all",children:[(0,a.jsx)(c.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"hidden lg:block",children:"Download"})]})})]})]})})}}},e=>{e.O(0,[7405,2076,8096,7358],()=>e(e.s=58671)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.