mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-05-04 18:18:58 +00:00
5 lines
143 KiB
JavaScript
5 lines
143 KiB
JavaScript
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(e.s=137)}([,function(t,e,n){!function(e,n){t.exports=n()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),n(1);var i=n(2),o=r(i),u=n(6),a=r(u),s=n(3),c=r(s),f=n(5),l=n(11),h=n(10),d=n(7),p=r(d);e["default"]={Reactor:a["default"],Store:o["default"],Immutable:c["default"],isKeyPath:l.isKeyPath,isGetter:h.isGetter,toJS:f.toJS,toImmutable:f.toImmutable,isImmutable:f.isImmutable,createReactMixin:p["default"]},t.exports=e["default"]},function(t,e){"use strict";try{window.console&&console.log||(console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){}})}catch(n){}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return t instanceof c}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.isStore=i;var u=n(3),a=n(4),s=n(5),c=function(){function t(e){r(this,t),this.__handlers=(0,u.Map)({}),e&&(0,a.extend)(this,e),this.initialize()}return o(t,[{key:"initialize",value:function(){}},{key:"getInitialState",value:function(){return(0,u.Map)()}},{key:"handle",value:function(t,e,n){var r=this.__handlers.get(e);return"function"==typeof r?r.call(this,t,n,e):t}},{key:"handleReset",value:function(t){return this.getInitialState()}},{key:"on",value:function(t,e){this.__handlers=this.__handlers.set(t,e)}},{key:"serialize",value:function(t){return(0,s.toJS)(t)}},{key:"deserialize",value:function(t){return(0,s.toImmutable)(t)}}]),t}();e["default"]=(0,a.toFactory)(c)},function(t,e,n){!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function n(t){t&&(t.value=!0)}function r(){}function i(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;n>i;i++)r[i]=t[i+e];return r}function o(t){return void 0===t.size&&(t.size=t.__iterate(a)),t.size}function u(t,e){if("number"!=typeof e){var n=+e;if(""+n!==e)return NaN;e=n}return 0>e?o(t)+e:e}function a(){return!0}function s(t,e,n){return(0===t||void 0!==n&&-n>=t)&&(void 0===e||void 0!==n&&e>=n)}function c(t,e){return l(t,e,0)}function f(t,e){return l(t,e,e)}function l(t,e,n){return void 0===t?n:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function h(t){return v(t)?t:P(t)}function d(t){return y(t)?t:D(t)}function p(t){return g(t)?t:C(t)}function _(t){return v(t)&&!m(t)?t:M(t)}function v(t){return!(!t||!t[_n])}function y(t){return!(!t||!t[vn])}function g(t){return!(!t||!t[yn])}function m(t){return y(t)||g(t)}function b(t){return!(!t||!t[gn])}function S(t){this.next=t}function O(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function w(){return{value:void 0,done:!0}}function E(t){return!!A(t)}function I(t){return t&&"function"==typeof t.next}function T(t){var e=A(t);return e&&e.call(t)}function A(t){var e=t&&(On&&t[On]||t[wn]);return"function"==typeof e?e:void 0}function j(t){return t&&"number"==typeof t.length}function P(t){return null===t||void 0===t?H():v(t)?t.toSeq():V(t)}function D(t){return null===t||void 0===t?H().toKeyedSeq():v(t)?y(t)?t.toSeq():t.fromEntrySeq():U(t)}function C(t){return null===t||void 0===t?H():v(t)?y(t)?t.entrySeq():t.toIndexedSeq():x(t)}function M(t){return(null===t||void 0===t?H():v(t)?y(t)?t.entrySeq():t:x(t)).toSetSeq()}function k(t){this._array=t,this.size=t.length}function R(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function z(t){this._iterable=t,this.size=t.length||t.size}function L(t){this._iterator=t,this._iteratorCache=[]}function N(t){return!(!t||!t[In])}function H(){return Tn||(Tn=new k([]))}function U(t){var e=Array.isArray(t)?new k(t).fromEntrySeq():I(t)?new L(t).fromEntrySeq():E(t)?new z(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function x(t){var e=q(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function V(t){var e=q(t)||"object"==typeof t&&new R(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function q(t){return j(t)?new k(t):I(t)?new L(t):E(t)?new z(t):void 0}function G(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var a=i[n?o-u:u];if(e(a[1],r?a[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,n)}function F(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[n?o-u:u];return u++>o?w():O(e,r?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,n)}function K(){throw TypeError("Abstract")}function Y(){}function B(){}function J(){}function W(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function Z(t,e){return e?X(e,t,"",{"":t}):Q(t)}function X(t,e,n,r){return Array.isArray(e)?t.call(r,n,C(e).map(function(n,r){return X(t,n,r,e)})):$(e)?t.call(r,n,D(e).map(function(n,r){return X(t,n,r,e)})):e}function Q(t){return Array.isArray(t)?C(t).map(Q).toList():$(t)?D(t).map(Q).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return tt(n)}return"string"===e?t.length>Rn?nt(t):rt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function nt(t){var e=Nn[t];return void 0===e&&(e=rt(t),Ln===zn&&(Ln=0,Nn={}),Ln++,Nn[t]=e),e}function rt(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;return tt(e)}function it(t){var e;if(Cn&&(e=An.get(t),void 0!==e))return e;if(e=t[kn],void 0!==e)return e;if(!Dn){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[kn],void 0!==e)return e;if(e=ot(t),void 0!==e)return e}if(e=++Mn,1073741824&Mn&&(Mn=0),Cn)An.set(t,e);else{if(void 0!==Pn&&Pn(t)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(Dn)Object.defineProperty(t,kn,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[kn]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[kn]=e}}return e}function ot(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw new Error(e)}function at(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function st(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function lt(t){this._iter=t,this.size=t.size}function ht(t){var e=kt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Rt,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e.__iteratorUncached=function(e,n){if(e===Sn){var r=t.__iterator(e,n);return new S(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===bn?mn:bn,n)},e}function dt(t,e,n){var r=kt(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var o=t.get(r,hn);return o===hn?i:e.call(n,o,r,t)},r.__iterateUncached=function(r,i){var o=this;return t.__iterate(function(t,i,u){return r(e.call(n,t,i,u),i,o)!==!1},i)},r.__iteratorUncached=function(r,i){var o=t.__iterator(Sn,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,a=u[0];return O(r,a,e.call(n,u[1],a,t),i)})},r}function pt(t,e){var n=kt(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=ht(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=Rt,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function _t(t,e,n,r){var i=kt(t);return r&&(i.has=function(r){var i=t.get(r,hn);return i!==hn&&!!e.call(n,i,r,t)},i.get=function(r,i){var o=t.get(r,hn);return o!==hn&&e.call(n,o,r,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,a=0;return t.__iterate(function(t,o,s){return e.call(n,t,o,s)?(a++,i(t,r?o:a-1,u)):void 0},o),a},i.__iteratorUncached=function(i,o){var u=t.__iterator(Sn,o),a=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var s=o.value,c=s[0],f=s[1];if(e.call(n,f,c,t))return O(i,r?c:a++,f,o)}})},i}function vt(t,e,n){var r=Nt().asMutable();return t.__iterate(function(i,o){r.update(e.call(n,i,o,t),0,function(t){return t+1})}),r.asImmutable()}function yt(t,e,n){var r=y(t),i=(b(t)?we():Nt()).asMutable();t.__iterate(function(o,u){i.update(e.call(n,o,u,t),function(t){return t=t||[],t.push(r?[u,o]:o),t})});var o=Mt(t);return i.map(function(e){return Pt(t,o(e))})}function gt(t,e,n,r){var i=t.size;if(void 0!==e&&(e=0|e),void 0!==n&&(n=0|n),s(e,n,i))return t;var o=c(e,i),a=f(n,i);if(o!==o||a!==a)return gt(t.toSeq().cacheResult(),e,n,r);var l,h=a-o;h===h&&(l=0>h?0:h);var d=kt(t);return d.size=0===l?l:t.size&&l||void 0,!r&&N(t)&&l>=0&&(d.get=function(e,n){return e=u(this,e),e>=0&&l>e?t.get(e+o,n):n}),d.__iterateUncached=function(e,n){var i=this;if(0===l)return 0;if(n)return this.cacheResult().__iterate(e,n);var u=0,a=!0,s=0;return t.__iterate(function(t,n){return a&&(a=u++<o)?void 0:(s++,e(t,r?n:s-1,i)!==!1&&s!==l)}),s},d.__iteratorUncached=function(e,n){if(0!==l&&n)return this.cacheResult().__iterator(e,n);var i=0!==l&&t.__iterator(e,n),u=0,a=0;return new S(function(){for(;u++<o;)i.next();if(++a>l)return w();var t=i.next();return r||e===bn?t:e===mn?O(e,a-1,void 0,t):O(e,a-1,t.value[1],t)})},d}function mt(t,e,n){var r=kt(t);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var u=0;return t.__iterate(function(t,i,a){return e.call(n,t,i,a)&&++u&&r(t,i,o)}),u},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var u=t.__iterator(Sn,i),a=!0;return new S(function(){if(!a)return w();var t=u.next();if(t.done)return t;var i=t.value,s=i[0],c=i[1];return e.call(n,c,s,o)?r===Sn?t:O(r,s,c,t):(a=!1,w())})},r}function bt(t,e,n,r){var i=kt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var a=!0,s=0;return t.__iterate(function(t,o,c){return a&&(a=e.call(n,t,o,c))?void 0:(s++,i(t,r?o:s-1,u))}),s},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var a=t.__iterator(Sn,o),s=!0,c=0;return new S(function(){var t,o,f;do{if(t=a.next(),t.done)return r||i===bn?t:i===mn?O(i,c++,void 0,t):O(i,c++,t.value[1],t);var l=t.value;o=l[0],f=l[1],s&&(s=e.call(n,f,o,u))}while(s);return i===Sn?t:O(i,o,f,t)})},i}function St(t,e){var n=y(t),r=[t].concat(e).map(function(t){return v(t)?n&&(t=d(t)):t=n?U(t):x(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===r.length)return t;if(1===r.length){var i=r[0];if(i===t||n&&y(i)||g(t)&&g(i))return i}var o=new k(r);return n?o=o.toKeyedSeq():g(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=r.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),o}function Ot(t,e,n){var r=kt(t);return r.__iterateUncached=function(r,i){function o(t,s){var c=this;t.__iterate(function(t,i){return(!e||e>s)&&v(t)?o(t,s+1):r(t,n?i:u++,c)===!1&&(a=!0),!a},i)}var u=0,a=!1;return o(t,0),u},r.__iteratorUncached=function(r,i){var o=t.__iterator(r,i),u=[],a=0;return new S(function(){for(;o;){var t=o.next();if(t.done===!1){var s=t.value;if(r===Sn&&(s=s[1]),e&&!(u.length<e)||!v(s))return n?t:O(r,a++,s,t);u.push(o),o=s.__iterator(r,i)}else o=u.pop()}return w()})},r}function wt(t,e,n){var r=Mt(t);return t.toSeq().map(function(i,o){return r(e.call(n,i,o,t))}).flatten(!0)}function Et(t,e){var n=kt(t);return n.size=t.size&&2*t.size-1,n.__iterateUncached=function(n,r){var i=this,o=0;return t.__iterate(function(t,r){return(!o||n(e,o++,i)!==!1)&&n(t,o++,i)!==!1},r),o},n.__iteratorUncached=function(n,r){var i,o=t.__iterator(bn,r),u=0;return new S(function(){return(!i||u%2)&&(i=o.next(),i.done)?i:u%2?O(n,u++,e):O(n,u++,i.value,i)})},n}function It(t,e,n){e||(e=zt);var r=y(t),i=0,o=t.toSeq().map(function(e,r){return[r,e,i++,n?n(e,r,t):e]}).toArray();return o.sort(function(t,n){return e(t[3],n[3])||t[2]-n[2]}).forEach(r?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),r?D(o):g(t)?C(o):M(o)}function Tt(t,e,n){if(e||(e=zt),n){var r=t.toSeq().map(function(e,r){return[e,n(e,r,t)]}).reduce(function(t,n){return At(e,t[1],n[1])?n:t});return r&&r[0]}return t.reduce(function(t,n){return At(e,t,n)?n:t})}function At(t,e,n){var r=t(n,e);return 0===r&&n!==e&&(void 0===n||null===n||n!==n)||r>0}function jt(t,e,n){var r=kt(t);return r.size=new k(n).map(function(t){return t.size}).min(),r.__iterate=function(t,e){for(var n,r=this.__iterator(bn,e),i=0;!(n=r.next()).done&&t(n.value,i++,this)!==!1;);return i},r.__iteratorUncached=function(t,r){var i=n.map(function(t){return t=h(t),T(r?t.reverse():t)}),o=0,u=!1;return new S(function(){var n;return u||(n=i.map(function(t){return t.next()}),u=n.some(function(t){return t.done})),u?w():O(t,o++,e.apply(null,n.map(function(t){return t.value})))})},r}function Pt(t,e){return N(t)?e:t.constructor(e)}function Dt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ct(t){return at(t.size),o(t)}function Mt(t){return y(t)?d:g(t)?p:_}function kt(t){return Object.create((y(t)?D:g(t)?C:M).prototype)}function Rt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):P.prototype.cacheResult.call(this)}function zt(t,e){return t>e?1:e>t?-1:0}function Lt(t){var e=T(t);if(!e){if(!j(t))throw new TypeError("Expected iterable or array-like: "+t);e=T(h(t))}return e}function Nt(t){return null===t||void 0===t?Jt():Ht(t)&&!b(t)?t:Jt().withMutations(function(e){var n=d(t);at(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Ht(t){return!(!t||!t[Hn])}function Ut(t,e){this.ownerID=t,this.entries=e}function xt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function Vt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function qt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function Gt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function Ft(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&Yt(t._root)}function Kt(t,e){return O(t,e[0],e[1])}function Yt(t,e){return{node:t,index:0,__prev:e}}function Bt(t,e,n,r){var i=Object.create(Un);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Jt(){return xn||(xn=Bt(0))}function Wt(t,n,r){var i,o;if(t._root){var u=e(dn),a=e(pn);if(i=Zt(t._root,t.__ownerID,0,void 0,n,r,u,a),!a.value)return t;o=t.size+(u.value?r===hn?-1:1:0)}else{if(r===hn)return t;o=1,i=new Ut(t.__ownerID,[[n,r]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Bt(o,i):Jt()}function Zt(t,e,r,i,o,u,a,s){return t?t.update(e,r,i,o,u,a,s):u===hn?t:(n(s),n(a),new Gt(e,i,[o,u]))}function Xt(t){return t.constructor===Gt||t.constructor===qt}function Qt(t,e,n,r,i){if(t.keyHash===r)return new qt(e,r,[t.entry,i]);var o,u=(0===n?t.keyHash:t.keyHash>>>n)&ln,a=(0===n?r:r>>>n)&ln,s=u===a?[Qt(t,e,n+cn,r,i)]:(o=new Gt(e,r,i),a>u?[t,o]:[o,t]);return new xt(e,1<<u|1<<a,s)}function $t(t,e,n,i){t||(t=new r);for(var o=new Gt(t,et(n),[n,i]),u=0;u<e.length;u++){var a=e[u];o=o.update(t,0,void 0,a[0],a[1])}return o}function te(t,e,n,r){for(var i=0,o=0,u=new Array(n),a=0,s=1,c=e.length;c>a;a++,s<<=1){var f=e[a];void 0!==f&&a!==r&&(i|=s,u[o++]=f)}return new xt(t,i,u)}function ee(t,e,n,r,i){for(var o=0,u=new Array(fn),a=0;0!==n;a++,n>>>=1)u[a]=1&n?e[o++]:void 0;return u[r]=i,new Vt(t,o+1,u)}function ne(t,e,n){for(var r=[],i=0;i<n.length;i++){var o=n[i],u=d(o);v(o)||(u=u.map(function(t){return Z(t)})),r.push(u)}return ie(t,e,r)}function re(t){return function(e,n,r){return e&&e.mergeDeepWith&&v(n)?e.mergeDeepWith(t,n):t?t(e,n,r):n}}function ie(t,e,n){return n=n.filter(function(t){return 0!==t.size}),0===n.length?t:0!==t.size||t.__ownerID||1!==n.length?t.withMutations(function(t){for(var r=e?function(n,r){t.update(r,hn,function(t){return t===hn?n:e(t,n,r)})}:function(e,n){t.set(n,e)},i=0;i<n.length;i++)n[i].forEach(r)}):t.constructor(n[0])}function oe(t,e,n,r){var i=t===hn,o=e.next();if(o.done){var u=i?n:t,a=r(u);return a===u?t:a}ut(i||t&&t.set,"invalid keyPath");var s=o.value,c=i?hn:t.get(s,hn),f=oe(c,e,n,r);return f===c?t:f===hn?t.remove(s):(i?Jt():t).set(s,f)}function ue(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function ae(t,e,n,r){var o=r?t:i(t);return o[e]=n,o}function se(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var o=new Array(i),u=0,a=0;i>a;a++)a===e?(o[a]=n,u=-1):o[a]=t[a+u];return o}function ce(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=new Array(r),o=0,u=0;r>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function fe(t){var e=_e();if(null===t||void 0===t)return e;if(le(t))return t;var n=p(t),r=n.size;return 0===r?e:(at(r),r>0&&fn>r?pe(0,r,cn,null,new he(n.toArray())):e.withMutations(function(t){t.setSize(r),n.forEach(function(e,n){return t.set(n,e)})}))}function le(t){return!(!t||!t[Fn])}function he(t,e){this.array=t,this.ownerID=e}function de(t,e){function n(t,e,n){return 0===e?r(t,n):i(t,e,n)}function r(t,n){var r=n===a?s&&s.array:t&&t.array,i=n>o?0:o-n,c=u-n;return c>fn&&(c=fn),function(){if(i===c)return Bn;var t=e?--c:i++;return r&&r[t]}}function i(t,r,i){var a,s=t&&t.array,c=i>o?0:o-i>>r,f=(u-i>>r)+1;return f>fn&&(f=fn),function(){for(;;){if(a){var t=a();if(t!==Bn)return t;a=null}if(c===f)return Bn;var o=e?--f:c++;a=n(s&&s[o],r-cn,i+(o<<r))}}}var o=t._origin,u=t._capacity,a=Oe(u),s=t._tail;return n(t._root,t._level,0)}function pe(t,e,n,r,i,o,u){var a=Object.create(Kn);return a.size=e-t,a._origin=t,a._capacity=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=o,a.__hash=u,a.__altered=!1,a}function _e(){return Yn||(Yn=pe(0,0,cn))}function ve(t,n,r){if(n=u(t,n),n!==n)return t;if(n>=t.size||0>n)return t.withMutations(function(t){0>n?be(t,n).set(0,r):be(t,0,n+1).set(n,r)});n+=t._origin;var i=t._tail,o=t._root,a=e(pn);return n>=Oe(t._capacity)?i=ye(i,t.__ownerID,0,n,r,a):o=ye(o,t.__ownerID,t._level,n,r,a),a.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):pe(t._origin,t._capacity,t._level,o,i):t}function ye(t,e,r,i,o,u){var a=i>>>r&ln,s=t&&a<t.array.length;if(!s&&void 0===o)return t;var c;if(r>0){var f=t&&t.array[a],l=ye(f,e,r-cn,i,o,u);return l===f?t:(c=ge(t,e),c.array[a]=l,c)}return s&&t.array[a]===o?t:(n(u),c=ge(t,e),void 0===o&&a===c.array.length-1?c.array.pop():c.array[a]=o,c)}function ge(t,e){return e&&t&&e===t.ownerID?t:new he(t?t.array.slice():[],e)}function me(t,e){if(e>=Oe(t._capacity))return t._tail;if(e<1<<t._level+cn){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&ln],r-=cn;return n}}function be(t,e,n){void 0!==e&&(e=0|e),void 0!==n&&(n=0|n);var i=t.__ownerID||new r,o=t._origin,u=t._capacity,a=o+e,s=void 0===n?u:0>n?u+n:o+n;if(a===o&&s===u)return t;if(a>=s)return t.clear();for(var c=t._level,f=t._root,l=0;0>a+l;)f=new he(f&&f.array.length?[void 0,f]:[],i),c+=cn,l+=1<<c;l&&(a+=l,o+=l,s+=l,u+=l);for(var h=Oe(u),d=Oe(s);d>=1<<c+cn;)f=new he(f&&f.array.length?[f]:[],i),c+=cn;var p=t._tail,_=h>d?me(t,s-1):d>h?new he([],i):p;if(p&&d>h&&u>a&&p.array.length){f=ge(f,i);for(var v=f,y=c;y>cn;y-=cn){var g=h>>>y&ln;v=v.array[g]=ge(v.array[g],i)}v.array[h>>>cn&ln]=p}if(u>s&&(_=_&&_.removeAfter(i,0,s)),a>=d)a-=d,s-=d,c=cn,f=null,_=_&&_.removeBefore(i,0,a);else if(a>o||h>d){for(l=0;f;){var m=a>>>c&ln;if(m!==d>>>c&ln)break;m&&(l+=(1<<c)*m),c-=cn,f=f.array[m]}f&&a>o&&(f=f.removeBefore(i,c,a-l)),f&&h>d&&(f=f.removeAfter(i,c,d-l)),l&&(a-=l,s-=l)}return t.__ownerID?(t.size=s-a,t._origin=a,t._capacity=s,t._level=c,t._root=f,t._tail=_,t.__hash=void 0,t.__altered=!0,t):pe(a,s,c,f,_)}function Se(t,e,n){for(var r=[],i=0,o=0;o<n.length;o++){var u=n[o],a=p(u);a.size>i&&(i=a.size),v(u)||(a=a.map(function(t){return Z(t)})),r.push(a)}return i>t.size&&(t=t.setSize(i)),ie(t,e,r)}function Oe(t){return fn>t?0:t-1>>>cn<<cn}function we(t){return null===t||void 0===t?Te():Ee(t)?t:Te().withMutations(function(e){var n=d(t);at(n.size),n.forEach(function(t,n){return e.set(n,t)})})}function Ee(t){return Ht(t)&&b(t)}function Ie(t,e,n,r){var i=Object.create(we.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=n,i.__hash=r,i}function Te(){return Jn||(Jn=Ie(Jt(),_e()))}function Ae(t,e,n){var r,i,o=t._map,u=t._list,a=o.get(e),s=void 0!==a;if(n===hn){if(!s)return t;u.size>=fn&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&a!==e}),r=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=o.remove(e),i=a===u.size-1?u.pop():u.set(a,void 0))}else if(s){if(n===u.get(a)[1])return t;r=o,i=u.set(a,[e,n])}else r=o.set(e,u.size),i=u.set(u.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):Ie(r,i)}function je(t){return null===t||void 0===t?Ce():Pe(t)?t:Ce().unshiftAll(t)}function Pe(t){return!(!t||!t[Wn])}function De(t,e,n,r){var i=Object.create(Zn);return i.size=t,i._head=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Ce(){return Xn||(Xn=De(0))}function Me(t){return null===t||void 0===t?Le():ke(t)&&!b(t)?t:Le().withMutations(function(e){var n=_(t);at(n.size),n.forEach(function(t){return e.add(t)})})}function ke(t){return!(!t||!t[Qn])}function Re(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function ze(t,e){var n=Object.create($n);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function Le(){return tr||(tr=ze(Jt()))}function Ne(t){return null===t||void 0===t?xe():He(t)?t:xe().withMutations(function(e){var n=_(t);at(n.size),n.forEach(function(t){return e.add(t)})})}function He(t){return ke(t)&&b(t)}function Ue(t,e){var n=Object.create(er);return n.size=t?t.size:0,n._map=t,n.__ownerID=e,n}function xe(){return nr||(nr=Ue(Te()))}function Ve(t,e){var n,r=function(o){if(o instanceof r)return o;if(!(this instanceof r))return new r(o);if(!n){n=!0;var u=Object.keys(t);Fe(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Nt(o)},i=r.prototype=Object.create(rr);return i.constructor=r,r}function qe(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function Ge(t){return t._name||t.constructor.name||"Record"}function Fe(t,e){try{e.forEach(Ke.bind(void 0,t))}catch(n){}}function Ke(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Ye(t,e){if(t===e)return!0;if(!v(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||y(t)!==y(e)||g(t)!==g(e)||b(t)!==b(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!m(t);if(b(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&W(i[1],t)&&(n||W(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,a=e.__iterate(function(e,r){return(n?t.has(e):i?W(e,t.get(r,hn)):W(t.get(r,hn),e))?void 0:(u=!1,!1)});return u&&t.size===a}function Be(t,e,n){if(!(this instanceof Be))return new Be(t,e,n);if(ut(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),t>e&&(n=-n),this._start=t,this._end=e,this._step=n,this.size=Math.max(0,Math.ceil((e-t)/n-1)+1),0===this.size){if(ir)return ir;ir=this}}function Je(t,e){if(!(this instanceof Je))return new Je(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(or)return or;or=this}}function We(t,e){var n=function(n){t.prototype[n]=e[n]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function Ze(t,e){return e}function Xe(t,e){return[e,t]}function Qe(t){return function(){return!t.apply(this,arguments)}}function $e(t){return function(){return-t.apply(this,arguments)}}function tn(t){return"string"==typeof t?JSON.stringify(t):t}function en(){return i(arguments)}function nn(t,e){return e>t?1:t>e?-1:0}function rn(t){if(t.size===1/0)return 0;var e=b(t),n=y(t),r=e?1:0,i=t.__iterate(n?e?function(t,e){r=31*r+un(et(t),et(e))|0}:function(t,e){r=r+un(et(t),et(e))|0}:e?function(t){r=31*r+et(t)|0}:function(t){r=r+et(t)|0});return on(i,r)}function on(t,e){return e=jn(e,3432918353),e=jn(e<<15|e>>>-15,461845907),e=jn(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=jn(e^e>>>16,2246822507),e=jn(e^e>>>13,3266489909),e=tt(e^e>>>16)}function un(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var an=Array.prototype.slice,sn="delete",cn=5,fn=1<<cn,ln=fn-1,hn={},dn={value:!1},pn={value:!1};t(d,h),t(p,h),t(_,h),h.isIterable=v,h.isKeyed=y,h.isIndexed=g,h.isAssociative=m,h.isOrdered=b,h.Keyed=d,h.Indexed=p,h.Set=_;var _n="@@__IMMUTABLE_ITERABLE__@@",vn="@@__IMMUTABLE_KEYED__@@",yn="@@__IMMUTABLE_INDEXED__@@",gn="@@__IMMUTABLE_ORDERED__@@",mn=0,bn=1,Sn=2,On="function"==typeof Symbol&&Symbol.iterator,wn="@@iterator",En=On||wn;S.prototype.toString=function(){return"[Iterator]"},S.KEYS=mn,S.VALUES=bn,S.ENTRIES=Sn,S.prototype.inspect=S.prototype.toSource=function(){return this.toString()},S.prototype[En]=function(){return this},t(P,h),P.of=function(){return P(arguments)},P.prototype.toSeq=function(){return this},P.prototype.toString=function(){return this.__toString("Seq {","}")},P.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},P.prototype.__iterate=function(t,e){return G(this,t,e,!0)},P.prototype.__iterator=function(t,e){return F(this,t,e,!0)},t(D,P),D.prototype.toKeyedSeq=function(){return this},t(C,P),C.of=function(){return C(arguments)},C.prototype.toIndexedSeq=function(){return this},C.prototype.toString=function(){return this.__toString("Seq [","]")},C.prototype.__iterate=function(t,e){return G(this,t,e,!1)},C.prototype.__iterator=function(t,e){return F(this,t,e,!1)},t(M,P),M.of=function(){return M(arguments)},M.prototype.toSetSeq=function(){return this},P.isSeq=N,P.Keyed=D,P.Set=M,P.Indexed=C;var In="@@__IMMUTABLE_SEQ__@@";P.prototype[In]=!0,t(k,C),k.prototype.get=function(t,e){return this.has(t)?this._array[u(this,t)]:e},k.prototype.__iterate=function(t,e){for(var n=this._array,r=n.length-1,i=0;r>=i;i++)if(t(n[e?r-i:i],i,this)===!1)return i+1;return i},k.prototype.__iterator=function(t,e){var n=this._array,r=n.length-1,i=0;return new S(function(){return i>r?w():O(t,i,n[e?r-i++:i++])})},t(R,D),R.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},R.prototype.has=function(t){return this._object.hasOwnProperty(t)},R.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,o=0;i>=o;o++){var u=r[e?i-o:o];if(t(n[u],u,this)===!1)return o+1}return o},R.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,o=0;return new S(function(){var u=r[e?i-o:o];return o++>i?w():O(t,u,n[u])})},R.prototype[gn]=!0,t(z,C),z.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=this._iterable,r=T(n),i=0;if(I(r))for(var o;!(o=r.next()).done&&t(o.value,i++,this)!==!1;);return i},z.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=T(n);if(!I(r))return new S(w);var i=0;return new S(function(){var e=r.next();return e.done?e:O(t,i++,e.value)})},t(L,C),L.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n=this._iterator,r=this._iteratorCache,i=0;i<r.length;)if(t(r[i],i++,this)===!1)return i;for(var o;!(o=n.next()).done;){var u=o.value;if(r[i]=u,t(u,i++,this)===!1)break}return i},L.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterator,r=this._iteratorCache,i=0;return new S(function(){if(i>=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return O(t,i,r[i++])})};var Tn;t(K,h),t(Y,K),t(B,K),t(J,K),K.Keyed=Y,K.Indexed=B,K.Set=J;var An,jn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Pn=Object.isExtensible,Dn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),Cn="function"==typeof WeakMap;Cn&&(An=new WeakMap);var Mn=0,kn="__immutablehash__";"function"==typeof Symbol&&(kn=Symbol(kn));var Rn=16,zn=255,Ln=0,Nn={};t(st,D),st.prototype.get=function(t,e){return this._iter.get(t,e)},st.prototype.has=function(t){return this._iter.has(t)},st.prototype.valueSeq=function(){return this._iter.valueSeq()},st.prototype.reverse=function(){var t=this,e=pt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},st.prototype.map=function(t,e){var n=this,r=dt(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},st.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Ct(this):0,function(i){return t(i,e?--n:n++,r)}),e)},st.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(bn,e),r=e?Ct(this):0;return new S(function(){var i=n.next();return i.done?i:O(t,e?--r:r++,i.value,i)})},st.prototype[gn]=!0,t(ct,C),ct.prototype.includes=function(t){return this._iter.includes(t)},ct.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ct.prototype.__iterator=function(t,e){var n=this._iter.__iterator(bn,e),r=0;return new S(function(){var e=n.next();return e.done?e:O(t,r++,e.value,e)})},t(ft,M),ft.prototype.has=function(t){return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ft.prototype.__iterator=function(t,e){var n=this._iter.__iterator(bn,e);return new S(function(){var e=n.next();return e.done?e:O(t,e.value,e.value,e)})},t(lt,D),lt.prototype.entrySeq=function(){return this._iter.toSeq()},lt.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Dt(e);var r=v(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},lt.prototype.__iterator=function(t,e){var n=this._iter.__iterator(bn,e);return new S(function(){
|
|
for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Dt(r);var i=v(r);return O(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ct.prototype.cacheResult=st.prototype.cacheResult=ft.prototype.cacheResult=lt.prototype.cacheResult=Rt,t(Nt,Y),Nt.prototype.toString=function(){return this.__toString("Map {","}")},Nt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Nt.prototype.set=function(t,e){return Wt(this,t,e)},Nt.prototype.setIn=function(t,e){return this.updateIn(t,hn,function(){return e})},Nt.prototype.remove=function(t){return Wt(this,t,hn)},Nt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return hn})},Nt.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},Nt.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=oe(this,Lt(t),e,n);return r===hn?void 0:r},Nt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Jt()},Nt.prototype.merge=function(){return ne(this,void 0,arguments)},Nt.prototype.mergeWith=function(t){var e=an.call(arguments,1);return ne(this,t,e)},Nt.prototype.mergeIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Jt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Nt.prototype.mergeDeep=function(){return ne(this,re(void 0),arguments)},Nt.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return ne(this,re(t),e)},Nt.prototype.mergeDeepIn=function(t){var e=an.call(arguments,1);return this.updateIn(t,Jt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Nt.prototype.sort=function(t){return we(It(this,t))},Nt.prototype.sortBy=function(t,e){return we(It(this,e,t))},Nt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Nt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new r)},Nt.prototype.asImmutable=function(){return this.__ensureOwner()},Nt.prototype.wasAltered=function(){return this.__altered},Nt.prototype.__iterator=function(t,e){return new Ft(this,t,e)},Nt.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},Nt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Bt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Nt.isMap=Ht;var Hn="@@__IMMUTABLE_MAP__@@",Un=Nt.prototype;Un[Hn]=!0,Un[sn]=Un.remove,Un.removeIn=Un.deleteIn,Ut.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(W(n,i[o][0]))return i[o][1];return r},Ut.prototype.update=function(t,e,r,o,u,a,s){for(var c=u===hn,f=this.entries,l=0,h=f.length;h>l&&!W(o,f[l][0]);l++);var d=h>l;if(d?f[l][1]===u:c)return this;if(n(s),(c||!d)&&n(a),!c||1!==f.length){if(!d&&!c&&f.length>=Vn)return $t(t,f,o,u);var p=t&&t===this.ownerID,_=p?f:i(f);return d?c?l===h-1?_.pop():_[l]=_.pop():_[l]=[o,u]:_.push([o,u]),p?(this.entries=_,this):new Ut(t,_)}},xt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=1<<((0===t?e:e>>>t)&ln),o=this.bitmap;return 0===(o&i)?r:this.nodes[ue(o&i-1)].get(t+cn,e,n,r)},xt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=1<<a,c=this.bitmap,f=0!==(c&s);if(!f&&i===hn)return this;var l=ue(c&s-1),h=this.nodes,d=f?h[l]:void 0,p=Zt(d,t,e+cn,n,r,i,o,u);if(p===d)return this;if(!f&&p&&h.length>=qn)return ee(t,h,c,a,p);if(f&&!p&&2===h.length&&Xt(h[1^l]))return h[1^l];if(f&&p&&1===h.length&&Xt(p))return p;var _=t&&t===this.ownerID,v=f?p?c:c^s:c|s,y=f?p?ae(h,l,p,_):ce(h,l,_):se(h,l,p,_);return _?(this.bitmap=v,this.nodes=y,this):new xt(t,v,y)},Vt.prototype.get=function(t,e,n,r){void 0===e&&(e=et(n));var i=(0===t?e:e>>>t)&ln,o=this.nodes[i];return o?o.get(t+cn,e,n,r):r},Vt.prototype.update=function(t,e,n,r,i,o,u){void 0===n&&(n=et(r));var a=(0===e?n:n>>>e)&ln,s=i===hn,c=this.nodes,f=c[a];if(s&&!f)return this;var l=Zt(f,t,e+cn,n,r,i,o,u);if(l===f)return this;var h=this.count;if(f){if(!l&&(h--,Gn>h))return te(t,c,h,a)}else h++;var d=t&&t===this.ownerID,p=ae(c,a,l,d);return d?(this.count=h,this.nodes=p,this):new Vt(t,h,p)},qt.prototype.get=function(t,e,n,r){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(W(n,i[o][0]))return i[o][1];return r},qt.prototype.update=function(t,e,r,o,u,a,s){void 0===r&&(r=et(o));var c=u===hn;if(r!==this.keyHash)return c?this:(n(s),n(a),Qt(this,t,e,r,[o,u]));for(var f=this.entries,l=0,h=f.length;h>l&&!W(o,f[l][0]);l++);var d=h>l;if(d?f[l][1]===u:c)return this;if(n(s),(c||!d)&&n(a),c&&2===h)return new Gt(t,this.keyHash,f[1^l]);var p=t&&t===this.ownerID,_=p?f:i(f);return d?c?l===h-1?_.pop():_[l]=_.pop():_[l]=[o,u]:_.push([o,u]),p?(this.entries=_,this):new qt(t,this.keyHash,_)},Gt.prototype.get=function(t,e,n,r){return W(n,this.entry[0])?this.entry[1]:r},Gt.prototype.update=function(t,e,r,i,o,u,a){var s=o===hn,c=W(i,this.entry[0]);return(c?o===this.entry[1]:s)?this:(n(a),s?void n(u):c?t&&t===this.ownerID?(this.entry[1]=o,this):new Gt(t,this.keyHash,[i,o]):(n(u),Qt(this,t,e,et(i),[i,o])))},Ut.prototype.iterate=qt.prototype.iterate=function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1},xt.prototype.iterate=Vt.prototype.iterate=function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var o=n[e?i-r:r];if(o&&o.iterate(t,e)===!1)return!1}},Gt.prototype.iterate=function(t,e){return t(this.entry)},t(Ft,S),Ft.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return Kt(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return Kt(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var o=r.nodes[this._reverse?n-i:i];if(o){if(o.entry)return Kt(t,o.entry);e=this._stack=Yt(o,e)}continue}e=this._stack=this._stack.__prev}return w()};var xn,Vn=fn/4,qn=fn/2,Gn=fn/4;t(fe,B),fe.of=function(){return this(arguments)},fe.prototype.toString=function(){return this.__toString("List [","]")},fe.prototype.get=function(t,e){if(t=u(this,t),t>=0&&t<this.size){t+=this._origin;var n=me(this,t);return n&&n.array[t&ln]}return e},fe.prototype.set=function(t,e){return ve(this,t,e)},fe.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=cn,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):_e()},fe.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(n){be(n,0,e+t.length);for(var r=0;r<t.length;r++)n.set(e+r,t[r])})},fe.prototype.pop=function(){return be(this,0,-1)},fe.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){be(e,-t.length);for(var n=0;n<t.length;n++)e.set(n,t[n])})},fe.prototype.shift=function(){return be(this,1)},fe.prototype.merge=function(){return Se(this,void 0,arguments)},fe.prototype.mergeWith=function(t){var e=an.call(arguments,1);return Se(this,t,e)},fe.prototype.mergeDeep=function(){return Se(this,re(void 0),arguments)},fe.prototype.mergeDeepWith=function(t){var e=an.call(arguments,1);return Se(this,re(t),e)},fe.prototype.setSize=function(t){return be(this,0,t)},fe.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:be(this,c(t,n),f(e,n))},fe.prototype.__iterator=function(t,e){var n=0,r=de(this,e);return new S(function(){var e=r();return e===Bn?w():O(t,n++,e)})},fe.prototype.__iterate=function(t,e){for(var n,r=0,i=de(this,e);(n=i())!==Bn&&t(n,r++,this)!==!1;);return r},fe.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?pe(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},fe.isList=le;var Fn="@@__IMMUTABLE_LIST__@@",Kn=fe.prototype;Kn[Fn]=!0,Kn[sn]=Kn.remove,Kn.setIn=Un.setIn,Kn.deleteIn=Kn.removeIn=Un.removeIn,Kn.update=Un.update,Kn.updateIn=Un.updateIn,Kn.mergeIn=Un.mergeIn,Kn.mergeDeepIn=Un.mergeDeepIn,Kn.withMutations=Un.withMutations,Kn.asMutable=Un.asMutable,Kn.asImmutable=Un.asImmutable,Kn.wasAltered=Un.wasAltered,he.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var r=n>>>e&ln;if(r>=this.array.length)return new he([],t);var i,o=0===r;if(e>0){var u=this.array[r];if(i=u&&u.removeBefore(t,e-cn,n),i===u&&o)return this}if(o&&!i)return this;var a=ge(this,t);if(!o)for(var s=0;r>s;s++)a.array[s]=void 0;return i&&(a.array[r]=i),a},he.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var r=n-1>>>e&ln;if(r>=this.array.length)return this;var i;if(e>0){var o=this.array[r];if(i=o&&o.removeAfter(t,e-cn,n),i===o&&r===this.array.length-1)return this}var u=ge(this,t);return u.array.splice(r+1),i&&(u.array[r]=i),u};var Yn,Bn={};t(we,Nt),we.of=function(){return this(arguments)},we.prototype.toString=function(){return this.__toString("OrderedMap {","}")},we.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},we.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):Te()},we.prototype.set=function(t,e){return Ae(this,t,e)},we.prototype.remove=function(t){return Ae(this,t,hn)},we.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},we.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},we.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},we.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?Ie(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},we.isOrderedMap=Ee,we.prototype[gn]=!0,we.prototype[sn]=we.prototype.remove;var Jn;t(je,B),je.of=function(){return this(arguments)},je.prototype.toString=function(){return this.__toString("Stack [","]")},je.prototype.get=function(t,e){var n=this._head;for(t=u(this,t);n&&t--;)n=n.next;return n?n.value:e},je.prototype.peek=function(){return this._head&&this._head.value},je.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,n=arguments.length-1;n>=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):De(t,e)},je.prototype.pushAll=function(t){if(t=p(t),0===t.size)return this;at(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):De(e,n)},je.prototype.pop=function(){return this.slice(1)},je.prototype.unshift=function(){return this.push.apply(this,arguments)},je.prototype.unshiftAll=function(t){return this.pushAll(t)},je.prototype.shift=function(){return this.pop.apply(this,arguments)},je.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Ce()},je.prototype.slice=function(t,e){if(s(t,e,this.size))return this;var n=c(t,this.size),r=f(e,this.size);if(r!==this.size)return B.prototype.slice.call(this,t,e);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):De(i,o)},je.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?De(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},je.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&t(r.value,n++,this)!==!1;)r=r.next;return n},je.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new S(function(){if(r){var e=r.value;return r=r.next,O(t,n++,e)}return w()})},je.isStack=Pe;var Wn="@@__IMMUTABLE_STACK__@@",Zn=je.prototype;Zn[Wn]=!0,Zn.withMutations=Un.withMutations,Zn.asMutable=Un.asMutable,Zn.asImmutable=Un.asImmutable,Zn.wasAltered=Un.wasAltered;var Xn;t(Me,J),Me.of=function(){return this(arguments)},Me.fromKeys=function(t){return this(d(t).keySeq())},Me.prototype.toString=function(){return this.__toString("Set {","}")},Me.prototype.has=function(t){return this._map.has(t)},Me.prototype.add=function(t){return Re(this,this._map.set(t,!0))},Me.prototype.remove=function(t){return Re(this,this._map.remove(t))},Me.prototype.clear=function(){return Re(this,this._map.clear())},Me.prototype.union=function(){var t=an.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n<t.length;n++)_(t[n]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},Me.prototype.intersect=function(){var t=an.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return _(t)});var e=this;return this.withMutations(function(n){e.forEach(function(e){t.every(function(t){return t.includes(e)})||n.remove(e)})})},Me.prototype.subtract=function(){var t=an.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return _(t)});var e=this;return this.withMutations(function(n){e.forEach(function(e){t.some(function(t){return t.includes(e)})&&n.remove(e)})})},Me.prototype.merge=function(){return this.union.apply(this,arguments)},Me.prototype.mergeWith=function(t){var e=an.call(arguments,1);return this.union.apply(this,e)},Me.prototype.sort=function(t){return Ne(It(this,t))},Me.prototype.sortBy=function(t,e){return Ne(It(this,e,t))},Me.prototype.wasAltered=function(){return this._map.wasAltered()},Me.prototype.__iterate=function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},Me.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Me.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Me.isSet=ke;var Qn="@@__IMMUTABLE_SET__@@",$n=Me.prototype;$n[Qn]=!0,$n[sn]=$n.remove,$n.mergeDeep=$n.merge,$n.mergeDeepWith=$n.mergeWith,$n.withMutations=Un.withMutations,$n.asMutable=Un.asMutable,$n.asImmutable=Un.asImmutable,$n.__empty=Le,$n.__make=ze;var tr;t(Ne,Me),Ne.of=function(){return this(arguments)},Ne.fromKeys=function(t){return this(d(t).keySeq())},Ne.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Ne.isOrderedSet=He;var er=Ne.prototype;er[gn]=!0,er.__empty=xe,er.__make=Ue;var nr;t(Ve,Y),Ve.prototype.toString=function(){return this.__toString(Ge(this)+" {","}")},Ve.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Ve.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},Ve.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=qe(this,Jt()))},Ve.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+Ge(this));var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:qe(this,n)},Ve.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:qe(this,e)},Ve.prototype.wasAltered=function(){return this._map.wasAltered()},Ve.prototype.__iterator=function(t,e){var n=this;return d(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},Ve.prototype.__iterate=function(t,e){var n=this;return d(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},Ve.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?qe(this,e,t):(this.__ownerID=t,this._map=e,this)};var rr=Ve.prototype;rr[sn]=rr.remove,rr.deleteIn=rr.removeIn=Un.removeIn,rr.merge=Un.merge,rr.mergeWith=Un.mergeWith,rr.mergeIn=Un.mergeIn,rr.mergeDeep=Un.mergeDeep,rr.mergeDeepWith=Un.mergeDeepWith,rr.mergeDeepIn=Un.mergeDeepIn,rr.setIn=Un.setIn,rr.update=Un.update,rr.updateIn=Un.updateIn,rr.withMutations=Un.withMutations,rr.asMutable=Un.asMutable,rr.asImmutable=Un.asImmutable,t(Be,C),Be.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},Be.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Be.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},Be.prototype.slice=function(t,e){return s(t,e,this.size)?this:(t=c(t,this.size),e=f(e,this.size),t>=e?new Be(0,0):new Be(this.get(t,this._end),this.get(e,this._end),this._step))},Be.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var n=e/this._step;if(n>=0&&n<this.size)return n}return-1},Be.prototype.lastIndexOf=function(t){return this.indexOf(t)},Be.prototype.__iterate=function(t,e){for(var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;n>=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-r:r}return o},Be.prototype.__iterator=function(t,e){var n=this.size-1,r=this._step,i=e?this._start+n*r:this._start,o=0;return new S(function(){var u=i;return i+=e?-r:r,o>n?w():O(t,o++,u)})},Be.prototype.equals=function(t){return t instanceof Be?this._start===t._start&&this._end===t._end&&this._step===t._step:Ye(this,t)};var ir;t(Je,C),Je.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Je.prototype.get=function(t,e){return this.has(t)?this._value:e},Je.prototype.includes=function(t){return W(this._value,t)},Je.prototype.slice=function(t,e){var n=this.size;return s(t,e,n)?this:new Je(this._value,f(e,n)-c(t,n))},Je.prototype.reverse=function(){return this},Je.prototype.indexOf=function(t){return W(this._value,t)?0:-1},Je.prototype.lastIndexOf=function(t){return W(this._value,t)?this.size:-1},Je.prototype.__iterate=function(t,e){for(var n=0;n<this.size;n++)if(t(this._value,n,this)===!1)return n+1;return n},Je.prototype.__iterator=function(t,e){var n=this,r=0;return new S(function(){return r<n.size?O(t,r++,n._value):w()})},Je.prototype.equals=function(t){return t instanceof Je?W(this._value,t._value):Ye(t)};var or;h.Iterator=S,We(h,{toArray:function(){at(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new ct(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new st(this,!0)},toMap:function(){return Nt(this.toKeyedSeq())},toObject:function(){at(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return we(this.toKeyedSeq())},toOrderedSet:function(){return Ne(y(this)?this.valueSeq():this)},toSet:function(){return Me(y(this)?this.valueSeq():this)},toSetSeq:function(){return new ft(this)},toSeq:function(){return g(this)?this.toIndexedSeq():y(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return je(y(this)?this.valueSeq():this)},toList:function(){return fe(y(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=an.call(arguments,0);return Pt(this,St(this,t))},includes:function(t){return this.some(function(e){return W(e,t)})},entries:function(){return this.__iterator(Sn)},every:function(t,e){at(this.size);var n=!0;return this.__iterate(function(r,i,o){return t.call(e,r,i,o)?void 0:(n=!1,!1)}),n},filter:function(t,e){return Pt(this,_t(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},findEntry:function(t,e){var n;return this.__iterate(function(r,i,o){return t.call(e,r,i,o)?(n=[i,r],!1):void 0}),n},findLastEntry:function(t,e){return this.toSeq().reverse().findEntry(t,e)},forEach:function(t,e){return at(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){at(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!==r&&void 0!==r?r.toString():""}),e},keys:function(){return this.__iterator(mn)},map:function(t,e){return Pt(this,dt(this,t,e))},reduce:function(t,e,n){at(this.size);var r,i;return arguments.length<2?i=!0:r=e,this.__iterate(function(e,o,u){i?(i=!1,r=e):r=t.call(n,r,e,o,u)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Pt(this,pt(this,!0))},slice:function(t,e){return Pt(this,gt(this,t,e,!0))},some:function(t,e){return!this.every(Qe(t),e)},sort:function(t){return Pt(this,It(this,t))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return o(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return vt(this,t,e)},equals:function(t){return Ye(this,t)},entrySeq:function(){var t=this;if(t._cache)return new k(t._cache);var e=t.toSeq().map(Xe).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Qe(t),e)},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},first:function(){return this.find(a)},flatMap:function(t,e){return Pt(this,wt(this,t,e))},flatten:function(t){return Pt(this,Ot(this,t,!0))},fromEntrySeq:function(){return new lt(this)},get:function(t,e){return this.find(function(e,n){return W(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=Lt(t);!(n=i.next()).done;){var o=n.value;if(r=r&&r.get?r.get(o,hn):hn,r===hn)return e}return r},groupBy:function(t,e){return yt(this,t,e)},has:function(t){return this.get(t,hn)!==hn},hasIn:function(t){return this.getIn(t,hn)!==hn},isSubset:function(t){return t="function"==typeof t.includes?t:h(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:h(t),t.isSubset(this)},keySeq:function(){return this.toSeq().map(Ze).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Tt(this,t)},maxBy:function(t,e){return Tt(this,e,t)},min:function(t){return Tt(this,t?$e(t):nn)},minBy:function(t,e){return Tt(this,e?$e(e):nn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Pt(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Pt(this,bt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Qe(t),e)},sortBy:function(t,e){return Pt(this,It(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Pt(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Pt(this,mt(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Qe(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=rn(this))}});var ur=h.prototype;ur[_n]=!0,ur[En]=ur.values,ur.__toJS=ur.toArray,ur.__toStringMapper=tn,ur.inspect=ur.toSource=function(){return this.toString()},ur.chain=ur.flatMap,ur.contains=ur.includes,function(){try{Object.defineProperty(ur,"length",{get:function(){if(!h.noLengthWarning){var t;try{throw new Error}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}(),We(d,{flip:function(){return Pt(this,ht(this))},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return W(e,t)})},lastKeyOf:function(t){return this.findLastKey(function(e){return W(e,t)})},mapEntries:function(t,e){var n=this,r=0;return Pt(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return Pt(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var ar=d.prototype;ar[vn]=!0,ar[En]=ur.entries,ar.__toJS=ur.toObject,ar.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+tn(t)},We(p,{toKeyedSeq:function(){return new st(this,!1)},filter:function(t,e){return Pt(this,_t(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){return this.toSeq().reverse().indexOf(t)},reverse:function(){return Pt(this,pt(this,!1))},slice:function(t,e){return Pt(this,gt(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=c(t,0>t?this.count():this.size);var r=this.slice(0,t);return Pt(this,1===n?r:r.concat(i(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.toKeyedSeq().findLastKey(t,e);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(t){return Pt(this,Ot(this,t,!1))},get:function(t,e){return t=u(this,t),0>t||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Pt(this,Et(this,t))},interleave:function(){var t=[this].concat(i(arguments)),e=jt(this.toSeq(),C.of,t),n=e.flatten(!0);return e.size&&(n.size=e.size*t.length),Pt(this,n)},last:function(){return this.get(-1)},skipWhile:function(t,e){return Pt(this,bt(this,t,e,!1))},zip:function(){var t=[this].concat(i(arguments));return Pt(this,jt(this,en,t))},zipWith:function(t){var e=i(arguments);return e[0]=this,Pt(this,jt(this,t,e))}}),p.prototype[yn]=!0,p.prototype[gn]=!0,We(_,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),_.prototype.has=ur.includes,We(D,d.prototype),We(C,p.prototype),We(M,_.prototype),We(Y,d.prototype),We(B,p.prototype),We(J,_.prototype);var sr={Iterable:h,Seq:P,Collection:K,Map:Nt,OrderedMap:we,List:fe,Stack:je,Set:Me,OrderedSet:Ne,Record:Ve,Range:Be,Repeat:Je,is:W,fromJS:Z};return sr})},function(t,e){"use strict";function n(t){return t&&"object"==typeof t&&toString.call(t)}function r(t){return"number"==typeof t&&t>-1&&t%1===0&&t<=Number.MAX_VALUE}var i=Function.prototype.bind;e.isString=function(t){return"string"==typeof t||"[object String]"===n(t)},e.isArray=Array.isArray||function(t){return"[object Array]"===n(t)},"function"!=typeof/./&&"object"!=typeof Int8Array?e.isFunction=function(t){return"function"==typeof t||!1}:e.isFunction=function(t){return"[object Function]"===toString.call(t)},e.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},e.extend=function(t){var e=arguments.length;if(!t||2>e)return t||{};for(var n=1;e>n;n++)for(var r=arguments[n],i=Object.keys(r),o=i.length,u=0;o>u;u++){var a=i[u];t[a]=r[a]}return t},e.clone=function(t){return e.isObject(t)?e.isArray(t)?t.slice():e.extend({},t):t},e.each=function(t,e,n){var i,o,u=t?t.length:0,a=-1;if(n&&(o=e,e=function(t,e,r){return o.call(n,t,e,r)}),r(u))for(;++a<u&&e(t[a],a,t)!==!1;);else for(i=Object.keys(t),u=i.length;++a<u&&e(t[i[a]],i[a],t)!==!1;);return t},e.partial=function(t){var e=Array.prototype.slice,n=e.call(arguments,1);return function(){return t.apply(this,n.concat(e.call(arguments)))}},e.toFactory=function(t){var e=function(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return new(i.apply(t,[null].concat(n)))};return e.__proto__=t,e.prototype=t.prototype,e}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return c["default"].Iterable.isIterable(t)}function o(t){return i(t)||!(0,f.isObject)(t)}function u(t){return i(t)?t.toJS():t}function a(t){return i(t)?t:c["default"].fromJS(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.isImmutable=i,e.isImmutableValue=o,e.toJS=u,e.toImmutable=a;var s=n(3),c=r(s),f=n(4)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),s=n(3),c=i(s),f=n(7),l=i(f),h=n(8),d=r(h),p=n(11),_=n(10),v=n(5),y=n(4),g=n(12),m=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];u(this,t);var n=!!e.debug,r=n?g.DEBUG_OPTIONS:g.PROD_OPTIONS,i=new g.ReactorState({debug:n,options:r.merge(e.options||{})});this.prevReactorState=i,this.reactorState=i,this.observerState=new g.ObserverState,this.ReactMixin=(0,l["default"])(this),this.__batchDepth=0,this.__isDispatching=!1}return a(t,[{key:"evaluate",value:function(t){var e=d.evaluate(this.reactorState,t),n=e.result,r=e.reactorState;return this.reactorState=r,n}},{key:"evaluateToJS",value:function(t){return(0,v.toJS)(this.evaluate(t))}},{key:"observe",value:function(t,e){var n=this;1===arguments.length&&(e=t,t=[]);var r=d.addObserver(this.observerState,t,e),i=r.observerState,o=r.entry;return this.observerState=i,function(){n.observerState=d.removeObserverByEntry(n.observerState,o)}}},{key:"unobserve",value:function(t,e){if(0===arguments.length)throw new Error("Must call unobserve with a Getter");if(!(0,_.isGetter)(t)&&!(0,p.isKeyPath)(t))throw new Error("Must call unobserve with a Getter");this.observerState=d.removeObserver(this.observerState,t,e)}},{key:"dispatch",value:function(t,e){if(0===this.__batchDepth){if(d.getOption(this.reactorState,"throwOnDispatchInDispatch")&&this.__isDispatching)throw this.__isDispatching=!1,new Error("Dispatch may not be called while a dispatch is in progress");this.__isDispatching=!0}try{this.reactorState=d.dispatch(this.reactorState,t,e)}catch(n){throw this.__isDispatching=!1,n}try{this.__notify()}finally{this.__isDispatching=!1}}},{key:"batch",value:function(t){this.batchStart(),t(),this.batchEnd()}},{key:"registerStore",value:function(t,e){console.warn("Deprecation warning: `registerStore` will no longer be supported in 1.1, use `registerStores` instead"),this.registerStores(o({},t,e))}},{key:"registerStores",value:function(t){this.reactorState=d.registerStores(this.reactorState,t),this.__notify()}},{key:"replaceStores",value:function(t){this.reactorState=d.replaceStores(this.reactorState,t)}},{key:"serialize",value:function(){return d.serialize(this.reactorState)}},{key:"loadState",value:function(t){this.reactorState=d.loadState(this.reactorState,t),this.__notify()}},{key:"reset",value:function(){var t=d.reset(this.reactorState);this.reactorState=t,this.prevReactorState=t,this.observerState=new g.ObserverState}},{key:"__notify",value:function(){var t=this;if(!(this.__batchDepth>0)){var e=this.reactorState.get("dirtyStores");if(0!==e.size){var n=c["default"].Set().withMutations(function(n){n.union(t.observerState.get("any")),e.forEach(function(e){var r=t.observerState.getIn(["stores",e]);r&&n.union(r)})});n.forEach(function(e){var n=t.observerState.getIn(["observersMap",e]);if(n){var r=n.get("getter"),i=n.get("handler"),o=d.evaluate(t.prevReactorState,r),u=d.evaluate(t.reactorState,r);
|
|
t.prevReactorState=o.reactorState,t.reactorState=u.reactorState;var a=o.result,s=u.result;c["default"].is(a,s)||i.call(null,s)}});var r=d.resetDirtyStores(this.reactorState);this.prevReactorState=r,this.reactorState=r}}}},{key:"batchStart",value:function(){this.__batchDepth++}},{key:"batchEnd",value:function(){if(this.__batchDepth--,this.__batchDepth<=0){this.__isDispatching=!0;try{this.__notify()}catch(t){throw this.__isDispatching=!1,t}this.__isDispatching=!1}}}]),t}();e["default"]=(0,y.toFactory)(m),t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n={};return(0,o.each)(e,function(e,r){n[r]=t.evaluate(e)}),n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(4);e["default"]=function(t){return{getInitialState:function(){return i(t,this.getDataBindings())},componentDidMount:function(){var e=this;this.__unwatchFns=[],(0,o.each)(this.getDataBindings(),function(n,i){var o=t.observe(n,function(t){e.setState(r({},i,t))});e.__unwatchFns.push(o)})},componentWillUnmount:function(){for(;this.__unwatchFns.length;)this.__unwatchFns.shift()()}}},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return new M({result:t,reactorState:e})}function o(t,e){return t.withMutations(function(t){(0,C.each)(e,function(e,n){t.getIn(["stores",n])&&console.warn("Store already defined for id = "+n);var r=e.getInitialState();if(void 0===r&&f(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store getInitialState() must return a value, did you forget a return statement");if(f(t,"throwOnNonImmutableStore")&&!(0,j.isImmutableValue)(r))throw new Error("Store getInitialState() must return an immutable value, did you forget to call toImmutable");t.update("stores",function(t){return t.set(n,e)}).update("state",function(t){return t.set(n,r)}).update("dirtyStores",function(t){return t.add(n)}).update("storeStates",function(t){return w(t,[n])})}),O(t)})}function u(t,e){return t.withMutations(function(t){(0,C.each)(e,function(e,n){t.update("stores",function(t){return t.set(n,e)})})})}function a(t,e,n){if(void 0===e&&f(t,"throwOnUndefinedActionType"))throw new Error("`dispatch` cannot be called with an `undefined` action type.");var r=t.get("state"),i=t.get("dirtyStores"),o=r.withMutations(function(r){A["default"].dispatchStart(t,e,n),t.get("stores").forEach(function(o,u){var a=r.get(u),s=void 0;try{s=o.handle(a,e,n)}catch(c){throw A["default"].dispatchError(t,c.message),c}if(void 0===s&&f(t,"throwOnUndefinedStoreReturnValue")){var l="Store handler must return a value, did you forget a return statement";throw A["default"].dispatchError(t,l),new Error(l)}r.set(u,s),a!==s&&(i=i.add(u))}),A["default"].dispatchEnd(t,r,i)}),u=t.set("state",o).set("dirtyStores",i).update("storeStates",function(t){return w(t,i)});return O(u)}function s(t,e){var n=[],r=(0,j.toImmutable)({}).withMutations(function(r){(0,C.each)(e,function(e,i){var o=t.getIn(["stores",i]);if(o){var u=o.deserialize(e);void 0!==u&&(r.set(i,u),n.push(i))}})}),i=I["default"].Set(n);return t.update("state",function(t){return t.merge(r)}).update("dirtyStores",function(t){return t.union(i)}).update("storeStates",function(t){return w(t,n)})}function c(t,e,n){var r=e;(0,D.isKeyPath)(e)&&(e=(0,P.fromKeyPath)(e));var i=t.get("nextId"),o=(0,P.getStoreDeps)(e),u=I["default"].Map({id:i,storeDeps:o,getterKey:r,getter:e,handler:n}),a=void 0;return a=0===o.size?t.update("any",function(t){return t.add(i)}):t.withMutations(function(t){o.forEach(function(e){var n=["stores",e];t.hasIn(n)||t.setIn(n,I["default"].Set()),t.updateIn(["stores",e],function(t){return t.add(i)})})}),a=a.set("nextId",i+1).setIn(["observersMap",i],u),{observerState:a,entry:u}}function f(t,e){var n=t.getIn(["options",e]);if(void 0===n)throw new Error("Invalid option: "+e);return n}function l(t,e,n){var r=t.get("observersMap").filter(function(t){var r=t.get("getterKey"),i=!n||t.get("handler")===n;return i?(0,D.isKeyPath)(e)&&(0,D.isKeyPath)(r)?(0,D.isEqual)(e,r):e===r:!1});return t.withMutations(function(t){r.forEach(function(e){return h(t,e)})})}function h(t,e){return t.withMutations(function(t){var n=e.get("id"),r=e.get("storeDeps");0===r.size?t.update("any",function(t){return t.remove(n)}):r.forEach(function(e){t.updateIn(["stores",e],function(t){return t?t.remove(n):t})}),t.removeIn(["observersMap",n])})}function d(t){var e=t.get("state");return t.withMutations(function(t){var n=t.get("stores"),r=n.keySeq().toJS();n.forEach(function(n,r){var i=e.get(r),o=n.handleReset(i);if(void 0===o&&f(t,"throwOnUndefinedStoreReturnValue"))throw new Error("Store handleReset() must return a value, did you forget a return statement");if(f(t,"throwOnNonImmutableStore")&&!(0,j.isImmutableValue)(o))throw new Error("Store reset state must be an immutable value, did you forget to call toImmutable");t.setIn(["state",r],o)}),t.update("storeStates",function(t){return w(t,r)}),v(t)})}function p(t,e){var n=t.get("state");if((0,D.isKeyPath)(e))return i(n.getIn(e),t);if(!(0,P.isGetter)(e))throw new Error("evaluate must be passed a keyPath or Getter");if(m(t,e))return i(S(t,e),t);var r=(0,P.getDeps)(e).map(function(e){return p(t,e).result}),o=(0,P.getComputeFn)(e).apply(null,r);return i(o,b(t,e,o))}function _(t){var e={};return t.get("stores").forEach(function(n,r){var i=t.getIn(["state",r]),o=n.serialize(i);void 0!==o&&(e[r]=o)}),e}function v(t){return t.set("dirtyStores",I["default"].Set())}function y(t){return t}function g(t,e){var n=y(e);return t.getIn(["cache",n])}function m(t,e){var n=g(t,e);if(!n)return!1;var r=n.get("storeStates");return 0===r.size?!1:r.every(function(e,n){return t.getIn(["storeStates",n])===e})}function b(t,e,n){var r=y(e),i=t.get("dispatchId"),o=(0,P.getStoreDeps)(e),u=(0,j.toImmutable)({}).withMutations(function(e){o.forEach(function(n){var r=t.getIn(["storeStates",n]);e.set(n,r)})});return t.setIn(["cache",r],I["default"].Map({value:n,storeStates:u,dispatchId:i}))}function S(t,e){var n=y(e);return t.getIn(["cache",n,"value"])}function O(t){return t.update("dispatchId",function(t){return t+1})}function w(t,e){return t.withMutations(function(t){e.forEach(function(e){var n=t.has(e)?t.get(e)+1:1;t.set(e,n)})})}Object.defineProperty(e,"__esModule",{value:!0}),e.registerStores=o,e.replaceStores=u,e.dispatch=a,e.loadState=s,e.addObserver=c,e.getOption=f,e.removeObserver=l,e.removeObserverByEntry=h,e.reset=d,e.evaluate=p,e.serialize=_,e.resetDirtyStores=v;var E=n(3),I=r(E),T=n(9),A=r(T),j=n(5),P=n(10),D=n(11),C=n(4),M=I["default"].Record({result:null,reactorState:null})},function(t,e,n){"use strict";var r=n(8);e.dispatchStart=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.groupCollapsed("Dispatch: %s",e),console.group("payload"),console.debug(n),console.groupEnd())},e.dispatchError=function(t,e){(0,r.getOption)(t,"logDispatches")&&console.group&&(console.debug("Dispatch error: "+e),console.groupEnd())},e.dispatchEnd=function(t,e,n){(0,r.getOption)(t,"logDispatches")&&console.group&&((0,r.getOption)(t,"logDirtyStores")&&console.log("Stores updated:",n.toList().toJS()),(0,r.getOption)(t,"logAppState")&&console.debug("Dispatch done, new state: ",e.toJS()),console.groupEnd())}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,h.isArray)(t)&&(0,h.isFunction)(t[t.length-1])}function o(t){return t[t.length-1]}function u(t){return t.slice(0,t.length-1)}function a(t,e){e||(e=l["default"].Set());var n=l["default"].Set().withMutations(function(e){if(!i(t))throw new Error("getFlattenedDeps must be passed a Getter");u(t).forEach(function(t){if((0,d.isKeyPath)(t))e.add((0,f.List)(t));else{if(!i(t))throw new Error("Invalid getter, each dependency must be a KeyPath or Getter");e.union(a(t))}})});return e.union(n)}function s(t){if(!(0,d.isKeyPath)(t))throw new Error("Cannot create Getter from KeyPath: "+t);return[t,p]}function c(t){if(t.hasOwnProperty("__storeDeps"))return t.__storeDeps;var e=a(t).map(function(t){return t.first()}).filter(function(t){return!!t});return Object.defineProperty(t,"__storeDeps",{enumerable:!1,configurable:!1,writable:!1,value:e}),e}Object.defineProperty(e,"__esModule",{value:!0});var f=n(3),l=r(f),h=n(4),d=n(11),p=function(t){return t};e["default"]={isGetter:i,getComputeFn:o,getFlattenedDeps:a,getStoreDeps:c,getDeps:u,fromKeyPath:s},t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,s.isArray)(t)&&!(0,s.isFunction)(t[t.length-1])}function o(t,e){var n=a["default"].List(t),r=a["default"].List(e);return a["default"].is(n,r)}Object.defineProperty(e,"__esModule",{value:!0}),e.isKeyPath=i,e.isEqual=o;var u=n(3),a=r(u),s=n(4)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=(0,r.Map)({logDispatches:!1,logAppState:!1,logDirtyStores:!1,throwOnUndefinedActionType:!1,throwOnUndefinedStoreReturnValue:!1,throwOnNonImmutableStore:!1,throwOnDispatchInDispatch:!1});e.PROD_OPTIONS=i;var o=(0,r.Map)({logDispatches:!0,logAppState:!0,logDirtyStores:!0,throwOnUndefinedActionType:!0,throwOnUndefinedStoreReturnValue:!0,throwOnNonImmutableStore:!0,throwOnDispatchInDispatch:!0});e.DEBUG_OPTIONS=o;var u=(0,r.Record)({dispatchId:0,state:(0,r.Map)(),stores:(0,r.Map)(),cache:(0,r.Map)(),storeStates:(0,r.Map)(),dirtyStores:(0,r.Set)(),debug:!1,options:i});e.ReactorState=u;var a=(0,r.Record)({any:(0,r.Set)(),stores:(0,r.Map)({}),observersMap:(0,r.Map)({}),nextId:1});e.ObserverState=a}])})},,function(t,e){"use strict";var n=function(t){var e,n={};if(!(t instanceof Object)||Array.isArray(t))throw new Error("keyMirror(...): Argument must be an object.");for(e in t)t.hasOwnProperty(e)&&(n[e]=e);return n};t.exports=n},function(t,e,n){"use strict";var r=n(61),i=r.a;Object.defineProperty(e,"a",{configurable:!1,enumerable:!0,get:function(){return i}})},function(t,e,n){"use strict";var r=n(83),i=n(85),o=r.a;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return o}});var u=i;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return u}})},,function(t,e,n){"use strict";function r(t){t.registerStores({restApiCache:c.a})}function i(t){return[["restApiCache",t.entity],function(t){return!!t}]}function o(t){return[["restApiCache",t.entity],function(t){return t||a.toImmutable.bind()({})}]}function u(t){return function(e){return["restApiCache",t.entity,e]}}var a=n(1),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var c=n(110),f=n(109);e.register=r,e.createHasDataGetter=i,e.createEntityMapGetter=o,e.createByIdGetter=u;var l=f.a;Object.defineProperty(e,"createApiActions",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({ENTITY_HISTORY_DATE_SELECTED:null,ENTITY_HISTORY_FETCH_START:null,ENTITY_HISTORY_FETCH_ERROR:null,ENTITY_HISTORY_FETCH_SUCCESS:null,RECENT_ENTITY_HISTORY_FETCH_START:null,RECENT_ENTITY_HISTORY_FETCH_ERROR:null,RECENT_ENTITY_HISTORY_FETCH_SUCCESS:null,LOG_OUT:null})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({LOGBOOK_DATE_SELECTED:null,LOGBOOK_ENTRIES_FETCH_START:null,LOGBOOK_ENTRIES_FETCH_ERROR:null,LOGBOOK_ENTRIES_FETCH_SUCCESS:null})},function(t,e,n){"use strict";var r=n(111),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(41),u=i.a;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return u}});var a=o;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return a}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({VALIDATING_AUTH_TOKEN:null,VALID_AUTH_TOKEN:null,INVALID_AUTH_TOKEN:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){t.registerStores({authAttempt:i.a,authCurrent:o.a,rememberAuth:u.a})}var i=n(64),o=n(65),u=n(66),a=n(62),s=n(63);e.register=r;var c=a;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return c}});var f=s;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(1),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(84),c=n(26),f=n(4),l=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),d="entity",p=new u.Immutable.Record({entityId:null,domain:null,objectId:null,state:null,entityDisplay:null,stateDisplay:null,lastChanged:null,lastChangedAsDate:null,lastUpdated:null,lastUpdatedAsDate:null,attributes:{},isCustomGroup:null},"Entity"),_=function(t){function e(t,n,o,u){var a=arguments.length<=4||void 0===arguments[4]?{}:arguments[4];r(this,e);var s=t.split("."),f=l(s,2),h=f[0],d=f[1],p=n.replace(/_/g," ");return a.unit_of_measurement&&(p+=" "+a.unit_of_measurement),i(this,Object.getPrototypeOf(e).call(this,{entityId:t,domain:h,objectId:d,state:n,stateDisplay:p,lastChanged:o,lastUpdated:u,attributes:a,entityDisplay:a.friendly_name||d.replace(/_/g," "),lastChangedAsDate:c.a.bind()(o),lastUpdatedAsDate:c.a.bind()(u),isCustomGroup:"group"===h&&!a.auto}))}return o(e,t),h(e,[{key:"domainModel",value:function(t){if("media_player"!==this.domain)throw new Error("Domain does not have a model");return new s.a(t,this)}},{key:"id",get:function(){return this.entityId}}],[{key:"save",value:function(t,e){var n=u.toJS.bind()(e),r=n.entityId,i=n.state,o=n.attributes,a=void 0===o?{}:o,s={state:i,attributes:a};return f.a.bind()(t,"POST","states/"+r,s)}},{key:"fetch",value:function(t,e){return f.a.bind()(t,"GET","states/"+e)}},{key:"fetchAll",value:function(t){return f.a.bind()(t,"GET","states")}},{key:"fromJSON",value:function(t){var n=t.entity_id,r=t.state,i=t.last_changed,o=t.last_updated,u=t.attributes;return new e(n,r,i,o,u)}}]),e}(p);_.entity=d,e.a=_},,,function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({SERVER_CONFIG_LOADED:null,COMPONENT_LOADED:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){t.registerStores({serverComponent:i.a,serverConfig:o.a})}var i=n(69),o=n(70),u=n(67),a=n(68);e.register=r;var s=u;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return s}});var c=a;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return c}})},function(t,e,n){"use strict";var r=n(88),i=n(89),o=r.a;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return o}});var u=i;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return u}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({NAVIGATE:null,SHOW_SIDEBAR:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){t.registerStores({notifications:i.a})}var i=n(106),o=n(104),u=n(105);e.register=r;var a=o;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return a}});var s=u;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({API_FETCH_SUCCESS:null,API_FETCH_START:null,API_FETCH_FAIL:null,API_SAVE_SUCCESS:null,API_SAVE_START:null,API_SAVE_FAIL:null,API_DELETE_SUCCESS:null,API_DELETE_START:null,API_DELETE_FAIL:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){t.registerStores({streamStatus:i.a})}var i=n(118),o=n(114),u=n(115);e.register=r;var a=o;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return a}});var s=u;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({API_FETCH_ALL_START:null,API_FETCH_ALL_SUCCESS:null,API_FETCH_ALL_FAIL:null,SYNC_SCHEDULED:null,SYNC_SCHEDULE_CANCELLED:null})},function(t,e,n){"use strict";function r(t){t.registerStores({isFetchingData:i.a,isSyncScheduled:o.a})}var i=n(120),o=n(121),u=n(119),a=n(44);e.register=r;var s=u;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return s}});var c=a;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return c}})},function(t,e,n){"use strict";function r(t){return t.getUTCFullYear()+"-"+(t.getUTCMonth()+1)+"-"+t.getUTCDate()}e.a=r},function(t,e,n){"use strict";function r(t){return new Date(t)}e.a=r},,,,function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function r(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;10>n;n++)e["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==r.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(o){return!1}}var i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=r()?Object.assign:function(t,e){for(var r,u,a=n(t),s=1;s<arguments.length;s++){r=Object(arguments[s]);for(var c in r)i.call(r,c)&&(a[c]=r[c]);if(Object.getOwnPropertySymbols){u=Object.getOwnPropertySymbols(r);for(var f=0;f<u.length;f++)o.call(r,u[f])&&(a[u[f]]=r[u[f]])}}return a}},function(t,e,n){"use strict";function r(){var t=new Date((new Date).getTime()-80*Math.random()*60*1e3);return t.toISOString()}function i(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];u.push({state:e,attributes:n,entity_id:t,last_changed:r(),last_updated:r()})}function o(t,e,n,r,o){a++;var u={entity_id:n,order:a};r&&(u.friendly_name=r),o&&(u.view=o,u.hidden=!0),i("group."+t,e,u)}var u=[],a=0;i("a.demo_mode","enabled"),i("configurator.philips_hue","configure",{configure_id:"4415244496-1",description:"Press the button on the bridge to register Philips Hue with Home Assistant.",description_image:"/demo/images/config_philips_hue.jpg",fields:[],submit_caption:"I have pressed the button"}),o("default_view","on",["a.demo_mode","sensor.humidity","sensor.temperature","device_tracker.paulus","device_tracker.anne_therese","configurator.philips_hue","group.cooking","group.general","group.rooms","camera.living_room","media_player.living_room","scene.romantic","scene.good_morning","script.water_lawn"],"Main",!0),o("rooms_view","on",["group.living_room","group.bedroom"],"Rooms",!0),o("rooms","on",["group.living_room","group.bedroom"]),i("device_tracker.anne_therese","school",{entity_picture:"https://graph.facebook.com/621994601/picture",friendly_name:"Anne Therese",latitude:32.879898,longitude:-117.236776,gps_accuracy:250,battery:76}),i("device_tracker.paulus","not_home",{entity_picture:"https://graph.facebook.com/297400035/picture",friendly_name:"Paulus",gps_accuracy:75,latitude:32.89295,longitude:-117.203431,battery:56}),i("zone.school","zoning",{radius:250,latitude:32.880834,longitude:-117.237556,icon:"mdi:library",hidden:!0}),i("zone.work","zoning",{radius:250,latitude:32.896844,longitude:-117.202204,icon:"mdi:worker",hidden:!0}),i("zone.home","zoning",{radius:100,latitude:32.873708,longitude:-117.22659,icon:"mdi:home",hidden:!0}),o("general","on",["alarm_control_panel.home","garage_door.garage_door","lock.kitchen_door","thermostat.nest","camera.living_room"]),i("camera.living_room","idle",{entity_picture:"/demo/webcam.jpg?"}),i("garage_door.garage_door","open"),i("alarm_control_panel.home","armed_home",{friendly_name:"Alarm",code_format:"^\\d{4}"}),i("lock.kitchen_door","open"),i("script.water_lawn","off",{friendly_name:"Water Lawn"}),i("scene.romantic","scening",{friendly_name:"Romantic"}),o("living_room","on",["light.table_lamp","light.ceiling","light.tv_back_light","switch.ac","media_player.living_room"]),i("light.tv_back_light","off",{friendly_name:"TV Back Light"}),i("light.ceiling","on",{friendly_name:"Ceiling Lights",brightness:200,rgb_color:[255,116,155]}),i("light.table_lamp","on",{brightness:200,rgb_color:[150,212,94]}),i("switch.ac","on",{friendly_name:"AC",icon:"mdi:air-conditioner"}),i("media_player.living_room","playing",{entity_picture:"/demo/images/thrones.jpg",friendly_name:"Chromecast",supported_media_commands:509,media_content_type:"tvshow",media_title:"The Dance of Dragons",media_series_title:"Game of Thrones",media_season:5,media_episode:"09",app_name:"HBO Now"}),o("bedroom","off",["light.bed_light","switch.decorative_lights","rollershutter.bedroom_window"]),i("switch.decorative_lights","off"),i("light.bed_light","off"),i("rollershutter.bedroom_window","closed",{friendly_name:"Window",current_position:0}),i("sensor.temperature","15.6",{unit_of_measurement:"°C",friendly_name:"Temperature"}),i("sensor.humidity","54",{unit_of_measurement:"%",friendly_name:"Humidity"}),i("thermostat.nest","23",{away_mode:"off",temperature:"21",current_temperature:"18",unit_of_measurement:"°C"}),i("input_select.cook_today","Paulus",{options:["Paulus","Anne Therese"],icon:"mdi:panda"}),i("input_boolean.notify_cook","on",{icon:"mdi:alarm"}),o("cooking","unknown",["input_select.cook_today","input_boolean.notify_cook"]),e.a=u},function(t,e,n){"use strict";var r=n(1),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=["isLoadingEntityHistory"];Object.defineProperty(e,"isLoadingEntityHistory",{configurable:!1,enumerable:!0,get:function(){return o}});var u=["currentEntityHistoryDate"];Object.defineProperty(e,"currentDate",{configurable:!1,enumerable:!0,get:function(){return u}});var a=["entityHistory"];Object.defineProperty(e,"entityHistoryMap",{configurable:!1,enumerable:!0,get:function(){return a}});var s=[u,a,function(t,e){return e.get(t)||r.toImmutable.bind()({})}];Object.defineProperty(e,"entityHistoryForCurrentDate",{configurable:!1,enumerable:!0,get:function(){return s}});var c=[u,a,function(t,e){return!!e.get(t)}];Object.defineProperty(e,"hasDataForCurrentDate",{configurable:!1,enumerable:!0,get:function(){return c}});var f=["recentEntityHistory"];Object.defineProperty(e,"recentEntityHistoryMap",{configurable:!1,enumerable:!0,get:function(){return f}});var l=["recentEntityHistory"];Object.defineProperty(e,"recentEntityHistoryUpdatedMap",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";function r(t){t.registerStores({currentEntityHistoryDate:i.a,entityHistory:o.a,isLoadingEntityHistory:u.a,recentEntityHistory:a.a,recentEntityHistoryUpdated:s.a})}var i=n(78),o=n(79),u=n(80),a=n(81),s=n(82),c=n(77),f=n(32);e.register=r;var l=c;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return l}});var h=f;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return h}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(1),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(4),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f="event",l=new u.Immutable.Record({event:null,listenerCount:0},"Event"),h=function(t){function e(t){var n=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return r(this,e),i(this,Object.getPrototypeOf(e).call(this,{event:t,listenerCount:n}))}return o(e,t),c(e,[{key:"id",get:function(){return this.event}}],[{key:"fetchAll",value:function(t){return s.a.bind()(t,"GET","events")}},{key:"fromJSON",value:function(t){var n=t.event,r=t.listener_count;return new e(n,r)}}]),e}(l);h.entity=f,e.a=h},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({SELECT_ENTITY:null,LOG_OUT:null})},function(t,e,n){"use strict";function r(t){t.registerStores({moreInfoEntityId:i.a})}var i=n(100),o=n(98),u=n(99);e.register=r;var a=o;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return a}});var s=u;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";function r(t,e){t.dispatch(o.a.SHOW_SIDEBAR,{show:e})}function i(t,e){t.dispatch(o.a.NAVIGATE,{pane:e})}var o=n(19);e.showSidebar=r,e.navigate=i},function(t,e,n){"use strict";function r(t){return[i,function(e){return e===t}]}e.isActivePane=r;var i=["selectedNavigationPanel"];Object.defineProperty(e,"activePane",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["showSidebar"];Object.defineProperty(e,"showSidebar",{configurable:!1,enumerable:!0,get:function(){return o}})},function(t,e,n){"use strict";function r(t){t.registerStores({selectedNavigationPanel:i.a,showSidebar:o.a})}var i=n(101),o=n(102),u=n(37),a=n(38),s=n(103);e.register=r;var c=u;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return c}});var f=a;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return f}});var l=s;Object.defineProperty(e,"urlSync",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({NOTIFICATION_CREATED:null})},function(t,e,n){"use strict";function r(t,e){return[l(t),function(t){return!!t&&t.services.has(e)}]}function i(t){return[u.getters.byId(t),f,s.a]}var o=n(7),u=n(5),a=n(42),s=n(113);e.hasService=r,e.canToggleEntity=i;var c=o.createHasDataGetter.bind()(a.a);Object.defineProperty(e,"hasData",{configurable:!1,enumerable:!0,get:function(){return c}});var f=o.createEntityMapGetter.bind()(a.a);Object.defineProperty(e,"entityMap",{configurable:!1,enumerable:!0,get:function(){return f}});var l=o.createByIdGetter.bind()(a.a);Object.defineProperty(e,"byDomain",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(1),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(4),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f="service",l=new u.Immutable.Record({domain:null,services:[]},"ServiceDomain"),h=function(t){function e(t,n){return r(this,e),i(this,Object.getPrototypeOf(e).call(this,{domain:t,services:n}))}return o(e,t),c(e,[{key:"id",get:function(){return this.domain}}],[{key:"fetchAll",value:function(){return s.a.bind()("GET","services")}},{key:"fromJSON",value:function(t){var n=t.domain,r=t.services;return new e(n,u.toImmutable.bind()(r))}}]),e}(l);h.entity=f,e.a=h},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({STREAM_START:null,STREAM_STOP:null,STREAM_ERROR:null})},function(t,e,n){"use strict";var r=n(5),i=n(18),o=n(10),u=[r.getters.hasData,i.getters.hasData,o.getters.hasData,function(t,e,n){return t&&e&&n}];Object.defineProperty(e,"isDataLoaded",{configurable:!1,enumerable:!0,get:function(){return u}});var a=["isFetchingData"];Object.defineProperty(e,"isFetching",{configurable:!1,enumerable:!0,get:function(){return a}});var s=["isSyncScheduled"];Object.defineProperty(e,"isSyncScheduled",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({SELECT_VIEW:null})},function(t,e,n){"use strict";function r(t){t.registerStores({currentView:i.a})}var i=n(126),o=n(124),u=n(125);e.register=r;var a=o;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return a}});var s=u;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";var r=n(3),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i}),e.a=i.a.bind()({VOICE_START:null,VOICE_RESULT:null,VOICE_TRANSMITTING:null,VOICE_DONE:null,VOICE_ERROR:null})},function(t,e,n){"use strict";function r(t){return!t||(new Date).getTime()-t>6e4}e.a=r},,,,,,,,,function(t,e,n){var r=n(193);t.exports=function(t,e,n){function i(){var f=r()-s;e>f&&f>0?o=setTimeout(i,e-f):(o=null,n||(c=t.apply(a,u),o||(a=u=null)))}var o,u,a,s,c;return null==e&&(e=100),function(){a=this,u=arguments,s=r();var f=n&&!o;return o||(o=setTimeout(i,e)),f&&(c=t.apply(a,u),a=u=null),c}}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function");
|
|
}var i=n(107),o=n(132),u=n(134),a=n(136),s=n(12),c=n(17),f=n(5),l=n(33),h=n(87),d=n(18),p=n(92),_=n(36),v=n(39),y=n(20),g=n(46),m=n(10),b=n(22),S=n(24),O=n(123),w=n(129),E=n(7),I=function T(){r(this,T);var t=o.a.bind()();Object.defineProperties(this,{demo:{value:1,enumerable:!0},localStoragePreferences:{value:i.a,enumerable:!0},reactor:{value:t,enumerable:!0},util:{value:a.a,enumerable:!0},startLocalStoragePreferencesSync:{value:i.a.startSync.bind(i.a,t)},startUrlSync:{value:v.urlSync.startSync.bind(null,t)},stopUrlSync:{value:v.urlSync.stopSync.bind(null,t)}}),u.a.bind()(this,t,{auth:s,config:c,entity:f,entityHistory:l,errorLog:h,event:d,logbook:p,moreInfo:_,navigation:v,notification:y,view:g,service:m,stream:b,sync:S,template:O,voice:w,restApi:E})};e.a=I},,,function(t,e,n){"use strict";var r=n(12),i=function(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?null:arguments[3],o=t.evaluate(r.getters.authInfo),u=o.host+"/api/"+n;return new Promise(function(t,n){var r=new XMLHttpRequest;r.open(e,u,!0),r.setRequestHeader("X-HA-access",o.authToken),r.onload=function(){var e=void 0;try{e="application/json"===r.getResponseHeader("content-type")?JSON.parse(r.responseText):r.responseText}catch(i){e=r.responseText}r.status>199&&r.status<300?t(e):n(e)},r.onerror=function(){return n({})},i?r.send(JSON.stringify(i)):r.send()})};i=function(t,e,r){return new Promise(function(t){if("GET"!==e)throw new Error("Method "+e+" not allowed in demo mode.");var i=r.split("/",1)[0];switch(i){case"bootstrap":t(n(71)["default"]);break;case"logbook":t(n(74)["default"]);break;case"history":t(n(76)["default"]);break;default:throw new Error("URL not implemented in demo mode /api/"+r)}})},e.a=i},function(t,e,n){"use strict";function r(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.useStreaming,i=(void 0===r?t.evaluate(u.getters.isSupported):r,n.rememberAuth),c=void 0===i?!1:i,f=n.host,l=void 0===f?"":f;t.dispatch(o.a.VALIDATING_AUTH_TOKEN,{authToken:e,host:l}),a.actions.fetchAll(t).then(function(){return t.dispatch(o.a.VALID_AUTH_TOKEN,{authToken:e,host:l,rememberAuth:c}),void t.dispatch("STREAM_START")},function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.message,r=void 0===n?s:n;t.dispatch(o.a.INVALID_AUTH_TOKEN,{errorMessage:r})})}function i(t){t.dispatch(o.a.LOG_OUT,{})}var o=n(11),u=n(22),a=n(24);e.validate=r,e.logOut=i;var s="Unexpected result from API"},function(t,e,n){"use strict";var r=["authAttempt","isValidating"];Object.defineProperty(e,"isValidating",{configurable:!1,enumerable:!0,get:function(){return r}});var i=["authAttempt","isInvalid"];Object.defineProperty(e,"isInvalidAttempt",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["authAttempt","errorMessage"];Object.defineProperty(e,"attemptErrorMessage",{configurable:!1,enumerable:!0,get:function(){return o}});var u=["rememberAuth"];Object.defineProperty(e,"rememberAuth",{configurable:!1,enumerable:!0,get:function(){return u}});var a=[["authAttempt","authToken"],["authAttempt","host"],function(t,e){return{authToken:t,host:e}}];Object.defineProperty(e,"attemptAuthInfo",{configurable:!1,enumerable:!0,get:function(){return a}});var s=["authCurrent","authToken"];Object.defineProperty(e,"currentAuthToken",{configurable:!1,enumerable:!0,get:function(){return s}});var c=[s,["authCurrent","host"],function(t,e){return{authToken:t,host:e}}];Object.defineProperty(e,"currentAuthInfo",{configurable:!1,enumerable:!0,get:function(){return c}});var f=[r,["authAttempt","authToken"],["authCurrent","authToken"],function(t,e,n){return t?e:n}];Object.defineProperty(e,"authToken",{configurable:!1,enumerable:!0,get:function(){return f}});var l=[r,a,c,function(t,e,n){return t?e:n}];Object.defineProperty(e,"authInfo",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";function r(t,e){var n=e.authToken,r=e.host;return u.toImmutable.bind()({authToken:n,host:r,isValidating:!0,isInvalid:!1,errorMessage:""})}function i(){return c.getInitialState()}function o(t,e){var n=e.errorMessage;return t.withMutations(function(t){return t.set("isValidating",!1).set("isInvalid",!0).set("errorMessage",n)})}var u=n(1),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(11),c=new u.Store({getInitialState:function(){return u.toImmutable.bind()({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(s.a.VALIDATING_AUTH_TOKEN,r),this.on(s.a.VALID_AUTH_TOKEN,i),this.on(s.a.INVALID_AUTH_TOKEN,o)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.authToken,r=e.host;return o.toImmutable.bind()({authToken:n,host:r})}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(11),s=new o.Store({getInitialState:function(){return o.toImmutable.bind()({authToken:null,host:""})},initialize:function(){this.on(a.a.VALID_AUTH_TOKEN,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";function r(t,e){var n=e.rememberAuth;return n}var i=n(1),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var u=n(11),a=new i.Store({getInitialState:function(){return!0},initialize:function(){this.on(u.a.VALID_AUTH_TOKEN,r)}});e.a=a},function(t,e,n){"use strict";function r(t,e){t.dispatch(a.a.SERVER_CONFIG_LOADED,e)}function i(t){u.a.bind()(t,"GET","config").then(function(e){return r(t,e)})}function o(t,e){t.dispatch(a.a.COMPONENT_LOADED,{component:e})}var u=n(4),a=n(16);e.configLoaded=r,e.fetchAll=i,e.componentLoaded=o},function(t,e,n){"use strict";function r(t){return[["serverComponent"],function(e){return e.contains(t)}]}e.isComponentLoaded=r;var i=[["serverConfig","latitude"],["serverConfig","longitude"],function(t,e){return{latitude:t,longitude:e}}];Object.defineProperty(e,"locationGPS",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["serverConfig","location_name"];Object.defineProperty(e,"locationName",{configurable:!1,enumerable:!0,get:function(){return o}});var u=["serverConfig","serverVersion"];Object.defineProperty(e,"serverVersion",{configurable:!1,enumerable:!0,get:function(){return u}})},function(t,e,n){"use strict";function r(t,e){var n=e.component;return t.push(n)}function i(t,e){var n=e.components;return u.toImmutable.bind()(n)}function o(){return c.getInitialState()}var u=n(1),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(16),c=new u.Store({getInitialState:function(){return u.toImmutable.bind()([])},initialize:function(){this.on(s.a.COMPONENT_LOADED,r),this.on(s.a.SERVER_CONFIG_LOADED,i),this.on(s.a.LOG_OUT,o)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,u=e.temperature_unit,a=e.time_zone,s=e.version;return o.toImmutable.bind()({latitude:n,longitude:r,location_name:i,temperature_unit:u,time_zone:a,serverVersion:s})}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(16),s=new o.Store({getInitialState:function(){return o.toImmutable.bind()({latitude:null,longitude:null,location_name:"Home",temperature_unit:"°C",time_zone:"UTC",serverVersion:"unknown"})},initialize:function(){this.on(a.a.SERVER_CONFIG_LOADED,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";var r=n(72),i=n(73),o=n(75),u=n(31);e["default"]={config:r.a,events:i.a,services:o.a,states:u.a}},function(t,e,n){"use strict";e.a={components:["configurator","http","api","frontend","history","conversation","logbook","introduction"],latitude:32.87336,location_name:"Home",longitude:-117.22743,temperature_unit:"°F",time_zone:"America/Los_Angeles",version:"0.9"}},function(t,e,n){"use strict";e.a=[{event:"call_service",listener_count:1},{event:"time_changed",listener_count:1},{event:"state_changed",listener_count:3},{event:"homeassistant_stop",listener_count:2}]},function(t,e,n){"use strict";e["default"]=[{domain:"sun",entity_id:"sun.sun",message:"has risen",name:"sun",when:"2015-04-24T06:08:47.000Z"},{domain:"device_tracker",entity_id:"device_tracker.paulus",message:"left home",name:"Paulus",when:"2015-04-24T08:54:47.000Z"},{domain:"device_tracker",entity_id:"device_tracker.anne_therese",message:"left home",name:"Anne Therese",when:"2015-04-24T09:08:47.000Z"},{domain:"group",entity_id:"group.all_devices",message:"left home",name:"All devices",when:"2015-04-24T09:08:47.000Z"},{domain:"thermostat",entity_id:"thermostat.nest",message:"changed to 17 °C",name:"Nest",when:"2015-04-24T09:08:47.000Z"},{domain:"thermostat",entity_id:"thermostat.nest",message:"changed to 21 °C",name:"Nest",when:"2015-04-24T16:00:47.000Z"},{domain:"device_tracker",entity_id:"device_tracker.anne_therese",message:"came home",name:"Anne Therese",when:"2015-04-24T16:24:47.000Z"},{domain:"group",entity_id:"group.all_devices",message:"came home",name:"All devices",when:"2015-04-24T16:24:47.000Z"},{domain:"light",entity_id:"light.bowl",message:"turned on",name:"Bowl",when:"2015-04-24T18:01:47.000Z"},{domain:"light",entity_id:"light.ceiling",message:"turned on",name:"Ceiling",when:"2015-04-24T18:16:47.000Z"},{domain:"light",entity_id:"light.tv_back_light",message:"turned on",name:"TV Back Light",when:"2015-04-24T18:31:47.000Z"},{domain:"sun",entity_id:"sun.sun",message:"has set",name:"sun",when:"2015-04-24T18:46:47.000Z"},{domain:"media_player",entity_id:"media_player.living_room",message:"changed to Plex",name:"Media Player",when:"2015-04-24T19:12:47.000Z"}]},function(t,e,n){"use strict";e.a=[{domain:"homeassistant",services:{stop:{description:"",fields:{}},turn_off:{description:"",fields:{}},turn_on:{description:"",fields:{}}}},{domain:"light",services:{turn_off:{description:"",fields:{}},turn_on:{description:"",fields:{}}}},{domain:"switch",services:{turn_off:{description:"",fields:{}},turn_on:{description:"",fields:{}}}},{domain:"input_boolean",services:{turn_off:{description:"",fields:{}},turn_on:{description:"",fields:{}}}},{domain:"configurator",services:{configure:{description:"",fields:{}}}}]},function(t,e,n){"use strict";function r(t){var e=new Date(Date.now()-60*t*1e3);return e.toISOString()}function i(t){return Math.random()*t-t/2}function o(t,e){s[t.entity_id]=!0;var n=void 0;n="string"==typeof e[0]?e.map(function(t){return{state:t}}):e;var o=900/n.length;c.push(n.map(function(e,n){var u=void 0;u=e.attributes||t.attributes?e.attributes?t.attributes?a.a.bind()({},t.attributes,e.attributes):e.attributes:t.attributes:{};var s=r(0===n?f:f-n*o+i(o));return{attributes:u,entity_id:t.entity_id,state:e.state||t.state,last_changed:s,last_updated:s}}))}var u=n(30),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=(n(31),{"a.demo_mode":!0,"configurator.philips_hue":!0,"group.default_view":!0,"group.rooms_view":!0,"group.rooms":!0,"zone.school":!0,"zone.work":!0,"zone.home":!0,"group.general":!0,"camera.roundabout":!0,"script.water_lawn":!0,"scene.romantic":!0,"scene.good_morning":!0,"group.cooking":!0}),c=[],f=1440;o({entity_id:"sensor.humidity",attributes:{unit_of_measurement:"%"}},["45","49","52","49","52","49","45","42"]),o({entity_id:"sensor.temperature",attributes:{unit_of_measurement:"°C"}},["23","27","25","23","24"]),o({entity_id:"thermostat.nest",attributes:{unit_of_measurement:"°C"}},[{state:"23",attributes:{current_temperature:20,temperature:23}},{state:"23",attributes:{current_temperature:22,temperature:23}},{state:"20",attributes:{current_temperature:21,temperature:20}},{state:"20",attributes:{current_temperature:20,temperature:20}},{state:"20",attributes:{current_temperature:19,temperature:20}}]),o({entity_id:"media_player.living_room",attributes:{friendly_name:"Chromecast"}},["Plex","idle","YouTube","Netflix","idle","Plex"]),o({entity_id:"group.all_devices"},["home","not_home","home"]),o({entity_id:"device_tracker.paulus"},["home","not_home","work","not_home"]),o({entity_id:"device_tracker.anne_therese"},["home","not_home","home","not_home","school"]),o({entity_id:"garage_door.garage_door"},["open","closed","open"]),o({entity_id:"alarm_control_panel.home"},["disarmed","pending","armed_home","pending","disarmed","pending","armed_home"]),o({entity_id:"lock.kitchen_door"},["unlocked","locked","unlocked","locked"]),o({entity_id:"light.tv_back_light"},["on","off","on","off"]),o({entity_id:"light.ceiling"},["on","off","on"]),o({entity_id:"light.table_lamp"},["on","off","on"]),o({entity_id:"switch.ac"},["on","off","on"]),o({entity_id:"group.bedroom"},["on","off","on","off"]),o({entity_id:"group.living_room"},["on","off","on"]),o({entity_id:"switch.decorative_lights"},["on","off","on","off"]),o({entity_id:"light.bed_light"},["on","off","on","off"]),o({entity_id:"rollershutter.bedroom_window"},["open","closed","open","closed"]),o({entity_id:"input_select.cook_today"},["Anne Therese","Paulus"]),o({entity_id:"input_boolean.notify_cook"},["off","on"]);e["default"]=c},function(t,e,n){"use strict";function r(t,e){t.dispatch(s.a.ENTITY_HISTORY_DATE_SELECTED,{date:e})}function i(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];t.dispatch(s.a.RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),a.a.bind()(t,"GET",n).then(function(e){return t.dispatch(s.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(s.a.RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function o(t,e){return t.dispatch(s.a.ENTITY_HISTORY_FETCH_START,{date:e}),a.a.bind()(t,"GET","history/period/"+e).then(function(n){return t.dispatch(s.a.ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(s.a.ENTITY_HISTORY_FETCH_ERROR,{})})}function u(t){var e=t.evaluate(c.currentDate);return o(t,e)}var a=n(4),s=n(8),c=n(32);e.changeCurrentDate=r,e.fetchRecent=i,e.fetchDate=o,e.fetchSelectedDate=u},function(t,e,n){"use strict";function r(t,e){var n=e.date;return a.a.bind()(n)}function i(){return c.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(25),s=n(8),c=new o.Store({getInitialState:function(){var t=new Date;return t.setDate(t.getUTCDate()-1),a.a.bind()(t)},initialize:function(){this.on(s.a.ENTITY_HISTORY_DATE_SELECTED,r),this.on(s.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,o.toImmutable.bind()({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],o.toImmutable.bind()(e.map(s.a.fromJSON)))})})}function i(){return c.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(8),s=n(13),c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(a.a.ENTITY_HISTORY_FETCH_SUCCESS,r),this.on(a.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";var r=n(1),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(8),u=new r.Store({getInitialState:function(){return!1},initialize:function(){this.on(o.a.ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(o.a.ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(o.a.ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(o.a.RECENT_ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(o.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(o.a.RECENT_ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(o.a.LOG_OUT,function(){return!1})}});e.a=u},function(t,e,n){"use strict";function r(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,o.toImmutable.bind()(e.map(s.a.fromJSON)))})})}function i(){return c.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(8),s=n(13),c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(a.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,r),this.on(a.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.stateHistory,r=(new Date).getTime();return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,r)}),history.length>1&&t.set(s,r)})}function i(){return c.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(8),s="ALL_ENTRY_FETCH",c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(a.a.RECENT_ENTITY_HISTORY_FETCH_SUCCESS,r),this.on(a.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";var r=n(7),i=n(13),o=r.createApiActions.bind()(i.a);e.a=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=["playing","paused","unknown"],u=function(){function t(e,n){r(this,t),this.serviceActions=e.serviceActions,this.stateObj=n}return i(t,[{key:"mediaPlayPause",value:function(){this.callService("media_play_pause")}},{key:"nextTrack",value:function(){this.callService("media_next_track")}},{key:"playbackControl",value:function(){this.callService("media_play_pause")}},{key:"previousTrack",value:function(){this.callService("media_previous_track")}},{key:"setVolume",value:function(t){this.callService("volume_set",{volume_level:t})}},{key:"togglePower",value:function(){this.isOff?this.turnOn():this.turnOff()}},{key:"turnOff",value:function(){this.callService("turn_off")}},{key:"turnOn",value:function(){this.callService("turn_on")}},{key:"volumeDown",value:function(){this.callService("volume_down")}},{key:"volumeMute",value:function(t){if(!this.supportsVolumeMute)throw new Error("Muting volume not supported");this.callService("volume_mute",{is_volume_muted:t})}},{key:"volumeUp",value:function(){this.callService("volume_down")}},{key:"callService",value:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,this.serviceActions.callService("media_player",t,n)}},{key:"isOff",get:function(){return"off"===this.stateObj.state}},{key:"isIdle",get:function(){return"idle"===this.stateObj.state}},{key:"isMuted",get:function(){return this.stateObj.attributes.is_volume_muted}},{key:"isPaused",get:function(){return"paused"===this.stateObj.state}},{key:"isPlaying",get:function(){return"playing"===this.stateObj.state}},{key:"isMusic",get:function(){return"music"===this.stateObj.attributes.media_content_type}},{key:"isTVShow",get:function(){return"tvshow"===this.stateObj.attributes.media_content_type}},{key:"hasMediaControl",get:function(){return-1!==o.indexOf(this.stateObj.state)}},{key:"volumeSliderValue",get:function(){return 100*this.stateObj.attributes.volume_level}},{key:"supportsPause",get:function(){return 0!==(1&this.stateObj.attributes.supported_media_commands)}},{key:"supportsVolumeSet",get:function(){return 0!==(4&this.stateObj.attributes.supported_media_commands)}},{key:"supportsVolumeMute",get:function(){return 0!==(8&this.stateObj.attributes.supported_media_commands)}},{key:"supportsPreviousTrack",get:function(){return 0!==(16&this.stateObj.attributes.supported_media_commands)}},{key:"supportsNextTrack",get:function(){return 0!==(32&this.stateObj.attributes.supported_media_commands)}},{key:"supportsTurnOn",get:function(){return 0!==(128&this.stateObj.attributes.supported_media_commands)}},{key:"supportsTurnOff",get:function(){return 0!==(256&this.stateObj.attributes.supported_media_commands)}},{key:"supportsVolumeButtons",get:function(){return 0!==(1024&this.stateObj.attributes.supported_media_commands)}},{key:"primaryText",get:function(){return this.stateObj.attributes.media_title||this.stateObj.stateDisplay}},{key:"secondaryText",get:function(){if(this.isMusic)return this.stateObj.attributes.media_artist;if(this.isTVShow){var t=this.stateObj.attributes.media_series_title;return this.stateObj.attributes.media_season&&(t+=" S"+this.stateObj.attributes.media_season,this.stateObj.attributes.media_episode&&(t+="E"+this.stateObj.attributes.media_episode)),t}return this.stateObj.attributes.app_name?this.stateObj.attributes.app_name:""}}]),t}();e.a=u},function(t,e,n){"use strict";var r=n(7),i=n(13),o=r.createHasDataGetter.bind()(i.a);Object.defineProperty(e,"hasData",{configurable:!1,enumerable:!0,get:function(){return o}});var u=r.createEntityMapGetter.bind()(i.a);Object.defineProperty(e,"entityMap",{configurable:!1,enumerable:!0,get:function(){return u}});var a=r.createByIdGetter.bind()(i.a);Object.defineProperty(e,"byId",{configurable:!1,enumerable:!0,get:function(){return a}});var s=[u,function(t){return t.filter(function(t){return!t.attributes.hidden})}];Object.defineProperty(e,"visibleEntityMap",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";function r(t){return i.a.bind()(t,"GET","error_log")}var i=n(4);e.fetchErrorLog=r},function(t,e,n){"use strict";var r=n(86),i=r;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return i}})},function(t,e,n){"use strict";var r=n(4),i=n(7),o=n(20),u=n(34),a=i.createApiActions.bind()(u.a);a.fireEvent=function(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return r.a.bind()(t,"POST","events/"+e,n).then(function(){o.actions.createNotification(t,"Event "+e+" successful fired!")})},e.a=a},function(t,e,n){"use strict";var r=n(7),i=n(34),o=r.createHasDataGetter.bind()(i.a);Object.defineProperty(e,"hasData",{configurable:!1,enumerable:!0,get:function(){return o}});var u=r.createEntityMapGetter.bind()(i.a);Object.defineProperty(e,"entityMap",{configurable:!1,enumerable:!0,get:function(){return u}});var a=r.createByIdGetter.bind()(i.a);Object.defineProperty(e,"byId",{configurable:!1,enumerable:!0,get:function(){return a}})},function(t,e,n){"use strict";function r(t,e){t.dispatch(u.a.LOGBOOK_DATE_SELECTED,{date:e})}function i(t,e){t.dispatch(u.a.LOGBOOK_ENTRIES_FETCH_START,{date:e}),o.a.bind()(t,"GET","logbook/"+e).then(function(n){return t.dispatch(u.a.LOGBOOK_ENTRIES_FETCH_SUCCESS,{date:e,entries:n})},function(){return t.dispatch(u.a.LOGBOOK_ENTRIES_FETCH_ERROR,{})})}var o=n(4),u=n(9);e.changeCurrentDate=r,e.fetchDate=i},function(t,e,n){"use strict";function r(t){return!t||(new Date).getTime()-t>u}var i=n(1),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var u=6e4,a=["currentLogbookDate"];Object.defineProperty(e,"currentDate",{configurable:!1,enumerable:!0,get:function(){return a}});var s=[a,["logbookEntriesUpdated"],function(t,e){return r(e.get(t))}];Object.defineProperty(e,"isCurrentStale",{configurable:!1,enumerable:!0,get:function(){return s}});var c=[a,["logbookEntries"],function(t,e){return e.get(t)||i.toImmutable.bind()([])}];Object.defineProperty(e,"currentEntries",{configurable:!1,enumerable:!0,get:function(){return c}});var f=["isLoadingLogbookEntries"];Object.defineProperty(e,"isLoadingEntries",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t){t.registerStores({currentLogbookDate:i.a,isLoadingLogbookEntries:o.a,logbookEntries:u.a,logbookEntriesUpdated:a.a})}var i=n(94),o=n(95),u=n(96),a=n(97),s=n(90),c=n(91);e.register=r;var f=s;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return f}});var l=c;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return l}})},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u=n(1),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(26),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=new u.Immutable.Record({when:null,name:null,message:null,domain:null,entityId:null},"LogbookEntry"),l=function(t){function e(t,n,o,u,a){return r(this,e),i(this,Object.getPrototypeOf(e).call(this,{when:t,name:n,message:o,domain:u,entityId:a}))}return o(e,t),c(e,null,[{key:"fromJSON",value:function(t){var n=t.when,r=t.name,i=t.message,o=t.domain,u=t.entity_id;return new e(s.a.bind()(n),r,i,o,u)}}]),e}(f);e.a=l},function(t,e,n){"use strict";function r(t,e){var n=e.date;return a.a.bind()(n)}function i(){return c.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(25),s=n(9),c=new o.Store({getInitialState:function(){return a.a.bind()(new Date)},initialize:function(){this.on(s.a.LOGBOOK_DATE_SELECTED,r),this.on(s.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";var r=n(1),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(9),u=new r.Store({getInitialState:function(){return!1},initialize:function(){this.on(o.a.LOGBOOK_ENTRIES_FETCH_START,function(){return!0}),this.on(o.a.LOGBOOK_ENTRIES_FETCH_SUCCESS,function(){return!1}),this.on(o.a.LOGBOOK_ENTRIES_FETCH_ERROR,function(){return!1}),this.on(o.a.LOG_OUT,function(){return!1})}});e.a=u},function(t,e,n){"use strict";function r(t,e){var n=e.date,r=e.entries;return t.set(n,o.toImmutable.bind()(r.map(s.a.fromJSON)))}function i(){return c.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(9),s=n(93),c=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(a.a.LOGBOOK_ENTRIES_FETCH_SUCCESS,r),this.on(a.a.LOG_OUT,i)}});e.a=c},function(t,e,n){"use strict";function r(t,e){var n=e.date;return t.set(n,(new Date).getTime())}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(9),s=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){this.on(a.a.LOGBOOK_ENTRIES_FETCH_SUCCESS,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";function r(t,e){t.dispatch(o.a.SELECT_ENTITY,{entityId:e})}function i(t){t.dispatch(o.a.SELECT_ENTITY,{entityId:null})}var o=n(35);e.selectEntity=r,e.deselectEntity=i},function(t,e,n){"use strict";var r=n(48),i=n(5),o=n(33),u=["moreInfoEntityId"];Object.defineProperty(e,"currentEntityId",{configurable:!1,enumerable:!0,get:function(){return u}});var a=[u,function(t){return null!==t}];Object.defineProperty(e,"hasCurrentEntityId",{configurable:!1,enumerable:!0,get:function(){return a}});var s=[u,i.getters.entityMap,function(t,e){return e.get(t)||null}];Object.defineProperty(e,"currentEntity",{configurable:!1,enumerable:!0,get:function(){return s}});var c=[u,o.getters.recentEntityHistoryMap,function(t,e){return e.get(t)}];Object.defineProperty(e,"currentEntityHistory",{configurable:!1,enumerable:!0,get:function(){return c}});var f=[u,o.getters.recentEntityHistoryUpdatedMap,function(t,e){return r.a.bind()(e.get(t))}];Object.defineProperty(e,"isCurrentEntityHistoryStale",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t,e){var n=e.entityId;return n}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(35),s=new o.Store({getInitialState:function(){return null},initialize:function(){this.on(a.a.SELECT_ENTITY,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";function r(t,e){var n=e.pane;return n}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(19),s=new o.Store({getInitialState:function(){return"states"},initialize:function(){this.on(a.a.NAVIGATE,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";function r(t,e){var n=e.show;return!!n}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(19),s=new o.Store({getInitialState:function(){return!1},initialize:function(){this.on(a.a.SHOW_SIDEBAR,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";function r(t){return y[t.hassId]}function i(t,e){var n={pane:t};return"states"===t&&(n.view=e||null),n}function o(t,e){return"states"===t&&e?"/"+t+"/"+e:"/"+t}function u(t){var e=void 0,n=void 0;if("/"===window.location.pathname)e=t.evaluate(h.activePane),n=t.evaluate(l.getters.currentView);else{var r=window.location.pathname.substr(1).split("/"),u=p(r,2);e=u[0],n=u[1],t.batch(function(){d.navigate.bind()(t,e),n&&l.actions.selectView(t,n)})}history.replaceState(i(e,n),v,o(e,n))}function a(t,e){var n=e.state,i=n.pane,o=n.view;t.evaluate(f.getters.hasCurrentEntityId)?(r(t).ignoreNextDeselectEntity=!0,f.actions.deselectEntity(t)):i===t.evaluate(h.activePane)&&o===t.evaluate(l.getters.currentView)||t.batch(function(){d.navigate.bind()(t,i),void 0!==o&&l.actions.selectView(t,o)})}function s(t){if(_){u(t);var e={ignoreNextDeselectEntity:!1,popstateChangeListener:a.bind(null,t),unwatchNavigationObserver:t.observe(h.activePane,function(t){t!==history.state.pane&&history.pushState(i(t,history.state.view),v,o(t,history.state.view))}),unwatchViewObserver:t.observe(l.getters.currentView,function(t){t!==history.state.view&&history.pushState(i(history.state.pane,t),v,o(history.state.pane,t))}),unwatchMoreInfoObserver:t.observe(f.getters.hasCurrentEntityId,function(t){t?history.pushState(history.state,v,window.location.pathname):e.ignoreNextDeselectEntity?e.ignoreNextDeselectEntity=!1:setTimeout(function(){return history.back()},0)})};y[t.hassId]=e,window.addEventListener("popstate",e.popstateChangeListener)}}function c(t){if(_){var e=r(t);e&&(e.unwatchNavigationObserver(),e.unwatchViewObserver(),e.unwatchMoreInfoObserver(),window.removeEventListener("popstate",e.popstateChangeListener),y[t.hassId]=!1)}}var f=n(36),l=n(46),h=n(38),d=n(37);e.startSync=s,e.stopSync=c;var p=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(n.push(u.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=history.pushState&&!1,v="Home Assistant",y={}},function(t,e,n){"use strict";function r(t,e){t.dispatch(i.a.NOTIFICATION_CREATED,{message:e})}var i=n(40);e.createNotification=r},function(t,e,n){"use strict";var r=["notifications"];Object.defineProperty(e,"notificationMap",{configurable:!1,enumerable:!0,get:function(){return r}});var i=[r,function(t){return t.last();
|
|
}];Object.defineProperty(e,"lastNotificationMessage",{configurable:!1,enumerable:!0,get:function(){return i}})},function(t,e,n){"use strict";function r(t,e){var n=e.message;return t.set(t.size,n)}function i(){return s.getInitialState()}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(40),s=new o.Store({getInitialState:function(){return new o.Immutable.OrderedMap},initialize:function(){this.on(a.a.NOTIFICATION_CREATED,r),this.on(a.a.LOG_OUT,i)}});e.a=s},function(t,e,n){"use strict";var r=n(108),i=r.a;Object.defineProperty(e,"a",{configurable:!1,enumerable:!0,get:function(){return i}})},function(t,e,n){"use strict";function r(){if(!("localStorage"in window))return{};var t=window.localStorage,e="___test";try{return t.setItem(e,e),t.removeItem(e),t}catch(n){return{}}}var i=n(12),o=n(22),u=n(39),a=r(),s={authToken:{getter:[i.getters.currentAuthToken,i.getters.rememberAuth,function(t,e){return e?t:null}],defaultValue:null},useStreaming:{getter:o.getters.useStreaming,defaultValue:!0},showSidebar:{getter:u.getters.showSidebar,defaultValue:!1}},c={};Object.keys(s).forEach(function(t){t in a||(a[t]=s[t].defaultValue),Object.defineProperty(c,t,{get:function(){try{return JSON.parse(a[t])}catch(e){return s[t].defaultValue}}})}),c.startSync=function(t){Object.keys(s).forEach(function(e){var n=s[e].getter,r=function(t){a[e]=JSON.stringify(t)};t.observe(n,r),r(t.evaluate(n))})},e.a=c},function(t,e,n){"use strict";function r(t){var e={};return e.incrementData=function(e,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];i(e,t,r,n)},e.replaceData=function(e,n){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];i(e,t,l.a.bind()({},r,{replace:!0}),n)},e.removeData=function(e,n){s(e,t,{id:n})},t.fetch&&(e.fetch=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e.dispatch(h.a.API_FETCH_START,{model:t,params:n,method:"fetch"}),t.fetch(e,n).then(i.bind(null,e,t,n),o.bind(null,e,t,n))}),e.fetchAll=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e.dispatch(h.a.API_FETCH_START,{model:t,params:n,method:"fetchAll"}),t.fetchAll(e,n).then(i.bind(null,e,t,l.a.bind()({},n,{replace:!0})),o.bind(null,e,t,n))},t.save&&(e.save=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e.dispatch(h.a.API_SAVE_START,{params:n}),t.save(e,n).then(u.bind(null,e,t,n),a.bind(null,e,t,n))}),t["delete"]&&(e["delete"]=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return e.dispatch(h.a.API_DELETE_START,{params:n}),t["delete"](e,n).then(s.bind(null,e,t,n),c.bind(null,e,t,n))}),e}function i(t,e,n,r){return t.dispatch(h.a.API_FETCH_SUCCESS,{model:e,params:n,result:r}),r}function o(t,e,n,r){return t.dispatch(h.a.API_FETCH_FAIL,{model:e,params:n,reason:r}),Promise.reject(r)}function u(t,e,n,r){return t.dispatch(h.a.API_SAVE_SUCCESS,{model:e,params:n,result:r}),r}function a(t,e,n,r){return t.dispatch(h.a.API_SAVE_FAIL,{model:e,params:n,reason:r}),Promise.reject(r)}function s(t,e,n,r){return t.dispatch(h.a.API_DELETE_SUCCESS,{model:e,params:n,result:r}),r}function c(t,e,n,r){return t.dispatch(h.a.API_DELETE_FAIL,{model:e,params:n,reason:r}),Promise.reject(r)}var f=n(30),l=f&&f.__esModule?function(){return f["default"]}:function(){return f};Object.defineProperty(l,"a",{get:l});var h=n(21);e.a=r},function(t,e,n){"use strict";function r(t,e){var n=e.model,r=e.result,i=e.params,u=n.entity;if(!r)return t;var a=i.replace?t.set(u,o.toImmutable.bind()({})):t,s=Array.isArray(r)?r:[r],c=n.fromJSON||o.toImmutable;return a.withMutations(function(t){return s.forEach(function(e){var n=c(e);t.setIn([u,n.id],n)})})}function i(t,e){var n=e.model,r=e.params;return t.removeIn([n.entity,r.id])}var o=n(1),u=o&&o.__esModule?function(){return o["default"]}:function(){return o};Object.defineProperty(u,"a",{get:u});var a=n(21),s=new o.Store({getInitialState:function(){return o.toImmutable.bind()({})},initialize:function(){var t=this;this.on(a.a.API_FETCH_SUCCESS,r),this.on(a.a.API_SAVE_SUCCESS,r),this.on(a.a.API_DELETE_SUCCESS,i),this.on(a.a.LOG_OUT,function(){return t.getInitialState()})}});e.a=s},function(t,e,n){"use strict";var r=n(30),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(4),u=n(7),a=n(5),s=n(20),c=n(41),f=n(42),l=u.createApiActions.bind()(f.a);l.serviceRegistered=function(t,e,n){var r=t.evaluateToJS(c.byDomain(e));r?r.services.push(n):r={domain:e,services:[n]},l.incrementData(t,r)},l.callTurnOn=function(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return l.callService(t,"homeassistant","turn_on",i.a.bind()({},n,{entity_id:e}))},l.callTurnOff=function(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return l.callService(t,"homeassistant","turn_off",i.a.bind()({},n,{entity_id:e}))},l.callService=function(t,e,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3];return o.a.bind()(t,"POST","services/"+e+"/"+n,r).then(function(i){"turn_on"===n&&r.entity_id?s.actions.createNotification(t,"Turned on "+r.entity_id+"."):"turn_off"===n&&r.entity_id?s.actions.createNotification(t,"Turned off "+r.entity_id+"."):s.actions.createNotification(t,"Service "+e+"/"+n+" called."),a.actions.incrementData(t,i)})},t.exports=l},function(t,e,n){"use strict";function r(t,e){if("lock"===t)return!0;if("garage_door"===t)return!0;var n=e.get(t);return!!n&&n.services.has("turn_on")}e.a=r},function(t,e,n){"use strict";function r(t,e){return t?"group"===t.domain?"on"===t.state||"off"===t.state:i.a.bind()(t.domain,e):!1}var i=n(112);e.a=r},function(t,e,n){"use strict";function r(t){var e=d[t.hassId];e&&(e.scheduleHealthCheck.cancel(),e.source.close(),d[t.hassId]=!1)}function i(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=e.syncOnInitialConnect,o=void 0===n?!0:n;r(t);var u=a.a.bind()(i.bind(null,t),h),_=t.evaluate(s.getters.authToken),v=new EventSource("/api/stream?api_password="+_+"&restrict="+p),y=o;d[t.hassId]={source:v,scheduleHealthCheck:u},v.addEventListener("open",function(){u(),t.batch(function(){t.dispatch(f.a.STREAM_START),c.actions.stop(t),y?c.actions.fetchAll(t):y=!0})},!1),v.addEventListener("message",function(e){u(),"ping"!==e.data&&l.a.bind()(t,JSON.parse(e.data))},!1),v.addEventListener("error",function(){u(),v.readyState!==EventSource.CLOSED&&t.dispatch(f.a.STREAM_ERROR)},!1)}function o(t){r(t),t.batch(function(){t.dispatch(f.a.STREAM_STOP),c.actions.start(t)})}var u=n(57),a=u&&u.__esModule?function(){return u["default"]}:function(){return u};Object.defineProperty(a,"a",{get:a});var s=n(12),c=n(24),f=n(43),l=n(116);e.start=i,e.stop=o;var h=6e4,d={},p=["state_changed","component_loaded","service_registered"].join(",")},function(t,e,n){"use strict";var r=["streamStatus","isStreaming"];Object.defineProperty(e,"isStreamingEvents",{configurable:!1,enumerable:!0,get:function(){return r}});var i=["streamStatus","isSupported"];Object.defineProperty(e,"isSupported",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["streamStatus","useStreaming"];Object.defineProperty(e,"useStreaming",{configurable:!1,enumerable:!0,get:function(){return o}});var u=["streamStatus","hasError"];Object.defineProperty(e,"hasStreamingEventsError",{configurable:!1,enumerable:!0,get:function(){return u}})},function(t,e,n){"use strict";var r=n(5),i=n(17),o=n(10);e.a=function(t,e){switch(e.event_type){case"state_changed":e.data.new_state?r.actions.incrementData(t,e.data.new_state):r.actions.removeData(t,e.data.entity_id);break;case"component_loaded":i.actions.componentLoaded(t,e.data.component);break;case"service_registered":o.actions.serviceRegistered(t,e.data.domain,e.data.service)}}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};e.a="object"===("undefined"==typeof window?"undefined":r(window))&&"EventSource"in window},function(t,e,n){"use strict";function r(t){return t.withMutations(function(t){t.set("isStreaming",!0).set("useStreaming",!0).set("hasError",!1)})}function i(t){return t.withMutations(function(t){t.set("isStreaming",!1).set("useStreaming",!1).set("hasError",!1)})}function o(t){return t.withMutations(function(t){t.set("isStreaming",!1).set("hasError",!0)})}function u(){return l.getInitialState()}var a=n(1),s=a&&a.__esModule?function(){return a["default"]}:function(){return a};Object.defineProperty(s,"a",{get:s});var c=n(43),f=n(117),l=new a.Store({getInitialState:function(){return a.toImmutable.bind()({isSupported:f.a,isStreaming:!1,useStreaming:!0,hasError:!1})},initialize:function(){this.on(c.a.STREAM_START,r),this.on(c.a.STREAM_STOP,i),this.on(c.a.STREAM_ERROR,o),this.on(c.a.LOG_OUT,u)}});e.a=l},function(t,e,n){"use strict";function r(t){return t.evaluate(h.isSyncScheduled)}function i(t){r(t)&&(t.hassId in m||(m[t.hassId]=f.a.bind()(u.bind(null,t),g)),m[t.hassId]())}function o(t){var e=m[t.hassId];e&&e.cancel()}function u(t){return t.dispatch(l.a.API_FETCH_ALL_START,{}),d.a.bind()(t,"GET","bootstrap").then(function(e){t.batch(function(){p.actions.replaceData(t,e.states),_.actions.replaceData(t,e.services),v.actions.replaceData(t,e.events),y.actions.configLoaded(t,e.config),t.dispatch(l.a.API_FETCH_ALL_SUCCESS,{})}),i(t)},function(e){return t.dispatch(l.a.API_FETCH_ALL_FAIL,{message:e}),i(t),Promise.reject(e)})}function a(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=e.skipInitialSync,r=void 0===n?!1:n;t.dispatch(l.a.SYNC_SCHEDULED),r?i(t):u(t)}function s(t){t.dispatch(l.a.SYNC_SCHEDULE_CANCELLED),o(t)}var c=n(57),f=c&&c.__esModule?function(){return c["default"]}:function(){return c};Object.defineProperty(f,"a",{get:f});var l=n(23),h=n(44),d=n(4),p=n(5),_=n(10),v=n(18),y=n(17);e.fetchAll=u,e.start=a,e.stop=s;var g=3e4,m={}},function(t,e,n){"use strict";var r=n(1),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(23),u=new r.Store({getInitialState:function(){return!0},initialize:function(){this.on(o.a.API_FETCH_ALL_START,function(){return!0}),this.on(o.a.API_FETCH_ALL_SUCCESS,function(){return!1}),this.on(o.a.API_FETCH_ALL_FAIL,function(){return!1}),this.on(o.a.LOG_OUT,function(){return!1})}});e.a=u},function(t,e,n){"use strict";var r=n(1),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=n(23),u=new r.Store({getInitialState:function(){return!1},initialize:function(){this.on(o.a.SYNC_SCHEDULED,function(){return!0}),this.on(o.a.SYNC_SCHEDULE_CANCELLED,function(){return!1}),this.on(o.a.LOG_OUT,function(){return!1})}});e.a=u},function(t,e,n){"use strict";function r(t,e){return i.a.bind()(t,"POST","template",{template:e})}var i=n(4);e.render=r},function(t,e,n){"use strict";var r=n(122),i=r;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return i}})},function(t,e,n){"use strict";function r(t,e){t.dispatch(i.a.SELECT_VIEW,{view:e})}var i=n(45);e.selectView=r},function(t,e,n){"use strict";function r(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];n.attributes.entity_id.forEach(function(n){if(!t.has(n)){var o=e.get(n);o&&!o.attributes.hidden&&(t.set(n,o),"group"===o.domain&&i&&r(t,e,o,!1))}})}var i=n(1),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var u=n(5),a="group.default_view",s=["currentView"];Object.defineProperty(e,"currentView",{configurable:!1,enumerable:!0,get:function(){return s}});var c=[u.getters.entityMap,function(t){return t.filter(function(t){return"group"===t.domain&&t.attributes.view&&t.entityId!==a})}];Object.defineProperty(e,"views",{configurable:!1,enumerable:!0,get:function(){return c}});var f=[u.getters.entityMap,s,function(t,e){var n=void 0;return n=e?t.get(e):t.get(a),n?(new i.Immutable.Map).withMutations(function(e){r(e,t,n)}):t.filter(function(t){return!t.attributes.hidden})}];Object.defineProperty(e,"currentViewEntities",{configurable:!1,enumerable:!0,get:function(){return f}})},function(t,e,n){"use strict";function r(t,e){var n=e.model,r=e.result,i=e.params;if(null===t||"entity"!==n.entity||!i.replace)return t;for(var o=0;o<r.length;o++)if(r[o].entity_id===t)return t;return null}var i=n(1),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o});var u=n(45),a=n(21),s=new i.Store({getInitialState:function(){return null},initialize:function(){this.on(u.a.SELECT_VIEW,function(t,e){var n=e.view;return n}),this.on(a.a.API_FETCH_SUCCESS,r)}});e.a=s},function(t,e,n){"use strict";function r(t){return f[t.hassId]}function i(t){var e=r(t);if(e){var n=e.finalTranscript||e.interimTranscript;t.dispatch(c.a.VOICE_TRANSMITTING,{finalTranscript:n}),s.actions.callService(t,"conversation","process",{text:n}).then(function(){t.dispatch(c.a.VOICE_DONE)},function(){t.dispatch(c.a.VOICE_ERROR)})}}function o(t){var e=r(t);e&&(e.recognition.stop(),f[t.hassId]=!1)}function u(t){i(t),o(t)}function a(t){var e=u.bind(null,t);e();var n=new webkitSpeechRecognition;f[t.hassId]={recognition:n,interimTranscript:"",finalTranscript:""},n.interimResults=!0,n.onstart=function(){return t.dispatch(c.a.VOICE_START)},n.onerror=function(){return t.dispatch(c.a.VOICE_ERROR)},n.onend=e,n.onresult=function(e){var n=r(t);if(n){for(var i="",o="",u=e.resultIndex;u<e.results.length;u++)e.results[u].isFinal?i+=e.results[u][0].transcript:o+=e.results[u][0].transcript;n.interimTranscript=o,n.finalTranscript+=i,t.dispatch(c.a.VOICE_RESULT,{interimTranscript:o,finalTranscript:n.finalTranscript})}},n.start()}var s=n(10),c=n(47);e.stop=o,e.finish=u,e.listen=a;var f={}},function(t,e,n){"use strict";var r=["isVoiceSupported"];Object.defineProperty(e,"isVoiceSupported",{configurable:!1,enumerable:!0,get:function(){return r}});var i=["currentVoiceCommand","isListening"];Object.defineProperty(e,"isListening",{configurable:!1,enumerable:!0,get:function(){return i}});var o=["currentVoiceCommand","isTransmitting"];Object.defineProperty(e,"isTransmitting",{configurable:!1,enumerable:!0,get:function(){return o}});var u=["currentVoiceCommand","interimTranscript"];Object.defineProperty(e,"interimTranscript",{configurable:!1,enumerable:!0,get:function(){return u}});var a=["currentVoiceCommand","finalTranscript"];Object.defineProperty(e,"finalTranscript",{configurable:!1,enumerable:!0,get:function(){return a}});var s=[u,a,function(t,e){return t.slice(e.length)}];Object.defineProperty(e,"extraInterimTranscript",{configurable:!1,enumerable:!0,get:function(){return s}})},function(t,e,n){"use strict";function r(t){t.registerStores({currentVoiceCommand:o.a,isVoiceSupported:i.a})}var i=n(131),o=n(130),u=n(127),a=n(128);e.register=r;var s=u;Object.defineProperty(e,"actions",{configurable:!1,enumerable:!0,get:function(){return s}});var c=a;Object.defineProperty(e,"getters",{configurable:!1,enumerable:!0,get:function(){return c}})},function(t,e,n){"use strict";function r(t){return t.set("isListening",!0)}function i(t,e){var n=e.interimTranscript,r=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!0).set("isTransmitting",!1).set("interimTranscript",n).set("finalTranscript",r)})}function o(t,e){var n=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!1).set("isTransmitting",!0).set("interimTranscript","").set("finalTranscript",n)})}function u(){return h.getInitialState()}function a(){return h.getInitialState()}function s(){return h.getInitialState()}var c=n(1),f=c&&c.__esModule?function(){return c["default"]}:function(){return c};Object.defineProperty(f,"a",{get:f});var l=n(47),h=new c.Store({getInitialState:function(){return c.toImmutable.bind()({isListening:!1,isTransmitting:!1,interimTranscript:"",finalTranscript:""})},initialize:function(){this.on(l.a.VOICE_START,r),this.on(l.a.VOICE_RESULT,i),this.on(l.a.VOICE_TRANSMITTING,o),this.on(l.a.VOICE_DONE,u),this.on(l.a.VOICE_ERROR,a),this.on(l.a.LOG_OUT,s)}});e.a=h},function(t,e,n){"use strict";var r=n(1),i=r&&r.__esModule?function(){return r["default"]}:function(){return r};Object.defineProperty(i,"a",{get:i});var o=new r.Store({getInitialState:function(){return"webkitSpeechRecognition"in window}});e.a=o},function(t,e,n){"use strict";function r(){var t=new i.Reactor({debug:1});return t.hassId=u++,t}var i=n(1),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o}),e.a=r;var u=0},function(t,e,n){"use strict";function r(t,e){return i.toImmutable.bind()(t.attributes.entity_id.map(function(t){return e.get(t)}).filter(function(t){return!!t}))}var i=n(1),o=i&&i.__esModule?function(){return i["default"]}:function(){return i};Object.defineProperty(o,"a",{get:o}),e.a=r},function(t,e,n){"use strict";function r(t,e,n){Object.keys(n).forEach(function(r){var i=n[r];"register"in i&&i.register(e),"getters"in i&&Object.defineProperty(t,r+"Getters",{value:i.getters,enumerable:!0}),"actions"in i&&!function(){var n={};Object.getOwnPropertyNames(i.actions).forEach(function(t){"function"==typeof i.actions[t]&&Object.defineProperty(n,t,{value:i.actions[t].bind(null,e),enumerable:!0})}),Object.defineProperty(t,r+"Actions",{value:n,enumerable:!0})}()})}e.a=r},function(t,e,n){"use strict";e.a={UNIT_TEMP_C:"°C",UNIT_TEMP_F:"°F"}},function(t,e,n){"use strict";var r=n(25),i=n(133),o=n(48),u=n(26),a=n(135);e.a={dateToStr:r.a,expandGroup:i.a,isStaleTime:o.a,parseDateTime:u.a,temperatureUnits:a.a}},function(t,e,n){"use strict";var r=n(58),i=new r.a;window.validateAuth=function(t,e){i.authActions.validate(t,{rememberAuth:e,useStreaming:i.localStoragePreferences.useStreaming})},window.removeInitMsg=function(){var t=document.getElementById("ha-init-skeleton");t&&t.parentElement.removeChild(t)},i.reactor.batch(function(){i.navigationActions.showSidebar(i.localStoragePreferences.showSidebar),window.noAuth?window.validateAuth("",!1):i.localStoragePreferences.authToken&&window.validateAuth(i.localStoragePreferences.authToken,!0)}),setTimeout(i.startLocalStoragePreferencesSync,5e3),window.hass=i},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){function n(){return(new Date).getTime()}t.exports=Date.now||n}]); |