gearboxdownloadmodal 8.0.11 → 8.0.12
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 +2 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +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 C.isArray(e)?e.forEach(s):s(e),this}}Yn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),C.reduceDescriptors(Yn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),C.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 C.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"}C.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=C.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)];C.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),C.isString(r)&&o.push("path="+r),C.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 C.isPlainObject(A)&&C.isPlainObject(u)?C.merge.call({caseless:c},A,u):C.isPlainObject(u)?C.merge({},u):C.isArray(u)?u.slice():u}function i(A,u,c){if(C.isUndefined(u)){if(!C.isUndefined(A))return r(void 0,A,c)}else return r(A,u,c)}function s(A,u){if(!C.isUndefined(u))return r(void 0,u)}function o(A,u){if(C.isUndefined(u)){if(!C.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 C.forEach(Object.keys(Object.assign({},t,e)),function(u){const c=l[u]||i,f=c(t[u],e[u],u);C.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(C.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&&C.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(b){n(b),A()},function(b){r(b),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&&C.forEach(o.toJSON(),function(g,m){u.setRequestHeader(m,g)}),C.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 C.isReadableStream(new Response("").body)}catch{}})(),Dn={stream:Jr&&(t=>t.body)};Jn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Dn[e]&&(Dn[e]=C.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(C.isBlob(t))return t.size;if(C.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(C.isArrayBufferView(t))return t.byteLength;if(C.isURLSearchParams(t)&&(t=t+""),C.isString(t))return(await Nr(t)).byteLength},AA=async(t,e)=>{const n=C.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 b=()=>{!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;C.isFormData(r)&&(Z=G.headers.get("content-type"))&&u.setContentType(Z),G.body&&(r=no(G.body,so,ro(I,Nn(l)),null,Nr))}C.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=C.toFiniteNumber(K.headers.get("content-length"));K=new Response(no(K.body,so,a&&ro(Z,Nn(a,!0)),E&&b,Nr),G)}A=A||"text";let w=await Dn[C.findKey(Dn,A)||"text"](K,t);return!E&&b(),g&&g(),await new Promise((G,Z)=>{_s(G,Z,{data:w,headers:et.from(K.headers),status:K.status,statusText:K.statusText,config:t,request:v})})}catch(K){throw b(),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)}})};C.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=>C.isFunction(t)||t===null||t===!1,ao={getAdapter:t=>{t=C.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&&(C.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&&C.merge(s.common,s[n.method]);s&&C.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)}}C.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}))}}),C.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 C.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 C.extend(n,Gn.prototype,e,{allOwnKeys:!0}),C.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(C.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,b=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(...b))};v.classList.add(...b),v.addEventListener("animationend",I),v.addEventListener("animationcancel",I)},[]),q.useEffect(()=>{const v=c.current,b=()=>{v.removeEventListener("animationend",b),i?KA(v,u,s):u()};f||(A?b():(m.current=1,v.className+=` ${g}`,v.addEventListener("animationend",b)))},[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,...b}=g;if(!Fr(p)||function(R){return!i.current||a.props.enableMultiContainer&&R.containerId!==a.props.containerId||s.has(R.toastId)&&R.updateId==null}(b))return;const{toastId:I,updateId:K,data:E}=b,{props:w}=a,G=()=>A(I),Z=K==null;Z&&a.count++;const M={...w,style:w.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(b).filter(R=>{let[V,O]=R;return O!=null})),toastId:I,updateId:K,data:E,closeToast:G,isIn:!1,className:Pn(b.className||w.toastClassName),bodyClassName:Pn(b.bodyClassName||w.bodyClassName),progressClassName:Pn(b.progressClassName||w.progressClassName),autoClose:!b.isLoading&&(N=b.autoClose,j=w.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(b.onOpen)&&(M.onOpen=b.onOpen),Re(b.onClose)&&(M.onClose=b.onClose),M.closeButton=w.closeButton,b.closeButton===!1||Fr(b.closeButton)?M.closeButton=b.closeButton:b.closeButton===!0&&(M.closeButton=!Fr(w.closeButton)||w.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})),w.limit&&w.limit>0&&a.count>w.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 b={content:p,props:g};s.set(v,b),r(I=>[...I,v].filter(K=>K!==m)),Ve.emit(4,Co(b,b.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:b}=v.props;g.has(b)||g.set(b,[]),g.get(b).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",b),document.addEventListener("mouseup",I),document.addEventListener("touchmove",b),document.addEventListener("touchend",I);const w=s.current;o.canCloseOnClick=!0,o.canDrag=!0,o.boundingRect=w.getBoundingClientRect(),w.style.transition="",o.x=wo(E.nativeEvent),o.y=xo(E.nativeEvent),t.draggableDirection==="x"?(o.start=o.x,o.removalDistance=w.offsetWidth*(t.draggablePercent/100)):(o.start=o.y,o.removalDistance=w.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function g(E){if(o.boundingRect){const{top:w,bottom:G,left:Z,right:M}=o.boundingRect;E.nativeEvent.type!=="touchend"&&t.pauseOnHover&&o.x>=Z&&o.x<=M&&o.y>=w&&o.y<=G?v():m()}}function m(){n(!0)}function v(){n(!1)}function b(E){const w=s.current;o.canDrag&&w&&(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),w.style.transform=`translate${t.draggableDirection}(${o.delta}px)`,w.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function I(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",b),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:b,progressClassName:I,progressStyle:K,updateId:E,role:w,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:w},className:Re(v)?v({type:A}):yt("Toastify__toast-body",v),style:b},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 b(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)}}}),b=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 b(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 b(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}),w=[t,e,n,r,i,s,o,a,l,A,u,f,p,g,m,v,b,I,K,E],G={get:Z=>Fn(m(Z)),set:(Z,...M)=>{try{return b(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:w}),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,w,G,Z;let b="";if(e&&(n==="Playable"||n==="Ready")){const M=await ri(e,r),N=(w=(E=M==null?void 0:M.data)==null?void 0:E.globalProps)==null?void 0:w.defaultLandscape,j=(Z=(G=M==null?void 0:M.data)==null?void 0:G.globalProps)==null?void 0:Z.defaultPhoneIndex;N&&(b+="&landscape=true"),j!==void 0&&(b+=`&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+=b,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:b,disabled:I,user:K,setSafariCopyLink:E,isTest:w,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&&K.customer!=="playableFactoryInternal"){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,w,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",w,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:b}),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:b,setCdnModal:I,cdnUrl:K,setCdnUrl:E,customer:w})=>{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):oe}).filter(oe=>oe.name==="voodoo"?o.customer==="customer:20":!0).map(oe=>oe.id);console.log("networks",Q),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):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})}),b&&d.jsx(Zc,{onClose:()=>{I(!1),c()},versionId:r,urls:A,handleDownloadError:a,cdnUrl:K,setCdnUrl:E,generateCDN:async()=>{if(!D){if(!(e!=null&&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:b,setUrlType:I})=>{const[K,E]=q.useState(null),[w,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: 8.0.9");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:b})},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:b,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"?w:!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:w,getDownloadCount:Y,disabled:z,setSafariCopyLink:f,isTest:L,urlType:b,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&&(C.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&&C.merge(s.common,s[n.method]);s&&C.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)}}C.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}))}}),C.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 C.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 C.extend(n,Gn.prototype,e,{allOwnKeys:!0}),C.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(C.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,b=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(...b))};v.classList.add(...b),v.addEventListener("animationend",I),v.addEventListener("animationcancel",I)},[]),q.useEffect(()=>{const v=c.current,b=()=>{v.removeEventListener("animationend",b),i?KA(v,u,s):u()};f||(A?b():(m.current=1,v.className+=` ${g}`,v.addEventListener("animationend",b)))},[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,...b}=g;if(!Fr(p)||function(R){return!i.current||a.props.enableMultiContainer&&R.containerId!==a.props.containerId||s.has(R.toastId)&&R.updateId==null}(b))return;const{toastId:I,updateId:K,data:E}=b,{props:w}=a,G=()=>A(I),Z=K==null;Z&&a.count++;const M={...w,style:w.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(b).filter(R=>{let[V,O]=R;return O!=null})),toastId:I,updateId:K,data:E,closeToast:G,isIn:!1,className:Pn(b.className||w.toastClassName),bodyClassName:Pn(b.bodyClassName||w.bodyClassName),progressClassName:Pn(b.progressClassName||w.progressClassName),autoClose:!b.isLoading&&(N=b.autoClose,j=w.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(b.onOpen)&&(M.onOpen=b.onOpen),Re(b.onClose)&&(M.onClose=b.onClose),M.closeButton=w.closeButton,b.closeButton===!1||Fr(b.closeButton)?M.closeButton=b.closeButton:b.closeButton===!0&&(M.closeButton=!Fr(w.closeButton)||w.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})),w.limit&&w.limit>0&&a.count>w.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 b={content:p,props:g};s.set(v,b),r(I=>[...I,v].filter(K=>K!==m)),Ve.emit(4,Co(b,b.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:b}=v.props;g.has(b)||g.set(b,[]),g.get(b).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",b),document.addEventListener("mouseup",I),document.addEventListener("touchmove",b),document.addEventListener("touchend",I);const w=s.current;o.canCloseOnClick=!0,o.canDrag=!0,o.boundingRect=w.getBoundingClientRect(),w.style.transition="",o.x=wo(E.nativeEvent),o.y=xo(E.nativeEvent),t.draggableDirection==="x"?(o.start=o.x,o.removalDistance=w.offsetWidth*(t.draggablePercent/100)):(o.start=o.y,o.removalDistance=w.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function g(E){if(o.boundingRect){const{top:w,bottom:G,left:Z,right:M}=o.boundingRect;E.nativeEvent.type!=="touchend"&&t.pauseOnHover&&o.x>=Z&&o.x<=M&&o.y>=w&&o.y<=G?v():m()}}function m(){n(!0)}function v(){n(!1)}function b(E){const w=s.current;o.canDrag&&w&&(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),w.style.transform=`translate${t.draggableDirection}(${o.delta}px)`,w.style.opacity=""+(1-Math.abs(o.delta/o.removalDistance)))}function I(){document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",b),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:b,progressClassName:I,progressStyle:K,updateId:E,role:w,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:w},className:Re(v)?v({type:A}):yt("Toastify__toast-body",v),style:b},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 b(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)}}}),b=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 b(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 b(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}),w=[t,e,n,r,i,s,o,a,l,A,u,f,p,g,m,v,b,I,K,E],G={get:Z=>Fn(m(Z)),set:(Z,...M)=>{try{return b(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:w}),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,w,G,Z;let b="";if(e&&(n==="Playable"||n==="Ready")){const M=await ri(e,r),N=(w=(E=M==null?void 0:M.data)==null?void 0:E.globalProps)==null?void 0:w.defaultLandscape,j=(Z=(G=M==null?void 0:M.data)==null?void 0:G.globalProps)==null?void 0:Z.defaultPhoneIndex;N&&(b+="&landscape=true"),j!==void 0&&(b+=`&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+=b,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:b,disabled:I,user:K,setSafariCopyLink:E,isTest:w,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&&K.customer!=="playableFactoryInternal"){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,w,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",w,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:b}),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:b,setCdnModal:I,cdnUrl:K,setCdnUrl:E,customer:w})=>{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):oe}).filter(oe=>oe.name==="voodoo"?o.customer==="customer:20":!0).map(oe=>oe.id);console.log("networks",Q),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):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})}),b&&d.jsx(Zc,{onClose:()=>{I(!1),c()},versionId:r,urls:A,handleDownloadError:a,cdnUrl:K,setCdnUrl:E,generateCDN:async()=>{if(!D){if(!(e!=null&&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:b,setUrlType:I})=>{const[K,E]=q.useState(null),[w,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: 8.0.9");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:b})},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?[^\s'"]+)['|"]/))==null?void 0:oe.at(1))||"";m(Bt);const ct=((ve=Kt.match(/var\s+androidLink\s*=\s*['|"](https?[^\s'"]+)['|"]/))==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:b,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"?w:!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:w,getDownloadCount:Y,disabled:z,setSafariCopyLink:f,isTest:L,urlType:b,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
|