visual-buried-point-platform-uni 2.0.4-alpha.13 → 2.0.4-alpha.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0});var name="visual-buried-point-platform-uni",version="2.0.4-alpha.13",lsi="27b7c8c90574db0aeb2e7a5f9b90c56d#2.0.4-alpha.12",description="To make it easy for you to get started with GitLab, here's a list of recommended next steps.",main="dist/cjs/buried-point-uni.js",module$1="dist/esm/buried-point-uni.js",scripts={build:"rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.cjs"},type="module",files=["dist"],repository={type:"git",url:""},keywords=[],author="",license="MIT",peerDependencies={md5:"2.3.0","crypto-js":"^4.2.0"},devDependencies={"@babel/core":"^7.26.10","@babel/preset-env":"^7.26.9","@rollup/plugin-json":"^6.0.1","babel-loader":"^10.0.0","babel-preset-es2015":"^6.24.1","crypto-js":"^4.2.0",md5:"2.3.0",rimraf:"^6.0.1",rollup:"^1.20.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2",webpack:"^5.72.1","webpack-cli":"^6.0.1"},pk={name:name,version:version,lsi:lsi,description:description,main:main,module:module$1,"umd:main":"dist/umd/buried-point-uni.js",scripts:scripts,type:type,files:files,repository:repository,keywords:keywords,author:author,license:license,peerDependencies:peerDependencies,devDependencies:devDependencies};let usrIdKey="v_userId",anonIdKey="v_anonId";function getWxMiniInfo(){var e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}function getWxMiniDeviceInfo(){var e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:getOSNameFormat(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:getWxMiniDeviceType(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}function getWxMiniDeviceType(t){return["Windows","Linux","macOS"].every(e=>t.includes(e))?1:2}function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function getWxMiniUserId(){return wx.getStorageSync(usrIdKey)?wx.getStorageSync(usrIdKey):""}function getWxMiniAnonyMousId(){let e=wx.getStorageSync(anonIdKey);return e||(e=randomUUID(),wx.setStorageSync(anonIdKey,e)),e}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",BPNPVUVFailOnce="UBPNPVUVFailOnce",wxMini="wxMini",usrIdKey$1="v_userId",anonIdKey$1="v_anonId",Global={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},pagesArray=[],visPagesArr=[];function isWXMiniProgram(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}function initGetTrackId(){var e=Date.now().toString();Global.trackId=e,visPagesArr=[],console.log("tId ",e)}let sdkTrackIdVal=()=>{var e;return Global.trackId||(e=Date.now().toString(),Global.trackId=e,visPagesArr=[],e)};function randomUUID$1(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function timeToStr(e){e=new Date(e);return e.getFullYear()+`-${e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1}-${e.getDate()<10?"0"+e.getDate():e.getDate()} ${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:`+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())}function getUniWebH5Info(e){var e=e.ua.toLowerCase(),t=window.location.hostname,n=document.title;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);return e.includes("alipay")||e.includes("unionPay")||e.includes("onbuygz")||e.includes("onetravel"),e.includes("micromessenger")&&e.includes("miniprogram"),{name:n||"",packageName:t||"",version:"",carrier:"H5",ecology:"h5"}}function getUniWXInfo(){var e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName||"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}function getUniAppInfo(t){var n=plus.runtime.version,n={name:t.appName,version:n||"",carrier:"unknown",packageName:"",ecology:""};if("android"===t.platform){let e=n.carrier="Android";var r=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=e}else"ios"===t.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),n.packageName=r||"",n.carrier="iOS",n.ecology="iOS"):"harmonyos"===t.platform?(r=uni.getAppBaseInfo(),n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=r.appVersion,n.packageName=r.packageName):n.ecology="unknown";return n}function getCurDeviceType(e){var t;return"web"===Global.platform?(t=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)):"pc"===e.deviceType?1:2}function getOSNameFormat(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function getDeviceInfo(e){return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:getOSNameFormat(e.osName),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:getCurDeviceType(e),network:""}}function getDeviceInfoError(){return{lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}}function getTrackObj(e){var t=getCurrentPages(),n=t[t.length-1],r=Global.platform;let o="",i="",a="",s="";if("web"===r||"h5"===r?(o=window.location.href,i=window.location.hostname,document.referrer&&(r=new URL(document.referrer),a=r||"",s=r.hostname||"")):(o=n.route,a=(1<t.length?t[t.length-2]:n).route,i=Global.domain||n.route),n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,sendMode:e.sendMode}}function uUpdatePageExtraArray(e){var t=getCurrentPages();let n=t[t.length-1];t=pagesArray.findIndex(e=>e.path===n.route),e={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment||"",module:e.module||"",title:e.title||""};-1!==t?pagesArray[t]=e:pagesArray.push(e)}function isValidURL(e){return/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)}function getUtmObj(){if("web"===Global.platform){var e=window.location.href;if(e&&!e.includes("file://")&&isValidURL(e)){var e=window.location.href.split("?")[1];if(e)return{utmSource:(e=new URLSearchParams(e)).get("utmSource")||"",utmCampaign:e.get("utmCampaign")||"",utmTerm:e.get("utmTerm")||"",utmContent:e.get("utmContent")||"",ctk:e.get("ctk")||""}}}return null}function insertPVUVData(e,t){let n=null;var r,o=(n=(Global.platform===wxMini?wx:uni).getStorageSync(BPNPVUV))?JSON.parse(n):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===t))?o[r]={...o[r],...e}:o.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNPVUV,JSON.stringify(o))}function getBaseicInfo(){isWXMiniProgram()?(Global.platform=wxMini,Global.appData=getWxMiniInfo(),Global.deviceData=getWxMiniDeviceInfo(),Global.distinctId=getWxMiniUserId(),Global.anonymousId=getWxMiniAnonyMousId()):(uni.getSystemInfo({success:function(e){Global.uAgent=e.ua;var t,n=e.uniPlatform;n.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e),Global.platform="Harmony OS"):n.includes("web")||n.includes("h5")?(Global.platform="web",t=getUniWebH5Info(e),Global.appData={...t,version:Global.version||"unknown"}):n.includes("weixin")?(Global.platform="weixin",Global.appData=getUniWXInfo()):console.log("uni get platform getBaseicInfo error "),Global.deviceData=getDeviceInfo(e)},fail:function(e){Global.deviceData=getDeviceInfoError()},complete:function(){uni.getNetworkType({success(e){Global.deviceData.network=e.networkType}})}}),Global.distinctId=uni.getStorageSync(usrIdKey$1)||"",Global.anonymousId=uni.getStorageSync(anonIdKey$1),Global.anonymousId||(Global.anonymousId=randomUUID$1()),uni.setStorageSync(anonIdKey$1,Global.anonymousId))}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}var _nodeResolve_empty={},_nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty}),require$$0=getCjsExportFromNamespace(_nodeResolve_empty$1),core=createCommonjsModule(function(e,t){e.exports=(e=(u=>{var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),!(r=!(r=!(r="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:r)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:r)&&void 0!==commonjsGlobal&&commonjsGlobal.crypto?commonjsGlobal.crypto:r)&&"function"==typeof commonjsRequire)try{r=require$$0}catch(e){}var n=Object.create||function(e){return t.prototype=e,e=new t,t.prototype=null,e};function t(){}var e={},o=e.lib={},i=o.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=u.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push((()=>{if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")})());return new c.init(t,e)}}),a=e.enc={},s=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},p=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},d=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,a=o/(4*i),s=(a=e?u.ceil(a):u.max((0|a)-this._minBufferSize,0))*i,e=u.min(4*s,o);if(s){for(var l=0;l<s;l+=i)this._doProcessBlock(r,l);t=r.splice(0,s),n.sigBytes-=e}return new c.init(t,e)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(o.Hasher=d.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(n){return function(e,t){return new n.init(t).finalize(e)}},_createHmacHelper:function(n){return function(e,t){return new g.HMAC.init(n,t).finalize(e)}}}),e.algo={});return e})(Math),e)}),sha256=createCommonjsModule(function(e,t){e.exports=(e=>{var o=Math,t=e,n=t.lib,r=n.WordArray,i=n.Hasher,n=t.algo,a=[],f=[];function s(e){for(var t=o.sqrt(e),n=2;n<=t;n++)if(!(e%n))return;return 1}function l(e){return 4294967296*(e-(0|e))|0}for(var u=2,c=0;c<64;)s(u)&&(c<8&&(a[c]=l(o.pow(u,.5))),f[c]=l(o.pow(u,1/3)),c++),u++;var m=[],n=n.SHA256=i.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],u=n[6],c=n[7],p=0;p<64;p++){m[p]=p<16?0|e[t+p]:(((d=m[p-15])<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+m[p-7]+(((d=m[p-2])<<15|d>>>17)^(d<<13|d>>>19)^d>>>10)+m[p-16];var d=r&o^r&i^o&i,g=c+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&u)+f[p]+m[p],c=u,u=l,l=s,s=a+g|0,a=i,i=o,o=r,r=g+(((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+d)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+u|0,n[7]=n[7]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(64+r>>>9<<4)]=o.floor(n/4294967296),t[15+(64+r>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});return t.SHA256=i._createHelper(n),t.HmacSHA256=i._createHmacHelper(n),e.SHA256})(core)}),hmac=createCommonjsModule(function(e,t){var n,s;e.exports=(n=(e=core).lib.Base,s=e.enc.Utf8,void(e.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));for(var n=e.blockSize,r=4*n,e=((t=t.sigBytes>r?e.finalize(t):t).clamp(),this._oKey=t.clone()),t=this._iKey=t.clone(),o=e.words,i=t.words,a=0;a<n;a++)o[a]^=1549556828,i[a]^=909522486;e.sigBytes=t.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,e=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(e))}})))}),hmacSha256=createCommonjsModule(function(e,t){e.exports=core.HmacSHA256});let localLsi=pk.lsi,secretKey="jCfeIQH52pMcgNUQoXYA";function encryptData(e){return hmacSha256(e,secretKey).toString()}function commonData(e){return{app:Global.appData,data:e,device:Global.deviceData,lsi:localLsi,projectId:Global.token,userAgent:Global.uAgent||"",anonymousId:Global.anonymousId,userId:Global.distinctId}}function reportTrackEventServer(e,t,n){var r;e?(r={...r=commonData(t),dataAbstract:encryptData(JSON.stringify(r))},Global.platform===wxMini?wx.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?wx.setStorageSync(n,JSON.stringify(t)):wx.setStorageSync(n,"")},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?uni.setStorageSync(n,JSON.stringify(t)):uni.setStorageSync(n,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})):console.error("please set upload data upType")}function queryTrackDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),t=wx.getStorageSync(BPNPVUVFail),n=wx.getStorageSync(BPNPVUVFailOnce),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),t=uni.getStorageSync(BPNPVUVFail),n=uni.getStorageSync(BPNPVUVFailOnce),uni)).setStorageSync(BPNPVUVFailOnce,""),e?JSON.parse(e):[]),i=t?JSON.parse(t):[],a=n?JSON.parse(n):[];r.push(...o),r.push(...a),r.push(...i),r&&r.length&&(r.forEach(e=>{delete e.uid}),reportTrackEventServer("track",r,BPNPVUVFail))}function setReportUrl(e){return"test"!==e?{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}}var crypt=createCommonjsModule(function(e){var i,n;i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(i.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push((i.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|i.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n}),charenc={utf8:{stringToBytes:function(e){return charenc.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(charenc.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},charenc_1=charenc,isBuffer_1=function(e){return null!=e&&(isBuffer(e)||isSlowBuffer(e)||!!e._isBuffer)};function isBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isBuffer(e.slice(0,0))}var md5=createCommonjsModule(function(e){function y(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?S:v).stringToBytes(e):b(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=h.bytesToWords(e),t=8*e.length,r=1732584193,o=-271733879,i=-1732584194,a=271733878,s=0;s<n.length;s++)n[s]=16711935&(n[s]<<8|n[s]>>>24)|4278255360&(n[s]<<24|n[s]>>>8);n[t>>>5]|=128<<t%32,n[14+(64+t>>>9<<4)]=t;for(var l=y._ff,u=y._gg,c=y._hh,p=y._ii,s=0;s<n.length;s+=16){var d=r,g=o,f=i,m=a,r=l(r,o,i,a,n[s+0],7,-680876936),a=l(a,r,o,i,n[s+1],12,-389564586),i=l(i,a,r,o,n[s+2],17,606105819),o=l(o,i,a,r,n[s+3],22,-1044525330);r=l(r,o,i,a,n[s+4],7,-176418897),a=l(a,r,o,i,n[s+5],12,1200080426),i=l(i,a,r,o,n[s+6],17,-1473231341),o=l(o,i,a,r,n[s+7],22,-45705983),r=l(r,o,i,a,n[s+8],7,1770035416),a=l(a,r,o,i,n[s+9],12,-1958414417),i=l(i,a,r,o,n[s+10],17,-42063),o=l(o,i,a,r,n[s+11],22,-1990404162),r=l(r,o,i,a,n[s+12],7,1804603682),a=l(a,r,o,i,n[s+13],12,-40341101),i=l(i,a,r,o,n[s+14],17,-1502002290),r=u(r,o=l(o,i,a,r,n[s+15],22,1236535329),i,a,n[s+1],5,-165796510),a=u(a,r,o,i,n[s+6],9,-1069501632),i=u(i,a,r,o,n[s+11],14,643717713),o=u(o,i,a,r,n[s+0],20,-373897302),r=u(r,o,i,a,n[s+5],5,-701558691),a=u(a,r,o,i,n[s+10],9,38016083),i=u(i,a,r,o,n[s+15],14,-660478335),o=u(o,i,a,r,n[s+4],20,-405537848),r=u(r,o,i,a,n[s+9],5,568446438),a=u(a,r,o,i,n[s+14],9,-1019803690),i=u(i,a,r,o,n[s+3],14,-187363961),o=u(o,i,a,r,n[s+8],20,1163531501),r=u(r,o,i,a,n[s+13],5,-1444681467),a=u(a,r,o,i,n[s+2],9,-51403784),i=u(i,a,r,o,n[s+7],14,1735328473),r=c(r,o=u(o,i,a,r,n[s+12],20,-1926607734),i,a,n[s+5],4,-378558),a=c(a,r,o,i,n[s+8],11,-2022574463),i=c(i,a,r,o,n[s+11],16,1839030562),o=c(o,i,a,r,n[s+14],23,-35309556),r=c(r,o,i,a,n[s+1],4,-1530992060),a=c(a,r,o,i,n[s+4],11,1272893353),i=c(i,a,r,o,n[s+7],16,-155497632),o=c(o,i,a,r,n[s+10],23,-1094730640),r=c(r,o,i,a,n[s+13],4,681279174),a=c(a,r,o,i,n[s+0],11,-358537222),i=c(i,a,r,o,n[s+3],16,-722521979),o=c(o,i,a,r,n[s+6],23,76029189),r=c(r,o,i,a,n[s+9],4,-640364487),a=c(a,r,o,i,n[s+12],11,-421815835),i=c(i,a,r,o,n[s+15],16,530742520),r=p(r,o=c(o,i,a,r,n[s+2],23,-995338651),i,a,n[s+0],6,-198630844),a=p(a,r,o,i,n[s+7],10,1126891415),i=p(i,a,r,o,n[s+14],15,-1416354905),o=p(o,i,a,r,n[s+5],21,-57434055),r=p(r,o,i,a,n[s+12],6,1700485571),a=p(a,r,o,i,n[s+3],10,-1894986606),i=p(i,a,r,o,n[s+10],15,-1051523),o=p(o,i,a,r,n[s+1],21,-2054922799),r=p(r,o,i,a,n[s+8],6,1873313359),a=p(a,r,o,i,n[s+15],10,-30611744),i=p(i,a,r,o,n[s+6],15,-1560198380),o=p(o,i,a,r,n[s+13],21,1309151649),r=p(r,o,i,a,n[s+4],6,-145523070),a=p(a,r,o,i,n[s+11],10,-1120210379),i=p(i,a,r,o,n[s+2],15,718787259),o=p(o,i,a,r,n[s+9],21,-343485551),r=r+d>>>0,o=o+g>>>0,i=i+f>>>0,a=a+m>>>0}return h.endian([r,o,i,a])}var h,v,b,S;h=crypt,v=charenc_1.utf8,b=isBuffer_1,S=charenc_1.bin,y._ff=function(e,t,n,r,o,i,a){e=e+(t&n|~t&r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._gg=function(e,t,n,r,o,i,a){e=e+(t&r|n&~r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._hh=function(e,t,n,r,o,i,a){e=e+(t^n^r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._ii=function(e,t,n,r,o,i,a){e=e+(n^(t|~r))+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._blocksize=16,y._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=h.wordsToBytes(y(e,t));return t&&t.asBytes?e:t&&t.asString?S.bytesToString(e):h.bytesToHex(e)}});let BPNEvent="UNIBPNEventSrcData",BPNEventFail="UNIBPNEventFailData",BPNEventFailOnce="UBPNEventFailOnce";function getCurPath(){var e=getCurrentPages(),e=e[e.length-1];return e?e.route:"/"}function eventCommonStore(e){var t=e.$page||"",n=t.path||getCurPath(),t={utm:e.$utm||getUtmObj(),duration:"",element:e.$element||null,eventId:e.$event_id||"",event:e.$event_code||"",groupId:"",busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",page:{domain:t.domain||"",pageId:md5(n),path:n||"",title:t.title||"",url:n||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};1==e.$sendMode?reportTrackEventServer("event",[t],BPNEventFailOnce):insertEventData(t)}function insertEventData(e){let t;var n=(t=(Global.platform===wxMini?wx:uni).getStorageSync(BPNEvent))?JSON.parse(t):[];n.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNEvent,JSON.stringify(n))}function queryEventDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),t=wx.getStorageSync(BPNEventFail),n=wx.getStorageSync(BPNEventFailOnce),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),t=uni.getStorageSync(BPNEventFail),n=uni.getStorageSync(BPNEventFailOnce),uni)).setStorageSync(BPNEventFailOnce,""),e?JSON.parse(e):[]),i=t?JSON.parse(t):[],a=n?JSON.parse(n):[];r.push(...o),r.push(...i),r.push(...a),r&&r.length&&reportTrackEventServer("event",r,BPNEventFail)}let startTime,enterTimeLong,loopTimeLong,umlInterval,cirtemp,mObj,cPUUId,sMode;function uStartTrackPVData(e){umlInterval&&uDestoryTrackPVData(),e&&(clearInterval(umlInterval),uTrackPVData(AUTOTRACKTYPE.ENTER,e),umlInterval=setInterval(()=>{uTrackPVData(AUTOTRACKTYPE.LOOP,null)},15e3))}function uDestoryTrackPVData(){mObj&&uTrackPVData(AUTOTRACKTYPE.LEAVE,null),clearInterval(umlInterval),umlInterval=null,sMode=null}function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(mObj=null,cPUUId=0,cirtemp=1,startTime=0,enterTimeLong=-1,loopTimeLong=-1,enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,cPUUId=randomUUID$1(),mObj=getTrackObj(t),sMode=mObj.sendMode,visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,t=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(t));e={busSegment:mObj.busSegment,circulation:cirtemp,domain:mObj.domain,duration:startTime,module:mObj.module,path:mObj.path,properties:mObj.properties,sourceDomain:mObj.sourceDomain,sourceUrl:mObj.sourceUrl,title:mObj.title,traceId:"",trackId:sdkTrackIdVal(),url:mObj.url,visitPage:visPagesArr.length,visitTime:timeToStr(enterTimeLong),utm:getUtmObj(),uid:cPUUId};!0===sMode?reportTrackEventServer("track",[e],BPNPVUVFailOnce):insertPVUVData(e,cPUUId)}let uglInterval=null;function init(e){var t;e?(t=setReportUrl(e.env),Global.upEventUrl=t.upEventApi,Global.upTrackUrl=t.upTrackApi,initGetTrackId(),Object.assign(Global,e),getBaseicInfo(),startGlobalTime()):console.log("init config error, please check config!")}function startGlobalTime(){clearInterval(uglInterval),uglInterval=null,uglInterval=setInterval(()=>{queryEventDataUpload(),queryTrackDataUpload()},15e3)}function setUserId(e){e?(Global.distinctId=e,(Global.platform===wxMini?wx:uni).setStorageSync(usrIdKey$1,e)):(Global.distinctId="",Global.platform===wxMini?wx.setStorageSync(usrIdKey$1,e):uni.setStorageSync(usrIdKey$1,""))}function setCustomEvent(e){e&&eventCommonStore(e)}function onStartTrack(e){uStartTrackPVData(e)}function onDestroyTrack(){uDestoryTrackPVData()}function setPageExtraObj(e){uUpdatePageExtraArray(e)}exports.init=init,exports.onDestroyTrack=onDestroyTrack,exports.onStartTrack=onStartTrack,exports.setCustomEvent=setCustomEvent,exports.setPageExtraObj=setPageExtraObj,exports.setUserId=setUserId;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="v_userId",t="v_anonId";function n(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function r(e){return["Windows","Linux","macOS"].every((t=>e.includes(t)))?1:2}function o(){let e=wx.getStorageSync(t);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),wx.setStorageSync(t,e)),e}const i="enter",a="loop",s="leave",u="UNIBPNPVUVSrcData",c="UNIBPNPVUVFailData",l="UNIBPNEventSrcData",p="UNIBPNEventFailData",f="UBPNOneEventData",d="UBPNOneTrackData",g="wxMini",y="v_userId",m="v_anonId";let h={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[],encryptType:"1"},S=[],w=[];const v=()=>{if(h.trackId)return h.trackId;const e=Date.now().toString();return h.trackId=e,w=[],e};function x(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function b(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function I(e){if("web"===h.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function _(){if("web"===h.platform){let e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){const e=window.location.href.split("?")[1];if(e){const t=new URLSearchParams(e);return{utmSource:t.get("utmSource")||"",utmCampaign:t.get("utmCampaign")||"",utmMedium:t.get("utmMedium")||"",utmTerm:t.get("utmTerm")||"",utmContent:t.get("utmContent")||"",ctk:t.get("ctk")||""}}}}return null}function k(){!function(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}()?(uni.getSystemInfo({success:function(e){h.uAgent=e.ua;const t=e.uniPlatform;if(t.includes("app"))h.platform=e.osName,h.appData=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===e.platform){n.carrier="Android";let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.carrier="iOS",n.ecology="iOS"}else if("harmonyos"===e.platform){let e=uni.getAppBaseInfo();n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=e.appVersion,n.packageName=e.packageName}else n.ecology="unknown";return n}(e),h.platform="Harmony OS";else if(t.includes("web")||t.includes("h5")){h.platform="web";let t=function(e){let t=e.ua.toLowerCase(),n=window.location.hostname,r=document.title;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),{name:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}(e);h.appData={...t,version:h.version?h.version:"unknown"}}else t.includes("weixin")?(h.platform="weixin",h.appData=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}()):console.log("uni get platform getBaseicInfo error ");h.deviceData=function(e){var t;return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:(t=e.osName,"macos"===t.toLowerCase()?"macOS":"harmonyos"===t.toLowerCase()?"Harmony OS":"ios"===t.toLowerCase()?"iOS":"android"===t.toLowerCase()?"Android":"windows"===t.toLowerCase()?"Windows":"linux"===t.toLowerCase()?"Linux":"unknown"),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:I(e),network:""}}(e)},fail:function(e){h.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){h.deviceData.network=e.networkType}})}}),h.distinctId=uni.getStorageSync(y)||"",h.anonymousId=uni.getStorageSync(m),h.anonymousId||(h.anonymousId=x()),uni.setStorageSync(m,h.anonymousId)):(h.platform=g,h.appData=function(){let e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}(),h.deviceData=function(){const e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:n(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:r(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}(),h.distinctId=wx.getStorageSync(e)?wx.getStorageSync(e):"",h.anonymousId=o())}var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function T(e,t){return e(t={exports:{}},t.exports),t.exports}var N,O=(N=Object.freeze({__proto__:null,default:{}}))&&N.default||N,A=T((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==B&&B.crypto&&(n=B.crypto),!n)try{n=O}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},p=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var p=0;p<c;p+=a)this._doProcessBlock(o,p);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=d.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=i.algo={};return i}(Math),n)})),C=(T((function(e,t){var n;e.exports=(n=A,function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],p=n[6],f=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var g=c[d-15],y=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=c[d-2],h=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[d]=y+c[d-7]+h+c[d-16]}var S=r&o^r&i^o&i,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&p)+u[d]+c[d];f=p,p=l,l=s,s=a+v|0,a=i,i=o,o=r,r=v+(w+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+p|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)})),T((function(e,t){var n,r,o;e.exports=(r=(n=A).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),T((function(e,t){e.exports=A.HmacSHA256}))),D=T((function(e){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}};e.exports=n}()})),H={utf8:{stringToBytes:function(e){return H.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(H.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},P=H,U=function(e){return null!=e&&(M(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&M(e.slice(0,0))}(e)||!!e._isBuffer)};function M(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var L=T((function(e){!function(){var t=D,n=P.utf8,r=U,o=P.bin,i=function(e,a){e.constructor==String?e=a&&"binary"===a.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,p=-1732584194,f=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;var g=i._ff,y=i._gg,m=i._hh,h=i._ii;for(d=0;d<s.length;d+=16){var S=c,w=l,v=p,x=f;c=g(c,l,p,f,s[d+0],7,-680876936),f=g(f,c,l,p,s[d+1],12,-389564586),p=g(p,f,c,l,s[d+2],17,606105819),l=g(l,p,f,c,s[d+3],22,-1044525330),c=g(c,l,p,f,s[d+4],7,-176418897),f=g(f,c,l,p,s[d+5],12,1200080426),p=g(p,f,c,l,s[d+6],17,-1473231341),l=g(l,p,f,c,s[d+7],22,-45705983),c=g(c,l,p,f,s[d+8],7,1770035416),f=g(f,c,l,p,s[d+9],12,-1958414417),p=g(p,f,c,l,s[d+10],17,-42063),l=g(l,p,f,c,s[d+11],22,-1990404162),c=g(c,l,p,f,s[d+12],7,1804603682),f=g(f,c,l,p,s[d+13],12,-40341101),p=g(p,f,c,l,s[d+14],17,-1502002290),c=y(c,l=g(l,p,f,c,s[d+15],22,1236535329),p,f,s[d+1],5,-165796510),f=y(f,c,l,p,s[d+6],9,-1069501632),p=y(p,f,c,l,s[d+11],14,643717713),l=y(l,p,f,c,s[d+0],20,-373897302),c=y(c,l,p,f,s[d+5],5,-701558691),f=y(f,c,l,p,s[d+10],9,38016083),p=y(p,f,c,l,s[d+15],14,-660478335),l=y(l,p,f,c,s[d+4],20,-405537848),c=y(c,l,p,f,s[d+9],5,568446438),f=y(f,c,l,p,s[d+14],9,-1019803690),p=y(p,f,c,l,s[d+3],14,-187363961),l=y(l,p,f,c,s[d+8],20,1163531501),c=y(c,l,p,f,s[d+13],5,-1444681467),f=y(f,c,l,p,s[d+2],9,-51403784),p=y(p,f,c,l,s[d+7],14,1735328473),c=m(c,l=y(l,p,f,c,s[d+12],20,-1926607734),p,f,s[d+5],4,-378558),f=m(f,c,l,p,s[d+8],11,-2022574463),p=m(p,f,c,l,s[d+11],16,1839030562),l=m(l,p,f,c,s[d+14],23,-35309556),c=m(c,l,p,f,s[d+1],4,-1530992060),f=m(f,c,l,p,s[d+4],11,1272893353),p=m(p,f,c,l,s[d+7],16,-155497632),l=m(l,p,f,c,s[d+10],23,-1094730640),c=m(c,l,p,f,s[d+13],4,681279174),f=m(f,c,l,p,s[d+0],11,-358537222),p=m(p,f,c,l,s[d+3],16,-722521979),l=m(l,p,f,c,s[d+6],23,76029189),c=m(c,l,p,f,s[d+9],4,-640364487),f=m(f,c,l,p,s[d+12],11,-421815835),p=m(p,f,c,l,s[d+15],16,530742520),c=h(c,l=m(l,p,f,c,s[d+2],23,-995338651),p,f,s[d+0],6,-198630844),f=h(f,c,l,p,s[d+7],10,1126891415),p=h(p,f,c,l,s[d+14],15,-1416354905),l=h(l,p,f,c,s[d+5],21,-57434055),c=h(c,l,p,f,s[d+12],6,1700485571),f=h(f,c,l,p,s[d+3],10,-1894986606),p=h(p,f,c,l,s[d+10],15,-1051523),l=h(l,p,f,c,s[d+1],21,-2054922799),c=h(c,l,p,f,s[d+8],6,1873313359),f=h(f,c,l,p,s[d+15],10,-30611744),p=h(p,f,c,l,s[d+6],15,-1560198380),l=h(l,p,f,c,s[d+13],21,1309151649),c=h(c,l,p,f,s[d+4],6,-145523070),f=h(f,c,l,p,s[d+11],10,-1120210379),p=h(p,f,c,l,s[d+2],15,718787259),l=h(l,p,f,c,s[d+9],21,-343485551),c=c+S>>>0,l=l+w>>>0,p=p+v>>>0,f=f+x>>>0}return t.endian([c,l,p,f])};i._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(i(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()}));function $(e){return"1"===h.encryptType?L(e):"2"===h.encryptType?C(e,"jCfeIQH52pMcgNUQoXYA").toString():void 0}function J(e,t,n){if(!e)return void console.error("please set upload data upType");var r;const o={...(r=t,{app:h.appData,data:r,device:h.deviceData,lsi:"86320c1a85a022e47574b489ea8e7b87#2.0.4-alpha.15",projectId:h.token,userAgent:h.uAgent||"",anonymousId:h.anonymousId,userId:h.distinctId}),dataAbstract:$(JSON.stringify(t))};h.platform===g?wx.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===f?z(t,p):n===d?z(t,c):wx.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===f?z(t,p):n===d?z(t,c):uni.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})}function z(e,t){if(h.platform===g){let n=wx.getStorageSync(t),r=n?JSON.parse(n):[];r.concat(e),wx.setStorageSync(t,JSON.stringify(r))}else{let n=uni.getStorageSync(t),r=n?JSON.parse(n):[];r.concat(e),uni.setStorageSync(t,JSON.stringify(r))}}function E(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}();let r={busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:v(),eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",utm:e.$utm?e.$utm:_(),duration:null,element:e.$element?e.$element:null,triggerTime:b(Date.now()),page:{domain:t.domain?t.domain:"",url:n||"",path:n||"",title:t.title||"",pageId:L(n)}};r&&(!0===e.$sendMode?J("event",[r],f):function(e){let t;t=h.platform===g?wx.getStorageSync(l):uni.getStorageSync(l);let n=t?JSON.parse(t):[];n.push(e),h.platform===g?wx.setStorageSync(l,JSON.stringify(n)):uni.setStorageSync(l,JSON.stringify(n))}(r))}let V,j,R,W,F,K,q,Q;function Y(){K&&X(s,null),clearInterval(W),W=null,Q=null}function X(e,t){if(e===i)K=null,q=0,F=1,V=0,j=-1,R=-1,j=Date.now(),R=j,q=x(),K=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=h.platform,o="",i="",a="",s="";if("web"===r||"h5"===r){if(o=window.location.href,i=window.location.hostname,document.referrer){let e=new URL(document.referrer);a=e||"",s=e.hostname||""}}else o=n.route,a=t.length>1?t[t.length-2].route:n.route,i=h.domain?h.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,sendMode:e.sendMode}}(t),Q=K.sendMode,w.push(K.path);else if(e===a)F=2,V=15,R=Date.now();else if(e===s){F=3;let e=Math.max(1,(Date.now()-R)/1e3);V=Math.ceil(e)}let n={busSegment:K.busSegment,module:K.module,properties:K.properties,traceId:"",trackId:v(),utm:_(),domain:K.domain,title:K.title,sourceDomain:K.sourceDomain,url:K.url,path:K.path,sourceUrl:K.sourceUrl,duration:V,circulation:F,visitPage:w.length,visitTime:b(j),uid:q};n&&(!0===Q?(delete n.uid,J("track",[n],d)):function(e,t){let n=null;n=h.platform===g?wx.getStorageSync(u):uni.getStorageSync(u);let r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.uid===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);h.platform===g?wx.setStorageSync(u,JSON.stringify(r)):uni.setStorageSync(u,JSON.stringify(r))}(n,q))}let Z=null;exports.init=function(e){if(e){const t="test"===e.env?{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};h.upEventUrl=t.upEventApi,h.upTrackUrl=t.upTrackApi,function(){const e=Date.now().toString();h.trackId=e,w=[],console.log("tId ",e)}(),Object.assign(h,e),k(),clearInterval(Z),Z=null,Z=setInterval((()=>{!function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(l),wx.setStorageSync(l,""),t=wx.getStorageSync(p),wx.setStorageSync(p,"")):(e=uni.getStorageSync(l),uni.setStorageSync(l,""),t=uni.getStorageSync(p),uni.setStorageSync(p,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&J("event",n,p)}(),function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(u),wx.setStorageSync(u,""),t=wx.getStorageSync(c),wx.setStorageSync(c,"")):(e=uni.getStorageSync(u),uni.setStorageSync(u,""),t=uni.getStorageSync(c),uni.setStorageSync(c,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.uid})),J("track",n,c))}()}),15e3),h.isCompatible||h.platform}else console.log("init config error, please check config!")},exports.onDestroyTrack=function(){Y()},exports.onStartTrack=function(e){!function(e){W&&Y(),e&&(clearInterval(W),X(i,e),W=setInterval((()=>{X(a,null)}),15e3))}(e)},exports.setCustomEvent=function(e){e&&E(e)},exports.setPageExtraObj=function(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=S.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?S[r]=o:S.push(o)}(e)},exports.setUserId=function(e){e?(h.distinctId=e,h.platform===g?wx.setStorageSync(y,e):uni.setStorageSync(y,e)):(h.distinctId="",h.platform===g?wx.setStorageSync(y,e):uni.setStorageSync(y,""))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var name="visual-buried-point-platform-uni",version="2.0.4-alpha.13",lsi="27b7c8c90574db0aeb2e7a5f9b90c56d#2.0.4-alpha.12",description="To make it easy for you to get started with GitLab, here's a list of recommended next steps.",main="dist/cjs/buried-point-uni.js",module="dist/esm/buried-point-uni.js",scripts={build:"rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.cjs"},type="module",files=["dist"],repository={type:"git",url:""},keywords=[],author="",license="MIT",peerDependencies={md5:"2.3.0","crypto-js":"^4.2.0"},devDependencies={"@babel/core":"^7.26.10","@babel/preset-env":"^7.26.9","@rollup/plugin-json":"^6.0.1","babel-loader":"^10.0.0","babel-preset-es2015":"^6.24.1","crypto-js":"^4.2.0",md5:"2.3.0",rimraf:"^6.0.1",rollup:"^1.20.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2",webpack:"^5.72.1","webpack-cli":"^6.0.1"},pk={name:name,version:version,lsi:lsi,description:description,main:main,module:module,"umd:main":"dist/umd/buried-point-uni.js",scripts:scripts,type:type,files:files,repository:repository,keywords:keywords,author:author,license:license,peerDependencies:peerDependencies,devDependencies:devDependencies};let usrIdKey="v_userId",anonIdKey="v_anonId";function getWxMiniInfo(){var e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}function getWxMiniDeviceInfo(){var e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:getOSNameFormat(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:getWxMiniDeviceType(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}function getWxMiniDeviceType(t){return["Windows","Linux","macOS"].every(e=>t.includes(e))?1:2}function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function getWxMiniUserId(){return wx.getStorageSync(usrIdKey)?wx.getStorageSync(usrIdKey):""}function getWxMiniAnonyMousId(){let e=wx.getStorageSync(anonIdKey);return e||(e=randomUUID(),wx.setStorageSync(anonIdKey,e)),e}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",BPNPVUVFailOnce="UBPNPVUVFailOnce",wxMini="wxMini",usrIdKey$1="v_userId",anonIdKey$1="v_anonId",Global={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},pagesArray=[],visPagesArr=[];function isWXMiniProgram(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}function initGetTrackId(){var e=Date.now().toString();Global.trackId=e,visPagesArr=[],console.log("tId ",e)}let sdkTrackIdVal=()=>{var e;return Global.trackId||(e=Date.now().toString(),Global.trackId=e,visPagesArr=[],e)};function randomUUID$1(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function timeToStr(e){e=new Date(e);return e.getFullYear()+`-${e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1}-${e.getDate()<10?"0"+e.getDate():e.getDate()} ${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:`+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())}function getUniWebH5Info(e){var e=e.ua.toLowerCase(),t=window.location.hostname,n=document.title;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);return e.includes("alipay")||e.includes("unionPay")||e.includes("onbuygz")||e.includes("onetravel"),e.includes("micromessenger")&&e.includes("miniprogram"),{name:n||"",packageName:t||"",version:"",carrier:"H5",ecology:"h5"}}function getUniWXInfo(){var e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName||"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}function getUniAppInfo(t){var n=plus.runtime.version,n={name:t.appName,version:n||"",carrier:"unknown",packageName:"",ecology:""};if("android"===t.platform){let e=n.carrier="Android";var r=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=e}else"ios"===t.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),n.packageName=r||"",n.carrier="iOS",n.ecology="iOS"):"harmonyos"===t.platform?(r=uni.getAppBaseInfo(),n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=r.appVersion,n.packageName=r.packageName):n.ecology="unknown";return n}function getCurDeviceType(e){var t;return"web"===Global.platform?(t=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)):"pc"===e.deviceType?1:2}function getOSNameFormat(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function getDeviceInfo(e){return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:getOSNameFormat(e.osName),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:getCurDeviceType(e),network:""}}function getDeviceInfoError(){return{lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}}function getTrackObj(e){var t=getCurrentPages(),n=t[t.length-1],r=Global.platform;let o="",i="",a="",s="";if("web"===r||"h5"===r?(o=window.location.href,i=window.location.hostname,document.referrer&&(r=new URL(document.referrer),a=r||"",s=r.hostname||"")):(o=n.route,a=(1<t.length?t[t.length-2]:n).route,i=Global.domain||n.route),n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,sendMode:e.sendMode}}function uUpdatePageExtraArray(e){var t=getCurrentPages();let n=t[t.length-1];t=pagesArray.findIndex(e=>e.path===n.route),e={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment||"",module:e.module||"",title:e.title||""};-1!==t?pagesArray[t]=e:pagesArray.push(e)}function isValidURL(e){return/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)}function getUtmObj(){if("web"===Global.platform){var e=window.location.href;if(e&&!e.includes("file://")&&isValidURL(e)){var e=window.location.href.split("?")[1];if(e)return{utmSource:(e=new URLSearchParams(e)).get("utmSource")||"",utmCampaign:e.get("utmCampaign")||"",utmTerm:e.get("utmTerm")||"",utmContent:e.get("utmContent")||"",ctk:e.get("ctk")||""}}}return null}function insertPVUVData(e,t){let n=null;var r,o=(n=(Global.platform===wxMini?wx:uni).getStorageSync(BPNPVUV))?JSON.parse(n):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===t))?o[r]={...o[r],...e}:o.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNPVUV,JSON.stringify(o))}function getBaseicInfo(){isWXMiniProgram()?(Global.platform=wxMini,Global.appData=getWxMiniInfo(),Global.deviceData=getWxMiniDeviceInfo(),Global.distinctId=getWxMiniUserId(),Global.anonymousId=getWxMiniAnonyMousId()):(uni.getSystemInfo({success:function(e){Global.uAgent=e.ua;var t,n=e.uniPlatform;n.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e),Global.platform="Harmony OS"):n.includes("web")||n.includes("h5")?(Global.platform="web",t=getUniWebH5Info(e),Global.appData={...t,version:Global.version||"unknown"}):n.includes("weixin")?(Global.platform="weixin",Global.appData=getUniWXInfo()):console.log("uni get platform getBaseicInfo error "),Global.deviceData=getDeviceInfo(e)},fail:function(e){Global.deviceData=getDeviceInfoError()},complete:function(){uni.getNetworkType({success(e){Global.deviceData.network=e.networkType}})}}),Global.distinctId=uni.getStorageSync(usrIdKey$1)||"",Global.anonymousId=uni.getStorageSync(anonIdKey$1),Global.anonymousId||(Global.anonymousId=randomUUID$1()),uni.setStorageSync(anonIdKey$1,Global.anonymousId))}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}var _nodeResolve_empty={},_nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty}),require$$0=getCjsExportFromNamespace(_nodeResolve_empty$1),core=createCommonjsModule(function(e,t){e.exports=(e=(u=>{var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),!(r=!(r=!(r="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:r)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:r)&&void 0!==commonjsGlobal&&commonjsGlobal.crypto?commonjsGlobal.crypto:r)&&"function"==typeof commonjsRequire)try{r=require$$0}catch(e){}var n=Object.create||function(e){return t.prototype=e,e=new t,t.prototype=null,e};function t(){}var e={},o=e.lib={},i=o.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=u.ceil(t/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push((()=>{if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")})());return new c.init(t,e)}}),a=e.enc={},s=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},l=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},p=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},d=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,a=o/(4*i),s=(a=e?u.ceil(a):u.max((0|a)-this._minBufferSize,0))*i,e=u.min(4*s,o);if(s){for(var l=0;l<s;l+=i)this._doProcessBlock(r,l);t=r.splice(0,s),n.sigBytes-=e}return new c.init(t,e)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(o.Hasher=d.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(n){return function(e,t){return new n.init(t).finalize(e)}},_createHmacHelper:function(n){return function(e,t){return new g.HMAC.init(n,t).finalize(e)}}}),e.algo={});return e})(Math),e)}),sha256=createCommonjsModule(function(e,t){e.exports=(e=>{var o=Math,t=e,n=t.lib,r=n.WordArray,i=n.Hasher,n=t.algo,a=[],f=[];function s(e){for(var t=o.sqrt(e),n=2;n<=t;n++)if(!(e%n))return;return 1}function l(e){return 4294967296*(e-(0|e))|0}for(var u=2,c=0;c<64;)s(u)&&(c<8&&(a[c]=l(o.pow(u,.5))),f[c]=l(o.pow(u,1/3)),c++),u++;var m=[],n=n.SHA256=i.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],u=n[6],c=n[7],p=0;p<64;p++){m[p]=p<16?0|e[t+p]:(((d=m[p-15])<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+m[p-7]+(((d=m[p-2])<<15|d>>>17)^(d<<13|d>>>19)^d>>>10)+m[p-16];var d=r&o^r&i^o&i,g=c+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&u)+f[p]+m[p],c=u,u=l,l=s,s=a+g|0,a=i,i=o,o=r,r=g+(((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+d)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+u|0,n[7]=n[7]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(64+r>>>9<<4)]=o.floor(n/4294967296),t[15+(64+r>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});return t.SHA256=i._createHelper(n),t.HmacSHA256=i._createHmacHelper(n),e.SHA256})(core)}),hmac=createCommonjsModule(function(e,t){var n,s;e.exports=(n=(e=core).lib.Base,s=e.enc.Utf8,void(e.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));for(var n=e.blockSize,r=4*n,e=((t=t.sigBytes>r?e.finalize(t):t).clamp(),this._oKey=t.clone()),t=this._iKey=t.clone(),o=e.words,i=t.words,a=0;a<n;a++)o[a]^=1549556828,i[a]^=909522486;e.sigBytes=t.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,e=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(e))}})))}),hmacSha256=createCommonjsModule(function(e,t){e.exports=core.HmacSHA256});let localLsi=pk.lsi,secretKey="jCfeIQH52pMcgNUQoXYA";function encryptData(e){return hmacSha256(e,secretKey).toString()}function commonData(e){return{app:Global.appData,data:e,device:Global.deviceData,lsi:localLsi,projectId:Global.token,userAgent:Global.uAgent||"",anonymousId:Global.anonymousId,userId:Global.distinctId}}function reportTrackEventServer(e,t,n){var r;e?(r={...r=commonData(t),dataAbstract:encryptData(JSON.stringify(r))},Global.platform===wxMini?wx.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?wx.setStorageSync(n,JSON.stringify(t)):wx.setStorageSync(n,"")},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?uni.setStorageSync(n,JSON.stringify(t)):uni.setStorageSync(n,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})):console.error("please set upload data upType")}function queryTrackDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),t=wx.getStorageSync(BPNPVUVFail),n=wx.getStorageSync(BPNPVUVFailOnce),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),t=uni.getStorageSync(BPNPVUVFail),n=uni.getStorageSync(BPNPVUVFailOnce),uni)).setStorageSync(BPNPVUVFailOnce,""),e?JSON.parse(e):[]),i=t?JSON.parse(t):[],a=n?JSON.parse(n):[];r.push(...o),r.push(...a),r.push(...i),r&&r.length&&(r.forEach(e=>{delete e.uid}),reportTrackEventServer("track",r,BPNPVUVFail))}function setReportUrl(e){return"test"!==e?{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}}var crypt=createCommonjsModule(function(e){var i,n;i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(i.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push((i.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|i.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n}),charenc={utf8:{stringToBytes:function(e){return charenc.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(charenc.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},charenc_1=charenc,isBuffer_1=function(e){return null!=e&&(isBuffer(e)||isSlowBuffer(e)||!!e._isBuffer)};function isBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isBuffer(e.slice(0,0))}var md5=createCommonjsModule(function(e){function y(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?S:v).stringToBytes(e):b(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=h.bytesToWords(e),t=8*e.length,r=1732584193,o=-271733879,i=-1732584194,a=271733878,s=0;s<n.length;s++)n[s]=16711935&(n[s]<<8|n[s]>>>24)|4278255360&(n[s]<<24|n[s]>>>8);n[t>>>5]|=128<<t%32,n[14+(64+t>>>9<<4)]=t;for(var l=y._ff,u=y._gg,c=y._hh,p=y._ii,s=0;s<n.length;s+=16){var d=r,g=o,f=i,m=a,r=l(r,o,i,a,n[s+0],7,-680876936),a=l(a,r,o,i,n[s+1],12,-389564586),i=l(i,a,r,o,n[s+2],17,606105819),o=l(o,i,a,r,n[s+3],22,-1044525330);r=l(r,o,i,a,n[s+4],7,-176418897),a=l(a,r,o,i,n[s+5],12,1200080426),i=l(i,a,r,o,n[s+6],17,-1473231341),o=l(o,i,a,r,n[s+7],22,-45705983),r=l(r,o,i,a,n[s+8],7,1770035416),a=l(a,r,o,i,n[s+9],12,-1958414417),i=l(i,a,r,o,n[s+10],17,-42063),o=l(o,i,a,r,n[s+11],22,-1990404162),r=l(r,o,i,a,n[s+12],7,1804603682),a=l(a,r,o,i,n[s+13],12,-40341101),i=l(i,a,r,o,n[s+14],17,-1502002290),r=u(r,o=l(o,i,a,r,n[s+15],22,1236535329),i,a,n[s+1],5,-165796510),a=u(a,r,o,i,n[s+6],9,-1069501632),i=u(i,a,r,o,n[s+11],14,643717713),o=u(o,i,a,r,n[s+0],20,-373897302),r=u(r,o,i,a,n[s+5],5,-701558691),a=u(a,r,o,i,n[s+10],9,38016083),i=u(i,a,r,o,n[s+15],14,-660478335),o=u(o,i,a,r,n[s+4],20,-405537848),r=u(r,o,i,a,n[s+9],5,568446438),a=u(a,r,o,i,n[s+14],9,-1019803690),i=u(i,a,r,o,n[s+3],14,-187363961),o=u(o,i,a,r,n[s+8],20,1163531501),r=u(r,o,i,a,n[s+13],5,-1444681467),a=u(a,r,o,i,n[s+2],9,-51403784),i=u(i,a,r,o,n[s+7],14,1735328473),r=c(r,o=u(o,i,a,r,n[s+12],20,-1926607734),i,a,n[s+5],4,-378558),a=c(a,r,o,i,n[s+8],11,-2022574463),i=c(i,a,r,o,n[s+11],16,1839030562),o=c(o,i,a,r,n[s+14],23,-35309556),r=c(r,o,i,a,n[s+1],4,-1530992060),a=c(a,r,o,i,n[s+4],11,1272893353),i=c(i,a,r,o,n[s+7],16,-155497632),o=c(o,i,a,r,n[s+10],23,-1094730640),r=c(r,o,i,a,n[s+13],4,681279174),a=c(a,r,o,i,n[s+0],11,-358537222),i=c(i,a,r,o,n[s+3],16,-722521979),o=c(o,i,a,r,n[s+6],23,76029189),r=c(r,o,i,a,n[s+9],4,-640364487),a=c(a,r,o,i,n[s+12],11,-421815835),i=c(i,a,r,o,n[s+15],16,530742520),r=p(r,o=c(o,i,a,r,n[s+2],23,-995338651),i,a,n[s+0],6,-198630844),a=p(a,r,o,i,n[s+7],10,1126891415),i=p(i,a,r,o,n[s+14],15,-1416354905),o=p(o,i,a,r,n[s+5],21,-57434055),r=p(r,o,i,a,n[s+12],6,1700485571),a=p(a,r,o,i,n[s+3],10,-1894986606),i=p(i,a,r,o,n[s+10],15,-1051523),o=p(o,i,a,r,n[s+1],21,-2054922799),r=p(r,o,i,a,n[s+8],6,1873313359),a=p(a,r,o,i,n[s+15],10,-30611744),i=p(i,a,r,o,n[s+6],15,-1560198380),o=p(o,i,a,r,n[s+13],21,1309151649),r=p(r,o,i,a,n[s+4],6,-145523070),a=p(a,r,o,i,n[s+11],10,-1120210379),i=p(i,a,r,o,n[s+2],15,718787259),o=p(o,i,a,r,n[s+9],21,-343485551),r=r+d>>>0,o=o+g>>>0,i=i+f>>>0,a=a+m>>>0}return h.endian([r,o,i,a])}var h,v,b,S;h=crypt,v=charenc_1.utf8,b=isBuffer_1,S=charenc_1.bin,y._ff=function(e,t,n,r,o,i,a){e=e+(t&n|~t&r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._gg=function(e,t,n,r,o,i,a){e=e+(t&r|n&~r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._hh=function(e,t,n,r,o,i,a){e=e+(t^n^r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._ii=function(e,t,n,r,o,i,a){e=e+(n^(t|~r))+(o>>>0)+a;return(e<<i|e>>>32-i)+t},y._blocksize=16,y._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=h.wordsToBytes(y(e,t));return t&&t.asBytes?e:t&&t.asString?S.bytesToString(e):h.bytesToHex(e)}});let BPNEvent="UNIBPNEventSrcData",BPNEventFail="UNIBPNEventFailData",BPNEventFailOnce="UBPNEventFailOnce";function getCurPath(){var e=getCurrentPages(),e=e[e.length-1];return e?e.route:"/"}function eventCommonStore(e){var t=e.$page||"",n=t.path||getCurPath(),t={utm:e.$utm||getUtmObj(),duration:"",element:e.$element||null,eventId:e.$event_id||"",event:e.$event_code||"",groupId:"",busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",page:{domain:t.domain||"",pageId:md5(n),path:n||"",title:t.title||"",url:n||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};1==e.$sendMode?reportTrackEventServer("event",[t],BPNEventFailOnce):insertEventData(t)}function insertEventData(e){let t;var n=(t=(Global.platform===wxMini?wx:uni).getStorageSync(BPNEvent))?JSON.parse(t):[];n.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNEvent,JSON.stringify(n))}function queryEventDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),t=wx.getStorageSync(BPNEventFail),n=wx.getStorageSync(BPNEventFailOnce),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),t=uni.getStorageSync(BPNEventFail),n=uni.getStorageSync(BPNEventFailOnce),uni)).setStorageSync(BPNEventFailOnce,""),e?JSON.parse(e):[]),i=t?JSON.parse(t):[],a=n?JSON.parse(n):[];r.push(...o),r.push(...i),r.push(...a),r&&r.length&&reportTrackEventServer("event",r,BPNEventFail)}let startTime,enterTimeLong,loopTimeLong,umlInterval,cirtemp,mObj,cPUUId,sMode;function uStartTrackPVData(e){umlInterval&&uDestoryTrackPVData(),e&&(clearInterval(umlInterval),uTrackPVData(AUTOTRACKTYPE.ENTER,e),umlInterval=setInterval(()=>{uTrackPVData(AUTOTRACKTYPE.LOOP,null)},15e3))}function uDestoryTrackPVData(){mObj&&uTrackPVData(AUTOTRACKTYPE.LEAVE,null),clearInterval(umlInterval),umlInterval=null,sMode=null}function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(mObj=null,cPUUId=0,cirtemp=1,startTime=0,enterTimeLong=-1,loopTimeLong=-1,enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,cPUUId=randomUUID$1(),mObj=getTrackObj(t),sMode=mObj.sendMode,visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,t=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(t));e={busSegment:mObj.busSegment,circulation:cirtemp,domain:mObj.domain,duration:startTime,module:mObj.module,path:mObj.path,properties:mObj.properties,sourceDomain:mObj.sourceDomain,sourceUrl:mObj.sourceUrl,title:mObj.title,traceId:"",trackId:sdkTrackIdVal(),url:mObj.url,visitPage:visPagesArr.length,visitTime:timeToStr(enterTimeLong),utm:getUtmObj(),uid:cPUUId};!0===sMode?reportTrackEventServer("track",[e],BPNPVUVFailOnce):insertPVUVData(e,cPUUId)}let uglInterval=null;function init(e){var t;e?(t=setReportUrl(e.env),Global.upEventUrl=t.upEventApi,Global.upTrackUrl=t.upTrackApi,initGetTrackId(),Object.assign(Global,e),getBaseicInfo(),startGlobalTime()):console.log("init config error, please check config!")}function startGlobalTime(){clearInterval(uglInterval),uglInterval=null,uglInterval=setInterval(()=>{queryEventDataUpload(),queryTrackDataUpload()},15e3)}function setUserId(e){e?(Global.distinctId=e,(Global.platform===wxMini?wx:uni).setStorageSync(usrIdKey$1,e)):(Global.distinctId="",Global.platform===wxMini?wx.setStorageSync(usrIdKey$1,e):uni.setStorageSync(usrIdKey$1,""))}function setCustomEvent(e){e&&eventCommonStore(e)}function onStartTrack(e){uStartTrackPVData(e)}function onDestroyTrack(){uDestoryTrackPVData()}function setPageExtraObj(e){uUpdatePageExtraArray(e)}export{init,onDestroyTrack,onStartTrack,setCustomEvent,setPageExtraObj,setUserId};
|
|
1
|
+
const e="v_userId",t="v_anonId";function n(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function r(e){return["Windows","Linux","macOS"].every((t=>e.includes(t)))?1:2}function o(){let e=wx.getStorageSync(t);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),wx.setStorageSync(t,e)),e}const i="enter",a="loop",s="leave",u="UNIBPNPVUVSrcData",c="UNIBPNPVUVFailData",l="UNIBPNEventSrcData",f="UNIBPNEventFailData",p="UBPNOneEventData",d="UBPNOneTrackData",g="wxMini",y="v_userId",m="v_anonId";let h={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[],encryptType:"1"},S=[],w=[];const v=()=>{if(h.trackId)return h.trackId;const e=Date.now().toString();return h.trackId=e,w=[],e};function x(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function b(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function I(e){if("web"===h.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function _(){if("web"===h.platform){let e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){const e=window.location.href.split("?")[1];if(e){const t=new URLSearchParams(e);return{utmSource:t.get("utmSource")||"",utmCampaign:t.get("utmCampaign")||"",utmMedium:t.get("utmMedium")||"",utmTerm:t.get("utmTerm")||"",utmContent:t.get("utmContent")||"",ctk:t.get("ctk")||""}}}}return null}function k(){!function(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}()?(uni.getSystemInfo({success:function(e){h.uAgent=e.ua;const t=e.uniPlatform;if(t.includes("app"))h.platform=e.osName,h.appData=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===e.platform){n.carrier="Android";let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.carrier="iOS",n.ecology="iOS"}else if("harmonyos"===e.platform){let e=uni.getAppBaseInfo();n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=e.appVersion,n.packageName=e.packageName}else n.ecology="unknown";return n}(e),h.platform="Harmony OS";else if(t.includes("web")||t.includes("h5")){h.platform="web";let t=function(e){let t=e.ua.toLowerCase(),n=window.location.hostname,r=document.title;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),{name:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}(e);h.appData={...t,version:h.version?h.version:"unknown"}}else t.includes("weixin")?(h.platform="weixin",h.appData=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}()):console.log("uni get platform getBaseicInfo error ");h.deviceData=function(e){var t;return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:(t=e.osName,"macos"===t.toLowerCase()?"macOS":"harmonyos"===t.toLowerCase()?"Harmony OS":"ios"===t.toLowerCase()?"iOS":"android"===t.toLowerCase()?"Android":"windows"===t.toLowerCase()?"Windows":"linux"===t.toLowerCase()?"Linux":"unknown"),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:I(e),network:""}}(e)},fail:function(e){h.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){h.deviceData.network=e.networkType}})}}),h.distinctId=uni.getStorageSync(y)||"",h.anonymousId=uni.getStorageSync(m),h.anonymousId||(h.anonymousId=x()),uni.setStorageSync(m,h.anonymousId)):(h.platform=g,h.appData=function(){let e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}(),h.deviceData=function(){const e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:n(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:r(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}(),h.distinctId=wx.getStorageSync(e)?wx.getStorageSync(e):"",h.anonymousId=o())}var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e,t){return e(t={exports:{}},t.exports),t.exports}var T,O=(T=Object.freeze({__proto__:null,default:{}}))&&T.default||T,A=N((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==B&&B.crypto&&(n=B.crypto),!n)try{n=O}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(o,f);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=d.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=i.algo={};return i}(Math),n)})),C=(N((function(e,t){var n;e.exports=(n=A,function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],f=n[6],p=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var g=c[d-15],y=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=c[d-2],h=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[d]=y+c[d-7]+h+c[d-16]}var S=r&o^r&i^o&i,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[d]+c[d];p=f,f=l,l=s,s=a+v|0,a=i,i=o,o=r,r=v+(w+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)})),N((function(e,t){var n,r,o;e.exports=(r=(n=A).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),N((function(e,t){e.exports=A.HmacSHA256}))),H=N((function(e){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}};e.exports=n}()})),D={utf8:{stringToBytes:function(e){return D.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(D.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},U=D,P=function(e){return null!=e&&(M(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&M(e.slice(0,0))}(e)||!!e._isBuffer)};function M(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var L=N((function(e){!function(){var t=H,n=U.utf8,r=P,o=U.bin,i=function(e,a){e.constructor==String?e=a&&"binary"===a.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,f=-1732584194,p=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;var g=i._ff,y=i._gg,m=i._hh,h=i._ii;for(d=0;d<s.length;d+=16){var S=c,w=l,v=f,x=p;c=g(c,l,f,p,s[d+0],7,-680876936),p=g(p,c,l,f,s[d+1],12,-389564586),f=g(f,p,c,l,s[d+2],17,606105819),l=g(l,f,p,c,s[d+3],22,-1044525330),c=g(c,l,f,p,s[d+4],7,-176418897),p=g(p,c,l,f,s[d+5],12,1200080426),f=g(f,p,c,l,s[d+6],17,-1473231341),l=g(l,f,p,c,s[d+7],22,-45705983),c=g(c,l,f,p,s[d+8],7,1770035416),p=g(p,c,l,f,s[d+9],12,-1958414417),f=g(f,p,c,l,s[d+10],17,-42063),l=g(l,f,p,c,s[d+11],22,-1990404162),c=g(c,l,f,p,s[d+12],7,1804603682),p=g(p,c,l,f,s[d+13],12,-40341101),f=g(f,p,c,l,s[d+14],17,-1502002290),c=y(c,l=g(l,f,p,c,s[d+15],22,1236535329),f,p,s[d+1],5,-165796510),p=y(p,c,l,f,s[d+6],9,-1069501632),f=y(f,p,c,l,s[d+11],14,643717713),l=y(l,f,p,c,s[d+0],20,-373897302),c=y(c,l,f,p,s[d+5],5,-701558691),p=y(p,c,l,f,s[d+10],9,38016083),f=y(f,p,c,l,s[d+15],14,-660478335),l=y(l,f,p,c,s[d+4],20,-405537848),c=y(c,l,f,p,s[d+9],5,568446438),p=y(p,c,l,f,s[d+14],9,-1019803690),f=y(f,p,c,l,s[d+3],14,-187363961),l=y(l,f,p,c,s[d+8],20,1163531501),c=y(c,l,f,p,s[d+13],5,-1444681467),p=y(p,c,l,f,s[d+2],9,-51403784),f=y(f,p,c,l,s[d+7],14,1735328473),c=m(c,l=y(l,f,p,c,s[d+12],20,-1926607734),f,p,s[d+5],4,-378558),p=m(p,c,l,f,s[d+8],11,-2022574463),f=m(f,p,c,l,s[d+11],16,1839030562),l=m(l,f,p,c,s[d+14],23,-35309556),c=m(c,l,f,p,s[d+1],4,-1530992060),p=m(p,c,l,f,s[d+4],11,1272893353),f=m(f,p,c,l,s[d+7],16,-155497632),l=m(l,f,p,c,s[d+10],23,-1094730640),c=m(c,l,f,p,s[d+13],4,681279174),p=m(p,c,l,f,s[d+0],11,-358537222),f=m(f,p,c,l,s[d+3],16,-722521979),l=m(l,f,p,c,s[d+6],23,76029189),c=m(c,l,f,p,s[d+9],4,-640364487),p=m(p,c,l,f,s[d+12],11,-421815835),f=m(f,p,c,l,s[d+15],16,530742520),c=h(c,l=m(l,f,p,c,s[d+2],23,-995338651),f,p,s[d+0],6,-198630844),p=h(p,c,l,f,s[d+7],10,1126891415),f=h(f,p,c,l,s[d+14],15,-1416354905),l=h(l,f,p,c,s[d+5],21,-57434055),c=h(c,l,f,p,s[d+12],6,1700485571),p=h(p,c,l,f,s[d+3],10,-1894986606),f=h(f,p,c,l,s[d+10],15,-1051523),l=h(l,f,p,c,s[d+1],21,-2054922799),c=h(c,l,f,p,s[d+8],6,1873313359),p=h(p,c,l,f,s[d+15],10,-30611744),f=h(f,p,c,l,s[d+6],15,-1560198380),l=h(l,f,p,c,s[d+13],21,1309151649),c=h(c,l,f,p,s[d+4],6,-145523070),p=h(p,c,l,f,s[d+11],10,-1120210379),f=h(f,p,c,l,s[d+2],15,718787259),l=h(l,f,p,c,s[d+9],21,-343485551),c=c+S>>>0,l=l+w>>>0,f=f+v>>>0,p=p+x>>>0}return t.endian([c,l,f,p])};i._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(i(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()}));function $(e){return"1"===h.encryptType?L(e):"2"===h.encryptType?C(e,"jCfeIQH52pMcgNUQoXYA").toString():void 0}function J(e,t,n){if(!e)return void console.error("please set upload data upType");var r;const o={...(r=t,{app:h.appData,data:r,device:h.deviceData,lsi:"86320c1a85a022e47574b489ea8e7b87#2.0.4-alpha.15",projectId:h.token,userAgent:h.uAgent||"",anonymousId:h.anonymousId,userId:h.distinctId}),dataAbstract:$(JSON.stringify(t))};h.platform===g?wx.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===p?z(t,f):n===d?z(t,c):wx.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===p?z(t,f):n===d?z(t,c):uni.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})}function z(e,t){if(h.platform===g){let n=wx.getStorageSync(t),r=n?JSON.parse(n):[];r.concat(e),wx.setStorageSync(t,JSON.stringify(r))}else{let n=uni.getStorageSync(t),r=n?JSON.parse(n):[];r.concat(e),uni.setStorageSync(t,JSON.stringify(r))}}function E(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}();let r={busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:v(),eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",utm:e.$utm?e.$utm:_(),duration:null,element:e.$element?e.$element:null,triggerTime:b(Date.now()),page:{domain:t.domain?t.domain:"",url:n||"",path:n||"",title:t.title||"",pageId:L(n)}};r&&(!0===e.$sendMode?J("event",[r],p):function(e){let t;t=h.platform===g?wx.getStorageSync(l):uni.getStorageSync(l);let n=t?JSON.parse(t):[];n.push(e),h.platform===g?wx.setStorageSync(l,JSON.stringify(n)):uni.setStorageSync(l,JSON.stringify(n))}(r))}let V,j,R,W,F,K,q,Q;function Y(){K&&X(s,null),clearInterval(W),W=null,Q=null}function X(e,t){if(e===i)K=null,q=0,F=1,V=0,j=-1,R=-1,j=Date.now(),R=j,q=x(),K=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=h.platform,o="",i="",a="",s="";if("web"===r||"h5"===r){if(o=window.location.href,i=window.location.hostname,document.referrer){let e=new URL(document.referrer);a=e||"",s=e.hostname||""}}else o=n.route,a=t.length>1?t[t.length-2].route:n.route,i=h.domain?h.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,sendMode:e.sendMode}}(t),Q=K.sendMode,w.push(K.path);else if(e===a)F=2,V=15,R=Date.now();else if(e===s){F=3;let e=Math.max(1,(Date.now()-R)/1e3);V=Math.ceil(e)}let n={busSegment:K.busSegment,module:K.module,properties:K.properties,traceId:"",trackId:v(),utm:_(),domain:K.domain,title:K.title,sourceDomain:K.sourceDomain,url:K.url,path:K.path,sourceUrl:K.sourceUrl,duration:V,circulation:F,visitPage:w.length,visitTime:b(j),uid:q};n&&(!0===Q?(delete n.uid,J("track",[n],d)):function(e,t){let n=null;n=h.platform===g?wx.getStorageSync(u):uni.getStorageSync(u);let r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.uid===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);h.platform===g?wx.setStorageSync(u,JSON.stringify(r)):uni.setStorageSync(u,JSON.stringify(r))}(n,q))}let Z=null;function G(e){if(e){const t="test"===e.env?{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};h.upEventUrl=t.upEventApi,h.upTrackUrl=t.upTrackApi,function(){const e=Date.now().toString();h.trackId=e,w=[],console.log("tId ",e)}(),Object.assign(h,e),k(),clearInterval(Z),Z=null,Z=setInterval((()=>{!function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(l),wx.setStorageSync(l,""),t=wx.getStorageSync(f),wx.setStorageSync(f,"")):(e=uni.getStorageSync(l),uni.setStorageSync(l,""),t=uni.getStorageSync(f),uni.setStorageSync(f,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&J("event",n,f)}(),function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(u),wx.setStorageSync(u,""),t=wx.getStorageSync(c),wx.setStorageSync(c,"")):(e=uni.getStorageSync(u),uni.setStorageSync(u,""),t=uni.getStorageSync(c),uni.setStorageSync(c,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.uid})),J("track",n,c))}()}),15e3),h.isCompatible||h.platform}else console.log("init config error, please check config!")}function ee(e){e?(h.distinctId=e,h.platform===g?wx.setStorageSync(y,e):uni.setStorageSync(y,e)):(h.distinctId="",h.platform===g?wx.setStorageSync(y,e):uni.setStorageSync(y,""))}function te(e){e&&E(e)}function ne(e){!function(e){W&&Y(),e&&(clearInterval(W),X(i,e),W=setInterval((()=>{X(a,null)}),15e3))}(e)}function re(){Y()}function oe(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=S.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?S[r]=o:S.push(o)}(e)}export{G as init,re as onDestroyTrack,ne as onStartTrack,te as setCustomEvent,oe as setPageExtraObj,ee as setUserId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BuriedPointUni={})}(this,(function(e){"use strict";const t="v_userId",n="v_anonId";function r(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function o(e){return["Windows","Linux","macOS"].every((t=>e.includes(t)))?1:2}function i(){let e=wx.getStorageSync(n);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),wx.setStorageSync(n,e)),e}const a="enter",s="loop",u="leave",c="UNIBPNPVUVSrcData",l="UNIBPNPVUVFailData",f="UNIBPNEventSrcData",p="UNIBPNEventFailData",d="UBPNOneEventData",g="UBPNOneTrackData",y="wxMini",m="v_userId",h="v_anonId";let S={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[],encryptType:"1"},w=[],v=[];const x=()=>{if(S.trackId)return S.trackId;const e=Date.now().toString();return S.trackId=e,v=[],e};function b(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function I(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function _(e){if("web"===S.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function k(){if("web"===S.platform){let e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){const e=window.location.href.split("?")[1];if(e){const t=new URLSearchParams(e);return{utmSource:t.get("utmSource")||"",utmCampaign:t.get("utmCampaign")||"",utmMedium:t.get("utmMedium")||"",utmTerm:t.get("utmTerm")||"",utmContent:t.get("utmContent")||"",ctk:t.get("ctk")||""}}}}return null}function B(){!function(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}()?(uni.getSystemInfo({success:function(e){S.uAgent=e.ua;const t=e.uniPlatform;if(t.includes("app"))S.platform=e.osName,S.appData=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===e.platform){n.carrier="Android";let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.carrier="iOS",n.ecology="iOS"}else if("harmonyos"===e.platform){let e=uni.getAppBaseInfo();n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=e.appVersion,n.packageName=e.packageName}else n.ecology="unknown";return n}(e),S.platform="Harmony OS";else if(t.includes("web")||t.includes("h5")){S.platform="web";let t=function(e){let t=e.ua.toLowerCase(),n=window.location.hostname,r=document.title;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),{name:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}(e);S.appData={...t,version:S.version?S.version:"unknown"}}else t.includes("weixin")?(S.platform="weixin",S.appData=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}()):console.log("uni get platform getBaseicInfo error ");S.deviceData=function(e){var t;return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:(t=e.osName,"macos"===t.toLowerCase()?"macOS":"harmonyos"===t.toLowerCase()?"Harmony OS":"ios"===t.toLowerCase()?"iOS":"android"===t.toLowerCase()?"Android":"windows"===t.toLowerCase()?"Windows":"linux"===t.toLowerCase()?"Linux":"unknown"),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:_(e),network:""}}(e)},fail:function(e){S.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){S.deviceData.network=e.networkType}})}}),S.distinctId=uni.getStorageSync(m)||"",S.anonymousId=uni.getStorageSync(h),S.anonymousId||(S.anonymousId=b()),uni.setStorageSync(h,S.anonymousId)):(S.platform=y,S.appData=function(){let e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}(),S.deviceData=function(){const e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:r(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:o(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}(),S.distinctId=wx.getStorageSync(t)?wx.getStorageSync(t):"",S.anonymousId=i())}var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e,t){return e(t={exports:{}},t.exports),t.exports}var O,A=(O=Object.freeze({__proto__:null,default:{}}))&&O.default||O,C=N((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==T&&T.crypto&&(n=T.crypto),!n)try{n=A}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(o,f);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=d.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=i.algo={};return i}(Math),n)})),D=(N((function(e,t){var n;e.exports=(n=C,function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],f=n[6],p=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var g=c[d-15],y=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=c[d-2],h=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[d]=y+c[d-7]+h+c[d-16]}var S=r&o^r&i^o&i,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[d]+c[d];p=f,f=l,l=s,s=a+v|0,a=i,i=o,o=r,r=v+(w+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)})),N((function(e,t){var n,r,o;e.exports=(r=(n=C).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),N((function(e,t){e.exports=C.HmacSHA256}))),H=N((function(e){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}};e.exports=n}()})),P={utf8:{stringToBytes:function(e){return P.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(P.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},U=P,M=function(e){return null!=e&&(L(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&L(e.slice(0,0))}(e)||!!e._isBuffer)};function L(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var $=N((function(e){!function(){var t=H,n=U.utf8,r=M,o=U.bin,i=function(e,a){e.constructor==String?e=a&&"binary"===a.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,f=-1732584194,p=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;var g=i._ff,y=i._gg,m=i._hh,h=i._ii;for(d=0;d<s.length;d+=16){var S=c,w=l,v=f,x=p;c=g(c,l,f,p,s[d+0],7,-680876936),p=g(p,c,l,f,s[d+1],12,-389564586),f=g(f,p,c,l,s[d+2],17,606105819),l=g(l,f,p,c,s[d+3],22,-1044525330),c=g(c,l,f,p,s[d+4],7,-176418897),p=g(p,c,l,f,s[d+5],12,1200080426),f=g(f,p,c,l,s[d+6],17,-1473231341),l=g(l,f,p,c,s[d+7],22,-45705983),c=g(c,l,f,p,s[d+8],7,1770035416),p=g(p,c,l,f,s[d+9],12,-1958414417),f=g(f,p,c,l,s[d+10],17,-42063),l=g(l,f,p,c,s[d+11],22,-1990404162),c=g(c,l,f,p,s[d+12],7,1804603682),p=g(p,c,l,f,s[d+13],12,-40341101),f=g(f,p,c,l,s[d+14],17,-1502002290),c=y(c,l=g(l,f,p,c,s[d+15],22,1236535329),f,p,s[d+1],5,-165796510),p=y(p,c,l,f,s[d+6],9,-1069501632),f=y(f,p,c,l,s[d+11],14,643717713),l=y(l,f,p,c,s[d+0],20,-373897302),c=y(c,l,f,p,s[d+5],5,-701558691),p=y(p,c,l,f,s[d+10],9,38016083),f=y(f,p,c,l,s[d+15],14,-660478335),l=y(l,f,p,c,s[d+4],20,-405537848),c=y(c,l,f,p,s[d+9],5,568446438),p=y(p,c,l,f,s[d+14],9,-1019803690),f=y(f,p,c,l,s[d+3],14,-187363961),l=y(l,f,p,c,s[d+8],20,1163531501),c=y(c,l,f,p,s[d+13],5,-1444681467),p=y(p,c,l,f,s[d+2],9,-51403784),f=y(f,p,c,l,s[d+7],14,1735328473),c=m(c,l=y(l,f,p,c,s[d+12],20,-1926607734),f,p,s[d+5],4,-378558),p=m(p,c,l,f,s[d+8],11,-2022574463),f=m(f,p,c,l,s[d+11],16,1839030562),l=m(l,f,p,c,s[d+14],23,-35309556),c=m(c,l,f,p,s[d+1],4,-1530992060),p=m(p,c,l,f,s[d+4],11,1272893353),f=m(f,p,c,l,s[d+7],16,-155497632),l=m(l,f,p,c,s[d+10],23,-1094730640),c=m(c,l,f,p,s[d+13],4,681279174),p=m(p,c,l,f,s[d+0],11,-358537222),f=m(f,p,c,l,s[d+3],16,-722521979),l=m(l,f,p,c,s[d+6],23,76029189),c=m(c,l,f,p,s[d+9],4,-640364487),p=m(p,c,l,f,s[d+12],11,-421815835),f=m(f,p,c,l,s[d+15],16,530742520),c=h(c,l=m(l,f,p,c,s[d+2],23,-995338651),f,p,s[d+0],6,-198630844),p=h(p,c,l,f,s[d+7],10,1126891415),f=h(f,p,c,l,s[d+14],15,-1416354905),l=h(l,f,p,c,s[d+5],21,-57434055),c=h(c,l,f,p,s[d+12],6,1700485571),p=h(p,c,l,f,s[d+3],10,-1894986606),f=h(f,p,c,l,s[d+10],15,-1051523),l=h(l,f,p,c,s[d+1],21,-2054922799),c=h(c,l,f,p,s[d+8],6,1873313359),p=h(p,c,l,f,s[d+15],10,-30611744),f=h(f,p,c,l,s[d+6],15,-1560198380),l=h(l,f,p,c,s[d+13],21,1309151649),c=h(c,l,f,p,s[d+4],6,-145523070),p=h(p,c,l,f,s[d+11],10,-1120210379),f=h(f,p,c,l,s[d+2],15,718787259),l=h(l,f,p,c,s[d+9],21,-343485551),c=c+S>>>0,l=l+w>>>0,f=f+v>>>0,p=p+x>>>0}return t.endian([c,l,f,p])};i._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(i(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()}));function J(e){return"1"===S.encryptType?$(e):"2"===S.encryptType?D(e,"jCfeIQH52pMcgNUQoXYA").toString():void 0}function z(e,t,n){if(!e)return void console.error("please set upload data upType");var r;const o={...(r=t,{app:S.appData,data:r,device:S.deviceData,lsi:"86320c1a85a022e47574b489ea8e7b87#2.0.4-alpha.15",projectId:S.token,userAgent:S.uAgent||"",anonymousId:S.anonymousId,userId:S.distinctId}),dataAbstract:J(JSON.stringify(t))};S.platform===y?wx.request({url:"event"===e?S.upEventUrl:S.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:S.token,projectId:S.token},data:o,success:function(e){e&&e.data&&(n===d?E(t,p):n===g?E(t,l):wx.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?S.upEventUrl:S.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:S.token,projectId:S.token},data:o,success:function(e){e&&e.data&&(n===d?E(t,p):n===g?E(t,l):uni.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})}function E(e,t){if(S.platform===y){let n=wx.getStorageSync(t),r=n?JSON.parse(n):[];r.concat(e),wx.setStorageSync(t,JSON.stringify(r))}else{let n=uni.getStorageSync(t),r=n?JSON.parse(n):[];r.concat(e),uni.setStorageSync(t,JSON.stringify(r))}}function j(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}();let r={busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:x(),eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",utm:e.$utm?e.$utm:k(),duration:null,element:e.$element?e.$element:null,triggerTime:I(Date.now()),page:{domain:t.domain?t.domain:"",url:n||"",path:n||"",title:t.title||"",pageId:$(n)}};r&&(!0===e.$sendMode?z("event",[r],d):function(e){let t;t=S.platform===y?wx.getStorageSync(f):uni.getStorageSync(f);let n=t?JSON.parse(t):[];n.push(e),S.platform===y?wx.setStorageSync(f,JSON.stringify(n)):uni.setStorageSync(f,JSON.stringify(n))}(r))}let V,R,W,F,K,q,Q,Y;function X(){q&&Z(u,null),clearInterval(F),F=null,Y=null}function Z(e,t){if(e===a)q=null,Q=0,K=1,V=0,R=-1,W=-1,R=Date.now(),W=R,Q=b(),q=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=S.platform,o="",i="",a="",s="";if("web"===r||"h5"===r){if(o=window.location.href,i=window.location.hostname,document.referrer){let e=new URL(document.referrer);a=e||"",s=e.hostname||""}}else o=n.route,a=t.length>1?t[t.length-2].route:n.route,i=S.domain?S.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,sendMode:e.sendMode}}(t),Y=q.sendMode,v.push(q.path);else if(e===s)K=2,V=15,W=Date.now();else if(e===u){K=3;let e=Math.max(1,(Date.now()-W)/1e3);V=Math.ceil(e)}let n={busSegment:q.busSegment,module:q.module,properties:q.properties,traceId:"",trackId:x(),utm:k(),domain:q.domain,title:q.title,sourceDomain:q.sourceDomain,url:q.url,path:q.path,sourceUrl:q.sourceUrl,duration:V,circulation:K,visitPage:v.length,visitTime:I(R),uid:Q};n&&(!0===Y?(delete n.uid,z("track",[n],g)):function(e,t){let n=null;n=S.platform===y?wx.getStorageSync(c):uni.getStorageSync(c);let r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.uid===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);S.platform===y?wx.setStorageSync(c,JSON.stringify(r)):uni.setStorageSync(c,JSON.stringify(r))}(n,Q))}let G=null;e.init=function(e){if(e){const t="test"===e.env?{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};S.upEventUrl=t.upEventApi,S.upTrackUrl=t.upTrackApi,function(){const e=Date.now().toString();S.trackId=e,v=[],console.log("tId ",e)}(),Object.assign(S,e),B(),clearInterval(G),G=null,G=setInterval((()=>{!function(){let e=null,t=null,n=[];S.platform===y?(e=wx.getStorageSync(f),wx.setStorageSync(f,""),t=wx.getStorageSync(p),wx.setStorageSync(p,"")):(e=uni.getStorageSync(f),uni.setStorageSync(f,""),t=uni.getStorageSync(p),uni.setStorageSync(p,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&z("event",n,p)}(),function(){let e=null,t=null,n=[];S.platform===y?(e=wx.getStorageSync(c),wx.setStorageSync(c,""),t=wx.getStorageSync(l),wx.setStorageSync(l,"")):(e=uni.getStorageSync(c),uni.setStorageSync(c,""),t=uni.getStorageSync(l),uni.setStorageSync(l,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.uid})),z("track",n,l))}()}),15e3),S.isCompatible||S.platform}else console.log("init config error, please check config!")},e.onDestroyTrack=function(){X()},e.onStartTrack=function(e){!function(e){F&&X(),e&&(clearInterval(F),Z(a,e),F=setInterval((()=>{Z(s,null)}),15e3))}(e)},e.setCustomEvent=function(e){e&&j(e)},e.setPageExtraObj=function(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=w.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?w[r]=o:w.push(o)}(e)},e.setUserId=function(e){e?(S.distinctId=e,S.platform===y?wx.setStorageSync(m,e):uni.setStorageSync(m,e)):(S.distinctId="",S.platform===y?wx.setStorageSync(m,e):uni.setStorageSync(m,""))},Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-buried-point-platform-uni",
|
|
3
|
-
"version": "2.0.4-alpha.
|
|
4
|
-
"lsi": "
|
|
3
|
+
"version": "2.0.4-alpha.16",
|
|
4
|
+
"lsi": "f61772f7c0d4abc06af1a9b91a51d488#2.0.4-alpha.16",
|
|
5
5
|
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
|
|
6
6
|
"main": "dist/cjs/buried-point-uni.js",
|
|
7
7
|
"module": "dist/esm/buried-point-uni.js",
|
|
8
8
|
"umd:main": "dist/umd/buried-point-uni.js",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.
|
|
10
|
+
"build": "rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.js"
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"files": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"crypto-js": "^4.2.0",
|
|
25
|
+
"md5": "2.3.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.26.10",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"crypto-js": "^4.2.0",
|
|
34
34
|
"md5": "2.3.0",
|
|
35
35
|
"rimraf": "^6.0.1",
|
|
36
|
-
"rollup": "
|
|
36
|
+
"rollup": "2.79.2",
|
|
37
37
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
38
38
|
"rollup-plugin-babel": "^4.3.3",
|
|
39
39
|
"rollup-plugin-commonjs": "^10.0.2",
|
|
40
40
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
41
41
|
"rollup-plugin-replace": "^2.2.0",
|
|
42
|
-
"rollup-plugin-
|
|
42
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
43
43
|
"webpack": "^5.72.1",
|
|
44
44
|
"webpack-cli": "^6.0.1"
|
|
45
45
|
}
|