Files
to_session/text/3.65.22_0/scripts/background/offscreen.js

9 lines
51 KiB
JavaScript
Raw Normal View History

2025-11-12 12:54:37 +08:00
"use strict";(()=>{var Ne=Object.create;var te=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Je=(c,p,x)=>p in c?te(c,p,{enumerable:!0,configurable:!0,writable:!0,value:x}):c[p]=x;var Ye=(c,p)=>()=>(c&&(p=c(c=0)),p);var ie=(c,p)=>()=>(p||c((p={exports:{}}).exports,p),p.exports);var Qe=(c,p,x,S)=>{if(p&&typeof p=="object"||typeof p=="function")for(let b of Xe(p))!ze.call(c,b)&&b!==x&&te(c,b,{get:()=>p[b],enumerable:!(S=Ge(p,b))||S.enumerable});return c};var oe=(c,p,x)=>(x=c!=null?Ne($e(c)):{},Qe(p||!c||!c.__esModule?te(x,"default",{value:c,enumerable:!0}):x,c));var Q=(c,p,x)=>(Je(c,typeof p!="symbol"?p+"":p,x),x);function ce(){throw new Error("setTimeout has not been defined")}function se(){throw new Error("clearTimeout has not been defined")}function pe(c){if(F===setTimeout)return setTimeout(c,0);if((F===ce||!F)&&setTimeout)return F=setTimeout,setTimeout(c,0);try{return F(c,0)}catch{try{return F.call(null,c,0)}catch{return F.call(this,c,0)}}}function Ze(c){if(L===clearTimeout)return clearTimeout(c);if((L===se||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(c);try{return L(c)}catch{try{return L.call(null,c)}catch{return L.call(this,c)}}}function qe(){!N||!H||(N=!1,H.length?j=H.concat(j):Z=-1,j.length&&_e())}function _e(){if(!N){var c=pe(qe);N=!0;for(var p=j.length;p;){for(H=j,j=[];++Z<p;)H&&H[Z].run();Z=-1,p=j.length}H=null,N=!1,Ze(c)}}function et(c){var p=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)p[x-1]=arguments[x];j.push(new ge(c,p)),j.length===1&&!N&&pe(_e)}function ge(c,p){this.fun=c,this.array=p}function U(){}function Tt(c){throw new Error("process.binding is not supported")}function Wt(){return"/"}function kt(c){throw new Error("process.chdir is not supported")}function Pt(){return 0}function bt(c){var p=xt.call(K)*.001,x=Math.floor(p),S=Math.floor(p%1*1e9);return c&&(x=x-c[0],S=S-c[1],S<0&&(x--,S+=1e9)),[x,S]}function ft(){var c=new Date,p=c-wt;return p/1e3}var F,L,j,N,H,Z,tt,ot,nt,at,rt,it,lt,ct,st,pt,_t,gt,mt,ut,dt,Ct,K,xt,wt,E,le,D=Ye(()=>{F=ce,L=se;typeof globalThis.setTimeout=="function"&&(F=setTimeout);typeof globalThis.clearTimeout=="function"&&(L=clearTimeout);j=[],N=!1,Z=-1;ge.prototype.run=function(){this.fun.apply(null,this.array)};tt="browser",ot="browser",nt=!0,at={},rt=[],it="",lt={},ct={},st={};pt=U,_t=U,gt=U,mt=U,ut=U,dt=U,Ct=U;K=globalThis.performance||{},xt=K.now||K.mozNow||K.msNow||K.oNow||K.webkitNow||function(){return new Date().getTime()};wt=new Date;E={nextTick:et,title:tt,browser:nt,env:at,argv:rt,version:it,versions:lt,on:pt,addListener:_t,once:gt,off:mt,removeListener:ut,removeAllListeners:dt,emit:Ct,binding:Tt,cwd:Wt,chdir:kt,umask:Pt,hrtime:bt,platform:ot,release:ct,config:st,uptime:ft},le={version:"3.65.22","env.PROJECT":"okxwallet-extension","env.NODE_ENV":"production","env.SOURCEMAP":"true","env.DEV_TARGET":"","env.APP_VERSION":"3.65.22","env.COMMIT_HASH":"1c1b","env.PLATFORM_WEB":void 0,"env.REDUX_DEVTOOLS":"","env.MONITOR_PLATFORM":"extension","env.ASSETS_BUILD_TYPE":"publish"};Object.keys(le).forEach(c=>{let p=c.split("."),x=E;for(let S=0;S<p.length;S++){let b=p[S];S===p.length-1?x[b]=le[c]:x=x[b]||(x[b]={})}})});var ae=ie((ne,me)=>{D();(function(c,p){if(typeof define=="function"&&define.amd)define("webextension-polyfill",["module"],p);else if(typeof ne<"u")p(me);else{var x={exports:{}};p(x),c.browser=x.exports}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:ne,function(c){"use strict";if(!globalThis.chrome?.runtime?.id)throw new Error("This script should only be loaded in a browser extension.");if(typeof globalThis.browser>"u"||Object.getPrototypeOf(globalThis.browser)!==Object.prototype){let p="The message port closed before a response was received.",x=S=>{let b={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,ma
\r ${C}`)):(a||_)&&(C=`ThrowError: ${JSON.stringify(a||_)}
\r at ${d}: ${e}: ${n}`);let g=encodeURIComponent(window.location.href);return{msg:_,file:d,line:e,col:n,stack:C,url:g}},isReported(s){let{file:_,line:d,col:e}=s,n=`${_}__${d}__${e}`;return P.includes(n)},rememberError(s){let{file:_,line:d,col:e}=s,n=`${_}__${d}__${e}`;P.unshift(n),P.length>50&&P.pop(),setTimeout(()=>{localStorage.__error__=JSON.stringify(P)},0)}}},"../monitor/src/global/attrs.js":function(b,T,l){l.r(T);var W=l("../monitor/src/global/click.js"),P=l("../monitor/src/global/expose.js"),s=l("../monitor/src/common/constants.js");let{Configs:_}=s.default;T.default={listen(d){let e=n=>{d.logEvent({...n,category:"ok"})};this.preprocess(),W.default.listen(e,this),P.default.listen(e,this)},preprocess(){document.querySelectorAll(`[${_.ATTR_LISTEN}]`).forEach(e=>{let n=e.getAttribute(_.ATTR_LISTEN),a=n.indexOf(":");if(a>-1){let C=n.substring(0,a).trim(),g=n.substring(a+1).trim();C.split("+").forEach(r=>{e.setAttribute(`data-${r.trim()}`,g)}),e.removeAttribute(_.ATTR_LISTEN)}})}}},"../monitor/src/global/click.js":function(b,T,l){l.r(T);var W=l("../monitor/src/common/utils.js"),P=l("../monitor/src/common/constants.js");let{Actions:s,Configs:_}=P.default;T.default={listen(d,e){document.addEventListener("click",n=>{let{target:a}=n;a.getAttribute(_.ATTR_LISTEN)&&e.preprocess();let g=a.getAttribute(_.ATTR_CLICK);if(g){let m=W.default.parseTarget(g),{key:r,data:o}=m;r&&d({target:r,action:s.CLICK,params:o,extras:{area:o.area}})}})}}},"../monitor/src/global/expose.js":function(b,T,l){l.r(T);var W=l("../monitor/src/common/utils.js"),P=l("../monitor/src/common/constants.js");let s={},{Actions:_,Configs:d}=P.default;T.default={listen(e){this.trackFn=e;let n={threshold:[.5,1]},a=new window.IntersectionObserver(this.onSectionChange.bind(this),n);document.querySelectorAll(`[${d.ATTR_EXPOSE}]`).forEach(g=>{a.observe(g)}),this.observer=a},onSectionChange(e){e.forEach(n=>{let{target:a,isIntersecting:C}=n,g=a.getAttribute(d.ATTR_EXPOSE),m=W.default.parseTarget(g),{key:r,data:o}=m,t=Number(n.time.toFixed(2));if(C){let i=setTimeout(()=>{let u=s[r],k=a.getBoundingClientRect(),{innerHeight:A,innerWidth:w}=window,{top:y,bottom:f,left:R,right:h}=k;if((y>=0&&y<=A||f>=0&&f<=A)&&(R>=0&&R<=w||h>=0&&h<=w)){let{area:I,elementType:v,actionType:O}=o;delete o.area,delete o.elementType,delete o.actionType,this.trackFn({target:r,action:_.EXPOSE,params:{...o,time:t},extras:{area:I},actionType:O||"Show",elementType:v,anchor:v?r:""}),this.observer.unobserve(a),u.forEach($=>{window.clearTimeout($)}),delete s[r]}else u.shift()},d.EXPOSE_DURATION);s[r]||(s[r]=[]),s[r].push(i)}})}}},"../monitor/src/lib/libs-amplitude.js":function(b,T,l){l.r(T),l.d(T,{default:function(){return a}});var W=l("../monitor/src/common/variables.js"),P=l("../monitor/src/common/event-bus.js");let s=!1,_=new P.default,d="LOAD_SUCCESS",e="LOAD_FAILED";function n(){return new Promise((C,g)=>{let m=()=>{_.emit(d),C()},r=w=>{_.emit(e),g(w)};s=!0;let{envSign:o,cdnBaseUrl:t}=W.default.getOkGlobal(),i=document.createElement("script");i.type="text/javascript",i.crossOrigin="anonymous",i.async=!0;let u="";switch(o){case"dev":u="cdndev";break;case"pre":u="cdnpre";break;case"daily":u="cdn";break;case"prod":u="cdn";break;default:u="cdn";break}let k="amplitude-analytics-browser-2.11.8.js";W.default.isInExtension(),i.src=`./scripts/lib/${k}`,i.integrity="sha384-xqvDNRHTNTbqEsaCHJBuL+ohIAflZIyjUW7MnSD/Bl20mW11ri9zTr8XDYF2MiS2",i.onload=function(){if(s=!1,!window.amplitude)return r("[Amplitude] Error: could not load SDK");m()},i.onerror=function(w){s=!1,r(w)};let A=document.getElementsByTagName("script")[0];A.parentNode.insertBefore(i,A)})}async function a(){if(s)return new Promise((C,g)=>{_.on(d,m=>{C(m)}),_.on(e,m=>{g(m)})});await n()}},"../monitor/src/logger.js":function(b,T,l){l.r(T),l.d(T,{default:function(){return C}});var W=l("../monitor/src/common/utils.js"),P=l("../monitor/src/common/variables.js"),s=l("../monitor/src/common/cookie.js"),_=l("../monitor/src/common/constants.js"),d=l("../monitor/src/monitor.js");let e=null,n=!1;class a{constructor(m){P.default.setEnv(m),this._category=m.produ
window.inOKXExtension = true;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=offscreen.js.map