gearboxdownloadmodal 6.0.21 → 6.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +3 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +57 -57
package/dist/index.umd.js
CHANGED
|
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(Z),null," "));var W=R(N,T,z,V,x+"."+T,
|
|
|
47
47
|
`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Qa[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},no=Symbol("internals");function bt(e){return e&&String(e).trim().toLowerCase()}function Tt(e){return e===!1||e==null?e:b.isArray(e)?e.map(Tt):String(e)}function Va(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 Ba=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wn(e,t,n,r,o){if(b.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!b.isString(t)){if(b.isString(r))return t.indexOf(r)!==-1;if(b.isRegExp(r))return r.test(t)}}function Ua(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Fa(e,t){const n=b.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 Ht{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(A,m,c){const s=bt(m);if(!s)throw new Error("header name must be a non-empty string");const d=b.findKey(o,s);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||m]=Tt(A))}const a=(A,m)=>b.forEach(A,(c,s)=>i(c,s,m));return b.isPlainObject(t)||t instanceof this.constructor?a(t,n):b.isString(t)&&(t=t.trim())&&!Ba(t)?a(Pa(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=bt(t),t){const r=b.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Va(o);if(b.isFunction(n))return n.call(this,o,r);if(b.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=bt(t),t){const r=b.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Wn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(a){if(a=bt(a),a){const A=b.findKey(r,a);A&&(!n||Wn(r,r[A],A,n))&&(delete r[A],o=!0)}}return b.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||Wn(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return b.forEach(this,(o,i)=>{const a=b.findKey(r,i);if(a){n[a]=Tt(o),delete n[i];return}const A=t?Ua(i):String(i).trim();A!==i&&delete n[i],n[A]=Tt(o),r[A]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return b.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&b.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[no]=this[no]={accessors:{}}).accessors,o=this.prototype;function i(a){const A=bt(a);r[A]||(Fa(o,a),r[A]=!0)}return b.isArray(t)?t.forEach(i):i(t),this}}Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),b.reduceDescriptors(Ht.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),b.freezeMethods(Ht);const Te=Ht;function Sn(e,t){const n=this||Kn,r=t||n,o=Te.from(r.headers);let i=r.data;return b.forEach(e,function(A){i=A.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ro(e){return!!(e&&e.__CANCEL__)}function Ct(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}b.inherits(Ct,ne,{__CANCEL__:!0});function _a(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const $a=Ne.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,a,A){const m=[];m.push(n+"="+encodeURIComponent(r)),b.isNumber(o)&&m.push("expires="+new Date(o).toGMTString()),b.isString(i)&&m.push("path="+i),b.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 eA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tA(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function oo(e,t){return e&&!eA(t)?tA(e,t):t}const nA=Ne.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=b.isString(a)?o(a):a;return A.protocol===r.protocol&&A.host===r.host}}():function(){return function(){return!0}}();function rA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function oA(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(),s=r[i];a||(a=c),n[o]=m,r[o]=c;let d=i,g=0;for(;d!==o;)g+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const q=s&&c-s;return q?Math.round(g*1e3/q):void 0}}function io(e,t){let n=0;const r=oA(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 s={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};s[t?"download":"upload"]=!0,e(s)}}const Mn={http:Ea,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let o=e.data;const i=Te.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;b.isFormData(o)&&(Ne.isStandardBrowserEnv||Ne.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?b.isString(c=i.getContentType())&&i.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let s=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+h))}const d=oo(e.baseURL,e.url);s.open(e.method.toUpperCase(),_r(d,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function g(){if(!s)return;const p=Te.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),y={data:!a||a==="text"||a==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:p,config:e,request:s};_a(function(O){n(O),m()},function(O){r(O),m()},y),s=null}if("onloadend"in s?s.onloadend=g:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(g)},s.onabort=function(){s&&(r(new ne("Request aborted",ne.ECONNABORTED,e,s)),s=null)},s.onerror=function(){r(new ne("Network Error",ne.ERR_NETWORK,e,s)),s=null},s.ontimeout=function(){let h=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const y=e.transitional||eo;e.timeoutErrorMessage&&(h=e.timeoutErrorMessage),r(new ne(h,y.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,s)),s=null},Ne.isStandardBrowserEnv){const p=(e.withCredentials||nA(d))&&e.xsrfCookieName&&$a.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in s&&b.forEach(i.toJSON(),function(h,y){s.setRequestHeader(y,h)}),b.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),a&&a!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",io(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",io(e.onUploadProgress)),(e.cancelToken||e.signal)&&(A=p=>{s&&(r(!p||p.type?new Ct(null,e,s):p),s.abort(),s=null)},e.cancelToken&&e.cancelToken.subscribe(A),e.signal&&(e.signal.aborted?A():e.signal.addEventListener("abort",A)));const q=rA(d);if(q&&Ne.protocols.indexOf(q)===-1){r(new ne("Unsupported protocol "+q+":",ne.ERR_BAD_REQUEST,e));return}s.send(o||null)})}};b.forEach(Mn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ao=e=>`- ${e}`,iA=e=>b.isFunction(e)||e===null||e===!1,Ao={getAdapter:e=>{e=b.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,!iA(n)&&(r=Mn[(a=String(n)).toLowerCase()],r===void 0))throw new ne(`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(ao).join(`
|
|
50
|
-
`):" "+ao(i[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Mn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function so(e){return Ln(e),e.headers=Te.from(e.headers),e.data=Sn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ao.getAdapter(e.adapter||Kn.adapter)(e).then(function(r){return Ln(e),r.data=Sn.call(e,e.transformResponse,r),r.headers=Te.from(r.headers),r},function(r){return ro(r)||(Ln(e),r&&r.response&&(r.response.data=Sn.call(e,e.transformResponse,r.response),r.response.headers=Te.from(r.response.headers))),Promise.reject(r)})}const lo=e=>e instanceof Te?e.toJSON():e;function st(e,t){t=t||{};const n={};function r(c,s,d){return b.isPlainObject(c)&&b.isPlainObject(s)?b.merge.call({caseless:d},c,s):b.isPlainObject(s)?b.merge({},s):b.isArray(s)?s.slice():s}function o(c,s,d){if(b.isUndefined(s)){if(!b.isUndefined(c))return r(void 0,c,d)}else return r(c,s,d)}function i(c,s){if(!b.isUndefined(s))return r(void 0,s)}function a(c,s){if(b.isUndefined(s)){if(!b.isUndefined(c))return r(void 0,c)}else return r(void 0,s)}function A(c,s,d){if(d in t)return r(c,s);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,s)=>o(lo(c),lo(s),!0)};return b.forEach(Object.keys(Object.assign({},e,t)),function(s){const d=m[s]||o,g=d(e[s],t[s],s);b.isUndefined(g)&&d!==A||(n[s]=g)}),n}const uo="1.5.1",En={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{En[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const co={};En.transitional=function(t,n,r){function o(i,a){return"[Axios v"+uo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new ne(o(a," has been removed"+(n?" in "+n:"")),ne.ERR_DEPRECATED);return n&&!co[a]&&(co[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 ne("options must be an object",ne.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 ne("option "+i+" must be "+m,ne.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ne("Unknown option "+i,ne.ERR_BAD_OPTION)}}const On={assertOptions:aA,validators:En},Be=On.validators;class Xt{constructor(t){this.defaults=t,this.interceptors={request:new $r,response:new $r}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=st(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&On.assertOptions(r,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean)},!1),o!=null&&(b.isFunction(o)?n.paramsSerializer={serialize:o}:On.assertOptions(o,{encode:Be.function,serialize:Be.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&b.merge(i.common,i[n.method]);i&&b.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Te.concat(a,i);const A=[];let m=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(m=m&&h.synchronous,A.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let s,d=0,g;if(!m){const p=[so.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),g=p.length,s=Promise.resolve(n);d<g;)s=s.then(p[d++],p[d++]);return s}g=A.length;let q=n;for(d=0;d<g;){const p=A[d++],h=A[d++];try{q=p(q)}catch(y){h.call(this,y);break}}try{s=so.call(this,q)}catch(p){return Promise.reject(p)}for(d=0,g=c.length;d<g;)s=s.then(c[d++],c[d++]);return s}getUri(t){t=st(this.defaults,t);const n=oo(t.baseURL,t.url);return _r(n,t.params,t.paramsSerializer)}}b.forEach(["delete","get","head","options"],function(t){Xt.prototype[t]=function(n,r){return this.request(st(r||{},{method:t,url:n,data:(r||{}).data}))}}),b.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(st(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Xt.prototype[t]=n(),Xt.prototype[t+"Form"]=n(!0)});const Qt=Xt;class kn{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 Ct(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 kn(function(o){t=o}),cancel:t}}}const AA=kn;function sA(e){return function(n){return e.apply(null,n)}}function lA(e){return b.isObject(e)&&e.isAxiosError===!0}const zn={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(zn).forEach(([e,t])=>{zn[t]=e});const uA=zn;function mo(e){const t=new Qt(e),n=Yr(Qt.prototype.request,t);return b.extend(n,Qt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return mo(st(e,o))},n}const de=mo(Kn);de.Axios=Qt,de.CanceledError=Ct,de.CancelToken=AA,de.isCancel=ro,de.VERSION=uo,de.toFormData=Gt,de.AxiosError=ne,de.Cancel=de.CanceledError,de.all=function(t){return Promise.all(t)},de.spread=sA,de.isAxiosError=lA,de.mergeConfig=st,de.AxiosHeaders=Te,de.formToJSON=e=>to(b.isHTMLForm(e)?new FormData(e):e),de.getAdapter=Ao.getAdapter,de.HttpStatusCode=uA,de.default=de;const cA=de;/*! typescript-cookie v1.0.6 | MIT */const po=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),fo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Yn=decodeURIComponent,jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function mA(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 ho(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 qo=Object.freeze({decodeName:Yn,decodeValue:jn,encodeName:po,encodeValue:fo}),Jn=Object.freeze({path:"/"});function go(e,t,n=Jn,{encodeValue:r=fo,encodeName:o=po}={}){return document.cookie=`${o(e)}=${r(t,e)}${mA(n)}`}function yo(e,{decodeValue:t=jn,decodeName:n=Yn}={}){return ho(e,t,n)}function dA({decodeValue:e=jn,decodeName:t=Yn}={}){return ho(void 0,e,t)}function pA(e,t=Jn){go(e,"",Object.assign({},t,{expires:-1}))}function Nn(e,t){const n={set:function(o,i,a){return go(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return dA(this.converter.read);if(o!=null)return yo(o,this.converter.read)},remove:function(o,i){pA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Nn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Nn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Nn({read:qo.decodeValue,write:qo.encodeValue},Jn);let vo;typeof window<"u"&&(vo=yo("token"));const fe=cA.create({headers:{Authorization:vo}});async function fA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function hA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function qA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function gA(e,t,n,r,o){return(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function yA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function vA(e,t,n,r,o){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function bA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function CA(e,t){return(await fe.post(t+"/updateFlexUrl",e||{})).data}async function bo(e,t,n){return(await fe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Pt(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 Co(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=Co(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ue(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Co(e))&&(r&&(r+=" "),r+=t);return r}const Zt=e=>typeof e=="number"&&!isNaN(e),$e=e=>typeof e=="string",Ce=e=>typeof e=="function",Vt=e=>$e(e)||Ce(e)?e:null,Dn=e=>C.isValidElement(e)||$e(e)||Ce(e)||Zt(e);function ZA(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 Bt(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:s,nodeRef:d,isIn:g}=a;const q=r?`${t}--${m}`:t,p=r?`${n}--${m}`:n,h=C.useRef(0);return C.useLayoutEffect(()=>{const y=d.current,K=q.split(" "),O=J=>{J.target===d.current&&(y.dispatchEvent(new Event("d")),y.removeEventListener("animationend",O),y.removeEventListener("animationcancel",O),h.current===0&&J.type!=="animationcancel"&&y.classList.remove(...K))};y.classList.add(...K),y.addEventListener("animationend",O),y.addEventListener("animationcancel",O)},[]),C.useEffect(()=>{const y=d.current,K=()=>{y.removeEventListener("animationend",K),o?ZA(y,s,i):s()};g||(c?K():(h.current=1,y.className+=` ${p}`,y.addEventListener("animationend",K)))},[g]),C.createElement(C.Fragment,null,A)}}function Zo(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 We={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)})}},Ut=e=>{let{theme:t,type:n,...r}=e;return C.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Rn={info:function(e){return C.createElement(Ut,{...e},C.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 C.createElement(Ut,{...e},C.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 C.createElement(Ut,{...e},C.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 C.createElement(Ut,{...e},C.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 C.createElement("div",{className:"Toastify__spinner"})}};function IA(e){const[,t]=C.useReducer(q=>q+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=q=>n.indexOf(q)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:q=>i.get(q)}).current;function m(q){let{containerId:p}=q;const{limit:h}=A.props;!h||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(q){r(p=>q==null?[]:p.filter(h=>h!==q))}function s(){const{toastContent:q,toastProps:p,staleId:h}=A.queue.shift();g(q,p,h)}function d(q,p){let{delay:h,staleId:y,...K}=p;if(!Dn(q)||function(Q){return!o.current||A.props.enableMultiContainer&&Q.containerId!==A.props.containerId||i.has(Q.toastId)&&Q.updateId==null}(K))return;const{toastId:O,updateId:J,data:Y}=K,{props:v}=A,_=()=>c(O),$=J==null;$&&A.count++;const F={...v,style:v.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(K).filter(Q=>{let[B,S]=Q;return S!=null})),toastId:O,updateId:J,data:Y,closeToast:_,isIn:!1,className:Vt(K.className||v.toastClassName),bodyClassName:Vt(K.bodyClassName||v.bodyClassName),progressClassName:Vt(K.progressClassName||v.progressClassName),autoClose:!K.isLoading&&(le=K.autoClose,ee=v.autoClose,le===!1||Zt(le)&&le>0?le:ee),deleteToast(){const Q=Zo(i.get(O),"removed");i.delete(O),We.emit(4,Q);const B=A.queue.length;if(A.count=O==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),B>0){const S=O==null?A.props.limit:1;if(B===1||S===1)A.displayedToast++,s();else{const j=S>B?B:S;A.displayedToast=j;for(let D=0;D<j;D++)s()}}else t()}};var le,ee;F.iconOut=function(Q){let{theme:B,type:S,isLoading:j,icon:D}=Q,f=null;const L={theme:B,type:S};return D===!1||(Ce(D)?f=D(L):C.isValidElement(D)?f=C.cloneElement(D,L):$e(D)||Zt(D)?f=D:j?f=Rn.spinner():(G=>G in Rn)(S)&&(f=Rn[S](L))),f}(F),Ce(K.onOpen)&&(F.onOpen=K.onOpen),Ce(K.onClose)&&(F.onClose=K.onClose),F.closeButton=v.closeButton,K.closeButton===!1||Dn(K.closeButton)?F.closeButton=K.closeButton:K.closeButton===!0&&(F.closeButton=!Dn(v.closeButton)||v.closeButton);let Ae=q;C.isValidElement(q)&&!$e(q.type)?Ae=C.cloneElement(q,{closeToast:_,toastProps:F,data:Y}):Ce(q)&&(Ae=q({closeToast:_,toastProps:F,data:Y})),v.limit&&v.limit>0&&A.count>v.limit&&$?A.queue.push({toastContent:Ae,toastProps:F,staleId:y}):Zt(h)?setTimeout(()=>{g(Ae,F,y)},h):g(Ae,F,y)}function g(q,p,h){const{toastId:y}=p;h&&i.delete(h);const K={content:q,props:p};i.set(y,K),r(O=>[...O,y].filter(J=>J!==h)),We.emit(4,Zo(K,K.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,We.cancelEmit(3).on(0,d).on(1,q=>o.current&&c(q)).on(5,m).emit(2,A),()=>{i.clear(),We.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(q){const p=new Map,h=Array.from(i.values());return e.newestOnTop&&h.reverse(),h.forEach(y=>{const{position:K}=y.props;p.has(K)||p.set(K,[]),p.get(K).push(y)}),Array.from(p,y=>q(y[0],y[1]))},containerRef:o,isToastActive:a}}function Io(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function wo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function wA(e){const[t,n]=C.useState(!1),[r,o]=C.useState(!1),i=C.useRef(null),a=C.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=C.useRef(e),{autoClose:m,pauseOnHover:c,closeToast:s,onClick:d,closeOnClick:g}=e;function q(Y){if(e.draggable){Y.nativeEvent.type==="touchstart"&&Y.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",K),document.addEventListener("mouseup",O),document.addEventListener("touchmove",K),document.addEventListener("touchend",O);const v=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=v.getBoundingClientRect(),v.style.transition="",a.x=Io(Y.nativeEvent),a.y=wo(Y.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=v.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=v.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(Y){if(a.boundingRect){const{top:v,bottom:_,left:$,right:F}=a.boundingRect;Y.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=$&&a.x<=F&&a.y>=v&&a.y<=_?y():h()}}function h(){n(!0)}function y(){n(!1)}function K(Y){const v=i.current;a.canDrag&&v&&(a.didMove=!0,t&&y(),a.x=Io(Y),a.y=wo(Y),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),v.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,v.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function O(){document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",O);const Y=i.current;if(a.canDrag&&a.didMove&&Y){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();Y.style.transition="transform 0.2s, opacity 0.2s",Y.style.transform=`translate${e.draggableDirection}(0)`,Y.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),Ce(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const Y=A.current;Ce(Y.onClose)&&Y.onClose(C.isValidElement(Y.children)&&Y.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||y(),window.addEventListener("focus",h),window.addEventListener("blur",y)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",y))}),[e.pauseOnFocusLoss]);const J={onMouseDown:q,onTouchStart:q,onMouseUp:p,onTouchEnd:p};return m&&c&&(J.onMouseEnter=y,J.onMouseLeave=h),g&&(J.onClick=Y=>{d&&d(Y),a.canCloseOnClick&&s()}),{playToast:h,pauseToast:y,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:J}}function xo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return C.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},C.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 xA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:m,progress:c,rtl:s,isIn:d,theme:g}=e;const q=i||m&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:q?0:1};m&&(p.transform=`scaleX(${c})`);const h=Ue("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),y=Ce(a)?a({rtl:s,type:o,defaultClassName:h}):Ue(h,a);return C.createElement("div",{role:"progressbar","aria-hidden":q?"true":"false","aria-label":"notification timer",className:y,style:p,[m&&c>=1?"onTransitionEnd":"onAnimationEnd"]:m&&c<1?null:()=>{d&&r()}})}const KA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=wA(e),{closeButton:i,children:a,autoClose:A,onClick:m,type:c,hideProgressBar:s,closeToast:d,transition:g,position:q,className:p,style:h,bodyClassName:y,bodyStyle:K,progressClassName:O,progressStyle:J,updateId:Y,role:v,progress:_,rtl:$,toastId:F,deleteToast:le,isIn:ee,isLoading:Ae,iconOut:Q,closeOnClick:B,theme:S}=e,j=Ue("Toastify__toast",`Toastify__toast-theme--${S}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":$},{"Toastify__toast--close-on-click":B}),D=Ce(p)?p({rtl:$,position:q,type:c,defaultClassName:j}):Ue(j,p),f=!!_||!A,L={closeToast:d,type:c,theme:S};let G=null;return i===!1||(G=Ce(i)?i(L):C.isValidElement(i)?C.cloneElement(i,L):xo(L)),C.createElement(g,{isIn:ee,done:le,position:q,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:F,onClick:m,className:D,...o,style:h,ref:r},C.createElement("div",{...ee&&{role:v},className:Ce(y)?y({type:c}):Ue("Toastify__toast-body",y),style:K},Q!=null&&C.createElement("div",{className:Ue("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Ae})},Q),C.createElement("div",null,a)),G,C.createElement(xA,{...Y&&!f?{key:`pb-${Y}`}:{},rtl:$,theme:S,delay:A,isRunning:t,isIn:ee,closeToast:d,hide:s,type:c,style:J,className:O,controlledProgress:f,progress:_||0})))},Ft=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},WA=Bt(Ft("bounce",!0));Bt(Ft("slide",!0)),Bt(Ft("zoom")),Bt(Ft("flip"));const Gn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=IA(e),{className:i,style:a,rtl:A,containerId:m}=e;function c(s){const d=Ue("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return Ce(i)?i({position:s,rtl:A,defaultClassName:d}):Ue(d,Vt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:m},n((s,d)=>{const g=d.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:c(s),style:g,key:`container-${s}`},d.map((q,p)=>{let{content:h,props:y}=q;return C.createElement(KA,{...y,isIn:o(y.toastId),style:{...y.style,"--nth":p+1,"--len":d.length},key:`toast-${y.key}`},h)}))}))});Gn.displayName="ToastContainer",Gn.defaultProps={position:"top-right",transition:WA,autoClose:5e3,closeButton:xo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Tn,et=new Map,It=[],SA=1;function Ko(){return""+SA++}function MA(e){return e&&($e(e.toastId)||Zt(e.toastId))?e.toastId:Ko()}function wt(e,t){return et.size>0?We.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function _t(e,t){return{...t,type:t&&t.type||e,toastId:MA(t)}}function $t(e){return(t,n)=>wt(t,_t(e,n))}function ce(e,t){return wt(e,_t("default",t))}ce.loading=(e,t)=>wt(e,_t("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ce.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=$e(o)?ce.loading(o,n):ce.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},m=(s,d,g)=>{if(d==null)return void ce.dismiss(r);const q={type:s,...A,...n,data:g},p=$e(d)?{render:d}:d;return r?ce.update(r,{...q,...p}):ce(p.render,{...q,...p}),g},c=Ce(e)?e():e;return c.then(s=>m("success",a,s)).catch(s=>m("error",i,s)),c},ce.success=$t("success"),ce.info=$t("info"),ce.error=$t("error"),ce.warning=$t("warning"),ce.warn=ce.warning,ce.dark=(e,t)=>wt(e,_t("default",{theme:"dark",...t})),ce.dismiss=e=>{et.size>0?We.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ce.clearWaitingQueue=function(e){return e===void 0&&(e={}),We.emit(5,e)},ce.isActive=e=>{let t=!1;return et.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},ce.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=et.get(i||Tn);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:Ko()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,wt(a,i)}},0)},ce.done=e=>{ce.update(e,{progress:1})},ce.onChange=e=>(We.on(4,e),()=>{We.off(4,e)}),ce.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"},ce.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},We.on(2,e=>{Tn=e.containerId||e,et.set(Tn,e),It.forEach(t=>{We.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{et.delete(e.containerId||e),et.size===0&&We.off(0).off(1).off(5)});function xt(e){ce.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Hn="",De="Playable",Le=null,Wo=null;const Xn=async(e,t,n)=>{De==="Playable"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await bo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):De==="Flex"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await CA({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):De==="Ready"&&t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(t.googleUrl=t.iosUrl),await bo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le))},en=async e=>{let t=Hn+"/"+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),xt("Download successfully")}).catch(r=>{console.error("File error:",r)})},LA=(e,t)=>{let n=Hn+"/"+e;Pt(n)?xt("Link Copied"):t(n)};async function tn(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let m=async c=>{r==="download"?await en(c):r==="copy"&&LA(c,Wo)};try{await Xn(e,n,i)}catch(c){console.log("updateUrls error",c)}De==="Playable"?gA(Le,e,t,o,i).then(async c=>{let{url:s}=c;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):De==="Flex"?hA({_id:e,network:t,extras:i},Le).then(async c=>{if(c.message){A(c);return}let{url:s}=c;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):De==="Import"?qA(Le,e,t).then(async c=>{let s=c.url;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):De==="Ready"&&vA(Le,e,t,o,i).then(async c=>{if(c.message){A(c);return}let s=c.url;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})})}async function EA(e,t,n,r=null){return new Promise(async(o,i)=>{await Xn(e,t,r),De==="Flex"?fA(e,n,Le).then(async a=>{if(a.message){i(a);return}await en(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})}):De==="Ready"?bA(e,n,Le).then(async a=>{if(a.message){i(a);return}await en(a.url),o(a.url)}).catch(a=>{console.log("err",a);let A=a.response.data.error.msg;i({message:A})}):yA(e,n,Le).then(async a=>{await en(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})})})}function OA(e,t,n,r){De=e,Le=t,Wo=n,Hn=r}async function Qn(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}const kA=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:o,setSafariCopyLink:i,qrUrl:a,iosLink:A,androidLink:m,urlType:c})=>{const[s,d]=C.useState(!1),g=async()=>{d(!0),tn(e,"default",{iosUrl:A,googleUrl:m},null,!1,{urlType:c}).then(async q=>{var K,O,J,Y;let p="";if(t&&(n==="Playable"||n==="Ready")){const v=await Qn(t,r);console.log(v);const _=(O=(K=v==null?void 0:v.data)==null?void 0:K.globalProps)==null?void 0:O.defaultLandscape,$=(Y=(J=v==null?void 0:v.data)==null?void 0:J.globalProps)==null?void 0:Y.defaultPhoneIndex;console.log(_,$),_&&(p+="&landscape=true"),$!==void 0&&(p+=`&phoneIndex=${$}`)}Qn(t,r),d(!1);let h;n==="Flex"?h=`${o}/preview?versionId=${e}`:n==="Import"?h=`${o}/preview?versionId=${e}_`:n==="Ready"?h=`${o}/preview?versionId=${e}_&ready=true`:h=`${o}/preview?versionId=${e}_`,h+=p,Pt(h)?xt("Link copied"):i(h),d(!1)}).catch(q=>{d(!1)})};return l.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[l.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:a?l.jsx(_i,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):l.jsx("img",{style:{width:"50px",height:"50px"},src:Ve,alt:"pf-logo-gif"})}),l.jsxs("div",{children:[l.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),l.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{s||g()},children:[l.jsx(zr,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),l.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:s?l.jsx("img",{style:{height:"90%"},src:Ve,alt:"loading"}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},zA=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:o,iframeUrl:i,fetchFileUrl:a,copyLinkUrl:A,setSafariCopyLink:m,iosLink:c,androidLink:s,urlType:d})=>{const[g,q]=C.useState(window.innerWidth);console.log("iosLink",c),C.useEffect(()=>{console.log("re add event listener");function h(y){console.log(y),y.data==="cta"&&(console.log("Received 'cta' message from iframe"),c&&window.open(c,"_blank"))}return window.addEventListener("message",h,!1),()=>{window.removeEventListener("message",h)}},[c,s]),C.useEffect(()=>{const h=()=>{q(window.innerWidth)};return window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}},[]);const p=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return l.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:g>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(hi,{iframeUrl:i}),l.jsx(qi,{name:p}),l.jsx(kA,{versionId:t,playableId:n,typeOfProduct:r,api:o,copyLinkUrl:A,setSafariCopyLink:m,qrUrl:i,iosLink:c,androidLink:s,urlType:d})]})};var he=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(he||{});const So=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return l.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:l.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[l.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}),l.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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:he[t],stroke:he[t],strokeWidth:"1",children:l.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"})})," "]})]})})},YA=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:[l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[l.jsx("span",{style:{color:he[e]},children:"Select Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]}),l.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:[l.jsx(So,{checked:t,typeOfProduct:e,id:"asd"}),l.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"16px",fontWeight:"bold"},children:"Select All"})]})]});async function jA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const JA=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[l.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),l.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_518_12094",children:l.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),NA=({creditDownload:e,api:t})=>l.jsxs(l.Fragment,{children:[l.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."}),l.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"," ",l.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.",l.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>jA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(JA,{})]})]})]}),Mo=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=A=>{n(A.target.value)},a=A=>{r(A.target.value)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"App Store:"}),l.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:he[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]}),l.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:["Google Play:"," "]}),l.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:he[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},DA=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=a=>{n(a.target.value)};return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),l.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:he[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},RA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:m,isTest:c,setIsTest:s,urlType:d,setUrlType:g})=>{const q=()=>l.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),l.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:he[e]},type:"checkbox",checked:c,onChange:()=>{s(!c)},placeholder:"Google Url",disabled:i})]}),p=()=>l.jsx(l.Fragment,{children:l.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:[l.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"}),l.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(()=>{g("game")},200)},children:l.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"),l.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(()=>{g("single")},200)},children:l.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 l.jsx(l.Fragment,{children:e!=="Import"&&l.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[m.customer=="playableFactoryInternal"&&e==="Playable"&&l.jsx(q,{}),e==="Ready"?l.jsxs(l.Fragment,{children:[l.jsx(p,{}),d==="game"&&l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),d==="single"&&l.jsx(DA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):l.jsx(l.Fragment,{children:l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&l.jsx(NA,{creditDownload:A,api:a})]})})},GA=({typeOfProduct:e,title:t,fileSize:n})=>l.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[l.jsx("span",{style:{color:he[e]},children:t}),n&&l.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),TA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:s,setIsTest:d,urlType:g,setUrlType:q,allNetworksSelected:p,setAllNetworksSelected:h})=>l.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:[l.jsx(GA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(RA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:s,setIsTest:d,urlType:g,setUrlType:q}),l.jsx(YA,{typeOfProduct:e,allNetworksSelected:p,setAllNetworksSelected:h})]}),Pn=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>l.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}),Nl="",HA=({typeOfProduct:e})=>l.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:l.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}})]})}),Vn=({isNetworksLoading:e=!1})=>l.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Ve,alt:"pf-logo-gif"})}),Lo=({title:e,titleId:t,...n})=>l.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?l.jsx("title",{id:t,children:e}):null,l.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"})]}),XA=({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?",l.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:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.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:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:m}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.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"}),l.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"})]})]})]})},Eo=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),l.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:[l.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?"}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),l.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async i=>{i.preventDefault(),i.stopPropagation(),r==="download"?(await n(),await o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),QA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>l.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:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.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:l.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?l.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:l.jsx("img",{width:"25px",height:"25px",src:Ve,alt:"pf-logo-gif"})}):l.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?l.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:l.jsx("img",{width:"25px",height:"25px",src:Ve,alt:"pf-logo-gif"})}):l.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"})]}),l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?l.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:l.jsx("img",{width:"25px",height:"25px",src:Ve,alt:"pf-logo-gif"})}):l.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 PA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const VA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:m,versionId:c,api:s,handleDownloadError:d,fetchFileUrl:g,urls:q,game:p,setIsConfirmActive:h,creditDownload:y,getDownloadCount:K,disabled:O,user:J,setSafariCopyLink:Y,isTest:v,urlType:_})=>{const[$,F]=C.useState(!1),[le,ee]=C.useState(""),[Ae,Q]=C.useState(!1),[B,S]=C.useState(!1),[j,D]=C.useState(!1),[f,L]=C.useState("download"),[G,Z]=C.useState(!1),[I,M]=C.useState(!1),[k,z]=C.useState(!1);let V={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 x=()=>{n(e)},N=async(R,W)=>(F(!0),new Promise((se,Re)=>{tn(c,R,q,W,v,{urlType:_}).then(ve=>{F(!1),se(ve)}).catch(ve=>{F(!1),d(ve.message,ve),Re(ve)})})),P=async(R=!1)=>{R?M(!0):Z(!0);const W={molocoGenerateHtml:!1};R&&(W.molocoGenerateHtml=!0),tn(c,o,q,"download",v,W).then(se=>{R?M(!1):Z(!1),D(!1)}).catch(se=>{d(se.message,se)})},U=async()=>{z(!0);const R=await PA(s,c,o,m);let W=`${g}/${R==null?void 0:R.url}`;Pt(W)?(xt("Link Copied"),z(!1)):Y(W)},T=o==="moloco"||o==="molocoV2";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?he[m]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+m,onClick:x,children:[l.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[l.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:l.jsx("div",{children:i&&i.map(R=>R.network).includes(o)?a?l.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:l.jsx(HA,{typeOfProduct:m})}):i.map(R=>l.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:R.network===o?R.size.toString().slice(0,5)+"Mb":""},R.network)):null})}),l.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(m==="Playable"||m==="Ready"||m==="Flex")&&A&&l.jsx(So,{checked:r,typeOfProduct:m,id:e})}),l.jsx("img",{onClick:x,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[l.jsxs(Pn,{className:`${T?"w-1/2":"w-2/3"} border-hover-`+m,downloading:$,onClickDonwload:async R=>{if(R.stopPropagation(),T&&J.customer==="playableFactoryInternal"){D(!0);return}else{ee("download");const W=q.iosUrl,se=q.googleUrl;y&&y.willSpendCredit?(h(!0),L("download"),Q(!0)):["Playable","Flex"].includes(m)&&(!W||!se)||m==="Ready"&&_==="single"&&!W||m==="Ready"&&_==="multi"&&(!W||!se)?(h(!0),S(!0)):(S(!1),Q(!1),await N(o,"download"))}},children:[!$&&l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),T&&J.customer!=="playableFactoryInternal"?"TXT":"Download"]}),$&&l.jsx(Vn,{})]}),V[o]&&V[o].includes("copy")&&l.jsx(Pn,{className:"w-1/3 border-hover-"+m,onClickDonwload:async R=>{R.stopPropagation(),ee("copyLink");const W=q.iosUrl,se=q.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("copy"),h(!0),Q(!0)):m!=="Import"&&(!W||!se)?(h(!0),S(!0)):(Q(!1),S(!1),await N(o,"copy"))},disabled:O,children:l.jsx(zr,{className:"h-6 w-6 stroke-dark-full"})}),T&&J.customer!=="playableFactoryInternal"&&l.jsx(Pn,{className:"w-1/2 border-hover-"+m,onClickDonwload:async R=>{R.stopPropagation(),ee("download");const W=q.iosUrl,se=q.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("download"),h(!0),Q(!0)):m!=="Import"&&(!W||!se)?(h(!0),S(!0)):(Q(!1),S(!1),await P(!0))},disabled:O,children:l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]})})]}),T&&l.jsx("img",{style:{position:"absolute",width:"135px",right:"0",top:"18px"},src:"https://home.playablefactory.app/recommended_badge.png"})]}),Ae&&l.jsx(Eo,{creditConfirmType:f,handleCopyLink:async()=>{S(!1),h(!1),await N(o,"copy")},download:async()=>{S(!1),h(!1),await N(o,"download")},onClose:()=>{Q(!1),h(!1)},getDownloadCount:K}),B&&l.jsx(XA,{onClose:()=>{S(!1),h(!1)},iosLink:q.iosUrl,googleLink:q.googleUrl,buttonType:le,handleCopyLink:async()=>{S(!1),h(!1),await N(o,"copy")},download:async()=>{S(!1),h(!1),await N(o,"download")},typeOfProduct:m,urlType:_}),j&&J.customer==="playableFactoryInternal"&&l.jsx(QA,{onClose:()=>{D(!1)},handleDownload:P,handleDownloadMolocoTest:U,downloadingMoloco:G,donwloadintMolocoTest:k,downloadingMolocoHtml:I})]})},nn=[{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:"22",name:"moloco",imageSrc:"https://home.playablefactory.com/moloco.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:"44",name:"molocoV2",imageSrc:"https://home.playablefactory.com/molocoV2.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"}],BA=({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:he[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return l.jsx("button",{onClick:r,className:n,style:o,children:e})},UA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?l.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:he[t]},children:l.jsx(Vn,{})}):l.jsx(BA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),FA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:m,urls:c,game:s,getDownloadCount:d,disabled:g,setSafariCopyLink:q,isTest:p,urlType:h,allNetworksSelected:y,setAllNetworksSelected:K})=>{const[O,J]=C.useState([]),[Y,v]=C.useState([]),[_,$]=C.useState(!1),[F,le]=C.useState(""),[ee,Ae]=C.useState(!1),[Q,B]=C.useState(!1),[S,j]=C.useState("download"),[D,f]=C.useState(!1),L=async I=>{const M=[...O];if(O.includes(I)){const k=M.findIndex(z=>z===I);M.splice(k,1),J(M)}else M.push(I),J([...O,I]);nn.filter(k=>[...M].includes(k.id)).map(k=>k.name)},G=async()=>new Promise(async(I,M)=>{const k=nn.filter(z=>[...O].includes(z.id)).map(z=>z.name);Ae(!0),EA(r,c,k,{urlType:h}).then(z=>{Ae(!1),I(z)}).catch(z=>{console.log("get multi download err"),Ae(!1),A(z.message,z),M(z)})}),Z=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(B(!0),j("download"),f(!0)):(f(!1),await G())};return C.useEffect(()=>{const I=nn.filter(M=>{var k;return t&&((k=t==null?void 0:t.networks)==null?void 0:k.length)>0?t==null?void 0:t.networks.includes(M.name):o==="Import"?e==null?void 0:e.networks.filter(z=>z.status==="paid").some(z=>z.name===M.name):e==null?void 0:e.networks.includes(M.name)}).filter(M=>M.name==="voodoo"?a.customer==="customer:20":!0).map(M=>M.id);J(y?I:[])},[y]),l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"relative",flex:1,overflowY:Q?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:l.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&nn.filter(I=>{var M;return t&&((M=t==null?void 0:t.networks)==null?void 0:M.length)>0?t==null?void 0:t.networks.includes(I.name):o==="Import"?e==null?void 0:e.networks.filter(k=>k.status==="paid").some(k=>k.name===I.name):e==null?void 0:e.networks.includes(I.name)}).filter(I=>I.name==="voodoo"?a.customer==="customer:20":!0).map(I=>{let M=I.imageSrc;if(I.name==="web"){let k="web_"+o.toLowerCase()+".png";M=M.replace("web.png",k)}return l.jsx(VA,{id:I.id,name:I.name,imageUrl:M,selected:O.includes(I.id),handleCardClick:L,networkVersionSize:Y,fileSizeLoading:_,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:m,urls:c,game:s,creditDownload:t,setIsConfirmActive:B,getDownloadCount:d,disabled:g,user:a,setSafariCopyLink:q,isTest:p,urlType:h},I.id)})})}),O.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&l.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:l.jsx(UA,{onClickMultiDownload:Z,networksVersionTotalSize:F,typeOfProduct:o,multiDownloading:ee})}),D&&l.jsx(Eo,{creditConfirmType:S,handleCopyLink:async()=>{},download:async()=>{f(!1),B(!1),await G()},onClose:()=>{f(!1),B(!1)},getDownloadCount:d})]})};async function _A(e,t){return(await fe.post(t+"/getFlexDownloadCount",e)).data}async function $A(e,t){try{return(await fe.post(t+"/findGame",{_id:e})).data}catch{}}async function es(e,t){return(await fe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function ts(e,t){return(await fe.post(t+"/getFlexData",{_id:e})).data}async function ns(e,t){return(await fe.post(t+"/getImportedPlayable",{id:e})).data}async function rs(e,t){return(await fe.post(t+"/getReadyDownloadCount",e)).data}const os=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],Oo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"];let ko=null;const is=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:m,fetchFileUrl:c,fileSize:s,setFileSize:d,setSafariCopyLink:g,iosLink:q,androidLink:p,setIosLink:h,setAndroidLink:y,urlType:K,setUrlType:O})=>{const[J,Y]=C.useState(null),[v,_]=C.useState(null),[$,F]=C.useState(null),[le,ee]=C.useState(!1),[Ae,Q]=C.useState(!0),[B,S]=C.useState(window.innerWidth),[j,D]=C.useState(!1),[f,L]=C.useState(!1);C.useEffect(()=>{},[f]),C.useEffect(()=>{const x=()=>{S(window.innerWidth)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[]);const G=async()=>{ee(!0);const x=await Qn(e,i);return x!=null&&x.networks||(x.networks=os),Y(x),x},Z=(x,N)=>{clearTimeout(ko),ko=setTimeout(()=>{console.log("Update URLS:"),Xn(t,{iosUrl:x,googleUrl:N},{urlType:K})},1e3)},I=x=>{h(x),Z(x,p)},M=x=>{y(x),Z(q,x)},k=async(x,N)=>{var P,U;console.log("getIosAndAndroidLink");try{let T;if(r==="Playable"||r==="Ready"){const R=await es(t,i);if(R){console.log("version",R),h(R.iosLink),y(R.androidLink),ee(!1);return}if(x&&(x.iosUrl||x.googleUrl)){h(x.iosUrl),y(x.googleUrl),ee(!1);return}if(N&&N.html){let W=await fetch(c+"/"+N.html).then(ve=>ve.text());const se=((P=W.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:P.at(1))||"";h(se);const Re=((U=W.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:U.at(1))||"";y(Re),ee(!1)}else y(""),h(""),ee(!1)}else if(r==="Flex"){const R=await ts(t,i);if(R.googleUrl||R.iosUrl){y(R.googleUrl),h(R.iosUrl),ee(!1);return}x&&(x.iosUrl||x.googleUrl)?(h(x.iosUrl),y(x.googleUrl),ee(!1)):(y(""),h(""),ee(!1))}}catch(T){m(T.response.data.error.msg)}},z=async()=>{ee(!0);let x;r==="Flex"?x=await _A({_id:t},i):r==="Ready"&&(x=await rs({_id:t},i)),x&&(["admin","pm","tester","sales"].includes(a.role)?F({...x,networks:Oo}):r==="Ready"&&!x.canDownload?F({...x,networks:Oo}):F(x)),ee(!1)},V=async()=>await $A(n,i);return C.useEffect(()=>{o||(Y(null),_(null),F(null),d(null)),o&&(r==="Playable"?(G().then(x=>{k(null,x)}),Q(!1)):r==="Ready"?z().then(x=>{G().then(N=>{k(null,N),Q(!1)})}):r==="Flex"?z().then(x=>{Q(!1),V().then(N=>{o&&(k(N,null),Q(!1),_(N))})}):r==="Import"&&ns(t,i).then(x=>{console.log(x),Y(x),h(x.iosUrl||""),y(x.googleUrl||""),ee(!1),Q(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:B>1440?"700px":"650px",width:B>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(TA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:q,googleUrl:p},handleIosChange:I,handleGoogleChange:M,disabled:Ae,api:i,creditDownload:$,user:a,isTest:j,setIsTest:D,urlType:K,setUrlType:O,allNetworksSelected:f,setAllNetworksSelected:L}),le?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Vn,{isNetworksLoading:!0})}):(J||$)&&(r==="Flex"?v:!0)&&!le&&q!=="Loading..."&&p!=="Loading..."&&l.jsx(FA,{playable:J,creditDownload:$,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:m,fetchFileUrl:c,urls:{iosUrl:q,googleUrl:p},game:v,getDownloadCount:z,disabled:Ae,setSafariCopyLink:g,isTest:j,urlType:K,allNetworksSelected:f,setAllNetworksSelected:L})]})},Dl="";var Bn={exports:{}},tt={},Un={exports:{}},Ee={},Fn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
|
|
50
|
+
`):" "+ao(i[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Mn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ct(null,e)}function so(e){return Ln(e),e.headers=Te.from(e.headers),e.data=Sn.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ao.getAdapter(e.adapter||Kn.adapter)(e).then(function(r){return Ln(e),r.data=Sn.call(e,e.transformResponse,r),r.headers=Te.from(r.headers),r},function(r){return ro(r)||(Ln(e),r&&r.response&&(r.response.data=Sn.call(e,e.transformResponse,r.response),r.response.headers=Te.from(r.response.headers))),Promise.reject(r)})}const lo=e=>e instanceof Te?e.toJSON():e;function st(e,t){t=t||{};const n={};function r(c,s,d){return b.isPlainObject(c)&&b.isPlainObject(s)?b.merge.call({caseless:d},c,s):b.isPlainObject(s)?b.merge({},s):b.isArray(s)?s.slice():s}function o(c,s,d){if(b.isUndefined(s)){if(!b.isUndefined(c))return r(void 0,c,d)}else return r(c,s,d)}function i(c,s){if(!b.isUndefined(s))return r(void 0,s)}function a(c,s){if(b.isUndefined(s)){if(!b.isUndefined(c))return r(void 0,c)}else return r(void 0,s)}function A(c,s,d){if(d in t)return r(c,s);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,s)=>o(lo(c),lo(s),!0)};return b.forEach(Object.keys(Object.assign({},e,t)),function(s){const d=m[s]||o,g=d(e[s],t[s],s);b.isUndefined(g)&&d!==A||(n[s]=g)}),n}const uo="1.5.1",En={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{En[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const co={};En.transitional=function(t,n,r){function o(i,a){return"[Axios v"+uo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new ne(o(a," has been removed"+(n?" in "+n:"")),ne.ERR_DEPRECATED);return n&&!co[a]&&(co[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 ne("options must be an object",ne.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 ne("option "+i+" must be "+m,ne.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ne("Unknown option "+i,ne.ERR_BAD_OPTION)}}const On={assertOptions:aA,validators:En},Be=On.validators;class Xt{constructor(t){this.defaults=t,this.interceptors={request:new $r,response:new $r}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=st(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&On.assertOptions(r,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean)},!1),o!=null&&(b.isFunction(o)?n.paramsSerializer={serialize:o}:On.assertOptions(o,{encode:Be.function,serialize:Be.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&b.merge(i.common,i[n.method]);i&&b.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Te.concat(a,i);const A=[];let m=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(m=m&&h.synchronous,A.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let s,d=0,g;if(!m){const p=[so.bind(this),void 0];for(p.unshift.apply(p,A),p.push.apply(p,c),g=p.length,s=Promise.resolve(n);d<g;)s=s.then(p[d++],p[d++]);return s}g=A.length;let q=n;for(d=0;d<g;){const p=A[d++],h=A[d++];try{q=p(q)}catch(y){h.call(this,y);break}}try{s=so.call(this,q)}catch(p){return Promise.reject(p)}for(d=0,g=c.length;d<g;)s=s.then(c[d++],c[d++]);return s}getUri(t){t=st(this.defaults,t);const n=oo(t.baseURL,t.url);return _r(n,t.params,t.paramsSerializer)}}b.forEach(["delete","get","head","options"],function(t){Xt.prototype[t]=function(n,r){return this.request(st(r||{},{method:t,url:n,data:(r||{}).data}))}}),b.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(st(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Xt.prototype[t]=n(),Xt.prototype[t+"Form"]=n(!0)});const Qt=Xt;class kn{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 Ct(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 kn(function(o){t=o}),cancel:t}}}const AA=kn;function sA(e){return function(n){return e.apply(null,n)}}function lA(e){return b.isObject(e)&&e.isAxiosError===!0}const zn={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(zn).forEach(([e,t])=>{zn[t]=e});const uA=zn;function mo(e){const t=new Qt(e),n=Yr(Qt.prototype.request,t);return b.extend(n,Qt.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return mo(st(e,o))},n}const de=mo(Kn);de.Axios=Qt,de.CanceledError=Ct,de.CancelToken=AA,de.isCancel=ro,de.VERSION=uo,de.toFormData=Gt,de.AxiosError=ne,de.Cancel=de.CanceledError,de.all=function(t){return Promise.all(t)},de.spread=sA,de.isAxiosError=lA,de.mergeConfig=st,de.AxiosHeaders=Te,de.formToJSON=e=>to(b.isHTMLForm(e)?new FormData(e):e),de.getAdapter=Ao.getAdapter,de.HttpStatusCode=uA,de.default=de;const cA=de;/*! typescript-cookie v1.0.6 | MIT */const po=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),fo=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Yn=decodeURIComponent,jn=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function mA(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 ho(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 qo=Object.freeze({decodeName:Yn,decodeValue:jn,encodeName:po,encodeValue:fo}),Jn=Object.freeze({path:"/"});function go(e,t,n=Jn,{encodeValue:r=fo,encodeName:o=po}={}){return document.cookie=`${o(e)}=${r(t,e)}${mA(n)}`}function yo(e,{decodeValue:t=jn,decodeName:n=Yn}={}){return ho(e,t,n)}function dA({decodeValue:e=jn,decodeName:t=Yn}={}){return ho(void 0,e,t)}function pA(e,t=Jn){go(e,"",Object.assign({},t,{expires:-1}))}function Nn(e,t){const n={set:function(o,i,a){return go(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return dA(this.converter.read);if(o!=null)return yo(o,this.converter.read)},remove:function(o,i){pA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return Nn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return Nn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}Nn({read:qo.decodeValue,write:qo.encodeValue},Jn);let vo;typeof window<"u"&&(vo=yo("token"));const fe=cA.create({headers:{Authorization:vo}});async function fA(e,t,n){return(await fe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}async function hA(e,t){return e.network=="fb"&&(e.zip=1),(await fe.post(t+"/createFlexVersionLink",e||{})).data}async function qA(e,t,n){return(await fe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function gA(e,t,n,r,o){return(await fe.post(e+"/createPlayableVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function yA(e,t,n){return(await fe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function vA(e,t,n,r,o){return(await fe.post(e+"/createReadyVersionLink",{_id:t,network:n,isPfTest:r,extras:o})).data}async function bA(e,t,n){return(await fe.post(n+"/createReadyVersionLinkMulti",{_id:e,networks:t})).data}async function CA(e,t){return(await fe.post(t+"/updateFlexUrl",e||{})).data}async function bo(e,t,n){return(await fe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Pt(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 Co(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=Co(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ue(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Co(e))&&(r&&(r+=" "),r+=t);return r}const Zt=e=>typeof e=="number"&&!isNaN(e),$e=e=>typeof e=="string",Ce=e=>typeof e=="function",Vt=e=>$e(e)||Ce(e)?e:null,Dn=e=>C.isValidElement(e)||$e(e)||Ce(e)||Zt(e);function ZA(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 Bt(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:s,nodeRef:d,isIn:g}=a;const q=r?`${t}--${m}`:t,p=r?`${n}--${m}`:n,h=C.useRef(0);return C.useLayoutEffect(()=>{const y=d.current,K=q.split(" "),O=J=>{J.target===d.current&&(y.dispatchEvent(new Event("d")),y.removeEventListener("animationend",O),y.removeEventListener("animationcancel",O),h.current===0&&J.type!=="animationcancel"&&y.classList.remove(...K))};y.classList.add(...K),y.addEventListener("animationend",O),y.addEventListener("animationcancel",O)},[]),C.useEffect(()=>{const y=d.current,K=()=>{y.removeEventListener("animationend",K),o?ZA(y,s,i):s()};g||(c?K():(h.current=1,y.className+=` ${p}`,y.addEventListener("animationend",K)))},[g]),C.createElement(C.Fragment,null,A)}}function Zo(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 We={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)})}},Ut=e=>{let{theme:t,type:n,...r}=e;return C.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Rn={info:function(e){return C.createElement(Ut,{...e},C.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 C.createElement(Ut,{...e},C.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 C.createElement(Ut,{...e},C.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 C.createElement(Ut,{...e},C.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 C.createElement("div",{className:"Toastify__spinner"})}};function IA(e){const[,t]=C.useReducer(q=>q+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=q=>n.indexOf(q)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:q=>i.get(q)}).current;function m(q){let{containerId:p}=q;const{limit:h}=A.props;!h||p&&A.containerId!==p||(A.count-=A.queue.length,A.queue=[])}function c(q){r(p=>q==null?[]:p.filter(h=>h!==q))}function s(){const{toastContent:q,toastProps:p,staleId:h}=A.queue.shift();g(q,p,h)}function d(q,p){let{delay:h,staleId:y,...K}=p;if(!Dn(q)||function(Q){return!o.current||A.props.enableMultiContainer&&Q.containerId!==A.props.containerId||i.has(Q.toastId)&&Q.updateId==null}(K))return;const{toastId:O,updateId:J,data:Y}=K,{props:v}=A,_=()=>c(O),$=J==null;$&&A.count++;const F={...v,style:v.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(K).filter(Q=>{let[B,S]=Q;return S!=null})),toastId:O,updateId:J,data:Y,closeToast:_,isIn:!1,className:Vt(K.className||v.toastClassName),bodyClassName:Vt(K.bodyClassName||v.bodyClassName),progressClassName:Vt(K.progressClassName||v.progressClassName),autoClose:!K.isLoading&&(le=K.autoClose,ee=v.autoClose,le===!1||Zt(le)&&le>0?le:ee),deleteToast(){const Q=Zo(i.get(O),"removed");i.delete(O),We.emit(4,Q);const B=A.queue.length;if(A.count=O==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),B>0){const S=O==null?A.props.limit:1;if(B===1||S===1)A.displayedToast++,s();else{const j=S>B?B:S;A.displayedToast=j;for(let D=0;D<j;D++)s()}}else t()}};var le,ee;F.iconOut=function(Q){let{theme:B,type:S,isLoading:j,icon:D}=Q,f=null;const L={theme:B,type:S};return D===!1||(Ce(D)?f=D(L):C.isValidElement(D)?f=C.cloneElement(D,L):$e(D)||Zt(D)?f=D:j?f=Rn.spinner():(G=>G in Rn)(S)&&(f=Rn[S](L))),f}(F),Ce(K.onOpen)&&(F.onOpen=K.onOpen),Ce(K.onClose)&&(F.onClose=K.onClose),F.closeButton=v.closeButton,K.closeButton===!1||Dn(K.closeButton)?F.closeButton=K.closeButton:K.closeButton===!0&&(F.closeButton=!Dn(v.closeButton)||v.closeButton);let Ae=q;C.isValidElement(q)&&!$e(q.type)?Ae=C.cloneElement(q,{closeToast:_,toastProps:F,data:Y}):Ce(q)&&(Ae=q({closeToast:_,toastProps:F,data:Y})),v.limit&&v.limit>0&&A.count>v.limit&&$?A.queue.push({toastContent:Ae,toastProps:F,staleId:y}):Zt(h)?setTimeout(()=>{g(Ae,F,y)},h):g(Ae,F,y)}function g(q,p,h){const{toastId:y}=p;h&&i.delete(h);const K={content:q,props:p};i.set(y,K),r(O=>[...O,y].filter(J=>J!==h)),We.emit(4,Zo(K,K.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,We.cancelEmit(3).on(0,d).on(1,q=>o.current&&c(q)).on(5,m).emit(2,A),()=>{i.clear(),We.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(q){const p=new Map,h=Array.from(i.values());return e.newestOnTop&&h.reverse(),h.forEach(y=>{const{position:K}=y.props;p.has(K)||p.set(K,[]),p.get(K).push(y)}),Array.from(p,y=>q(y[0],y[1]))},containerRef:o,isToastActive:a}}function Io(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function wo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function wA(e){const[t,n]=C.useState(!1),[r,o]=C.useState(!1),i=C.useRef(null),a=C.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,A=C.useRef(e),{autoClose:m,pauseOnHover:c,closeToast:s,onClick:d,closeOnClick:g}=e;function q(Y){if(e.draggable){Y.nativeEvent.type==="touchstart"&&Y.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",K),document.addEventListener("mouseup",O),document.addEventListener("touchmove",K),document.addEventListener("touchend",O);const v=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=v.getBoundingClientRect(),v.style.transition="",a.x=Io(Y.nativeEvent),a.y=wo(Y.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=v.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=v.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function p(Y){if(a.boundingRect){const{top:v,bottom:_,left:$,right:F}=a.boundingRect;Y.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=$&&a.x<=F&&a.y>=v&&a.y<=_?y():h()}}function h(){n(!0)}function y(){n(!1)}function K(Y){const v=i.current;a.canDrag&&v&&(a.didMove=!0,t&&y(),a.x=Io(Y),a.y=wo(Y),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),v.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,v.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function O(){document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",O),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",O);const Y=i.current;if(a.canDrag&&a.didMove&&Y){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();Y.style.transition="transform 0.2s, opacity 0.2s",Y.style.transform=`translate${e.draggableDirection}(0)`,Y.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",h,{once:!0}),Ce(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const Y=A.current;Ce(Y.onClose)&&Y.onClose(C.isValidElement(Y.children)&&Y.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||y(),window.addEventListener("focus",h),window.addEventListener("blur",y)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",h),window.removeEventListener("blur",y))}),[e.pauseOnFocusLoss]);const J={onMouseDown:q,onTouchStart:q,onMouseUp:p,onTouchEnd:p};return m&&c&&(J.onMouseEnter=y,J.onMouseLeave=h),g&&(J.onClick=Y=>{d&&d(Y),a.canCloseOnClick&&s()}),{playToast:h,pauseToast:y,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:J}}function xo(e){let{closeToast:t,theme:n,ariaLabel:r="close"}=e;return C.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),t(o)},"aria-label":r},C.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},C.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 xA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:m,progress:c,rtl:s,isIn:d,theme:g}=e;const q=i||m&&c===0,p={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:q?0:1};m&&(p.transform=`scaleX(${c})`);const h=Ue("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),y=Ce(a)?a({rtl:s,type:o,defaultClassName:h}):Ue(h,a);return C.createElement("div",{role:"progressbar","aria-hidden":q?"true":"false","aria-label":"notification timer",className:y,style:p,[m&&c>=1?"onTransitionEnd":"onAnimationEnd"]:m&&c<1?null:()=>{d&&r()}})}const KA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=wA(e),{closeButton:i,children:a,autoClose:A,onClick:m,type:c,hideProgressBar:s,closeToast:d,transition:g,position:q,className:p,style:h,bodyClassName:y,bodyStyle:K,progressClassName:O,progressStyle:J,updateId:Y,role:v,progress:_,rtl:$,toastId:F,deleteToast:le,isIn:ee,isLoading:Ae,iconOut:Q,closeOnClick:B,theme:S}=e,j=Ue("Toastify__toast",`Toastify__toast-theme--${S}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":$},{"Toastify__toast--close-on-click":B}),D=Ce(p)?p({rtl:$,position:q,type:c,defaultClassName:j}):Ue(j,p),f=!!_||!A,L={closeToast:d,type:c,theme:S};let G=null;return i===!1||(G=Ce(i)?i(L):C.isValidElement(i)?C.cloneElement(i,L):xo(L)),C.createElement(g,{isIn:ee,done:le,position:q,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:F,onClick:m,className:D,...o,style:h,ref:r},C.createElement("div",{...ee&&{role:v},className:Ce(y)?y({type:c}):Ue("Toastify__toast-body",y),style:K},Q!=null&&C.createElement("div",{className:Ue("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Ae})},Q),C.createElement("div",null,a)),G,C.createElement(xA,{...Y&&!f?{key:`pb-${Y}`}:{},rtl:$,theme:S,delay:A,isRunning:t,isIn:ee,closeToast:d,hide:s,type:c,style:J,className:O,controlledProgress:f,progress:_||0})))},Ft=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},WA=Bt(Ft("bounce",!0));Bt(Ft("slide",!0)),Bt(Ft("zoom")),Bt(Ft("flip"));const Gn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=IA(e),{className:i,style:a,rtl:A,containerId:m}=e;function c(s){const d=Ue("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return Ce(i)?i({position:s,rtl:A,defaultClassName:d}):Ue(d,Vt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:m},n((s,d)=>{const g=d.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:c(s),style:g,key:`container-${s}`},d.map((q,p)=>{let{content:h,props:y}=q;return C.createElement(KA,{...y,isIn:o(y.toastId),style:{...y.style,"--nth":p+1,"--len":d.length},key:`toast-${y.key}`},h)}))}))});Gn.displayName="ToastContainer",Gn.defaultProps={position:"top-right",transition:WA,autoClose:5e3,closeButton:xo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Tn,et=new Map,It=[],SA=1;function Ko(){return""+SA++}function MA(e){return e&&($e(e.toastId)||Zt(e.toastId))?e.toastId:Ko()}function wt(e,t){return et.size>0?We.emit(0,e,t):It.push({content:e,options:t}),t.toastId}function _t(e,t){return{...t,type:t&&t.type||e,toastId:MA(t)}}function $t(e){return(t,n)=>wt(t,_t(e,n))}function ce(e,t){return wt(e,_t("default",t))}ce.loading=(e,t)=>wt(e,_t("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ce.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=$e(o)?ce.loading(o,n):ce.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},m=(s,d,g)=>{if(d==null)return void ce.dismiss(r);const q={type:s,...A,...n,data:g},p=$e(d)?{render:d}:d;return r?ce.update(r,{...q,...p}):ce(p.render,{...q,...p}),g},c=Ce(e)?e():e;return c.then(s=>m("success",a,s)).catch(s=>m("error",i,s)),c},ce.success=$t("success"),ce.info=$t("info"),ce.error=$t("error"),ce.warning=$t("warning"),ce.warn=ce.warning,ce.dark=(e,t)=>wt(e,_t("default",{theme:"dark",...t})),ce.dismiss=e=>{et.size>0?We.emit(1,e):It=It.filter(t=>e!=null&&t.options.toastId!==e)},ce.clearWaitingQueue=function(e){return e===void 0&&(e={}),We.emit(5,e)},ce.isActive=e=>{let t=!1;return et.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},ce.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=et.get(i||Tn);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:Ko()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,wt(a,i)}},0)},ce.done=e=>{ce.update(e,{progress:1})},ce.onChange=e=>(We.on(4,e),()=>{We.off(4,e)}),ce.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"},ce.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},We.on(2,e=>{Tn=e.containerId||e,et.set(Tn,e),It.forEach(t=>{We.emit(0,t.content,t.options)}),It=[]}).on(3,e=>{et.delete(e.containerId||e),et.size===0&&We.off(0).off(1).off(5)});function xt(e){ce.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Hn="",De="Playable",Le=null,Wo=null;const Xn=async(e,t,n)=>{De==="Playable"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await bo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):De==="Flex"?t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&await CA({_id:e,iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le):De==="Ready"&&t&&t.iosUrl!=="Loading..."&&t.googleUrl!=="Loading..."&&((n==null?void 0:n.urlType)==="single"&&(t.googleUrl=t.iosUrl),await bo(e,{iosLink:t==null?void 0:t.iosUrl,androidLink:t==null?void 0:t.googleUrl},Le))},en=async e=>{let t=Hn+"/"+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),xt("Download successfully")}).catch(r=>{console.error("File error:",r)})},LA=(e,t)=>{let n=Hn+"/"+e;Pt(n)?xt("Link Copied"):t(n)};async function tn(e,t,n,r="download",o=!1,i=null){return new Promise(async(a,A)=>{let m=async c=>{r==="download"?await en(c):r==="copy"&&LA(c,Wo)};try{await Xn(e,n,i)}catch(c){console.log("updateUrls error",c)}De==="Playable"?gA(Le,e,t,o,i).then(async c=>{let{url:s}=c;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):De==="Flex"?hA({_id:e,network:t,extras:i},Le).then(async c=>{if(c.message){A(c);return}let{url:s}=c;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):De==="Import"?qA(Le,e,t).then(async c=>{let s=c.url;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})}):De==="Ready"&&vA(Le,e,t,o,i).then(async c=>{if(c.message){A(c);return}let s=c.url;await m(s),a(c)}).catch(c=>{let s=c.response.data.error.msg;A({message:s})})})}async function EA(e,t,n,r=null){return new Promise(async(o,i)=>{await Xn(e,t,r),De==="Flex"?fA(e,n,Le).then(async a=>{if(a.message){i(a);return}await en(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})}):De==="Ready"?bA(e,n,Le).then(async a=>{if(a.message){i(a);return}await en(a.url),o(a.url)}).catch(a=>{console.log("err",a);let A=a.response.data.error.msg;i({message:A})}):yA(e,n,Le).then(async a=>{await en(a.url),o(a.url)}).catch(a=>{let A=a.response.data.error.msg;i({message:A})})})}function OA(e,t,n,r){De=e,Le=t,Wo=n,Hn=r}async function Qn(e,t){return(await fe.post(t+"/findPlayable",{_id:e})).data}const kA=({versionId:e,playableId:t,typeOfProduct:n,api:r,copyLinkUrl:o,setSafariCopyLink:i,qrUrl:a,iosLink:A,androidLink:m,urlType:c})=>{const[s,d]=C.useState(!1),g=async()=>{d(!0),tn(e,"default",{iosUrl:A,googleUrl:m},null,!1,{urlType:c}).then(async q=>{var K,O,J,Y;let p="";if(t&&(n==="Playable"||n==="Ready")){const v=await Qn(t,r);console.log(v);const _=(O=(K=v==null?void 0:v.data)==null?void 0:K.globalProps)==null?void 0:O.defaultLandscape,$=(Y=(J=v==null?void 0:v.data)==null?void 0:J.globalProps)==null?void 0:Y.defaultPhoneIndex;console.log(_,$),_&&(p+="&landscape=true"),$!==void 0&&(p+=`&phoneIndex=${$}`)}Qn(t,r),d(!1);let h;n==="Flex"?h=`${o}/preview?versionId=${e}`:n==="Import"?h=`${o}/preview?versionId=${e}_`:n==="Ready"?h=`${o}/preview?versionId=${e}_&ready=true`:h=`${o}/preview?versionId=${e}_`,h+=p,Pt(h)?xt("Link copied"):i(h),d(!1)}).catch(q=>{d(!1)})};return l.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[l.jsx("div",{style:{marginRight:"0.75rem",width:"50%",display:"flex",justifyContent:"center",alignItems:"center"},children:a?l.jsx(_i,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:a}):l.jsx("img",{style:{width:"50px",height:"50px"},src:Ve,alt:"pf-logo-gif"})}),l.jsxs("div",{children:[l.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),l.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.375rem",backgroundColor:"#00a3ff57",color:"secondary-blue",cursor:"pointer"},onClick:()=>{s||g()},children:[l.jsx(zr,{style:{height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),l.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",justifyContent:"center",width:"80px"},children:s?l.jsx("img",{style:{height:"90%"},src:Ve,alt:"loading"}):l.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},children:"Copy Link"})})]})]})]})},zA=({versionName:e,versionId:t,playableId:n,typeOfProduct:r,api:o,iframeUrl:i,fetchFileUrl:a,copyLinkUrl:A,setSafariCopyLink:m,iosLink:c,androidLink:s,urlType:d})=>{const[g,q]=C.useState(window.innerWidth);console.log("iosLink",c),C.useEffect(()=>{console.log("re add event listener");function h(y){console.log(y),y.data==="cta"&&(console.log("Received 'cta' message from iframe"),c&&window.open(c,"_blank"))}return window.addEventListener("message",h,!1),()=>{window.removeEventListener("message",h)}},[c,s]),C.useEffect(()=>{const h=()=>{q(window.innerWidth)};return window.addEventListener("resize",h),()=>{window.removeEventListener("resize",h)}},[]);const p=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return l.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:g>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[l.jsx(hi,{iframeUrl:i}),l.jsx(qi,{name:p}),l.jsx(kA,{versionId:t,playableId:n,typeOfProduct:r,api:o,copyLinkUrl:A,setSafariCopyLink:m,qrUrl:i,iosLink:c,androidLink:s,urlType:d})]})};var he=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(he||{});const So=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return l.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:l.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[l.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}),l.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:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:he[t],stroke:he[t],strokeWidth:"1",children:l.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"})})," "]})]})})},YA=({typeOfProduct:e,allNetworksSelected:t,setAllNetworksSelected:n})=>l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:"0.5rem"},children:[l.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold",display:"flex"},children:[l.jsx("span",{style:{color:he[e]},children:"Select Network"}),l.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]}),l.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:[l.jsx(So,{checked:t,typeOfProduct:e,id:"asd"}),l.jsx("span",{style:{marginLeft:"0.5rem",fontSize:"16px",fontWeight:"bold"},children:"Select All"})]})]});async function jA(e,t){return(await fe.post(t+"/buyRequest",{requestType:e})).data}const JA=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[l.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),l.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_518_12094",children:l.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),NA=({creditDownload:e,api:t})=>l.jsxs(l.Fragment,{children:[l.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."}),l.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"," ",l.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.",l.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>jA("Flex Credit",t).then(n=>xt("You will be contacted regarding your request.")),children:["Get more",l.jsx(JA,{})]})]})]}),Mo=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=A=>{n(A.target.value)},a=A=>{r(A.target.value)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"App Store:"}),l.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:he[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]}),l.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:["Google Play:"," "]}),l.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:he[e],marginRight:"2rem"},type:"text",value:t.googleUrl,onChange:a,placeholder:"Google Url",disabled:o})]})]})},DA=({typeOfProduct:e,urls:t,handleIosChange:n,handleGoogleChange:r,disabled:o})=>{const i=a=>{n(a.target.value)};return l.jsx(l.Fragment,{children:l.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[l.jsx("span",{style:{width:"5rem",fontWeight:"bold",flexShrink:0},children:"Redirection URL:"}),l.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:he[e],marginRight:"2rem"},type:"text",value:t.iosUrl,onChange:i,placeholder:"Ios Url",disabled:o})]})})},RA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A,user:m,isTest:c,setIsTest:s,urlType:d,setUrlType:g})=>{const q=()=>l.jsxs("div",{style:{display:"flex",height:"24px",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[l.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Enable Test:"," "]}),l.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:he[e]},type:"checkbox",checked:c,onChange:()=>{s(!c)},placeholder:"Google Url",disabled:i})]}),p=()=>l.jsx(l.Fragment,{children:l.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:[l.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"}),l.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(()=>{g("game")},200)},children:l.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"),l.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(()=>{g("single")},200)},children:l.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 l.jsx(l.Fragment,{children:e!=="Import"&&l.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[m.customer=="playableFactoryInternal"&&e==="Playable"&&l.jsx(q,{}),e==="Ready"?l.jsxs(l.Fragment,{children:[l.jsx(p,{}),d==="game"&&l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i}),d==="single"&&l.jsx(DA,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})]}):l.jsx(l.Fragment,{children:l.jsx(Mo,{typeOfProduct:e,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i})}),(A==null?void 0:A.willSpendCredit)&&l.jsx(NA,{creditDownload:A,api:a})]})})},GA=({typeOfProduct:e,title:t,fileSize:n})=>l.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:[l.jsx("span",{style:{color:he[e]},children:t}),n&&l.jsxs("span",{style:{fontSize:"14px",fontWeight:"bold",marginLeft:"30px",color:"#87878E"},children:["File size: ",parseFloat(n).toFixed(2)," mb"]})]}),TA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:s,setIsTest:d,urlType:g,setUrlType:q,allNetworksSelected:p,setAllNetworksSelected:h})=>l.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:[l.jsx(GA,{typeOfProduct:e,title:r,fileSize:t}),l.jsx(RA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:m,user:c,isTest:s,setIsTest:d,urlType:g,setUrlType:q}),l.jsx(YA,{typeOfProduct:e,allNetworksSelected:p,setAllNetworksSelected:h})]}),Pn=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>l.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}),Nl="",HA=({typeOfProduct:e})=>l.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:l.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}}),l.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:he[e]}})]})}),Vn=({isNetworksLoading:e=!1})=>l.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:Ve,alt:"pf-logo-gif"})}),Lo=({title:e,titleId:t,...n})=>l.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?l.jsx("title",{id:t,children:e}):null,l.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"})]}),XA=({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?",l.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:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.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:[l.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:m}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.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"}),l.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"})]})]})]})},Eo=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>l.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),l.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:[l.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?"}),l.jsxs("div",{style:{display:"flex",gap:"5px"},children:[l.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),l.jsx("button",{style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"#F9830B",backgroundColor:"#F9830B",padding:"2px",fontWeight:"bold",color:"white"},onClick:async i=>{i.preventDefault(),i.stopPropagation(),r==="download"?(await n(),await o()):r==="copy"&&(await t(),await o()),e()},children:"Yes"})]})]})]}),QA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o,downloadingMolocoHtml:i})=>l.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:[l.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),l.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:l.jsxs("div",{style:{display:"flex",gap:"5px",flexDirection:"column"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"center"},children:[r?l.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:l.jsx("img",{width:"25px",height:"25px",src:Ve,alt:"pf-logo-gif"})}):l.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?l.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:l.jsx("img",{width:"25px",height:"25px",src:Ve,alt:"pf-logo-gif"})}):l.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"})]}),l.jsx("div",{style:{display:"flex",justifyContent:"center"},children:o?l.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:l.jsx("img",{width:"25px",height:"25px",src:Ve,alt:"pf-logo-gif"})}):l.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 PA(e,t,n,r){return(await fe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const VA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:m,versionId:c,api:s,handleDownloadError:d,fetchFileUrl:g,urls:q,game:p,setIsConfirmActive:h,creditDownload:y,getDownloadCount:K,disabled:O,user:J,setSafariCopyLink:Y,isTest:v,urlType:_})=>{const[$,F]=C.useState(!1),[le,ee]=C.useState(""),[Ae,Q]=C.useState(!1),[B,S]=C.useState(!1),[j,D]=C.useState(!1),[f,L]=C.useState("download"),[G,Z]=C.useState(!1),[I,M]=C.useState(!1),[k,z]=C.useState(!1);let V={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 x=()=>{n(e)},N=async(R,W)=>(F(!0),new Promise((se,Re)=>{tn(c,R,q,W,v,{urlType:_}).then(ve=>{F(!1),se(ve)}).catch(ve=>{F(!1),d(ve.message,ve),Re(ve)})})),P=async(R=!1)=>{R?M(!0):Z(!0);const W={molocoGenerateHtml:!1};R&&(W.molocoGenerateHtml=!0),tn(c,o,q,"download",v,W).then(se=>{R?M(!1):Z(!1),D(!1)}).catch(se=>{d(se.message,se)})},U=async()=>{z(!0);const R=await PA(s,c,o,m);let W=`${g}/${R==null?void 0:R.url}`;Pt(W)?(xt("Link Copied"),z(!1)):Y(W)},T=o==="moloco"||o==="molocoV2";return l.jsxs(l.Fragment,{children:[l.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?he[m]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+m,onClick:x,children:[l.jsxs("div",{style:{marginTop:o=="web"?"10px":"40px",display:"flex",justifyContent:"center"},children:[l.jsx("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:l.jsx("div",{children:i&&i.map(R=>R.network).includes(o)?a?l.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:l.jsx(HA,{typeOfProduct:m})}):i.map(R=>l.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:R.network===o?R.size.toString().slice(0,5)+"Mb":""},R.network)):null})}),l.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(m==="Playable"||m==="Ready"||m==="Flex")&&A&&l.jsx(So,{checked:r,typeOfProduct:m,id:e})}),l.jsx("img",{onClick:x,style:{width:"30rem",height:o=="web"?"80px":"50px",objectFit:"contain"},src:t})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[l.jsxs(Pn,{className:`${T?"w-1/2":"w-2/3"} border-hover-`+m,downloading:$,onClickDonwload:async R=>{if(R.stopPropagation(),T&&J.customer==="playableFactoryInternal"){D(!0);return}else{ee("download");const W=q.iosUrl,se=q.googleUrl;y&&y.willSpendCredit?(h(!0),L("download"),Q(!0)):["Playable","Flex"].includes(m)&&(!W||!se)||m==="Ready"&&_==="single"&&!W||m==="Ready"&&_==="multi"&&(!W||!se)?(h(!0),S(!0)):(S(!1),Q(!1),await N(o,"download"))}},children:[!$&&l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),T&&J.customer!=="playableFactoryInternal"?"TXT":"Download"]}),$&&l.jsx(Vn,{})]}),V[o]&&V[o].includes("copy")&&l.jsx(Pn,{className:"w-1/3 border-hover-"+m,onClickDonwload:async R=>{R.stopPropagation(),ee("copyLink");const W=q.iosUrl,se=q.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("copy"),h(!0),Q(!0)):m!=="Import"&&(!W||!se)?(h(!0),S(!0)):(Q(!1),S(!1),await N(o,"copy"))},disabled:O,children:l.jsx(zr,{className:"h-6 w-6 stroke-dark-full"})}),T&&J.customer!=="playableFactoryInternal"&&l.jsx(Pn,{className:"w-1/2 border-hover-"+m,onClickDonwload:async R=>{R.stopPropagation(),ee("download");const W=q.iosUrl,se=q.googleUrl;y&&(y!=null&&y.willSpendCredit)?(L("download"),h(!0),Q(!0)):m!=="Import"&&(!W||!se)?(h(!0),S(!0)):(Q(!1),S(!1),await P(!0))},disabled:O,children:l.jsxs(l.Fragment,{children:[l.jsx(Lo,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1rem",stroke:"dark-full"}}),"HTML"]})})]}),T&&l.jsx("img",{style:{position:"absolute",width:"135px",right:"0",top:"18px"},src:"https://home.playablefactory.app/recommended_badge.png"})]}),Ae&&l.jsx(Eo,{creditConfirmType:f,handleCopyLink:async()=>{S(!1),h(!1),await N(o,"copy")},download:async()=>{S(!1),h(!1),await N(o,"download")},onClose:()=>{Q(!1),h(!1)},getDownloadCount:K}),B&&l.jsx(XA,{onClose:()=>{S(!1),h(!1)},iosLink:q.iosUrl,googleLink:q.googleUrl,buttonType:le,handleCopyLink:async()=>{S(!1),h(!1),await N(o,"copy")},download:async()=>{S(!1),h(!1),await N(o,"download")},typeOfProduct:m,urlType:_}),j&&J.customer==="playableFactoryInternal"&&l.jsx(QA,{onClose:()=>{D(!1)},handleDownload:P,handleDownloadMolocoTest:U,downloadingMoloco:G,donwloadintMolocoTest:k,downloadingMolocoHtml:I})]})},nn=[{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:"22",name:"moloco",imageSrc:"https://home.playablefactory.com/moloco.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:"44",name:"molocoV2",imageSrc:"https://home.playablefactory.com/molocoV2.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"}],BA=({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:he[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return l.jsx("button",{onClick:r,className:n,style:o,children:e})},UA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>l.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?l.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:he[t]},children:l.jsx(Vn,{})}):l.jsx(BA,{typeOfProduct:t,onClick:n,children:l.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Download All"})})}),FA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:m,urls:c,game:s,getDownloadCount:d,disabled:g,setSafariCopyLink:q,isTest:p,urlType:h,allNetworksSelected:y,setAllNetworksSelected:K})=>{const[O,J]=C.useState([]),[Y,v]=C.useState([]),[_,$]=C.useState(!1),[F,le]=C.useState(""),[ee,Ae]=C.useState(!1),[Q,B]=C.useState(!1),[S,j]=C.useState("download"),[D,f]=C.useState(!1),L=async I=>{const M=[...O];if(O.includes(I)){const k=M.findIndex(z=>z===I);M.splice(k,1),J(M)}else M.push(I),J([...O,I]);nn.filter(k=>[...M].includes(k.id)).map(k=>k.name)},G=async()=>new Promise(async(I,M)=>{const k=nn.filter(z=>[...O].includes(z.id)).map(z=>z.name);Ae(!0),EA(r,c,k,{urlType:h}).then(z=>{Ae(!1),I(z)}).catch(z=>{console.log("get multi download err"),Ae(!1),A(z.message,z),M(z)})}),Z=async()=>{c.iosUrl,c.googleUrl,t&&t.willSpendCredit?(B(!0),j("download"),f(!0)):(f(!1),await G())};return C.useEffect(()=>{const I=nn.filter(M=>{var k;return t&&((k=t==null?void 0:t.networks)==null?void 0:k.length)>0?t==null?void 0:t.networks.includes(M.name):o==="Import"?e==null?void 0:e.networks.filter(z=>z.status==="paid").some(z=>z.name===M.name):e==null?void 0:e.networks.includes(M.name)}).filter(M=>M.name==="voodoo"?a.customer==="customer:20":!0).map(M=>M.id);J(y?I:[])},[y]),l.jsxs(l.Fragment,{children:[l.jsx("div",{style:{position:"relative",flex:1,overflowY:Q?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:l.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&nn.filter(I=>{var M;return t&&((M=t==null?void 0:t.networks)==null?void 0:M.length)>0?t==null?void 0:t.networks.includes(I.name):o==="Import"?e==null?void 0:e.networks.filter(k=>k.status==="paid").some(k=>k.name===I.name):e==null?void 0:e.networks.includes(I.name)}).filter(I=>I.name==="voodoo"?a.customer==="customer:20":!0).map(I=>{let M=I.imageSrc;if(I.name==="web"){let k="web_"+o.toLowerCase()+".png";M=M.replace("web.png",k)}return l.jsx(VA,{id:I.id,name:I.name,imageUrl:M,selected:O.includes(I.id),handleCardClick:L,networkVersionSize:Y,fileSizeLoading:_,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:m,urls:c,game:s,creditDownload:t,setIsConfirmActive:B,getDownloadCount:d,disabled:g,user:a,setSafariCopyLink:q,isTest:p,urlType:h},I.id)})})}),O.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&l.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:l.jsx(UA,{onClickMultiDownload:Z,networksVersionTotalSize:F,typeOfProduct:o,multiDownloading:ee})}),D&&l.jsx(Eo,{creditConfirmType:S,handleCopyLink:async()=>{},download:async()=>{f(!1),B(!1),await G()},onClose:()=>{f(!1),B(!1)},getDownloadCount:d})]})};async function _A(e,t){return(await fe.post(t+"/getFlexDownloadCount",e)).data}async function $A(e,t){try{return(await fe.post(t+"/findGame",{_id:e})).data}catch{}}async function es(e,t){return(await fe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function ts(e,t){return(await fe.post(t+"/getFlexData",{_id:e})).data}async function ns(e,t){return(await fe.post(t+"/getImportedPlayable",{id:e})).data}async function rs(e,t){return(await fe.post(t+"/getReadyDownloadCount",e)).data}const os=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],Oo=["web","adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"];let ko=null;const is=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:m,fetchFileUrl:c,fileSize:s,setFileSize:d,setSafariCopyLink:g,iosLink:q,androidLink:p,setIosLink:h,setAndroidLink:y,urlType:K,setUrlType:O})=>{const[J,Y]=C.useState(null),[v,_]=C.useState(null),[$,F]=C.useState(null),[le,ee]=C.useState(!1),[Ae,Q]=C.useState(!0),[B,S]=C.useState(window.innerWidth),[j,D]=C.useState(!1);console.log("download modal version: 6.0.22");const[f,L]=C.useState(!1);C.useEffect(()=>{},[f]),C.useEffect(()=>{const x=()=>{S(window.innerWidth)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[]);const G=async()=>{ee(!0);const x=await Qn(e,i);return x!=null&&x.networks||(x.networks=os),Y(x),x},Z=(x,N)=>{clearTimeout(ko),ko=setTimeout(()=>{console.log("Update URLS:"),Xn(t,{iosUrl:x,googleUrl:N},{urlType:K})},1e3)},I=x=>{h(x),Z(x,p)},M=x=>{y(x),Z(q,x)},k=async(x,N)=>{var P,U;console.log("getIosAndAndroidLink");try{let T;if(r==="Playable"||r==="Ready"){const R=await es(t,i);if(R){console.log("version",R),h(R.iosLink),y(R.androidLink),ee(!1);return}if(x&&(x.iosUrl||x.googleUrl)){h(x.iosUrl),y(x.googleUrl),ee(!1);return}if(N&&N.html){let W=await fetch(c+"/"+N.html).then(ve=>ve.text());const se=((P=W.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:P.at(1))||"";h(se);const Re=((U=W.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:U.at(1))||"";y(Re),ee(!1)}else y(""),h(""),ee(!1)}else if(r==="Flex"){const R=await ts(t,i);if(R.googleUrl||R.iosUrl){y(R.googleUrl),h(R.iosUrl),ee(!1);return}x&&(x.iosUrl||x.googleUrl)?(h(x.iosUrl),y(x.googleUrl),ee(!1)):(y(""),h(""),ee(!1))}}catch(T){m(T.response.data.error.msg)}},z=async()=>{ee(!0);let x;r==="Flex"?x=await _A({_id:t},i):r==="Ready"&&(x=await rs({_id:t},i)),x&&(["admin","pm","tester","sales"].includes(a.role)?F({...x,networks:Oo}):r==="Ready"&&!x.canDownload?F({...x,networks:Oo}):F(x)),ee(!1)},V=async()=>await $A(n,i);return C.useEffect(()=>{o||(Y(null),_(null),F(null),d(null)),o&&(r==="Playable"?(G().then(x=>{k(null,x)}),Q(!1)):r==="Ready"?z().then(x=>{G().then(N=>{k(null,N),Q(!1)})}):r==="Flex"?z().then(x=>{Q(!1),V().then(N=>{o&&(k(N,null),Q(!1),_(N))})}):r==="Import"&&ns(t,i).then(x=>{console.log(x),Y(x),h(x.iosUrl||""),y(x.googleUrl||""),ee(!1),Q(!1)}))},[n,e,t,o]),l.jsxs("div",{style:{display:"flex",height:B>1440?"700px":"650px",width:B>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[l.jsx(TA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:q,googleUrl:p},handleIosChange:I,handleGoogleChange:M,disabled:Ae,api:i,creditDownload:$,user:a,isTest:j,setIsTest:D,urlType:K,setUrlType:O,allNetworksSelected:f,setAllNetworksSelected:L}),le?l.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:l.jsx(Vn,{isNetworksLoading:!0})}):(J||$)&&(r==="Flex"?v:!0)&&!le&&q!=="Loading..."&&p!=="Loading..."&&l.jsx(FA,{playable:J,creditDownload:$,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:m,fetchFileUrl:c,urls:{iosUrl:q,googleUrl:p},game:v,getDownloadCount:z,disabled:Ae,setSafariCopyLink:g,isTest:j,urlType:K,allNetworksSelected:f,setAllNetworksSelected:L})]})},Dl="";var Bn={exports:{}},tt={},Un={exports:{}},Ee={},Fn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
|
|
51
51
|
* Adapted from jQuery UI core
|
|
52
52
|
*
|
|
53
53
|
* http://jqueryui.com
|