gearboxdownloadmodal 6.0.41 → 6.0.43

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.umd.js CHANGED
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(q),null," "));var K=J(G,Z,Y,T,D+"."+Z,
47
47
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Pa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ao=Symbol("internals");function wt(e){return e&&String(e).trim().toLowerCase()}function Ut(e){return e===!1||e==null?e:I.isArray(e)?e.map(Ut):String(e)}function Ba(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Ua=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ln(e,t,n,r,o){if(I.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!I.isString(t)){if(I.isString(r))return t.indexOf(r)!==-1;if(I.isRegExp(r))return r.test(t)}}function Fa(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _a(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,a){return this[r].call(this,t,o,i,a)},configurable:!0})})}class Ft{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(A,m,c){const l=wt(m);if(!l)throw new Error("header name must be a non-empty string");const d=I.findKey(o,l);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||m]=Ut(A))}const a=(A,m)=>I.forEach(A,(c,l)=>i(c,l,m));return I.isPlainObject(t)||t instanceof this.constructor?a(t,n):I.isString(t)&&(t=t.trim())&&!Ua(t)?a(Va(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=wt(t),t){const r=I.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Ba(o);if(I.isFunction(n))return n.call(this,o,r);if(I.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wt(t),t){const r=I.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ln(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(a){if(a=wt(a),a){const A=I.findKey(r,a);A&&(!n||Ln(r,r[A],A,n))&&(delete r[A],o=!0)}}return I.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||Ln(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return I.forEach(this,(o,i)=>{const a=I.findKey(r,i);if(a){n[a]=Ut(o),delete n[i];return}const A=t?Fa(i):String(i).trim();A!==i&&delete n[i],n[A]=Ut(o),r[A]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return I.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&I.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
48
48
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[ao]=this[ao]={accessors:{}}).accessors,o=this.prototype;function i(a){const A=wt(a);r[A]||(_a(o,a),r[A]=!0)}return I.isArray(t)?t.forEach(i):i(t),this}}Ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(Ft.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),I.freezeMethods(Ft);const Qe=Ft;function En(e,t){const n=this||Mn,r=t||n,o=Qe.from(r.headers);let i=r.data;return I.forEach(e,function(A){i=A.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Ao(e){return!!(e&&e.__CANCEL__)}function Kt(e,t,n){re.call(this,e??"canceled",re.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Kt,re,{__CANCEL__:!0});function $a(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new re("Request failed with status code "+n.status,[re.ERR_BAD_REQUEST,re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const eA=Te.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,a,A){const m=[];m.push(n+"="+encodeURIComponent(r)),I.isNumber(o)&&m.push("expires="+new Date(o).toGMTString()),I.isString(i)&&m.push("path="+i),I.isString(a)&&m.push("domain="+a),A===!0&&m.push("secure"),document.cookie=m.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function tA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nA(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function so(e,t){return e&&!tA(t)?nA(e,t):t}const rA=Te.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{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=o(window.location.href),function(a){const A=I.isString(a)?o(a):a;return A.protocol===r.protocol&&A.host===r.host}}():function(){return function(){return!0}}();function oA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function iA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(m){const c=Date.now(),l=r[i];a||(a=c),n[o]=m,r[o]=c;let d=i,y=0;for(;d!==o;)y+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const g=l&&c-l;return g?Math.round(y*1e3/g):void 0}}function lo(e,t){let n=0;const r=iA(50,250);return o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,A=i-n,m=r(A),c=i<=a;n=i;const l={loaded:i,total:a,progress:a?i/a:void 0,bytes:A,rate:m||void 0,estimated:m&&a&&c?(a-i)/m:void 0,event:o};l[t?"download":"upload"]=!0,e(l)}}const On={http:Oa,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let o=e.data;const i=Qe.from(e.headers).normalize(),a=e.responseType;let A;function m(){e.cancelToken&&e.cancelToken.unsubscribe(A),e.signal&&e.signal.removeEventListener("abort",A)}let c;I.isFormData(o)&&(Te.isStandardBrowserEnv||Te.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?I.isString(c=i.getContentType())&&i.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(e.auth){const h=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(h+":"+f))}const d=so(e.baseURL,e.url);l.open(e.method.toUpperCase(),no(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout;function y(){if(!l)return;const h=Qe.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),v={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:h,config:e,request:l};$a(function(k){n(k),m()},function(k){r(k),m()},v),l=null}if("onloadend"in l?l.onloadend=y:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(y)},l.onabort=function(){l&&(r(new re("Request aborted",re.ECONNABORTED,e,l)),l=null)},l.onerror=function(){r(new re("Network Error",re.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||oo;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),r(new re(f,v.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,e,l)),l=null},Te.isStandardBrowserEnv){const h=rA(d)&&e.xsrfCookieName&&eA.read(e.xsrfCookieName);h&&i.set(e.xsrfHeaderName,h)}o===void 0&&i.setContentType(null),"setRequestHeader"in l&&I.forEach(i.toJSON(),function(f,v){l.setRequestHeader(v,f)}),I.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&a!=="json"&&(l.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&l.addEventListener("progress",lo(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",lo(e.onUploadProgress)),(e.cancelToken||e.signal)&&(A=h=>{l&&(r(!h||h.type?new Kt(null,e,l):h),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(A),e.signal&&(e.signal.aborted?A():e.signal.addEventListener("abort",A)));const g=oA(d);if(g&&Te.protocols.indexOf(g)===-1){r(new re("Unsupported protocol "+g+":",re.ERR_BAD_REQUEST,e));return}l.send(o||null)})}};I.forEach(On,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const uo=e=>`- ${e}`,aA=e=>I.isFunction(e)||e===null||e===!1,co={getAdapter:e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!aA(n)&&(r=On[(a=String(n)).toLowerCase()],r===void 0))throw new re(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([A,m])=>`adapter ${A} `+(m===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
49
49
  `+i.map(uo).join(`
50
- `):" "+uo(i[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:On};function kn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Kt(null,e)}function mo(e){return kn(e),e.headers=Qe.from(e.headers),e.data=En.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),co.getAdapter(e.adapter||Mn.adapter)(e).then(function(r){return kn(e),r.data=En.call(e,e.transformResponse,r),r.headers=Qe.from(r.headers),r},function(r){return Ao(r)||(kn(e),r&&r.response&&(r.response.data=En.call(e,e.transformResponse,r.response),r.response.headers=Qe.from(r.response.headers))),Promise.reject(r)})}const po=e=>e instanceof Qe?e.toJSON():e;function ut(e,t){t=t||{};const n={};function r(c,l,d){return I.isPlainObject(c)&&I.isPlainObject(l)?I.merge.call({caseless:d},c,l):I.isPlainObject(l)?I.merge({},l):I.isArray(l)?l.slice():l}function o(c,l,d){if(I.isUndefined(l)){if(!I.isUndefined(c))return r(void 0,c,d)}else return r(c,l,d)}function i(c,l){if(!I.isUndefined(l))return r(void 0,l)}function a(c,l){if(I.isUndefined(l)){if(!I.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function A(c,l,d){if(d in t)return r(c,l);if(d in e)return r(void 0,c)}const m={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:A,headers:(c,l)=>o(po(c),po(l),!0)};return I.forEach(Object.keys(Object.assign({},e,t)),function(l){const d=m[l]||o,y=d(e[l],t[l],l);I.isUndefined(y)&&d!==A||(n[l]=y)}),n}const fo="1.6.0",jn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ho={};jn.transitional=function(t,n,r){function o(i,a){return"[Axios v"+fo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new re(o(a," has been removed"+(n?" in "+n:"")),re.ERR_DEPRECATED);return n&&!ho[a]&&(ho[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,A):!0}};function AA(e,t,n){if(typeof e!="object")throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const A=e[i],m=A===void 0||a(A,i,e);if(m!==!0)throw new re("option "+i+" must be "+m,re.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new re("Unknown option "+i,re.ERR_BAD_OPTION)}}const zn={assertOptions:AA,validators:jn},Fe=zn.validators;class _t{constructor(t){this.defaults=t,this.interceptors={request:new ro,response:new ro}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ut(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&zn.assertOptions(r,{silentJSONParsing:Fe.transitional(Fe.boolean),forcedJSONParsing:Fe.transitional(Fe.boolean),clarifyTimeoutError:Fe.transitional(Fe.boolean)},!1),o!=null&&(I.isFunction(o)?n.paramsSerializer={serialize:o}:zn.assertOptions(o,{encode:Fe.function,serialize:Fe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&I.merge(i.common,i[n.method]);i&&I.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=Qe.concat(a,i);const A=[];let m=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(m=m&&f.synchronous,A.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let l,d=0,y;if(!m){const h=[mo.bind(this),void 0];for(h.unshift.apply(h,A),h.push.apply(h,c),y=h.length,l=Promise.resolve(n);d<y;)l=l.then(h[d++],h[d++]);return l}y=A.length;let g=n;for(d=0;d<y;){const h=A[d++],f=A[d++];try{g=h(g)}catch(v){f.call(this,v);break}}try{l=mo.call(this,g)}catch(h){return Promise.reject(h)}for(d=0,y=c.length;d<y;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=ut(this.defaults,t);const n=so(t.baseURL,t.url);return no(n,t.params,t.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(t){_t.prototype[t]=function(n,r){return this.request(ut(r||{},{method:t,url:n,data:(r||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(ut(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}_t.prototype[t]=n(),_t.prototype[t+"Form"]=n(!0)});const $t=_t;class Yn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(A=>{r.subscribe(A),i=A}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,A){r.reason||(r.reason=new Kt(i,a,A),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Yn(function(o){t=o}),cancel:t}}}const sA=Yn;function lA(e){return function(n){return e.apply(null,n)}}function uA(e){return I.isObject(e)&&e.isAxiosError===!0}const Jn={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(Jn).forEach(([e,t])=>{Jn[t]=e});const cA=Jn;function go(e){const t=new $t(e),n=Rr($t.prototype.request,t);return I.extend(n,$t.prototype,t,{allOwnKeys:!0}),I.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return go(ut(e,o))},n}const he=go(Mn);he.Axios=$t,he.CanceledError=Kt,he.CancelToken=sA,he.isCancel=Ao,he.VERSION=fo,he.toFormData=Bt,he.AxiosError=re,he.Cancel=he.CanceledError,he.all=function(t){return Promise.all(t)},he.spread=lA,he.isAxiosError=uA,he.mergeConfig=ut,he.AxiosHeaders=Qe,he.formToJSON=e=>io(I.isHTMLForm(e)?new FormData(e):e),he.getAdapter=co.getAdapter,he.HttpStatusCode=cA,he.default=he;const mA=he;/*! typescript-cookie v1.0.6 | MIT */const qo=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),yo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Nn=decodeURIComponent,Rn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function dA(e){return e=Object.assign({},e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires!=null&&(e.expires=e.expires.toUTCString()),Object.entries(e).filter(([t,n])=>n!=null&&n!==!1).map(([t,n])=>n===!0?`; ${t}`:`; ${t}=${n.split(";")[0]}`).join("")}function vo(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,o={};let i;for(;(i=r.exec(document.cookie))!=null;)try{const a=n(i[1]);if(o[a]=t(i[2],a),e===a)break}catch{}return e!=null?o[e]:o}const bo=Object.freeze({decodeName:Nn,decodeValue:Rn,encodeName:qo,encodeValue:yo}),Dn=Object.freeze({path:"/"});function Co(e,t,n=Dn,{encodeValue:r=yo,encodeName:o=qo}={}){return document.cookie=`${o(e)}=${r(t,e)}${dA(n)}`}function Zo(e,{decodeValue:t=Rn,decodeName:n=Nn}={}){return vo(e,t,n)}function pA({decodeValue:e=Rn,decodeName:t=Nn}={}){return vo(void 0,e,t)}function fA(e,t=Dn){Co(e,"",Object.assign({},t,{expires:-1}))}function Gn(e,t){const n={set:function(o,i,a){return Co(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return pA(this.converter.read);if(o!=null)return Zo(o,this.converter.read)},remove:function(o,i){fA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Gn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Gn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Gn({read:bo.decodeValue,write:bo.encodeValue},Dn);let Io;typeof window<"u"&&(Io=Zo("token"));const ge=mA.create({headers:{Authorization:Io}});async function hA(e,t,n){return(await ge.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function gA(e,t){return e.network=="fb"&&(e.zip=1),(await ge.post(t+"/createFlexVersionLink",e||{})).data}async function qA(e,t,n){return(await ge.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function yA(e,t,n,r,o){return(await ge.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function vA(e,t,n){return(await ge.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function bA(e,t,n,r,o){return(await ge.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function CA(e,t,n){return(await ge.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function ZA(e,t,n,r,o,i){return(await ge.post(e+"/createFusionVersionLink",{_id:t,network:n,fusionData:r,isPfTest:o,extras:i})).data}async function IA(e,t){return(await ge.post(t+"/getCdnExportName",e||{})).data}async function xA(e,t){return(await ge.post(t+"/updateFlexUrl",e||{})).data}async function xo(e,t,n){return(await ge.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Wt(e){const t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select();try{return document.execCommand("copy")?(document.body.removeChild(t),!0):(document.body.removeChild(t),!1)}catch{return document.body.removeChild(t),!1}}function wo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=wo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function _e(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=wo(e))&&(r&&(r+=" "),r+=t);return r}const St=e=>typeof e=="number"&&!isNaN(e),tt=e=>typeof e=="string",Ie=e=>typeof e=="function",en=e=>tt(e)||Ie(e)?e:null,Tn=e=>b.isValidElement(e)||tt(e)||Ie(e)||St(e);function wA(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function tn(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:m,preventExitTransition:c,done:l,nodeRef:d,isIn:y}=a;const g=r?`${t}--${m}`:t,h=r?`${n}--${m}`:n,f=b.useRef(0);return b.useLayoutEffect(()=>{const v=d.current,W=g.split(" "),k=z=>{z.target===d.current&&(v.dispatchEvent(new Event("d")),v.removeEventListener("animationend",k),v.removeEventListener("animationcancel",k),f.current===0&&z.type!=="animationcancel"&&v.classList.remove(...W))};v.classList.add(...W),v.addEventListener("animationend",k),v.addEventListener("animationcancel",k)},[]),b.useEffect(()=>{const v=d.current,W=()=>{v.removeEventListener("animationend",W),o?wA(v,l,i):l()};y||(c?W():(f.current=1,v.className+=` ${h}`,v.addEventListener("animationend",W)))},[y]),b.createElement(b.Fragment,null,A)}}function Ko(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Le={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},nn=e=>{let{theme:t,type:n,...r}=e;return b.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Hn={info:function(e){return b.createElement(nn,{...e},b.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(e){return b.createElement(nn,{...e},b.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(e){return b.createElement(nn,{...e},b.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(e){return b.createElement(nn,{...e},b.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 b.createElement("div",{className:"Toastify__spinner"})}};function KA(e){const[,t]=b.useReducer(g=>g+1,0),[n,r]=b.useState([]),o=b.useRef(null),i=b.useRef(new Map).current,a=g=>n.indexOf(g)!==-1,A=b.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:g=>i.get(g)}).current;function m(g){let{containerId:h}=g;const{limit:f}=A.props;!f||h&&A.containerId!==h||(A.count-=A.queue.length,A.queue=[])}function c(g){r(h=>g==null?[]:h.filter(f=>f!==g))}function l(){const{toastContent:g,toastProps:h,staleId:f}=A.queue.shift();y(g,h,f)}function d(g,h){let{delay:f,staleId:v,...W}=h;if(!Tn(g)||function(F){return!o.current||A.props.enableMultiContainer&&F.containerId!==A.props.containerId||i.has(F.toastId)&&F.updateId==null}(W))return;const{toastId:k,updateId:z,data:E}=W,{props:C}=A,P=()=>c(k),oe=z==null;oe&&A.count++;const V={...C,style:C.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(W).filter(F=>{let[_,M]=F;return M!=null})),toastId:k,updateId:z,data:E,closeToast:P,isIn:!1,className:en(W.className||C.toastClassName),bodyClassName:en(W.bodyClassName||C.bodyClassName),progressClassName:en(W.progressClassName||C.progressClassName),autoClose:!W.isLoading&&(me=W.autoClose,ne=C.autoClose,me===!1||St(me)&&me>0?me:ne),deleteToast(){const F=Ko(i.get(k),"removed");i.delete(k),Le.emit(4,F);const _=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),_>0){const M=k==null?A.props.limit:1;if(_===1||M===1)A.displayedToast++,l();else{const S=M>_?_:M;A.displayedToast=S;for(let N=0;N<S;N++)l()}}else t()}};var me,ne;V.iconOut=function(F){let{theme:_,type:M,isLoading:S,icon:N}=F,p=null;const O={theme:_,type:M};return N===!1||(Ie(N)?p=N(O):b.isValidElement(N)?p=b.cloneElement(N,O):tt(N)||St(N)?p=N:S?p=Hn.spinner():(B=>B in Hn)(M)&&(p=Hn[M](O))),p}(V),Ie(W.onOpen)&&(V.onOpen=W.onOpen),Ie(W.onClose)&&(V.onClose=W.onClose),V.closeButton=C.closeButton,W.closeButton===!1||Tn(W.closeButton)?V.closeButton=W.closeButton:W.closeButton===!0&&(V.closeButton=!Tn(C.closeButton)||C.closeButton);let ue=g;b.isValidElement(g)&&!tt(g.type)?ue=b.cloneElement(g,{closeToast:P,toastProps:V,data:E}):Ie(g)&&(ue=g({closeToast:P,toastProps:V,data:E})),C.limit&&C.limit>0&&A.count>C.limit&&oe?A.queue.push({toastContent:ue,toastProps:V,staleId:v}):St(f)?setTimeout(()=>{y(ue,V,v)},f):y(ue,V,v)}function y(g,h,f){const{toastId:v}=h;f&&i.delete(f);const W={content:g,props:h};i.set(v,W),r(k=>[...k,v].filter(z=>z!==f)),Le.emit(4,Ko(W,W.props.updateId==null?"added":"updated"))}return b.useEffect(()=>(A.containerId=e.containerId,Le.cancelEmit(3).on(0,d).on(1,g=>o.current&&c(g)).on(5,m).emit(2,A),()=>{i.clear(),Le.emit(3,A)}),[]),b.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(g){const h=new Map,f=Array.from(i.values());return e.newestOnTop&&f.reverse(),f.forEach(v=>{const{position:W}=v.props;h.has(W)||h.set(W,[]),h.get(W).push(v)}),Array.from(h,v=>g(v[0],v[1]))},containerRef:o,isToastActive:a}}function Wo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function So(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function WA(e){const[t,n]=b.useState(!1),[r,o]=b.useState(!1),i=b.useRef(null),a=b.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=b.useRef(e),{autoClose:m,pauseOnHover:c,closeToast:l,onClick:d,closeOnClick:y}=e;function g(E){if(e.draggable){E.nativeEvent.type==="touchstart"&&E.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",W),document.addEventListener("mouseup",k),document.addEventListener("touchmove",W),document.addEventListener("touchend",k);const C=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=C.getBoundingClientRect(),C.style.transition="",a.x=Wo(E.nativeEvent),a.y=So(E.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function h(E){if(a.boundingRect){const{top:C,bottom:P,left:oe,right:V}=a.boundingRect;E.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=oe&&a.x<=V&&a.y>=C&&a.y<=P?v():f()}}function f(){n(!0)}function v(){n(!1)}function W(E){const C=i.current;a.canDrag&&C&&(a.didMove=!0,t&&v(),a.x=Wo(E),a.y=So(E),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),C.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,C.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",W),document.removeEventListener("touchend",k);const E=i.current;if(a.canDrag&&a.didMove&&E){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();E.style.transition="transform 0.2s, opacity 0.2s",E.style.transform=`translate${e.draggableDirection}(0)`,E.style.opacity="1"}}b.useEffect(()=>{A.current=e}),b.useEffect(()=>(i.current&&i.current.addEventListener("d",f,{once:!0}),Ie(e.onOpen)&&e.onOpen(b.isValidElement(e.children)&&e.children.props),()=>{const E=A.current;Ie(E.onClose)&&E.onClose(b.isValidElement(E.children)&&E.children.props)}),[]),b.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||v(),window.addEventListener("focus",f),window.addEventListener("blur",v)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",f),window.removeEventListener("blur",v))}),[e.pauseOnFocusLoss]);const z={onMouseDown:g,onTouchStart:g,onMouseUp:h,onTouchEnd:h};return m&&c&&(z.onMouseEnter=v,z.onMouseLeave=f),y&&(z.onClick=E=>{d&&d(E),a.canCloseOnClick&&l()}),{playToast:f,pauseToast:v,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:z}}function Mo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return b.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},b.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},b.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 SA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:m,progress:c,rtl:l,isIn:d,theme:y}=e;const g=i||m&&c===0,h={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:g?0:1};m&&(h.transform=`scaleX(${c})`);const f=_e("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":l}),v=Ie(a)?a({rtl:l,type:o,defaultClassName:f}):_e(f,a);return b.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:v,style:h,[m&&c>=1?"onTransitionEnd":"onAnimationEnd"]:m&&c<1?null:()=>{d&&r()}})}const MA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=WA(e),{closeButton:i,children:a,autoClose:A,onClick:m,type:c,hideProgressBar:l,closeToast:d,transition:y,position:g,className:h,style:f,bodyClassName:v,bodyStyle:W,progressClassName:k,progressStyle:z,updateId:E,role:C,progress:P,rtl:oe,toastId:V,deleteToast:me,isIn:ne,isLoading:ue,iconOut:F,closeOnClick:_,theme:M}=e,S=_e("Toastify__toast",`Toastify__toast-theme--${M}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":oe},{"Toastify__toast--close-on-click":_}),N=Ie(h)?h({rtl:oe,position:g,type:c,defaultClassName:S}):_e(S,h),p=!!P||!A,O={closeToast:d,type:c,theme:M};let B=null;return i===!1||(B=Ie(i)?i(O):b.isValidElement(i)?b.cloneElement(i,O):Mo(O)),b.createElement(y,{isIn:ne,done:me,position:g,preventExitTransition:n,nodeRef:r},b.createElement("div",{id:V,onClick:m,className:N,...o,style:f,ref:r},b.createElement("div",{...ne&&{role:C},className:Ie(v)?v({type:c}):_e("Toastify__toast-body",v),style:W},F!=null&&b.createElement("div",{className:_e("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!ue})},F),b.createElement("div",null,a)),B,b.createElement(SA,{...E&&!p?{key:`pb-${E}`}:{},rtl:oe,theme:M,delay:A,isRunning:t,isIn:ne,closeToast:d,hide:l,type:c,style:z,className:k,controlledProgress:p,progress:P||0})))},rn=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},LA=tn(rn("bounce",!0));tn(rn("slide",!0)),tn(rn("zoom")),tn(rn("flip"));const Xn=b.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=KA(e),{className:i,style:a,rtl:A,containerId:m}=e;function c(l){const d=_e("Toastify__toast-container",`Toastify__toast-container--${l}`,{"Toastify__toast-container--rtl":A});return Ie(i)?i({position:l,rtl:A,defaultClassName:d}):_e(d,en(i))}return b.useEffect(()=>{t&&(t.current=r.current)},[]),b.createElement("div",{ref:r,className:"Toastify",id:m},n((l,d)=>{const y=d.length?{...a}:{...a,pointerEvents:"none"};return b.createElement("div",{className:c(l),style:y,key:`container-${l}`},d.map((g,h)=>{let{content:f,props:v}=g;return b.createElement(MA,{...v,isIn:o(v.toastId),style:{...v.style,"--nth":h+1,"--len":d.length},key:`toast-${v.key}`},f)}))}))});Xn.displayName="ToastContainer",Xn.defaultProps={position:"top-right",transition:LA,autoClose:5e3,closeButton:Mo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Qn,nt=new Map,Mt=[],EA=1;function Lo(){return""+EA++}function OA(e){return e&&(tt(e.toastId)||St(e.toastId))?e.toastId:Lo()}function Lt(e,t){return nt.size>0?Le.emit(0,e,t):Mt.push({content:e,options:t}),t.toastId}function on(e,t){return{...t,type:t&&t.type||e,toastId:OA(t)}}function an(e){return(t,n)=>Lt(t,on(e,n))}function de(e,t){return Lt(e,on("default",t))}de.loading=(e,t)=>Lt(e,on("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),de.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=tt(o)?de.loading(o,n):de.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},m=(l,d,y)=>{if(d==null)return void de.dismiss(r);const g={type:l,...A,...n,data:y},h=tt(d)?{render:d}:d;return r?de.update(r,{...g,...h}):de(h.render,{...g,...h}),y},c=Ie(e)?e():e;return c.then(l=>m("success",a,l)).catch(l=>m("error",i,l)),c},de.success=an("success"),de.info=an("info"),de.error=an("error"),de.warning=an("warning"),de.warn=de.warning,de.dark=(e,t)=>Lt(e,on("default",{theme:"dark",...t})),de.dismiss=e=>{nt.size>0?Le.emit(1,e):Mt=Mt.filter(t=>e!=null&&t.options.toastId!==e)},de.clearWaitingQueue=function(e){return e===void 0&&(e={}),Le.emit(5,e)},de.isActive=e=>{let t=!1;return nt.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},de.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=nt.get(i||Qn);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:Lo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,Lt(a,i)}},0)},de.done=e=>{de.update(e,{progress:1})},de.onChange=e=>(Le.on(4,e),()=>{Le.off(4,e)}),de.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"},de.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Le.on(2,e=>{Qn=e.containerId||e,nt.set(Qn,e),Mt.forEach(t=>{Le.emit(0,t.content,t.options)}),Mt=[]}).on(3,e=>{nt.delete(e.containerId||e),nt.size===0&&Le.off(0).off(1).off(5)});function ct(e){de.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Pn="",je="Playable",we=null,Eo=null,Oo;const Vn=async(e,t,n)=>{je==="Playable"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await xo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},we):je==="Flex"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await xA({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},we):je==="Ready"&&t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(t.googleUrl=t.iosUrl),await xo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},we))},An=async e=>{let t=Pn+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const o=window.URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=n.split("/").reduce((a,A)=>A,""),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(o),ct("Download successfully")}).catch(r=>{console.error("File error:",r)})},kA=(e,t)=>{let n=Pn+"/"+e;Wt(n)?ct("Link Copied"):t(n)};async function Et(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let m=async c=>{r==="download"?await An(c):r==="copy"&&kA(c,Eo)};try{await Vn(e,n,i)}catch(c){console.log("updateUrls error",c)}je==="Playable"?yA(we,e,t,o,i).then(async c=>{let{url:l}=c;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Flex"?gA({_id:e,network:t,extras:i},we).then(async c=>{if(c.message){A(c);return}let{url:l}=c;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Import"?qA(we,e,t).then(async c=>{let l=c.url;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Ready"?bA(we,e,t,o,i).then(async c=>{if(c.message){A(c);return}let l=c.url;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Fusion"&&ZA(we,e,t,Oo,o,i).then(async c=>{let l=c.url;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})})})}async function jA(e,t,n,r=null){return new Promise(async(o,i)=>{await Vn(e,t,r),je==="Flex"?hA(e,n,we).then(async a=>{if(a.message){i(a);return}await An(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})}):je==="Ready"?CA(e,n,we).then(async a=>{if(a.message){i(a);return}await An(a.url),o(a.url)}).catch(a=>{console.log("err",a);let A=a.response.data.error.msg;i({message:A})}):vA(e,n,we).then(async a=>{await An(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})})})}function zA(e,t,n,r,o){je=e,we=t,Eo=n,Pn=r,Oo=o}async function YA(e){return await IA({versionId:e,checkExistance:!0},we)}async function Bn(e,t){return(await ge.post(t+"/findPlayable",{_id:e})).data}const JA=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:o,setSafariCopyLink:i,qrUrl:a,iosLink:A,androidLink:m,urlType:c})=>{const[l,d]=b.useState(!1),y=async()=>{d(!0),Et(e,"default",{iosUrl:A,googleUrl:m},null,!1,{urlType:c}).then(async g=>{var W,k,z,E;let h="";if(t&&(n==="Playable"||n==="Ready")){const C=await Bn(t,r);console.log(C);const P=(k=(W=C==null?void 0:C.data)==null?void 0:W.globalProps)==null?void 0:k.defaultLandscape,oe=(E=(z=C==null?void 0:C.data)==null?void 0:z.globalProps)==null?void 0:E.defaultPhoneIndex;console.log(P,oe),P&&(h+="&landscape=true"),oe!==void 0&&(h+=`&phoneIndex=${oe}`)}Bn(t,r),d(!1);let f;n==="Flex"?f=`${o}/preview?versionId=${e}`:n==="Import"?f=`${o}/preview?versionId=${e}_`:n==="Ready"?f=`${o}/preview?versionId=${e}_&ready=true`:f=`${o}/preview?versionId=${e}_`,f+=h,Wt(f)?ct("Link copied"):i(f),d(!1)}).catch(g=>{d(!1)})};return s.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[s.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:a?s.jsx($i,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):s.jsx("img",{style:{width:"50px",height:"50px"},src:Xe,alt:"pf-logo-gif"})}),s.jsxs("div",{children:[s.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),s.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{l||y()},children:[s.jsx(Nr,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),s.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:l?s.jsx("img",{style:{height:"90%"},src:Xe,alt:"loading"}):s.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},NA=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:o,iframeUrl:i,fetchFileUrl:a,copyLinkUrl:A,setSafariCopyLink:m,iosLink:c,androidLink:l,urlType:d})=>{const[y,g]=b.useState(window.innerWidth);console.log("iosLink",c),b.useEffect(()=>{console.log("re add event listener");function f(v){console.log(v),v.data==="cta"&&(console.log("Received 'cta' message from iframe"),c&&window.open(c,"_blank"))}return window.addEventListener("message",f,!1),()=>{window.removeEventListener("message",f)}},[c,l]),b.useEffect(()=>{const f=()=>{g(window.innerWidth)};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]);const h=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return s.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:y>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[s.jsx(gi,{iframeUrl:i}),s.jsx(qi,{name:h}),s.jsx(JA,{versionId:t,playableId:n,typeOfProduct:r,api:o,copyLinkUrl:A,setSafariCopyLink:m,qrUrl:i,iosLink:c,androidLink:l,urlType:d})]})};var ye=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(ye||{});const ko=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=b.useState(e);b.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return s.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:s.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[s.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:i}),s.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:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:ye[t],stroke:ye[t],strokeWidth:"1",children:s.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"})})," "]})]})})},RA=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:[s.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[s.jsx("span",{style:{color:ye[e]},children:"Select Network"}),s.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]}),s.jsxs("div",{onClick:()=>{n(!t)},style:{marginLeft:"auto",marginRight:"2rem",display:"flex",height:"24px",alignItems:"center",justifyContent:"flex-end",fontSize:"0.875rem",width:110},children:[s.jsx(ko,{checked:t,typeOfProduct:e,id:"asd"}),s.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"16px",fontWeight:"bold"},children:"Select All"})]})]});async function DA(e,t){return(await ge.post(t+"/buyRequest",{requestType:e})).data}const GA=()=>s.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[s.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_518_12094",children:s.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),TA=({creditDownload:e,api:t})=>s.jsxs(s.Fragment,{children:[s.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."}),s.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"," ",s.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)<0?0:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)})," ","credits remaining.",s.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>DA("Flex Credit",t).then(n=>ct("You will be contacted regarding your request.")),children:["Get more",s.jsx(GA,{})]})]})]}),jo=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=A=>{n(A.target.value)},a=A=>{r(A.target.value)};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[s.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"App Store:"}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]}),s.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[s.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:["Google Play:"," "]}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},HA=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=a=>{n(a.target.value)};return s.jsx(s.Fragment,{children:s.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[s.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},XA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:m,isTest:c,setIsTest:l,urlType:d,setUrlType:y})=>{const g=()=>s.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[s.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"20px",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e]},type:"checkbox",checked:c,onChange:()=>{l(!c)},placeholder:"Google Url",disabled:i})]}),h=()=>s.jsx(s.Fragment,{children:s.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:[s.jsx("div",{style:{position:"absolute",bottom:"-3px",left:d==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),s.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(()=>{y("game")},200)},children:s.jsx("span",{style:{position:"relative",color:d==="game"?"#000":"#a3a3a3",fontWeight:d==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),s.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(()=>{y("single")},200)},children:s.jsx("span",{style:{position:"relative",color:d==="single"?"#000":"#a3a3a3",fontWeight:d==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return s.jsx(s.Fragment,{children:e!=="Import"&&s.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[m.customer=="playableFactoryInternal"&&e==="Playable"&&s.jsx(g,{}),e==="Ready"?s.jsxs(s.Fragment,{children:[s.jsx(h,{}),d==="game"&&s.jsx(jo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),d==="single"&&s.jsx(HA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):s.jsx(s.Fragment,{children:s.jsx(jo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&s.jsx(TA,{creditDownload:A,api:a})]})})},QA=({typeOfProduct:e,title:t,fileSize:n})=>s.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[s.jsx("span",{style:{color:ye[e]},children:t}),n&&s.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),PA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:l,setIsTest:d,urlType:y,setUrlType:g,allNetworksSelected:h,setAllNetworksSelected:f})=>s.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:[s.jsx(QA,{typeOfProduct:e,title:r,fileSize:t}),s.jsx(XA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:l,setIsTest:d,urlType:y,setUrlType:g}),s.jsx(RA,{typeOfProduct:e,allNetworksSelected:h,setAllNetworksSelected:f})]}),Un=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>s.jsx("button",{onClick:n,className:t,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||o,children:e}),Xl="",VA=({typeOfProduct:e})=>s.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:s.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}}),s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}}),s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}}),s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}})]})}),Ot=({isNetworksLoading:e=!1})=>s.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:s.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Xe,alt:"pf-logo-gif"})}),Fn=({title:e,titleId:t,...n})=>s.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":t,...n,children:[e?s.jsx("title",{id:t,children:e}):null,s.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"})]}),BA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i,typeOfProduct:a,urlType:A})=>{let m="";return a==="Ready"&&A==="single"?m="Redirection url is empty. Are you sure you want to continue?":!t&&!n?m="Both links are empty. Are you sure you want to continue?":t?n||(m="Google link is empty. Are you sure you want to continue?"):m="iOS link is empty. Are you sure you want to continue?",s.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:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),s.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:[s.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:m}),s.jsxs("div",{style:{display:"flex",gap:"5px"},children:[s.jsx("button",{onClick:()=>{e(!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:"No"}),s.jsx("button",{onClick:async c=>{r==="download"?await i():r==="copyLink"&&await o(),e()},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:"Yes"})]})]})]})},_n=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o,width:i="130%",height:a="120%"})=>s.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:a,width:i,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),s.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:[s.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?"}),s.jsxs("div",{style:{display:"flex",gap:"5px"},children:[s.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),s.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 o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),UA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>s.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:e,children:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),s.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:a=>{a.stopPropagation()},children:s.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?s.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:s.jsx("img",{width:"25px",height:"25px",src:Xe,alt:"pf-logo-gif"})}):s.jsx("button",{onClick:()=>{t(!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"}),i?s.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:s.jsx("img",{width:"25px",height:"25px",src:Xe,alt:"pf-logo-gif"})}):s.jsx("button",{onClick:()=>{t(!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"})]}),s.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?s.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:s.jsx("img",{width:"25px",height:"25px",src:Xe,alt:"pf-logo-gif"})}):s.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 FA(e,t,n,r){return(await ge.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const _A=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:m,versionId:c,api:l,handleDownloadError:d,fetchFileUrl:y,urls:g,game:h,setIsConfirmActive:f,creditDownload:v,getDownloadCount:W,disabled:k,user:z,setSafariCopyLink:E,isTest:C,urlType:P,setCdnModal:oe,generateCDN:V,cdnUrl:me})=>{const[ne,ue]=b.useState(!1),[F,_]=b.useState(""),[M,S]=b.useState(!1),[N,p]=b.useState(!1),[O,B]=b.useState(!1),[q,x]=b.useState("download"),[R,j]=b.useState(!1),[Y,T]=b.useState(!1),[D,G]=b.useState(!1);let H={aarki:"html,copy",adcolony:"copy,html",adjoe:"copy,html",applovin:"copy,html",appreciate:"zip",chartboost:"copy,html",criteo:"zip",crossinstall:"copy,html",default:"copy",fb:"zip",fyber:"copy,html",google:"zip",google360:"zip",ironsource:"copy,html",kayzen:"apikey",kaden:"html",kidoz:"html",lifestreet:"copy,html",liftoff:"copy,zip",mobvista:"html",moloco:"html,molocotest",molocoV2:"html,molocotest",nucleo:"copy,html",oceanengine:"copy,zip",pointblank:"html",smadex:"zip",snapchat:"zip",tapjoy:"copy,html",tencent:"zip",toutiao:"copy,zip",toutiao_cn:"copy,zip",unity:"copy,html",vungle:"html",web:"copy,html",yandex:"zip",zucks:"copy,html",luna:"zip",inmobi:"copy,html,",nend:"html",adikteev:"html",jammp:"copy,html",mraid:"copy,html"};const U=()=>{n(e)},Z=async(ae,ee)=>{const pe={molocoGenerateHtml:!1,urlType:P};if($&&(ee==="copy"?(T(!0),ee="download",pe.molocoGenerateHtml=!0):j(!0)),console.log("getVersion",ae,ee,pe),ae==="cdn"){oe(!0),await V(!0);return}return ue(!0),new Promise((ht,gt)=>{Et(c,ae,g,ee,C,pe).then(Ee=>{ue(!1),ht(Ee),T(!1),j(!1)}).catch(Ee=>{ue(!1),d(Ee.message,Ee),gt(Ee),T(!1),j(!1)})})},J=async(ae=!1)=>{ae?T(!0):j(!0);const ee={molocoGenerateHtml:!1};ae&&(ee.molocoGenerateHtml=!0),Et(c,o,g,"download",C,ee).then(pe=>{ae?T(!1):j(!1),B(!1)}).catch(pe=>{d(pe.message,pe)})},K=async()=>{G(!0);const ae=await FA(l,c,o,m);let ee=`${y}/${ae==null?void 0:ae.url}`;Wt(ee)?(ct("Link Copied"),G(!1)):E(ee)},$=o==="moloco"||o==="molocoV2";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?ye[m]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+m,onClick:U,children:[s.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[s.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:s.jsx("div",{children:i&&i.map(ae=>ae.network).includes(o)?a?s.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:s.jsx(VA,{typeOfProduct:m})}):i.map(ae=>s.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===o?ae.size.toString().slice(0,5)+"Mb":""},ae.network)):null})}),s.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(m==="Playable"||m==="Ready"||m==="Flex")&&A&&s.jsx(ko,{checked:r,typeOfProduct:m,id:e})}),s.jsx("img",{onClick:U,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[s.jsx(Un,{className:`${$?"w-1/2":"w-2/3"} border-hover-`+m,downloading:ne,onClickDonwload:async ae=>{if(ae.stopPropagation(),$&&z.customer==="playableFactoryInternal"){B(!0);return}else{_("download");const ee=g.iosUrl,pe=g.googleUrl;o==="cdn"&&v&&v.willSpendCredit&&!me||o!=="cdn"&&v&&v.willSpendCredit?(f(!0),x("download"),S(!0)):["Playable","Flex"].includes(m)&&(!ee||!pe)||m==="Ready"&&P==="single"&&!ee||m==="Ready"&&P==="multi"&&(!ee||!pe)?(f(!0),p(!0)):(p(!1),S(!1),await Z(o,"download"))}},children:$?s.jsxs(s.Fragment,{children:[!R&&s.jsxs(s.Fragment,{children:[s.jsx(Fn,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),z.customer!=="playableFactoryInternal"?"TXT":"Download"]}),R&&s.jsx(Ot,{})]}):s.jsxs(s.Fragment,{children:[!ne&&s.jsxs(s.Fragment,{children:[s.jsx(Fn,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),o==="cdn"?"Generate Link":"Download"]}),ne&&s.jsx(Ot,{})]})}),H[o]&&H[o].includes("copy")&&s.jsx(Un,{className:"w-1/3 border-hover-"+m,onClickDonwload:async ae=>{ae.stopPropagation(),_("copyLink");const ee=g.iosUrl,pe=g.googleUrl;v&&(v!=null&&v.willSpendCredit)?(x("copy"),f(!0),S(!0)):m!=="Import"&&(!ee||!pe)?(f(!0),p(!0)):(S(!1),p(!1),await Z(o,"copy"))},disabled:k,children:s.jsx(Nr,{className:"h-6 w-6 stroke-dark-full"})}),$&&z.customer!=="playableFactoryInternal"&&s.jsxs(Un,{className:"w-1/2 border-hover-"+m,onClickDonwload:async ae=>{ae.stopPropagation(),_("copyLink");const ee=g.iosUrl,pe=g.googleUrl;v&&(v!=null&&v.willSpendCredit)?(x("download"),f(!0),S(!0)):m!=="Import"&&(!ee||!pe)?(f(!0),p(!0)):(S(!1),p(!1),await J(!0))},disabled:k,children:[!Y&&s.jsxs(s.Fragment,{children:[s.jsx(Fn,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]}),Y&&s.jsx(Ot,{})]})]}),$&&s.jsx("img",{style:{position:"absolute",width:"135px",right:"0",top:"18px"},src:"https://home.playablefactory.app/recommended_badge.png"})]}),M&&s.jsx(_n,{creditConfirmType:q,handleCopyLink:async()=>{p(!1),f(!1),await Z(o,"copy")},download:async()=>{p(!1),f(!1),await Z(o,"download")},onClose:()=>{S(!1),f(!1)},getDownloadCount:W}),N&&s.jsx(BA,{onClose:()=>{p(!1),f(!1)},iosLink:g.iosUrl,googleLink:g.googleUrl,buttonType:F,handleCopyLink:async()=>{p(!1),f(!1),await Z(o,"copy")},download:async()=>{p(!1),f(!1),await Z(o,"download")},typeOfProduct:m,urlType:P}),O&&z.customer==="playableFactoryInternal"&&s.jsx(UA,{onClose:()=>{B(!1)},handleDownload:J,handleDownloadMolocoTest:K,downloadingMoloco:R,donwloadintMolocoTest:D,downloadingMolocoHtml:Y})]})},sn=[{id:"22",name:"moloco",imageSrc:"https://home.playablefactory.com/moloco.png"},{id:"44",name:"molocoV2",imageSrc:"https://home.playablefactory.com/molocoV2.png"},{id:"33",name:"web",imageSrc:"https://home.playablefactory.com/files/network_icons/web.png"},{id:"1",name:"unity",imageSrc:"https://home.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://home.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://home.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://home.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://home.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://home.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://home.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://home.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://home.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://home.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://home.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://home.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://home.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://home.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://home.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://home.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://home.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://home.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://home.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://home.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://home.playablefactory.com/liftoff.png"},{id:"23",name:"nucleo",imageSrc:"https://home.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://home.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://home.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://home.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://home.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://home.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://home.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://home.playablefactory.com/yandex.png"},{id:"34",name:"zucks",imageSrc:"https://home.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://home.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://home.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://home.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://home.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://home.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://home.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://home.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://home.playablefactory.com/adjoe.png"},{id:"45",name:"adikteev",imageSrc:"https://home.playablefactory.com/adikteev.png"},{id:"46",name:"appier",imageSrc:"https://home.playablefactory.com/appier.png"},{id:"47",name:"remerge",imageSrc:"https://home.playablefactory.com/remerge.png"},{id:"48",name:"persona",imageSrc:"https://home.playablefactory.com/persona.png"},{id:"49",name:"bidease",imageSrc:"https://home.playablefactory.com/bidease.png"},{id:"50",name:"mraid",imageSrc:"https://home.playablefactory.com/mraid.png"},{id:"51",name:"zynga",imageSrc:"https://home.playablefactory.com/zynga.png"},{id:"52",name:"youappi",imageSrc:"https://home.playablefactory.com/youappi.png"},{id:"53",name:"cdn",imageSrc:"https://home.playablefactory.com/cdn.png"}],$A=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const o={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:ye[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return s.jsx("button",{onClick:r,className:n,style:o,children:e})},es=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?s.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:ye[t]},children:s.jsx(Ot,{})}):s.jsx($A,{typeOfProduct:t,onClick:n,children:s.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),ts=({title:e,titleId:t})=>s.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:[s.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"}),s.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"})]}),ns=({onClose:e,cdnUrl:t,generateCDN:n,cdnUploading:r})=>s.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:e,children:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),s.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:o=>{o.stopPropagation()},children:s.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[s.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&&s.jsx("img",{width:"30px",src:Xe,alt:"pf-logo-gif"})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[s.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:s.jsx(ts,{})}),s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:s.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:t,target:"_blank",children:t||"No CDN link generated"})}),s.jsx("button",{onClick:()=>{if(!t)return;Wt(t)&&ct("Link copied")},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:t?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})]})})]}),rs=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:m,urls:c,game:l,getDownloadCount:d,disabled:y,setSafariCopyLink:g,isTest:h,urlType:f,allNetworksSelected:v,setAllNetworksSelected:W,cdnModal:k,setCdnModal:z,cdnUrl:E,setCdnUrl:C})=>{const[P,oe]=b.useState([]),[V,me]=b.useState([]),[ne,ue]=b.useState(!1),[F,_]=b.useState(""),[M,S]=b.useState(!1),[N,p]=b.useState(!1),[O,B]=b.useState("download"),[q,x]=b.useState(!1),[R,j]=b.useState(!1),[Y,T]=b.useState(!1),D=async(Z=!1)=>{Z&&E||Y||(T(!0),Et(r,"cdn",c,null,!1,{}).then(J=>{C(J.url),T(!1)}).catch(J=>{A(J.message,J),T(!1)}))},G=async Z=>{const J=[...P];if(P.includes(Z)){const K=J.findIndex($=>$===Z);J.splice(K,1),oe(J)}else J.push(Z),oe([...P,Z]);sn.filter(K=>[...J].includes(K.id)).map(K=>K.name)},H=async()=>new Promise(async(Z,J)=>{const K=sn.filter($=>[...P].includes($.id)).map($=>$.name);S(!0),jA(r,c,K,{urlType:f}).then($=>{S(!1),Z($)}).catch($=>{console.log("get multi download err"),S(!1),A($.message,$),J($)})}),U=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(p(!0),B("download"),x(!0)):(x(!1),await H())};return b.useEffect(()=>{const Z=sn.filter(J=>{var K;return t&&((K=t==null?void 0:t.networks)==null?void 0:K.length)>0?t==null?void 0:t.networks.includes(J.name):o==="Import"?e==null?void 0:e.networks.filter($=>$.status==="paid").some($=>$.name===J.name):e==null?void 0:e.networks.includes(J.name)}).filter(J=>J.name==="voodoo"?a.customer==="customer:20":!0).map(J=>J.id);oe(v?Z:[])},[v]),s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"relative",flex:1,overflowY:N?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:s.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&sn.filter(Z=>{var J;return t&&((J=t==null?void 0:t.networks)==null?void 0:J.length)>0?t==null?void 0:t.networks.includes(Z.name):o==="Import"?e==null?void 0:e.networks.filter(K=>K.status==="paid").some(K=>K.name===Z.name):e==null?void 0:e.networks.includes(Z.name)}).filter(Z=>Z.name==="voodoo"?a.customer==="customer:20":!0).map(Z=>{let J=Z.imageSrc;if(Z.name==="web"){let K="web_"+o.toLowerCase()+".png";J=J.replace("web.png",K)}return s.jsx(_A,{id:Z.id,name:Z.name,imageUrl:J,selected:P.includes(Z.id),handleCardClick:G,networkVersionSize:V,fileSizeLoading:ne,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:m,urls:c,game:l,creditDownload:t,setIsConfirmActive:p,getDownloadCount:d,disabled:y,user:a,setSafariCopyLink:g,isTest:h,urlType:f,setCdnModal:z,generateCDN:D,cdnUrl:E},Z.id)})})}),P.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&s.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:s.jsx(es,{onClickMultiDownload:U,networksVersionTotalSize:F,typeOfProduct:o,multiDownloading:M})}),k&&s.jsx(ns,{onClose:()=>{z(!1),d()},versionId:r,urls:c,handleDownloadError:A,cdnUrl:E,setCdnUrl:C,generateCDN:async()=>{if(!Y){if(T(!0),a.customer==="playableFactoryInternal"){D();return}j(!0)}},cdnUploading:Y}),R&&s.jsx(_n,{width:"100%",height:"100%",creditConfirmType:O,handleCopyLink:async()=>{},download:async()=>{x(!1),j(!1),D()},onClose:()=>{x(!1),j(!1),T(!1)},getDownloadCount:d}),q&&s.jsx(_n,{creditConfirmType:O,handleCopyLink:async()=>{},download:async()=>{x(!1),p(!1),await H()},onClose:()=>{x(!1),p(!1)},getDownloadCount:d})]})};async function os(e,t){return(await ge.post(t+"/getFlexDownloadCount",e)).data}async function is(e,t){try{return(await ge.post(t+"/findGame",{_id:e})).data}catch{}}async function as(e,t){return(await ge.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function As(e,t){return(await ge.post(t+"/getFlexData",{_id:e})).data}async function ss(e,t){return(await ge.post(t+"/getImportedPlayable",{id:e})).data}async function ls(e,t){return(await ge.post(t+"/getReadyDownloadCount",e)).data}const us=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],zo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco","cdn"];let Yo=null;const cs=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:m,fetchFileUrl:c,fileSize:l,setFileSize:d,setSafariCopyLink:y,iosLink:g,androidLink:h,setIosLink:f,setAndroidLink:v,urlType:W,setUrlType:k})=>{const[z,E]=b.useState(null),[C,P]=b.useState(null),[oe,V]=b.useState(null),[me,ne]=b.useState(!1),[ue,F]=b.useState(!0),[_,M]=b.useState(window.innerWidth),[S,N]=b.useState(!1),[p,O]=b.useState(!1),[B,q]=b.useState("");b.useEffect(()=>{B||YA(t).then(Z=>{Z.exist&&q(Z.uploadPath)})},[B]),console.log("download modal version: 6.0.37");const[x,R]=b.useState(!1);b.useEffect(()=>{},[x]),b.useEffect(()=>{const Z=()=>{M(window.innerWidth)};return window.addEventListener("resize",Z),()=>{window.removeEventListener("resize",Z)}},[]);const j=async()=>{ne(!0);const Z=await Bn(e,i);return Z!=null&&Z.networks||(Z.networks=us),E(Z),Z},Y=(Z,J)=>{clearTimeout(Yo),Yo=setTimeout(()=>{console.log("Update URLS:"),Vn(t,{iosUrl:Z,googleUrl:J},{urlType:W})},1e3)},T=Z=>{f(Z),Y(Z,h)},D=Z=>{v(Z),Y(g,Z)},G=async(Z,J)=>{var K,$;console.log("getIosAndAndroidLink");try{let ae;if(r==="Playable"||r==="Ready"){const ee=await as(t,i);if(ee){console.log("version",ee),f(ee.iosLink),v(ee.androidLink),ne(!1);return}if(Z&&(Z.iosUrl||Z.googleUrl)){f(Z.iosUrl),v(Z.googleUrl),ne(!1);return}if(J&&J.html){let pe=await fetch(c+"/"+J.html).then(Ee=>Ee.text());const ht=((K=pe.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:K.at(1))||"";f(ht);const gt=(($=pe.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:$.at(1))||"";v(gt),ne(!1)}else v(""),f(""),ne(!1)}else if(r==="Flex"){const ee=await As(t,i);if(ee.googleUrl||ee.iosUrl){v(ee.googleUrl),f(ee.iosUrl),ne(!1);return}Z&&(Z.iosUrl||Z.googleUrl)?(f(Z.iosUrl),v(Z.googleUrl),ne(!1)):(v(""),f(""),ne(!1))}}catch(ae){m(ae.response.data.error.msg)}},H=async()=>{ne(!0);let Z;r==="Flex"?Z=await os({_id:t},i):r==="Ready"&&(Z=await ls({_id:t},i)),Z&&(["admin","pm","tester","sales"].includes(a.role)?V({...Z,networks:zo}):r==="Ready"&&!Z.canDownload?V({...Z,networks:zo}):V(Z)),ne(!1)},U=async()=>await is(n,i);return b.useEffect(()=>{o||(E(null),P(null),V(null),d(null)),o&&(r==="Playable"?(j().then(Z=>{G(null,Z)}),F(!1)):r==="Ready"?H().then(Z=>{j().then(J=>{G(null,J),F(!1)})}):r==="Flex"?H().then(Z=>{F(!1),U().then(J=>{o&&(G(J,null),F(!1),P(J))})}):r==="Import"&&ss(t,i).then(Z=>{console.log(Z),E(Z),f(Z.iosUrl||""),v(Z.googleUrl||""),ne(!1),F(!1)}))},[n,e,t,o]),s.jsxs("div",{style:{display:"flex",height:_>1440?"700px":"650px",width:_>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[s.jsx(PA,{title:A,typeOfProduct:r,fileSize:l,urls:{iosUrl:g,googleUrl:h},handleIosChange:T,handleGoogleChange:D,disabled:ue,api:i,creditDownload:oe,user:a,isTest:S,setIsTest:N,urlType:W,setUrlType:k,allNetworksSelected:x,setAllNetworksSelected:R}),me?s.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:s.jsx(Ot,{isNetworksLoading:!0})}):(z||oe)&&(r==="Flex"?C:!0)&&!me&&g!=="Loading..."&&h!=="Loading..."&&s.jsx(rs,{playable:z,creditDownload:oe,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:m,fetchFileUrl:c,urls:{iosUrl:g,googleUrl:h},game:C,getDownloadCount:H,disabled:ue,setSafariCopyLink:y,isTest:S,urlType:W,allNetworksSelected:x,setAllNetworksSelected:R,cdnModal:p,setCdnModal:O,cdnUrl:B,setCdnUrl:q})]})},Ql="";var $n={exports:{}},rt={},er={exports:{}},ze={},tr={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;/*!
50
+ `):" "+uo(i[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:On};function kn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Kt(null,e)}function mo(e){return kn(e),e.headers=Qe.from(e.headers),e.data=En.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),co.getAdapter(e.adapter||Mn.adapter)(e).then(function(r){return kn(e),r.data=En.call(e,e.transformResponse,r),r.headers=Qe.from(r.headers),r},function(r){return Ao(r)||(kn(e),r&&r.response&&(r.response.data=En.call(e,e.transformResponse,r.response),r.response.headers=Qe.from(r.response.headers))),Promise.reject(r)})}const po=e=>e instanceof Qe?e.toJSON():e;function ut(e,t){t=t||{};const n={};function r(c,l,d){return I.isPlainObject(c)&&I.isPlainObject(l)?I.merge.call({caseless:d},c,l):I.isPlainObject(l)?I.merge({},l):I.isArray(l)?l.slice():l}function o(c,l,d){if(I.isUndefined(l)){if(!I.isUndefined(c))return r(void 0,c,d)}else return r(c,l,d)}function i(c,l){if(!I.isUndefined(l))return r(void 0,l)}function a(c,l){if(I.isUndefined(l)){if(!I.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function A(c,l,d){if(d in t)return r(c,l);if(d in e)return r(void 0,c)}const m={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:A,headers:(c,l)=>o(po(c),po(l),!0)};return I.forEach(Object.keys(Object.assign({},e,t)),function(l){const d=m[l]||o,y=d(e[l],t[l],l);I.isUndefined(y)&&d!==A||(n[l]=y)}),n}const fo="1.6.0",jn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ho={};jn.transitional=function(t,n,r){function o(i,a){return"[Axios v"+fo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new re(o(a," has been removed"+(n?" in "+n:"")),re.ERR_DEPRECATED);return n&&!ho[a]&&(ho[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,A):!0}};function AA(e,t,n){if(typeof e!="object")throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const A=e[i],m=A===void 0||a(A,i,e);if(m!==!0)throw new re("option "+i+" must be "+m,re.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new re("Unknown option "+i,re.ERR_BAD_OPTION)}}const zn={assertOptions:AA,validators:jn},Fe=zn.validators;class _t{constructor(t){this.defaults=t,this.interceptors={request:new ro,response:new ro}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ut(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&zn.assertOptions(r,{silentJSONParsing:Fe.transitional(Fe.boolean),forcedJSONParsing:Fe.transitional(Fe.boolean),clarifyTimeoutError:Fe.transitional(Fe.boolean)},!1),o!=null&&(I.isFunction(o)?n.paramsSerializer={serialize:o}:zn.assertOptions(o,{encode:Fe.function,serialize:Fe.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&I.merge(i.common,i[n.method]);i&&I.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=Qe.concat(a,i);const A=[];let m=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(m=m&&f.synchronous,A.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let l,d=0,y;if(!m){const h=[mo.bind(this),void 0];for(h.unshift.apply(h,A),h.push.apply(h,c),y=h.length,l=Promise.resolve(n);d<y;)l=l.then(h[d++],h[d++]);return l}y=A.length;let g=n;for(d=0;d<y;){const h=A[d++],f=A[d++];try{g=h(g)}catch(v){f.call(this,v);break}}try{l=mo.call(this,g)}catch(h){return Promise.reject(h)}for(d=0,y=c.length;d<y;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=ut(this.defaults,t);const n=so(t.baseURL,t.url);return no(n,t.params,t.paramsSerializer)}}I.forEach(["delete","get","head","options"],function(t){_t.prototype[t]=function(n,r){return this.request(ut(r||{},{method:t,url:n,data:(r||{}).data}))}}),I.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(ut(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}_t.prototype[t]=n(),_t.prototype[t+"Form"]=n(!0)});const $t=_t;class Yn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(A=>{r.subscribe(A),i=A}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,A){r.reason||(r.reason=new Kt(i,a,A),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Yn(function(o){t=o}),cancel:t}}}const sA=Yn;function lA(e){return function(n){return e.apply(null,n)}}function uA(e){return I.isObject(e)&&e.isAxiosError===!0}const Jn={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(Jn).forEach(([e,t])=>{Jn[t]=e});const cA=Jn;function go(e){const t=new $t(e),n=Rr($t.prototype.request,t);return I.extend(n,$t.prototype,t,{allOwnKeys:!0}),I.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return go(ut(e,o))},n}const he=go(Mn);he.Axios=$t,he.CanceledError=Kt,he.CancelToken=sA,he.isCancel=Ao,he.VERSION=fo,he.toFormData=Bt,he.AxiosError=re,he.Cancel=he.CanceledError,he.all=function(t){return Promise.all(t)},he.spread=lA,he.isAxiosError=uA,he.mergeConfig=ut,he.AxiosHeaders=Qe,he.formToJSON=e=>io(I.isHTMLForm(e)?new FormData(e):e),he.getAdapter=co.getAdapter,he.HttpStatusCode=cA,he.default=he;const mA=he;/*! typescript-cookie v1.0.6 | MIT */const qo=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),yo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Nn=decodeURIComponent,Rn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function dA(e){return e=Object.assign({},e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires!=null&&(e.expires=e.expires.toUTCString()),Object.entries(e).filter(([t,n])=>n!=null&&n!==!1).map(([t,n])=>n===!0?`; ${t}`:`; ${t}=${n.split(";")[0]}`).join("")}function vo(e,t,n){const r=/(?:^|; )([^=]*)=([^;]*)/g,o={};let i;for(;(i=r.exec(document.cookie))!=null;)try{const a=n(i[1]);if(o[a]=t(i[2],a),e===a)break}catch{}return e!=null?o[e]:o}const bo=Object.freeze({decodeName:Nn,decodeValue:Rn,encodeName:qo,encodeValue:yo}),Dn=Object.freeze({path:"/"});function Co(e,t,n=Dn,{encodeValue:r=yo,encodeName:o=qo}={}){return document.cookie=`${o(e)}=${r(t,e)}${dA(n)}`}function Zo(e,{decodeValue:t=Rn,decodeName:n=Nn}={}){return vo(e,t,n)}function pA({decodeValue:e=Rn,decodeName:t=Nn}={}){return vo(void 0,e,t)}function fA(e,t=Dn){Co(e,"",Object.assign({},t,{expires:-1}))}function Gn(e,t){const n={set:function(o,i,a){return Co(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return pA(this.converter.read);if(o!=null)return Zo(o,this.converter.read)},remove:function(o,i){fA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Gn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Gn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Gn({read:bo.decodeValue,write:bo.encodeValue},Dn);let Io;typeof window<"u"&&(Io=Zo("token"));const ge=mA.create({headers:{Authorization:Io}});async function hA(e,t,n){return(await ge.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function gA(e,t){return e.network=="fb"&&(e.zip=1),(await ge.post(t+"/createFlexVersionLink",e||{})).data}async function qA(e,t,n){return(await ge.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function yA(e,t,n,r,o){return(await ge.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function vA(e,t,n){return(await ge.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function bA(e,t,n,r,o){return(await ge.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function CA(e,t,n){return(await ge.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function ZA(e,t,n,r,o,i){return(await ge.post(e+"/createFusionVersionLink",{_id:t,network:n,fusionData:r,isPfTest:o,extras:i})).data}async function IA(e,t){return(await ge.post(t+"/getCdnExportName",e||{})).data}async function xA(e,t){return(await ge.post(t+"/updateFlexUrl",e||{})).data}async function xo(e,t,n){return(await ge.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Wt(e){const t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select();try{return document.execCommand("copy")?(document.body.removeChild(t),!0):(document.body.removeChild(t),!1)}catch{return document.body.removeChild(t),!1}}function wo(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=wo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function _e(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=wo(e))&&(r&&(r+=" "),r+=t);return r}const St=e=>typeof e=="number"&&!isNaN(e),tt=e=>typeof e=="string",Ie=e=>typeof e=="function",en=e=>tt(e)||Ie(e)?e:null,Tn=e=>b.isValidElement(e)||tt(e)||Ie(e)||St(e);function wA(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function tn(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:m,preventExitTransition:c,done:l,nodeRef:d,isIn:y}=a;const g=r?`${t}--${m}`:t,h=r?`${n}--${m}`:n,f=b.useRef(0);return b.useLayoutEffect(()=>{const v=d.current,W=g.split(" "),k=z=>{z.target===d.current&&(v.dispatchEvent(new Event("d")),v.removeEventListener("animationend",k),v.removeEventListener("animationcancel",k),f.current===0&&z.type!=="animationcancel"&&v.classList.remove(...W))};v.classList.add(...W),v.addEventListener("animationend",k),v.addEventListener("animationcancel",k)},[]),b.useEffect(()=>{const v=d.current,W=()=>{v.removeEventListener("animationend",W),o?wA(v,l,i):l()};y||(c?W():(f.current=1,v.className+=` ${h}`,v.addEventListener("animationend",W)))},[y]),b.createElement(b.Fragment,null,A)}}function Ko(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Le={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter(r=>r!==t);return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const n=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)})}},nn=e=>{let{theme:t,type:n,...r}=e;return b.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Hn={info:function(e){return b.createElement(nn,{...e},b.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(e){return b.createElement(nn,{...e},b.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(e){return b.createElement(nn,{...e},b.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(e){return b.createElement(nn,{...e},b.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 b.createElement("div",{className:"Toastify__spinner"})}};function KA(e){const[,t]=b.useReducer(g=>g+1,0),[n,r]=b.useState([]),o=b.useRef(null),i=b.useRef(new Map).current,a=g=>n.indexOf(g)!==-1,A=b.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:g=>i.get(g)}).current;function m(g){let{containerId:h}=g;const{limit:f}=A.props;!f||h&&A.containerId!==h||(A.count-=A.queue.length,A.queue=[])}function c(g){r(h=>g==null?[]:h.filter(f=>f!==g))}function l(){const{toastContent:g,toastProps:h,staleId:f}=A.queue.shift();y(g,h,f)}function d(g,h){let{delay:f,staleId:v,...W}=h;if(!Tn(g)||function(F){return!o.current||A.props.enableMultiContainer&&F.containerId!==A.props.containerId||i.has(F.toastId)&&F.updateId==null}(W))return;const{toastId:k,updateId:z,data:E}=W,{props:C}=A,P=()=>c(k),oe=z==null;oe&&A.count++;const V={...C,style:C.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(W).filter(F=>{let[_,M]=F;return M!=null})),toastId:k,updateId:z,data:E,closeToast:P,isIn:!1,className:en(W.className||C.toastClassName),bodyClassName:en(W.bodyClassName||C.bodyClassName),progressClassName:en(W.progressClassName||C.progressClassName),autoClose:!W.isLoading&&(me=W.autoClose,ne=C.autoClose,me===!1||St(me)&&me>0?me:ne),deleteToast(){const F=Ko(i.get(k),"removed");i.delete(k),Le.emit(4,F);const _=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),_>0){const M=k==null?A.props.limit:1;if(_===1||M===1)A.displayedToast++,l();else{const S=M>_?_:M;A.displayedToast=S;for(let N=0;N<S;N++)l()}}else t()}};var me,ne;V.iconOut=function(F){let{theme:_,type:M,isLoading:S,icon:N}=F,p=null;const O={theme:_,type:M};return N===!1||(Ie(N)?p=N(O):b.isValidElement(N)?p=b.cloneElement(N,O):tt(N)||St(N)?p=N:S?p=Hn.spinner():(B=>B in Hn)(M)&&(p=Hn[M](O))),p}(V),Ie(W.onOpen)&&(V.onOpen=W.onOpen),Ie(W.onClose)&&(V.onClose=W.onClose),V.closeButton=C.closeButton,W.closeButton===!1||Tn(W.closeButton)?V.closeButton=W.closeButton:W.closeButton===!0&&(V.closeButton=!Tn(C.closeButton)||C.closeButton);let ue=g;b.isValidElement(g)&&!tt(g.type)?ue=b.cloneElement(g,{closeToast:P,toastProps:V,data:E}):Ie(g)&&(ue=g({closeToast:P,toastProps:V,data:E})),C.limit&&C.limit>0&&A.count>C.limit&&oe?A.queue.push({toastContent:ue,toastProps:V,staleId:v}):St(f)?setTimeout(()=>{y(ue,V,v)},f):y(ue,V,v)}function y(g,h,f){const{toastId:v}=h;f&&i.delete(f);const W={content:g,props:h};i.set(v,W),r(k=>[...k,v].filter(z=>z!==f)),Le.emit(4,Ko(W,W.props.updateId==null?"added":"updated"))}return b.useEffect(()=>(A.containerId=e.containerId,Le.cancelEmit(3).on(0,d).on(1,g=>o.current&&c(g)).on(5,m).emit(2,A),()=>{i.clear(),Le.emit(3,A)}),[]),b.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(g){const h=new Map,f=Array.from(i.values());return e.newestOnTop&&f.reverse(),f.forEach(v=>{const{position:W}=v.props;h.has(W)||h.set(W,[]),h.get(W).push(v)}),Array.from(h,v=>g(v[0],v[1]))},containerRef:o,isToastActive:a}}function Wo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function So(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function WA(e){const[t,n]=b.useState(!1),[r,o]=b.useState(!1),i=b.useRef(null),a=b.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=b.useRef(e),{autoClose:m,pauseOnHover:c,closeToast:l,onClick:d,closeOnClick:y}=e;function g(E){if(e.draggable){E.nativeEvent.type==="touchstart"&&E.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",W),document.addEventListener("mouseup",k),document.addEventListener("touchmove",W),document.addEventListener("touchend",k);const C=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=C.getBoundingClientRect(),C.style.transition="",a.x=Wo(E.nativeEvent),a.y=So(E.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function h(E){if(a.boundingRect){const{top:C,bottom:P,left:oe,right:V}=a.boundingRect;E.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=oe&&a.x<=V&&a.y>=C&&a.y<=P?v():f()}}function f(){n(!0)}function v(){n(!1)}function W(E){const C=i.current;a.canDrag&&C&&(a.didMove=!0,t&&v(),a.x=Wo(E),a.y=So(E),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),C.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,C.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",W),document.removeEventListener("touchend",k);const E=i.current;if(a.canDrag&&a.didMove&&E){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();E.style.transition="transform 0.2s, opacity 0.2s",E.style.transform=`translate${e.draggableDirection}(0)`,E.style.opacity="1"}}b.useEffect(()=>{A.current=e}),b.useEffect(()=>(i.current&&i.current.addEventListener("d",f,{once:!0}),Ie(e.onOpen)&&e.onOpen(b.isValidElement(e.children)&&e.children.props),()=>{const E=A.current;Ie(E.onClose)&&E.onClose(b.isValidElement(E.children)&&E.children.props)}),[]),b.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||v(),window.addEventListener("focus",f),window.addEventListener("blur",v)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",f),window.removeEventListener("blur",v))}),[e.pauseOnFocusLoss]);const z={onMouseDown:g,onTouchStart:g,onMouseUp:h,onTouchEnd:h};return m&&c&&(z.onMouseEnter=v,z.onMouseLeave=f),y&&(z.onClick=E=>{d&&d(E),a.canCloseOnClick&&l()}),{playToast:f,pauseToast:v,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:z}}function Mo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return b.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},b.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},b.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 SA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:m,progress:c,rtl:l,isIn:d,theme:y}=e;const g=i||m&&c===0,h={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:g?0:1};m&&(h.transform=`scaleX(${c})`);const f=_e("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${y}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":l}),v=Ie(a)?a({rtl:l,type:o,defaultClassName:f}):_e(f,a);return b.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:v,style:h,[m&&c>=1?"onTransitionEnd":"onAnimationEnd"]:m&&c<1?null:()=>{d&&r()}})}const MA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=WA(e),{closeButton:i,children:a,autoClose:A,onClick:m,type:c,hideProgressBar:l,closeToast:d,transition:y,position:g,className:h,style:f,bodyClassName:v,bodyStyle:W,progressClassName:k,progressStyle:z,updateId:E,role:C,progress:P,rtl:oe,toastId:V,deleteToast:me,isIn:ne,isLoading:ue,iconOut:F,closeOnClick:_,theme:M}=e,S=_e("Toastify__toast",`Toastify__toast-theme--${M}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":oe},{"Toastify__toast--close-on-click":_}),N=Ie(h)?h({rtl:oe,position:g,type:c,defaultClassName:S}):_e(S,h),p=!!P||!A,O={closeToast:d,type:c,theme:M};let B=null;return i===!1||(B=Ie(i)?i(O):b.isValidElement(i)?b.cloneElement(i,O):Mo(O)),b.createElement(y,{isIn:ne,done:me,position:g,preventExitTransition:n,nodeRef:r},b.createElement("div",{id:V,onClick:m,className:N,...o,style:f,ref:r},b.createElement("div",{...ne&&{role:C},className:Ie(v)?v({type:c}):_e("Toastify__toast-body",v),style:W},F!=null&&b.createElement("div",{className:_e("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!ue})},F),b.createElement("div",null,a)),B,b.createElement(SA,{...E&&!p?{key:`pb-${E}`}:{},rtl:oe,theme:M,delay:A,isRunning:t,isIn:ne,closeToast:d,hide:l,type:c,style:z,className:k,controlledProgress:p,progress:P||0})))},rn=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},LA=tn(rn("bounce",!0));tn(rn("slide",!0)),tn(rn("zoom")),tn(rn("flip"));const Xn=b.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=KA(e),{className:i,style:a,rtl:A,containerId:m}=e;function c(l){const d=_e("Toastify__toast-container",`Toastify__toast-container--${l}`,{"Toastify__toast-container--rtl":A});return Ie(i)?i({position:l,rtl:A,defaultClassName:d}):_e(d,en(i))}return b.useEffect(()=>{t&&(t.current=r.current)},[]),b.createElement("div",{ref:r,className:"Toastify",id:m},n((l,d)=>{const y=d.length?{...a}:{...a,pointerEvents:"none"};return b.createElement("div",{className:c(l),style:y,key:`container-${l}`},d.map((g,h)=>{let{content:f,props:v}=g;return b.createElement(MA,{...v,isIn:o(v.toastId),style:{...v.style,"--nth":h+1,"--len":d.length},key:`toast-${v.key}`},f)}))}))});Xn.displayName="ToastContainer",Xn.defaultProps={position:"top-right",transition:LA,autoClose:5e3,closeButton:Mo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Qn,nt=new Map,Mt=[],EA=1;function Lo(){return""+EA++}function OA(e){return e&&(tt(e.toastId)||St(e.toastId))?e.toastId:Lo()}function Lt(e,t){return nt.size>0?Le.emit(0,e,t):Mt.push({content:e,options:t}),t.toastId}function on(e,t){return{...t,type:t&&t.type||e,toastId:OA(t)}}function an(e){return(t,n)=>Lt(t,on(e,n))}function de(e,t){return Lt(e,on("default",t))}de.loading=(e,t)=>Lt(e,on("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),de.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=tt(o)?de.loading(o,n):de.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},m=(l,d,y)=>{if(d==null)return void de.dismiss(r);const g={type:l,...A,...n,data:y},h=tt(d)?{render:d}:d;return r?de.update(r,{...g,...h}):de(h.render,{...g,...h}),y},c=Ie(e)?e():e;return c.then(l=>m("success",a,l)).catch(l=>m("error",i,l)),c},de.success=an("success"),de.info=an("info"),de.error=an("error"),de.warning=an("warning"),de.warn=de.warning,de.dark=(e,t)=>Lt(e,on("default",{theme:"dark",...t})),de.dismiss=e=>{nt.size>0?Le.emit(1,e):Mt=Mt.filter(t=>e!=null&&t.options.toastId!==e)},de.clearWaitingQueue=function(e){return e===void 0&&(e={}),Le.emit(5,e)},de.isActive=e=>{let t=!1;return nt.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},de.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=nt.get(i||Qn);return a&&a.getToast(r)}(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:Lo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,Lt(a,i)}},0)},de.done=e=>{de.update(e,{progress:1})},de.onChange=e=>(Le.on(4,e),()=>{Le.off(4,e)}),de.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"},de.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Le.on(2,e=>{Qn=e.containerId||e,nt.set(Qn,e),Mt.forEach(t=>{Le.emit(0,t.content,t.options)}),Mt=[]}).on(3,e=>{nt.delete(e.containerId||e),nt.size===0&&Le.off(0).off(1).off(5)});function ct(e){de.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Pn="",je="Playable",we=null,Eo=null,Oo;const Vn=async(e,t,n)=>{je==="Playable"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await xo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},we):je==="Flex"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await xA({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},we):je==="Ready"&&t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(t.googleUrl=t.iosUrl),await xo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},we))},An=async e=>{let t=Pn+"/"+e,n=e;fetch(t).then(r=>r.blob()).then(r=>{const o=window.URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=n.split("/").reduce((a,A)=>A,""),document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(o),ct("Download successfully")}).catch(r=>{console.error("File error:",r)})},kA=(e,t)=>{let n=Pn+"/"+e;Wt(n)?ct("Link Copied"):t(n)};async function Et(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let m=async c=>{r==="download"?await An(c):r==="copy"&&kA(c,Eo)};try{await Vn(e,n,i)}catch(c){console.log("updateUrls error",c)}je==="Playable"?yA(we,e,t,o,i).then(async c=>{let{url:l}=c;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Flex"?gA({_id:e,network:t,extras:i},we).then(async c=>{if(c.message){A(c);return}let{url:l}=c;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Import"?qA(we,e,t).then(async c=>{let l=c.url;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Ready"?bA(we,e,t,o,i).then(async c=>{if(c.message){A(c);return}let l=c.url;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})}):je==="Fusion"&&ZA(we,e,t,Oo,o,i).then(async c=>{let l=c.url;await m(l),a(c)}).catch(c=>{let l=c.response.data.error.msg;A({message:l})})})}async function jA(e,t,n,r=null){return new Promise(async(o,i)=>{await Vn(e,t,r),je==="Flex"?hA(e,n,we).then(async a=>{if(a.message){i(a);return}await An(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})}):je==="Ready"?CA(e,n,we).then(async a=>{if(a.message){i(a);return}await An(a.url),o(a.url)}).catch(a=>{console.log("err",a);let A=a.response.data.error.msg;i({message:A})}):vA(e,n,we).then(async a=>{await An(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})})})}function zA(e,t,n,r,o){je=e,we=t,Eo=n,Pn=r,Oo=o}async function YA(e){return await IA({versionId:e,checkExistance:!0},we)}async function Bn(e,t){return(await ge.post(t+"/findPlayable",{_id:e})).data}const JA=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:o,setSafariCopyLink:i,qrUrl:a,iosLink:A,androidLink:m,urlType:c})=>{const[l,d]=b.useState(!1),y=async()=>{d(!0),Et(e,"default",{iosUrl:A,googleUrl:m},null,!1,{urlType:c}).then(async g=>{var W,k,z,E;let h="";if(t&&(n==="Playable"||n==="Ready")){const C=await Bn(t,r);console.log(C);const P=(k=(W=C==null?void 0:C.data)==null?void 0:W.globalProps)==null?void 0:k.defaultLandscape,oe=(E=(z=C==null?void 0:C.data)==null?void 0:z.globalProps)==null?void 0:E.defaultPhoneIndex;console.log(P,oe),P&&(h+="&landscape=true"),oe!==void 0&&(h+=`&phoneIndex=${oe}`)}Bn(t,r),d(!1);let f;n==="Flex"?f=`${o}/preview?versionId=${e}`:n==="Import"?f=`${o}/preview?versionId=${e}_`:n==="Ready"?f=`${o}/preview?versionId=${e}_&ready=true`:f=`${o}/preview?versionId=${e}_`,f+=h,Wt(f)?ct("Link copied"):i(f),d(!1)}).catch(g=>{d(!1)})};return s.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[s.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:a?s.jsx($i,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):s.jsx("img",{style:{width:"50px",height:"50px"},src:Xe,alt:"pf-logo-gif"})}),s.jsxs("div",{children:[s.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),s.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{l||y()},children:[s.jsx(Nr,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),s.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:l?s.jsx("img",{style:{height:"90%"},src:Xe,alt:"loading"}):s.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},NA=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:o,iframeUrl:i,fetchFileUrl:a,copyLinkUrl:A,setSafariCopyLink:m,iosLink:c,androidLink:l,urlType:d})=>{const[y,g]=b.useState(window.innerWidth);console.log("iosLink",c),b.useEffect(()=>{console.log("re add event listener");function f(v){console.log(v),v.data==="cta"&&(console.log("Received 'cta' message from iframe"),c&&window.open(c,"_blank"))}return window.addEventListener("message",f,!1),()=>{window.removeEventListener("message",f)}},[c,l]),b.useEffect(()=>{const f=()=>{g(window.innerWidth)};return window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[]);const h=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return s.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:y>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[s.jsx(gi,{iframeUrl:i}),s.jsx(qi,{name:h}),s.jsx(JA,{versionId:t,playableId:n,typeOfProduct:r,api:o,copyLinkUrl:A,setSafariCopyLink:m,qrUrl:i,iosLink:c,androidLink:l,urlType:d})]})};var ye=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(ye||{});const ko=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=b.useState(e);b.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return s.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:s.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[s.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:i}),s.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:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:ye[t],stroke:ye[t],strokeWidth:"1",children:s.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"})})," "]})]})})},RA=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:[s.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[s.jsx("span",{style:{color:ye[e]},children:"Select Network"}),s.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]}),s.jsxs("div",{onClick:()=>{n(!t)},style:{marginLeft:"auto",marginRight:"2rem",display:"flex",height:"24px",alignItems:"center",justifyContent:"flex-end",fontSize:"0.875rem",width:110},children:[s.jsx(ko,{checked:t,typeOfProduct:e,id:"asd"}),s.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"16px",fontWeight:"bold"},children:"Select All"})]})]});async function DA(e,t){return(await ge.post(t+"/buyRequest",{requestType:e})).data}const GA=()=>s.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[s.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),s.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),s.jsx("defs",{children:s.jsx("clipPath",{id:"clip0_518_12094",children:s.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),TA=({creditDownload:e,api:t})=>s.jsxs(s.Fragment,{children:[s.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."}),s.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"," ",s.jsx("span",{style:{paddingLeft:"0.25rem",paddingRight:"0.25rem",fontWeight:"bold",color:"#yourColorHere"},children:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)<0?0:(e==null?void 0:e.downloadLimit)-(e==null?void 0:e.downloadLimitUsed)})," ","credits remaining.",s.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>DA("Flex Credit",t).then(n=>ct("You will be contacted regarding your request.")),children:["Get more",s.jsx(GA,{})]})]})]}),jo=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=A=>{n(A.target.value)},a=A=>{r(A.target.value)};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[s.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"App Store:"}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]}),s.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[s.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:["Google Play:"," "]}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},HA=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=a=>{n(a.target.value)};return s.jsx(s.Fragment,{children:s.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[s.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"100%",alignItems:"center",borderRadius:"0.375rem",border:t.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},XA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:m,isTest:c,setIsTest:l,urlType:d,setUrlType:y})=>{const g=()=>s.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[s.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),s.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"20px",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:ye[e]},type:"checkbox",checked:c,onChange:()=>{l(!c)},placeholder:"Google Url",disabled:i})]}),h=()=>s.jsx(s.Fragment,{children:s.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:[s.jsx("div",{style:{position:"absolute",bottom:"-3px",left:d==="single"?"50%":"0%",width:"50%",height:"3px",borderRadius:"2px",backgroundColor:"#12a9fe",transition:"all 0.2s ease-in-out"},id:"tab-switch-background"}),s.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(()=>{y("game")},200)},children:s.jsx("span",{style:{position:"relative",color:d==="game"?"#000":"#a3a3a3",fontWeight:d==="game"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"game-tab",children:"App"})},"gameTab"),s.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(()=>{y("single")},200)},children:s.jsx("span",{style:{position:"relative",color:d==="single"?"#000":"#a3a3a3",fontWeight:d==="single"?"bold":"normal",transition:"all 0.2s ease-in-out"},id:"single-tab",children:"Website"})},"singleTab")]})});return s.jsx(s.Fragment,{children:e!=="Import"&&s.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[m.customer=="playableFactoryInternal"&&e==="Playable"&&s.jsx(g,{}),e==="Ready"?s.jsxs(s.Fragment,{children:[s.jsx(h,{}),d==="game"&&s.jsx(jo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),d==="single"&&s.jsx(HA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):s.jsx(s.Fragment,{children:s.jsx(jo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&s.jsx(TA,{creditDownload:A,api:a})]})})},QA=({typeOfProduct:e,title:t,fileSize:n})=>s.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[s.jsx("span",{style:{color:ye[e]},children:t}),n&&s.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),PA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:l,setIsTest:d,urlType:y,setUrlType:g,allNetworksSelected:h,setAllNetworksSelected:f})=>s.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:[s.jsx(QA,{typeOfProduct:e,title:r,fileSize:t}),s.jsx(XA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:l,setIsTest:d,urlType:y,setUrlType:g}),s.jsx(RA,{typeOfProduct:e,allNetworksSelected:h,setAllNetworksSelected:f})]}),Un=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>s.jsx("button",{onClick:n,className:t,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||o,children:e}),Xl="",VA=({typeOfProduct:e})=>s.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:s.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}}),s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}}),s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}}),s.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:ye[e]}})]})}),Ot=({isNetworksLoading:e=!1})=>s.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:s.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Xe,alt:"pf-logo-gif"})}),Fn=({title:e,titleId:t,...n})=>s.jsxs("svg",{viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em","aria-labelledby":t,...n,children:[e?s.jsx("title",{id:t,children:e}):null,s.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"})]}),BA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i,typeOfProduct:a,urlType:A})=>{let m="";return a==="Ready"&&A==="single"?m="Redirection url is empty. Are you sure you want to continue?":!t&&!n?m="Both links are empty. Are you sure you want to continue?":t?n||(m="Google link is empty. Are you sure you want to continue?"):m="iOS link is empty. Are you sure you want to continue?",s.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:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),s.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:[s.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:m}),s.jsxs("div",{style:{display:"flex",gap:"5px"},children:[s.jsx("button",{onClick:()=>{e(!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:"No"}),s.jsx("button",{onClick:async c=>{r==="download"?await i():r==="copyLink"&&await o(),e()},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:"Yes"})]})]})]})},_n=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o,width:i="130%",height:a="120%"})=>s.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:a,width:i,alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),s.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:[s.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?"}),s.jsxs("div",{style:{display:"flex",gap:"5px"},children:[s.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),s.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 o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),UA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>s.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:e,children:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),s.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:a=>{a.stopPropagation()},children:s.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[s.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?s.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:s.jsx("img",{width:"25px",height:"25px",src:Xe,alt:"pf-logo-gif"})}):s.jsx("button",{onClick:()=>{t(!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"}),i?s.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:s.jsx("img",{width:"25px",height:"25px",src:Xe,alt:"pf-logo-gif"})}):s.jsx("button",{onClick:()=>{t(!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"})]}),s.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?s.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:s.jsx("img",{width:"25px",height:"25px",src:Xe,alt:"pf-logo-gif"})}):s.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 FA(e,t,n,r){return(await ge.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const _A=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:m,versionId:c,api:l,handleDownloadError:d,fetchFileUrl:y,urls:g,game:h,setIsConfirmActive:f,creditDownload:v,getDownloadCount:W,disabled:k,user:z,setSafariCopyLink:E,isTest:C,urlType:P,setCdnModal:oe,generateCDN:V,cdnUrl:me})=>{const[ne,ue]=b.useState(!1),[F,_]=b.useState(""),[M,S]=b.useState(!1),[N,p]=b.useState(!1),[O,B]=b.useState(!1),[q,x]=b.useState("download"),[R,j]=b.useState(!1),[Y,T]=b.useState(!1),[D,G]=b.useState(!1);let H={aarki:"html,copy",adcolony:"copy,html",adjoe:"copy,html",applovin:"copy,html",appreciate:"zip",chartboost:"copy,html",criteo:"zip",crossinstall:"copy,html",default:"copy",fb:"zip",fyber:"copy,html",google:"zip",google360:"zip",ironsource:"copy,html",kayzen:"apikey",kaden:"html",kidoz:"html",lifestreet:"copy,html",liftoff:"copy,zip",mobvista:"html",moloco:"html,molocotest",molocoV2:"html,molocotest",nucleo:"copy,html",oceanengine:"copy,zip",pointblank:"html",smadex:"zip",snapchat:"zip",tapjoy:"copy,html",tencent:"zip",toutiao:"copy,zip",toutiao_cn:"copy,zip",unity:"copy,html",vungle:"html",web:"copy,html",yandex:"zip",zucks:"copy,html",luna:"zip",inmobi:"copy,html,",nend:"html",adikteev:"html",jammp:"copy,html",mraid:"copy,html"};const U=()=>{n(e)},Z=async(ae,ee)=>{const pe={molocoGenerateHtml:!1,urlType:P};if($&&(ee==="copy"?(T(!0),ee="download",pe.molocoGenerateHtml=!0):j(!0)),console.log("getVersion",ae,ee,pe),ae==="cdn"){oe(!0),await V(!0);return}return ue(!0),new Promise((ht,gt)=>{Et(c,ae,g,ee,C,pe).then(Ee=>{ue(!1),ht(Ee),T(!1),j(!1)}).catch(Ee=>{ue(!1),d(Ee.message,Ee),gt(Ee),T(!1),j(!1)})})},J=async(ae=!1)=>{ae?T(!0):j(!0);const ee={molocoGenerateHtml:!1};ae&&(ee.molocoGenerateHtml=!0),Et(c,o,g,"download",C,ee).then(pe=>{ae?T(!1):j(!1),B(!1)}).catch(pe=>{d(pe.message,pe)})},K=async()=>{G(!0);const ae=await FA(l,c,o,m);let ee=`${y}/${ae==null?void 0:ae.url}`;Wt(ee)?(ct("Link Copied"),G(!1)):E(ee)},$=o==="moloco"||o==="molocoV2";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?ye[m]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"8px",cursor:"pointer"},className:"border-hover-"+m,onClick:U,children:[s.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[s.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:s.jsx("div",{children:i&&i.map(ae=>ae.network).includes(o)?a?s.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:s.jsx(VA,{typeOfProduct:m})}):i.map(ae=>s.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===o?ae.size.toString().slice(0,5)+"Mb":""},ae.network)):null})}),s.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(m==="Playable"||m==="Ready"||m==="Flex")&&A&&s.jsx(ko,{checked:r,typeOfProduct:m,id:e})}),s.jsx("img",{onClick:U,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[s.jsx(Un,{className:`${$?"w-1/2":"w-2/3"} border-hover-`+m,downloading:ne,onClickDonwload:async ae=>{if(ae.stopPropagation(),$&&z.customer==="playableFactoryInternal"){B(!0);return}else{_("download");const ee=g.iosUrl,pe=g.googleUrl;o==="cdn"&&v&&v.willSpendCredit&&!me||o!=="cdn"&&v&&v.willSpendCredit?(f(!0),x("download"),S(!0)):["Playable","Flex"].includes(m)&&(!ee||!pe)||m==="Ready"&&P==="single"&&!ee||m==="Ready"&&P==="multi"&&(!ee||!pe)?(f(!0),p(!0)):(p(!1),S(!1),await Z(o,"download"))}},children:$?s.jsxs(s.Fragment,{children:[!R&&s.jsxs(s.Fragment,{children:[s.jsx(Fn,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),z.customer!=="playableFactoryInternal"?"TXT":"Download"]}),R&&s.jsx(Ot,{})]}):s.jsxs(s.Fragment,{children:[!ne&&s.jsxs(s.Fragment,{children:[s.jsx(Fn,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),o==="cdn"?"Generate Link":"Download"]}),ne&&s.jsx(Ot,{})]})}),H[o]&&H[o].includes("copy")&&s.jsx(Un,{className:"w-1/3 border-hover-"+m,onClickDonwload:async ae=>{ae.stopPropagation(),_("copyLink");const ee=g.iosUrl,pe=g.googleUrl;v&&(v!=null&&v.willSpendCredit)?(x("copy"),f(!0),S(!0)):m!=="Import"&&(!ee||!pe)?(f(!0),p(!0)):(S(!1),p(!1),await Z(o,"copy"))},disabled:k,children:s.jsx(Nr,{className:"h-6 w-6 stroke-dark-full"})}),$&&z.customer!=="playableFactoryInternal"&&s.jsxs(Un,{className:"w-1/2 border-hover-"+m,onClickDonwload:async ae=>{ae.stopPropagation(),_("copyLink");const ee=g.iosUrl,pe=g.googleUrl;v&&(v!=null&&v.willSpendCredit)?(x("download"),f(!0),S(!0)):m!=="Import"&&(!ee||!pe)?(f(!0),p(!0)):(S(!1),p(!1),await J(!0))},disabled:k,children:[!Y&&s.jsxs(s.Fragment,{children:[s.jsx(Fn,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]}),Y&&s.jsx(Ot,{})]})]}),$&&s.jsx("img",{style:{position:"absolute",width:"135px",right:"0",top:"18px"},src:"https://home.playablefactory.app/recommended_badge.png"})]}),M&&s.jsx(_n,{creditConfirmType:q,handleCopyLink:async()=>{p(!1),f(!1),await Z(o,"copy")},download:async()=>{p(!1),f(!1),await Z(o,"download")},onClose:()=>{S(!1),f(!1)},getDownloadCount:W}),N&&s.jsx(BA,{onClose:()=>{p(!1),f(!1)},iosLink:g.iosUrl,googleLink:g.googleUrl,buttonType:F,handleCopyLink:async()=>{p(!1),f(!1),await Z(o,"copy")},download:async()=>{p(!1),f(!1),await Z(o,"download")},typeOfProduct:m,urlType:P}),O&&z.customer==="playableFactoryInternal"&&s.jsx(UA,{onClose:()=>{B(!1)},handleDownload:J,handleDownloadMolocoTest:K,downloadingMoloco:R,donwloadintMolocoTest:D,downloadingMolocoHtml:Y})]})},sn=[{id:"22",name:"moloco",imageSrc:"https://home.playablefactory.com/moloco.png"},{id:"44",name:"molocoV2",imageSrc:"https://home.playablefactory.com/molocoV2.png"},{id:"33",name:"web",imageSrc:"https://home.playablefactory.com/files/network_icons/web.png"},{id:"1",name:"unity",imageSrc:"https://home.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://home.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://home.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://home.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://home.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://home.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://home.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://home.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://home.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://home.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://home.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://home.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://home.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://home.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://home.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://home.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://home.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://home.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://home.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://home.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://home.playablefactory.com/liftoff.png"},{id:"23",name:"nucleo",imageSrc:"https://home.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://home.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://home.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://home.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://home.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://home.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://home.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://home.playablefactory.com/yandex.png"},{id:"34",name:"zucks",imageSrc:"https://home.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://home.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://home.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://home.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://home.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://home.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://home.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://home.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://home.playablefactory.com/adjoe.png"},{id:"45",name:"adikteev",imageSrc:"https://home.playablefactory.com/adikteev.png"},{id:"46",name:"appier",imageSrc:"https://home.playablefactory.com/appier.png"},{id:"47",name:"remerge",imageSrc:"https://home.playablefactory.com/remerge.png"},{id:"48",name:"persona",imageSrc:"https://home.playablefactory.com/persona.png"},{id:"49",name:"bidease",imageSrc:"https://home.playablefactory.com/bidease.png"},{id:"50",name:"mraid",imageSrc:"https://home.playablefactory.com/mraid.png"},{id:"51",name:"zynga",imageSrc:"https://home.playablefactory.com/zynga.png"},{id:"52",name:"youappi",imageSrc:"https://home.playablefactory.com/youappi.png"},{id:"53",name:"cdn",imageSrc:"https://home.playablefactory.com/cdn.png"}],$A=({children:e,typeOfProduct:t,className:n,onClick:r})=>{const o={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"0.5rem",width:"12rem",height:"2.5rem",backgroundColor:ye[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return s.jsx("button",{onClick:r,className:n,style:o,children:e})},es=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?s.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:ye[t]},children:s.jsx(Ot,{})}):s.jsx($A,{typeOfProduct:t,onClick:n,children:s.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),ts=({title:e,titleId:t})=>s.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:[s.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"}),s.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"})]}),ns=({onClose:e,cdnUrl:t,generateCDN:n,cdnUploading:r})=>s.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:e,children:[s.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),s.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:o=>{o.stopPropagation()},children:s.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[s.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&&s.jsx("img",{width:"30px",src:Xe,alt:"pf-logo-gif"})]}),s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"#f6f6f6",height:"60px",color:"#737373"},children:[s.jsx("div",{style:{width:"66px",height:"100%",borderRight:"1px solid #e1e1e1",display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0},children:s.jsx(ts,{})}),s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",maxWidth:"68%"},children:s.jsx("a",{style:{textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},href:t,target:"_blank",children:t||"No CDN link generated"})}),s.jsx("button",{onClick:()=>{if(!t)return;Wt(t)&&ct("Link copied")},style:{cursor:"pointer",borderRadius:"0.375rem",backgroundColor:t?"darkorange":"lightgray",color:"white",transition:"all 0.15s ease-linear",width:"100px",height:"46px",marginRight:"10px",flexShrink:0},children:"Copy"})]})]})})]}),rs=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:m,urls:c,game:l,getDownloadCount:d,disabled:y,setSafariCopyLink:g,isTest:h,urlType:f,allNetworksSelected:v,setAllNetworksSelected:W,cdnModal:k,setCdnModal:z,cdnUrl:E,setCdnUrl:C})=>{const[P,oe]=b.useState([]),[V,me]=b.useState([]),[ne,ue]=b.useState(!1),[F,_]=b.useState(""),[M,S]=b.useState(!1),[N,p]=b.useState(!1),[O,B]=b.useState("download"),[q,x]=b.useState(!1),[R,j]=b.useState(!1),[Y,T]=b.useState(!1),D=async(Z=!1)=>{Z&&E||Y||(T(!0),Et(r,"cdn",c,null,!1,{}).then(J=>{C(J.url),T(!1)}).catch(J=>{A(J.message,J),T(!1)}))},G=async Z=>{const J=[...P];if(P.includes(Z)){const K=J.findIndex($=>$===Z);J.splice(K,1),oe(J)}else J.push(Z),oe([...P,Z]);sn.filter(K=>[...J].includes(K.id)).map(K=>K.name)},H=async()=>new Promise(async(Z,J)=>{const K=sn.filter($=>[...P].includes($.id)).map($=>$.name);S(!0),jA(r,c,K,{urlType:f}).then($=>{S(!1),Z($)}).catch($=>{console.log("get multi download err"),S(!1),A($.message,$),J($)})}),U=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(p(!0),B("download"),x(!0)):(x(!1),await H())};return b.useEffect(()=>{const Z=sn.filter(J=>{var K;return t&&((K=t==null?void 0:t.networks)==null?void 0:K.length)>0?t==null?void 0:t.networks.includes(J.name):o==="Import"?e==null?void 0:e.networks.filter($=>$.status==="paid").some($=>$.name===J.name):e==null?void 0:e.networks.includes(J.name)}).filter(J=>J.name==="voodoo"?a.customer==="customer:20":!0).map(J=>J.id);oe(v?Z:[])},[v]),s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{position:"relative",flex:1,overflowY:N?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:s.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&sn.filter(Z=>{var J;return t&&((J=t==null?void 0:t.networks)==null?void 0:J.length)>0?t==null?void 0:t.networks.includes(Z.name):o==="Import"?e==null?void 0:e.networks.filter(K=>K.status==="paid").some(K=>K.name===Z.name):e==null?void 0:e.networks.includes(Z.name)}).filter(Z=>Z.name==="voodoo"?a.customer==="customer:20":!0).map(Z=>{let J=Z.imageSrc;if(Z.name==="web"){let K="web_"+o.toLowerCase()+".png";J=J.replace("web.png",K)}return s.jsx(_A,{id:Z.id,name:Z.name,imageUrl:J,selected:P.includes(Z.id),handleCardClick:G,networkVersionSize:V,fileSizeLoading:ne,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:m,urls:c,game:l,creditDownload:t,setIsConfirmActive:p,getDownloadCount:d,disabled:y,user:a,setSafariCopyLink:g,isTest:h,urlType:f,setCdnModal:z,generateCDN:D,cdnUrl:E},Z.id)})})}),P.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&s.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:s.jsx(es,{onClickMultiDownload:U,networksVersionTotalSize:F,typeOfProduct:o,multiDownloading:M})}),k&&s.jsx(ns,{onClose:()=>{z(!1),d()},versionId:r,urls:c,handleDownloadError:A,cdnUrl:E,setCdnUrl:C,generateCDN:async()=>{if(!Y){if(a.customer==="playableFactoryInternal"){D();return}j(!0)}},cdnUploading:Y}),R&&s.jsx(_n,{width:"100%",height:"100%",creditConfirmType:O,handleCopyLink:async()=>{},download:async()=>{x(!1),j(!1),D()},onClose:()=>{x(!1),j(!1),T(!1)},getDownloadCount:d}),q&&s.jsx(_n,{creditConfirmType:O,handleCopyLink:async()=>{},download:async()=>{x(!1),p(!1),await H()},onClose:()=>{x(!1),p(!1)},getDownloadCount:d})]})};async function os(e,t){return(await ge.post(t+"/getFlexDownloadCount",e)).data}async function is(e,t){try{return(await ge.post(t+"/findGame",{_id:e})).data}catch{}}async function as(e,t){return(await ge.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function As(e,t){return(await ge.post(t+"/getFlexData",{_id:e})).data}async function ss(e,t){return(await ge.post(t+"/getImportedPlayable",{id:e})).data}async function ls(e,t){return(await ge.post(t+"/getReadyDownloadCount",e)).data}const us=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],zo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco","cdn"];let Yo=null;const cs=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:m,fetchFileUrl:c,fileSize:l,setFileSize:d,setSafariCopyLink:y,iosLink:g,androidLink:h,setIosLink:f,setAndroidLink:v,urlType:W,setUrlType:k})=>{const[z,E]=b.useState(null),[C,P]=b.useState(null),[oe,V]=b.useState(null),[me,ne]=b.useState(!1),[ue,F]=b.useState(!0),[_,M]=b.useState(window.innerWidth),[S,N]=b.useState(!1),[p,O]=b.useState(!1),[B,q]=b.useState("");b.useEffect(()=>{B||YA(t).then(Z=>{Z.exist&&q(Z.uploadPath)})},[B]),console.log("download modal version: 6.0.37");const[x,R]=b.useState(!1);b.useEffect(()=>{},[x]),b.useEffect(()=>{const Z=()=>{M(window.innerWidth)};return window.addEventListener("resize",Z),()=>{window.removeEventListener("resize",Z)}},[]);const j=async()=>{ne(!0);const Z=await Bn(e,i);return Z!=null&&Z.networks||(Z.networks=us),E(Z),Z},Y=(Z,J)=>{clearTimeout(Yo),Yo=setTimeout(()=>{console.log("Update URLS:"),Vn(t,{iosUrl:Z,googleUrl:J},{urlType:W})},1e3)},T=Z=>{f(Z),Y(Z,h)},D=Z=>{v(Z),Y(g,Z)},G=async(Z,J)=>{var K,$;console.log("getIosAndAndroidLink");try{let ae;if(r==="Playable"||r==="Ready"){const ee=await as(t,i);if(ee){console.log("version",ee),f(ee.iosLink),v(ee.androidLink),ne(!1);return}if(Z&&(Z.iosUrl||Z.googleUrl)){f(Z.iosUrl),v(Z.googleUrl),ne(!1);return}if(J&&J.html){let pe=await fetch(c+"/"+J.html).then(Ee=>Ee.text());const ht=((K=pe.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:K.at(1))||"";f(ht);const gt=(($=pe.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:$.at(1))||"";v(gt),ne(!1)}else v(""),f(""),ne(!1)}else if(r==="Flex"){const ee=await As(t,i);if(ee.googleUrl||ee.iosUrl){v(ee.googleUrl),f(ee.iosUrl),ne(!1);return}Z&&(Z.iosUrl||Z.googleUrl)?(f(Z.iosUrl),v(Z.googleUrl),ne(!1)):(v(""),f(""),ne(!1))}}catch(ae){m(ae.response.data.error.msg)}},H=async()=>{ne(!0);let Z;r==="Flex"?Z=await os({_id:t},i):r==="Ready"&&(Z=await ls({_id:t},i)),Z&&(["admin","pm","tester","sales"].includes(a.role)?V({...Z,networks:zo}):r==="Ready"&&!Z.canDownload?V({...Z,networks:zo}):V(Z)),ne(!1)},U=async()=>await is(n,i);return b.useEffect(()=>{o||(E(null),P(null),V(null),d(null)),o&&(r==="Playable"?(j().then(Z=>{G(null,Z)}),F(!1)):r==="Ready"?H().then(Z=>{j().then(J=>{G(null,J),F(!1)})}):r==="Flex"?H().then(Z=>{F(!1),U().then(J=>{o&&(G(J,null),F(!1),P(J))})}):r==="Import"&&ss(t,i).then(Z=>{console.log(Z),E(Z),f(Z.iosUrl||""),v(Z.googleUrl||""),ne(!1),F(!1)}))},[n,e,t,o]),s.jsxs("div",{style:{display:"flex",height:_>1440?"700px":"650px",width:_>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[s.jsx(PA,{title:A,typeOfProduct:r,fileSize:l,urls:{iosUrl:g,googleUrl:h},handleIosChange:T,handleGoogleChange:D,disabled:ue,api:i,creditDownload:oe,user:a,isTest:S,setIsTest:N,urlType:W,setUrlType:k,allNetworksSelected:x,setAllNetworksSelected:R}),me?s.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:s.jsx(Ot,{isNetworksLoading:!0})}):(z||oe)&&(r==="Flex"?C:!0)&&!me&&g!=="Loading..."&&h!=="Loading..."&&s.jsx(rs,{playable:z,creditDownload:oe,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:m,fetchFileUrl:c,urls:{iosUrl:g,googleUrl:h},game:C,getDownloadCount:H,disabled:ue,setSafariCopyLink:y,isTest:S,urlType:W,allNetworksSelected:x,setAllNetworksSelected:R,cdnModal:p,setCdnModal:O,cdnUrl:B,setCdnUrl:q})]})},Ql="";var $n={exports:{}},rt={},er={exports:{}},ze={},tr={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;/*!
51
51
  * Adapted from jQuery UI core
52
52
  *
53
53
  * http://jqueryui.com