hamrahi-player-library 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,7 +59,7 @@ Take a look at the reducer(s) handling this action type: ${m.type}.
59
59
 
60
60
  Check the render method of \``+fe+"`."}return""}}function Ot(fe){return""}var At={};function Ye(fe){{var Se=Pt();if(!Se){var De=typeof fe=="string"?fe:fe.displayName||fe.name;De&&(Se=`
61
61
 
62
- Check the top-level render call using <`+De+">.")}return Se}}function jt(fe,Se){{if(!fe._store||fe._store.validated||fe.key!=null)return;fe._store.validated=!0;var De=Ye(Se);if(At[De])return;At[De]=!0;var ze="";fe&&fe._owner&&fe._owner!==Rt.current&&(ze=" It was passed a child from "+oe(fe._owner.type)+"."),vt(fe),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',De,ze),vt(null)}}function Mt(fe,Se){{if(typeof fe!="object")return;if(Oe(fe))for(var De=0;De<fe.length;De++){var ze=fe[De];_t(ze)&&jt(ze,Se)}else if(_t(fe))fe._store&&(fe._store.validated=!0);else if(fe){var Qe=v(fe);if(typeof Qe=="function"&&Qe!==fe.entries)for(var Je=Qe.call(fe),Xe;!(Xe=Je.next()).done;)_t(Xe.value)&&jt(Xe.value,Se)}}}function Nt(fe){{var Se=fe.type;if(Se==null||typeof Se=="string")return;var De;if(typeof Se=="function")De=Se.propTypes;else if(typeof Se=="object"&&(Se.$$typeof===l||Se.$$typeof===u))De=Se.propTypes;else return;if(De){var ze=oe(Se);je(De,fe.props,"prop",ze,fe)}else if(Se.PropTypes!==void 0&&!wt){wt=!0;var Qe=oe(Se);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Qe||"Unknown")}typeof Se.getDefaultProps=="function"&&!Se.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ht(fe){{for(var Se=Object.keys(fe.props),De=0;De<Se.length;De++){var ze=Se[De];if(ze!=="children"&&ze!=="key"){vt(fe),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ze),vt(null);break}}fe.ref!==null&&(vt(fe),C("Invalid attribute `ref` supplied to `React.Fragment`."),vt(null))}}function It(fe,Se,De,ze,Qe,Je){{var Xe=M(fe);if(!Xe){var We="";(fe===void 0||typeof fe=="object"&&fe!==null&&Object.keys(fe).length===0)&&(We+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ht=Ot();ht?We+=ht:We+=Pt();var ot;fe===null?ot="null":Oe(fe)?ot="array":fe!==void 0&&fe.$$typeof===e?(ot="<"+(oe(fe.type)||"Unknown")+" />",We=" Did you accidentally export a JSX literal instead of a component?"):ot=typeof fe,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ot,We)}var lt=Et(fe,Se,De,Qe,Je);if(lt==null)return lt;if(Xe){var pt=Se.children;if(pt!==void 0)if(ze)if(Oe(pt)){for(var St=0;St<pt.length;St++)Mt(pt[St],fe);Object.freeze&&Object.freeze(pt)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Mt(pt,fe)}return fe===n?Ht(lt):Nt(lt),lt}}function $t(fe,Se,De){return It(fe,Se,De,!0)}function Dt(fe,Se,De){return It(fe,Se,De,!1)}var Bt=Dt,zt=$t;V$1.Fragment=n,V$1.jsx=Bt,V$1.jsxs=zt}()),V$1}process.env.NODE_ENV==="production"?se.exports=Cr():se.exports=Er();var c$1=se.exports;const xr={undo:"يعود",undoing:"العودة",operationWasUndone:"تمت إرجاع العملية",errorInOperation:"خطأ في التشغيل"},Rr={undo:"undo",undoing:"undoing",operationWasUndone:"The operation was undone",errorInOperation:"error in operation"},Tr={undo:"برگرداندن",undoing:"در حال بازگردانی",operationWasUndone:"عملیات بازگردانده شد",errorInOperation:"خطا در انجام عملیات"},wr=i=>{const e=i.split("-"),t={top:"unset",bottom:"unset",right:"unset",left:"unset"};return e[0]==="top"?t.top=10:t.bottom=10,e[1]==="right"?t.right=10:t.left=10,t},Sr=(i,e)=>i?e!=="unset"?"animate__bounceInLeft":"animate__bounceInRight":e!=="unset"?"animate__bounceOutLeft":"animate__bounceOutRight",ne=i=>Object.fromEntries(Object.entries(i).filter(([e,t])=>t!==void 0)),jr=()=>{let i="xxxxxxxx-xxxx-Mxxx-Nxxx-x".replace(/[xMN]/g,e=>{let t;return e==="M"?t=Math.floor(1+Math.random()*5):e==="N"?t=Math.floor(8+Math.random()*4):t=Math.floor(Math.random()*16),t.toString(16)});return i+=Date.now().toString(16),i},ie=i=>{switch(i){case"en":return Rr;case"ar":return xr;default:return Tr}};var Or=function(){function i(t){this.subscriber=t}var e=i.prototype;return e.remove=function(){this.subscriber&&(this.subscriber.removeSubscription(this),this.subscriber=null)},i}(),kr=Or;function Fr(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}var Pr=kr,Lr=function(i){Fr(e,i);function e(t,n,s){var r;return r=i.call(this,t)||this,r.listener=n,r.context=s,r}return e}(Pr),Me=Lr,$r=process.env.NODE_ENV!=="production"?function(i){if(i===void 0)throw new Error("invariant(...): Second argument must be a string.")}:function(i){};function Nr(i,e){for(var t=arguments.length,n=new Array(t>2?t-2:0),s=2;s<t;s++)n[s-2]=arguments[s];if($r(e),!i){var r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;r=new Error(e.replace(/%s/g,function(){return String(n[a++])})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}var Ie=Nr,$e=Ie,Ar=function(){function i(){this._subscriptionsForType={},this._currentSubscription=null}var e=i.prototype;return e.addSubscription=function(t,n){n.subscriber!==this&&(process.env.NODE_ENV!=="production"?$e(!1,"The subscriber of the subscription is incorrectly set."):$e(!1)),this._subscriptionsForType[t]||(this._subscriptionsForType[t]=[]);var s=this._subscriptionsForType[t].length;return this._subscriptionsForType[t].push(n),n.eventType=t,n.key=s,n},e.removeAllSubscriptions=function(t){t===void 0?this._subscriptionsForType={}:delete this._subscriptionsForType[t]},e.removeSubscription=function(t){var n=t.eventType,s=t.key,r=this._subscriptionsForType[n];r&&delete r[s]},e.getSubscriptionsForType=function(t){return this._subscriptionsForType[t]},i}(),Dr=Ar;function G$1(i){return function(){return i}}var P=function(){};P.thatReturns=G$1,P.thatReturnsFalse=G$1(!1),P.thatReturnsTrue=G$1(!0),P.thatReturnsNull=G$1(null),P.thatReturnsThis=function(){return this},P.thatReturnsArgument=function(i){return i};var Mr=P,Ir=Me,Vr=Dr,Ne=Ie,Wr=Mr,Br=function(){function i(){this._subscriber=new Vr,this._currentSubscription=null}var e=i.prototype;return e.addListener=function(t,n,s){return this._subscriber.addSubscription(t,new Ir(this._subscriber,n,s))},e.once=function(t,n,s){var r=this;return this.addListener(t,function(){r.removeCurrentListener(),n.apply(s,arguments)})},e.removeAllListeners=function(t){this._subscriber.removeAllSubscriptions(t)},e.removeCurrentListener=function(){this._currentSubscription||(process.env.NODE_ENV!=="production"?Ne(!1,"Not in an emitting cycle; there is no current subscription"):Ne(!1)),this._subscriber.removeSubscription(this._currentSubscription)},e.listeners=function(t){var n=this._subscriber.getSubscriptionsForType(t);return n?n.filter(Wr.thatReturnsTrue).map(function(s){return s.listener}):[]},e.emit=function(t){var n=this._subscriber.getSubscriptionsForType(t);if(n){for(var s=Object.keys(n),r=0;r<s.length;r++){var a=s[r],o=n[a];o&&(this._currentSubscription=o,this.__emitToSubscription.apply(this,[o].concat(Array.prototype.slice.call(arguments))))}this._currentSubscription=null}},e.__emitToSubscription=function(t,n){var s=Array.prototype.slice.call(arguments,2);t.listener.apply(t.context,s)},i}(),Ur=Br,Yr={EventEmitter:Ur},Hr=Yr;const W$1=new Hr.EventEmitter,Zr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,style:{marginTop:"1px"},children:[c$1.jsx("path",{className:`${t==="dark"?"fill-red-dark":"fill-red-light"}`,opacity:"0.8",d:"M21.76 15.92L15.36 4.4C14.5 2.85 13.31 2 12 2C10.69 2 9.49998 2.85 8.63998 4.4L2.23998 15.92C1.42998 17.39 1.33998 18.8 1.98998 19.91C2.63998 21.02 3.91998 21.63 5.59998 21.63H18.4C20.08 21.63 21.36 21.02 22.01 19.91C22.66 18.8 22.57 17.38 21.76 15.92Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M12 14.75C11.59 14.75 11.25 14.41 11.25 14V9C11.25 8.59 11.59 8.25 12 8.25C12.41 8.25 12.75 8.59 12.75 9V14C12.75 14.41 12.41 14.75 12 14.75Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M12 18.0005C11.94 18.0005 11.87 17.9905 11.8 17.9805C11.74 17.9705 11.68 17.9505 11.62 17.9205C11.56 17.9005 11.5 17.8705 11.44 17.8305C11.39 17.7905 11.34 17.7505 11.29 17.7105C11.11 17.5205 11 17.2605 11 17.0005C11 16.7405 11.11 16.4805 11.29 16.2905C11.34 16.2505 11.39 16.2105 11.44 16.1705C11.5 16.1305 11.56 16.1005 11.62 16.0805C11.68 16.0505 11.74 16.0305 11.8 16.0205C11.93 15.9905 12.07 15.9905 12.19 16.0205C12.26 16.0305 12.32 16.0505 12.38 16.0805C12.44 16.1005 12.5 16.1305 12.56 16.1705C12.61 16.2105 12.66 16.2505 12.71 16.2905C12.89 16.4805 13 16.7405 13 17.0005C13 17.2605 12.89 17.5205 12.71 17.7105C12.66 17.7505 12.61 17.7905 12.56 17.8305C12.5 17.8705 12.44 17.9005 12.38 17.9205C12.32 17.9505 12.26 17.9705 12.19 17.9805C12.13 17.9905 12.06 18.0005 12 18.0005Z"})]}),qr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,style:{marginTop:"1px"},children:[c$1.jsx("path",{className:`${t==="dark"?"fill-lime-dark":"fill-lime-light"}`,opacity:"0.8",d:"M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M10.5799 15.5796C10.3799 15.5796 10.1899 15.4996 10.0499 15.3596L7.21994 12.5296C6.92994 12.2396 6.92994 11.7596 7.21994 11.4696C7.50994 11.1796 7.98994 11.1796 8.27994 11.4696L10.5799 13.7696L15.7199 8.62961C16.0099 8.33961 16.4899 8.33961 16.7799 8.62961C17.0699 8.91961 17.0699 9.39961 16.7799 9.68961L11.1099 15.3596C10.9699 15.4996 10.7799 15.5796 10.5799 15.5796Z"})]}),Gr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,style:{marginTop:"1px"},children:[c$1.jsx("path",{className:`${t==="dark"?"fill-orange-dark":"fill-orange-light"}`,opacity:"0.8",d:"M16.34 2H7.67C4.28 2 2 4.38 2 7.92V16.09C2 19.62 4.28 22 7.67 22H16.34C19.73 22 22 19.62 22 16.09V7.92C22 4.38 19.73 2 16.34 2Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M11 15.7825V11.3625C11 11.1305 11.0922 10.9079 11.2563 10.7438C11.4204 10.5797 11.6429 10.4875 11.875 10.4875C12.1071 10.4875 12.3296 10.5797 12.4937 10.7438C12.6578 10.9079 12.75 11.1305 12.75 11.3625V15.7825C12.75 16.0146 12.6578 16.2372 12.4937 16.4013C12.3296 16.5654 12.1071 16.6575 11.875 16.6575C11.6429 16.6575 11.4204 16.5654 11.2563 16.4013C11.0922 16.2372 11 16.0146 11 15.7825V15.7825ZM11.005 8.18955C11.0044 8.01539 11.0556 7.84499 11.1522 7.70002C11.2487 7.55505 11.3861 7.44206 11.547 7.37542C11.7079 7.30877 11.885 7.29149 12.0558 7.32576C12.2265 7.36004 12.3832 7.44432 12.506 7.56789C12.6287 7.69147 12.7119 7.84875 12.745 8.01973C12.7781 8.19072 12.7596 8.36769 12.6918 8.52813C12.6241 8.68858 12.5102 8.82525 12.3645 8.92077C12.2189 9.01628 12.0482 9.06633 11.874 9.06455C11.6432 9.06218 11.4227 8.96905 11.26 8.80529C11.0974 8.64154 11.0058 8.42034 11.005 8.18955Z"})]}),Jr=()=>c$1.jsx("div",{className:"promise-loader"}),zr=({type:i,theme:e})=>{let t=c$1.jsx(c$1.Fragment,{});return i==="success"?t=c$1.jsx(qr,{theme:e}):i==="warning"?t=c$1.jsx(Gr,{theme:e}):i==="error"?t=c$1.jsx(Zr,{theme:e}):i==="promise"&&(t=c$1.jsx(Jr,{})),c$1.jsx("div",{style:{flex:"none"},children:t})},Kr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,children:[c$1.jsx("path",{className:`${t==="dark"?"toast_undo-fill-dark":"toast_undo-fill-light"}`,d:"M11.3477 14.2949H5.34766C5.04016 14.2949 4.78516 14.0399 4.78516 13.7324C4.78516 13.4249 5.04016 13.1699 5.34766 13.1699H11.3477C13.1027 13.1699 14.5352 11.7374 14.5352 9.98242C14.5352 8.22742 13.1027 6.79492 11.3477 6.79492H3.09766C2.79016 6.79492 2.53516 6.53992 2.53516 6.23242C2.53516 5.92492 2.79016 5.66992 3.09766 5.66992H11.3477C13.7252 5.66992 15.6602 7.60492 15.6602 9.98242C15.6602 12.3599 13.7252 14.2949 11.3477 14.2949Z"}),c$1.jsx("path",{className:`${t==="dark"?"toast_undo-fill-dark":"toast_undo-fill-light"}`,d:"M4.82242 8.67016C4.67992 8.67016 4.53742 8.61766 4.42492 8.50516L2.50492 6.58516C2.28742 6.36766 2.28742 6.00766 2.50492 5.79016L4.42492 3.87016C4.64242 3.65266 5.00242 3.65266 5.21992 3.87016C5.43742 4.08766 5.43742 4.44766 5.21992 4.66516L3.69742 6.18766L5.21992 7.71016C5.43742 7.92766 5.43742 8.28766 5.21992 8.50516C5.11492 8.61766 4.96492 8.67016 4.82242 8.67016Z"})]}),Xr=({toastInfo:i,callbackFunction:e,theme:t,texts:n,lang:s})=>{const[r,a]=React2.useState(!1),o=()=>{a(!0);const l=e();if(l&&!r){const d=jr();ae({title:n.undoing,type:"promise",id:`toast-promise-${d}`}),l.then(()=>{Ae(`toast-promise-${d}`),ae({...i,title:n.operationWasUndone,type:i.type??"success",callbackFunction:void 0,lang:s})}).catch(()=>{Ae(`toast-promise-${d}`),ae({...i,title:n.errorInOperation,type:"error",callbackFunction:void 0,lang:s})})}else a(!1)};return c$1.jsxs("div",{className:`toast_undo ${t==="dark"?"toast_undo-dark":"toast_undo-light"}`,style:{cursor:r?"default":"pointer"},onClick:r?()=>{}:()=>o(),children:[c$1.jsx(Kr,{theme:t}),c$1.jsx("span",{dir:"auto",children:n.undo})]})},Qr=({type:i,positionX:e,showToast:t,setShowToast:n,autoClose:s,theme:r,isHover:a})=>{const[o,l]=React2.useState(100),d=React2.useRef(null),f=React2.useRef(a);React2.useEffect(()=>{f.current=a},[a]),React2.useEffect(()=>(t&&l(100),s&&t&&(d.current=setInterval(()=>{f.current||l(g=>g-1e3/s)},10)),()=>clearInterval(d.current)),[t]);const u=()=>{clearInterval(d.current),n(!1)};let p;React2.useEffect(()=>(o<=0&&u(),()=>clearTimeout(p)),[o]);let m="";return i==="success"?m=r==="dark"?"toast_progressBar-lime-dark":"toast_progressBar-lime-light":i==="warning"?m=r==="dark"?"toast_progressBar-orange-dark":"toast_progressBar-orange-light":i==="error"&&(m=r==="dark"?"toast_progressBar-red-dark":"toast_progressBar-red-light"),c$1.jsx("div",{className:"toast_progressBar",children:c$1.jsx("div",{style:{left:e==="left"?0:"unset",right:e==="right"?0:"unset",width:`${o}%`},className:`toast_progressBar-inner ${m}`})})},et=({className:i,onClick:e})=>c$1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"none"},className:i,onClick:e,children:c$1.jsx("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"})}),rt=({toastInfo:i,toastPosition:e,toasts:t,setToasts:n,texts:s,lang:r})=>{const[a,o]=React2.useState(!0),[l,d]=React2.useState(!1);React2.useEffect(()=>{let u;return a===!1&&(u=setTimeout(()=>o(void 0),1e3)),()=>clearTimeout(u)},[a]);const f=Sr(a,e.left);return c$1.jsx(c$1.Fragment,{children:a!==void 0&&c$1.jsxs("div",{className:`toast ${r==="en"&&"toast-ltr"} ${i.theme==="dark"?"toast_dark":"toast_light"} animate__animated ${f}`,style:{boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.25)"},id:i.id,onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),children:[c$1.jsx(zr,{type:i.type,theme:i.theme}),c$1.jsx("p",{dir:"auto",className:`toast_title ${r==="en"?"toast_title_ltr":"toast_title_rtl"}`,children:i.title}),i.type!=="promise"&&i.callbackFunction&&c$1.jsx(Xr,{toastInfo:i,callbackFunction:i.callbackFunction,theme:i.theme,toasts:t,setToasts:n,texts:s,lang:r}),i.type!=="promise"&&i.autoClose&&c$1.jsx(Qr,{type:i.type,positionX:e.left!=="unset"?"left":"right",showToast:a,setShowToast:o,autoClose:i.autoClose,theme:i.theme,isHover:l}),i.type!=="promise"&&c$1.jsx(et,{className:`toast_closeIcon ${i.theme==="dark"?"toast_closeIcon-dark":"toast_closeIcon-light"}`,onClick:()=>o(!1)})]})})},nt=i=>{const[e,t]=React2.useState([]),[n,s]=React2.useState(ie(i.lang?i.lang:"fa")),r=React2.useRef({position:"bottom-right",theme:"light",autoClose:5e3,lang:i.lang?i.lang:"fa"});React2.useEffect(()=>(W$1.addListener("toast",o=>{const l=ne(o);let d={};const f={...r.current,...l,id:o.id?`mobin-toast-${o.id}`:void 0};d=ie(f.lang),s(d),t(u=>[...u,f])}),W$1.addListener("closeToast",o=>{t(l=>l.filter(d=>d.id!==`mobin-toast-${o}`))}),()=>W$1.removeAllListeners()),[]),React2.useEffect(()=>{r.current={...r.current,...ne(i)}},[i.theme]),React2.useEffect(()=>{r.current={...r.current,...ne(i)},s(ie(i.lang?i.lang:"fa"))},[i.lang]);const a=wr(r.current.position);return c$1.jsx(c$1.Fragment,{children:e.length?c$1.jsx("div",{className:"toast-wrapper",style:{...a},children:e.map(o=>c$1.jsx(rt,{lang:i.lang,toastInfo:o,toastPosition:a,toasts:e,setToasts:t,texts:n},o.id))}):c$1.jsx(c$1.Fragment,{})})},ae=({id:i,title:e,type:t,position:n,theme:s,autoClose:r,callbackFunction:a,lang:o})=>{W$1.emit("toast",{id:i,title:e,type:t,position:n,theme:s,autoClose:r,callbackFunction:a,lang:o})},Ae=i=>W$1.emit("closeToast",i),firstQuizQuestion=i=>i.questions[0],lastQuizQuestion=(i,e)=>i.questions[i.questions.length-1],lastQuizQuestionStatus=i=>i.questions.length?lastQuizQuestion(i).status:void 0,generalOptionals=["src","googleIndex","snapshot","fullscreen","autoplay","t","h","theme","provider","fullrate","e-cover","cover","uid","user_id","user_ids","preview","isAuth","authentication","site","xToken","width","height","chart","onFinished","showModuleTitle","scrollElementId","onSnapshot","isMarkersChange","featureSet","uuid","handleRedirectCards","homeButtonClickFlag","redirectOnEndedUrl","lang"],allParams=["src","type","id","fullscreen","autoplay","portrait","t","h","isGeneral","raw","theme","provider","fullrate","snapshot","cover","user_id","user_ids","preview","isAuth","authentication","site","e-url","e-cover","width","height","chart","onFinished","shoiwModuleTitle","scrollElementId","onSnapshot","isMarkersChange","quiz","featureSet","uuid","homeButtonClickFlag","redirectOnEndedUrl","lang"],quizConditions={required:["type","quiz","id"],optionals:[...generalOptionals]},isGeneralConditions={required:["type","isGeneral","src"],optionals:[...generalOptionals,"portrait"]},staticConditions={required:["e-url","type"],optionals:[...generalOptionals]},nonStaticConditions={required:["id","type"],optionals:[...generalOptionals,"portrait"]},rawConditions={required:["raw","type","id"],optionals:[...generalOptionals,"portrait"]},conditions=i=>{var Nt;const{trailer:e,params:t,details:n,gif:s,isComplexPortrait:r,isComplexDesktop:a,markers:o,subtitles:l,question:d,emojis:f,onlineViewers:u,alternative_Lives:p,recommendationList:m,multiAudio:g,isLiveError:y,isValidAddress:v,isFetchDetails:b,token:C,selectedOptionId:_,emojiList1:R,emojiList2:E,selectedSubtitle:F,playList:O,videoElementSizeInfo:A,chartPoints:N,isReady:M}=store.getState().videoData,{firstPlay:Z,lock:X,canPlayVideo:oe,qualityLevels:le,manualQuality:de,activeElements:ue,isLoading:ce,isLive:pe,isEnded:he,isAutoPlay:Y,play:ge,isFullScreen:xe,autoQuality:be,showMiniPlayer:Ce,loadedFragmentsCount:ke}=store.getState().controller,{trailerPopover:me,settingPopover:ye,markersListPopover:we,sharePopover:_e,feedbackPopover:Re,multiLivesPopover:Ee,fullRatePopover:ve,autoPlayPopover:qe,recommendListPopover:Ge,speedPopover:tt,tagsPopover:st,personalMarkersPopover:He,bookmarksPopover:Be,chatPopover:Fe,loginPopover:je,chatEmojisPopover:Ve,commentPopover:Oe,playListCardPopover:Ue,playListPopover:Ze,pollPopover:Ke,downloadPopover:it}=store.getState().popovers,{canAddComment:dt,canShowSubmittedComment:xt,commentsCount:mt,comments:ut,commentDefaultMessages:bt}=store.getState().comments,{selectedTags:at,inputTagSearch:Ct}=store.getState().tags,{isLogin:gt,settings:ct,bookmarkId:kt,avatar_url:Et,name:Rt,phone_number:Lt,videoSettings:vt,showContinuousPlayback:wt}=store.getState().user,{chatEnabled:_t,showChat:Pt,defaultMessages:Ot,pinMessage:At}=store.getState().chats,{quiz:Ye,chances:jt}=store.getState().quiz,Mt=store.getState().miniPlayer;switch(i){case ConditionName.showHeader:return!Z&&oe&&!qe;case ConditionName.showMain:return!X||Z;case ConditionName.showFooter:return!Z&&oe;case ConditionName.showGif:return!Z&&t.type==="live"&&ct.poll_emoji&&s;case ConditionName.showElapsedTime:return t.type!=="live"||staticFormats(t.type);case ConditionName.showLiveStatus:return t.type==="live"&&!Z&&!X&&(isIOS()&&isTouchScreenPortrait()||!isIOS())&&!he;case ConditionName.showLiveStatusInComplexPortrait:return t.type==="live"&&!he;case ConditionName.showTouchVolumeBrightness:return!Z&&isTouchScreenLandscape()&&!X&&!he&&t.raw!=="true";case ConditionName.showBackwardForward:return!Z&&isTouchScreen()&&!X&&t.raw!=="true"&&(!he||he&&t.type!=="live");case ConditionName.showPoll:return ct.poll_emoji&&!Z&&d&&d.active&&!X&&t.type==="live"&&(isIOS()&&isTouchScreenPortrait()||!isIOS());case ConditionName.showFullRate:return!staticFormats(t.type)&&!Z&&t.fullrate==="true"&&ve!==void 0;case ConditionName.showTitle:return!staticFormats(t.type)&&t.type!=="live"&&t.isGeneral!=="true"&&!X;case ConditionName.showSnapShot:return!Z&&t.portrait!=="true"&&t.snapshot==="true"&&(!staticFormats(t.type)||isWhiteListUrl(t.src));case ConditionName.showInstagramEmoji:return ct.poll_emoji&&f&&t.type==="live"&&!Z&&!r;case ConditionName.showEmojiComplexPortrait:return ct.poll_emoji&&f&&t.type==="live";case ConditionName.showOnlineViewers:return!!u&&u>0&&(!r||t.quiz==="true");case ConditionName.showMultiLivePopover:return Ee;case ConditionName.showMarkerListPopover:return we;case ConditionName.showFullRatePopover:return ve;case ConditionName.showAutoPlayPopover:return qe&&he&&t.portrait==="true"&&!Ce&&m&&m.length>0;case ConditionName.showRecommendListPopover:return Ge;case ConditionName.showSettingPopover:return ye;case ConditionName.showSpeedPopover:return tt;case ConditionName.showTagsPopover:return st;case ConditionName.showPersonalMarkerPopover:return He;case ConditionName.showBookmarksPopover:return!!Be;case ConditionName.showFeedbackPopover:return Re;case ConditionName.showChatPopover:return!!Fe;case ConditionName.showTrailerPopover:return me;case ConditionName.showLoginPopover:return je;case ConditionName.showAutoPlayListTouchIcon:return he&&!qe&&isTouchScreenLandscape()&&t.portrait==="true"&&!isIOS()&&!X&&m&&m.length>0;case ConditionName.showMultiLive:return p&&p.length>0&&ct.poll_emoji;case ConditionName.showBigReplayIcon:return he&&t.portrait==="true"&&isTouchScreen()&&(isIOS()&&isTouchScreenPortrait()||!isIOS());case ConditionName.showReplayIcon:return t.portrait==="true"&&!isIOS()&&!isTouchScreen()&&Ce!==!0;case ConditionName.showPlayNextIcon:return t.portrait==="true"&&!isIOS()&&(!isTouchScreen()||isTouchScreenLandscape())&&t.isGeneral!=="true"&&Ce!==!0;case ConditionName.showAutoPlayToggleIcon:return t.portrait==="true"&&t.isGeneral!=="true"&&(isIOS()&&isTouchScreenPortrait()||!isIOS())&&Ce!==!0;case ConditionName.showSettingIcon:return!staticFormats(t.type)&&!isIOS();case ConditionName.showLikeDislike:return!staticFormats(t.type)&&t.portrait==="true"&&t.isGeneral!=="true"&&!a&&!r;case ConditionName.showBanner:return Z&&n.banner;case ConditionName.showBannerStaticFiles:return Z&&t.cover;case ConditionName.showSpeedIcon:return t.type!=="live";case ConditionName.showShareInSetting:return!r&&!a;case ConditionName.showPlayListIcon:return O&&O.length>0&&(xe||!xe&&t.portrait!=="true")&&Ce!==!0;case ConditionName.showPlayListTabTouchscreen:return O&&O.length>0&&isTouchScreen();case ConditionName.showCommentComponent:return dt||!dt&&mt>0;case ConditionName.showModuleTitle:return t.showModuleTitle==="true";case ConditionName.showProgressbar:return!(isIOS()&&t.type==="live")&&!(t.type==="live"&&he);case ConditionName.showAgeClassification:return n.pg_state&&!X;case ConditionName.showChat:return t.type==="live"&&_t&&Pt;case ConditionName.showMiniPlayer:return Ce;case ConditionName.showPictureInPicture:return Ce!==!0&&!isIOS()&&t.site!=="zarebin.ir";case ConditionName.showPersonalMarker:return t.authentication==="true"&&(t.featureSet===void 0||t.featureSet.personalMarker!=="false");case ConditionName.showFeedback:return t.featureSet===void 0||t.featureSet.feedback!=="false";case ConditionName.trackerEnabled:return(t.featureSet===void 0||t.featureSet.enableTracker!=="false")&&t.quiz!=="true";case ConditionName.showTabNavigator:return t.authentication==="true"&&(t.featureSet===void 0||t.featureSet.profileFooter!=="false");case ConditionName.showBookmark:return t.authentication==="true"&&(t.featureSet===void 0||t.featureSet.bookmark!=="false");case ConditionName.shareButton:return t.featureSet===void 0||t.featureSet.shareButton!=="false";case ConditionName.showCommentSection:return t.featureSet===void 0||t.featureSet.showCommentSection!=="false";case ConditionName.showVideoUploadTime:return t.featureSet===void 0||t.featureSet.videoUploadTime!=="false";case ConditionName.showVideoViewers:return t.featureSet===void 0||t.featureSet.videoViewers!=="false";case ConditionName.showRecommendationList:return t.featureSet===void 0||t.featureSet.recommendationList!=="false";case ConditionName.showPlaylist:return t.featureSet===void 0||t.featureSet.playlist!=="false";case ConditionName.show_Chat:return t.featureSet===void 0||t.featureSet.chat!=="false";case ConditionName.showSubtitle:return!!F&&(!Ce||isFullMobilePortrait());case ConditionName.hidePopovers:return!we&&!ye&&!Re&&!_e&&!Ee;case ConditionName.isRaw:return t.raw;case ConditionName.isParamsPortrait:return t.portrait==="true";case ConditionName.isComplexPortrait:return r;case ConditionName.isComplexDarkModePortrait:return r&&t.theme==="dark";case ConditionName.isComplexDesktop:return a;case ConditionName.isLandscape:return window.innerHeight<=window.innerWidth;case ConditionName.isTouchScreen:return isTouchScreen();case ConditionName.isTouchScreenPortrait:return isTouchScreenPortrait();case ConditionName.isTouchScreenLandscape:return isTouchScreenLandscape();case ConditionName.isActiveElements:return ue;case ConditionName.isPlay:return ge;case ConditionName.isPlayMiniPlayer:return Mt.play;case ConditionName.isFirstPlay:return Z;case ConditionName.isLock:return X;case ConditionName.isIOS:return isIOS();case ConditionName.isIOSLive:return isIOS()&&t.type==="live";case ConditionName.isLoading:return ce;case ConditionName.isLive:return pe;case ConditionName.isLiveParam:return t.type==="live";case ConditionName.isLiveError:return y;case ConditionName.isDarkMode:return t.theme==="dark";case ConditionName.isStaticFormat:return staticFormats(t.type);case ConditionName.isEnded:return he;case ConditionName.isAutoPlay:return Y;case ConditionName.isFullScreen:return xe;case ConditionName.isGeneral:return t.isGeneral==="true";case ConditionName.isValidAddress:return v;case ConditionName.isFetchDetails:return b;case ConditionName.isAutoQuality:return ct.quality===-1;case ConditionName.isAuth:return C&&t.isAuth==="true";case ConditionName.isChildClassification:return n.pg_state&&n.pg_state<14;case ConditionName.isTeenagerClassification:return n.pg_state&&n.pg_state>=14&&n.pg_state<18;case ConditionName.isYoungClassification:return n.pg_state&&n.pg_state>=18;case ConditionName.isSelectedSubtitle:return!!l&&l.length>0&&F;case ConditionName.isZarebinSite:return t.site==="zarebin.ir";case ConditionName.isUserIdsParamsEqualAll:return!!t.user_ids&&t.user_ids==="all";case ConditionName.isMiniPlayer:return(t.portrait!=="true"||Ce)&&A.width<520;case ConditionName.isFullMobilePortrait:return isFullMobilePortrait();case ConditionName.isLogin:return gt;case ConditionName.isSpinSettingsIcon:return ct.quality===-1?be===void 0:ct.quality!==de;case ConditionName.isVttFitHeight:return A.height<600||isTouchScreen();case ConditionName.isBookmark:return kt!==void 0;case ConditionName.isPressKeySpace:return!X;case ConditionName.isPressKeyK:return!X;case ConditionName.isPressKeyI:return!X&&!Z&&!Ce;case ConditionName.isPressKeyF:return!X&&!Z&&!Ce;case ConditionName.isPressKeyS:return t.type!=="live"&&!X&&!Z;case ConditionName.isPressKeyC:return!X&&!Z&&!Ce&&!!l&&l.length>0;case ConditionName.isPressKeyArrowRight:return!Z&&!X;case ConditionName.isPressKeyArrowLeft:return!Z&&!X;case ConditionName.isPressKeyL:return!Z;case ConditionName.isPressKeyN:return m&&m.length>0&&!Z&&!X;case ConditionName.isPressKeyQ:return p&&p.length>0&&!Z&&!X;case ConditionName.isPressKeyE:return o.length!==0&&!Z&&!X;case ConditionName.isPressKeyM:return!Z&&!X;case ConditionName.isSendTimelineLog:return!staticFormats(t.type);case ConditionName.isPointsQuiz:return!!Ye&&Object.keys(Ye).length>0&&Ye.type===QuizTypes.Points;case ConditionName.isReady:return M;case ConditionName.isProduction:return getStatus()==="production";case ConditionName.isPaymentSuccess:return getStatus()==="production";case ConditionName.isPopoverOpen:return[we,ye,_e,Re,Ee,Ke,qe,Ge,st,tt,Ze,Ue,Oe,He,Be,Fe,Ve,me,je,it].some(Bt=>!!Bt);case ConditionName.isOnPermise:return envs.onPermise==="true";case ConditionName.isArabicLang:return t.lang===Lang.ar;case ConditionName.backgroundColorInLightMode:return a||r;case ConditionName.heightScreen:return!r&&!a&&!t.height;case ConditionName.playByClickPoster:return Z&&n.banner&&!wt;case ConditionName.hasMarkers:return o.length!==0;case ConditionName.hasTitle:return n.title;case ConditionName.hasDescription:return n.description;case ConditionName.hasClipboard:return navigator&&navigator.clipboard&&navigator.clipboard.writeText;case ConditionName.hasRecommendationList:return m&&m.length>0;case ConditionName.hasTags:return n.tag;case ConditionName.hasPreviewTime:return t.preview==="true";case ConditionName.hasEmojis:return f;case ConditionName.hasEmojiList1Or2:return f&&!!f.emoji_list_1||f&&!!f.emoji_list_2;case ConditionName.hasBanner:return n.banner;case ConditionName.hasMultiAudio:return g.length>0;case ConditionName.hasDownloadLinks:return n.download_links.length>0&&(t.featureSet===void 0||t.featureSet.downloadUrl!=="false");case ConditionName.hasStreamLink:return n.stream_link;case ConditionName.hasPoll:return d&&Object.keys(d).length>0;case ConditionName.hasUserIds:return!!t.user_ids;case ConditionName.hasAlternativeLives:return p&&p.length>0;case ConditionName.hasManualQuality:return de!=null;case ConditionName.hasSound:return!!ct.volume;case ConditionName.hasVtt:return!!n.vtt||!!n.vtt_mobile;case ConditionName.hasAutoPlay:return t.autoplay==="true";case ConditionName.hasPlayList:return O&&O.length>0&&(isTouchScreen()&&Ze||!isTouchScreen());case ConditionName.hasXToken:return!!t.xToken;case ConditionName.hasMovieDetails:return n.content_type!==null&&n.content_type!==void 0;case ConditionName.hasMovieContentType:return n.content_type!==null;case ConditionName.hasMovieReleaseYear:return!!n.release_year;case ConditionName.hasIMDB:return n.imdb_rate!==null;case ConditionName.hasSelectedTags:return!!at.length;case ConditionName.hasInputTagSearch:return!!Ct;case ConditionName.hasFullScreenParams:return t.fullscreen==="true";case ConditionName.hasPreviewParams:return t.preview==="true";case ConditionName.hasChart:return t.chart==="true"&&!staticFormats(t.type);case ConditionName.hasChartPoints:return!!N.length;case ConditionName.hasOnFinishedParams:return!!t.onFinished;case ConditionName.hasOnSnapshotParams:return!!t.onSnapshot;case ConditionName.hasXTokenParamOrSendXToken:const It=new URLSearchParams(window.location.search).get("xToken"),$t=api.get("xToken");return!!It||!!$t;case ConditionName.hasUserAvatar:return!!Et;case ConditionName.hasUserName:return!!Rt;case ConditionName.hasUserPhoneNumber:return!!Lt;case ConditionName.hasScrollElementId:return!!t.scrollElementId&&Ce!==void 0&&(a||t.portrait==="false")&&!isTouchScreen();case ConditionName.hasSportProvider:return t.provider==="sport";case ConditionName.hasSidebar:const Dt=document.getElementById("__container");return a&&(O&&O.length>0&&(t.featureSet===void 0||t.featureSet.playlist!=="false")||t.featureSet===void 0||t.featureSet.chat!=="false"||m&&m.length>0&&(t.featureSet===void 0||t.featureSet.recommendationList!=="false")||gt)&&(Dt?Dt.getBoundingClientRect().width:window.innerWidth)>900;case ConditionName.isBeforeRequest_Playlist_Chat_Recommendation:return t.type!=="live"&&O===void 0&&(t.featureSet===void 0||t.featureSet.playlist!=="false")||(t.featureSet===void 0||t.featureSet.recommendationList!=="false")&&m===void 0;case ConditionName.isBeforeRequestComments:return ut===void 0&&!isTouchScreen()&&(dt||!dt&&mt>0);case ConditionName.isVisibilityChange:return t.type==="live"&&!document.pictureInPictureElement;case ConditionName.hasTrailer:return e.length!==0;case ConditionName.hasHParam:return t.h==="true";case ConditionName.hasPreviewStart:return n.preview_start;case ConditionName.hasPreviewEnd:return n.preview_end;case ConditionName.hasSubtitles:return!!l&&l.length>0&&t.quiz!=="true";case ConditionName.hasSubtitlesInDetails:return n.subtitles&&n.subtitles.length>0&&t.quiz!=="true";case ConditionName.hasHomeButtonClickFlag:return!!t.homeButtonClickFlag;case ConditionName.hasContinuousPlayback:return!!vt.time&&wt&&!t.t&&((Nt=t.featureSet)==null?void 0:Nt.continuousPlayback)==="true";case ConditionName.hasPermittedLoadedFragment:return ke.length>=Number(getInitialLoadedFragmentCount());case ConditionName.hasAllParams:return allParams.length===Object.keys(VideoDataSliceState.params).length;case ConditionName.hasDefaultMessages:return!!Ot.length;case ConditionName.hasPinMessage:return!!At;case ConditionName.hasCommentDefaultMessages:return!!bt&&!!bt.length;case ConditionName.hasActiveCue:return F&&F.activeCues&&F.activeCues.length>0;case ConditionName.hasTimeMachine:return t.type!=="live"||t.type==="live"&&n.time_machine!==null;case ConditionName.has360:return!!n.is_360;case ConditionName.hasRedirectOnEndedUrlParams:return!!t.redirectOnEndedUrl;case ConditionName.hasDaaniTokenParams:return!!t.daaniToken;case ConditionName.getRecommendationList:return t.portrait==="true"&&t.quiz!=="true"&&b;case ConditionName.getLiveDetailsInIntervals:return y&&t.type==="live"&&t.isGeneral!=="true";case ConditionName.getDetails:return!!t.type&&t.id&&t.isGeneral!=="true";case ConditionName.getMarkers:return["vod","archive","clip"].includes(String(t.type))&&t.id&&t.isGeneral!=="true"&&t.quiz!=="true"&&!t.hideMarkers&&b;case ConditionName.getPlayList:return!staticFormats(t.type)&&t.type!=="live"&&!isFullMobilePortrait()&&b;case ConditionName.firstGetDataIntervalAPI:return t.type==="live"&&t.isGeneral!=="true";case ConditionName.getUserSetting:return gt&&t.quiz!=="true"&&b;case ConditionName.getVideoMetaData:return gt&&t.quiz!=="true"&&b;case ConditionName.getUserProfile:return!!t.xToken&&b;case ConditionName.footerPaddingZero:return t.type!=="live"||t.type==="live"&&isTouchScreen()||isTouchScreenPortrait();case ConditionName.manaulPostAPI:return!!_||R.length>0||E.length>0;case ConditionName.canAccessVideo:return!!(t.h==="true"&&getAccessToken());case ConditionName.canAddComment:return dt;case ConditionName.canShowSubmittedComment:return xt;case ConditionName.canPlayVideo:return oe;case ConditionName.chatEnabled:return _t;case ConditionName.filterLastGif:return+le[le.length-2]==+le[ct.quality===-1?be??de:de];case ConditionName.instagramEmojiAnimation:return!isTouchScreen()||isTouchScreen()&&!ue;case ConditionName.handleOverflowHidden:return!a||a&&xe;case ConditionName.thresholdOnlineViewers:return!!u&&u>=n.online_viewer_threshold;case ConditionName.setSubtitleFirstPlay:return n.subtitles&&n.subtitles.length>0&&!Z&&!staticFormats(t.type);case ConditionName.showQuizPopover:return t.xToken||firstQuizQuestion(Ye);case ConditionName.isQuizStatusEqual1:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions.length>0&&lastQuizQuestionStatus(Ye)===1;case ConditionName.isQuizStatusEqual2:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions.length>0&&lastQuizQuestionStatus(Ye)===2;case ConditionName.isQuizStatusEqual4:return!!(Ye&&Object.keys(Ye).length>0&&Ye.questions&&Ye.questions.length>0&&lastQuizQuestionStatus(Ye)===4);case ConditionName.isQuizEnd:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions&&Ye.number_of_questions===Ye.questions.length&&lastQuizQuestionStatus(Ye)===4;case ConditionName.hasQuizParams:return t.quiz==="true";case ConditionName.hasQuiz:return!!Ye&&Object.keys(Ye).length>0&&!Z;case ConditionName.hasQuizQuestion:return!!Ye&&Ye.questions&&Ye.questions.length;case ConditionName.hasChances:return jt!==-1;case ConditionName.sendUserTrackerRequest:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions.length===0&&!Z&&t.xToken}},whiteListTargets=getWhiteListTargets().split(","),whiteListGeneralUrl=getWhiteListGeneralUrl().split(","),activeElementsTime=3e3,showLoaderTime=3e3,livePlayRetryDuration=3e3,RetryCountGeneralDataFetch=3,RetryTimeDelayGeneralDataFetch=5,durationWatched=60,continuousePlaybackIntervalTime=6e4,footerPadding=()=>conditions(ConditionName.footerPaddingZero)?0:64,featureToggle="ft",sidebarWidth=357,LiveDelay=6,LiveWindow=12,videoTag=()=>document.getElementById("player-tag"),miniPlayerVideoTag=()=>document.getElementById("mini-player-video-tag"),multiLiveVideo=()=>document.getElementById("multilive-player"),progressBar=()=>document.getElementById("time-progress-bar"),progressBarWidth=()=>store.getState().videoData.videoElementSizeInfo.width-2*footerPadding(),seenPoll=()=>JSON.parse(localStorage.getItem("seen-poll")),livePoll=()=>JSON.parse(localStorage.getItem("live-poll"));/*! *****************************************************************************
62
+ Check the top-level render call using <`+De+">.")}return Se}}function jt(fe,Se){{if(!fe._store||fe._store.validated||fe.key!=null)return;fe._store.validated=!0;var De=Ye(Se);if(At[De])return;At[De]=!0;var ze="";fe&&fe._owner&&fe._owner!==Rt.current&&(ze=" It was passed a child from "+oe(fe._owner.type)+"."),vt(fe),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',De,ze),vt(null)}}function Mt(fe,Se){{if(typeof fe!="object")return;if(Oe(fe))for(var De=0;De<fe.length;De++){var ze=fe[De];_t(ze)&&jt(ze,Se)}else if(_t(fe))fe._store&&(fe._store.validated=!0);else if(fe){var Qe=v(fe);if(typeof Qe=="function"&&Qe!==fe.entries)for(var Je=Qe.call(fe),Xe;!(Xe=Je.next()).done;)_t(Xe.value)&&jt(Xe.value,Se)}}}function Nt(fe){{var Se=fe.type;if(Se==null||typeof Se=="string")return;var De;if(typeof Se=="function")De=Se.propTypes;else if(typeof Se=="object"&&(Se.$$typeof===l||Se.$$typeof===u))De=Se.propTypes;else return;if(De){var ze=oe(Se);je(De,fe.props,"prop",ze,fe)}else if(Se.PropTypes!==void 0&&!wt){wt=!0;var Qe=oe(Se);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Qe||"Unknown")}typeof Se.getDefaultProps=="function"&&!Se.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ht(fe){{for(var Se=Object.keys(fe.props),De=0;De<Se.length;De++){var ze=Se[De];if(ze!=="children"&&ze!=="key"){vt(fe),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ze),vt(null);break}}fe.ref!==null&&(vt(fe),C("Invalid attribute `ref` supplied to `React.Fragment`."),vt(null))}}function It(fe,Se,De,ze,Qe,Je){{var Xe=M(fe);if(!Xe){var We="";(fe===void 0||typeof fe=="object"&&fe!==null&&Object.keys(fe).length===0)&&(We+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ht=Ot();ht?We+=ht:We+=Pt();var ot;fe===null?ot="null":Oe(fe)?ot="array":fe!==void 0&&fe.$$typeof===e?(ot="<"+(oe(fe.type)||"Unknown")+" />",We=" Did you accidentally export a JSX literal instead of a component?"):ot=typeof fe,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ot,We)}var lt=Et(fe,Se,De,Qe,Je);if(lt==null)return lt;if(Xe){var pt=Se.children;if(pt!==void 0)if(ze)if(Oe(pt)){for(var St=0;St<pt.length;St++)Mt(pt[St],fe);Object.freeze&&Object.freeze(pt)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Mt(pt,fe)}return fe===n?Ht(lt):Nt(lt),lt}}function $t(fe,Se,De){return It(fe,Se,De,!0)}function Dt(fe,Se,De){return It(fe,Se,De,!1)}var Bt=Dt,zt=$t;V$1.Fragment=n,V$1.jsx=Bt,V$1.jsxs=zt}()),V$1}process.env.NODE_ENV==="production"?se.exports=Cr():se.exports=Er();var c$1=se.exports;const xr={undo:"يعود",undoing:"العودة",operationWasUndone:"تمت إرجاع العملية",errorInOperation:"خطأ في التشغيل"},Rr={undo:"undo",undoing:"undoing",operationWasUndone:"The operation was undone",errorInOperation:"error in operation"},Tr={undo:"برگرداندن",undoing:"در حال بازگردانی",operationWasUndone:"عملیات بازگردانده شد",errorInOperation:"خطا در انجام عملیات"},wr=i=>{const e=i.split("-"),t={top:"unset",bottom:"unset",right:"unset",left:"unset"};return e[0]==="top"?t.top=10:t.bottom=10,e[1]==="right"?t.right=10:t.left=10,t},Sr=(i,e)=>i?e!=="unset"?"animate__bounceInLeft":"animate__bounceInRight":e!=="unset"?"animate__bounceOutLeft":"animate__bounceOutRight",ne=i=>Object.fromEntries(Object.entries(i).filter(([e,t])=>t!==void 0)),jr=()=>{let i="xxxxxxxx-xxxx-Mxxx-Nxxx-x".replace(/[xMN]/g,e=>{let t;return e==="M"?t=Math.floor(1+Math.random()*5):e==="N"?t=Math.floor(8+Math.random()*4):t=Math.floor(Math.random()*16),t.toString(16)});return i+=Date.now().toString(16),i},ie=i=>{switch(i){case"en":return Rr;case"ar":return xr;default:return Tr}};var Or=function(){function i(t){this.subscriber=t}var e=i.prototype;return e.remove=function(){this.subscriber&&(this.subscriber.removeSubscription(this),this.subscriber=null)},i}(),kr=Or;function Fr(i,e){i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.__proto__=e}var Pr=kr,Lr=function(i){Fr(e,i);function e(t,n,s){var r;return r=i.call(this,t)||this,r.listener=n,r.context=s,r}return e}(Pr),Me=Lr,$r=process.env.NODE_ENV!=="production"?function(i){if(i===void 0)throw new Error("invariant(...): Second argument must be a string.")}:function(i){};function Nr(i,e){for(var t=arguments.length,n=new Array(t>2?t-2:0),s=2;s<t;s++)n[s-2]=arguments[s];if($r(e),!i){var r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;r=new Error(e.replace(/%s/g,function(){return String(n[a++])})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}var Ie=Nr,$e=Ie,Ar=function(){function i(){this._subscriptionsForType={},this._currentSubscription=null}var e=i.prototype;return e.addSubscription=function(t,n){n.subscriber!==this&&(process.env.NODE_ENV!=="production"?$e(!1,"The subscriber of the subscription is incorrectly set."):$e(!1)),this._subscriptionsForType[t]||(this._subscriptionsForType[t]=[]);var s=this._subscriptionsForType[t].length;return this._subscriptionsForType[t].push(n),n.eventType=t,n.key=s,n},e.removeAllSubscriptions=function(t){t===void 0?this._subscriptionsForType={}:delete this._subscriptionsForType[t]},e.removeSubscription=function(t){var n=t.eventType,s=t.key,r=this._subscriptionsForType[n];r&&delete r[s]},e.getSubscriptionsForType=function(t){return this._subscriptionsForType[t]},i}(),Dr=Ar;function G$1(i){return function(){return i}}var P=function(){};P.thatReturns=G$1,P.thatReturnsFalse=G$1(!1),P.thatReturnsTrue=G$1(!0),P.thatReturnsNull=G$1(null),P.thatReturnsThis=function(){return this},P.thatReturnsArgument=function(i){return i};var Mr=P,Ir=Me,Vr=Dr,Ne=Ie,Wr=Mr,Br=function(){function i(){this._subscriber=new Vr,this._currentSubscription=null}var e=i.prototype;return e.addListener=function(t,n,s){return this._subscriber.addSubscription(t,new Ir(this._subscriber,n,s))},e.once=function(t,n,s){var r=this;return this.addListener(t,function(){r.removeCurrentListener(),n.apply(s,arguments)})},e.removeAllListeners=function(t){this._subscriber.removeAllSubscriptions(t)},e.removeCurrentListener=function(){this._currentSubscription||(process.env.NODE_ENV!=="production"?Ne(!1,"Not in an emitting cycle; there is no current subscription"):Ne(!1)),this._subscriber.removeSubscription(this._currentSubscription)},e.listeners=function(t){var n=this._subscriber.getSubscriptionsForType(t);return n?n.filter(Wr.thatReturnsTrue).map(function(s){return s.listener}):[]},e.emit=function(t){var n=this._subscriber.getSubscriptionsForType(t);if(n){for(var s=Object.keys(n),r=0;r<s.length;r++){var a=s[r],o=n[a];o&&(this._currentSubscription=o,this.__emitToSubscription.apply(this,[o].concat(Array.prototype.slice.call(arguments))))}this._currentSubscription=null}},e.__emitToSubscription=function(t,n){var s=Array.prototype.slice.call(arguments,2);t.listener.apply(t.context,s)},i}(),Ur=Br,Yr={EventEmitter:Ur},Hr=Yr;const W$1=new Hr.EventEmitter,Zr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,style:{marginTop:"1px"},children:[c$1.jsx("path",{className:`${t==="dark"?"fill-red-dark":"fill-red-light"}`,opacity:"0.8",d:"M21.76 15.92L15.36 4.4C14.5 2.85 13.31 2 12 2C10.69 2 9.49998 2.85 8.63998 4.4L2.23998 15.92C1.42998 17.39 1.33998 18.8 1.98998 19.91C2.63998 21.02 3.91998 21.63 5.59998 21.63H18.4C20.08 21.63 21.36 21.02 22.01 19.91C22.66 18.8 22.57 17.38 21.76 15.92Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M12 14.75C11.59 14.75 11.25 14.41 11.25 14V9C11.25 8.59 11.59 8.25 12 8.25C12.41 8.25 12.75 8.59 12.75 9V14C12.75 14.41 12.41 14.75 12 14.75Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M12 18.0005C11.94 18.0005 11.87 17.9905 11.8 17.9805C11.74 17.9705 11.68 17.9505 11.62 17.9205C11.56 17.9005 11.5 17.8705 11.44 17.8305C11.39 17.7905 11.34 17.7505 11.29 17.7105C11.11 17.5205 11 17.2605 11 17.0005C11 16.7405 11.11 16.4805 11.29 16.2905C11.34 16.2505 11.39 16.2105 11.44 16.1705C11.5 16.1305 11.56 16.1005 11.62 16.0805C11.68 16.0505 11.74 16.0305 11.8 16.0205C11.93 15.9905 12.07 15.9905 12.19 16.0205C12.26 16.0305 12.32 16.0505 12.38 16.0805C12.44 16.1005 12.5 16.1305 12.56 16.1705C12.61 16.2105 12.66 16.2505 12.71 16.2905C12.89 16.4805 13 16.7405 13 17.0005C13 17.2605 12.89 17.5205 12.71 17.7105C12.66 17.7505 12.61 17.7905 12.56 17.8305C12.5 17.8705 12.44 17.9005 12.38 17.9205C12.32 17.9505 12.26 17.9705 12.19 17.9805C12.13 17.9905 12.06 18.0005 12 18.0005Z"})]}),qr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,style:{marginTop:"1px"},children:[c$1.jsx("path",{className:`${t==="dark"?"fill-lime-dark":"fill-lime-light"}`,opacity:"0.8",d:"M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M10.5799 15.5796C10.3799 15.5796 10.1899 15.4996 10.0499 15.3596L7.21994 12.5296C6.92994 12.2396 6.92994 11.7596 7.21994 11.4696C7.50994 11.1796 7.98994 11.1796 8.27994 11.4696L10.5799 13.7696L15.7199 8.62961C16.0099 8.33961 16.4899 8.33961 16.7799 8.62961C17.0699 8.91961 17.0699 9.39961 16.7799 9.68961L11.1099 15.3596C10.9699 15.4996 10.7799 15.5796 10.5799 15.5796Z"})]}),Gr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,style:{marginTop:"1px"},children:[c$1.jsx("path",{className:`${t==="dark"?"fill-orange-dark":"fill-orange-light"}`,opacity:"0.8",d:"M16.34 2H7.67C4.28 2 2 4.38 2 7.92V16.09C2 19.62 4.28 22 7.67 22H16.34C19.73 22 22 19.62 22 16.09V7.92C22 4.38 19.73 2 16.34 2Z"}),c$1.jsx("path",{className:"fill_gray_color",d:"M11 15.7825V11.3625C11 11.1305 11.0922 10.9079 11.2563 10.7438C11.4204 10.5797 11.6429 10.4875 11.875 10.4875C12.1071 10.4875 12.3296 10.5797 12.4937 10.7438C12.6578 10.9079 12.75 11.1305 12.75 11.3625V15.7825C12.75 16.0146 12.6578 16.2372 12.4937 16.4013C12.3296 16.5654 12.1071 16.6575 11.875 16.6575C11.6429 16.6575 11.4204 16.5654 11.2563 16.4013C11.0922 16.2372 11 16.0146 11 15.7825V15.7825ZM11.005 8.18955C11.0044 8.01539 11.0556 7.84499 11.1522 7.70002C11.2487 7.55505 11.3861 7.44206 11.547 7.37542C11.7079 7.30877 11.885 7.29149 12.0558 7.32576C12.2265 7.36004 12.3832 7.44432 12.506 7.56789C12.6287 7.69147 12.7119 7.84875 12.745 8.01973C12.7781 8.19072 12.7596 8.36769 12.6918 8.52813C12.6241 8.68858 12.5102 8.82525 12.3645 8.92077C12.2189 9.01628 12.0482 9.06633 11.874 9.06455C11.6432 9.06218 11.4227 8.96905 11.26 8.80529C11.0974 8.64154 11.0058 8.42034 11.005 8.18955Z"})]}),Jr=()=>c$1.jsx("div",{className:"promise-loader"}),zr=({type:i,theme:e})=>{let t=c$1.jsx(c$1.Fragment,{});return i==="success"?t=c$1.jsx(qr,{theme:e}):i==="warning"?t=c$1.jsx(Gr,{theme:e}):i==="error"?t=c$1.jsx(Zr,{theme:e}):i==="promise"&&(t=c$1.jsx(Jr,{})),c$1.jsx("div",{style:{flex:"none"},children:t})},Kr=({className:i,onClick:e,theme:t})=>c$1.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,onClick:e,children:[c$1.jsx("path",{className:`${t==="dark"?"toast_undo-fill-dark":"toast_undo-fill-light"}`,d:"M11.3477 14.2949H5.34766C5.04016 14.2949 4.78516 14.0399 4.78516 13.7324C4.78516 13.4249 5.04016 13.1699 5.34766 13.1699H11.3477C13.1027 13.1699 14.5352 11.7374 14.5352 9.98242C14.5352 8.22742 13.1027 6.79492 11.3477 6.79492H3.09766C2.79016 6.79492 2.53516 6.53992 2.53516 6.23242C2.53516 5.92492 2.79016 5.66992 3.09766 5.66992H11.3477C13.7252 5.66992 15.6602 7.60492 15.6602 9.98242C15.6602 12.3599 13.7252 14.2949 11.3477 14.2949Z"}),c$1.jsx("path",{className:`${t==="dark"?"toast_undo-fill-dark":"toast_undo-fill-light"}`,d:"M4.82242 8.67016C4.67992 8.67016 4.53742 8.61766 4.42492 8.50516L2.50492 6.58516C2.28742 6.36766 2.28742 6.00766 2.50492 5.79016L4.42492 3.87016C4.64242 3.65266 5.00242 3.65266 5.21992 3.87016C5.43742 4.08766 5.43742 4.44766 5.21992 4.66516L3.69742 6.18766L5.21992 7.71016C5.43742 7.92766 5.43742 8.28766 5.21992 8.50516C5.11492 8.61766 4.96492 8.67016 4.82242 8.67016Z"})]}),Xr=({toastInfo:i,callbackFunction:e,theme:t,texts:n,lang:s})=>{const[r,a]=React2.useState(!1),o=()=>{a(!0);const l=e();if(l&&!r){const d=jr();ae({title:n.undoing,type:"promise",id:`toast-promise-${d}`}),l.then(()=>{Ae(`toast-promise-${d}`),ae({...i,title:n.operationWasUndone,type:i.type??"success",callbackFunction:void 0,lang:s})}).catch(()=>{Ae(`toast-promise-${d}`),ae({...i,title:n.errorInOperation,type:"error",callbackFunction:void 0,lang:s})})}else a(!1)};return c$1.jsxs("div",{className:`toast_undo ${t==="dark"?"toast_undo-dark":"toast_undo-light"}`,style:{cursor:r?"default":"pointer"},onClick:r?()=>{}:()=>o(),children:[c$1.jsx(Kr,{theme:t}),c$1.jsx("span",{dir:"auto",children:n.undo})]})},Qr=({type:i,positionX:e,showToast:t,setShowToast:n,autoClose:s,theme:r,isHover:a})=>{const[o,l]=React2.useState(100),d=React2.useRef(null),f=React2.useRef(a);React2.useEffect(()=>{f.current=a},[a]),React2.useEffect(()=>(t&&l(100),s&&t&&(d.current=setInterval(()=>{f.current||l(g=>g-1e3/s)},10)),()=>clearInterval(d.current)),[t]);const u=()=>{clearInterval(d.current),n(!1)};let p;React2.useEffect(()=>(o<=0&&u(),()=>clearTimeout(p)),[o]);let m="";return i==="success"?m=r==="dark"?"toast_progressBar-lime-dark":"toast_progressBar-lime-light":i==="warning"?m=r==="dark"?"toast_progressBar-orange-dark":"toast_progressBar-orange-light":i==="error"&&(m=r==="dark"?"toast_progressBar-red-dark":"toast_progressBar-red-light"),c$1.jsx("div",{className:"toast_progressBar",children:c$1.jsx("div",{style:{left:e==="left"?0:"unset",right:e==="right"?0:"unset",width:`${o}%`},className:`toast_progressBar-inner ${m}`})})},et=({className:i,onClick:e})=>c$1.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"none"},className:i,onClick:e,children:c$1.jsx("path",{d:"M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"})}),rt=({toastInfo:i,toastPosition:e,toasts:t,setToasts:n,texts:s,lang:r})=>{const[a,o]=React2.useState(!0),[l,d]=React2.useState(!1);React2.useEffect(()=>{let u;return a===!1&&(u=setTimeout(()=>o(void 0),1e3)),()=>clearTimeout(u)},[a]);const f=Sr(a,e.left);return c$1.jsx(c$1.Fragment,{children:a!==void 0&&c$1.jsxs("div",{className:`toast ${r==="en"&&"toast-ltr"} ${i.theme==="dark"?"toast_dark":"toast_light"} animate__animated ${f}`,style:{boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.25)"},id:i.id,onMouseOver:()=>d(!0),onMouseOut:()=>d(!1),children:[c$1.jsx(zr,{type:i.type,theme:i.theme}),c$1.jsx("p",{dir:"auto",className:`toast_title ${r==="en"?"toast_title_ltr":"toast_title_rtl"}`,children:i.title}),i.type!=="promise"&&i.callbackFunction&&c$1.jsx(Xr,{toastInfo:i,callbackFunction:i.callbackFunction,theme:i.theme,toasts:t,setToasts:n,texts:s,lang:r}),i.type!=="promise"&&i.autoClose&&c$1.jsx(Qr,{type:i.type,positionX:e.left!=="unset"?"left":"right",showToast:a,setShowToast:o,autoClose:i.autoClose,theme:i.theme,isHover:l}),i.type!=="promise"&&c$1.jsx(et,{className:`toast_closeIcon ${i.theme==="dark"?"toast_closeIcon-dark":"toast_closeIcon-light"}`,onClick:()=>o(!1)})]})})},nt=i=>{const[e,t]=React2.useState([]),[n,s]=React2.useState(ie(i.lang?i.lang:"fa")),r=React2.useRef({position:"bottom-right",theme:"light",autoClose:5e3,lang:i.lang?i.lang:"fa"});React2.useEffect(()=>(W$1.addListener("toast",o=>{const l=ne(o);let d={};const f={...r.current,...l,id:o.id?`mobin-toast-${o.id}`:void 0};d=ie(f.lang),s(d),t(u=>[...u,f])}),W$1.addListener("closeToast",o=>{t(l=>l.filter(d=>d.id!==`mobin-toast-${o}`))}),()=>W$1.removeAllListeners()),[]),React2.useEffect(()=>{r.current={...r.current,...ne(i)}},[i.theme]),React2.useEffect(()=>{r.current={...r.current,...ne(i)},s(ie(i.lang?i.lang:"fa"))},[i.lang]);const a=wr(r.current.position);return c$1.jsx(c$1.Fragment,{children:e.length?c$1.jsx("div",{className:"toast-wrapper",style:{...a},children:e.map(o=>c$1.jsx(rt,{lang:i.lang,toastInfo:o,toastPosition:a,toasts:e,setToasts:t,texts:n},o.id))}):c$1.jsx(c$1.Fragment,{})})},ae=({id:i,title:e,type:t,position:n,theme:s,autoClose:r,callbackFunction:a,lang:o})=>{W$1.emit("toast",{id:i,title:e,type:t,position:n,theme:s,autoClose:r,callbackFunction:a,lang:o})},Ae=i=>W$1.emit("closeToast",i),firstQuizQuestion=i=>i.questions[0],lastQuizQuestion=(i,e)=>i.questions[i.questions.length-1],lastQuizQuestionStatus=i=>i.questions.length?lastQuizQuestion(i).status:void 0,generalOptionals=["src","googleIndex","snapshot","fullscreen","autoplay","t","h","theme","provider","fullrate","e-cover","cover","uid","user_id","user_ids","preview","isAuth","authentication","site","xToken","width","height","chart","onFinished","showModuleTitle","scrollElementId","onSnapshot","isMarkersChange","featureSet","uuid","handleRedirectCards","homeButtonClickFlag","redirectOnEndedUrl","lang"],allParams=["src","type","id","fullscreen","autoplay","portrait","t","h","isGeneral","raw","theme","provider","fullrate","snapshot","cover","user_id","user_ids","preview","isAuth","authentication","site","e-url","e-cover","width","height","chart","onFinished","shoiwModuleTitle","scrollElementId","onSnapshot","isMarkersChange","quiz","featureSet","uuid","homeButtonClickFlag","redirectOnEndedUrl","lang"],quizConditions={required:["type","quiz","id"],optionals:[...generalOptionals]},isGeneralConditions={required:["type","isGeneral","src"],optionals:[...generalOptionals,"portrait"]},staticConditions={required:["e-url","type"],optionals:[...generalOptionals]},nonStaticConditions={required:["id","type"],optionals:[...generalOptionals,"portrait"]},rawConditions={required:["raw","type","id"],optionals:[...generalOptionals,"portrait"]},conditions=i=>{var Nt;const{trailer:e,params:t,details:n,gif:s,isComplexPortrait:r,isComplexDesktop:a,markers:o,subtitles:l,question:d,emojis:f,onlineViewers:u,alternative_Lives:p,recommendationList:m,multiAudio:g,isLiveError:y,isValidAddress:v,isFetchDetails:b,token:C,selectedOptionId:_,emojiList1:R,emojiList2:E,selectedSubtitle:F,playList:O,videoElementSizeInfo:A,chartPoints:N,isReady:M}=store.getState().videoData,{firstPlay:Z,lock:X,canPlayVideo:oe,qualityLevels:le,manualQuality:de,activeElements:ue,isLoading:ce,isLive:pe,isEnded:he,isAutoPlay:Y,play:ge,isFullScreen:xe,autoQuality:be,showMiniPlayer:Ce,loadedFragmentsCount:ke}=store.getState().controller,{trailerPopover:me,settingPopover:ye,markersListPopover:we,sharePopover:_e,feedbackPopover:Re,multiLivesPopover:Ee,fullRatePopover:ve,autoPlayPopover:qe,recommendListPopover:Ge,speedPopover:tt,tagsPopover:st,personalMarkersPopover:He,bookmarksPopover:Be,chatPopover:Fe,loginPopover:je,chatEmojisPopover:Ve,commentPopover:Oe,playListCardPopover:Ue,playListPopover:Ze,pollPopover:Ke,downloadPopover:it}=store.getState().popovers,{canAddComment:dt,canShowSubmittedComment:xt,commentsCount:mt,comments:ut,commentDefaultMessages:bt}=store.getState().comments,{selectedTags:at,inputTagSearch:Ct}=store.getState().tags,{isLogin:gt,settings:ct,bookmarkId:kt,avatar_url:Et,name:Rt,phone_number:Lt,videoSettings:vt,showContinuousPlayback:wt}=store.getState().user,{chatEnabled:_t,showChat:Pt,defaultMessages:Ot,pinMessage:At}=store.getState().chats,{quiz:Ye,chances:jt}=store.getState().quiz,Mt=store.getState().miniPlayer;switch(i){case ConditionName.showHeader:return!Z&&oe&&!qe;case ConditionName.showMain:return!X||Z;case ConditionName.showFooter:return!Z&&oe;case ConditionName.showGif:return!Z&&t.type==="live"&&ct.poll_emoji&&s;case ConditionName.showElapsedTime:return t.type!=="live"||staticFormats(t.type);case ConditionName.showLiveStatus:return t.type==="live"&&!Z&&!X&&(isIOS()&&isTouchScreenPortrait()||!isIOS())&&!he;case ConditionName.showLiveStatusInComplexPortrait:return t.type==="live"&&!he;case ConditionName.showTouchVolumeBrightness:return!Z&&isTouchScreenLandscape()&&!X&&!he&&t.raw!=="true";case ConditionName.showBackwardForward:return!Z&&isTouchScreen()&&!X&&t.raw!=="true"&&(!he||he&&t.type!=="live");case ConditionName.showPoll:return ct.poll_emoji&&!Z&&d&&d.active&&!X&&t.type==="live"&&(isIOS()&&isTouchScreenPortrait()||!isIOS());case ConditionName.showFullRate:return!staticFormats(t.type)&&!Z&&t.fullrate==="true"&&ve!==void 0;case ConditionName.showTitle:return!staticFormats(t.type)&&t.type!=="live"&&t.isGeneral!=="true"&&!X;case ConditionName.showSnapShot:return!Z&&t.portrait!=="true"&&t.snapshot==="true"&&(!staticFormats(t.type)||isWhiteListUrl(t.src));case ConditionName.showInstagramEmoji:return ct.poll_emoji&&f&&t.type==="live"&&!Z&&!r;case ConditionName.showEmojiComplexPortrait:return ct.poll_emoji&&f&&t.type==="live";case ConditionName.showOnlineViewers:return!!u&&u>0&&(!r||t.quiz==="true");case ConditionName.showMultiLivePopover:return Ee;case ConditionName.showMarkerListPopover:return we;case ConditionName.showFullRatePopover:return ve;case ConditionName.showAutoPlayPopover:return qe&&he&&t.portrait==="true"&&!Ce&&m&&m.length>0;case ConditionName.showRecommendListPopover:return Ge;case ConditionName.showSettingPopover:return ye;case ConditionName.showSpeedPopover:return tt;case ConditionName.showTagsPopover:return st;case ConditionName.showPersonalMarkerPopover:return He;case ConditionName.showBookmarksPopover:return!!Be;case ConditionName.showFeedbackPopover:return Re;case ConditionName.showChatPopover:return!!Fe;case ConditionName.showTrailerPopover:return me;case ConditionName.showLoginPopover:return je;case ConditionName.showAutoPlayListTouchIcon:return he&&!qe&&isTouchScreenLandscape()&&t.portrait==="true"&&!isIOS()&&!X&&m&&m.length>0;case ConditionName.showMultiLive:return p&&p.length>0&&ct.poll_emoji;case ConditionName.showBigReplayIcon:return he&&t.portrait==="true"&&isTouchScreen()&&(isIOS()&&isTouchScreenPortrait()||!isIOS());case ConditionName.showReplayIcon:return t.portrait==="true"&&!isIOS()&&!isTouchScreen()&&Ce!==!0;case ConditionName.showPlayNextIcon:return t.portrait==="true"&&!isIOS()&&(!isTouchScreen()||isTouchScreenLandscape())&&t.isGeneral!=="true"&&Ce!==!0;case ConditionName.showAutoPlayToggleIcon:return t.portrait==="true"&&t.isGeneral!=="true"&&(isIOS()&&isTouchScreenPortrait()||!isIOS())&&Ce!==!0;case ConditionName.showSettingIcon:return!staticFormats(t.type)&&!isIOS();case ConditionName.showLikeDislike:return!staticFormats(t.type)&&t.portrait==="true"&&t.isGeneral!=="true"&&!a&&!r;case ConditionName.showBanner:return Z&&n.banner;case ConditionName.showBannerStaticFiles:return Z&&t.cover;case ConditionName.showSpeedIcon:return t.type!=="live";case ConditionName.showShareInSetting:return!r&&!a;case ConditionName.showPlayListIcon:return O&&O.length>0&&(xe||!xe&&t.portrait!=="true")&&Ce!==!0;case ConditionName.showPlayListTabTouchscreen:return O&&O.length>0&&isTouchScreen();case ConditionName.showCommentComponent:return dt||!dt&&mt>0;case ConditionName.showModuleTitle:return t.showModuleTitle==="true";case ConditionName.showProgressbar:return!(isIOS()&&t.type==="live")&&!(t.type==="live"&&he);case ConditionName.showAgeClassification:return n.pg_state&&!X;case ConditionName.showChat:return t.type==="live"&&_t&&Pt;case ConditionName.showMiniPlayer:return Ce;case ConditionName.showPictureInPicture:return Ce!==!0&&!isIOS()&&t.site!=="zarebin.ir";case ConditionName.showPersonalMarker:return t.authentication==="true"&&(t.featureSet===void 0||t.featureSet.personalMarker!=="false");case ConditionName.showFeedback:return t.featureSet===void 0||t.featureSet.feedback!=="false";case ConditionName.trackerEnabled:return(t.featureSet===void 0||t.featureSet.enableTracker!=="false")&&t.quiz!=="true";case ConditionName.showTabNavigator:return t.authentication==="true"&&(t.featureSet===void 0||t.featureSet.profileFooter!=="false");case ConditionName.showBookmark:return t.authentication==="true"&&(t.featureSet===void 0||t.featureSet.bookmark!=="false");case ConditionName.shareButton:return t.featureSet===void 0||t.featureSet.shareButton!=="false";case ConditionName.showCommentSection:return t.featureSet===void 0||t.featureSet.showCommentSection!=="false";case ConditionName.showVideoUploadTime:return t.featureSet===void 0||t.featureSet.videoUploadTime!=="false";case ConditionName.showVideoViewers:return t.featureSet===void 0||t.featureSet.videoViewers!=="false";case ConditionName.showRecommendationList:return t.featureSet===void 0||t.featureSet.recommendationList!=="false";case ConditionName.showPlaylist:return t.featureSet===void 0||t.featureSet.playlist!=="false";case ConditionName.show_Chat:return t.featureSet===void 0||t.featureSet.chat!=="false";case ConditionName.showSubtitle:return!!F&&(!Ce||isFullMobilePortrait());case ConditionName.hidePopovers:return!we&&!ye&&!Re&&!_e&&!Ee;case ConditionName.isRaw:return t.raw;case ConditionName.isParamsPortrait:return t.portrait==="true";case ConditionName.isComplexPortrait:return r;case ConditionName.isComplexDarkModePortrait:return r&&t.theme==="dark";case ConditionName.isComplexDesktop:return a;case ConditionName.isLandscape:return window.innerHeight<=window.innerWidth;case ConditionName.isTouchScreen:return isTouchScreen();case ConditionName.isTouchScreenPortrait:return isTouchScreenPortrait();case ConditionName.isTouchScreenLandscape:return isTouchScreenLandscape();case ConditionName.isActiveElements:return ue;case ConditionName.isPlay:return ge;case ConditionName.isPlayMiniPlayer:return Mt.play;case ConditionName.isFirstPlay:return Z;case ConditionName.isLock:return X;case ConditionName.isIOS:return isIOS();case ConditionName.isIOSLive:return isIOS()&&t.type==="live";case ConditionName.isLoading:return ce;case ConditionName.isLive:return pe;case ConditionName.isLiveParam:return t.type==="live";case ConditionName.isLiveError:return y;case ConditionName.isDarkMode:return t.theme==="dark";case ConditionName.isStaticFormat:return staticFormats(t.type);case ConditionName.isEnded:return he;case ConditionName.isAutoPlay:return Y;case ConditionName.isFullScreen:return xe;case ConditionName.isGeneral:return t.isGeneral==="true";case ConditionName.isValidAddress:return v;case ConditionName.isFetchDetails:return b;case ConditionName.isAutoQuality:return ct.quality===-1;case ConditionName.isAuth:return C&&t.isAuth==="true";case ConditionName.isChildClassification:return n.pg_state&&n.pg_state<14;case ConditionName.isTeenagerClassification:return n.pg_state&&n.pg_state>=14&&n.pg_state<18;case ConditionName.isYoungClassification:return n.pg_state&&n.pg_state>=18;case ConditionName.isSelectedSubtitle:return!!l&&l.length>0&&F;case ConditionName.isZarebinSite:return t.site==="zarebin.ir";case ConditionName.isUserIdsParamsEqualAll:return!!t.user_ids&&t.user_ids==="all";case ConditionName.isMiniPlayer:return(t.portrait!=="true"||Ce)&&A.width<520&&!t.disableMiniPlayer;case ConditionName.isFullMobilePortrait:return t.disableMiniPlayer&&isTouchScreenPortrait()||isFullMobilePortrait();case ConditionName.isLogin:return gt;case ConditionName.isSpinSettingsIcon:return ct.quality===-1?be===void 0:ct.quality!==de;case ConditionName.isVttFitHeight:return A.height<600||isTouchScreen();case ConditionName.isBookmark:return kt!==void 0;case ConditionName.isPressKeySpace:return!X;case ConditionName.isPressKeyK:return!X;case ConditionName.isPressKeyI:return!X&&!Z&&!Ce;case ConditionName.isPressKeyF:return!X&&!Z&&!Ce;case ConditionName.isPressKeyS:return t.type!=="live"&&!X&&!Z;case ConditionName.isPressKeyC:return!X&&!Z&&!Ce&&!!l&&l.length>0;case ConditionName.isPressKeyArrowRight:return!Z&&!X;case ConditionName.isPressKeyArrowLeft:return!Z&&!X;case ConditionName.isPressKeyL:return!Z;case ConditionName.isPressKeyN:return m&&m.length>0&&!Z&&!X;case ConditionName.isPressKeyQ:return p&&p.length>0&&!Z&&!X;case ConditionName.isPressKeyE:return o.length!==0&&!Z&&!X;case ConditionName.isPressKeyM:return!Z&&!X;case ConditionName.isSendTimelineLog:return!staticFormats(t.type);case ConditionName.isPointsQuiz:return!!Ye&&Object.keys(Ye).length>0&&Ye.type===QuizTypes.Points;case ConditionName.isReady:return M;case ConditionName.isProduction:return getStatus()==="production";case ConditionName.isPaymentSuccess:return getStatus()==="production";case ConditionName.isPopoverOpen:return[we,ye,_e,Re,Ee,Ke,qe,Ge,st,tt,Ze,Ue,Oe,He,Be,Fe,Ve,me,je,it].some(Bt=>!!Bt);case ConditionName.isOnPermise:return envs.onPermise==="true";case ConditionName.isArabicLang:return t.lang===Lang.ar;case ConditionName.backgroundColorInLightMode:return a||r;case ConditionName.heightScreen:return!r&&!a&&!t.height;case ConditionName.playByClickPoster:return Z&&n.banner&&!wt;case ConditionName.hasMarkers:return o.length!==0;case ConditionName.hasTitle:return n.title;case ConditionName.hasDescription:return n.description;case ConditionName.hasClipboard:return navigator&&navigator.clipboard&&navigator.clipboard.writeText;case ConditionName.hasRecommendationList:return m&&m.length>0;case ConditionName.hasTags:return n.tag;case ConditionName.hasPreviewTime:return t.preview==="true";case ConditionName.hasEmojis:return f;case ConditionName.hasEmojiList1Or2:return f&&!!f.emoji_list_1||f&&!!f.emoji_list_2;case ConditionName.hasBanner:return n.banner;case ConditionName.hasMultiAudio:return g.length>0;case ConditionName.hasDownloadLinks:return n.download_links.length>0&&(t.featureSet===void 0||t.featureSet.downloadUrl!=="false");case ConditionName.hasStreamLink:return n.stream_link;case ConditionName.hasPoll:return d&&Object.keys(d).length>0;case ConditionName.hasUserIds:return!!t.user_ids;case ConditionName.hasAlternativeLives:return p&&p.length>0;case ConditionName.hasManualQuality:return de!=null;case ConditionName.hasSound:return!!ct.volume;case ConditionName.hasVtt:return!!n.vtt||!!n.vtt_mobile;case ConditionName.hasAutoPlay:return t.autoplay==="true";case ConditionName.hasPlayList:return O&&O.length>0&&(isTouchScreen()&&Ze||!isTouchScreen());case ConditionName.hasXToken:return!!t.xToken;case ConditionName.hasMovieDetails:return n.content_type!==null&&n.content_type!==void 0;case ConditionName.hasMovieContentType:return n.content_type!==null;case ConditionName.hasMovieReleaseYear:return!!n.release_year;case ConditionName.hasIMDB:return n.imdb_rate!==null;case ConditionName.hasSelectedTags:return!!at.length;case ConditionName.hasInputTagSearch:return!!Ct;case ConditionName.hasFullScreenParams:return t.fullscreen==="true";case ConditionName.hasPreviewParams:return t.preview==="true";case ConditionName.hasChart:return t.chart==="true"&&!staticFormats(t.type);case ConditionName.hasChartPoints:return!!N.length;case ConditionName.hasOnFinishedParams:return!!t.onFinished;case ConditionName.hasOnSnapshotParams:return!!t.onSnapshot;case ConditionName.hasXTokenParamOrSendXToken:const It=new URLSearchParams(window.location.search).get("xToken"),$t=api.get("xToken");return!!It||!!$t;case ConditionName.hasUserAvatar:return!!Et;case ConditionName.hasUserName:return!!Rt;case ConditionName.hasUserPhoneNumber:return!!Lt;case ConditionName.hasScrollElementId:return!!t.scrollElementId&&Ce!==void 0&&(a||t.portrait==="false")&&!isTouchScreen();case ConditionName.hasSportProvider:return t.provider==="sport";case ConditionName.hasSidebar:const Dt=document.getElementById("__container");return a&&(O&&O.length>0&&(t.featureSet===void 0||t.featureSet.playlist!=="false")||t.featureSet===void 0||t.featureSet.chat!=="false"||m&&m.length>0&&(t.featureSet===void 0||t.featureSet.recommendationList!=="false")||gt)&&(Dt?Dt.getBoundingClientRect().width:window.innerWidth)>900;case ConditionName.isBeforeRequest_Playlist_Chat_Recommendation:return t.type!=="live"&&O===void 0&&(t.featureSet===void 0||t.featureSet.playlist!=="false")||(t.featureSet===void 0||t.featureSet.recommendationList!=="false")&&m===void 0;case ConditionName.isBeforeRequestComments:return ut===void 0&&!isTouchScreen()&&(dt||!dt&&mt>0);case ConditionName.isVisibilityChange:return t.type==="live"&&!document.pictureInPictureElement;case ConditionName.hasTrailer:return e.length!==0;case ConditionName.hasHParam:return t.h==="true";case ConditionName.hasPreviewStart:return n.preview_start;case ConditionName.hasPreviewEnd:return n.preview_end;case ConditionName.hasSubtitles:return!!l&&l.length>0&&t.quiz!=="true";case ConditionName.hasSubtitlesInDetails:return n.subtitles&&n.subtitles.length>0&&t.quiz!=="true";case ConditionName.hasHomeButtonClickFlag:return!!t.homeButtonClickFlag;case ConditionName.hasContinuousPlayback:return!!vt.time&&wt&&!t.t&&((Nt=t.featureSet)==null?void 0:Nt.continuousPlayback)==="true";case ConditionName.hasPermittedLoadedFragment:return ke.length>=Number(getInitialLoadedFragmentCount());case ConditionName.hasAllParams:return allParams.length===Object.keys(VideoDataSliceState.params).length;case ConditionName.hasDefaultMessages:return!!Ot.length;case ConditionName.hasPinMessage:return!!At;case ConditionName.hasCommentDefaultMessages:return!!bt&&!!bt.length;case ConditionName.hasActiveCue:return F&&F.activeCues&&F.activeCues.length>0;case ConditionName.hasTimeMachine:return t.type!=="live"||t.type==="live"&&n.time_machine!==null;case ConditionName.has360:return!!n.is_360;case ConditionName.hasRedirectOnEndedUrlParams:return!!t.redirectOnEndedUrl;case ConditionName.hasDaaniTokenParams:return!!t.daaniToken;case ConditionName.getRecommendationList:return t.portrait==="true"&&t.quiz!=="true"&&b;case ConditionName.getLiveDetailsInIntervals:return y&&t.type==="live"&&t.isGeneral!=="true";case ConditionName.getDetails:return!!t.type&&t.id&&t.isGeneral!=="true";case ConditionName.getMarkers:return["vod","archive","clip"].includes(String(t.type))&&t.id&&t.isGeneral!=="true"&&t.quiz!=="true"&&!t.hideMarkers&&b;case ConditionName.getPlayList:return!staticFormats(t.type)&&t.type!=="live"&&!isFullMobilePortrait()&&b;case ConditionName.firstGetDataIntervalAPI:return t.type==="live"&&t.isGeneral!=="true";case ConditionName.getUserSetting:return gt&&t.quiz!=="true"&&b;case ConditionName.getVideoMetaData:return gt&&t.quiz!=="true"&&b;case ConditionName.getUserProfile:return!!t.xToken&&b;case ConditionName.footerPaddingZero:return t.type!=="live"||t.type==="live"&&isTouchScreen()||isTouchScreenPortrait();case ConditionName.manaulPostAPI:return!!_||R.length>0||E.length>0;case ConditionName.canAccessVideo:return!!(t.h==="true"&&getAccessToken());case ConditionName.canAddComment:return dt;case ConditionName.canShowSubmittedComment:return xt;case ConditionName.canPlayVideo:return oe;case ConditionName.chatEnabled:return _t;case ConditionName.filterLastGif:return+le[le.length-2]==+le[ct.quality===-1?be??de:de];case ConditionName.instagramEmojiAnimation:return!isTouchScreen()||isTouchScreen()&&!ue;case ConditionName.handleOverflowHidden:return!a||a&&xe;case ConditionName.thresholdOnlineViewers:return!!u&&u>=n.online_viewer_threshold;case ConditionName.setSubtitleFirstPlay:return n.subtitles&&n.subtitles.length>0&&!Z&&!staticFormats(t.type);case ConditionName.showQuizPopover:return t.xToken||firstQuizQuestion(Ye);case ConditionName.isQuizStatusEqual1:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions.length>0&&lastQuizQuestionStatus(Ye)===1;case ConditionName.isQuizStatusEqual2:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions.length>0&&lastQuizQuestionStatus(Ye)===2;case ConditionName.isQuizStatusEqual4:return!!(Ye&&Object.keys(Ye).length>0&&Ye.questions&&Ye.questions.length>0&&lastQuizQuestionStatus(Ye)===4);case ConditionName.isQuizEnd:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions&&Ye.number_of_questions===Ye.questions.length&&lastQuizQuestionStatus(Ye)===4;case ConditionName.hasQuizParams:return t.quiz==="true";case ConditionName.hasQuiz:return!!Ye&&Object.keys(Ye).length>0&&!Z;case ConditionName.hasQuizQuestion:return!!Ye&&Ye.questions&&Ye.questions.length;case ConditionName.hasChances:return jt!==-1;case ConditionName.sendUserTrackerRequest:return!!Ye&&Object.keys(Ye).length>0&&Ye.questions.length===0&&!Z&&t.xToken}},whiteListTargets=getWhiteListTargets().split(","),whiteListGeneralUrl=getWhiteListGeneralUrl().split(","),activeElementsTime=3e3,showLoaderTime=3e3,livePlayRetryDuration=3e3,RetryCountGeneralDataFetch=3,RetryTimeDelayGeneralDataFetch=5,durationWatched=60,continuousePlaybackIntervalTime=6e4,footerPadding=()=>conditions(ConditionName.footerPaddingZero)?0:64,featureToggle="ft",sidebarWidth=357,LiveDelay=6,LiveWindow=12,videoTag=()=>document.getElementById("player-tag"),miniPlayerVideoTag=()=>document.getElementById("mini-player-video-tag"),multiLiveVideo=()=>document.getElementById("multilive-player"),progressBar=()=>document.getElementById("time-progress-bar"),progressBarWidth=()=>store.getState().videoData.videoElementSizeInfo.width-2*footerPadding(),seenPoll=()=>JSON.parse(localStorage.getItem("seen-poll")),livePoll=()=>JSON.parse(localStorage.getItem("live-poll"));/*! *****************************************************************************
63
63
  Copyright (c) Microsoft Corporation.
64
64
 
65
65
  Permission to use, copy, modify, and/or distribute this software for any
@@ -76,7 +76,7 @@ Check the top-level render call using <`+De+">.")}return Se}}function jt(fe,Se){
76
76
  Shader compile Log: ${e}`,INSUFFICIENT_ARGS:(i,e)=>`Insufficient arguments: given "${i}" for "${e}".`};var ERROR={CODES:ERROR_CODES,MESSAGES};const EVENTS$1={MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_UP:"mouseup",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend",WHEEL:"wheel",RESIZE:"resize",CONTEXT_MENU:"contextmenu",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",KEY_DOWN:"keydown",KEY_UP:"keyup",CONTEXT_CREATE_ERROR:"webglcontextcreationerror",CONTEXT_LOST:"webglcontextlost",CONTEXT_RESTORED:"webglcontextrestored",DEVICE_ORIENTATION:"deviceorientation",DEVICE_MOTION:"devicemotion",ORIENTATION_CHANGE:"orientationchange",XR_END:"end"};var MOUSE_BUTTON;(function(i){i[i.LEFT=0]="LEFT",i[i.MIDDLE=1]="MIDDLE",i[i.RIGHT=2]="RIGHT"})(MOUSE_BUTTON||(MOUSE_BUTTON={}));const CURSOR={GRAB:"grab",GRABBING:"grabbing",NONE:""},KEY_DIRECTION=["LEFT","UP","RIGHT","DOWN"];var DIRECTION_KEY_CODE;(function(i){i[i.LEFT=37]="LEFT",i[i.UP=38]="UP",i[i.RIGHT=39]="RIGHT",i[i.DOWN=40]="DOWN"})(DIRECTION_KEY_CODE||(DIRECTION_KEY_CODE={}));const DIRECTION_KEY_NAME={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"},FULLSCREEN_ELEMENT=["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],DEFAULT_CLASS={CTX_LOST:"view360-ctx-lost",IN_VR:"view360-vr-presenting",HOTSPOT_CONTAINER:"view360-hotspots",HOTSPOT:"view360-hotspot",HOTSPOT_VISIBLE:"view360-hotspot-visible"},EVENTS={READY:"ready",LOAD_START:"loadStart",LOAD:"load",PROJECTION_CHANGE:"projectionChange",RESIZE:"resize",BEFORE_RENDER:"beforeRender",RENDER:"render",VIEW_CHANGE:"viewChange",VR_START:"vrStart",VR_END:"vrEnd"},EASING={EASE_OUT_CUBIC:i=>1-Math.pow(1-i,3)};var _a;const CAMERA_EVENTS={ANIMATION_END:"animationEnd"},OBJECT_3D_EVENTS={UPDATE:"update"},CONTROL_EVENTS={INPUT_START:"inputStart",CHANGE:"change",INPUT_END:"inputEnd",ENABLE:"enable",DISABLE:"disable",STATIC_CLICK:"staticClick"},DEG_TO_RAD=Math.PI/180,RAD_TO_DEG=180/Math.PI,DEFAULT_EASING=EASING.EASE_OUT_CUBIC,DEFAULT_ANIMATION_DURATION=300,INFINITE_RANGE={min:-1/0,max:1/0},DEFAULT_PITCH_RANGE={min:-90,max:90},DEFAULT_ZOOM_RANGE={min:.6,max:10};var ROTATE;(function(i){i[i.ZERO=0]="ZERO",i[i.CW_90=1]="CW_90",i[i.CCW_90=2]="CCW_90",i[i.CW_180=3]="CW_180"})(ROTATE||(ROTATE={}));const SESSION_VR="immersive-vr",XR_REFERENCE_SPACE="local",EPSILON$1=(_a=Number.EPSILON)!==null&&_a!==void 0?_a:2220446049250313e-31,isString=i=>typeof i=="string",isElement=i=>!!i&&i.nodeType===Node.ELEMENT_NODE,getNullableElement=(i,e)=>{let t=null;if(isString(i)){const s=(e||document).querySelector(i);if(!s)return null;t=s}else isElement(i)&&(t=i);return t},getElement=(i,e)=>{const t=getNullableElement(i,e);if(!t)throw isString(i)?new View360Error(ERROR.MESSAGES.ELEMENT_NOT_FOUND(i),ERROR.CODES.ELEMENT_NOT_FOUND):new View360Error(ERROR.MESSAGES.WRONG_TYPE(i,["HTMLElement","string"]),ERROR.CODES.WRONG_TYPE);return t},findCanvas=(i,e)=>{const t=i.querySelector(e);if(!t)throw new View360Error(ERROR.MESSAGES.CANVAS_NOT_FOUND,ERROR.CODES.CANVAS_NOT_FOUND);return t},clamp=(i,e,t)=>Math.max(Math.min(i,t),e),lerp=(i,e,t)=>i*(1-t)+e*t,circulate=(i,e,t)=>{const n=Math.abs(t-e);if(i<e){const s=(e-i)%n;i=t-s}else if(i>t){const s=(i-t)%n;i=e+s}return i},getObjectOption=i=>typeof i=="object"?i:{},toVerticalFov=(i,e)=>Math.atan(Math.tan(i*.5)/e)*2,isFullscreen=()=>{if(!document)return!1;for(const i of FULLSCREEN_ELEMENT)if(document[i])return!0;return!1},sensorCanBeEnabledIOS=()=>window.isSecureContext&&!!DeviceMotionEvent&&"requestPermission"in DeviceMotionEvent,hfovToZoom=(i,e)=>{const t=Math.tan(DEG_TO_RAD*i*.5),n=Math.tan(DEG_TO_RAD*e*.5);return t/n},eulerToQuat=(i,e,t,n)=>{identity(i);const s=.01,r=clamp(t,-90+s,90-s);return rotateY(i,i,e*DEG_TO_RAD),rotateX(i,i,r*DEG_TO_RAD),rotateZ(i,i,n*DEG_TO_RAD),i},quatToEuler=i=>{const e=i[0],t=i[1],n=i[2],s=i[3],r=e*e,a=t*t,o=n*n,l=s*s,d=r+a+o+l,f=e*s-t*n;let u,p;if(f>.499995*d)u=Math.PI/2,p=2*Math.atan2(t,e);else if(f<-.499995*d)u=-Math.PI/2,p=-2*Math.atan2(t,e);else{const m=fromValues$3(0,0,1),g=fromValues$3(0,1,0);transformQuat(m,m,i),transformQuat(g,g,i);const y=Math.sqrt(m[0]*m[0]+m[2]*m[2]);u=Math.atan2(-m[1],y),p=Math.atan2(m[0],m[2])}return{pitch:clamp(u*RAD_TO_DEG,-90,90),yaw:circulate(p*RAD_TO_DEG,0,360)}};class Motion{get val(){return this._val}get start(){return this._start}get end(){return this._end}get progress(){return this._progress}get activated(){return this._activated}get duration(){return this._duration}set duration(e){this._duration=e}get loop(){return this._loop}set loop(e){this._loop=e}get range(){return this._range}get easing(){return this._easing}set easing(e){this._easing=e}constructor({duration:e=DEFAULT_ANIMATION_DURATION,loop:t=!1,range:n={min:0,max:1},easing:s=DEFAULT_EASING}={}){this._duration=e,this._loop=t,this._range=n,this._easing=s,this._activated=!1,this.reset(0)}update(e){if(!this._activated)return this._val=this._end,0;const t=this._start,n=this._end,s=this._duration,r=this._val,a=this._loop,o=this._progress+e/s;this._progress=a?circulate(o,0,1):clamp(o,0,1);const l=this._easing(this._progress);return this._val=lerp(t,n,l),!a&&this._progress>=1&&(this._activated=!1),this._val-r}reset(e){const t=this._range,n=clamp(e,t.min,t.max);this._start=n,this._end=n,this._val=n,this._progress=0,this._activated=!1}add(e){const t=this._range;this._start=clamp(this._start+e,t.min,t.max),this._end=clamp(this._end+e,t.min,t.max),this._val=clamp(this._val+e,t.min,t.max)}setNewEndByDelta(e){const t=this._range;this._start=this._val,this._end=clamp(this._end+e,t.min,t.max),this._progress=0,this._activated=!0}setRange(e,t){this._start=clamp(this._start,e,t),this._end=clamp(this._end,e,t),this._range={min:e,max:t}}}class CameraAnimation{get duration(){return this._motion.duration}set duration(e){this._motion.duration=e}get easing(){return this._motion.easing}set easing(e){this._motion.easing=e}constructor(e,t,n,{duration:s=DEFAULT_ANIMATION_DURATION,easing:r=DEFAULT_EASING}={}){this._camera=e,this._motion=new Motion({duration:s,easing:r,range:{min:0,max:1}}),this._from=t,this._to=n,this._finishPromise=new Promise(a=>{this._finish=a}),this._motion.setNewEndByDelta(1)}getFinishPromise(){return this._finishPromise}update(e){const t=this._camera,n=this._from,s=this._to,r=this._motion;r.update(e);const a=r.val,o=create$1(),l=lerp(n.zoom,s.zoom,a);slerp(o,n.rotation,s.rotation,a),t.rotate(o,l),a>=1&&this._finish()}}class Camera extends Component{get aspect(){return this._aspect}get changed(){return this._changed}get yawRange(){return this._initialYawRange}set yawRange(e){this._initialYawRange=e}get pitchRange(){return this._initialPitchRange}set pitchRange(e){this._initialPitchRange=e}get zoomRange(){return this._initialZoomRange}set zoomRange(e){this._initialZoomRange=e}constructor({initialYaw:e,initialPitch:t,initialZoom:n,yawRange:s,pitchRange:r,zoomRange:a,fov:o}){super(),this.yaw=e,this.pitch=t,this.zoom=n,this.rollOffset=0,this.initialYaw=e,this.initialPitch=t,this.initialZoom=n,this.position=create$3(),this.animation=null,this._up=fromValues$3(0,1,0),this._aspect=1,this._initialYawRange=s,this._initialPitchRange=r,this._initialZoomRange=a,this._yawRange=s,this._pitchRange=r,this._zoomRange=a,this.quaternion=create$1(),this._updateQuaternion(),this.viewMatrix=create$4(),this.projectionMatrix=create$4(),this.fov=o,this._maxRenderHeight=-1}destroy(){this.off()}resize(e,t){const n=this._aspect;this._aspect=e/t,this._aspect!==n&&this.updateMatrix()}lookAt({yaw:e=this.yaw,pitch:t=this.pitch,zoom:n=this.zoom}){const s=clone$2(this.quaternion),r=this.zoom;this.yaw=circulate(e,0,360),this.pitch=clamp(t,-90,90),this.zoom=n,this._updateQuaternion();const a=Math.abs(n-r);(!equals(this.quaternion,s)||a>=EPSILON$1*10)&&this.updateMatrix()}rotate(e,t=this.zoom){const n=normalize(create$1(),e),s=equals(this.quaternion,n);copy(this.quaternion,n);const r=this.zoom,{yaw:a,pitch:o}=quatToEuler(n);this.yaw=a,this.pitch=o,this.zoom=t;const l=Math.abs(t-r);(!s||l>=EPSILON$1*10)&&this.updateMatrix()}animateTo({yaw:e=this.yaw,pitch:t=this.pitch,zoom:n=this.zoom,duration:s=0,easing:r=DEFAULT_EASING}={}){return __awaiter(this,void 0,void 0,function*(){if(this.yaw===e&&this.pitch===t&&this.zoom===n)return;const a={rotation:clone$2(this.quaternion),zoom:this.zoom},o={rotation:eulerToQuat(create$1(),e,t,this.rollOffset),zoom:n},l=new CameraAnimation(this,a,o,{duration:s,easing:r}),d=l.getFinishPromise();return this.animation=l,d.then(()=>{this.animation=null,this.trigger(CAMERA_EVENTS.ANIMATION_END,{animation:l})}),d})}restrictYawRange(e,t){this._yawRange={min:e,max:t}}restrictPitchRange(e,t){this._pitchRange={min:e,max:t}}restrictZoomRange(e,t){this._zoomRange={min:e,max:t}}restrictRenderHeight(e){this._maxRenderHeight=e}resetRange(){this._yawRange=this._initialYawRange,this._pitchRange=this._initialPitchRange,this._zoomRange=this._initialZoomRange,this._maxRenderHeight=-1}getYawRange(e){const t=this._yawRange,n=this._maxRenderHeight;if(!t)return INFINITE_RANGE;const s=this.getHorizontalFov(e)*.5;let r=t.min,a=t.max;if(n>0){const o=toVerticalFov(s*DEG_TO_RAD,this._aspect),l=n*.5,d=Math.tan(o),f=Math.sqrt((1+l*l)/(1+d*d)),u=Math.atan(Math.tan(s*DEG_TO_RAD)*f)*RAD_TO_DEG;r=t.min+u,a=t.max-u}return r>a&&(r=0,a=0),{min:r,max:a}}getPitchRange(e){const t=this._pitchRange,n=this._maxRenderHeight;if(!t)return DEFAULT_PITCH_RANGE;let s=t.min,r=t.max;if(n>0){const a=this.getVerticalFov(e)*.5;s=t.min+a,r=t.max-a}return s>r&&(s=0,r=0),{min:Math.max(s,-90),max:Math.min(r,90)}}getZoomRange(){var e;const t=(e=this._zoomRange)!==null&&e!==void 0?e:DEFAULT_ZOOM_RANGE,n=this.getHorizontalFov(t.max),s=this.getHorizontalFov(t.min),r=this.getHorizontalFov(this.zoom);return{min:Math.max(n,1),max:Math.min(s,180),current:r}}getHorizontalFov(e=this.zoom){return this._getZoomedHorizontalFov(e)*RAD_TO_DEG}getVerticalFov(e=this.zoom){const t=this._aspect,n=this._getZoomedHorizontalFov(e);return toVerticalFov(n,t)*RAD_TO_DEG}fovToZoom(e){const t=this.fov,n=Math.tan(DEG_TO_RAD*t*.5),s=Math.tan(DEG_TO_RAD*e*.5);return n/s}updateMatrix(){const e=this._up,t=this._aspect,n=this.viewMatrix,s=this.projectionMatrix,r=this.position,a=this.quaternion,o=create$3(),l=fromValues$3(0,0,-1);transformQuat(l,l,a),transformQuat(o,e,a);const d=this._getZoomedHorizontalFov(),f=toVerticalFov(d,t);lookAt(n,r,l,o),perspective(s,f,t,.1,100),this._changed=!0}onFrameRender(){this._changed=!1}_updateQuaternion(){eulerToQuat(this.quaternion,this.yaw,this.pitch,this.rollOffset)}_getZoomedHorizontalFov(e=this.zoom){return 2*Math.atan(Math.tan(DEG_TO_RAD*this.fov*.5)/e)}}class MouseInput extends Component{constructor(){super(),this._onMouseDown=e=>{const t=this._el;!t||e.button!==MOUSE_BUTTON.LEFT||(e.preventDefault(),t.focus?t.focus():window.focus(),this._prevPos[0]=e.clientX,this._prevPos[1]=e.clientY,window.addEventListener(EVENTS$1.MOUSE_MOVE,this._onMouseMove,!1),window.addEventListener(EVENTS$1.MOUSE_UP,this._onMouseUp,!1),this.trigger(CONTROL_EVENTS.INPUT_START,{srcEvent:e,isTouch:!1,isKeyboard:!1}))},this._onMouseMove=e=>{e.preventDefault();const t=e.clientX,n=e.clientY,s=this._prevPos,r=t-s[0],a=n-s[1];this.trigger(CONTROL_EVENTS.CHANGE,{delta:{x:r,y:a},isTouch:!1,isKeyboard:!1}),s[0]=t,s[1]=n},this._onMouseUp=()=>{this._prevPos[0]=0,this._prevPos[1]=0,window.removeEventListener(EVENTS$1.MOUSE_MOVE,this._onMouseMove,!1),window.removeEventListener(EVENTS$1.MOUSE_UP,this._onMouseUp,!1),this.trigger(CONTROL_EVENTS.INPUT_END,{isTouch:!1,isKeyboard:!1,scrolling:!1})},this._el=null,this._prevPos=[0,0]}enable(e){this._el||(e.addEventListener(EVENTS$1.MOUSE_DOWN,this._onMouseDown),this._el=e)}disable(){const e=this._el;e&&(e.removeEventListener(EVENTS$1.MOUSE_DOWN,this._onMouseDown),window.removeEventListener(EVENTS$1.MOUSE_MOVE,this._onMouseMove,!1),window.removeEventListener(EVENTS$1.MOUSE_UP,this._onMouseUp,!1),this._el=null)}}class TouchInput extends Component{get scrollable(){return this._scrollable}set scrollable(e){this._scrollable=e}constructor(){super(),this._onTouchStart=e=>{if(e.touches.length>1||this._scrolling)return;const t=e.touches[0];this._isFirstTouch=!0,this._prevPos[0]=t.clientX,this._prevPos[1]=t.clientY,this.trigger(CONTROL_EVENTS.INPUT_START,{srcEvent:e,isTouch:!0,isKeyboard:!1})},this._onTouchMove=e=>{if(e.touches.length>1||this._scrolling)return;const t=e.touches[0],n=this._scrollable,s=this._prevPos,r=t.clientX,a=t.clientY,o=r-s[0],l=a-s[1];if(this._isFirstTouch){if(n&&!isFullscreen()&&Math.abs(l)>Math.abs(o)){this._scrolling=!0;return}this._isFirstTouch=!1}e.cancelable!==!1&&e.preventDefault(),this.trigger(CONTROL_EVENTS.CHANGE,{delta:{x:o,y:l},isTouch:!0,isKeyboard:!1}),s[0]=r,s[1]=a},this._onTouchEnd=e=>{if(e.touches.length!==0)return;const t=e.touches[0],n=this._prevPos;t?(n[0]=t.clientX,n[1]=t.clientY):(n[0]=0,n[1]=0,this.trigger(CONTROL_EVENTS.INPUT_END,{isTouch:!0,isKeyboard:!1,scrolling:this._scrolling})),e.cancelable!==!1&&e.preventDefault(),this._scrolling=!1},this._el=null,this._prevPos=[0,0],this._isFirstTouch=!1,this._scrolling=!1,this._scrollable=!1}enable(e){this._el||(e.addEventListener(EVENTS$1.TOUCH_START,this._onTouchStart,{passive:!1}),e.addEventListener(EVENTS$1.TOUCH_MOVE,this._onTouchMove,{passive:!1}),e.addEventListener(EVENTS$1.TOUCH_END,this._onTouchEnd),this._el=e)}disable(){const e=this._el;e&&(e.removeEventListener(EVENTS$1.TOUCH_START,this._onTouchStart),e.removeEventListener(EVENTS$1.TOUCH_MOVE,this._onTouchMove),e.removeEventListener(EVENTS$1.TOUCH_END,this._onTouchEnd),this._el=null)}}class KeyboardInput extends Component{get active(){const e=this._pressed;return e.LEFT||e.UP||e.RIGHT||e.DOWN}constructor(){super(),this._onKeyDown=e=>{if(e.location!==KeyboardEvent.DOM_KEY_LOCATION_STANDARD)return;this._updateKeyPress(e,!0);const t=this._getPressedKeyCount();t<=0||(e.preventDefault(),t===1&&!e.repeat&&this.trigger(CONTROL_EVENTS.INPUT_START,{srcEvent:e,isTouch:!1,isKeyboard:!0}))},this._onKeyUp=e=>{e.location!==KeyboardEvent.DOM_KEY_LOCATION_STANDARD||(this._updateKeyPress(e,!1),this._getPressedKeyCount()>0)||this.trigger(CONTROL_EVENTS.INPUT_END,{isTouch:!1,isKeyboard:!0,scrolling:!1})},this._el=null,this._clearPressedKeys()}enable(e){this._el||(e.addEventListener(EVENTS$1.KEY_DOWN,this._onKeyDown),e.addEventListener(EVENTS$1.KEY_UP,this._onKeyUp),this._el=e,this._clearPressedKeys())}disable(){const e=this._el;e&&(e.removeEventListener(EVENTS$1.KEY_DOWN,this._onKeyDown),e.removeEventListener(EVENTS$1.KEY_UP,this._onKeyUp),this._el=null,this._clearPressedKeys())}update(){const e=this._getDeltaByPressedKeys();(e.x!==0||e.y!==0)&&this.trigger(CONTROL_EVENTS.CHANGE,{delta:e,isTouch:!1,isKeyboard:!0})}_clearPressedKeys(){this._pressed=KEY_DIRECTION.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:!1}),{})}_updateKeyPress(e,t){const n=this._pressed,s=e.keyCode!=null?DIRECTION_KEY_CODE[e.keyCode]:DIRECTION_KEY_NAME[e.key];s&&(n[s]=t)}_getPressedKeyCount(){return KEY_DIRECTION.filter(e=>this._pressed[e]).length}_getDeltaByPressedKeys(){const e=this._pressed;let t=0,n=0;return e.LEFT&&(t+=1),e.RIGHT&&(t-=1),e.UP&&(n+=1),e.DOWN&&(n-=1),{x:t,y:n}}}class RotateControl extends Component{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._keyboardInput.active||this._xMotion.activated||this._yMotion.activated}get yaw(){return this._xMotion}get pitch(){return this._yMotion}get scrollable(){return this._touchInput.scrollable}set scrollable(e){this._touchInput.scrollable=e}get pointerScale(){return this._pointerScale}set pointerScale(e){this._pointerScale=e}get keyboardScale(){return this._keyboardScale}set keyboardScale(e){this._keyboardScale=e}get duration(){return this._duration}set duration(e){this._duration=e,this._xMotion.duration=e,this._yMotion.duration=e}get easing(){return this._easing}set easing(e){this._easing=e,this._xMotion.easing=e,this._yMotion.easing=e}get disablePitch(){return this._disablePitch}set disablePitch(e){this._disablePitch=e}get disableYaw(){return this._disableYaw}set disableYaw(e){this._disableYaw=e}get disableKeyboard(){return this._disableKeyboard}set disableKeyboard(e){this._disableKeyboard=e}constructor(e,t,{duration:n=DEFAULT_ANIMATION_DURATION,easing:s=DEFAULT_EASING,pointerScale:r=[1,1],keyboardScale:a=[1,1],disablePitch:o=!1,disableYaw:l=!1,disableKeyboard:d=!1}={}){super(),this._onInputStart=f=>{this._changedWhileDragging=!1,this.trigger(CONTROL_EVENTS.INPUT_START,Object.assign(Object.assign({},f),{inputType:"rotate"}))},this._onChange=f=>{const u=f.delta,p=1/this._zoomScale,m=this._screenScale,g=this._keyboardScale,y=this._pointerScale;let v;f.isKeyboard?v=[g[0]*p,g[1]*p]:v=[y[0]*m[0]*p,y[1]*m[1]*p];const b=u.x*v[0],C=u.y*v[1];this._xMotion.setNewEndByDelta(b),this._yMotion.setNewEndByDelta(C),this._changedWhileDragging=!0},this._onInputEnd=f=>{this.trigger(CONTROL_EVENTS.INPUT_END,Object.assign(Object.assign({},f),{inputType:"rotate"})),!this._changedWhileDragging&&!f.isKeyboard&&!f.scrolling&&this.trigger(CONTROL_EVENTS.STATIC_CLICK,{isTouch:f.isTouch}),this._changedWhileDragging=!1},this._controlEl=e,this._pointerScale=r,this._keyboardScale=a,this._duration=n,this._easing=s,this._disablePitch=o,this._disableYaw=l,this._disableKeyboard=d,this._enableBlocked=t,this._mouseInput=new MouseInput,this._touchInput=new TouchInput,this._keyboardInput=new KeyboardInput,this._xMotion=new Motion({duration:n,range:INFINITE_RANGE,easing:s}),this._yMotion=new Motion({duration:n,range:DEFAULT_PITCH_RANGE,easing:s}),this._screenScale=[1,1],this._zoomScale=1,this._enabled=!1,this._changedWhileDragging=!1,this._bindInputs()}destroy(){this.disable(),this._mouseInput.off(),this._touchInput.off(),this._keyboardInput.off(),this.off(),this._changedWhileDragging=!1}update(e){if(!this._enabled)return;const t=this._xMotion,n=this._yMotion,s=this._keyboardInput;this._disableKeyboard||s.update(),this._disablePitch||n.update(e),this._disableYaw||t.update(e)}updateRange(e,t){const n=e.getYawRange(t),s=e.getPitchRange(t);this._xMotion.setRange(n.min,n.max),this._yMotion.setRange(s.min,s.max)}setZoomScale(e){this._zoomScale=e}resize(e,t,n,s){const r=toVerticalFov(e*DEG_TO_RAD,t)*RAD_TO_DEG;this._screenScale[0]=e/n,this._screenScale[1]=r/s}enable(){if(this._enabled)return;const e=this._controlEl;this._mouseInput.enable(e),this._touchInput.enable(e),this._keyboardInput.enable(e),this._enabled=!0,this._enableBlocked=!1,this.trigger(CONTROL_EVENTS.ENABLE,{control:this,updateCursor:!0})}disable(){this._enabled&&(this._mouseInput.disable(),this._touchInput.disable(),this._keyboardInput.disable(),this._enabled=!1,this.trigger(CONTROL_EVENTS.DISABLE,{updateCursor:!0}))}sync(e){this.updateRange(e,e.zoom),this._xMotion.reset(e.yaw),this._yMotion.reset(e.pitch)}_bindInputs(){const e=this._mouseInput,t=this._touchInput,n=this._keyboardInput;e.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.on(CONTROL_EVENTS.CHANGE,this._onChange),e.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd),t.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),t.on(CONTROL_EVENTS.CHANGE,this._onChange),t.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd),n.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),n.on(CONTROL_EVENTS.CHANGE,this._onChange),n.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd)}}class WheelInput extends Component{get scrollable(){return this._scrollable}set scrollable(e){this._scrollable=e}constructor(){super(),this._onWheel=e=>{const t=this._scrollable;if(e.deltaY===0||t)return;e.preventDefault(),e.stopPropagation(),this._inputTimer<0?this.trigger(CONTROL_EVENTS.INPUT_START,{srcEvent:e,isTouch:!1,isKeyboard:!1}):this._clearTimer();const n=this._baseScale*e.deltaY;this.trigger(CONTROL_EVENTS.CHANGE,{delta:n,isTouch:!1,isKeyboard:!1}),this._inputTimer=window.setTimeout(()=>{this.trigger(CONTROL_EVENTS.INPUT_END,{isTouch:!1,isKeyboard:!1,scrolling:!1}),this._inputTimer=-1},DEFAULT_ANIMATION_DURATION)},this._el=null,this._baseScale=.04,this._scrollable=!1,this._inputTimer=-1}enable(e){this._el||(e.addEventListener(EVENTS$1.WHEEL,this._onWheel,{passive:!1,capture:!1}),this._el=e,this._clearTimer())}disable(){const e=this._el;e&&(e.removeEventListener(EVENTS$1.WHEEL,this._onWheel,!1),this._el=null,this._clearTimer())}_clearTimer(){window.clearTimeout(this._inputTimer),this._inputTimer=-1}}class PinchInput extends Component{constructor(){super(),this._onTouchMove=e=>{const t=e.touches;if(t.length!==2||!e.cancelable)return;e.preventDefault(),e.stopPropagation();const n=this._prevDistance,s=[t[0].pageX-t[1].pageX,t[0].pageY-t[1].pageY],r=Math.sqrt(s[0]*s[0]+s[1]*s[1])*this._baseScale,a=this._isFirstTouch?0:r-n;this._isFirstTouch&&this.trigger(CONTROL_EVENTS.INPUT_START,{srcEvent:e,isTouch:!0,isKeyboard:!1}),this._prevDistance=r,this._isFirstTouch=!1,this.trigger(CONTROL_EVENTS.CHANGE,{delta:a,isTouch:!0,isKeyboard:!1})},this._onTouchEnd=e=>{e.touches.length===0&&(this._isFirstTouch||this.trigger(CONTROL_EVENTS.INPUT_END,{isTouch:!0,isKeyboard:!1,scrolling:!1}),this._prevDistance=-1,this._isFirstTouch=!0)},this._el=null,this._baseScale=-.2,this._prevDistance=-1,this._isFirstTouch=!0}enable(e){this._el||(e.addEventListener(EVENTS$1.TOUCH_MOVE,this._onTouchMove,{passive:!1,capture:!1}),e.addEventListener(EVENTS$1.TOUCH_END,this._onTouchEnd),this._el=e,this._prevDistance=-1,this._isFirstTouch=!0)}disable(){const e=this._el;e&&(e.removeEventListener(EVENTS$1.TOUCH_MOVE,this._onTouchMove,!1),e.removeEventListener(EVENTS$1.TOUCH_END,this._onTouchEnd),this._el=null)}}class ZoomControl extends Component{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._motion.activated}get zoom(){return this._motion.val}get scrollable(){return this._wheelInput.scrollable}set scrollable(e){this._wheelInput.scrollable=e}get range(){return this._motion.range}get scale(){return this._scale}set scale(e){this._scale=e}get duration(){return this._motion.duration}get easing(){return this._motion.easing}constructor(e,t,{scale:n=1,duration:s=DEFAULT_ANIMATION_DURATION,easing:r=DEFAULT_EASING}={}){super(),this._onInputStart=a=>{this.trigger(CONTROL_EVENTS.INPUT_START,Object.assign(Object.assign({},a),{inputType:"zoom"}))},this._onChange=({delta:a})=>{const o=this._scale,l=a*o;this._motion.setNewEndByDelta(l)},this._onInputEnd=a=>{this.trigger(CONTROL_EVENTS.INPUT_END,Object.assign(Object.assign({},a),{inputType:"zoom"}))},this._scale=n,this._controlEl=e,this._enableBlocked=t,this._wheelInput=new WheelInput,this._pinchInput=new PinchInput,this._motion=new Motion({duration:s,easing:r,range:INFINITE_RANGE}),this._enabled=!1,this._bindInputs()}destroy(){this.disable(),this._wheelInput.off(),this._pinchInput.off(),this.off()}update(e){if(!this._enabled)return;this._motion.update(e)}enable(){if(this._enabled)return;const e=this._controlEl;this._wheelInput.enable(e),this._pinchInput.enable(e),this._enabled=!0,this._enableBlocked=!1,this.trigger(CONTROL_EVENTS.ENABLE,{control:this,updateCursor:!1})}disable(){this._enabled&&(this._wheelInput.disable(),this._pinchInput.disable(),this._enabled=!1,this.trigger(CONTROL_EVENTS.DISABLE,{updateCursor:!1}))}sync(e){const t=this._motion,n=e.getZoomRange();t.setRange(n.min,n.max),t.reset(n.current)}_bindInputs(){const e=this._wheelInput,t=this._pinchInput;e.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.on(CONTROL_EVENTS.CHANGE,this._onChange),e.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd),t.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),t.on(CONTROL_EVENTS.CHANGE,this._onChange),t.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd)}}const ROTATE_CONSTANT={PITCH_DELTA:1,YAW_DELTA_BY_ROLL:2,YAW_DELTA_BY_YAW:3};ROTATE_CONSTANT[ROTATE_CONSTANT.PITCH_DELTA]={targetAxis:[0,1,0],meshPoint:[0,0,1]},ROTATE_CONSTANT[ROTATE_CONSTANT.YAW_DELTA_BY_ROLL]={targetAxis:[0,1,0],meshPoint:[1,0,0]},ROTATE_CONSTANT[ROTATE_CONSTANT.YAW_DELTA_BY_YAW]={targetAxis:[1,0,0],meshPoint:[0,0,1]};class GyroInput extends Component{get enabled(){return this._enabled}get orientationUpdated(){return this._orientationUpdated}get ignoreRoll(){return this._ignoreRoll}set ignoreRoll(e){this._ignoreRoll=e}constructor(){super(),this._onDeviceOrientation=e=>{const t=this._orientation,{alpha:n,beta:s,gamma:r}=e;n==null||s==null||r==null||(t.alpha=n,t.beta=s,t.gamma=r,this._orientationUpdated=!0,this._needsCalibrate&&(this._needsCalibrate=!1,this._calibrateSensor()))},this._updateScreenOrientation=()=>{window.screen&&window.screen.orientation&&window.screen.orientation.angle!==void 0?this._screenOrientation=screen.orientation.angle:window.orientation!==void 0?this._screenOrientation=window.orientation>=0?window.orientation:360+window.orientation:this._screenOrientation=0},this.quaternion=create$1(),this._orientation={alpha:0,beta:90,gamma:0},this._yawOrigin=0,this._yawOffset=0,this._orientationUpdated=!1,this._screenOrientation=0,this._needsCalibrate=!0,this._enabled=!1}enable(){this._enabled||(window.addEventListener(EVENTS$1.DEVICE_ORIENTATION,this._onDeviceOrientation),window.addEventListener(EVENTS$1.ORIENTATION_CHANGE,this._updateScreenOrientation),this._updateScreenOrientation(),this._orientationUpdated=!1,this._needsCalibrate=!0,this._enabled=!0)}disable(){this._enabled&&(window.removeEventListener(EVENTS$1.DEVICE_ORIENTATION,this._onDeviceOrientation),window.removeEventListener(EVENTS$1.ORIENTATION_CHANGE,this._updateScreenOrientation),this._enabled=!1)}update(){this._updateRotation(),this._orientationUpdated=!1}collectDelta(){if(!this._orientationUpdated)return{pitch:0,yaw:0};const e=clone$2(this.quaternion);return this._updateRotation(),this._orientationUpdated=!1,this._toEulerDelta(e,this.quaternion)}setInitialRotation(e){this._yawOrigin=e}_calibrateSensor(){const e=this._yawOrigin,t=this.quaternion;this._yawOffset=0,this._updateRotation();const{yaw:n}=quatToEuler(t);this._yawOffset=n-e,this._updateRotation(),this._needsCalibrate=!1}_updateRotation(){const e=this.quaternion,{alpha:t,beta:n,gamma:s}=this._orientation;identity(e),rotateY(e,e,(t-this._yawOffset)*DEG_TO_RAD),rotateX(e,e,n*DEG_TO_RAD),rotateZ(e,e,-s*DEG_TO_RAD);const r=create$1(),a=-this._screenOrientation*.5*DEG_TO_RAD,o=fromValues$1(-Math.sqrt(.5),0,0,Math.sqrt(.5));set$1(r,0,Math.sin(a),0,Math.cos(a)),multiply(e,e,r),multiply(e,e,o),normalize(e,e)}_toEulerDelta(e,t){return{yaw:this._getDeltaYaw(e,t),pitch:this._getDeltaPitch(e,t)}}_getDeltaYaw(e,t){const n=this._getRotationDelta(e,t,ROTATE_CONSTANT.YAW_DELTA_BY_YAW);return this._getRotationDelta(e,t,ROTATE_CONSTANT.YAW_DELTA_BY_ROLL)*Math.sin(this._extractPitchFromQuat(t))+n}_getDeltaPitch(e,t){return this._getRotationDelta(e,t,ROTATE_CONSTANT.PITCH_DELTA)}_getRotationDelta(e,t,n){const s=fromValues$3(ROTATE_CONSTANT[n].targetAxis[0],ROTATE_CONSTANT[n].targetAxis[1],ROTATE_CONSTANT[n].targetAxis[2]),r=ROTATE_CONSTANT[n].meshPoint,a=clone$2(e),o=clone$2(t);normalize(a,a),normalize(o,o);let l=fromValues$3(0,0,1),d=fromValues$3(0,0,1);transformQuat(l,l,a),transformQuat(d,d,o),transformQuat(s,s,o);const u=dot(s,cross(create$3(),l,d))>0?1:-1,p=fromValues$3(r[0],r[1],r[2]);let m;n!==ROTATE_CONSTANT.YAW_DELTA_BY_YAW?m=fromValues$3(0,u,0):m=fromValues$3(u,0,0),transformQuat(p,p,o),transformQuat(m,m,o);const g=p,y=m,v=create$3();cross(v,g,y),normalize$2(v,v);const b=v[0],C=v[1],_=v[2];d=fromValues$3(r[0],r[1],r[2]),transformQuat(d,d,o),l=fromValues$3(r[0],r[1],r[2]),transformQuat(l,l,a);let R=Math.abs(l[0]*b+l[1]*C+l[2]*_);const E=create$3();subtract(E,l,scale(create$3(),v,R));let F=(E[0]*d[0]+E[1]*d[1]+E[2]*d[2])/(length(E)*length(d));F>1&&(F=1);const O=Math.acos(F),A=cross(create$3(),d,E);R=b*A[0]+C*A[1]+_*A[2];let N;return n!==ROTATE_CONSTANT.YAW_DELTA_BY_YAW?N=R>0?1:-1:N=R<0?1:-1,O*N*u*RAD_TO_DEG}_extractPitchFromQuat(e){const t=fromValues$3(0,0,1);return transformQuat(t,t,e),-1*Math.atan2(t[1],Math.sqrt(Math.pow(t[0],2)+Math.pow(t[2],2)))}}class GyroControl extends Component{get enabled(){return this._input.enabled}get enableBlocked(){return this._enableBlocked}get animating(){return this._input.enabled&&this._input.orientationUpdated}get ignoreRoll(){return this._ignoreRoll}set ignoreRoll(e){this._ignoreRoll=e}static isAvailable(){return __awaiter(this,void 0,void 0,function*(){if(!DeviceMotionEvent)return!1;let e;const t=()=>new Promise(s=>{e=r=>{s(r.rotationRate&&r.rotationRate.alpha!=null)},window.addEventListener(EVENTS$1.DEVICE_MOTION,e)}),n=()=>new Promise(s=>{setTimeout(()=>s(!1),1e3)});return Promise.race([t(),n()]).then(s=>(window.removeEventListener(EVENTS$1.DEVICE_MOTION,e),s))})}static requestSensorPermission(){return __awaiter(this,void 0,void 0,function*(){return sensorCanBeEnabledIOS()?DeviceMotionEvent.requestPermission().then(e=>e==="granted").catch(()=>!1):!0})}constructor(e,{ignoreRoll:t=!0}={}){super(),this._enableBlocked=e,this._ignoreRoll=t,this._input=new GyroInput}destroy(){this.disable(),this._input.off(),this.off()}update(e,t,n,s){this._ignoreRoll?this._updateYawPitch(e,t,n,s):this._updateQuaternion(e,s)}enable(){this._input.enabled||(this._input.enable(),this._enableBlocked=!1,this.trigger(CONTROL_EVENTS.ENABLE,{control:this,updateCursor:!1}))}disable(){this._input.enabled&&(this._input.disable(),this.trigger(CONTROL_EVENTS.DISABLE,{updateCursor:!1}))}sync(){}_updateYawPitch(e,t,n,s){const r=this._input;if(!r.enabled)return;const{yaw:a,pitch:o}=r.collectDelta();t.add(a),n.add(o),e.lookAt({yaw:t.val,pitch:n.val,zoom:s})}_updateQuaternion(e,t){const n=this._input;n.enabled&&(n.update(),e.rotate(n.quaternion,t))}}class PanoControl{get useGrabCursor(){return this._useGrabCursor}set useGrabCursor(e){e!==this._useGrabCursor&&(this._useGrabCursor=e,e&&this._enabled?this._setCursor(CURSOR.GRAB):e||this._setCursor(CURSOR.NONE))}get disableContextMenu(){return this._disableContextMenu}set disableContextMenu(e){e!==this._disableContextMenu&&(this._disableContextMenu=e,e&&this._enabled?this._blockContextMenu():e||this._restoreContextMenu())}get scrollable(){return this._rotateControl.scrollable}set scrollable(e){this._rotateControl.scrollable=e}get wheelScrollable(){return this._zoomControl.scrollable}set wheelScrollable(e){this._zoomControl.scrollable=e}get ignoreZoomScale(){return this._ignoreZoomScale}set ignoreZoomScale(e){this._ignoreZoomScale=e}get enabled(){return this._enabled}get rotate(){return this._rotateControl}get zoom(){return this._zoomControl}get gyro(){return this._gyroControl}get animating(){return this._rotateControl.animating||this._zoomControl.animating||this._gyroControl.animating}constructor(e,t,{useGrabCursor:n,scrollable:s,wheelScrollable:r,disableContextMenu:a,rotate:o,zoom:l,gyro:d}){this._preventContextMenu=f=>{f.preventDefault()},this._onInputStart=f=>{this._useGrabCursor&&!f.isKeyboard&&this._setCursor(CURSOR.GRABBING)},this._onInputEnd=f=>{this._useGrabCursor&&!f.isKeyboard&&this._setCursor(CURSOR.GRAB)},this._onEnable=({control:f,updateCursor:u})=>{u&&this._useGrabCursor&&this._setCursor(CURSOR.GRAB),f.sync(this._camera)},this._onDisable=({updateCursor:f})=>{f&&this._setCursor(CURSOR.NONE)},this._onCameraAnimationEnd=({animation:f})=>{f.getFinishPromise().then(()=>{this.sync()})},this._useGrabCursor=n,this._disableContextMenu=a,this._camera=t,this._controlEl=e,this._ignoreZoomScale=!1,this._enabled=!1,this._rotateControl=new RotateControl(e,!o,getObjectOption(o)),this._zoomControl=new ZoomControl(e,!l,getObjectOption(l)),this._gyroControl=new GyroControl(!d,getObjectOption(d)),this._rotateControl.scrollable=s,this._zoomControl.scrollable=r,this._bindEvents()}destroy(){this.disable(),this._rotateControl.destroy(),this._zoomControl.destroy(),this._setCursor(CURSOR.NONE)}resize(e,t){const n=this._camera;this._rotateControl.resize(n.fov,n.aspect,e,t)}enable(){return __awaiter(this,void 0,void 0,function*(){this._enabled||(this._rotateControl.enableBlocked||this._rotateControl.enable(),this._zoomControl.enableBlocked||this._zoomControl.enable(),this._gyroControl.enableBlocked||(yield GyroControl.isAvailable())&&this._gyroControl.enable(),this.sync(),this._disableContextMenu&&this._blockContextMenu(),this._enabled=!0)})}disable(){this._enabled&&(this._rotateControl.disable(),this._zoomControl.disable(),this._gyroControl.disable(),this._restoreContextMenu(),this._enabled=!1)}update(e){const t=this._camera,n=this._rotateControl,s=this._zoomControl,r=this._gyroControl;s.update(e);const a=hfovToZoom(t.fov,s.zoom),o=this._ignoreZoomScale?1:Math.max(a,1);n.setZoomScale(o),n.updateRange(t,a),n.update(e);const l=n.yaw,d=n.pitch;r.enabled?r.update(t,l,d,a):t.lookAt({yaw:l.val,pitch:d.val,zoom:a})}sync(){const e=this._camera;this._zoomControl.sync(e),this._rotateControl.sync(e)}_blockContextMenu(){this._controlEl.addEventListener(EVENTS$1.CONTEXT_MENU,this._preventContextMenu)}_restoreContextMenu(){this._controlEl.removeEventListener(EVENTS$1.CONTEXT_MENU,this._preventContextMenu)}_setCursor(e){if(!this._useGrabCursor&&e!==CURSOR.NONE)return;const t=this._controlEl;t.style.cursor=e}_bindEvents(){const e=this._rotateControl,t=this._zoomControl;e.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd),e.on(CONTROL_EVENTS.ENABLE,this._onEnable),e.on(CONTROL_EVENTS.DISABLE,this._onDisable),t.on(CONTROL_EVENTS.ENABLE,this._onEnable),t.on(CONTROL_EVENTS.DISABLE,this._onDisable),this._camera.on(CAMERA_EVENTS.ANIMATION_END,this._onCameraAnimationEnd)}}class Texture{constructor({width:e,height:t,flipY:n}){this.width=e,this.height=t,this.flipY=n,this.wrapS=WebGLRenderingContext.CLAMP_TO_EDGE,this.wrapT=WebGLRenderingContext.CLAMP_TO_EDGE}destroy(){}isVideo(){return!1}isCube(){return!1}}class Texture2D extends Texture{constructor({source:e,width:t,height:n,flipY:s}){super({width:t,height:n,flipY:s}),this.source=e}}class TextureVideo extends Texture2D{destroy(){const e=this.source;e.pause(),e.removeAttribute("src"),e.load()}isVideo(){return!0}isPaused(){const e=this.source;return e.paused||e.ended||e.readyState<=2}hasAudio(){const e=this.source;return e.audioTracks?e.audioTracks.length>0:e.webkitAudioDecodedByteCount!=null?e.webkitAudioDecodedByteCount>0:e.mozHasAudio!=null?e.mozHasAudio:!0}}class TextureCube extends Texture{constructor({sources:e,width:t,height:n,flipY:s}){super({width:t,height:n,flipY:s}),this.sources=e}isCube(){return!0}}class TextureLoader{constructor(){this._loadChecker=new ImReady}load(e,t){return __awaiter(this,void 0,void 0,function*(){if(t)return this.loadVideo(e,getObjectOption(t));if(Array.isArray(e)&&e.length>1)return this.loadCubeImage(e);{const n=Array.isArray(e)?e[0]:e;return this.loadImage(n)}})}loadImage(e){return __awaiter(this,void 0,void 0,function*(){const t=this._toImageArray(e);return this._load(t,n=>{const s=t[0];n(new Texture2D({source:s,width:s.naturalWidth,height:s.naturalHeight,flipY:!0}))})})}loadCubeImage(e){return __awaiter(this,void 0,void 0,function*(){const t=this._toImageArray(e);return this._load(t,n=>{n(new TextureCube({sources:t,width:t[0].naturalWidth,height:t[0].naturalHeight,flipY:!1}))})})}loadVideo(e,t){return __awaiter(this,void 0,void 0,function*(){const n=Object.assign({autoplay:!0,muted:!0,loop:!1,volume:1},t),s=this._toVideoElement(e,n);return this._load([s],r=>{const{autoplay:a,muted:o}=n;s.currentTime=0,a&&o&&s.play().catch(()=>{}),r(new TextureVideo({source:s,width:s.videoWidth,height:s.videoHeight,flipY:!0}))})})}_load(e,t){const n=this._loadChecker;return new Promise((s,r)=>{n.once("ready",a=>{a.errorCount>0||t(s)}),n.once("error",r),n.check(e)})}_toImageArray(e){return(Array.isArray(e)?e:[e]).map(n=>{if(isString(n)){const s=new Image;return s.crossOrigin="anonymous",s.src=n,s}else return n})}_toVideoElement(e,{muted:t,loop:n,volume:s}){if(e instanceof HTMLVideoElement)return e;const r=document.createElement("video");return r.crossOrigin="anonymous",r.playsInline=!0,r.setAttribute("webkit-playsinline",""),r.muted=t,r.volume=s,r.loop=n,Array.isArray(e)?e.forEach(o=>this._appendSourceElement(r,o)):this._appendSourceElement(r,e),r.querySelectorAll("source").length>0&&r.readyState<1&&r.load(),r}_appendSourceElement(e,t){if(t instanceof HTMLSourceElement)return t;const n=document.createElement("source");n.src=t,e.appendChild(n)}}class FrameAnimator{constructor(e,t=window){this.maxDeltaTime=e,this._context=t,this._rafId=-1,this._rafTimer=-1,this._lastUpdateTime=-1}start(e){const t=this._context;if(!t||!e||this._rafId>=0||this._rafTimer>=0)return;const n=(s,r)=>{const a=Date.now(),o=Math.min(a-this._lastUpdateTime,this.maxDeltaTime*1e3);e(o,r),this._lastUpdateTime=a,this._rafId=t.requestAnimationFrame(n)};this._lastUpdateTime=Date.now(),this._rafId=t.requestAnimationFrame(n)}stop(){this._rafId>=0&&this._context.cancelAnimationFrame(this._rafId),this._rafTimer>=0&&clearTimeout(this._rafTimer),this._rafId=-1,this._rafTimer=-1}changeContext(e){this.stop(),this._context=e}}class AutoResizer{get useResizeObserver(){return this._useResizeObserver}get enabled(){return this._enabled}constructor(e,t){this._skipFirstResize=(()=>{let n=!0;return()=>{if(n){n=!1;return}this._onResize()}})(),this._useResizeObserver=e,this._enabled=!1,this._resizeObserver=null,this._onResize=t}enable(e){if(this._enabled&&this.disable(),this._useResizeObserver&&window.ResizeObserver){const t=e.getBoundingClientRect(),n=t.width!==0||t.height!==0,s=new ResizeObserver(n?this._skipFirstResize:this._onResize);s.observe(e),this._resizeObserver=s}else window.addEventListener(EVENTS$1.RESIZE,this._onResize);return this._enabled=!0,this}disable(){if(!this._enabled)return this;const e=this._resizeObserver;return e?(e.disconnect(),this._resizeObserver=null):window.removeEventListener(EVENTS$1.RESIZE,this._onResize),this._enabled=!1,this}}class Autoplay{get enabled(){return this._enabled}get enableBlocked(){return this._enableBlocked}get playing(){return this._enabled&&!this._interrupted}get delay(){return this._delay}set delay(e){this._delay=e}get delayOnMouseLeave(){return this._delayOnMouseLeave}set delayOnMouseLeave(e){this._delayOnMouseLeave=e}get speed(){return this._speed}set speed(e){this._speed=e}get pauseOnHover(){return this._pauseOnHover}set pauseOnHover(e){this._pauseOnHover=e}get canInterrupt(){return this._canInterrupt}set canInterrupt(e){this._canInterrupt=e}get disableOnInterrupt(){return this._disableOnInterrupt}set disableOnInterrupt(e){this._disableOnInterrupt=e}constructor(e,t,n){this._onInputStart=()=>{this._canInterrupt&&(this._interrupted=!0,this._clearTimeout())},this._onInputEnd=()=>{this._setUninterruptedAfterDelay(this._delay)},this._onGyroEnable=()=>{this.disable()},this._onMouseEnter=()=>{this._pauseOnHover&&(this._interrupted=!0,this._hovering=!0)},this._onMouseLeave=()=>{this._pauseOnHover&&(this._hovering=!1,this._setUninterruptedAfterDelay(this._delayOnMouseLeave))},this._camera=e.camera,this._control=e.control,this._element=t,this._enabled=!1,this._interrupted=!1,this._interruptionTimer=-1,this._hovering=!1;const{delay:s=2e3,delayOnMouseLeave:r=0,speed:a=1,pauseOnHover:o=!1,canInterrupt:l=!0,disableOnInterrupt:d=!1}=getObjectOption(n);this._enableBlocked=!n,this._delay=s,this._delayOnMouseLeave=r,this._speed=a,this._pauseOnHover=o,this._canInterrupt=l,this._disableOnInterrupt=d}destroy(){this.disable()}update(e){if(!this._enabled)return;if(this._interrupted){this._disableOnInterrupt&&this.disable();return}const t=this._camera,n=-this._speed*e/100;t.yaw=circulate(t.yaw+n,0,360)}enable(){const e=this._control,t=this._element;this._enabled||e.gyro.enabled||(e.rotate.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.rotate.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd),e.zoom.on(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.zoom.on(CONTROL_EVENTS.INPUT_END,this._onInputEnd),e.gyro.on(CONTROL_EVENTS.ENABLE,this._onGyroEnable),t.addEventListener(EVENTS$1.MOUSE_ENTER,this._onMouseEnter,!1),t.addEventListener(EVENTS$1.MOUSE_LEAVE,this._onMouseLeave,!1),this._enabled=!0,this._enableBlocked=!1)}enableAfterDelay(){this.enable(),this._interrupted=!0,this._setUninterruptedAfterDelay(this._delay)}disable(){if(!this._enabled)return;const e=this._control,t=this._element;e.rotate.off(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.rotate.off(CONTROL_EVENTS.INPUT_END,this._onInputEnd),e.zoom.off(CONTROL_EVENTS.INPUT_START,this._onInputStart),e.zoom.off(CONTROL_EVENTS.INPUT_END,this._onInputEnd),e.gyro.off(CONTROL_EVENTS.ENABLE,this._onGyroEnable),t.removeEventListener(EVENTS$1.MOUSE_ENTER,this._onMouseEnter,!1),t.removeEventListener(EVENTS$1.MOUSE_LEAVE,this._onMouseLeave,!1),this._enabled=!1,this._interrupted=!1,this._hovering=!1,this._clearTimeout()}_setUninterruptedAfterDelay(e){this._hovering||(this._clearTimeout(),e>0?this._interruptionTimer=window.setTimeout(()=>{this._interrupted=!1,this._interruptionTimer=-1},e):(this._interrupted=!1,this._interruptionTimer=-1))}_clearTimeout(){this._interruptionTimer>=0&&(window.clearTimeout(this._interruptionTimer),this._interruptionTimer=-1)}}class XRManager extends Component{constructor(e,t={}){super(),this.destroy=()=>{this.exit(),this.off()},this._onSessionEnd=()=>{this.exit(),this.trigger(EVENTS.VR_END)},this._xrSession=null,this._xrRefSpace=null,this._ctx=e,this._options=t}isAvailable(){return __awaiter(this,void 0,void 0,function*(){const e=window.navigator.xr;return e?e.isSessionSupported(SESSION_VR).then(t=>t).catch(()=>!1):!1})}enter(){return __awaiter(this,void 0,void 0,function*(){const e=this._ctx,t=window.navigator.xr;if(!t)return;yield GyroControl.requestSensorPermission();const n=Object.assign({requiredFeatures:[XR_REFERENCE_SPACE]},this._options);yield e.makeXRCompatible();const s=yield t.requestSession(SESSION_VR,n);e.bindXRLayer(s);const r=yield s.requestReferenceSpace(XR_REFERENCE_SPACE);this._setSession(s,r),this.trigger(EVENTS.VR_START,{session:s})})}exit(){const e=this._xrSession;e&&e.end().catch(()=>{}),this._xrSession=null,this._xrRefSpace=null}canRender(e){const t=this._xrRefSpace;return t?!!e.getViewerPose(t):!1}getEyeParams(e){const t=e.session,n=e.getViewerPose(this._xrRefSpace);if(!n)return null;const s=t.renderState.baseLayer;return s?n.views.map(r=>{const a=s.getViewport(r),o=r.transform.inverse.matrix;return{viewport:a,vMatrix:o,pMatrix:r.projectionMatrix}}):null}_setSession(e,t){this._xrSession=e,this._xrRefSpace=t,e.addEventListener(EVENTS$1.XR_END,this._onSessionEnd)}}class Hotspot{constructor(e,t){this.element=e,this.position=t}}class HotspotRenderer{constructor(e,t,{zoom:n=!1}){this._containerEl=getNullableElement(`.${DEFAULT_CLASS.HOTSPOT_CONTAINER}`,e),this._renderer=t,this._hotspots=[],this._zoom=n}refresh(){const e=this._containerEl;if(!e)return;const t=[].slice.apply(e.querySelectorAll(`.${DEFAULT_CLASS.HOTSPOT}`));this._hotspots=t.map(n=>this._parseHotspot(n))}render(e){const t=this._hotspots,n=this._renderer.width*.5,s=this._renderer.height*.5,r=e.zoom,a="translate(-50%, -50%)",o=this._zoom?`scale(${r})`:"";t.forEach(l=>{const d=l.position,f=create$3();if(copy$2(f,d),transformMat4(f,f,e.viewMatrix),transformMat4(f,f,e.projectionMatrix),f[2]>1||f[2]<0){l.element.classList.remove(DEFAULT_CLASS.HOTSPOT_VISIBLE);return}const u=fromValues(f[0]*n+n,-f[1]*s+s);l.element.classList.add(DEFAULT_CLASS.HOTSPOT_VISIBLE),l.element.style.transform=[a,`translate(${u[0]}px, ${u[1]}px)`,o].join(" ")})}_parseHotspot(e){const t=e.dataset.yaw,n=e.dataset.pitch,s=e.dataset.position;if(t||n){const r=t?parseFloat(t):0,a=n?parseFloat(n):0,o=this._yawPitchToVec3(r,a);return new Hotspot(e,o)}else if(s){const r=s.split(" ").map(a=>parseFloat(a));if(r.length<3)throw new View360Error(ERROR.MESSAGES.INSUFFICIENT_ARGS(s,'hotspot attribute "data-position"'),ERROR.CODES.INSUFFICIENT_ARGS);return new Hotspot(e,fromValues$3(r[0],r[1],r[2]))}else{const r=fromValues$3(0,0,-1);return new Hotspot(e,r)}}_yawPitchToVec3(e,t){const n=e*DEG_TO_RAD,s=t*DEG_TO_RAD,r=create$3();return r[1]=Math.sin(s),r[2]=Math.cos(s),r[0]=r[2]*Math.sin(-n),r[2]=-r[2]*Math.cos(-n),r}}class VertexArrayObject{get count(){return this.geometry.indicies.count}constructor(e,t,n){this.obj=e,this.geometry=t,this.buffers=n}}class WebGLContext{get canvas(){return this._canvas}get maxTextureSize(){return this._maxTextureSize}get isWebGL2(){return this._isWebGL2}get supportVAO(){return this._isWebGL2||!!this._extensions.vao}get lost(){return this._contextLost}get debug(){return this._debug}constructor(e,t){this._onContextLost=()=>{this._canvas.classList.add(DEFAULT_CLASS.CTX_LOST),this._contextLost=!0},this._onContextRestore=()=>{this._canvas.classList.remove(DEFAULT_CLASS.CTX_LOST),this._contextLost=!1},this._canvas=e,this._contextLost=!1,this._debug=t,this._extensions={vao:null,loseContext:null}}init(){const e=this._canvas,{gl:t,isWebGL2:n}=this._getContext(e);this._gl=t,this._maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this._isWebGL2=n,this._isWebGL2||(this._extensions.vao=t.getExtension("OES_vertex_array_object")),this._extensions.loseContext=t.getExtension("WEBGL_lose_context"),e.addEventListener(EVENTS$1.CONTEXT_LOST,this._onContextLost),e.addEventListener(EVENTS$1.CONTEXT_RESTORED,this._onContextRestore)}destroy(){const e=this._gl,t=this._canvas;e&&(e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),t.removeEventListener(EVENTS$1.CONTEXT_LOST,this._onContextLost),t.removeEventListener(EVENTS$1.CONTEXT_RESTORED,this._onContextRestore)}forceLoseContext(){const e=this._extensions.loseContext;e&&e.loseContext()}forceRestoreContext(){const e=this._extensions.loseContext;e&&e.restoreContext()}clear(){const e=this._gl;e.clear(e.COLOR_BUFFER_BIT)}resize(){const e=this._gl;e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight)}viewport(e,t,n,s){this._gl.viewport(e,t,n,s)}createVAO(e,t){const n=this._createNativeVAO(),s=new VertexArrayObject(n,e,{indicies:this._createBuffer(),position:this._createBuffer(),uv:this._createBuffer()});return n&&(this._bindNativeVAO(n),this._supplyGeometryData(s,t),this._bindNativeVAO(null),this._unbindBuffers()),s}draw(e,t){const n=this._gl;e.obj?this._bindNativeVAO(e.obj):this._supplyGeometryData(e,t),n.drawElements(n.TRIANGLES,e.count,n.UNSIGNED_SHORT,0),e.obj?this._bindNativeVAO(null):this._unbindBuffers()}releaseVAO(e){e.obj&&this._deleteNativeVAO(e.obj),this._deleteBuffer(e.buffers.indicies),this._deleteBuffer(e.buffers.position),this._deleteBuffer(e.buffers.uv)}getUniformLocations(e,t){const n=this._gl,s=Object.keys(t).reduce((r,a)=>(r[a]=n.getUniformLocation(e,a),r),{});return Object.assign(Object.assign({},this._getCommonUniformLocations(e)),s)}updateCommonUniforms(e,t,n){const s=this._gl,r=n.uniformLocations,a=e.matrix,o=create$4();multiply$1(o,t.viewMatrix,a),s.uniformMatrix4fv(r.uMVMatrix,!1,o),s.uniformMatrix4fv(r.uPMatrix,!1,t.projectionMatrix)}updateVRUniforms(e,t,n,s){const r=this._gl,a=e.uniformLocations;r.uniformMatrix4fv(a.uMVMatrix,!1,t),r.uniformMatrix4fv(a.uPMatrix,!1,n),a.uEye&&r.uniform1f(a.uEye,s)}updateUniforms(e){const t=this._gl,n=e.uniforms,s=e.uniformLocations;for(const r in n){const a=n[r],o=s[r];a&&a.needsUpdate&&a.update(t,o,this._isWebGL2)}}releaseShaderResources(e){const t=this._gl,n=e.uniforms;for(const s in n){const r=n[s];r&&r.needsUpdate&&r.destroy(t)}t.deleteProgram(e.program)}useProgram(e){this._gl.useProgram(e.program)}createProgram(e,t){const n=this._gl,s=n.createProgram(),r=this._compileShader(n.VERTEX_SHADER,e),a=this._compileShader(n.FRAGMENT_SHADER,t);if(n.attachShader(s,r),n.attachShader(s,a),n.bindAttribLocation(s,0,"position"),n.bindAttribLocation(s,1,"uv"),n.linkProgram(s),this._debug&&!n.getProgramParameter(s,n.LINK_STATUS)){let o=null;throw n.getShaderParameter(r,n.COMPILE_STATUS)?n.getShaderParameter(a,n.COMPILE_STATUS)||(o=n.getShaderInfoLog(a)):o=n.getShaderInfoLog(r),new View360Error(ERROR.MESSAGES.FAILED_LINKING_PROGRAM(n.getProgramInfoLog(s),o),ERROR.CODES.FAILED_LINKING_PROGRAM)}return n.deleteShader(r),n.deleteShader(a),s}createWebGLTexture(e){const t=this._gl,n=t.createTexture();if(t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,e.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,e.wrapT),!e.isVideo()&&this._isWebGL2){const s=t;s.texStorage2D(s.TEXTURE_2D,1,s.RGBA8,e.width,e.height)}return n}createWebGLCubeTexture(e,t){const n=this._gl,s=n.createTexture();if(n.bindTexture(n.TEXTURE_CUBE_MAP,s),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,e.wrapS),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,e.wrapT),this._isWebGL2){const r=n;r.texStorage2D(r.TEXTURE_CUBE_MAP,1,r.RGBA8,t,t)}return s}makeXRCompatible(){return __awaiter(this,void 0,void 0,function*(){const e=this._gl,t=e.getContextAttributes();t&&t.xrCompatible!==!0&&(yield e.makeXRCompatible())})}bindXRLayer(e){const t=this._gl,n=new XRWebGLLayer(e,t);e.updateRenderState({baseLayer:n})}bindXRFrame(e){const t=this._gl,s=e.session.renderState.baseLayer;t.bindFramebuffer(t.FRAMEBUFFER,s.framebuffer)}useDefaultFrameBuffer(){const e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)}_createBuffer(){return this._gl.createBuffer()}_deleteBuffer(e){return this._gl.deleteBuffer(e)}_createNativeVAO(){const e=this._gl;if(this._isWebGL2)return e.createVertexArray();{const t=this._extensions.vao;return(t==null?void 0:t.createVertexArrayOES())||null}}_bindNativeVAO(e){const t=this._gl;if(this._isWebGL2)t.bindVertexArray(e);else{const n=this._extensions.vao;n==null||n.bindVertexArrayOES(e)}}_deleteNativeVAO(e){const t=this._gl;if(this._isWebGL2)t.deleteVertexArray(e);else{const n=this._extensions.vao;n==null||n.deleteVertexArrayOES(e)}}_supplyGeometryData(e,t){const n=e.geometry;this._supplyIndiciesData(n.indicies,e.buffers.indicies),this._supplyAttributeData(n.vertices,t.program,"position",e.buffers.position),this._supplyAttributeData(n.uvs,t.program,"uv",e.buffers.uv)}_unbindBuffers(){const e=this._gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),e.bindBuffer(e.ARRAY_BUFFER,null)}_supplyIndiciesData(e,t){const n=this._gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.data,n.STATIC_DRAW)}_supplyAttributeData(e,t,n,s){const r=this._gl,a=r.getAttribLocation(t,n);a<0||(r.bindBuffer(r.ARRAY_BUFFER,s),r.bufferData(r.ARRAY_BUFFER,e.data,r.STATIC_DRAW),r.vertexAttribPointer(a,e.itemSize,r.FLOAT,!1,0,0),r.enableVertexAttribArray(a))}_compileShader(e,t){const n=this._gl,s=n.createShader(e);return n.shaderSource(s,t),n.compileShader(s),s}_getCommonUniformLocations(e){const t=this._gl;return{uMVMatrix:t.getUniformLocation(e,"uMVMatrix"),uPMatrix:t.getUniformLocation(e,"uPMatrix")}}_getContext(e){const t=["webgl2","webgl","experimental-webgl","webkit-3d","moz-webgl"];let n=null,s=!1;const r={preserveDrawingBuffer:!1,antialias:!1},a=o=>o.statusMessage;e.addEventListener(EVENTS$1.CONTEXT_CREATE_ERROR,a);for(const o of t){try{n=e.getContext(o,r),s=o==="webgl2"}catch{}if(n)break}if(e.removeEventListener(EVENTS$1.CONTEXT_CREATE_ERROR,a),!n)throw new View360Error(ERROR.MESSAGES.WEBGL_NOT_SUPPORTED,ERROR.CODES.WEBGL_NOT_SUPPORTED);return{gl:n,isWebGL2:s}}}class WebGLRenderer{get canvas(){return this._canvas}get width(){return this._elementSize.x}get height(){return this._elementSize.y}get pixelRatio(){return this._pixelRatio}get aspect(){return this._elementSize.x/this._elementSize.y}constructor(e,t){this._canvas=e,this._elementSize={x:0,y:0},this._pixelRatio=1,this.ctx=new WebGLContext(e,t)}destroy(){const e=this._canvas;this.ctx.destroy(),e.width=1,e.height=1}resize(){const e=this._canvas,t=this._elementSize,n=window.devicePixelRatio;t.x=e.clientWidth,t.y=e.clientHeight,e.width=t.x*n,e.height=t.y*n,this._pixelRatio=n,this.ctx.resize()}render(e,t){const n=this.ctx;n.lost||(n.clear(),n.useProgram(e.program),n.updateCommonUniforms(e,t,e.program),e.update({camera:t}),n.updateUniforms(e.program),n.draw(e.vao,e.program))}renderVR(e,t,n){const s=this.ctx,r=t.getEyeParams(n);!r||!e||(s.bindXRFrame(n),s.useProgram(e.program),s.updateUniforms(e.program),r.forEach((a,o)=>{const l=a.viewport,d=multiply$1(create$4(),a.vMatrix,e.matrix);s.viewport(l.x,l.y,l.width,l.height),s.updateVRUniforms(e.program,d,a.pMatrix,o),s.draw(e.vao,e.program)}))}}class View360 extends Component{get rootEl(){return this._rootEl}get renderer(){return this._renderer}get camera(){return this._camera}get control(){return this._control}get vr(){return this._vr}get hotspot(){return this._hotspot}get plugins(){return this._plugins}get projection(){return this._projection}set projection(e){this._initialized&&e?this.load(e):this._projection=e}get mesh(){return this._mesh}get initialized(){return this._initialized}get autoplay(){return this._autoplay}get autoInit(){return this._autoInit}get autoResize(){return this._autoResize}get canvasSelector(){return this._canvasSelector}get useResizeObserver(){return this._useResizeObserver}get tabIndex(){return this._tabIndex}set tabIndex(e){const t=this._renderer.canvas;this._tabIndex=e,e!=null?t.tabIndex=e:t.removeAttribute("tabindex")}get maxDeltaTime(){return this._animator.maxDeltaTime}set maxDeltaTime(e){this._animator.maxDeltaTime=e}get debug(){return this._debug}set debug(e){this._debug=e}get initialYaw(){return this._camera.initialYaw}set initialYaw(e){this._camera.initialYaw=e}get initialPitch(){return this._camera.initialPitch}set initialPitch(e){this._camera.initialPitch=e}get initialZoom(){return this._camera.initialZoom}set initialZoom(e){this._camera.initialZoom=e}get yawRange(){return this._camera.yawRange}set yawRange(e){this._camera.yawRange=e,this._projection&&this._projection.updateCamera(this._camera)}get pitchRange(){return this._camera.pitchRange}set pitchRange(e){this._camera.pitchRange=e,this._projection&&this._projection.updateCamera(this._camera)}get zoomRange(){return this._camera.zoomRange}set zoomRange(e){this._camera.zoomRange=e,this._projection&&this._projection.updateCamera(this._camera)}get fov(){return this._camera.fov}set fov(e){const t=this._camera,n=this._control;t.fov=e,t.updateMatrix(),n.sync()}get rotate(){return this._control.rotate}get zoom(){return this._control.zoom}get gyro(){return this._control.gyro}get useGrabCursor(){return this._control.useGrabCursor}set useGrabCursor(e){this._control.useGrabCursor=e}get disableContextMenu(){return this._control.disableContextMenu}set disableContextMenu(e){this._control.disableContextMenu=e}get scrollable(){return this._control.scrollable}set scrollable(e){this._control.scrollable=e}get wheelScrollable(){return this._control.wheelScrollable}set wheelScrollable(e){this._control.wheelScrollable=e}constructor(e,{projection:t=null,initialYaw:n=0,initialPitch:s=0,initialZoom:r=1,yawRange:a=null,pitchRange:o=null,zoomRange:l=null,fov:d=90,useGrabCursor:f=!0,disableContextMenu:u=!1,rotate:p=!0,zoom:m=!0,gyro:g=!1,scrollable:y=!0,wheelScrollable:v=!1,autoplay:b=!1,hotspot:C={},autoInit:_=!0,autoResize:R=!0,canvasSelector:E="canvas",useResizeObserver:F=!0,on:O={},plugins:A=[],maxDeltaTime:N=1/30,tabIndex:M=0,debug:Z=!1}={}){super(),this.renderFrame=oe=>{const le=this._camera,de=this._renderer,ue=this._control,ce=this._hotspot,pe=this._autoplay,he=this._mesh;he&&(this._emit(EVENTS.BEFORE_RENDER),pe.playing&&(pe.update(oe),ue.sync()),le.animation?le.animation.update(oe):ue.update(oe),de.render(he,le),ce.render(le),le.changed&&this._emit(EVENTS.VIEW_CHANGE,{yaw:le.yaw,pitch:le.pitch,zoom:le.zoom,quaternion:[le.quaternion[0],le.quaternion[1],le.quaternion[2],le.quaternion[3]]}),le.onFrameRender(),this._emit(EVENTS.RENDER))},this._renderFrameOnDemand=oe=>{const le=this._camera,de=this._control,ue=this._autoplay,ce=this._mesh,pe=ce==null?void 0:ce.getTexture();!this._initialized||!pe||!le.animation&&!de.animating&&!ue.playing&&!pe.isVideo()||this.renderFrame(oe)},this._renderVRFrame=(oe,le)=>{const de=this._vr,ue=this._mesh,ce=this._renderer;ue&&(this._emit(EVENTS.BEFORE_RENDER),ce.renderVR(ue,de,le),this._emit(EVENTS.RENDER))},this._rootEl=getElement(e),this._plugins=A,this._initialized=!1,this._autoInit=_,this._autoResize=R,this._canvasSelector=E,this._useResizeObserver=F,this._tabIndex=M,this._debug=Z;const X=findCanvas(this._rootEl,E);this._renderer=new WebGLRenderer(X,Z),this._camera=new Camera({initialYaw:n,initialPitch:s,initialZoom:r,fov:d,yawRange:a,pitchRange:o,zoomRange:l}),this._control=new PanoControl(X,this._camera,{useGrabCursor:f,scrollable:y,wheelScrollable:v,disableContextMenu:u,rotate:p,zoom:m,gyro:g}),this._animator=new FrameAnimator(N),this._autoplay=new Autoplay(this,X,b),this._projection=t,this._mesh=null,this._autoResizer=new AutoResizer(F,()=>this.resize()),this._vr=new XRManager(this._renderer.ctx),this._hotspot=new HotspotRenderer(this._rootEl,this._renderer,C),this._addEventHandlers(O),t&&_&&this.init()}destroy(){this._camera.destroy(),this._animator.stop(),this._renderer.destroy(),this._control.destroy(),this._autoResizer.disable(),this._mesh&&(this._mesh.destroy(this._renderer.ctx),this._mesh=null),this._plugins.forEach(e=>e.destroy(this)),this._initialized=!1}init(){return __awaiter(this,void 0,void 0,function*(){if(!this._projection)throw new View360Error(ERROR.MESSAGES.PROVIDE_PROJECTION_FIRST,ERROR.CODES.PROVIDE_PROJECTION_FIRST);const e=this._renderer,t=this._camera,n=this._control,s=this._animator,r=this._hotspot,a=this._projection,o=e.canvas;this._bindComponentEvents(),e.ctx.init(),this._resizeComponents(),t.updateMatrix(),this._autoResize&&this._autoResizer.enable(o),this._autoplay.enableBlocked||this._autoplay.enable(),this._plugins.forEach(d=>{d.init(this)});const l=yield this._loadTexture(a);this._applyProjection(a,l),r.refresh(),s.start(this._renderFrameOnDemand),yield n.enable(),this._tabIndex!=null&&!o.hasAttribute("tabIndex")&&(o.tabIndex=this._tabIndex),this._initialized=!0,this.renderFrame(0),this._emit(EVENTS.READY)})}load(e){return __awaiter(this,void 0,void 0,function*(){if(!e)return!1;if(this._initialized){const t=yield this._loadTexture(e);this._applyProjection(e,t),this.renderFrame(0)}else this._projection=e,this.init();return!0})}resize(){if(!this._initialized)return;this._resizeComponents(),this.renderFrame(0);const{width:e,height:t}=this._renderer;this._emit(EVENTS.RESIZE,{width:e,height:t})}addPlugins(...e){this._initialized&&e.forEach(t=>{t.init(this)}),this._plugins.push(...e)}removePlugins(...e){e.forEach(t=>{const n=this._plugins.indexOf(t);n<0||(t.destroy(this),this._plugins.splice(n,1))})}_emit(e,...t){const n=t?t[0]:{};this.trigger(e,Object.assign({type:e,target:this},n))}_applyProjection(e,t){const n=this._camera,s=this._control,r=this._renderer,a=this._mesh;a&&a.destroy(r.ctx);const o=e.createMesh(r.ctx,t);e.updateCamera(n),e.updateControl(s),this._mesh=o,this._emit(EVENTS.PROJECTION_CHANGE,{projection:e})}_loadTexture(e){return __awaiter(this,void 0,void 0,function*(){const t=new TextureLoader,{src:n,video:s}=e;this._emit(EVENTS.LOAD_START,{src:n,video:s});const r=yield t.load(n,s);return this._emit(EVENTS.LOAD,{src:n,video:s}),r})}_resizeComponents(){const e=this._renderer,t=this._camera,n=this._control;e.resize(),t.resize(e.width,e.height),n.resize(e.width,e.height)}_addEventHandlers(e){Object.keys(e).forEach(t=>{this.on(t,e[t])})}_bindComponentEvents(){const e=this._rootEl,t=this._control,n=this._animator,s=this._renderer,r=this._vr;[CONTROL_EVENTS.STATIC_CLICK,CONTROL_EVENTS.INPUT_START,CONTROL_EVENTS.INPUT_END].forEach(o=>{t.rotate.on(o,l=>{this._emit(o,l)}),t.zoom.on(o,l=>{this._emit(o,l)})}),r.on(EVENTS.VR_START,o=>{e.classList.add(DEFAULT_CLASS.IN_VR),n.changeContext(o.session),n.start(this._renderVRFrame),this._emit(EVENTS.VR_START)}),r.on(EVENTS.VR_END,()=>{e.classList.remove(DEFAULT_CLASS.IN_VR),s.ctx.useDefaultFrameBuffer(),n.changeContext(window),n.start(this._renderFrameOnDemand),this.resize(),this._emit(EVENTS.VR_END)})}}View360.VERSION="4.0.0-beta.7";class Object3D extends Component{constructor(){super(),this.matrix=create$4(),this.rotation=create$1(),this.position=fromValues$3(0,0,0),this.scale=fromValues$3(1,1,1)}updateMatrix(){fromRotationTranslationScale(this.matrix,this.rotation,this.position,this.scale)}update(e){this.trigger(OBJECT_3D_EVENTS.UPDATE,e)}}class Projection{constructor({src:e,video:t=!1}){this.src=e,this.video=t}updateCamera(e){e.resetRange()}updateControl(e){e.ignoreZoomScale=!1}}class Uniform{constructor(){this.needsUpdate=!0}destroy(e){}}class TriangleMesh extends Object3D{constructor(e,t){super(),this.vao=e,this.program=t}destroy(e){e.releaseVAO(this.vao),e.releaseShaderResources(this.program)}getTexture(){return this.program.uniforms.uTexture.texture}}class ShaderProgram{constructor(e,t,n,s){this.program=e.createProgram(t,n),this.uniforms=s,this.uniformLocations=e.getUniformLocations(this.program,s)}}class VertexData{constructor(e,t){this.data=e,this.itemSize=t,this.count=e.length/t}}class Geometry{constructor(e,t,n){this.vertices=new VertexData(new Float32Array(e),3),this.indicies=new VertexData(new Uint16Array(t),1),this.uvs=new VertexData(new Float32Array(n),2)}}class UniformTexture2D extends Uniform{constructor(e,t){super(),this.texture=t,this._webglTexture=e.createWebGLTexture(t)}destroy(e){this.texture.destroy(),e.deleteTexture(this._webglTexture)}update(e,t,n){const s=this.texture,r=s.isVideo();e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.uniform1i(t,0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this._webglTexture),!r&&n?e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,s.source):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s.source),r||(this.needsUpdate=!1)}}var vs$2=`#define GLSLIFY 1
77
77
  attribute vec3 position;attribute vec2 uv;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;varying highp vec2 vUV;void main(){vUV=uv;gl_Position=uPMatrix*uMVMatrix*vec4(position,1.0);}`,fs$2=`#define GLSLIFY 1
78
78
  uniform sampler2D uTexture;varying highp vec2 vUV;void main(){gl_FragColor=texture2D(uTexture,vUV.st);}`;class SphereGeometry extends Geometry{constructor(){const n=-.5*Math.PI,s=[],r=[],a=[];let o,l;for(o=0;o<=60;o++){const d=(o/60-.5)*Math.PI,f=Math.sin(d),u=Math.cos(d);for(l=0;l<=60;l++){const p=(l/60-.5)*2*Math.PI+n,m=Math.sin(p),y=Math.cos(p)*u,v=f,b=m*u,C=l/60,_=o/60;if(s.push(C,_),r.push(y,v,b),l!==60&&o!==60){const R=o*61+l,E=R+60+1;a.push(R,R+1,E,E,R+1,E+1)}}}super(r,a,s)}}class EquirectProjection extends Projection{constructor(e){super(e)}createMesh(e,t){const n={uTexture:new UniformTexture2D(e,t)},s=new SphereGeometry,r=new ShaderProgram(e,vs$2,fs$2,n),a=e.createVAO(s,r);return new TriangleMesh(a,r)}}class UniformFloat extends Uniform{constructor(e){super(),this.val=e}update(e,t){e.uniform1f(t,this.val),this.needsUpdate=!1}}class UniformVector4Array extends Uniform{constructor(e){super(),this.val=e}update(e,t){e.uniform4fv(t,this.val.reduce((n,s)=>[...n,...s],[])),this.needsUpdate=!1}}var vs=`#define GLSLIFY 1
79
- attribute vec3 position;attribute vec2 uv;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;uniform vec4 uTexScaleOffset[2];uniform float uEye;varying highp vec2 vUV;void main(){vec4 scaleOffset=uTexScaleOffset[int(uEye)];vUV=uv.xy*scaleOffset.xy+scaleOffset.zw;gl_Position=uPMatrix*uMVMatrix*vec4(position,1.0);}`;class StereoEquiProjection extends Projection{constructor(e){super(e),this._mode=e.mode}createMesh(e,t){let n,s;switch(this._mode){case StereoEquiProjection.MODE.LEFT_RIGHT:n=[.5,1,0,0],s=[.5,1,.5,0];break;default:n=[1,.5,0,0],s=[1,.5,0,.5]}const r={uTexture:new UniformTexture2D(e,t),uEye:new UniformFloat(0),uTexScaleOffset:new UniformVector4Array([n,s])},a=new SphereGeometry,o=new ShaderProgram(e,vs,fs$2,r),l=e.createVAO(a,o);return new TriangleMesh(l,o)}}StereoEquiProjection.MODE={LEFT_RIGHT:"left_right",TOP_BOTTOM:"top_bottom"};const ar={save:"يحفظ",addPersonalMarker:"أضف علامة شخصية",editPersonalMarker:"تحرير العلامة الشخصية",pleaseSelectMarker:"الرجاء تحديد علامة.",pleaseEnterMarkerName:"الرجاء إدخال اسم العلامة.",maxLengthMarkerName:"يجب ألا يتجاوز طول اسم المؤشر 256 حرفًا.",successAddMarker:"تمت إضافة العلامة بنجاح.",successEditMarker:"تم تحرير العلامة بنجاح.",errorRegisteringTwoMarker:"خطأ في تسجيل علامتين في نفس الوقت.",pleaseLoginFirst:"الرجاء تسجيل الدخول أولا",addMarker:"أضف علامة",markerName:"اسم العلامة",description:"وصف",pleaseEnterMarkerDescription:"أدخل وصفًا للعلامة.",cancel:"انسحب",nextIn:"التالي في",play:"يلعب",visit:"يزور",clickForMoreVideos:"انقر لمزيد من أشرطة الفيديو",hour:"ساعة",minutes:"دقائق",seconds:"ثانیه",currentlyNoItemsSaved:"لا يوجد حاليا أي عناصر محفوظة.",savedList:"القائمة المحفوظة",enterYourOpinion:"أدخل رأيك",notPossibleRegisterComment:"حاليا، ليس من الممكن تسجيل تعليق.",youMustSubmitYourComment:"يجب عليك تقديم تعليقك",notPossibleToRegisterComment:"حاليا، ليس من الممكن تسجيل تعليق.",comeIn:"ادخل",sharing:"مشاركة",recordFeedback:"سجل ردود الفعل",cinematicFilm:"فيلم سينمائي",serial:"مسلسل",subtitle:"الترجمة",translation:"مزدوج",persian:"الفارسية",english:"إنجليزي",arabic:"عربي",turkish:"تركي",playlist:"قائمة التشغيل",playlists:"قوائم التشغيل",showPlaylist:"عرض قائمة التشغيل",suggestedVideos:"الفيديوهات المقترحة",become:"يصبح.",production:"إنتاج",viewPoint:"وجهة نظر",show:"يعرض",saved:"أنقذ",home:"بيت",profile:"حساب تعريفي",previousViewingTime:"وقت المشاهدة السابق",continuousPlaybackText:'سيتم تشغيل الفيديو الخاص بك من وقت المشاهدة السابق. إذا كنت تريد تشغيل الفيديو من البداية، فاختر خيار "مشاهدة الفيديو من البداية".',watchContinuousVideo:"شاهد بقية الفيديو",watchCBeginningVideo:"شاهد الفيديو من البداية",takingPicture:"التقاط الصور",liveChat:"الدردشة الحية",hideLiveChat:"إخفاء الدردشة المباشرة",showLiveChat:"عرض الدردشة الحية",anonymousUser:"مستخدم مجهول",awaitingApprovalByAdmin:"في انتظار موافقة المشرف",approvedByAdmin:"تمت الموافقة عليه من قبل المشرف",closeMessage:"أغلق الرسالة",viewFullPinnedMessage:"عرض الرسالة المثبتة كاملة",pinnedMessage:"رسالة مثبتة",less:"أقل",more:"أكثر",copyLink:"انسخ الرابط",linkWasCopied:"تم نسخ الرابط",download:"تحميل",withQuality:"مع الجودة",selectDownloadQuality:"حدد جودة التنزيل",badSoundAndImageQuality:"جودة الصوت والصورة سيئة",streamLinkFailure:"فشل رابط الدفق",amountOfInternetUsageWasHigh:"كان مقدار استخدام الإنترنت مرتفعًا",programAppearance:"مظهر البرنامج",soundAndImageMismatch:"عدم تطابق الصوت والصورة",noSubtitle:"لا ترجمات",noSubtitle1:"لا ترجمات",accessForMeDifficult:"كان من الصعب بالنسبة لي الوصول إليه",videoContentWasNotGood:"محتوى الفيديو لم يكن جيداً",goodSoundAndImageQuality:"جودة صوت وصورة جيدة",noDisconnection:"لا يوجد انقطاع",amountOfInternetUsage:"حجم استخدام الانترنت",privacyProtection:"حماية الخصوصية",farsiSubtitles:"ترجمات فارسية",easyAccess:"سهولة الوصول",appropriateVideoContent:"محتوى الفيديو المناسب",veryBad:"سيئة للغاية",bad:"سيء",middle:"متوسط",good:"جيد",veryGood:"جيد جدًا",successfullyCommentSubmit:"لقد تم تسجيل تعليقك بنجاح.",ratingZarebin:"",fullRateInternetTraffic:"يتم احتساب حركة المرور الخاصة بك على الإنترنت بالسعر الكامل.",exitFrom:"خروج از",fullScreen:"صفحة كاملة",lock:"قفل",markersList:"قائمة المؤشرات",markers:"نشانگرها",languageSelection:"اختيار اللغة",default:"تقصير",retry:"حاول ثانية",pictureInPicture:"صورة في صورة",video:"فيديو",season:"موسم",section:"جزء",playNextVideo:"قم بتشغيل الفيديو التالي",replay:"اعادتها",pause:"قف",quality:"جودة",automatic:"تلقائي",basedOnYourInternetSpeed:"على أساس سرعة الإنترنت لديك",settings:"إعدادات",choiceQuality:"اختيار الجودة",subtitleSettings:"إعدادات الترجمة",jumpTo:"القفز الى",mute:"صامت",unmute:"مع الصوت",playBackSpeed:"سرعة التشغيل",normalSpeed:"السرعة العادية",subtitleBackgroundColor:"لون خلفية الترجمة",subtitleTextColor:"لون نص الترجمة",subtitleSelection:"اختيار الترجمة",selectSubtitleBackgroundColor:"حدد لون الخلفية للترجمة",selectSubtitleTextColor:"اختر لون نص الترجمة",tagFilter:"مرشح العلامة",tags:"العلامات",separateItemsWithEnter:"افصل العناصر باستخدام Enter",contentType:"نوع المحتوى",search:"يبحث",accordingThisTagVideoNotFound:"حسب العلامة المطلوبة لم يتم العثور على الفيديو!",autoPlay:"اللعب التلقائي",bright:"ساطع",off:"عن",is:"يكون",photo:"صورة",currentlyNoVideoContent:"لا يوجد حاليا أي محتوى فيديو على هذه القناة لهذا البث المباشر.",viewOtherVideos:"يمكنك مشاهدة عمليات البث المباشر الأخرى أو التحقق من جدول البث المباشر المستقبلي لقناتك المطلوبة",enteredAddressNotCorrect:"العنوان الذي تم إدخاله غير صحيح.",first:"أولاً",second:"ثانية",third:"ثالث",fourth:"الرابع",fifth:"الخامس",sixth:"السادس",seventh:"السابع",eighth:"الثامن",ninth:"التاسع",tenth:"العاشر",eleventh:"الحادي عشر",twelfth:"الثاني عشر",thirteenth:"الثالث عشر",fourteenth:"الرابع عشر",fifteenth:"الخامس عشر",sixteenth:"السادس عشر",seventeenth:"السابع عشر",eighteenth:"الثامن عشر",nineteenth:"التاسع عشر",twentieth:"العشرين"},en={save:"Save",addPersonalMarker:"Add Marker",editPersonalMarker:"Edit Marker",pleaseSelectMarker:"Please select a marker.",pleaseEnterMarkerName:"Enter a marker name.",maxLengthMarkerName:"Marker name can’t exceed 256 characters.",successAddMarker:"Marker added successfully.",successEditMarker:"Marker updated successfully.",errorRegisteringTwoMarker:"Could not register marker.",pleaseLoginFirst:"Please log in first.",addMarker:"Add Marker",markerName:"Marker Name",description:"Description",pleaseEnterMarkerDescription:"Enter marker description.",cancel:"Cancel",nextIn:"Next in",play:"Play",visit:"Visit",clickForMoreVideos:"Click for more videos",hour:"Hour",minutes:"Minutes",seconds:"Seconds",currentlyNoItemsSaved:"No saved items yet.",savedList:"Saved List",enterYourOpinion:"Write your comment",notPossibleRegisterComment:"Comments are disabled right now.",youMustSubmitYourComment:"Please log in to comment.",notPossibleToRegisterComment:"Comments are disabled right now.",comeIn:"Login",sharing:"Share",recordFeedback:"Send Feedback",cinematicFilm:"Movie",serial:"Series",subtitle:"Subtitles",translation:"Dubbed",persian:"Persian",english:"English",arabic:"Arabic",turkish:"Turkish",playlist:"Playlist",playlists:"Playlists",showPlaylist:"Show Playlist",suggestedVideos:"Suggested Videos",become:"Become",production:"Production",viewPoint:"Viewpoint",show:"Show",saved:"Saved",home:"Home",profile:"Profile",previousViewingTime:"Last watched time",continuousPlaybackText:"Your video will continue from where you left off. To start from the beginning, choose 'Watch from start'.",watchContinuousVideo:"Continue Watching",watchCBeginningVideo:"Watch from Start",takingPicture:"Take Screenshot",liveChat:"Live Chat",hideLiveChat:"Hide Chat",showLiveChat:"Show Chat",anonymousUser:"Guest User",awaitingApprovalByAdmin:"Pending admin approval",approvedByAdmin:"Approved",closeMessage:"Close",viewFullPinnedMessage:"View full pinned message",pinnedMessage:"Pinned Message",less:"Show less",more:"Show more",copyLink:"Copy Link",linkWasCopied:"Link copied!",download:"Download",withQuality:"Quality",selectDownloadQuality:"Choose download quality",badSoundAndImageQuality:"Poor audio/video quality",streamLinkFailure:"Stream link error",amountOfInternetUsageWasHigh:"High data usage",programAppearance:"App appearance",soundAndImageMismatch:"Audio out of sync",noSubtitle:"No subtitles",noSubtitle1:"Without subtitles",accessForMeDifficult:"Hard to access",videoContentWasNotGood:"Video content wasn’t good",goodSoundAndImageQuality:"Good audio/video quality",noDisconnection:"No interruptions",amountOfInternetUsage:"Data usage",privacyProtection:"Privacy protection",farsiSubtitles:"Persian subtitles",easyAccess:"Easy access",appropriateVideoContent:"Appropriate content",veryBad:"Very Bad",bad:"Bad",middle:"Average",good:"Good",veryGood:"Very Good",successfullyCommentSubmit:"Comment submitted successfully.",ratingZarebin:"Rate Zarebin",fullRateInternetTraffic:"Internet usage will be counted fully.",exitFrom:"Exit",fullScreen:"Fullscreen",lock:"Lock",markersList:"Markers List",markers:"Markers",languageSelection:"Language",default:"Default",retry:"Retry",pictureInPicture:"Picture-in-Picture",video:"Video",season:"Season",section:"Episode",playNextVideo:"Play Next Video",replay:"Replay",pause:"Pause",quality:"Quality",automatic:"Auto",basedOnYourInternetSpeed:"Based on your internet speed",settings:"Settings",choiceQuality:"Select Quality",subtitleSettings:"Subtitle Settings",jumpTo:"Skip to",mute:"Mute",unmute:"Unmute",playBackSpeed:"Playback Speed",normalSpeed:"Normal",subtitleBackgroundColor:"Subtitle Background",subtitleTextColor:"Subtitle Text Color",subtitleSelection:"Select Subtitle",selectSubtitleBackgroundColor:"Choose subtitle background",selectSubtitleTextColor:"Choose subtitle text color",tagFilter:"Tag Filter",tags:"Tags",separateItemsWithEnter:"Separate items with Enter",contentType:"Content Type",search:"Search",accordingThisTagVideoNotFound:"No video found for this tag!",autoPlay:"Autoplay",bright:"Light",off:"Off",is:"is",photo:"Photo",currentlyNoVideoContent:"No video content available for this live stream.",viewOtherVideos:"You can check other live streams or upcoming schedules.",enteredAddressNotCorrect:"The entered address is invalid.",first:"First",second:"Second",third:"Third",fourth:"Fourth",fifth:"Fifth",sixth:"Sixth",seventh:"Seventh",eighth:"Eighth",ninth:"Ninth",tenth:"Tenth",eleventh:"Eleventh",twelfth:"Twelfth",thirteenth:"Thirteenth",fourteenth:"Fourteenth",fifteenth:"Fifteenth",sixteenth:"Sixteenth",seventeenth:"Seventeenth",eighteenth:"Eighteenth",nineteenth:"Nineteenth",twentieth:"Twentieth"},fa={save:"ذخیره",addPersonalMarker:"افزودن نشانگر شخصی",editPersonalMarker:"ویرایش نشانگر شخصی",pleaseSelectMarker:"لطفا یک نشانگر انتخاب نمایید.",pleaseEnterMarkerName:"لطفا نام نشانگر را وارد کنید.",maxLengthMarkerName:"اندازه نام نشانگر نباید بیش از 256 حرف باشد.",successAddMarker:"نشانگر با موفقیت اضافه شد.",successEditMarker:"نشانگر با موفقیت ویرایش شد.",errorRegisteringTwoMarker:"نشانگر با موفقیت ویرایش شد.",pleaseLoginFirst:"لطفا ابتدا وارد شوید.",addMarker:"افزودن نشانگر",markerName:"نام نشانگر",description:"توضیحات",pleaseEnterMarkerDescription:"توضیحات مربوط به نشانگر را وارد کنید.",cancel:"انصراف",nextIn:"بعدی در",play:"پخش",visit:"بازدید",clickForMoreVideos:"ویدیوهای بیشتر کلیک کنید",hour:"ساعت",minutes:"دقیقه",seconds:"ثانیه",currentlyNoItemsSaved:"در حال حاضر هیچ آیتمی ذخیره نشده است.",savedList:"لیست ذخیره‌شده‌ها",enterYourOpinion:"دیدگاه خود را وارد کنید",notPossibleRegisterComment:"در حال حاضر امکان ثبت دیدگاه وجود ندارد.",youMustSubmitYourComment:"شما برای ارسال دیدگاه خود باید",notPossibleToRegisterComment:"در حال حاضر امکان ثبت دیدگاه وجود ندارد.",comeIn:"وارد",sharing:"اشتراک گذاری",recordFeedback:"ثبت بازخورد",cinematicFilm:"فیلم سینمایی",serial:"سریال",subtitle:"زیرنویس",translation:"دوبله",persian:"فارسی",english:"انگلیسی",arabic:"عربی",turkish:"ترکی",playlist:"لیست پخش",playlists:"لیست‌های پخش",showPlaylist:"نمایش لیست‌پخش",suggestedVideos:"ویدیوهای پیشنهادی",become:"شوید.",production:"تولید",viewPoint:"دیدگاه",show:"نمایش",saved:"ذخیره‌شده‌ها",home:"خانه",profile:"پروفایل",previousViewingTime:"زمان مشاهده قبلی",continuousPlaybackText:"ویدیو شما از زمان مشاهده قبلی پخش خواهد شد. در صورت تمایل به پخش ویدیو از ابتدا گزینه “تماشای ویدیو از ابتدا” را انتخاب کنید",watchContinuousVideo:"تماشای ادامه ویدیو",watchCBeginningVideo:"تماشای ویدیو از ابتدا",takingPicture:"عکس گرفتن",liveChat:"گفت‌وگوی زنده",hideLiveChat:"مخفی کردن گفتگوی زنده",showLiveChat:"نمایش گفتگوی زنده",anonymousUser:"کاربر ناشناس",awaitingApprovalByAdmin:"در انتظار تایید توسط ادمین",approvedByAdmin:"تایید شده توسط ادمین",closeMessage:"بستن پیام",viewFullPinnedMessage:"مشاهده کامل پیام پین شده",pinnedMessage:"پیام پین شده",less:"کمتر",more:"بیشتر",copyLink:"کپی لینک",linkWasCopied:"لینک کپی شد",download:"دانلود",withQuality:"با کیفیت",selectDownloadQuality:"انتخاب کیفیت دانلود",badSoundAndImageQuality:"کیفیت بد صدا و تصویر",streamLinkFailure:"خرابی لینک استریم",amountOfInternetUsageWasHigh:"حجم مصرفی اینترنت زیاد بود",programAppearance:"ظاهر برنامه",soundAndImageMismatch:"عدم تطابق صدا و تصویر",noSubtitle:"نداشتن زیرنویس",noSubtitle1:"بدون زیرنویس",accessForMeDifficult:"دسترسی برام سخت بود",videoContentWasNotGood:"محتوای ویدیو خوب نبود",goodSoundAndImageQuality:"کیفیت خوب صدا و تصویر",noDisconnection:"بدون قطع و وصلی",amountOfInternetUsage:"میزان حجم مصرفی اینترنت",privacyProtection:"حفظ حریم شخصی",farsiSubtitles:"زیرنویس فارسی",easyAccess:"دسترسی آسان",appropriateVideoContent:"محتوای مناسب ویدیو",veryBad:"خیلی بد",bad:"بد",middle:"متوسط",good:"خوب",veryGood:"خیلی خوب",successfullyCommentSubmit:"نظر شما با موفقیت ثبت شد.",ratingZarebin:"امتیاز دادن به ذره بین",fullRateInternetTraffic:"ترافیک اینترنت شما تمام بها محاسبه می‌شود.",exitFrom:"خروج از",fullScreen:"تمام صفحه",lock:"قفل",markersList:"لیست نشانگرها",markers:"نشانگرها",languageSelection:"انتخاب زبان",default:"پیش فرض",retry:"تلاش مجدد",pictureInPicture:"تصویر در تصویر",video:"ویدیو",season:"فصل",section:"قسمت",playNextVideo:"پخش ویدیوی بعدی ",replay:"بازپخش",pause:"توقف",quality:"کیفیت",automatic:"خودکار",basedOnYourInternetSpeed:"بر اساس سرعت اینترنت شما",settings:"تنظیمات",choiceQuality:"انتخاب کیفیت",subtitleSettings:"تنظیمات زیرنویس",jumpTo:"پرش به",mute:"بی صدا",unmute:"با صدا",playBackSpeed:"سرعت پخش",normalSpeed:"سرعت معمولی",subtitleBackgroundColor:"رنگ پس زمینه زیرنویس",subtitleTextColor:"رنگ متن زیرنویس",subtitleSelection:"انتخاب زیرنویس",selectSubtitleBackgroundColor:"انتخاب رنگ پس زمینه زیرنویس",selectSubtitleTextColor:"انتخاب رنگ متن زیرنویس",tagFilter:"فیلتر تگ",tags:"تگ ها",separateItemsWithEnter:"آیتم ها را با Enter از هم جدا کنید",contentType:"نوع محتوا",search:"جستجو",accordingThisTagVideoNotFound:"با توجه به تگ مورد نظر ویدیویی یافت نشد!",autoPlay:"پخش خودکار",bright:"روشن",off:"خاموش",is:"است",photo:"عکس",currentlyNoVideoContent:"در حال حاضر محتوای ویدیویی در این کانال برای این پخش‌زنده وجود ندارد.",viewOtherVideos:"شما می‌توانید سایر پخش زنده های ما را مشاهده کنید یا برنامه پخش زنده‌های آینده کانال مورد نظر خود را چک کنید",enteredAddressNotCorrect:"آدرس وارد شده صحیح نیست.",first:"اول",second:"دوم",third:"سوم",fourth:"چهارم",fifth:"پنجم",sixth:"ششم",seventh:"هفتم",eighth:"هشتم",ninth:"نهم",tenth:"دهم",eleventh:"یازدهم",twelfth:"دوازدهم",thirteenth:"سیزدهم",fourteenth:"چهاردهم",fifteenth:"پانزدهم",sixteenth:"شانزدهم",seventeenth:"هفدهم",eighteenth:"هجدهم",nineteenth:"نوزدهم",twentieth:"بیستم"},translate=()=>{const{params:i}=store.getState().videoData;return i.lang===Lang.en?en:i.lang===Lang.ar?ar:fa},PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0",PACKET_TYPES.close="1",PACKET_TYPES.ping="2",PACKET_TYPES.pong="3",PACKET_TYPES.message="4",PACKET_TYPES.upgrade="5",PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(i=>{PACKET_TYPES_REVERSE[PACKET_TYPES[i]]=i});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,encodePacket=({type:i,data:e},t,n)=>withNativeBlob$1&&e instanceof Blob?t?n(e):encodeBlobAsBase64(e,n):withNativeArrayBuffer$2&&(e instanceof ArrayBuffer||isView$1(e))?t?n(e):encodeBlobAsBase64(new Blob([e]),n):n(PACKET_TYPES[i]+(e||"")),encodeBlobAsBase64=(i,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(i)};function toArray(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(i,e){if(withNativeBlob$1&&i.data instanceof Blob)return i.data.arrayBuffer().then(toArray).then(e);if(withNativeArrayBuffer$2&&(i.data instanceof ArrayBuffer||isView$1(i.data)))return e(toArray(i.data));encodePacket(i,!1,t=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),e(TEXT_ENCODER.encode(t))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<chars.length;i++)lookup$1[chars.charCodeAt(i)]=i;const decode$1=i=>{let e=i.length*.75,t=i.length,n,s=0,r,a,o,l;i[i.length-1]==="="&&(e--,i[i.length-2]==="="&&e--);const d=new ArrayBuffer(e),f=new Uint8Array(d);for(n=0;n<t;n+=4)r=lookup$1[i.charCodeAt(n)],a=lookup$1[i.charCodeAt(n+1)],o=lookup$1[i.charCodeAt(n+2)],l=lookup$1[i.charCodeAt(n+3)],f[s++]=r<<2|a>>4,f[s++]=(a&15)<<4|o>>2,f[s++]=(o&3)<<6|l&63;return d},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(i,e)=>{if(typeof i!="string")return{type:"message",data:mapBinary(i,e)};const t=i.charAt(0);return t==="b"?{type:"message",data:decodeBase64Packet(i.substring(1),e)}:PACKET_TYPES_REVERSE[t]?i.length>1?{type:PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:PACKET_TYPES_REVERSE[t]}:ERROR_PACKET},decodeBase64Packet=(i,e)=>{if(withNativeArrayBuffer$1){const t=decode$1(i);return mapBinary(t,e)}else return{base64:!0,data:i}},mapBinary=(i,e)=>{switch(e){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},SEPARATOR="",encodePayload=(i,e)=>{const t=i.length,n=new Array(t);let s=0;i.forEach((r,a)=>{encodePacket(r,!1,o=>{n[a]=o,++s===t&&e(n.join(SEPARATOR))})})},decodePayload=(i,e)=>{const t=i.split(SEPARATOR),n=[];for(let s=0;s<t.length;s++){const r=decodePacket(t[s],e);if(n.push(r),r.type==="error")break}return n};function createPacketEncoderStream(){return new TransformStream({transform(i,e){encodePacketToBinary(i,t=>{const n=t.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const r=new DataView(s.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{s=new Uint8Array(9);const r=new DataView(s.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}let TEXT_DECODER;function totalLength(i){return i.reduce((e,t)=>e+t.length,0)}function concatChunks(i,e){if(i[0].length===e)return i.shift();const t=new Uint8Array(e);let n=0;for(let s=0;s<e;s++)t[s]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function createPacketDecoderStream(i,e){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const t=[];let n=0,s=-1,r=!1;return new TransformStream({transform(a,o){for(t.push(a);;){if(n===0){if(totalLength(t)<1)break;const l=concatChunks(t,1);r=(l[0]&128)===128,s=l[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(totalLength(t)<2)break;const l=concatChunks(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(totalLength(t)<8)break;const l=concatChunks(t,8),d=new DataView(l.buffer,l.byteOffset,l.length),f=d.getUint32(0);if(f>Math.pow(2,21)-1){o.enqueue(ERROR_PACKET);break}s=f*Math.pow(2,32)+d.getUint32(4),n=3}else{if(totalLength(t)<s)break;const l=concatChunks(t,s);o.enqueue(decodePacket(r?l:TEXT_DECODER.decode(l),e)),n=0}if(s===0||s>i){o.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(i){if(i)return mixin(i)}function mixin(i){for(var e in Emitter.prototype)i[e]=Emitter.prototype[e];return i}Emitter.prototype.on=Emitter.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this},Emitter.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,s=0;s<t.length;s++)if(n=t[s],n===e||n.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+i],this},Emitter.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,s=t.length;n<s;++n)t[n].apply(this,e)}return this},Emitter.prototype.emitReserved=Emitter.prototype.emit,Emitter.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]},Emitter.prototype.hasListeners=function(i){return!!this.listeners(i).length};const nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),defaultBinaryType="arraybuffer";function createCookieJar(){}function pick(i,...e){return e.reduce((t,n)=>(i.hasOwnProperty(n)&&(t[n]=i[n]),t),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(i,e){e.useNativeTimers?(i.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),i.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(i.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),i.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(i){return typeof i=="string"?utf8Length(i):Math.ceil((i.byteLength||i.size)*BASE64_OVERHEAD)}function utf8Length(i){let e=0,t=0;for(let n=0,s=i.length;n<s;n++)e=i.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function randomString(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode(i){let e="";for(let t in i)i.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(i[t]));return e}function decode(i){let e={},t=i.split("&");for(let n=0,s=t.length;n<s;n++){let r=t[n].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class TransportError extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Transport extends Emitter{constructor(e){super(),this.writable=!1,installTimerFunctions(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new TransportError(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=decodePacket(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=encode(e);return t.length?"?"+t:""}}class Polling extends Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};decodePayload(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,encodePayload(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=randomString()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let value=!1;try{value=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(i){}const hasCORS=value;function empty(){}class BaseXHR extends Polling{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(s,r)=>{this.onError("xhr post error",s,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}let Request$1=class Ft extends Emitter{constructor(e,t,n){super(),this.createRequest=e,installTimerFunctions(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=pick(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Ft.requestsCount++,Ft.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=empty,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ft.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};if(Request$1.requestsCount=0,Request$1.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const i="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(i,unloadHandler,!1)}}function unloadHandler(){for(let i in Request$1.requests)Request$1.requests.hasOwnProperty(i)&&Request$1.requests[i].abort()}const hasXHR2=function(){const i=newRequest({xdomain:!1});return i&&i.responseType!==null}();class XHR extends BaseXHR{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=hasXHR2&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Request$1(newRequest,this.uri(),e)}}function newRequest(i){const e=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||hasCORS))return new XMLHttpRequest}catch{}if(!e)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class BaseWS extends Transport{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],s=t===e.length-1;encodePacket(n,this.supportsBinary,r=>{try{this.doWrite(n,r)}catch{}s&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=randomString()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;class WS extends BaseWS{createSocket(e,t,n){return isReactNative?new WebSocketCtor(e,t,n):t?new WebSocketCtor(e,t):new WebSocketCtor(e)}doWrite(e,t){this.ws.send(t)}}class WT extends Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),s=createPacketEncoderStream();s.readable.pipeTo(e.writable),this._writer=s.writable.getWriter();const r=()=>{n.read().then(({done:o,value:l})=>{o||(this.onPacket(l),r())}).catch(o=>{})};r();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],s=t===e.length-1;this._writer.write(n).then(()=>{s&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const transports={websocket:WS,webtransport:WT,polling:XHR},re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$1(i){if(i.length>8e3)throw"URI too long";const e=i,t=i.indexOf("["),n=i.indexOf("]");t!=-1&&n!=-1&&(i=i.substring(0,t)+i.substring(t,n).replace(/:/g,";")+i.substring(n,i.length));let s=re.exec(i||""),r={},a=14;for(;a--;)r[parts[a]]=s[a]||"";return t!=-1&&n!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=pathNames(r,r.path),r.queryKey=queryKey(r,r.query),r}function pathNames(i,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function queryKey(i,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,r){s&&(t[s]=r)}),t}const withEventListeners=typeof addEventListener=="function"&&typeof removeEventListener=="function",OFFLINE_EVENT_LISTENERS=[];withEventListeners&&addEventListener("offline",()=>{OFFLINE_EVENT_LISTENERS.forEach(i=>i())},!1);class SocketWithoutUpgrade extends Emitter{constructor(e,t){if(super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=parse$1(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=parse$1(t.host).host);installTimerFunctions(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const s=n.prototype.name;this.transports.push(s),this._transportsByName[s]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode(this.opts.query)),withEventListeners&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=protocol$1,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",SocketWithoutUpgrade.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const s=this.writeBuffer[n].data;if(s&&(t+=byteLength(s)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,nextTick(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,s){if(typeof t=="function"&&(s=t,t=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const r={type:e,data:t,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(SocketWithoutUpgrade.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),withEventListeners&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);n!==-1&&OFFLINE_EVENT_LISTENERS.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}SocketWithoutUpgrade.protocol=protocol$1;class SocketWithUpgrade extends SocketWithoutUpgrade{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;SocketWithoutUpgrade.priorWebsocketSuccess=!1;const s=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!n)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;SocketWithoutUpgrade.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(f(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=t.name,this.emitReserved("upgradeError",p)}}))};function r(){n||(n=!0,f(),t.close(),t=null)}const a=u=>{const p=new Error("probe error: "+u);p.transport=t.name,r(),this.emitReserved("upgradeError",p)};function o(){a("transport closed")}function l(){a("socket closed")}function d(u){t&&u.name!==t.name&&r()}const f=()=>{t.removeListener("open",s),t.removeListener("error",a),t.removeListener("close",o),this.off("close",l),this.off("upgrading",d)};t.once("open",s),t.once("error",a),t.once("close",o),this.once("close",l),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let Socket$1=class extends SocketWithUpgrade{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(s=>transports[s]).filter(s=>!!s)),super(e,n)}};function url(i,e="",t){let n=i;t=t||typeof location<"u"&&location,i==null&&(i=t.protocol+"//"+t.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=t.protocol+i:i=t.host+i),/^(https?|wss?):\/\//.test(i)||(typeof t<"u"?i=t.protocol+"//"+i:i="https://"+i),n=parse$1(i)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const r=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+e,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,toString$1=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$1.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$1.call(File)==="[object FileConstructor]";function isBinary(i){return withNativeArrayBuffer&&(i instanceof ArrayBuffer||isView(i))||withNativeBlob&&i instanceof Blob||withNativeFile&&i instanceof File}function hasBinary(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(hasBinary(i[t]))return!0;return!1}if(isBinary(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return hasBinary(i.toJSON(),!0);for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&hasBinary(i[t]))return!0;return!1}function deconstructPacket(i){const e=[],t=i.data,n=i;return n.data=_deconstructPacket(t,e),n.attachments=e.length,{packet:n,buffers:e}}function _deconstructPacket(i,e){if(!i)return i;if(isBinary(i)){const t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){const t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=_deconstructPacket(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){const t={};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=_deconstructPacket(i[n],e));return t}return i}function reconstructPacket(i,e){return i.data=_reconstructPacket(i.data,e),delete i.attachments,i}function _reconstructPacket(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=_reconstructPacket(i[t],e);else if(typeof i=="object")for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=_reconstructPacket(i[t],e));return i}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(e){this.replacer=e}encode(e){return(e.type===PacketType.EVENT||e.type===PacketType.ACK)&&hasBinary(e)?this.encodeAsBinary({type:e.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===PacketType.BINARY_EVENT||e.type===PacketType.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=deconstructPacket(e),n=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(n),s}}function isObject$1(i){return Object.prototype.toString.call(i)==="[object Object]"}class Decoder extends Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===PacketType.BINARY_EVENT;n||t.type===PacketType.BINARY_ACK?(t.type=n?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(isBinary(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(PacketType[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===PacketType.BINARY_EVENT||n.type===PacketType.BINARY_ACK){const r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const a=e.substring(r,t);if(a!=Number(a)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.nsp="/";const s=e.charAt(t+1);if(s!==""&&Number(s)==s){const r=t+1;for(;++t;){const a=e.charAt(t);if(a==null||Number(a)!=a){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(Decoder.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case PacketType.CONNECT:return isObject$1(t);case PacketType.DISCONNECT:return t===void 0;case PacketType.CONNECT_ERROR:return typeof t=="string"||isObject$1(t);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&RESERVED_EVENTS$1.indexOf(t[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on(i,e,t){return i.on(e,t),function(){i.off(e,t)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[on(e,"open",this.onopen.bind(this)),on(e,"packet",this.onpacket.bind(this)),on(e,"error",this.onerror.bind(this)),on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,s,r;if(RESERVED_EVENTS.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const a={type:PacketType.EVENT,data:t};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const f=this.ids++,u=t.pop();this._registerAckCallback(f,u),a.id=f}const o=(s=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||s===void 0?void 0:s.writable,l=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,t){var n;const s=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(s===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},s),a=(...o)=>{this.io.clearTimeoutFn(r),t.apply(this,o)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...t){return new Promise((n,s)=>{const r=(a,o)=>a?s(a):n(o);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...r)=>n!==this._queue[0]?void 0:(s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(s)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(e);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(e);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...s){n||(n=!0,t.packet({type:PacketType.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Backoff(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*i);i=Math.floor(e*10)&1?i+t:i-t}return Math.min(i,this.max)|0},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(i){this.ms=i},Backoff.prototype.setMax=function(i){this.max=i},Backoff.prototype.setJitter=function(i){this.jitter=i};class Manager extends Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,installTimerFunctions(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||parser;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=on(t,"open",function(){n.onopen(),e&&e()}),r=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},a=on(t,"error",r);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{s(),r(new Error("timeout")),t.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(on(e,"ping",this.onping.bind(this)),on(e,"data",this.ondata.bind(this)),on(e,"error",this.onerror.bind(this)),on(e,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){nextTick(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const cache={};function lookup(i,e){typeof i=="object"&&(e=i,i=void 0),e=e||{};const t=url(i,e.path||"/socket.io"),n=t.source,s=t.id,r=t.path,a=cache[s]&&r in cache[s].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let l;return o?l=new Manager(n,e):(cache[s]||(cache[s]=new Manager(n,e)),l=cache[s]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const handleGetUsersInChat=async i=>{const e=await axios({url:API().user.profile,method:"post",headers:{"Content-Type":"application/json"},data:i});return responseValidator(e.status)?e.data:[]},submitCommentInChat=async(i,e,t)=>{const n=store.dispatch,{roomId:s,messages:r,messageCount:a,chatType:o}=store.getState().chats,{name:l,avatar_url:d}=store.getState().user,f={room:s,text:t?void 0:e,default_message_id:t??void 0},{data:u,status:p}=await submitChatComment(f);if(responseValidator(p)){if(!t&&o===ChatType.private){const m={name:l,avatar_url:d,created_at:u.created_at,text:e,author:u.author,room_id:s,id:u.id,isConfirmed:!1};n(setMessages(r?[m,...r]:[m])),n(setMessageCount(a+1))}}else ae({title:"ارتباط با سرور دچار مشکل شده است.",type:"error"});i&&i("")},fetchChatMessage=async(i,e)=>{const{roomId:t,messages:n,messageCount:s}=store.getState().chats,r=store.dispatch,{data:a,status:o}=await getAllChatMessages(t,i);if(responseValidator(o)){e(!1);let l=[];s!==0?n?l=[...n,...a.results]:l=[...a.results]:l=[...a.results],r(setMessageCount(a.count)),handleFirstTimeChatRoomMessage(l)}},handleConnectSocket=i=>{const e=store.dispatch,{roomId:t}=store.getState().chats;let n;n=lookup(API().live.liveChat.chat(t)),n.on("connect",async()=>{e(setSocket(n)),fetchChatMessage(0,i),n.on("message",async s=>handleChatRoomMessage(s))})},handleChatRoomMessage=async i=>{const e=store.dispatch,{messages:t,chatType:n}=store.getState().chats,{userId:s}=store.getState().user;if(!Array.isArray(i)){let r;if(n!==ChatType.public&&t&&(r=t.findIndex(o=>o.id===i.id)),r>-1&&t&&t.length){const o=JSON.parse(JSON.stringify(t));o[r].isConfirmed=!0,e(setMessages(o))}else n===ChatType.auto&&s===i.author&&(i.isConfirmed=!0),t&&t.length?e(setMessages([i,...t])):e(setMessages([i]));const{usersInfoInChat:a}=store.getState().chats;if(!a.find(o=>o.id===i.author)){const o=await handleGetUsersInChat([i.author]);o.length&&e(setUsersInfoInChat([...a,...o]))}}},handleFirstTimeChatRoomMessage=async i=>{const e=store.dispatch;if(i.length){e(setMessages(i));let t=[];i.map(s=>t.push(s.author)),t=[...new Set(t)];const n=await handleGetUsersInChat(t);n.length&&e(setUsersInfoInChat(n))}else e(setMessages([]))},handleChatActiveRoom=async i=>{const e=store.dispatch,{params:t}=store.getState().videoData,{roomId:n,chatEnabled:s,socket:r,showChat:a}=store.getState().chats;let o;if(!conditions(ConditionName.hasQuizParams)&&conditions(ConditionName.isParamsPortrait)&&i){let{data:l,status:d}=await apiCaller({url:API().live.liveChat.getRoomId(+String(t.id))});responseValidator(d)&&(n!==l.id&&r&&(e(setMessages([])),e(setChatEnabled(!1))),e(setDefaultMessages(l.default_messages)),e(setPinMessage(l.pin)),e(setRoomId(l.id)),e(setChatType(l.type)),o=l.id)}else s&&r&&(e(setMessages([])),e(setChatEnabled(!1)));s!==!!o&&setTimeout(()=>{a&&e(setChatPopover(!0)),e(setChatEnabled(!!o))},0)},submitChatComment=async i=>{const{data:e,status:t}=await apiCaller({url:API().live.liveChat.sendChatMessage,method:"post",data:i,headers:handleHasXTokenParamOrSendXToken(),retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}},getAllChatMessages=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:API().live.liveChat.getMessageList(i),method:"GET",data:{offset:e,limit:10,ordering:"-created_at"},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},feedbackLog=(i,e,t)=>{const{params:n,details:s}=store.getState().videoData;return{category:"feedback",id:Number(n.id),stars:i,text:e,customText:t,type:n.type,src:conditions(ConditionName.hasStreamLink)?s.stream_link:n.src,provider:n.provider}},eventMarkerClickLog=(i,e,t,n,s)=>{const{params:r,details:a}=store.getState().videoData;return{category:"eventMarkerClick",video_id:conditions(ConditionName.isLiveParam)?a.id:Number(r.id),markerId:i,markerTime:e,markerTitle:t,markerDescription:n,markerSticker:s,type:r.type,src:conditions(ConditionName.hasStreamLink)?a.stream_link:r.src,provider:r.provider}},speedChangeLog=i=>{const{params:e,details:t}=store.getState().videoData,{settings:n}=store.getState().user;return{category:"speedChange",previousSelectedSpeed:n.speed,selectedSpeed:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,provider:e.provider}},qualityChangeRequestLog=i=>{const{params:e,details:t}=store.getState().videoData,{qualityLevels:n,manualQuality:s,autoQuality:r}=store.getState().controller;return{category:"qualityChangeRequest",currentPlayingQuality:`${n[conditions(ConditionName.isAutoQuality)?r??s:s]}P`,previousSelectedQuality:conditions(ConditionName.isAutoQuality)?"auto":`${n[s]}P`,selectedQuality:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,provider:e.provider}},catchUpLoadingLog=i=>{const{params:e,details:t}=store.getState().videoData,{hlsLiveSyncPosition:n,qualityLevels:s,autoQuality:r}=store.getState().controller,{settings:a}=store.getState().user;return{category:"catchUpLoading",previousVideoTime:Number(sessionStorage.getItem("previousVideoTime")),currentVideoTime:n,duration:i,quality:`${conditions(ConditionName.isAutoQuality)?s[r]:s[a.quality]}P`,isAutoQuality:conditions(ConditionName.isAutoQuality),id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,provider:e.provider}},shareDialogLog=(i,e,t,n)=>{const{params:s,details:r}=store.getState().videoData;return{category:"shareDialog",id:Number(s.id),type:s.type,src:conditions(ConditionName.hasStreamLink)?r.stream_link:s.src,videoTime:i,eventMarkerId:n,provider:s.provider,jump:e?"true":"false",jumpTime:e?t:void 0}},shareCopyLog=(i,e,t,n)=>{const{params:s,details:r}=store.getState().videoData;return{category:"shareCopy",id:Number(s.id),type:s.type,src:conditions(ConditionName.hasStreamLink)?r.stream_link:s.src,videoTime:i,eventMarkerId:n,jump:e?"true":"false",jumpTime:e?t:void 0,provider:s.provider}},alternativeLiveLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"alternativeLiveClick",id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,alternativeLiveUserId:i,provider:e.provider}},deActiveSettingLog=()=>{const{params:i,details:e}=store.getState().videoData,{settings:t}=store.getState().user;let n={id:Number(i.id),type:i.type,src:conditions(ConditionName.hasStreamLink)?e.stream_link:i.src,provider:i.provider};return t.poll_emoji?{...n,category:"activeSetting"}:{...n,category:"deactiveSetting",hasOtherLive:conditions(ConditionName.hasAlternativeLives)?"true":"false",hasPoll:conditions(ConditionName.hasPoll)?"true":"false",hasEmoji:conditions(ConditionName.hasEmojiList1Or2)?"true":"false"}},backwardForwardLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i==="backward"?"backward":"forward",id:Number(e.id),type:e.type,src:t.stream_link?t.stream_link:e.src,provider:e.provider}},pollModalCloseLog=(i,e,t)=>({category:"pollModalClose",pollId:t,id:Number(i.id),type:i.type,src:e.stream_link?e.stream_link:i.src,provider:i.provider}),tagClickLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"tagClick",tagText:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},likeDislikeLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},fullscreenLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},brightnessLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData;return{category:"brightnessChange",source:i,target:e,id:Number(t.id),type:t.type,src:conditions(ConditionName.hasStreamLink)?n.stream_link:t.src}},volumeLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData;return{category:"volumeChange",source:i,target:e,id:Number(t.id),type:t.type,src:conditions(ConditionName.hasStreamLink)?n.stream_link:t.src}},subtitleLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"subtitle",language:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},lockLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},recommendationListLog=(i,e,t,n)=>{const{params:s,details:r}=store.getState().videoData;return{category:"recommend",sourcevideoId:conditions(ConditionName.isLiveParam)?r.id:+s.id,targetVideoId:i,sourceUserId:r.user_id,targetUserId:e,sourceType:s.type,targetType:t,listIndex:n,id:Number(s.id),type:s.type,src:conditions(ConditionName.hasStreamLink)?r.stream_link:s.src}},ExceptionsLog=(i,e)=>({category:"error",type:i,message:e}),videoTimelineLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData,{duration:s}=store.getState().controller;return{category:"video-timeline",video_id:conditions(ConditionName.isLiveParam)?n.id:+t.id,video_type:t.type==="archive"?"live":t.type,start:i,end:e,watchedDuration:e-i,video_duration:conditions(ConditionName.isLiveParam)?null:Math.floor(s),clientUUID:getUUID(),user_id:conditions(ConditionName.isLiveParam)?t.id:n.user_id,content_type:n.content_type,content_id:n.content_id}},bookmarkLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:conditions(ConditionName.isLiveParam)?t.id:+e.id,type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},autoQualityChangeLog=(i,e,t)=>{const{params:n,details:s}=store.getState().videoData;return{category:"autoQualityChange",sourceQuality:i,targetQuality:e,diffQuality:t,id:Number(n.id),type:n.type,src:conditions(ConditionName.hasStreamLink)?s.stream_link:n.src,provider:n.provider}},pingpongLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData;return{category:"pingpong",id:Number(t.id),type:t.type,src:conditions(ConditionName.hasStreamLink)?n.stream_link:t.src,PingPongDuration:Number((new Date().getTime()-i).toFixed(2)),PingPongSourceQuality:`${e[0]}P`,PingPongTargetQuality:`${e[1]}P`,provider:t.provider}},pausePlayLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i?"playVideo":"pauseVideo",id:Number(e.id),type:e.type,src:t.stream_link?t.stream_link:e.src,provider:e.provider}},initLog=(i,e,t,n,s)=>{const{params:r,details:a}=store.getState().videoData,o=Date.now()-s.current+i+e,l=window.performance.memory,d=JSON.parse(JSON.stringify(window.performance.timing));return{category:"initLog",id:Number(r.id),type:r.type,origin:new URL(conditions(ConditionName.hasStreamLink)?a.stream_link:r.src).origin,src:conditions(ConditionName.hasStreamLink)?a.stream_link:r.src,loading:i,bannerLoading:!conditions(ConditionName.hasBanner)||t<0?0:t,waiting:e,firstChunkPlaying:n<0?0:n,totalTime:o,provider:r.provider,performance:flattenObject({memory:l,timing:d},"performance"),userAgent:window.navigator.userAgent}},loadingLog=(i,e,t,n,s)=>{const{params:r,details:a,hlsLiveSyncPosition:o}=store.getState().videoData,{settings:l}=store.getState().user,d=conditions(ConditionName.isLiveParam)?o:videoTag().currentTime,f=Date.now()-t.current;return{category:"loading",id:Number(r.id),type:r.type,src:conditions(ConditionName.hasStreamLink)?a.stream_link:r.src,duration:i,quality:`${e}P`,isAutoQuality:conditions(ConditionName.isAutoQuality),previousLoaderDiff:f,counter:n.current,loadingPercentile:Number((i/f).toFixed(2)),videoTime:d,videoEntranceTime:s,speed:l.speed,provider:r.provider}},playListClickLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"playListClick",playlistId:i,id:conditions(ConditionName.isLiveParam)?t.id:+e.id,type:e.type}},videoOfPlaylistClickLog=(i,e,t,n)=>({category:"videoOfPlaylistClick",tag:i,indexNumber:n,videoId:e,videoType:t}),searchLog=i=>{const{selectedTags:e,inputTagSearch:t}=store.getState().tags,{params:n}=store.getState().videoData;return{category:"search",tag:e.join(","),q:conditions(ConditionName.hasInputTagSearch)?t:void 0,user_ids:n.user_ids,video_type:i}},searchResultClickLog=(i,e,t)=>{const{selectedTags:n,inputTagSearch:s}=store.getState().tags,{params:r}=store.getState().videoData,a=handleContentType();return{category:"searchResultClick",tag:n.join(","),q:conditions(ConditionName.hasInputTagSearch)?s:void 0,user_ids:r.user_ids,video_type:a,clickedId:i,clickedIndex:t,clickedType:e}},handleContinuousPlayback=()=>{const{videoSettings:i}=store.getState().user,{params:e}=store.getState().videoData,t=e.type.toString(),n=conditions(ConditionName.isLogin),s=videoTag().currentTime;if(t!=="live"&&s!==0){const r=videoTag().duration,a={video_id:+e.id,video_type:handleVideoType(),time:s===r?0:Math.floor(videoTag().currentTime),is_like:i.is_like};let o=localStorage.getItem("viewedVideos");if(o){let l=JSON.parse(o);l=l.filter(d=>d.video_id!==a.video_id||d.video_type!==a.video_type),l.length<10||l.shift(),l.push(a),localStorage.setItem("viewedVideos",JSON.stringify(l))}else localStorage.setItem("viewedVideos",JSON.stringify([a]));n&&createVideoSettings(a)}},handleApplyContinuousPlayback=()=>{const i=store.dispatch,{params:e}=store.getState().videoData;let t=localStorage.getItem("viewedVideos");if(t){const s=JSON.parse(t).find(r=>r.video_id===Number(e.id)&&r.video_type===handleVideoType());s&&(i(setVideoSettings({is_like:s.is_like,time:s.time})),s.time!==0&&i(setShowContinuousPlayback(!0)))}},handleShowContinuousVideo=i=>{const e=store.dispatch,{videoSettings:t}=store.getState().user;handlePlayPause(i),handleVideoTimeline(t.time),e(setShowContinuousPlayback(!1))},handleGoToFirstVideo=i=>{const e=store.dispatch,{videoSettings:t}=store.getState().user;e(setVideoSettings({...t,time:0})),e(setShowContinuousPlayback(!1)),handlePlayPause(i)},handlePlayPause=i=>{const e=store.dispatch,{params:t}=store.getState().videoData;(i===null||i.target.nodeName!=="INPUT")&&(i!==null&&(i.stopPropagation(),i.preventDefault()),videoTag().paused?videoTag().play():videoTag().pause(),e(setPlay(!videoTag().paused)),t.onPlayPause&&t.onPlayPause(!videoTag().paused))},handlePlayerPauseMiniPlayer=i=>{if(i===null||i.target.nodeName!=="INPUT"){const e=store.dispatch;miniPlayerVideoTag().paused?miniPlayerVideoTag().play():miniPlayerVideoTag().pause(),e(setPlayMiniPlayer(!miniPlayerVideoTag().paused)),videoTag()&&videoTag().played&&(videoTag().pause(),e(setPlay(!1)))}},handlePlayPauseInDOM=i=>{const e=store.dispatch;return i?(videoTag().play(),e(setPlay(!0)),!0):(videoTag().pause(),e(setPlay(!1)),!1)},handleChangeSoundVolume=i=>{const e=store.dispatch,{settings:t}=store.getState().user;e(setUserSettings({...t,volume:i})),conditions(ConditionName.isIOS)?videoTag().muted=!videoTag().muted:videoTag().volume=i/100},handleIsLive=()=>{const i=store.dispatch,{hlsLiveSyncPosition:e}=store.getState().controller;handleVideoTimeline(videoTag().currentTime,e),videoTag().currentTime=e,i(setCurrentTime(e)),progressBar()&&(progressBar().style.width="100%"),i(setIsLive(!0));const t=Date.now();videoTag().play().then(()=>sendFluentLog(catchUpLoadingLog(Date.now()-t)))},handleBackwardForward=(i,e=15,t)=>{if(t&&t.target.nodeName==="INPUT")return;const n=store.dispatch;i==="touchBackward"?i="backward":i==="touchForward"&&(i="forward"),sendFluentLog(backwardForwardLog(i));let s=0;i==="backward"?e===0?s=0:s=videoTag().currentTime-e:i==="forward"&&(e===videoTag().duration?s=e:s=videoTag().currentTime+e),conditions(ConditionName.isLiveParam)&&n(setCurrentTime(s)),conditions(ConditionName.isStaticFormat)||handleVideoTimeline(videoTag().currentTime,videoTag().currentTime+e),videoTag().currentTime=s},handleFullScreen=()=>{const i=store.dispatch,e=document.fullscreenElement;conditions(ConditionName.isIOS)?videoTag().webkitEnterFullScreen?(i(setPlay(!1)),videoTag().webkitEnterFullScreen()):(i(setClearPopoversSlice()),sendFluentLog(fullscreenLog("fullScreen"))):e?(i(setIsFullScreen(!1)),document.exitFullscreen(),conditions(ConditionName.isTouchScreen)&&conditions(ConditionName.isParamsPortrait)&&i(setIsComplexPortrait(!0))):(i(setClearPopoversSlice()),document.documentElement.requestFullscreen(),i(setIsFullScreen(!0)),sendFluentLog(fullscreenLog("fullScreen")),conditions(ConditionName.isTouchScreen)&&conditions(ConditionName.isParamsPortrait)&&i(setIsComplexPortrait(!1)))},handleLockOrientation=()=>{conditions(ConditionName.isTouchScreen)&&!conditions(ConditionName.isIOS)&&(conditions(ConditionName.isLandscape)&&!conditions(ConditionName.isFullScreen)?window.screen.orientation.lock("portrait"):window.screen.orientation.lock("landscape"))},handleLock=i=>{const e=store.dispatch;e(setLock(i==="lock")),sendFluentLog(lockLog(i))},handleVideoTimeline=(i,e)=>{if(conditions(ConditionName.isSendTimelineLog)){const t=store.dispatch,{videoTimelines:n}=store.getState().videoData;let s=Math.floor(i),r=Math.floor(e);n.length===0?t(setVideoTimelines([s>=videoTag().duration&&!conditions(ConditionName.isLive)?r:s])):(n[0]<s&&apiCaller({url:API().videoTimelineLog,method:"post",data:videoTimelineLog(n[0],s)}),r&&r>=videoTag().duration?t(setVideoTimelines([])):t(setVideoTimelines([r])))}},handleVideoElementSizeInfo=()=>{var t;const i=store.dispatch,e=(t=document.getElementById("video-area"))==null?void 0:t.getBoundingClientRect();e.height=e.width*9/16,e&&i(setVideoElementSizeInfo(e))},handleClickVideoCard=(i,e,t)=>{const n=store.dispatch,{params:s,recommendationList:r}=store.getState().videoData;let a=i,o=e;if(r&&r.length&&(!i||!e)){const l=findFirstVideoInRecommendationList();a=i||l.id,o=e||l.type}videoTag()&&(handleVideoTimeline(videoTag().currentTime),conditions(ConditionName.isEnded)||handleContinuousPlayback()),a&&o&&(s.handleRedirectCards&&!t&&s.handleRedirectCards(a,o),clearRedux(),n(setPlayerParams({...s,id:a,type:o,xToken:s.xToken})),n(setIsClickInnerCard(!0)))},detailAPI=i=>{const{params:e}=store.getState().videoData;return getApiUrls().apiUrl+(i||e.id)},detailsConfig={url:"",maxRetryCount:0,headers:{},retryPolicy:[],errorCallback:void 0},liveDetailsConfig=i=>{detailsConfig.url=detailAPI(i);let e=window.location.origin;e=e.replace("https://",""),e=e.replace("http://",""),detailsConfig.url+="?from="+e},nonLiveDetailsConfig=i=>(detailsConfig.url=detailAPI(i),detailsConfig.maxRetryCount=3,detailsConfig.retryPolicy=[{codeAbove:500,codeBelow:null,excludeCodes:[],includeCodes:[409],delay:1,count:3},{codeAbove:null,codeBelow:404,excludeCodes:[403,402,401,400],includeCodes:[],delay:10,count:6}],detailsConfig.errorCallback=(e,t)=>{e!==404&&errorLogProvider({type:"DETAIL_ERROR",message:t?JSON.parse(t).message:""})},detailsConfig),hasIsAuthInParams=()=>{const{token:i}=store.getState().videoData;hasQuestionMark(detailsConfig.url)?detailsConfig.url+=`&token=${i}`:detailsConfig.url+=`?token=${i}`},hasHInParams=()=>{detailsConfig.headers={authorization:`Bearer ${getAccessToken()}`}},hasDaaniToken=()=>{const{daaniToken:i}=store.getState().videoData.params;hasQuestionMark(detailsConfig.url)?detailsConfig.url+=`&ext_user=${i}`:detailsConfig.url+=`?ext_user=${i}`},handleDetailsConfig=i=>(conditions(ConditionName.isLiveParam)?liveDetailsConfig(i):nonLiveDetailsConfig(),conditions(ConditionName.isAuth)&&hasIsAuthInParams(),conditions(ConditionName.hasHParam)&&hasHInParams(),conditions(ConditionName.hasDaaniTokenParams)&&hasDaaniToken(),detailsConfig),videoViewCount=i=>apiCaller({url:API().viewCount(i),data:{uuid:getUUID()}}),handleDetailsInLive=i=>{const e=store.dispatch;e(setLiveId(i.id)),e(setIsLive(!0)),e(setIsLiveError(!1)),conditions(ConditionName.isEnded)?setTimeout(()=>detailSetter(i),LiveDelay*1e3):detailSetter(i)},getLiveAndVodDetails=async i=>{const e=store.dispatch,{params:t}=store.getState().videoData;try{const n=await apiCaller({...handleDetailsConfig(i)});if(responseValidator(n.status)){if(appendQueryParamsToChunks(n.data.stream_link),await axios.head("https://"+weighted_random(n.data.hls_links)+n.data.path),i)return n.data;videoViewCount(n.data.content_id),conditions(ConditionName.isLiveParam)?handleDetailsInLive(n.data):detailSetter(n.data)}else throw new Error(JSON.stringify({status:n.status,message:n.data}))}catch(n){if(JSON.parse(n.message).status===404&&conditions(ConditionName.isLiveParam)&&conditions(ConditionName.hasRedirectOnEndedUrlParams)&&(window.location.href=t.redirectOnEndedUrl),i)return;conditions(ConditionName.isLiveParam)&&e(setIsLiveError(!0)),handlePageTitle(String(t.id)),e(setIsFetchDetails(!0)),e(setErrorType("liveAndVod")),e(setIsValidAddress(!1))}},detailSetter=i=>{const e=store.dispatch,{params:t}=store.getState().videoData;i.title?handlePageTitle(i.title):handlePageTitle(String(t.id)),e(setInfo({...i,stream_link:!!i.stream_link&&addUuidToSrc("https://"+weighted_random(i.hls_links)+i.path)})),e(setIsFetchDetails(!0)),e(setIsValidAddress(!0))},manualGeneralErrorResponseHandler=(i,e,t,n,s,r,a)=>{i!==RetryCountGeneralDataFetch&&i!==1?t(i-1):i===1&&n.length>0&&(n.forEach(o=>clearInterval(o)),s([])),console.error(`get aggregat error: ${r.detail}`)},firstGetDataIntervalAPI=async(i,e,t,n,s,r)=>{const{params:a}=store.getState().videoData,{data:o,status:l}=await apiCaller({url:API().live.generalData});if(responseValidator(l)&&o.config){if(o.backup&&(window.location.href=window.location.href.replace(`id=${a.id}`,`id=${o.backup}`).replace(`&t=${a.t}`,"")),e(RetryCountGeneralDataFetch),t(setConfig(o.config)),n(conditions(ConditionName.hasQuizParams)?o.config.quiz_get_interval:o.config.get_interval),s(o.config.viewers_interval),r(o.config.empoji_poll_interval),t(setEmojis(o.emojis)),t(setOnlineViewers(o.online_viewers)),t(setQuestion(o.question)),t(setAlternative_Lives(o.alternative_lives)),t(setMarkers(o.markers.sort(compare))),t(setGif(o.gif)),t(setQuiz(o.quiz)),handleChatActiveRoom(o.chat_enabled),o.timeline.windows.length){const d=[];o.timeline.windows.map(f=>d.push(f.viewers)),t(setChartPoints(d))}!o&&!o.question&&!o.question.active&&(livePoll()&&livePoll().liveId!==a.id||!livePoll())&&localStorage.setItem("live-poll",JSON.stringify({liveId:a.id,polls:[]}))}else n(RetryTimeDelayGeneralDataFetch),e(i-1),console.error(`get aggregat error: ${o.detail}`)},manualGetDataIntervalAPI=async(i,e,t,n,s,r,a,o,l)=>{const{params:d}=store.getState().videoData,{data:f,status:u}=await apiCaller({url:API().live.generalData});if(responseValidator(u)&&f.config){if(f.backup&&(window.location.href=window.location.href.replace(`id=${d.id}`,`id=${f.backup}`).replace(`&t=${d.t}`,"")),n(RetryCountGeneralDataFetch),s(setConfig(f.config)),(conditions(ConditionName.hasQuizParams)&&f.config.quiz_get_interval!==t||!conditions(ConditionName.hasQuizParams)&&f.config.get_interval!==t)&&a(conditions(ConditionName.hasQuizParams)?f.config.quiz_get_interval:f.config.get_interval),o(f.config.viewers_interval),l(f.config.empoji_poll_interval),s(setEmojis(f.emojis)),s(setOnlineViewers(f.online_viewers)),s(setQuestion(f.question)),s(setAlternative_Lives(f.alternative_lives)),s(setMarkers(f.markers.sort(compare))),s(setGif(f.gif)),handleChatActiveRoom(f.chat_enabled),s(setQuiz(f.quiz)),f.timeline.windows.length){const p=[];f.timeline.windows.map(m=>p.push(m.viewers)),s(setChartPoints(p))}!f.question&&f.question&&!f.question.active&&(livePoll()&&livePoll().liveId!==d.id||!livePoll())&&localStorage.setItem("live-poll",JSON.stringify({liveId:d.id,polls:[]}))}else manualGeneralErrorResponseHandler(i,s,n,e,r,f)},manualPostAPI=async()=>{const i=store.dispatch,{selectedOptionId:e,emojiList1:t,emojiList2:n,params:s,details:r}=store.getState().videoData;if(conditions(ConditionName.manaulPostAPI)){const a={poll:{option_id:e},emoji_list_1:t,emoji_list_2:n,type:s.type,id:r.id,user_id:s.id},{status:o}=await postEmojiPoll(a);responseValidator(o)&&(i(setEmojiList1([])),i(setEmojiList2([])),i(setSelectedOptionId(null)))}},manualGetOnlineViewerIntervalAPI=async()=>await apiCaller({url:API().live.online_viewer}),handleSubtitle=()=>{const i=store.dispatch,{subtitles:e,selectedSubtitle:t}=store.getState().videoData,n=e.find(s=>s.language==="fa");t?(Object.values(videoTag().textTracks).find(s=>s.mode==="showing").mode="disabled",i(setSubtitleText("")),i(setSelectedSubtitle(void 0)),sendFluentLog(subtitleLog("empty"))):n?(n.mode="showing",i(setSelectedSubtitle(n)),sendFluentLog(subtitleLog(n.language))):(videoTag().textTracks[0].mode="showing",i(setSelectedSubtitle(videoTag().textTracks[0])),sendFluentLog(subtitleLog(videoTag().textTracks[0].language)))},handleClickRecommendationCard=(i,e,t,n,s)=>{i&&handleRipple(i,`recommendationList-${e}`,150);const{recommendationList:r}=store.getState().videoData;handleVideoTimeline(videoTag().currentTime),sendFluentLog(recommendationListLog(e??r[0].id,t??r[0].user_id,n??r[0].type,s??1))},combinedMarkers=(i,e)=>{const t=[];i&&i.map(n=>{t.push({banner:"",id:n.id?n.id:n.time,live_id:conditions(ConditionName.isLiveParam)?n.video_id:0,sticker:n.sticker,time:n.time,title:n.name,video_type:n.video_type,video_id:n.video_id,description:n.description,isPersonal:n.id?n.id:n.time})}),store.dispatch(setMarkers([...e,...t].sort(compare)))},handlePlayListTabClick=()=>{const i=store.dispatch,{playList:e}=store.getState().videoData;i(setPlayListPopover(!0)),sendFluentLog(playListClickLog(e[0].id))},handleVideoOfPlaylistClick=(i,e,t,n,s)=>{handleRipple(i,`playList-${t}`,150),sendFluentLog(videoOfPlaylistClickLog(e,t,n,s))},handleContentType=()=>{const{isMovieFilter:i,isSeriesFilter:e}=store.getState().tags;let t;return i&&e?t=`${ContentTypesString.Vod},${ContentTypesString.PlayList}`:i?t=ContentTypesString.Vod:e&&(t=ContentTypesString.PlayList),t},findFirstVideoInRecommendationList=()=>{const{recommendationList:i}=store.getState().videoData,e=i.find(t=>t.type!=="playlist");return{id:e.id,type:e.type,banner:e.banner,title:e.title}},postEmojiPoll=async i=>{const{status:e}=await apiCaller({url:API().live.postData,method:"POST",data:i,retryPolicy:[{codeAbove:null,codeBelow:500,excludeCodes:[500,408,407,406,405,404,403,402,401,400],includeCodes:[409],delay:3,count:3}]});return{status:e}},getPlaylistVideos=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:API().playListVideos(i),method:"GET",data:{offset:e,limit:10},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},getAllGeneralMarker=async i=>await getAll(i,[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]),getAllPersonalMarkers=async i=>{const{data:e,status:t}=await apiCaller({url:i,headers:handleHasXTokenParamOrSendXToken(),retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}},getCommentList=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:i,data:{limit:10,offset:e},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},submitComment=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:i,method:"POST",data:e,headers:{...handleHasXTokenParamOrSendXToken(),"ACCEPT-LANGUAGE":"fa"},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[409],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},getPlayListCards=async i=>{const{data:e,status:t}=await apiCaller({url:i,retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}},getPlaylistHeader=async i=>{const{data:e,status:t}=await apiCaller({url:i,retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}};class InvalidTokenError extends Error{}InvalidTokenError.prototype.name="InvalidTokenError";function b64DecodeUnicode(i){return decodeURIComponent(atob(i).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function base64UrlDecode(i){let e=i.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b64DecodeUnicode(e)}catch{return atob(e)}}function jwtDecode(i,e){if(typeof i!="string")throw new InvalidTokenError("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,n=i.split(".")[t];if(typeof n!="string")throw new InvalidTokenError(`Invalid token specified: missing part #${t+1}`);let s;try{s=base64UrlDecode(n)}catch(r){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(s)}catch(r){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${t+1} (${r.message})`)}}const checkCanComment=async()=>{const i=store.dispatch,{details:e}=store.getState().videoData,{data:t,status:n}=await apiCaller({url:API().comment.canAddComment(e.content_id)});responseValidator(n)&&(i(setCanAddComment(t.can_comment)),i(setCanShowSubmittedComment(t.comment_hidden_default===0)),i(setCommentsCount(t.comments_count-t.hidden_comments_count)),i(setCommentsCountPagination(t.first_level_comments_count-t.first_level_hidden_comments_count)))},handleGetComments=async(i,e)=>{const t=store.dispatch,{comments:n,usersCommentsProfiles:s}=store.getState().comments,{details:r}=store.getState().videoData,{data:a,status:o}=await getCommentList(API().comment.commentList(r.content_id),i);responseValidator(o)&&a.results&&a.results.length?(n!==void 0&&n.length?t(setComments([...n,...a.results])):t(setComments(a.results)),e(!1),t(setUsersCommentsProfiles(await handleGetUsersComments(a.results,s)))):(n===void 0||n.length===0)&&t(setComments([]))},handleGetReplies=async(i,e,t,n,s,r)=>{get(async(a,o)=>{responseValidator(o)&&(e.length?t([...e,...a.results]):t(a.results),s(await handleGetUsersComments(a.results,n)))},API().comment.replyList(i),{limit:10,offset:e.length-(r?1:0)})},handleSubmitDefaultMessageComment=async i=>{const e=store.dispatch,{details:t}=store.getState().videoData,{comments:n}=store.getState().comments;if(await checkCanComment(),conditions(ConditionName.canAddComment)){const s={text:void 0,default_message_id:i,content:t.content_id,reply_to:void 0},{data:r,status:a}=await submitComment(API().comment.create,s);responseValidator(a)?n?(e(setComments([r,...n])),conditions(ConditionName.isTouchScreen)&&n.length>0&&document.getElementById("touchscreenListComments").scrollIntoView({behavior:"smooth"})):e(setComments([r])):r&&ae({title:r.detail,type:"error"})}},handleSubmitComment=async(i,e,t,n,s,r)=>{const a=store.dispatch,{details:o}=store.getState().videoData,{replyToAuthor:l,comments:d}=store.getState().comments;if(await checkCanComment(),conditions(ConditionName.canAddComment)&&(i||t)){const f={text:i,content:s==="reply"?void 0:o.content_id,reply_to:s==="reply"?l.id:void 0},{data:u,status:p}=await submitComment(API().comment.create,f);responseValidator(p)?(e(""),n(""),conditions(ConditionName.canShowSubmittedComment)?s==="reply"?a(setRealTimeReply(u)):d?(a(setComments([u,...d])),conditions(ConditionName.isTouchScreen)&&d.length>0&&document.getElementById("touchscreenListComments").scrollIntoView({behavior:"smooth"})):a(setComments([u])):ae({title:`${s==="reply"?"پاسخ":"نظر"} شما با موفقیت ثبت شد و پس از تایید نمایش داده می شود.`,type:"success"}),s==="reply"&&(a(setReplyToAuthor({})),r&&r(!1))):ae({title:"خطا در ثبت دیدگاه",type:"error"})}else conditions(ConditionName.canAddComment)||ae({title:"در حال حاضر امکان ثبت دیدگاه وجود ندارد",type:"error"})},handleGetUsersComments=async(i,e)=>{const t=[];i.map(s=>s.author!=="AnonymousUser"&&t.push(s.author));const n=await axios({url:API().user.profile,method:"post",headers:{"Content-Type":"application/json"},data:t});return responseValidator(n.status)?[...e,...n.data]:[]},handleCommentsIdsInLocalStorage=()=>{const i=localStorage.getItem("commentsLikeUnlike");if(i){const{params:e}=store.getState().videoData,t=JSON.parse(i).find(n=>n.videoId===e.id&&n.videoType===e.type);if(t)return t.comments}},handleLikeUnlikeComment=async(i,e,t,n,s)=>{const{params:r}=store.getState().videoData,{status:a}=await apiCaller({url:e?API().comment.like(i):API().comment.unlike(i),data:{uuid:getUUID()}});if(responseValidator(a)){s(e?n+1:n-1),t(e);const o=localStorage.getItem("commentsLikeUnlike");if(o){const l=JSON.parse(o).filter(f=>f.videoId!==r.id||f.videoId===r.id&&f.videoType!==r.type),d=JSON.parse(o).find(f=>f.videoId===r.id&&f.videoType===r.type);if(l)if(d){const f=d.comments.filter(u=>u!==i);e?localStorage.setItem("commentsLikeUnlike",JSON.stringify([...l,{videoId:r.id,videoType:r.type,comments:[...f,i]}])):localStorage.setItem("commentsLikeUnlike",JSON.stringify([...l,{videoId:r.id,videoType:r.type,comments:f}]))}else localStorage.setItem("commentsLikeUnlike",JSON.stringify([...l,{videoId:r.id,videoType:r.type,comments:[i]}]))}else localStorage.setItem("commentsLikeUnlike",JSON.stringify([{videoId:r.id,videoType:r.type,comments:[i]}]))}},handleCloseCommentPopover=()=>{const i=store.dispatch;i(setCommentPopover(!1)),i(setComments(void 0))},isShowCommentSettings=i=>{const{params:e}=store.getState().videoData;return e.xToken?jwtDecode(e.xToken).sub===i:!1},getPointerTime=(i,e="")=>{const{videoElementSizeInfo:t}=store.getState().videoData,{duration:n,hlsLiveSyncPosition:s}=store.getState().controller,r=conditions(ConditionName.isLiveParam)?s:n,a=i.clientX!==void 0?i.clientX:i.touches[0].clientX;if(a<=t.right-footerPadding()&&a>footerPadding()){let l=(a-footerPadding()-t.left)/(t.width-2*footerPadding())*r;return e==="tooltipTime-live"&&(l=r-l),l}},getPointerPosition=i=>{const{videoElementSizeInfo:e}=store.getState().videoData,t=i.clientX!==void 0?i.clientX:i.touches[0].clientX;if(t<=e.right-footerPadding()&&t>footerPadding())return t-footerPadding()-e.left},getMarkerPosition=i=>{const{duration:e,hlsLiveSyncPosition:t}=store.getState().controller,n=conditions(ConditionName.isLiveParam)?t:e;return i*progressBarWidth()/n},hideProgressTooltip=i=>{i&&(i.style.opacity="0.0",i.style.pointerEvents="none",i.style.zIndex=zIndex.vttDisable)},generalStyleTooltipHandler=i=>{i.style.display="block",i.style.zIndex=zIndex.vtt,i.style.opacity=store.getState().videoData.details.vtt?"1.0":"0.6",i.style.pointerEvents="auto",i.style.transition="opacity 1s ease-out"},vttTooltipStyleHandler=(i,e)=>{const{videoElementSizeInfo:t}=store.getState().videoData,n=document.getElementsByClassName("pl-progressTooltip")[0],s=document.getElementById("parent-player");n&&s&&(getPointerPosition(i)>n.getBoundingClientRect().width/2&&getPointerPosition(i)<t.right-t.left-n.getBoundingClientRect().width/2?e.style.left=`${getPointerPosition(i)-n.offsetWidth/2}px`:getPointerPosition(i)<(s.offsetLeft===0?n.offsetWidth:s.offsetLeft)?e.style.left="0px":videoTag().offsetLeft+videoTag().offsetWidth<getPointerPosition(i)+n.offsetWidth&&(e.style.left=`${videoTag().offsetWidth-n.offsetWidth}px`))},showProgressTooltip=(i,e,t)=>{e&&generalStyleTooltipHandler(e),store.getState().videoData.details.vtt?vttTooltipStyleHandler(i,e):e.style.left=`${getPointerPosition(i)-30}px`,store.dispatch(setTooltipTime(Number(getPointerTime(i)))),t.textContent=conditions(ConditionName.isLiveParam)?`-${secondsToHMS(getPointerTime(i,"tooltipTime-live"))}`:`${secondsToHMS(getPointerTime(i))}`},handleTimeTooltip=(i,e=!1)=>{const{videoElementSizeInfo:t}=store.getState().videoData,n=document.querySelector(".pl-progressTooltip"),s=document.querySelector(".pl-progressTimeTooltip"),r=i.clientX!==void 0?i.clientX:i.touches[0].clientX;n&&s&&r<=t.right-footerPadding()&&r>t.left+footerPadding()?(showProgressTooltip(i,n,s),e&&setTimeout(()=>hideProgressTooltip(n),2e3)):hideProgressTooltip(n)},handleProgressTime=i=>{const e=i.clientX!==void 0?i.clientX:i.touches[0].clientX;progressBar()&&(e<=i.view.innerWidth-footerPadding()&&e>footerPadding()?progressBar().style.width=`${getPointerPosition(i)}px`:e<=i.view.innerWidth-footerPadding()?progressBar().style.width=0:e>footerPadding()&&(progressBar().style.width="100%"))},handlePointerDown=(i,e,t)=>{i.preventDefault(),i.stopPropagation(),t(!0);const n=store.dispatch,s=i.clientX!==void 0?i.clientX:i.touches[0].clientX;s<=i.view.innerWidth-footerPadding()&&s>footerPadding()&&(n(setActivePointerProgressBar(!0)),n(setDelayTurnOffControlbar(!0)),sessionStorage.setItem("previousVideoTime",String(videoTag().currentTime)),i.target.setPointerCapture(i.pointerId),e.length>0&&e.map(r=>clearTimeout(r)))},handlePointerMove=i=>{i.preventDefault(),i.stopPropagation();const e=store.dispatch,{activePointerProgressBar:t}=store.getState().controller,{left:n}=store.getState().videoData.videoElementSizeInfo,s=i.clientX!==void 0?i.clientX:i.touches[0].clientX,r=document.querySelector(".pl-progressTooltip");s>n+footerPadding()?(r&&(r.style.display="block !important",r.style.pointerEvents="auto"),t&&(e(setDelayTurnOffControlbar(!0)),handleTimeTooltip(i),handleProgressTime(i),videoTag().pause())):r&&(r.style.display="none !important",r.style.pointerEvents="none")},handlePointerUp=(i,e,t,n)=>{n(!1),i.preventDefault(),i.stopPropagation();const s=store.dispatch,{duration:r,hlsLiveSyncPosition:a}=store.getState().controller,{left:o,right:l}=store.getState().videoData.videoElementSizeInfo,d=conditions(ConditionName.isLiveParam)?a:r;i.target.removeEventListener("pointermove",handlePointerMove);const f=i.clientX!==void 0?i.clientX:i.touches[0].clientX;let u=0;f>o+footerPadding()&&f<l+footerPadding()?u=getPointerTime(i):f<o+footerPadding()?u=0:f>footerPadding()&&(u=d),conditions(ConditionName.isStaticFormat)||handleVideoTimeline(videoTag().currentTime,u),videoTag().currentTime=u,store.getState().controller.activePointerProgressBar&&(s(setActivePointerProgressBar(!1)),s(setDelayTurnOffControlbar(!1)),videoTag().play(),handleTimeTooltip(i,!0),sessionStorage.setItem("current-time",String(u)),handleProgressTime(i),handleTimeout(i,s,e,t))},handleTimeout=(i,e,t,n)=>{const s=n;let r=setTimeout(()=>{const{settingPopover:a,markersListPopover:o}=store.getState().popovers,{delayTurnOffControlbar:l}=store.getState().controller;i.pointerType==="touch"&&!a&&!o&&l&&e(setActiveElements(!1))},activeElementsTime);s.push(r),t(s)},handleCatchUpLoadingLog=()=>{const i=Date.now();videoTag().play().then(()=>sendFluentLog(catchUpLoadingLog(Date.now()-i)))},handleMouseMove=i=>handleTimeTooltip(i),handleMouseOut=()=>{const i=document.querySelector(".pl-progressTooltip");hideProgressTooltip(i)},deconstructTimestamp=i=>{const e=i.split("."),n=e[0].split(":");return{milliseconds:parseInt(e[1],10)||0,seconds:parseInt(n.pop(),10)||0,minutes:parseInt(n.pop(),10)||0,hours:parseInt(n.pop(),10)||0}},getSecondsFromTimestamp=i=>{const e=deconstructTimestamp(i);return parseInt(e.hours*(60*60)+e.minutes*60+e.seconds+e.milliseconds/1e3,10)},getPropsFromDef=i=>{const e=i.split(/#xywh=/i),t=e[0],s=e[1].match(/[0-9]+/gi);return{x:s[0],y:s[1],w:s[2],h:s[3],image:t}},getFullyQualifiedUrl=(i,e)=>i.indexOf("//")>=0?i:e.indexOf("//")===0?[e.replace(/\/$/gi,""),i.trim()].join("/"):e.indexOf("//")>0?[e.trim(),i.trim()].join("/"):i,getVttCss=(i,e)=>{const t={};let n=e.split(/\/\w+\.vtt\s?/)[0];if(i=getFullyQualifiedUrl(i,n),!i.match(/#xywh=/i))return t.background='url("'+i+e.split(/\/\w+\.vtt\s?/)[1]+'")',t;const s=getPropsFromDef(i);return t.background='url("'+s.image+e.split(/\/\w+\.vtt\s?/)[1]+'") no-repeat -'+s.x+"px -"+s.y+"px",t.width=s.w+"px",t.height=s.h+"px",t.url=s.image,t},fetchFile=(i,e)=>{fetch(i).then(t=>{if(!t.ok)throw store.dispatch(setInfo({...store.getState().videoData.details,vtt:void 0,vtt_mobile:void 0})),new Error("Network response was not ok");return t.text()}).then(t=>{const n=[];t.split(/[\r\n][\r\n]/i).forEach(r=>{if(r.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3}).*/gi)){const a=r.split(/[\r\n]/i),l=a[0].split(/ ?--> ?/i),d=l[0],f=l[1],u=a[1],p=getVttCss(u,i);n.push({start:getSecondsFromTimestamp(d),end:getSecondsFromTimestamp(f),css:p})}}),e(n)}).catch(t=>{console.error("Error fetching file:",t)})},getStyleForTime=(i,e,t)=>{for(let n=0;n<e.length;++n){const s=e[n];if(i>=s.start&&i<s.end){if(s.css.url&&!t[s.css.url]){const r={background:s.css.background,width:s.css.width,height:s.css.height};return t[s.css.url]=r,r}else if(s.css.url)return t[s.css.url]}}},getFitMaxNumberCard=()=>Math.ceil(window.innerWidth*window.innerHeight/(265*149)),handleGetTags=(i,e,t,n)=>{const{details:s,params:r}=store.getState().videoData,{selectedTags:a,inputTagSearch:o}=store.getState().tags;i&&t.length&&get((l,d)=>{responseValidator(d)&&(l.results.length>0&&n(t.concat(l.results)),e(!1))},API().searchViewers,{tag:a.join(","),q:conditions(ConditionName.hasInputTagSearch)?o:void 0,user_ids:conditions(ConditionName.isUserIdsParamsEqualAll)?void 0:conditions(ConditionName.hasUserIds)?r.user_ids:s.user_id,limit:conditions(ConditionName.isComplexPortrait)?10:getFitMaxNumberCard(),offset:t.length})},handleClickTag=(i,e,t,n)=>{const s=store.dispatch,{details:r,params:a}=store.getState().videoData,{selectedTags:o,inputTagSearch:l}=store.getState().tags,d=handleContentType();sendFluentLog(searchLog(d)),n&&n(!0),get((f,u)=>{responseValidator(u)&&(i(f.count),f.results.length>0?(s(setTagsPopover(!0)),t(f.results)):t([])),n&&n(!1)},API().searchViewers,{tag:o.join(","),q:conditions(ConditionName.hasInputTagSearch)?l:void 0,user_ids:conditions(ConditionName.isUserIdsParamsEqualAll)?void 0:conditions(ConditionName.hasUserIds)?a.user_ids:r.user_id,limit:e.length+(conditions(ConditionName.isComplexPortrait)?10:getFitMaxNumberCard()),offset:0,video_type:d})},handleClickPlayerCardTag=(i,e)=>{const t=store.dispatch,{selectedTags:n}=store.getState().tags;i.preventDefault(),i.stopPropagation(),n.includes(e)||(t(setPlayListCardPopover(!1)),t(setTagsPopover(!0)),t(setSelectedTags([...n,e])),sendFluentLog(tagClickLog(e.trim())))},getAllViewersTagList=async()=>{const{details:i,params:e}=store.getState().videoData,{selectedTags:t}=store.getState().tags;return new Promise(async n=>{try{const s=await getAll(API().viewersTagList(e.type),[],{user_ids:conditions(ConditionName.isUserIdsParamsEqualAll)?void 0:conditions(ConditionName.hasUserIds)?e.user_ids:i.user_id,tag:t.join(",")});n(s)}catch{}})},handleViewersTagList=async()=>{const i=store.dispatch,{selectedTags:e}=store.getState().tags,t=await getAllViewersTagList();if(t){let n=[];t.map(s=>n.push(s.tag.trim())),n=[...new Set(n)],i(setViewersTagsList(n.filter(s=>s!==e[0])))}},handleCloseTagPopover=()=>{const i=store.dispatch;i(setTagsPopover(!1)),i(setSelectedTags([])),i(setInputTagSearch("")),i(setIsMovieFilter(!1)),i(setIsSeriesFilter(!1)),i(setInputFilterTagSearch(""))},handleTagInput=(i,e,t,n,s,r,a)=>{const o=store.dispatch;o(setInputTagSearch(i)),e(!0),clearTimeout(t.current),t.current=setTimeout(()=>{handleClickTag(n,s,r,a),e(!1)},500)},handleCloseSelectedTags=i=>{const e=store.dispatch,{selectedTags:t,viewersTagsList:n}=store.getState().tags;e(setSelectedTags(t.filter(s=>s!==i))),e(setViewersTagsList([i,...n]))},handleClickViewersTagList=i=>{const e=store.dispatch,{selectedTags:t,viewersTagsList:n}=store.getState().tags;e(setSelectedTags([...t,i])),e(setViewersTagsList(n.filter(s=>s!==i)))},handleClearTagInput=(i,e,t)=>{const n=store.dispatch;n(setInputTagSearch("")),handleClickTag(i,e,t)},handleNextTag=(i,e)=>{i.preventDefault(),i.stopPropagation(),e.current.scrollLeft-=e.current.clientWidth},handlePrevTag=(i,e)=>{i.preventDefault(),i.stopPropagation(),e.current.scrollLeft+=e.current.clientWidth},handleScrollLeft=(i,e)=>{i.preventDefault(),i.stopPropagation();const t=document.getElementById(e);t&&(t.scrollLeft-=50)},handleScrollRight=(i,e)=>{i.preventDefault(),i.stopPropagation();const t=document.getElementById(e);t&&(t.scrollLeft+=50)},handleSearchResultClick=(i,e,t,n,s,r)=>{const a=store.dispatch;handleRipple(i,`tagVideoList-${n}`,150),s===ContentTypesString.PlayList?(a(setPlayListCardPopover(!0)),t.current=e):sendFluentLog(searchResultClickLog(n,s,r))},createSettings=async i=>{i={...i,quality:conditions(ConditionName.isAutoQuality)?null:i.quality},conditions(ConditionName.isLogin)&&conditions(ConditionName.trackerEnabled)&&await apiCaller({url:API().user.createSettings,method:"POST",data:i,headers:handleHasXTokenParamOrSendXToken()})},createVideoSettings=async i=>{const{params:e,details:t}=store.getState().videoData;conditions(ConditionName.isLogin)&&conditions(ConditionName.trackerEnabled)&&await apiCaller({url:API().user.createVideoMetaData,method:"POST",data:{video_id:i.video_id??conditions(ConditionName.isLiveParam)?t.id:+e.id,video_type:i.video_type??handleVideoType(),...i},headers:handleHasXTokenParamOrSendXToken()})},handleBookmark=async(i,e,t)=>{if(i&&i.stopPropagation(),conditions(ConditionName.hasXToken)){const n=store.dispatch,{bookmarks:s,bookmarkId:r}=store.getState().user;if(conditions(ConditionName.isBookmark)||t==="delete"){if(conditions(ConditionName.trackerEnabled)){const{status:a,data:o}=await apiCaller({url:API().user.deleteBookmark(e),method:"DELETE",headers:handleHasXTokenParamOrSendXToken()});responseValidator(a)?(n(setBookmarks(s.filter(l=>e?l.id!==e:l.id!==r))),n(setBookmarkId(void 0)),sendFluentLog(bookmarkLog("unBookmark"))):ae({type:"error",title:o.detail})}}else{const{details:a,params:o}=store.getState().videoData,l={object_link:window.location.href,cover_url:a.banner,title:a.title,category:handleGetBookmarkCategory(o.provider)};if(conditions(ConditionName.trackerEnabled)){const{data:d,status:f}=await apiCaller({url:API().user.bookmarks,method:"POST",data:l,headers:handleHasXTokenParamOrSendXToken()});responseValidator(f)?(n(setBookmarks([d,...s])),n(setBookmarkId(d.id)),sendFluentLog(bookmarkLog("bookmark"))):ae({type:"error",title:d.detail})}}}else ae({title:"لطفا ابتدا وارد شوید.",type:"error"})},authToken={key:"HAMRAHI_CLOUD_AUTH_TOKEN",get:()=>{const i=api.get(authToken.key);return i?JSON.parse(i):null},set:i=>api.set(authToken.key,JSON.stringify(i),{expires:1095,sameSite:"none",secure:!0}),remove:()=>api.remove(authToken.key)},handleAutoFullScreen=()=>{const i=store.dispatch,{params:e}=store.getState().videoData,t=n=>{n.requestFullScreen?n.requestFullScreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullScreen&&n.webkitRequestFullScreen()};i(setClearPopoversSlice()),t(document.documentElement),i(setIsFullScreen(e.fullscreen==="true")),conditions(ConditionName.isComplexDesktop)&&i(setIsComplexDesktop(!1)),conditions(ConditionName.isTouchScreen)&&conditions(ConditionName.isParamsPortrait)&&i(setIsComplexPortrait(e.fullscreen!=="true"))},appendQueryParamsToChunksIOS=()=>{let i=".ts",e=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const{daaniToken:t}=store.getState().videoData.params;let n=`?uuid=${getUUID()}`;conditions(ConditionName.hasDaaniTokenParams)&&(n=`${n}&ext_user=${t}`),arguments[1].endsWith(i)&&(arguments[1]=arguments[1]+n),e.apply(this,arguments)}},handleBufferedTime=(i,e)=>{const t=store.dispatch;e.current=setInterval(()=>{const s=i.target.buffered.end(0)/videoTag().duration*100;t(setBufferedTimeWidth(s))},500)},handleHlsConfig=()=>{const{params:i,streamLinkParams:e}=store.getState().videoData;return{xhrSetup:(t,n)=>{n.split("m3u8")[1]||(n=`${n}${e}`),t.open("GET",n,!0)},startLevel:i.type==="live"?1:-1,debug:!1,enableWorker:!0,liveDurationInfinity:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine),maxLiveSyncPlaybackRate:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?2:1,abrBandWidthUpFactor:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?.6:.7,abrBandWidthFactor:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?.8:.95,backBufferLength:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?2:1/0,maxBufferLength:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?12:30,maxMaxBufferLength:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?600:60,liveSyncDuration:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?3:LiveDelay,liveMaxLatencyDuration:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?8:void 0,manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}}}},handleMultiLiveHlsConfig=()=>{const{streamLinkParams:i}=store.getState().videoData;return{xhrSetup:(e,t)=>{t=`${t}${i}`,e.open("GET",t,!0)},startLevel:1,debug:!1,liveSyncDuration:LiveDelay,maxMaxBufferLength:60,playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1e3,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1e3,retryDelayMs:1e3,maxRetryDelayMs:1e3}}}}},handleManifestParsed=(i,e)=>{const t=store.dispatch;let n=[],s=[""],r=[];if(i.levels.map(a=>{n.push(a.attrs.RESOLUTION.split("x")[1].trim()),s.push(`${(a.bitrate/1e3).toFixed(0)}kbps`),r.push(a.attrs.RESOLUTION)}),i.autoLevelCapping=highestResolutionSupported(r,window.innerWidth,window.innerHeight),t(setQualityLevels(n)),t(setQualityBitrates(s)),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"].forEach(a=>document.addEventListener(a,()=>{conditions(ConditionName.isAutoQuality)&&(i.autoLevelCapping=highestResolutionSupported(r,window.innerWidth,window.innerHeight),i.nextLevel=-1)},!1)),e.audioTracks.length>0){const a=e.audioTracks.sort(o=>o.default===!0?-1:1);t(setMultiAudio(a))}},handleManifestLoaded=i=>i.audioTrack=0,handleMediaAttached=(i,e)=>{const{params:t,details:n}=store.getState().videoData;let s=conditions(ConditionName.isGeneral)?t.src:n.stream_link;e.loadSource(s),e.on(i.Events.MANIFEST_PARSED,(r,a)=>handleManifestParsed(e,a)),e.on(i.Events.MANIFEST_LOADED,()=>handleManifestLoaded(e))},handleLevels=(i,e,t)=>{if(e.frag.type!=="audio"){const n=store.dispatch,{settings:s}=store.getState().user,{qualityLevels:r,manualQuality:a,autoQuality:o}=store.getState().controller;conditions(ConditionName.isAutoQuality)?conditions(ConditionName.isAutoQuality)&&o===void 0?(i.nextLevel=-1,t(r[e.frag.level]),n(setAutoQuality(e.frag.level))):conditions(ConditionName.isAutoQuality)&&(t(r[e.frag.level]),o!==e.frag.level&&n(setAutoQuality(e.frag.level))):(e.frag.level!==a&&(i.nextLevel=r[s.quality]?s.quality:-1),r[s.quality]?(n(setManualQuality(s.quality)),n(setAutoQuality(void 0))):(t(r[e.frag.level]),n(setAutoQuality(e.frag.level)),n(setUserSettings({...s,quality:-1})),createSettings({...s,quality:null})))}},handleFragBuffered=i=>{var s;const e=store.dispatch;store.getState().controller.loadedFragmentsCount.length<Number(getInitialLoadedFragmentCount())&&e(setLoadedFragmentsCount([...new Set([...store.getState().controller.loadedFragmentsCount,i.abrController.fragCurrent.sn])]));const n=((s=i.mainForwardBufferInfo)==null?void 0:s.end)/videoTag().duration*100;e(setBufferedTimeWidth(n))},handleFragLoading=i=>{const e=store.dispatch;conditions(ConditionName.isLiveParam)&&e(setHlsLivePosition(i.liveSyncPosition))},handleFragChanged=(i,e,t,n)=>{const{params:s,multiAudio:r,selectedAudioId:a}=store.getState().videoData;r&&a!==void 0&&a!==e.audioTrack&&(e.audioTrack=a,e.trigger(i.Events.AUDIO_TRACK_LOADING,r[a])),(s.type||!conditions(ConditionName.isLiveParam))&&handleLevels(e,t,n)},handleFragParsed=(i,e,t)=>{const{type:n}=store.getState().videoData.params;(n||n==="live")&&handleLevels(i,e,t)},handleHlsErrors=(i,e)=>{if(e.event!=="hlsAudioTrackLoading")return{type:"HLS_"+e.type,message:e.error.message}},handlePreview=i=>{const e=store.dispatch,{params:t,details:n}=store.getState().videoData,s=conditions(ConditionName.hasPreviewStart)?n.preview_start:0,r=conditions(ConditionName.hasPreviewEnd)?n.preview_end:videoTag()?videoTag().duration:0;t.preview==="true"&&i.target.currentTime>=r&&(videoTag().currentTime=s,e(setCurrentTime(s)))},handleVideoWaiting=(i,e)=>{const t=store.dispatch;i.preventDefault(),e.current=Date.now(),t(setIsLoading(!0))},handleVideoSeeking=(i,e)=>{const t=store.dispatch;i.preventDefault(),e.current=0,t(setIsLoading(!0))},handleVideoTime=()=>{const{params:i}=store.getState().videoData,{videoSettings:e}=store.getState().user,t=store.dispatch;videoTag().currentTime=i.t?+i.t:e.time,t(setCurrentTime(i.t?+i.t:e.time))},handleVideoPlay=(i,e)=>{const t=store.dispatch,{details:n}=store.getState().videoData;if(i.preventDefault(),e.current=Date.now(),t(setPlay(!0)),conditions(ConditionName.isFirstPlay)){if(conditions(ConditionName.has360)&&(handle360(),setTimeout(()=>handleVideoTime(),200)),!conditions(ConditionName.has360)&&!conditions(ConditionName.isLiveParam)&&handleVideoTime(),conditions(ConditionName.hasFullScreenParams)&&handleAutoFullScreen(),conditions(ConditionName.isFullScreen)&&handleLockOrientation(),conditions(ConditionName.hasPreviewParams)){const s=n.preview_start?n.preview_start:0;videoTag().currentTime=s,t(setCurrentTime(s))}t(setVideoTimelines([Math.floor(videoTag().currentTime)]))}sendFluentLog(pausePlayLog(!0)),t(setSubtitleText(""))},handleVideoPlaying=(i,e,t,n,s,r,a,o)=>{const l=store.dispatch,{autoQuality:d,canPlayVideo:f,firstPlay:u,qualityLevels:p}=store.getState().controller,{settings:m}=store.getState().user,g=m.quality===-1&&d?p[d]:p[m.quality];let y=0;a.current&&(y=Date.now()-a.current),u&&videoTag().played&&sendFluentLog(initLog(e.current,Date.now()-t.current,n.current-t.current,Date.now()-s.current,s)),l(setFirstPlay(!1)),f&&y>0&&g!==void 0&&(r.current=y,a.current=0,sendFluentLog(loadingLog(y,g,s,i,o.current)),i.current=i.current+1,s.current=Date.now())},handleVideoPause=i=>{const e=store.dispatch;i.preventDefault(),sendFluentLog(pausePlayLog(!1)),e(setPlay(!1))},handleVideoTimeUpdate=i=>{const e=store.dispatch,{selectedSubtitle:t}=store.getState().videoData;i.preventDefault(),handlePreview(i),e(setCurrentTime(i.target.currentTime)),conditions(ConditionName.hasActiveCue)&&e(setSubtitleText(t.activeCues[0].text))},handleVideoCanPlay=i=>{const e=store.dispatch,{settings:t}=store.getState().user;if(i.preventDefault(),e(setIsLoading(!1)),e(setCanPlayVideo(!0)),videoTag().volume=t.volume/100,conditions(ConditionName.isIOSLive)||e(setDuration(i.target.duration)),conditions(ConditionName.isIOS)){const n=Object.values(i.target.textTracks);n&&n.length&&e(setSubtitles(Object.values(n[0]).length?n:[]))}else e(setSubtitles(Object.values(i.target.textTracks)))},handleVideoEnded=i=>{const e=store.dispatch,{params:t}=store.getState().videoData;i.preventDefault(),e(setIsLiveError(!0)),e(setIsEnded(!0)),e(setActiveElements(!0)),handleVideoTimeline(videoTag().duration),conditions(ConditionName.hasOnFinishedParams)&&t.onFinished()},handleVideoError=i=>{i.preventDefault();let e=videoTag().error;if(e)switch(e.code){case e.MEDIA_ERR_ABORTED:errorLogProvider({type:"videoTagError",message:"You aborted the video playback."});break;case e.MEDIA_ERR_NETWORK:errorLogProvider({type:"videoTagError",message:"A network error caused the video download to fail part-way."});break;case e.MEDIA_ERR_DECODE:errorLogProvider({type:"videoTagError",message:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support."});break;case e.MEDIA_ERR_SRC_NOT_SUPPORTED:errorLogProvider({type:"videoTagError",message:"The video could not be loaded, either because the server or network failed or because the format is not supported."});break;default:errorLogProvider({type:"videoTagError",message:"An unknown error occurred."});break}else errorLogProvider({type:"videoTagError",message:"An error occurred, but the error object is not available."})},handleIosVideoPlay=(i,e)=>{const t=store.dispatch;i.preventDefault(),e.current=Date.now(),t(setFirstPlay(!1)),conditions(ConditionName.isFirstPlay)&&conditions(ConditionName.has360)&&handle360()},handleIosVideoPlaying=()=>{const i=store.dispatch;i(setIsLoading(!1))},handleIosVideoTimeUpdate=i=>{const e=store.dispatch;i.preventDefault(),e(setCurrentTime(i.target.currentTime)),handlePreview(i)},handleIosVideoEnded=()=>{const{params:i}=store.getState().videoData;conditions(ConditionName.hasOnFinishedParams)&&i.onFinished()},handleStaticVideoPause=i=>{const e=store.dispatch;i.preventDefault(),e(setPlay(!1))},handleStaticVideoPlay=(i,e)=>{const t=store.dispatch;i.preventDefault(),t(setPlay(!0)),e.current=Date.now(),conditions(ConditionName.isFirstPlay)&&conditions(ConditionName.hasFullScreenParams)&&handleAutoFullScreen(),conditions(ConditionName.isFullScreen)&&handleLockOrientation()},handleStaticVideoPlaying=(i,e,t)=>{const n=store.dispatch,{firstPlay:s}=store.getState().controller;n(setIsLoading(!1)),s&&videoTag().played&&sendFluentLog(initLog(Math.round(i.current),Date.now()-e.current,0,Date.now()-t.current,t)),n(setFirstPlay(!1))},handleStaticVideoTimeUpdate=i=>{const e=store.dispatch;i.preventDefault(),e(setCurrentTime(i.target.currentTime)),e(setDuration(i.target.duration))},handleStaticVideoCanPlay=i=>{const e=store.dispatch;i.preventDefault(),e(setIsLoading(!1)),e(setCanPlayVideo(!0))},handleStaticVideoLoadedData=(i,e)=>{i.preventDefault(),handleBufferedTime(i,e)},handleStaticVideoEnded=i=>{const{params:e}=store.getState().videoData;conditions(ConditionName.hasOnFinishedParams)&&e.onFinished(),i.preventDefault()},handleMultiLiveManifestParsed=i=>i.nextLevel=i.levels.findIndex(e=>e.attrs.RESOLUTION.split("x")[1].trim()==="144"),handleMultiLiveMediaAttached=async(i,e)=>{const{multiLives:t}=store.getState().videoData,{stream_link:n}=await getLiveAndVodDetails(t[0].user_id);e.loadSource(n),e.on(i.Events.MANIFEST_PARSED,()=>handleMultiLiveManifestParsed(e))},handleMultiLiveFragLoading=async i=>{const e=store.dispatch;conditions(ConditionName.isLiveParam)&&e(setHlsLivePosition(i.liveSyncPosition))},handleVideoVisibilityChange=i=>{handleVideoTimeline(videoTag().currentTime),handleContinuousPlayback(),conditions(ConditionName.isVisibilityChange)&&(document.hidden?i.stopLoad():i.startLoad())};var resolveConfig$2={},resolveConfig$1={},negateValue={},hasRequiredNegateValue;function requireNegateValue(){return hasRequiredNegateValue||(hasRequiredNegateValue=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){if(t=`${t}`,t==="0")return"0";if(/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(t))return t.replace(/^[+-]?/,s=>s==="-"?"":"-");let n=["var","calc","min","max","clamp"];for(const s of n)if(t.includes(`${s}(`))return`calc(${t} * -1)`}}(negateValue)),negateValue}var corePluginList={},hasRequiredCorePluginList;function requireCorePluginList(){return hasRequiredCorePluginList||(hasRequiredCorePluginList=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});const e=["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","lineClamp","display","aspectRatio","size","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","captionSide","borderCollapse","borderSpacing","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","listStyleImage","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","hyphens","whitespace","textWrap","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","boxShadowColor","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","contain","content","forcedColorAdjust"]}(corePluginList)),corePluginList}var configurePlugins={},hasRequiredConfigurePlugins;function requireConfigurePlugins(){return hasRequiredConfigurePlugins||(hasRequiredConfigurePlugins=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t,n){return t===void 0?n:Array.isArray(t)?t:[...new Set(n.filter(r=>t!==!1&&t[r]!==!1).concat(Object.keys(t).filter(r=>t[r]!==!1)))]}}(configurePlugins)),configurePlugins}var colors$3={},log={},picocolors_browser={exports:{}},hasRequiredPicocolors_browser;function requirePicocolors_browser(){if(hasRequiredPicocolors_browser)return picocolors_browser.exports;hasRequiredPicocolors_browser=1;var i=String,e=function(){return{isColorSupported:!1,reset:i,bold:i,dim:i,italic:i,underline:i,inverse:i,hidden:i,strikethrough:i,black:i,red:i,green:i,yellow:i,blue:i,magenta:i,cyan:i,white:i,gray:i,bgBlack:i,bgRed:i,bgGreen:i,bgYellow:i,bgBlue:i,bgMagenta:i,bgCyan:i,bgWhite:i,blackBright:i,redBright:i,greenBright:i,yellowBright:i,blueBright:i,magentaBright:i,cyanBright:i,whiteBright:i,bgBlackBright:i,bgRedBright:i,bgGreenBright:i,bgYellowBright:i,bgBlueBright:i,bgMagentaBright:i,bgCyanBright:i,bgWhiteBright:i}};return picocolors_browser.exports=e(),picocolors_browser.exports.createColors=e,picocolors_browser.exports}var hasRequiredLog;function requireLog(){return hasRequiredLog||(hasRequiredLog=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,d){for(var f in d)Object.defineProperty(l,f,{enumerable:!0,get:d[f]})}e(i,{dim:function(){return a},default:function(){return o}});const t=n(requirePicocolors_browser());function n(l){return l&&l.__esModule?l:{default:l}}let s=new Set;function r(l,d,f){typeof process<"u"&&process.env.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),d.forEach(u=>console.warn(l,"-",u)))}function a(l){return t.default.dim(l)}const o={info(l,d){r(t.default.bold(t.default.cyan("info")),...Array.isArray(l)?[l]:[d,l])},warn(l,d){r(t.default.bold(t.default.yellow("warn")),...Array.isArray(l)?[l]:[d,l])},risk(l,d){r(t.default.bold(t.default.magenta("risk")),...Array.isArray(l)?[l]:[d,l])}}}(log)),log}var hasRequiredColors;function requireColors(){return hasRequiredColors||(hasRequiredColors=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});const e=t(requireLog());function t(r){return r&&r.__esModule?r:{default:r}}function n({version:r,from:a,to:o}){e.default.warn(`${a}-color-renamed`,[`As of Tailwind CSS ${r}, \`${a}\` has been renamed to \`${o}\`.`,"Update your configuration file to silence this warning."])}const s={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return n({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return n({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return n({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return n({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return n({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(colors$3)),colors$3}var defaults$2={},hasRequiredDefaults;function requireDefaults(){return hasRequiredDefaults||(hasRequiredDefaults=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"defaults",{enumerable:!0,get:function(){return e}});function e(t,...n){for(let a of n){for(let o in a){var s;!(t==null||(s=t.hasOwnProperty)===null||s===void 0)&&s.call(t,o)||(t[o]=a[o])}for(let o of Object.getOwnPropertySymbols(a)){var r;!(t==null||(r=t.hasOwnProperty)===null||r===void 0)&&r.call(t,o)||(t[o]=a[o])}}return t}}(defaults$2)),defaults$2}var toPath={},hasRequiredToPath;function requireToPath(){return hasRequiredToPath||(hasRequiredToPath=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"toPath",{enumerable:!0,get:function(){return e}});function e(t){if(Array.isArray(t))return t;let n=t.split("[").length-1,s=t.split("]").length-1;if(n!==s)throw new Error(`Path is invalid. Has unbalanced brackets: ${t}`);return t.split(/\.(?![^\[]*\])|[\[\]]/g).filter(Boolean)}}(toPath)),toPath}var normalizeConfig={},featureFlags={},hasRequiredFeatureFlags;function requireFeatureFlags(){return hasRequiredFeatureFlags||(hasRequiredFeatureFlags=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(u,p){for(var m in p)Object.defineProperty(u,m,{enumerable:!0,get:p[m]})}e(i,{flagEnabled:function(){return o},issueFlagNotices:function(){return d},default:function(){return f}});const t=s(requirePicocolors_browser()),n=s(requireLog());function s(u){return u&&u.__esModule?u:{default:u}}let r={optimizeUniversalDefaults:!1,generalizedModifiers:!0,disableColorOpacityUtilitiesByDefault:!1,relativeContentPathsByDefault:!1},a={future:["hoverOnlyWhenSupported","respectDefaultRingColorOpacity","disableColorOpacityUtilitiesByDefault","relativeContentPathsByDefault"],experimental:["optimizeUniversalDefaults","generalizedModifiers"]};function o(u,p){if(a.future.includes(p)){var m,g,y;return u.future==="all"||((y=(g=u==null||(m=u.future)===null||m===void 0?void 0:m[p])!==null&&g!==void 0?g:r[p])!==null&&y!==void 0?y:!1)}if(a.experimental.includes(p)){var v,b,C;return u.experimental==="all"||((C=(b=u==null||(v=u.experimental)===null||v===void 0?void 0:v[p])!==null&&b!==void 0?b:r[p])!==null&&C!==void 0?C:!1)}return!1}function l(u){if(u.experimental==="all")return a.experimental;var p;return Object.keys((p=u==null?void 0:u.experimental)!==null&&p!==void 0?p:{}).filter(m=>a.experimental.includes(m)&&u.experimental[m])}function d(u){if(process.env.JEST_WORKER_ID===void 0&&l(u).length>0){let p=l(u).map(m=>t.default.yellow(m)).join(", ");n.default.warn("experimental-flags-enabled",[`You have enabled experimental features: ${p}`,"Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time."])}}const f=a}(featureFlags)),featureFlags}var hasRequiredNormalizeConfig;function requireNormalizeConfig(){return hasRequiredNormalizeConfig||(hasRequiredNormalizeConfig=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"normalizeConfig",{enumerable:!0,get:function(){return r}});const e=requireFeatureFlags(),t=s(requireLog());function n(a){if(typeof WeakMap!="function")return null;var o=new WeakMap,l=new WeakMap;return(n=function(d){return d?l:o})(a)}function s(a,o){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var l=n(o);if(l&&l.has(a))return l.get(a);var d={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(u!=="default"&&Object.prototype.hasOwnProperty.call(a,u)){var p=f?Object.getOwnPropertyDescriptor(a,u):null;p&&(p.get||p.set)?Object.defineProperty(d,u,p):d[u]=a[u]}return d.default=a,l&&l.set(a,d),d}function r(a){if((()=>{if(a.purge||!a.content||!Array.isArray(a.content)&&!(typeof a.content=="object"&&a.content!==null))return!1;if(Array.isArray(a.content))return a.content.every(d=>typeof d=="string"?!0:!(typeof(d==null?void 0:d.raw)!="string"||d!=null&&d.extension&&typeof(d==null?void 0:d.extension)!="string"));if(typeof a.content=="object"&&a.content!==null){if(Object.keys(a.content).some(d=>!["files","relative","extract","transform"].includes(d)))return!1;if(Array.isArray(a.content.files)){if(!a.content.files.every(d=>typeof d=="string"?!0:!(typeof(d==null?void 0:d.raw)!="string"||d!=null&&d.extension&&typeof(d==null?void 0:d.extension)!="string")))return!1;if(typeof a.content.extract=="object"){for(let d of Object.values(a.content.extract))if(typeof d!="function")return!1}else if(!(a.content.extract===void 0||typeof a.content.extract=="function"))return!1;if(typeof a.content.transform=="object"){for(let d of Object.values(a.content.transform))if(typeof d!="function")return!1}else if(!(a.content.transform===void 0||typeof a.content.transform=="function"))return!1;if(typeof a.content.relative!="boolean"&&typeof a.content.relative<"u")return!1}return!0}return!1})()||t.default.warn("purge-deprecation",["The `purge`/`content` options have changed in Tailwind CSS v3.0.","Update your configuration file to eliminate this warning.","https://tailwindcss.com/docs/upgrade-guide#configure-content-sources"]),a.safelist=(()=>{var d;let{content:f,purge:u,safelist:p}=a;return Array.isArray(p)?p:Array.isArray(f==null?void 0:f.safelist)?f.safelist:Array.isArray(u==null?void 0:u.safelist)?u.safelist:Array.isArray(u==null||(d=u.options)===null||d===void 0?void 0:d.safelist)?u.options.safelist:[]})(),a.blocklist=(()=>{let{blocklist:d}=a;if(Array.isArray(d)){if(d.every(f=>typeof f=="string"))return d;t.default.warn("blocklist-invalid",["The `blocklist` option must be an array of strings.","https://tailwindcss.com/docs/content-configuration#discarding-classes"])}return[]})(),typeof a.prefix=="function")t.default.warn("prefix-function",["As of Tailwind CSS v3.0, `prefix` cannot be a function.","Update `prefix` in your configuration to be a string to eliminate this warning.","https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function"]),a.prefix="";else{var l;a.prefix=(l=a.prefix)!==null&&l!==void 0?l:""}a.content={relative:(()=>{let{content:d}=a;return d!=null&&d.relative?d.relative:(0,e.flagEnabled)(a,"relativeContentPathsByDefault")})(),files:(()=>{let{content:d,purge:f}=a;return Array.isArray(f)?f:Array.isArray(f==null?void 0:f.content)?f.content:Array.isArray(d)?d:Array.isArray(d==null?void 0:d.content)?d.content:Array.isArray(d==null?void 0:d.files)?d.files:[]})(),extract:(()=>{let d=(()=>{var p,m,g,y,v,b,C,_,R,E;return!((p=a.purge)===null||p===void 0)&&p.extract?a.purge.extract:!((m=a.content)===null||m===void 0)&&m.extract?a.content.extract:!((g=a.purge)===null||g===void 0||(y=g.extract)===null||y===void 0)&&y.DEFAULT?a.purge.extract.DEFAULT:!((v=a.content)===null||v===void 0||(b=v.extract)===null||b===void 0)&&b.DEFAULT?a.content.extract.DEFAULT:!((C=a.purge)===null||C===void 0||(_=C.options)===null||_===void 0)&&_.extractors?a.purge.options.extractors:!((R=a.content)===null||R===void 0||(E=R.options)===null||E===void 0)&&E.extractors?a.content.options.extractors:{}})(),f={},u=(()=>{var p,m,g,y;if(!((p=a.purge)===null||p===void 0||(m=p.options)===null||m===void 0)&&m.defaultExtractor)return a.purge.options.defaultExtractor;if(!((g=a.content)===null||g===void 0||(y=g.options)===null||y===void 0)&&y.defaultExtractor)return a.content.options.defaultExtractor})();if(u!==void 0&&(f.DEFAULT=u),typeof d=="function")f.DEFAULT=d;else if(Array.isArray(d))for(let{extensions:p,extractor:m}of d??[])for(let g of p)f[g]=m;else typeof d=="object"&&d!==null&&Object.assign(f,d);return f})(),transform:(()=>{let d=(()=>{var u,p,m,g,y,v;return!((u=a.purge)===null||u===void 0)&&u.transform?a.purge.transform:!((p=a.content)===null||p===void 0)&&p.transform?a.content.transform:!((m=a.purge)===null||m===void 0||(g=m.transform)===null||g===void 0)&&g.DEFAULT?a.purge.transform.DEFAULT:!((y=a.content)===null||y===void 0||(v=y.transform)===null||v===void 0)&&v.DEFAULT?a.content.transform.DEFAULT:{}})(),f={};return typeof d=="function"?f.DEFAULT=d:typeof d=="object"&&d!==null&&Object.assign(f,d),f})()};for(let d of a.content.files)if(typeof d=="string"&&/{([^,]*?)}/g.test(d)){t.default.warn("invalid-glob-braces",[`The glob pattern ${(0,t.dim)(d)} in your Tailwind CSS configuration is invalid.`,`Update it to ${(0,t.dim)(d.replace(/{([^,]*?)}/g,"$1"))} to silence this warning.`]);break}return a}}(normalizeConfig)),normalizeConfig}var isPlainObject={},hasRequiredIsPlainObject;function requireIsPlainObject(){return hasRequiredIsPlainObject||(hasRequiredIsPlainObject=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const n=Object.getPrototypeOf(t);return n===null||Object.getPrototypeOf(n)===null}}(isPlainObject)),isPlainObject}var cloneDeep={},hasRequiredCloneDeep;function requireCloneDeep(){return hasRequiredCloneDeep||(hasRequiredCloneDeep=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"cloneDeep",{enumerable:!0,get:function(){return e}});function e(t){return Array.isArray(t)?t.map(n=>e(n)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([n,s])=>[n,e(s)])):t}}(cloneDeep)),cloneDeep}var pluginUtils={},escapeCommas={},hasRequiredEscapeCommas;function requireEscapeCommas(){return hasRequiredEscapeCommas||(hasRequiredEscapeCommas=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\\,/g,"\\2c ")}}(escapeCommas)),escapeCommas}var withAlphaVariable={},color$1={},colorNames={},hasRequiredColorNames;function requireColorNames(){return hasRequiredColorNames||(hasRequiredColorNames=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});const e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}(colorNames)),colorNames}var hasRequiredColor;function requireColor(){return hasRequiredColor||(hasRequiredColor=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(g,y){for(var v in y)Object.defineProperty(g,v,{enumerable:!0,get:y[v]})}e(i,{parseColor:function(){return p},formatColor:function(){return m}});const t=n(requireColorNames());function n(g){return g&&g.__esModule?g:{default:g}}let s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,r=/^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,a=/(?:\d+|\d*\.\d+)%?/,o=/(?:\s*,\s*|\s+)/,l=/\s*[,/]\s*/,d=/var\(--(?:[^ )]*?)(?:,(?:[^ )]*?|var\(--[^ )]*?\)))?\)/,f=new RegExp(`^(rgba?)\\(\\s*(${a.source}|${d.source})(?:${o.source}(${a.source}|${d.source}))?(?:${o.source}(${a.source}|${d.source}))?(?:${l.source}(${a.source}|${d.source}))?\\s*\\)$`),u=new RegExp(`^(hsla?)\\(\\s*((?:${a.source})(?:deg|rad|grad|turn)?|${d.source})(?:${o.source}(${a.source}|${d.source}))?(?:${o.source}(${a.source}|${d.source}))?(?:${l.source}(${a.source}|${d.source}))?\\s*\\)$`);function p(g,{loose:y=!1}={}){var v,b;if(typeof g!="string")return null;if(g=g.trim(),g==="transparent")return{mode:"rgb",color:["0","0","0"],alpha:"0"};if(g in t.default)return{mode:"rgb",color:t.default[g].map(F=>F.toString())};let C=g.replace(r,(F,O,A,N,M)=>["#",O,O,A,A,N,N,M?M+M:""].join("")).match(s);if(C!==null)return{mode:"rgb",color:[parseInt(C[1],16),parseInt(C[2],16),parseInt(C[3],16)].map(F=>F.toString()),alpha:C[4]?(parseInt(C[4],16)/255).toString():void 0};var _;let R=(_=g.match(f))!==null&&_!==void 0?_:g.match(u);if(R===null)return null;let E=[R[2],R[3],R[4]].filter(Boolean).map(F=>F.toString());return E.length===2&&E[0].startsWith("var(")?{mode:R[1],color:[E[0]],alpha:E[1]}:!y&&E.length!==3||E.length<3&&!E.some(F=>/^var\(.*?\)$/.test(F))?null:{mode:R[1],color:E,alpha:(v=R[5])===null||v===void 0||(b=v.toString)===null||b===void 0?void 0:b.call(v)}}function m({mode:g,color:y,alpha:v}){let b=v!==void 0;return g==="rgba"||g==="hsla"?`${g}(${y.join(", ")}${b?`, ${v}`:""})`:`${g}(${y.join(" ")}${b?` / ${v}`:""})`}}(color$1)),color$1}var hasRequiredWithAlphaVariable;function requireWithAlphaVariable(){return hasRequiredWithAlphaVariable||(hasRequiredWithAlphaVariable=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(r,a){for(var o in a)Object.defineProperty(r,o,{enumerable:!0,get:a[o]})}e(i,{withAlphaValue:function(){return n},default:function(){return s}});const t=requireColor();function n(r,a,o){if(typeof r=="function")return r({opacityValue:a});let l=(0,t.parseColor)(r,{loose:!0});return l===null?o:(0,t.formatColor)({...l,alpha:a})}function s({color:r,property:a,variable:o}){let l=[].concat(a);if(typeof r=="function")return{[o]:"1",...Object.fromEntries(l.map(f=>[f,r({opacityVariable:o,opacityValue:`var(${o}, 1)`})]))};const d=(0,t.parseColor)(r);return d===null?Object.fromEntries(l.map(f=>[f,r])):d.alpha!==void 0?Object.fromEntries(l.map(f=>[f,r])):{[o]:"1",...Object.fromEntries(l.map(f=>[f,(0,t.formatColor)({...d,alpha:`var(${o}, 1)`})]))}}}(withAlphaVariable)),withAlphaVariable}var dataTypes={},parseBoxShadowValue={},splitAtTopLevelOnly={},hasRequiredSplitAtTopLevelOnly;function requireSplitAtTopLevelOnly(){return hasRequiredSplitAtTopLevelOnly||(hasRequiredSplitAtTopLevelOnly=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"splitAtTopLevelOnly",{enumerable:!0,get:function(){return e}});function e(t,n){let s=[],r=[],a=0,o=!1;for(let l=0;l<t.length;l++){let d=t[l];s.length===0&&d===n[0]&&!o&&(n.length===1||t.slice(l,l+n.length)===n)&&(r.push(t.slice(a,l)),a=l+n.length),o=o?!1:d==="\\",d==="("||d==="["||d==="{"?s.push(d):(d===")"&&s[s.length-1]==="("||d==="]"&&s[s.length-1]==="["||d==="}"&&s[s.length-1]==="{")&&s.pop()}return r.push(t.slice(a)),r}}(splitAtTopLevelOnly)),splitAtTopLevelOnly}var hasRequiredParseBoxShadowValue;function requireParseBoxShadowValue(){return hasRequiredParseBoxShadowValue||(hasRequiredParseBoxShadowValue=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,d){for(var f in d)Object.defineProperty(l,f,{enumerable:!0,get:d[f]})}e(i,{parseBoxShadowValue:function(){return a},formatBoxShadowValue:function(){return o}});const t=requireSplitAtTopLevelOnly();let n=new Set(["inset","inherit","initial","revert","unset"]),s=/\ +(?![^(]*\))/g,r=/^-?(\d+|\.\d+)(.*?)$/g;function a(l){return(0,t.splitAtTopLevelOnly)(l,",").map(f=>{let u=f.trim(),p={raw:u},m=u.split(s),g=new Set;for(let y of m)r.lastIndex=0,!g.has("KEYWORD")&&n.has(y)?(p.keyword=y,g.add("KEYWORD")):r.test(y)?g.has("X")?g.has("Y")?g.has("BLUR")?g.has("SPREAD")||(p.spread=y,g.add("SPREAD")):(p.blur=y,g.add("BLUR")):(p.y=y,g.add("Y")):(p.x=y,g.add("X")):p.color?(p.unknown||(p.unknown=[]),p.unknown.push(y)):p.color=y;return p.valid=p.x!==void 0&&p.y!==void 0,p})}function o(l){return l.map(d=>d.valid?[d.keyword,d.x,d.y,d.blur,d.spread,d.color].filter(Boolean).join(" "):d.raw).join(", ")}}(parseBoxShadowValue)),parseBoxShadowValue}var hasRequiredDataTypes;function requireDataTypes(){return hasRequiredDataTypes||(hasRequiredDataTypes=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(ce,pe){for(var he in pe)Object.defineProperty(ce,he,{enumerable:!0,get:pe[he]})}e(i,{normalize:function(){return l},normalizeAttributeSelectors:function(){return d},url:function(){return u},number:function(){return p},percentage:function(){return m},length:function(){return v},lineWidth:function(){return C},shadow:function(){return _},color:function(){return R},image:function(){return E},gradient:function(){return O},position:function(){return N},familyName:function(){return M},genericName:function(){return X},absoluteSize:function(){return le},relativeSize:function(){return ue}});const t=requireColor(),n=requireParseBoxShadowValue(),s=requireSplitAtTopLevelOnly();let r=["min","max","clamp","calc"];function a(ce){return r.some(pe=>new RegExp(`^${pe}\\(.*\\)`).test(ce))}const o=new Set(["scroll-timeline-name","timeline-scope","view-timeline-name","font-palette","anchor-name","anchor-scope","position-anchor","position-try-options","scroll-timeline","animation-timeline","view-timeline","position-try"]);function l(ce,pe=null,he=!0){let Y=pe&&o.has(pe.property);return ce.startsWith("--")&&!Y?`var(${ce})`:ce.includes("url(")?ce.split(/(url\(.*?\))/g).filter(Boolean).map(ge=>/^url\(.*?\)$/.test(ge)?ge:l(ge,pe,!1)).join(""):(ce=ce.replace(/([^\\])_+/g,(ge,xe)=>xe+" ".repeat(ge.length-1)).replace(/^_/g," ").replace(/\\_/g,"_"),he&&(ce=ce.trim()),ce=f(ce),ce)}function d(ce){return ce.includes("=")&&(ce=ce.replace(/(=.*)/g,(pe,he)=>{if(he[1]==="'"||he[1]==='"')return he;if(he.length>2){let Y=he[he.length-1];if(he[he.length-2]===" "&&(Y==="i"||Y==="I"||Y==="s"||Y==="S"))return`="${he.slice(1,-2)}" ${he[he.length-1]}`}return`="${he.slice(1)}"`})),ce}function f(ce){let pe=["theme"],he=["min-content","max-content","fit-content","safe-area-inset-top","safe-area-inset-right","safe-area-inset-bottom","safe-area-inset-left","titlebar-area-x","titlebar-area-y","titlebar-area-width","titlebar-area-height","keyboard-inset-top","keyboard-inset-right","keyboard-inset-bottom","keyboard-inset-left","keyboard-inset-width","keyboard-inset-height","radial-gradient","linear-gradient","conic-gradient","repeating-radial-gradient","repeating-linear-gradient","repeating-conic-gradient","anchor-size"];return ce.replace(/(calc|min|max|clamp)\(.+\)/g,Y=>{let ge="";function xe(){let be=ge.trimEnd();return be[be.length-1]}for(let be=0;be<Y.length;be++){let Ce=function(ye){return ye.split("").every((we,_e)=>Y[be+_e]===we)},ke=function(ye){let we=1/0;for(let Re of ye){let Ee=Y.indexOf(Re,be);Ee!==-1&&Ee<we&&(we=Ee)}let _e=Y.slice(be,we);return be+=_e.length-1,_e},me=Y[be];if(Ce("var"))ge+=ke([")",","]);else if(he.some(ye=>Ce(ye))){let ye=he.find(we=>Ce(we));ge+=ye,be+=ye.length-1}else pe.some(ye=>Ce(ye))?ge+=ke([")"]):Ce("[")?ge+=ke(["]"]):["+","-","*","/"].includes(me)&&!["(","+","-","*","/",","].includes(xe())?ge+=` ${me} `:ge+=me}return ge.replace(/\s+/g," ")})}function u(ce){return ce.startsWith("url(")}function p(ce){return!isNaN(Number(ce))||a(ce)}function m(ce){return ce.endsWith("%")&&p(ce.slice(0,-1))||a(ce)}let y=`(?:${["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"].join("|")})`;function v(ce){return ce==="0"||new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${y}$`).test(ce)||a(ce)}let b=new Set(["thin","medium","thick"]);function C(ce){return b.has(ce)}function _(ce){let pe=(0,n.parseBoxShadowValue)(l(ce));for(let he of pe)if(!he.valid)return!1;return!0}function R(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,"_").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:(0,t.parseColor)(Y,{loose:!0})!==null?(pe++,!0):!1))?pe>0:!1}function E(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,",").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:u(Y)||O(Y)||["element(","image(","cross-fade(","image-set("].some(ge=>Y.startsWith(ge))?(pe++,!0):!1))?pe>0:!1}let F=new Set(["conic-gradient","linear-gradient","radial-gradient","repeating-conic-gradient","repeating-linear-gradient","repeating-radial-gradient"]);function O(ce){ce=l(ce);for(let pe of F)if(ce.startsWith(`${pe}(`))return!0;return!1}let A=new Set(["center","top","right","bottom","left"]);function N(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,"_").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:A.has(Y)||v(Y)||m(Y)?(pe++,!0):!1))?pe>0:!1}function M(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,",").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:Y.includes(" ")&&!/(['"])([^"']+)\1/g.test(Y)||/^\d/g.test(Y)?!1:(pe++,!0)))?pe>0:!1}let Z=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);function X(ce){return Z.has(ce)}let oe=new Set(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large"]);function le(ce){return oe.has(ce)}let de=new Set(["larger","smaller"]);function ue(ce){return de.has(ce)}}(dataTypes)),dataTypes}var validateFormalSyntax={},hasRequiredValidateFormalSyntax;function requireValidateFormalSyntax(){return hasRequiredValidateFormalSyntax||(hasRequiredValidateFormalSyntax=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"backgroundSize",{enumerable:!0,get:function(){return n}});const e=requireDataTypes(),t=requireSplitAtTopLevelOnly();function n(s){let r=["cover","contain"];return(0,t.splitAtTopLevelOnly)(s,",").every(a=>{let o=(0,t.splitAtTopLevelOnly)(a,"_").filter(Boolean);return o.length===1&&r.includes(o[0])?!0:o.length!==1&&o.length!==2?!1:o.every(l=>(0,e.length)(l)||(0,e.percentage)(l)||l==="auto")})}}(validateFormalSyntax)),validateFormalSyntax}var hasRequiredPluginUtils;function requirePluginUtils(){return hasRequiredPluginUtils||(hasRequiredPluginUtils=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(N,M){for(var Z in M)Object.defineProperty(N,Z,{enumerable:!0,get:M[Z]})}e(i,{updateAllClasses:function(){return d},asValue:function(){return p},parseColorFormat:function(){return y},asColor:function(){return b},asLookupValue:function(){return C},typeMap:function(){return R},coerceValue:function(){return O},getMatchingTypes:function(){return A}});const t=l(requireEscapeCommas()),n=requireWithAlphaVariable(),s=requireDataTypes(),r=l(requireNegateValue()),a=requireValidateFormalSyntax(),o=requireFeatureFlags();function l(N){return N&&N.__esModule?N:{default:N}}function d(N,M){N.walkClasses(Z=>{Z.value=M(Z.value),Z.raws&&Z.raws.value&&(Z.raws.value=(0,t.default)(Z.raws.value))})}function f(N,M){if(!m(N))return;let Z=N.slice(1,-1);if(M(Z))return(0,s.normalize)(Z)}function u(N,M={},Z){let X=M[N];if(X!==void 0)return(0,r.default)(X);if(m(N)){let oe=f(N,Z);return oe===void 0?void 0:(0,r.default)(oe)}}function p(N,M={},{validate:Z=()=>!0}={}){var X;let oe=(X=M.values)===null||X===void 0?void 0:X[N];return oe!==void 0?oe:M.supportsNegativeValues&&N.startsWith("-")?u(N.slice(1),M.values,Z):f(N,Z)}function m(N){return N.startsWith("[")&&N.endsWith("]")}function g(N){let M=N.lastIndexOf("/"),Z=N.lastIndexOf("[",M),X=N.indexOf("]",M);return N[M-1]==="]"||N[M+1]==="["||Z!==-1&&X!==-1&&Z<M&&M<X&&(M=N.lastIndexOf("/",Z)),M===-1||M===N.length-1?[N,void 0]:m(N)&&!N.includes("]/[")?[N,void 0]:[N.slice(0,M),N.slice(M+1)]}function y(N){if(typeof N=="string"&&N.includes("<alpha-value>")){let M=N;return({opacityValue:Z=1})=>M.replace(/<alpha-value>/g,Z)}return N}function v(N){return(0,s.normalize)(N.slice(1,-1))}function b(N,M={},{tailwindConfig:Z={}}={}){var X;if(((X=M.values)===null||X===void 0?void 0:X[N])!==void 0){var oe;return y((oe=M.values)===null||oe===void 0?void 0:oe[N])}let[le,de]=g(N);if(de!==void 0){var ue,ce,pe,he;let Y=(he=(ue=M.values)===null||ue===void 0?void 0:ue[le])!==null&&he!==void 0?he:m(le)?le.slice(1,-1):void 0;return Y===void 0?void 0:(Y=y(Y),m(de)?(0,n.withAlphaValue)(Y,v(de)):((ce=Z.theme)===null||ce===void 0||(pe=ce.opacity)===null||pe===void 0?void 0:pe[de])===void 0?void 0:(0,n.withAlphaValue)(Y,Z.theme.opacity[de]))}return p(N,M,{validate:s.color})}function C(N,M={}){var Z;return(Z=M.values)===null||Z===void 0?void 0:Z[N]}function _(N){return(M,Z)=>p(M,Z,{validate:N})}let R={any:p,color:b,url:_(s.url),image:_(s.image),length:_(s.length),percentage:_(s.percentage),position:_(s.position),lookup:C,"generic-name":_(s.genericName),"family-name":_(s.familyName),number:_(s.number),"line-width":_(s.lineWidth),"absolute-size":_(s.absoluteSize),"relative-size":_(s.relativeSize),shadow:_(s.shadow),size:_(a.backgroundSize)},E=Object.keys(R);function F(N,M){let Z=N.indexOf(M);return Z===-1?[void 0,N]:[N.slice(0,Z),N.slice(Z+1)]}function O(N,M,Z,X){if(Z.values&&M in Z.values)for(let{type:le}of N??[]){let de=R[le](M,Z,{tailwindConfig:X});if(de!==void 0)return[de,le,null]}if(m(M)){let le=M.slice(1,-1),[de,ue]=F(le,":");if(!/^[\w-_]+$/g.test(de))ue=le;else if(de!==void 0&&!E.includes(de))return[];if(ue.length>0&&E.includes(de))return[p(`[${ue}]`,Z),de,null]}let oe=A(N,M,Z,X);for(let le of oe)return le;return[]}function*A(N,M,Z,X){let oe=(0,o.flagEnabled)(X,"generalizedModifiers"),[le,de]=g(M);if(oe&&Z.modifiers!=null&&(Z.modifiers==="any"||typeof Z.modifiers=="object"&&(de&&m(de)||de in Z.modifiers))||(le=M,de=void 0),de!==void 0&&le===""&&(le="DEFAULT"),de!==void 0&&typeof Z.modifiers=="object"){var ce,pe;let he=(pe=(ce=Z.modifiers)===null||ce===void 0?void 0:ce[de])!==null&&pe!==void 0?pe:null;he!==null?de=he:m(de)&&(de=v(de))}for(let{type:he}of N??[]){let Y=R[he](le,Z,{tailwindConfig:X});Y!==void 0&&(yield[Y,he,de??null])}}}(pluginUtils)),pluginUtils}var toColorValue={},hasRequiredToColorValue;function requireToColorValue(){return hasRequiredToColorValue||(hasRequiredToColorValue=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){return typeof t=="function"?t({}):t}}(toColorValue)),toColorValue}var hasRequiredResolveConfig$2;function requireResolveConfig$2(){return hasRequiredResolveConfig$2||(hasRequiredResolveConfig$2=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return Z}});const e=m(requireNegateValue()),t=m(requireCorePluginList()),n=m(requireConfigurePlugins()),s=m(requireColors()),r=requireDefaults(),a=requireToPath(),o=requireNormalizeConfig(),l=m(requireIsPlainObject()),d=requireCloneDeep(),f=requirePluginUtils(),u=requireWithAlphaVariable(),p=m(requireToColorValue());function m(X){return X&&X.__esModule?X:{default:X}}function g(X){return typeof X=="function"}function y(X,...oe){let le=oe.pop();for(let de of oe)for(let ue in de){let ce=le(X[ue],de[ue]);ce===void 0?(0,l.default)(X[ue])&&(0,l.default)(de[ue])?X[ue]=y({},X[ue],de[ue],le):X[ue]=de[ue]:X[ue]=ce}return X}const v={colors:s.default,negative(X){return Object.keys(X).filter(oe=>X[oe]!=="0").reduce((oe,le)=>{let de=(0,e.default)(X[le]);return de!==void 0&&(oe[`-${le}`]=de),oe},{})},breakpoints(X){return Object.keys(X).filter(oe=>typeof X[oe]=="string").reduce((oe,le)=>({...oe,[`screen-${le}`]:X[le]}),{})}};function b(X,...oe){return g(X)?X(...oe):X}function C(X){return X.reduce((oe,{extend:le})=>y(oe,le,(de,ue)=>de===void 0?[ue]:Array.isArray(de)?[ue,...de]:[ue,de]),{})}function _(X){return{...X.reduce((oe,le)=>(0,r.defaults)(oe,le),{}),extend:C(X)}}function R(X,oe){if(Array.isArray(X)&&(0,l.default)(X[0]))return X.concat(oe);if(Array.isArray(oe)&&(0,l.default)(oe[0])&&(0,l.default)(X))return[X,...oe];if(Array.isArray(oe))return oe}function E({extend:X,...oe}){return y(oe,X,(le,de)=>!g(le)&&!de.some(g)?y({},le,...de,R):(ue,ce)=>y({},...[le,...de].map(pe=>b(pe,ue,ce)),R))}function*F(X){let oe=(0,a.toPath)(X);if(oe.length===0||(yield oe,Array.isArray(X)))return;let le=/^(.*?)\s*\/\s*([^/]+)$/,de=X.match(le);if(de!==null){let[,ue,ce]=de,pe=(0,a.toPath)(ue);pe.alpha=ce,yield pe}}function O(X){const oe=(le,de)=>{for(const ue of F(le)){let ce=0,pe=X;for(;pe!=null&&ce<ue.length;)pe=pe[ue[ce++]],pe=g(pe)&&(ue.alpha===void 0||ce<=ue.length-1)?pe(oe,v):pe;if(pe!==void 0){if(ue.alpha!==void 0){let he=(0,f.parseColorFormat)(pe);return(0,u.withAlphaValue)(he,ue.alpha,(0,p.default)(he))}return(0,l.default)(pe)?(0,d.cloneDeep)(pe):pe}}return de};return Object.assign(oe,{theme:oe,...v}),Object.keys(X).reduce((le,de)=>(le[de]=g(X[de])?X[de](oe,v):X[de],le),{})}function A(X){let oe=[];return X.forEach(le=>{oe=[...oe,le];var de;const ue=(de=le==null?void 0:le.plugins)!==null&&de!==void 0?de:[];ue.length!==0&&ue.forEach(ce=>{ce.__isOptionsFunction&&(ce=ce());var pe;oe=[...oe,...A([(pe=ce==null?void 0:ce.config)!==null&&pe!==void 0?pe:{}])]})}),oe}function N(X){return[...X].reduceRight((le,de)=>g(de)?de({corePlugins:le}):(0,n.default)(de,le),t.default)}function M(X){return[...X].reduceRight((le,de)=>[...le,...de],[])}function Z(X){let oe=[...A(X),{prefix:"",important:!1,separator:":"}];var le,de;return(0,o.normalizeConfig)((0,r.defaults)({theme:O(E(_(oe.map(ue=>(le=ue==null?void 0:ue.theme)!==null&&le!==void 0?le:{})))),corePlugins:N(oe.map(ue=>ue.corePlugins)),plugins:M(X.map(ue=>(de=ue==null?void 0:ue.plugins)!==null&&de!==void 0?de:[]))},...oe))}}(resolveConfig$1)),resolveConfig$1}var getAllConfigs={},config_full,hasRequiredConfig_full;function requireConfig_full(){return hasRequiredConfig_full||(hasRequiredConfig_full=1,config_full={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:i})=>({...i("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:i})=>i("blur"),backdropBrightness:({theme:i})=>i("brightness"),backdropContrast:({theme:i})=>i("contrast"),backdropGrayscale:({theme:i})=>i("grayscale"),backdropHueRotate:({theme:i})=>i("hueRotate"),backdropInvert:({theme:i})=>i("invert"),backdropOpacity:({theme:i})=>i("opacity"),backdropSaturate:({theme:i})=>i("saturate"),backdropSepia:({theme:i})=>i("sepia"),backgroundColor:({theme:i})=>i("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:i})=>i("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:i})=>({...i("colors"),DEFAULT:i("colors.gray.200","currentColor")}),borderOpacity:({theme:i})=>i("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:i})=>({...i("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:i})=>i("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:i})=>i("colors"),colors:({colors:i})=>({inherit:i.inherit,current:i.current,transparent:i.transparent,black:i.black,white:i.white,slate:i.slate,gray:i.gray,zinc:i.zinc,neutral:i.neutral,stone:i.stone,red:i.red,orange:i.orange,amber:i.amber,yellow:i.yellow,lime:i.lime,green:i.green,emerald:i.emerald,teal:i.teal,cyan:i.cyan,sky:i.sky,blue:i.blue,indigo:i.indigo,violet:i.violet,purple:i.purple,fuchsia:i.fuchsia,pink:i.pink,rose:i.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:i})=>i("borderColor"),divideOpacity:({theme:i})=>i("borderOpacity"),divideWidth:({theme:i})=>i("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:i})=>({none:"none",...i("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:i})=>i("spacing"),gradientColorStops:({theme:i})=>i("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},height:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:i})=>({auto:"auto",...i("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:i})=>({...i("spacing"),none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:i,breakpoints:e})=>({...i("spacing"),none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e(i("screens"))}),minHeight:({theme:i})=>({...i("spacing"),full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),minWidth:({theme:i})=>({...i("spacing"),full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:i})=>i("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:i})=>i("spacing"),placeholderColor:({theme:i})=>i("colors"),placeholderOpacity:({theme:i})=>i("opacity"),ringColor:({theme:i})=>({DEFAULT:i("colors.blue.500","#3b82f6"),...i("colors")}),ringOffsetColor:({theme:i})=>i("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:i})=>({DEFAULT:"0.5",...i("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:i})=>({...i("spacing")}),scrollPadding:({theme:i})=>i("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:i})=>({...i("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:i})=>({none:"none",...i("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:i})=>i("colors"),textDecorationColor:({theme:i})=>i("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:i})=>({...i("spacing")}),textOpacity:({theme:i})=>i("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:i})=>({...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),size:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),width:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]}),config_full}var hasRequiredGetAllConfigs;function requireGetAllConfigs(){return hasRequiredGetAllConfigs||(hasRequiredGetAllConfigs=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});const e=n(requireConfig_full()),t=requireFeatureFlags();function n(r){return r&&r.__esModule?r:{default:r}}function s(r){var a;const o=((a=r==null?void 0:r.presets)!==null&&a!==void 0?a:[e.default]).slice().reverse().flatMap(f=>s(f instanceof Function?f():f)),l={respectDefaultRingColorOpacity:{theme:{ringColor:({theme:f})=>({DEFAULT:"#3b82f67f",...f("colors")})}},disableColorOpacityUtilitiesByDefault:{corePlugins:{backgroundOpacity:!1,borderOpacity:!1,divideOpacity:!1,placeholderOpacity:!1,ringOpacity:!1,textOpacity:!1}}},d=Object.keys(l).filter(f=>(0,t.flagEnabled)(r,f)).map(f=>l[f]);return[r,...d,...o]}}(getAllConfigs)),getAllConfigs}var hasRequiredResolveConfig$1;function requireResolveConfig$1(){return hasRequiredResolveConfig$1||(hasRequiredResolveConfig$1=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});const e=n(requireResolveConfig$2()),t=n(requireGetAllConfigs());function n(r){return r&&r.__esModule?r:{default:r}}function s(...r){let[,...a]=(0,t.default)(r[0]);return(0,e.default)([...r,...a])}}(resolveConfig$2)),resolveConfig$2}var resolveConfig_1,hasRequiredResolveConfig;function requireResolveConfig(){if(hasRequiredResolveConfig)return resolveConfig_1;hasRequiredResolveConfig=1;let i=requireResolveConfig$1();return resolveConfig_1=(i.__esModule?i:{default:i}).default,resolveConfig_1}var resolveConfigExports=requireResolveConfig();const resolveConfig=getDefaultExportFromCjs$1(resolveConfigExports),config={content:["./index.html","./src/**/*.{js,ts,jsx,tsx}"],prefix:"pl-",darkMode:["class",'[class= "dark"]'],theme:{extend:{colors:{playerColor:"rgb(var(--color-playerColor) / <alpha-value>)",playerColor1:"rgb(var(--color-playerColor1) / <alpha-value>)",main:{DEFAULT:"#651FFF",highLight:"#BB86FC",lightPurple:"#D4C5FF",light:"#7C4DFF",700:"#6833DD",dark:"#442D8E"},primary:{500:"#50A5FF",600:"#7C8EFF",700:"#027DFF",800:"#006ADA"},secondary:{DEFAULT:"#BCBDC0",50:"#FBFBFB",100:"#F7F7FC",200:"#EFF0F6",300:"#D9DBE9",400:"#A0A3BD",500:"#6E7191",600:"#4E4B66",700:"#262338",800:"#14142A",900:"#040412"},gray:{warm:"#ECEADC",highLight:"#E6E6E6",100:"#F5F5F5",300:"#D4D4D4",400:"#A3A3A3",500:"#737373",600:"#313A43",700:"#404040",800:"#151515"},dark:{1:"#1C1B1E",2:"#2C2C2C",3:"#303034",4:"#919094",5:"#E3E2E6",6:"#F2F0F4",7:"#BB86FC",8:"#E8DEFF",9:"#CDBDFF",10:"#383838",13:"#1C1B1F"},red:{light:"#EE1D23",200:"#EA0000",300:"#FCA5A5",500:"#EF4444",600:"#DC2626",700:"#B91C1C",zProgress:"#F74B50",error:"#F2B8B5",onError:"#601410"},lime:{300:"#A6F787",500:"#84CC16",600:"#65A30D",800:"#28752B",success:"#067306"},orange:{100:"#F15F22",200:"#FCC44D",600:"#F3732B",700:"#F15F22"},purple:{light:"#DACDFF"},warning:{DEFAULT:"#F5A623",100:"#DE8200"},z:{secondary:{50:"#FAFAFA",100:"#DBDDDE",500:"#939598",600:"#57585A"},yellow:{light:"#FAD832",login:"#FFBC39"},gray:{300:"#CDCDCD",400:"#BDBDBD",500:"#393E46",700:"#222831"},red:{progress:"#F64B50"},green:{DEFAULT:"#00B59C"}}}}},plugins:[]},wait=i=>new Promise(e=>setTimeout(e,i*1e3)),getRemainingTime=i=>{const e=Math.floor(Date.now()/1e3-i),t=new Intl.RelativeTimeFormat(conditions(ConditionName.isArabicLang)?Lang.ar:Lang.fa,{numeric:"auto"});switch(!0){case e<60:return t.format(-e,"second");case e<3600:return t.format(-Math.floor(e/60),"minute");case e<86400:return t.format(-Math.floor(e/3600),"hour");case e<2592e3:return t.format(-Math.floor(e/86400),"day");case e<31536e3:return t.format(-Math.floor(e/2592e3),"month");default:return t.format(-Math.floor(e/31536e3),"year")}},compare=(i,e)=>i.time<e.time?-1:i.time>e.time?1:0,handlePageTitle=i=>{i&&conditions(ConditionName.showModuleTitle)&&(document.title=i)},getUUID=()=>{let i=localStorage.getItem("hamrahiUUID");return i||(i=uuidGenerator(),localStorage.setItem("hamrahiUUID",i)),i.toString()},uuidGenerator=()=>{let i="xxxxxxxx-xxxx-Mxxx-Nxxx-x".replace(/[xMN]/g,e=>{let t;return e==="M"?t=Math.floor(1+Math.random()*5):e==="N"?t=Math.floor(8+Math.random()*4):t=Math.floor(Math.random()*16),t.toString(16)});return i+=Date.now().toString(16),i},isTouchScreen=()=>"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,isTouchScreenLandscape=()=>{const{videoElementSizeInfo:i}=store.getState().videoData,{isFullScreen:e}=store.getState().controller;return conditions(ConditionName.isMiniPlayer)&&i.width!==0?isTouchScreen()&&i.width>i.height:isTouchScreen()&&e},isTouchScreenPortrait=()=>{const{isFullScreen:i}=store.getState().controller;return isTouchScreen()&&!i},handleIsComplexDesktop=i=>!isTouchScreen()&&!document.fullscreenElement&&i,isIOS=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,controllbarIconSize={miniPlayer:15,other:20},addZeroBefore=i=>(i<10?"0":"")+i,secondsToHMS=i=>{const e=Math.floor(i/3600),t=Math.floor(i%3600/60),n=Math.floor(i%3600%60);return e<1?`${addZeroBefore(t)}:${addZeroBefore(n)}`:`${addZeroBefore(e)}:${addZeroBefore(t)}:${addZeroBefore(n)}`},secondsToPersianHMS=i=>{const e=Math.floor(i/3600),t=Math.floor(i%3600/60),n=Math.floor(i%3600%60),s=n?`${n} ${translate().seconds}`:null,r=t?`${t} ${translate().minutes}`:null;return[e?`${e} ${translate().hour}`:null,r,s].filter(o=>o!==null)},efficientSecondsToPersianHMS=i=>{const e=i>=3600?Math.floor(i/3600):0,t=i>=60?Math.floor(i%3600/60):0,n=i<60*60?Math.floor(i%3600%60):0,s=n?`${n} ${translate().seconds}`:null,r=t?`${t} ${translate().minutes}`:null;return[e?`${e} ${translate().hour}`:null,r,s].filter(o=>o!==null).join(" و ")},staticFormats=i=>["mp4","mkv","mov","m4v"].includes(i)?"mp4":i==="webm"||i==="flv"?i:["mp3","ogg"].includes(i)?"mp3":!1,addUuidToSrc=i=>{const e=new URL(i);let t=i;return e.search.length?t+=`&uuid=${getUUID()}`:t+=`?uuid=${getUUID()}`},handleSumVotes=i=>{let e=0;return i&&Object.keys(i).length>0&&i.options.length>0&&i.options.forEach(t=>{livePoll()&&livePoll().polls.filter(n=>n.qid===i.id&&n.oid===t.id&&n.sumOptionVotes===t.vote+1).length>0&&(e+=1),e+=t.vote}),e},checkParentTarget=(i,e)=>{try{return[i.target.id,i.target.parentNode.id,i.target.parentNode.parentNode.id,i.target.parentNode.parentNode.parentNode.id,i.target.parentNode.parentNode.parentNode.parentNode.id].includes(e)}catch{return!1}},unitization=i=>i/1e3<1?{value:i,unit:""}:i/(1e3*1e3)<1?{value:Math.ceil(i/1e3*10)/10,unit:"K"}:i/(1e3*1e3*1e3)<1?{value:Math.ceil(i/(1e3*1e3)*10)/10,unit:"M"}:{value:0,unit:""},handleNotActiveText=(i="404")=>{if(i==="liveAndVod")return{title:translate().currentlyNoVideoContent,description:translate().viewOtherVideos};if(i==="404"||i===void 0)return{title:"404",description:translate().enteredAddressNotCorrect}},isVoted=i=>livePoll()&&livePoll().polls.some(e=>e.qid===i),isSelectedOption=(i,e)=>livePoll()&&livePoll().polls.some(t=>t.qid===i&&t.oid===e),appendQueryParamsToChunks=i=>{const e=store.dispatch,{token:t,params:n}=store.getState().videoData;let s="";s=i.split("m3u8")[1],s?s=`${s}&uuid=${getUUID()}`:s=`?uuid=${getUUID()}`,conditions(ConditionName.isAuth)&&(hasQuestionMark(s)?s=`${s}&token=${t}`:s=`?token=${t}`),conditions(ConditionName.hasDaaniTokenParams)&&(hasQuestionMark(s)?s=`${s}&ext_user=${n.daaniToken}`:s=`?ext_user=${n.daaniToken}`),e(setStreamLinkParams(s))},inViewPort=i=>{if(i){const e=i.offsetLeft-i.offsetWidth/2,t=window.innerWidth-(i.offsetLeft+i.offsetWidth);if(e>=0&&t>=0)return"inViewport";if(e<0)return"OutViewPortFromLeft";if(t<0)return"OutViewPortFromRight"}},handleIsComplexPortrait=i=>i.portrait==="true"&&isTouchScreenPortrait()&&i.isGeneral!=="true"&&i.raw!=="true",isFullMobilePortrait=()=>{const{params:i,videoElementSizeInfo:e}=store.getState().videoData;return i.portrait!=="true"&&(+e.width.toFixed(0)===window.screen.width||+e.width.toFixed(0)===window.screen.availWidth)&&(window.screen.height>window.screen.width||window.screen.availHeight>window.screen.availWidth)},handleRippleCircle=(i,e)=>{const t=document.getElementById(e),n=document.createElement("span");n.style.width=n.style.height="50px",n.style.left=`${i.touches[0].clientX-t.offsetLeft-25}px`,n.style.top=`${i.touches[0].clientY-t.offsetTop-25}px`,n.classList.add("pl-ripple");const s=t.getElementsByClassName("pl-ripple")[0];s&&s.remove(),t.appendChild(n)},handleRipple=(i,e,t=50)=>{const n=i.clientX!==void 0?i.clientX:i.touches[0].clientX,s=i.clientY!==void 0?i.clientY:i.touches[0].clientY,r=document.getElementById(e),a=document.createElement("span");a.style.width=a.style.height=`${t}px`,a.style.left=`${n-t/2}px`,a.style.top=`${s-r.getBoundingClientRect().top-t/2}px`,a.classList.add("pl-ripple");const o=r.getElementsByClassName("pl-ripple")[0];o&&o.remove(),r.appendChild(a)},changeVideoUrl=(i,e)=>{const{params:t}=store.getState().videoData,n=findFirstVideoInRecommendationList(),s=i||n.type,r=e||n.id;if(conditions(ConditionName.hasSportProvider)){const a=window.location.href.split("?")[1];return a?`${window.location.origin}/ngpplayer/${s}/${r}?${a}`:`${window.location.origin}/ngpplayer/${s}/${r}`}else return window.location.href.replace(`type=${t.type}`,`type=${s}`).replace(`id=${t.id}`,`id=${r}`)},hasQuestionMark=i=>!!i.match(/\?/g),responseValidator=i=>i>=200&&i<300,generateNewAccessToken=async()=>{var i,e,t;if((i=authToken.get())!=null&&i.refresh){const{data:n,status:s}=await apiCaller({url:API().auth.refresh,method:"POST",data:{refresh:(e=authToken.get())==null?void 0:e.refresh}});if(responseValidator(s)){const r={access:n.access,refresh:(t=authToken.get())==null?void 0:t.refresh,token_id:n.token_id};authToken.set(r)}else throw authToken.remove(),new Error("")}},isWhiteListUrl=i=>!!whiteListTargets.find(e=>new URL(i).origin.includes(e)),handlePopoverSizeInMiniPlayer=()=>{const{videoElementSizeInfo:i}=store.getState().videoData;return conditions(ConditionName.isMiniPlayer)&&!conditions(ConditionName.isFullMobilePortrait)?{top:i.top,height:i.height,left:i.left}:{}},numbersToLetters=[translate().first,translate().second,translate().third,translate().fourth,translate().fifth,translate().sixth,translate().seventh,translate().eighth,translate().ninth,translate().tenth,translate().eleventh,translate().twelfth,translate().thirteenth,translate().fourteenth,translate().fifteenth,translate().sixteenth,translate().seventeenth,translate().eighteenth,translate().nineteenth,translate().twentieth],handleVideoType=()=>{const{params:i}=store.getState().videoData;switch(i.type){case"vod":return VideoNumberTypeEnum.Vod;case"archive":case"live":return VideoNumberTypeEnum.Archive;case"clip":return VideoNumberTypeEnum.Clip;default:return VideoNumberTypeEnum.FutureLive}},handleHasXTokenParamOrSendXToken=()=>{if(conditions(ConditionName.hasXTokenParamOrSendXToken))return{"x-token":store.getState().videoData.params.xToken}},handleGetBookmarkCategory=i=>{switch(i){case"film":return BookmarkCategory.FILM;case"sport":return BookmarkCategory.SPORT;default:return BookmarkCategory.FILM}};function getWebEnvConfig(i){const t=store.getState().videoData.webListConfig.find(n=>n.key===i);return t?t.value:""}const clearRedux=()=>{const i=store.dispatch;i(setClearVideoDataSlice()),i(setClearControllerSlice()),i(setClearUserSlice()),i(setClearTagsSlice()),i(setClearPopoversSlice()),i(setClearCommentsSlice()),i(setClearChatSlice())},weighted_random=i=>{let e,t=[];for(e=0;e<i.length;e++)t[e]=i[e].weight+(t[e-1]||0);let n=Math.random()*t[t.length-1];for(e=0;e<t.length&&!(t[e]>n);e++);return i[e].domain},imageFormatChecking=i=>["jpg","png","jpeg"].includes(i.toLowerCase().split(".")[i.toLowerCase().split(".").length-1]),handlePageLoadTime=i=>{let e=0;performance&&performance.getEntriesByType("navigation")&&(e=performance.getEntriesByType("navigation")[0].duration),i.current=e},highestResolutionSupported=(i,e,t)=>{const n=e*window.devicePixelRatio,s=t*window.devicePixelRatio;let r=[];return conditions(ConditionName.isTouchScreenPortrait)?r=i.filter(a=>Number(a.split("x")[0].trim())<=n):r=i.filter(a=>Number(a.split("x")[0].trim())<=s||Number(a.split("x")[1].trim())<=n),r.indexOf(r[r.length-1])},getSubtitleLabel=i=>{let e;switch(i){case"fa":e=translate().persian;break;case"en":e=translate().english;break;case"ar":e=translate().arabic;break;case"tr":e=translate().turkish;break}return e},strToObj=str=>{var obj={};if(str&&typeof str=="string"){var objStr=str.match(/\{(.)+\}/g);eval("obj ="+objStr)}return obj},hasPermissionToRedirect=i=>{const e=store.dispatch;if(e(setIsFetchDetails(!0)),i)try{const t=new URL(i);isWhiteListGeneralUrl(t.hostname,whiteListGeneralUrl)?e(setIsValidAddress(!0)):(e(setErrorType("404")),e(setIsValidAddress(!1)))}catch{e(setErrorType("404")),e(setIsValidAddress(!1))}};function isWhiteListGeneralUrl(i,e){for(let t=0;t<e.length;t++)if(i.startsWith(e[t]))return!0;return!1}const flattenObject=(i,e)=>{let t={};for(const n in i){const s=e?`${e}_${n}`:n;typeof i[n]=="object"&&!Array.isArray(i[n])?t={...t,...flattenObject(i[n],s)}:t[s]=i[n]}return t},findIntersectionBetweenTwoArray=(i,e)=>i.filter(t=>!e.includes(t)),sortLanguages=i=>{const e={fa:1,en:2};return i.slice().sort((t,n)=>{const s=e[t.lang]||999,r=e[n.lang]||999;return s-r})},hexToRGB=(i,e=1,t=!1)=>{const n=parseInt(i.slice(1,3),16),s=parseInt(i.slice(3,5),16),r=parseInt(i.slice(5,7),16);return t?`${n} ${s} ${r}`:e?"rgba("+n+", "+s+", "+r+", "+e+")":"rgb("+n+", "+s+", "+r+")"},checkIsOnPremise=i=>{const{params:e}=store.getState().videoData;return conditions(ConditionName.isOnPermise)?window.location.origin:e.baseUrl??i},handle360=async()=>{let i=!1;(window.DeviceOrientationEvent||window.DeviceMotionEvent)&&(i=await GyroControl.isAvailable());const e=new View360("#videoTagContainer",{zoomRange:{min:.35,max:3},initialZoom:.41,gyro:i});return e.on("inputStart",()=>store.dispatch(setIsViewChangeIn360(!0))),e.on("inputEnd",()=>store.dispatch(setIsViewChangeIn360(!1))),e.load(new EquirectProjection({src:videoTag(),video:{autoplay:!0}})),e},fullConfig=resolveConfig(config),getTailwindColor=i=>i.split(".").reduce((e,t)=>e==null?void 0:e[t],fullConfig.theme),sendFluentLog=i=>{const{poll_emoji:e}=store.getState().user.settings,{params:t,details:n}=store.getState().videoData;let s={...i,timestamp:Date.now(),clientUUID:getUUID(),uuid:getUUID(),link:window.location.href,user_id:conditions(ConditionName.isLiveParam)?Number(t.id):n.user_id,live_id:conditions(ConditionName.isLiveParam)?n.id:null,format:i.category==="feedback"?conditions(ConditionName.isStaticFormat)?"static":"hls":void 0,content_type:n.content_type,content_id:n.content_id};conditions(ConditionName.isLiveParam)&&(s[featureToggle]=e),apiCaller({url:API().logs,method:"post",data:s})};function errorLogProvider(i){i&&sendFluentLog(ExceptionsLog(i.type,i.message))}class ErrorBoundary extends React2.Component{constructor(){super(...arguments);Te(this,"state",{hasError:!1,error:null,errorInfo:null})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){this.setState({error:t,errorInfo:n}),console.log(t,n),errorLogProvider({type:"OTHER_ERROR",message:t.message})}render(){return this.state.hasError?jsxRuntime.jsx(jsxRuntime.Fragment,{}):this.props.children}}const useAppDispatch=()=>useDispatch(),useAppSelector=useSelector,useKeyPress=(i,e)=>{const t=React2.useRef(e);React2.useEffect(()=>{t.current=e},[]),React2.useEffect(()=>{const n=s=>{s.code===i&&!["INPUT","TEXTAREA"].includes(s.target.nodeName)&&!s.target.isContentEditable&&!conditions(ConditionName.showTagsPopover)&&!conditions(ConditionName.showPersonalMarkerPopover)&&!conditions(ConditionName.showFeedbackPopover)&&t.current(s)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[i])},useHandleKeyPress=()=>{const i=useAppDispatch();useKeyPress("Space",e=>{conditions(ConditionName.isPressKeySpace)&&handlePlayPause(e)}),useKeyPress("KeyK",e=>{conditions(ConditionName.isPressKeyK)&&handlePlayPause(e)}),useKeyPress("ArrowRight",e=>{conditions(ConditionName.isPressKeyArrowRight)&&conditions(ConditionName.hasTimeMachine)&&handleBackwardForward("forward",15,e)}),useKeyPress("ArrowLeft",e=>{conditions(ConditionName.isPressKeyArrowLeft)&&conditions(ConditionName.hasTimeMachine)&&handleBackwardForward("backward",15,e)}),useKeyPress("KeyI",()=>{conditions(ConditionName.isPressKeyI)&&videoTag().requestPictureInPicture()}),useKeyPress("KeyF",()=>{conditions(ConditionName.isPressKeyF)&&handleFullScreen()}),useKeyPress("KeyL",()=>{conditions(ConditionName.isPressKeyL)&&handleLock(conditions(ConditionName.isLock)?"unlock":"lock")}),useKeyPress("KeyC",()=>{conditions(ConditionName.isPressKeyC)&&handleSubtitle()}),useKeyPress("KeyN",()=>{conditions(ConditionName.isPressKeyN)&&(handleClickRecommendationCard(),handleClickVideoCard())}),useKeyPress("KeyQ",()=>{if(conditions(ConditionName.isPressKeyQ)){const{multiLivesPopover:e}=store.getState().popovers;i(setMultiLivesPopovers(!e))}}),useKeyPress("KeyE",()=>{if(conditions(ConditionName.isPressKeyE)){const{markersListPopover:e}=store.getState().popovers;i(setClearPopoversSlice()),i(setMarkersListPopover(!e)),conditions(ConditionName.isActiveElements)?conditions(ConditionName.showMarkerListPopover)||i(setActiveElements(!1)):i(setActiveElements(!0))}}),useKeyPress("KeyS",()=>{const{speedPopover:e}=store.getState().popovers;i(setClearPopoversSlice()),conditions(ConditionName.isPressKeyS)&&(i(setSpeedPopover(!e)),conditions(ConditionName.isActiveElements)?conditions(ConditionName.showSpeedPopover)||i(setActiveElements(!1)):i(setActiveElements(!0)))}),useKeyPress("KeyM",()=>{if(conditions(ConditionName.isPressKeyM)){const{settings:e}=store.getState().user;handleChangeSoundVolume(e.volume?0:50)}})},useColorSwitcher=()=>{const i=window.matchMedia("(prefers-color-scheme: light)"),e=localStorage.getItem("theme");i.addEventListener("change",function(n){n.matches?t(Theme.DARK):t(Theme.LIGHT)});const t=n=>{const s=window.document.documentElement;s.classList.remove(n===Theme.DARK?Theme.LIGHT:Theme.DARK),s.classList.add(n),localStorage.setItem("theme",n)};return React2.useEffect(()=>{e&&t("light")},[e]),null},useHandleParams=i=>{const e=useAppDispatch(),{token:t,params:n}=useAppSelector(({videoData:{token:E,params:F}})=>({token:E,params:F}),shallowEqual),{isClickInnerCard:s}=useAppSelector(({controller:{isClickInnerCard:E}})=>({isClickInnerCard:E}),shallowEqual),[r,a]=React2.useState([]),[o,l]=React2.useState([]);let d={};const f=async()=>{i.isAuth==="true"?t&&e(setIsReady(!0)):e(setIsReady(!0))},u=()=>e(setPlayerParams(d)),p=()=>{if(i.theme){const E=i.theme===Theme.LIGHT?Theme.LIGHT:Theme.DARK;e(setTheme(E)),d.theme=E}else window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(e(setTheme(Theme.DARK)),d.theme="dark"):(e(setTheme(Theme.LIGHT)),d.theme="light")},m=()=>{let E=d.featureSet;return typeof d.featureSet=="string"&&(E=strToObj(d.featureSet)),d.featureSet=E,d},g=()=>{i.uuid&&(localStorage.setItem("hamrahiUUID",i.uuid),d.uuid=i.uuid)},y=()=>{const E=api.get("xToken");E&&!d.xToken&&(d.xToken=E)},v=()=>{d={portrait:conditions(ConditionName.isTouchScreen)&&i.isGeneral!=="true"?"true":"false",provider:"unknown",chart:"true",authentication:"true",...i},e(setIsComplexDesktop(d.portrait==="true"&&!conditions(ConditionName.isTouchScreen))),e(setIsComplexPortrait(handleIsComplexPortrait({portrait:d.portrait,...i})))},b=()=>{const E=String(i["e-url"]),F=String(i["e-cover"]);d={src:E.endsWith("/")?window.atob(E.slice(0,-1)):window.atob(E),type:i.type,fullscreen:i.fullscreen,autoplay:i.autoplay,snapshot:i.snapshot,portrait:"false",fullrate:i.fullrate,width:i.width,height:i.height,cover:F&&F!=="undefined"?window.atob(F):void 0,onFinished:i.onFinished,onSnapshot:i.onSnapshot,uuid:getUUID()}},C=(E,F,O)=>{const A=Object.keys(E);let N=findIntersectionBetweenTwoArray(F,A),M=A.filter(Z=>findIntersectionBetweenTwoArray(findIntersectionBetweenTwoArray(allParams,F),O).includes(Z));return{requiredItems:N,notRequiredItems:M}},_=()=>{let E=[],F=[];return i.quiz==="true"?(E=quizConditions.required,F=quizConditions.optionals):i.raw==="true"?(E=rawConditions.required,F=rawConditions.optionals):i.isGeneral==="true"?(E=isGeneralConditions.required,F=isGeneralConditions.optionals):i.type==="mp4"?(E=staticConditions.required,F=staticConditions.optionals):["live","vod","archive","clip"].includes(String(i.type))&&(E=nonStaticConditions.required,F=nonStaticConditions.optionals),{requiredConditions:E,optionalsConditions:F}},R=async()=>{if(d={},Object.keys(i).includes("type")){const{requiredItems:E,notRequiredItems:F}=C(i,_().requiredConditions,_().optionalsConditions);l(F),E.length?a(E):(["live","vod","archive","clip"].includes(String(i.type))?(v(),y()):staticFormats(String(i.type))&&b(),g(),Object.keys(d)&&m(),p(),u(),f())}else a(["type"])};return React2.useLayoutEffect(()=>{n.id&&i.quiz!=="true"&&s&&(i={...n,homeButtonClickFlag:i.homeButtonClickFlag},R())},[n.id]),React2.useLayoutEffect(()=>{R()},[i,t,s]),{requiredItems:r,notRequiredItems:o}},StaticPlayer=React2.lazy(()=>Promise.resolve().then(()=>player$1)),LiveAndVodPlayer$1=React2.lazy(()=>Promise.resolve().then(()=>player)),ParamsErrorPopover$1=React2.lazy(()=>Promise.resolve().then(()=>paramsErrorPopover)),VideoPlayer$2=({params:i})=>{const e=useAppDispatch();useAppSelector(({controller:{isFullScreen:a}})=>({isFullScreen:a}),shallowEqual),useAppSelector(({videoData:{isReady:a,params:o,isComplexPortrait:l}})=>({isReady:a,params:o,isComplexPortrait:l}),shallowEqual);const{requiredItems:t,notRequiredItems:n}=useHandleParams(i);useHandleKeyPress(),useColorSwitcher(),React2.useEffect(()=>(e(setIsClickInnerCard(!1)),()=>clearRedux()),[]),React2.useEffect(()=>{const a=localStorage.getItem("isAutoPlay");a&&e(setIsAutoPlay(a==="true")),Document.prototype.playPause=o=>handlePlayPauseInDOM(o),conditions(ConditionName.isIOS)||window.screen.orientation.addEventListener("change",o=>{!conditions(ConditionName.isFullScreen)&&conditions(ConditionName.isParamsPortrait)&&e(setIsComplexPortrait(!0));const l=document.getElementById("video-player-module");l&&(o.target.type.includes("landscape")&&!conditions(ConditionName.isFullScreen)?(l.classList.add("pl-overflow-scroll"),l.classList.remove("pl-overflow-hidden")):(l.classList.add("pl-overflow-hidden"),l.classList.remove("pl-overflow-scroll")))})},[]);const s=()=>{let a="";return conditions(ConditionName.isParamsPortrait)?window.innerWidth>window.innerHeight&&conditions(ConditionName.isFullScreen)?a="pl-overflow-hidden":window.innerWidth>window.innerHeight&&!conditions(ConditionName.isFullScreen)?a="pl-overflow-auto":window.innerWidth<window.innerHeight&&(a="pl-overflow-hidden"):a="pl-overflow-hidden",a};let r=jsxRuntime.jsx(jsxRuntime.Fragment,{});return t.length||n.length||!conditions(ConditionName.hasAllParams)?r=jsxRuntime.jsx(React2.Suspense,{fallback:"",children:jsxRuntime.jsx(ParamsErrorPopover$1,{requiredItems:t,notRequiredItems:n})}):conditions(ConditionName.isReady)?r=jsxRuntime.jsx("div",{className:`video-player-container ${s()} ${conditions(ConditionName.isComplexPortrait)&&"!no-scrollbar pl-max-h-[100dvh]"} ${conditions(ConditionName.isFullScreen)&&"pl-fixed pl-right-0 pl-top-0 pl-h-screen pl-w-screen !pl-overflow-hidden"}`,style:{zIndex:zIndex.videoPlayerInFullScreen,touchAction:"pan-y"},id:"video-player-module",children:jsxRuntime.jsx(React2.Suspense,{fallback:"",children:conditions(ConditionName.isStaticFormat)?jsxRuntime.jsx(StaticPlayer,{}):jsxRuntime.jsx(LiveAndVodPlayer$1,{})})}):r=jsxRuntime.jsx("div",{className:"!pl-aspect-video pl-max-h-screen pl-w-full pl-overflow-hidden pl-bg-white dark:pl-bg-black"}),jsxRuntime.jsxs(ErrorBoundary,{children:[jsxRuntime.jsx(nt,{position:"bottom-right",autoClose:3e3,theme:conditions(ConditionName.isDarkMode)?"dark":"light"}),r]})};var dist={},hasRequiredDist;function requireDist(){if(hasRequiredDist)return dist;hasRequiredDist=1,Object.defineProperty(dist,"__esModule",{value:!0}),dist.parse=a,dist.serialize=d;const i=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,t=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,s=Object.prototype.toString,r=(()=>{const p=function(){};return p.prototype=Object.create(null),p})();function a(p,m){const g=new r,y=p.length;if(y<2)return g;const v=(m==null?void 0:m.decode)||f;let b=0;do{const C=p.indexOf("=",b);if(C===-1)break;const _=p.indexOf(";",b),R=_===-1?y:_;if(C>R){b=p.lastIndexOf(";",C-1)+1;continue}const E=o(p,b,C),F=l(p,C,E),O=p.slice(E,F);if(g[O]===void 0){let A=o(p,C+1,R),N=l(p,R,A);const M=v(p.slice(A,N));g[O]=M}b=R+1}while(b<y);return g}function o(p,m,g){do{const y=p.charCodeAt(m);if(y!==32&&y!==9)return m}while(++m<g);return g}function l(p,m,g){for(;m>g;){const y=p.charCodeAt(--m);if(y!==32&&y!==9)return m+1}return g}function d(p,m,g){const y=(g==null?void 0:g.encode)||encodeURIComponent;if(!i.test(p))throw new TypeError(`argument name is invalid: ${p}`);const v=y(m);if(!e.test(v))throw new TypeError(`argument val is invalid: ${m}`);let b=p+"="+v;if(!g)return b;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);b+="; Max-Age="+g.maxAge}if(g.domain){if(!t.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);b+="; Domain="+g.domain}if(g.path){if(!n.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);b+="; Path="+g.path}if(g.expires){if(!u(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);b+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(b+="; HttpOnly"),g.secure&&(b+="; Secure"),g.partitioned&&(b+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":b+="; Priority=Low";break;case"medium":b+="; Priority=Medium";break;case"high":b+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":b+="; SameSite=Strict";break;case"lax":b+="; SameSite=Lax";break;case"none":b+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return b}function f(p){if(p.indexOf("%")===-1)return p;try{return decodeURIComponent(p)}catch{return p}}function u(p){return s.call(p)==="[object Date]"}return dist}requireDist();/**
79
+ attribute vec3 position;attribute vec2 uv;uniform mat4 uMVMatrix;uniform mat4 uPMatrix;uniform vec4 uTexScaleOffset[2];uniform float uEye;varying highp vec2 vUV;void main(){vec4 scaleOffset=uTexScaleOffset[int(uEye)];vUV=uv.xy*scaleOffset.xy+scaleOffset.zw;gl_Position=uPMatrix*uMVMatrix*vec4(position,1.0);}`;class StereoEquiProjection extends Projection{constructor(e){super(e),this._mode=e.mode}createMesh(e,t){let n,s;switch(this._mode){case StereoEquiProjection.MODE.LEFT_RIGHT:n=[.5,1,0,0],s=[.5,1,.5,0];break;default:n=[1,.5,0,0],s=[1,.5,0,.5]}const r={uTexture:new UniformTexture2D(e,t),uEye:new UniformFloat(0),uTexScaleOffset:new UniformVector4Array([n,s])},a=new SphereGeometry,o=new ShaderProgram(e,vs,fs$2,r),l=e.createVAO(a,o);return new TriangleMesh(l,o)}}StereoEquiProjection.MODE={LEFT_RIGHT:"left_right",TOP_BOTTOM:"top_bottom"};const ar={save:"يحفظ",addPersonalMarker:"أضف علامة شخصية",editPersonalMarker:"تحرير العلامة الشخصية",pleaseSelectMarker:"الرجاء تحديد علامة.",pleaseEnterMarkerName:"الرجاء إدخال اسم العلامة.",maxLengthMarkerName:"يجب ألا يتجاوز طول اسم المؤشر 256 حرفًا.",successAddMarker:"تمت إضافة العلامة بنجاح.",successEditMarker:"تم تحرير العلامة بنجاح.",errorRegisteringTwoMarker:"خطأ في تسجيل علامتين في نفس الوقت.",pleaseLoginFirst:"الرجاء تسجيل الدخول أولا",addMarker:"أضف علامة",markerName:"اسم العلامة",description:"وصف",pleaseEnterMarkerDescription:"أدخل وصفًا للعلامة.",cancel:"انسحب",nextIn:"التالي في",play:"يلعب",visit:"يزور",clickForMoreVideos:"انقر لمزيد من أشرطة الفيديو",hour:"ساعة",minutes:"دقائق",seconds:"ثانیه",currentlyNoItemsSaved:"لا يوجد حاليا أي عناصر محفوظة.",savedList:"القائمة المحفوظة",enterYourOpinion:"أدخل رأيك",notPossibleRegisterComment:"حاليا، ليس من الممكن تسجيل تعليق.",youMustSubmitYourComment:"يجب عليك تقديم تعليقك",notPossibleToRegisterComment:"حاليا، ليس من الممكن تسجيل تعليق.",comeIn:"ادخل",sharing:"مشاركة",recordFeedback:"سجل ردود الفعل",cinematicFilm:"فيلم سينمائي",serial:"مسلسل",subtitle:"الترجمة",translation:"مزدوج",persian:"الفارسية",english:"إنجليزي",arabic:"عربي",turkish:"تركي",playlist:"قائمة التشغيل",playlists:"قوائم التشغيل",showPlaylist:"عرض قائمة التشغيل",suggestedVideos:"الفيديوهات المقترحة",become:"يصبح.",production:"إنتاج",viewPoint:"وجهة نظر",show:"يعرض",saved:"أنقذ",home:"بيت",profile:"حساب تعريفي",previousViewingTime:"وقت المشاهدة السابق",continuousPlaybackText:'سيتم تشغيل الفيديو الخاص بك من وقت المشاهدة السابق. إذا كنت تريد تشغيل الفيديو من البداية، فاختر خيار "مشاهدة الفيديو من البداية".',watchContinuousVideo:"شاهد بقية الفيديو",watchCBeginningVideo:"شاهد الفيديو من البداية",takingPicture:"التقاط الصور",liveChat:"الدردشة الحية",hideLiveChat:"إخفاء الدردشة المباشرة",showLiveChat:"عرض الدردشة الحية",anonymousUser:"مستخدم مجهول",awaitingApprovalByAdmin:"في انتظار موافقة المشرف",approvedByAdmin:"تمت الموافقة عليه من قبل المشرف",closeMessage:"أغلق الرسالة",viewFullPinnedMessage:"عرض الرسالة المثبتة كاملة",pinnedMessage:"رسالة مثبتة",less:"أقل",more:"أكثر",copyLink:"انسخ الرابط",linkWasCopied:"تم نسخ الرابط",download:"تحميل",withQuality:"مع الجودة",selectDownloadQuality:"حدد جودة التنزيل",badSoundAndImageQuality:"جودة الصوت والصورة سيئة",streamLinkFailure:"فشل رابط الدفق",amountOfInternetUsageWasHigh:"كان مقدار استخدام الإنترنت مرتفعًا",programAppearance:"مظهر البرنامج",soundAndImageMismatch:"عدم تطابق الصوت والصورة",noSubtitle:"لا ترجمات",noSubtitle1:"لا ترجمات",accessForMeDifficult:"كان من الصعب بالنسبة لي الوصول إليه",videoContentWasNotGood:"محتوى الفيديو لم يكن جيداً",goodSoundAndImageQuality:"جودة صوت وصورة جيدة",noDisconnection:"لا يوجد انقطاع",amountOfInternetUsage:"حجم استخدام الانترنت",privacyProtection:"حماية الخصوصية",farsiSubtitles:"ترجمات فارسية",easyAccess:"سهولة الوصول",appropriateVideoContent:"محتوى الفيديو المناسب",veryBad:"سيئة للغاية",bad:"سيء",middle:"متوسط",good:"جيد",veryGood:"جيد جدًا",successfullyCommentSubmit:"لقد تم تسجيل تعليقك بنجاح.",ratingZarebin:"",fullRateInternetTraffic:"يتم احتساب حركة المرور الخاصة بك على الإنترنت بالسعر الكامل.",exitFrom:"خروج از",fullScreen:"صفحة كاملة",lock:"قفل",markersList:"قائمة المؤشرات",markers:"نشانگرها",languageSelection:"اختيار اللغة",default:"تقصير",retry:"حاول ثانية",pictureInPicture:"صورة في صورة",video:"فيديو",season:"موسم",section:"جزء",playNextVideo:"قم بتشغيل الفيديو التالي",replay:"اعادتها",pause:"قف",quality:"جودة",automatic:"تلقائي",basedOnYourInternetSpeed:"على أساس سرعة الإنترنت لديك",settings:"إعدادات",choiceQuality:"اختيار الجودة",subtitleSettings:"إعدادات الترجمة",jumpTo:"القفز الى",mute:"صامت",unmute:"مع الصوت",playBackSpeed:"سرعة التشغيل",normalSpeed:"السرعة العادية",subtitleBackgroundColor:"لون خلفية الترجمة",subtitleTextColor:"لون نص الترجمة",subtitleSelection:"اختيار الترجمة",selectSubtitleBackgroundColor:"حدد لون الخلفية للترجمة",selectSubtitleTextColor:"اختر لون نص الترجمة",tagFilter:"مرشح العلامة",tags:"العلامات",separateItemsWithEnter:"افصل العناصر باستخدام Enter",contentType:"نوع المحتوى",search:"يبحث",accordingThisTagVideoNotFound:"حسب العلامة المطلوبة لم يتم العثور على الفيديو!",autoPlay:"اللعب التلقائي",bright:"ساطع",off:"عن",is:"يكون",photo:"صورة",currentlyNoVideoContent:"لا يوجد حاليا أي محتوى فيديو على هذه القناة لهذا البث المباشر.",viewOtherVideos:"يمكنك مشاهدة عمليات البث المباشر الأخرى أو التحقق من جدول البث المباشر المستقبلي لقناتك المطلوبة",enteredAddressNotCorrect:"العنوان الذي تم إدخاله غير صحيح.",first:"أولاً",second:"ثانية",third:"ثالث",fourth:"الرابع",fifth:"الخامس",sixth:"السادس",seventh:"السابع",eighth:"الثامن",ninth:"التاسع",tenth:"العاشر",eleventh:"الحادي عشر",twelfth:"الثاني عشر",thirteenth:"الثالث عشر",fourteenth:"الرابع عشر",fifteenth:"الخامس عشر",sixteenth:"السادس عشر",seventeenth:"السابع عشر",eighteenth:"الثامن عشر",nineteenth:"التاسع عشر",twentieth:"العشرين"},en={save:"Save",addPersonalMarker:"Add Marker",editPersonalMarker:"Edit Marker",pleaseSelectMarker:"Please select a marker.",pleaseEnterMarkerName:"Enter a marker name.",maxLengthMarkerName:"Marker name can’t exceed 256 characters.",successAddMarker:"Marker added successfully.",successEditMarker:"Marker updated successfully.",errorRegisteringTwoMarker:"Could not register marker.",pleaseLoginFirst:"Please log in first.",addMarker:"Add Marker",markerName:"Marker Name",description:"Description",pleaseEnterMarkerDescription:"Enter marker description.",cancel:"Cancel",nextIn:"Next in",play:"Play",visit:"Visit",clickForMoreVideos:"Click for more videos",hour:"Hour",minutes:"Minutes",seconds:"Seconds",currentlyNoItemsSaved:"No saved items yet.",savedList:"Saved List",enterYourOpinion:"Write your comment",notPossibleRegisterComment:"Comments are disabled right now.",youMustSubmitYourComment:"Please log in to comment.",notPossibleToRegisterComment:"Comments are disabled right now.",comeIn:"Login",sharing:"Share",recordFeedback:"Send Feedback",cinematicFilm:"Movie",serial:"Series",subtitle:"Subtitles",translation:"Dubbed",persian:"Persian",english:"English",arabic:"Arabic",turkish:"Turkish",playlist:"Playlist",playlists:"Playlists",showPlaylist:"Show Playlist",suggestedVideos:"Suggested Videos",become:"Become",production:"Production",viewPoint:"Viewpoint",show:"Show",saved:"Saved",home:"Home",profile:"Profile",previousViewingTime:"Last watched time",continuousPlaybackText:"Your video will continue from where you left off. To start from the beginning, choose 'Watch from start'.",watchContinuousVideo:"Continue Watching",watchCBeginningVideo:"Watch from Start",takingPicture:"Take Screenshot",liveChat:"Live Chat",hideLiveChat:"Hide Chat",showLiveChat:"Show Chat",anonymousUser:"Guest User",awaitingApprovalByAdmin:"Pending admin approval",approvedByAdmin:"Approved",closeMessage:"Close",viewFullPinnedMessage:"View full pinned message",pinnedMessage:"Pinned Message",less:"Show less",more:"Show more",copyLink:"Copy Link",linkWasCopied:"Link copied!",download:"Download",withQuality:"Quality",selectDownloadQuality:"Choose download quality",badSoundAndImageQuality:"Poor audio/video quality",streamLinkFailure:"Stream link error",amountOfInternetUsageWasHigh:"High data usage",programAppearance:"App appearance",soundAndImageMismatch:"Audio out of sync",noSubtitle:"No subtitles",noSubtitle1:"Without subtitles",accessForMeDifficult:"Hard to access",videoContentWasNotGood:"Video content wasn’t good",goodSoundAndImageQuality:"Good audio/video quality",noDisconnection:"No interruptions",amountOfInternetUsage:"Data usage",privacyProtection:"Privacy protection",farsiSubtitles:"Persian subtitles",easyAccess:"Easy access",appropriateVideoContent:"Appropriate content",veryBad:"Very Bad",bad:"Bad",middle:"Average",good:"Good",veryGood:"Very Good",successfullyCommentSubmit:"Comment submitted successfully.",ratingZarebin:"Rate Zarebin",fullRateInternetTraffic:"Internet usage will be counted fully.",exitFrom:"Exit",fullScreen:"Fullscreen",lock:"Lock",markersList:"Markers List",markers:"Markers",languageSelection:"Language",default:"Default",retry:"Retry",pictureInPicture:"Picture-in-Picture",video:"Video",season:"Season",section:"Episode",playNextVideo:"Play Next Video",replay:"Replay",pause:"Pause",quality:"Quality",automatic:"Auto",basedOnYourInternetSpeed:"Based on your internet speed",settings:"Settings",choiceQuality:"Select Quality",subtitleSettings:"Subtitle Settings",jumpTo:"Skip to",mute:"Mute",unmute:"Unmute",playBackSpeed:"Playback Speed",normalSpeed:"Normal",subtitleBackgroundColor:"Subtitle Background",subtitleTextColor:"Subtitle Text Color",subtitleSelection:"Select Subtitle",selectSubtitleBackgroundColor:"Choose subtitle background",selectSubtitleTextColor:"Choose subtitle text color",tagFilter:"Tag Filter",tags:"Tags",separateItemsWithEnter:"Separate items with Enter",contentType:"Content Type",search:"Search",accordingThisTagVideoNotFound:"No video found for this tag!",autoPlay:"Autoplay",bright:"Light",off:"Off",is:"is",photo:"Photo",currentlyNoVideoContent:"No video content available for this live stream.",viewOtherVideos:"You can check other live streams or upcoming schedules.",enteredAddressNotCorrect:"The entered address is invalid.",first:"First",second:"Second",third:"Third",fourth:"Fourth",fifth:"Fifth",sixth:"Sixth",seventh:"Seventh",eighth:"Eighth",ninth:"Ninth",tenth:"Tenth",eleventh:"Eleventh",twelfth:"Twelfth",thirteenth:"Thirteenth",fourteenth:"Fourteenth",fifteenth:"Fifteenth",sixteenth:"Sixteenth",seventeenth:"Seventeenth",eighteenth:"Eighteenth",nineteenth:"Nineteenth",twentieth:"Twentieth"},fa={save:"ذخیره",addPersonalMarker:"افزودن نشانگر شخصی",editPersonalMarker:"ویرایش نشانگر شخصی",pleaseSelectMarker:"لطفا یک نشانگر انتخاب نمایید.",pleaseEnterMarkerName:"لطفا نام نشانگر را وارد کنید.",maxLengthMarkerName:"اندازه نام نشانگر نباید بیش از 256 حرف باشد.",successAddMarker:"نشانگر با موفقیت اضافه شد.",successEditMarker:"نشانگر با موفقیت ویرایش شد.",errorRegisteringTwoMarker:"نشانگر با موفقیت ویرایش شد.",pleaseLoginFirst:"لطفا ابتدا وارد شوید.",addMarker:"افزودن نشانگر",markerName:"نام نشانگر",description:"توضیحات",pleaseEnterMarkerDescription:"توضیحات مربوط به نشانگر را وارد کنید.",cancel:"انصراف",nextIn:"بعدی در",play:"پخش",visit:"بازدید",clickForMoreVideos:"ویدیوهای بیشتر کلیک کنید",hour:"ساعت",minutes:"دقیقه",seconds:"ثانیه",currentlyNoItemsSaved:"در حال حاضر هیچ آیتمی ذخیره نشده است.",savedList:"لیست ذخیره‌شده‌ها",enterYourOpinion:"دیدگاه خود را وارد کنید",notPossibleRegisterComment:"در حال حاضر امکان ثبت دیدگاه وجود ندارد.",youMustSubmitYourComment:"شما برای ارسال دیدگاه خود باید",notPossibleToRegisterComment:"در حال حاضر امکان ثبت دیدگاه وجود ندارد.",comeIn:"وارد",sharing:"اشتراک گذاری",recordFeedback:"ثبت بازخورد",cinematicFilm:"فیلم سینمایی",serial:"سریال",subtitle:"زیرنویس",translation:"دوبله",persian:"فارسی",english:"انگلیسی",arabic:"عربی",turkish:"ترکی",playlist:"لیست پخش",playlists:"لیست‌های پخش",showPlaylist:"نمایش لیست‌پخش",suggestedVideos:"ویدیوهای پیشنهادی",become:"شوید.",production:"تولید",viewPoint:"دیدگاه",show:"نمایش",saved:"ذخیره‌شده‌ها",home:"خانه",profile:"پروفایل",previousViewingTime:"زمان مشاهده قبلی",continuousPlaybackText:"ویدیو شما از زمان مشاهده قبلی پخش خواهد شد. در صورت تمایل به پخش ویدیو از ابتدا گزینه “تماشای ویدیو از ابتدا” را انتخاب کنید",watchContinuousVideo:"تماشای ادامه ویدیو",watchCBeginningVideo:"تماشای ویدیو از ابتدا",takingPicture:"عکس گرفتن",liveChat:"گفت‌وگوی زنده",hideLiveChat:"مخفی کردن گفتگوی زنده",showLiveChat:"نمایش گفتگوی زنده",anonymousUser:"کاربر ناشناس",awaitingApprovalByAdmin:"در انتظار تایید توسط ادمین",approvedByAdmin:"تایید شده توسط ادمین",closeMessage:"بستن پیام",viewFullPinnedMessage:"مشاهده کامل پیام پین شده",pinnedMessage:"پیام پین شده",less:"کمتر",more:"بیشتر",copyLink:"کپی لینک",linkWasCopied:"لینک کپی شد",download:"دانلود",withQuality:"با کیفیت",selectDownloadQuality:"انتخاب کیفیت دانلود",badSoundAndImageQuality:"کیفیت بد صدا و تصویر",streamLinkFailure:"خرابی لینک استریم",amountOfInternetUsageWasHigh:"حجم مصرفی اینترنت زیاد بود",programAppearance:"ظاهر برنامه",soundAndImageMismatch:"عدم تطابق صدا و تصویر",noSubtitle:"نداشتن زیرنویس",noSubtitle1:"بدون زیرنویس",accessForMeDifficult:"دسترسی برام سخت بود",videoContentWasNotGood:"محتوای ویدیو خوب نبود",goodSoundAndImageQuality:"کیفیت خوب صدا و تصویر",noDisconnection:"بدون قطع و وصلی",amountOfInternetUsage:"میزان حجم مصرفی اینترنت",privacyProtection:"حفظ حریم شخصی",farsiSubtitles:"زیرنویس فارسی",easyAccess:"دسترسی آسان",appropriateVideoContent:"محتوای مناسب ویدیو",veryBad:"خیلی بد",bad:"بد",middle:"متوسط",good:"خوب",veryGood:"خیلی خوب",successfullyCommentSubmit:"نظر شما با موفقیت ثبت شد.",ratingZarebin:"امتیاز دادن به ذره بین",fullRateInternetTraffic:"ترافیک اینترنت شما تمام بها محاسبه می‌شود.",exitFrom:"خروج از",fullScreen:"تمام صفحه",lock:"قفل",markersList:"لیست نشانگرها",markers:"نشانگرها",languageSelection:"انتخاب زبان",default:"پیش فرض",retry:"تلاش مجدد",pictureInPicture:"تصویر در تصویر",video:"ویدیو",season:"فصل",section:"قسمت",playNextVideo:"پخش ویدیوی بعدی ",replay:"بازپخش",pause:"توقف",quality:"کیفیت",automatic:"خودکار",basedOnYourInternetSpeed:"بر اساس سرعت اینترنت شما",settings:"تنظیمات",choiceQuality:"انتخاب کیفیت",subtitleSettings:"تنظیمات زیرنویس",jumpTo:"پرش به",mute:"بی صدا",unmute:"با صدا",playBackSpeed:"سرعت پخش",normalSpeed:"سرعت معمولی",subtitleBackgroundColor:"رنگ پس زمینه زیرنویس",subtitleTextColor:"رنگ متن زیرنویس",subtitleSelection:"انتخاب زیرنویس",selectSubtitleBackgroundColor:"انتخاب رنگ پس زمینه زیرنویس",selectSubtitleTextColor:"انتخاب رنگ متن زیرنویس",tagFilter:"فیلتر تگ",tags:"تگ ها",separateItemsWithEnter:"آیتم ها را با Enter از هم جدا کنید",contentType:"نوع محتوا",search:"جستجو",accordingThisTagVideoNotFound:"با توجه به تگ مورد نظر ویدیویی یافت نشد!",autoPlay:"پخش خودکار",bright:"روشن",off:"خاموش",is:"است",photo:"عکس",currentlyNoVideoContent:"در حال حاضر محتوای ویدیویی در این کانال برای این پخش‌زنده وجود ندارد.",viewOtherVideos:"شما می‌توانید سایر پخش زنده های ما را مشاهده کنید یا برنامه پخش زنده‌های آینده کانال مورد نظر خود را چک کنید",enteredAddressNotCorrect:"آدرس وارد شده صحیح نیست.",first:"اول",second:"دوم",third:"سوم",fourth:"چهارم",fifth:"پنجم",sixth:"ششم",seventh:"هفتم",eighth:"هشتم",ninth:"نهم",tenth:"دهم",eleventh:"یازدهم",twelfth:"دوازدهم",thirteenth:"سیزدهم",fourteenth:"چهاردهم",fifteenth:"پانزدهم",sixteenth:"شانزدهم",seventeenth:"هفدهم",eighteenth:"هجدهم",nineteenth:"نوزدهم",twentieth:"بیستم"},translate=()=>{const{params:i}=store.getState().videoData;return i.lang===Lang.en?en:i.lang===Lang.ar?ar:fa},PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0",PACKET_TYPES.close="1",PACKET_TYPES.ping="2",PACKET_TYPES.pong="3",PACKET_TYPES.message="4",PACKET_TYPES.upgrade="5",PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(i=>{PACKET_TYPES_REVERSE[PACKET_TYPES[i]]=i});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,encodePacket=({type:i,data:e},t,n)=>withNativeBlob$1&&e instanceof Blob?t?n(e):encodeBlobAsBase64(e,n):withNativeArrayBuffer$2&&(e instanceof ArrayBuffer||isView$1(e))?t?n(e):encodeBlobAsBase64(new Blob([e]),n):n(PACKET_TYPES[i]+(e||"")),encodeBlobAsBase64=(i,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(i)};function toArray(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(i,e){if(withNativeBlob$1&&i.data instanceof Blob)return i.data.arrayBuffer().then(toArray).then(e);if(withNativeArrayBuffer$2&&(i.data instanceof ArrayBuffer||isView$1(i.data)))return e(toArray(i.data));encodePacket(i,!1,t=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),e(TEXT_ENCODER.encode(t))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<chars.length;i++)lookup$1[chars.charCodeAt(i)]=i;const decode$1=i=>{let e=i.length*.75,t=i.length,n,s=0,r,a,o,l;i[i.length-1]==="="&&(e--,i[i.length-2]==="="&&e--);const d=new ArrayBuffer(e),f=new Uint8Array(d);for(n=0;n<t;n+=4)r=lookup$1[i.charCodeAt(n)],a=lookup$1[i.charCodeAt(n+1)],o=lookup$1[i.charCodeAt(n+2)],l=lookup$1[i.charCodeAt(n+3)],f[s++]=r<<2|a>>4,f[s++]=(a&15)<<4|o>>2,f[s++]=(o&3)<<6|l&63;return d},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(i,e)=>{if(typeof i!="string")return{type:"message",data:mapBinary(i,e)};const t=i.charAt(0);return t==="b"?{type:"message",data:decodeBase64Packet(i.substring(1),e)}:PACKET_TYPES_REVERSE[t]?i.length>1?{type:PACKET_TYPES_REVERSE[t],data:i.substring(1)}:{type:PACKET_TYPES_REVERSE[t]}:ERROR_PACKET},decodeBase64Packet=(i,e)=>{if(withNativeArrayBuffer$1){const t=decode$1(i);return mapBinary(t,e)}else return{base64:!0,data:i}},mapBinary=(i,e)=>{switch(e){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},SEPARATOR="",encodePayload=(i,e)=>{const t=i.length,n=new Array(t);let s=0;i.forEach((r,a)=>{encodePacket(r,!1,o=>{n[a]=o,++s===t&&e(n.join(SEPARATOR))})})},decodePayload=(i,e)=>{const t=i.split(SEPARATOR),n=[];for(let s=0;s<t.length;s++){const r=decodePacket(t[s],e);if(n.push(r),r.type==="error")break}return n};function createPacketEncoderStream(){return new TransformStream({transform(i,e){encodePacketToBinary(i,t=>{const n=t.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const r=new DataView(s.buffer);r.setUint8(0,126),r.setUint16(1,n)}else{s=new Uint8Array(9);const r=new DataView(s.buffer);r.setUint8(0,127),r.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}let TEXT_DECODER;function totalLength(i){return i.reduce((e,t)=>e+t.length,0)}function concatChunks(i,e){if(i[0].length===e)return i.shift();const t=new Uint8Array(e);let n=0;for(let s=0;s<e;s++)t[s]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function createPacketDecoderStream(i,e){TEXT_DECODER||(TEXT_DECODER=new TextDecoder);const t=[];let n=0,s=-1,r=!1;return new TransformStream({transform(a,o){for(t.push(a);;){if(n===0){if(totalLength(t)<1)break;const l=concatChunks(t,1);r=(l[0]&128)===128,s=l[0]&127,s<126?n=3:s===126?n=1:n=2}else if(n===1){if(totalLength(t)<2)break;const l=concatChunks(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),n=3}else if(n===2){if(totalLength(t)<8)break;const l=concatChunks(t,8),d=new DataView(l.buffer,l.byteOffset,l.length),f=d.getUint32(0);if(f>Math.pow(2,21)-1){o.enqueue(ERROR_PACKET);break}s=f*Math.pow(2,32)+d.getUint32(4),n=3}else{if(totalLength(t)<s)break;const l=concatChunks(t,s);o.enqueue(decodePacket(r?l:TEXT_DECODER.decode(l),e)),n=0}if(s===0||s>i){o.enqueue(ERROR_PACKET);break}}}})}const protocol$1=4;function Emitter(i){if(i)return mixin(i)}function mixin(i){for(var e in Emitter.prototype)i[e]=Emitter.prototype[e];return i}Emitter.prototype.on=Emitter.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this},Emitter.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this},Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,s=0;s<t.length;s++)if(n=t[s],n===e||n.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+i],this},Emitter.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,s=t.length;n<s;++n)t[n].apply(this,e)}return this},Emitter.prototype.emitReserved=Emitter.prototype.emit,Emitter.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]},Emitter.prototype.hasListeners=function(i){return!!this.listeners(i).length};const nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),defaultBinaryType="arraybuffer";function createCookieJar(){}function pick(i,...e){return e.reduce((t,n)=>(i.hasOwnProperty(n)&&(t[n]=i[n]),t),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(i,e){e.useNativeTimers?(i.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),i.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(i.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),i.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(i){return typeof i=="string"?utf8Length(i):Math.ceil((i.byteLength||i.size)*BASE64_OVERHEAD)}function utf8Length(i){let e=0,t=0;for(let n=0,s=i.length;n<s;n++)e=i.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function randomString(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode(i){let e="";for(let t in i)i.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(i[t]));return e}function decode(i){let e={},t=i.split("&");for(let n=0,s=t.length;n<s;n++){let r=t[n].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}class TransportError extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Transport extends Emitter{constructor(e){super(),this.writable=!1,installTimerFunctions(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new TransportError(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=decodePacket(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=encode(e);return t.length?"?"+t:""}}class Polling extends Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};decodePayload(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,encodePayload(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=randomString()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let value=!1;try{value=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(i){}const hasCORS=value;function empty(){}class BaseXHR extends Polling{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(s,r)=>{this.onError("xhr post error",s,r)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}let Request$1=class Ft extends Emitter{constructor(e,t,n){super(),this.createRequest=e,installTimerFunctions(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=pick(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Ft.requestsCount++,Ft.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=empty,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ft.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};if(Request$1.requestsCount=0,Request$1.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const i="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(i,unloadHandler,!1)}}function unloadHandler(){for(let i in Request$1.requests)Request$1.requests.hasOwnProperty(i)&&Request$1.requests[i].abort()}const hasXHR2=function(){const i=newRequest({xdomain:!1});return i&&i.responseType!==null}();class XHR extends BaseXHR{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=hasXHR2&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Request$1(newRequest,this.uri(),e)}}function newRequest(i){const e=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||hasCORS))return new XMLHttpRequest}catch{}if(!e)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class BaseWS extends Transport{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],s=t===e.length-1;encodePacket(n,this.supportsBinary,r=>{try{this.doWrite(n,r)}catch{}s&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=randomString()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;class WS extends BaseWS{createSocket(e,t,n){return isReactNative?new WebSocketCtor(e,t,n):t?new WebSocketCtor(e,t):new WebSocketCtor(e)}doWrite(e,t){this.ws.send(t)}}class WT extends Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),s=createPacketEncoderStream();s.readable.pipeTo(e.writable),this._writer=s.writable.getWriter();const r=()=>{n.read().then(({done:o,value:l})=>{o||(this.onPacket(l),r())}).catch(o=>{})};r();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],s=t===e.length-1;this._writer.write(n).then(()=>{s&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const transports={websocket:WS,webtransport:WT,polling:XHR},re=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse$1(i){if(i.length>8e3)throw"URI too long";const e=i,t=i.indexOf("["),n=i.indexOf("]");t!=-1&&n!=-1&&(i=i.substring(0,t)+i.substring(t,n).replace(/:/g,";")+i.substring(n,i.length));let s=re.exec(i||""),r={},a=14;for(;a--;)r[parts[a]]=s[a]||"";return t!=-1&&n!=-1&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=pathNames(r,r.path),r.queryKey=queryKey(r,r.query),r}function pathNames(i,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function queryKey(i,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,r){s&&(t[s]=r)}),t}const withEventListeners=typeof addEventListener=="function"&&typeof removeEventListener=="function",OFFLINE_EVENT_LISTENERS=[];withEventListeners&&addEventListener("offline",()=>{OFFLINE_EVENT_LISTENERS.forEach(i=>i())},!1);class SocketWithoutUpgrade extends Emitter{constructor(e,t){if(super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=parse$1(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=parse$1(t.host).host);installTimerFunctions(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const s=n.prototype.name;this.transports.push(s),this._transportsByName[s]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode(this.opts.query)),withEventListeners&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=protocol$1,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",SocketWithoutUpgrade.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const s=this.writeBuffer[n].data;if(s&&(t+=byteLength(s)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,nextTick(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,s){if(typeof t=="function"&&(s=t,t=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const r={type:e,data:t,options:n};this.emitReserved("packetCreate",r),this.writeBuffer.push(r),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(SocketWithoutUpgrade.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),withEventListeners&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);n!==-1&&OFFLINE_EVENT_LISTENERS.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}SocketWithoutUpgrade.protocol=protocol$1;class SocketWithUpgrade extends SocketWithoutUpgrade{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;SocketWithoutUpgrade.priorWebsocketSuccess=!1;const s=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",u=>{if(!n)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;SocketWithoutUpgrade.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(f(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=t.name,this.emitReserved("upgradeError",p)}}))};function r(){n||(n=!0,f(),t.close(),t=null)}const a=u=>{const p=new Error("probe error: "+u);p.transport=t.name,r(),this.emitReserved("upgradeError",p)};function o(){a("transport closed")}function l(){a("socket closed")}function d(u){t&&u.name!==t.name&&r()}const f=()=>{t.removeListener("open",s),t.removeListener("error",a),t.removeListener("close",o),this.off("close",l),this.off("upgrading",d)};t.once("open",s),t.once("error",a),t.once("close",o),this.once("close",l),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let Socket$1=class extends SocketWithUpgrade{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(s=>transports[s]).filter(s=>!!s)),super(e,n)}};function url(i,e="",t){let n=i;t=t||typeof location<"u"&&location,i==null&&(i=t.protocol+"//"+t.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=t.protocol+i:i=t.host+i),/^(https?|wss?):\/\//.test(i)||(typeof t<"u"?i=t.protocol+"//"+i:i="https://"+i),n=parse$1(i)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const r=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port+e,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,toString$1=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$1.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$1.call(File)==="[object FileConstructor]";function isBinary(i){return withNativeArrayBuffer&&(i instanceof ArrayBuffer||isView(i))||withNativeBlob&&i instanceof Blob||withNativeFile&&i instanceof File}function hasBinary(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(hasBinary(i[t]))return!0;return!1}if(isBinary(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return hasBinary(i.toJSON(),!0);for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&hasBinary(i[t]))return!0;return!1}function deconstructPacket(i){const e=[],t=i.data,n=i;return n.data=_deconstructPacket(t,e),n.attachments=e.length,{packet:n,buffers:e}}function _deconstructPacket(i,e){if(!i)return i;if(isBinary(i)){const t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){const t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=_deconstructPacket(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){const t={};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=_deconstructPacket(i[n],e));return t}return i}function reconstructPacket(i,e){return i.data=_reconstructPacket(i.data,e),delete i.attachments,i}function _reconstructPacket(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=_reconstructPacket(i[t],e);else if(typeof i=="object")for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=_reconstructPacket(i[t],e));return i}const RESERVED_EVENTS$1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],protocol=5;var PacketType;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(PacketType||(PacketType={}));class Encoder{constructor(e){this.replacer=e}encode(e){return(e.type===PacketType.EVENT||e.type===PacketType.ACK)&&hasBinary(e)?this.encodeAsBinary({type:e.type===PacketType.EVENT?PacketType.BINARY_EVENT:PacketType.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===PacketType.BINARY_EVENT||e.type===PacketType.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=deconstructPacket(e),n=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(n),s}}function isObject$1(i){return Object.prototype.toString.call(i)==="[object Object]"}class Decoder extends Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===PacketType.BINARY_EVENT;n||t.type===PacketType.BINARY_ACK?(t.type=n?PacketType.EVENT:PacketType.ACK,this.reconstructor=new BinaryReconstructor(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(isBinary(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(PacketType[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===PacketType.BINARY_EVENT||n.type===PacketType.BINARY_ACK){const r=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const a=e.substring(r,t);if(a!=Number(a)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(a)}if(e.charAt(t+1)==="/"){const r=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(r,t)}else n.nsp="/";const s=e.charAt(t+1);if(s!==""&&Number(s)==s){const r=t+1;for(;++t;){const a=e.charAt(t);if(a==null||Number(a)!=a){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(Decoder.isPayloadValid(n.type,r))n.data=r;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case PacketType.CONNECT:return isObject$1(t);case PacketType.DISCONNECT:return t===void 0;case PacketType.CONNECT_ERROR:return typeof t=="string"||isObject$1(t);case PacketType.EVENT:case PacketType.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&RESERVED_EVENTS$1.indexOf(t[0])===-1);case PacketType.ACK:case PacketType.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BinaryReconstructor{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const parser=Object.freeze(Object.defineProperty({__proto__:null,Decoder,Encoder,get PacketType(){return PacketType},protocol},Symbol.toStringTag,{value:"Module"}));function on(i,e,t){return i.on(e,t),function(){i.off(e,t)}}const RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Socket extends Emitter{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[on(e,"open",this.onopen.bind(this)),on(e,"packet",this.onpacket.bind(this)),on(e,"error",this.onerror.bind(this)),on(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,s,r;if(RESERVED_EVENTS.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const a={type:PacketType.EVENT,data:t};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const f=this.ids++,u=t.pop();this._registerAckCallback(f,u),a.id=f}const o=(s=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||s===void 0?void 0:s.writable,l=this.connected&&!(!((r=this.io.engine)===null||r===void 0)&&r._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(e,t){var n;const s=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(s===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},s),a=(...o)=>{this.io.clearTimeoutFn(r),t.apply(this,o)};a.withError=!0,this.acks[e]=a}emitWithAck(e,...t){return new Promise((n,s)=>{const r=(a,o)=>a?s(a):n(o);r.withError=!0,t.push(r),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...r)=>n!==this._queue[0]?void 0:(s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(s)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(e);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(e);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...s){n||(n=!0,t.packet({type:PacketType.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Backoff(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*i);i=Math.floor(e*10)&1?i+t:i-t}return Math.min(i,this.max)|0},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(i){this.ms=i},Backoff.prototype.setMax=function(i){this.max=i},Backoff.prototype.setJitter=function(i){this.jitter=i};class Manager extends Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,installTimerFunctions(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||parser;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=on(t,"open",function(){n.onopen(),e&&e()}),r=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),e?e(o):this.maybeReconnectOnOpen()},a=on(t,"error",r);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{s(),r(new Error("timeout")),t.close()},o);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(on(e,"ping",this.onping.bind(this)),on(e,"data",this.ondata.bind(this)),on(e,"error",this.onerror.bind(this)),on(e,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){nextTick(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const cache={};function lookup(i,e){typeof i=="object"&&(e=i,i=void 0),e=e||{};const t=url(i,e.path||"/socket.io"),n=t.source,s=t.id,r=t.path,a=cache[s]&&r in cache[s].nsps,o=e.forceNew||e["force new connection"]||e.multiplex===!1||a;let l;return o?l=new Manager(n,e):(cache[s]||(cache[s]=new Manager(n,e)),l=cache[s]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});const handleGetUsersInChat=async i=>{const e=await axios({url:API().user.profile,method:"post",headers:{"Content-Type":"application/json"},data:i});return responseValidator(e.status)?e.data:[]},submitCommentInChat=async(i,e,t)=>{const n=store.dispatch,{roomId:s,messages:r,messageCount:a,chatType:o}=store.getState().chats,{name:l,avatar_url:d}=store.getState().user,f={room:s,text:t?void 0:e,default_message_id:t??void 0},{data:u,status:p}=await submitChatComment(f);if(responseValidator(p)){if(!t&&o===ChatType.private){const m={name:l,avatar_url:d,created_at:u.created_at,text:e,author:u.author,room_id:s,id:u.id,isConfirmed:!1};n(setMessages(r?[m,...r]:[m])),n(setMessageCount(a+1))}}else ae({title:"ارتباط با سرور دچار مشکل شده است.",type:"error"});i&&i("")},fetchChatMessage=async(i,e)=>{const{roomId:t,messages:n,messageCount:s}=store.getState().chats,r=store.dispatch,{data:a,status:o}=await getAllChatMessages(t,i);if(responseValidator(o)){e(!1);let l=[];s!==0?n?l=[...n,...a.results]:l=[...a.results]:l=[...a.results],r(setMessageCount(a.count)),handleFirstTimeChatRoomMessage(l)}},handleConnectSocket=i=>{const e=store.dispatch,{roomId:t}=store.getState().chats;let n;n=lookup(API().live.liveChat.chat(t)),n.on("connect",async()=>{e(setSocket(n)),fetchChatMessage(0,i),n.on("message",async s=>handleChatRoomMessage(s))})},handleChatRoomMessage=async i=>{const e=store.dispatch,{messages:t,chatType:n}=store.getState().chats,{userId:s}=store.getState().user;if(!Array.isArray(i)){let r;if(n!==ChatType.public&&t&&(r=t.findIndex(o=>o.id===i.id)),r>-1&&t&&t.length){const o=JSON.parse(JSON.stringify(t));o[r].isConfirmed=!0,e(setMessages(o))}else n===ChatType.auto&&s===i.author&&(i.isConfirmed=!0),t&&t.length?e(setMessages([i,...t])):e(setMessages([i]));const{usersInfoInChat:a}=store.getState().chats;if(!a.find(o=>o.id===i.author)){const o=await handleGetUsersInChat([i.author]);o.length&&e(setUsersInfoInChat([...a,...o]))}}},handleFirstTimeChatRoomMessage=async i=>{const e=store.dispatch;if(i.length){e(setMessages(i));let t=[];i.map(s=>t.push(s.author)),t=[...new Set(t)];const n=await handleGetUsersInChat(t);n.length&&e(setUsersInfoInChat(n))}else e(setMessages([]))},handleChatActiveRoom=async i=>{const e=store.dispatch,{params:t}=store.getState().videoData,{roomId:n,chatEnabled:s,socket:r,showChat:a}=store.getState().chats;let o;if(!conditions(ConditionName.hasQuizParams)&&conditions(ConditionName.isParamsPortrait)&&i){let{data:l,status:d}=await apiCaller({url:API().live.liveChat.getRoomId(+String(t.id))});responseValidator(d)&&(n!==l.id&&r&&(e(setMessages([])),e(setChatEnabled(!1))),e(setDefaultMessages(l.default_messages)),e(setPinMessage(l.pin)),e(setRoomId(l.id)),e(setChatType(l.type)),o=l.id)}else s&&r&&(e(setMessages([])),e(setChatEnabled(!1)));s!==!!o&&setTimeout(()=>{a&&e(setChatPopover(!0)),e(setChatEnabled(!!o))},0)},submitChatComment=async i=>{const{data:e,status:t}=await apiCaller({url:API().live.liveChat.sendChatMessage,method:"post",data:i,headers:handleHasXTokenParamOrSendXToken(),retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}},getAllChatMessages=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:API().live.liveChat.getMessageList(i),method:"GET",data:{offset:e,limit:10,ordering:"-created_at"},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},feedbackLog=(i,e,t)=>{const{params:n,details:s}=store.getState().videoData;return{category:"feedback",id:Number(n.id),stars:i,text:e,customText:t,type:n.type,src:conditions(ConditionName.hasStreamLink)?s.stream_link:n.src,provider:n.provider}},eventMarkerClickLog=(i,e,t,n,s)=>{const{params:r,details:a}=store.getState().videoData;return{category:"eventMarkerClick",video_id:conditions(ConditionName.isLiveParam)?a.id:Number(r.id),markerId:i,markerTime:e,markerTitle:t,markerDescription:n,markerSticker:s,type:r.type,src:conditions(ConditionName.hasStreamLink)?a.stream_link:r.src,provider:r.provider}},speedChangeLog=i=>{const{params:e,details:t}=store.getState().videoData,{settings:n}=store.getState().user;return{category:"speedChange",previousSelectedSpeed:n.speed,selectedSpeed:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,provider:e.provider}},qualityChangeRequestLog=i=>{const{params:e,details:t}=store.getState().videoData,{qualityLevels:n,manualQuality:s,autoQuality:r}=store.getState().controller;return{category:"qualityChangeRequest",currentPlayingQuality:`${n[conditions(ConditionName.isAutoQuality)?r??s:s]}P`,previousSelectedQuality:conditions(ConditionName.isAutoQuality)?"auto":`${n[s]}P`,selectedQuality:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,provider:e.provider}},catchUpLoadingLog=i=>{const{params:e,details:t}=store.getState().videoData,{hlsLiveSyncPosition:n,qualityLevels:s,autoQuality:r}=store.getState().controller,{settings:a}=store.getState().user;return{category:"catchUpLoading",previousVideoTime:Number(sessionStorage.getItem("previousVideoTime")),currentVideoTime:n,duration:i,quality:`${conditions(ConditionName.isAutoQuality)?s[r]:s[a.quality]}P`,isAutoQuality:conditions(ConditionName.isAutoQuality),id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,provider:e.provider}},shareDialogLog=(i,e,t,n)=>{const{params:s,details:r}=store.getState().videoData;return{category:"shareDialog",id:Number(s.id),type:s.type,src:conditions(ConditionName.hasStreamLink)?r.stream_link:s.src,videoTime:i,eventMarkerId:n,provider:s.provider,jump:e?"true":"false",jumpTime:e?t:void 0}},shareCopyLog=(i,e,t,n)=>{const{params:s,details:r}=store.getState().videoData;return{category:"shareCopy",id:Number(s.id),type:s.type,src:conditions(ConditionName.hasStreamLink)?r.stream_link:s.src,videoTime:i,eventMarkerId:n,jump:e?"true":"false",jumpTime:e?t:void 0,provider:s.provider}},alternativeLiveLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"alternativeLiveClick",id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src,alternativeLiveUserId:i,provider:e.provider}},deActiveSettingLog=()=>{const{params:i,details:e}=store.getState().videoData,{settings:t}=store.getState().user;let n={id:Number(i.id),type:i.type,src:conditions(ConditionName.hasStreamLink)?e.stream_link:i.src,provider:i.provider};return t.poll_emoji?{...n,category:"activeSetting"}:{...n,category:"deactiveSetting",hasOtherLive:conditions(ConditionName.hasAlternativeLives)?"true":"false",hasPoll:conditions(ConditionName.hasPoll)?"true":"false",hasEmoji:conditions(ConditionName.hasEmojiList1Or2)?"true":"false"}},backwardForwardLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i==="backward"?"backward":"forward",id:Number(e.id),type:e.type,src:t.stream_link?t.stream_link:e.src,provider:e.provider}},pollModalCloseLog=(i,e,t)=>({category:"pollModalClose",pollId:t,id:Number(i.id),type:i.type,src:e.stream_link?e.stream_link:i.src,provider:i.provider}),tagClickLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"tagClick",tagText:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},likeDislikeLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},fullscreenLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},brightnessLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData;return{category:"brightnessChange",source:i,target:e,id:Number(t.id),type:t.type,src:conditions(ConditionName.hasStreamLink)?n.stream_link:t.src}},volumeLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData;return{category:"volumeChange",source:i,target:e,id:Number(t.id),type:t.type,src:conditions(ConditionName.hasStreamLink)?n.stream_link:t.src}},subtitleLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"subtitle",language:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},lockLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:Number(e.id),type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},recommendationListLog=(i,e,t,n)=>{const{params:s,details:r}=store.getState().videoData;return{category:"recommend",sourcevideoId:conditions(ConditionName.isLiveParam)?r.id:+s.id,targetVideoId:i,sourceUserId:r.user_id,targetUserId:e,sourceType:s.type,targetType:t,listIndex:n,id:Number(s.id),type:s.type,src:conditions(ConditionName.hasStreamLink)?r.stream_link:s.src}},ExceptionsLog=(i,e)=>({category:"error",type:i,message:e}),videoTimelineLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData,{duration:s}=store.getState().controller;return{category:"video-timeline",video_id:conditions(ConditionName.isLiveParam)?n.id:+t.id,video_type:t.type==="archive"?"live":t.type,start:i,end:e,watchedDuration:e-i,video_duration:conditions(ConditionName.isLiveParam)?null:Math.floor(s),clientUUID:getUUID(),user_id:conditions(ConditionName.isLiveParam)?t.id:n.user_id,content_type:n.content_type,content_id:n.content_id}},bookmarkLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i,id:conditions(ConditionName.isLiveParam)?t.id:+e.id,type:e.type,src:conditions(ConditionName.hasStreamLink)?t.stream_link:e.src}},autoQualityChangeLog=(i,e,t)=>{const{params:n,details:s}=store.getState().videoData;return{category:"autoQualityChange",sourceQuality:i,targetQuality:e,diffQuality:t,id:Number(n.id),type:n.type,src:conditions(ConditionName.hasStreamLink)?s.stream_link:n.src,provider:n.provider}},pingpongLog=(i,e)=>{const{params:t,details:n}=store.getState().videoData;return{category:"pingpong",id:Number(t.id),type:t.type,src:conditions(ConditionName.hasStreamLink)?n.stream_link:t.src,PingPongDuration:Number((new Date().getTime()-i).toFixed(2)),PingPongSourceQuality:`${e[0]}P`,PingPongTargetQuality:`${e[1]}P`,provider:t.provider}},pausePlayLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:i?"playVideo":"pauseVideo",id:Number(e.id),type:e.type,src:t.stream_link?t.stream_link:e.src,provider:e.provider}},initLog=(i,e,t,n,s)=>{const{params:r,details:a}=store.getState().videoData,o=Date.now()-s.current+i+e,l=window.performance.memory,d=JSON.parse(JSON.stringify(window.performance.timing));return{category:"initLog",id:Number(r.id),type:r.type,origin:new URL(conditions(ConditionName.hasStreamLink)?a.stream_link:r.src).origin,src:conditions(ConditionName.hasStreamLink)?a.stream_link:r.src,loading:i,bannerLoading:!conditions(ConditionName.hasBanner)||t<0?0:t,waiting:e,firstChunkPlaying:n<0?0:n,totalTime:o,provider:r.provider,performance:flattenObject({memory:l,timing:d},"performance"),userAgent:window.navigator.userAgent}},loadingLog=(i,e,t,n,s)=>{const{params:r,details:a,hlsLiveSyncPosition:o}=store.getState().videoData,{settings:l}=store.getState().user,d=conditions(ConditionName.isLiveParam)?o:videoTag().currentTime,f=Date.now()-t.current;return{category:"loading",id:Number(r.id),type:r.type,src:conditions(ConditionName.hasStreamLink)?a.stream_link:r.src,duration:i,quality:`${e}P`,isAutoQuality:conditions(ConditionName.isAutoQuality),previousLoaderDiff:f,counter:n.current,loadingPercentile:Number((i/f).toFixed(2)),videoTime:d,videoEntranceTime:s,speed:l.speed,provider:r.provider}},playListClickLog=i=>{const{params:e,details:t}=store.getState().videoData;return{category:"playListClick",playlistId:i,id:conditions(ConditionName.isLiveParam)?t.id:+e.id,type:e.type}},videoOfPlaylistClickLog=(i,e,t,n)=>({category:"videoOfPlaylistClick",tag:i,indexNumber:n,videoId:e,videoType:t}),searchLog=i=>{const{selectedTags:e,inputTagSearch:t}=store.getState().tags,{params:n}=store.getState().videoData;return{category:"search",tag:e.join(","),q:conditions(ConditionName.hasInputTagSearch)?t:void 0,user_ids:n.user_ids,video_type:i}},searchResultClickLog=(i,e,t)=>{const{selectedTags:n,inputTagSearch:s}=store.getState().tags,{params:r}=store.getState().videoData,a=handleContentType();return{category:"searchResultClick",tag:n.join(","),q:conditions(ConditionName.hasInputTagSearch)?s:void 0,user_ids:r.user_ids,video_type:a,clickedId:i,clickedIndex:t,clickedType:e}},handleContinuousPlayback=()=>{const{videoSettings:i}=store.getState().user,{params:e}=store.getState().videoData,t=e.type.toString(),n=conditions(ConditionName.isLogin),s=videoTag().currentTime;if(t!=="live"&&s!==0){const r=videoTag().duration,a={video_id:+e.id,video_type:handleVideoType(),time:s===r?0:Math.floor(videoTag().currentTime),is_like:i.is_like};let o=localStorage.getItem("viewedVideos");if(o){let l=JSON.parse(o);l=l.filter(d=>d.video_id!==a.video_id||d.video_type!==a.video_type),l.length<10||l.shift(),l.push(a),localStorage.setItem("viewedVideos",JSON.stringify(l))}else localStorage.setItem("viewedVideos",JSON.stringify([a]));n&&createVideoSettings(a)}},handleApplyContinuousPlayback=()=>{const i=store.dispatch,{params:e}=store.getState().videoData;let t=localStorage.getItem("viewedVideos");if(t){const s=JSON.parse(t).find(r=>r.video_id===Number(e.id)&&r.video_type===handleVideoType());s&&(i(setVideoSettings({is_like:s.is_like,time:s.time})),s.time!==0&&i(setShowContinuousPlayback(!0)))}},handleShowContinuousVideo=i=>{const e=store.dispatch,{videoSettings:t}=store.getState().user;handlePlayPause(i),handleVideoTimeline(t.time),e(setShowContinuousPlayback(!1))},handleGoToFirstVideo=i=>{const e=store.dispatch,{videoSettings:t}=store.getState().user;e(setVideoSettings({...t,time:0})),e(setShowContinuousPlayback(!1)),handlePlayPause(i)},handlePlayPause=i=>{const e=store.dispatch,{params:t}=store.getState().videoData;(i===null||i.target.nodeName!=="INPUT")&&(i!==null&&(i.stopPropagation(),i.preventDefault()),videoTag().paused?videoTag().play():videoTag().pause(),e(setPlay(!videoTag().paused)),t.onPlayPause&&t.onPlayPause(!videoTag().paused))},handlePlayerPauseMiniPlayer=i=>{if(i===null||i.target.nodeName!=="INPUT"){const e=store.dispatch;miniPlayerVideoTag().paused?miniPlayerVideoTag().play():miniPlayerVideoTag().pause(),e(setPlayMiniPlayer(!miniPlayerVideoTag().paused)),videoTag()&&videoTag().played&&(videoTag().pause(),e(setPlay(!1)))}},handlePlayPauseInDOM=i=>{const e=store.dispatch;return i?(videoTag().play(),e(setPlay(!0)),!0):(videoTag().pause(),e(setPlay(!1)),!1)},handleChangeSoundVolume=i=>{const e=store.dispatch,{settings:t}=store.getState().user;e(setUserSettings({...t,volume:i})),conditions(ConditionName.isIOS)?videoTag().muted=!videoTag().muted:videoTag().volume=i/100},handleIsLive=()=>{const i=store.dispatch,{hlsLiveSyncPosition:e}=store.getState().controller;handleVideoTimeline(videoTag().currentTime,e),videoTag().currentTime=e,i(setCurrentTime(e)),progressBar()&&(progressBar().style.width="100%"),i(setIsLive(!0));const t=Date.now();videoTag().play().then(()=>sendFluentLog(catchUpLoadingLog(Date.now()-t)))},handleBackwardForward=(i,e=15,t)=>{if(t&&t.target.nodeName==="INPUT")return;const n=store.dispatch;i==="touchBackward"?i="backward":i==="touchForward"&&(i="forward"),sendFluentLog(backwardForwardLog(i));let s=0;i==="backward"?e===0?s=0:s=videoTag().currentTime-e:i==="forward"&&(e===videoTag().duration?s=e:s=videoTag().currentTime+e),conditions(ConditionName.isLiveParam)&&n(setCurrentTime(s)),conditions(ConditionName.isStaticFormat)||handleVideoTimeline(videoTag().currentTime,videoTag().currentTime+e),videoTag().currentTime=s},handleFullScreen=()=>{const i=store.dispatch,e=document.fullscreenElement;conditions(ConditionName.isIOS)?videoTag().webkitEnterFullScreen?(i(setPlay(!1)),videoTag().webkitEnterFullScreen()):(i(setClearPopoversSlice()),sendFluentLog(fullscreenLog("fullScreen"))):e?(i(setIsFullScreen(!1)),document.exitFullscreen(),conditions(ConditionName.isTouchScreen)&&conditions(ConditionName.isParamsPortrait)&&i(setIsComplexPortrait(!0))):(i(setClearPopoversSlice()),document.documentElement.requestFullscreen(),i(setIsFullScreen(!0)),sendFluentLog(fullscreenLog("fullScreen")),conditions(ConditionName.isTouchScreen)&&conditions(ConditionName.isParamsPortrait)&&i(setIsComplexPortrait(!1)))},handleLockOrientation=()=>{conditions(ConditionName.isTouchScreen)&&!conditions(ConditionName.isIOS)&&(conditions(ConditionName.isLandscape)&&!conditions(ConditionName.isFullScreen)?window.screen.orientation.lock("portrait"):window.screen.orientation.lock("landscape"))},handleLock=i=>{const e=store.dispatch;e(setLock(i==="lock")),sendFluentLog(lockLog(i))},handleVideoTimeline=(i,e)=>{if(conditions(ConditionName.isSendTimelineLog)){const t=store.dispatch,{videoTimelines:n}=store.getState().videoData;let s=Math.floor(i),r=Math.floor(e);n.length===0?t(setVideoTimelines([s>=videoTag().duration&&!conditions(ConditionName.isLive)?r:s])):(n[0]<s&&apiCaller({url:API().videoTimelineLog,method:"post",data:videoTimelineLog(n[0],s)}),r&&r>=videoTag().duration?t(setVideoTimelines([])):t(setVideoTimelines([r])))}},handleVideoElementSizeInfo=()=>{var t;const i=store.dispatch,e=(t=document.getElementById("video-area"))==null?void 0:t.getBoundingClientRect();e.height=e.width*9/16,e&&i(setVideoElementSizeInfo(e))},handleClickVideoCard=(i,e,t)=>{const n=store.dispatch,{params:s,recommendationList:r}=store.getState().videoData;let a=i,o=e;if(r&&r.length&&(!i||!e)){const l=findFirstVideoInRecommendationList();a=i||l.id,o=e||l.type}videoTag()&&(handleVideoTimeline(videoTag().currentTime),conditions(ConditionName.isEnded)||handleContinuousPlayback()),a&&o&&(s.handleRedirectCards&&!t&&s.handleRedirectCards(a,o),clearRedux(),n(setPlayerParams({...s,id:a,type:o,xToken:s.xToken})),n(setIsClickInnerCard(!0)))},detailAPI=i=>{const{params:e}=store.getState().videoData;return getApiUrls().apiUrl+(i||e.id)},detailsConfig={url:"",maxRetryCount:0,headers:{},retryPolicy:[],errorCallback:void 0},liveDetailsConfig=i=>{detailsConfig.url=detailAPI(i);let e=window.location.origin;e=e.replace("https://",""),e=e.replace("http://",""),detailsConfig.url+="?from="+e},nonLiveDetailsConfig=i=>(detailsConfig.url=detailAPI(i),detailsConfig.maxRetryCount=3,detailsConfig.retryPolicy=[{codeAbove:500,codeBelow:null,excludeCodes:[],includeCodes:[409],delay:1,count:3},{codeAbove:null,codeBelow:404,excludeCodes:[403,402,401,400],includeCodes:[],delay:10,count:6}],detailsConfig.errorCallback=(e,t)=>{e!==404&&errorLogProvider({type:"DETAIL_ERROR",message:t?JSON.parse(t).message:""})},detailsConfig),hasIsAuthInParams=()=>{const{token:i}=store.getState().videoData;hasQuestionMark(detailsConfig.url)?detailsConfig.url+=`&token=${i}`:detailsConfig.url+=`?token=${i}`},hasHInParams=()=>{detailsConfig.headers={authorization:`Bearer ${getAccessToken()}`}},hasDaaniToken=()=>{const{daaniToken:i}=store.getState().videoData.params;hasQuestionMark(detailsConfig.url)?detailsConfig.url+=`&ext_user=${i}`:detailsConfig.url+=`?ext_user=${i}`},handleDetailsConfig=i=>(conditions(ConditionName.isLiveParam)?liveDetailsConfig(i):nonLiveDetailsConfig(),conditions(ConditionName.isAuth)&&hasIsAuthInParams(),conditions(ConditionName.hasHParam)&&hasHInParams(),conditions(ConditionName.hasDaaniTokenParams)&&hasDaaniToken(),detailsConfig),videoViewCount=i=>apiCaller({url:API().viewCount(i),data:{uuid:getUUID()}}),handleDetailsInLive=i=>{const e=store.dispatch;e(setLiveId(i.id)),e(setIsLive(!0)),e(setIsLiveError(!1)),conditions(ConditionName.isEnded)?setTimeout(()=>detailSetter(i),LiveDelay*1e3):detailSetter(i)},getLiveAndVodDetails=async i=>{const e=store.dispatch,{params:t}=store.getState().videoData;try{const n=await apiCaller({...handleDetailsConfig(i)});if(responseValidator(n.status)){if(appendQueryParamsToChunks(n.data.stream_link),await axios.head("https://"+weighted_random(n.data.hls_links)+n.data.path),i)return n.data;videoViewCount(n.data.content_id),conditions(ConditionName.isLiveParam)?handleDetailsInLive(n.data):detailSetter(n.data)}else throw new Error(JSON.stringify({status:n.status,message:n.data}))}catch(n){if(JSON.parse(n.message).status===404&&conditions(ConditionName.isLiveParam)&&conditions(ConditionName.hasRedirectOnEndedUrlParams)&&(window.location.href=t.redirectOnEndedUrl),i)return;conditions(ConditionName.isLiveParam)&&e(setIsLiveError(!0)),handlePageTitle(String(t.id)),e(setIsFetchDetails(!0)),e(setErrorType("liveAndVod")),e(setIsValidAddress(!1))}},detailSetter=i=>{const e=store.dispatch,{params:t}=store.getState().videoData;i.title?handlePageTitle(i.title):handlePageTitle(String(t.id)),e(setInfo({...i,stream_link:!!i.stream_link&&addUuidToSrc("https://"+weighted_random(i.hls_links)+i.path)})),e(setIsFetchDetails(!0)),e(setIsValidAddress(!0))},manualGeneralErrorResponseHandler=(i,e,t,n,s,r,a)=>{i!==RetryCountGeneralDataFetch&&i!==1?t(i-1):i===1&&n.length>0&&(n.forEach(o=>clearInterval(o)),s([])),console.error(`get aggregat error: ${r.detail}`)},firstGetDataIntervalAPI=async(i,e,t,n,s,r)=>{const{params:a}=store.getState().videoData,{data:o,status:l}=await apiCaller({url:API().live.generalData});if(responseValidator(l)&&o.config){if(o.backup&&(window.location.href=window.location.href.replace(`id=${a.id}`,`id=${o.backup}`).replace(`&t=${a.t}`,"")),e(RetryCountGeneralDataFetch),t(setConfig(o.config)),n(conditions(ConditionName.hasQuizParams)?o.config.quiz_get_interval:o.config.get_interval),s(o.config.viewers_interval),r(o.config.empoji_poll_interval),t(setEmojis(o.emojis)),t(setOnlineViewers(o.online_viewers)),t(setQuestion(o.question)),t(setAlternative_Lives(o.alternative_lives)),t(setMarkers(o.markers.sort(compare))),t(setGif(o.gif)),t(setQuiz(o.quiz)),handleChatActiveRoom(o.chat_enabled),o.timeline.windows.length){const d=[];o.timeline.windows.map(f=>d.push(f.viewers)),t(setChartPoints(d))}!o&&!o.question&&!o.question.active&&(livePoll()&&livePoll().liveId!==a.id||!livePoll())&&localStorage.setItem("live-poll",JSON.stringify({liveId:a.id,polls:[]}))}else n(RetryTimeDelayGeneralDataFetch),e(i-1),console.error(`get aggregat error: ${o.detail}`)},manualGetDataIntervalAPI=async(i,e,t,n,s,r,a,o,l)=>{const{params:d}=store.getState().videoData,{data:f,status:u}=await apiCaller({url:API().live.generalData});if(responseValidator(u)&&f.config){if(f.backup&&(window.location.href=window.location.href.replace(`id=${d.id}`,`id=${f.backup}`).replace(`&t=${d.t}`,"")),n(RetryCountGeneralDataFetch),s(setConfig(f.config)),(conditions(ConditionName.hasQuizParams)&&f.config.quiz_get_interval!==t||!conditions(ConditionName.hasQuizParams)&&f.config.get_interval!==t)&&a(conditions(ConditionName.hasQuizParams)?f.config.quiz_get_interval:f.config.get_interval),o(f.config.viewers_interval),l(f.config.empoji_poll_interval),s(setEmojis(f.emojis)),s(setOnlineViewers(f.online_viewers)),s(setQuestion(f.question)),s(setAlternative_Lives(f.alternative_lives)),s(setMarkers(f.markers.sort(compare))),s(setGif(f.gif)),handleChatActiveRoom(f.chat_enabled),s(setQuiz(f.quiz)),f.timeline.windows.length){const p=[];f.timeline.windows.map(m=>p.push(m.viewers)),s(setChartPoints(p))}!f.question&&f.question&&!f.question.active&&(livePoll()&&livePoll().liveId!==d.id||!livePoll())&&localStorage.setItem("live-poll",JSON.stringify({liveId:d.id,polls:[]}))}else manualGeneralErrorResponseHandler(i,s,n,e,r,f)},manualPostAPI=async()=>{const i=store.dispatch,{selectedOptionId:e,emojiList1:t,emojiList2:n,params:s,details:r}=store.getState().videoData;if(conditions(ConditionName.manaulPostAPI)){const a={poll:{option_id:e},emoji_list_1:t,emoji_list_2:n,type:s.type,id:r.id,user_id:s.id},{status:o}=await postEmojiPoll(a);responseValidator(o)&&(i(setEmojiList1([])),i(setEmojiList2([])),i(setSelectedOptionId(null)))}},manualGetOnlineViewerIntervalAPI=async()=>await apiCaller({url:API().live.online_viewer}),handleSubtitle=()=>{const i=store.dispatch,{subtitles:e,selectedSubtitle:t}=store.getState().videoData,n=e.find(s=>s.language==="fa");t?(Object.values(videoTag().textTracks).find(s=>s.mode==="showing").mode="disabled",i(setSubtitleText("")),i(setSelectedSubtitle(void 0)),sendFluentLog(subtitleLog("empty"))):n?(n.mode="showing",i(setSelectedSubtitle(n)),sendFluentLog(subtitleLog(n.language))):(videoTag().textTracks[0].mode="showing",i(setSelectedSubtitle(videoTag().textTracks[0])),sendFluentLog(subtitleLog(videoTag().textTracks[0].language)))},handleClickRecommendationCard=(i,e,t,n,s)=>{i&&handleRipple(i,`recommendationList-${e}`,150);const{recommendationList:r}=store.getState().videoData;handleVideoTimeline(videoTag().currentTime),sendFluentLog(recommendationListLog(e??r[0].id,t??r[0].user_id,n??r[0].type,s??1))},combinedMarkers=(i,e)=>{const t=[];i&&i.map(n=>{t.push({banner:"",id:n.id?n.id:n.time,live_id:conditions(ConditionName.isLiveParam)?n.video_id:0,sticker:n.sticker,time:n.time,title:n.name,video_type:n.video_type,video_id:n.video_id,description:n.description,isPersonal:n.id?n.id:n.time})}),store.dispatch(setMarkers([...e,...t].sort(compare)))},handlePlayListTabClick=()=>{const i=store.dispatch,{playList:e}=store.getState().videoData;i(setPlayListPopover(!0)),sendFluentLog(playListClickLog(e[0].id))},handleVideoOfPlaylistClick=(i,e,t,n,s)=>{handleRipple(i,`playList-${t}`,150),sendFluentLog(videoOfPlaylistClickLog(e,t,n,s))},handleContentType=()=>{const{isMovieFilter:i,isSeriesFilter:e}=store.getState().tags;let t;return i&&e?t=`${ContentTypesString.Vod},${ContentTypesString.PlayList}`:i?t=ContentTypesString.Vod:e&&(t=ContentTypesString.PlayList),t},findFirstVideoInRecommendationList=()=>{const{recommendationList:i}=store.getState().videoData,e=i.find(t=>t.type!=="playlist");return{id:e.id,type:e.type,banner:e.banner,title:e.title}},postEmojiPoll=async i=>{const{status:e}=await apiCaller({url:API().live.postData,method:"POST",data:i,retryPolicy:[{codeAbove:null,codeBelow:500,excludeCodes:[500,408,407,406,405,404,403,402,401,400],includeCodes:[409],delay:3,count:3}]});return{status:e}},getPlaylistVideos=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:API().playListVideos(i),method:"GET",data:{offset:e,limit:10},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},getAllGeneralMarker=async i=>await getAll(i,[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]),getAllPersonalMarkers=async i=>{const{data:e,status:t}=await apiCaller({url:i,headers:handleHasXTokenParamOrSendXToken(),retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}},getCommentList=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:i,data:{limit:10,offset:e},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},submitComment=async(i,e)=>{const{data:t,status:n}=await apiCaller({url:i,method:"POST",data:e,headers:{...handleHasXTokenParamOrSendXToken(),"ACCEPT-LANGUAGE":"fa"},retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[409],includeCodes:[],delay:2,count:3}]});return{data:t,status:n}},getPlayListCards=async i=>{const{data:e,status:t}=await apiCaller({url:i,retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}},getPlaylistHeader=async i=>{const{data:e,status:t}=await apiCaller({url:i,retryPolicy:[{codeAbove:400,codeBelow:null,excludeCodes:[],includeCodes:[],delay:2,count:3}]});return{data:e,status:t}};class InvalidTokenError extends Error{}InvalidTokenError.prototype.name="InvalidTokenError";function b64DecodeUnicode(i){return decodeURIComponent(atob(i).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function base64UrlDecode(i){let e=i.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b64DecodeUnicode(e)}catch{return atob(e)}}function jwtDecode(i,e){if(typeof i!="string")throw new InvalidTokenError("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,n=i.split(".")[t];if(typeof n!="string")throw new InvalidTokenError(`Invalid token specified: missing part #${t+1}`);let s;try{s=base64UrlDecode(n)}catch(r){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${t+1} (${r.message})`)}try{return JSON.parse(s)}catch(r){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${t+1} (${r.message})`)}}const checkCanComment=async()=>{const i=store.dispatch,{details:e}=store.getState().videoData,{data:t,status:n}=await apiCaller({url:API().comment.canAddComment(e.content_id)});responseValidator(n)&&(i(setCanAddComment(t.can_comment)),i(setCanShowSubmittedComment(t.comment_hidden_default===0)),i(setCommentsCount(t.comments_count-t.hidden_comments_count)),i(setCommentsCountPagination(t.first_level_comments_count-t.first_level_hidden_comments_count)))},handleGetComments=async(i,e)=>{const t=store.dispatch,{comments:n,usersCommentsProfiles:s}=store.getState().comments,{details:r}=store.getState().videoData,{data:a,status:o}=await getCommentList(API().comment.commentList(r.content_id),i);responseValidator(o)&&a.results&&a.results.length?(n!==void 0&&n.length?t(setComments([...n,...a.results])):t(setComments(a.results)),e(!1),t(setUsersCommentsProfiles(await handleGetUsersComments(a.results,s)))):(n===void 0||n.length===0)&&t(setComments([]))},handleGetReplies=async(i,e,t,n,s,r)=>{get(async(a,o)=>{responseValidator(o)&&(e.length?t([...e,...a.results]):t(a.results),s(await handleGetUsersComments(a.results,n)))},API().comment.replyList(i),{limit:10,offset:e.length-(r?1:0)})},handleSubmitDefaultMessageComment=async i=>{const e=store.dispatch,{details:t}=store.getState().videoData,{comments:n}=store.getState().comments;if(await checkCanComment(),conditions(ConditionName.canAddComment)){const s={text:void 0,default_message_id:i,content:t.content_id,reply_to:void 0},{data:r,status:a}=await submitComment(API().comment.create,s);responseValidator(a)?n?(e(setComments([r,...n])),conditions(ConditionName.isTouchScreen)&&n.length>0&&document.getElementById("touchscreenListComments").scrollIntoView({behavior:"smooth"})):e(setComments([r])):r&&ae({title:r.detail,type:"error"})}},handleSubmitComment=async(i,e,t,n,s,r)=>{const a=store.dispatch,{details:o}=store.getState().videoData,{replyToAuthor:l,comments:d}=store.getState().comments;if(await checkCanComment(),conditions(ConditionName.canAddComment)&&(i||t)){const f={text:i,content:s==="reply"?void 0:o.content_id,reply_to:s==="reply"?l.id:void 0},{data:u,status:p}=await submitComment(API().comment.create,f);responseValidator(p)?(e(""),n(""),conditions(ConditionName.canShowSubmittedComment)?s==="reply"?a(setRealTimeReply(u)):d?(a(setComments([u,...d])),conditions(ConditionName.isTouchScreen)&&d.length>0&&document.getElementById("touchscreenListComments").scrollIntoView({behavior:"smooth"})):a(setComments([u])):ae({title:`${s==="reply"?"پاسخ":"نظر"} شما با موفقیت ثبت شد و پس از تایید نمایش داده می شود.`,type:"success"}),s==="reply"&&(a(setReplyToAuthor({})),r&&r(!1))):ae({title:"خطا در ثبت دیدگاه",type:"error"})}else conditions(ConditionName.canAddComment)||ae({title:"در حال حاضر امکان ثبت دیدگاه وجود ندارد",type:"error"})},handleGetUsersComments=async(i,e)=>{const t=[];i.map(s=>s.author!=="AnonymousUser"&&t.push(s.author));const n=await axios({url:API().user.profile,method:"post",headers:{"Content-Type":"application/json"},data:t});return responseValidator(n.status)?[...e,...n.data]:[]},handleCommentsIdsInLocalStorage=()=>{const i=localStorage.getItem("commentsLikeUnlike");if(i){const{params:e}=store.getState().videoData,t=JSON.parse(i).find(n=>n.videoId===e.id&&n.videoType===e.type);if(t)return t.comments}},handleLikeUnlikeComment=async(i,e,t,n,s)=>{const{params:r}=store.getState().videoData,{status:a}=await apiCaller({url:e?API().comment.like(i):API().comment.unlike(i),data:{uuid:getUUID()}});if(responseValidator(a)){s(e?n+1:n-1),t(e);const o=localStorage.getItem("commentsLikeUnlike");if(o){const l=JSON.parse(o).filter(f=>f.videoId!==r.id||f.videoId===r.id&&f.videoType!==r.type),d=JSON.parse(o).find(f=>f.videoId===r.id&&f.videoType===r.type);if(l)if(d){const f=d.comments.filter(u=>u!==i);e?localStorage.setItem("commentsLikeUnlike",JSON.stringify([...l,{videoId:r.id,videoType:r.type,comments:[...f,i]}])):localStorage.setItem("commentsLikeUnlike",JSON.stringify([...l,{videoId:r.id,videoType:r.type,comments:f}]))}else localStorage.setItem("commentsLikeUnlike",JSON.stringify([...l,{videoId:r.id,videoType:r.type,comments:[i]}]))}else localStorage.setItem("commentsLikeUnlike",JSON.stringify([{videoId:r.id,videoType:r.type,comments:[i]}]))}},handleCloseCommentPopover=()=>{const i=store.dispatch;i(setCommentPopover(!1)),i(setComments(void 0))},isShowCommentSettings=i=>{const{params:e}=store.getState().videoData;return e.xToken?jwtDecode(e.xToken).sub===i:!1},getPointerTime=(i,e="")=>{const{videoElementSizeInfo:t}=store.getState().videoData,{duration:n,hlsLiveSyncPosition:s}=store.getState().controller,r=conditions(ConditionName.isLiveParam)?s:n,a=i.clientX!==void 0?i.clientX:i.touches[0].clientX;if(a<=t.right-footerPadding()&&a>footerPadding()){let l=(a-footerPadding()-t.left)/(t.width-2*footerPadding())*r;return e==="tooltipTime-live"&&(l=r-l),l}},getPointerPosition=i=>{const{videoElementSizeInfo:e}=store.getState().videoData,t=i.clientX!==void 0?i.clientX:i.touches[0].clientX;if(t<=e.right-footerPadding()&&t>footerPadding())return t-footerPadding()-e.left},getMarkerPosition=i=>{const{duration:e,hlsLiveSyncPosition:t}=store.getState().controller,n=conditions(ConditionName.isLiveParam)?t:e;return i*progressBarWidth()/n},hideProgressTooltip=i=>{i&&(i.style.opacity="0.0",i.style.pointerEvents="none",i.style.zIndex=zIndex.vttDisable)},generalStyleTooltipHandler=i=>{i.style.display="block",i.style.zIndex=zIndex.vtt,i.style.opacity=store.getState().videoData.details.vtt?"1.0":"0.6",i.style.pointerEvents="auto",i.style.transition="opacity 1s ease-out"},vttTooltipStyleHandler=(i,e)=>{const{videoElementSizeInfo:t}=store.getState().videoData,n=document.getElementsByClassName("pl-progressTooltip")[0],s=document.getElementById("parent-player");n&&s&&(getPointerPosition(i)>n.getBoundingClientRect().width/2&&getPointerPosition(i)<t.right-t.left-n.getBoundingClientRect().width/2?e.style.left=`${getPointerPosition(i)-n.offsetWidth/2}px`:getPointerPosition(i)<(s.offsetLeft===0?n.offsetWidth:s.offsetLeft)?e.style.left="0px":videoTag().offsetLeft+videoTag().offsetWidth<getPointerPosition(i)+n.offsetWidth&&(e.style.left=`${videoTag().offsetWidth-n.offsetWidth}px`))},showProgressTooltip=(i,e,t)=>{e&&generalStyleTooltipHandler(e),store.getState().videoData.details.vtt?vttTooltipStyleHandler(i,e):e.style.left=`${getPointerPosition(i)-30}px`,store.dispatch(setTooltipTime(Number(getPointerTime(i)))),t.textContent=conditions(ConditionName.isLiveParam)?`-${secondsToHMS(getPointerTime(i,"tooltipTime-live"))}`:`${secondsToHMS(getPointerTime(i))}`},handleTimeTooltip=(i,e=!1)=>{const{videoElementSizeInfo:t}=store.getState().videoData,n=document.querySelector(".pl-progressTooltip"),s=document.querySelector(".pl-progressTimeTooltip"),r=i.clientX!==void 0?i.clientX:i.touches[0].clientX;n&&s&&r<=t.right-footerPadding()&&r>t.left+footerPadding()?(showProgressTooltip(i,n,s),e&&setTimeout(()=>hideProgressTooltip(n),2e3)):hideProgressTooltip(n)},handleProgressTime=i=>{const e=i.clientX!==void 0?i.clientX:i.touches[0].clientX;progressBar()&&(e<=i.view.innerWidth-footerPadding()&&e>footerPadding()?progressBar().style.width=`${getPointerPosition(i)}px`:e<=i.view.innerWidth-footerPadding()?progressBar().style.width=0:e>footerPadding()&&(progressBar().style.width="100%"))},handlePointerDown=(i,e,t)=>{i.preventDefault(),i.stopPropagation(),t(!0);const n=store.dispatch,s=i.clientX!==void 0?i.clientX:i.touches[0].clientX;s<=i.view.innerWidth-footerPadding()&&s>footerPadding()&&(n(setActivePointerProgressBar(!0)),n(setDelayTurnOffControlbar(!0)),sessionStorage.setItem("previousVideoTime",String(videoTag().currentTime)),i.target.setPointerCapture(i.pointerId),e.length>0&&e.map(r=>clearTimeout(r)))},handlePointerMove=i=>{i.preventDefault(),i.stopPropagation();const e=store.dispatch,{activePointerProgressBar:t}=store.getState().controller,{left:n}=store.getState().videoData.videoElementSizeInfo,s=i.clientX!==void 0?i.clientX:i.touches[0].clientX,r=document.querySelector(".pl-progressTooltip");s>n+footerPadding()?(r&&(r.style.display="block !important",r.style.pointerEvents="auto"),t&&(e(setDelayTurnOffControlbar(!0)),handleTimeTooltip(i),handleProgressTime(i),videoTag().pause())):r&&(r.style.display="none !important",r.style.pointerEvents="none")},handlePointerUp=(i,e,t,n)=>{n(!1),i.preventDefault(),i.stopPropagation();const s=store.dispatch,{duration:r,hlsLiveSyncPosition:a}=store.getState().controller,{left:o,right:l}=store.getState().videoData.videoElementSizeInfo,d=conditions(ConditionName.isLiveParam)?a:r;i.target.removeEventListener("pointermove",handlePointerMove);const f=i.clientX!==void 0?i.clientX:i.touches[0].clientX;let u=0;f>o+footerPadding()&&f<l+footerPadding()?u=getPointerTime(i):f<o+footerPadding()?u=0:f>footerPadding()&&(u=d),conditions(ConditionName.isStaticFormat)||handleVideoTimeline(videoTag().currentTime,u),videoTag().currentTime=u,store.getState().controller.activePointerProgressBar&&(s(setActivePointerProgressBar(!1)),s(setDelayTurnOffControlbar(!1)),videoTag().play(),handleTimeTooltip(i,!0),sessionStorage.setItem("current-time",String(u)),handleProgressTime(i),handleTimeout(i,s,e,t))},handleTimeout=(i,e,t,n)=>{const s=n;let r=setTimeout(()=>{const{settingPopover:a,markersListPopover:o}=store.getState().popovers,{delayTurnOffControlbar:l}=store.getState().controller;i.pointerType==="touch"&&!a&&!o&&l&&e(setActiveElements(!1))},activeElementsTime);s.push(r),t(s)},handleCatchUpLoadingLog=()=>{const i=Date.now();videoTag().play().then(()=>sendFluentLog(catchUpLoadingLog(Date.now()-i)))},handleMouseMove=i=>handleTimeTooltip(i),handleMouseOut=()=>{const i=document.querySelector(".pl-progressTooltip");hideProgressTooltip(i)},deconstructTimestamp=i=>{const e=i.split("."),n=e[0].split(":");return{milliseconds:parseInt(e[1],10)||0,seconds:parseInt(n.pop(),10)||0,minutes:parseInt(n.pop(),10)||0,hours:parseInt(n.pop(),10)||0}},getSecondsFromTimestamp=i=>{const e=deconstructTimestamp(i);return parseInt(e.hours*(60*60)+e.minutes*60+e.seconds+e.milliseconds/1e3,10)},getPropsFromDef=i=>{const e=i.split(/#xywh=/i),t=e[0],s=e[1].match(/[0-9]+/gi);return{x:s[0],y:s[1],w:s[2],h:s[3],image:t}},getFullyQualifiedUrl=(i,e)=>i.indexOf("//")>=0?i:e.indexOf("//")===0?[e.replace(/\/$/gi,""),i.trim()].join("/"):e.indexOf("//")>0?[e.trim(),i.trim()].join("/"):i,getVttCss=(i,e)=>{const t={};let n=e.split(/\/\w+\.vtt\s?/)[0];if(i=getFullyQualifiedUrl(i,n),!i.match(/#xywh=/i))return t.background='url("'+i+e.split(/\/\w+\.vtt\s?/)[1]+'")',t;const s=getPropsFromDef(i);return t.background='url("'+s.image+e.split(/\/\w+\.vtt\s?/)[1]+'") no-repeat -'+s.x+"px -"+s.y+"px",t.width=s.w+"px",t.height=s.h+"px",t.url=s.image,t},fetchFile=(i,e)=>{fetch(i).then(t=>{if(!t.ok)throw store.dispatch(setInfo({...store.getState().videoData.details,vtt:void 0,vtt_mobile:void 0})),new Error("Network response was not ok");return t.text()}).then(t=>{const n=[];t.split(/[\r\n][\r\n]/i).forEach(r=>{if(r.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3}).*/gi)){const a=r.split(/[\r\n]/i),l=a[0].split(/ ?--> ?/i),d=l[0],f=l[1],u=a[1],p=getVttCss(u,i);n.push({start:getSecondsFromTimestamp(d),end:getSecondsFromTimestamp(f),css:p})}}),e(n)}).catch(t=>{console.error("Error fetching file:",t)})},getStyleForTime=(i,e,t)=>{for(let n=0;n<e.length;++n){const s=e[n];if(i>=s.start&&i<s.end){if(s.css.url&&!t[s.css.url]){const r={background:s.css.background,width:s.css.width,height:s.css.height};return t[s.css.url]=r,r}else if(s.css.url)return t[s.css.url]}}},getFitMaxNumberCard=()=>Math.ceil(window.innerWidth*window.innerHeight/(265*149)),handleGetTags=(i,e,t,n)=>{const{details:s,params:r}=store.getState().videoData,{selectedTags:a,inputTagSearch:o}=store.getState().tags;i&&t.length&&get((l,d)=>{responseValidator(d)&&(l.results.length>0&&n(t.concat(l.results)),e(!1))},API().searchViewers,{tag:a.join(","),q:conditions(ConditionName.hasInputTagSearch)?o:void 0,user_ids:conditions(ConditionName.isUserIdsParamsEqualAll)?void 0:conditions(ConditionName.hasUserIds)?r.user_ids:s.user_id,limit:conditions(ConditionName.isComplexPortrait)?10:getFitMaxNumberCard(),offset:t.length})},handleClickTag=(i,e,t,n)=>{const s=store.dispatch,{details:r,params:a}=store.getState().videoData,{selectedTags:o,inputTagSearch:l}=store.getState().tags,d=handleContentType();sendFluentLog(searchLog(d)),n&&n(!0),get((f,u)=>{responseValidator(u)&&(i(f.count),f.results.length>0?(s(setTagsPopover(!0)),t(f.results)):t([])),n&&n(!1)},API().searchViewers,{tag:o.join(","),q:conditions(ConditionName.hasInputTagSearch)?l:void 0,user_ids:conditions(ConditionName.isUserIdsParamsEqualAll)?void 0:conditions(ConditionName.hasUserIds)?a.user_ids:r.user_id,limit:e.length+(conditions(ConditionName.isComplexPortrait)?10:getFitMaxNumberCard()),offset:0,video_type:d})},handleClickPlayerCardTag=(i,e)=>{const t=store.dispatch,{selectedTags:n}=store.getState().tags;i.preventDefault(),i.stopPropagation(),n.includes(e)||(t(setPlayListCardPopover(!1)),t(setTagsPopover(!0)),t(setSelectedTags([...n,e])),sendFluentLog(tagClickLog(e.trim())))},getAllViewersTagList=async()=>{const{details:i,params:e}=store.getState().videoData,{selectedTags:t}=store.getState().tags;return new Promise(async n=>{try{const s=await getAll(API().viewersTagList(e.type),[],{user_ids:conditions(ConditionName.isUserIdsParamsEqualAll)?void 0:conditions(ConditionName.hasUserIds)?e.user_ids:i.user_id,tag:t.join(",")});n(s)}catch{}})},handleViewersTagList=async()=>{const i=store.dispatch,{selectedTags:e}=store.getState().tags,t=await getAllViewersTagList();if(t){let n=[];t.map(s=>n.push(s.tag.trim())),n=[...new Set(n)],i(setViewersTagsList(n.filter(s=>s!==e[0])))}},handleCloseTagPopover=()=>{const i=store.dispatch;i(setTagsPopover(!1)),i(setSelectedTags([])),i(setInputTagSearch("")),i(setIsMovieFilter(!1)),i(setIsSeriesFilter(!1)),i(setInputFilterTagSearch(""))},handleTagInput=(i,e,t,n,s,r,a)=>{const o=store.dispatch;o(setInputTagSearch(i)),e(!0),clearTimeout(t.current),t.current=setTimeout(()=>{handleClickTag(n,s,r,a),e(!1)},500)},handleCloseSelectedTags=i=>{const e=store.dispatch,{selectedTags:t,viewersTagsList:n}=store.getState().tags;e(setSelectedTags(t.filter(s=>s!==i))),e(setViewersTagsList([i,...n]))},handleClickViewersTagList=i=>{const e=store.dispatch,{selectedTags:t,viewersTagsList:n}=store.getState().tags;e(setSelectedTags([...t,i])),e(setViewersTagsList(n.filter(s=>s!==i)))},handleClearTagInput=(i,e,t)=>{const n=store.dispatch;n(setInputTagSearch("")),handleClickTag(i,e,t)},handleNextTag=(i,e)=>{i.preventDefault(),i.stopPropagation(),e.current.scrollLeft-=e.current.clientWidth},handlePrevTag=(i,e)=>{i.preventDefault(),i.stopPropagation(),e.current.scrollLeft+=e.current.clientWidth},handleScrollLeft=(i,e)=>{i.preventDefault(),i.stopPropagation();const t=document.getElementById(e);t&&(t.scrollLeft-=50)},handleScrollRight=(i,e)=>{i.preventDefault(),i.stopPropagation();const t=document.getElementById(e);t&&(t.scrollLeft+=50)},handleSearchResultClick=(i,e,t,n,s,r)=>{const a=store.dispatch;handleRipple(i,`tagVideoList-${n}`,150),s===ContentTypesString.PlayList?(a(setPlayListCardPopover(!0)),t.current=e):sendFluentLog(searchResultClickLog(n,s,r))},createSettings=async i=>{i={...i,quality:conditions(ConditionName.isAutoQuality)?null:i.quality},conditions(ConditionName.isLogin)&&conditions(ConditionName.trackerEnabled)&&await apiCaller({url:API().user.createSettings,method:"POST",data:i,headers:handleHasXTokenParamOrSendXToken()})},createVideoSettings=async i=>{const{params:e,details:t}=store.getState().videoData;conditions(ConditionName.isLogin)&&conditions(ConditionName.trackerEnabled)&&await apiCaller({url:API().user.createVideoMetaData,method:"POST",data:{video_id:i.video_id??conditions(ConditionName.isLiveParam)?t.id:+e.id,video_type:i.video_type??handleVideoType(),...i},headers:handleHasXTokenParamOrSendXToken()})},handleBookmark=async(i,e,t)=>{if(i&&i.stopPropagation(),conditions(ConditionName.hasXToken)){const n=store.dispatch,{bookmarks:s,bookmarkId:r}=store.getState().user;if(conditions(ConditionName.isBookmark)||t==="delete"){if(conditions(ConditionName.trackerEnabled)){const{status:a,data:o}=await apiCaller({url:API().user.deleteBookmark(e),method:"DELETE",headers:handleHasXTokenParamOrSendXToken()});responseValidator(a)?(n(setBookmarks(s.filter(l=>e?l.id!==e:l.id!==r))),n(setBookmarkId(void 0)),sendFluentLog(bookmarkLog("unBookmark"))):ae({type:"error",title:o.detail})}}else{const{details:a,params:o}=store.getState().videoData,l={object_link:window.location.href,cover_url:a.banner,title:a.title,category:handleGetBookmarkCategory(o.provider)};if(conditions(ConditionName.trackerEnabled)){const{data:d,status:f}=await apiCaller({url:API().user.bookmarks,method:"POST",data:l,headers:handleHasXTokenParamOrSendXToken()});responseValidator(f)?(n(setBookmarks([d,...s])),n(setBookmarkId(d.id)),sendFluentLog(bookmarkLog("bookmark"))):ae({type:"error",title:d.detail})}}}else ae({title:"لطفا ابتدا وارد شوید.",type:"error"})},authToken={key:"HAMRAHI_CLOUD_AUTH_TOKEN",get:()=>{const i=api.get(authToken.key);return i?JSON.parse(i):null},set:i=>api.set(authToken.key,JSON.stringify(i),{expires:1095,sameSite:"none",secure:!0}),remove:()=>api.remove(authToken.key)},handleAutoFullScreen=()=>{const i=store.dispatch,{params:e}=store.getState().videoData,t=n=>{n.requestFullScreen?n.requestFullScreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullScreen&&n.webkitRequestFullScreen()};i(setClearPopoversSlice()),t(document.documentElement),i(setIsFullScreen(e.fullscreen==="true")),conditions(ConditionName.isComplexDesktop)&&i(setIsComplexDesktop(!1)),conditions(ConditionName.isTouchScreen)&&conditions(ConditionName.isParamsPortrait)&&i(setIsComplexPortrait(e.fullscreen!=="true"))},appendQueryParamsToChunksIOS=()=>{let i=".ts",e=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){const{daaniToken:t}=store.getState().videoData.params;let n=`?uuid=${getUUID()}`;conditions(ConditionName.hasDaaniTokenParams)&&(n=`${n}&ext_user=${t}`),arguments[1].endsWith(i)&&(arguments[1]=arguments[1]+n),e.apply(this,arguments)}},handleBufferedTime=(i,e)=>{const t=store.dispatch;e.current=setInterval(()=>{const s=i.target.buffered.end(0)/videoTag().duration*100;t(setBufferedTimeWidth(s))},500)},handleHlsConfig=()=>{const{params:i,streamLinkParams:e}=store.getState().videoData;return{xhrSetup:(t,n)=>{n.split("m3u8")[1]||(n=`${n}${e}`),t.open("GET",n,!0)},startLevel:i.type==="live"?1:-1,debug:!1,enableWorker:!0,liveDurationInfinity:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine),maxLiveSyncPlaybackRate:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?2:1,abrBandWidthUpFactor:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?.6:.7,abrBandWidthFactor:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?.8:.95,backBufferLength:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?2:1/0,maxBufferLength:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?12:30,maxMaxBufferLength:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?600:60,liveSyncDuration:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?3:LiveDelay,liveMaxLatencyDuration:conditions(ConditionName.hasQuizParams)||!conditions(ConditionName.hasTimeMachine)?8:void 0,manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4},errorRetry:{maxNumRetry:10,retryDelayMs:5e3,maxRetryDelayMs:1e4}}}}},handleMultiLiveHlsConfig=()=>{const{streamLinkParams:i}=store.getState().videoData;return{xhrSetup:(e,t)=>{t=`${t}${i}`,e.open("GET",t,!0)},startLevel:1,debug:!1,liveSyncDuration:LiveDelay,maxMaxBufferLength:60,playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1e3,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1e3,retryDelayMs:1e3,maxRetryDelayMs:1e3}}}}},handleManifestParsed=(i,e)=>{const t=store.dispatch;let n=[],s=[""],r=[];if(i.levels.map(a=>{n.push(a.attrs.RESOLUTION.split("x")[1].trim()),s.push(`${(a.bitrate/1e3).toFixed(0)}kbps`),r.push(a.attrs.RESOLUTION)}),i.autoLevelCapping=highestResolutionSupported(r,window.innerWidth,window.innerHeight),t(setQualityLevels(n)),t(setQualityBitrates(s)),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"].forEach(a=>document.addEventListener(a,()=>{conditions(ConditionName.isAutoQuality)&&(i.autoLevelCapping=highestResolutionSupported(r,window.innerWidth,window.innerHeight),i.nextLevel=-1)},!1)),e.audioTracks.length>0){const a=e.audioTracks.sort(o=>o.default===!0?-1:1);t(setMultiAudio(a))}},handleManifestLoaded=i=>i.audioTrack=0,handleMediaAttached=(i,e)=>{const{params:t,details:n}=store.getState().videoData;let s=conditions(ConditionName.isGeneral)?t.src:n.stream_link;e.loadSource(s),e.on(i.Events.MANIFEST_PARSED,(r,a)=>handleManifestParsed(e,a)),e.on(i.Events.MANIFEST_LOADED,()=>handleManifestLoaded(e))},handleLevels=(i,e,t)=>{if(e.frag.type!=="audio"){const n=store.dispatch,{settings:s}=store.getState().user,{qualityLevels:r,manualQuality:a,autoQuality:o}=store.getState().controller;conditions(ConditionName.isAutoQuality)?conditions(ConditionName.isAutoQuality)&&o===void 0?(i.nextLevel=-1,t(r[e.frag.level]),n(setAutoQuality(e.frag.level))):conditions(ConditionName.isAutoQuality)&&(t(r[e.frag.level]),o!==e.frag.level&&n(setAutoQuality(e.frag.level))):(e.frag.level!==a&&(i.nextLevel=r[s.quality]?s.quality:-1),r[s.quality]?(n(setManualQuality(s.quality)),n(setAutoQuality(void 0))):(t(r[e.frag.level]),n(setAutoQuality(e.frag.level)),n(setUserSettings({...s,quality:-1})),createSettings({...s,quality:null})))}},handleFragBuffered=i=>{var s;const e=store.dispatch;store.getState().controller.loadedFragmentsCount.length<Number(getInitialLoadedFragmentCount())&&e(setLoadedFragmentsCount([...new Set([...store.getState().controller.loadedFragmentsCount,i.abrController.fragCurrent.sn])]));const n=((s=i.mainForwardBufferInfo)==null?void 0:s.end)/videoTag().duration*100;e(setBufferedTimeWidth(n))},handleFragLoading=i=>{const e=store.dispatch;conditions(ConditionName.isLiveParam)&&e(setHlsLivePosition(i.liveSyncPosition))},handleFragChanged=(i,e,t,n)=>{const{params:s,multiAudio:r,selectedAudioId:a}=store.getState().videoData;r&&a!==void 0&&a!==e.audioTrack&&(e.audioTrack=a,e.trigger(i.Events.AUDIO_TRACK_LOADING,r[a])),(s.type||!conditions(ConditionName.isLiveParam))&&handleLevels(e,t,n)},handleFragParsed=(i,e,t)=>{const{type:n}=store.getState().videoData.params;(n||n==="live")&&handleLevels(i,e,t)},handleHlsErrors=(i,e)=>{if(e.event!=="hlsAudioTrackLoading")return{type:"HLS_"+e.type,message:e.error.message}},handlePreview=i=>{const e=store.dispatch,{params:t,details:n}=store.getState().videoData,s=conditions(ConditionName.hasPreviewStart)?n.preview_start:0,r=conditions(ConditionName.hasPreviewEnd)?n.preview_end:videoTag()?videoTag().duration:0;t.preview==="true"&&i.target.currentTime>=r&&(videoTag().currentTime=s,e(setCurrentTime(s)))},handleVideoWaiting=(i,e)=>{const t=store.dispatch;i.preventDefault(),e.current=Date.now(),t(setIsLoading(!0))},handleVideoSeeking=(i,e)=>{const t=store.dispatch;i.preventDefault(),e.current=0,t(setIsLoading(!0))},handleVideoTime=()=>{const{params:i}=store.getState().videoData,{videoSettings:e}=store.getState().user,t=store.dispatch;videoTag().currentTime=i.t?+i.t:e.time,t(setCurrentTime(i.t?+i.t:e.time))},handleVideoPlay=(i,e)=>{const t=store.dispatch,{details:n}=store.getState().videoData;if(i.preventDefault(),e.current=Date.now(),t(setPlay(!0)),conditions(ConditionName.isFirstPlay)){if(conditions(ConditionName.has360)&&(handle360(),setTimeout(()=>handleVideoTime(),200)),!conditions(ConditionName.has360)&&!conditions(ConditionName.isLiveParam)&&handleVideoTime(),conditions(ConditionName.hasFullScreenParams)&&handleAutoFullScreen(),conditions(ConditionName.isFullScreen)&&handleLockOrientation(),conditions(ConditionName.hasPreviewParams)){const s=n.preview_start?n.preview_start:0;videoTag().currentTime=s,t(setCurrentTime(s))}t(setVideoTimelines([Math.floor(videoTag().currentTime)]))}sendFluentLog(pausePlayLog(!0)),t(setSubtitleText(""))},handleVideoPlaying=(i,e,t,n,s,r,a,o)=>{const l=store.dispatch,{autoQuality:d,canPlayVideo:f,firstPlay:u,qualityLevels:p}=store.getState().controller,{settings:m}=store.getState().user,g=m.quality===-1&&d?p[d]:p[m.quality];let y=0;a.current&&(y=Date.now()-a.current),u&&videoTag().played&&sendFluentLog(initLog(e.current,Date.now()-t.current,n.current-t.current,Date.now()-s.current,s)),l(setFirstPlay(!1)),f&&y>0&&g!==void 0&&(r.current=y,a.current=0,sendFluentLog(loadingLog(y,g,s,i,o.current)),i.current=i.current+1,s.current=Date.now())},handleVideoPause=i=>{const e=store.dispatch;i.preventDefault(),sendFluentLog(pausePlayLog(!1)),e(setPlay(!1))},handleVideoTimeUpdate=i=>{const e=store.dispatch,{selectedSubtitle:t}=store.getState().videoData;i.preventDefault(),handlePreview(i),e(setCurrentTime(i.target.currentTime)),conditions(ConditionName.hasActiveCue)&&e(setSubtitleText(t.activeCues[0].text))},handleVideoCanPlay=i=>{const e=store.dispatch,{settings:t}=store.getState().user;if(i.preventDefault(),e(setIsLoading(!1)),e(setCanPlayVideo(!0)),videoTag().volume=t.volume/100,conditions(ConditionName.isIOSLive)||e(setDuration(i.target.duration)),conditions(ConditionName.isIOS)){const n=Object.values(i.target.textTracks);n&&n.length&&e(setSubtitles(Object.values(n[0]).length?n:[]))}else e(setSubtitles(Object.values(i.target.textTracks)))},handleVideoEnded=i=>{const e=store.dispatch,{params:t}=store.getState().videoData;i.preventDefault(),e(setIsLiveError(!0)),e(setIsEnded(!0)),e(setActiveElements(!0)),handleVideoTimeline(videoTag().duration),conditions(ConditionName.hasOnFinishedParams)&&t.onFinished()},handleVideoError=i=>{i.preventDefault();let e=videoTag().error;if(e)switch(e.code){case e.MEDIA_ERR_ABORTED:errorLogProvider({type:"videoTagError",message:"You aborted the video playback."});break;case e.MEDIA_ERR_NETWORK:errorLogProvider({type:"videoTagError",message:"A network error caused the video download to fail part-way."});break;case e.MEDIA_ERR_DECODE:errorLogProvider({type:"videoTagError",message:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support."});break;case e.MEDIA_ERR_SRC_NOT_SUPPORTED:errorLogProvider({type:"videoTagError",message:"The video could not be loaded, either because the server or network failed or because the format is not supported."});break;default:errorLogProvider({type:"videoTagError",message:"An unknown error occurred."});break}else errorLogProvider({type:"videoTagError",message:"An error occurred, but the error object is not available."})},handleIosVideoPlay=(i,e)=>{const t=store.dispatch;i.preventDefault(),e.current=Date.now(),t(setFirstPlay(!1)),conditions(ConditionName.isFirstPlay)&&conditions(ConditionName.has360)&&handle360()},handleIosVideoPlaying=()=>{const i=store.dispatch;i(setIsLoading(!1))},handleIosVideoTimeUpdate=i=>{const e=store.dispatch;i.preventDefault(),e(setCurrentTime(i.target.currentTime)),handlePreview(i)},handleIosVideoEnded=()=>{const{params:i}=store.getState().videoData;conditions(ConditionName.hasOnFinishedParams)&&i.onFinished()},handleStaticVideoPause=i=>{const e=store.dispatch;i.preventDefault(),e(setPlay(!1))},handleStaticVideoPlay=(i,e)=>{const t=store.dispatch;i.preventDefault(),t(setPlay(!0)),e.current=Date.now(),conditions(ConditionName.isFirstPlay)&&conditions(ConditionName.hasFullScreenParams)&&handleAutoFullScreen(),conditions(ConditionName.isFullScreen)&&handleLockOrientation()},handleStaticVideoPlaying=(i,e,t)=>{const n=store.dispatch,{firstPlay:s}=store.getState().controller;n(setIsLoading(!1)),s&&videoTag().played&&sendFluentLog(initLog(Math.round(i.current),Date.now()-e.current,0,Date.now()-t.current,t)),n(setFirstPlay(!1))},handleStaticVideoTimeUpdate=i=>{const e=store.dispatch;i.preventDefault(),e(setCurrentTime(i.target.currentTime)),e(setDuration(i.target.duration))},handleStaticVideoCanPlay=i=>{const e=store.dispatch;i.preventDefault(),e(setIsLoading(!1)),e(setCanPlayVideo(!0))},handleStaticVideoLoadedData=(i,e)=>{i.preventDefault(),handleBufferedTime(i,e)},handleStaticVideoEnded=i=>{const{params:e}=store.getState().videoData;conditions(ConditionName.hasOnFinishedParams)&&e.onFinished(),i.preventDefault()},handleMultiLiveManifestParsed=i=>i.nextLevel=i.levels.findIndex(e=>e.attrs.RESOLUTION.split("x")[1].trim()==="144"),handleMultiLiveMediaAttached=async(i,e)=>{const{multiLives:t}=store.getState().videoData,{stream_link:n}=await getLiveAndVodDetails(t[0].user_id);e.loadSource(n),e.on(i.Events.MANIFEST_PARSED,()=>handleMultiLiveManifestParsed(e))},handleMultiLiveFragLoading=async i=>{const e=store.dispatch;conditions(ConditionName.isLiveParam)&&e(setHlsLivePosition(i.liveSyncPosition))},handleVideoVisibilityChange=i=>{handleVideoTimeline(videoTag().currentTime),handleContinuousPlayback(),conditions(ConditionName.isVisibilityChange)&&(document.hidden?i.stopLoad():i.startLoad())};var resolveConfig$2={},resolveConfig$1={},negateValue={},hasRequiredNegateValue;function requireNegateValue(){return hasRequiredNegateValue||(hasRequiredNegateValue=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){if(t=`${t}`,t==="0")return"0";if(/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(t))return t.replace(/^[+-]?/,s=>s==="-"?"":"-");let n=["var","calc","min","max","clamp"];for(const s of n)if(t.includes(`${s}(`))return`calc(${t} * -1)`}}(negateValue)),negateValue}var corePluginList={},hasRequiredCorePluginList;function requireCorePluginList(){return hasRequiredCorePluginList||(hasRequiredCorePluginList=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});const e=["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","lineClamp","display","aspectRatio","size","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","captionSide","borderCollapse","borderSpacing","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","listStyleImage","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","hyphens","whitespace","textWrap","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","boxShadowColor","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","contain","content","forcedColorAdjust"]}(corePluginList)),corePluginList}var configurePlugins={},hasRequiredConfigurePlugins;function requireConfigurePlugins(){return hasRequiredConfigurePlugins||(hasRequiredConfigurePlugins=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t,n){return t===void 0?n:Array.isArray(t)?t:[...new Set(n.filter(r=>t!==!1&&t[r]!==!1).concat(Object.keys(t).filter(r=>t[r]!==!1)))]}}(configurePlugins)),configurePlugins}var colors$3={},log={},picocolors_browser={exports:{}},hasRequiredPicocolors_browser;function requirePicocolors_browser(){if(hasRequiredPicocolors_browser)return picocolors_browser.exports;hasRequiredPicocolors_browser=1;var i=String,e=function(){return{isColorSupported:!1,reset:i,bold:i,dim:i,italic:i,underline:i,inverse:i,hidden:i,strikethrough:i,black:i,red:i,green:i,yellow:i,blue:i,magenta:i,cyan:i,white:i,gray:i,bgBlack:i,bgRed:i,bgGreen:i,bgYellow:i,bgBlue:i,bgMagenta:i,bgCyan:i,bgWhite:i,blackBright:i,redBright:i,greenBright:i,yellowBright:i,blueBright:i,magentaBright:i,cyanBright:i,whiteBright:i,bgBlackBright:i,bgRedBright:i,bgGreenBright:i,bgYellowBright:i,bgBlueBright:i,bgMagentaBright:i,bgCyanBright:i,bgWhiteBright:i}};return picocolors_browser.exports=e(),picocolors_browser.exports.createColors=e,picocolors_browser.exports}var hasRequiredLog;function requireLog(){return hasRequiredLog||(hasRequiredLog=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,d){for(var f in d)Object.defineProperty(l,f,{enumerable:!0,get:d[f]})}e(i,{dim:function(){return a},default:function(){return o}});const t=n(requirePicocolors_browser());function n(l){return l&&l.__esModule?l:{default:l}}let s=new Set;function r(l,d,f){typeof process<"u"&&process.env.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),d.forEach(u=>console.warn(l,"-",u)))}function a(l){return t.default.dim(l)}const o={info(l,d){r(t.default.bold(t.default.cyan("info")),...Array.isArray(l)?[l]:[d,l])},warn(l,d){r(t.default.bold(t.default.yellow("warn")),...Array.isArray(l)?[l]:[d,l])},risk(l,d){r(t.default.bold(t.default.magenta("risk")),...Array.isArray(l)?[l]:[d,l])}}}(log)),log}var hasRequiredColors;function requireColors(){return hasRequiredColors||(hasRequiredColors=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});const e=t(requireLog());function t(r){return r&&r.__esModule?r:{default:r}}function n({version:r,from:a,to:o}){e.default.warn(`${a}-color-renamed`,[`As of Tailwind CSS ${r}, \`${a}\` has been renamed to \`${o}\`.`,"Update your configuration file to silence this warning."])}const s={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return n({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return n({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return n({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return n({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return n({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(colors$3)),colors$3}var defaults$2={},hasRequiredDefaults;function requireDefaults(){return hasRequiredDefaults||(hasRequiredDefaults=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"defaults",{enumerable:!0,get:function(){return e}});function e(t,...n){for(let a of n){for(let o in a){var s;!(t==null||(s=t.hasOwnProperty)===null||s===void 0)&&s.call(t,o)||(t[o]=a[o])}for(let o of Object.getOwnPropertySymbols(a)){var r;!(t==null||(r=t.hasOwnProperty)===null||r===void 0)&&r.call(t,o)||(t[o]=a[o])}}return t}}(defaults$2)),defaults$2}var toPath={},hasRequiredToPath;function requireToPath(){return hasRequiredToPath||(hasRequiredToPath=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"toPath",{enumerable:!0,get:function(){return e}});function e(t){if(Array.isArray(t))return t;let n=t.split("[").length-1,s=t.split("]").length-1;if(n!==s)throw new Error(`Path is invalid. Has unbalanced brackets: ${t}`);return t.split(/\.(?![^\[]*\])|[\[\]]/g).filter(Boolean)}}(toPath)),toPath}var normalizeConfig={},featureFlags={},hasRequiredFeatureFlags;function requireFeatureFlags(){return hasRequiredFeatureFlags||(hasRequiredFeatureFlags=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(u,p){for(var m in p)Object.defineProperty(u,m,{enumerable:!0,get:p[m]})}e(i,{flagEnabled:function(){return o},issueFlagNotices:function(){return d},default:function(){return f}});const t=s(requirePicocolors_browser()),n=s(requireLog());function s(u){return u&&u.__esModule?u:{default:u}}let r={optimizeUniversalDefaults:!1,generalizedModifiers:!0,disableColorOpacityUtilitiesByDefault:!1,relativeContentPathsByDefault:!1},a={future:["hoverOnlyWhenSupported","respectDefaultRingColorOpacity","disableColorOpacityUtilitiesByDefault","relativeContentPathsByDefault"],experimental:["optimizeUniversalDefaults","generalizedModifiers"]};function o(u,p){if(a.future.includes(p)){var m,g,y;return u.future==="all"||((y=(g=u==null||(m=u.future)===null||m===void 0?void 0:m[p])!==null&&g!==void 0?g:r[p])!==null&&y!==void 0?y:!1)}if(a.experimental.includes(p)){var v,b,C;return u.experimental==="all"||((C=(b=u==null||(v=u.experimental)===null||v===void 0?void 0:v[p])!==null&&b!==void 0?b:r[p])!==null&&C!==void 0?C:!1)}return!1}function l(u){if(u.experimental==="all")return a.experimental;var p;return Object.keys((p=u==null?void 0:u.experimental)!==null&&p!==void 0?p:{}).filter(m=>a.experimental.includes(m)&&u.experimental[m])}function d(u){if(process.env.JEST_WORKER_ID===void 0&&l(u).length>0){let p=l(u).map(m=>t.default.yellow(m)).join(", ");n.default.warn("experimental-flags-enabled",[`You have enabled experimental features: ${p}`,"Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time."])}}const f=a}(featureFlags)),featureFlags}var hasRequiredNormalizeConfig;function requireNormalizeConfig(){return hasRequiredNormalizeConfig||(hasRequiredNormalizeConfig=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"normalizeConfig",{enumerable:!0,get:function(){return r}});const e=requireFeatureFlags(),t=s(requireLog());function n(a){if(typeof WeakMap!="function")return null;var o=new WeakMap,l=new WeakMap;return(n=function(d){return d?l:o})(a)}function s(a,o){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var l=n(o);if(l&&l.has(a))return l.get(a);var d={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in a)if(u!=="default"&&Object.prototype.hasOwnProperty.call(a,u)){var p=f?Object.getOwnPropertyDescriptor(a,u):null;p&&(p.get||p.set)?Object.defineProperty(d,u,p):d[u]=a[u]}return d.default=a,l&&l.set(a,d),d}function r(a){if((()=>{if(a.purge||!a.content||!Array.isArray(a.content)&&!(typeof a.content=="object"&&a.content!==null))return!1;if(Array.isArray(a.content))return a.content.every(d=>typeof d=="string"?!0:!(typeof(d==null?void 0:d.raw)!="string"||d!=null&&d.extension&&typeof(d==null?void 0:d.extension)!="string"));if(typeof a.content=="object"&&a.content!==null){if(Object.keys(a.content).some(d=>!["files","relative","extract","transform"].includes(d)))return!1;if(Array.isArray(a.content.files)){if(!a.content.files.every(d=>typeof d=="string"?!0:!(typeof(d==null?void 0:d.raw)!="string"||d!=null&&d.extension&&typeof(d==null?void 0:d.extension)!="string")))return!1;if(typeof a.content.extract=="object"){for(let d of Object.values(a.content.extract))if(typeof d!="function")return!1}else if(!(a.content.extract===void 0||typeof a.content.extract=="function"))return!1;if(typeof a.content.transform=="object"){for(let d of Object.values(a.content.transform))if(typeof d!="function")return!1}else if(!(a.content.transform===void 0||typeof a.content.transform=="function"))return!1;if(typeof a.content.relative!="boolean"&&typeof a.content.relative<"u")return!1}return!0}return!1})()||t.default.warn("purge-deprecation",["The `purge`/`content` options have changed in Tailwind CSS v3.0.","Update your configuration file to eliminate this warning.","https://tailwindcss.com/docs/upgrade-guide#configure-content-sources"]),a.safelist=(()=>{var d;let{content:f,purge:u,safelist:p}=a;return Array.isArray(p)?p:Array.isArray(f==null?void 0:f.safelist)?f.safelist:Array.isArray(u==null?void 0:u.safelist)?u.safelist:Array.isArray(u==null||(d=u.options)===null||d===void 0?void 0:d.safelist)?u.options.safelist:[]})(),a.blocklist=(()=>{let{blocklist:d}=a;if(Array.isArray(d)){if(d.every(f=>typeof f=="string"))return d;t.default.warn("blocklist-invalid",["The `blocklist` option must be an array of strings.","https://tailwindcss.com/docs/content-configuration#discarding-classes"])}return[]})(),typeof a.prefix=="function")t.default.warn("prefix-function",["As of Tailwind CSS v3.0, `prefix` cannot be a function.","Update `prefix` in your configuration to be a string to eliminate this warning.","https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function"]),a.prefix="";else{var l;a.prefix=(l=a.prefix)!==null&&l!==void 0?l:""}a.content={relative:(()=>{let{content:d}=a;return d!=null&&d.relative?d.relative:(0,e.flagEnabled)(a,"relativeContentPathsByDefault")})(),files:(()=>{let{content:d,purge:f}=a;return Array.isArray(f)?f:Array.isArray(f==null?void 0:f.content)?f.content:Array.isArray(d)?d:Array.isArray(d==null?void 0:d.content)?d.content:Array.isArray(d==null?void 0:d.files)?d.files:[]})(),extract:(()=>{let d=(()=>{var p,m,g,y,v,b,C,_,R,E;return!((p=a.purge)===null||p===void 0)&&p.extract?a.purge.extract:!((m=a.content)===null||m===void 0)&&m.extract?a.content.extract:!((g=a.purge)===null||g===void 0||(y=g.extract)===null||y===void 0)&&y.DEFAULT?a.purge.extract.DEFAULT:!((v=a.content)===null||v===void 0||(b=v.extract)===null||b===void 0)&&b.DEFAULT?a.content.extract.DEFAULT:!((C=a.purge)===null||C===void 0||(_=C.options)===null||_===void 0)&&_.extractors?a.purge.options.extractors:!((R=a.content)===null||R===void 0||(E=R.options)===null||E===void 0)&&E.extractors?a.content.options.extractors:{}})(),f={},u=(()=>{var p,m,g,y;if(!((p=a.purge)===null||p===void 0||(m=p.options)===null||m===void 0)&&m.defaultExtractor)return a.purge.options.defaultExtractor;if(!((g=a.content)===null||g===void 0||(y=g.options)===null||y===void 0)&&y.defaultExtractor)return a.content.options.defaultExtractor})();if(u!==void 0&&(f.DEFAULT=u),typeof d=="function")f.DEFAULT=d;else if(Array.isArray(d))for(let{extensions:p,extractor:m}of d??[])for(let g of p)f[g]=m;else typeof d=="object"&&d!==null&&Object.assign(f,d);return f})(),transform:(()=>{let d=(()=>{var u,p,m,g,y,v;return!((u=a.purge)===null||u===void 0)&&u.transform?a.purge.transform:!((p=a.content)===null||p===void 0)&&p.transform?a.content.transform:!((m=a.purge)===null||m===void 0||(g=m.transform)===null||g===void 0)&&g.DEFAULT?a.purge.transform.DEFAULT:!((y=a.content)===null||y===void 0||(v=y.transform)===null||v===void 0)&&v.DEFAULT?a.content.transform.DEFAULT:{}})(),f={};return typeof d=="function"?f.DEFAULT=d:typeof d=="object"&&d!==null&&Object.assign(f,d),f})()};for(let d of a.content.files)if(typeof d=="string"&&/{([^,]*?)}/g.test(d)){t.default.warn("invalid-glob-braces",[`The glob pattern ${(0,t.dim)(d)} in your Tailwind CSS configuration is invalid.`,`Update it to ${(0,t.dim)(d.replace(/{([^,]*?)}/g,"$1"))} to silence this warning.`]);break}return a}}(normalizeConfig)),normalizeConfig}var isPlainObject={},hasRequiredIsPlainObject;function requireIsPlainObject(){return hasRequiredIsPlainObject||(hasRequiredIsPlainObject=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const n=Object.getPrototypeOf(t);return n===null||Object.getPrototypeOf(n)===null}}(isPlainObject)),isPlainObject}var cloneDeep={},hasRequiredCloneDeep;function requireCloneDeep(){return hasRequiredCloneDeep||(hasRequiredCloneDeep=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"cloneDeep",{enumerable:!0,get:function(){return e}});function e(t){return Array.isArray(t)?t.map(n=>e(n)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([n,s])=>[n,e(s)])):t}}(cloneDeep)),cloneDeep}var pluginUtils={},escapeCommas={},hasRequiredEscapeCommas;function requireEscapeCommas(){return hasRequiredEscapeCommas||(hasRequiredEscapeCommas=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){return t.replace(/\\,/g,"\\2c ")}}(escapeCommas)),escapeCommas}var withAlphaVariable={},color$1={},colorNames={},hasRequiredColorNames;function requireColorNames(){return hasRequiredColorNames||(hasRequiredColorNames=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});const e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}(colorNames)),colorNames}var hasRequiredColor;function requireColor(){return hasRequiredColor||(hasRequiredColor=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(g,y){for(var v in y)Object.defineProperty(g,v,{enumerable:!0,get:y[v]})}e(i,{parseColor:function(){return p},formatColor:function(){return m}});const t=n(requireColorNames());function n(g){return g&&g.__esModule?g:{default:g}}let s=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,r=/^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,a=/(?:\d+|\d*\.\d+)%?/,o=/(?:\s*,\s*|\s+)/,l=/\s*[,/]\s*/,d=/var\(--(?:[^ )]*?)(?:,(?:[^ )]*?|var\(--[^ )]*?\)))?\)/,f=new RegExp(`^(rgba?)\\(\\s*(${a.source}|${d.source})(?:${o.source}(${a.source}|${d.source}))?(?:${o.source}(${a.source}|${d.source}))?(?:${l.source}(${a.source}|${d.source}))?\\s*\\)$`),u=new RegExp(`^(hsla?)\\(\\s*((?:${a.source})(?:deg|rad|grad|turn)?|${d.source})(?:${o.source}(${a.source}|${d.source}))?(?:${o.source}(${a.source}|${d.source}))?(?:${l.source}(${a.source}|${d.source}))?\\s*\\)$`);function p(g,{loose:y=!1}={}){var v,b;if(typeof g!="string")return null;if(g=g.trim(),g==="transparent")return{mode:"rgb",color:["0","0","0"],alpha:"0"};if(g in t.default)return{mode:"rgb",color:t.default[g].map(F=>F.toString())};let C=g.replace(r,(F,O,A,N,M)=>["#",O,O,A,A,N,N,M?M+M:""].join("")).match(s);if(C!==null)return{mode:"rgb",color:[parseInt(C[1],16),parseInt(C[2],16),parseInt(C[3],16)].map(F=>F.toString()),alpha:C[4]?(parseInt(C[4],16)/255).toString():void 0};var _;let R=(_=g.match(f))!==null&&_!==void 0?_:g.match(u);if(R===null)return null;let E=[R[2],R[3],R[4]].filter(Boolean).map(F=>F.toString());return E.length===2&&E[0].startsWith("var(")?{mode:R[1],color:[E[0]],alpha:E[1]}:!y&&E.length!==3||E.length<3&&!E.some(F=>/^var\(.*?\)$/.test(F))?null:{mode:R[1],color:E,alpha:(v=R[5])===null||v===void 0||(b=v.toString)===null||b===void 0?void 0:b.call(v)}}function m({mode:g,color:y,alpha:v}){let b=v!==void 0;return g==="rgba"||g==="hsla"?`${g}(${y.join(", ")}${b?`, ${v}`:""})`:`${g}(${y.join(" ")}${b?` / ${v}`:""})`}}(color$1)),color$1}var hasRequiredWithAlphaVariable;function requireWithAlphaVariable(){return hasRequiredWithAlphaVariable||(hasRequiredWithAlphaVariable=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(r,a){for(var o in a)Object.defineProperty(r,o,{enumerable:!0,get:a[o]})}e(i,{withAlphaValue:function(){return n},default:function(){return s}});const t=requireColor();function n(r,a,o){if(typeof r=="function")return r({opacityValue:a});let l=(0,t.parseColor)(r,{loose:!0});return l===null?o:(0,t.formatColor)({...l,alpha:a})}function s({color:r,property:a,variable:o}){let l=[].concat(a);if(typeof r=="function")return{[o]:"1",...Object.fromEntries(l.map(f=>[f,r({opacityVariable:o,opacityValue:`var(${o}, 1)`})]))};const d=(0,t.parseColor)(r);return d===null?Object.fromEntries(l.map(f=>[f,r])):d.alpha!==void 0?Object.fromEntries(l.map(f=>[f,r])):{[o]:"1",...Object.fromEntries(l.map(f=>[f,(0,t.formatColor)({...d,alpha:`var(${o}, 1)`})]))}}}(withAlphaVariable)),withAlphaVariable}var dataTypes={},parseBoxShadowValue={},splitAtTopLevelOnly={},hasRequiredSplitAtTopLevelOnly;function requireSplitAtTopLevelOnly(){return hasRequiredSplitAtTopLevelOnly||(hasRequiredSplitAtTopLevelOnly=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"splitAtTopLevelOnly",{enumerable:!0,get:function(){return e}});function e(t,n){let s=[],r=[],a=0,o=!1;for(let l=0;l<t.length;l++){let d=t[l];s.length===0&&d===n[0]&&!o&&(n.length===1||t.slice(l,l+n.length)===n)&&(r.push(t.slice(a,l)),a=l+n.length),o=o?!1:d==="\\",d==="("||d==="["||d==="{"?s.push(d):(d===")"&&s[s.length-1]==="("||d==="]"&&s[s.length-1]==="["||d==="}"&&s[s.length-1]==="{")&&s.pop()}return r.push(t.slice(a)),r}}(splitAtTopLevelOnly)),splitAtTopLevelOnly}var hasRequiredParseBoxShadowValue;function requireParseBoxShadowValue(){return hasRequiredParseBoxShadowValue||(hasRequiredParseBoxShadowValue=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(l,d){for(var f in d)Object.defineProperty(l,f,{enumerable:!0,get:d[f]})}e(i,{parseBoxShadowValue:function(){return a},formatBoxShadowValue:function(){return o}});const t=requireSplitAtTopLevelOnly();let n=new Set(["inset","inherit","initial","revert","unset"]),s=/\ +(?![^(]*\))/g,r=/^-?(\d+|\.\d+)(.*?)$/g;function a(l){return(0,t.splitAtTopLevelOnly)(l,",").map(f=>{let u=f.trim(),p={raw:u},m=u.split(s),g=new Set;for(let y of m)r.lastIndex=0,!g.has("KEYWORD")&&n.has(y)?(p.keyword=y,g.add("KEYWORD")):r.test(y)?g.has("X")?g.has("Y")?g.has("BLUR")?g.has("SPREAD")||(p.spread=y,g.add("SPREAD")):(p.blur=y,g.add("BLUR")):(p.y=y,g.add("Y")):(p.x=y,g.add("X")):p.color?(p.unknown||(p.unknown=[]),p.unknown.push(y)):p.color=y;return p.valid=p.x!==void 0&&p.y!==void 0,p})}function o(l){return l.map(d=>d.valid?[d.keyword,d.x,d.y,d.blur,d.spread,d.color].filter(Boolean).join(" "):d.raw).join(", ")}}(parseBoxShadowValue)),parseBoxShadowValue}var hasRequiredDataTypes;function requireDataTypes(){return hasRequiredDataTypes||(hasRequiredDataTypes=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(ce,pe){for(var he in pe)Object.defineProperty(ce,he,{enumerable:!0,get:pe[he]})}e(i,{normalize:function(){return l},normalizeAttributeSelectors:function(){return d},url:function(){return u},number:function(){return p},percentage:function(){return m},length:function(){return v},lineWidth:function(){return C},shadow:function(){return _},color:function(){return R},image:function(){return E},gradient:function(){return O},position:function(){return N},familyName:function(){return M},genericName:function(){return X},absoluteSize:function(){return le},relativeSize:function(){return ue}});const t=requireColor(),n=requireParseBoxShadowValue(),s=requireSplitAtTopLevelOnly();let r=["min","max","clamp","calc"];function a(ce){return r.some(pe=>new RegExp(`^${pe}\\(.*\\)`).test(ce))}const o=new Set(["scroll-timeline-name","timeline-scope","view-timeline-name","font-palette","anchor-name","anchor-scope","position-anchor","position-try-options","scroll-timeline","animation-timeline","view-timeline","position-try"]);function l(ce,pe=null,he=!0){let Y=pe&&o.has(pe.property);return ce.startsWith("--")&&!Y?`var(${ce})`:ce.includes("url(")?ce.split(/(url\(.*?\))/g).filter(Boolean).map(ge=>/^url\(.*?\)$/.test(ge)?ge:l(ge,pe,!1)).join(""):(ce=ce.replace(/([^\\])_+/g,(ge,xe)=>xe+" ".repeat(ge.length-1)).replace(/^_/g," ").replace(/\\_/g,"_"),he&&(ce=ce.trim()),ce=f(ce),ce)}function d(ce){return ce.includes("=")&&(ce=ce.replace(/(=.*)/g,(pe,he)=>{if(he[1]==="'"||he[1]==='"')return he;if(he.length>2){let Y=he[he.length-1];if(he[he.length-2]===" "&&(Y==="i"||Y==="I"||Y==="s"||Y==="S"))return`="${he.slice(1,-2)}" ${he[he.length-1]}`}return`="${he.slice(1)}"`})),ce}function f(ce){let pe=["theme"],he=["min-content","max-content","fit-content","safe-area-inset-top","safe-area-inset-right","safe-area-inset-bottom","safe-area-inset-left","titlebar-area-x","titlebar-area-y","titlebar-area-width","titlebar-area-height","keyboard-inset-top","keyboard-inset-right","keyboard-inset-bottom","keyboard-inset-left","keyboard-inset-width","keyboard-inset-height","radial-gradient","linear-gradient","conic-gradient","repeating-radial-gradient","repeating-linear-gradient","repeating-conic-gradient","anchor-size"];return ce.replace(/(calc|min|max|clamp)\(.+\)/g,Y=>{let ge="";function xe(){let be=ge.trimEnd();return be[be.length-1]}for(let be=0;be<Y.length;be++){let Ce=function(ye){return ye.split("").every((we,_e)=>Y[be+_e]===we)},ke=function(ye){let we=1/0;for(let Re of ye){let Ee=Y.indexOf(Re,be);Ee!==-1&&Ee<we&&(we=Ee)}let _e=Y.slice(be,we);return be+=_e.length-1,_e},me=Y[be];if(Ce("var"))ge+=ke([")",","]);else if(he.some(ye=>Ce(ye))){let ye=he.find(we=>Ce(we));ge+=ye,be+=ye.length-1}else pe.some(ye=>Ce(ye))?ge+=ke([")"]):Ce("[")?ge+=ke(["]"]):["+","-","*","/"].includes(me)&&!["(","+","-","*","/",","].includes(xe())?ge+=` ${me} `:ge+=me}return ge.replace(/\s+/g," ")})}function u(ce){return ce.startsWith("url(")}function p(ce){return!isNaN(Number(ce))||a(ce)}function m(ce){return ce.endsWith("%")&&p(ce.slice(0,-1))||a(ce)}let y=`(?:${["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"].join("|")})`;function v(ce){return ce==="0"||new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${y}$`).test(ce)||a(ce)}let b=new Set(["thin","medium","thick"]);function C(ce){return b.has(ce)}function _(ce){let pe=(0,n.parseBoxShadowValue)(l(ce));for(let he of pe)if(!he.valid)return!1;return!0}function R(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,"_").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:(0,t.parseColor)(Y,{loose:!0})!==null?(pe++,!0):!1))?pe>0:!1}function E(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,",").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:u(Y)||O(Y)||["element(","image(","cross-fade(","image-set("].some(ge=>Y.startsWith(ge))?(pe++,!0):!1))?pe>0:!1}let F=new Set(["conic-gradient","linear-gradient","radial-gradient","repeating-conic-gradient","repeating-linear-gradient","repeating-radial-gradient"]);function O(ce){ce=l(ce);for(let pe of F)if(ce.startsWith(`${pe}(`))return!0;return!1}let A=new Set(["center","top","right","bottom","left"]);function N(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,"_").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:A.has(Y)||v(Y)||m(Y)?(pe++,!0):!1))?pe>0:!1}function M(ce){let pe=0;return(0,s.splitAtTopLevelOnly)(ce,",").every(Y=>(Y=l(Y),Y.startsWith("var(")?!0:Y.includes(" ")&&!/(['"])([^"']+)\1/g.test(Y)||/^\d/g.test(Y)?!1:(pe++,!0)))?pe>0:!1}let Z=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);function X(ce){return Z.has(ce)}let oe=new Set(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large"]);function le(ce){return oe.has(ce)}let de=new Set(["larger","smaller"]);function ue(ce){return de.has(ce)}}(dataTypes)),dataTypes}var validateFormalSyntax={},hasRequiredValidateFormalSyntax;function requireValidateFormalSyntax(){return hasRequiredValidateFormalSyntax||(hasRequiredValidateFormalSyntax=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"backgroundSize",{enumerable:!0,get:function(){return n}});const e=requireDataTypes(),t=requireSplitAtTopLevelOnly();function n(s){let r=["cover","contain"];return(0,t.splitAtTopLevelOnly)(s,",").every(a=>{let o=(0,t.splitAtTopLevelOnly)(a,"_").filter(Boolean);return o.length===1&&r.includes(o[0])?!0:o.length!==1&&o.length!==2?!1:o.every(l=>(0,e.length)(l)||(0,e.percentage)(l)||l==="auto")})}}(validateFormalSyntax)),validateFormalSyntax}var hasRequiredPluginUtils;function requirePluginUtils(){return hasRequiredPluginUtils||(hasRequiredPluginUtils=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(N,M){for(var Z in M)Object.defineProperty(N,Z,{enumerable:!0,get:M[Z]})}e(i,{updateAllClasses:function(){return d},asValue:function(){return p},parseColorFormat:function(){return y},asColor:function(){return b},asLookupValue:function(){return C},typeMap:function(){return R},coerceValue:function(){return O},getMatchingTypes:function(){return A}});const t=l(requireEscapeCommas()),n=requireWithAlphaVariable(),s=requireDataTypes(),r=l(requireNegateValue()),a=requireValidateFormalSyntax(),o=requireFeatureFlags();function l(N){return N&&N.__esModule?N:{default:N}}function d(N,M){N.walkClasses(Z=>{Z.value=M(Z.value),Z.raws&&Z.raws.value&&(Z.raws.value=(0,t.default)(Z.raws.value))})}function f(N,M){if(!m(N))return;let Z=N.slice(1,-1);if(M(Z))return(0,s.normalize)(Z)}function u(N,M={},Z){let X=M[N];if(X!==void 0)return(0,r.default)(X);if(m(N)){let oe=f(N,Z);return oe===void 0?void 0:(0,r.default)(oe)}}function p(N,M={},{validate:Z=()=>!0}={}){var X;let oe=(X=M.values)===null||X===void 0?void 0:X[N];return oe!==void 0?oe:M.supportsNegativeValues&&N.startsWith("-")?u(N.slice(1),M.values,Z):f(N,Z)}function m(N){return N.startsWith("[")&&N.endsWith("]")}function g(N){let M=N.lastIndexOf("/"),Z=N.lastIndexOf("[",M),X=N.indexOf("]",M);return N[M-1]==="]"||N[M+1]==="["||Z!==-1&&X!==-1&&Z<M&&M<X&&(M=N.lastIndexOf("/",Z)),M===-1||M===N.length-1?[N,void 0]:m(N)&&!N.includes("]/[")?[N,void 0]:[N.slice(0,M),N.slice(M+1)]}function y(N){if(typeof N=="string"&&N.includes("<alpha-value>")){let M=N;return({opacityValue:Z=1})=>M.replace(/<alpha-value>/g,Z)}return N}function v(N){return(0,s.normalize)(N.slice(1,-1))}function b(N,M={},{tailwindConfig:Z={}}={}){var X;if(((X=M.values)===null||X===void 0?void 0:X[N])!==void 0){var oe;return y((oe=M.values)===null||oe===void 0?void 0:oe[N])}let[le,de]=g(N);if(de!==void 0){var ue,ce,pe,he;let Y=(he=(ue=M.values)===null||ue===void 0?void 0:ue[le])!==null&&he!==void 0?he:m(le)?le.slice(1,-1):void 0;return Y===void 0?void 0:(Y=y(Y),m(de)?(0,n.withAlphaValue)(Y,v(de)):((ce=Z.theme)===null||ce===void 0||(pe=ce.opacity)===null||pe===void 0?void 0:pe[de])===void 0?void 0:(0,n.withAlphaValue)(Y,Z.theme.opacity[de]))}return p(N,M,{validate:s.color})}function C(N,M={}){var Z;return(Z=M.values)===null||Z===void 0?void 0:Z[N]}function _(N){return(M,Z)=>p(M,Z,{validate:N})}let R={any:p,color:b,url:_(s.url),image:_(s.image),length:_(s.length),percentage:_(s.percentage),position:_(s.position),lookup:C,"generic-name":_(s.genericName),"family-name":_(s.familyName),number:_(s.number),"line-width":_(s.lineWidth),"absolute-size":_(s.absoluteSize),"relative-size":_(s.relativeSize),shadow:_(s.shadow),size:_(a.backgroundSize)},E=Object.keys(R);function F(N,M){let Z=N.indexOf(M);return Z===-1?[void 0,N]:[N.slice(0,Z),N.slice(Z+1)]}function O(N,M,Z,X){if(Z.values&&M in Z.values)for(let{type:le}of N??[]){let de=R[le](M,Z,{tailwindConfig:X});if(de!==void 0)return[de,le,null]}if(m(M)){let le=M.slice(1,-1),[de,ue]=F(le,":");if(!/^[\w-_]+$/g.test(de))ue=le;else if(de!==void 0&&!E.includes(de))return[];if(ue.length>0&&E.includes(de))return[p(`[${ue}]`,Z),de,null]}let oe=A(N,M,Z,X);for(let le of oe)return le;return[]}function*A(N,M,Z,X){let oe=(0,o.flagEnabled)(X,"generalizedModifiers"),[le,de]=g(M);if(oe&&Z.modifiers!=null&&(Z.modifiers==="any"||typeof Z.modifiers=="object"&&(de&&m(de)||de in Z.modifiers))||(le=M,de=void 0),de!==void 0&&le===""&&(le="DEFAULT"),de!==void 0&&typeof Z.modifiers=="object"){var ce,pe;let he=(pe=(ce=Z.modifiers)===null||ce===void 0?void 0:ce[de])!==null&&pe!==void 0?pe:null;he!==null?de=he:m(de)&&(de=v(de))}for(let{type:he}of N??[]){let Y=R[he](le,Z,{tailwindConfig:X});Y!==void 0&&(yield[Y,he,de??null])}}}(pluginUtils)),pluginUtils}var toColorValue={},hasRequiredToColorValue;function requireToColorValue(){return hasRequiredToColorValue||(hasRequiredToColorValue=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return e}});function e(t){return typeof t=="function"?t({}):t}}(toColorValue)),toColorValue}var hasRequiredResolveConfig$2;function requireResolveConfig$2(){return hasRequiredResolveConfig$2||(hasRequiredResolveConfig$2=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return Z}});const e=m(requireNegateValue()),t=m(requireCorePluginList()),n=m(requireConfigurePlugins()),s=m(requireColors()),r=requireDefaults(),a=requireToPath(),o=requireNormalizeConfig(),l=m(requireIsPlainObject()),d=requireCloneDeep(),f=requirePluginUtils(),u=requireWithAlphaVariable(),p=m(requireToColorValue());function m(X){return X&&X.__esModule?X:{default:X}}function g(X){return typeof X=="function"}function y(X,...oe){let le=oe.pop();for(let de of oe)for(let ue in de){let ce=le(X[ue],de[ue]);ce===void 0?(0,l.default)(X[ue])&&(0,l.default)(de[ue])?X[ue]=y({},X[ue],de[ue],le):X[ue]=de[ue]:X[ue]=ce}return X}const v={colors:s.default,negative(X){return Object.keys(X).filter(oe=>X[oe]!=="0").reduce((oe,le)=>{let de=(0,e.default)(X[le]);return de!==void 0&&(oe[`-${le}`]=de),oe},{})},breakpoints(X){return Object.keys(X).filter(oe=>typeof X[oe]=="string").reduce((oe,le)=>({...oe,[`screen-${le}`]:X[le]}),{})}};function b(X,...oe){return g(X)?X(...oe):X}function C(X){return X.reduce((oe,{extend:le})=>y(oe,le,(de,ue)=>de===void 0?[ue]:Array.isArray(de)?[ue,...de]:[ue,de]),{})}function _(X){return{...X.reduce((oe,le)=>(0,r.defaults)(oe,le),{}),extend:C(X)}}function R(X,oe){if(Array.isArray(X)&&(0,l.default)(X[0]))return X.concat(oe);if(Array.isArray(oe)&&(0,l.default)(oe[0])&&(0,l.default)(X))return[X,...oe];if(Array.isArray(oe))return oe}function E({extend:X,...oe}){return y(oe,X,(le,de)=>!g(le)&&!de.some(g)?y({},le,...de,R):(ue,ce)=>y({},...[le,...de].map(pe=>b(pe,ue,ce)),R))}function*F(X){let oe=(0,a.toPath)(X);if(oe.length===0||(yield oe,Array.isArray(X)))return;let le=/^(.*?)\s*\/\s*([^/]+)$/,de=X.match(le);if(de!==null){let[,ue,ce]=de,pe=(0,a.toPath)(ue);pe.alpha=ce,yield pe}}function O(X){const oe=(le,de)=>{for(const ue of F(le)){let ce=0,pe=X;for(;pe!=null&&ce<ue.length;)pe=pe[ue[ce++]],pe=g(pe)&&(ue.alpha===void 0||ce<=ue.length-1)?pe(oe,v):pe;if(pe!==void 0){if(ue.alpha!==void 0){let he=(0,f.parseColorFormat)(pe);return(0,u.withAlphaValue)(he,ue.alpha,(0,p.default)(he))}return(0,l.default)(pe)?(0,d.cloneDeep)(pe):pe}}return de};return Object.assign(oe,{theme:oe,...v}),Object.keys(X).reduce((le,de)=>(le[de]=g(X[de])?X[de](oe,v):X[de],le),{})}function A(X){let oe=[];return X.forEach(le=>{oe=[...oe,le];var de;const ue=(de=le==null?void 0:le.plugins)!==null&&de!==void 0?de:[];ue.length!==0&&ue.forEach(ce=>{ce.__isOptionsFunction&&(ce=ce());var pe;oe=[...oe,...A([(pe=ce==null?void 0:ce.config)!==null&&pe!==void 0?pe:{}])]})}),oe}function N(X){return[...X].reduceRight((le,de)=>g(de)?de({corePlugins:le}):(0,n.default)(de,le),t.default)}function M(X){return[...X].reduceRight((le,de)=>[...le,...de],[])}function Z(X){let oe=[...A(X),{prefix:"",important:!1,separator:":"}];var le,de;return(0,o.normalizeConfig)((0,r.defaults)({theme:O(E(_(oe.map(ue=>(le=ue==null?void 0:ue.theme)!==null&&le!==void 0?le:{})))),corePlugins:N(oe.map(ue=>ue.corePlugins)),plugins:M(X.map(ue=>(de=ue==null?void 0:ue.plugins)!==null&&de!==void 0?de:[]))},...oe))}}(resolveConfig$1)),resolveConfig$1}var getAllConfigs={},config_full,hasRequiredConfig_full;function requireConfig_full(){return hasRequiredConfig_full||(hasRequiredConfig_full=1,config_full={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:i})=>({...i("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:i})=>i("blur"),backdropBrightness:({theme:i})=>i("brightness"),backdropContrast:({theme:i})=>i("contrast"),backdropGrayscale:({theme:i})=>i("grayscale"),backdropHueRotate:({theme:i})=>i("hueRotate"),backdropInvert:({theme:i})=>i("invert"),backdropOpacity:({theme:i})=>i("opacity"),backdropSaturate:({theme:i})=>i("saturate"),backdropSepia:({theme:i})=>i("sepia"),backgroundColor:({theme:i})=>i("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:i})=>i("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:i})=>({...i("colors"),DEFAULT:i("colors.gray.200","currentColor")}),borderOpacity:({theme:i})=>i("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:i})=>({...i("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:i})=>i("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:i})=>i("colors"),colors:({colors:i})=>({inherit:i.inherit,current:i.current,transparent:i.transparent,black:i.black,white:i.white,slate:i.slate,gray:i.gray,zinc:i.zinc,neutral:i.neutral,stone:i.stone,red:i.red,orange:i.orange,amber:i.amber,yellow:i.yellow,lime:i.lime,green:i.green,emerald:i.emerald,teal:i.teal,cyan:i.cyan,sky:i.sky,blue:i.blue,indigo:i.indigo,violet:i.violet,purple:i.purple,fuchsia:i.fuchsia,pink:i.pink,rose:i.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:i})=>i("borderColor"),divideOpacity:({theme:i})=>i("borderOpacity"),divideWidth:({theme:i})=>i("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:i})=>({none:"none",...i("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:i})=>i("spacing"),gradientColorStops:({theme:i})=>i("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridTemplateColumns:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",subgrid:"subgrid",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},height:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:i})=>({auto:"auto",...i("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:i})=>({...i("spacing"),none:"none",full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:i,breakpoints:e})=>({...i("spacing"),none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e(i("screens"))}),minHeight:({theme:i})=>({...i("spacing"),full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",min:"min-content",max:"max-content",fit:"fit-content"}),minWidth:({theme:i})=>({...i("spacing"),full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",15:"0.15",20:"0.2",25:"0.25",30:"0.3",35:"0.35",40:"0.4",45:"0.45",50:"0.5",55:"0.55",60:"0.6",65:"0.65",70:"0.7",75:"0.75",80:"0.8",85:"0.85",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:i})=>i("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:i})=>i("spacing"),placeholderColor:({theme:i})=>i("colors"),placeholderOpacity:({theme:i})=>i("opacity"),ringColor:({theme:i})=>({DEFAULT:i("colors.blue.500","#3b82f6"),...i("colors")}),ringOffsetColor:({theme:i})=>i("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:i})=>({DEFAULT:"0.5",...i("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:i})=>({...i("spacing")}),scrollPadding:({theme:i})=>i("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:i})=>({...i("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:i})=>({none:"none",...i("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:i})=>i("colors"),textDecorationColor:({theme:i})=>i("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:i})=>({...i("spacing")}),textOpacity:({theme:i})=>i("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:i})=>({...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),size:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"}),width:({theme:i})=>({auto:"auto",...i("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]}),config_full}var hasRequiredGetAllConfigs;function requireGetAllConfigs(){return hasRequiredGetAllConfigs||(hasRequiredGetAllConfigs=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});const e=n(requireConfig_full()),t=requireFeatureFlags();function n(r){return r&&r.__esModule?r:{default:r}}function s(r){var a;const o=((a=r==null?void 0:r.presets)!==null&&a!==void 0?a:[e.default]).slice().reverse().flatMap(f=>s(f instanceof Function?f():f)),l={respectDefaultRingColorOpacity:{theme:{ringColor:({theme:f})=>({DEFAULT:"#3b82f67f",...f("colors")})}},disableColorOpacityUtilitiesByDefault:{corePlugins:{backgroundOpacity:!1,borderOpacity:!1,divideOpacity:!1,placeholderOpacity:!1,ringOpacity:!1,textOpacity:!1}}},d=Object.keys(l).filter(f=>(0,t.flagEnabled)(r,f)).map(f=>l[f]);return[r,...d,...o]}}(getAllConfigs)),getAllConfigs}var hasRequiredResolveConfig$1;function requireResolveConfig$1(){return hasRequiredResolveConfig$1||(hasRequiredResolveConfig$1=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return s}});const e=n(requireResolveConfig$2()),t=n(requireGetAllConfigs());function n(r){return r&&r.__esModule?r:{default:r}}function s(...r){let[,...a]=(0,t.default)(r[0]);return(0,e.default)([...r,...a])}}(resolveConfig$2)),resolveConfig$2}var resolveConfig_1,hasRequiredResolveConfig;function requireResolveConfig(){if(hasRequiredResolveConfig)return resolveConfig_1;hasRequiredResolveConfig=1;let i=requireResolveConfig$1();return resolveConfig_1=(i.__esModule?i:{default:i}).default,resolveConfig_1}var resolveConfigExports=requireResolveConfig();const resolveConfig=getDefaultExportFromCjs$1(resolveConfigExports),config={content:["./index.html","./src/**/*.{js,ts,jsx,tsx}"],prefix:"pl-",darkMode:["class",'[class= "dark"]'],theme:{extend:{colors:{playerColor:"rgb(var(--color-playerColor) / <alpha-value>)",playerColor1:"rgb(var(--color-playerColor1) / <alpha-value>)",main:{DEFAULT:"#651FFF",highLight:"#BB86FC",lightPurple:"#D4C5FF",light:"#7C4DFF",700:"#6833DD",dark:"#442D8E"},primary:{500:"#50A5FF",600:"#7C8EFF",700:"#027DFF",800:"#006ADA"},secondary:{DEFAULT:"#BCBDC0",50:"#FBFBFB",100:"#F7F7FC",200:"#EFF0F6",300:"#D9DBE9",400:"#A0A3BD",500:"#6E7191",600:"#4E4B66",700:"#262338",800:"#14142A",900:"#040412"},gray:{warm:"#ECEADC",highLight:"#E6E6E6",100:"#F5F5F5",300:"#D4D4D4",400:"#A3A3A3",500:"#737373",600:"#313A43",700:"#404040",800:"#151515"},dark:{1:"#1C1B1E",2:"#2C2C2C",3:"#303034",4:"#919094",5:"#E3E2E6",6:"#F2F0F4",7:"#BB86FC",8:"#E8DEFF",9:"#CDBDFF",10:"#383838",13:"#1C1B1F"},red:{light:"#EE1D23",200:"#EA0000",300:"#FCA5A5",500:"#EF4444",600:"#DC2626",700:"#B91C1C",zProgress:"#F74B50",error:"#F2B8B5",onError:"#601410"},lime:{300:"#A6F787",500:"#84CC16",600:"#65A30D",800:"#28752B",success:"#067306"},orange:{100:"#F15F22",200:"#FCC44D",600:"#F3732B",700:"#F15F22"},purple:{light:"#DACDFF"},warning:{DEFAULT:"#F5A623",100:"#DE8200"},z:{secondary:{50:"#FAFAFA",100:"#DBDDDE",500:"#939598",600:"#57585A"},yellow:{light:"#FAD832",login:"#FFBC39"},gray:{300:"#CDCDCD",400:"#BDBDBD",500:"#393E46",700:"#222831"},red:{progress:"#F64B50"},green:{DEFAULT:"#00B59C"}}}}},plugins:[]},wait=i=>new Promise(e=>setTimeout(e,i*1e3)),getRemainingTime=i=>{const e=Math.floor(Date.now()/1e3-i),t=new Intl.RelativeTimeFormat(conditions(ConditionName.isArabicLang)?Lang.ar:Lang.fa,{numeric:"auto"});switch(!0){case e<60:return t.format(-e,"second");case e<3600:return t.format(-Math.floor(e/60),"minute");case e<86400:return t.format(-Math.floor(e/3600),"hour");case e<2592e3:return t.format(-Math.floor(e/86400),"day");case e<31536e3:return t.format(-Math.floor(e/2592e3),"month");default:return t.format(-Math.floor(e/31536e3),"year")}},compare=(i,e)=>i.time<e.time?-1:i.time>e.time?1:0,handlePageTitle=i=>{i&&conditions(ConditionName.showModuleTitle)&&(document.title=i)},getUUID=()=>{let i=localStorage.getItem("hamrahiUUID");return i||(i=uuidGenerator(),localStorage.setItem("hamrahiUUID",i)),i.toString()},uuidGenerator=()=>{let i="xxxxxxxx-xxxx-Mxxx-Nxxx-x".replace(/[xMN]/g,e=>{let t;return e==="M"?t=Math.floor(1+Math.random()*5):e==="N"?t=Math.floor(8+Math.random()*4):t=Math.floor(Math.random()*16),t.toString(16)});return i+=Date.now().toString(16),i},isTouchScreen=()=>"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,isTouchScreenLandscape=()=>{const{videoElementSizeInfo:i}=store.getState().videoData,{isFullScreen:e}=store.getState().controller;return conditions(ConditionName.isMiniPlayer)&&i.width!==0?isTouchScreen()&&i.width>i.height:isTouchScreen()&&e},isTouchScreenPortrait=()=>{const{isFullScreen:i}=store.getState().controller;return isTouchScreen()&&!i},handleIsComplexDesktop=i=>!isTouchScreen()&&!document.fullscreenElement&&i,isIOS=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,controllbarIconSize={miniPlayer:15,other:20},addZeroBefore=i=>(i<10?"0":"")+i,secondsToHMS=i=>{const e=Math.floor(i/3600),t=Math.floor(i%3600/60),n=Math.floor(i%3600%60);return e<1?`${addZeroBefore(t)}:${addZeroBefore(n)}`:`${addZeroBefore(e)}:${addZeroBefore(t)}:${addZeroBefore(n)}`},secondsToPersianHMS=i=>{const e=Math.floor(i/3600),t=Math.floor(i%3600/60),n=Math.floor(i%3600%60),s=n?`${n} ${translate().seconds}`:null,r=t?`${t} ${translate().minutes}`:null;return[e?`${e} ${translate().hour}`:null,r,s].filter(o=>o!==null)},efficientSecondsToPersianHMS=i=>{const e=i>=3600?Math.floor(i/3600):0,t=i>=60?Math.floor(i%3600/60):0,n=i<60*60?Math.floor(i%3600%60):0,s=n?`${n} ${translate().seconds}`:null,r=t?`${t} ${translate().minutes}`:null;return[e?`${e} ${translate().hour}`:null,r,s].filter(o=>o!==null).join(" و ")},staticFormats=i=>["mp4","mkv","mov","m4v"].includes(i)?"mp4":i==="webm"||i==="flv"?i:["mp3","ogg"].includes(i)?"mp3":!1,addUuidToSrc=i=>{const e=new URL(i);let t=i;return e.search.length?t+=`&uuid=${getUUID()}`:t+=`?uuid=${getUUID()}`},handleSumVotes=i=>{let e=0;return i&&Object.keys(i).length>0&&i.options.length>0&&i.options.forEach(t=>{livePoll()&&livePoll().polls.filter(n=>n.qid===i.id&&n.oid===t.id&&n.sumOptionVotes===t.vote+1).length>0&&(e+=1),e+=t.vote}),e},checkParentTarget=(i,e)=>{try{return[i.target.id,i.target.parentNode.id,i.target.parentNode.parentNode.id,i.target.parentNode.parentNode.parentNode.id,i.target.parentNode.parentNode.parentNode.parentNode.id].includes(e)}catch{return!1}},unitization=i=>i/1e3<1?{value:i,unit:""}:i/(1e3*1e3)<1?{value:Math.ceil(i/1e3*10)/10,unit:"K"}:i/(1e3*1e3*1e3)<1?{value:Math.ceil(i/(1e3*1e3)*10)/10,unit:"M"}:{value:0,unit:""},handleNotActiveText=(i="404")=>{if(i==="liveAndVod")return{title:translate().currentlyNoVideoContent,description:translate().viewOtherVideos};if(i==="404"||i===void 0)return{title:"404",description:translate().enteredAddressNotCorrect}},isVoted=i=>livePoll()&&livePoll().polls.some(e=>e.qid===i),isSelectedOption=(i,e)=>livePoll()&&livePoll().polls.some(t=>t.qid===i&&t.oid===e),appendQueryParamsToChunks=i=>{const e=store.dispatch,{token:t,params:n}=store.getState().videoData;let s="";s=i.split("m3u8")[1],s?s=`${s}&uuid=${getUUID()}`:s=`?uuid=${getUUID()}`,conditions(ConditionName.isAuth)&&(hasQuestionMark(s)?s=`${s}&token=${t}`:s=`?token=${t}`),conditions(ConditionName.hasDaaniTokenParams)&&(hasQuestionMark(s)?s=`${s}&ext_user=${n.daaniToken}`:s=`?ext_user=${n.daaniToken}`),e(setStreamLinkParams(s))},inViewPort=i=>{if(i){const e=i.offsetLeft-i.offsetWidth/2,t=window.innerWidth-(i.offsetLeft+i.offsetWidth);if(e>=0&&t>=0)return"inViewport";if(e<0)return"OutViewPortFromLeft";if(t<0)return"OutViewPortFromRight"}},handleIsComplexPortrait=i=>i.portrait==="true"&&isTouchScreenPortrait()&&i.isGeneral!=="true"&&i.raw!=="true",isFullMobilePortrait=()=>{const{params:i,videoElementSizeInfo:e}=store.getState().videoData;return i.portrait!=="true"&&(+e.width.toFixed(0)===window.screen.width||+e.width.toFixed(0)===window.screen.availWidth)&&(window.screen.height>window.screen.width||window.screen.availHeight>window.screen.availWidth)},handleRippleCircle=(i,e)=>{const t=document.getElementById(e),n=document.createElement("span");n.style.width=n.style.height="50px",n.style.left=`${i.touches[0].clientX-t.offsetLeft-25}px`,n.style.top=`${i.touches[0].clientY-t.offsetTop-25}px`,n.classList.add("pl-ripple");const s=t.getElementsByClassName("pl-ripple")[0];s&&s.remove(),t.appendChild(n)},handleRipple=(i,e,t=50)=>{const n=i.clientX!==void 0?i.clientX:i.touches[0].clientX,s=i.clientY!==void 0?i.clientY:i.touches[0].clientY,r=document.getElementById(e),a=document.createElement("span");a.style.width=a.style.height=`${t}px`,a.style.left=`${n-t/2}px`,a.style.top=`${s-r.getBoundingClientRect().top-t/2}px`,a.classList.add("pl-ripple");const o=r.getElementsByClassName("pl-ripple")[0];o&&o.remove(),r.appendChild(a)},changeVideoUrl=(i,e)=>{const{params:t}=store.getState().videoData,n=findFirstVideoInRecommendationList(),s=i||n.type,r=e||n.id;if(conditions(ConditionName.hasSportProvider)){const a=window.location.href.split("?")[1];return a?`${window.location.origin}/ngpplayer/${s}/${r}?${a}`:`${window.location.origin}/ngpplayer/${s}/${r}`}else return window.location.href.replace(`type=${t.type}`,`type=${s}`).replace(`id=${t.id}`,`id=${r}`)},hasQuestionMark=i=>!!i.match(/\?/g),responseValidator=i=>i>=200&&i<300,generateNewAccessToken=async()=>{var i,e,t;if((i=authToken.get())!=null&&i.refresh){const{data:n,status:s}=await apiCaller({url:API().auth.refresh,method:"POST",data:{refresh:(e=authToken.get())==null?void 0:e.refresh}});if(responseValidator(s)){const r={access:n.access,refresh:(t=authToken.get())==null?void 0:t.refresh,token_id:n.token_id};authToken.set(r)}else throw authToken.remove(),new Error("")}},isWhiteListUrl=i=>!!whiteListTargets.find(e=>new URL(i).origin.includes(e)),handlePopoverSizeInMiniPlayer=()=>{const{videoElementSizeInfo:i}=store.getState().videoData;return conditions(ConditionName.isMiniPlayer)&&!conditions(ConditionName.isFullMobilePortrait)?{top:i.top,height:i.height,left:i.left}:{}},numbersToLetters=[translate().first,translate().second,translate().third,translate().fourth,translate().fifth,translate().sixth,translate().seventh,translate().eighth,translate().ninth,translate().tenth,translate().eleventh,translate().twelfth,translate().thirteenth,translate().fourteenth,translate().fifteenth,translate().sixteenth,translate().seventeenth,translate().eighteenth,translate().nineteenth,translate().twentieth],handleVideoType=()=>{const{params:i}=store.getState().videoData;switch(i.type){case"vod":return VideoNumberTypeEnum.Vod;case"archive":case"live":return VideoNumberTypeEnum.Archive;case"clip":return VideoNumberTypeEnum.Clip;default:return VideoNumberTypeEnum.FutureLive}},handleHasXTokenParamOrSendXToken=()=>{if(conditions(ConditionName.hasXTokenParamOrSendXToken))return{"x-token":store.getState().videoData.params.xToken}},handleGetBookmarkCategory=i=>{switch(i){case"film":return BookmarkCategory.FILM;case"sport":return BookmarkCategory.SPORT;default:return BookmarkCategory.FILM}};function getWebEnvConfig(i){const t=store.getState().videoData.webListConfig.find(n=>n.key===i);return t?t.value:""}const clearRedux=()=>{const i=store.dispatch;i(setClearVideoDataSlice()),i(setClearControllerSlice()),i(setClearUserSlice()),i(setClearTagsSlice()),i(setClearPopoversSlice()),i(setClearCommentsSlice()),i(setClearChatSlice())},weighted_random=i=>{let e,t=[];for(e=0;e<i.length;e++)t[e]=i[e].weight+(t[e-1]||0);let n=Math.random()*t[t.length-1];for(e=0;e<t.length&&!(t[e]>n);e++);return i[e].domain},imageFormatChecking=i=>["jpg","png","jpeg"].includes(i.toLowerCase().split(".")[i.toLowerCase().split(".").length-1]),handlePageLoadTime=i=>{let e=0;performance&&performance.getEntriesByType("navigation")&&(e=performance.getEntriesByType("navigation")[0].duration),i.current=e},highestResolutionSupported=(i,e,t)=>{const n=e*window.devicePixelRatio,s=t*window.devicePixelRatio;let r=[];return conditions(ConditionName.isTouchScreenPortrait)?r=i.filter(a=>Number(a.split("x")[0].trim())<=n):r=i.filter(a=>Number(a.split("x")[0].trim())<=s||Number(a.split("x")[1].trim())<=n),r.indexOf(r[r.length-1])},getSubtitleLabel=i=>{let e;switch(i){case"fa":e=translate().persian;break;case"en":e=translate().english;break;case"ar":e=translate().arabic;break;case"tr":e=translate().turkish;break}return e},strToObj=str=>{var obj={};if(str&&typeof str=="string"){var objStr=str.match(/\{(.)+\}/g);eval("obj ="+objStr)}return obj},hasPermissionToRedirect=i=>{const e=store.dispatch;if(e(setIsFetchDetails(!0)),i)try{const t=new URL(i);isWhiteListGeneralUrl(t.hostname,whiteListGeneralUrl)?e(setIsValidAddress(!0)):(e(setErrorType("404")),e(setIsValidAddress(!1)))}catch{e(setErrorType("404")),e(setIsValidAddress(!1))}};function isWhiteListGeneralUrl(i,e){for(let t=0;t<e.length;t++)if(i.startsWith(e[t]))return!0;return!1}const flattenObject=(i,e)=>{let t={};for(const n in i){const s=e?`${e}_${n}`:n;typeof i[n]=="object"&&!Array.isArray(i[n])?t={...t,...flattenObject(i[n],s)}:t[s]=i[n]}return t},findIntersectionBetweenTwoArray=(i,e)=>i.filter(t=>!e.includes(t)),sortLanguages=i=>{const e={fa:1,en:2};return i.slice().sort((t,n)=>{const s=e[t.lang]||999,r=e[n.lang]||999;return s-r})},hexToRGB=(i,e=1,t=!1)=>{const n=parseInt(i.slice(1,3),16),s=parseInt(i.slice(3,5),16),r=parseInt(i.slice(5,7),16);return t?`${n} ${s} ${r}`:e?"rgba("+n+", "+s+", "+r+", "+e+")":"rgb("+n+", "+s+", "+r+")"},checkIsOnPremise=i=>{const{params:e}=store.getState().videoData;return conditions(ConditionName.isOnPermise)?window.location.origin:e.baseUrl??i},handle360=async()=>{let i=!1;(window.DeviceOrientationEvent||window.DeviceMotionEvent)&&(i=await GyroControl.isAvailable());const e=new View360("#videoTagContainer",{zoomRange:{min:.35,max:3},initialZoom:.41,gyro:i});return e.on("inputStart",()=>store.dispatch(setIsViewChangeIn360(!0))),e.on("inputEnd",()=>store.dispatch(setIsViewChangeIn360(!1))),e.load(new EquirectProjection({src:videoTag(),video:{autoplay:!0}})),e},fullConfig=resolveConfig(config),getTailwindColor=i=>i.split(".").reduce((e,t)=>e==null?void 0:e[t],fullConfig.theme),sendFluentLog=i=>{const{poll_emoji:e}=store.getState().user.settings,{params:t,details:n}=store.getState().videoData;let s={...i,timestamp:Date.now(),clientUUID:getUUID(),uuid:getUUID(),link:window.location.href,user_id:conditions(ConditionName.isLiveParam)?Number(t.id):n.user_id,live_id:conditions(ConditionName.isLiveParam)?n.id:null,format:i.category==="feedback"?conditions(ConditionName.isStaticFormat)?"static":"hls":void 0,content_type:n.content_type,content_id:n.content_id};conditions(ConditionName.isLiveParam)&&(s[featureToggle]=e),apiCaller({url:API().logs,method:"post",data:s})};function errorLogProvider(i){i&&sendFluentLog(ExceptionsLog(i.type,i.message))}class ErrorBoundary extends React2.Component{constructor(){super(...arguments);Te(this,"state",{hasError:!1,error:null,errorInfo:null})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){this.setState({error:t,errorInfo:n}),console.log(t,n),errorLogProvider({type:"OTHER_ERROR",message:t.message})}render(){return this.state.hasError?jsxRuntime.jsx(jsxRuntime.Fragment,{}):this.props.children}}const useAppDispatch=()=>useDispatch(),useAppSelector=useSelector,useKeyPress=(i,e)=>{const t=React2.useRef(e);React2.useEffect(()=>{t.current=e},[]),React2.useEffect(()=>{const n=s=>{s.code===i&&!["INPUT","TEXTAREA"].includes(s.target.nodeName)&&!s.target.isContentEditable&&!conditions(ConditionName.showTagsPopover)&&!conditions(ConditionName.showPersonalMarkerPopover)&&!conditions(ConditionName.showFeedbackPopover)&&t.current(s)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[i])},useHandleKeyPress=()=>{const i=useAppDispatch();useKeyPress("Space",e=>{conditions(ConditionName.isPressKeySpace)&&handlePlayPause(e)}),useKeyPress("KeyK",e=>{conditions(ConditionName.isPressKeyK)&&handlePlayPause(e)}),useKeyPress("ArrowRight",e=>{conditions(ConditionName.isPressKeyArrowRight)&&conditions(ConditionName.hasTimeMachine)&&handleBackwardForward("forward",15,e)}),useKeyPress("ArrowLeft",e=>{conditions(ConditionName.isPressKeyArrowLeft)&&conditions(ConditionName.hasTimeMachine)&&handleBackwardForward("backward",15,e)}),useKeyPress("KeyI",()=>{conditions(ConditionName.isPressKeyI)&&videoTag().requestPictureInPicture()}),useKeyPress("KeyF",()=>{conditions(ConditionName.isPressKeyF)&&handleFullScreen()}),useKeyPress("KeyL",()=>{conditions(ConditionName.isPressKeyL)&&handleLock(conditions(ConditionName.isLock)?"unlock":"lock")}),useKeyPress("KeyC",()=>{conditions(ConditionName.isPressKeyC)&&handleSubtitle()}),useKeyPress("KeyN",()=>{conditions(ConditionName.isPressKeyN)&&(handleClickRecommendationCard(),handleClickVideoCard())}),useKeyPress("KeyQ",()=>{if(conditions(ConditionName.isPressKeyQ)){const{multiLivesPopover:e}=store.getState().popovers;i(setMultiLivesPopovers(!e))}}),useKeyPress("KeyE",()=>{if(conditions(ConditionName.isPressKeyE)){const{markersListPopover:e}=store.getState().popovers;i(setClearPopoversSlice()),i(setMarkersListPopover(!e)),conditions(ConditionName.isActiveElements)?conditions(ConditionName.showMarkerListPopover)||i(setActiveElements(!1)):i(setActiveElements(!0))}}),useKeyPress("KeyS",()=>{const{speedPopover:e}=store.getState().popovers;i(setClearPopoversSlice()),conditions(ConditionName.isPressKeyS)&&(i(setSpeedPopover(!e)),conditions(ConditionName.isActiveElements)?conditions(ConditionName.showSpeedPopover)||i(setActiveElements(!1)):i(setActiveElements(!0)))}),useKeyPress("KeyM",()=>{if(conditions(ConditionName.isPressKeyM)){const{settings:e}=store.getState().user;handleChangeSoundVolume(e.volume?0:50)}})},useColorSwitcher=()=>{const i=window.matchMedia("(prefers-color-scheme: light)"),e=localStorage.getItem("theme");i.addEventListener("change",function(n){n.matches?t(Theme.DARK):t(Theme.LIGHT)});const t=n=>{const s=window.document.documentElement;s.classList.remove(n===Theme.DARK?Theme.LIGHT:Theme.DARK),s.classList.add(n),localStorage.setItem("theme",n)};return React2.useEffect(()=>{e&&t("light")},[e]),null},useHandleParams=i=>{const e=useAppDispatch(),{token:t,params:n}=useAppSelector(({videoData:{token:E,params:F}})=>({token:E,params:F}),shallowEqual),{isClickInnerCard:s}=useAppSelector(({controller:{isClickInnerCard:E}})=>({isClickInnerCard:E}),shallowEqual),[r,a]=React2.useState([]),[o,l]=React2.useState([]);let d={};const f=async()=>{i.isAuth==="true"?t&&e(setIsReady(!0)):e(setIsReady(!0))},u=()=>e(setPlayerParams(d)),p=()=>{if(i.theme){const E=i.theme===Theme.LIGHT?Theme.LIGHT:Theme.DARK;e(setTheme(E)),d.theme=E}else window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(e(setTheme(Theme.DARK)),d.theme="dark"):(e(setTheme(Theme.LIGHT)),d.theme="light")},m=()=>{let E=d.featureSet;return typeof d.featureSet=="string"&&(E=strToObj(d.featureSet)),d.featureSet=E,d},g=()=>{i.uuid&&(localStorage.setItem("hamrahiUUID",i.uuid),d.uuid=i.uuid)},y=()=>{const E=api.get("xToken");E&&!d.xToken&&(d.xToken=E)},v=()=>{d={portrait:conditions(ConditionName.isTouchScreen)&&i.isGeneral!=="true"?"true":"false",provider:"unknown",chart:"true",authentication:"true",...i},e(setIsComplexDesktop(d.portrait==="true"&&!conditions(ConditionName.isTouchScreen))),e(setIsComplexPortrait(handleIsComplexPortrait({portrait:d.portrait,...i})))},b=()=>{const E=String(i["e-url"]),F=String(i["e-cover"]);d={src:E.endsWith("/")?window.atob(E.slice(0,-1)):window.atob(E),type:i.type,fullscreen:i.fullscreen,autoplay:i.autoplay,snapshot:i.snapshot,portrait:"false",fullrate:i.fullrate,width:i.width,height:i.height,cover:F&&F!=="undefined"?window.atob(F):void 0,onFinished:i.onFinished,onSnapshot:i.onSnapshot,uuid:getUUID(),disableMiniPlayer:i.disableMiniPlayer}},C=(E,F,O)=>{const A=Object.keys(E);let N=findIntersectionBetweenTwoArray(F,A),M=A.filter(Z=>findIntersectionBetweenTwoArray(findIntersectionBetweenTwoArray(allParams,F),O).includes(Z));return{requiredItems:N,notRequiredItems:M}},_=()=>{let E=[],F=[];return i.quiz==="true"?(E=quizConditions.required,F=quizConditions.optionals):i.raw==="true"?(E=rawConditions.required,F=rawConditions.optionals):i.isGeneral==="true"?(E=isGeneralConditions.required,F=isGeneralConditions.optionals):i.type==="mp4"?(E=staticConditions.required,F=staticConditions.optionals):["live","vod","archive","clip"].includes(String(i.type))&&(E=nonStaticConditions.required,F=nonStaticConditions.optionals),{requiredConditions:E,optionalsConditions:F}},R=async()=>{if(d={},Object.keys(i).includes("type")){const{requiredItems:E,notRequiredItems:F}=C(i,_().requiredConditions,_().optionalsConditions);l(F),E.length?a(E):(["live","vod","archive","clip"].includes(String(i.type))?(v(),y()):staticFormats(String(i.type))&&b(),g(),Object.keys(d)&&m(),p(),u(),f())}else a(["type"])};return React2.useLayoutEffect(()=>{n.id&&i.quiz!=="true"&&s&&(i={...n,homeButtonClickFlag:i.homeButtonClickFlag},R())},[n.id]),React2.useLayoutEffect(()=>{R()},[i,t,s]),{requiredItems:r,notRequiredItems:o}},StaticPlayer=React2.lazy(()=>Promise.resolve().then(()=>player$1)),LiveAndVodPlayer$1=React2.lazy(()=>Promise.resolve().then(()=>player)),ParamsErrorPopover$1=React2.lazy(()=>Promise.resolve().then(()=>paramsErrorPopover)),VideoPlayer$2=({params:i})=>{const e=useAppDispatch();useAppSelector(({controller:{isFullScreen:a}})=>({isFullScreen:a}),shallowEqual),useAppSelector(({videoData:{isReady:a,params:o,isComplexPortrait:l}})=>({isReady:a,params:o,isComplexPortrait:l}),shallowEqual);const{requiredItems:t,notRequiredItems:n}=useHandleParams(i);useHandleKeyPress(),useColorSwitcher(),React2.useEffect(()=>(e(setIsClickInnerCard(!1)),()=>clearRedux()),[]),React2.useEffect(()=>{const a=localStorage.getItem("isAutoPlay");a&&e(setIsAutoPlay(a==="true")),Document.prototype.playPause=o=>handlePlayPauseInDOM(o),conditions(ConditionName.isIOS)||window.screen.orientation.addEventListener("change",o=>{!conditions(ConditionName.isFullScreen)&&conditions(ConditionName.isParamsPortrait)&&e(setIsComplexPortrait(!0));const l=document.getElementById("video-player-module");l&&(o.target.type.includes("landscape")&&!conditions(ConditionName.isFullScreen)?(l.classList.add("pl-overflow-scroll"),l.classList.remove("pl-overflow-hidden")):(l.classList.add("pl-overflow-hidden"),l.classList.remove("pl-overflow-scroll")))})},[]);const s=()=>{let a="";return conditions(ConditionName.isParamsPortrait)?window.innerWidth>window.innerHeight&&conditions(ConditionName.isFullScreen)?a="pl-overflow-hidden":window.innerWidth>window.innerHeight&&!conditions(ConditionName.isFullScreen)?a="pl-overflow-auto":window.innerWidth<window.innerHeight&&(a="pl-overflow-hidden"):a="pl-overflow-hidden",a};let r=jsxRuntime.jsx(jsxRuntime.Fragment,{});return t.length||n.length||!conditions(ConditionName.hasAllParams)?r=jsxRuntime.jsx(React2.Suspense,{fallback:"",children:jsxRuntime.jsx(ParamsErrorPopover$1,{requiredItems:t,notRequiredItems:n})}):conditions(ConditionName.isReady)?r=jsxRuntime.jsx("div",{className:`video-player-container ${s()} ${conditions(ConditionName.isComplexPortrait)&&"!no-scrollbar pl-max-h-[100dvh]"} ${conditions(ConditionName.isFullScreen)&&"pl-fixed pl-right-0 pl-top-0 pl-h-screen pl-w-screen !pl-overflow-hidden"}`,style:{zIndex:zIndex.videoPlayerInFullScreen,touchAction:"pan-y"},id:"video-player-module",children:jsxRuntime.jsx(React2.Suspense,{fallback:"",children:conditions(ConditionName.isStaticFormat)?jsxRuntime.jsx(StaticPlayer,{}):jsxRuntime.jsx(LiveAndVodPlayer$1,{})})}):r=jsxRuntime.jsx("div",{className:"!pl-aspect-video pl-max-h-screen pl-w-full pl-overflow-hidden pl-bg-white dark:pl-bg-black"}),jsxRuntime.jsxs(ErrorBoundary,{children:[jsxRuntime.jsx(nt,{position:"bottom-right",autoClose:3e3,theme:conditions(ConditionName.isDarkMode)?"dark":"light"}),r]})};var dist={},hasRequiredDist;function requireDist(){if(hasRequiredDist)return dist;hasRequiredDist=1,Object.defineProperty(dist,"__esModule",{value:!0}),dist.parse=a,dist.serialize=d;const i=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,t=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,s=Object.prototype.toString,r=(()=>{const p=function(){};return p.prototype=Object.create(null),p})();function a(p,m){const g=new r,y=p.length;if(y<2)return g;const v=(m==null?void 0:m.decode)||f;let b=0;do{const C=p.indexOf("=",b);if(C===-1)break;const _=p.indexOf(";",b),R=_===-1?y:_;if(C>R){b=p.lastIndexOf(";",C-1)+1;continue}const E=o(p,b,C),F=l(p,C,E),O=p.slice(E,F);if(g[O]===void 0){let A=o(p,C+1,R),N=l(p,R,A);const M=v(p.slice(A,N));g[O]=M}b=R+1}while(b<y);return g}function o(p,m,g){do{const y=p.charCodeAt(m);if(y!==32&&y!==9)return m}while(++m<g);return g}function l(p,m,g){for(;m>g;){const y=p.charCodeAt(--m);if(y!==32&&y!==9)return m+1}return g}function d(p,m,g){const y=(g==null?void 0:g.encode)||encodeURIComponent;if(!i.test(p))throw new TypeError(`argument name is invalid: ${p}`);const v=y(m);if(!e.test(v))throw new TypeError(`argument val is invalid: ${m}`);let b=p+"="+v;if(!g)return b;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);b+="; Max-Age="+g.maxAge}if(g.domain){if(!t.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);b+="; Domain="+g.domain}if(g.path){if(!n.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);b+="; Path="+g.path}if(g.expires){if(!u(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);b+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(b+="; HttpOnly"),g.secure&&(b+="; Secure"),g.partitioned&&(b+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":b+="; Priority=Low";break;case"medium":b+="; Priority=Medium";break;case"high":b+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":b+="; SameSite=Strict";break;case"lax":b+="; SameSite=Lax";break;case"none":b+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return b}function f(p){if(p.indexOf("%")===-1)return p;try{return decodeURIComponent(p)}catch{return p}}function u(p){return s.call(p)==="[object Date]"}return dist}requireDist();/**
80
80
  * react-router v7.3.0
81
81
  *
82
82
  * Copyright (c) Remix Software Inc.