Onionr/static-data/www/shared/node_modules/pnotify/dist/iife/PNotifyNonBlock.js
2019-09-23 17:56:05 -05:00

2 lines
2.8 KiB
JavaScript

var _typeof="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},_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},PNotifyNonBlock=function(e){"use strict";e=e&&e.__esModule?e.default:e;var n;function t(t){!function(t,e){t._handlers=i(),t._slots=i(),t._bind=e._bind,t._staged={},t.options=e,t.root=e.root||t,t.store=e.store||t.root.store,e.root||(t._beforecreate=[],t._oncreate=[],t._aftercreate=[])}(this,t),this._state=s(_extends({_notice:null,_options:{}},e.modules.NonBlock.defaults),t.data),this._intro=!0,this._fragment=(this._state,{c:o,m:o,p:o,d:o}),t.target&&(this._fragment.c(),this._mount(t.target,t.anchor))}function o(){}function s(t,e){for(var n in e)t[n]=e[n];return t}function i(){return Object.create(null)}function r(t){for(;t&&t.length;)t.shift()()}return s(t.prototype,{destroy:function(t){this.destroy=o,this.fire("destroy"),this.set=o,this._fragment.d(!1!==t),this._fragment=null,this._state={}},get:function(){return this._state},fire:function(t,e){var n=t in this._handlers&&this._handlers[t].slice();if(!n)return;for(var o=0;o<n.length;o+=1){var i=n[o];if(!i.__calling)try{i.__calling=!0,i.call(this,e)}finally{i.__calling=!1}}},on:function(t,e){var n=this._handlers[t]||(this._handlers[t]=[]);return n.push(e),{cancel:function(){var t=n.indexOf(e);~t&&n.splice(t,1)}}},set:function(t){if(this._set(s({},t)),this.root._lock)return;!function(t){t._lock=!0,r(t._beforecreate),r(t._oncreate),r(t._aftercreate),t._lock=!1}(this.root)},_set:function(t){var e=this._state,n={},o=!1;for(var i in t=s(this._staged,t),this._staged={},t)this._differs(t[i],e[i])&&(n[i]=o=!0);if(!o)return;this._state=s(s({},e),t),this._recompute(n,this._state),this._bind&&this._bind(n,this._state);this._fragment&&(this.fire("state",{changed:n,current:this._state,previous:e}),this._fragment.p(n,this._state),this.fire("update",{changed:n,current:this._state,previous:e}))},_stage:function(t){s(this._staged,t)},_mount:function(t,e){this._fragment[this._fragment.i?"i":"m"](t,e||null)},_differs:function(t,e){return t!=t?e==e:t!==e||t&&"object"===(void 0===t?"undefined":_typeof(t))||"function"==typeof t}}),s(t.prototype,{initModule:function(t){this.set(t),this.doNonBlockClass()},update:function(){this.doNonBlockClass()},doNonBlockClass:function(){this.get().nonblock?this.get()._notice.addModuleClass("nonblock"):this.get()._notice.removeModuleClass("nonblock")}}),t.prototype._recompute=o,(n=t).key="NonBlock",n.defaults={nonblock:!1},n.init=function(t){return new n({target:document.body,data:{_notice:t}})},e.modules.NonBlock=n,t}(PNotify);
//# sourceMappingURL=PNotifyNonBlock.js.map