Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
14 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. (function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(exports):typeof define==='function'&&define.amd?define(['exports'],factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,factory(global.PNotifyCountdown={}));}(this,(function(exports){'use strict';function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function(obj){return typeof obj;};}else{_typeof=function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}
  2. return _typeof(obj);}
  3. function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
  4. function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}
  5. function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}
  6. function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}
  7. subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass);}
  8. function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}
  9. function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}
  10. function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true;}catch(e){return false;}}
  11. function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}
  12. return self;}
  13. function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}
  14. return _assertThisInitialized(self);}
  15. function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}
  16. return _possibleConstructorReturn(this,result);};}
  17. function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}
  18. function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}
  19. function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}
  20. function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}
  21. function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&Symbol.iterator in Object(iter))return Array.from(iter);}
  22. function _iterableToArrayLimit(arr,i){if(typeof Symbol==="undefined"||!(Symbol.iterator in Object(arr)))return;var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}
  23. return _arr;}
  24. function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}
  25. function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2;}
  26. function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
  27. function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}
  28. function noop(){}
  29. function run(fn){return fn();}
  30. function blank_object(){return Object.create(null);}
  31. function run_all(fns){fns.forEach(run);}
  32. function is_function(thing){return typeof thing==='function';}
  33. function safe_not_equal(a,b){return a!=a?b==b:a!==b||a&&_typeof(a)==='object'||typeof a==='function';}
  34. function is_empty(obj){return Object.keys(obj).length===0;}
  35. function append(target,node){target.appendChild(node);}
  36. function insert(target,node,anchor){target.insertBefore(node,anchor||null);}
  37. function detach(node){node.parentNode.removeChild(node);}
  38. function element(name){return document.createElement(name);}
  39. function text(data){return document.createTextNode(data);}
  40. function empty(){return text('');}
  41. function attr(node,attribute,value){if(value==null)node.removeAttribute(attribute);else if(node.getAttribute(attribute)!==value)node.setAttribute(attribute,value);}
  42. function children(element){return Array.from(element.childNodes);}
  43. var current_component;function set_current_component(component){current_component=component;}
  44. function get_current_component(){if(!current_component)throw new Error('Function called outside component initialization');return current_component;}
  45. function onMount(fn){get_current_component().$$.on_mount.push(fn);}
  46. function onDestroy(fn){get_current_component().$$.on_destroy.push(fn);}
  47. var dirty_components=[];var binding_callbacks=[];var render_callbacks=[];var flush_callbacks=[];var resolved_promise=Promise.resolve();var update_scheduled=false;function schedule_update(){if(!update_scheduled){update_scheduled=true;resolved_promise.then(flush);}}
  48. function add_render_callback(fn){render_callbacks.push(fn);}
  49. var flushing=false;var seen_callbacks=new Set();function flush(){if(flushing)return;flushing=true;do{for(var i=0;i<dirty_components.length;i+=1){var component=dirty_components[i];set_current_component(component);update(component.$$);}
  50. set_current_component(null);dirty_components.length=0;while(binding_callbacks.length){binding_callbacks.pop()();}
  51. for(var _i=0;_i<render_callbacks.length;_i+=1){var callback=render_callbacks[_i];if(!seen_callbacks.has(callback)){seen_callbacks.add(callback);callback();}}
  52. render_callbacks.length=0;}while(dirty_components.length);while(flush_callbacks.length){flush_callbacks.pop()();}
  53. update_scheduled=false;flushing=false;seen_callbacks.clear();}
  54. function update($$){if($$.fragment!==null){$$.update();run_all($$.before_update);var dirty=$$.dirty;$$.dirty=[-1];$$.fragment&&$$.fragment.p($$.ctx,dirty);$$.after_update.forEach(add_render_callback);}}
  55. var outroing=new Set();function transition_in(block,local){if(block&&block.i){outroing["delete"](block);block.i(local);}}
  56. function mount_component(component,target,anchor){var _component$$$=component.$$,fragment=_component$$$.fragment,on_mount=_component$$$.on_mount,on_destroy=_component$$$.on_destroy,after_update=_component$$$.after_update;fragment&&fragment.m(target,anchor);add_render_callback(function(){var new_on_destroy=on_mount.map(run).filter(is_function);if(on_destroy){on_destroy.push.apply(on_destroy,_toConsumableArray(new_on_destroy));}else{run_all(new_on_destroy);}
  57. component.$$.on_mount=[];});after_update.forEach(add_render_callback);}
  58. function destroy_component(component,detaching){var $$=component.$$;if($$.fragment!==null){run_all($$.on_destroy);$$.fragment&&$$.fragment.d(detaching);$$.on_destroy=$$.fragment=null;$$.ctx=[];}}
  59. function make_dirty(component,i){if(component.$$.dirty[0]===-1){dirty_components.push(component);schedule_update();component.$$.dirty.fill(0);}
  60. component.$$.dirty[i/31|0]|=1<<i%31;}
  61. function init(component,options,instance,create_fragment,not_equal,props){var dirty=arguments.length>6&&arguments[6]!==undefined?arguments[6]:[-1];var parent_component=current_component;set_current_component(component);var prop_values=options.props||{};var $$=component.$$={fragment:null,ctx:null,props:props,update:noop,not_equal:not_equal,bound:blank_object(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(parent_component?parent_component.$$.context:[]),callbacks:blank_object(),dirty:dirty,skip_bound:false};var ready=false;$$.ctx=instance?instance(component,prop_values,function(i,ret){var value=(arguments.length<=2?0:arguments.length-2)?arguments.length<=2?undefined:arguments[2]:ret;if($$.ctx&&not_equal($$.ctx[i],$$.ctx[i]=value)){if(!$$.skip_bound&&$$.bound[i])$$.bound[i](value);if(ready)make_dirty(component,i);}
  62. return ret;}):[];$$.update();ready=true;run_all($$.before_update);$$.fragment=create_fragment?create_fragment($$.ctx):false;if(options.target){if(options.hydrate){var nodes=children(options.target);$$.fragment&&$$.fragment.l(nodes);nodes.forEach(detach);}else{$$.fragment&&$$.fragment.c();}
  63. if(options.intro)transition_in(component.$$.fragment);mount_component(component,options.target,options.anchor);flush();}
  64. set_current_component(parent_component);}
  65. var SvelteComponent=function(){function SvelteComponent(){_classCallCheck(this,SvelteComponent);}
  66. _createClass(SvelteComponent,[{key:"$destroy",value:function $destroy(){destroy_component(this,1);this.$destroy=noop;}},{key:"$on",value:function $on(type,callback){var callbacks=this.$$.callbacks[type]||(this.$$.callbacks[type]=[]);callbacks.push(callback);return function(){var index=callbacks.indexOf(callback);if(index!==-1)callbacks.splice(index,1);};}},{key:"$set",value:function $set($$props){if(this.$$set&&!is_empty($$props)){this.$$.skip_bound=true;this.$$set($$props);this.$$.skip_bound=false;}}}]);return SvelteComponent;}();function create_if_block(ctx){var div1;var div0;var div0_class_value;var div0_style_value;var div1_class_value;return{c:function c(){div1=element("div");div0=element("div");attr(div0,"class",div0_class_value="pnotify-countdown-bar ".concat(ctx[0].getStyle("countdown-bar")));attr(div0,"style",div0_style_value="height: ".concat(ctx[1]==="right"||ctx[1]==="left"?ctx[3]:"100","%; width: ").concat(ctx[1]==="top"||ctx[1]==="bottom"?ctx[3]:"100","%;"));attr(div1,"class",div1_class_value="pnotify-countdown pnotify-countdown-".concat(ctx[1]," ").concat(ctx[2]?"pnotify-countdown-reverse":""," ").concat(ctx[0].getStyle("countdown")));},m:function m(target,anchor){insert(target,div1,anchor);append(div1,div0);},p:function p(ctx,dirty){if(dirty&1&&div0_class_value!==(div0_class_value="pnotify-countdown-bar ".concat(ctx[0].getStyle("countdown-bar")))){attr(div0,"class",div0_class_value);}
  67. if(dirty&10&&div0_style_value!==(div0_style_value="height: ".concat(ctx[1]==="right"||ctx[1]==="left"?ctx[3]:"100","%; width: ").concat(ctx[1]==="top"||ctx[1]==="bottom"?ctx[3]:"100","%;"))){attr(div0,"style",div0_style_value);}
  68. if(dirty&7&&div1_class_value!==(div1_class_value="pnotify-countdown pnotify-countdown-".concat(ctx[1]," ").concat(ctx[2]?"pnotify-countdown-reverse":""," ").concat(ctx[0].getStyle("countdown")))){attr(div1,"class",div1_class_value);}},d:function d(detaching){if(detaching)detach(div1);}};}
  69. function create_fragment(ctx){var if_block_anchor;var if_block=ctx[4]&&create_if_block(ctx);return{c:function c(){if(if_block)if_block.c();if_block_anchor=empty();},m:function m(target,anchor){if(if_block)if_block.m(target,anchor);insert(target,if_block_anchor,anchor);},p:function p(ctx,_ref){var _ref2=_slicedToArray(_ref,1),dirty=_ref2[0];if(ctx[4]){if(if_block){if_block.p(ctx,dirty);}else{if_block=create_if_block(ctx);if_block.c();if_block.m(if_block_anchor.parentNode,if_block_anchor);}}else if(if_block){if_block.d(1);if_block=null;}},i:noop,o:noop,d:function d(detaching){if(if_block)if_block.d(detaching);if(detaching)detach(if_block_anchor);}};}
  70. var position="AppendContainer";var defaults={anchor:"bottom",reverse:false};function instance($$self,$$props,$$invalidate){var _$$props$self=$$props.self,self=_$$props$self===void 0?null:_$$props$self;var _$$props$anchor=$$props.anchor,anchor=_$$props$anchor===void 0?defaults.anchor:_$$props$anchor;var _$$props$reverse=$$props.reverse,reverse=_$$props$reverse===void 0?defaults.reverse:_$$props$reverse;var _state=self.getState();var _timer=self.getTimer();var _msLeft=0;var _percent=100;var ival;var offUpdate;var offAfterOpen;var getValues=function getValues(){$$invalidate(5,_state=self.getState());$$invalidate(6,_timer=self.getTimer());};onMount(function(){offUpdate=self.on("pnotify:update",getValues);offAfterOpen=self.on("pnotify:afterOpen",getValues);ival=setInterval(function(){if(showCountdown){if(timeStart){_msLeft=self.delay-(new Date()-timeStart);$$invalidate(3,_percent=_msLeft/self.delay*100);}else{$$invalidate(3,_percent=_state==="closing"?0:100);}}},100);});onDestroy(function(){offUpdate&&offUpdate();offAfterOpen&&offAfterOpen();clearInterval(ival);});$$self.$$set=function($$props){if("self"in $$props)$$invalidate(0,self=$$props.self);if("anchor"in $$props)$$invalidate(1,anchor=$$props.anchor);if("reverse"in $$props)$$invalidate(2,reverse=$$props.reverse);};var showCountdown;var timeStart;$$self.$$.update=function(){if($$self.$$.dirty&33){$$invalidate(4,showCountdown=["opening","open","closing"].indexOf(_state)!==-1&&self.hide&&self.delay!==Infinity);}
  71. if($$self.$$.dirty&80){timeStart=showCountdown&&_timer&&_timer!=="prevented"?new Date():null;}
  72. if($$self.$$.dirty&19){{self.removeModuleClass("elem","pnotify-with-countdown","pnotify-with-countdown-bottom","pnotify-with-countdown-top","pnotify-with-countdown-left","pnotify-with-countdown-right");if(showCountdown){self.addModuleClass("elem","pnotify-with-countdown","pnotify-with-countdown-".concat(anchor));}}}};return[self,anchor,reverse,_percent,showCountdown];}
  73. var Countdown=function(_SvelteComponent){_inherits(Countdown,_SvelteComponent);var _super=_createSuper(Countdown);function Countdown(options){var _this;_classCallCheck(this,Countdown);_this=_super.call(this);init(_assertThisInitialized(_this),options,instance,create_fragment,safe_not_equal,{self:0,anchor:1,reverse:2});return _this;}
  74. return Countdown;}(SvelteComponent);exports.default=Countdown;exports.defaults=defaults;exports.position=position;Object.defineProperty(exports,'__esModule',{value:true});})));