forked from tandibar/ng-rollbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng-rollbar.min.js
7 lines (7 loc) · 4.65 KB
/
ng-rollbar.min.js
1
2
3
4
5
6
7
/**
* @license ng-rollbar 0.3.1 (06-08-2015)
* (c) 2015 IdentPro GmbH
* License: MIT
*/
!function(a){a.module("tandibar/ng-rollbar",[]),a.module("tandibar/ng-rollbar").config(["$provide",function(a){a.decorator("$exceptionHandler",["$delegate","$window",function(a,b){return function(c,d){b.Rollbar&&b.Rollbar.error(c,{cause:d}),a(c,d)}}])}]),a.module("tandibar/ng-rollbar").provider("Rollbar",function(){function a(a){return{Rollbar:a.Rollbar,configure:a.Rollbar.configure,critical:a.Rollbar.critical,error:a.Rollbar.error,warning:a.Rollbar.warning,info:a.Rollbar.info,debug:a.Rollbar.debug,scope:a.Rollbar.scope,verbose:function(b){void 0===b&&(b=!0),a.Rollbar.configure({verbose:b})},enable:function(){a.Rollbar.configure({enabled:!0})},disable:function(){a.Rollbar.configure({enabled:!1})}}}this.init=function(a){var b=a;!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,c,d){"use strict";var e=d(1).Rollbar,f=d(2),g="https://d37gvrvc0wt4s1.cloudfront.net/js/v1.4/rollbar.min.js";b.rollbarJsUrl=b.rollbarJsUrl||g;var h=e.init(window,b),i=f(h,b);h.loadFull(window,document,!1,b,i)},function(a){"use strict";function b(){var a=window.console;a&&"function"==typeof a.log&&a.log.apply(a,arguments)}function c(a){this.shimId=++h,this.notifier=null,this.parentShim=a,this.logger=b,this._rollbarOldOnError=null}function d(a,b,c){window._rollbarWrappedError&&(c[4]||(c[4]=window._rollbarWrappedError),c[5]||(c[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),a.uncaughtError.apply(a,c),b&&b.apply(window,c)}function e(a){var b=c;return g(function(){if(this.notifier)return this.notifier[a].apply(this.notifier,arguments);var c=this,d="scope"===a;d&&(c=new b(this));var e=Array.prototype.slice.call(arguments,0),f={shim:c,method:a,args:e,ts:new Date};return window._rollbarShimQueue.push(f),d?c:void 0})}function f(a,b){if(b.hasOwnProperty&&b.hasOwnProperty("addEventListener")){var c=b.addEventListener;b.addEventListener=function(b,d,e){c.call(this,b,a.wrap(d),e)};var d=b.removeEventListener;b.removeEventListener=function(a,b,c){d.call(this,a,b&&b._wrapped?b._wrapped:b,c)}}}function g(a,c){return c=c||b,function(){try{return a.apply(this,arguments)}catch(b){c("Rollbar internal error:",b)}}}var h=0;c.init=function(a,b){var e=b.globalAlias||"Rollbar";if("object"==typeof a[e])return a[e];a._rollbarShimQueue=[],a._rollbarWrappedError=null,b=b||{};var h=new c;return g(function(){if(h.configure(b),b.captureUncaught){h._rollbarOldOnError=a.onerror,a.onerror=function(){var a=Array.prototype.slice.call(arguments,0);d(h,h._rollbarOldOnError,a)};var c,g,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(c=0;c<i.length;++c)g=i[c],a[g]&&a[g].prototype&&f(h,a[g].prototype)}return a[e]=h,h},h.logger)()},c.prototype.loadFull=function(a,b,c,d,e){var f=function(){var b;if(void 0===a._rollbarPayloadQueue){var c,d,f,g;for(b=new Error("rollbar.js did not load");c=a._rollbarShimQueue.shift();)for(f=c.args,g=0;g<f.length;++g)if(d=f[g],"function"==typeof d){d(b);break}}"function"==typeof e&&e(b)},h=b.createElement("script"),i=b.getElementsByTagName("script")[0];h.src=d.rollbarJsUrl,h.async=!c,h.onload=g(f,this.logger),i.parentNode.insertBefore(h,i)},c.prototype.wrap=function(a,b){try{var c;if(c="function"==typeof b?b:function(){return b||{}},"function"!=typeof a)return a;if(a._isWrap)return a;if(!a._wrapped){a._wrapped=function(){try{return a.apply(this,arguments)}catch(b){throw b._rollbarContext=c()||{},b._rollbarContext._wrappedSource=a.toString(),window._rollbarWrappedError=b,b}},a._wrapped._isWrap=!0;for(var d in a)a.hasOwnProperty(d)&&(a._wrapped[d]=a[d])}return a._wrapped}catch(e){return a}};for(var i="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),j=0;j<i.length;++j)c.prototype[i[j]]=e(i[j]);a.exports={Rollbar:c,_rollbarWindowOnError:d}},function(a){"use strict";a.exports=function(a,b){return function(c){if(!c&&!window._rollbarInitialized){var d=window.RollbarNotifier,e=b||{},f=e.globalAlias||"Rollbar",g=window.Rollbar.init(e,a);g._processShimQueue(window._rollbarShimQueue||[]),window[f]=g,window._rollbarInitialized=!0,d.processPayloads()}}}}])},a.$inject=["$window"],this.$get=a})}(angular);
//# sourceMappingURL=ng-rollbar.min.js.map