gearboxdownloadmodal 8.0.3 → 8.0.5
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.
- package/dist/index.es.js +12 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/src/services/getNetworks.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -53,7 +53,7 @@ Valid keys: `+JSON.stringify(Object.keys(x),null," "));var Y=me(_,$,D,H,F+"."+$
|
|
|
53
53
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Qs]=this[Qs]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=sn(o);r[a]||(Qu(i,o),r[a]=!0)}return w.isArray(e)?e.forEach(s):s(e),this}}Yn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),w.reduceDescriptors(Yn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),w.freezeMethods(Yn);const et=Yn;function Yr(t,e){const n=this||Rr,r=e||n,i=et.from(r.headers);let s=r.data;return w.forEach(t,function(a){s=a.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Fs(t){return!!(t&&t.__CANCEL__)}function Yt(t,e,n){ie.call(this,t??"canceled",ie.ERR_CANCELED,e,n),this.name="CanceledError"}w.inherits(Yt,ie,{__CANCEL__:!0});function _s(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new ie("Request failed with status code "+n.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Fu(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function _u(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const A=Date.now(),u=r[s];o||(o=A),n[i]=l,r[i]=A;let c=s,f=0;for(;c!==i;)f+=n[c++],c=c%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),A-o<e)return;const p=u&&A-u;return p?Math.round(f*1e3/p):void 0}}function $u(t,e){let n=0;const r=1e3/e;let i=null;return function(){const o=this===!0,a=Date.now();if(o||a-n>r)return i&&(clearTimeout(i),i=null),n=a,t.apply(null,arguments);i||(i=setTimeout(()=>(i=null,n=Date.now(),t.apply(null,arguments)),r-(a-n)))}}const Nn=(t,e,n=3)=>{let r=0;const i=_u(50,250);return $u(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,A=i(l),u=o<=a;r=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:A||void 0,estimated:A&&a&&u?(a-o)/A:void 0,event:s,lengthComputable:a!=null};c[e?"download":"upload"]=!0,t(c)},n)},eA=$e.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=w.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),tA=$e.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];w.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),w.isString(r)&&o.push("path="+r),w.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function nA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function rA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $s(t,e){return t&&!nA(e)?rA(t,e):e}const eo=t=>t instanceof et?{...t}:t;function Ct(t,e){e=e||{};const n={};function r(A,u,c){return w.isPlainObject(A)&&w.isPlainObject(u)?w.merge.call({caseless:c},A,u):w.isPlainObject(u)?w.merge({},u):w.isArray(u)?u.slice():u}function i(A,u,c){if(w.isUndefined(u)){if(!w.isUndefined(A))return r(void 0,A,c)}else return r(A,u,c)}function s(A,u){if(!w.isUndefined(u))return r(void 0,u)}function o(A,u){if(w.isUndefined(u)){if(!w.isUndefined(A))return r(void 0,A)}else return r(void 0,u)}function a(A,u,c){if(c in e)return r(A,u);if(c in t)return r(void 0,A)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(A,u)=>i(eo(A),eo(u),!0)};return w.forEach(Object.keys(Object.assign({},t,e)),function(u){const c=l[u]||i,f=c(t[u],e[u],u);w.isUndefined(f)&&c!==a||(n[u]=f)}),n}const to=t=>{const e=Ct({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=e;e.headers=o=et.from(o),e.url=Bs($s(e.baseURL,e.url),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(w.isFormData(n)){if($e.hasStandardBrowserEnv||$e.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[A,...u]=l?l.split(";").map(c=>c.trim()).filter(Boolean):[];o.setContentType([A||"multipart/form-data",...u].join("; "))}}if($e.hasStandardBrowserEnv&&(r&&w.isFunction(r)&&(r=r(e)),r||r!==!1&&eA(e.url))){const A=i&&s&&tA.read(s);A&&o.set(i,A)}return e},iA=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const i=to(t);let s=i.data;const o=et.from(i.headers).normalize();let{responseType:a}=i,l;function A(){i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let u=new XMLHttpRequest;u.open(i.method.toUpperCase(),i.url,!0),u.timeout=i.timeout;function c(){if(!u)return;const p=et.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!a||a==="text"||a==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:p,config:t,request:u};_s(function(C){n(C),A()},function(C){r(C),A()},m),u=null}"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(c)},u.onabort=function(){u&&(r(new ie("Request aborted",ie.ECONNABORTED,i,u)),u=null)},u.onerror=function(){r(new ie("Network Error",ie.ERR_NETWORK,i,u)),u=null},u.ontimeout=function(){let g=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const m=i.transitional||Xs;i.timeoutErrorMessage&&(g=i.timeoutErrorMessage),r(new ie(g,m.clarifyTimeoutError?ie.ETIMEDOUT:ie.ECONNABORTED,i,u)),u=null},s===void 0&&o.setContentType(null),"setRequestHeader"in u&&w.forEach(o.toJSON(),function(g,m){u.setRequestHeader(m,g)}),w.isUndefined(i.withCredentials)||(u.withCredentials=!!i.withCredentials),a&&a!=="json"&&(u.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&u.addEventListener("progress",Nn(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Nn(i.onUploadProgress)),(i.cancelToken||i.signal)&&(l=p=>{u&&(r(!p||p.type?new Yt(null,t,u):p),u.abort(),u=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const f=Fu(i.url);if(f&&$e.protocols.indexOf(f)===-1){r(new ie("Unsupported protocol "+f+":",ie.ERR_BAD_REQUEST,t));return}u.send(s||null)})},sA=(t,e)=>{let n=new AbortController,r;const i=function(l){if(!r){r=!0,o();const A=l instanceof Error?l:this.reason;n.abort(A instanceof ie?A:new Yt(A instanceof Error?A.message:A))}};let s=e&&setTimeout(()=>{i(new ie(`timeout ${e} of ms exceeded`,ie.ETIMEDOUT))},e);const o=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",i):l.unsubscribe(i))}),t=null)};t.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=o,[a,()=>{s&&clearTimeout(s),s=null}]},oA=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},aA=async function*(t,e,n){for await(const r of t)yield*oA(ArrayBuffer.isView(r)?r:await n(String(r)),e)},no=(t,e,n,r,i)=>{const s=aA(t,e,i);let o=0;return new ReadableStream({type:"bytes",async pull(a){const{done:l,value:A}=await s.next();if(l){a.close(),r();return}let u=A.byteLength;n&&n(o+=u),a.enqueue(new Uint8Array(A))},cancel(a){return r(a),s.return()}},{highWaterMark:2})},ro=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},Jn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",io=Jn&&typeof ReadableStream=="function",Nr=Jn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),lA=io&&(()=>{let t=!1;const e=new Request($e.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),so=64*1024,Jr=io&&!!(()=>{try{return w.isReadableStream(new Response("").body)}catch{}})(),Dn={stream:Jr&&(t=>t.body)};Jn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Dn[e]&&(Dn[e]=w.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new ie(`Response type '${e}' is not supported`,ie.ERR_NOT_SUPPORT,r)})})})(new Response);const uA=async t=>{if(t==null)return 0;if(w.isBlob(t))return t.size;if(w.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(w.isArrayBufferView(t))return t.byteLength;if(w.isURLSearchParams(t)&&(t=t+""),w.isString(t))return(await Nr(t)).byteLength},AA=async(t,e)=>{const n=w.toFiniteNumber(t.getContentLength());return n??uA(e)},Dr={http:Ku,xhr:iA,fetch:Jn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:A,headers:u,withCredentials:c="same-origin",fetchOptions:f}=to(t);A=A?(A+"").toLowerCase():"text";let[p,g]=i||s||o?sA([i,s],o):[],m,v;const C=()=>{!m&&setTimeout(()=>{p&&p.unsubscribe()}),m=!0};let I;try{if(l&&lA&&n!=="get"&&n!=="head"&&(I=await AA(u,r))!==0){let G=new Request(e,{method:"POST",body:r,duplex:"half"}),Z;w.isFormData(r)&&(Z=G.headers.get("content-type"))&&u.setContentType(Z),G.body&&(r=no(G.body,so,ro(I,Nn(l)),null,Nr))}w.isString(c)||(c=c?"cors":"omit"),v=new Request(e,{...f,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",withCredentials:c});let K=await fetch(v);const E=Jr&&(A==="stream"||A==="response");if(Jr&&(a||E)){const G={};["status","statusText","headers"].forEach(M=>{G[M]=K[M]});const Z=w.toFiniteNumber(K.headers.get("content-length"));K=new Response(no(K.body,so,a&&ro(Z,Nn(a,!0)),E&&C,Nr),G)}A=A||"text";let b=await Dn[w.findKey(Dn,A)||"text"](K,t);return!E&&C(),g&&g(),await new Promise((G,Z)=>{_s(G,Z,{data:b,headers:et.from(K.headers),status:K.status,statusText:K.statusText,config:t,request:v})})}catch(K){throw C(),K&&K.name==="TypeError"&&/fetch/i.test(K.message)?Object.assign(new ie("Network Error",ie.ERR_NETWORK,t,v),{cause:K.cause||K}):ie.from(K,K&&K.code,t,v)}})};w.forEach(Dr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const oo=t=>`- ${t}`,cA=t=>w.isFunction(t)||t===null||t===!1,ao={getAdapter:t=>{t=w.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let o;if(r=n,!cA(n)&&(r=Dr[(o=String(n)).toLowerCase()],r===void 0))throw new ie(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since :
|
|
54
54
|
`+s.map(oo).join(`
|
|
55
55
|
`):" "+oo(s[0]):"as no adapter specified";throw new ie("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Dr};function Tr(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Yt(null,t)}function lo(t){return Tr(t),t.headers=et.from(t.headers),t.data=Yr.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ao.getAdapter(t.adapter||Rr.adapter)(t).then(function(r){return Tr(t),r.data=Yr.call(t,t.transformResponse,r),r.headers=et.from(r.headers),r},function(r){return Fs(r)||(Tr(t),r&&r.response&&(r.response.data=Yr.call(t,t.transformResponse,r.response),r.response.headers=et.from(r.response.headers))),Promise.reject(r)})}const uo="1.7.2",Gr={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Gr[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ao={};Gr.transitional=function(e,n,r){function i(s,o){return"[Axios v"+uo+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new ie(i(o," has been removed"+(n?" in "+n:"")),ie.ERR_DEPRECATED);return n&&!Ao[o]&&(Ao[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};function dA(t,e,n){if(typeof t!="object")throw new ie("options must be an object",ie.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new ie("option "+s+" must be "+l,ie.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ie("Unknown option "+s,ie.ERR_BAD_OPTION)}}const Pr={assertOptions:dA,validators:Gr},gt=Pr.validators;class Tn{constructor(e){this.defaults=e,this.interceptors={request:new Vs,response:new Vs}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
56
|
-
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ct(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Pr.assertOptions(r,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean)},!1),i!=null&&(w.isFunction(i)?n.paramsSerializer={serialize:i}:Pr.assertOptions(i,{encode:gt.function,serialize:gt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&w.merge(s.common,s[n.method]);s&&w.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=et.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const A=[];this.interceptors.response.forEach(function(m){A.push(m.fulfilled,m.rejected)});let u,c=0,f;if(!l){const g=[lo.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,A),f=g.length,u=Promise.resolve(n);c<f;)u=u.then(g[c++],g[c++]);return u}f=a.length;let p=n;for(c=0;c<f;){const g=a[c++],m=a[c++];try{p=g(p)}catch(v){m.call(this,v);break}}try{u=lo.call(this,p)}catch(g){return Promise.reject(g)}for(c=0,f=A.length;c<f;)u=u.then(A[c++],A[c++]);return u}getUri(e){e=Ct(this.defaults,e);const n=$s(e.baseURL,e.url);return Bs(n,e.params,e.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(e){Tn.prototype[e]=function(n,r){return this.request(Ct(r||{},{method:e,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(r){return function(s,o,a){return this.request(Ct(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Tn.prototype[e]=n(),Tn.prototype[e+"Form"]=n(!0)});const Gn=Tn;class Hr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Yt(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Hr(function(i){e=i}),cancel:e}}}const fA=Hr;function pA(t){return function(n){return t.apply(null,n)}}function hA(t){return w.isObject(t)&&t.isAxiosError===!0}const Br={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Br).forEach(([t,e])=>{Br[e]=t});const mA=Br;function co(t){const e=new Gn(t),n=ks(Gn.prototype.request,e);return w.extend(n,Gn.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return co(Ct(t,i))},n}const xe=co(Rr);xe.Axios=Gn,xe.CanceledError=Yt,xe.CancelToken=fA,xe.isCancel=Fs,xe.VERSION=uo,xe.toFormData=Rn,xe.AxiosError=ie,xe.Cancel=xe.CanceledError,xe.all=function(e){return Promise.all(e)},xe.spread=pA,xe.isAxiosError=hA,xe.mergeConfig=Ct,xe.AxiosHeaders=et,xe.formToJSON=t=>Us(w.isHTMLForm(t)?new FormData(t):t),xe.getAdapter=ao.getAdapter,xe.HttpStatusCode=mA,xe.default=xe;const gA=xe;/*! typescript-cookie v1.0.6 | MIT */const fo=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),po=t=>encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Vr=decodeURIComponent,Xr=t=>(t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function yA(t){return t=Object.assign({},t),typeof t.expires=="number"&&(t.expires=new Date(Date.now()+t.expires*864e5)),t.expires!=null&&(t.expires=t.expires.toUTCString()),Object.entries(t).filter(([e,n])=>n!=null&&n!==!1).map(([e,n])=>n===!0?`; ${e}`:`; ${e}=${n.split(";")[0]}`).join("")}function ho(t,e,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,i={};let s;for(;(s=r.exec(document.cookie))!=null;)try{const o=n(s[1]);if(i[o]=e(s[2],o),t===o)break}catch{}return t!=null?i[t]:i}const mo=Object.freeze({decodeName:Vr,decodeValue:Xr,encodeName:fo,encodeValue:po}),Ur=Object.freeze({path:"/"});function go(t,e,n=Ur,{encodeValue:r=po,encodeName:i=fo}={}){return document.cookie=`${i(t)}=${r(e,t)}${yA(n)}`}function yo(t,{decodeValue:e=Xr,decodeName:n=Vr}={}){return ho(t,e,n)}function vA({decodeValue:t=Xr,decodeName:e=Vr}={}){return ho(void 0,t,e)}function qA(t,e=Ur){go(t,"",Object.assign({},e,{expires:-1}))}function Qr(t,e){const n={set:function(i,s,o){return go(i,s,Object.assign({},this.attributes,o),{encodeValue:this.converter.write})},get:function(i){if(arguments.length===0)return vA(this.converter.read);if(i!=null)return yo(i,this.converter.read)},remove:function(i,s){qA(i,Object.assign({},this.attributes,s))},withAttributes:function(i){return Qr(this.converter,Object.assign({},this.attributes,i))},withConverter:function(i){return Qr(Object.assign({},this.converter,i),this.attributes)}},r={attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}};return Object.create(n,r)}Qr({read:mo.decodeValue,write:mo.encodeValue},Ur);let vo;typeof window<"u"&&(vo=yo("token"));const ge=gA.create({headers:{Authorization:vo}});async function bA(t,e,n){return(await ge.post(n+"/createFlexVersionLinkMulti",{_id:t,networks:e})).data}async function CA(t,e){return t.network=="fb"&&(t.zip=1),(await ge.post(e+"/createFlexVersionLink",t||{})).data}async function wA(t,e,n){return(await ge.post(t+"/createImportedVersionLink",{_id:e,network:n})).data}async function xA(t,e,n,r,i){return(await ge.post(t+"/createPlayableVersionLink",{_id:e,network:n,isPfTest:r,extras:i})).data}async function ZA(t,e,n){return(await ge.post(n+"/createPlayableVersionLinkMulti",{_id:t,networks:e})).data}async function IA(t,e,n,r,i,s){return(await ge.post(t+"/createReadyVersionLink",{_id:e,network:n,isPfTest:r,extras:i,download:s})).data}async function SA(t,e,n){return(await ge.post(n+"/createReadyVersionLinkMulti",{_id:t,networks:e})).data}async function EA(t,e,n,r,i,s,o,a){return(await ge.post(t+"/createFusionVersionLink",{_id:e,network:n,fusionData:r,isPfTest:i,extras:s,androidLink:o,iosLink:a})).data}async function OA(t,e){return(await ge.post(e+"/updateFusionUrl",t||{})).data}async function kA(t,e){return(await ge.post(e+"/getCdnExportName",t||{})).data}async function LA(t,e){return(await ge.post(e+"/updateFlexUrl",t||{})).data}async function qo(t,e,n){return(await ge.post(n+"/updatePlayableVersion",{...e,_id:t})).data}function Nt(t){const e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select();try{return document.execCommand("copy")?(document.body.removeChild(e),!0):(document.body.removeChild(e),!1)}catch{return document.body.removeChild(e),!1}}function bo(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=bo(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function yt(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=bo(t))&&(r&&(r+=" "),r+=e);return r}const on=t=>typeof t=="number"&&!isNaN(t),wt=t=>typeof t=="string",Re=t=>typeof t=="function",Pn=t=>wt(t)||Re(t)?t:null,Fr=t=>q.isValidElement(t)||wt(t)||Re(t)||on(t);function KA(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=t;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,n)})})}function Hn(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:s=300}=t;return function(o){let{children:a,position:l,preventExitTransition:A,done:u,nodeRef:c,isIn:f}=o;const p=r?`${e}--${l}`:e,g=r?`${n}--${l}`:n,m=q.useRef(0);return q.useLayoutEffect(()=>{const v=c.current,C=p.split(" "),I=K=>{K.target===c.current&&(v.dispatchEvent(new Event("d")),v.removeEventListener("animationend",I),v.removeEventListener("animationcancel",I),m.current===0&&K.type!=="animationcancel"&&v.classList.remove(...C))};v.classList.add(...C),v.addEventListener("animationend",I),v.addEventListener("animationcancel",I)},[]),q.useEffect(()=>{const v=c.current,C=()=>{v.removeEventListener("animationend",C),i?KA(v,u,s):u()};f||(A?C():(m.current=1,v.className+=` ${g}`,v.addEventListener("animationend",C)))},[f]),q.createElement(q.Fragment,null,a)}}function Co(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const Ve={list:new Map,emitQueue:new Map,on(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off(t,e){if(e){const n=this.list.get(t).filter(r=>r!==e);return this.list.set(t,n),this}return this.list.delete(t),this},cancelEmit(t){const e=this.emitQueue.get(t);return e&&(e.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(e=>{const n=setTimeout(()=>{e(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(n)})}},Bn=t=>{let{theme:e,type:n,...r}=t;return q.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},_r={info:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return q.createElement("div",{className:"Toastify__spinner"})}};function MA(t){const[,e]=q.useReducer(p=>p+1,0),[n,r]=q.useState([]),i=q.useRef(null),s=q.useRef(new Map).current,o=p=>n.indexOf(p)!==-1,a=q.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:o,getToast:p=>s.get(p)}).current;function l(p){let{containerId:g}=p;const{limit:m}=a.props;!m||g&&a.containerId!==g||(a.count-=a.queue.length,a.queue=[])}function A(p){r(g=>p==null?[]:g.filter(m=>m!==p))}function u(){const{toastContent:p,toastProps:g,staleId:m}=a.queue.shift();f(p,g,m)}function c(p,g){let{delay:m,staleId:v,...C}=g;if(!Fr(p)||function(R){return!i.current||a.props.enableMultiContainer&&R.containerId!==a.props.containerId||s.has(R.toastId)&&R.updateId==null}(C))return;const{toastId:I,updateId:K,data:E}=C,{props:b}=a,G=()=>A(I),Z=K==null;Z&&a.count++;const M={...b,style:b.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(C).filter(R=>{let[V,O]=R;return O!=null})),toastId:I,updateId:K,data:E,closeToast:G,isIn:!1,className:Pn(C.className||b.toastClassName),bodyClassName:Pn(C.bodyClassName||b.bodyClassName),progressClassName:Pn(C.progressClassName||b.progressClassName),autoClose:!C.isLoading&&(N=C.autoClose,j=b.autoClose,N===!1||on(N)&&N>0?N:j),deleteToast(){const R=Co(s.get(I),"removed");s.delete(I),Ve.emit(4,R);const V=a.queue.length;if(a.count=I==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),V>0){const O=I==null?a.props.limit:1;if(V===1||O===1)a.displayedToast++,u();else{const L=O>V?V:O;a.displayedToast=L;for(let P=0;P<L;P++)u()}}else e()}};var N,j;M.iconOut=function(R){let{theme:V,type:O,isLoading:L,icon:P}=R,y=null;const W={theme:V,type:O};return P===!1||(Re(P)?y=P(W):q.isValidElement(P)?y=q.cloneElement(P,W):wt(P)||on(P)?y=P:L?y=_r.spinner():(U=>U in _r)(O)&&(y=_r[O](W))),y}(M),Re(C.onOpen)&&(M.onOpen=C.onOpen),Re(C.onClose)&&(M.onClose=C.onClose),M.closeButton=b.closeButton,C.closeButton===!1||Fr(C.closeButton)?M.closeButton=C.closeButton:C.closeButton===!0&&(M.closeButton=!Fr(b.closeButton)||b.closeButton);let z=p;q.isValidElement(p)&&!wt(p.type)?z=q.cloneElement(p,{closeToast:G,toastProps:M,data:E}):Re(p)&&(z=p({closeToast:G,toastProps:M,data:E})),b.limit&&b.limit>0&&a.count>b.limit&&Z?a.queue.push({toastContent:z,toastProps:M,staleId:v}):on(m)?setTimeout(()=>{f(z,M,v)},m):f(z,M,v)}function f(p,g,m){const{toastId:v}=g;m&&s.delete(m);const C={content:p,props:g};s.set(v,C),r(I=>[...I,v].filter(K=>K!==m)),Ve.emit(4,Co(C,C.props.updateId==null?"added":"updated"))}return q.useEffect(()=>(a.containerId=t.containerId,Ve.cancelEmit(3).on(0,c).on(1,p=>i.current&&A(p)).on(5,l).emit(2,a),()=>{s.clear(),Ve.emit(3,a)}),[]),q.useEffect(()=>{a.props=t,a.isToastActive=o,a.displayedToast=n.length}),{getToastToRender:function(p){const g=new Map,m=Array.from(s.values());return t.newestOnTop&&m.reverse(),m.forEach(v=>{const{position:C}=v.props;g.has(C)||g.set(C,[]),g.get(C).push(v)}),Array.from(g,v=>p(v[0],v[1]))},containerRef:i,isToastActive:o}}function wo(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function xo(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function WA(t){const[e,n]=q.useState(!1),[r,i]=q.useState(!1),s=q.useRef(null),o=q.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=q.useRef(t),{autoClose:l,pauseOnHover:A,closeToast:u,onClick:c,closeOnClick:f}=t;function p(E){if(t.draggable){E.nativeEvent.type==="touchstart"&&E.nativeEvent.preventDefault(),o.didMove=!1,document.addEventListener("mousemove",C),document.addEventListener("mouseup",I),document.addEventListener("touchmove",C),document.addEventListener("touchend",I);const b=s.current;o.canCloseOnClick=!0,o.canDrag=!0,o.boundingRect=b.getBoundingClientRect(),b.style.transition="",o.x=wo(E.nativeEvent),o.y=xo(E.nativeEvent),t.draggableDirection==="x"?(o.start=o.x,o.removalDistance=b.offsetWidth*(t.draggablePercent/100)):(o.start=o.y,o.removalDistance=b.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function g(E){if(o.boundingRect){const{top:b,bottom:G,left:Z,right:M}=o.boundingRect;E.nativeEvent.type!=="touchend"&&t.pauseOnHover&&o.x>=Z&&o.x<=M&&o.y>=b&&o.y<=G?v():m()}}function m(){n(!0)}function v(){n(!1)}function C(E){const b=s.current;o.canDrag&&b&&(o.didMove=!0,e&&v(),o.x=wo(E),o.y=xo(E),o.delta=t.draggableDirection==="x"?o.x-o.start:o.y-o.start,o.start!==o.x&&(o.canCloseOnClick=!1),b.style.transform=`translate${t.draggableDirection}(${o.delta}px)`,b.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function I(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",I);const E=s.current;if(o.canDrag&&o.didMove&&E){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),void t.closeToast();E.style.transition="transform 0.2s, opacity 0.2s",E.style.transform=`translate${t.draggableDirection}(0)`,E.style.opacity="1"}}q.useEffect(()=>{a.current=t}),q.useEffect(()=>(s.current&&s.current.addEventListener("d",m,{once:!0}),Re(t.onOpen)&&t.onOpen(q.isValidElement(t.children)&&t.children.props),()=>{const E=a.current;Re(E.onClose)&&E.onClose(q.isValidElement(E.children)&&E.children.props)}),[]),q.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||v(),window.addEventListener("focus",m),window.addEventListener("blur",v)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",m),window.removeEventListener("blur",v))}),[t.pauseOnFocusLoss]);const K={onMouseDown:p,onTouchStart:p,onMouseUp:g,onTouchEnd:g};return l&&A&&(K.onMouseEnter=v,K.onMouseLeave=m),f&&(K.onClick=E=>{c&&c(E),o.canCloseOnClick&&u()}),{playToast:m,pauseToast:v,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:K}}function Zo(t){let{closeToast:e,theme:n,ariaLabel:r="close"}=t;return q.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:i=>{i.stopPropagation(),e(i)},"aria-label":r},q.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},q.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function jA(t){let{delay:e,isRunning:n,closeToast:r,type:i="default",hide:s,className:o,style:a,controlledProgress:l,progress:A,rtl:u,isIn:c,theme:f}=t;const p=s||l&&A===0,g={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused",opacity:p?0:1};l&&(g.transform=`scaleX(${A})`);const m=yt("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":u}),v=Re(o)?o({rtl:u,type:i,defaultClassName:m}):yt(m,o);return q.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:g,[l&&A>=1?"onTransitionEnd":"onAnimationEnd"]:l&&A<1?null:()=>{c&&r()}})}const RA=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:i}=WA(t),{closeButton:s,children:o,autoClose:a,onClick:l,type:A,hideProgressBar:u,closeToast:c,transition:f,position:p,className:g,style:m,bodyClassName:v,bodyStyle:C,progressClassName:I,progressStyle:K,updateId:E,role:b,progress:G,rtl:Z,toastId:M,deleteToast:N,isIn:j,isLoading:z,iconOut:R,closeOnClick:V,theme:O}=t,L=yt("Toastify__toast",`Toastify__toast-theme--${O}`,`Toastify__toast--${A}`,{"Toastify__toast--rtl":Z},{"Toastify__toast--close-on-click":V}),P=Re(g)?g({rtl:Z,position:p,type:A,defaultClassName:L}):yt(L,g),y=!!G||!a,W={closeToast:c,type:A,theme:O};let U=null;return s===!1||(U=Re(s)?s(W):q.isValidElement(s)?q.cloneElement(s,W):Zo(W)),q.createElement(f,{isIn:j,done:N,position:p,preventExitTransition:n,nodeRef:r},q.createElement("div",{id:M,onClick:l,className:P,...i,style:m,ref:r},q.createElement("div",{...j&&{role:b},className:Re(v)?v({type:A}):yt("Toastify__toast-body",v),style:C},R!=null&&q.createElement("div",{className:yt("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!z})},R),q.createElement("div",null,o)),U,q.createElement(jA,{...E&&!y?{key:`pb-${E}`}:{},rtl:Z,theme:O,delay:a,isRunning:e,isIn:j,closeToast:c,hide:u,type:A,style:K,className:I,controlledProgress:y,progress:G||0})))},Vn=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},zA=Hn(Vn("bounce",!0));Hn(Vn("slide",!0)),Hn(Vn("zoom")),Hn(Vn("flip"));const $r=q.forwardRef((t,e)=>{const{getToastToRender:n,containerRef:r,isToastActive:i}=MA(t),{className:s,style:o,rtl:a,containerId:l}=t;function A(u){const c=yt("Toastify__toast-container",`Toastify__toast-container--${u}`,{"Toastify__toast-container--rtl":a});return Re(s)?s({position:u,rtl:a,defaultClassName:c}):yt(c,Pn(s))}return q.useEffect(()=>{e&&(e.current=r.current)},[]),q.createElement("div",{ref:r,className:"Toastify",id:l},n((u,c)=>{const f=c.length?{...o}:{...o,pointerEvents:"none"};return q.createElement("div",{className:A(u),style:f,key:`container-${u}`},c.map((p,g)=>{let{content:m,props:v}=p;return q.createElement(RA,{...v,isIn:i(v.toastId),style:{...v.style,"--nth":g+1,"--len":c.length},key:`toast-${v.key}`},m)}))}))});$r.displayName="ToastContainer",$r.defaultProps={position:"top-right",transition:zA,autoClose:5e3,closeButton:Zo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let ei,xt=new Map,an=[],YA=1;function Io(){return""+YA++}function NA(t){return t&&(wt(t.toastId)||on(t.toastId))?t.toastId:Io()}function ln(t,e){return xt.size>0?Ve.emit(0,t,e):an.push({content:t,options:e}),e.toastId}function Xn(t,e){return{...e,type:e&&e.type||t,toastId:NA(e)}}function Un(t){return(e,n)=>ln(e,Xn(t,n))}function ye(t,e){return ln(t,Xn("default",e))}ye.loading=(t,e)=>ln(t,Xn("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),ye.promise=function(t,e,n){let r,{pending:i,error:s,success:o}=e;i&&(r=wt(i)?ye.loading(i,n):ye.loading(i.render,{...n,...i}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,c,f)=>{if(c==null)return void ye.dismiss(r);const p={type:u,...a,...n,data:f},g=wt(c)?{render:c}:c;return r?ye.update(r,{...p,...g}):ye(g.render,{...p,...g}),f},A=Re(t)?t():t;return A.then(u=>l("success",o,u)).catch(u=>l("error",s,u)),A},ye.success=Un("success"),ye.info=Un("info"),ye.error=Un("error"),ye.warning=Un("warning"),ye.warn=ye.warning,ye.dark=(t,e)=>ln(t,Xn("default",{theme:"dark",...e})),ye.dismiss=t=>{xt.size>0?Ve.emit(1,t):an=an.filter(e=>t!=null&&e.options.toastId!==t)},ye.clearWaitingQueue=function(t){return t===void 0&&(t={}),Ve.emit(5,t)},ye.isActive=t=>{let e=!1;return xt.forEach(n=>{n.isToastActive&&n.isToastActive(t)&&(e=!0)}),e},ye.update=function(t,e){e===void 0&&(e={}),setTimeout(()=>{const n=function(r,i){let{containerId:s}=i;const o=xt.get(s||ei);return o&&o.getToast(r)}(t,e);if(n){const{props:r,content:i}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:Io()};s.toastId!==t&&(s.staleId=t);const o=s.render||i;delete s.render,ln(o,s)}},0)},ye.done=t=>{ye.update(t,{progress:1})},ye.onChange=t=>(Ve.on(4,t),()=>{Ve.off(4,t)}),ye.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},ye.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Ve.on(2,t=>{ei=t.containerId||t,xt.set(ei,t),an.forEach(e=>{Ve.emit(0,e.content,e.options)}),an=[]}).on(3,t=>{xt.delete(t.containerId||t),xt.size===0&&Ve.off(0).off(1).off(5)});function JA(t){ye.error(t,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function Zt(t){ye.success(t,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let ti="",ze="Playable",Ye=null,So=null,un,Eo=[];const ni=async(t,e,n)=>{ze==="Playable"?e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&await qo(t,{iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye):ze==="Flex"?e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&await LA({_id:t,iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye):ze==="Ready"?e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(e.googleUrl=e.iosUrl),await qo(t,{iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye)):ze==="Fusion"&&e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&await OA({_id:un==null?void 0:un.fusionId,iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye)},Qn=async t=>{let e=ti+"/"+t,n=t;fetch(e).then(r=>r.blob()).then(r=>{const i=window.URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=n.split("/").reduce((o,a)=>a,""),document.body.appendChild(s),s.click(),window.URL.revokeObjectURL(i),Zt("Download successfully")}).catch(r=>{console.error("File error:",r)})},DA=(t,e,n)=>{let r=ti+"/"+t;n==="adikteev"&&(r=t),Nt(r)?Zt(ae.t("common:link_copied")):e(r)};function Oo(t){let e=Eo.find(n=>n.id===t);return e&&e.apiName?e.apiName:t}async function An(t,e,n,r="download",i=!1,s=null){return e=Oo(e),new Promise(async(o,a)=>{let l=async A=>{r==="download"?await Qn(A):r==="copy"&&DA(A,So,e)};try{await ni(t,n,s)}catch(A){console.log("updateUrls error",A)}ze==="Playable"?xA(Ye,t,e,i,s).then(async A=>{let{url:u}=A;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Flex"?CA({_id:t,network:e,extras:s},Ye).then(async A=>{if(A.message){a(A);return}let{url:u}=A;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Import"?wA(Ye,t,e).then(async A=>{let u=A.url;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Ready"?IA(Ye,t,e,i,s,r==="download").then(async A=>{if(A.message){a(A);return}let u=A.url;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Fusion"&&EA(Ye,t,e,un,i,s,n==null?void 0:n.googleUrl,n==null?void 0:n.iosUrl).then(async A=>{let u=A.url;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})})})}async function TA(t,e,n,r=null){return new Promise(async(i,s)=>{n=n.map(o=>Oo(o)),await ni(t,e,r),ze==="Flex"?bA(t,n,Ye).then(async o=>{if(o.message){s(o);return}await Qn(o.url),i(o.url)}).catch(o=>{let a=o.response.data.error.msg;s({message:a})}):ze==="Ready"?SA(t,n,Ye).then(async o=>{if(o.message){s(o);return}await Qn(o.url),i(o.url)}).catch(o=>{console.log("err",o);let a=o.response.data.error.msg;s({message:a})}):ZA(t,n,Ye).then(async o=>{await Qn(o.url),i(o.url)}).catch(o=>{let a=o.response.data.error.msg;s({message:a})})})}function GA(t,e,n,r,i){ze=t,Ye=e,So=n,ti=r,un=i}function PA(t){Eo=t}async function HA(t){try{return await kA({versionId:t,checkExistance:!0,isFlex:ze==="Flex",isFusion:ze==="Fusion"},Ye)}catch{return null}}async function ri(t,e){return(await ge.post(e+"/findPlayable",{_id:t})).data}const ko=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Lo=t=>"init"in t,Ko=t=>!!t.write,Mo=t=>"v"in t||"e"in t,Fn=t=>{if("e"in t)throw t.e;return t.v},_n=new WeakMap,Wo=t=>{var e;return $n(t)&&!!((e=_n.get(t))!=null&&e[0])},BA=t=>{const e=_n.get(t);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(n=>n()))},jo=(t,e)=>{let n=_n.get(t);if(!n){n=[!0,new Set],_n.set(t,n);const r=()=>{n[0]=!1};t.then(r,r)}n[1].add(e)},$n=t=>typeof(t==null?void 0:t.then)=="function",Ro=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},ii=(t,e,n)=>{const r=n(t),i="v"in r,s=r.v;if($n(e))for(const o of r.d.keys())Ro(t,e,n(o));r.v=e,delete r.e,(!i||!Object.is(s,r.v))&&(++r.n,$n(s)&&BA(s))},zo=(t,e,n)=>{var r;const i=new Set;for(const s of((r=n.get(t))==null?void 0:r.t)||[])n.has(s)&&i.add(s);for(const s of e.p)i.add(s);return i},VA=()=>{const t=new Set,e=()=>{t.forEach(n=>n())};return e.add=n=>(t.add(n),()=>{t.delete(n)}),e},si=()=>{const t={},e=new WeakMap,n=r=>{var i,s;(i=e.get(t))==null||i.forEach(o=>o(r)),(s=e.get(r))==null||s.forEach(o=>o())};return n.add=(r,i)=>{const s=r||t,o=(e.has(s)?e:e.set(s,new Set)).get(s);return o.add(i),()=>{o==null||o.delete(i),o.size||e.delete(s)}},n},XA=t=>(t.c||(t.c=si()),t.m||(t.m=si()),t.u||(t.u=si()),t.f||(t.f=VA()),t),UA=Symbol(),Yo=(t=new WeakMap,e=new WeakMap,n=new WeakMap,r=new Set,i=new Set,s=new Set,o={},a=(f,...p)=>f.read(...p),l=(f,...p)=>f.write(...p),A=(f,p)=>{var g;return(g=f.unstable_onInit)==null?void 0:g.call(f,p)},u=(f,p)=>{var g;return(g=f.onMount)==null?void 0:g.call(f,p)},...c)=>{const f=c[0]||(Z=>{let M=t.get(Z);return M||(M={d:new Map,p:new Set,n:0},t.set(Z,M),A==null||A(Z,G)),M}),p=c[1]||(()=>{const Z=[],M=N=>{try{N()}catch(j){Z.push(j)}};do{o.f&&M(o.f);const N=new Set,j=N.add.bind(N);r.forEach(z=>{var R;return(R=e.get(z))==null?void 0:R.l.forEach(j)}),r.clear(),s.forEach(j),s.clear(),i.forEach(j),i.clear(),N.forEach(M),r.size&&g()}while(r.size||s.size||i.size);if(Z.length)throw new AggregateError(Z)}),g=c[2]||(()=>{const Z=[],M=new WeakSet,N=new WeakSet,j=Array.from(r);for(;j.length;){const z=j[j.length-1],R=f(z);if(N.has(z)){j.pop();continue}if(M.has(z)){n.get(z)===R.n&&Z.push([z,R]),N.add(z),j.pop();continue}M.add(z);for(const V of zo(z,R,e))M.has(V)||j.push(V)}for(let z=Z.length-1;z>=0;--z){const[R,V]=Z[z];let O=!1;for(const L of V.d.keys())if(L!==R&&r.has(L)){O=!0;break}O&&(m(R),I(R)),n.delete(R)}}),m=c[3]||(Z=>{var M;const N=f(Z);if(Mo(N)&&(e.has(Z)&&n.get(Z)!==N.n||Array.from(N.d).every(([y,W])=>m(y).n===W)))return N;N.d.clear();let j=!0;const z=()=>{e.has(Z)&&(I(Z),g(),p())},R=y=>{var W;if(ko(Z,y)){const x=f(y);if(!Mo(x))if(Lo(y))ii(y,y.init,f);else throw new Error("no atom init");return Fn(x)}const U=m(y);try{return Fn(U)}finally{N.d.set(y,U.n),Wo(N.v)&&Ro(Z,N.v,U),(W=e.get(y))==null||W.t.add(Z),j||z()}};let V,O;const L={get signal(){return V||(V=new AbortController),V.signal},get setSelf(){return!O&&Ko(Z)&&(O=(...y)=>{if(!j)try{return C(Z,...y)}finally{g(),p()}}),O}},P=N.n;try{const y=a(Z,R,L);return ii(Z,y,f),$n(y)&&(jo(y,()=>V==null?void 0:V.abort()),y.then(z,z)),N}catch(y){return delete N.v,N.e=y,++N.n,N}finally{j=!1,P!==N.n&&n.get(Z)===P&&(n.set(Z,N.n),r.add(Z),(M=o.c)==null||M.call(o,Z))}}),v=c[4]||(Z=>{const M=[Z];for(;M.length;){const N=M.pop(),j=f(N);for(const z of zo(N,j,e)){const R=f(z);n.set(z,R.n),M.push(z)}}}),C=c[5]||((Z,...M)=>{let N=!0;const j=R=>Fn(m(R)),z=(R,...V)=>{var O;const L=f(R);try{if(ko(Z,R)){if(!Lo(R))throw new Error("atom not writable");const P=L.n,y=V[0];ii(R,y,f),I(R),P!==L.n&&(r.add(R),(O=o.c)==null||O.call(o,R),v(R));return}else return C(R,...V)}finally{N||(g(),p())}};try{return l(Z,j,z,...M)}finally{N=!1}}),I=c[6]||(Z=>{var M;const N=f(Z),j=e.get(Z);if(j&&!Wo(N.v)){for(const[z,R]of N.d)if(!j.d.has(z)){const V=f(z);K(z).t.add(Z),j.d.add(z),R!==V.n&&(r.add(z),(M=o.c)==null||M.call(o,z),v(z))}for(const z of j.d||[])if(!N.d.has(z)){j.d.delete(z);const R=E(z);R==null||R.t.delete(Z)}}}),K=c[7]||(Z=>{var M;const N=f(Z);let j=e.get(Z);if(!j){m(Z);for(const z of N.d.keys())K(z).t.add(Z);if(j={l:new Set,d:new Set(N.d.keys()),t:new Set},e.set(Z,j),(M=o.m)==null||M.call(o,Z),Ko(Z)){const z=()=>{let R=!0;const V=(...O)=>{try{return C(Z,...O)}finally{R||(g(),p())}};try{const O=u(Z,V);O&&(j.u=()=>{R=!0;try{O()}finally{R=!1}})}finally{R=!1}};i.add(z)}}return j}),E=c[8]||(Z=>{var M;const N=f(Z);let j=e.get(Z);if(j&&!j.l.size&&!Array.from(j.t).some(z=>{var R;return(R=e.get(z))==null?void 0:R.d.has(Z)})){j.u&&s.add(j.u),j=void 0,e.delete(Z),(M=o.u)==null||M.call(o,Z);for(const z of N.d.keys()){const R=E(z);R==null||R.t.delete(Z)}return}return j}),b=[t,e,n,r,i,s,o,a,l,A,u,f,p,g,m,v,C,I,K,E],G={get:Z=>Fn(m(Z)),set:(Z,...M)=>{try{return C(Z,...M)}finally{g(),p()}},sub:(Z,M)=>{const j=K(Z).l;return j.add(M),p(),()=>{j.delete(M),E(Z),p()}}};return Object.defineProperty(G,UA,{value:b}),G},QA=XA,No=jo;let FA=0;function cn(t,e){const n=`atom${++FA}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=_A,r.write=$A),e&&(r.write=e),r}function _A(t){return t(this)}function $A(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const $p=()=>{let t=0;const e=QA({}),n=new WeakMap,r=new WeakMap,i=Yo(n,r,void 0,void 0,void 0,void 0,e,void 0,(a,l,A,...u)=>t?A(a,...u):a.write(l,A,...u)),s=new Set;return e.m.add(void 0,a=>{s.add(a);const l=n.get(a);l.m=r.get(a)}),e.u.add(void 0,a=>{s.delete(a);const l=n.get(a);delete l.m}),Object.assign(i,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),n),dev4_get_mounted_atoms:()=>s,dev4_restore_atoms:a=>{const l={read:()=>null,write:(A,u)=>{++t;try{for(const[c,f]of a)"init"in c&&u(c,f)}finally{--t}}};i.set(l)}})};function ec(){return Yo()}let oi;function tc(){return oi||(oi=ec()),oi}const nc=q.createContext(void 0);function Jo(t){const e=q.useContext(nc);return(t==null?void 0:t.store)||e||tc()}const ai=t=>typeof(t==null?void 0:t.then)=="function",li=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},rc=q.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(li(t),t)}),ui=new WeakMap,Do=(t,e)=>{let n=ui.get(t);return n||(n=new Promise((r,i)=>{let s=t;const o=A=>u=>{s===A&&r(u)},a=A=>u=>{s===A&&i(u)},l=()=>{try{const A=e();ai(A)?(ui.set(A,n),s=A,A.then(o(A),a(A)),No(A,l)):r(A)}catch(A){i(A)}};t.then(o(t),a(t)),No(t,l)}),ui.set(t,n)),n};function ic(t,e){const{delay:n,unstable_promiseStatus:r=!q.use}=e||{},i=Jo(e),[[s,o,a],l]=q.useReducer(u=>{const c=i.get(t);return Object.is(u[0],c)&&u[1]===i&&u[2]===t?u:[c,i,t]},void 0,()=>[i.get(t),i,t]);let A=s;if((o!==i||a!==t)&&(l(),A=i.get(t)),q.useEffect(()=>{const u=i.sub(t,()=>{if(r)try{const c=i.get(t);ai(c)&&li(Do(c,()=>i.get(t)))}catch{}if(typeof n=="number"){setTimeout(l,n);return}l()});return l(),u},[i,t,n,r]),q.useDebugValue(A),ai(A)){const u=Do(A,()=>i.get(t));return r&&li(u),rc(u)}return A}function sc(t,e){const n=Jo(e);return q.useCallback((...i)=>n.set(t,...i),[n,t])}function Ne(t,e){return[ic(t,e),sc(t,e)]}const To=cn(""),Go=cn(!1),Ai=cn([]),Po=cn([]),dn=cn(!1),oc=({versionId:t,playableId:e,typeOfProduct:n,api:r,copyLinkUrl:i,setSafariCopyLink:s,qrUrl:o,iosLink:a,androidLink:l,urlType:A})=>{const[u,c]=q.useState(!1),[f,p]=Ne(dn),g=n==="Playable"?f:!0,m=async()=>{c(!0),An(t,"default",g?{iosUrl:a,googleUrl:l}:null,null,!1,{urlType:A}).then(async v=>{var E,b,G,Z;let C="";if(e&&(n==="Playable"||n==="Ready")){const M=await ri(e,r),N=(b=(E=M==null?void 0:M.data)==null?void 0:E.globalProps)==null?void 0:b.defaultLandscape,j=(Z=(G=M==null?void 0:M.data)==null?void 0:G.globalProps)==null?void 0:Z.defaultPhoneIndex;N&&(C+="&landscape=true"),j!==void 0&&(C+=`&phoneIndex=${j}`)}ri(e,r),c(!1);let I;n==="Flex"?I=`${i}/preview?versionId=${t}`:n==="Import"?I=`${i}/preview?versionId=${t}`:n==="Ready"?I=`${i}/preview?versionId=${t}&ready=true`:n==="Fusion"?I=`${i}/preview?versionId=${t}`:I=`${i}/preview?versionId=${t}`,I+=C,Nt(I)?Zt(ae.t("common:link_copied")):s(I),c(!1)}).catch(v=>{c(!1)})};return d.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[d.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:o?d.jsx(wl,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:o}):d.jsx("img",{style:{width:"50px",height:"50px"},src:Te,alt:"pf-logo-gif"})}),d.jsxs("div",{children:[d.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:ae.t("common:mobile_testing")}),d.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:ae.t("common:scan_qr_code_to_test_in_any_browser")}),d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{u||m()},children:d.jsxs(d.Fragment,{children:[d.jsx(hs,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),d.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:u?d.jsx("img",{style:{height:"90%"},src:Te,alt:"loading"}):d.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:ae.t("common:copy_link")})})]})})]})]})},ac=({versionName:t,versionId:e,playableId:n,typeOfProduct:r,api:i,iframeUrl:s,fetchFileUrl:o,copyLinkUrl:a,setSafariCopyLink:l,iosLink:A,androidLink:u,urlType:c})=>{const[f,p]=q.useState(window.innerWidth);console.log("iosLink",A),q.useEffect(()=>{console.log("re add event listener");function m(v){console.log(v),v.data==="cta"&&(console.log("Received 'cta' message from iframe"),A&&window.open(A,"_blank"))}return window.addEventListener("message",m,!1),()=>{window.removeEventListener("message",m)}},[A,u]),q.useEffect(()=>{const m=()=>{p(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const g=(t==null?void 0:t.length)>25?t.slice(0,25)+"...":t;return d.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:f>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[d.jsx(Ga,{iframeUrl:s}),d.jsx(Pa,{name:g}),d.jsx(oc,{versionId:e,playableId:n,typeOfProduct:r,api:i,copyLinkUrl:a,setSafariCopyLink:l,qrUrl:s,iosLink:A,androidLink:u,urlType:c})]})},lc=({typeOfProduct:t,allNetworksSelected:e,setAllNetworksSelected:n})=>d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:d.jsx("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"}})});async function uc(t,e){return(await ge.post(e+"/buyRequest",{requestType:t})).data}const Ac=()=>d.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[d.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),d.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_518_12094",children:d.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),cc=({creditDownload:t,api:e})=>d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",fontWeight:100},children:"If you continue to export, you will spend 1 credit."}),d.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.25rem",fontSize:"12px",fontWeight:100},children:["You have"," ",d.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(t==null?void 0:t.downloadLimit)-(t==null?void 0:t.downloadLimitUsed)<0?0:(t==null?void 0:t.downloadLimit)-(t==null?void 0:t.downloadLimitUsed)})," ","credits remaining.",d.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>uc("Flex Credit",e).then(n=>Zt("You will be contacted regarding your request.")),children:["Get more",d.jsx(Ac,{})]})]})]});var ke=(t=>(t.Flex="#7101FF",t.Playable="#F9830B",t.Import="#00a3ff",t.Ready="#0060A5",t.Fusion="#171717",t))(ke||{});const Ho=({typeOfProduct:t,urls:e,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const s=u=>{n(u.target.value)},o=u=>{r(u.target.value)},[a,l]=Ne(dn);let A=i;return t==="Playable"&&!i&&!a&&(A=!0),d.jsxs(d.Fragment,{children:[t==="Playable"&&d.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[d.jsx("span",{style:{width:"6.5rem",fontWeight:"bold",flexShrink:0},children:"Use Custom Url"}),d.jsx("input",{type:"checkbox",checked:a,onChange:u=>l(u.target.checked)})]}),d.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[d.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:ae.t("common:app_store")}),d.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:e.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ke[t],marginRight:"2rem"},type:"text",value:e.iosUrl,onChange:s,placeholder:"Ios Url",disabled:A})]}),d.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[d.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:[ae.t("common:google_play"),":"]}),d.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:e.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ke[t],marginRight:"2rem"},type:"text",value:e.googleUrl,onChange:o,placeholder:"Google Url",disabled:A})]})]})},dc=({typeOfProduct:t,urls:e,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const s=o=>{n(o.target.value)};return d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[d.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),d.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:e.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ke[t],marginRight:"2rem"},type:"text",value:e.iosUrl,onChange:s,placeholder:"Ios Url",disabled:i})]})})},fc=({typeOfProduct:t,fileSize:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s,api:o,creditDownload:a,user:l,isTest:A,setIsTest:u,urlType:c,setUrlType:f})=>{const p=()=>d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",width:"400px",height:"30px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid #eaeaec",marginBottom:"10px",position:"relative"},className:"tab-switch",children:[d.jsx("div",{style:{position:"absolute",bottom:"-3px",left:c==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),d.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="0%",document.getElementById("single-tab").style.color="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{f("game")},200)},children:d.jsx("span",{style:{position:"relative",color:c==="game"?"#000":"#a3a3a3",fontWeight:c==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),d.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="50%",document.getElementById("single-tab").style.color="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{f("single")},200)},children:d.jsx("span",{style:{position:"relative",color:c==="single"?"#000":"#a3a3a3",fontWeight:c==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return d.jsx(d.Fragment,{children:t!=="Import"&&d.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[t==="Ready"?d.jsxs(d.Fragment,{children:[d.jsx(p,{}),c==="game"&&d.jsx(Ho,{typeOfProduct:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s}),c==="single"&&d.jsx(dc,{typeOfProduct:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s})]}):d.jsx(d.Fragment,{children:d.jsx(Ho,{typeOfProduct:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s})}),(a==null?void 0:a.willSpendCredit)&&d.jsx(cc,{creditDownload:a,api:o})]})})},pc=({typeOfProduct:t,title:e,fileSize:n})=>d.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[d.jsx("span",{style:{color:ke[t]},children:e}),n?d.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:[ae.t("common:file_size")," ",parseFloat(n).toFixed(2)," mb"]}):null]}),hc=({typeOfProduct:t,fileSize:e,urls:n,title:r,handleIosChange:i,handleGoogleChange:s,disabled:o,creditDownload:a,api:l,user:A,isTest:u,setIsTest:c,urlType:f,setUrlType:p,allNetworksSelected:g,setAllNetworksSelected:m})=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid #D1D5DB",paddingLeft:"1.25rem",paddingRight:"1.25rem",gap:"0.5rem"},children:[d.jsx(pc,{typeOfProduct:t,title:r,fileSize:e}),d.jsx(fc,{typeOfProduct:t,fileSize:e,urls:n,handleIosChange:i,handleGoogleChange:s,disabled:o,creditDownload:a,api:l,user:A,isTest:u,setIsTest:c,urlType:f,setUrlType:p}),d.jsx(lc,{typeOfProduct:t,allNetworksSelected:g,setAllNetworksSelected:m})]}),ci=({children:t,className:e,onClickDonwload:n,downloading:r,disabled:i})=>d.jsx("button",{onClick:n,className:e,style:{display:"flex",height:"40px",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",border:"1px solid lightgray",padding:"0.25rem",fontSize:"0.875rem",width:200,backgroundColor:"#FFFFFF"},disabled:r||i,children:t}),mc=({checked:t,typeOfProduct:e,id:n})=>{const[r,i]=q.useState(t);q.useEffect(()=>{i(t)},[t]);const s=()=>{i(!r)};return d.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:d.jsxs("label",{onClick:s,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[d.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all ease-in-out",border:"1px solid lightgray",opacity:1},id:n,checked:r,onChange:s}),d.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:r?1:0,transition:"opacity ease-in-out"},children:[d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:ke[e],stroke:ke[e],strokeWidth:"1",children:d.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})," "]})]})})},eh="",gc=({typeOfProduct:t})=>d.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:d.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}}),d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}}),d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}}),d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}})]})}),fn=({isNetworksLoading:t=!1})=>d.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:d.jsx("img",{width:t?"100px":"25px",height:t?"100px":"25px",src:Te,alt:"pf-logo-gif"})}),di=({title:t,titleId:e,...n})=>d.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":e,...n,children:[t?d.jsx("title",{id:e,children:t}):null,d.jsx("path",{stroke:"currentColor",d:"m15.985 11.111-3.556 3.556-3.556-3.556M12.429 4v10.667M20.429 16.444A3.556 3.556 0 0 1 16.873 20H7.985a3.556 3.556 0 0 1-3.556-3.556",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),yc=({onClose:t,iosLink:e,googleLink:n,buttonType:r,handleCopyLink:i,download:s,typeOfProduct:o,urlType:a})=>{let l="";return o==="Ready"&&a==="single"?l=ae.t("common:redirection_url_is_empty_are_you_sure_want_to_continue"):!e&&!n?l=ae.t("common:both_links_are_empty_are_you_sure_want_to_continue"):e?n||(l=ae.t("common:google_link_is_empty_are_you_sure_want_to_continue")):l=ae.t("common:ios_link_is_empty_are_you_sure_want_to_continue"),d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",maxWidth:"350px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:l}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:()=>{t(!1)},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #666666",padding:"0.5rem",fontWeight:"bold",transition:"all 0.15s ease-linear"},children:ae.t("common:no")}),d.jsx("button",{onClick:async A=>{r==="download"?await s():r==="copyLink"&&await i(),t()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid red",backgroundColor:"darkorange",padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:ae.t("common:yes")})]})]})]})},fi=({onClose:t,handleCopyLink:e,download:n,creditConfirmType:r,getDownloadCount:i,width:s="130%",height:o="120%"})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:o,width:s,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:350,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:"You are going to spend 1 credit for this download, do you want to continue?"}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),d.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async a=>{a.preventDefault(),a.stopPropagation(),r==="download"?(await n(),await i()):r==="copy"&&(await e(),await i()),t()},children:"Yes"})]})]})]}),vc=({onClose:t,handleDownload:e,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:i,downloadingMolocoHtml:s})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},onClick:o=>{o.stopPropagation()},children:d.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:d.jsx("img",{width:"25px",height:"25px",src:Te,alt:"pf-logo-gif"})}):d.jsx("button",{onClick:()=>{e(!1)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),s?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:d.jsx("img",{width:"25px",height:"25px",src:Te,alt:"pf-logo-gif"})}):d.jsx("button",{onClick:()=>{e(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),d.jsx("div",{style:{display:"flex",justifyContent:"center"},children:i?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:d.jsx("img",{width:"25px",height:"25px",src:Te,alt:"pf-logo-gif"})}):d.jsx("button",{onClick:n,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:"Download Moloco Test"})})]})})]});async function qc(t,e,n,r){return(await ge.post(t+"/createMolocoTestPage",{_id:e,network:n,typeOfProduct:r})).data}const bc=({onClose:t,handleDownload:e,downloadingPortrait:n,downloadingLandscape:r,downloadingResponsive:i})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"15px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1.5rem",pointerEvents:"auto"},onClick:s=>{s.stopPropagation()},children:d.jsx("div",{style:{display:"flex",gap:"10px",flexDirection:"column"},children:d.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[n?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:d.jsx("img",{width:"20px",height:"20px",src:Te,alt:"loading-gif"})}):d.jsx("button",{onClick:()=>e("portrait"),style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Portrait"}),r?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:d.jsx("img",{width:"20px",height:"20px",src:Te,alt:"loading-gif"})}):d.jsx("button",{onClick:()=>e("landscape"),style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Landscape"}),i?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:d.jsx("img",{width:"20px",height:"20px",src:Te,alt:"loading-gif"})}):d.jsx("button",{onClick:()=>e("responsive"),style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Responsive"})]})})})]}),Cc=({id:t,imageUrl:e,handleCardClick:n,selected:r,name:i,networkVersionSize:s,fileSizeLoading:o,showCheckBox:a,typeOfProduct:l,versionId:A,api:u,handleDownloadError:c,fetchFileUrl:f,urls:p,game:g,setIsConfirmActive:m,creditDownload:v,getDownloadCount:C,disabled:I,user:K,setSafariCopyLink:E,isTest:b,urlType:G,setCdnModal:Z,generateCDN:M,cdnUrl:N})=>{const[j,z]=q.useState(!1),[R,V]=q.useState(""),[O,L]=q.useState(!1),[P,y]=q.useState(!1),[W,U]=q.useState(!1),[x,S]=q.useState("download"),[X,B]=q.useState(!1),[D,H]=q.useState(!1),[F,_]=q.useState(!1),[re,se]=q.useState(!1),[$,me]=q.useState(!1),[Y,Ce]=q.useState(!1),[Ke,Me]=q.useState(!1),[Ue,T]=Ne(Ai),[Q,oe]=Ne(dn),ve=l==="Playable"?Q:!0,qe={cdn:"Generate Link",adikteev:"Copy CDN"},We=()=>{n(t)},ot=async(Ae,be,Oe)=>{const Vt={molocoGenerateHtml:!1,urlType:G,responsiveType:"responsive"};if(ct?be==="copy"?(H(!0),be="download",Vt.molocoGenerateHtml=!0):B(!0):dt&&(Vt.responsiveType=Oe),console.log("getVersion",Ae,be,Vt),Ae==="cdn"){Z(!0),await M(!0);return}return Ae==="adikteev"&&(be="copy"),z(!0),new Promise((zi,Yi)=>{An(A,Ae,ve?p:null,be,b,Vt).then(Mt=>{z(!1),zi(Mt),H(!1),B(!1)}).catch(Mt=>{z(!1),c(Mt.message,Mt),Yi(Mt),H(!1),B(!1)})})},Kt=async(Ae=!1)=>{Ae?H(!0):B(!0);const be={molocoGenerateHtml:!1};Ae&&(be.molocoGenerateHtml=!0),An(A,i,ve?p:null,"download",b,be).then(Oe=>{Ae?H(!1):B(!1),U(!1)}).catch(Oe=>{c(Oe.message,Oe)})},Bt=async()=>{_(!0);const Ae=await qc(u,A,i,l);let be=`${f}/${Ae==null?void 0:Ae.url}`;Nt(be)?(Zt(ae.t("common:link_copied")),_(!1)):E(be)},ct=i==="moloco"||i==="molocoV2",dt=i==="google",fr=Ue.find(Ae=>Ae.name===i);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?ke[l]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+l,onClick:We,children:[d.jsxs("div",{style:{marginTop:i=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[d.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:d.jsx("div",{children:s&&s.map(Ae=>Ae.network).includes(i)?o?d.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"2rem"},children:d.jsx(gc,{typeOfProduct:l})}):s.map(Ae=>d.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",marginRight:"2rem",fontSize:"1rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center"},children:Ae.network===i?Ae.size.toString().slice(0,5)+"Mb":""},Ae.network)):null})}),d.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(l==="Playable"||l==="Ready"||l==="Flex")&&a&&d.jsx(mc,{checked:r,typeOfProduct:l,id:t})}),d.jsx("img",{onClick:We,style:{width:"30rem",height:i=="web"?"80px":"50px",objectFit:"contain"},src:e})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[d.jsx(ci,{className:`${ct?"w-1/2":"w-2/3"} border-hover-`+l,downloading:j,onClickDonwload:async Ae=>{if(Ae.stopPropagation(),console.log("user in onclickdownload",K),l==="Flex"&&K.flex===!1){c("|ACCESS|");return}if(ct&&K.customer==="playableFactoryInternal"){U(!0);return}else if(dt)se(!0);else{V("download");const be=p.iosUrl,Oe=p.googleUrl;i==="cdn"&&v&&v.willSpendCredit&&!N||i!=="cdn"&&v&&v.willSpendCredit?(m(!0),S("download"),L(!0)):["Playable","Flex"].includes(l)&&(!be||!Oe)||l==="Ready"&&G==="single"&&!be||l==="Ready"&&G==="multi"&&(!be||!Oe)?(m(!0),y(!0)):(y(!1),L(!1),await ot(i,"download"))}},children:ct?d.jsxs(d.Fragment,{children:[!X&&d.jsxs(d.Fragment,{children:[d.jsx(di,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),K.customer!=="playableFactoryInternal"?ae.t("common:txt"):ae.t("common:download")]}),X&&d.jsx(fn,{})]}):d.jsxs(d.Fragment,{children:[!j&&d.jsxs(d.Fragment,{children:[d.jsx(di,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),qe[i]||ae.t("common:download")]}),j&&d.jsx(fn,{})]})}),fr&&fr.downloadType.includes("copy")&&d.jsx(ci,{className:"w-1/3 border-hover-"+l,onClickDonwload:async Ae=>{Ae.stopPropagation(),V("copyLink");const be=p.iosUrl,Oe=p.googleUrl;v&&(v!=null&&v.willSpendCredit)?(S("copy"),m(!0),L(!0)):l!=="Import"&&(!be||!Oe)?(m(!0),y(!0)):(L(!1),y(!1),await ot(i,"copy"))},disabled:I,children:d.jsx(hs,{className:"h-6 w-6 stroke-dark-full"})}),ct&&K.customer!=="playableFactoryInternal"&&d.jsxs(ci,{className:"w-1/2 border-hover-"+l,onClickDonwload:async Ae=>{Ae.stopPropagation(),V("copyLink");const be=p.iosUrl,Oe=p.googleUrl;v&&(v!=null&&v.willSpendCredit)?(S("download"),m(!0),L(!0)):l!=="Import"&&(!be||!Oe)?(m(!0),y(!0)):(L(!1),y(!1),await Kt(!0))},disabled:I,children:[!D&&d.jsxs(d.Fragment,{children:[d.jsx(di,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),ae.t("common:html")]}),D&&d.jsx(fn,{})]})]})]}),O&&d.jsx(fi,{creditConfirmType:x,handleCopyLink:async()=>{y(!1),m(!1),await ot(i,"copy")},download:async()=>{y(!1),m(!1),await ot(i,"download")},onClose:()=>{L(!1),m(!1)},getDownloadCount:C}),P&&d.jsx(yc,{onClose:()=>{y(!1),m(!1)},iosLink:p.iosUrl,googleLink:p.googleUrl,buttonType:R,handleCopyLink:async()=>{y(!1),m(!1),await ot(i,"copy")},download:async()=>{y(!1),m(!1),await ot(i,"download")},typeOfProduct:l,urlType:G}),W&&K.customer==="playableFactoryInternal"&&d.jsx(vc,{onClose:()=>{U(!1)},handleDownload:Kt,handleDownloadMolocoTest:Bt,downloadingMoloco:X,donwloadintMolocoTest:F,downloadingMolocoHtml:D}),re&&d.jsx(bc,{onClose:()=>{se(!1)},handleDownload:async Ae=>{Ae==="portrait"?me(!0):Ae==="landscape"?Ce(!0):Me(!0),await ot(i,"download",Ae),Ae==="portrait"?me(!1):Ae==="landscape"?Ce(!1):Me(!1)},downloadingPortrait:$,downloadingLandscape:Y,downloadingResponsive:Ke})]})},wc=({children:t,typeOfProduct:e,className:n,onClick:r})=>{const i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:ke[e],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return d.jsx("button",{onClick:r,className:n,style:i,children:t})},xc=({networksVersionTotalSize:t,typeOfProduct:e,onClickMultiDownload:n,multiDownloading:r})=>d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?d.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:ke[e]},children:d.jsx(fn,{})}):d.jsx(wc,{typeOfProduct:e,onClick:n,children:d.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"1rem",padding:"0.5rem",color:"#fff"},children:"Download Selected"})})}),Bo=({title:t,titleId:e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),d.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),Zc=({onClose:t,cdnUrl:e,generateCDN:n,cdnUploading:r})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:i=>{i.stopPropagation()},children:d.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[d.jsxs("p",{style:{fontSize:"1.1rem",fontWeight:500,textAlign:"left",marginBottom:"10px",color:"#00a3ff",textDecoration:"underline",cursor:"pointer",width:"150px",display:"flex",gap:"10px",alignItems:"center",height:"28px"},onClick:()=>{r||n()},children:["Update Link",r&&d.jsx("img",{width:"30px",src:Te,alt:"pf-logo-gif"})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[d.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:d.jsx(Bo,{})}),d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:d.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:e,target:"_blank",children:e||"No CDN link generated"})}),d.jsx("button",{onClick:()=>{if(!e)return;Nt(e)&&Zt(ae.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:e?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})]})})]}),Ic=({onClose:t,url:e})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:n=>{n.stopPropagation()},children:d.jsx("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[d.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:d.jsx(Bo,{})}),d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:d.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:e,target:"_blank",children:e||d.jsx("img",{width:"30px",src:Te,alt:"pf-logo-gif"})})}),d.jsx("button",{onClick:()=>{if(!e)return;Nt(e)&&Zt(ae.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:e?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})})})]}),Sc=({playable:t,creditDownload:e,visible:n,versionId:r,typeOfProduct:i,api:s,user:o,handleDownloadError:a,fetchFileUrl:l,urls:A,game:u,getDownloadCount:c,disabled:f,setSafariCopyLink:p,isTest:g,urlType:m,allNetworksSelected:v,cdnModal:C,setCdnModal:I,cdnUrl:K,setCdnUrl:E,customer:b})=>{const[G,Z]=q.useState([]),[M,N]=q.useState([]),[j,z]=q.useState(!1),[R,V]=q.useState(""),[O,L]=q.useState(!1),[P,y]=q.useState(!1),[W,U]=q.useState("download"),[x,S]=q.useState(!1),[X,B]=q.useState(!1),[D,H]=q.useState(!1),[F,_]=Ne(To),[re,se]=Ne(Go),[$]=Ne(Ai),[me,Y]=Ne(dn),Ce=i==="Playable"?me:!0,Ke=async(Q=!1)=>{Q&&K||D||(H(!0),An(r,"cdn",Ce?A:null,null,!1,{}).then(oe=>{E(oe.url),H(!1)}).catch(oe=>{a(oe.message,oe),H(!1)}))},Me=async Q=>{if(Q==="adikteev")return;const oe=[...G];if(G.includes(Q)){const ve=oe.findIndex(qe=>qe===Q);oe.splice(ve,1),Z(oe)}else oe.push(Q),Z([...G,Q]);$.filter(ve=>[...oe].includes(ve.id)).map(ve=>ve.name)},Ue=async()=>new Promise(async(Q,oe)=>{const ve=$.filter(qe=>[...G].includes(qe.id)).map(qe=>qe.name);L(!0),TA(r,A,ve,{urlType:m}).then(qe=>{L(!1),Q(qe)}).catch(qe=>{console.log("get multi download err"),L(!1),a(qe.message,qe),oe(qe)})}),T=async()=>{A.iosUrl,A.googleUrl,e&&e.willSpendCredit?(y(!0),U("download"),S(!0)):(S(!1),await Ue())};return q.useEffect(()=>{const Q=$.filter(oe=>{var ve;return e&&((ve=e==null?void 0:e.networks)==null?void 0:ve.length)>0?typeof oe=="string"?e==null?void 0:e.networks.includes(oe):e==null?void 0:e.networks.includes(oe.name):i==="Import"?t==null?void 0:t.networks.filter(qe=>qe.status==="paid").some(qe=>qe.name===oe.name):t==null?void 0:t.networks.includes(oe.name)}).filter(oe=>oe.name==="voodoo"?o.customer==="customer:20":!0).map(oe=>oe.id);Z(v?Q:[])},[v]),d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{position:"relative",flex:1,overflowY:P?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:d.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&$.filter(Q=>{var oe;return e&&((oe=e==null?void 0:e.networks)==null?void 0:oe.length)>0?typeof Q=="string"?e==null?void 0:e.networks.includes(Q):e==null?void 0:e.networks.includes(Q.name):i==="Import"?t==null?void 0:t.networks.filter(ve=>ve.status==="paid").some(ve=>ve.name===Q.name):b!=null&&b.networks?b.networks.includes(Q.name):Q}).filter(Q=>Q.name==="voodoo"?o.customer==="customer:20":!0).map(Q=>{let oe=Q.imageSrc;if(Q.name==="web"){let ve="web_"+i.toLowerCase()+".png";oe=oe.replace("web.png",ve)}return d.jsx(Cc,{id:Q.id,name:Q.name,imageUrl:oe,selected:G.includes(Q.id),handleCardClick:Me,networkVersionSize:M,fileSizeLoading:j,showCheckBox:Q.id!=="adikteev",typeOfProduct:i,versionId:r,api:s,handleDownloadError:a,fetchFileUrl:l,urls:A,game:u,creditDownload:e,setIsConfirmActive:y,getDownloadCount:c,disabled:f,user:o,setSafariCopyLink:p,isTest:g,urlType:m,setCdnModal:I,generateCDN:Ke,cdnUrl:K},Q.id)})})}),G.length>1&&(i==="Playable"||i==="Ready"||i==="Flex")&&d.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:d.jsx(xc,{onClickMultiDownload:T,networksVersionTotalSize:R,typeOfProduct:i,multiDownloading:O})}),C&&d.jsx(Zc,{onClose:()=>{I(!1),c()},versionId:r,urls:A,handleDownloadError:a,cdnUrl:K,setCdnUrl:E,generateCDN:async()=>{if(!D){if(!e.willSpendCredit){Ke();return}if(o.customer==="playableFactoryInternal"){Ke();return}B(!0)}},cdnUploading:D}),re&&d.jsx(Ic,{onClose:()=>{se(!1)},url:F}),X&&d.jsx(fi,{width:"100%",height:"100%",creditConfirmType:W,handleCopyLink:async()=>{},download:async()=>{S(!1),B(!1),Ke()},onClose:()=>{S(!1),B(!1),H(!1)},getDownloadCount:c}),x&&d.jsx(fi,{creditConfirmType:W,handleCopyLink:async()=>{},download:async()=>{S(!1),y(!1),await Ue()},onClose:()=>{S(!1),y(!1)},getDownloadCount:c})]})};async function Ec(t,e){return(await ge.post(e+"/getFlexDownloadCount",t)).data}async function Oc(t,e){try{return(await ge.post(e+"/findGame",{_id:t})).data}catch{}}async function kc(t,e){return(await ge.post(e+"/getPlayableVersionMarketLink",{_id:t})).data}async function Lc(t,e){return(await ge.post(e+"/getFlexData",{_id:t})).data}async function Kc(t,e){return(await ge.post(e+"/getImportedPlayable",{id:t})).data}async function Mc(t,e){return(await ge.post(e+"/getReadyDownloadCount",t)).data}async function Wc(t,e){try{return(await ge.post(e+"/findCustomer",{_id:t})).data}catch{}}const Vo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","google360","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco","cdn"];let Xo=null;const jc=({playableId:t,versionId:e,gameId:n,typeOfProduct:r,visible:i,api:s,user:o,title:a,handleDownloadError:l,fetchFileUrl:A,fileSize:u,setFileSize:c,setSafariCopyLink:f,iosLink:p,androidLink:g,setIosLink:m,setAndroidLink:v,urlType:C,setUrlType:I})=>{const[K,E]=q.useState(null),[b,G]=q.useState(null),[Z,M]=q.useState(null),[N,j]=q.useState(!1),[z,R]=q.useState(!0),[V,O]=q.useState(window.innerWidth),[L,P]=q.useState(!1),[y,W]=q.useState(!1),[U,x]=q.useState("");Ne(To),Ne(Go);const[S,X]=Ne(Po),[B,D]=Ne(dn);q.useEffect(()=>{!U&&r!=="Fusion"&&HA(e).then(T=>{T!=null&&T.exist&&x(T.uploadPath)})},[U]),console.log("download modal version: 6.0.75");const[H,F]=q.useState(!1);q.useEffect(()=>{},[H]),q.useEffect(()=>{const T=()=>{O(window.innerWidth)};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)}},[]);const _=async()=>{j(!0);const T=await ri(t,s);return T!=null&&T.networks||(T.networks=Vo),E(T),T},re=(T,Q)=>{clearTimeout(Xo),Xo=setTimeout(()=>{r==="Playable"&&!B||ni(e,{iosUrl:T,googleUrl:Q},{urlType:C})},1e3)},se=T=>{m(T),re(T,g)},$=T=>{v(T),re(p,T)},me=async(T,Q)=>{var oe,ve;try{let qe;if(r==="Playable"||r==="Ready"){const We=await kc(e,s);if(We){m(We.iosLink),v(We.androidLink),j(!1);return}if(T&&(T.iosUrl||T.googleUrl)){m(T.iosUrl),v(T.googleUrl),j(!1);return}if(Q&&Q.html){const ot=`${A}/${Q.html}?t=${Date.now()}`;let Kt=await fetch(ot).then(dt=>dt.text());const Bt=((oe=Kt.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:oe.at(1))||"";m(Bt);const ct=((ve=Kt.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:ve.at(1))||"";v(ct),j(!1)}else v(""),m(""),j(!1)}else if(r==="Flex"){const We=await Lc(e,s);if(We.googleUrl||We.iosUrl){v(We.googleUrl),m(We.iosUrl),j(!1);return}T&&(T.iosUrl||T.googleUrl)?(m(T.iosUrl),v(T.googleUrl),j(!1)):(v(""),m(""),j(!1))}else r==="Fusion"&&(T&&(T.iosUrl||T.googleUrl)?(m(T.iosUrl),v(T.googleUrl),j(!1)):(v(""),m(""),j(!1)))}catch(qe){l(qe.response.data.error.msg)}},Y=async()=>{j(!0);let T;r==="Flex"?T=await Ec({_id:e},s):r==="Ready"&&(T=await Mc({_id:e},s)),T&&(["admin","pm","tester","sales"].includes(o.role)?M({...T,networks:S}):(console.log("result",T),r==="Ready"&&!T.canDownload?M({...T,networks:Vo}):(console.log("result",T),M({...T,networks:T.networks})))),j(!1)},Ce=async()=>await Oc(n,s),[Ke,Me]=q.useState(null),Ue=async T=>await Wc(T,s);return q.useEffect(()=>{i||(E(null),G(null),M(null),c(null),Me(null)),i&&(r==="Playable"?Ce().then(T=>{Ue(T.customer).then(Q=>{Me(Q)}),_().then(Q=>{me(null,Q)}),R(!1)}):r==="Ready"?Y().then(T=>{_().then(Q=>{me(null,Q),R(!1)})}):r==="Flex"?Y().then(T=>{R(!1),Ce().then(Q=>{i&&(me(Q,null),R(!1),G(Q))})}):r==="Import"?Kc(e,s).then(T=>{E(T),m(T.iosUrl||""),v(T.googleUrl||""),j(!1),R(!1)}):r==="Fusion"&&(R(!1),Ce().then(T=>{i&&(me(T,null),R(!1),T.networks=S.filter(Q=>Q!=="cdn"),G(T))})))},[n,t,e,i]),d.jsxs("div",{style:{display:"flex",height:V>1440?"700px":"650px",width:V>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[d.jsx(hc,{title:a,typeOfProduct:r,fileSize:u,urls:{iosUrl:p,googleUrl:g},handleIosChange:se,handleGoogleChange:$,disabled:z,api:s,creditDownload:Z,user:o,isTest:L,setIsTest:P,urlType:C,setUrlType:I,allNetworksSelected:H,setAllNetworksSelected:F}),N?d.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:d.jsx(fn,{isNetworksLoading:!0})}):(K||Z||r==="Fusion")&&(r==="Flex"?b:!0)&&!N&&p!=="Loading..."&&g!=="Loading..."&&d.jsx(Sc,{playable:K,creditDownload:Z,visible:i,versionId:e,typeOfProduct:r,api:s,user:o,handleDownloadError:l,fetchFileUrl:A,urls:{iosUrl:p,googleUrl:g},game:b,getDownloadCount:Y,disabled:z,setSafariCopyLink:f,isTest:L,urlType:C,allNetworksSelected:H,cdnModal:y,setCdnModal:W,cdnUrl:U,setCdnUrl:x,customer:Ke??void 0})]})},th="";var pi={exports:{}},It={},hi={exports:{}},tt={},mi={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;/*!
|
|
56
|
+
`+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Ct(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Pr.assertOptions(r,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean)},!1),i!=null&&(w.isFunction(i)?n.paramsSerializer={serialize:i}:Pr.assertOptions(i,{encode:gt.function,serialize:gt.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&w.merge(s.common,s[n.method]);s&&w.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),n.headers=et.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const A=[];this.interceptors.response.forEach(function(m){A.push(m.fulfilled,m.rejected)});let u,c=0,f;if(!l){const g=[lo.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,A),f=g.length,u=Promise.resolve(n);c<f;)u=u.then(g[c++],g[c++]);return u}f=a.length;let p=n;for(c=0;c<f;){const g=a[c++],m=a[c++];try{p=g(p)}catch(v){m.call(this,v);break}}try{u=lo.call(this,p)}catch(g){return Promise.reject(g)}for(c=0,f=A.length;c<f;)u=u.then(A[c++],A[c++]);return u}getUri(e){e=Ct(this.defaults,e);const n=$s(e.baseURL,e.url);return Bs(n,e.params,e.paramsSerializer)}}w.forEach(["delete","get","head","options"],function(e){Tn.prototype[e]=function(n,r){return this.request(Ct(r||{},{method:e,url:n,data:(r||{}).data}))}}),w.forEach(["post","put","patch"],function(e){function n(r){return function(s,o,a){return this.request(Ct(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Tn.prototype[e]=n(),Tn.prototype[e+"Form"]=n(!0)});const Gn=Tn;class Hr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Yt(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new Hr(function(i){e=i}),cancel:e}}}const fA=Hr;function pA(t){return function(n){return t.apply(null,n)}}function hA(t){return w.isObject(t)&&t.isAxiosError===!0}const Br={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Br).forEach(([t,e])=>{Br[e]=t});const mA=Br;function co(t){const e=new Gn(t),n=ks(Gn.prototype.request,e);return w.extend(n,Gn.prototype,e,{allOwnKeys:!0}),w.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return co(Ct(t,i))},n}const xe=co(Rr);xe.Axios=Gn,xe.CanceledError=Yt,xe.CancelToken=fA,xe.isCancel=Fs,xe.VERSION=uo,xe.toFormData=Rn,xe.AxiosError=ie,xe.Cancel=xe.CanceledError,xe.all=function(e){return Promise.all(e)},xe.spread=pA,xe.isAxiosError=hA,xe.mergeConfig=Ct,xe.AxiosHeaders=et,xe.formToJSON=t=>Us(w.isHTMLForm(t)?new FormData(t):t),xe.getAdapter=ao.getAdapter,xe.HttpStatusCode=mA,xe.default=xe;const gA=xe;/*! typescript-cookie v1.0.6 | MIT */const fo=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),po=t=>encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Vr=decodeURIComponent,Xr=t=>(t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function yA(t){return t=Object.assign({},t),typeof t.expires=="number"&&(t.expires=new Date(Date.now()+t.expires*864e5)),t.expires!=null&&(t.expires=t.expires.toUTCString()),Object.entries(t).filter(([e,n])=>n!=null&&n!==!1).map(([e,n])=>n===!0?`; ${e}`:`; ${e}=${n.split(";")[0]}`).join("")}function ho(t,e,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,i={};let s;for(;(s=r.exec(document.cookie))!=null;)try{const o=n(s[1]);if(i[o]=e(s[2],o),t===o)break}catch{}return t!=null?i[t]:i}const mo=Object.freeze({decodeName:Vr,decodeValue:Xr,encodeName:fo,encodeValue:po}),Ur=Object.freeze({path:"/"});function go(t,e,n=Ur,{encodeValue:r=po,encodeName:i=fo}={}){return document.cookie=`${i(t)}=${r(e,t)}${yA(n)}`}function yo(t,{decodeValue:e=Xr,decodeName:n=Vr}={}){return ho(t,e,n)}function vA({decodeValue:t=Xr,decodeName:e=Vr}={}){return ho(void 0,t,e)}function qA(t,e=Ur){go(t,"",Object.assign({},e,{expires:-1}))}function Qr(t,e){const n={set:function(i,s,o){return go(i,s,Object.assign({},this.attributes,o),{encodeValue:this.converter.write})},get:function(i){if(arguments.length===0)return vA(this.converter.read);if(i!=null)return yo(i,this.converter.read)},remove:function(i,s){qA(i,Object.assign({},this.attributes,s))},withAttributes:function(i){return Qr(this.converter,Object.assign({},this.attributes,i))},withConverter:function(i){return Qr(Object.assign({},this.converter,i),this.attributes)}},r={attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}};return Object.create(n,r)}Qr({read:mo.decodeValue,write:mo.encodeValue},Ur);let vo;typeof window<"u"&&(vo=yo("token"));const ge=gA.create({headers:{Authorization:vo}});async function bA(t,e,n){return(await ge.post(n+"/createFlexVersionLinkMulti",{_id:t,networks:e})).data}async function CA(t,e){return t.network=="fb"&&(t.zip=1),(await ge.post(e+"/createFlexVersionLink",t||{})).data}async function wA(t,e,n){return(await ge.post(t+"/createImportedVersionLink",{_id:e,network:n})).data}async function xA(t,e,n,r,i){return(await ge.post(t+"/createPlayableVersionLink",{_id:e,network:n,isPfTest:r,extras:i})).data}async function ZA(t,e,n){return(await ge.post(n+"/createPlayableVersionLinkMulti",{_id:t,networks:e})).data}async function IA(t,e,n,r,i,s){return(await ge.post(t+"/createReadyVersionLink",{_id:e,network:n,isPfTest:r,extras:i,download:s})).data}async function SA(t,e,n){return(await ge.post(n+"/createReadyVersionLinkMulti",{_id:t,networks:e})).data}async function EA(t,e,n,r,i,s,o,a){return(await ge.post(t+"/createFusionVersionLink",{_id:e,network:n,fusionData:r,isPfTest:i,extras:s,androidLink:o,iosLink:a})).data}async function OA(t,e){return(await ge.post(e+"/updateFusionUrl",t||{})).data}async function kA(t,e){return(await ge.post(e+"/getCdnExportName",t||{})).data}async function LA(t,e){return(await ge.post(e+"/updateFlexUrl",t||{})).data}async function qo(t,e,n){return(await ge.post(n+"/updatePlayableVersion",{...e,_id:t})).data}function Nt(t){const e=document.createElement("input");e.value=t,document.body.appendChild(e),e.select();try{return document.execCommand("copy")?(document.body.removeChild(e),!0):(document.body.removeChild(e),!1)}catch{return document.body.removeChild(e),!1}}function bo(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=bo(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function yt(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=bo(t))&&(r&&(r+=" "),r+=e);return r}const on=t=>typeof t=="number"&&!isNaN(t),wt=t=>typeof t=="string",Re=t=>typeof t=="function",Pn=t=>wt(t)||Re(t)?t:null,Fr=t=>q.isValidElement(t)||wt(t)||Re(t)||on(t);function KA(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:i}=t;requestAnimationFrame(()=>{i.minHeight="initial",i.height=r+"px",i.transition=`all ${n}ms`,requestAnimationFrame(()=>{i.height="0",i.padding="0",i.margin="0",setTimeout(e,n)})})}function Hn(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:i=!0,collapseDuration:s=300}=t;return function(o){let{children:a,position:l,preventExitTransition:A,done:u,nodeRef:c,isIn:f}=o;const p=r?`${e}--${l}`:e,g=r?`${n}--${l}`:n,m=q.useRef(0);return q.useLayoutEffect(()=>{const v=c.current,C=p.split(" "),I=K=>{K.target===c.current&&(v.dispatchEvent(new Event("d")),v.removeEventListener("animationend",I),v.removeEventListener("animationcancel",I),m.current===0&&K.type!=="animationcancel"&&v.classList.remove(...C))};v.classList.add(...C),v.addEventListener("animationend",I),v.addEventListener("animationcancel",I)},[]),q.useEffect(()=>{const v=c.current,C=()=>{v.removeEventListener("animationend",C),i?KA(v,u,s):u()};f||(A?C():(m.current=1,v.className+=` ${g}`,v.addEventListener("animationend",C)))},[f]),q.createElement(q.Fragment,null,a)}}function Co(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const Ve={list:new Map,emitQueue:new Map,on(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off(t,e){if(e){const n=this.list.get(t).filter(r=>r!==e);return this.list.set(t,n),this}return this.list.delete(t),this},cancelEmit(t){const e=this.emitQueue.get(t);return e&&(e.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(e=>{const n=setTimeout(()=>{e(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(n)})}},Bn=t=>{let{theme:e,type:n,...r}=t;return q.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},_r={info:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return q.createElement(Bn,{...t},q.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return q.createElement("div",{className:"Toastify__spinner"})}};function MA(t){const[,e]=q.useReducer(p=>p+1,0),[n,r]=q.useState([]),i=q.useRef(null),s=q.useRef(new Map).current,o=p=>n.indexOf(p)!==-1,a=q.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:o,getToast:p=>s.get(p)}).current;function l(p){let{containerId:g}=p;const{limit:m}=a.props;!m||g&&a.containerId!==g||(a.count-=a.queue.length,a.queue=[])}function A(p){r(g=>p==null?[]:g.filter(m=>m!==p))}function u(){const{toastContent:p,toastProps:g,staleId:m}=a.queue.shift();f(p,g,m)}function c(p,g){let{delay:m,staleId:v,...C}=g;if(!Fr(p)||function(R){return!i.current||a.props.enableMultiContainer&&R.containerId!==a.props.containerId||s.has(R.toastId)&&R.updateId==null}(C))return;const{toastId:I,updateId:K,data:E}=C,{props:b}=a,G=()=>A(I),Z=K==null;Z&&a.count++;const M={...b,style:b.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(C).filter(R=>{let[V,O]=R;return O!=null})),toastId:I,updateId:K,data:E,closeToast:G,isIn:!1,className:Pn(C.className||b.toastClassName),bodyClassName:Pn(C.bodyClassName||b.bodyClassName),progressClassName:Pn(C.progressClassName||b.progressClassName),autoClose:!C.isLoading&&(N=C.autoClose,j=b.autoClose,N===!1||on(N)&&N>0?N:j),deleteToast(){const R=Co(s.get(I),"removed");s.delete(I),Ve.emit(4,R);const V=a.queue.length;if(a.count=I==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),V>0){const O=I==null?a.props.limit:1;if(V===1||O===1)a.displayedToast++,u();else{const L=O>V?V:O;a.displayedToast=L;for(let P=0;P<L;P++)u()}}else e()}};var N,j;M.iconOut=function(R){let{theme:V,type:O,isLoading:L,icon:P}=R,y=null;const W={theme:V,type:O};return P===!1||(Re(P)?y=P(W):q.isValidElement(P)?y=q.cloneElement(P,W):wt(P)||on(P)?y=P:L?y=_r.spinner():(U=>U in _r)(O)&&(y=_r[O](W))),y}(M),Re(C.onOpen)&&(M.onOpen=C.onOpen),Re(C.onClose)&&(M.onClose=C.onClose),M.closeButton=b.closeButton,C.closeButton===!1||Fr(C.closeButton)?M.closeButton=C.closeButton:C.closeButton===!0&&(M.closeButton=!Fr(b.closeButton)||b.closeButton);let z=p;q.isValidElement(p)&&!wt(p.type)?z=q.cloneElement(p,{closeToast:G,toastProps:M,data:E}):Re(p)&&(z=p({closeToast:G,toastProps:M,data:E})),b.limit&&b.limit>0&&a.count>b.limit&&Z?a.queue.push({toastContent:z,toastProps:M,staleId:v}):on(m)?setTimeout(()=>{f(z,M,v)},m):f(z,M,v)}function f(p,g,m){const{toastId:v}=g;m&&s.delete(m);const C={content:p,props:g};s.set(v,C),r(I=>[...I,v].filter(K=>K!==m)),Ve.emit(4,Co(C,C.props.updateId==null?"added":"updated"))}return q.useEffect(()=>(a.containerId=t.containerId,Ve.cancelEmit(3).on(0,c).on(1,p=>i.current&&A(p)).on(5,l).emit(2,a),()=>{s.clear(),Ve.emit(3,a)}),[]),q.useEffect(()=>{a.props=t,a.isToastActive=o,a.displayedToast=n.length}),{getToastToRender:function(p){const g=new Map,m=Array.from(s.values());return t.newestOnTop&&m.reverse(),m.forEach(v=>{const{position:C}=v.props;g.has(C)||g.set(C,[]),g.get(C).push(v)}),Array.from(g,v=>p(v[0],v[1]))},containerRef:i,isToastActive:o}}function wo(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function xo(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function WA(t){const[e,n]=q.useState(!1),[r,i]=q.useState(!1),s=q.useRef(null),o=q.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=q.useRef(t),{autoClose:l,pauseOnHover:A,closeToast:u,onClick:c,closeOnClick:f}=t;function p(E){if(t.draggable){E.nativeEvent.type==="touchstart"&&E.nativeEvent.preventDefault(),o.didMove=!1,document.addEventListener("mousemove",C),document.addEventListener("mouseup",I),document.addEventListener("touchmove",C),document.addEventListener("touchend",I);const b=s.current;o.canCloseOnClick=!0,o.canDrag=!0,o.boundingRect=b.getBoundingClientRect(),b.style.transition="",o.x=wo(E.nativeEvent),o.y=xo(E.nativeEvent),t.draggableDirection==="x"?(o.start=o.x,o.removalDistance=b.offsetWidth*(t.draggablePercent/100)):(o.start=o.y,o.removalDistance=b.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function g(E){if(o.boundingRect){const{top:b,bottom:G,left:Z,right:M}=o.boundingRect;E.nativeEvent.type!=="touchend"&&t.pauseOnHover&&o.x>=Z&&o.x<=M&&o.y>=b&&o.y<=G?v():m()}}function m(){n(!0)}function v(){n(!1)}function C(E){const b=s.current;o.canDrag&&b&&(o.didMove=!0,e&&v(),o.x=wo(E),o.y=xo(E),o.delta=t.draggableDirection==="x"?o.x-o.start:o.y-o.start,o.start!==o.x&&(o.canCloseOnClick=!1),b.style.transform=`translate${t.draggableDirection}(${o.delta}px)`,b.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function I(){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",C),document.removeEventListener("touchend",I);const E=s.current;if(o.canDrag&&o.didMove&&E){if(o.canDrag=!1,Math.abs(o.delta)>o.removalDistance)return i(!0),void t.closeToast();E.style.transition="transform 0.2s, opacity 0.2s",E.style.transform=`translate${t.draggableDirection}(0)`,E.style.opacity="1"}}q.useEffect(()=>{a.current=t}),q.useEffect(()=>(s.current&&s.current.addEventListener("d",m,{once:!0}),Re(t.onOpen)&&t.onOpen(q.isValidElement(t.children)&&t.children.props),()=>{const E=a.current;Re(E.onClose)&&E.onClose(q.isValidElement(E.children)&&E.children.props)}),[]),q.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||v(),window.addEventListener("focus",m),window.addEventListener("blur",v)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",m),window.removeEventListener("blur",v))}),[t.pauseOnFocusLoss]);const K={onMouseDown:p,onTouchStart:p,onMouseUp:g,onTouchEnd:g};return l&&A&&(K.onMouseEnter=v,K.onMouseLeave=m),f&&(K.onClick=E=>{c&&c(E),o.canCloseOnClick&&u()}),{playToast:m,pauseToast:v,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:K}}function Zo(t){let{closeToast:e,theme:n,ariaLabel:r="close"}=t;return q.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:i=>{i.stopPropagation(),e(i)},"aria-label":r},q.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},q.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function jA(t){let{delay:e,isRunning:n,closeToast:r,type:i="default",hide:s,className:o,style:a,controlledProgress:l,progress:A,rtl:u,isIn:c,theme:f}=t;const p=s||l&&A===0,g={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused",opacity:p?0:1};l&&(g.transform=`scaleX(${A})`);const m=yt("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":u}),v=Re(o)?o({rtl:u,type:i,defaultClassName:m}):yt(m,o);return q.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:g,[l&&A>=1?"onTransitionEnd":"onAnimationEnd"]:l&&A<1?null:()=>{c&&r()}})}const RA=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:i}=WA(t),{closeButton:s,children:o,autoClose:a,onClick:l,type:A,hideProgressBar:u,closeToast:c,transition:f,position:p,className:g,style:m,bodyClassName:v,bodyStyle:C,progressClassName:I,progressStyle:K,updateId:E,role:b,progress:G,rtl:Z,toastId:M,deleteToast:N,isIn:j,isLoading:z,iconOut:R,closeOnClick:V,theme:O}=t,L=yt("Toastify__toast",`Toastify__toast-theme--${O}`,`Toastify__toast--${A}`,{"Toastify__toast--rtl":Z},{"Toastify__toast--close-on-click":V}),P=Re(g)?g({rtl:Z,position:p,type:A,defaultClassName:L}):yt(L,g),y=!!G||!a,W={closeToast:c,type:A,theme:O};let U=null;return s===!1||(U=Re(s)?s(W):q.isValidElement(s)?q.cloneElement(s,W):Zo(W)),q.createElement(f,{isIn:j,done:N,position:p,preventExitTransition:n,nodeRef:r},q.createElement("div",{id:M,onClick:l,className:P,...i,style:m,ref:r},q.createElement("div",{...j&&{role:b},className:Re(v)?v({type:A}):yt("Toastify__toast-body",v),style:C},R!=null&&q.createElement("div",{className:yt("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!z})},R),q.createElement("div",null,o)),U,q.createElement(jA,{...E&&!y?{key:`pb-${E}`}:{},rtl:Z,theme:O,delay:a,isRunning:e,isIn:j,closeToast:c,hide:u,type:A,style:K,className:I,controlledProgress:y,progress:G||0})))},Vn=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},zA=Hn(Vn("bounce",!0));Hn(Vn("slide",!0)),Hn(Vn("zoom")),Hn(Vn("flip"));const $r=q.forwardRef((t,e)=>{const{getToastToRender:n,containerRef:r,isToastActive:i}=MA(t),{className:s,style:o,rtl:a,containerId:l}=t;function A(u){const c=yt("Toastify__toast-container",`Toastify__toast-container--${u}`,{"Toastify__toast-container--rtl":a});return Re(s)?s({position:u,rtl:a,defaultClassName:c}):yt(c,Pn(s))}return q.useEffect(()=>{e&&(e.current=r.current)},[]),q.createElement("div",{ref:r,className:"Toastify",id:l},n((u,c)=>{const f=c.length?{...o}:{...o,pointerEvents:"none"};return q.createElement("div",{className:A(u),style:f,key:`container-${u}`},c.map((p,g)=>{let{content:m,props:v}=p;return q.createElement(RA,{...v,isIn:i(v.toastId),style:{...v.style,"--nth":g+1,"--len":c.length},key:`toast-${v.key}`},m)}))}))});$r.displayName="ToastContainer",$r.defaultProps={position:"top-right",transition:zA,autoClose:5e3,closeButton:Zo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let ei,xt=new Map,an=[],YA=1;function Io(){return""+YA++}function NA(t){return t&&(wt(t.toastId)||on(t.toastId))?t.toastId:Io()}function ln(t,e){return xt.size>0?Ve.emit(0,t,e):an.push({content:t,options:e}),e.toastId}function Xn(t,e){return{...e,type:e&&e.type||t,toastId:NA(e)}}function Un(t){return(e,n)=>ln(e,Xn(t,n))}function ye(t,e){return ln(t,Xn("default",e))}ye.loading=(t,e)=>ln(t,Xn("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),ye.promise=function(t,e,n){let r,{pending:i,error:s,success:o}=e;i&&(r=wt(i)?ye.loading(i,n):ye.loading(i.render,{...n,...i}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,c,f)=>{if(c==null)return void ye.dismiss(r);const p={type:u,...a,...n,data:f},g=wt(c)?{render:c}:c;return r?ye.update(r,{...p,...g}):ye(g.render,{...p,...g}),f},A=Re(t)?t():t;return A.then(u=>l("success",o,u)).catch(u=>l("error",s,u)),A},ye.success=Un("success"),ye.info=Un("info"),ye.error=Un("error"),ye.warning=Un("warning"),ye.warn=ye.warning,ye.dark=(t,e)=>ln(t,Xn("default",{theme:"dark",...e})),ye.dismiss=t=>{xt.size>0?Ve.emit(1,t):an=an.filter(e=>t!=null&&e.options.toastId!==t)},ye.clearWaitingQueue=function(t){return t===void 0&&(t={}),Ve.emit(5,t)},ye.isActive=t=>{let e=!1;return xt.forEach(n=>{n.isToastActive&&n.isToastActive(t)&&(e=!0)}),e},ye.update=function(t,e){e===void 0&&(e={}),setTimeout(()=>{const n=function(r,i){let{containerId:s}=i;const o=xt.get(s||ei);return o&&o.getToast(r)}(t,e);if(n){const{props:r,content:i}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:Io()};s.toastId!==t&&(s.staleId=t);const o=s.render||i;delete s.render,ln(o,s)}},0)},ye.done=t=>{ye.update(t,{progress:1})},ye.onChange=t=>(Ve.on(4,t),()=>{Ve.off(4,t)}),ye.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},ye.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Ve.on(2,t=>{ei=t.containerId||t,xt.set(ei,t),an.forEach(e=>{Ve.emit(0,e.content,e.options)}),an=[]}).on(3,t=>{xt.delete(t.containerId||t),xt.size===0&&Ve.off(0).off(1).off(5)});function JA(t){ye.error(t,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}function Zt(t){ye.success(t,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let ti="",ze="Playable",Ye=null,So=null,un,Eo=[];const ni=async(t,e,n)=>{ze==="Playable"?e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&await qo(t,{iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye):ze==="Flex"?e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&await LA({_id:t,iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye):ze==="Ready"?e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(e.googleUrl=e.iosUrl),await qo(t,{iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye)):ze==="Fusion"&&e&&e.iosUrl!=="Loading..."&&e.googleUrl!=="Loading..."&&await OA({_id:un==null?void 0:un.fusionId,iosLink:e==null?void 0:e.iosUrl,androidLink:e==null?void 0:e.googleUrl},Ye)},Qn=async t=>{let e=ti+"/"+t,n=t;fetch(e).then(r=>r.blob()).then(r=>{const i=window.URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=n.split("/").reduce((o,a)=>a,""),document.body.appendChild(s),s.click(),window.URL.revokeObjectURL(i),Zt("Download successfully")}).catch(r=>{console.error("File error:",r)})},DA=(t,e,n)=>{let r=ti+"/"+t;n==="adikteev"&&(r=t),Nt(r)?Zt(ae.t("common:link_copied")):e(r)};function Oo(t){let e=Eo.find(n=>n.id===t);return e&&e.apiName?e.apiName:t}async function An(t,e,n,r="download",i=!1,s=null){return e=Oo(e),new Promise(async(o,a)=>{let l=async A=>{r==="download"?await Qn(A):r==="copy"&&DA(A,So,e)};try{await ni(t,n,s)}catch(A){console.log("updateUrls error",A)}ze==="Playable"?xA(Ye,t,e,i,s).then(async A=>{let{url:u}=A;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Flex"?CA({_id:t,network:e,extras:s},Ye).then(async A=>{if(A.message){a(A);return}let{url:u}=A;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Import"?wA(Ye,t,e).then(async A=>{let u=A.url;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Ready"?IA(Ye,t,e,i,s,r==="download").then(async A=>{if(A.message){a(A);return}let u=A.url;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})}):ze==="Fusion"&&EA(Ye,t,e,un,i,s,n==null?void 0:n.googleUrl,n==null?void 0:n.iosUrl).then(async A=>{let u=A.url;await l(u),o(A)}).catch(A=>{let u=A.response.data.error.msg;a({message:u})})})}async function TA(t,e,n,r=null){return new Promise(async(i,s)=>{n=n.map(o=>Oo(o)),await ni(t,e,r),ze==="Flex"?bA(t,n,Ye).then(async o=>{if(o.message){s(o);return}await Qn(o.url),i(o.url)}).catch(o=>{let a=o.response.data.error.msg;s({message:a})}):ze==="Ready"?SA(t,n,Ye).then(async o=>{if(o.message){s(o);return}await Qn(o.url),i(o.url)}).catch(o=>{console.log("err",o);let a=o.response.data.error.msg;s({message:a})}):ZA(t,n,Ye).then(async o=>{await Qn(o.url),i(o.url)}).catch(o=>{let a=o.response.data.error.msg;s({message:a})})})}function GA(t,e,n,r,i){ze=t,Ye=e,So=n,ti=r,un=i}function PA(t){Eo=t}async function HA(t){try{return await kA({versionId:t,checkExistance:!0,isFlex:ze==="Flex",isFusion:ze==="Fusion"},Ye)}catch{return null}}async function ri(t,e){return(await ge.post(e+"/findPlayable",{_id:t})).data}const ko=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Lo=t=>"init"in t,Ko=t=>!!t.write,Mo=t=>"v"in t||"e"in t,Fn=t=>{if("e"in t)throw t.e;return t.v},_n=new WeakMap,Wo=t=>{var e;return $n(t)&&!!((e=_n.get(t))!=null&&e[0])},BA=t=>{const e=_n.get(t);e!=null&&e[0]&&(e[0]=!1,e[1].forEach(n=>n()))},jo=(t,e)=>{let n=_n.get(t);if(!n){n=[!0,new Set],_n.set(t,n);const r=()=>{n[0]=!1};t.then(r,r)}n[1].add(e)},$n=t=>typeof(t==null?void 0:t.then)=="function",Ro=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},ii=(t,e,n)=>{const r=n(t),i="v"in r,s=r.v;if($n(e))for(const o of r.d.keys())Ro(t,e,n(o));r.v=e,delete r.e,(!i||!Object.is(s,r.v))&&(++r.n,$n(s)&&BA(s))},zo=(t,e,n)=>{var r;const i=new Set;for(const s of((r=n.get(t))==null?void 0:r.t)||[])n.has(s)&&i.add(s);for(const s of e.p)i.add(s);return i},VA=()=>{const t=new Set,e=()=>{t.forEach(n=>n())};return e.add=n=>(t.add(n),()=>{t.delete(n)}),e},si=()=>{const t={},e=new WeakMap,n=r=>{var i,s;(i=e.get(t))==null||i.forEach(o=>o(r)),(s=e.get(r))==null||s.forEach(o=>o())};return n.add=(r,i)=>{const s=r||t,o=(e.has(s)?e:e.set(s,new Set)).get(s);return o.add(i),()=>{o==null||o.delete(i),o.size||e.delete(s)}},n},XA=t=>(t.c||(t.c=si()),t.m||(t.m=si()),t.u||(t.u=si()),t.f||(t.f=VA()),t),UA=Symbol(),Yo=(t=new WeakMap,e=new WeakMap,n=new WeakMap,r=new Set,i=new Set,s=new Set,o={},a=(f,...p)=>f.read(...p),l=(f,...p)=>f.write(...p),A=(f,p)=>{var g;return(g=f.unstable_onInit)==null?void 0:g.call(f,p)},u=(f,p)=>{var g;return(g=f.onMount)==null?void 0:g.call(f,p)},...c)=>{const f=c[0]||(Z=>{let M=t.get(Z);return M||(M={d:new Map,p:new Set,n:0},t.set(Z,M),A==null||A(Z,G)),M}),p=c[1]||(()=>{const Z=[],M=N=>{try{N()}catch(j){Z.push(j)}};do{o.f&&M(o.f);const N=new Set,j=N.add.bind(N);r.forEach(z=>{var R;return(R=e.get(z))==null?void 0:R.l.forEach(j)}),r.clear(),s.forEach(j),s.clear(),i.forEach(j),i.clear(),N.forEach(M),r.size&&g()}while(r.size||s.size||i.size);if(Z.length)throw new AggregateError(Z)}),g=c[2]||(()=>{const Z=[],M=new WeakSet,N=new WeakSet,j=Array.from(r);for(;j.length;){const z=j[j.length-1],R=f(z);if(N.has(z)){j.pop();continue}if(M.has(z)){n.get(z)===R.n&&Z.push([z,R]),N.add(z),j.pop();continue}M.add(z);for(const V of zo(z,R,e))M.has(V)||j.push(V)}for(let z=Z.length-1;z>=0;--z){const[R,V]=Z[z];let O=!1;for(const L of V.d.keys())if(L!==R&&r.has(L)){O=!0;break}O&&(m(R),I(R)),n.delete(R)}}),m=c[3]||(Z=>{var M;const N=f(Z);if(Mo(N)&&(e.has(Z)&&n.get(Z)!==N.n||Array.from(N.d).every(([y,W])=>m(y).n===W)))return N;N.d.clear();let j=!0;const z=()=>{e.has(Z)&&(I(Z),g(),p())},R=y=>{var W;if(ko(Z,y)){const x=f(y);if(!Mo(x))if(Lo(y))ii(y,y.init,f);else throw new Error("no atom init");return Fn(x)}const U=m(y);try{return Fn(U)}finally{N.d.set(y,U.n),Wo(N.v)&&Ro(Z,N.v,U),(W=e.get(y))==null||W.t.add(Z),j||z()}};let V,O;const L={get signal(){return V||(V=new AbortController),V.signal},get setSelf(){return!O&&Ko(Z)&&(O=(...y)=>{if(!j)try{return C(Z,...y)}finally{g(),p()}}),O}},P=N.n;try{const y=a(Z,R,L);return ii(Z,y,f),$n(y)&&(jo(y,()=>V==null?void 0:V.abort()),y.then(z,z)),N}catch(y){return delete N.v,N.e=y,++N.n,N}finally{j=!1,P!==N.n&&n.get(Z)===P&&(n.set(Z,N.n),r.add(Z),(M=o.c)==null||M.call(o,Z))}}),v=c[4]||(Z=>{const M=[Z];for(;M.length;){const N=M.pop(),j=f(N);for(const z of zo(N,j,e)){const R=f(z);n.set(z,R.n),M.push(z)}}}),C=c[5]||((Z,...M)=>{let N=!0;const j=R=>Fn(m(R)),z=(R,...V)=>{var O;const L=f(R);try{if(ko(Z,R)){if(!Lo(R))throw new Error("atom not writable");const P=L.n,y=V[0];ii(R,y,f),I(R),P!==L.n&&(r.add(R),(O=o.c)==null||O.call(o,R),v(R));return}else return C(R,...V)}finally{N||(g(),p())}};try{return l(Z,j,z,...M)}finally{N=!1}}),I=c[6]||(Z=>{var M;const N=f(Z),j=e.get(Z);if(j&&!Wo(N.v)){for(const[z,R]of N.d)if(!j.d.has(z)){const V=f(z);K(z).t.add(Z),j.d.add(z),R!==V.n&&(r.add(z),(M=o.c)==null||M.call(o,z),v(z))}for(const z of j.d||[])if(!N.d.has(z)){j.d.delete(z);const R=E(z);R==null||R.t.delete(Z)}}}),K=c[7]||(Z=>{var M;const N=f(Z);let j=e.get(Z);if(!j){m(Z);for(const z of N.d.keys())K(z).t.add(Z);if(j={l:new Set,d:new Set(N.d.keys()),t:new Set},e.set(Z,j),(M=o.m)==null||M.call(o,Z),Ko(Z)){const z=()=>{let R=!0;const V=(...O)=>{try{return C(Z,...O)}finally{R||(g(),p())}};try{const O=u(Z,V);O&&(j.u=()=>{R=!0;try{O()}finally{R=!1}})}finally{R=!1}};i.add(z)}}return j}),E=c[8]||(Z=>{var M;const N=f(Z);let j=e.get(Z);if(j&&!j.l.size&&!Array.from(j.t).some(z=>{var R;return(R=e.get(z))==null?void 0:R.d.has(Z)})){j.u&&s.add(j.u),j=void 0,e.delete(Z),(M=o.u)==null||M.call(o,Z);for(const z of N.d.keys()){const R=E(z);R==null||R.t.delete(Z)}return}return j}),b=[t,e,n,r,i,s,o,a,l,A,u,f,p,g,m,v,C,I,K,E],G={get:Z=>Fn(m(Z)),set:(Z,...M)=>{try{return C(Z,...M)}finally{g(),p()}},sub:(Z,M)=>{const j=K(Z).l;return j.add(M),p(),()=>{j.delete(M),E(Z),p()}}};return Object.defineProperty(G,UA,{value:b}),G},QA=XA,No=jo;let FA=0;function cn(t,e){const n=`atom${++FA}`,r={toString(){return n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=_A,r.write=$A),e&&(r.write=e),r}function _A(t){return t(this)}function $A(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const $p=()=>{let t=0;const e=QA({}),n=new WeakMap,r=new WeakMap,i=Yo(n,r,void 0,void 0,void 0,void 0,e,void 0,(a,l,A,...u)=>t?A(a,...u):a.write(l,A,...u)),s=new Set;return e.m.add(void 0,a=>{s.add(a);const l=n.get(a);l.m=r.get(a)}),e.u.add(void 0,a=>{s.delete(a);const l=n.get(a);delete l.m}),Object.assign(i,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),n),dev4_get_mounted_atoms:()=>s,dev4_restore_atoms:a=>{const l={read:()=>null,write:(A,u)=>{++t;try{for(const[c,f]of a)"init"in c&&u(c,f)}finally{--t}}};i.set(l)}})};function ec(){return Yo()}let oi;function tc(){return oi||(oi=ec()),oi}const nc=q.createContext(void 0);function Jo(t){const e=q.useContext(nc);return(t==null?void 0:t.store)||e||tc()}const ai=t=>typeof(t==null?void 0:t.then)=="function",li=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},rc=q.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(li(t),t)}),ui=new WeakMap,Do=(t,e)=>{let n=ui.get(t);return n||(n=new Promise((r,i)=>{let s=t;const o=A=>u=>{s===A&&r(u)},a=A=>u=>{s===A&&i(u)},l=()=>{try{const A=e();ai(A)?(ui.set(A,n),s=A,A.then(o(A),a(A)),No(A,l)):r(A)}catch(A){i(A)}};t.then(o(t),a(t)),No(t,l)}),ui.set(t,n)),n};function ic(t,e){const{delay:n,unstable_promiseStatus:r=!q.use}=e||{},i=Jo(e),[[s,o,a],l]=q.useReducer(u=>{const c=i.get(t);return Object.is(u[0],c)&&u[1]===i&&u[2]===t?u:[c,i,t]},void 0,()=>[i.get(t),i,t]);let A=s;if((o!==i||a!==t)&&(l(),A=i.get(t)),q.useEffect(()=>{const u=i.sub(t,()=>{if(r)try{const c=i.get(t);ai(c)&&li(Do(c,()=>i.get(t)))}catch{}if(typeof n=="number"){setTimeout(l,n);return}l()});return l(),u},[i,t,n,r]),q.useDebugValue(A),ai(A)){const u=Do(A,()=>i.get(t));return r&&li(u),rc(u)}return A}function sc(t,e){const n=Jo(e);return q.useCallback((...i)=>n.set(t,...i),[n,t])}function Ne(t,e){return[ic(t,e),sc(t,e)]}const To=cn(""),Go=cn(!1),Ai=cn([]),Po=cn([]),dn=cn(!1),oc=({versionId:t,playableId:e,typeOfProduct:n,api:r,copyLinkUrl:i,setSafariCopyLink:s,qrUrl:o,iosLink:a,androidLink:l,urlType:A})=>{const[u,c]=q.useState(!1),[f,p]=Ne(dn),g=n==="Playable"?f:!0,m=async()=>{c(!0),An(t,"default",g?{iosUrl:a,googleUrl:l}:null,null,!1,{urlType:A}).then(async v=>{var E,b,G,Z;let C="";if(e&&(n==="Playable"||n==="Ready")){const M=await ri(e,r),N=(b=(E=M==null?void 0:M.data)==null?void 0:E.globalProps)==null?void 0:b.defaultLandscape,j=(Z=(G=M==null?void 0:M.data)==null?void 0:G.globalProps)==null?void 0:Z.defaultPhoneIndex;N&&(C+="&landscape=true"),j!==void 0&&(C+=`&phoneIndex=${j}`)}ri(e,r),c(!1);let I;n==="Flex"?I=`${i}/preview?versionId=${t}`:n==="Import"?I=`${i}/preview?versionId=${t}`:n==="Ready"?I=`${i}/preview?versionId=${t}&ready=true`:n==="Fusion"?I=`${i}/preview?versionId=${t}`:I=`${i}/preview?versionId=${t}`,I+=C,Nt(I)?Zt(ae.t("common:link_copied")):s(I),c(!1)}).catch(v=>{c(!1)})};return d.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[d.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:o?d.jsx(wl,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:o}):d.jsx("img",{style:{width:"50px",height:"50px"},src:Te,alt:"pf-logo-gif"})}),d.jsxs("div",{children:[d.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:ae.t("common:mobile_testing")}),d.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:ae.t("common:scan_qr_code_to_test_in_any_browser")}),d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{u||m()},children:d.jsxs(d.Fragment,{children:[d.jsx(hs,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),d.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:u?d.jsx("img",{style:{height:"90%"},src:Te,alt:"loading"}):d.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:ae.t("common:copy_link")})})]})})]})]})},ac=({versionName:t,versionId:e,playableId:n,typeOfProduct:r,api:i,iframeUrl:s,fetchFileUrl:o,copyLinkUrl:a,setSafariCopyLink:l,iosLink:A,androidLink:u,urlType:c})=>{const[f,p]=q.useState(window.innerWidth);console.log("iosLink",A),q.useEffect(()=>{console.log("re add event listener");function m(v){console.log(v),v.data==="cta"&&(console.log("Received 'cta' message from iframe"),A&&window.open(A,"_blank"))}return window.addEventListener("message",m,!1),()=>{window.removeEventListener("message",m)}},[A,u]),q.useEffect(()=>{const m=()=>{p(window.innerWidth)};return window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[]);const g=(t==null?void 0:t.length)>25?t.slice(0,25)+"...":t;return d.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:f>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[d.jsx(Ga,{iframeUrl:s}),d.jsx(Pa,{name:g}),d.jsx(oc,{versionId:e,playableId:n,typeOfProduct:r,api:i,copyLinkUrl:a,setSafariCopyLink:l,qrUrl:s,iosLink:A,androidLink:u,urlType:c})]})},lc=({typeOfProduct:t,allNetworksSelected:e,setAllNetworksSelected:n})=>d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:d.jsx("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"}})});async function uc(t,e){return(await ge.post(e+"/buyRequest",{requestType:t})).data}const Ac=()=>d.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[d.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),d.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_518_12094",children:d.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),cc=({creditDownload:t,api:e})=>d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{marginTop:"0.5rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",fontWeight:100},children:"If you continue to export, you will spend 1 credit."}),d.jsxs("div",{style:{display:"flex",alignItems:"center",width:"100%",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.25rem",fontSize:"12px",fontWeight:100},children:["You have"," ",d.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(t==null?void 0:t.downloadLimit)-(t==null?void 0:t.downloadLimitUsed)<0?0:(t==null?void 0:t.downloadLimit)-(t==null?void 0:t.downloadLimitUsed)})," ","credits remaining.",d.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>uc("Flex Credit",e).then(n=>Zt("You will be contacted regarding your request.")),children:["Get more",d.jsx(Ac,{})]})]})]});var ke=(t=>(t.Flex="#7101FF",t.Playable="#F9830B",t.Import="#00a3ff",t.Ready="#0060A5",t.Fusion="#171717",t))(ke||{});const Ho=({typeOfProduct:t,urls:e,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const s=u=>{n(u.target.value)},o=u=>{r(u.target.value)},[a,l]=Ne(dn);let A=i;return t==="Playable"&&!i&&!a&&(A=!0),d.jsxs(d.Fragment,{children:[t==="Playable"&&d.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[d.jsx("span",{style:{width:"6.5rem",fontWeight:"bold",flexShrink:0},children:"Use Custom Url"}),d.jsx("input",{type:"checkbox",checked:a,onChange:u=>l(u.target.checked)})]}),d.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[d.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:ae.t("common:app_store")}),d.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:e.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ke[t],marginRight:"2rem"},type:"text",value:e.iosUrl,onChange:s,placeholder:"Ios Url",disabled:A})]}),d.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[d.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:[ae.t("common:google_play"),":"]}),d.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:e.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ke[t],marginRight:"2rem"},type:"text",value:e.googleUrl,onChange:o,placeholder:"Google Url",disabled:A})]})]})},dc=({typeOfProduct:t,urls:e,handleIosChange:n,handleGoogleChange:r,disabled:i})=>{const s=o=>{n(o.target.value)};return d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[d.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),d.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:e.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ke[t],marginRight:"2rem"},type:"text",value:e.iosUrl,onChange:s,placeholder:"Ios Url",disabled:i})]})})},fc=({typeOfProduct:t,fileSize:e,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s,api:o,creditDownload:a,user:l,isTest:A,setIsTest:u,urlType:c,setUrlType:f})=>{const p=()=>d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",width:"400px",height:"30px",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid #eaeaec",marginBottom:"10px",position:"relative"},className:"tab-switch",children:[d.jsx("div",{style:{position:"absolute",bottom:"-3px",left:c==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),d.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="0%",document.getElementById("single-tab").style.color="#a3a3a3",document.getElementById("game-tab").style.color="#000",document.getElementById("single-tab").style.fontWeight="normal",document.getElementById("game-tab").style.fontWeight="bold",setTimeout(()=>{f("game")},200)},children:d.jsx("span",{style:{position:"relative",color:c==="game"?"#000":"#a3a3a3",fontWeight:c==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),d.jsx("div",{style:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",position:"relative"},onClick:()=>{document.getElementById("tab-switch-background").style.left="50%",document.getElementById("single-tab").style.color="#000",document.getElementById("game-tab").style.color="#a3a3a3",document.getElementById("single-tab").style.fontWeight="bold",document.getElementById("game-tab").style.fontWeight="normal",setTimeout(()=>{f("single")},200)},children:d.jsx("span",{style:{position:"relative",color:c==="single"?"#000":"#a3a3a3",fontWeight:c==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return d.jsx(d.Fragment,{children:t!=="Import"&&d.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[t==="Ready"?d.jsxs(d.Fragment,{children:[d.jsx(p,{}),c==="game"&&d.jsx(Ho,{typeOfProduct:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s}),c==="single"&&d.jsx(dc,{typeOfProduct:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s})]}):d.jsx(d.Fragment,{children:d.jsx(Ho,{typeOfProduct:t,urls:n,handleIosChange:r,handleGoogleChange:i,disabled:s})}),(a==null?void 0:a.willSpendCredit)&&d.jsx(cc,{creditDownload:a,api:o})]})})},pc=({typeOfProduct:t,title:e,fileSize:n})=>d.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[d.jsx("span",{style:{color:ke[t]},children:e}),n?d.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:[ae.t("common:file_size")," ",parseFloat(n).toFixed(2)," mb"]}):null]}),hc=({typeOfProduct:t,fileSize:e,urls:n,title:r,handleIosChange:i,handleGoogleChange:s,disabled:o,creditDownload:a,api:l,user:A,isTest:u,setIsTest:c,urlType:f,setUrlType:p,allNetworksSelected:g,setAllNetworksSelected:m})=>d.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between",alignItems:"flex-start",borderBottom:"1px solid #D1D5DB",paddingLeft:"1.25rem",paddingRight:"1.25rem",gap:"0.5rem"},children:[d.jsx(pc,{typeOfProduct:t,title:r,fileSize:e}),d.jsx(fc,{typeOfProduct:t,fileSize:e,urls:n,handleIosChange:i,handleGoogleChange:s,disabled:o,creditDownload:a,api:l,user:A,isTest:u,setIsTest:c,urlType:f,setUrlType:p}),d.jsx(lc,{typeOfProduct:t,allNetworksSelected:g,setAllNetworksSelected:m})]}),ci=({children:t,className:e,onClickDonwload:n,downloading:r,disabled:i})=>d.jsx("button",{onClick:n,className:e,style:{display:"flex",height:"40px",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",border:"1px solid lightgray",padding:"0.25rem",fontSize:"0.875rem",width:200,backgroundColor:"#FFFFFF"},disabled:r||i,children:t}),mc=({checked:t,typeOfProduct:e,id:n})=>{const[r,i]=q.useState(t);q.useEffect(()=>{i(t)},[t]);const s=()=>{i(!r)};return d.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:d.jsxs("label",{onClick:s,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[d.jsx("input",{type:"checkbox",style:{position:"relative",height:"20px",width:"20px",cursor:"pointer",appearance:"none",borderRadius:"0.25rem",transition:"all ease-in-out",border:"1px solid lightgray",opacity:1},id:n,checked:r,onChange:s}),d.jsxs("div",{style:{pointerEvents:"none",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"white",opacity:r?1:0,transition:"opacity ease-in-out"},children:[d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:ke[e],stroke:ke[e],strokeWidth:"1",children:d.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})," "]})]})})},eh="",gc=({typeOfProduct:t})=>d.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:d.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}}),d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}}),d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}}),d.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ke[t]}})]})}),fn=({isNetworksLoading:t=!1})=>d.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:d.jsx("img",{width:t?"100px":"25px",height:t?"100px":"25px",src:Te,alt:"pf-logo-gif"})}),di=({title:t,titleId:e,...n})=>d.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":e,...n,children:[t?d.jsx("title",{id:e,children:t}):null,d.jsx("path",{stroke:"currentColor",d:"m15.985 11.111-3.556 3.556-3.556-3.556M12.429 4v10.667M20.429 16.444A3.556 3.556 0 0 1 16.873 20H7.985a3.556 3.556 0 0 1-3.556-3.556",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),yc=({onClose:t,iosLink:e,googleLink:n,buttonType:r,handleCopyLink:i,download:s,typeOfProduct:o,urlType:a})=>{let l="";return o==="Ready"&&a==="single"?l=ae.t("common:redirection_url_is_empty_are_you_sure_want_to_continue"):!e&&!n?l=ae.t("common:both_links_are_empty_are_you_sure_want_to_continue"):e?n||(l=ae.t("common:google_link_is_empty_are_you_sure_want_to_continue")):l=ae.t("common:ios_link_is_empty_are_you_sure_want_to_continue"),d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",maxWidth:"350px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:l}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:()=>{t(!1)},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #666666",padding:"0.5rem",fontWeight:"bold",transition:"all 0.15s ease-linear"},children:ae.t("common:no")}),d.jsx("button",{onClick:async A=>{r==="download"?await s():r==="copyLink"&&await i(),t()},style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid red",backgroundColor:"darkorange",padding:"0.5rem",fontWeight:"bold",color:"white",transition:"all 0.15s ease-linear"},children:ae.t("common:yes")})]})]})]})},fi=({onClose:t,handleCopyLink:e,download:n,creditConfirmType:r,getDownloadCount:i,width:s="130%",height:o="120%"})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:o,width:s,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:350,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:"You are going to spend 1 credit for this download, do you want to continue?"}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),d.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async a=>{a.preventDefault(),a.stopPropagation(),r==="download"?(await n(),await i()):r==="copy"&&(await e(),await i()),t()},children:"Yes"})]})]})]}),vc=({onClose:t,handleDownload:e,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:i,downloadingMolocoHtml:s})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},onClick:o=>{o.stopPropagation()},children:d.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:d.jsx("img",{width:"25px",height:"25px",src:Te,alt:"pf-logo-gif"})}):d.jsx("button",{onClick:()=>{e(!1)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginRight:"10px"},children:"Download"}),s?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:d.jsx("img",{width:"25px",height:"25px",src:Te,alt:"pf-logo-gif"})}):d.jsx("button",{onClick:()=>{e(!0)},style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px",marginLeft:"10px"},children:"Download HTML"})]}),d.jsx("div",{style:{display:"flex",justifyContent:"center"},children:i?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:d.jsx("img",{width:"25px",height:"25px",src:Te,alt:"pf-logo-gif"})}):d.jsx("button",{onClick:n,style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear",width:"200px"},children:"Download Moloco Test"})})]})})]});async function qc(t,e,n,r){return(await ge.post(t+"/createMolocoTestPage",{_id:e,network:n,typeOfProduct:r})).data}const bc=({onClose:t,handleDownload:e,downloadingPortrait:n,downloadingLandscape:r,downloadingResponsive:i})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"15px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1.5rem",pointerEvents:"auto"},onClick:s=>{s.stopPropagation()},children:d.jsx("div",{style:{display:"flex",gap:"10px",flexDirection:"column"},children:d.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[n?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:d.jsx("img",{width:"20px",height:"20px",src:Te,alt:"loading-gif"})}):d.jsx("button",{onClick:()=>e("portrait"),style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Portrait"}),r?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:d.jsx("img",{width:"20px",height:"20px",src:Te,alt:"loading-gif"})}):d.jsx("button",{onClick:()=>e("landscape"),style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Landscape"}),i?d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px"},children:d.jsx("img",{width:"20px",height:"20px",src:Te,alt:"loading-gif"})}):d.jsx("button",{onClick:()=>e("responsive"),style:{cursor:"pointer",borderRadius:"0.375rem",border:"1px solid #4285f4",backgroundColor:"#4285f4",color:"white",transition:"all 0.15s ease-linear",width:"140px",padding:"10px",fontSize:"14px"},children:"Responsive"})]})})})]}),Cc=({id:t,imageUrl:e,handleCardClick:n,selected:r,name:i,networkVersionSize:s,fileSizeLoading:o,showCheckBox:a,typeOfProduct:l,versionId:A,api:u,handleDownloadError:c,fetchFileUrl:f,urls:p,game:g,setIsConfirmActive:m,creditDownload:v,getDownloadCount:C,disabled:I,user:K,setSafariCopyLink:E,isTest:b,urlType:G,setCdnModal:Z,generateCDN:M,cdnUrl:N})=>{const[j,z]=q.useState(!1),[R,V]=q.useState(""),[O,L]=q.useState(!1),[P,y]=q.useState(!1),[W,U]=q.useState(!1),[x,S]=q.useState("download"),[X,B]=q.useState(!1),[D,H]=q.useState(!1),[F,_]=q.useState(!1),[re,se]=q.useState(!1),[$,me]=q.useState(!1),[Y,Ce]=q.useState(!1),[Ke,Me]=q.useState(!1),[Ue,T]=Ne(Ai),[Q,oe]=Ne(dn),ve=l==="Playable"?Q:!0,qe={cdn:"Generate Link",adikteev:"Copy CDN"},We=()=>{n(t)},ot=async(Ae,be,Oe)=>{if(z(!0),l==="Flex"&&K.flex===!1){c("|ACCESS|"),z(!1);return}const Vt={molocoGenerateHtml:!1,urlType:G,responsiveType:"responsive"};if(ct?be==="copy"?(H(!0),be="download",Vt.molocoGenerateHtml=!0):B(!0):dt&&(Vt.responsiveType=Oe),console.log("getVersion",Ae,be,Vt),Ae==="cdn"){Z(!0),await M(!0),z(!1);return}return Ae==="adikteev"&&(be="copy"),new Promise((zi,Yi)=>{An(A,Ae,ve?p:null,be,b,Vt).then(Mt=>{z(!1),zi(Mt),H(!1),B(!1)}).catch(Mt=>{z(!1),c(Mt.message,Mt),Yi(Mt),H(!1),B(!1)})})},Kt=async(Ae=!1)=>{Ae?H(!0):B(!0);const be={molocoGenerateHtml:!1};Ae&&(be.molocoGenerateHtml=!0),An(A,i,ve?p:null,"download",b,be).then(Oe=>{Ae?H(!1):B(!1),U(!1)}).catch(Oe=>{c(Oe.message,Oe)})},Bt=async()=>{_(!0);const Ae=await qc(u,A,i,l);let be=`${f}/${Ae==null?void 0:Ae.url}`;Nt(be)?(Zt(ae.t("common:link_copied")),_(!1)):E(be)},ct=i==="moloco"||i==="molocoV2",dt=i==="google",fr=Ue.find(Ae=>Ae.name===i);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?ke[l]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+l,onClick:We,children:[d.jsxs("div",{style:{marginTop:i=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[d.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:d.jsx("div",{children:s&&s.map(Ae=>Ae.network).includes(i)?o?d.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center",marginRight:"2rem"},children:d.jsx(gc,{typeOfProduct:l})}):s.map(Ae=>d.jsx("div",{style:{position:"absolute",right:"0",top:"0.5rem",padding:"0.5rem",marginRight:"2rem",fontSize:"1rem",height:"1.5rem",display:"flex",justifyContent:"center",alignItems:"center"},children:Ae.network===i?Ae.size.toString().slice(0,5)+"Mb":""},Ae.network)):null})}),d.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(l==="Playable"||l==="Ready"||l==="Flex")&&a&&d.jsx(mc,{checked:r,typeOfProduct:l,id:t})}),d.jsx("img",{onClick:We,style:{width:"30rem",height:i=="web"?"80px":"50px",objectFit:"contain"},src:e})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[d.jsx(ci,{className:`${ct?"w-1/2":"w-2/3"} border-hover-`+l,downloading:j,onClickDonwload:async Ae=>{if(Ae.stopPropagation(),console.log("user in onclickdownload",K),ct&&K.customer==="playableFactoryInternal"){U(!0);return}else if(dt)se(!0);else{V("download");const be=p.iosUrl,Oe=p.googleUrl;i==="cdn"&&v&&v.willSpendCredit&&!N||i!=="cdn"&&v&&v.willSpendCredit?(m(!0),S("download"),L(!0)):["Playable","Flex"].includes(l)&&(!be||!Oe)||l==="Ready"&&G==="single"&&!be||l==="Ready"&&G==="multi"&&(!be||!Oe)?(m(!0),y(!0)):(y(!1),L(!1),await ot(i,"download"))}},children:ct?d.jsxs(d.Fragment,{children:[!X&&d.jsxs(d.Fragment,{children:[d.jsx(di,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),K.customer!=="playableFactoryInternal"?ae.t("common:txt"):ae.t("common:download")]}),X&&d.jsx(fn,{})]}):d.jsxs(d.Fragment,{children:[!j&&d.jsxs(d.Fragment,{children:[d.jsx(di,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),qe[i]||ae.t("common:download")]}),j&&d.jsx(fn,{})]})}),fr&&fr.downloadType.includes("copy")&&d.jsx(ci,{className:"w-1/3 border-hover-"+l,onClickDonwload:async Ae=>{Ae.stopPropagation(),V("copyLink");const be=p.iosUrl,Oe=p.googleUrl;v&&(v!=null&&v.willSpendCredit)?(S("copy"),m(!0),L(!0)):l!=="Import"&&(!be||!Oe)?(m(!0),y(!0)):(L(!1),y(!1),await ot(i,"copy"))},disabled:I,children:d.jsx(hs,{className:"h-6 w-6 stroke-dark-full"})}),ct&&K.customer!=="playableFactoryInternal"&&d.jsxs(ci,{className:"w-1/2 border-hover-"+l,onClickDonwload:async Ae=>{Ae.stopPropagation(),V("copyLink");const be=p.iosUrl,Oe=p.googleUrl;v&&(v!=null&&v.willSpendCredit)?(S("download"),m(!0),L(!0)):l!=="Import"&&(!be||!Oe)?(m(!0),y(!0)):(L(!1),y(!1),await Kt(!0))},disabled:I,children:[!D&&d.jsxs(d.Fragment,{children:[d.jsx(di,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),ae.t("common:html")]}),D&&d.jsx(fn,{})]})]})]}),O&&d.jsx(fi,{creditConfirmType:x,handleCopyLink:async()=>{y(!1),m(!1),await ot(i,"copy")},download:async()=>{y(!1),m(!1),await ot(i,"download")},onClose:()=>{L(!1),m(!1)},getDownloadCount:C}),P&&d.jsx(yc,{onClose:()=>{y(!1),m(!1)},iosLink:p.iosUrl,googleLink:p.googleUrl,buttonType:R,handleCopyLink:async()=>{y(!1),m(!1),await ot(i,"copy")},download:async()=>{y(!1),m(!1),await ot(i,"download")},typeOfProduct:l,urlType:G}),W&&K.customer==="playableFactoryInternal"&&d.jsx(vc,{onClose:()=>{U(!1)},handleDownload:Kt,handleDownloadMolocoTest:Bt,downloadingMoloco:X,donwloadintMolocoTest:F,downloadingMolocoHtml:D}),re&&d.jsx(bc,{onClose:()=>{se(!1)},handleDownload:async Ae=>{Ae==="portrait"?me(!0):Ae==="landscape"?Ce(!0):Me(!0),await ot(i,"download",Ae),Ae==="portrait"?me(!1):Ae==="landscape"?Ce(!1):Me(!1)},downloadingPortrait:$,downloadingLandscape:Y,downloadingResponsive:Ke})]})},wc=({children:t,typeOfProduct:e,className:n,onClick:r})=>{const i={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:ke[e],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return d.jsx("button",{onClick:r,className:n,style:i,children:t})},xc=({networksVersionTotalSize:t,typeOfProduct:e,onClickMultiDownload:n,multiDownloading:r})=>d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?d.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:ke[e]},children:d.jsx(fn,{})}):d.jsx(wc,{typeOfProduct:e,onClick:n,children:d.jsx("span",{className:"whitespace-nowrap",style:{fontSize:"1rem",padding:"0.5rem",color:"#fff"},children:"Download Selected"})})}),Bo=({title:t,titleId:e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),d.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),Zc=({onClose:t,cdnUrl:e,generateCDN:n,cdnUploading:r})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:i=>{i.stopPropagation()},children:d.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[d.jsxs("p",{style:{fontSize:"1.1rem",fontWeight:500,textAlign:"left",marginBottom:"10px",color:"#00a3ff",textDecoration:"underline",cursor:"pointer",width:"150px",display:"flex",gap:"10px",alignItems:"center",height:"28px"},onClick:()=>{r||n()},children:["Update Link",r&&d.jsx("img",{width:"30px",src:Te,alt:"pf-logo-gif"})]}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[d.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:d.jsx(Bo,{})}),d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:d.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:e,target:"_blank",children:e||"No CDN link generated"})}),d.jsx("button",{onClick:()=>{if(!e)return;Nt(e)&&Zt(ae.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:e?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})]})})]}),Ic=({onClose:t,url:e})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.2)"},onClick:t,children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),d.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",maxWidth:"728px",width:"90%",minHeight:"150px",borderRadius:"10px",backgroundColor:"white",padding:"40px 30px 50px",pointerEvents:"auto"},onClick:n=>{n.stopPropagation()},children:d.jsx("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[d.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:d.jsx(Bo,{})}),d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:d.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:e,target:"_blank",children:e||d.jsx("img",{width:"30px",src:Te,alt:"pf-logo-gif"})})}),d.jsx("button",{onClick:()=>{if(!e)return;Nt(e)&&Zt(ae.t("common:link_copied"))},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:e?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})})})]}),Sc=({playable:t,creditDownload:e,visible:n,versionId:r,typeOfProduct:i,api:s,user:o,handleDownloadError:a,fetchFileUrl:l,urls:A,game:u,getDownloadCount:c,disabled:f,setSafariCopyLink:p,isTest:g,urlType:m,allNetworksSelected:v,cdnModal:C,setCdnModal:I,cdnUrl:K,setCdnUrl:E,customer:b})=>{const[G,Z]=q.useState([]),[M,N]=q.useState([]),[j,z]=q.useState(!1),[R,V]=q.useState(""),[O,L]=q.useState(!1),[P,y]=q.useState(!1),[W,U]=q.useState("download"),[x,S]=q.useState(!1),[X,B]=q.useState(!1),[D,H]=q.useState(!1),[F,_]=Ne(To),[re,se]=Ne(Go),[$]=Ne(Ai),[me,Y]=Ne(dn),Ce=i==="Playable"?me:!0,Ke=async(Q=!1)=>{Q&&K||D||(H(!0),An(r,"cdn",Ce?A:null,null,!1,{}).then(oe=>{E(oe.url),H(!1)}).catch(oe=>{a(oe.message,oe),H(!1)}))},Me=async Q=>{if(Q==="adikteev")return;const oe=[...G];if(G.includes(Q)){const ve=oe.findIndex(qe=>qe===Q);oe.splice(ve,1),Z(oe)}else oe.push(Q),Z([...G,Q]);$.filter(ve=>[...oe].includes(ve.id)).map(ve=>ve.name)},Ue=async()=>new Promise(async(Q,oe)=>{const ve=$.filter(qe=>[...G].includes(qe.id)).map(qe=>qe.name);L(!0),TA(r,A,ve,{urlType:m}).then(qe=>{L(!1),Q(qe)}).catch(qe=>{console.log("get multi download err"),L(!1),a(qe.message,qe),oe(qe)})}),T=async()=>{A.iosUrl,A.googleUrl,e&&e.willSpendCredit?(y(!0),U("download"),S(!0)):(S(!1),await Ue())};return q.useEffect(()=>{const Q=$.filter(oe=>{var ve;return e&&((ve=e==null?void 0:e.networks)==null?void 0:ve.length)>0?typeof oe=="string"?e==null?void 0:e.networks.includes(oe):e==null?void 0:e.networks.includes(oe.name):i==="Import"?t==null?void 0:t.networks.filter(qe=>qe.status==="paid").some(qe=>qe.name===oe.name):t==null?void 0:t.networks.includes(oe.name)}).filter(oe=>oe.name==="voodoo"?o.customer==="customer:20":!0).map(oe=>oe.id);Z(v?Q:[])},[v]),d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{position:"relative",flex:1,overflowY:P?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:d.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&$.filter(Q=>{var oe;return e&&((oe=e==null?void 0:e.networks)==null?void 0:oe.length)>0?typeof Q=="string"?e==null?void 0:e.networks.includes(Q):e==null?void 0:e.networks.includes(Q.name):i==="Import"?t==null?void 0:t.networks.filter(ve=>ve.status==="paid").some(ve=>ve.name===Q.name):b!=null&&b.networks?b.networks.includes(Q.name):Q}).filter(Q=>Q.name==="voodoo"?o.customer==="customer:20":!0).map(Q=>{let oe=Q.imageSrc;if(Q.name==="web"){let ve="web_"+i.toLowerCase()+".png";oe=oe.replace("web.png",ve)}return d.jsx(Cc,{id:Q.id,name:Q.name,imageUrl:oe,selected:G.includes(Q.id),handleCardClick:Me,networkVersionSize:M,fileSizeLoading:j,showCheckBox:Q.id!=="adikteev",typeOfProduct:i,versionId:r,api:s,handleDownloadError:a,fetchFileUrl:l,urls:A,game:u,creditDownload:e,setIsConfirmActive:y,getDownloadCount:c,disabled:f,user:o,setSafariCopyLink:p,isTest:g,urlType:m,setCdnModal:I,generateCDN:Ke,cdnUrl:K},Q.id)})})}),G.length>1&&(i==="Playable"||i==="Ready"||i==="Flex")&&d.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:d.jsx(xc,{onClickMultiDownload:T,networksVersionTotalSize:R,typeOfProduct:i,multiDownloading:O})}),C&&d.jsx(Zc,{onClose:()=>{I(!1),c()},versionId:r,urls:A,handleDownloadError:a,cdnUrl:K,setCdnUrl:E,generateCDN:async()=>{if(!D){if(!e.willSpendCredit){Ke();return}if(o.customer==="playableFactoryInternal"){Ke();return}B(!0)}},cdnUploading:D}),re&&d.jsx(Ic,{onClose:()=>{se(!1)},url:F}),X&&d.jsx(fi,{width:"100%",height:"100%",creditConfirmType:W,handleCopyLink:async()=>{},download:async()=>{S(!1),B(!1),Ke()},onClose:()=>{S(!1),B(!1),H(!1)},getDownloadCount:c}),x&&d.jsx(fi,{creditConfirmType:W,handleCopyLink:async()=>{},download:async()=>{S(!1),y(!1),await Ue()},onClose:()=>{S(!1),y(!1)},getDownloadCount:c})]})};async function Ec(t,e){return(await ge.post(e+"/getFlexDownloadCount",t)).data}async function Oc(t,e){try{return(await ge.post(e+"/findGame",{_id:t})).data}catch{}}async function kc(t,e){return(await ge.post(e+"/getPlayableVersionMarketLink",{_id:t})).data}async function Lc(t,e){return(await ge.post(e+"/getFlexData",{_id:t})).data}async function Kc(t,e){return(await ge.post(e+"/getImportedPlayable",{id:t})).data}async function Mc(t,e){return(await ge.post(e+"/getReadyDownloadCount",t)).data}async function Wc(t,e){try{return(await ge.post(e+"/findCustomer",{_id:t})).data}catch{}}const Vo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","google360","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco","cdn"];let Xo=null;const jc=({playableId:t,versionId:e,gameId:n,typeOfProduct:r,visible:i,api:s,user:o,title:a,handleDownloadError:l,fetchFileUrl:A,fileSize:u,setFileSize:c,setSafariCopyLink:f,iosLink:p,androidLink:g,setIosLink:m,setAndroidLink:v,urlType:C,setUrlType:I})=>{const[K,E]=q.useState(null),[b,G]=q.useState(null),[Z,M]=q.useState(null),[N,j]=q.useState(!1),[z,R]=q.useState(!0),[V,O]=q.useState(window.innerWidth),[L,P]=q.useState(!1),[y,W]=q.useState(!1),[U,x]=q.useState("");Ne(To),Ne(Go);const[S,X]=Ne(Po),[B,D]=Ne(dn);q.useEffect(()=>{!U&&r!=="Fusion"&&HA(e).then(T=>{T!=null&&T.exist&&x(T.uploadPath)})},[U]),console.log("download modal version: 6.0.75");const[H,F]=q.useState(!1);q.useEffect(()=>{},[H]),q.useEffect(()=>{const T=()=>{O(window.innerWidth)};return window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)}},[]);const _=async()=>{j(!0);const T=await ri(t,s);return T!=null&&T.networks||(T.networks=Vo),E(T),T},re=(T,Q)=>{clearTimeout(Xo),Xo=setTimeout(()=>{r==="Playable"&&!B||ni(e,{iosUrl:T,googleUrl:Q},{urlType:C})},1e3)},se=T=>{m(T),re(T,g)},$=T=>{v(T),re(p,T)},me=async(T,Q)=>{var oe,ve;try{let qe;if(r==="Playable"||r==="Ready"){const We=await kc(e,s);if(We){m(We.iosLink),v(We.androidLink),j(!1);return}if(T&&(T.iosUrl||T.googleUrl)){m(T.iosUrl),v(T.googleUrl),j(!1);return}if(Q&&Q.html){const ot=`${A}/${Q.html}?t=${Date.now()}`;let Kt=await fetch(ot).then(dt=>dt.text());const Bt=((oe=Kt.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:oe.at(1))||"";m(Bt);const ct=((ve=Kt.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:ve.at(1))||"";v(ct),j(!1)}else v(""),m(""),j(!1)}else if(r==="Flex"){const We=await Lc(e,s);if(We.googleUrl||We.iosUrl){v(We.googleUrl),m(We.iosUrl),j(!1);return}T&&(T.iosUrl||T.googleUrl)?(m(T.iosUrl),v(T.googleUrl),j(!1)):(v(""),m(""),j(!1))}else r==="Fusion"&&(T&&(T.iosUrl||T.googleUrl)?(m(T.iosUrl),v(T.googleUrl),j(!1)):(v(""),m(""),j(!1)))}catch(qe){l(qe.response.data.error.msg)}},Y=async()=>{j(!0);let T;r==="Flex"?T=await Ec({_id:e},s):r==="Ready"&&(T=await Mc({_id:e},s)),T&&(["admin","pm","tester","sales"].includes(o.role)?M({...T,networks:S}):(console.log("result",T),r==="Ready"&&!T.canDownload?M({...T,networks:Vo}):(console.log("result",T),M({...T,networks:T.networks})))),j(!1)},Ce=async()=>await Oc(n,s),[Ke,Me]=q.useState(null),Ue=async T=>await Wc(T,s);return q.useEffect(()=>{i||(E(null),G(null),M(null),c(null),Me(null)),i&&(r==="Playable"?Ce().then(T=>{Ue(T.customer).then(Q=>{Me(Q)}),_().then(Q=>{me(null,Q)}),R(!1)}):r==="Ready"?Y().then(T=>{_().then(Q=>{me(null,Q),R(!1)})}):r==="Flex"?Y().then(T=>{R(!1),Ce().then(Q=>{i&&(me(Q,null),R(!1),G(Q))})}):r==="Import"?Kc(e,s).then(T=>{E(T),m(T.iosUrl||""),v(T.googleUrl||""),j(!1),R(!1)}):r==="Fusion"&&(R(!1),Ce().then(T=>{i&&(me(T,null),R(!1),T.networks=S.filter(Q=>Q!=="cdn"),G(T))})))},[n,t,e,i]),d.jsxs("div",{style:{display:"flex",height:V>1440?"700px":"650px",width:V>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[d.jsx(hc,{title:a,typeOfProduct:r,fileSize:u,urls:{iosUrl:p,googleUrl:g},handleIosChange:se,handleGoogleChange:$,disabled:z,api:s,creditDownload:Z,user:o,isTest:L,setIsTest:P,urlType:C,setUrlType:I,allNetworksSelected:H,setAllNetworksSelected:F}),N?d.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:d.jsx(fn,{isNetworksLoading:!0})}):(K||Z||r==="Fusion")&&(r==="Flex"?b:!0)&&!N&&p!=="Loading..."&&g!=="Loading..."&&d.jsx(Sc,{playable:K,creditDownload:Z,visible:i,versionId:e,typeOfProduct:r,api:s,user:o,handleDownloadError:l,fetchFileUrl:A,urls:{iosUrl:p,googleUrl:g},game:b,getDownloadCount:Y,disabled:z,setSafariCopyLink:f,isTest:L,urlType:C,allNetworksSelected:H,cdnModal:y,setCdnModal:W,cdnUrl:U,setCdnUrl:x,customer:Ke??void 0})]})},th="";var pi={exports:{}},It={},hi={exports:{}},tt={},mi={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;/*!
|
|
57
57
|
* Adapted from jQuery UI core
|
|
58
58
|
*
|
|
59
59
|
* http://jqueryui.com
|
|
@@ -84,5 +84,5 @@ doc.body (`+t+`):
|
|
|
84
84
|
`+i:"")+`
|
|
85
85
|
|
|
86
86
|
The above lifecycles should be removed. Learn more about this warning here:
|
|
87
|
-
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=na,e.componentWillReceiveProps=ra),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=ia;var a=e.componentDidUpdate;e.componentDidUpdate=function(A,u,c){var f=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:c;a.call(this,A,u,f)}}return t}const Ed=Na(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Sd},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(It,"__esModule",{value:!0}),It.bodyOpenClassName=It.portalClassName=void 0;var sa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Od=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),oa=q,nr=mn(oa),kd=za,rr=mn(kd),Ld=bn,ne=mn(Ld),Kd=Id,aa=mn(Kd),Md=nt,Wd=Rd(Md),vt=rt,la=mn(vt),jd=Ed;function Rd(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function mn(t){return t&&t.__esModule?t:{default:t}}function zd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ua(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Yd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Nd=It.portalClassName="ReactModalPortal",Jd=It.bodyOpenClassName="ReactModal__Body--open",Lt=vt.canUseDOM&&rr.default.createPortal!==void 0,bi=function(e){return document.createElement(e)},Aa=function(){return Lt?rr.default.createPortal:rr.default.unstable_renderSubtreeIntoContainer};function ir(t){return t()}var Gt=function(t){Yd(e,t);function e(){var n,r,i,s;zd(this,e);for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return s=(r=(i=ua(this,(n=e.__proto__||Object.getPrototypeOf(e)).call.apply(n,[this].concat(a))),i),i.removePortal=function(){!Lt&&rr.default.unmountComponentAtNode(i.node);var A=ir(i.props.parentSelector);A&&A.contains(i.node)?A.removeChild(i.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},i.portalRef=function(A){i.portal=A},i.renderPortal=function(A){var u=Aa(),c=u(i,nr.default.createElement(aa.default,sa({defaultStyles:e.defaultStyles},A)),i.node);i.portalRef(c)},r),ua(i,s)}return Od(e,[{key:"componentDidMount",value:function(){if(vt.canUseDOM){Lt||(this.node=bi("div")),this.node.className=this.props.portalClassName;var r=ir(this.props.parentSelector);r.appendChild(this.node),!Lt&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var i=ir(r.parentSelector),s=ir(this.props.parentSelector);return{prevParent:i,nextParent:s}}},{key:"componentDidUpdate",value:function(r,i,s){if(vt.canUseDOM){var o=this.props,a=o.isOpen,l=o.portalClassName;r.portalClassName!==l&&(this.node.className=l);var A=s.prevParent,u=s.nextParent;u!==A&&(A.removeChild(this.node),u.appendChild(this.node)),!(!r.isOpen&&!a)&&!Lt&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!vt.canUseDOM||!this.node||!this.portal)){var r=this.portal.state,i=Date.now(),s=r.isOpen&&this.props.closeTimeoutMS&&(r.closesAt||i+this.props.closeTimeoutMS);s?(r.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,s-i)):this.removePortal()}}},{key:"render",value:function(){if(!vt.canUseDOM||!Lt)return null;!this.node&&Lt&&(this.node=bi("div"));var r=Aa();return r(nr.default.createElement(aa.default,sa({ref:this.portalRef,defaultStyles:e.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){Wd.setElement(r)}}]),e}(oa.Component);Gt.propTypes={isOpen:ne.default.bool.isRequired,style:ne.default.shape({content:ne.default.object,overlay:ne.default.object}),portalClassName:ne.default.string,bodyOpenClassName:ne.default.string,htmlOpenClassName:ne.default.string,className:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),overlayClassName:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),appElement:ne.default.oneOfType([ne.default.instanceOf(la.default),ne.default.instanceOf(vt.SafeHTMLCollection),ne.default.instanceOf(vt.SafeNodeList),ne.default.arrayOf(ne.default.instanceOf(la.default))]),onAfterOpen:ne.default.func,onRequestClose:ne.default.func,closeTimeoutMS:ne.default.number,ariaHideApp:ne.default.bool,shouldFocusAfterRender:ne.default.bool,shouldCloseOnOverlayClick:ne.default.bool,shouldReturnFocusAfterClose:ne.default.bool,preventScroll:ne.default.bool,parentSelector:ne.default.func,aria:ne.default.object,data:ne.default.object,role:ne.default.string,contentLabel:ne.default.string,shouldCloseOnEsc:ne.default.bool,overlayRef:ne.default.func,contentRef:ne.default.func,id:ne.default.string,overlayElement:ne.default.func,contentElement:ne.default.func},Gt.defaultProps={isOpen:!1,portalClassName:Nd,bodyOpenClassName:Jd,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,n){return nr.default.createElement("div",e,n)},contentElement:function(e,n){return nr.default.createElement("div",e,n)}},Gt.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,jd.polyfill)(Gt),process.env.NODE_ENV!=="production"&&(Gt.setCreateHTMLElement=function(t){return bi=t}),It.default=Gt,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=It,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}e.default=r.default,t.exports=e.default}(pi,pi.exports);var Dd=pi.exports;const Ci=Ya(Dd),Td=({width:t,height:e,fill:n})=>d.jsxs("svg",{width:t,height:e,viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.2918 79.3302C42.5513 78.6026 43.0293 77.973 43.6602 77.5273C44.2911 77.0816 45.0443 76.8416 45.8168 76.8402H59.2418C60.0143 76.8416 60.7675 77.0816 61.3984 77.5273C62.0293 77.973 62.5072 78.6026 62.7668 79.3302L67.9193 93.7152H75.0293C76.5211 93.7152 77.9519 94.3078 79.0068 95.3627C80.0617 96.4176 80.6543 97.8484 80.6543 99.3402C80.6543 100.832 80.0617 102.263 79.0068 103.318C77.9519 104.373 76.5211 104.965 75.0293 104.965H30.0293C28.5375 104.965 27.1067 104.373 26.0518 103.318C24.9969 102.263 24.4043 100.832 24.4043 99.3402C24.4043 97.8484 24.9969 96.4176 26.0518 95.3627C27.1067 94.3078 28.5375 93.7152 30.0293 93.7152H37.1393L42.2843 79.3302H42.2918Z",fill:n,opacity:.8}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M69.6975 22.1831H69.375V7.50562C69.375 6.21562 69.225 4.96312 68.955 3.75562H94.08C100.103 3.75562 105 8.64562 105 14.6831V71.5781C105 77.6156 100.11 82.5056 94.0725 82.5056H10.9275C9.49248 82.5056 8.07151 82.223 6.74573 81.6738C5.41994 81.1247 4.2153 80.3197 3.20059 79.305C2.18588 78.2903 1.38096 77.0857 0.831806 75.7599C0.282648 74.4341 0 73.0131 0 71.5781L0 14.6831C0 8.64562 4.89 3.75562 10.9275 3.75562H36.045C35.7657 4.98606 35.6248 6.24387 35.625 7.50562V22.1831H35.3025C23.61 22.1831 17.7525 36.3206 26.025 44.5931L43.2225 61.7906C45.6836 64.25 49.0206 65.6316 52.5 65.6316C55.9794 65.6316 59.3164 64.25 61.7775 61.7906L78.975 44.5931C87.2475 36.3206 81.39 22.1831 69.6975 22.1831Z",fill:n}),d.jsx("path",{d:"M55.1876 55.1551L72.3776 37.9501C72.903 37.4261 73.2611 36.758 73.4066 36.0304C73.552 35.3028 73.4784 34.5484 73.195 33.8626C72.9115 33.1769 72.431 32.5906 71.8142 32.1781C71.1974 31.7656 70.4722 31.5453 69.7301 31.5451H60.0326V7.50012C60.0326 5.511 59.2425 3.60334 57.8359 2.19682C56.4294 0.790299 54.5218 0.00012207 52.5326 0.00012207C50.5435 0.00012207 48.6359 0.790299 47.2293 2.19682C45.8228 3.60334 45.0326 5.511 45.0326 7.50012V31.5526H35.3351C34.5931 31.5528 33.8678 31.7731 33.2511 32.1856C32.6343 32.5981 32.1538 33.1844 31.8703 33.8701C31.5869 34.5559 31.5132 35.3103 31.6587 36.0379C31.8042 36.7655 32.1623 37.4336 32.6876 37.9576L49.8776 55.1551C50.226 55.5044 50.6398 55.7814 51.0954 55.9705C51.551 56.1595 52.0394 56.2568 52.5326 56.2568C53.0259 56.2568 53.5143 56.1595 53.9699 55.9705C54.4255 55.7814 54.8393 55.5044 55.1876 55.1551Z",fill:n,opacity:.8})]}),At=Object.create(null);At.open="0",At.close="1",At.ping="2",At.pong="3",At.message="4",At.upgrade="5",At.noop="6";const sr=Object.create(null);Object.keys(At).forEach(t=>{sr[At[t]]=t});const wi={type:"error",data:"parser error"},ca=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",da=typeof ArrayBuffer=="function",fa=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,xi=({type:t,data:e},n,r)=>ca&&e instanceof Blob?n?r(e):pa(e,r):da&&(e instanceof ArrayBuffer||fa(e))?n?r(e):pa(new Blob([e]),r):r(At[t]+(e||"")),pa=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function ha(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Zi;function Gd(t,e){if(ca&&t.data instanceof Blob)return t.data.arrayBuffer().then(ha).then(e);if(da&&(t.data instanceof ArrayBuffer||fa(t.data)))return e(ha(t.data));xi(t,!1,n=>{Zi||(Zi=new TextEncoder),e(Zi.encode(n))})}const ma="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ma.length;t++)gn[ma.charCodeAt(t)]=t;const Pd=t=>{let e=t.length*.75,n=t.length,r,i=0,s,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const A=new ArrayBuffer(e),u=new Uint8Array(A);for(r=0;r<n;r+=4)s=gn[t.charCodeAt(r)],o=gn[t.charCodeAt(r+1)],a=gn[t.charCodeAt(r+2)],l=gn[t.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return A},Hd=typeof ArrayBuffer=="function",Ii=(t,e)=>{if(typeof t!="string")return{type:"message",data:ga(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Bd(t.substring(1),e)}:sr[n]?t.length>1?{type:sr[n],data:t.substring(1)}:{type:sr[n]}:wi},Bd=(t,e)=>{if(Hd){const n=Pd(t);return ga(n,e)}else return{base64:!0,data:t}},ga=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ya=String.fromCharCode(30),Vd=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{xi(s,!1,a=>{r[o]=a,++i===n&&e(r.join(ya))})})},Xd=(t,e)=>{const n=t.split(ya),r=[];for(let i=0;i<n.length;i++){const s=Ii(n[i],e);if(r.push(s),s.type==="error")break}return r};function Ud(){return new TransformStream({transform(t,e){Gd(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let Si;function or(t){return t.reduce((e,n)=>e+n.length,0)}function ar(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function Qd(t,e){Si||(Si=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(or(n)<1)break;const l=ar(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(or(n)<2)break;const l=ar(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(or(n)<8)break;const l=ar(n,8),A=new DataView(l.buffer,l.byteOffset,l.length),u=A.getUint32(0);if(u>Math.pow(2,53-32)-1){a.enqueue(wi);break}i=u*Math.pow(2,32)+A.getUint32(4),r=3}else{if(or(n)<i)break;const l=ar(n,i);a.enqueue(Ii(s?l:Si.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(wi);break}}}})}const va=4;function Ze(t){if(t)return Fd(t)}function Fd(t){for(var e in Ze.prototype)t[e]=Ze.prototype[e];return t}Ze.prototype.on=Ze.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Ze.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this},Ze.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this},Ze.prototype.emitReserved=Ze.prototype.emit,Ze.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Ze.prototype.hasListeners=function(t){return!!this.listeners(t).length};const lr=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),Xe=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),_d="arraybuffer";function rh(){}function qa(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const $d=Xe.setTimeout,ef=Xe.clearTimeout;function ur(t,e){e.useNativeTimers?(t.setTimeoutFn=$d.bind(Xe),t.clearTimeoutFn=ef.bind(Xe)):(t.setTimeoutFn=Xe.setTimeout.bind(Xe),t.clearTimeoutFn=Xe.clearTimeout.bind(Xe))}const tf=1.33;function nf(t){return typeof t=="string"?rf(t):Math.ceil((t.byteLength||t.size)*tf)}function rf(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function ba(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function sf(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function of(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class af extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ei extends Ze{constructor(e){super(),this.writable=!1,ur(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new af(e,n,r)),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 n=Ii(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_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 n=sf(e);return n.length?"?"+n:""}}class lf extends Ei{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Xd(e,this.socket.binaryType).forEach(n),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,Vd(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ba()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Ca=!1;try{Ca=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const uf=Ca;function Af(){}class cf extends lf{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Pt=class pr extends Ze{constructor(e,n,r){super(),this.createRequest=e,ur(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=qa(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=pr.requestsCount++,pr.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=Af,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pr.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(Pt.requestsCount=0,Pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",wa);else if(typeof addEventListener=="function"){const t="onpagehide"in Xe?"pagehide":"unload";addEventListener(t,wa,!1)}}function wa(){for(let t in Pt.requests)Pt.requests.hasOwnProperty(t)&&Pt.requests[t].abort()}const df=function(){const t=xa({xdomain:!1});return t&&t.responseType!==null}();class ff extends cf{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=df&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Pt(xa,this.uri(),e)}}function xa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||uf))return new XMLHttpRequest}catch{}if(!e)try{return new Xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Za=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pf extends Ei{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=Za?{}:qa(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}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 n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;xi(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&lr(()=>{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",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ba()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Oi=Xe.WebSocket||Xe.MozWebSocket;class hf extends pf{createSocket(e,n,r){return Za?new Oi(e,n,r):n?new Oi(e,n):new Oi(e)}doWrite(e,n){this.ws.send(n)}}class mf extends Ei{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 n=Qd(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Ud();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&lr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const gf={websocket:hf,webtransport:mf,polling:ff},yf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ki(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=yf.exec(t||""),s={},o=14;for(;o--;)s[vf[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=qf(s,s.path),s.queryKey=bf(s,s.query),s}function qf(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function bf(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Li=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ar=[];Li&&addEventListener("offline",()=>{Ar.forEach(t=>t())},!1);class qt extends Ze{constructor(e,n){if(super(),this.binaryType=_d,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=ki(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ki(n.host).host);ur(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=of(this.opts.query)),Li&&(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"})},Ar.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=va,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&qt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}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",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",qt.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 n=new Error("server error");n.code=e.data,this._onError(n);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 n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=nf(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,lr(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(qt.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,n){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(),Li&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ar.indexOf(this._offlineEventListener);r!==-1&&Ar.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}qt.protocol=va;class Cf extends qt{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 n=this.createTransport(e),r=!1;qt.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;qt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function A(c){n&&c.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",A)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",A),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let wf=class extends Cf{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>gf[i]).filter(i=>!!i)),super(e,r)}};function xf(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=ki(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Zf=typeof ArrayBuffer=="function",If=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Ia=Object.prototype.toString,Sf=typeof Blob=="function"||typeof Blob<"u"&&Ia.call(Blob)==="[object BlobConstructor]",Ef=typeof File=="function"||typeof File<"u"&&Ia.call(File)==="[object FileConstructor]";function Ki(t){return Zf&&(t instanceof ArrayBuffer||If(t))||Sf&&t instanceof Blob||Ef&&t instanceof File}function cr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(cr(t[n]))return!0;return!1}if(Ki(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return cr(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&cr(t[n]))return!0;return!1}function Of(t){const e=[],n=t.data,r=t;return r.data=Mi(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Mi(t,e){if(!t)return t;if(Ki(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Mi(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Mi(t[r],e));return n}return t}function kf(t,e){return t.data=Wi(t.data,e),delete t.attachments,t}function Wi(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Wi(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Wi(t[n],e));return t}const Lf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Kf=5;var ue;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(ue||(ue={}));class Mf{constructor(e){this.replacer=e}encode(e){return(e.type===ue.EVENT||e.type===ue.ACK)&&cr(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=Of(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Sa(t){return Object.prototype.toString.call(t)==="[object Object]"}class ji extends Ze{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===ue.BINARY_EVENT;r||n.type===ue.BINARY_ACK?(n.type=r?ue.EVENT:ue.ACK,this.reconstructor=new Wf(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ki(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(s,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(s,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}r.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(ji.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case ue.CONNECT:return Sa(n);case ue.DISCONNECT:return n===void 0;case ue.CONNECT_ERROR:return typeof n=="string"||Sa(n);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Lf.indexOf(n[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Wf{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=kf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jf=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ji,Encoder:Mf,get PacketType(){return ue},protocol:Kf},Symbol.toStringTag,{value:"Module"}));function st(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Rf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ea extends Ze{constructor(e,n,r){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=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[st(e,"open",this.onopen.bind(this)),st(e,"packet",this.onpacket.bind(this)),st(e,"error",this.onerror.bind(this)),st(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,...n){var r,i,s;if(Rf.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:ue.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,c=n.pop();this._registerAckCallback(u,c),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.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:ue.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,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ue.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 ue.EVENT:case ue.BINARY_EVENT:this.onevent(e);break;case ue.ACK:case ue.BINARY_ACK:this.onack(e);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.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 n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:ue.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,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:ue.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 n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,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 n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Ht(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Ht.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},Ht.prototype.reset=function(){this.attempts=0},Ht.prototype.setMin=function(t){this.ms=t},Ht.prototype.setMax=function(t){this.max=t},Ht.prototype.setJitter=function(t){this.jitter=t};class Ri extends Ze{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ur(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ht({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||jf;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.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 n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.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 wf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=st(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=st(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(st(e,"ping",this.onping.bind(this)),st(e,"data",this.ondata.bind(this)),st(e,"error",this.onerror.bind(this)),st(e,"close",this.onclose.bind(this)),st(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){lr(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ea(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],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,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),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 n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const yn={};function dr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=xf(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=yn[i]&&s in yn[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Ri(r,e):(yn[i]||(yn[i]=new Ri(r,e)),l=yn[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(dr,{Manager:Ri,Socket:Ea,io:dr,connect:dr});async function zf(t,e,n){return(await ge.post(n,{versionId:t,fileSize:e})).data}async function Yf(t,e){return(await ge.post(e+"/getFileSize",t)).data}const Oa=5,Nf=({setIsExceedingFileSizeAccepted:t,closeModal:e,setLoading:n,typeOfProduct:r,versionId:i,fileSize:s,setFileSize:o,user:a,compressApi:l,producerApi:A,api:u})=>{const[c,f]=q.useState(!1),[p,g]=q.useState(!1);q.useEffect(()=>{const C=dr(l,{path:"/socket.io"});return C.on("connect",()=>{console.log("Connected to the socket server")}),C.on("video-compressing",async I=>{if(console.log(I),I.userId===a._id&&I.isSuccess){console.log("Video compress successfull");const K=await Yf({_id:i},u);o(K.size),t(!1)}}),C.on("error",I=>{console.error("Socket error:",I)}),()=>{C.disconnect()}},[i]);const m=()=>{e(),t(!1),n(!0)},v=async()=>{try{f(!0);const C=await zf(i,s,`${A}/videos/compressByDiff`);console.log("Compression result:",C),n(!1)}catch(C){console.error("Error compressing video:",C),n(!1),e()}};return d.jsxs(Ci,{isOpen:!0,ariaHideApp:!1,onRequestClose:m,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:"400px",width:"650px",overflow:"hidden",padding:"0px 0px 0px 0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{className:"fixed h-[40px] w-full flex justify-end",children:d.jsx("div",{className:"pointer-events-auto absolute flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white hover:bg-dark-10",onClick:m,children:d.jsx("img",{src:Hi,alt:"close image"})})}),d.jsx("div",{className:"mt-5 h-[150px] w-full ",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx(Td,{width:100,height:100,fill:ke[r]})})}),d.jsx("div",{className:"mb-5 h-[50px] w-full",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx("span",{className:"text-3xl font-bold text-flex-purple",children:"Playable Size Too Big"})})}),d.jsx("div",{className:"mb-3 h-[50px] w-full",children:d.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[!p&&!c&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"You can compress it to reduce the size automatically,",d.jsx("br",{}),"or go back and edit your content manually"]}),!p&&c&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"Compressing to reduce size..."]}),p&&!c&&d.jsx("span",{className:"text-center align-middle text-lg text-black",children:"Your playable is now under 5 MB and ready to export"})]})}),d.jsxs("div",{className:"my-5 flex h-[53px] w-full flex-row justify-center ",children:[d.jsx("div",{className:"pointer-events-auto mr-3 flex h-full w-[180px] items-center justify-center rounded-md border border-red-600 transition-all hover:scale-105 cursor-pointer",onClick:m,children:d.jsx("span",{className:"text-center align-middle text-xl font-bold text-red-600",children:"Cancel"})}),d.jsx("div",{className:" pointer-events-auto ml-3 flex h-full w-[180px] items-center justify-center rounded-md transition-all hover:scale-105 cursor-pointer",style:{backgroundColor:ke[r]},onClick:()=>{r==="Flex"&&!p?v():t(!1)},children:d.jsxs("span",{className:"text-center align-middle text-xl font-bold text-white",children:[r==="Flex"&&c&&!p&&"Compressing...",r==="Flex"&&!c&&!p&&s-Oa<2&&"Compress",r==="Flex"&&!c&&!p&&s-Oa>=2&&"Continue",r!=="Flex"&&!c&&p&&"Export",r!=="Flex"&&"Continue"]})})]})]})},Jf=({onClose:t,url:e})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:500,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px",minHeight:"48px"},children:d.jsx("a",{style:{fontSize:"12px",display:"block",fontWeight:"normal",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"},href:e,children:e})}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"Close"}),d.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async n=>{n.preventDefault(),n.stopPropagation(),t()},children:"Copy"})]})]})]});async function Df(t,e){return(await ge.post(t+"/getNetworks",{typeOfProduct:e})).data}const Tf=({visible:t,closeModal:e,versionId:n,gameId:r,versionName:i,playableId:s,typeOfProduct:o,api:a,user:l,title:A,iframeUrl:u,handleDownloadError:c,fetchFileUrl:f,copyLinkUrl:p,fusionData:g})=>{const[m,v]=q.useState(window.innerWidth),[C,I]=q.useState(!1),[K,E]=q.useState(u),[b,G]=q.useState(!1),[Z,M]=q.useState(!0),[N,j]=q.useState(null),[z,R]=q.useState(""),[V,O]=q.useState("Loading..."),[L,P]=q.useState("Loading..."),[y,W]=q.useState("game"),[U,x]=Ne(Ai),[S,X]=Ne(Po);GA(o,a,R,f,g);const B=async()=>{let D=await Df(a,o);if(!D){JA("Networks not found");return}D=D.map(H=>(H.name=H.id,H)),x(D),X(D.map(H=>H.id).filter(H=>H!=="default")),PA(D),An(n,"preview",null,null,!1).then(H=>{I(!0),E(f+"/"+H.url),(o==="Flex"||o==="Ready"||o==="Playable"||o==="Fusion")&&(H.size>=5?G(!0):G(!1),j(H.size)),M(!1)})};return q.useEffect(()=>{t?C||(B(),I(!0)):(I(!1),E(""))},[t]),q.useEffect(()=>{const D=()=>{v(window.innerWidth)};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[]),Z&&t?d.jsx(d.Fragment,{children:d.jsx(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:d.jsx("div",{style:{display:"flex",height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",alignItems:"center",justifyContent:"center"},children:d.jsx("img",{style:{width:"100px",height:"100px"},src:Te,alt:"pf-logo-gif"})})})}):Z&&o==="Flex"?null:d.jsxs("div",{onMouseDown:D=>{D.stopPropagation()},onMouseUp:D=>{D.stopPropagation()},children:[b&&t&&d.jsx(Nf,{setIsExceedingFileSizeAccepted:G,closeModal:e,setLoading:M,typeOfProduct:o,versionId:n,fileSize:N,setFileSize:j,user:l,compressApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app",producerApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app",api:a}),!b&&d.jsxs(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{style:{position:"absolute",top:"1.25rem",right:"1.25rem",zIndex:50},children:d.jsx("button",{onClick:()=>{e(),o==="Flex"&&M(!0)},style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:d.jsx("img",{src:Hi,alt:"close image"})})}),d.jsxs(Ta,{children:[C?d.jsx(ac,{versionName:i,versionId:n,playableId:s||"",typeOfProduct:o,iframeUrl:K,api:a,fetchFileUrl:f,copyLinkUrl:p,setSafariCopyLink:R,iosLink:V,androidLink:L,urlType:y}):d.jsx(d.Fragment,{children:d.jsx("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"5px",height:m>1440?"650px":"625px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:d.jsx("img",{width:"75px",height:"75px",src:Te,alt:"pf-logo-gif"})})}),d.jsx(jc,{visible:t,versionId:n,playableId:s,gameId:r,typeOfProduct:o,api:a,user:l,title:A,handleDownloadError:c,fetchFileUrl:f,fileSize:N,setFileSize:j,setSafariCopyLink:R,iosLink:V,androidLink:L,setIosLink:O,setAndroidLink:P,urlType:y,setUrlType:W})]}),d.jsx($r,{}),z&&d.jsx(Jf,{onClose:()=>{Nt(z),R("")},url:z}),d.jsx("div",{style:{position:"absolute",bottom:"0",left:"30px",fontSize:"12px",lineHeight:"12px",zIndex:50},children:"Version: 6.0.37"})]})]})};pt.DownloadModal=Tf,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})});
|
|
87
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=na,e.componentWillReceiveProps=ra),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=ia;var a=e.componentDidUpdate;e.componentDidUpdate=function(A,u,c){var f=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:c;a.call(this,A,u,f)}}return t}const Ed=Na(Object.freeze(Object.defineProperty({__proto__:null,polyfill:Sd},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(It,"__esModule",{value:!0}),It.bodyOpenClassName=It.portalClassName=void 0;var sa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Od=function(){function t(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),oa=q,nr=mn(oa),kd=za,rr=mn(kd),Ld=bn,ne=mn(Ld),Kd=Id,aa=mn(Kd),Md=nt,Wd=Rd(Md),vt=rt,la=mn(vt),jd=Ed;function Rd(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function mn(t){return t&&t.__esModule?t:{default:t}}function zd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ua(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Yd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Nd=It.portalClassName="ReactModalPortal",Jd=It.bodyOpenClassName="ReactModal__Body--open",Lt=vt.canUseDOM&&rr.default.createPortal!==void 0,bi=function(e){return document.createElement(e)},Aa=function(){return Lt?rr.default.createPortal:rr.default.unstable_renderSubtreeIntoContainer};function ir(t){return t()}var Gt=function(t){Yd(e,t);function e(){var n,r,i,s;zd(this,e);for(var o=arguments.length,a=Array(o),l=0;l<o;l++)a[l]=arguments[l];return s=(r=(i=ua(this,(n=e.__proto__||Object.getPrototypeOf(e)).call.apply(n,[this].concat(a))),i),i.removePortal=function(){!Lt&&rr.default.unmountComponentAtNode(i.node);var A=ir(i.props.parentSelector);A&&A.contains(i.node)?A.removeChild(i.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},i.portalRef=function(A){i.portal=A},i.renderPortal=function(A){var u=Aa(),c=u(i,nr.default.createElement(aa.default,sa({defaultStyles:e.defaultStyles},A)),i.node);i.portalRef(c)},r),ua(i,s)}return Od(e,[{key:"componentDidMount",value:function(){if(vt.canUseDOM){Lt||(this.node=bi("div")),this.node.className=this.props.portalClassName;var r=ir(this.props.parentSelector);r.appendChild(this.node),!Lt&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var i=ir(r.parentSelector),s=ir(this.props.parentSelector);return{prevParent:i,nextParent:s}}},{key:"componentDidUpdate",value:function(r,i,s){if(vt.canUseDOM){var o=this.props,a=o.isOpen,l=o.portalClassName;r.portalClassName!==l&&(this.node.className=l);var A=s.prevParent,u=s.nextParent;u!==A&&(A.removeChild(this.node),u.appendChild(this.node)),!(!r.isOpen&&!a)&&!Lt&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!vt.canUseDOM||!this.node||!this.portal)){var r=this.portal.state,i=Date.now(),s=r.isOpen&&this.props.closeTimeoutMS&&(r.closesAt||i+this.props.closeTimeoutMS);s?(r.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,s-i)):this.removePortal()}}},{key:"render",value:function(){if(!vt.canUseDOM||!Lt)return null;!this.node&&Lt&&(this.node=bi("div"));var r=Aa();return r(nr.default.createElement(aa.default,sa({ref:this.portalRef,defaultStyles:e.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){Wd.setElement(r)}}]),e}(oa.Component);Gt.propTypes={isOpen:ne.default.bool.isRequired,style:ne.default.shape({content:ne.default.object,overlay:ne.default.object}),portalClassName:ne.default.string,bodyOpenClassName:ne.default.string,htmlOpenClassName:ne.default.string,className:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),overlayClassName:ne.default.oneOfType([ne.default.string,ne.default.shape({base:ne.default.string.isRequired,afterOpen:ne.default.string.isRequired,beforeClose:ne.default.string.isRequired})]),appElement:ne.default.oneOfType([ne.default.instanceOf(la.default),ne.default.instanceOf(vt.SafeHTMLCollection),ne.default.instanceOf(vt.SafeNodeList),ne.default.arrayOf(ne.default.instanceOf(la.default))]),onAfterOpen:ne.default.func,onRequestClose:ne.default.func,closeTimeoutMS:ne.default.number,ariaHideApp:ne.default.bool,shouldFocusAfterRender:ne.default.bool,shouldCloseOnOverlayClick:ne.default.bool,shouldReturnFocusAfterClose:ne.default.bool,preventScroll:ne.default.bool,parentSelector:ne.default.func,aria:ne.default.object,data:ne.default.object,role:ne.default.string,contentLabel:ne.default.string,shouldCloseOnEsc:ne.default.bool,overlayRef:ne.default.func,contentRef:ne.default.func,id:ne.default.string,overlayElement:ne.default.func,contentElement:ne.default.func},Gt.defaultProps={isOpen:!1,portalClassName:Nd,bodyOpenClassName:Jd,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(e,n){return nr.default.createElement("div",e,n)},contentElement:function(e,n){return nr.default.createElement("div",e,n)}},Gt.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,jd.polyfill)(Gt),process.env.NODE_ENV!=="production"&&(Gt.setCreateHTMLElement=function(t){return bi=t}),It.default=Gt,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=It,r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}e.default=r.default,t.exports=e.default}(pi,pi.exports);var Dd=pi.exports;const Ci=Ya(Dd),Td=({width:t,height:e,fill:n})=>d.jsxs("svg",{width:t,height:e,viewBox:"0 0 105 105",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M42.2918 79.3302C42.5513 78.6026 43.0293 77.973 43.6602 77.5273C44.2911 77.0816 45.0443 76.8416 45.8168 76.8402H59.2418C60.0143 76.8416 60.7675 77.0816 61.3984 77.5273C62.0293 77.973 62.5072 78.6026 62.7668 79.3302L67.9193 93.7152H75.0293C76.5211 93.7152 77.9519 94.3078 79.0068 95.3627C80.0617 96.4176 80.6543 97.8484 80.6543 99.3402C80.6543 100.832 80.0617 102.263 79.0068 103.318C77.9519 104.373 76.5211 104.965 75.0293 104.965H30.0293C28.5375 104.965 27.1067 104.373 26.0518 103.318C24.9969 102.263 24.4043 100.832 24.4043 99.3402C24.4043 97.8484 24.9969 96.4176 26.0518 95.3627C27.1067 94.3078 28.5375 93.7152 30.0293 93.7152H37.1393L42.2843 79.3302H42.2918Z",fill:n,opacity:.8}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M69.6975 22.1831H69.375V7.50562C69.375 6.21562 69.225 4.96312 68.955 3.75562H94.08C100.103 3.75562 105 8.64562 105 14.6831V71.5781C105 77.6156 100.11 82.5056 94.0725 82.5056H10.9275C9.49248 82.5056 8.07151 82.223 6.74573 81.6738C5.41994 81.1247 4.2153 80.3197 3.20059 79.305C2.18588 78.2903 1.38096 77.0857 0.831806 75.7599C0.282648 74.4341 0 73.0131 0 71.5781L0 14.6831C0 8.64562 4.89 3.75562 10.9275 3.75562H36.045C35.7657 4.98606 35.6248 6.24387 35.625 7.50562V22.1831H35.3025C23.61 22.1831 17.7525 36.3206 26.025 44.5931L43.2225 61.7906C45.6836 64.25 49.0206 65.6316 52.5 65.6316C55.9794 65.6316 59.3164 64.25 61.7775 61.7906L78.975 44.5931C87.2475 36.3206 81.39 22.1831 69.6975 22.1831Z",fill:n}),d.jsx("path",{d:"M55.1876 55.1551L72.3776 37.9501C72.903 37.4261 73.2611 36.758 73.4066 36.0304C73.552 35.3028 73.4784 34.5484 73.195 33.8626C72.9115 33.1769 72.431 32.5906 71.8142 32.1781C71.1974 31.7656 70.4722 31.5453 69.7301 31.5451H60.0326V7.50012C60.0326 5.511 59.2425 3.60334 57.8359 2.19682C56.4294 0.790299 54.5218 0.00012207 52.5326 0.00012207C50.5435 0.00012207 48.6359 0.790299 47.2293 2.19682C45.8228 3.60334 45.0326 5.511 45.0326 7.50012V31.5526H35.3351C34.5931 31.5528 33.8678 31.7731 33.2511 32.1856C32.6343 32.5981 32.1538 33.1844 31.8703 33.8701C31.5869 34.5559 31.5132 35.3103 31.6587 36.0379C31.8042 36.7655 32.1623 37.4336 32.6876 37.9576L49.8776 55.1551C50.226 55.5044 50.6398 55.7814 51.0954 55.9705C51.551 56.1595 52.0394 56.2568 52.5326 56.2568C53.0259 56.2568 53.5143 56.1595 53.9699 55.9705C54.4255 55.7814 54.8393 55.5044 55.1876 55.1551Z",fill:n,opacity:.8})]}),At=Object.create(null);At.open="0",At.close="1",At.ping="2",At.pong="3",At.message="4",At.upgrade="5",At.noop="6";const sr=Object.create(null);Object.keys(At).forEach(t=>{sr[At[t]]=t});const wi={type:"error",data:"parser error"},ca=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",da=typeof ArrayBuffer=="function",fa=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,xi=({type:t,data:e},n,r)=>ca&&e instanceof Blob?n?r(e):pa(e,r):da&&(e instanceof ArrayBuffer||fa(e))?n?r(e):pa(new Blob([e]),r):r(At[t]+(e||"")),pa=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function ha(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Zi;function Gd(t,e){if(ca&&t.data instanceof Blob)return t.data.arrayBuffer().then(ha).then(e);if(da&&(t.data instanceof ArrayBuffer||fa(t.data)))return e(ha(t.data));xi(t,!1,n=>{Zi||(Zi=new TextEncoder),e(Zi.encode(n))})}const ma="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ma.length;t++)gn[ma.charCodeAt(t)]=t;const Pd=t=>{let e=t.length*.75,n=t.length,r,i=0,s,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const A=new ArrayBuffer(e),u=new Uint8Array(A);for(r=0;r<n;r+=4)s=gn[t.charCodeAt(r)],o=gn[t.charCodeAt(r+1)],a=gn[t.charCodeAt(r+2)],l=gn[t.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return A},Hd=typeof ArrayBuffer=="function",Ii=(t,e)=>{if(typeof t!="string")return{type:"message",data:ga(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Bd(t.substring(1),e)}:sr[n]?t.length>1?{type:sr[n],data:t.substring(1)}:{type:sr[n]}:wi},Bd=(t,e)=>{if(Hd){const n=Pd(t);return ga(n,e)}else return{base64:!0,data:t}},ga=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ya=String.fromCharCode(30),Vd=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((s,o)=>{xi(s,!1,a=>{r[o]=a,++i===n&&e(r.join(ya))})})},Xd=(t,e)=>{const n=t.split(ya),r=[];for(let i=0;i<n.length;i++){const s=Ii(n[i],e);if(r.push(s),s.type==="error")break}return r};function Ud(){return new TransformStream({transform(t,e){Gd(t,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(n)})}})}let Si;function or(t){return t.reduce((e,n)=>e+n.length,0)}function ar(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function Qd(t,e){Si||(Si=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(or(n)<1)break;const l=ar(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(or(n)<2)break;const l=ar(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(or(n)<8)break;const l=ar(n,8),A=new DataView(l.buffer,l.byteOffset,l.length),u=A.getUint32(0);if(u>Math.pow(2,53-32)-1){a.enqueue(wi);break}i=u*Math.pow(2,32)+A.getUint32(4),r=3}else{if(or(n)<i)break;const l=ar(n,i);a.enqueue(Ii(s?l:Si.decode(l),e)),r=0}if(i===0||i>t){a.enqueue(wi);break}}}})}const va=4;function Ze(t){if(t)return Fd(t)}function Fd(t){for(var e in Ze.prototype)t[e]=Ze.prototype[e];return t}Ze.prototype.on=Ze.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Ze.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},Ze.prototype.off=Ze.prototype.removeListener=Ze.prototype.removeAllListeners=Ze.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this},Ze.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this},Ze.prototype.emitReserved=Ze.prototype.emit,Ze.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Ze.prototype.hasListeners=function(t){return!!this.listeners(t).length};const lr=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),Xe=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),_d="arraybuffer";function rh(){}function qa(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const $d=Xe.setTimeout,ef=Xe.clearTimeout;function ur(t,e){e.useNativeTimers?(t.setTimeoutFn=$d.bind(Xe),t.clearTimeoutFn=ef.bind(Xe)):(t.setTimeoutFn=Xe.setTimeout.bind(Xe),t.clearTimeoutFn=Xe.clearTimeout.bind(Xe))}const tf=1.33;function nf(t){return typeof t=="string"?rf(t):Math.ceil((t.byteLength||t.size)*tf)}function rf(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function ba(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function sf(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function of(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}class af extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ei extends Ze{constructor(e){super(),this.writable=!1,ur(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new af(e,n,r)),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 n=Ii(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_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 n=sf(e);return n.length?"?"+n:""}}class lf extends Ei{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Xd(e,this.socket.binaryType).forEach(n),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,Vd(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=ba()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let Ca=!1;try{Ca=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const uf=Ca;function Af(){}class cf extends lf{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Pt=class pr extends Ze{constructor(e,n,r){super(),this.createRequest=e,ur(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=qa(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=pr.requestsCount++,pr.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=Af,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete pr.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(Pt.requestsCount=0,Pt.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",wa);else if(typeof addEventListener=="function"){const t="onpagehide"in Xe?"pagehide":"unload";addEventListener(t,wa,!1)}}function wa(){for(let t in Pt.requests)Pt.requests.hasOwnProperty(t)&&Pt.requests[t].abort()}const df=function(){const t=xa({xdomain:!1});return t&&t.responseType!==null}();class ff extends cf{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=df&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Pt(xa,this.uri(),e)}}function xa(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||uf))return new XMLHttpRequest}catch{}if(!e)try{return new Xe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Za=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class pf extends Ei{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=Za?{}:qa(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(i){return this.emitReserved("error",i)}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 n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;xi(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&lr(()=>{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",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=ba()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Oi=Xe.WebSocket||Xe.MozWebSocket;class hf extends pf{createSocket(e,n,r){return Za?new Oi(e,n,r):n?new Oi(e,n):new Oi(e)}doWrite(e,n){this.ws.send(n)}}class mf extends Ei{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 n=Qd(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),i=Ud();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;this._writer.write(r).then(()=>{i&&lr(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const gf={websocket:hf,webtransport:mf,polling:ff},yf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ki(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=yf.exec(t||""),s={},o=14;for(;o--;)s[vf[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=qf(s,s.path),s.queryKey=bf(s,s.query),s}function qf(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function bf(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Li=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ar=[];Li&&addEventListener("offline",()=>{Ar.forEach(t=>t())},!1);class qt extends Ze{constructor(e,n){if(super(),this.binaryType=_d,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=ki(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=ki(n.host).host);ur(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=of(this.opts.query)),Li&&(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"})},Ar.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=va,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&qt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}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",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",qt.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 n=new Error("server error");n.code=e.data,this._onError(n);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 n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=nf(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,lr(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:e,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(qt.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,n){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(),Li&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ar.indexOf(this._offlineEventListener);r!==-1&&Ar.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}qt.protocol=va;class Cf extends qt{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 n=this.createTransport(e),r=!1;qt.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;qt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function A(c){n&&c.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",A)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",A),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let wf=class extends Cf{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>gf[i]).filter(i=>!!i)),super(e,r)}};function xf(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=ki(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+e,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const Zf=typeof ArrayBuffer=="function",If=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Ia=Object.prototype.toString,Sf=typeof Blob=="function"||typeof Blob<"u"&&Ia.call(Blob)==="[object BlobConstructor]",Ef=typeof File=="function"||typeof File<"u"&&Ia.call(File)==="[object FileConstructor]";function Ki(t){return Zf&&(t instanceof ArrayBuffer||If(t))||Sf&&t instanceof Blob||Ef&&t instanceof File}function cr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(cr(t[n]))return!0;return!1}if(Ki(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return cr(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&cr(t[n]))return!0;return!1}function Of(t){const e=[],n=t.data,r=t;return r.data=Mi(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Mi(t,e){if(!t)return t;if(Ki(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Mi(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Mi(t[r],e));return n}return t}function kf(t,e){return t.data=Wi(t.data,e),delete t.attachments,t}function Wi(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Wi(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Wi(t[n],e));return t}const Lf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Kf=5;var ue;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(ue||(ue={}));class Mf{constructor(e){this.replacer=e}encode(e){return(e.type===ue.EVENT||e.type===ue.ACK)&&cr(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=Of(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Sa(t){return Object.prototype.toString.call(t)==="[object Object]"}class ji extends Ze{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===ue.BINARY_EVENT;r||n.type===ue.BINARY_ACK?(n.type=r?ue.EVENT:ue.ACK,this.reconstructor=new Wf(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ki(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.BINARY_ACK){const s=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const o=e.substring(s,n);if(o!=Number(o)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(s,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=e.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===e.length)break}r.id=Number(e.substring(s,n+1))}if(e.charAt(++n)){const s=this.tryParse(e.substr(n));if(ji.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case ue.CONNECT:return Sa(n);case ue.DISCONNECT:return n===void 0;case ue.CONNECT_ERROR:return typeof n=="string"||Sa(n);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&Lf.indexOf(n[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Wf{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=kf(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const jf=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ji,Encoder:Mf,get PacketType(){return ue},protocol:Kf},Symbol.toStringTag,{value:"Module"}));function st(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const Rf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ea extends Ze{constructor(e,n,r){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=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[st(e,"open",this.onopen.bind(this)),st(e,"packet",this.onpacket.bind(this)),st(e,"error",this.onerror.bind(this)),st(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,...n){var r,i,s;if(Rf.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:ue.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,c=n.pop();this._registerAckCallback(u,c),o.id=u}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.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:ue.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,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ue.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 ue.EVENT:case ue.BINARY_EVENT:this.onevent(e);break;case ue.ACK:case ue.BINARY_ACK:this.onack(e);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.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 n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:ue.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,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:ue.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 n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,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 n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Ht(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Ht.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0},Ht.prototype.reset=function(){this.attempts=0},Ht.prototype.setMin=function(t){this.ms=t},Ht.prototype.setMax=function(t){this.max=t},Ht.prototype.setJitter=function(t){this.jitter=t};class Ri extends Ze{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ur(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ht({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||jf;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.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 n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.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 wf(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=st(n,"open",function(){r.onopen(),e&&e()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=st(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(st(e,"ping",this.onping.bind(this)),st(e,"data",this.ondata.bind(this)),st(e,"error",this.onerror.bind(this)),st(e,"close",this.onclose.bind(this)),st(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){lr(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ea(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],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,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),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 n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const yn={};function dr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=xf(t,e.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=yn[i]&&s in yn[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Ri(r,e):(yn[i]||(yn[i]=new Ri(r,e)),l=yn[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(dr,{Manager:Ri,Socket:Ea,io:dr,connect:dr});async function zf(t,e,n){return(await ge.post(n,{versionId:t,fileSize:e})).data}async function Yf(t,e){return(await ge.post(e+"/getFileSize",t)).data}const Oa=5,Nf=({setIsExceedingFileSizeAccepted:t,closeModal:e,setLoading:n,typeOfProduct:r,versionId:i,fileSize:s,setFileSize:o,user:a,compressApi:l,producerApi:A,api:u})=>{const[c,f]=q.useState(!1),[p,g]=q.useState(!1);q.useEffect(()=>{const C=dr(l,{path:"/socket.io"});return C.on("connect",()=>{console.log("Connected to the socket server")}),C.on("video-compressing",async I=>{if(console.log(I),I.userId===a._id&&I.isSuccess){console.log("Video compress successfull");const K=await Yf({_id:i},u);o(K.size),t(!1)}}),C.on("error",I=>{console.error("Socket error:",I)}),()=>{C.disconnect()}},[i]);const m=()=>{e(),t(!1),n(!0)},v=async()=>{try{f(!0);const C=await zf(i,s,`${A}/videos/compressByDiff`);console.log("Compression result:",C),n(!1)}catch(C){console.error("Error compressing video:",C),n(!1),e()}};return d.jsxs(Ci,{isOpen:!0,ariaHideApp:!1,onRequestClose:m,style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:"400px",width:"650px",overflow:"hidden",padding:"0px 0px 0px 0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{className:"fixed h-[40px] w-full flex justify-end",children:d.jsx("div",{className:"pointer-events-auto absolute flex h-10 w-10 cursor-pointer items-center justify-center rounded-sm bg-white hover:bg-dark-10",onClick:m,children:d.jsx("img",{src:Hi,alt:"close image"})})}),d.jsx("div",{className:"mt-5 h-[150px] w-full ",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx(Td,{width:100,height:100,fill:ke[r]})})}),d.jsx("div",{className:"mb-5 h-[50px] w-full",children:d.jsx("div",{className:"flex h-full w-full items-center justify-center",children:d.jsx("span",{className:"text-3xl font-bold text-flex-purple",children:"Playable Size Too Big"})})}),d.jsx("div",{className:"mb-3 h-[50px] w-full",children:d.jsxs("div",{className:"flex h-full w-full items-center justify-center",children:[!p&&!c&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"You can compress it to reduce the size automatically,",d.jsx("br",{}),"or go back and edit your content manually"]}),!p&&c&&d.jsxs("span",{className:"text-center align-middle text-lg text-black",children:["Your playable exceeds the 5MB limit.",d.jsx("br",{}),"Compressing to reduce size..."]}),p&&!c&&d.jsx("span",{className:"text-center align-middle text-lg text-black",children:"Your playable is now under 5 MB and ready to export"})]})}),d.jsxs("div",{className:"my-5 flex h-[53px] w-full flex-row justify-center ",children:[d.jsx("div",{className:"pointer-events-auto mr-3 flex h-full w-[180px] items-center justify-center rounded-md border border-red-600 transition-all hover:scale-105 cursor-pointer",onClick:m,children:d.jsx("span",{className:"text-center align-middle text-xl font-bold text-red-600",children:"Cancel"})}),d.jsx("div",{className:" pointer-events-auto ml-3 flex h-full w-[180px] items-center justify-center rounded-md transition-all hover:scale-105 cursor-pointer",style:{backgroundColor:ke[r]},onClick:()=>{r==="Flex"&&!p?v():t(!1)},children:d.jsxs("span",{className:"text-center align-middle text-xl font-bold text-white",children:[r==="Flex"&&c&&!p&&"Compressing...",r==="Flex"&&!c&&!p&&s-Oa<2&&"Compress",r==="Flex"&&!c&&!p&&s-Oa>=2&&"Continue",r!=="Flex"&&!c&&p&&"Export",r!=="Flex"&&"Continue"]})})]})]})},Jf=({onClose:t,url:e})=>d.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[d.jsx("div",{onClick:t,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),d.jsxs("div",{style:{position:"absolute",zIndex:50,display:"flex",height:"max-content",width:500,flexDirection:"column",gap:"5px",borderRadius:"8px",backgroundColor:"white",padding:"20px"},children:[d.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px",minHeight:"48px"},children:d.jsx("a",{style:{fontSize:"12px",display:"block",fontWeight:"normal",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"},href:e,children:e})}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"Close"}),d.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async n=>{n.preventDefault(),n.stopPropagation(),t()},children:"Copy"})]})]})]});async function Df(t,e,n,r){return(await ge.post(t+"/getNetworks",{typeOfProduct:e,versionId:n,customerId:r})).data}const Tf=({visible:t,closeModal:e,versionId:n,gameId:r,versionName:i,playableId:s,typeOfProduct:o,api:a,user:l,title:A,iframeUrl:u,handleDownloadError:c,fetchFileUrl:f,copyLinkUrl:p,fusionData:g})=>{const[m,v]=q.useState(window.innerWidth),[C,I]=q.useState(!1),[K,E]=q.useState(u),[b,G]=q.useState(!1),[Z,M]=q.useState(!0),[N,j]=q.useState(null),[z,R]=q.useState(""),[V,O]=q.useState("Loading..."),[L,P]=q.useState("Loading..."),[y,W]=q.useState("game"),[U,x]=Ne(Ai),[S,X]=Ne(Po);GA(o,a,R,f,g);const B=async()=>{let D=await Df(a,o,n,l.customer);if(!D){JA("Networks not found");return}D=D.map(H=>(H.name=H.id,H)),x(D),X(D.map(H=>H.id).filter(H=>H!=="default")),PA(D),An(n,"preview",null,null,!1).then(H=>{I(!0),E(f+"/"+H.url),(o==="Flex"||o==="Ready"||o==="Playable"||o==="Fusion")&&(H.size>=5?G(!0):G(!1),j(H.size)),M(!1)})};return q.useEffect(()=>{t?C||(B(),I(!0)):(I(!1),E(""))},[t]),q.useEffect(()=>{const D=()=>{v(window.innerWidth)};return window.addEventListener("resize",D),()=>{window.removeEventListener("resize",D)}},[]),Z&&t?d.jsx(d.Fragment,{children:d.jsx(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:d.jsx("div",{style:{display:"flex",height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",alignItems:"center",justifyContent:"center"},children:d.jsx("img",{style:{width:"100px",height:"100px"},src:Te,alt:"pf-logo-gif"})})})}):Z&&o==="Flex"?null:d.jsxs("div",{onMouseDown:D=>{D.stopPropagation()},onMouseUp:D=>{D.stopPropagation()},children:[b&&t&&d.jsx(Nf,{setIsExceedingFileSizeAccepted:G,closeModal:e,setLoading:M,typeOfProduct:o,versionId:n,fileSize:N,setFileSize:j,user:l,compressApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app",producerApi:a.includes(".com")?"https://compress.playablefactory.com":"https://compress.playablefactory.app",api:a}),!b&&d.jsxs(Ci,{isOpen:t,ariaHideApp:!1,onRequestClose:()=>{e(),o==="Flex"&&M(!0)},style:{content:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",borderRadius:"0.75rem",backgroundColor:"white",zIndex:50,height:m>1440?"700px":"650px",width:m>1440?"965px":"975px",overflow:"hidden",paddingTop:"0px"},overlay:{position:"fixed",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:50,top:0,left:0,right:0,bottom:0}},contentLabel:"Playable Editing Download Modal",shouldCloseOnOverlayClick:!0,children:[d.jsx("div",{style:{position:"absolute",top:"1.25rem",right:"1.25rem",zIndex:50},children:d.jsx("button",{onClick:()=>{e(),o==="Flex"&&M(!0)},style:{color:"#718096",cursor:"pointer",backgroundColor:"#F7F7F8"},children:d.jsx("img",{src:Hi,alt:"close image"})})}),d.jsxs(Ta,{children:[C?d.jsx(ac,{versionName:i,versionId:n,playableId:s||"",typeOfProduct:o,iframeUrl:K,api:a,fetchFileUrl:f,copyLinkUrl:p,setSafariCopyLink:R,iosLink:V,androidLink:L,urlType:y}):d.jsx(d.Fragment,{children:d.jsx("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"5px",height:m>1440?"650px":"625px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:d.jsx("img",{width:"75px",height:"75px",src:Te,alt:"pf-logo-gif"})})}),d.jsx(jc,{visible:t,versionId:n,playableId:s,gameId:r,typeOfProduct:o,api:a,user:l,title:A,handleDownloadError:c,fetchFileUrl:f,fileSize:N,setFileSize:j,setSafariCopyLink:R,iosLink:V,androidLink:L,setIosLink:O,setAndroidLink:P,urlType:y,setUrlType:W})]}),d.jsx($r,{}),z&&d.jsx(Jf,{onClose:()=>{Nt(z),R("")},url:z}),d.jsx("div",{style:{position:"absolute",bottom:"0",left:"30px",fontSize:"12px",lineHeight:"12px",zIndex:50},children:"Version: 6.0.37"})]})]})};pt.DownloadModal=Tf,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})});
|
|
88
88
|
//# sourceMappingURL=index.umd.js.map
|