gearboxdownloadmodal 5.0.74 → 5.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -47,7 +47,7 @@ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var O=ge(D,U,z,Q,Y+"."+U
47
47
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&Ya[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ur=Symbol("internals");function yt(e){return e&&String(e).trim().toLowerCase()}function Rt(e){return e===!1||e==null?e:y.isArray(e)?e.map(Rt):String(e)}function ja(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 Ja=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Zn(e,t,n,r,o){if(y.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!y.isString(t)){if(y.isString(r))return t.indexOf(r)!==-1;if(y.isRegExp(r))return r.test(t)}}function Na(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Da(e,t){const n=y.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 Gt{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(A,c,m){const s=yt(c);if(!s)throw new Error("header name must be a non-empty string");const d=y.findKey(o,s);(!d||o[d]===void 0||m===!0||m===void 0&&o[d]!==!1)&&(o[d||c]=Rt(A))}const a=(A,c)=>y.forEach(A,(m,s)=>i(m,s,c));return y.isPlainObject(t)||t instanceof this.constructor?a(t,n):y.isString(t)&&(t=t.trim())&&!Ja(t)?a(za(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=yt(t),t){const r=y.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return ja(o);if(y.isFunction(n))return n.call(this,o,r);if(y.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=yt(t),t){const r=y.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Zn(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(a){if(a=yt(a),a){const A=y.findKey(r,a);A&&(!n||Zn(r,r[A],A,n))&&(delete r[A],o=!0)}}return y.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||Zn(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return y.forEach(this,(o,i)=>{const a=y.findKey(r,i);if(a){n[a]=Rt(o),delete n[i];return}const A=t?Na(i):String(i).trim();A!==i&&delete n[i],n[A]=Rt(o),r[A]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return y.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&y.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[Ur]=this[Ur]={accessors:{}}).accessors,o=this.prototype;function i(a){const A=yt(a);r[A]||(Da(o,a),r[A]=!0)}return y.isArray(t)?t.forEach(i):i(t),this}}Gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),y.reduceDescriptors(Gt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),y.freezeMethods(Gt);const Ne=Gt;function In(e,t){const n=this||Cn,r=t||n,o=Ne.from(r.headers);let i=r.data;return y.forEach(e,function(A){i=A.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Fr(e){return!!(e&&e.__CANCEL__)}function vt(e,t,n){_.call(this,e??"canceled",_.ERR_CANCELED,t,n),this.name="CanceledError"}y.inherits(vt,_,{__CANCEL__:!0});function Ra(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new _("Request failed with status code "+n.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Ga=je.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,a,A){const c=[];c.push(n+"="+encodeURIComponent(r)),y.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),y.isString(i)&&c.push("path="+i),y.isString(a)&&c.push("domain="+a),A===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ta(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ha(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function _r(e,t){return e&&!Ta(t)?Ha(e,t):t}const Xa=je.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=y.isString(a)?o(a):a;return A.protocol===r.protocol&&A.host===r.host}}():function(){return function(){return!0}}();function Qa(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Va(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(c){const m=Date.now(),s=r[i];a||(a=m),n[o]=c,r[o]=m;let d=i,v=0;for(;d!==o;)v+=n[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),m-a<t)return;const h=s&&m-s;return h?Math.round(v*1e3/h):void 0}}function $r(e,t){let n=0;const r=Va(50,250);return o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,A=i-n,c=r(A),m=i<=a;n=i;const s={loaded:i,total:a,progress:a?i/a:void 0,bytes:A,rate:c||void 0,estimated:c&&a&&m?(a-i)/c:void 0,event:o};s[t?"download":"upload"]=!0,e(s)}}const wn={http:ba,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let o=e.data;const i=Ne.from(e.headers).normalize(),a=e.responseType;let A;function c(){e.cancelToken&&e.cancelToken.unsubscribe(A),e.signal&&e.signal.removeEventListener("abort",A)}let m;y.isFormData(o)&&(je.isStandardBrowserEnv||je.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.getContentType(/^\s*multipart\/form-data/)?y.isString(m=i.getContentType())&&i.setContentType(m.replace(/^\s*(multipart\/form-data);+/,"$1")):i.setContentType("multipart/form-data"));let s=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",q=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(f+":"+q))}const d=_r(e.baseURL,e.url);s.open(e.method.toUpperCase(),Qr(d,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function v(){if(!s)return;const f=Ne.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),Z={data:!a||a==="text"||a==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:f,config:e,request:s};Ra(function(k){n(k),c()},function(k){r(k),c()},Z),s=null}if("onloadend"in s?s.onloadend=v:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(v)},s.onabort=function(){s&&(r(new _("Request aborted",_.ECONNABORTED,e,s)),s=null)},s.onerror=function(){r(new _("Network Error",_.ERR_NETWORK,e,s)),s=null},s.ontimeout=function(){let q=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const Z=e.transitional||Pr;e.timeoutErrorMessage&&(q=e.timeoutErrorMessage),r(new _(q,Z.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,e,s)),s=null},je.isStandardBrowserEnv){const f=(e.withCredentials||Xa(d))&&e.xsrfCookieName&&Ga.read(e.xsrfCookieName);f&&i.set(e.xsrfHeaderName,f)}o===void 0&&i.setContentType(null),"setRequestHeader"in s&&y.forEach(i.toJSON(),function(q,Z){s.setRequestHeader(Z,q)}),y.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),a&&a!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",$r(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",$r(e.onUploadProgress)),(e.cancelToken||e.signal)&&(A=f=>{s&&(r(!f||f.type?new vt(null,e,s):f),s.abort(),s=null)},e.cancelToken&&e.cancelToken.subscribe(A),e.signal&&(e.signal.aborted?A():e.signal.addEventListener("abort",A)));const h=Qa(d);if(h&&je.protocols.indexOf(h)===-1){r(new _("Unsupported protocol "+h+":",_.ERR_BAD_REQUEST,e));return}s.send(o||null)})}};y.forEach(wn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const eo=e=>`- ${e}`,Pa=e=>y.isFunction(e)||e===null||e===!1,to={getAdapter:e=>{e=y.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,!Pa(n)&&(r=wn[(a=String(n)).toLowerCase()],r===void 0))throw new _(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([A,c])=>`adapter ${A} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
49
49
  `+i.map(eo).join(`
50
- `):" "+eo(i[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:wn};function xn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vt(null,e)}function no(e){return xn(e),e.headers=Ne.from(e.headers),e.data=In.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),to.getAdapter(e.adapter||Cn.adapter)(e).then(function(r){return xn(e),r.data=In.call(e,e.transformResponse,r),r.headers=Ne.from(r.headers),r},function(r){return Fr(r)||(xn(e),r&&r.response&&(r.response.data=In.call(e,e.transformResponse,r.response),r.response.headers=Ne.from(r.response.headers))),Promise.reject(r)})}const ro=e=>e instanceof Ne?e.toJSON():e;function it(e,t){t=t||{};const n={};function r(m,s,d){return y.isPlainObject(m)&&y.isPlainObject(s)?y.merge.call({caseless:d},m,s):y.isPlainObject(s)?y.merge({},s):y.isArray(s)?s.slice():s}function o(m,s,d){if(y.isUndefined(s)){if(!y.isUndefined(m))return r(void 0,m,d)}else return r(m,s,d)}function i(m,s){if(!y.isUndefined(s))return r(void 0,s)}function a(m,s){if(y.isUndefined(s)){if(!y.isUndefined(m))return r(void 0,m)}else return r(void 0,s)}function A(m,s,d){if(d in t)return r(m,s);if(d in e)return r(void 0,m)}const c={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:(m,s)=>o(ro(m),ro(s),!0)};return y.forEach(Object.keys(Object.assign({},e,t)),function(s){const d=c[s]||o,v=d(e[s],t[s],s);y.isUndefined(v)&&d!==A||(n[s]=v)}),n}const oo="1.5.1",Kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const io={};Kn.transitional=function(t,n,r){function o(i,a){return"[Axios v"+oo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new _(o(a," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!io[a]&&(io[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 Ba(e,t,n){if(typeof e!="object")throw new _("options must be an object",_.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],c=A===void 0||a(A,i,e);if(c!==!0)throw new _("option "+i+" must be "+c,_.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _("Unknown option "+i,_.ERR_BAD_OPTION)}}const Wn={assertOptions:Ba,validators:Kn},He=Wn.validators;class Tt{constructor(t){this.defaults=t,this.interceptors={request:new Vr,response:new Vr}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=it(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Wn.assertOptions(r,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),o!=null&&(y.isFunction(o)?n.paramsSerializer={serialize:o}:Wn.assertOptions(o,{encode:He.function,serialize:He.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&y.merge(i.common,i[n.method]);i&&y.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=Ne.concat(a,i);const A=[];let c=!0;this.interceptors.request.forEach(function(q){typeof q.runWhen=="function"&&q.runWhen(n)===!1||(c=c&&q.synchronous,A.unshift(q.fulfilled,q.rejected))});const m=[];this.interceptors.response.forEach(function(q){m.push(q.fulfilled,q.rejected)});let s,d=0,v;if(!c){const f=[no.bind(this),void 0];for(f.unshift.apply(f,A),f.push.apply(f,m),v=f.length,s=Promise.resolve(n);d<v;)s=s.then(f[d++],f[d++]);return s}v=A.length;let h=n;for(d=0;d<v;){const f=A[d++],q=A[d++];try{h=f(h)}catch(Z){q.call(this,Z);break}}try{s=no.call(this,h)}catch(f){return Promise.reject(f)}for(d=0,v=m.length;d<v;)s=s.then(m[d++],m[d++]);return s}getUri(t){t=it(this.defaults,t);const n=_r(t.baseURL,t.url);return Qr(n,t.params,t.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(t){Tt.prototype[t]=function(n,r){return this.request(it(r||{},{method:t,url:n,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(it(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Tt.prototype[t]=n(),Tt.prototype[t+"Form"]=n(!0)});const Ht=Tt;class Mn{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 vt(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 Mn(function(o){t=o}),cancel:t}}}const Ua=Mn;function Fa(e){return function(n){return e.apply(null,n)}}function _a(e){return y.isObject(e)&&e.isAxiosError===!0}const Sn={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(Sn).forEach(([e,t])=>{Sn[t]=e});const $a=Sn;function ao(e){const t=new Ht(e),n=Sr(Ht.prototype.request,t);return y.extend(n,Ht.prototype,t,{allOwnKeys:!0}),y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ao(it(e,o))},n}const ce=ao(Cn);ce.Axios=Ht,ce.CanceledError=vt,ce.CancelToken=Ua,ce.isCancel=Fr,ce.VERSION=oo,ce.toFormData=Dt,ce.AxiosError=_,ce.Cancel=ce.CanceledError,ce.all=function(t){return Promise.all(t)},ce.spread=Fa,ce.isAxiosError=_a,ce.mergeConfig=it,ce.AxiosHeaders=Ne,ce.formToJSON=e=>Br(y.isHTMLForm(e)?new FormData(e):e),ce.getAdapter=to.getAdapter,ce.HttpStatusCode=$a,ce.default=ce;const eA=ce;/*! typescript-cookie v1.0.6 | MIT */const Ao=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),so=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Ln=decodeURIComponent,On=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function tA(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 lo(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 uo=Object.freeze({decodeName:Ln,decodeValue:On,encodeName:Ao,encodeValue:so}),En=Object.freeze({path:"/"});function co(e,t,n=En,{encodeValue:r=so,encodeName:o=Ao}={}){return document.cookie=`${o(e)}=${r(t,e)}${tA(n)}`}function mo(e,{decodeValue:t=On,decodeName:n=Ln}={}){return lo(e,t,n)}function nA({decodeValue:e=On,decodeName:t=Ln}={}){return lo(void 0,e,t)}function rA(e,t=En){co(e,"",Object.assign({},t,{expires:-1}))}function kn(e,t){const n={set:function(o,i,a){return co(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return nA(this.converter.read);if(o!=null)return mo(o,this.converter.read)},remove:function(o,i){rA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return kn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return kn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}kn({read:uo.decodeValue,write:uo.encodeValue},En);let po;typeof window<"u"&&(po=mo("token"));const pe=eA.create({headers:{Authorization:po}});async function oA(e,t){return e.network=="fb"&&(e.zip=1),(await pe.post(t+"/createFlexVersionLink",e||{})).data}async function iA(e,t,n){return(await pe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function aA(e,t,n){return(await pe.post(e+"/createPlayableVersionLink",{_id:t,network:n})).data}async function AA(e,t,n){return(await pe.post(e+"/createReadyVersionLink",{_id:t,network:n})).data}async function sA(e,t){return(await pe.post(t+"/updateFlexUrl",e||{})).data}async function lA(e,t,n){return(await pe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Yn(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 fo(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=fo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Xe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=fo(e))&&(r&&(r+=" "),r+=t);return r}const bt=e=>typeof e=="number"&&!isNaN(e),Pe=e=>typeof e=="string",ve=e=>typeof e=="function",Xt=e=>Pe(e)||ve(e)?e:null,zn=e=>C.isValidElement(e)||Pe(e)||ve(e)||bt(e);function uA(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 Qt(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:c,preventExitTransition:m,done:s,nodeRef:d,isIn:v}=a;const h=r?`${t}--${c}`:t,f=r?`${n}--${c}`:n,q=C.useRef(0);return C.useLayoutEffect(()=>{const Z=d.current,x=h.split(" "),k=R=>{R.target===d.current&&(Z.dispatchEvent(new Event("d")),Z.removeEventListener("animationend",k),Z.removeEventListener("animationcancel",k),q.current===0&&R.type!=="animationcancel"&&Z.classList.remove(...x))};Z.classList.add(...x),Z.addEventListener("animationend",k),Z.addEventListener("animationcancel",k)},[]),C.useEffect(()=>{const Z=d.current,x=()=>{Z.removeEventListener("animationend",x),o?uA(Z,s,i):s()};v||(m?x():(q.current=1,Z.className+=` ${f}`,Z.addEventListener("animationend",x)))},[v]),C.createElement(C.Fragment,null,A)}}function ho(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 xe={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)})}},Vt=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})},jn={info:function(e){return C.createElement(Vt,{...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(Vt,{...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(Vt,{...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(Vt,{...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 cA(e){const[,t]=C.useReducer(h=>h+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=h=>n.indexOf(h)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:h=>i.get(h)}).current;function c(h){let{containerId:f}=h;const{limit:q}=A.props;!q||f&&A.containerId!==f||(A.count-=A.queue.length,A.queue=[])}function m(h){r(f=>h==null?[]:f.filter(q=>q!==h))}function s(){const{toastContent:h,toastProps:f,staleId:q}=A.queue.shift();v(h,f,q)}function d(h,f){let{delay:q,staleId:Z,...x}=f;if(!zn(h)||function(V){return!o.current||A.props.enableMultiContainer&&V.containerId!==A.props.containerId||i.has(V.toastId)&&V.updateId==null}(x))return;const{toastId:k,updateId:R,data:S}=x,{props:b}=A,P=()=>m(k),ee=R==null;ee&&A.count++;const X={...b,style:b.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(x).filter(V=>{let[B,K]=V;return K!=null})),toastId:k,updateId:R,data:S,closeToast:P,isIn:!1,className:Xt(x.className||b.toastClassName),bodyClassName:Xt(x.bodyClassName||b.bodyClassName),progressClassName:Xt(x.progressClassName||b.progressClassName),autoClose:!x.isLoading&&(ne=x.autoClose,re=b.autoClose,ne===!1||bt(ne)&&ne>0?ne:re),deleteToast(){const V=ho(i.get(k),"removed");i.delete(k),xe.emit(4,V);const B=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),B>0){const K=k==null?A.props.limit:1;if(B===1||K===1)A.displayedToast++,s();else{const E=K>B?B:K;A.displayedToast=E;for(let J=0;J<E;J++)s()}}else t()}};var ne,re;X.iconOut=function(V){let{theme:B,type:K,isLoading:E,icon:J}=V,p=null;const M={theme:B,type:K};return J===!1||(ve(J)?p=J(M):C.isValidElement(J)?p=C.cloneElement(J,M):Pe(J)||bt(J)?p=J:E?p=jn.spinner():(W=>W in jn)(K)&&(p=jn[K](M))),p}(X),ve(x.onOpen)&&(X.onOpen=x.onOpen),ve(x.onClose)&&(X.onClose=x.onClose),X.closeButton=b.closeButton,x.closeButton===!1||zn(x.closeButton)?X.closeButton=x.closeButton:x.closeButton===!0&&(X.closeButton=!zn(b.closeButton)||b.closeButton);let Ae=h;C.isValidElement(h)&&!Pe(h.type)?Ae=C.cloneElement(h,{closeToast:P,toastProps:X,data:S}):ve(h)&&(Ae=h({closeToast:P,toastProps:X,data:S})),b.limit&&b.limit>0&&A.count>b.limit&&ee?A.queue.push({toastContent:Ae,toastProps:X,staleId:Z}):bt(q)?setTimeout(()=>{v(Ae,X,Z)},q):v(Ae,X,Z)}function v(h,f,q){const{toastId:Z}=f;q&&i.delete(q);const x={content:h,props:f};i.set(Z,x),r(k=>[...k,Z].filter(R=>R!==q)),xe.emit(4,ho(x,x.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,xe.cancelEmit(3).on(0,d).on(1,h=>o.current&&m(h)).on(5,c).emit(2,A),()=>{i.clear(),xe.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(h){const f=new Map,q=Array.from(i.values());return e.newestOnTop&&q.reverse(),q.forEach(Z=>{const{position:x}=Z.props;f.has(x)||f.set(x,[]),f.get(x).push(Z)}),Array.from(f,Z=>h(Z[0],Z[1]))},containerRef:o,isToastActive:a}}function qo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function go(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function dA(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:c,pauseOnHover:m,closeToast:s,onClick:d,closeOnClick:v}=e;function h(S){if(e.draggable){S.nativeEvent.type==="touchstart"&&S.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",k),document.addEventListener("touchmove",x),document.addEventListener("touchend",k);const b=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=b.getBoundingClientRect(),b.style.transition="",a.x=qo(S.nativeEvent),a.y=go(S.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=b.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=b.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function f(S){if(a.boundingRect){const{top:b,bottom:P,left:ee,right:X}=a.boundingRect;S.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=ee&&a.x<=X&&a.y>=b&&a.y<=P?Z():q()}}function q(){n(!0)}function Z(){n(!1)}function x(S){const b=i.current;a.canDrag&&b&&(a.didMove=!0,t&&Z(),a.x=qo(S),a.y=go(S),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),b.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,b.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",k);const S=i.current;if(a.canDrag&&a.didMove&&S){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();S.style.transition="transform 0.2s, opacity 0.2s",S.style.transform=`translate${e.draggableDirection}(0)`,S.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",q,{once:!0}),ve(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const S=A.current;ve(S.onClose)&&S.onClose(C.isValidElement(S.children)&&S.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||Z(),window.addEventListener("focus",q),window.addEventListener("blur",Z)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",q),window.removeEventListener("blur",Z))}),[e.pauseOnFocusLoss]);const R={onMouseDown:h,onTouchStart:h,onMouseUp:f,onTouchEnd:f};return c&&m&&(R.onMouseEnter=Z,R.onMouseLeave=q),v&&(R.onClick=S=>{d&&d(S),a.canCloseOnClick&&s()}),{playToast:q,pauseToast:Z,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:R}}function yo(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 mA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:c,progress:m,rtl:s,isIn:d,theme:v}=e;const h=i||c&&m===0,f={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:h?0:1};c&&(f.transform=`scaleX(${m})`);const q=Xe("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${v}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),Z=ve(a)?a({rtl:s,type:o,defaultClassName:q}):Xe(q,a);return C.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:Z,style:f,[c&&m>=1?"onTransitionEnd":"onAnimationEnd"]:c&&m<1?null:()=>{d&&r()}})}const pA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=dA(e),{closeButton:i,children:a,autoClose:A,onClick:c,type:m,hideProgressBar:s,closeToast:d,transition:v,position:h,className:f,style:q,bodyClassName:Z,bodyStyle:x,progressClassName:k,progressStyle:R,updateId:S,role:b,progress:P,rtl:ee,toastId:X,deleteToast:ne,isIn:re,isLoading:Ae,iconOut:V,closeOnClick:B,theme:K}=e,E=Xe("Toastify__toast",`Toastify__toast-theme--${K}`,`Toastify__toast--${m}`,{"Toastify__toast--rtl":ee},{"Toastify__toast--close-on-click":B}),J=ve(f)?f({rtl:ee,position:h,type:m,defaultClassName:E}):Xe(E,f),p=!!P||!A,M={closeToast:d,type:m,theme:K};let W=null;return i===!1||(W=ve(i)?i(M):C.isValidElement(i)?C.cloneElement(i,M):yo(M)),C.createElement(v,{isIn:re,done:ne,position:h,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:X,onClick:c,className:J,...o,style:q,ref:r},C.createElement("div",{...re&&{role:b},className:ve(Z)?Z({type:m}):Xe("Toastify__toast-body",Z),style:x},V!=null&&C.createElement("div",{className:Xe("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Ae})},V),C.createElement("div",null,a)),W,C.createElement(mA,{...S&&!p?{key:`pb-${S}`}:{},rtl:ee,theme:K,delay:A,isRunning:t,isIn:re,closeToast:d,hide:s,type:m,style:R,className:k,controlledProgress:p,progress:P||0})))},Pt=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},fA=Qt(Pt("bounce",!0));Qt(Pt("slide",!0)),Qt(Pt("zoom")),Qt(Pt("flip"));const Jn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=cA(e),{className:i,style:a,rtl:A,containerId:c}=e;function m(s){const d=Xe("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return ve(i)?i({position:s,rtl:A,defaultClassName:d}):Xe(d,Xt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:c},n((s,d)=>{const v=d.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:m(s),style:v,key:`container-${s}`},d.map((h,f)=>{let{content:q,props:Z}=h;return C.createElement(pA,{...Z,isIn:o(Z.toastId),style:{...Z.style,"--nth":f+1,"--len":d.length},key:`toast-${Z.key}`},q)}))}))});Jn.displayName="ToastContainer",Jn.defaultProps={position:"top-right",transition:fA,autoClose:5e3,closeButton:yo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Nn,Be=new Map,Ct=[],hA=1;function vo(){return""+hA++}function qA(e){return e&&(Pe(e.toastId)||bt(e.toastId))?e.toastId:vo()}function Zt(e,t){return Be.size>0?xe.emit(0,e,t):Ct.push({content:e,options:t}),t.toastId}function Bt(e,t){return{...t,type:t&&t.type||e,toastId:qA(t)}}function Ut(e){return(t,n)=>Zt(t,Bt(e,n))}function le(e,t){return Zt(e,Bt("default",t))}le.loading=(e,t)=>Zt(e,Bt("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),le.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=Pe(o)?le.loading(o,n):le.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(s,d,v)=>{if(d==null)return void le.dismiss(r);const h={type:s,...A,...n,data:v},f=Pe(d)?{render:d}:d;return r?le.update(r,{...h,...f}):le(f.render,{...h,...f}),v},m=ve(e)?e():e;return m.then(s=>c("success",a,s)).catch(s=>c("error",i,s)),m},le.success=Ut("success"),le.info=Ut("info"),le.error=Ut("error"),le.warning=Ut("warning"),le.warn=le.warning,le.dark=(e,t)=>Zt(e,Bt("default",{theme:"dark",...t})),le.dismiss=e=>{Be.size>0?xe.emit(1,e):Ct=Ct.filter(t=>e!=null&&t.options.toastId!==e)},le.clearWaitingQueue=function(e){return e===void 0&&(e={}),xe.emit(5,e)},le.isActive=e=>{let t=!1;return Be.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},le.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=Be.get(i||Nn);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:vo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,Zt(a,i)}},0)},le.done=e=>{le.update(e,{progress:1})},le.onChange=e=>(xe.on(4,e),()=>{xe.off(4,e)}),le.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"},le.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},xe.on(2,e=>{Nn=e.containerId||e,Be.set(Nn,e),Ct.forEach(t=>{xe.emit(0,t.content,t.options)}),Ct=[]}).on(3,e=>{Be.delete(e.containerId||e),Be.size===0&&xe.off(0).off(1).off(5)});function It(e){le.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Dn="";const gA=e=>{let t=Dn+"/"+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),It("Download successfully")}).catch(r=>{console.error("File error:",r)})},yA=(e,t)=>{let n=Dn+"/"+e;Yn(n)?It("Link Copied"):t(n)};async function Ft(e,t,n,r,o,i="download",a){return new Promise(async(A,c)=>{let m=s=>{i==="download"?gA(s):i==="copy"&&yA(s,a)};e==="Playable"?(r&&await lA(t,{iosLink:r==null?void 0:r.iosUrl,androidLink:r==null?void 0:r.googleUrl},o),aA(o,t,n).then(async s=>{let{url:d}=s;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)})):e==="Flex"?(r&&await sA({_id:t,iosLink:r==null?void 0:r.iosUrl,androidLink:r==null?void 0:r.googleUrl},o),oA({_id:t,network:n},o).then(async s=>{let{url:d}=s;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)})):e==="Import"?iA(o,t,n).then(s=>{let d=s.url;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)}):e==="Ready"&&AA(o,t,n).then(s=>{let d=s.url;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)})})}function vA(e){Dn=e}const bA=({versionId:e,typeOfProduct:t,api:n,fetchFileUrl:r,copyLinkUrl:o,setSafariCopyLink:i})=>{const[a,A]=C.useState(!1),c=async()=>{A(!0),Ft(t,e,"default",null,n,"copy",i).then(m=>{A(!1)}).catch(m=>{A(!1)})};return u.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[u.jsx("div",{style:{marginRight:"0.75rem",width:"50%"},children:u.jsx(Ri,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:`${o}/preview?versionId=${e}`+(t==="Flex"?"":"_")})}),u.jsxs("div",{children:[u.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),u.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),u.jsxs("div",{style:{display:"flex",cursor:"pointer",borderRadius:"0.375rem",backgroundColor:"#00A3FF1A",color:"secondary-blue"},children:[u.jsx(Mr,{style:{marginRight:"0.25rem",height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),a?u.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",margin:"auto"},children:u.jsx("img",{style:{height:"90%"},src:rt,alt:"loading"})}):u.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},onClick:c,children:"Copy Link"})]})]})]})},CA=({versionName:e,versionId:t,typeOfProduct:n,api:r,iframeUrl:o,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})=>{const[c,m]=C.useState(window.innerWidth);C.useEffect(()=>{const d=()=>{m(window.innerWidth)};return window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[]);const s=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return u.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:c>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[u.jsx(ii,{iframeUrl:o}),u.jsx(ai,{name:s}),u.jsx(bA,{versionId:t,typeOfProduct:n,api:r,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})]})};var me=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(me||{});const ZA=({typeOfProduct:e})=>u.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold"},children:[u.jsx("span",{style:{color:me[e]},children:"Select a Network"}),u.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]});async function IA(e,t){return(await pe.post(t+"/buyRequest",{requestType:e})).data}const wA=()=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[u.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),u.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_518_12094",children:u.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),xA=({creditDownload:e,api:t})=>u.jsxs(u.Fragment,{children:[u.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."}),u.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"," ",u.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.",u.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>IA("Flex Credit",t).then(n=>It("You will be contacted regarding your request.")),children:["Get more",u.jsx(wA,{})]})]})]}),KA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A})=>{const c=s=>{r(s.target.value)},m=s=>{o(s.target.value)};return u.jsxs(u.Fragment,{children:[t&&u.jsxs("span",{style:{fontSize:"16px",fontWeight:"bold"},children:["File size: ",parseFloat(t).toFixed(2)," mb"]}),e!=="Import"&&u.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[u.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[u.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"App Store:"}),u.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:me[e]},type:"text",value:n.iosUrl,onChange:c,placeholder:"Ios Url",disabled:i})]}),u.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[u.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Google Play:"," "]}),u.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:me[e]},type:"text",value:n.googleUrl,onChange:m,placeholder:"Google Url",disabled:i})]}),(A==null?void 0:A.willSpendCredit)&&u.jsx(xA,{creditDownload:A,api:a})]})]})},WA=({typeOfProduct:e,title:t})=>u.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:u.jsx("span",{style:{color:me[e]},children:t})}),MA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:c})=>u.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:"1rem"},children:[u.jsx(WA,{typeOfProduct:e,title:r}),u.jsx(KA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:c}),u.jsx(ZA,{typeOfProduct:e})]}),bo=({fill:e,stroke:t,className:n,style:r})=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:e,stroke:t,strokeWidth:n,style:r,className:"w-6 h-6",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.563.563 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.563.563 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5z"})}),Co=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>u.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}),SA=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return u.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:u.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[u.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}),u.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:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:me[t],stroke:me[t],strokeWidth:"1",children:u.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"})})," "]})]})})},kl="",LA=({typeOfProduct:e})=>u.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:u.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}}),u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}}),u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}}),u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}})]})}),Rn=({isNetworksLoading:e=!1})=>u.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:u.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:rt,alt:"pf-logo-gif"})}),OA=({title:e,titleId:t,...n})=>u.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?u.jsx("title",{id:t,children:e}):null,u.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"})]}),EA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i})=>{let a="";return!t&&!n?a="Both links are empty. Are you sure you want to continue?":t?n||(a="Google link is empty. Are you sure you want to continue?"):a="iOS link is empty. Are you sure you want to continue?",u.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:[u.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),u.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:[u.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:a}),u.jsxs("div",{style:{display:"flex",gap:"5px"},children:[u.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"}),u.jsx("button",{onClick:async A=>{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"})]})]})]})},Zo=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>u.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[u.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),u.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:[u.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?"}),u.jsxs("div",{style:{display:"flex",gap:"5px"},children:[u.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),u.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"})]})]})]}),kA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o})=>u.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:[u.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),u.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:u.jsxs("div",{style:{display:"flex",gap:"5px"},children:[r?u.jsx("div",{style:{flex:1,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"},children:u.jsx("img",{width:"25px",height:"25px",src:rt,alt:"pf-logo-gif"})}):u.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear"},children:"Download"}),o?u.jsx("div",{style:{flex:1,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"},children:u.jsx("img",{width:"25px",height:"25px",src:rt,alt:"pf-logo-gif"})}):u.jsx("button",{onClick:n,style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear"},children:"Download Moloco Test"})]})})]});async function YA(e,t,n,r){return(await pe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const zA=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],jA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:c,versionId:m,api:s,handleDownloadError:d,fetchFileUrl:v,urls:h,game:f,setIsConfirmActive:q,creditDownload:Z,getDownloadCount:x,disabled:k,user:R,setSafariCopyLink:S})=>{const[b,P]=C.useState(!1),[ee,X]=C.useState(""),[ne,re]=C.useState(!1),[Ae,V]=C.useState(!1),[B,K]=C.useState(!1),[E,J]=C.useState("download"),[p,M]=C.useState(!1),[W,g]=C.useState(!1);let w={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"};const N=()=>{n(e)},j=async(Y,D)=>{P(!0),Ft(c,m,Y,h,s,D,S).then(G=>{P(!1)}).catch(G=>{P(!1),d(G)})},z=async()=>{M(!0),Ft(c,m,o,h,s,"download",S).then(Y=>{M(!1),K(!1)}).catch(Y=>{d(Y)})},Q=async()=>{g(!0);const Y=await YA(s,m,o,c);let D=`${v}/${Y==null?void 0:Y.url}`;Yn(D)?(It("Link Copied"),g(!1)):S(D)};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?me[c]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+c,onClick:N,children:[u.jsxs("div",{style:{marginTop:"40px",display:"flex",justifyContent:"center"},children:[u.jsxs("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:[zA.includes(o)&&c!=="Import"&&u.jsx(bo,{fill:me[c],stroke:me[c],className:"mb-1 inline-block w-6",style:{marginBottom:"0.25rem",display:"inline-block",width:"1.5rem"}}),u.jsx("div",{children:i&&i.map(Y=>Y.network).includes(o)?a?u.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:u.jsx(LA,{typeOfProduct:c})}):i.map(Y=>u.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:Y.network===o?Y.size.toString().slice(0,5)+"Mb":""},Y.network)):null})]}),u.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(c==="Playable"||c==="Ready"||c==="Flex")&&A&&u.jsx(SA,{checked:r,typeOfProduct:c,id:e})}),u.jsx("img",{onClick:N,style:{width:"30rem",height:"50px",objectFit:"contain"},src:t})]}),u.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[u.jsxs(Co,{className:"w-2/3 border-hover-"+c,downloading:b,onClickDonwload:async Y=>{if(Y.stopPropagation(),(o==="moloco"||o==="molocoV2")&&R.customer==="playableFactoryInternal"){K(!0);return}else{X("download");const D=h.iosUrl,G=h.googleUrl;Z&&Z.willSpendCredit?(q(!0),J("download"),re(!0)):c!=="Import"&&(!D||!G)?(q(!0),V(!0)):(V(!1),re(!1),j(o,"download"))}},children:[!b&&u.jsxs(u.Fragment,{children:[u.jsx(OA,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1.5rem",stroke:"dark-full"}}),"Download"]}),b&&u.jsx(Rn,{})]}),w[o].includes("copy")&&u.jsx(Co,{className:"w-1/3 border-hover-"+c,onClickDonwload:async Y=>{Y.stopPropagation(),X("copyLink");const D=h.iosUrl,G=h.googleUrl;Z&&(Z!=null&&Z.willSpendCredit)?(J("copy"),q(!0),re(!0)):c!=="Import"&&(!D||!G)?(q(!0),V(!0)):(re(!1),V(!1),j(o,"copy"))},disabled:k,children:u.jsx(Mr,{className:"h-6 w-6 stroke-dark-full"})})]})]}),ne&&u.jsx(Zo,{creditConfirmType:E,handleCopyLink:async()=>{V(!1),q(!1),j(o,"copy")},download:async()=>{V(!1),q(!1),j(o,"download")},onClose:()=>{re(!1),q(!1)},getDownloadCount:x}),Ae&&u.jsx(EA,{onClose:()=>{V(!1),q(!1)},iosLink:h.iosUrl,googleLink:h.googleUrl,buttonType:ee,handleCopyLink:async()=>{V(!1),q(!1),j(o,"copy")},download:async()=>{V(!1),q(!1),j(o,"download")}}),B&&R.customer==="playableFactoryInternal"&&u.jsx(kA,{onClose:()=>{K(!1)},handleDownload:z,handleDownloadMolocoTest:Q,downloadingMoloco:p,donwloadintMolocoTest:W})]})},Gn=[{id:"1",name:"unity",imageSrc:"https://gearbox.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://gearbox.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://gearbox.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://gearbox.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://gearbox.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://gearbox.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://gearbox.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://gearbox.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://gearbox.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://gearbox.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://gearbox.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://gearbox.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://gearbox.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://gearbox.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://gearbox.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://gearbox.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://gearbox.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://gearbox.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://gearbox.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://gearbox.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://gearbox.playablefactory.com/liftoff.png"},{id:"22",name:"moloco",imageSrc:"https://gearbox.playablefactory.com/moloco.png"},{id:"23",name:"nucleo",imageSrc:"https://gearbox.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://gearbox.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://gearbox.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://gearbox.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://gearbox.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://gearbox.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://gearbox.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://gearbox.playablefactory.com/yandex.png"},{id:"33",name:"web",imageSrc:"https://gearbox.playablefactory.com/web.png"},{id:"34",name:"zucks",imageSrc:"https://gearbox.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://gearbox.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://gearbox.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://gearbox.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://gearbox.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://gearbox.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://gearbox.playablefactory.com/adjoe.png"},{id:"44",name:"molocoV2",imageSrc:"https://gearbox.playablefactory.com/molocoV2.png"},{id:"45",name:"adikteev",imageSrc:"https://gearbox.playablefactory.com/adikteev.png"}],JA=({typeOfProduct:e})=>u.jsx("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem"},children:u.jsx("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"0.875rem",fontWeight:"bold",height:"1.5rem"},children:e!=="Import"&&u.jsxs(u.Fragment,{children:[u.jsx(bo,{fill:me[e],stroke:me[e],style:{display:"inline-block",width:"1.5rem"},className:""}),u.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Data tracking functionality is turned on by default for marked network downloads"})]})})}),NA=({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:me[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return u.jsx("button",{onClick:r,className:n,style:o,children:e})},DA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>u.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?u.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:me[t]},children:u.jsx(Rn,{})}):u.jsx(NA,{typeOfProduct:t,onClick:n,children:u.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Multi Download"})})});async function RA(e,t,n){return(await pe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function GA(e,t,n){return(await pe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}const TA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:c,urls:m,game:s,getDownloadCount:d,disabled:v,setSafariCopyLink:h})=>{const[f,q]=C.useState([]),[Z,x]=C.useState([]),[k,R]=C.useState(!1),[S,b]=C.useState(""),[P,ee]=C.useState(!1),[X,ne]=C.useState(!1),[re,Ae]=C.useState("download"),[V,B]=C.useState(!1),K=async p=>{const M=[...f];if(f.includes(p)){const W=M.findIndex(g=>g===p);M.splice(W,1),q(M)}else M.push(p),q([...f,p]);Gn.filter(W=>[...M].includes(W.id)).map(W=>W.name)},E=async()=>{try{const p=Gn.filter(N=>[...f].includes(N.id)).map(N=>N.name);ee(!0);let M;o==="Flex"?M=await GA(r,p,i):M=await RA(r,p,i);const{url:W}=M;let g;const w=c+"/"+W;g=document.createElement("iframe"),g.setAttribute("src",w),g.style.display="none",document.body.appendChild(g),g.click(),ee(!1),It("Multi downloaded completed successfully")}catch(p){ee(!1),A(p.response.data.error.msg),console.error(p)}},J=async()=>{m.iosUrl,m.googleUrl,t&&t.willSpendCredit?(ne(!0),Ae("download"),B(!0)):(B(!1),await E())};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{position:"relative",flex:1,overflowY:X?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:[u.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&Gn.filter(p=>{var M;return t&&((M=t==null?void 0:t.networks)==null?void 0:M.length)>0?t==null?void 0:t.networks.includes(p.name):o==="Import"?e==null?void 0:e.networks.filter(W=>W.status==="paid").some(W=>W.name===p.name):e==null?void 0:e.networks.includes(p.name)}).filter(p=>p.name==="voodoo"?a.customer==="customer:20":!0).map(p=>u.jsx(jA,{id:p.id,name:p.name,imageUrl:p.imageSrc,selected:f.includes(p.id),handleCardClick:K,networkVersionSize:Z,fileSizeLoading:k,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:c,urls:m,game:s,creditDownload:t,setIsConfirmActive:ne,getDownloadCount:d,disabled:v,user:a,setSafariCopyLink:h},p.id))}),u.jsx(JA,{typeOfProduct:o})]}),f.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&u.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:u.jsx(DA,{onClickMultiDownload:J,networksVersionTotalSize:S,typeOfProduct:o,multiDownloading:P})}),V&&u.jsx(Zo,{creditConfirmType:re,handleCopyLink:async()=>{},download:async()=>{B(!1),ne(!1),await E()},onClose:()=>{B(!1),ne(!1)},getDownloadCount:d})]})};async function HA(e,t){return(await pe.post(t+"/findPlayable",{_id:e})).data}async function XA(e,t){return(await pe.post(t+"/getFlexDownloadCount",e)).data}async function QA(e,t){try{return(await pe.post(t+"/findGame",{_id:e})).data}catch{}}async function VA(e,t){return(await pe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function PA(e,t){return(await pe.post(t+"/getFlexData",{_id:e})).data}async function BA(e,t){return(await pe.post(t+"/getImportedPlayable",{id:e})).data}async function UA(e,t){return(await pe.post(t+"/getReadyDownloadCount",e)).data}const FA=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],_A=["adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"],$A=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:c,fetchFileUrl:m,fileSize:s,setFileSize:d,setSafariCopyLink:v})=>{const[h,f]=C.useState(null),[q,Z]=C.useState(null),[x,k]=C.useState(null),[R,S]=C.useState(!1),[b,P]=C.useState("Loading..."),[ee,X]=C.useState("Loading..."),[ne,re]=C.useState(!0),[Ae,V]=C.useState(window.innerWidth);C.useEffect(()=>{const W=()=>{V(window.innerWidth)};return window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}},[]);const B=async()=>{S(!0);const W=await HA(e,i);return W!=null&&W.networks||(W.networks=FA),f(W),W},K=W=>{P(W)},E=W=>{X(W)},J=async(W,g)=>{var w,N;try{let j;if(r==="Playable"||r==="Ready"){const z=await VA(t,i);if(z){P(z.iosLink),X(z.androidLink),S(!1);return}if(W&&(W.iosUrl||W.googleUrl)){P(W.iosUrl),X(W.googleUrl),S(!1);return}if(g&&g.html){let Q=await fetch(m+"/"+g.html).then(G=>G.text());const Y=((w=Q.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:w.at(1))||"";P(Y);const D=((N=Q.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:N.at(1))||"";X(D),S(!1)}else X(""),P(""),S(!1)}else if(r==="Flex"){const z=await PA(t,i);if(z.googleUrl||z.iosUrl){X(z.googleUrl),P(z.iosUrl),S(!1);return}W&&(W.iosUrl||W.googleUrl)?(P(W.iosUrl),X(W.googleUrl),S(!1)):(X(""),P(""),S(!1))}}catch(j){c(j.response.data.error.msg)}},p=async()=>{S(!0);let W;r==="Flex"?W=await XA({_id:t},i):r==="Ready"&&(W=await UA({_id:t},i)),W&&(["admin","pm","tester"].includes(a.role)?k({...W,networks:_A}):k(W)),S(!1)},M=async()=>await QA(n,i);return C.useEffect(()=>{o||(f(null),Z(null),k(null),d(null)),o&&(r==="Playable"||r==="Ready"?(B().then(W=>{J(null,W)}),re(!1)):r==="Flex"?p().then(W=>{re(!1),M().then(g=>{o&&(J(g,null),re(!1),Z(g))})}):r==="Import"&&BA(t,i).then(W=>{console.log(W),f(W),P(W.iosUrl||""),X(W.googleUrl||""),S(!1),re(!1)}))},[n,e,t,o]),u.jsxs("div",{style:{display:"flex",height:Ae>1440?"700px":"650px",width:Ae>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[u.jsx(MA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:b,googleUrl:ee},handleIosChange:K,handleGoogleChange:E,disabled:ne,api:i,creditDownload:x}),R?u.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:u.jsx(Rn,{isNetworksLoading:!0})}):(h||x)&&(r==="Flex"?q:!0)&&!R&&b!=="Loading..."&&ee!=="Loading..."&&u.jsx(TA,{playable:h,creditDownload:x,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:c,fetchFileUrl:m,urls:{iosUrl:b,googleUrl:ee},game:q,getDownloadCount:p,disabled:ne,setSafariCopyLink:v})]})},Yl="";var Tn={exports:{}},Ue={},Hn={exports:{}},Se={},Xn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*!
50
+ `):" "+eo(i[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:wn};function xn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vt(null,e)}function no(e){return xn(e),e.headers=Ne.from(e.headers),e.data=In.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),to.getAdapter(e.adapter||Cn.adapter)(e).then(function(r){return xn(e),r.data=In.call(e,e.transformResponse,r),r.headers=Ne.from(r.headers),r},function(r){return Fr(r)||(xn(e),r&&r.response&&(r.response.data=In.call(e,e.transformResponse,r.response),r.response.headers=Ne.from(r.response.headers))),Promise.reject(r)})}const ro=e=>e instanceof Ne?e.toJSON():e;function it(e,t){t=t||{};const n={};function r(m,s,d){return y.isPlainObject(m)&&y.isPlainObject(s)?y.merge.call({caseless:d},m,s):y.isPlainObject(s)?y.merge({},s):y.isArray(s)?s.slice():s}function o(m,s,d){if(y.isUndefined(s)){if(!y.isUndefined(m))return r(void 0,m,d)}else return r(m,s,d)}function i(m,s){if(!y.isUndefined(s))return r(void 0,s)}function a(m,s){if(y.isUndefined(s)){if(!y.isUndefined(m))return r(void 0,m)}else return r(void 0,s)}function A(m,s,d){if(d in t)return r(m,s);if(d in e)return r(void 0,m)}const c={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:(m,s)=>o(ro(m),ro(s),!0)};return y.forEach(Object.keys(Object.assign({},e,t)),function(s){const d=c[s]||o,v=d(e[s],t[s],s);y.isUndefined(v)&&d!==A||(n[s]=v)}),n}const oo="1.5.1",Kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const io={};Kn.transitional=function(t,n,r){function o(i,a){return"[Axios v"+oo+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,A)=>{if(t===!1)throw new _(o(a," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!io[a]&&(io[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 Ba(e,t,n){if(typeof e!="object")throw new _("options must be an object",_.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],c=A===void 0||a(A,i,e);if(c!==!0)throw new _("option "+i+" must be "+c,_.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _("Unknown option "+i,_.ERR_BAD_OPTION)}}const Wn={assertOptions:Ba,validators:Kn},He=Wn.validators;class Tt{constructor(t){this.defaults=t,this.interceptors={request:new Vr,response:new Vr}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=it(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Wn.assertOptions(r,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),o!=null&&(y.isFunction(o)?n.paramsSerializer={serialize:o}:Wn.assertOptions(o,{encode:He.function,serialize:He.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&y.merge(i.common,i[n.method]);i&&y.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=Ne.concat(a,i);const A=[];let c=!0;this.interceptors.request.forEach(function(q){typeof q.runWhen=="function"&&q.runWhen(n)===!1||(c=c&&q.synchronous,A.unshift(q.fulfilled,q.rejected))});const m=[];this.interceptors.response.forEach(function(q){m.push(q.fulfilled,q.rejected)});let s,d=0,v;if(!c){const f=[no.bind(this),void 0];for(f.unshift.apply(f,A),f.push.apply(f,m),v=f.length,s=Promise.resolve(n);d<v;)s=s.then(f[d++],f[d++]);return s}v=A.length;let h=n;for(d=0;d<v;){const f=A[d++],q=A[d++];try{h=f(h)}catch(Z){q.call(this,Z);break}}try{s=no.call(this,h)}catch(f){return Promise.reject(f)}for(d=0,v=m.length;d<v;)s=s.then(m[d++],m[d++]);return s}getUri(t){t=it(this.defaults,t);const n=_r(t.baseURL,t.url);return Qr(n,t.params,t.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(t){Tt.prototype[t]=function(n,r){return this.request(it(r||{},{method:t,url:n,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,A){return this.request(it(A||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Tt.prototype[t]=n(),Tt.prototype[t+"Form"]=n(!0)});const Ht=Tt;class Mn{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 vt(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 Mn(function(o){t=o}),cancel:t}}}const Ua=Mn;function Fa(e){return function(n){return e.apply(null,n)}}function _a(e){return y.isObject(e)&&e.isAxiosError===!0}const Sn={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(Sn).forEach(([e,t])=>{Sn[t]=e});const $a=Sn;function ao(e){const t=new Ht(e),n=Sr(Ht.prototype.request,t);return y.extend(n,Ht.prototype,t,{allOwnKeys:!0}),y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return ao(it(e,o))},n}const ce=ao(Cn);ce.Axios=Ht,ce.CanceledError=vt,ce.CancelToken=Ua,ce.isCancel=Fr,ce.VERSION=oo,ce.toFormData=Dt,ce.AxiosError=_,ce.Cancel=ce.CanceledError,ce.all=function(t){return Promise.all(t)},ce.spread=Fa,ce.isAxiosError=_a,ce.mergeConfig=it,ce.AxiosHeaders=Ne,ce.formToJSON=e=>Br(y.isHTMLForm(e)?new FormData(e):e),ce.getAdapter=to.getAdapter,ce.HttpStatusCode=$a,ce.default=ce;const eA=ce;/*! typescript-cookie v1.0.6 | MIT */const Ao=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),so=e=>encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent),Ln=decodeURIComponent,On=e=>(e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent));function tA(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 lo(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 uo=Object.freeze({decodeName:Ln,decodeValue:On,encodeName:Ao,encodeValue:so}),En=Object.freeze({path:"/"});function co(e,t,n=En,{encodeValue:r=so,encodeName:o=Ao}={}){return document.cookie=`${o(e)}=${r(t,e)}${tA(n)}`}function mo(e,{decodeValue:t=On,decodeName:n=Ln}={}){return lo(e,t,n)}function nA({decodeValue:e=On,decodeName:t=Ln}={}){return lo(void 0,e,t)}function rA(e,t=En){co(e,"",Object.assign({},t,{expires:-1}))}function kn(e,t){const n={set:function(o,i,a){return co(o,i,Object.assign({},this.attributes,a),{encodeValue:this.converter.write})},get:function(o){if(arguments.length===0)return nA(this.converter.read);if(o!=null)return mo(o,this.converter.read)},remove:function(o,i){rA(o,Object.assign({},this.attributes,i))},withAttributes:function(o){return kn(this.converter,Object.assign({},this.attributes,o))},withConverter:function(o){return kn(Object.assign({},this.converter,o),this.attributes)}},r={attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}};return Object.create(n,r)}kn({read:uo.decodeValue,write:uo.encodeValue},En);let po;typeof window<"u"&&(po=mo("token"));const pe=eA.create({headers:{Authorization:po}});async function oA(e,t){return e.network=="fb"&&(e.zip=1),(await pe.post(t+"/createFlexVersionLink",e||{})).data}async function iA(e,t,n){return(await pe.post(e+"/createImportedVersionLink",{_id:t,network:n})).data}async function aA(e,t,n){return(await pe.post(e+"/createPlayableVersionLink",{_id:t,network:n})).data}async function AA(e,t,n){return(await pe.post(e+"/createReadyVersionLink",{_id:t,network:n})).data}async function sA(e,t){return(await pe.post(t+"/updateFlexUrl",e||{})).data}async function lA(e,t,n){return(await pe.post(n+"/updatePlayableVersion",{...t,_id:e})).data}function Yn(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 fo(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=fo(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Xe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=fo(e))&&(r&&(r+=" "),r+=t);return r}const bt=e=>typeof e=="number"&&!isNaN(e),Pe=e=>typeof e=="string",ve=e=>typeof e=="function",Xt=e=>Pe(e)||ve(e)?e:null,zn=e=>C.isValidElement(e)||Pe(e)||ve(e)||bt(e);function uA(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 Qt(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:A,position:c,preventExitTransition:m,done:s,nodeRef:d,isIn:v}=a;const h=r?`${t}--${c}`:t,f=r?`${n}--${c}`:n,q=C.useRef(0);return C.useLayoutEffect(()=>{const Z=d.current,x=h.split(" "),k=R=>{R.target===d.current&&(Z.dispatchEvent(new Event("d")),Z.removeEventListener("animationend",k),Z.removeEventListener("animationcancel",k),q.current===0&&R.type!=="animationcancel"&&Z.classList.remove(...x))};Z.classList.add(...x),Z.addEventListener("animationend",k),Z.addEventListener("animationcancel",k)},[]),C.useEffect(()=>{const Z=d.current,x=()=>{Z.removeEventListener("animationend",x),o?uA(Z,s,i):s()};v||(m?x():(q.current=1,Z.className+=` ${f}`,Z.addEventListener("animationend",x)))},[v]),C.createElement(C.Fragment,null,A)}}function ho(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 xe={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)})}},Vt=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})},jn={info:function(e){return C.createElement(Vt,{...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(Vt,{...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(Vt,{...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(Vt,{...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 cA(e){const[,t]=C.useReducer(h=>h+1,0),[n,r]=C.useState([]),o=C.useRef(null),i=C.useRef(new Map).current,a=h=>n.indexOf(h)!==-1,A=C.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:a,getToast:h=>i.get(h)}).current;function c(h){let{containerId:f}=h;const{limit:q}=A.props;!q||f&&A.containerId!==f||(A.count-=A.queue.length,A.queue=[])}function m(h){r(f=>h==null?[]:f.filter(q=>q!==h))}function s(){const{toastContent:h,toastProps:f,staleId:q}=A.queue.shift();v(h,f,q)}function d(h,f){let{delay:q,staleId:Z,...x}=f;if(!zn(h)||function(V){return!o.current||A.props.enableMultiContainer&&V.containerId!==A.props.containerId||i.has(V.toastId)&&V.updateId==null}(x))return;const{toastId:k,updateId:R,data:S}=x,{props:b}=A,P=()=>m(k),ee=R==null;ee&&A.count++;const X={...b,style:b.toastStyle,key:A.toastKey++,...Object.fromEntries(Object.entries(x).filter(V=>{let[B,K]=V;return K!=null})),toastId:k,updateId:R,data:S,closeToast:P,isIn:!1,className:Xt(x.className||b.toastClassName),bodyClassName:Xt(x.bodyClassName||b.bodyClassName),progressClassName:Xt(x.progressClassName||b.progressClassName),autoClose:!x.isLoading&&(ne=x.autoClose,re=b.autoClose,ne===!1||bt(ne)&&ne>0?ne:re),deleteToast(){const V=ho(i.get(k),"removed");i.delete(k),xe.emit(4,V);const B=A.queue.length;if(A.count=k==null?A.count-A.displayedToast:A.count-1,A.count<0&&(A.count=0),B>0){const K=k==null?A.props.limit:1;if(B===1||K===1)A.displayedToast++,s();else{const E=K>B?B:K;A.displayedToast=E;for(let J=0;J<E;J++)s()}}else t()}};var ne,re;X.iconOut=function(V){let{theme:B,type:K,isLoading:E,icon:J}=V,p=null;const M={theme:B,type:K};return J===!1||(ve(J)?p=J(M):C.isValidElement(J)?p=C.cloneElement(J,M):Pe(J)||bt(J)?p=J:E?p=jn.spinner():(W=>W in jn)(K)&&(p=jn[K](M))),p}(X),ve(x.onOpen)&&(X.onOpen=x.onOpen),ve(x.onClose)&&(X.onClose=x.onClose),X.closeButton=b.closeButton,x.closeButton===!1||zn(x.closeButton)?X.closeButton=x.closeButton:x.closeButton===!0&&(X.closeButton=!zn(b.closeButton)||b.closeButton);let Ae=h;C.isValidElement(h)&&!Pe(h.type)?Ae=C.cloneElement(h,{closeToast:P,toastProps:X,data:S}):ve(h)&&(Ae=h({closeToast:P,toastProps:X,data:S})),b.limit&&b.limit>0&&A.count>b.limit&&ee?A.queue.push({toastContent:Ae,toastProps:X,staleId:Z}):bt(q)?setTimeout(()=>{v(Ae,X,Z)},q):v(Ae,X,Z)}function v(h,f,q){const{toastId:Z}=f;q&&i.delete(q);const x={content:h,props:f};i.set(Z,x),r(k=>[...k,Z].filter(R=>R!==q)),xe.emit(4,ho(x,x.props.updateId==null?"added":"updated"))}return C.useEffect(()=>(A.containerId=e.containerId,xe.cancelEmit(3).on(0,d).on(1,h=>o.current&&m(h)).on(5,c).emit(2,A),()=>{i.clear(),xe.emit(3,A)}),[]),C.useEffect(()=>{A.props=e,A.isToastActive=a,A.displayedToast=n.length}),{getToastToRender:function(h){const f=new Map,q=Array.from(i.values());return e.newestOnTop&&q.reverse(),q.forEach(Z=>{const{position:x}=Z.props;f.has(x)||f.set(x,[]),f.get(x).push(Z)}),Array.from(f,Z=>h(Z[0],Z[1]))},containerRef:o,isToastActive:a}}function qo(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function go(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function dA(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:c,pauseOnHover:m,closeToast:s,onClick:d,closeOnClick:v}=e;function h(S){if(e.draggable){S.nativeEvent.type==="touchstart"&&S.nativeEvent.preventDefault(),a.didMove=!1,document.addEventListener("mousemove",x),document.addEventListener("mouseup",k),document.addEventListener("touchmove",x),document.addEventListener("touchend",k);const b=i.current;a.canCloseOnClick=!0,a.canDrag=!0,a.boundingRect=b.getBoundingClientRect(),b.style.transition="",a.x=qo(S.nativeEvent),a.y=go(S.nativeEvent),e.draggableDirection==="x"?(a.start=a.x,a.removalDistance=b.offsetWidth*(e.draggablePercent/100)):(a.start=a.y,a.removalDistance=b.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function f(S){if(a.boundingRect){const{top:b,bottom:P,left:ee,right:X}=a.boundingRect;S.nativeEvent.type!=="touchend"&&e.pauseOnHover&&a.x>=ee&&a.x<=X&&a.y>=b&&a.y<=P?Z():q()}}function q(){n(!0)}function Z(){n(!1)}function x(S){const b=i.current;a.canDrag&&b&&(a.didMove=!0,t&&Z(),a.x=qo(S),a.y=go(S),a.delta=e.draggableDirection==="x"?a.x-a.start:a.y-a.start,a.start!==a.x&&(a.canCloseOnClick=!1),b.style.transform=`translate${e.draggableDirection}(${a.delta}px)`,b.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function k(){document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",k);const S=i.current;if(a.canDrag&&a.didMove&&S){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),void e.closeToast();S.style.transition="transform 0.2s, opacity 0.2s",S.style.transform=`translate${e.draggableDirection}(0)`,S.style.opacity="1"}}C.useEffect(()=>{A.current=e}),C.useEffect(()=>(i.current&&i.current.addEventListener("d",q,{once:!0}),ve(e.onOpen)&&e.onOpen(C.isValidElement(e.children)&&e.children.props),()=>{const S=A.current;ve(S.onClose)&&S.onClose(C.isValidElement(S.children)&&S.children.props)}),[]),C.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||Z(),window.addEventListener("focus",q),window.addEventListener("blur",Z)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",q),window.removeEventListener("blur",Z))}),[e.pauseOnFocusLoss]);const R={onMouseDown:h,onTouchStart:h,onMouseUp:f,onTouchEnd:f};return c&&m&&(R.onMouseEnter=Z,R.onMouseLeave=q),v&&(R.onClick=S=>{d&&d(S),a.canCloseOnClick&&s()}),{playToast:q,pauseToast:Z,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:R}}function yo(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 mA(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:A,controlledProgress:c,progress:m,rtl:s,isIn:d,theme:v}=e;const h=i||c&&m===0,f={...A,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused",opacity:h?0:1};c&&(f.transform=`scaleX(${m})`);const q=Xe("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${v}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":s}),Z=ve(a)?a({rtl:s,type:o,defaultClassName:q}):Xe(q,a);return C.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:Z,style:f,[c&&m>=1?"onTransitionEnd":"onAnimationEnd"]:c&&m<1?null:()=>{d&&r()}})}const pA=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o}=dA(e),{closeButton:i,children:a,autoClose:A,onClick:c,type:m,hideProgressBar:s,closeToast:d,transition:v,position:h,className:f,style:q,bodyClassName:Z,bodyStyle:x,progressClassName:k,progressStyle:R,updateId:S,role:b,progress:P,rtl:ee,toastId:X,deleteToast:ne,isIn:re,isLoading:Ae,iconOut:V,closeOnClick:B,theme:K}=e,E=Xe("Toastify__toast",`Toastify__toast-theme--${K}`,`Toastify__toast--${m}`,{"Toastify__toast--rtl":ee},{"Toastify__toast--close-on-click":B}),J=ve(f)?f({rtl:ee,position:h,type:m,defaultClassName:E}):Xe(E,f),p=!!P||!A,M={closeToast:d,type:m,theme:K};let W=null;return i===!1||(W=ve(i)?i(M):C.isValidElement(i)?C.cloneElement(i,M):yo(M)),C.createElement(v,{isIn:re,done:ne,position:h,preventExitTransition:n,nodeRef:r},C.createElement("div",{id:X,onClick:c,className:J,...o,style:q,ref:r},C.createElement("div",{...re&&{role:b},className:ve(Z)?Z({type:m}):Xe("Toastify__toast-body",Z),style:x},V!=null&&C.createElement("div",{className:Xe("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Ae})},V),C.createElement("div",null,a)),W,C.createElement(mA,{...S&&!p?{key:`pb-${S}`}:{},rtl:ee,theme:K,delay:A,isRunning:t,isIn:re,closeToast:d,hide:s,type:m,style:R,className:k,controlledProgress:p,progress:P||0})))},Pt=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},fA=Qt(Pt("bounce",!0));Qt(Pt("slide",!0)),Qt(Pt("zoom")),Qt(Pt("flip"));const Jn=C.forwardRef((e,t)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=cA(e),{className:i,style:a,rtl:A,containerId:c}=e;function m(s){const d=Xe("Toastify__toast-container",`Toastify__toast-container--${s}`,{"Toastify__toast-container--rtl":A});return ve(i)?i({position:s,rtl:A,defaultClassName:d}):Xe(d,Xt(i))}return C.useEffect(()=>{t&&(t.current=r.current)},[]),C.createElement("div",{ref:r,className:"Toastify",id:c},n((s,d)=>{const v=d.length?{...a}:{...a,pointerEvents:"none"};return C.createElement("div",{className:m(s),style:v,key:`container-${s}`},d.map((h,f)=>{let{content:q,props:Z}=h;return C.createElement(pA,{...Z,isIn:o(Z.toastId),style:{...Z.style,"--nth":f+1,"--len":d.length},key:`toast-${Z.key}`},q)}))}))});Jn.displayName="ToastContainer",Jn.defaultProps={position:"top-right",transition:fA,autoClose:5e3,closeButton:yo,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let Nn,Be=new Map,Ct=[],hA=1;function vo(){return""+hA++}function qA(e){return e&&(Pe(e.toastId)||bt(e.toastId))?e.toastId:vo()}function Zt(e,t){return Be.size>0?xe.emit(0,e,t):Ct.push({content:e,options:t}),t.toastId}function Bt(e,t){return{...t,type:t&&t.type||e,toastId:qA(t)}}function Ut(e){return(t,n)=>Zt(t,Bt(e,n))}function le(e,t){return Zt(e,Bt("default",t))}le.loading=(e,t)=>Zt(e,Bt("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),le.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=Pe(o)?le.loading(o,n):le.loading(o.render,{...n,...o}));const A={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(s,d,v)=>{if(d==null)return void le.dismiss(r);const h={type:s,...A,...n,data:v},f=Pe(d)?{render:d}:d;return r?le.update(r,{...h,...f}):le(f.render,{...h,...f}),v},m=ve(e)?e():e;return m.then(s=>c("success",a,s)).catch(s=>c("error",i,s)),m},le.success=Ut("success"),le.info=Ut("info"),le.error=Ut("error"),le.warning=Ut("warning"),le.warn=le.warning,le.dark=(e,t)=>Zt(e,Bt("default",{theme:"dark",...t})),le.dismiss=e=>{Be.size>0?xe.emit(1,e):Ct=Ct.filter(t=>e!=null&&t.options.toastId!==e)},le.clearWaitingQueue=function(e){return e===void 0&&(e={}),xe.emit(5,e)},le.isActive=e=>{let t=!1;return Be.forEach(n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)}),t},le.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const a=Be.get(i||Nn);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:vo()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,Zt(a,i)}},0)},le.done=e=>{le.update(e,{progress:1})},le.onChange=e=>(xe.on(4,e),()=>{xe.off(4,e)}),le.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"},le.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},xe.on(2,e=>{Nn=e.containerId||e,Be.set(Nn,e),Ct.forEach(t=>{xe.emit(0,t.content,t.options)}),Ct=[]}).on(3,e=>{Be.delete(e.containerId||e),Be.size===0&&xe.off(0).off(1).off(5)});function It(e){le.success(e,{position:"top-center",autoClose:650,hideProgressBar:!0,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light"})}let Dn="";const gA=e=>{let t=Dn+"/"+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),It("Download successfully")}).catch(r=>{console.error("File error:",r)})},yA=(e,t)=>{let n=Dn+"/"+e;Yn(n)?It("Link Copied"):t(n)};async function Ft(e,t,n,r,o,i="download",a){return new Promise(async(A,c)=>{let m=s=>{i==="download"?gA(s):i==="copy"&&yA(s,a)};e==="Playable"?(r&&await lA(t,{iosLink:r==null?void 0:r.iosUrl,androidLink:r==null?void 0:r.googleUrl},o),aA(o,t,n).then(async s=>{let{url:d}=s;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)})):e==="Flex"?(r&&await sA({_id:t,iosLink:r==null?void 0:r.iosUrl,androidLink:r==null?void 0:r.googleUrl},o),oA({_id:t,network:n},o).then(async s=>{if(s.message){c(s.message);return}let{url:d}=s;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)})):e==="Import"?iA(o,t,n).then(s=>{let d=s.url;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)}):e==="Ready"&&AA(o,t,n).then(s=>{let d=s.url;m(d),A(d)}).catch(s=>{let d=s.response.data.error.msg;c(d)})})}function vA(e){Dn=e}const bA=({versionId:e,typeOfProduct:t,api:n,fetchFileUrl:r,copyLinkUrl:o,setSafariCopyLink:i})=>{const[a,A]=C.useState(!1),c=async()=>{A(!0),Ft(t,e,"default",null,n,"copy",i).then(m=>{A(!1)}).catch(m=>{A(!1)})};return u.jsxs("div",{style:{display:"flex",height:"125px",width:"100%",borderRadius:"10px",backgroundColor:"#000000",padding:"10px"},children:[u.jsx("div",{style:{marginRight:"0.75rem",width:"50%"},children:u.jsx(Ri,{bgColor:"#0F0F1E",fgColor:"#ffffff",style:{height:"auto",maxWidth:"100%",width:"100%"},value:`${o}/preview?versionId=${e}`+(t==="Flex"?"":"_")})}),u.jsxs("div",{children:[u.jsx("div",{style:{marginBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"bold",color:"white"},children:"Mobile testing"}),u.jsx("div",{style:{marginBottom:"1rem",fontSize:"0.75rem",color:"gray"},children:"Scan QR Code to test in any browser"}),u.jsxs("div",{style:{display:"flex",cursor:"pointer",borderRadius:"0.375rem",backgroundColor:"#00A3FF1A",color:"secondary-blue"},children:[u.jsx(Mr,{style:{marginRight:"0.25rem",height:"1.5rem",width:"1.5rem",stroke:"secondary-blue",color:"white"}}),a?u.jsx("div",{style:{height:"24px",display:"flex",alignItems:"center",margin:"auto"},children:u.jsx("img",{style:{height:"90%"},src:rt,alt:"loading"})}):u.jsx("button",{style:{fontSize:"1rem",color:"white",background:"rgba(0, 163, 255, 0)"},onClick:c,children:"Copy Link"})]})]})]})},CA=({versionName:e,versionId:t,typeOfProduct:n,api:r,iframeUrl:o,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})=>{const[c,m]=C.useState(window.innerWidth);C.useEffect(()=>{const d=()=>{m(window.innerWidth)};return window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[]);const s=(e==null?void 0:e.length)>25?e.slice(0,25)+"...":e;return u.jsxs("div",{style:{display:"flex",width:"300px",flexDirection:"column",justifyContent:"space-between",padding:"5px",height:c>1440?"680px":"620px",borderRadius:"0px 0px 0px 16px",marginTop:"20px"},children:[u.jsx(ii,{iframeUrl:o}),u.jsx(ai,{name:s}),u.jsx(bA,{versionId:t,typeOfProduct:n,api:r,fetchFileUrl:i,copyLinkUrl:a,setSafariCopyLink:A})]})};var me=(e=>(e.Flex="#7101FF",e.Playable="#F9830B",e.Import="#00a3ff",e.Ready="#0060A5",e))(me||{});const ZA=({typeOfProduct:e})=>u.jsxs("div",{style:{fontSize:"2xl",fontWeight:"bold"},children:[u.jsx("span",{style:{color:me[e]},children:"Select a Network"}),u.jsx("span",{style:{whiteSpace:"pre"},children:" From List"})]});async function IA(e,t){return(await pe.post(t+"/buyRequest",{requestType:e})).data}const wA=()=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsxs("g",{"clip-path":"url(#clip0_518_12094)",children:[u.jsx("path",{d:"M4.50977 11.99L19.4898 11.99",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),u.jsx("path",{d:"M13.5068 17.977L19.4828 12L13.5068 6.02299",stroke:"#7101FF","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),u.jsx("defs",{children:u.jsx("clipPath",{id:"clip0_518_12094",children:u.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 24) rotate(-90)"})})})]}),xA=({creditDownload:e,api:t})=>u.jsxs(u.Fragment,{children:[u.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."}),u.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"," ",u.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.",u.jsxs("button",{style:{marginLeft:"0.5rem",display:"flex",alignItems:"center",fontSize:"12px",fontWeight:"bold",textDecoration:"underline",color:"#yourColorHere"},onClick:()=>IA("Flex Credit",t).then(n=>It("You will be contacted regarding your request.")),children:["Get more",u.jsx(wA,{})]})]})]}),KA=({typeOfProduct:e,fileSize:t,urls:n,handleIosChange:r,handleGoogleChange:o,disabled:i,api:a,creditDownload:A})=>{const c=s=>{r(s.target.value)},m=s=>{o(s.target.value)};return u.jsxs(u.Fragment,{children:[t&&u.jsxs("span",{style:{fontSize:"16px",fontWeight:"bold"},children:["File size: ",parseFloat(t).toFixed(2)," mb"]}),e!=="Import"&&u.jsxs("div",{style:{display:"flex",width:"100%",flexDirection:"column"},children:[u.jsxs("div",{style:{display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"200"},children:[u.jsx("span",{style:{width:"5rem",fontWeight:"bold"},children:"App Store:"}),u.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.iosUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:me[e]},type:"text",value:n.iosUrl,onChange:c,placeholder:"Ios Url",disabled:i})]}),u.jsxs("div",{style:{marginTop:"0.5rem",display:"flex",height:"2rem",width:"100%",alignItems:"center",fontSize:"12px",fontWeight:"100"},children:[u.jsxs("span",{style:{width:"5rem",fontWeight:"bold"},children:["Google Play:"," "]}),u.jsx("input",{style:{marginLeft:"1.25rem",display:"flex",height:"100%",width:"70%",alignItems:"center",borderRadius:"0.375rem",border:n.googleUrl?"1px solid lightgray":"1px solid red",paddingLeft:"0.5rem",color:"#000000",borderColor:me[e]},type:"text",value:n.googleUrl,onChange:m,placeholder:"Google Url",disabled:i})]}),(A==null?void 0:A.willSpendCredit)&&u.jsx(xA,{creditDownload:A,api:a})]})]})},WA=({typeOfProduct:e,title:t})=>u.jsx("div",{style:{fontSize:"1.5rem",fontWeight:"bold",paddingTop:"20px"},children:u.jsx("span",{style:{color:me[e]},children:t})}),MA=({typeOfProduct:e,fileSize:t,urls:n,title:r,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:c})=>u.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:"1rem"},children:[u.jsx(WA,{typeOfProduct:e,title:r}),u.jsx(KA,{typeOfProduct:e,fileSize:t,urls:n,handleIosChange:o,handleGoogleChange:i,disabled:a,creditDownload:A,api:c}),u.jsx(ZA,{typeOfProduct:e})]}),bo=({fill:e,stroke:t,className:n,style:r})=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:e,stroke:t,strokeWidth:n,style:r,className:"w-6 h-6",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.563.563 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.563.563 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5z"})}),Co=({children:e,className:t,onClickDonwload:n,downloading:r,disabled:o})=>u.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}),SA=({checked:e,typeOfProduct:t,id:n})=>{const[r,o]=C.useState(e);C.useEffect(()=>{o(e)},[e]);const i=()=>{o(!r)};return u.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:u.jsxs("label",{onClick:i,style:{position:"relative",display:"flex",cursor:"pointer",alignItems:"center"},htmlFor:n,children:[u.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}),u.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:[u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",style:{height:"14px",width:"14px"},viewBox:"0 0 20 20",fill:me[t],stroke:me[t],strokeWidth:"1",children:u.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"})})," "]})]})})},kl="",LA=({typeOfProduct:e})=>u.jsx("div",{style:{backgroundColor:"transparent",display:"flex",alignItems:"center",flexDirection:"column"},children:u.jsxs("div",{style:{position:"relative",width:"64px",height:"16px",marginTop:"8px"},children:[u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}}),u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}}),u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}}),u.jsx("div",{style:{position:"absolute",top:0,width:"8px",height:"8px",borderRadius:"50%",backgroundColor:me[e]}})]})}),Rn=({isNetworksLoading:e=!1})=>u.jsx("div",{style:{display:"flex",height:"100%",width:"90px",alignItems:"center",justifyContent:"center"},children:u.jsx("img",{width:e?"100px":"25px",height:e?"100px":"25px",src:rt,alt:"pf-logo-gif"})}),OA=({title:e,titleId:t,...n})=>u.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?u.jsx("title",{id:t,children:e}):null,u.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"})]}),EA=({onClose:e,iosLink:t,googleLink:n,buttonType:r,handleCopyLink:o,download:i})=>{let a="";return!t&&!n?a="Both links are empty. Are you sure you want to continue?":t?n||(a="Google link is empty. Are you sure you want to continue?"):a="iOS link is empty. Are you sure you want to continue?",u.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:[u.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),u.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:[u.jsx("h1",{style:{textAlign:"center",fontSize:"18px",lineHeight:"24px"},children:a}),u.jsxs("div",{style:{display:"flex",gap:"5px"},children:[u.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"}),u.jsx("button",{onClick:async A=>{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"})]})]})]})},Zo=({onClose:e,handleCopyLink:t,download:n,creditConfirmType:r,getDownloadCount:o})=>u.jsxs("div",{style:{position:"fixed",top:0,left:0,zIndex:50,display:"flex",height:"120%",width:"130%",alignItems:"center",justifyContent:"center",backgroundColor:"#00000080"},children:[u.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%"}}),u.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:[u.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?"}),u.jsxs("div",{style:{display:"flex",gap:"5px"},children:[u.jsx("button",{onClick:e,style:{flex:1,cursor:"pointer",borderRadius:"4px",borderWidth:"1px",borderColor:"dark-50",padding:"2px",fontWeight:"bold"},children:"No"}),u.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"})]})]})]}),kA=({onClose:e,handleDownload:t,handleDownloadMolocoTest:n,downloadingMoloco:r,downloadingMolocoTest:o})=>u.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:[u.jsx("div",{onClick:e,style:{position:"absolute",zIndex:30,height:"100%",width:"100%",pointerEvents:"none"}}),u.jsx("div",{style:{position:"absolute",zIndex:50,display:"flex",flexDirection:"column",gap:"5px",minWidth:"500px",borderRadius:"0.375rem",backgroundColor:"white",padding:"1rem",pointerEvents:"auto"},children:u.jsxs("div",{style:{display:"flex",gap:"5px"},children:[r?u.jsx("div",{style:{flex:1,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"},children:u.jsx("img",{width:"25px",height:"25px",src:rt,alt:"pf-logo-gif"})}):u.jsx("button",{onClick:t,style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear"},children:"Download"}),o?u.jsx("div",{style:{flex:1,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"},children:u.jsx("img",{width:"25px",height:"25px",src:rt,alt:"pf-logo-gif"})}):u.jsx("button",{onClick:n,style:{flex:1,cursor:"pointer",borderRadius:"0.375rem",border:"1px solid darkorange",backgroundColor:"darkorange",color:"white",transition:"all 0.15s ease-linear"},children:"Download Moloco Test"})]})})]});async function YA(e,t,n,r){return(await pe.post(e+"/createMolocoTestPage",{_id:t,network:n,typeOfProduct:r})).data}const zA=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],jA=({id:e,imageUrl:t,handleCardClick:n,selected:r,name:o,networkVersionSize:i,fileSizeLoading:a,showCheckBox:A,typeOfProduct:c,versionId:m,api:s,handleDownloadError:d,fetchFileUrl:v,urls:h,game:f,setIsConfirmActive:q,creditDownload:Z,getDownloadCount:x,disabled:k,user:R,setSafariCopyLink:S})=>{const[b,P]=C.useState(!1),[ee,X]=C.useState(""),[ne,re]=C.useState(!1),[Ae,V]=C.useState(!1),[B,K]=C.useState(!1),[E,J]=C.useState("download"),[p,M]=C.useState(!1),[W,g]=C.useState(!1);let w={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"};const N=()=>{n(e)},j=async(Y,D)=>{P(!0),Ft(c,m,Y,h,s,D,S).then(G=>{P(!1)}).catch(G=>{P(!1),d(G)})},z=async()=>{M(!0),Ft(c,m,o,h,s,"download",S).then(Y=>{M(!1),K(!1)}).catch(Y=>{d(Y)})},Q=async()=>{g(!0);const Y=await YA(s,m,o,c);let D=`${v}/${Y==null?void 0:Y.url}`;Yn(D)?(It("Link Copied"),g(!1)):S(D)};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{position:"relative",display:"flex",flexDirection:"column",gap:"20px",padding:"16px",borderColor:r?me[c]:"lightgray",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white",width:"100%",height:"175px",borderRadius:"16px",cursor:"pointer"},className:"border-hover-"+c,onClick:N,children:[u.jsxs("div",{style:{marginTop:"40px",display:"flex",justifyContent:"center"},children:[u.jsxs("div",{style:{position:"absolute",right:"0",top:"0",padding:"8px"},children:[zA.includes(o)&&c!=="Import"&&u.jsx(bo,{fill:me[c],stroke:me[c],className:"mb-1 inline-block w-6",style:{marginBottom:"0.25rem",display:"inline-block",width:"1.5rem"}}),u.jsx("div",{children:i&&i.map(Y=>Y.network).includes(o)?a?u.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:u.jsx(LA,{typeOfProduct:c})}):i.map(Y=>u.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:Y.network===o?Y.size.toString().slice(0,5)+"Mb":""},Y.network)):null})]}),u.jsx("div",{style:{position:"absolute",top:"0",left:"0",padding:"0.5rem"},children:(c==="Playable"||c==="Ready"||c==="Flex")&&A&&u.jsx(SA,{checked:r,typeOfProduct:c,id:e})}),u.jsx("img",{onClick:N,style:{width:"30rem",height:"50px",objectFit:"contain"},src:t})]}),u.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.25rem"},children:[u.jsxs(Co,{className:"w-2/3 border-hover-"+c,downloading:b,onClickDonwload:async Y=>{if(Y.stopPropagation(),(o==="moloco"||o==="molocoV2")&&R.customer==="playableFactoryInternal"){K(!0);return}else{X("download");const D=h.iosUrl,G=h.googleUrl;Z&&Z.willSpendCredit?(q(!0),J("download"),re(!0)):c!=="Import"&&(!D||!G)?(q(!0),V(!0)):(V(!1),re(!1),j(o,"download"))}},children:[!b&&u.jsxs(u.Fragment,{children:[u.jsx(OA,{style:{marginRight:"0.5rem",height:"1.5rem",width:"1.5rem",stroke:"dark-full"}}),"Download"]}),b&&u.jsx(Rn,{})]}),w[o].includes("copy")&&u.jsx(Co,{className:"w-1/3 border-hover-"+c,onClickDonwload:async Y=>{Y.stopPropagation(),X("copyLink");const D=h.iosUrl,G=h.googleUrl;Z&&(Z!=null&&Z.willSpendCredit)?(J("copy"),q(!0),re(!0)):c!=="Import"&&(!D||!G)?(q(!0),V(!0)):(re(!1),V(!1),j(o,"copy"))},disabled:k,children:u.jsx(Mr,{className:"h-6 w-6 stroke-dark-full"})})]})]}),ne&&u.jsx(Zo,{creditConfirmType:E,handleCopyLink:async()=>{V(!1),q(!1),j(o,"copy")},download:async()=>{V(!1),q(!1),j(o,"download")},onClose:()=>{re(!1),q(!1)},getDownloadCount:x}),Ae&&u.jsx(EA,{onClose:()=>{V(!1),q(!1)},iosLink:h.iosUrl,googleLink:h.googleUrl,buttonType:ee,handleCopyLink:async()=>{V(!1),q(!1),j(o,"copy")},download:async()=>{V(!1),q(!1),j(o,"download")}}),B&&R.customer==="playableFactoryInternal"&&u.jsx(kA,{onClose:()=>{K(!1)},handleDownload:z,handleDownloadMolocoTest:Q,downloadingMoloco:p,donwloadintMolocoTest:W})]})},Gn=[{id:"1",name:"unity",imageSrc:"https://gearbox.playablefactory.com/unity.png"},{id:"2",name:"applovin",imageSrc:"https://gearbox.playablefactory.com/applovin.png"},{id:"3",name:"ironsource",imageSrc:"https://gearbox.playablefactory.com/ironsource.png"},{id:"4",name:"vungle",imageSrc:"https://gearbox.playablefactory.com/vungle.png"},{id:"5",name:"mobvista",imageSrc:"https://gearbox.playablefactory.com/mobvista.png"},{id:"6",name:"fb",imageSrc:"https://gearbox.playablefactory.com/fb.png"},{id:"7",name:"toutiao",imageSrc:"https://gearbox.playablefactory.com/toutiao.png"},{id:"8",name:"toutiao_cn",imageSrc:"https://gearbox.playablefactory.com/toutiao_cn.png"},{id:"9",name:"adcolony",imageSrc:"https://gearbox.playablefactory.com/adcolony.png"},{id:"10",name:"criteo",imageSrc:"https://gearbox.playablefactory.com/criteo.png"},{id:"11",name:"chartboost",imageSrc:"https://gearbox.playablefactory.com/chartboost.png"},{id:"12",name:"kayzen",imageSrc:"https://gearbox.playablefactory.com/kayzen.png"},{id:"13",name:"crossinstall",imageSrc:"https://gearbox.playablefactory.com/crossinstall.png"},{id:"14",name:"default",imageSrc:"https://gearbox.playablefactory.com/default.png"},{id:"15",name:"fyber",imageSrc:"https://gearbox.playablefactory.com/fyber.png"},{id:"16",name:"appreciate",imageSrc:"https://gearbox.playablefactory.com/appreciate.png"},{id:"17",name:"google360",imageSrc:"https://gearbox.playablefactory.com/google360.png"},{id:"18",name:"kaden",imageSrc:"https://gearbox.playablefactory.com/kaden.png"},{id:"19",name:"kidoz",imageSrc:"https://gearbox.playablefactory.com/kidoz.png"},{id:"20",name:"lifestreet",imageSrc:"https://gearbox.playablefactory.com/lifestreet.png"},{id:"21",name:"liftoff",imageSrc:"https://gearbox.playablefactory.com/liftoff.png"},{id:"22",name:"moloco",imageSrc:"https://gearbox.playablefactory.com/moloco.png"},{id:"23",name:"nucleo",imageSrc:"https://gearbox.playablefactory.com/nucleo.png"},{id:"24",name:"oceanengine",imageSrc:"https://gearbox.playablefactory.com/oceanengine.png"},{id:"25",name:"pointblank",imageSrc:"https://gearbox.playablefactory.com/pointblank.png"},{id:"26",name:"snapchat",imageSrc:"https://gearbox.playablefactory.com/snapchat.png"},{id:"27",name:"tapjoy",imageSrc:"https://gearbox.playablefactory.com/tapjoy.png"},{id:"28",name:"tencent",imageSrc:"https://gearbox.playablefactory.com/tencent.png"},{id:"31",name:"aarki",imageSrc:"https://gearbox.playablefactory.com/aarki.png"},{id:"32",name:"yandex",imageSrc:"https://gearbox.playablefactory.com/yandex.png"},{id:"33",name:"web",imageSrc:"https://gearbox.playablefactory.com/web.png"},{id:"34",name:"zucks",imageSrc:"https://gearbox.playablefactory.com/zucks.png"},{id:"35",name:"google",imageSrc:"https://gearbox.playablefactory.com/google.png"},{id:"36",name:"inmobi",imageSrc:"https://gearbox.playablefactory.com/inmobi.png"},{id:"38",name:"smadex",imageSrc:"https://gearbox.playablefactory.com/smadex.png"},{id:"39",name:"instantGame",imageSrc:"https://gearbox.playablefactory.com/instantGame.png"},{id:"40",name:"luna",imageSrc:"https://gearbox.playablefactory.com/luna.png"},{id:"41",name:"nend",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"42",name:"jammp",imageSrc:"https://gearbox.playablefactory.com/nend.png"},{id:"43",name:"adjoe",imageSrc:"https://gearbox.playablefactory.com/adjoe.png"},{id:"44",name:"molocoV2",imageSrc:"https://gearbox.playablefactory.com/molocoV2.png"},{id:"45",name:"adikteev",imageSrc:"https://gearbox.playablefactory.com/adikteev.png"}],JA=({typeOfProduct:e})=>u.jsx("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem"},children:u.jsx("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"0.875rem",fontWeight:"bold",height:"1.5rem"},children:e!=="Import"&&u.jsxs(u.Fragment,{children:[u.jsx(bo,{fill:me[e],stroke:me[e],style:{display:"inline-block",width:"1.5rem"},className:""}),u.jsx("span",{style:{display:"flex",alignItems:"center"},children:"Data tracking functionality is turned on by default for marked network downloads"})]})})}),NA=({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:me[t],color:"white",fontSize:"0.875rem",borderRadius:"0.875rem"};return u.jsx("button",{onClick:r,className:n,style:o,children:e})},DA=({networksVersionTotalSize:e,typeOfProduct:t,onClickMultiDownload:n,multiDownloading:r})=>u.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"8px"},children:r?u.jsx("div",{style:{display:"flex",width:"12rem",height:"2.5rem",borderRadius:"0.875rem",alignItems:"center",justifyContent:"center",backgroundColor:me[t]},children:u.jsx(Rn,{})}):u.jsx(NA,{typeOfProduct:t,onClick:n,children:u.jsx("span",{style:{fontSize:"1.25rem",padding:"0.5rem",color:"#fff"},children:"Multi Download"})})});async function RA(e,t,n){return(await pe.post(n+"/createPlayableVersionLinkMulti",{_id:e,networks:t})).data}async function GA(e,t,n){return(await pe.post(n+"/createFlexVersionLinkMulti",{_id:e,networks:t})).data}const TA=({playable:e,creditDownload:t,visible:n,versionId:r,typeOfProduct:o,api:i,user:a,handleDownloadError:A,fetchFileUrl:c,urls:m,game:s,getDownloadCount:d,disabled:v,setSafariCopyLink:h})=>{const[f,q]=C.useState([]),[Z,x]=C.useState([]),[k,R]=C.useState(!1),[S,b]=C.useState(""),[P,ee]=C.useState(!1),[X,ne]=C.useState(!1),[re,Ae]=C.useState("download"),[V,B]=C.useState(!1),K=async p=>{const M=[...f];if(f.includes(p)){const W=M.findIndex(g=>g===p);M.splice(W,1),q(M)}else M.push(p),q([...f,p]);Gn.filter(W=>[...M].includes(W.id)).map(W=>W.name)},E=async()=>{try{const p=Gn.filter(N=>[...f].includes(N.id)).map(N=>N.name);ee(!0);let M;o==="Flex"?M=await GA(r,p,i):M=await RA(r,p,i);const{url:W}=M;let g;const w=c+"/"+W;g=document.createElement("iframe"),g.setAttribute("src",w),g.style.display="none",document.body.appendChild(g),g.click(),ee(!1),It("Multi downloaded completed successfully")}catch(p){ee(!1),A(p.response.data.error.msg),console.error(p)}},J=async()=>{m.iosUrl,m.googleUrl,t&&t.willSpendCredit?(ne(!0),Ae("download"),B(!0)):(B(!1),await E())};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{position:"relative",flex:1,overflowY:X?"hidden":"auto",padding:"1.5rem",paddingTop:"0"},children:[u.jsx("div",{style:{display:"grid",gridTemplateColumns:"180px 180px 180px",gap:"1rem",overflowY:"auto",padding:"0.75rem"},children:n&&Gn.filter(p=>{var M;return t&&((M=t==null?void 0:t.networks)==null?void 0:M.length)>0?t==null?void 0:t.networks.includes(p.name):o==="Import"?e==null?void 0:e.networks.filter(W=>W.status==="paid").some(W=>W.name===p.name):e==null?void 0:e.networks.includes(p.name)}).filter(p=>p.name==="voodoo"?a.customer==="customer:20":!0).map(p=>u.jsx(jA,{id:p.id,name:p.name,imageUrl:p.imageSrc,selected:f.includes(p.id),handleCardClick:K,networkVersionSize:Z,fileSizeLoading:k,showCheckBox:!0,typeOfProduct:o,versionId:r,api:i,handleDownloadError:A,fetchFileUrl:c,urls:m,game:s,creditDownload:t,setIsConfirmActive:ne,getDownloadCount:d,disabled:v,user:a,setSafariCopyLink:h},p.id))}),u.jsx(JA,{typeOfProduct:o})]}),f.length>1&&(o==="Playable"||o==="Ready"||o==="Flex")&&u.jsx("div",{style:{position:"fixed",bottom:"0",left:"65%",zIndex:20,transform:"translateX(-50%)",display:"flex",flexDirection:"column",paddingTop:"5px"},children:u.jsx(DA,{onClickMultiDownload:J,networksVersionTotalSize:S,typeOfProduct:o,multiDownloading:P})}),V&&u.jsx(Zo,{creditConfirmType:re,handleCopyLink:async()=>{},download:async()=>{B(!1),ne(!1),await E()},onClose:()=>{B(!1),ne(!1)},getDownloadCount:d})]})};async function HA(e,t){return(await pe.post(t+"/findPlayable",{_id:e})).data}async function XA(e,t){return(await pe.post(t+"/getFlexDownloadCount",e)).data}async function QA(e,t){try{return(await pe.post(t+"/findGame",{_id:e})).data}catch{}}async function VA(e,t){return(await pe.post(t+"/getPlayableVersionMarketLink",{_id:e})).data}async function PA(e,t){return(await pe.post(t+"/getFlexData",{_id:e})).data}async function BA(e,t){return(await pe.post(t+"/getImportedPlayable",{id:e})).data}async function UA(e,t){return(await pe.post(t+"/getReadyDownloadCount",e)).data}const FA=["adcolony","ironsource","applovin","unity","mobvista","criteo","kayzen","vungle","moloco","inmobi"],_A=["adcolony","applovin","chartboost","crossinstall","fb","google","ironsource","lifestreet","liftoff","mobvista","nucleo","tapjoy","toutiao","unity","vungle","moloco"],$A=({playableId:e,versionId:t,gameId:n,typeOfProduct:r,visible:o,api:i,user:a,title:A,handleDownloadError:c,fetchFileUrl:m,fileSize:s,setFileSize:d,setSafariCopyLink:v})=>{const[h,f]=C.useState(null),[q,Z]=C.useState(null),[x,k]=C.useState(null),[R,S]=C.useState(!1),[b,P]=C.useState("Loading..."),[ee,X]=C.useState("Loading..."),[ne,re]=C.useState(!0),[Ae,V]=C.useState(window.innerWidth);C.useEffect(()=>{const W=()=>{V(window.innerWidth)};return window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}},[]);const B=async()=>{S(!0);const W=await HA(e,i);return W!=null&&W.networks||(W.networks=FA),f(W),W},K=W=>{P(W)},E=W=>{X(W)},J=async(W,g)=>{var w,N;try{let j;if(r==="Playable"||r==="Ready"){const z=await VA(t,i);if(z){P(z.iosLink),X(z.androidLink),S(!1);return}if(W&&(W.iosUrl||W.googleUrl)){P(W.iosUrl),X(W.googleUrl),S(!1);return}if(g&&g.html){let Q=await fetch(m+"/"+g.html).then(G=>G.text());const Y=((w=Q.match(/var\s+iosLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:w.at(1))||"";P(Y);const D=((N=Q.match(/var\s+androidLink\s*=\s*['|"](https?[\w\d;,/?:@&=+$\-_.!~*'()#]+)['|"]/))==null?void 0:N.at(1))||"";X(D),S(!1)}else X(""),P(""),S(!1)}else if(r==="Flex"){const z=await PA(t,i);if(z.googleUrl||z.iosUrl){X(z.googleUrl),P(z.iosUrl),S(!1);return}W&&(W.iosUrl||W.googleUrl)?(P(W.iosUrl),X(W.googleUrl),S(!1)):(X(""),P(""),S(!1))}}catch(j){c(j.response.data.error.msg)}},p=async()=>{S(!0);let W;r==="Flex"?W=await XA({_id:t},i):r==="Ready"&&(W=await UA({_id:t},i)),W&&(["admin","pm","tester"].includes(a.role)?k({...W,networks:_A}):k(W)),S(!1)},M=async()=>await QA(n,i);return C.useEffect(()=>{o||(f(null),Z(null),k(null),d(null)),o&&(r==="Playable"||r==="Ready"?(B().then(W=>{J(null,W)}),re(!1)):r==="Flex"?p().then(W=>{re(!1),M().then(g=>{o&&(J(g,null),re(!1),Z(g))})}):r==="Import"&&BA(t,i).then(W=>{console.log(W),f(W),P(W.iosUrl||""),X(W.googleUrl||""),S(!1),re(!1)}))},[n,e,t,o]),u.jsxs("div",{style:{display:"flex",height:Ae>1440?"700px":"650px",width:Ae>1440?"675px":"680px",flexDirection:"column",borderRadius:"rounded",backgroundColor:"#F7F7F8",paddingTop:"0px"},children:[u.jsx(MA,{title:A,typeOfProduct:r,fileSize:s,urls:{iosUrl:b,googleUrl:ee},handleIosChange:K,handleGoogleChange:E,disabled:ne,api:i,creditDownload:x}),R?u.jsx("div",{style:{height:"100%",width:"100%",display:"flex",justifyContent:"center"},children:u.jsx(Rn,{isNetworksLoading:!0})}):(h||x)&&(r==="Flex"?q:!0)&&!R&&b!=="Loading..."&&ee!=="Loading..."&&u.jsx(TA,{playable:h,creditDownload:x,visible:o,versionId:t,typeOfProduct:r,api:i,user:a,handleDownloadError:c,fetchFileUrl:m,urls:{iosUrl:b,googleUrl:ee},game:q,getDownloadCount:p,disabled:ne,setSafariCopyLink:v})]})},Yl="";var Tn={exports:{}},Ue={},Hn={exports:{}},Se={},Xn={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