本次同步 09-12 至 09-28 的代码变更,主要内容: 新增功能 - 修改密码:后端新增 ChangePasswordRequest DTO 与UserController/UserService 对应接口,前端新增 ChangePasswordDialog 并在 Header 接入入口 - 文件预览组件重构:file-preview 目录拆分出 VideoPreview(支持 blobUrl 直传)、 ImagePreview、AudioPreview,index.tsx 统一调度各类型预览器 - 新增 my_ops 算子模块:markitdown_parser、mineru_pdf_parser、text_quality_evaluator - 新增 tools/minio-file-server MinIO 文件服务 功能增强 - 数据清洗:cleaning_task_service/scheduler/routes 重构, data_juicer_executor 与 wrapper 增强,OperatorTable/LogsTable/TaskDetail 同步调整 - 数据标注:annotation sync.py、project.py 接口与schema 更新 - 数据采集、算子市场、首页与菜单路由相关页面调整 - DataJuicer 算子接入(useOperatorOperations、dj_ops_schema) 结构调整 - deepflow/ 更名为 deep-flow/(419 个文件重命名) - 新增 helm 部署编排、GitHub Actions 之外的自建镜像构建脚本 未纳入本次提交 - scripts-backup/、runtime/python-executor-backup/、components_backup/(备份目录) - *.backup*、__pycache__ 产物 - zh_core_web_sm-3.8.0-py3-none-any.whl(46MB 构建产物) - DataX/(内嵌独立仓库,远程亦未收录其源码)
2 lines
26 KiB
JavaScript
2 lines
26 KiB
JavaScript
/*! version: 2.2.29 */
|
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("@baidu/webb",["require"],e):"object"==typeof exports?exports.webb2=e():t.webb2=e()}("undefined"!=typeof self?self:this,(function(){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=8)}([function(t,e,i){"use strict";function n(){var t=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}function o(t,e){var i=["webkit","moz","ms","o"];if(e in t)return e;for(var n=0;n<i.length;n++){var o=""+i[n]+e;if(o in t)return o}return""}Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.sendLog=function(t,e){var i=new Image,o=n();window[o]=i,i.onload=function(){e&&e(),delete window[o]},i.onerror=function(t){e&&e(t),delete window[o]},i.src=t},e.guid=n,e.extend=function(t,e){if(!e||"object"!==(void 0===e?"undefined":r(e)))return t;for(var i=Object.keys(e),n=i.length;n--;)t[i[n]]=e[i[n]];return t},e.stringify=function(t){return Object.keys(t).map((function(e){var i=t[e];return void 0===i?i="":"string"!=typeof i&&(i=JSON.stringify(i)),encodeURIComponent(e)+"="+encodeURIComponent(i)})).join("&")},e.getProp=o,e.getScrollInfo=function(){return{x:document.body.scrollLeft||document.documentElement.scrollLeft,y:document.body.scrollTop||document.documentElement.scrollTop}},e.bindVisibilityChangeEvent=function(t){s&&(document.addEventListener(a,t),document.addEventListener(u,t))},e.disposeVisibilityChangeEvent=function(t){document.removeEventListener(a,t),document.removeEventListener(u,t)},e.getPageHiddenValue=function(t){return t&&"hidden"in t?t.hidden:document[s]},e.assign=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).forEach((function(i){t[i]=e[i]})),t},e.matchesPolyfill=function(){if(Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}},e.getUrlFromStyle=function(t){var e=window.getComputedStyle(t)["background-image"];return e&&"none"!==e&&/^url\(/i.test(e)?e.replace(/^url\(['"]?([^'"]+)['"]?\)/i,"$1"):""},e.isUrl=function(t){return t&&"string"==typeof t&&/^\s?(http:|https:)?\/\//.test(t)},e.afterReady=function(t,e){/complete|loaded|interactive/.test(document.readyState)&&document.body?t():document.addEventListener("DOMContentLoaded",(function(){e?t():setTimeout((function(){t()}),0)}))};var s=o(document,"hidden"),a=s.replace(/hidden/i,"visibilitychange"),u="baiduboxappvisibilitychange"},function(t,e,i){"use strict";function n(t,e){var i=t.colno||window.event&&window.event.errorCharacter||0,n=t.error||{};return(0,r.assign)({msg:t.message,ln:t.lineno,file:t.filename,col:i,stack:n.stack},e)}function o(t){var e=this,i=n(t,this.exceptionInfo);setTimeout((function(){e.send("et_js",i,e.exceptionDim)}),0)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0);e["default"]={initException:function(){this.exceptionDim=null,this.exceptionInfo={},this.onerrorCb=o.bind(this)},startJsExceptionLog:function(t,e){this.exceptionInfo=(0,r.assign)({},t),this.exceptionDim=(0,r.assign)({},e),window.removeEventListener("error",this.onerrorCb),window.addEventListener("error",this.onerrorCb)},startResExceptionLog:function(t,e){},stopJsExceptionLog:function(){window.removeEventListener("error",this.onerrorCb)},stopResExceptionLog:function(){},sendExceptionLog:function(t,e){this.send("et_comm",t,e)},sendJSError:function(t,e,i,o){e=n(t,e||{}),this.send("et_js",e,i,null,o)},destroyJsException:function(){this.stopJsExceptionLog(),this.exceptionDim=null,this.exceptionInfo=null,this.onerrorCb=null}},t.exports=e["default"]},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e["default"]={sendBaseDispLog:function(t,e,i){var o=document.documentElement,r={size:{doc:{w:o.scrollWidth,h:o.scrollHeight},wind:{w:o.clientWidth,h:o.clientHeight},scr:{w:screen.width,h:screen.height}},dpr:window.devicePixelRatio||1};t&&(r=(0,n.assign)(r,t)),this.send("disp_comm",r,e,null,i)},sendDispLog:function(t,e,i){var o;o=t instanceof Array?t:(0,n.assign)({},t),this.send("disp_content",o,e,null,i)}},t.exports=e["default"]},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0);e["default"]={sendBasePfLog:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],i=arguments[2],o=window.performance&&performance.timing||{},r=o.navigationStart,s=o.requestStart,a=o.responseStart,u=o.responseEnd,c=o.domComplete,d=o.domLoading,l=o.domainLookupStart,h=o.domainLookupEnd,p=o.connectStart,f=o.connectEnd,m=o.loadEventStart,g={dns:h-l,tcp:f-p,req:a-s,res:u-a,dct:c-d,ld:o.loadEventEnd-m},v=window.__webbbrige__||{},b=v.whiteScreenTime,y=v.firstScreenTime;b&&(g=(0,n.assign)(g,{wst:b-r})),y&&(g=(0,n.assign)(g,{fst:y-r})),g=(0,n.assign)(g,t),this.send("pf_comm",g,e,null,i)},sendPfLog:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],i=arguments[2],o=(0,n.assign)({},t);this.send("pf_comm",o,e,null,i)}},t.exports=e["default"]},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={sendCountLog:function(t,e){this.send("count_comm",t,e)}},t.exports=e["default"]},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={sendDistributeLog:function(t,e){this.send("dist_comm",t,e)}},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return["et","pf","dist","count"].indexOf(t.split("_")[0])>-1}Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=i(0),a=function(t){return t&&t.__esModule?t:{"default":t}}(i(7)),u="https://sp1.baidu.com/5b1ZeDe5KgQFm2e88IuM_a/mwb2.gif",c=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?)_/),d=c&&c[2]&&+c[2]<14,l="",h={pf:"perf",dist:"dist",count:"count",et:"except"},p={ignoreSample:!1,saveLocal:!1},f=!1,m=new a["default"]({storage:"localstorage",maxRecordLen:300,compress:"no",onSave:function(t){try{var e=new g({pf_comm:{sample:-1!==(document.cookie||"").indexOf("webbtest=1")?1:.001},et_comm:{sample:-1!==(document.cookie||"").indexOf("webbtest=1")?1:.01},lid:l,pid:"19_103"});if(t.error&&e.send("et_comm",{msg:t.error.message,stack:t.error.stack},{path:location.pathname},{group:"common"}),f)return;f=!0,e.send("pf_comm",{lsCost:t.cost,lsLen:t.length},{path:location.pathname},{group:"common"})}catch(t){console.error(t)}},onFlush:function(t){console.log("flushed list",t),t.length&&function(t){var e=u+"?"+(0,s.stringify)({pid:"1_1",type:"except",group:"localcache"}),i=JSON.stringify({pid:"1_1",type:"except",group:"localcache",ts:Date.now(),lid:l,info:{msg:"webb sdk localcache",pageUrl:location.href,log:JSON.stringify(t)}});if(d||!navigator.sendBeacon||!navigator.sendBeacon(e,i)){if(!window.fetch)return;fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:i})}}(t)}}),g=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var i={sample:0,saveLocal:p.saveLocal};this.validateOptions(e),l=e.lid||p.lid,this.options=(0,s.extend)(i,e),this.random=Math.random(),this.options.sample&&(this.options.curSample=Math.random()<this.options.sample?1:0),this.updateCurSample(),this.initException(),this.options.ia&&this.initIa&&this.initIa()}return r(t,null,[{key:"setGlobalOption",value:function(t){p=(0,s.extend)(p,t)}}]),r(t,[{key:"updateCurSample",value:function(){var t=this;Object.keys(this.options).forEach((function(e){var i=t.options[e];i&&i.sample&&void 0===i.curSample&&(t.options[e].curSample=Math.random()<i.sample?1:0)}))}},{key:"validateOptions",value:function(t){var e=["pid","lid"];if("object"!==(void 0===t?"undefined":o(t)))throw new Error("Options must be an object!");if(!e.every((function(e){return e in t})))throw new Error("Options "+e.join(", ")+" required")}},{key:"updateOption",value:function(t){this.options=(0,s.extend)(this.options,t),this.updateCurSample()}},{key:"wrapCommonParam",value:function(t,e,i){var o={pid:this.options.pid,lid:this.options.lid,ts:Date.now(),type:t,info:e,ext:this.options.ext?this.options.ext:{}};return n(t)&&(o.type=t.split("_")[0],o.type=h[o.type]?h[o.type]:o.type,o.group=t.split("_")[1]||"common",o.group="comm"===o.group?"common":o.group),i&&(o.dim=i),o}},{key:"hitSample",value:function(t){if(p.ignoreSample)return 1;var e=this.options[t];return e?"sample"in e?"eachreq"===e.sampleType?e.sample&&Math.random()<=e.sample?1:0:e.curSample:"eachreq"===this.options.sampleType?this.options.sample&&Math.random()<=this.options.sample?1:0:this.options.curSample:0}},{key:"getLogHost",value:function(t){var e=this.options;return e[t]&&e[t].logHost||e.logHost?e[t]&&e[t].logHost?e[t].logHost:e.logHost:n(t)?u:"https://sp1.baidu.com/5b1ZeDe5KgQFm2e88IuM_a/webb.gif"}},{key:"saveLocal",value:function(t){0!==t.type.indexOf("et_")&&0!==t.type.indexOf("except")&&0!==t.type.indexOf("pf_")&&0!==t.type.indexOf("perf")||m&&m.addLog(t)}},{key:"flushLog",value:function(){m&&m.flushLog()}},{key:"send",value:function(t,e,i,n,o){"function"==typeof i&&(o=n,n=i,i=null);var r=this.wrapCommonParam(t,e,i);(0,s.extend)(r,o),r&&r.ext?r.ext.path=location.pathname:r&&!r.ext&&(r.ext={path:location.pathname});var a=this.extendOptions&&this.extendOptions.onlySaveLocal,u=this.extendOptions&&this.extendOptions.saveLocal;if((!(this.options.saveLocal||u||a)||(this.saveLocal(r),!a))&&this.hitSample(t)){var c=(0,s.guid)(),d=window[c]=new Image;d.onload=function(t){n&&("function"==typeof n?n(t):n.successCb&&"function"==typeof n.successCb&&n.successCb(t)),delete window[c]},d.onerror=function(t){n&&n.errorCb&&"function"==typeof n.errorCb&&n.errorCb(t),delete window[c]},d.src=this.getLogHost(t)+"?"+(0,s.stringify)(r)}}},{key:"sendBeacon",value:function(t,e,i,n){var o=this.wrapCommonParam(t,e,i);(0,s.extend)(o,n),o&&o.ext?o.ext.path=location.pathname:o&&!o.ext&&(o.ext={path:location.pathname});var r=this.extendOptions&&this.extendOptions.onlySaveLocal,a=this.extendOptions&&this.extendOptions.saveLocal;if((!(this.options.saveLocal||a||r)||(this.saveLocal(o),!r))&&this.hitSample(t))if(navigator.sendBeacon){navigator.sendBeacon(this.getLogHost(t)+"?"+(0,s.stringify)(o))||this.send(t,e,i)}else this.send(t,e,i)}},{key:"destroy",value:function(){this.destroyJsException(),this.destroyIaMonitor(),this.destroyMediaTime()}}]),t}();e["default"]=g,t.exports=e["default"]},function(t,e,i){t.exports=function(){"use strict";function t(t,e){function i(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function e(t){for(var e=[],i={},n=0,o=t;n<o.length;n++){var r=o[n];null==i[r]?i[r]=1:i[r]++}for(var s=0,a=Object.entries(i);s<a.length;s++){var u=a[s],c=u[0],d=u[1];e.push(new b(c,d))}return e}function i(t){for(var e=function(t,e){return t.weight-e.weight};t.length>1;){t.sort(e);var i=t.shift(),n=t.shift();if(i&&n){var o=new b(null,i.weight+n.weight);o.left=i,o.right=n,t.unshift(o)}}return t.shift()}function n(t){function e(t,n,o){var r=[].concat(o);r.push(n),null!=t&&(null==t.data?(e(t.left,"0",r),e(t.right,"1",r)):i[t.data]=r.join(""))}if(null==t)return null;var i={};return e(t,"",[]),i}function o(t,e){for(var i=[],n=0,o=t;n<o.length;n++){var r=o[n];i.push(e[r])}return i}function r(t){for(var e=t.join(""),i=Math.ceil(e.length/8),n=new Array(i+1),o=0,r="",s=0;s<e.length;s+=8)r=e.substring(s,s+8),n[o]=parseInt(r,2),o++;return n[o]=r.length,n}function s(t){var s=n(i(e(t)));return{result:r(o(t,s)),codes:s}}function a(t,e){t&&(e|=256);var i=Number(e).toString(2);return t?i.substring(i.length-8):i}function u(t,e){for(var i=[],n=0;n<e.length-1;n++){var o=n!==e.length-2;i.push(a(o,e[n]))}var r=i[i.length-1];r="00000000".substring(8-(e[e.length-1]-r.length))+r,i[i.length-1]=r;for(var s={},u=0,c=Object.entries(t);u<c.length;u++){var d=c[u],l=d[0];s[d[1]]=l}var h=i.join(""),p=[],f=h.length;for(n=0;n<f;){for(var m=1,g=(o=!0,null);o&&n+m<=f&&""!==(l=h.substring(n,n+m));)(g=s[l])?o=!1:m++;p.push(parseInt(g)),n+=m}return p}function c(t){for(var e=[],i=0;i<t.length;i++)e.push(t.charCodeAt(i));return e}function d(t){for(var e="",i=0,n=t;i<n.length;i++){var o=n[i];e+=String.fromCharCode(o)}return e}function l(t){var e=s(c(t)),i=e.result;return{codes:e.codes,result:d(i)}}function h(t,e){return d(u(t,c(e)))}function p(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(Object.assign||function(t){for(var e=void 0,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,t)}function f(t){for(var e="",i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}function m(t){for(var e="",i=0,n=0,o=0,r=0;i<t.length;)(n=t.charCodeAt(i))<128?(e+=String.fromCharCode(n),i++):n>191&&n<224?(o=t.charCodeAt(i+1),e+=String.fromCharCode((31&n)<<6|63&o),i+=2):(o=t.charCodeAt(i+1),r=t.charCodeAt(i+2),e+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&r),i+=3);return e}function g(t,e){if(void 0===e&&(e=!1),!t)return"";e||(t=f(t));var i,n,o,r={},s=[],a=t.charAt(0),u=a,c=u,d=256,l=function(){s.push(a.length>1?String.fromCharCode(r[a]):a)};for(e&&s.push(a),i=1;i<t.length;i++)n=t.charAt(i),e?(o=t.charCodeAt(i),a=o<256?n:r[o]||a+u,s.push(a),u=a.charAt(0),r[d++]=c+u,c=a):r.hasOwnProperty(a+n)?a+=n:(l(),r[a+n]=d++,a=n);e||l();var h=s.join("");return e&&(h=m(h)),h}var v=function(t,e){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},b=function(){function t(t,e){this.data=t,this.weight=e}return t.prototype.preOrder=function(t){t.push(this),this.left&&this.left.preOrder(t),this.right&&this.right.preOrder(t)},t}(),y=function(){function t(){}return t.prototype.set=function(t,e){},t.prototype.get=function(t,e){},t.prototype.rm=function(t){},t}(),w=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.isSupport=function(){return!!window.localStorage},i.prototype.set=function(t,e){try{localStorage.setItem(t,e)}catch(t){console.error(t)}},i.prototype.get=function(t,e){var i=null;try{i=localStorage.getItem(t)}catch(t){console.error(t)}e&&e(i)},i.prototype.rm=function(t){try{localStorage.removeItem(t)}catch(t){console.error(t)}},i}(y),S=function(e){function i(){var t=e.call(this)||this;t.databaseName="spyLC",t.db=null,t.setQueue=[],t.getQueue=[];var i=window.indexedDB.open(t.databaseName);return i.onupgradeneeded=function(e){t.db=e.target&&e.target.result,t.db&&!t.db.objectStoreNames.contains(t.databaseName)&&t.db.createObjectStore(t.databaseName,{keyPath:"key"}),t.runQueueTask()},i.onsuccess=function(){t.db=i.result,t.runQueueTask()},t}return t(i,e),i.isSupport=function(){return!!window.indexedDB},i.prototype.set=function(t,e){this.db?this.db.transaction([this.databaseName],"readwrite").objectStore(this.databaseName).add({key:t,value:e}):this.setQueue.push({key:t,value:e})},i.prototype.get=function(t,e){if(this.db){var i=this.db.transaction([this.databaseName]).objectStore(this.databaseName).get(t);i.onsuccess=function(){var t=i.result?i.result:{value:""};e(t.value)}}else this.getQueue.push({key:t,cb:e})},i.prototype.runQueueTask=function(){var t=this;this.setQueue.forEach((function(e){t.set(e.key,e.value)})),this.getQueue.forEach((function(e){t.get(e.key,e.cb)}))},i}(y);return function(){function t(t){void 0===t&&(t={}),this.tmpList=[],this.option=p({defaultTrigger:!0,compress:"lzw",key:"SpyLocalCache",interval:500,maxRecordLen:30,onFlush:function(){},onSave:function(){},storage:S.isSupport()?"indexedDB":w.isSupport()?"localstorage":"empty"},t),this.load=this.load.bind(this),this.init()}return t.prototype.init=function(){"indexedDB"===this.option.storage?this.storage=new S:"localstorage"===this.option.storage?this.storage=new w:this.storage=new y,"complete"===document.readyState?this.load():window.addEventListener("load",this.load)},t.prototype.load=function(){location.search.indexOf("_FlushLogLocalCache=1")>-1&&this.option.defaultTrigger&&this.flushLog()},t.prototype.addLog=function(t){var e=this;t=JSON.stringify(t),this.tmpList.push(t),this.timer&&clearTimeout(this.timer),this.timer=setTimeout((function(){e.save()}),this.option.interval)},t.prototype.getData=function(t){var e=this;try{this.storage.get(this.option.key,(function(i){i?e.storage.get(e.option.key+"Codes",(function(n){var o=[];try{n&&(n=JSON.parse(n)),o=e.unzip(i,n).split("\n")}catch(t){console.error(t)}t(o)})):t([])}))}catch(e){console.error(e),t([])}},t.prototype.save=function(){var t=this,e=Date.now();this.getData((function(i){var n=t.option.maxRecordLen-1,o=(i.length>n?i.slice(i.length-n,i.length):i).concat(t.tmpList),r=o.join("\n"),s=null,a=0;try{var u=t.zip(r),c="";u.codes?(c=JSON.stringify(u.codes),t.storage.set(t.option.key+"Codes",c)):t.storage.rm(t.option.key+"Codes"),t.storage.set(t.option.key,u.result),a=u.result.length}catch(t){s=t,console.error(t)}t.tmpList=[],t.option.onSave&&t.option.onSave({cost:Date.now()-e,length:a/1024,list:o,error:s})}))},t.prototype.flushLog=function(){var t=this;this.getData((function(e){try{for(var i=0;i<e.length;i++)e[i]=JSON.parse(e[i])}catch(i){e=[],t.storage.rm(t.option.key),console.error(i)}for(i=0;i<t.tmpList.length;i++)e.push(JSON.parse(t.tmpList[i]));t.option.onFlush&&t.option.onFlush(e)}))},t.prototype.zip=function(t){return"lzw"===this.option.compress?{codes:null,result:g(t)}:"huffman"===this.option.compress?l(t):{codes:null,result:t}},t.prototype.unzip=function(t,e){return"lzw"===this.option.compress?g(t,!0):"huffman"===this.option.compress?h(e,t):t},t}()}()},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(i(9)),r=n(i(1)),s=n(i(10)),a=n(i(2)),u=n(i(3)),c=n(i(4)),d=n(i(5)),l=n(i(6)),h=i(0);(0,h.extend)(l["default"].prototype,o["default"]),(0,h.extend)(l["default"].prototype,r["default"]),(0,h.extend)(l["default"].prototype,s["default"]),(0,h.extend)(l["default"].prototype,a["default"]),(0,h.extend)(l["default"].prototype,u["default"]),(0,h.extend)(l["default"].prototype,c["default"]),(0,h.extend)(l["default"].prototype,d["default"]),e["default"]=l["default"],t.exports=e["default"]},function(t,e,i){"use strict";function n(t,e){return-1!==t.indexOf(e)}function o(t){(0,r.getPageHiddenValue)(t)?this.iaHideCb(t):this.iaShowCb(t)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),s=["bf","scroll","resize"];e["default"]={initIa:function(){this.iaTimer=null,this.curSpeed=4e3,this.iaQueue=[],this.lastQueueLen=-1,this.iaDim={},this.iaSendSwitch=!1,this.scrollCb=this.sendScrollLog.bind(this),this.resizeCb=this.sendResizeLog.bind(this),this.iaVisibilityCb=o.bind(this),this.iaHideCb=this.iaHideCb.bind(this),this.iaShowCb=this.iaShowCb.bind(this)},flushIaQueue:function(){var t=[].concat(this.iaQueue);for(this.iaQueue=[];t.length;){var e=t.splice(0,6);this.sendBeacon("ia",e,this.iaDim)}clearTimeout(this.iaTimer),this.startCycle()},startCycle:function(){var t=this;this.iaTimer=setTimeout((function(){var e=t.iaQueue.length;-1===t.lastQueueLen?t.lastQueueLen=e:t.lastQueueLen&&e/t.lastQueueLen>=2&&t.curSpeed>2e3?t.curSpeed-=1e3:e&&t.lastQueueLen/e>=2&&t.curSpeed<6e3||!e&&t.curSpeed<6e3?t.curSpeed+=1e3:e&&!t.lastQueueLen&&t.curSpeed>2e3?t.curSpeed-=1e3:!e&&t.curSpeed<6e3&&(t.curSpeed+=1e3),t.lastQueueLen=e,t.flushIaQueue(),clearTimeout(t.iaTimer),t.startCycle()}),this.curSpeed)},startIaMonitor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.options&&this.options.ia){this.iaDim=(0,r.assign)(this.iaDim,t),this.resetIaSwitch(),this.iaShowCb(null,!0),this.removeMonitorEvents(),clearTimeout(this.iaTimer),this.startCycle(),this.monitorItems=s;var e=[];this.options&&this.options.ia&&this.options.ia.iaMonitorItems?e=this.options.ia.iaMonitorItems:this.options&&this.options.iaMonitorItems&&(e=this.options.iaMonitorItems),e&&Array.isArray(e)&&e.length&&(this.monitorItems=e.filter((function(t){return n(s,t)})),this.monitorItems.length||(this.monitorItems=s)),this.bindMonitorEvents()}},stopIaMonitor:function(){this.options&&this.options.ia&&(this.iaHideCb(null,!0),this.flushIaQueue(),this.removeMonitorEvents(),clearTimeout(this.iaTimer))},sendScrollLog:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.scrollLogLock||(this.scrollLogLock=!0,setTimeout((function(){t.scrollLogLock=!1}),500),e.x>=0&&e.y>=0||(e=(0,r.getScrollInfo)()),this.iaQueue.push({k:"scroll",x:e.x,y:e.y,t:(new Date).getTime(),ele:e.scrollEle||"window"}))},sendResizeLog:function(){var t=this;this.resizeLogLock||(this.resizeLogLock=!0,setTimeout((function(){t.resizeLogLock=!1}),500),setTimeout((function(){t.iaQueue.push({k:"resize",w:window.innerWidth||document.documentElement.clientWidth,h:window.innerHeight||document.documentElement.clientHeight,t:(new Date).getTime()})}),50))},bindMonitorEvents:function(){var t=this.monitorItems;n(t,"bf")&&((0,r.getProp)(document,"hidden")&&(0,r.bindVisibilityChangeEvent)(this.iaVisibilityCb),window.addEventListener("beforeunload",this.iaHideCb,!1),window.addEventListener("unload",this.iaHideCb,!1),window.addEventListener("pagehide",this.iaHideCb,!1),window.addEventListener("pageshow",this.iaShowCb,!1)),n(t,"scroll")&&window.addEventListener("scroll",this.scrollCb),n(t,"resize")&&window.addEventListener("resize",this.resizeCb)},removeMonitorEvents:function(){window.removeEventListener("scroll",this.scrollCb),window.removeEventListener("resize",this.resizeCb),(0,r.disposeVisibilityChangeEvent)(this.iaVisibilityCb),window.removeEventListener("beforeunload",this.iaHideCb,!1),window.removeEventListener("unload",this.iaHideCb,!1),window.removeEventListener("pagehide",this.iaHideCb,!1),window.removeEventListener("pageshow",this.iaShowCb,!1)},updateIaDim:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.iaDim=t},resetIaSwitch:function(){this.iaSendSwitch=!1},convertIaSwitch:function(){this.iaSendSwitch=!this.iaSendSwitch},iaHideCb:function(t,e){if(this.iaSendSwitch||e){var i=t?t.type:"";e&&(i="manual"),this.convertIaSwitch(),this.iaQueue.push({k:"blur",trigger:i,t:(new Date).getTime()}),this.flushIaQueue()}},iaShowCb:function(t,e){if(!this.iaSendSwitch||e){var i=t?t.type:"";e&&(i="manual"),this.convertIaSwitch(),this.iaQueue.push({k:"focus",trigger:i,t:(new Date).getTime()}),this.flushIaQueue()}},destroyIaMonitor:function(){this.removeMonitorEvents(),clearTimeout(this.iaTimer),this.iaTimer=null,this.curSpeed=null,this.iaQueue=null,this.lastQueueLen=null,this.iaDim=null,this.scrollCb=null,this.resizeCb=null,this.pageActiveStatusChangeCb=null}},t.exports=e["default"]},function(t,e,i){"use strict";function n(){var t=this.__media__;t.sendSwitch=!0,t.continueSwitch=!1}function o(){var t=this.__media__;t.sendSwitch=!t.sendSwitch,t.continueSwitch=!t.continueSwitch}function r(t){(0,u.getPageHiddenValue)(t)?this.mediaHideCb(t):this.mediaShowCb(t)}function s(t){var e=this.__media__||{};e.continueSwitch&&(this.convertMediaSwitch(),e.count+=1,e.startTime=Date.now())}function a(t,e){var i=this.__media__;if(i.sendSwitch||e){var n=t?t.type:"";e&&(n="manual"),i.endTime=Date.now(),this.convertMediaSwitch();var o={t1:i.startTime,t2:i.endTime,count:i.count,trigger:n};this.sendBeacon(c,o,i.dim)}}Object.defineProperty(e,"__esModule",{value:!0});var u=i(0),c="time";e["default"]={initMediaTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.__media__={dim:e,startTime:0,endTime:0,count:1,sendSwitch:!0,continueSwitch:!1};t?i.startTime=t:window.__webbbrige__&&window.__webbbrige__.startTime?(i.startTime=window.__webbbrige__.startTime,window.__webbbrige__.startTime=null):i.startTime=Date.now(),this.hasMediaInit=!0,this.mediaHideCb=a.bind(this),this.mediaShowCb=s.bind(this),this.mediaVisibilityCb=r.bind(this),this.resetMediaSwitch=n.bind(this),this.convertMediaSwitch=o.bind(this),this.destroyMediaEvent(),this.bindMediaEvent()},reStartMediaTime:function(t){if(this.hasMediaInit){var e=this.__media__;e.count=t?1:e.count+1,e.startTime=Date.now(),this.resetMediaSwitch(),this.destroyMediaEvent(),this.bindMediaEvent()}else this.initMediaTime()},stopMediaTime:function(){!this.__media__||this.__media__&&!this.__media__.startTime||(this.mediaHideCb(null,!0),this.destroyMediaEvent(),this.__media__.startTime=null)},updateMediaDim:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.__media__.dim=t},bindMediaEvent:function(){(0,u.getProp)(document,"hidden")&&(0,u.bindVisibilityChangeEvent)(this.mediaVisibilityCb),window.addEventListener("beforeunload",this.mediaHideCb,!1),window.addEventListener("unload",this.mediaHideCb,!1),window.addEventListener("pagehide",this.mediaHideCb,!1),window.addEventListener("pageshow",this.mediaShowCb,!1)},destroyMediaEvent:function(){(0,u.disposeVisibilityChangeEvent)(this.mediaVisibilityCb),window.removeEventListener("beforeunload",this.mediaHideCb,!1),window.removeEventListener("unload",this.mediaHideCb,!1),window.removeEventListener("pagehide",this.mediaHideCb,!1),window.removeEventListener("pageshow",this.mediaShowCb,!1)},destroyMediaTime:function(){this.destroyMediaEvent(),this.__media__=null,this.hasMediaInit=!1,this.mediaHideCb=null,this.mediaShowCb=null,this.mediaVisibilityCb=null,this.resetMediaSwitch=null,this.convertMediaSwitch=null}},t.exports=e["default"]}])})); |