fundebug.1.6.0.min.js 16 KB

1
  1. var a0_0x5ebc=["networkType","__esModule","silentApp","forEach","callback","belong","url","sendToFundebug","has","symbol","name","prototype","function","http","onHide","notifierUrl","monitorMethodArguments","onLoad","indexOf","defineProperty","silent","options","metaData","type","getSystemInfo","silentConsole","onReady","exports","getEvent","silentBehavior","push","args","elapsedTime","entries","path","userInfo","iterator","default","silentHttpHeader","methodWhitelist","error","add","onShow","string","time","apply"];(function(t,e){var n=function(e){while(--e){t["push"](t["shift"]())}};n(++e)})(a0_0x5ebc,479);var a0_0x45d8=function(e,t){e=e-0;var n=a0_0x5ebc[e];return n};module["exports"]=function(n){var r={};function i(e){if(r[e])return r[e]["exports"];var t=r[e]={i:e,l:!1,exports:{}};return n[e]["call"](t["exports"],t,t["exports"],i),t["l"]=!0,t["exports"]}return i["m"]=n,i["c"]=r,i["d"]=function(e,t,n){var r={};r["enumerable"]=!0;r["get"]=n;i["o"](e,t)||Object["defineProperty"](e,t,r)},i["r"]=function(e){var t={};t["value"]="Module";var n={};n["value"]=!0;"undefined"!=typeof Symbol&&Symbol["toStringTag"]&&Object["defineProperty"](e,Symbol["toStringTag"],t),Object[a0_0x45d8("0x0")](e,"__esModule",n)},i["t"]=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t[a0_0x45d8("0x1c")])return t;var n=Object["create"](null);var r={};r["enumerable"]=!0;r["value"]=t;if(i["r"](n),Object["defineProperty"](n,"default",r),2&e&&"string"!=typeof t)for(var o in t)i["d"](n,o,function(e){return t[e]}["bind"](null,o));return n},i["n"]=function(e){var t=e&&e["__esModule"]?function(){return e[a0_0x45d8("0x12")]}:function(){return e};return i["d"](t,"a",t),t},i["o"]=function(e,t){return Object["prototype"]["hasOwnProperty"]["call"](e,t)},i["p"]="",i(i["s"]=0)}([function(e,t,n){var r=n(1),o=n(11),i=n(12),a=n(13),u=n(14),c=n(15),s={},f=[],l={};s["init"]=r(l,f,s),s["test"]=o(l,f,s),s["notify"]=i(l,f,s),s["notifyError"]=a(l,f,s),s["notifyHttpError"]=u(l,f,s),s["set"]=c(l,f,s),e["exports"]=s},function(e,t,n){function o(e){;"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol["iterator"]?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e["constructor"]===Symbol&&e!==Symbol["prototype"]?"symbol":typeof e})(e)}var i=n(2),a=n(8),u=n(9),c=n(10),s=n(7),f=!1;e["exports"]=function(n,e,r){return function(t){if(f=!0,t&&"object"===o(t)){["apikey","appVersion","releaseStage","metaData","filters","silent",a0_0x45d8("0x13"),"monitorHttpData","httpTimeout","monitorMethodCall","monitorMethodArguments","methodWhitelist","setUserInfo","sampleRate",a0_0x45d8("0xa"),a0_0x45d8("0x1d"),"silentPage",a0_0x45d8("0x1f"),a0_0x45d8("0x2a"),"silentInject","silentConsole","monitorConsoleError","monitorResponse"]["forEach"](function(e){n[e]=t[e]}),t["notifierUrl"]||(n["notifierUrl"]="https://fundebug.com/wxjs/"),t[a0_0x45d8("0x6")]||t[a0_0x45d8("0xa")]||u(n,e,r),t["silentInject"]||t["silent"]||(i(n,e,r),a(n,e),t["silentHttp"]||c(n,e,r)),s["getNetworkType"](),t["setSystemInfo"]&&s["getSystemInfo"](),t["setLocation"]&&s["getLocation"]()}}},setTimeout(function(){!1===f&&console["error"]("请使用fundebug.init(https://docs.fundebug.com/notifier/wxjs/api/init.html)配置apikey!")},1e3)},function(e,t,n){var i=n(3),u=n(4),c=n(7);e["exports"]=function(r,o,n){var e={};e["onLaunch"]=function(e){r["scene"]=e&&e["scene"];var t={};t["type"]="function";t["time"]=(new Date)["getTime"]();t["belong"]="App";t["method"]="onLaunch";t["path"]=e&&e["path"];t["query"]=e&&e["query"];t["scene"]=e&&e["scene"];var n=t;i["captureBreadcrumb"](o,n,r["silentBehavior"])};e["onShow"]=function(e){r["scene"]=e&&e["scene"];var t={};t["type"]="function";t["time"]=(new Date)["getTime"]();t["belong"]="App";t["method"]=a0_0x45d8("0x17");t["path"]=e&&e[a0_0x45d8("0xf")];t["query"]=e&&e["query"];t["scene"]=e&&e["scene"];var n=t;i["captureBreadcrumb"](o,n,r["silentBehavior"])};e["onHide"]=function(){var e={};e["type"]="function";e[a0_0x45d8("0x19")]=(new Date)["getTime"]();e["belong"]="App";e["method"]="onHide";e["route"]=r["currentPage"]&&r["currentPage"]["route"];e["options"]=r["currentPage"]&&r["currentPage"][a0_0x45d8("0x2")];var t=e;i["captureBreadcrumb"](o,t,r["silentBehavior"])};e["onError"]=function(e){if(e){var t=c["getEvent"](r,o,n);t["error"]=e,t["type"]="uncaught",u[a0_0x45d8("0x22")](t,r)}};var a=e,t=App;App=function(i){Object["keys"](a)[a0_0x45d8("0x1e")](function(e){var t,n,r,o;r=a[n=e],o=(t=i)[n],t[n]=function(){try{r["apply"](this,arguments)}catch(e){console["error"](e)}return o&&o["apply"](this,arguments)}}),t(i)}}},function(e,t){t["captureBreadcrumb"]=function(e,t,n){n||(e[a0_0x45d8("0xb")](t),20<e["length"]&&e["shift"]())},t["getCurrentPage"]=function(){var e=getCurrentPages();if(e["length"])return e[e["length"]-1]},t["isSampled"]=function(e){return!e&&0!==e||(e=parseFloat(e),!!isNaN(e)||Math["random"]()<=e)}},function(e,t,n){var r=n(5),o=n(3),i=n(6),a=50,u=5;t["sendToFundebug"]=function(e,t){if(!t["silent"]&&(e["metaData"]=i["copyWithoutCircle"](e[a0_0x45d8("0x3")]),function(e){if(!e["apikey"])return void console["error"]("请使用fundebug.init(https://docs.fundebug.com/notifier/wxjs/api/init.html)配置apikey!");return!(!a||!u||(a--,u--,0))}(e))){if(t[a0_0x45d8("0x1f")]&&a0_0x45d8("0x27")==typeof t["callback"]){var n=Object["assign"]({},e);delete n["breadcrumbs"],t["callback"](n)}r["isFiltered"](e,t["filters"])||o["isSampled"](t["sampleRate"])&&wx["request"]({url:t[a0_0x45d8("0x2a")],method:"POST",data:e,complete:function(){u++}})}}},function(e,t){function r(e,t){if(!e)return!1;if(!t)return!1;if(Object["keys"]&&!Object["keys"](t)["length"])return!1;for(var n in t)if(t["hasOwnProperty"](n))if(t[n]["constructor"]===RegExp){if(!t[n]["test"](e[n]))return!1}else if(t[n]["constructor"]===Object){if(!r(e[n],t[n]))return!1}else{if(t[n]["constructor"]!==String||"inexistence"!==t[n])return!1;if(e["hasOwnProperty"](n))return!1}return!0}t["isFiltered"]=function(e,t){if(!t||!t["length"])return!1;for(var n=0;n<t["length"];n++)if(r(e,t[n]))return!0;return!1}},function(e,t){function u(e,t){return function(e){if(Array["isArray"](e))return e}(e)||function(e,t){if(!(Symbol[a0_0x45d8("0x11")]in Object(e)||"[object Arguments]"===Object["prototype"]["toString"]["call"](e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol["iterator"]]();!(r=(a=u["next"]())["done"])&&(n["push"](a["value"]),!t||n["length"]!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u["return"]||u["return"]()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function c(e){;"@babel/helpers - typeof";return(c="function"==typeof Symbol&&"symbol"==typeof Symbol["iterator"]?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e["constructor"]===Symbol&&e!==Symbol["prototype"]?"symbol":typeof e})(e)}var n=!1;try{var r=wx["getSystemInfoSync"]();if("ios"===r["platform"])parseInt(r["system"]["match"](/iOS (\d+)\./)[1])<11&&(n=!0)}catch(e){console["error"](e)}t["copyWithoutCircle"]=function(e){return e&&"object"===c(e)&&function(e){try{JSON["stringify"](e)}catch(e){return-1!==e["message"]["indexOf"]("Converting circular structure to JSON")||-1!==e["message"][a0_0x45d8("0x2d")]("JSON.stringify cannot serialize cyclic structures")}return!1}(e)?n?{}:function o(t,i){try{var a={};return Object[a0_0x45d8("0xe")](t)["forEach"](function(e){var t=u(e,2),n=t[0],r=t[1];"object"===c(r)&&null!==r?i[a0_0x45d8("0x23")](r)?a[n]="property removed because of circular structure":10<i["size"]?a[n]="property removed to avoid deep recursion":(i[a0_0x45d8("0x16")](r),a[n]=o(r,i)):a[n]=r}),a}catch(e){return t}}(e,new Set([e])):e}},function(e,t,n){var r={};r["notifierVersion"]="1.6.0";var o=n(3),i=n(6),a=r;t[a0_0x45d8("0x9")]=function(e,t,n){return a["scene"]=e["scene"],a["apikey"]=e["apikey"],a["appVersion"]=e["appVersion"],a["releaseStage"]=e["releaseStage"],a["metaData"]=n["metaData"]||e[a0_0x45d8("0x3")],a["breadcrumbs"]=t,a[a0_0x45d8("0x19")]=(new Date)["getTime"](),e["silentApp"]||(a["App"]=i["copyWithoutCircle"](getApp())),e["silentPage"]||(a["Page"]=i["copyWithoutCircle"](o["getCurrentPage"]())),a["userInfo"]||(n["userInfo"]?a["userInfo"]=n["userInfo"]:e["setUserInfo"]&&wx["getUserInfo"]({success:function(e){a["userInfo"]=e[a0_0x45d8("0x10")]}})),a},t["getNetworkType"]=function(){var e={};e["success"]=function(e){a["networkType"]=e[a0_0x45d8("0x1b")]};wx["getNetworkType"](e)},t[a0_0x45d8("0x5")]=function(){var e={};e["success"]=function(e){a["systemInfo"]=e};wx["getSystemInfo"](e)},t["getLocation"]=function(){var e={};e["type"]="wgs84";e["success"]=function(e){a["locationInfo"]=e};wx["getLocation"](e)}},function(e,t,n){var c=n(3);e["exports"]=function(o,i){var a=["onLoad","onShow",a0_0x45d8("0x7"),a0_0x45d8("0x29"),"onUnload","onPullDownRefresh","onReachBottom","onShareAppMessage"];function n(e,n){var r=e[n];e[n]=function(){try{"onLoad"!==n&&"onShow"!==n||(o["currentPage"]=c["getCurrentPage"]());var e={};e["type"]="function";e["time"]=(new Date)["getTime"]();e[a0_0x45d8("0x20")]="Page";e["method"]=n;e["route"]=o["currentPage"]&&o["currentPage"]["route"];e["options"]=o["currentPage"]&&o["currentPage"]["options"];var t=e;a0_0x45d8("0x2c")===n&&(t["args"]=arguments),o["monitorMethodArguments"]&&!u(a,n)&&(t[a0_0x45d8("0xc")]=arguments),function(e){var t=o["methodWhitelist"],n=o["methodBlacklist"];if("onPageScroll"===e)return!1;return t&&t["length"]?Boolean(u(t,e)):!n||!n["length"]||Boolean(!u(n,e))}(n)&&c["captureBreadcrumb"](i,t,o["silentBehavior"])}catch(e){console["error"](e)}return r&&r["apply"](this,arguments)}}var e=Page;function u(e,t){for(var n=0;n<e["length"];n++)if(e[n]===t)return!0;return!1}Page=function(t){a["forEach"](function(e){t[e]&&n(t,e)}),o["monitorMethodCall"]&&Object["keys"](t)["forEach"](function(e){"function"!=typeof t[e]||u(a,e)||n(t,e)}),e(t)}}},function(e,t,n){var s=n(3),f=n(6),l=n(4),p=n(7);e["exports"]=function(a,u,c){["log","error","info","warn"]["forEach"](function(e){var o,i;o=e,i=console[o],console[o]=function(){try{var e={};e["type"]="console";e["time"]=(new Date)["getTime"]();e["method"]=o;e["args"]=f["copyWithoutCircle"](arguments);var t=e;s["captureBreadcrumb"](u,t)}catch(e){console["error"](e)}if(a0_0x45d8("0x15")===o&&arguments[0]&&/^\[non-writable\] modification of global variable ".+" is not allowed when using plugins at app\.json\.$/["test"](arguments[0]))i&&i[a0_0x45d8("0x1a")](this,arguments),console["error"]("当使用小程序插件时,微信禁止Fundebug重写App/Page/wx等全局变量,请使用fundebug.init将silentInject(https://docs.fundebug.com/notifier/wxjs/customize/silentinject.html)设为true,并使用fundebug.notifyError(https://docs.fundebug.com/notifier/wxjs/api/notifyerror.html)上报onError捕获的错误。详情请查看Fundebug文档(https://docs.fundebug.com/notifier/wxjs/other/non_writable.html)");else{if(a["monitorConsoleError"]&&arguments[0]){var n=p["getEvent"](a,u,c),r=arguments[0]["stack"];"{}"!=r&&""!=r&&null!=r&&(n["error"]=r,n["type"]="consoleError",l["sendToFundebug"](n,a))}i&&i["apply"](this,arguments)}}})}},function(e,t,n){var s=n(3),f=n(4),l=n(7);e[a0_0x45d8("0x8")]=function(a,u,c){var e=Object["assign"]({},wx),n=e["request"];function r(r,e,o){var i=r[e];r[e]=function(){try{var e=arguments[0],t=function(e){var t={};t["url"]=e["url"];t["data"]=e["data"];t["header"]=e["header"];t["method"]=e["method"];t["dataType"]=e["dataType"];t["responseType"]=e["responseType"];var n=t;a["silentHttpHeader"]&&delete n["header"];a["monitorHttpData"]||delete n["data"];return n}(r),n=(new Date)["getTime"]()-o;!function(e,t,n){if(function(e,t){if(!/^2\d\d$/["test"](e))return!0;var n=a["httpTimeout"];if("number"==typeof n&&n<t)return!0;return!1}(t["statusCode"],n)){var r=l[a0_0x45d8("0x9")](a,u,c);r["type"]="httpError",r["req"]=e,a["monitorResponse"]&&(r["res"]=t),r[a0_0x45d8("0xd")]=n,f["sendToFundebug"](r,a)}}(t,e,n),function(e,t,n,r){var o={};o["type"]=a0_0x45d8("0x28");o["time"]=n;o["req"]=e;o["elapsedTime"]=r;var i=o;a["monitorResponse"]&&(i["res"]=t);s["captureBreadcrumb"](u,i,a["silentBehavior"])}(t,e,o,n)}catch(e){console["error"](e)}return i&&i["apply"](this,arguments)}}Object["defineProperty"](e,"request",{writable:!0,enumerable:!0,configurable:!0,value:function(e){try{if(e&&!/fundebug\.com/["test"](e[a0_0x45d8("0x21")])){var t=(new Date)["getTime"]();r(e,"success",t),r(e,"fail",t)}}catch(e){console["error"](e)}return n(e)}}),wx=e}},function(e,t,n){var a=n(4),u=n(7);e["exports"]=function(r,o,i){return function(e,t){try{if(r["silent"])return;if(e&&"string"!=typeof e)return void console["error"]("fundebug.test()的name参数类型必须为string!");if(t&&"string"!=typeof t)return void console[a0_0x45d8("0x15")]("fundebug.test()的message参数类型必须为string!");var n=u["getEvent"](r,o,i);n["type"]="test",n["name"]=e||"Test",n["message"]=t||"Hello, Fundebug!",a["sendToFundebug"](n,r)}catch(e){console[a0_0x45d8("0x15")](e)}}}},function(e,t,n){function u(e){;"@babel/helpers - typeof";return(u="function"==typeof Symbol&&"symbol"==typeof Symbol["iterator"]?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e["constructor"]===Symbol&&e!==Symbol["prototype"]?"symbol":typeof e})(e)}var c=n(4),s=n(7);e["exports"]=function(o,i,a){return function(e,t,n){try{if(o[a0_0x45d8("0x1")])return;if(!e)return void console["error"]("fundebug.notify()必须指定name参数!");if("string"!=typeof e)return void console["error"]("fundebug.notify()的name参数类型必须为string!");if(t&&a0_0x45d8("0x18")!=typeof t)return void console["error"]("fundebug.notify()的message参数类型必须为string!");if(n&&"object"!==u(n))return void console["error"]("fundebug.notify()的option参数类型必须为object!");var r=s["getEvent"](o,i,a);r["type"]="notification",r["name"]=e,r["message"]=t,n&&n["metaData"]&&(r["metaData"]=n["metaData"]),c["sendToFundebug"](r,o)}catch(e){console["error"](e)}}}},function(e,t,n){function a(e){;"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol["iterator"]?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e["constructor"]===Symbol&&e!==Symbol["prototype"]?"symbol":typeof e})(e)}var u=n(4),c=n(7);e["exports"]=function(r,o,i){return function(e,t){try{if(r["silent"])return;if(!e)return void console["error"]("fundebug.notifyError()必须指定error参数!");if(t&&"object"!==a(t))return void console["error"]("fundebug.notifyError()的option参数类型必须为object!");var n=c["getEvent"](r,o,i);e instanceof Error?n["error"]={name:e[a0_0x45d8("0x25")],message:e["message"],stack:e["stack"]}:n["error"]=e,n[a0_0x45d8("0x4")]="caught",t&&(t["name"]&&(n["name"]=t["name"]),t["metaData"]&&(n["metaData"]=t["metaData"])),u["sendToFundebug"](n,r)}catch(e){console["error"](e)}}}},function(e,t,n){function u(e){;"@babel/helpers - typeof";return(u="function"==typeof Symbol&&"symbol"==typeof Symbol["iterator"]?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e["constructor"]===Symbol&&e!==Symbol["prototype"]?"symbol":typeof e})(e)}var c=n(4),s=n(7);e["exports"]=function(o,i,a){return function(e,t,n){try{if(o["silent"])return;if(!e)return void console["error"]("fundebug.notifyHttpError()必须指定req参数!");if(!t)return void console["error"]("fundebug.notifyHttpError()必须指定res参数!");if(e&&"object"!==u(e))return void console["error"]("fundebug.notifyHttpError()的req参数类型必须为object!");if(t&&"object"!==u(t))return void console[a0_0x45d8("0x15")]("fundebug.notifyHttpError()的res参数类型必须为object!");if(n&&"object"!==u(n))return void console[a0_0x45d8("0x15")]("fundebug.notifyHttpError()的option参数类型必须为object!");var r=s["getEvent"](o,i,a);r["type"]="httpError",r["req"]=e,r["res"]=t,n&&n["metaData"]&&(r["metaData"]=n["metaData"]),c["sendToFundebug"](r,o)}catch(e){console["error"](e)}}}},function(e,t){function r(e){;"@babel/helpers - typeof";return(r="function"==typeof Symbol&&a0_0x45d8("0x24")==typeof Symbol["iterator"]?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e["constructor"]===Symbol&&e!==Symbol[a0_0x45d8("0x26")]?"symbol":typeof e})(e)}e[a0_0x45d8("0x8")]=function(n,e,t){return function(t){if(t&&"object"===r(t)){["appVersion","releaseStage","metaData","filters","silent",a0_0x45d8("0x13"),"monitorHttpData","httpTimeout","monitorMethodCall",a0_0x45d8("0x2b"),a0_0x45d8("0x14"),"setUserInfo","sampleRate","silentBehavior","silentApp","silentPage","callback","silentResponse","monitorConsoleError","monitorResponse"]["forEach"](function(e){null!=t[e]&&(n[e]=t[e])})}}}}]);