Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

image-observer-mini

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-observer-mini - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

dist/image-observer-mini.zip

2

dist/bytedance/index.js

@@ -1,1 +0,1 @@

module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),i={formatTiming:function(e,t,r){var n;return(n={})[r+"_start"]=e,n[r+"_end"]=t,n[r+"_duration"]=t-e,n},mergeObj:function(e,t){return Object.assign({},e,t)},formatRenderErrorInfo:function(e){var t=e.detail;return Object.assign({},{err_desc:t&&t.errMsg||n.ERROR_MSG.ERROR_HARD_DECODER,err_code:n.ERROR_CODE[n.ERROR_MSG.ERROR_HARD_DECODER],code:1,load_status:"fail",fail_phase:n.ERROR_PHASE.DECODE})},getDomain:function(e){var t="",r=e.match(/^(?:\/\/|[^\/]+)*/);return r&&(t=r[0]),t.replace(/http(s|):\/\//,"")},formatSrcList:function(e){return"string"!=typeof e?[]:e.split(",")},loopRequest:function(e,t){var r=void 0;if(!1===Array.isArray(t)||0===t.length)return Promise.reject({url:"",res:{}});var n="";return new Promise((function(i,o){!function a(){var s=t.shift();s?(n=s,e.request(s).then((function(e){i({url:s,res:r=e,urls:t})})).catch((function(e){r=e,a()}))):o({url:n,res:r})}()}))}};t.default=i},function(e,t,r){"use strict";var n;t.__esModule=!0;t.DIVIDER_RECEIVE_IMG="divider_receive_img";var i=t.ERROR_MSG={NETWORK_ERR:"NETWORK_ERR",SOURCE_NOT_FOUND:"SOURCE_NOT_FOUND",NETWORK_TIMEOUT:"NETWORK_TIMEOUT",TYPE_ERR_NOT_IMG:"TYPE_ERR_NOT_IMG",TYPE_ERR_CAN_NOT_DECODE:"TYPE_ERR_CAN_NOT_DECODE",TYPE_ERR_HARD_IMG:"TYPE_ERR_HARD_IMG",TYPE_ERR_SOFT_IMG:"TYPE_ERR_SOFT_IMG",MISSING_DECODER:"MISSING_DECODER",ERROR_DECODER:"ERROR_DECODER",ERROR_SOFT_DECODER:"ERROR_SOFT_DECODER",ERROR_ASYNC_DECODER:"ERROR_ASYNC_DECODER",TIMEOUT_ASYNC_DECODER:"TIMEOUT_ASYNC_DECODER",ERROR_HARD_DECODER:"ERROR_HARD_DECODER",ERROR_SYSTEM_INIT:"ERROR_SYSTEM_INIT",ERROR_SYSTEM_OBS:"ERROR_SYSTEM_OBS",ERROR_SYSTEM_SECTION:"ERROR_SYSTEM_SECTION"};t.ERROR_CODE=((n={})[i.NETWORK_ERR]=1001,n[i.SOURCE_NOT_FOUND]=1002,n[i.NETWORK_TIMEOUT]=1003,n[i.TYPE_ERR_NOT_IMG]=2001,n[i.TYPE_ERR_CAN_NOT_DECODE]=2002,n[i.TYPE_ERR_HARD_IMG]=2101,n[i.TYPE_ERR_SOFT_IMG]=2201,n[i.MISSING_DECODER]=3001,n[i.ERROR_DECODER]=3002,n[i.ERROR_HARD_DECODER]=3100,n[i.ERROR_SOFT_DECODER]=3200,n[i.ERROR_ASYNC_DECODER]=3201,n[i.TIMEOUT_ASYNC_DECODER]=3202,n[i.ERROR_SYSTEM_INIT]=5001,n[i.ERROR_SYSTEM_OBS]=5002,n[i.ERROR_SYSTEM_SECTION]=5003,n),t.ERROR_PHASE={DECODE:"decode",DOWNLOAD:"download",RENDER:"render"},t.LOAD_STATUS={SUCCESS:"success",FAIL:"fail"},t.LOG_LIFE_MAP={REQUEST_INFO:"REQUEST_INFO",CODEC_INFO:"CODEC_INFO",EDITOR_INFO:"EDITOR_INFO",FILTER_INFO:"FILTER_INFO",RENDER_INFO:"RENDER_INFO",LOG_INFO:"LOG_INFO",BACKUP_PROCESS:"BACKUP_PROCESS"}},function(e,t,r){"use strict";var n=r(3);Component({properties:{src:{type:String},mode:{type:String,value:"scaleToFill"},webp:{type:Boolean,value:!1},lazyLoad:{type:Boolean,value:!1},showMenuByLongpress:{type:Boolean,value:!1}},data:{mainSrc:"",_backupFlag:!1,urls:[],_log:{queue:{}}},lifetimes:{attached:function(){var e=this,t=+new Date,r=n.util.formatSrcList(this.data.src);this.data._log.queue=n.util.formatTiming(t,+new Date,"queue"),n.util.loopRequest(n.requester,r).then((function(t){e.data.mainSrc=t.url,t.res.url=t.url,e.setData({mainSrc:t.url,urls:t.urls}),e.data._log.download=t.res})).catch((function(t){var r=t.url;t.res.url=r,e.data._log.download=t.res;var i=n.Logger.export(e.data._log);e.beforeSendLog(i)}))},ready:function(){},detached:function(){this.data._log={}}},methods:{beforeSendLog:function(e){this.triggerEvent("beforeSendLog",e,{})},bindloadSelf:function(e){this.triggerEvent("bindload",e.detail,{}),this.data._log.decode=n.Logger._formatDecoderTiming(this.data._log.download.timing.download_end,"decode",e.detail);var t=n.Logger._formatRenderTiming(this.data._log.decode.decode_end);this.data._log.render=t,this.data._log.render.applied_image_size=n.Logger._formatImageApplySize(e.detail);var r=n.Logger.export(this.data._log);this.beforeSendLog(r)},binderrorSelf:function(e){var t=this;this.data._log.decode=n.util.formatRenderErrorInfo(e);var r=this.data.urls;if(Array.isArray(r)&&0===r.length){var i=n.Logger.export(this.data._log);return this.beforeSendLog(i),void this.triggerEvent("binderror",e.detail,{})}n.util.loopRequest(n.requester,r).then((function(e){t.data.mainSrc=e.url,e.res.url=e.url,t.setData({mainSrc:e.url,urls:e.urls}),t.data._log.download=e.res})).catch((function(e){var r=e.url;e.res.url=r,t.data._log.download=e.res;var i=n.Logger.export(t.data._log);t.beforeSendLog(i),t.triggerEvent("binderror",e.detail,{})}))}}})},function(e,t,r){"use strict";t.__esModule=!0,t.Logger=t.util=t.requester=void 0;var n=a(r(4)),i=a(r(5)),o=a(r(0));function a(e){return e&&e.__esModule?e:{default:e}}var s=new n.default;t.requester=s,t.util=o.default,t.Logger=i.default},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(1),o=r(0),a=(n=o)&&n.__esModule?n:{default:n};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.info=[],this.main=wx||tt}return e.prototype._formatNetwork=function(e){try{var t=Object.keys(e).map((function(t){return t+":"+e[t]}));this.info.concat(t)}catch(e){}},e.prototype._formatRequest=function(e){var t=null,r=e.statusCode,n=e.errMsg,o=e.header["Content-Length"],a=e.header["Content-Type"],s="",_="",u=e.data;try{s=e.header["X-Response-Cinfo"],_=e.header["x-response-cache"]}catch(t){this.info.push("cdn info not access")}if(this._formatNetwork(e.profile),404===r)return(t=new Error(i.ERROR_MSG.SOURCE_NOT_FOUND)).err_code=i.ERROR_CODE.SOURCE_NOT_FOUND,t.description=n,t.number=r,{code:1,error:t};var d=/^image\//;return d.test(a)?(a=a.replace(d,""),{code:0,httpStatus:r,httpText:n,arrayBuffer:u,fileSize:o||u.byteLength||0,imageType:a,response_cache:_,response_cinfo:s,info:this.info}):((t=new Error(i.ERROR_MSG.TYPE_ERR_NOT_IMG)).number=r,t.description=n,t.err_code=i.ERROR_CODE.TYPE_ERR_NOT_IMG,{code:1,error:t})},e.prototype._formatError=function(e){return"The user aborted a request."===e.message&&(e=Object.assign(e,{err_code:i.ERROR_CODE[i.ERROR_MSG.NETWORK_TIMEOUT],number:100,description:"timeout, SDK abort fetch"})),{code:1,errMsg:e.message,errCode:e.err_code||i.ERROR_CODE[i.ERROR_MSG.NETWORK_ERR],httpStatus:e.number,httpText:e.description,fail_phase:i.ERROR_PHASE.DOWNLOAD,load_status:i.LOAD_STATUS.FAIL,info:this.info}},e.prototype.request=function(e){var t=this,r=+new Date;return new Promise((function(n,i){t.main.request({url:e,responseType:"arraybuffer",success:function(e){var o=t._formatRequest(e);if(0===o.code)o.timing=a.default.formatTiming(r,+new Date,"download"),n(o);else{var s=t._formatError(o.error);s.timing=a.default.formatTiming(r,+new Date,"download"),i(s)}},fail:function(e){var n=t._formatError(e);n.timing=a.default.formatTiming(r,+new Date,"download"),i(n)}})}))},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n},a=r(6);var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.main=function(){return wx||tt},e._formatRenderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"render";return o.default.formatTiming(e,+new Date,t)},e._formatDecoderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decode",r=arguments[2],n=16;(r.width<2e3||r.height<2e3)&&(n=1);var i=Math.min((+new Date-e)%16,n),a=e+i;return o.default.formatTiming(e,a,t)},e._formatImageApplySize=function(e){return e.width+" * "+e.height},e._formatDownload=function(e){var t=e.timing;try{delete e.timing,e.errMsg&&(e.err_desc=e.errMsg),e.errCode&&(e.err_code=e.errCode),e.file_size=e.fileSize,delete e.fileSize,e.image_type=e.imageType,delete e.imageType,e.http_status=e.httpStatus,delete e.httpStatus,delete e.arrayBuffer}catch(t){Array.isArray(e.info)?e.info.push(t.toString()):e.info=[t.toString()]}return Object.assign({},t,e)},e._formatDecode=function(e){return Object.assign({},e)},e._formatRender=function(e){var t=e.timing;return delete e.timing,Object.assign({},t,e)},e._formatProcess=function(e){e.duration=e.queue_duration+e.download_duration+e.decode_duration+e.render_duration,e.uri=e.url,e.domain=o.default.getDomain(e.url)},e._getStorageInfo=function(){return e.main().getStorageInfoSync()},e._save2Storage=function(t){e.main().setStorage({key:t.url,data:t,fail:function(){var t=e._getStorageInfo();console.error("set log fail cur:"+t.currentSize+" limit:"+t.limitSize)}})},e.export=function(t,r){var n=e._formatDownload(t.queue),i=e._formatDownload(t.download),o=e._formatDecode(t.decode),s=e._formatDecode(t.render),_=Object.assign({},a.defaultParams,n,i,o,s);return e._formatProcess(_),e._save2Storage(_),_},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0,t.settingUrl=t.defaultParams=void 0;var n,i=r(7);var o={file_size:0,applied_image_size:"0*0",duration:-1,queue_duration:-1,queue_start:-1,queue_end:-1,download_duration:-1,download_start:-1,download_end:-1,decode_duration:-1,decode_start:-1,decode_end:-1,render_duration:-1,render_start:-1,render_end:-1,timing_time_start:-1,timing_redirect_start:-1,timing_redirect_end:-1,timing_fetch_start:-1,timing_dns_start:-1,timing_dns_end:-1,timing_connect_start:-1,timing_connect_end:-1,timing_request_start:-1,timing_request_end:-1,timing_response_start:-1,timing_response_end:-1,timing_network_duration:-1,timing_connect:-1,timing_dns:-1,timing_send:-1,timing_wait:-1,timing_retry:-1,timing_runtime:-1,image_type:null,image_sdk_version:((n=i)&&n.__esModule?n:{default:n}).default.version,log_id:0,log_type:"image_monitor_v2",image_count:1,load_status:"success",fail_phase:"download",err_code:0,err_desc:"xxx",http_status:0,timestamp:0,retry_count:0,heic_custom_decoder:0,is_bg:0,device_pixel_ratio:1,department:"",response_sinfo:"",response_cache:"",response_cinfo:"",uri:null};t.defaultParams=o,t.settingUrl={cn:"//imagex-web-settings.volcimagex.net/app/monitor/settings",va:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",sg:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",default:"//imagex-web-settings.volcimagex.net/app/monitor/settings"}},function(e){e.exports=JSON.parse('{"name":"imageXmini","version":"1.0.0","description":"","main":"miniprogram_dist/index.js","scripts":{"dev":"gulp dev --develop --watch","builddev":"gulp watch --develop","build":"gulp && bash buildByetminiAndbundle.sh","movedist2dev":"bash ","dist":"npm run build","clean-dev":"gulp clean --develop","clean":"gulp clean","test":"jest --bail","test-debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --bail","coverage":"jest ./test/* --coverage --bail","lint":"eslint \\"src/**/*.js\\" --fix","lint-tools":"eslint \\"tools/**/*.js\\" --rule \\"import/no-extraneous-dependencies: false\\" --fix"},"miniprogram":"miniprogram_dist","jest":{"testEnvironment":"jsdom","testURL":"https://jest.test","collectCoverageFrom":["miniprogram_dist/**/*.js"],"moduleDirectories":["node_modules","miniprogram_dist"]},"repository":{"type":"git","url":""},"author":"tuqiang","license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^2.28.0","@typescript-eslint/parser":"^2.28.0","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-module-resolver":"^3.2.0","babel-preset-env":"^1.7.0","colors":"^1.3.1","eslint":"^5.14.1","eslint-config-airbnb-base":"13.1.0","eslint-loader":"^2.1.2","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^3.8.0","gulp":"^4.0.0","gulp-clean":"^0.4.0","gulp-if":"^2.0.2","gulp-install":"^1.1.0","gulp-less":"^4.0.1","gulp-rename":"^1.4.0","gulp-sourcemaps":"^2.6.5","jest":"^23.5.0","miniprogram-api-typings":"^2.10.3-1","miniprogram-simulate":"^1.2.5","thread-loader":"^2.1.3","through2":"^2.0.3","ts-loader":"^7.0.0","typescript":"^3.8.3","vinyl":"^2.2.0","webpack":"^4.29.5","webpack-node-externals":"^1.7.2"},"dependencies":{}}')}]);
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),i={formatTiming:function(e,t,r){var n;return(n={})[r+"_start"]=e,n[r+"_end"]=t,n[r+"_duration"]=t-e,n},mergeObj:function(e,t){return Object.assign({},e,t)},formatRenderErrorInfo:function(e){var t=e.detail;return Object.assign({},{err_desc:t&&t.errMsg||n.ERROR_MSG.ERROR_HARD_DECODER,err_code:n.ERROR_CODE[n.ERROR_MSG.ERROR_HARD_DECODER],code:1,load_status:"fail",fail_phase:n.ERROR_PHASE.DECODE})},getDomain:function(e){var t="",r=e.match(/^(?:\/\/|[^\/]+)*/);return r&&(t=r[0]),t.replace(/http(s|):\/\//,"")},formatSrcList:function(e){return"string"!=typeof e?[]:e.split(",")},loopRequest:function(e,t){var r=void 0;if(!1===Array.isArray(t)||0===t.length)return Promise.reject({url:"",res:{}});var n="";return new Promise((function(i,o){!function a(){var s=t.shift();s?(n=s,e.request(s).then((function(e){i({url:s,res:r=e,urls:t})})).catch((function(e){r=e,a()}))):o({url:n,res:r})}()}))}};t.default=i},function(e,t,r){"use strict";var n;t.__esModule=!0;t.DIVIDER_RECEIVE_IMG="divider_receive_img";var i=t.ERROR_MSG={NETWORK_ERR:"NETWORK_ERR",SOURCE_NOT_FOUND:"SOURCE_NOT_FOUND",NETWORK_TIMEOUT:"NETWORK_TIMEOUT",TYPE_ERR_NOT_IMG:"TYPE_ERR_NOT_IMG",TYPE_ERR_CAN_NOT_DECODE:"TYPE_ERR_CAN_NOT_DECODE",TYPE_ERR_HARD_IMG:"TYPE_ERR_HARD_IMG",TYPE_ERR_SOFT_IMG:"TYPE_ERR_SOFT_IMG",MISSING_DECODER:"MISSING_DECODER",ERROR_DECODER:"ERROR_DECODER",ERROR_SOFT_DECODER:"ERROR_SOFT_DECODER",ERROR_ASYNC_DECODER:"ERROR_ASYNC_DECODER",TIMEOUT_ASYNC_DECODER:"TIMEOUT_ASYNC_DECODER",ERROR_HARD_DECODER:"ERROR_HARD_DECODER",ERROR_SYSTEM_INIT:"ERROR_SYSTEM_INIT",ERROR_SYSTEM_OBS:"ERROR_SYSTEM_OBS",ERROR_SYSTEM_SECTION:"ERROR_SYSTEM_SECTION"};t.ERROR_CODE=((n={})[i.NETWORK_ERR]=1001,n[i.SOURCE_NOT_FOUND]=1002,n[i.NETWORK_TIMEOUT]=1003,n[i.TYPE_ERR_NOT_IMG]=2001,n[i.TYPE_ERR_CAN_NOT_DECODE]=2002,n[i.TYPE_ERR_HARD_IMG]=2101,n[i.TYPE_ERR_SOFT_IMG]=2201,n[i.MISSING_DECODER]=3001,n[i.ERROR_DECODER]=3002,n[i.ERROR_HARD_DECODER]=3100,n[i.ERROR_SOFT_DECODER]=3200,n[i.ERROR_ASYNC_DECODER]=3201,n[i.TIMEOUT_ASYNC_DECODER]=3202,n[i.ERROR_SYSTEM_INIT]=5001,n[i.ERROR_SYSTEM_OBS]=5002,n[i.ERROR_SYSTEM_SECTION]=5003,n),t.ERROR_PHASE={DECODE:"decode",DOWNLOAD:"download",RENDER:"render"},t.LOAD_STATUS={SUCCESS:"success",FAIL:"fail"},t.LOG_LIFE_MAP={REQUEST_INFO:"REQUEST_INFO",CODEC_INFO:"CODEC_INFO",EDITOR_INFO:"EDITOR_INFO",FILTER_INFO:"FILTER_INFO",RENDER_INFO:"RENDER_INFO",LOG_INFO:"LOG_INFO",BACKUP_PROCESS:"BACKUP_PROCESS"}},function(e,t,r){"use strict";var n=r(3);Component({properties:{src:{type:String},mode:{type:String,value:"scaleToFill"},webp:{type:Boolean,value:!1},lazyLoad:{type:Boolean,value:!1},showMenuByLongpress:{type:Boolean,value:!1}},data:{mainSrc:"",_backupFlag:!1,urls:[],_log:{queue:{}}},lifetimes:{attached:function(){var e=this,t=+new Date,r=n.util.formatSrcList(this.data.src);this.data._log.queue=n.util.formatTiming(t,+new Date,"queue"),n.util.loopRequest(n.requester,r).then((function(t){e.data.mainSrc=t.url,t.res.url=t.url,e.setData({mainSrc:t.url,urls:t.urls}),e.data._log.download=t.res})).catch((function(t){var r=t.url;t.res.url=r,e.data._log.download=t.res;var i=n.Logger.export(e.data._log);e.beforeSendLog(i)}))},detached:function(){this.data._log={}}},methods:{beforeSendLog:function(e){this.triggerEvent("beforeSendLog",e,{})},bindloadSelf:function(e){this.triggerEvent("bindload",e.detail,{}),this.data._log.decode=n.Logger._formatDecoderTiming(this.data._log.download.timing.download_end,"decode",e.detail);var t=n.Logger._formatRenderTiming(this.data._log.decode.decode_end);this.data._log.render=t,this.data._log.render.applied_image_size=n.Logger._formatImageApplySize(e.detail);var r=n.Logger.export(this.data._log);this.beforeSendLog(r)},binderrorSelf:function(e){var t=this;this.data._log.decode=n.util.formatRenderErrorInfo(e);var r=this.data.urls;if(Array.isArray(r)&&0===r.length){var i=n.Logger.export(this.data._log);return this.beforeSendLog(i),void this.triggerEvent("binderror",e.detail,{})}n.util.loopRequest(n.requester,r).then((function(e){t.data.mainSrc=e.url,e.res.url=e.url,t.setData({mainSrc:e.url,urls:e.urls}),t.data._log.download=e.res})).catch((function(e){var r=e.url;e.res.url=r,t.data._log.download=e.res;var i=n.Logger.export(t.data._log);t.beforeSendLog(i),t.triggerEvent("binderror",e.detail,{})}))}}})},function(e,t,r){"use strict";t.__esModule=!0,t.Logger=t.util=t.requester=void 0;var n=a(r(4)),i=a(r(5)),o=a(r(0));function a(e){return e&&e.__esModule?e:{default:e}}var s=new n.default;t.requester=s,t.util=o.default,t.Logger=i.default},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(1),o=r(0),a=(n=o)&&n.__esModule?n:{default:n};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.info=[],this.main=wx||tt}return e.prototype._formatNetwork=function(e){try{var t=Object.keys(e).map((function(t){return t+":"+e[t]}));this.info.concat(t)}catch(e){}},e.prototype._formatRequest=function(e){var t=null,r=e.statusCode,n=e.errMsg,o=e.header["Content-Length"],a=e.header["Content-Type"],s="",_="",u=e.data;try{s=e.header["X-Response-Cinfo"],_=e.header["x-response-cache"]}catch(t){this.info.push("cdn info not access")}if(this._formatNetwork(e.profile),404===r)return(t=new Error(i.ERROR_MSG.SOURCE_NOT_FOUND)).err_code=i.ERROR_CODE.SOURCE_NOT_FOUND,t.description=n,t.number=r,{code:1,error:t};var d=/^image\//;return d.test(a)?(a=a.replace(d,""),{code:0,httpStatus:r,httpText:n,arrayBuffer:u,fileSize:o||u.byteLength||0,imageType:a,response_cache:_,response_cinfo:s,info:this.info}):((t=new Error(i.ERROR_MSG.TYPE_ERR_NOT_IMG)).number=r,t.description=n,t.err_code=i.ERROR_CODE.TYPE_ERR_NOT_IMG,{code:1,error:t})},e.prototype._formatError=function(e){return"The user aborted a request."===e.message&&(e=Object.assign(e,{err_code:i.ERROR_CODE[i.ERROR_MSG.NETWORK_TIMEOUT],number:100,description:"timeout, SDK abort fetch"})),{code:1,errMsg:e.message,errCode:e.err_code||i.ERROR_CODE[i.ERROR_MSG.NETWORK_ERR],httpStatus:e.number,httpText:e.description,fail_phase:i.ERROR_PHASE.DOWNLOAD,load_status:i.LOAD_STATUS.FAIL,info:this.info}},e.prototype.request=function(e){var t=this,r=+new Date;return new Promise((function(n,i){t.main.request({url:e,responseType:"arraybuffer",success:function(e){var o=t._formatRequest(e);if(0===o.code)o.timing=a.default.formatTiming(r,+new Date,"download"),n(o);else{var s=t._formatError(o.error);s.timing=a.default.formatTiming(r,+new Date,"download"),i(s)}},fail:function(e){var n=t._formatError(e);n.timing=a.default.formatTiming(r,+new Date,"download"),i(n)}})}))},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n},a=r(6);var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.main=function(){return wx||tt},e._formatRenderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"render";return o.default.formatTiming(e,+new Date,t)},e._formatDecoderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decode",r=arguments[2],n=16;(r.width<2e3||r.height<2e3)&&(n=1);var i=Math.min((+new Date-e)%16,n),a=e+i;return o.default.formatTiming(e,a,t)},e._formatImageApplySize=function(e){return e.width+" * "+e.height},e._formatDownload=function(e){var t=e.timing;try{delete e.timing,e.errMsg&&(e.err_desc=e.errMsg),e.errCode&&(e.err_code=e.errCode),e.file_size=e.fileSize,delete e.fileSize,e.image_type=e.imageType,delete e.imageType,e.http_status=e.httpStatus,delete e.httpStatus,delete e.arrayBuffer}catch(t){Array.isArray(e.info)?e.info.push(t.toString()):e.info=[t.toString()]}return Object.assign({},t,e)},e._formatDecode=function(e){return Object.assign({},e)},e._formatRender=function(e){var t=e.timing;return delete e.timing,Object.assign({},t,e)},e._formatProcess=function(e){e.duration=e.queue_duration+e.download_duration+e.decode_duration+e.render_duration,e.uri=e.url,e.domain=o.default.getDomain(e.url)},e._getStorageInfo=function(){return e.main().getStorageInfoSync()},e._save2Storage=function(t){e.main().setStorage({key:t.url,data:t,fail:function(){var t=e._getStorageInfo();console.error("set log fail cur:"+t.currentSize+" limit:"+t.limitSize)}})},e.export=function(t,r){var n=e._formatDownload(t.queue),i=e._formatDownload(t.download),o=e._formatDecode(t.decode),s=e._formatDecode(t.render),_=Object.assign({},a.defaultParams,n,i,o,s);return e._formatProcess(_),e._save2Storage(_),_},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0,t.settingUrl=t.defaultParams=void 0;var n,i=r(7);var o={file_size:0,applied_image_size:"0*0",duration:-1,queue_duration:-1,queue_start:-1,queue_end:-1,download_duration:-1,download_start:-1,download_end:-1,decode_duration:-1,decode_start:-1,decode_end:-1,render_duration:-1,render_start:-1,render_end:-1,timing_time_start:-1,timing_redirect_start:-1,timing_redirect_end:-1,timing_fetch_start:-1,timing_dns_start:-1,timing_dns_end:-1,timing_connect_start:-1,timing_connect_end:-1,timing_request_start:-1,timing_request_end:-1,timing_response_start:-1,timing_response_end:-1,timing_network_duration:-1,timing_connect:-1,timing_dns:-1,timing_send:-1,timing_wait:-1,timing_retry:-1,timing_runtime:-1,image_type:null,image_sdk_version:((n=i)&&n.__esModule?n:{default:n}).default.version,log_id:0,log_type:"image_monitor_v2",image_count:1,load_status:"success",fail_phase:"download",err_code:0,err_desc:"xxx",http_status:0,timestamp:0,retry_count:0,heic_custom_decoder:0,is_bg:0,device_pixel_ratio:1,department:"",response_sinfo:"",response_cache:"",response_cinfo:"",uri:null};t.defaultParams=o,t.settingUrl={cn:"//imagex-web-settings.volcimagex.net/app/monitor/settings",va:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",sg:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",default:"//imagex-web-settings.volcimagex.net/app/monitor/settings"}},function(e){e.exports=JSON.parse('{"name":"image-observer-mini","version":"1.0.1","description":"","main":"dist/wechat/index.js","scripts":{"dev":"gulp dev --develop --watch","builddev":"gulp watch --develop","build":"gulp && bash buildByetminiAndbundle.sh","movedist2dev":"bash ","dist":"npm run build","clean-dev":"gulp clean --develop","clean":"gulp clean","test":"jest --bail","test-debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --bail","coverage":"jest ./test/* --coverage --bail","lint":"eslint \\"src/**/*.js\\" --fix","lint-tools":"eslint \\"tools/**/*.js\\" --rule \\"import/no-extraneous-dependencies: false\\" --fix"},"miniprogram":"miniprogram_dist","jest":{"testEnvironment":"jsdom","testURL":"https://jest.test","collectCoverageFrom":["miniprogram_dist/**/*.js"],"moduleDirectories":["node_modules","miniprogram_dist"]},"repository":{"type":"git","url":""},"author":"tuqiang","license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^2.28.0","@typescript-eslint/parser":"^2.28.0","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-module-resolver":"^3.2.0","babel-preset-env":"^1.7.0","colors":"^1.3.1","eslint":"^5.14.1","eslint-config-airbnb-base":"13.1.0","eslint-loader":"^2.1.2","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^3.8.0","gulp":"^4.0.0","gulp-clean":"^0.4.0","gulp-if":"^2.0.2","gulp-install":"^1.1.0","gulp-less":"^4.0.1","gulp-rename":"^1.4.0","gulp-sourcemaps":"^2.6.5","jest":"^23.5.0","miniprogram-api-typings":"^2.10.3-1","miniprogram-simulate":"^1.2.5","thread-loader":"^2.1.3","through2":"^2.0.3","ts-loader":"^7.0.0","typescript":"^3.8.3","vinyl":"^2.2.0","webpack":"^4.29.5","webpack-node-externals":"^1.7.2"},"dependencies":{}}')}]);

@@ -1,1 +0,1 @@

module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),i={formatTiming:function(e,t,r){var n;return(n={})[r+"_start"]=e,n[r+"_end"]=t,n[r+"_duration"]=t-e,n},mergeObj:function(e,t){return Object.assign({},e,t)},formatRenderErrorInfo:function(e){var t=e.detail;return Object.assign({},{err_desc:t&&t.errMsg||n.ERROR_MSG.ERROR_HARD_DECODER,err_code:n.ERROR_CODE[n.ERROR_MSG.ERROR_HARD_DECODER],code:1,load_status:"fail",fail_phase:n.ERROR_PHASE.DECODE})},getDomain:function(e){var t="",r=e.match(/^(?:\/\/|[^\/]+)*/);return r&&(t=r[0]),t.replace(/http(s|):\/\//,"")},formatSrcList:function(e){return"string"!=typeof e?[]:e.split(",")},loopRequest:function(e,t){var r=void 0;if(!1===Array.isArray(t)||0===t.length)return Promise.reject({url:"",res:{}});var n="";return new Promise((function(i,o){!function a(){var s=t.shift();s?(n=s,e.request(s).then((function(e){i({url:s,res:r=e,urls:t})})).catch((function(e){r=e,a()}))):o({url:n,res:r})}()}))}};t.default=i},function(e,t,r){"use strict";var n;t.__esModule=!0;t.DIVIDER_RECEIVE_IMG="divider_receive_img";var i=t.ERROR_MSG={NETWORK_ERR:"NETWORK_ERR",SOURCE_NOT_FOUND:"SOURCE_NOT_FOUND",NETWORK_TIMEOUT:"NETWORK_TIMEOUT",TYPE_ERR_NOT_IMG:"TYPE_ERR_NOT_IMG",TYPE_ERR_CAN_NOT_DECODE:"TYPE_ERR_CAN_NOT_DECODE",TYPE_ERR_HARD_IMG:"TYPE_ERR_HARD_IMG",TYPE_ERR_SOFT_IMG:"TYPE_ERR_SOFT_IMG",MISSING_DECODER:"MISSING_DECODER",ERROR_DECODER:"ERROR_DECODER",ERROR_SOFT_DECODER:"ERROR_SOFT_DECODER",ERROR_ASYNC_DECODER:"ERROR_ASYNC_DECODER",TIMEOUT_ASYNC_DECODER:"TIMEOUT_ASYNC_DECODER",ERROR_HARD_DECODER:"ERROR_HARD_DECODER",ERROR_SYSTEM_INIT:"ERROR_SYSTEM_INIT",ERROR_SYSTEM_OBS:"ERROR_SYSTEM_OBS",ERROR_SYSTEM_SECTION:"ERROR_SYSTEM_SECTION"};t.ERROR_CODE=((n={})[i.NETWORK_ERR]=1001,n[i.SOURCE_NOT_FOUND]=1002,n[i.NETWORK_TIMEOUT]=1003,n[i.TYPE_ERR_NOT_IMG]=2001,n[i.TYPE_ERR_CAN_NOT_DECODE]=2002,n[i.TYPE_ERR_HARD_IMG]=2101,n[i.TYPE_ERR_SOFT_IMG]=2201,n[i.MISSING_DECODER]=3001,n[i.ERROR_DECODER]=3002,n[i.ERROR_HARD_DECODER]=3100,n[i.ERROR_SOFT_DECODER]=3200,n[i.ERROR_ASYNC_DECODER]=3201,n[i.TIMEOUT_ASYNC_DECODER]=3202,n[i.ERROR_SYSTEM_INIT]=5001,n[i.ERROR_SYSTEM_OBS]=5002,n[i.ERROR_SYSTEM_SECTION]=5003,n),t.ERROR_PHASE={DECODE:"decode",DOWNLOAD:"download",RENDER:"render"},t.LOAD_STATUS={SUCCESS:"success",FAIL:"fail"},t.LOG_LIFE_MAP={REQUEST_INFO:"REQUEST_INFO",CODEC_INFO:"CODEC_INFO",EDITOR_INFO:"EDITOR_INFO",FILTER_INFO:"FILTER_INFO",RENDER_INFO:"RENDER_INFO",LOG_INFO:"LOG_INFO",BACKUP_PROCESS:"BACKUP_PROCESS"}},function(e,t,r){"use strict";var n=r(3);Component({properties:{src:{type:String},mode:{type:String,value:"scaleToFill"},webp:{type:Boolean,value:!1},lazyLoad:{type:Boolean,value:!1},showMenuByLongpress:{type:Boolean,value:!1}},data:{mainSrc:"",_backupFlag:!1,urls:[],_log:{queue:{}}},lifetimes:{attached:function(){var e=this,t=+new Date,r=n.util.formatSrcList(this.data.src);this.data._log.queue=n.util.formatTiming(t,+new Date,"queue"),n.util.loopRequest(n.requester,r).then((function(t){e.data.mainSrc=t.url,t.res.url=t.url,e.setData({mainSrc:t.url,urls:t.urls}),e.data._log.download=t.res})).catch((function(t){var r=t.url;t.res.url=r,e.data._log.download=t.res;var i=n.Logger.export(e.data._log);e.beforeSendLog(i)}))},ready:function(){},detached:function(){this.data._log={}}},methods:{beforeSendLog:function(e){this.triggerEvent("beforeSendLog",e,{})},bindloadSelf:function(e){this.triggerEvent("bindload",e.detail,{}),this.data._log.decode=n.Logger._formatDecoderTiming(this.data._log.download.timing.download_end,"decode",e.detail);var t=n.Logger._formatRenderTiming(this.data._log.decode.decode_end);this.data._log.render=t,this.data._log.render.applied_image_size=n.Logger._formatImageApplySize(e.detail);var r=n.Logger.export(this.data._log);this.beforeSendLog(r)},binderrorSelf:function(e){var t=this;this.data._log.decode=n.util.formatRenderErrorInfo(e);var r=this.data.urls;if(Array.isArray(r)&&0===r.length){var i=n.Logger.export(this.data._log);return this.beforeSendLog(i),void this.triggerEvent("binderror",e.detail,{})}n.util.loopRequest(n.requester,r).then((function(e){t.data.mainSrc=e.url,e.res.url=e.url,t.setData({mainSrc:e.url,urls:e.urls}),t.data._log.download=e.res})).catch((function(e){var r=e.url;e.res.url=r,t.data._log.download=e.res;var i=n.Logger.export(t.data._log);t.beforeSendLog(i),t.triggerEvent("binderror",e.detail,{})}))}}})},function(e,t,r){"use strict";t.__esModule=!0,t.Logger=t.util=t.requester=void 0;var n=a(r(4)),i=a(r(5)),o=a(r(0));function a(e){return e&&e.__esModule?e:{default:e}}var s=new n.default;t.requester=s,t.util=o.default,t.Logger=i.default},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(1),o=r(0),a=(n=o)&&n.__esModule?n:{default:n};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.info=[],this.main=wx||tt}return e.prototype._formatNetwork=function(e){try{var t=Object.keys(e).map((function(t){return t+":"+e[t]}));this.info.concat(t)}catch(e){}},e.prototype._formatRequest=function(e){var t=null,r=e.statusCode,n=e.errMsg,o=e.header["Content-Length"],a=e.header["Content-Type"],s="",_="",u=e.data;try{s=e.header["X-Response-Cinfo"],_=e.header["x-response-cache"]}catch(t){this.info.push("cdn info not access")}if(this._formatNetwork(e.profile),404===r)return(t=new Error(i.ERROR_MSG.SOURCE_NOT_FOUND)).err_code=i.ERROR_CODE.SOURCE_NOT_FOUND,t.description=n,t.number=r,{code:1,error:t};var d=/^image\//;return d.test(a)?(a=a.replace(d,""),{code:0,httpStatus:r,httpText:n,arrayBuffer:u,fileSize:o||u.byteLength||0,imageType:a,response_cache:_,response_cinfo:s,info:this.info}):((t=new Error(i.ERROR_MSG.TYPE_ERR_NOT_IMG)).number=r,t.description=n,t.err_code=i.ERROR_CODE.TYPE_ERR_NOT_IMG,{code:1,error:t})},e.prototype._formatError=function(e){return"The user aborted a request."===e.message&&(e=Object.assign(e,{err_code:i.ERROR_CODE[i.ERROR_MSG.NETWORK_TIMEOUT],number:100,description:"timeout, SDK abort fetch"})),{code:1,errMsg:e.message,errCode:e.err_code||i.ERROR_CODE[i.ERROR_MSG.NETWORK_ERR],httpStatus:e.number,httpText:e.description,fail_phase:i.ERROR_PHASE.DOWNLOAD,load_status:i.LOAD_STATUS.FAIL,info:this.info}},e.prototype.request=function(e){var t=this,r=+new Date;return new Promise((function(n,i){t.main.request({url:e,responseType:"arraybuffer",success:function(e){var o=t._formatRequest(e);if(0===o.code)o.timing=a.default.formatTiming(r,+new Date,"download"),n(o);else{var s=t._formatError(o.error);s.timing=a.default.formatTiming(r,+new Date,"download"),i(s)}},fail:function(e){var n=t._formatError(e);n.timing=a.default.formatTiming(r,+new Date,"download"),i(n)}})}))},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n},a=r(6);var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.main=function(){return wx||tt},e._formatRenderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"render";return o.default.formatTiming(e,+new Date,t)},e._formatDecoderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decode",r=arguments[2],n=16;(r.width<2e3||r.height<2e3)&&(n=1);var i=Math.min((+new Date-e)%16,n),a=e+i;return o.default.formatTiming(e,a,t)},e._formatImageApplySize=function(e){return e.width+" * "+e.height},e._formatDownload=function(e){var t=e.timing;try{delete e.timing,e.errMsg&&(e.err_desc=e.errMsg),e.errCode&&(e.err_code=e.errCode),e.file_size=e.fileSize,delete e.fileSize,e.image_type=e.imageType,delete e.imageType,e.http_status=e.httpStatus,delete e.httpStatus,delete e.arrayBuffer}catch(t){Array.isArray(e.info)?e.info.push(t.toString()):e.info=[t.toString()]}return Object.assign({},t,e)},e._formatDecode=function(e){return Object.assign({},e)},e._formatRender=function(e){var t=e.timing;return delete e.timing,Object.assign({},t,e)},e._formatProcess=function(e){e.duration=e.queue_duration+e.download_duration+e.decode_duration+e.render_duration,e.uri=e.url,e.domain=o.default.getDomain(e.url)},e._getStorageInfo=function(){return e.main().getStorageInfoSync()},e._save2Storage=function(t){e.main().setStorage({key:t.url,data:t,fail:function(){var t=e._getStorageInfo();console.error("set log fail cur:"+t.currentSize+" limit:"+t.limitSize)}})},e.export=function(t,r){var n=e._formatDownload(t.queue),i=e._formatDownload(t.download),o=e._formatDecode(t.decode),s=e._formatDecode(t.render),_=Object.assign({},a.defaultParams,n,i,o,s);return e._formatProcess(_),e._save2Storage(_),_},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0,t.settingUrl=t.defaultParams=void 0;var n,i=r(7);var o={file_size:0,applied_image_size:"0*0",duration:-1,queue_duration:-1,queue_start:-1,queue_end:-1,download_duration:-1,download_start:-1,download_end:-1,decode_duration:-1,decode_start:-1,decode_end:-1,render_duration:-1,render_start:-1,render_end:-1,timing_time_start:-1,timing_redirect_start:-1,timing_redirect_end:-1,timing_fetch_start:-1,timing_dns_start:-1,timing_dns_end:-1,timing_connect_start:-1,timing_connect_end:-1,timing_request_start:-1,timing_request_end:-1,timing_response_start:-1,timing_response_end:-1,timing_network_duration:-1,timing_connect:-1,timing_dns:-1,timing_send:-1,timing_wait:-1,timing_retry:-1,timing_runtime:-1,image_type:null,image_sdk_version:((n=i)&&n.__esModule?n:{default:n}).default.version,log_id:0,log_type:"image_monitor_v2",image_count:1,load_status:"success",fail_phase:"download",err_code:0,err_desc:"xxx",http_status:0,timestamp:0,retry_count:0,heic_custom_decoder:0,is_bg:0,device_pixel_ratio:1,department:"",response_sinfo:"",response_cache:"",response_cinfo:"",uri:null};t.defaultParams=o,t.settingUrl={cn:"//imagex-web-settings.volcimagex.net/app/monitor/settings",va:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",sg:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",default:"//imagex-web-settings.volcimagex.net/app/monitor/settings"}},function(e){e.exports=JSON.parse('{"name":"imageXmini","version":"1.0.0","description":"","main":"miniprogram_dist/index.js","scripts":{"dev":"gulp dev --develop --watch","builddev":"gulp watch --develop","build":"gulp && bash buildByetminiAndbundle.sh","movedist2dev":"bash ","dist":"npm run build","clean-dev":"gulp clean --develop","clean":"gulp clean","test":"jest --bail","test-debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --bail","coverage":"jest ./test/* --coverage --bail","lint":"eslint \\"src/**/*.js\\" --fix","lint-tools":"eslint \\"tools/**/*.js\\" --rule \\"import/no-extraneous-dependencies: false\\" --fix"},"miniprogram":"miniprogram_dist","jest":{"testEnvironment":"jsdom","testURL":"https://jest.test","collectCoverageFrom":["miniprogram_dist/**/*.js"],"moduleDirectories":["node_modules","miniprogram_dist"]},"repository":{"type":"git","url":""},"author":"tuqiang","license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^2.28.0","@typescript-eslint/parser":"^2.28.0","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-module-resolver":"^3.2.0","babel-preset-env":"^1.7.0","colors":"^1.3.1","eslint":"^5.14.1","eslint-config-airbnb-base":"13.1.0","eslint-loader":"^2.1.2","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^3.8.0","gulp":"^4.0.0","gulp-clean":"^0.4.0","gulp-if":"^2.0.2","gulp-install":"^1.1.0","gulp-less":"^4.0.1","gulp-rename":"^1.4.0","gulp-sourcemaps":"^2.6.5","jest":"^23.5.0","miniprogram-api-typings":"^2.10.3-1","miniprogram-simulate":"^1.2.5","thread-loader":"^2.1.3","through2":"^2.0.3","ts-loader":"^7.0.0","typescript":"^3.8.3","vinyl":"^2.2.0","webpack":"^4.29.5","webpack-node-externals":"^1.7.2"},"dependencies":{}}')}]);
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";t.__esModule=!0;var n=r(1),i={formatTiming:function(e,t,r){var n;return(n={})[r+"_start"]=e,n[r+"_end"]=t,n[r+"_duration"]=t-e,n},mergeObj:function(e,t){return Object.assign({},e,t)},formatRenderErrorInfo:function(e){var t=e.detail;return Object.assign({},{err_desc:t&&t.errMsg||n.ERROR_MSG.ERROR_HARD_DECODER,err_code:n.ERROR_CODE[n.ERROR_MSG.ERROR_HARD_DECODER],code:1,load_status:"fail",fail_phase:n.ERROR_PHASE.DECODE})},getDomain:function(e){var t="",r=e.match(/^(?:\/\/|[^\/]+)*/);return r&&(t=r[0]),t.replace(/http(s|):\/\//,"")},formatSrcList:function(e){return"string"!=typeof e?[]:e.split(",")},loopRequest:function(e,t){var r=void 0;if(!1===Array.isArray(t)||0===t.length)return Promise.reject({url:"",res:{}});var n="";return new Promise((function(i,o){!function a(){var s=t.shift();s?(n=s,e.request(s).then((function(e){i({url:s,res:r=e,urls:t})})).catch((function(e){r=e,a()}))):o({url:n,res:r})}()}))}};t.default=i},function(e,t,r){"use strict";var n;t.__esModule=!0;t.DIVIDER_RECEIVE_IMG="divider_receive_img";var i=t.ERROR_MSG={NETWORK_ERR:"NETWORK_ERR",SOURCE_NOT_FOUND:"SOURCE_NOT_FOUND",NETWORK_TIMEOUT:"NETWORK_TIMEOUT",TYPE_ERR_NOT_IMG:"TYPE_ERR_NOT_IMG",TYPE_ERR_CAN_NOT_DECODE:"TYPE_ERR_CAN_NOT_DECODE",TYPE_ERR_HARD_IMG:"TYPE_ERR_HARD_IMG",TYPE_ERR_SOFT_IMG:"TYPE_ERR_SOFT_IMG",MISSING_DECODER:"MISSING_DECODER",ERROR_DECODER:"ERROR_DECODER",ERROR_SOFT_DECODER:"ERROR_SOFT_DECODER",ERROR_ASYNC_DECODER:"ERROR_ASYNC_DECODER",TIMEOUT_ASYNC_DECODER:"TIMEOUT_ASYNC_DECODER",ERROR_HARD_DECODER:"ERROR_HARD_DECODER",ERROR_SYSTEM_INIT:"ERROR_SYSTEM_INIT",ERROR_SYSTEM_OBS:"ERROR_SYSTEM_OBS",ERROR_SYSTEM_SECTION:"ERROR_SYSTEM_SECTION"};t.ERROR_CODE=((n={})[i.NETWORK_ERR]=1001,n[i.SOURCE_NOT_FOUND]=1002,n[i.NETWORK_TIMEOUT]=1003,n[i.TYPE_ERR_NOT_IMG]=2001,n[i.TYPE_ERR_CAN_NOT_DECODE]=2002,n[i.TYPE_ERR_HARD_IMG]=2101,n[i.TYPE_ERR_SOFT_IMG]=2201,n[i.MISSING_DECODER]=3001,n[i.ERROR_DECODER]=3002,n[i.ERROR_HARD_DECODER]=3100,n[i.ERROR_SOFT_DECODER]=3200,n[i.ERROR_ASYNC_DECODER]=3201,n[i.TIMEOUT_ASYNC_DECODER]=3202,n[i.ERROR_SYSTEM_INIT]=5001,n[i.ERROR_SYSTEM_OBS]=5002,n[i.ERROR_SYSTEM_SECTION]=5003,n),t.ERROR_PHASE={DECODE:"decode",DOWNLOAD:"download",RENDER:"render"},t.LOAD_STATUS={SUCCESS:"success",FAIL:"fail"},t.LOG_LIFE_MAP={REQUEST_INFO:"REQUEST_INFO",CODEC_INFO:"CODEC_INFO",EDITOR_INFO:"EDITOR_INFO",FILTER_INFO:"FILTER_INFO",RENDER_INFO:"RENDER_INFO",LOG_INFO:"LOG_INFO",BACKUP_PROCESS:"BACKUP_PROCESS"}},function(e,t,r){"use strict";var n=r(3);Component({properties:{src:{type:String},mode:{type:String,value:"scaleToFill"},webp:{type:Boolean,value:!1},lazyLoad:{type:Boolean,value:!1},showMenuByLongpress:{type:Boolean,value:!1}},data:{mainSrc:"",_backupFlag:!1,urls:[],_log:{queue:{}}},lifetimes:{attached:function(){var e=this,t=+new Date,r=n.util.formatSrcList(this.data.src);this.data._log.queue=n.util.formatTiming(t,+new Date,"queue"),n.util.loopRequest(n.requester,r).then((function(t){e.data.mainSrc=t.url,t.res.url=t.url,e.setData({mainSrc:t.url,urls:t.urls}),e.data._log.download=t.res})).catch((function(t){var r=t.url;t.res.url=r,e.data._log.download=t.res;var i=n.Logger.export(e.data._log);e.beforeSendLog(i)}))},detached:function(){this.data._log={}}},methods:{beforeSendLog:function(e){this.triggerEvent("beforeSendLog",e,{})},bindloadSelf:function(e){this.triggerEvent("bindload",e.detail,{}),this.data._log.decode=n.Logger._formatDecoderTiming(this.data._log.download.timing.download_end,"decode",e.detail);var t=n.Logger._formatRenderTiming(this.data._log.decode.decode_end);this.data._log.render=t,this.data._log.render.applied_image_size=n.Logger._formatImageApplySize(e.detail);var r=n.Logger.export(this.data._log);this.beforeSendLog(r)},binderrorSelf:function(e){var t=this;this.data._log.decode=n.util.formatRenderErrorInfo(e);var r=this.data.urls;if(Array.isArray(r)&&0===r.length){var i=n.Logger.export(this.data._log);return this.beforeSendLog(i),void this.triggerEvent("binderror",e.detail,{})}n.util.loopRequest(n.requester,r).then((function(e){t.data.mainSrc=e.url,e.res.url=e.url,t.setData({mainSrc:e.url,urls:e.urls}),t.data._log.download=e.res})).catch((function(e){var r=e.url;e.res.url=r,t.data._log.download=e.res;var i=n.Logger.export(t.data._log);t.beforeSendLog(i),t.triggerEvent("binderror",e.detail,{})}))}}})},function(e,t,r){"use strict";t.__esModule=!0,t.Logger=t.util=t.requester=void 0;var n=a(r(4)),i=a(r(5)),o=a(r(0));function a(e){return e&&e.__esModule?e:{default:e}}var s=new n.default;t.requester=s,t.util=o.default,t.Logger=i.default},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(1),o=r(0),a=(n=o)&&n.__esModule?n:{default:n};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.info=[],this.main=wx||tt}return e.prototype._formatNetwork=function(e){try{var t=Object.keys(e).map((function(t){return t+":"+e[t]}));this.info.concat(t)}catch(e){}},e.prototype._formatRequest=function(e){var t=null,r=e.statusCode,n=e.errMsg,o=e.header["Content-Length"],a=e.header["Content-Type"],s="",_="",u=e.data;try{s=e.header["X-Response-Cinfo"],_=e.header["x-response-cache"]}catch(t){this.info.push("cdn info not access")}if(this._formatNetwork(e.profile),404===r)return(t=new Error(i.ERROR_MSG.SOURCE_NOT_FOUND)).err_code=i.ERROR_CODE.SOURCE_NOT_FOUND,t.description=n,t.number=r,{code:1,error:t};var d=/^image\//;return d.test(a)?(a=a.replace(d,""),{code:0,httpStatus:r,httpText:n,arrayBuffer:u,fileSize:o||u.byteLength||0,imageType:a,response_cache:_,response_cinfo:s,info:this.info}):((t=new Error(i.ERROR_MSG.TYPE_ERR_NOT_IMG)).number=r,t.description=n,t.err_code=i.ERROR_CODE.TYPE_ERR_NOT_IMG,{code:1,error:t})},e.prototype._formatError=function(e){return"The user aborted a request."===e.message&&(e=Object.assign(e,{err_code:i.ERROR_CODE[i.ERROR_MSG.NETWORK_TIMEOUT],number:100,description:"timeout, SDK abort fetch"})),{code:1,errMsg:e.message,errCode:e.err_code||i.ERROR_CODE[i.ERROR_MSG.NETWORK_ERR],httpStatus:e.number,httpText:e.description,fail_phase:i.ERROR_PHASE.DOWNLOAD,load_status:i.LOAD_STATUS.FAIL,info:this.info}},e.prototype.request=function(e){var t=this,r=+new Date;return new Promise((function(n,i){t.main.request({url:e,responseType:"arraybuffer",success:function(e){var o=t._formatRequest(e);if(0===o.code)o.timing=a.default.formatTiming(r,+new Date,"download"),n(o);else{var s=t._formatError(o.error);s.timing=a.default.formatTiming(r,+new Date,"download"),i(s)}},fail:function(e){var n=t._formatError(e);n.timing=a.default.formatTiming(r,+new Date,"download"),i(n)}})}))},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0;var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n},a=r(6);var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.main=function(){return wx||tt},e._formatRenderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"render";return o.default.formatTiming(e,+new Date,t)},e._formatDecoderTiming=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decode",r=arguments[2],n=16;(r.width<2e3||r.height<2e3)&&(n=1);var i=Math.min((+new Date-e)%16,n),a=e+i;return o.default.formatTiming(e,a,t)},e._formatImageApplySize=function(e){return e.width+" * "+e.height},e._formatDownload=function(e){var t=e.timing;try{delete e.timing,e.errMsg&&(e.err_desc=e.errMsg),e.errCode&&(e.err_code=e.errCode),e.file_size=e.fileSize,delete e.fileSize,e.image_type=e.imageType,delete e.imageType,e.http_status=e.httpStatus,delete e.httpStatus,delete e.arrayBuffer}catch(t){Array.isArray(e.info)?e.info.push(t.toString()):e.info=[t.toString()]}return Object.assign({},t,e)},e._formatDecode=function(e){return Object.assign({},e)},e._formatRender=function(e){var t=e.timing;return delete e.timing,Object.assign({},t,e)},e._formatProcess=function(e){e.duration=e.queue_duration+e.download_duration+e.decode_duration+e.render_duration,e.uri=e.url,e.domain=o.default.getDomain(e.url)},e._getStorageInfo=function(){return e.main().getStorageInfoSync()},e._save2Storage=function(t){e.main().setStorage({key:t.url,data:t,fail:function(){var t=e._getStorageInfo();console.error("set log fail cur:"+t.currentSize+" limit:"+t.limitSize)}})},e.export=function(t,r){var n=e._formatDownload(t.queue),i=e._formatDownload(t.download),o=e._formatDecode(t.decode),s=e._formatDecode(t.render),_=Object.assign({},a.defaultParams,n,i,o,s);return e._formatProcess(_),e._save2Storage(_),_},e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0,t.settingUrl=t.defaultParams=void 0;var n,i=r(7);var o={file_size:0,applied_image_size:"0*0",duration:-1,queue_duration:-1,queue_start:-1,queue_end:-1,download_duration:-1,download_start:-1,download_end:-1,decode_duration:-1,decode_start:-1,decode_end:-1,render_duration:-1,render_start:-1,render_end:-1,timing_time_start:-1,timing_redirect_start:-1,timing_redirect_end:-1,timing_fetch_start:-1,timing_dns_start:-1,timing_dns_end:-1,timing_connect_start:-1,timing_connect_end:-1,timing_request_start:-1,timing_request_end:-1,timing_response_start:-1,timing_response_end:-1,timing_network_duration:-1,timing_connect:-1,timing_dns:-1,timing_send:-1,timing_wait:-1,timing_retry:-1,timing_runtime:-1,image_type:null,image_sdk_version:((n=i)&&n.__esModule?n:{default:n}).default.version,log_id:0,log_type:"image_monitor_v2",image_count:1,load_status:"success",fail_phase:"download",err_code:0,err_desc:"xxx",http_status:0,timestamp:0,retry_count:0,heic_custom_decoder:0,is_bg:0,device_pixel_ratio:1,department:"",response_sinfo:"",response_cache:"",response_cinfo:"",uri:null};t.defaultParams=o,t.settingUrl={cn:"//imagex-web-settings.volcimagex.net/app/monitor/settings",va:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",sg:"https://imagex-web-settings.volcimagex.net/app/monitor/settings",default:"//imagex-web-settings.volcimagex.net/app/monitor/settings"}},function(e){e.exports=JSON.parse('{"name":"image-observer-mini","version":"1.0.1","description":"","main":"dist/wechat/index.js","scripts":{"dev":"gulp dev --develop --watch","builddev":"gulp watch --develop","build":"gulp && bash buildByetminiAndbundle.sh","movedist2dev":"bash ","dist":"npm run build","clean-dev":"gulp clean --develop","clean":"gulp clean","test":"jest --bail","test-debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --bail","coverage":"jest ./test/* --coverage --bail","lint":"eslint \\"src/**/*.js\\" --fix","lint-tools":"eslint \\"tools/**/*.js\\" --rule \\"import/no-extraneous-dependencies: false\\" --fix"},"miniprogram":"miniprogram_dist","jest":{"testEnvironment":"jsdom","testURL":"https://jest.test","collectCoverageFrom":["miniprogram_dist/**/*.js"],"moduleDirectories":["node_modules","miniprogram_dist"]},"repository":{"type":"git","url":""},"author":"tuqiang","license":"MIT","devDependencies":{"@typescript-eslint/eslint-plugin":"^2.28.0","@typescript-eslint/parser":"^2.28.0","babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-module-resolver":"^3.2.0","babel-preset-env":"^1.7.0","colors":"^1.3.1","eslint":"^5.14.1","eslint-config-airbnb-base":"13.1.0","eslint-loader":"^2.1.2","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^3.8.0","gulp":"^4.0.0","gulp-clean":"^0.4.0","gulp-if":"^2.0.2","gulp-install":"^1.1.0","gulp-less":"^4.0.1","gulp-rename":"^1.4.0","gulp-sourcemaps":"^2.6.5","jest":"^23.5.0","miniprogram-api-typings":"^2.10.3-1","miniprogram-simulate":"^1.2.5","thread-loader":"^2.1.3","through2":"^2.0.3","ts-loader":"^7.0.0","typescript":"^3.8.3","vinyl":"^2.2.0","webpack":"^4.29.5","webpack-node-externals":"^1.7.2"},"dependencies":{}}')}]);
{
"name": "image-observer-mini",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/wechat/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc