import{ag as Z,p as z,m as ne,g as A,L as oe,M as ae,x as se,r as w,b as k,s as j,z as le,e as ie,c as s,w as J,j as re,k as ue,N as ce,O as G,q as de,v as ve,u as fe,a as me,i as $,aa as he,a0 as ge,H as ye,_ as c,$ as T,C as P,a2 as r,F as _,a3 as ke,a4 as x,V as L,a8 as O,a5 as X,a6 as Y,ac as be,a9 as Ve,ab as xe}from"../../assets/main-CbsX0Voe.js";import{t as we}from"./DUP3pgRMEBzXsL9d_HBY.js";import{u as Ce,V as M}from"./H_Rbtcj4I8N4de4hN_eZ.js";import{u as Te,d as Se,e as R,V as Ie}from"./DSZISoEdzjgQTyQw3ngw.js";import{l as Be,n as Pe,h as E,o as Ee,p as _e,q as Le}from"./ByfZnMKtn1DL36CPUZJN.js";import{e as Oe,g as $e,h as He,i as Xe,j as W,f as Ye,b as Me,d as U,c as Re,k as je}from"./BFoGQ1BEUWIOyODT6MgV.js";import{V as We,a as ze}from"./Cf5rxDPKrZn7fN4hQ_E6.js";import{m as K,u as D}from"./B4raF4nqxz_3h9gAYxiJ.js";import{V as N}from"./Cz7RTb5mpIuTXbhlwf4N.js";import{V as Ae}from"./CGZeWPBs4iyAI_AAlpIM.js";import{M as De,V as Fe}from"./BYqSlRVuJjZa0hnoahql.js";import{V as q,a as Ge,b as Ue,c as Ne}from"./_rJddwWSvTSToSs3o6l0.js";import"./B6Ol4GtphlBPz_tVVZtJ.js";import"./psQqChm_c1nlgfS_-G79.js";import"./BjChlKGFVZn29vAvPKVp.js";const qe=e=>{const{touchstartX:o,touchendX:t,touchstartY:n,touchendY:l}=e,d=.5,a=16;e.offsetX=t-o,e.offsetY=l-n,Math.abs(e.offsetY)o+a&&e.right(e)),Math.abs(e.offsetX)n+a&&e.down(e))};function Ze(e,o){var n;const t=e.changedTouches[0];o.touchstartX=t.clientX,o.touchstartY=t.clientY,(n=o.start)==null||n.call(o,{originalEvent:e,...o})}function Je(e,o){var n;const t=e.changedTouches[0];o.touchendX=t.clientX,o.touchendY=t.clientY,(n=o.end)==null||n.call(o,{originalEvent:e,...o}),qe(o)}function Ke(e,o){var n;const t=e.changedTouches[0];o.touchmoveX=t.clientX,o.touchmoveY=t.clientY,(n=o.move)==null||n.call(o,{originalEvent:e,...o})}function Qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const o={touchstartX:0,touchstartY:0,touchendX:0,touchendY:0,touchmoveX:0,touchmoveY:0,offsetX:0,offsetY:0,left:e.left,right:e.right,up:e.up,down:e.down,start:e.start,move:e.move,end:e.end};return{touchstart:t=>Ze(t,o),touchend:t=>Je(t,o),touchmove:t=>Ke(t,o)}}function pe(e,o){var h;const t=o.value,n=t!=null&&t.parent?e.parentElement:e,l=(t==null?void 0:t.options)??{passive:!0},d=(h=o.instance)==null?void 0:h.$.uid;if(!n||!d)return;const a=Qe(o.value);n._touchHandlers=n._touchHandlers??Object.create(null),n._touchHandlers[d]=a,Z(a).forEach(f=>{n.addEventListener(f,a[f],l)})}function et(e,o){var d,a;const t=(d=o.value)!=null&&d.parent?e.parentElement:e,n=(a=o.instance)==null?void 0:a.$.uid;if(!(t!=null&&t._touchHandlers)||!n)return;const l=t._touchHandlers[n];Z(l).forEach(h=>{t.removeEventListener(h,l[h])}),delete t._touchHandlers[n]}const Q={mounted:pe,unmounted:et},p=Symbol.for("vuetify:v-window"),ee=Symbol.for("vuetify:v-window-group"),tt=z({continuous:Boolean,nextIcon:{type:[Boolean,String,Function,Object],default:"$next"},prevIcon:{type:[Boolean,String,Function,Object],default:"$prev"},reverse:Boolean,showArrows:{type:[Boolean,String],validator:e=>typeof e=="boolean"||e==="hover"},touch:{type:[Object,Boolean],default:void 0},direction:{type:String,default:"horizontal"},modelValue:null,disabled:Boolean,selectedClass:{type:String,default:"v-window-item--active"},mandatory:{type:[Boolean,String],default:"force"},...K(),...Be(),...ne()},"VWindow"),nt=A()({name:"VWindow",directives:{Touch:Q},props:tt(),emits:{"update:modelValue":e=>!0},setup(e,o){let{slots:t}=o;const{themeClasses:n}=oe(e),{isRtl:l}=ae(),{t:d}=se(),a=Pe(e,ee),h=w(),f=k(()=>l.value?!e.reverse:e.reverse),y=j(!1),S=k(()=>{const g=e.direction==="vertical"?"y":"x",C=(f.value?!y.value:y.value)?"-reverse":"";return`v-window-${g}${C}-transition`}),B=j(0),I=w(void 0),b=k(()=>a.items.value.findIndex(g=>a.selected.value.includes(g.id)));le(b,(g,V)=>{const C=a.items.value.length,F=C-1;C<=2?y.value=ge.continuous||b.value!==0),m=k(()=>e.continuous||b.value!==a.items.value.length-1);function i(){u.value&&a.prev()}function v(){m.value&&a.next()}const H=k(()=>{const g=[],V={icon:l.value?e.nextIcon:e.prevIcon,class:`v-window__${f.value?"right":"left"}`,onClick:a.prev,"aria-label":d("$vuetify.carousel.prev")};g.push(u.value?t.prev?t.prev({props:V}):s(E,V,null):s("div",null,null));const C={icon:l.value?e.prevIcon:e.nextIcon,class:`v-window__${f.value?"left":"right"}`,onClick:a.next,"aria-label":d("$vuetify.carousel.next")};return g.push(m.value?t.next?t.next({props:C}):s(E,C,null):s("div",null,null)),g}),te=k(()=>e.touch===!1?e.touch:{...{left:()=>{f.value?i():v()},right:()=>{f.value?v():i()},start:V=>{let{originalEvent:C}=V;C.stopPropagation()}},...e.touch===!0?{}:e.touch});return D(()=>J(s(e.tag,{ref:h,class:["v-window",{"v-window--show-arrows-on-hover":e.showArrows==="hover"},n.value,e.class],style:e.style},{default:()=>{var g,V;return[s("div",{class:"v-window__container",style:{height:I.value}},[(g=t.default)==null?void 0:g.call(t,{group:a}),e.showArrows!==!1&&s("div",{class:"v-window__controls"},[H.value])]),(V=t.additional)==null?void 0:V.call(t,{group:a})]}}),[[re("touch"),te.value]])),{group:a}}}),ot=z({reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},...K(),...Ee(),...Oe()},"VWindowItem"),at=A()({name:"VWindowItem",directives:{Touch:Q},props:ot(),emits:{"group:selected":e=>!0},setup(e,o){let{slots:t}=o;const n=ue(p),l=_e(e,ee),{isBooted:d}=Te();if(!n||!l)throw new Error("[Vuetify] VWindowItem must be used inside VWindow");const a=j(!1),h=k(()=>d.value&&(n.isReversed.value?e.reverseTransition!==!1:e.transition!==!1));function f(){!a.value||!n||(a.value=!1,n.transitionCount.value>0&&(n.transitionCount.value-=1,n.transitionCount.value===0&&(n.transitionHeight.value=void 0)))}function y(){var u;a.value||!n||(a.value=!0,n.transitionCount.value===0&&(n.transitionHeight.value=G((u=n.rootRef.value)==null?void 0:u.clientHeight)),n.transitionCount.value+=1)}function S(){f()}function B(u){a.value&&de(()=>{!h.value||!a.value||!n||(n.transitionHeight.value=G(u.clientHeight))})}const I=k(()=>{const u=n.isReversed.value?e.reverseTransition:e.transition;return h.value?{name:typeof u!="string"?n.transition.value:u,onBeforeEnter:y,onAfterEnter:f,onEnterCancelled:S,onBeforeLeave:y,onAfterLeave:f,onLeaveCancelled:S,onEnter:B}:!1}),{hasContent:b}=$e(e,l.isSelected);return D(()=>s(De,{transition:I.value,disabled:!d.value},{default:()=>{var u;return[J(s("div",{class:["v-window-item",l.selectedClass.value,e.class],style:e.style},[b.value&&((u=t.default)==null?void 0:u.call(t))]),[[ce,l.isSelected.value]])]}})),{groupItem:l}}}),st=z({id:String,text:String,...ve(He({closeOnBack:!1,location:"end",locationStrategy:"connected",eager:!0,minWidth:0,offset:10,openOnClick:!1,openOnHover:!0,origin:"auto",scrim:!1,scrollStrategy:"reposition",transition:!1}),["absolute","persistent"])},"VTooltip"),lt=A()({name:"VTooltip",props:st(),emits:{"update:modelValue":e=>!0},setup(e,o){let{slots:t}=o;const n=fe(e,"modelValue"),{scopeId:l}=Xe(),d=me(),a=k(()=>e.id||`v-tooltip-${d}`),h=w(),f=k(()=>e.location.split(" ").length>1?e.location:e.location+" center"),y=k(()=>e.origin==="auto"||e.origin==="overlap"||e.origin.split(" ").length>1||e.location.split(" ").length>1?e.origin:e.origin+" center"),S=k(()=>e.transition?e.transition:n.value?"scale-transition":"fade-transition"),B=k(()=>$({"aria-describedby":a.value},e.activatorProps));return D(()=>{const I=W.filterProps(e);return s(W,$({ref:h,class:["v-tooltip",e.class],style:e.style,id:a.value},I,{modelValue:n.value,"onUpdate:modelValue":b=>n.value=b,transition:S.value,absolute:!0,location:f.value,origin:y.value,persistent:!0,role:"tooltip",activatorProps:B.value,_disableGlobalStack:!0},l),{activator:t.activator,default:function(){var i;for(var b=arguments.length,u=new Array(b),m=0;m{f.value=!0},onFinish:()=>{f.value=!1}})}const B=u=>{d.value=!0,a.value=u};function I(){xe.post("/api/stats/view/add",{token:n.streams.token,id:n.video.hashId,data:{referrer:document.referrer,href:window.location.href,count:1,blocked:!1,ancestorOrigins:null}}).then(function(u){y.value=!0})}const b=u=>{d.value=!1,y.value||I()};return ye(()=>{n.ads.length&&!t().params.nt&&n.ads.forEach(u=>Ce(u))}),(u,m)=>(c(),T(_,null,[s(P(ke),{title:e.video.name},null,8,["title"]),s(Se,{height:"100vh",color:"black"},{default:r(()=>[a.value?(c(),x(M,{key:0},{default:r(()=>{var i;return[s(E,{class:"ma-1","prepend-icon":"mdi-arrow-left",position:"absolute",style:{"z-index":"1"},onClick:m[0]||(m[0]=v=>a.value=null)},{default:r(()=>[L("Back")]),_:1}),s(W,{"model-value":d.value,class:"align-center justify-center"},{default:r(()=>[s(Le,{color:"pink",indeterminate:"",size:"64"})]),_:1},8,["model-value"]),(i=a.value)!=null&&i.adblock?(c(),T("iframe",{key:0,ref_key:"iframe",ref:h,onLoad:m[1]||(m[1]=v=>b(this)),src:a.value.link,frameborder:"0",allowfullscreen:"",width:"100%",height:"100%",style:{background:"black"},sandbox:"allow-scripts allow-same-origin allow-forms allow-presentation allow-orientation-lock"},null,40,it)):(c(),T("iframe",{key:1,ref_key:"iframe",ref:h,onLoad:m[2]||(m[2]=v=>b(this)),src:a.value.link,frameborder:"0",allowfullscreen:"",width:"100%",height:"100%",style:{background:"black"}},null,40,rt))]}),_:1})):(c(),x(Fe,{key:1,src:"https://cdn.max-network.online/"+e.video.poster,gradient:"rgba(16, 16, 23, 0.71), #000000",height:"100%",cover:""},{default:r(()=>[s(We,{color:"rgba(0, 0, 0, 0)"},{append:r(()=>[e.streams.status==="success"?(c(),T(_,{key:0},[P(o)?(c(),x(Me,{key:0},{activator:r(({props:i})=>[s(U,$({variant:"tonal","append-icon":"mdi-menu-down"},i,{rounded:""}),{default:r(()=>[L(O(e.streams.data[l.value].label),1)]),_:2},1040)]),default:r(()=>[s(Re,null,{default:r(()=>[(c(!0),T(_,null,X(e.streams.data,(i,v)=>(c(),x(q,{key:i,title:i.label,active:v===l.value,onClick:H=>l.value=v,link:""},null,8,["title","active","onClick"]))),128))]),_:1})]),_:1})):(c(),x(je,{key:1,modelValue:l.value,"onUpdate:modelValue":m[3]||(m[3]=i=>l.value=i),filter:"",mandatory:""},{default:r(()=>[(c(!0),T(_,null,X(e.streams.data,i=>(c(),x(U,{key:i},{default:r(()=>[L(O(i.label),1)]),_:2},1024))),128))]),_:1},8,["modelValue"])),!P(t)().params.nt&&e.config.access.allow_download?(c(),T("a",{key:2,href:P(t)("files.mirror.show",e.video.hashId),class:"text-decoration-none",target:"_blank"},[s(lt,{text:"Download",location:"bottom"},{activator:r(({props:i})=>[s(E,$(i,{size:"small",color:"surface-variant",variant:"text",icon:"mdi-download"}),null,16)]),_:1})],8,ut)):Y("",!0)],64)):Y("",!0)]),default:r(()=>{var i,v;return[(i=e.config.player)!=null&&i.name?(c(),x(ze,{key:0,text:P(t)().params.nt?"":(v=e.video)==null?void 0:v.name},null,8,["text"])):Y("",!0)]}),_:1}),e.streams.status==="success"?(c(),x(M,{key:0},{default:r(()=>[s(R,{class:"pt-0 pb-0"},{default:r(()=>[e.streams.data.length>0?(c(),x(nt,{key:0,modelValue:l.value,"onUpdate:modelValue":m[4]||(m[4]=i=>l.value=i),direction:"vertical"},{default:r(()=>[(c(!0),T(_,null,X(e.streams.data,i=>(c(),x(at,{key:i},{default:r(()=>[s(Ge,{items:i.mirrors,height:"80vh"},{default:r(({item:v})=>[s(q,{onClick:H=>B(v),class:"mb-1 pa-1 pa-sm-2 mb-sm-2","base-color":"",rounded:"",variant:"tonal",link:""},{prepend:r(()=>[s(Ie,{color:"black",size:"small",image:"https://cdn.max-network.online/mirror/"+v.driver+".png"},null,8,["image"])]),append:r(()=>[s(E,{variant:"tonal",size:"small",icon:"mdi-play"})]),default:r(()=>[s(Ue,null,{default:r(()=>[L(O((v==null?void 0:v.symbol)??v.driver),1)]),_:2},1024),s(Ne,{class:"mt-sm-1"},{default:r(()=>[Ve("span",ct,O(P(we)(v.uploaded_at)),1)]),_:2},1024)]),_:2},1032,["onClick"])]),_:2},1032,["items"])]),_:2},1024))),128))]),_:1},8,["modelValue"])):(c(),x(N,{key:1,text:"The video is mirroring now",type:"error"}))]),_:1})]),_:1})):e.streams.status==="error"?(c(),x(M,{key:1},{default:r(()=>[s(Ae),s(R,null,{default:r(()=>[s(N,{key:"",text:e.streams.msg,type:"error"},null,8,["text"])]),_:1})]),_:1})):(c(),T("div",dt,[s(R,{class:"d-flex align-center justify-center",style:{height:"100vh"}},{default:r(()=>[s(E,{color:"grey-lighten-1",icon:"mdi-play",onClick:S,loading:f.value},null,8,["loading"])]),_:1})]))]),_:1},8,["src"]))]),_:1})],64))}};export{Bt as default};