var runtime=function(a){"use strict";var u,t=Object.prototype,h=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",e=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function i(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{i({},"")}catch(t){i=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var o,i,a,c,r=r&&r.prototype instanceof v?r:v,r=Object.create(r.prototype),n=new j(n||[]);return r._invoke=(o=t,i=e,a=n,c=l,function(t,r){if(c===p)throw new Error("Generator is already running");if(c===y){if("throw"===t)throw r;return k()}for(a.method=t,a.arg=r;;){var e=a.delegate;if(e){var n=function t(r,e){var n=r.iterator[e.method];if(n===u){if(e.delegate=null,"throw"===e.method){if(r.iterator.return&&(e.method="return",e.arg=u,t(r,e),"throw"===e.method))return g;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var n=f(n,r.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,g;n=n.arg;if(!n)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g;{if(!n.done)return n;e[r.resultName]=n.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u)}e.delegate=null;return g}(e,a);if(n){if(n===g)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(c===l)throw c=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c=p;n=f(o,i,a);if("normal"===n.type){if(c=a.done?y:s,n.arg!==g)return{value:n.arg,done:a.done}}else"throw"===n.type&&(c=y,a.method="throw",a.arg=n.arg)}}),r}function f(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}a.wrap=c;var l="suspendedStart",s="suspendedYield",p="executing",y="completed",g={};function v(){}function d(){}function m(){}var w={};i(w,n,function(){return this});r=Object.getPrototypeOf,r=r&&r(r(O([])));r&&r!==t&&h.call(r,n)&&(w=r);var L=m.prototype=v.prototype=Object.create(w);function x(t){["next","throw","return"].forEach(function(r){i(t,r,function(t){return this._invoke(r,t)})})}function b(a,c){var r;this._invoke=function(e,n){function t(){return new c(function(t,r){!function r(t,e,n,o){t=f(a[t],a,e);if("throw"!==t.type){var i=t.arg;return(e=i.value)&&"object"==typeof e&&h.call(e,"__await")?c.resolve(e.__await).then(function(t){r("next",t,n,o)},function(t){r("throw",t,n,o)}):c.resolve(e).then(function(t){i.value=t,n(i)},function(t){return r("throw",t,n,o)})}o(t.arg)}(e,n,t,r)})}return r=r?r.then(t,t):t()}}function E(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function _(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(r){if(r){var t=r[n];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var e=-1,t=function t(){for(;++e<r.length;)if(h.call(r,e))return t.value=r[e],t.done=!1,t;return t.value=u,t.done=!0,t};return t.next=t}}return{next:k}}function k(){return{value:u,done:!0}}return i(L,"constructor",d.prototype=m),i(m,"constructor",d),d.displayName=i(m,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,i(t,o,"GeneratorFunction")),t.prototype=Object.create(L),t},a.awrap=function(t){return{__await:t}},x(b.prototype),i(b.prototype,e,function(){return this}),a.AsyncIterator=b,a.async=function(t,r,e,n,o){void 0===o&&(o=Promise);var i=new b(c(t,r,e,n),o);return a.isGeneratorFunction(r)?i:i.next().then(function(t){return t.done?t.value:i.next()})},x(L),i(L,o,"Generator"),i(L,n,function(){return this}),i(L,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=[];for(t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},a.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&h.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=u)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function t(t,r){return i.type="throw",i.arg=e,n.next=t,r&&(n.method="next",n.arg=u),!!r}for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=h.call(o,"catchLoc"),c=h.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&h.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),g},finish:function(t){for(var r=this.tryEntries.length-1;0<=r;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),_(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;0<=r;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n,o=e.completion;return"throw"===o.type&&(n=o.arg,_(e)),n}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:O(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=u),g}},a}("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime=r")(runtime)};
!function(C){"use strict";var r,e,o;e={},(o=function(t){if(e[t])return e[t].exports;var n=e[t]={i:t,l:!1,exports:{}};return r[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}).m=r=[function(t,n,r){r(1),r(67),r(68),r(72),r(79),t.exports=r(85)},function(t,n,r){var e=r(2),o=r(36),i=r(57),u=r(56),r=r(62);e({target:"Array",proto:!0},{at:function(t){var n=o(this),r=i(n),t=u(t),t=0<=t?t:r+t;return t<0||r<=t?C:n[t]}}),r("at")},function(t,n,r){var a=r(3),p=r(4).f,s=r(40),l=r(43),y=r(34),v=r(50),d=r(61);t.exports=function(t,n){var r,e,o,i=t.target,u=t.global,c=t.stat,f=u?a:c?a[i]||y(i,{}):(a[i]||{}).prototype;if(f)for(r in n){if(e=n[r],o=t.noTargetGet?(o=p(f,r))&&o.value:f[r],!d(u?r:i+(c?".":"#")+r,t.forced)&&o!==C){if(typeof e==typeof o)continue;v(e,o)}(t.sham||o&&o.sham)&&s(e,"sham",!0),l(f,r,e,t)}}},function(t,n){function r(t){return t&&t.Math==Math&&t}t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof global&&global)||function(){return this}()||Function("return this")()},function(t,n,r){var e=r(5),o=r(7),i=r(8),u=r(9),c=r(10),f=r(15),a=r(35),p=r(38),s=Object.getOwnPropertyDescriptor;n.f=e?s:function(t,n){if(t=c(t),n=f(n),p)try{return s(t,n)}catch(t){}if(a(t,n))return u(!o(i.f,t,n),t[n])}},function(t,n,r){r=r(6);t.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var r=Function.prototype.call;t.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(t,n,r){var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!e.call({1:2},1);n.f=i?function(t){t=o(this,t);return!!t&&t.enumerable}:e},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(11),o=r(14);t.exports=function(t){return e(o(t))}},function(t,n,r){var e=r(3),o=r(12),i=r(6),u=r(13),c=e.Object,f=o("".split);t.exports=i(function(){return!c("z").propertyIsEnumerable(0)})?function(t){return"String"==u(t)?f(t,""):c(t)}:c},function(t,n){var r=Function.prototype,e=r.bind,o=r.call,i=e&&e.bind(o);t.exports=e?function(t){return t&&i(o,t)}:function(t){return t&&function(){return o.apply(t,arguments)}}},function(t,n,r){var r=r(12),e=r({}.toString),o=r("".slice);t.exports=function(t){return o(e(t),8,-1)}},function(t,n,r){var e=r(3).TypeError;t.exports=function(t){if(t==C)throw e("Can't call method on "+t);return t}},function(t,n,r){var e=r(16),o=r(19);t.exports=function(t){t=e(t,"string");return o(t)?t:t+""}},function(t,n,r){var e=r(3),o=r(7),i=r(17),u=r(19),c=r(26),f=r(29),r=r(30),a=e.TypeError,p=r("toPrimitive");t.exports=function(t,n){if(!i(t)||u(t))return t;var r=c(t,p);if(r){if(r=o(r,t,n=n===C?"default":n),!i(r)||u(r))return r;throw a("Can't convert object to primitive value")}return f(t,n=n===C?"number":n)}},function(t,n,r){var e=r(18);t.exports=function(t){return"object"==typeof t?null!==t:e(t)}},function(t,n){t.exports=function(t){return"function"==typeof t}},function(t,n,r){var e=r(3),o=r(20),i=r(18),u=r(21),r=r(22),c=e.Object;t.exports=r?function(t){return"symbol"==typeof t}:function(t){var n=o("Symbol");return i(n)&&u(n.prototype,c(t))}},function(t,n,r){var e=r(3),o=r(18);t.exports=function(t,n){return arguments.length<2?(r=e[t],o(r)?r:C):e[t]&&e[t][n];var r}},function(t,n,r){r=r(12);t.exports=r({}.isPrototypeOf)},function(t,n,r){r=r(23);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,n,r){var e=r(24),r=r(6);t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&e&&e<41})},function(t,n,r){var e,o,i=r(3),u=r(25),r=i.process,i=i.Deno,i=r&&r.versions||i&&i.version,i=i&&i.v8;!(o=i?0<(e=i.split("."))[0]&&e[0]<4?1:+(e[0]+e[1]):o)&&u&&(!(e=u.match(/Edge\/(\d+)/))||74<=e[1])&&(e=u.match(/Chrome\/(\d+)/))&&(o=+e[1]),t.exports=o},function(t,n,r){r=r(20);t.exports=r("navigator","userAgent")||""},function(t,n,r){var e=r(27);t.exports=function(t,n){n=t[n];return null==n?C:e(n)}},function(t,n,r){var e=r(3),o=r(18),i=r(28),u=e.TypeError;t.exports=function(t){if(o(t))return t;throw u(i(t)+" is not a function")}},function(t,n,r){var e=r(3).String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},function(t,n,r){var e=r(3),o=r(7),i=r(18),u=r(17),c=e.TypeError;t.exports=function(t,n){var r,e;if("string"===n&&i(r=t.toString)&&!u(e=o(r,t)))return e;if(i(r=t.valueOf)&&!u(e=o(r,t)))return e;if("string"!==n&&i(r=t.toString)&&!u(e=o(r,t)))return e;throw c("Can't convert object to primitive value")}},function(t,n,r){var e=r(3),o=r(31),i=r(35),u=r(37),c=r(23),f=r(22),a=o("wks"),p=e.Symbol,s=p&&p.for,l=f?p:p&&p.withoutSetter||u;t.exports=function(t){var n;return i(a,t)&&(c||"string"==typeof a[t])||(n="Symbol."+t,c&&i(p,t)?a[t]=p[t]:a[t]=(f&&s?s:l)(n)),a[t]}},function(t,n,r){var e=r(32),o=r(33);(t.exports=function(t,n){return o[t]||(o[t]=n!==C?n:{})})("versions",[]).push({version:"3.19.1",mode:e?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(t,n){t.exports=!1},function(t,n,r){var e=r(3),o=r(34),r="__core-js_shared__",r=e[r]||o(r,{});t.exports=r},function(t,n,r){var e=r(3),o=Object.defineProperty;t.exports=function(n,r){try{o(e,n,{value:r,configurable:!0,writable:!0})}catch(t){e[n]=r}return r}},function(t,n,r){var e=r(12),o=r(36),i=e({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,n){return i(o(t),n)}},function(t,n,r){var e=r(3),o=r(14),i=e.Object;t.exports=function(t){return i(o(t))}},function(t,n,r){var r=r(12),e=0,o=Math.random(),i=r(1..toString);t.exports=function(t){return"Symbol("+(t===C?"":t)+")_"+i(++e+o,36)}},function(t,n,r){var e=r(5),o=r(6),i=r(39);t.exports=!e&&!o(function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(3),r=r(17),o=e.document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n,r){var e=r(5),o=r(41),i=r(9);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(3),o=r(5),i=r(38),u=r(42),c=r(15),f=e.TypeError,a=Object.defineProperty;n.f=o?a:function(t,n,r){if(u(t),n=c(n),u(r),i)try{return a(t,n,r)}catch(t){}if("get"in r||"set"in r)throw f("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(3),o=r(17),i=e.String,u=e.TypeError;t.exports=function(t){if(o(t))return t;throw u(i(t)+" is not an object")}},function(t,n,r){var f=r(3),a=r(18),p=r(35),s=r(40),l=r(34),e=r(44),o=r(45),y=r(49).CONFIGURABLE,i=o.get,v=o.enforce,d=String(String).split("String");(t.exports=function(t,n,r,e){var o=!!e&&!!e.unsafe,i=!!e&&!!e.enumerable,u=!!e&&!!e.noTargetGet,c=e&&e.name!==C?e.name:n;a(r)&&("Symbol("===String(c).slice(0,7)&&(c="["+String(c).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!p(r,"name")||y&&r.name!==c)&&s(r,"name",c),(e=v(r)).source||(e.source=d.join("string"==typeof c?c:""))),t!==f?(o?!u&&t[n]&&(i=!0):delete t[n],i?t[n]=r:s(t,n,r)):i?t[n]=r:l(n,r)})(Function.prototype,"toString",function(){return a(this)&&i(this).source||e(this)})},function(t,n,r){var e=r(12),o=r(18),r=r(33),i=e(Function.toString);o(r.inspectSource)||(r.inspectSource=function(t){return i(t)}),t.exports=r.inspectSource},function(t,n,r){var e,o,i,u,c,f,a,p,s=r(46),l=r(3),y=r(12),v=r(17),d=r(40),b=r(35),g=r(33),h=r(47),r=r(48),m="Object already initialized",x=l.TypeError,l=l.WeakMap;a=s||g.state?(e=g.state||(g.state=new l),o=y(e.get),i=y(e.has),u=y(e.set),c=function(t,n){if(i(e,t))throw new x(m);return n.facade=t,u(e,t,n),n},f=function(t){return o(e,t)||{}},function(t){return i(e,t)}):(r[p=h("state")]=!0,c=function(t,n){if(b(t,p))throw new x(m);return n.facade=t,d(t,p,n),n},f=function(t){return b(t,p)?t[p]:{}},function(t){return b(t,p)}),t.exports={set:c,get:f,has:a,enforce:function(t){return a(t)?f(t):c(t,{})},getterFor:function(r){return function(t){var n;if(!v(t)||(n=f(t)).type!==r)throw x("Incompatible receiver, "+r+" required");return n}}}},function(t,n,r){var e=r(3),o=r(18),r=r(44),e=e.WeakMap;t.exports=o(e)&&/native code/.test(r(e))},function(t,n,r){var e=r(31),o=r(37),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n){t.exports={}},function(t,n,r){var e=r(5),o=r(35),i=Function.prototype,u=e&&Object.getOwnPropertyDescriptor,r=o(i,"name"),o=r&&"something"===function(){}.name,i=r&&(!e||e&&u(i,"name").configurable);t.exports={EXISTS:r,PROPER:o,CONFIGURABLE:i}},function(t,n,r){var c=r(35),f=r(51),a=r(4),p=r(41);t.exports=function(t,n){for(var r=f(n),e=p.f,o=a.f,i=0;i<r.length;i++){var u=r[i];c(t,u)||e(t,u,o(n,u))}}},function(t,n,r){var e=r(20),o=r(12),i=r(52),u=r(60),c=r(42),f=o([].concat);t.exports=e("Reflect","ownKeys")||function(t){var n=i.f(c(t)),r=u.f;return r?f(n,r(t)):n}},function(t,n,r){var e=r(53),o=r(59).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},function(t,n,r){var e=r(12),u=r(35),c=r(10),f=r(54).indexOf,a=r(48),p=e([].push);t.exports=function(t,n){var r,e=c(t),o=0,i=[];for(r in e)!u(a,r)&&u(e,r)&&p(i,r);for(;n.length>o;)u(e,r=n[o++])&&(~f(i,r)||p(i,r));return i}},function(t,n,r){var f=r(10),a=r(55),p=r(57),r=function(c){return function(t,n,r){var e,o=f(t),i=p(o),u=a(r,i);if(c&&n!=n){for(;u<i;)if((e=o[u++])!=e)return!0}else for(;u<i;u++)if((c||u in o)&&o[u]===n)return c||u||0;return!c&&-1}};t.exports={includes:r(!0),indexOf:r(!1)}},function(t,n,r){var e=r(56),o=Math.max,i=Math.min;t.exports=function(t,n){t=e(t);return t<0?o(t+n,0):i(t,n)}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){t=+t;return t!=t||0==t?0:(0<t?e:r)(t)}},function(t,n,r){var e=r(58);t.exports=function(t){return e(t.length)}},function(t,n,r){var e=r(56),o=Math.min;t.exports=function(t){return 0<t?o(e(t),9007199254740991):0}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(6),o=r(18),i=/#|\.prototype\./,r=function(t,n){t=c[u(t)];return t==a||t!=f&&(o(n)?e(n):!!n)},u=r.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=r.data={},f=r.NATIVE="N",a=r.POLYFILL="P";t.exports=r},function(t,n,r){var e=r(30),o=r(63),r=r(41),i=e("unscopables"),u=Array.prototype;u[i]==C&&r.f(u,i,{configurable:!0,value:o(null)}),t.exports=function(t){u[i][t]=!0}},function(t,n,r){function e(){}function o(t){return"<script>"+t+"</"+v+">"}function i(t){t.write(o("")),t.close();var n=t.parentWindow.Object;return t=null,n}var u,c=r(42),f=r(64),a=r(59),p=r(48),s=r(66),l=r(39),r=r(47),y="prototype",v="script",d=r("IE_PROTO"),b=function(){try{u=new ActiveXObject("htmlfile")}catch(t){}var t;b="undefined"==typeof document||document.domain&&u?i(u):((t=l("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(t=t.contentWindow.document).open(),t.write(o("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete b[y][a[n]];return b()};p[d]=!0,t.exports=Object.create||function(t,n){var r;return null!==t?(e[y]=c(t),r=new e,e[y]=null,r[d]=t):r=b(),n===C?r:f(r,n)}},function(t,n,r){var e=r(5),c=r(41),f=r(42),a=r(10),p=r(65);t.exports=e?Object.defineProperties:function(t,n){f(t);for(var r,e=a(n),o=p(n),i=o.length,u=0;u<i;)c.f(t,r=o[u++],e[r]);return t}},function(t,n,r){var e=r(53),o=r(59);t.exports=Object.keys||function(t){return e(t,o)}},function(t,n,r){r=r(20);t.exports=r("document","documentElement")},function(t,n,r){r(2)({target:"Object",stat:!0},{hasOwn:r(35)})},function(t,n,r){var e=r(2),o=r(12),i=r(14),u=r(56),c=r(69),r=r(6),f=o("".charAt);e({target:"String",proto:!0,forced:r(function(){return"\ud842"!=="𠮷".at(0)})},{at:function(t){var n=c(i(this)),r=n.length,t=u(t),t=0<=t?t:r+t;return t<0||r<=t?C:f(n,t)}})},function(t,n,r){var e=r(3),o=r(70),i=e.String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},function(t,n,r){var e=r(3),o=r(71),i=r(18),u=r(13),c=r(30)("toStringTag"),f=e.Object,a="Arguments"==u(function(){return arguments}());t.exports=o?u:function(t){var n;return t===C?"Undefined":null===t?"Null":"string"==typeof(t=function(t,n){try{return t[n]}catch(t){}}(n=f(t),c))?t:a?u(n):"Object"==(t=u(n))&&i(n.callee)?"Arguments":t}},function(t,n,r){var e={};e[r(30)("toStringTag")]="z",t.exports="[object z]"===String(e)},function(t,n,r){var e=r(73),o=r(57),i=r(56),u=e.aTypedArray;(0,e.exportTypedArrayMethod)("at",function(t){var n=u(this),r=o(n),t=i(t),t=0<=t?t:r+t;return t<0||r<=t?C:n[t]})},function(t,n,r){function e(t){return!!s(t)&&(t=y(t),l(M,t)||l(R,t))}var o,i,u,c=r(74),f=r(5),a=r(3),p=r(18),s=r(17),l=r(35),y=r(70),v=r(28),d=r(40),b=r(43),g=r(41).f,h=r(21),m=r(75),x=r(77),O=r(30),S=r(37),w=a.Int8Array,j=w&&w.prototype,r=a.Uint8ClampedArray,r=r&&r.prototype,A=w&&m(w),T=j&&m(j),w=Object.prototype,P=a.TypeError,O=O("toStringTag"),_=S("TYPED_ARRAY_TAG"),E=S("TYPED_ARRAY_CONSTRUCTOR"),I=c&&!!x&&"Opera"!==y(a.opera),c=!1,M={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},R={BigInt64Array:8,BigUint64Array:8};for(o in M)(u=(i=a[o])&&i.prototype)?d(u,E,i):I=!1;for(o in R)(u=(i=a[o])&&i.prototype)&&d(u,E,i);if((!I||!p(A)||A===Function.prototype)&&(A=function(){throw P("Incorrect invocation")},I))for(o in M)a[o]&&x(a[o],A);if((!I||!T||T===w)&&(T=A.prototype,I))for(o in M)a[o]&&x(a[o].prototype,T);if(I&&m(r)!==T&&x(r,T),f&&!l(T,O))for(o in c=!0,g(T,O,{get:function(){return s(this)?this[_]:C}}),M)a[o]&&d(a[o],_,o);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_CONSTRUCTOR:E,TYPED_ARRAY_TAG:c&&_,aTypedArray:function(t){if(e(t))return t;throw P("Target is not a typed array")},aTypedArrayConstructor:function(t){if(p(t)&&(!x||h(A,t)))return t;throw P(v(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,n,r){if(f){if(r)for(var e in M){e=a[e];if(e&&l(e.prototype,t))try{delete e.prototype[t]}catch(t){}}T[t]&&!r||b(T,t,!r&&I&&j[t]||n)}},exportTypedArrayStaticMethod:function(t,n,r){var e,o;if(f){if(x){if(r)for(e in M)if((o=a[e])&&l(o,t))try{delete o[t]}catch(t){}if(A[t]&&!r)return;try{return b(A,t,!r&&I&&A[t]||n)}catch(t){}}for(e in M)!(o=a[e])||o[t]&&!r||b(o,t,n)}},isView:function(t){if(!s(t))return!1;t=y(t);return"DataView"===t||l(M,t)||l(R,t)},isTypedArray:e,TypedArray:A,TypedArrayPrototype:T}},function(t,n){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(t,n,r){var e=r(3),o=r(35),i=r(18),u=r(36),c=r(47),r=r(76),f=c("IE_PROTO"),a=e.Object,p=a.prototype;t.exports=r?a.getPrototypeOf:function(t){var n=u(t);if(o(n,f))return n[f];t=n.constructor;return i(t)&&n instanceof t?t.prototype:n instanceof a?p:null}},function(t,n,r){r=r(6);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,n,r){var o=r(12),i=r(42),u=r(78);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,e=!1,t={};try{(r=o(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(t,[]),e=t instanceof Array}catch(t){}return function(t,n){return i(t),u(n),e?r(t,n):t.__proto__=n,t}}():C)},function(t,n,r){var e=r(3),o=r(18),i=e.String,u=e.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw u("Can't set "+i(t)+" as a prototype")}},function(t,n,r){var e=r(3),o=r(12),i=r(6),u=r(27),c=r(80),f=r(73),a=r(82),p=r(83),s=r(24),l=r(84),y=e.Array,v=f.aTypedArray,f=f.exportTypedArrayMethod,d=e.Uint16Array,b=d&&o(d.prototype.sort),o=!(!b||i(function(){b(new d(2),null)})&&i(function(){b(new d(2),{})})),g=!!b&&!i(function(){if(s)return s<74;if(a)return a<67;if(p)return!0;if(l)return l<602;for(var t,n=new d(516),r=y(516),e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(b(n,function(t,n){return(t/4|0)-(n/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0});f("sort",function(t){return t!==C&&u(t),g?b(this,t):c(v(this),(r=t,function(t,n){return r!==C?+r(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?0<1/t&&1/n<0?1:-1:n<t}));var r},!g||o)},function(t,n,r){var o=r(81),i=Math.floor,u=function(t,n){var r=t.length,e=i(r/2);return r<8?c(t,n):f(t,u(o(t,0,e),n),u(o(t,e),n),n)},c=function(t,n){for(var r,e,o=t.length,i=1;i<o;){for(r=t[e=i];e&&0<n(t[e-1],r);)t[e]=t[--e];e!==i++&&(t[e]=r)}return t},f=function(t,n,r,e){for(var o=n.length,i=r.length,u=0,c=0;u<o||c<i;)t[u+c]=u<o&&c<i?e(n[u],r[c])<=0?n[u++]:r[c++]:u<o?n[u++]:r[c++];return t};t.exports=u},function(t,n,r){r=r(12);t.exports=r([].slice)},function(t,n,r){r=r(25).match(/firefox\/(\d+)/i);t.exports=!!r&&+r[1]},function(t,n,r){r=r(25);t.exports=/MSIE|Trident/.test(r)},function(t,n,r){r=r(25).match(/AppleWebKit\/(\d+)\./);t.exports=!!r&&+r[1]},function(t,n,r){var e=r(2),o=r(3),r=r(86);e({global:!0,bind:!0,enumerable:!0,forced:!o.setImmediate||!o.clearImmediate},{setImmediate:r.set,clearImmediate:r.clear})},function(t,n,r){var e,o,i=r(3),u=r(87),c=r(88),f=r(18),a=r(35),p=r(6),s=r(66),l=r(81),y=r(39),v=r(89),d=r(90),b=i.setImmediate,g=i.clearImmediate,h=i.process,m=i.Dispatch,x=i.Function,O=i.MessageChannel,S=i.String,w=0,j={},A="onreadystatechange";try{e=i.location}catch(t){}function T(t){var n;a(j,t)&&(n=j[t],delete j[t],n())}function P(t){return function(){T(t)}}function _(t){T(t.data)}r=function(t){i.postMessage(S(t),e.protocol+"//"+e.host)};b&&g||(b=function(t){var n=l(arguments,1);return j[++w]=function(){u(f(t)?t:x(t),C,n)},o(w),w},g=function(t){delete j[t]},d?o=function(t){h.nextTick(P(t))}:m&&m.now?o=function(t){m.now(P(t))}:O&&!v?(O=(v=new O).port2,v.port1.onmessage=_,o=c(O.postMessage,O)):i.addEventListener&&f(i.postMessage)&&!i.importScripts&&e&&"file:"!==e.protocol&&!p(r)?(o=r,i.addEventListener("message",_,!1)):o=A in y("script")?function(t){s.appendChild(y("script"))[A]=function(){s.removeChild(this),T(t)}}:function(t){setTimeout(P(t),0)}),t.exports={set:b,clear:g}},function(t,n){var r=Function.prototype,e=r.apply,o=r.bind,i=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(o?i.bind(e):function(){return i.apply(e,arguments)})},function(t,n,r){var e=r(12),o=r(27),i=e(e.bind);t.exports=function(t,n){return o(t),n===C?t:i?i(t,n):function(){return t.apply(n,arguments)}}},function(t,n,r){r=r(25);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},function(t,n,r){var e=r(13),r=r(3);t.exports="process"==e(r.process)}],o.c=e,o.d=function(t,n,r){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(n,t){if(1&t&&(n=o(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)o.d(r,e,function(t){return n[t]}.bind(null,e));return r},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=0)}();
!function(){"use strict";const e=e=>Math.abs(parseInt(e,10)),t=(e,t)=>{const r=new Map([["init","init"],["validation_failed","invalid"],["acceptance_missing","unaccepted"],["spam","spam"],["aborted","aborted"],["mail_sent","sent"],["mail_failed","failed"],["submitting","submitting"],["resetting","resetting"],["payment_required","payment-required"]]);r.has(t)&&(t=r.get(t)),Array.from(r.values()).includes(t)||(t=`custom-${t=(t=t.replace(/[^0-9a-z]+/i," ").trim()).replace(/\s+/,"-")}`);const n=e.getAttribute("data-status");return e.wpcf7.status=t,e.setAttribute("data-status",t),e.classList.add(t),n&&n!==t&&e.classList.remove(n),t},r=(e,t,r)=>{const n=new CustomEvent(`wpcf7${t}`,{bubbles:!0,detail:r});"string"==typeof e&&(e=document.querySelector(e)),e.dispatchEvent(n)},n=e=>{const{root:t,namespace:r="contact-form-7/v1"}=wpcf7.api;return a.reduceRight(((e,t)=>r=>t(r,e)),(e=>{let n,a,{url:c,path:s,endpoint:o,headers:i,body:l,data:p,...d}=e;"string"==typeof o&&(n=r.replace(/^\/|\/$/g,""),a=o.replace(/^\//,""),s=a?n+"/"+a:n),"string"==typeof s&&(-1!==t.indexOf("?")&&(s=s.replace("?","&")),s=s.replace(/^\//,""),c=t+s),i={Accept:"application/json, */*;q=0.1",...i},delete i["X-WP-Nonce"],p&&(l=JSON.stringify(p),i["Content-Type"]="application/json");const u={code:"fetch_error",message:"You are probably offline."},f={code:"invalid_json",message:"The response is not a valid JSON response."};return window.fetch(c||s||window.location.href,{...d,headers:i,body:l}).then((e=>Promise.resolve(e).then((e=>{if(e.status>=200&&e.status<300)return e;throw e})).then((e=>{if(204===e.status)return null;if(e&&e.json)return e.json().catch((()=>{throw f}));throw f}))),(()=>{throw u}))}))(e)},a=[];function c(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(wpcf7.blocked)return s(e),void t(e,"submitting");const c=new FormData(e);a.submitter&&a.submitter.name&&c.append(a.submitter.name,a.submitter.value);const o={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(c,(e=>{const t=e[0],r=e[1];return!t.match(/^_/)&&{name:t,value:r}})).filter((e=>!1!==e)),formData:c},i=t=>{const r=document.createElement("li");r.setAttribute("id",t.error_id),t.idref?r.insertAdjacentHTML("beforeend",`<a href="#${t.idref}">${t.message}</a>`):r.insertAdjacentText("beforeend",t.message),e.wpcf7.parent.querySelector(".screen-reader-response ul").appendChild(r)},l=t=>{const r=e.querySelector(t.into),n=r.querySelector(".wpcf7-form-control");n.classList.add("wpcf7-not-valid"),n.setAttribute("aria-describedby",t.error_id);const a=document.createElement("span");a.setAttribute("class","wpcf7-not-valid-tip"),a.setAttribute("aria-hidden","true"),a.insertAdjacentText("beforeend",t.message),r.appendChild(a),r.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),n.closest(".use-floating-validation-tip")&&(n.addEventListener("focus",(e=>{a.setAttribute("style","display: none")})),a.addEventListener("mouseover",(e=>{a.setAttribute("style","display: none")})))};n({endpoint:`contact-forms/${e.wpcf7.id}/feedback`,method:"POST",body:c,wpcf7:{endpoint:"feedback",form:e,detail:o}}).then((n=>{const a=t(e,n.status);return o.status=n.status,o.apiResponse=n,["invalid","unaccepted","spam","aborted"].includes(a)?r(e,a,o):["sent","failed"].includes(a)&&r(e,`mail${a}`,o),r(e,"submit",o),n})).then((t=>{t.posted_data_hash&&(e.querySelector('input[name="_wpcf7_posted_data_hash"]').value=t.posted_data_hash),"mail_sent"===t.status&&(e.reset(),e.wpcf7.resetOnMailSent=!0),t.invalid_fields&&(t.invalid_fields.forEach(i),t.invalid_fields.forEach(l)),e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').insertAdjacentText("beforeend",t.message),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=t.message}))})).catch((e=>console.error(e)))}n.use=e=>{a.unshift(e)},n.use(((e,n)=>{if(e.wpcf7&&"feedback"===e.wpcf7.endpoint){const{form:n,detail:a}=e.wpcf7;s(n),r(n,"beforesubmit",a),t(n,"submitting")}return n(e)}));const s=e=>{e.wpcf7.parent.querySelector('.screen-reader-response [role="status"]').innerText="",e.wpcf7.parent.querySelector(".screen-reader-response ul").innerText="",e.querySelectorAll(".wpcf7-not-valid-tip").forEach((e=>{e.remove()})),e.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),e.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid")})),e.querySelectorAll(".wpcf7-response-output").forEach((e=>{e.innerText=""}))};function o(e){const a=new FormData(e),c={contactFormId:e.wpcf7.id,pluginVersion:e.wpcf7.pluginVersion,contactFormLocale:e.wpcf7.locale,unitTag:e.wpcf7.unitTag,containerPostId:e.wpcf7.containerPost,status:e.wpcf7.status,inputs:Array.from(a,(e=>{const t=e[0],r=e[1];return!t.match(/^_/)&&{name:t,value:r}})).filter((e=>!1!==e)),formData:a};n({endpoint:`contact-forms/${e.wpcf7.id}/refill`,method:"GET",wpcf7:{endpoint:"refill",form:e,detail:c}}).then((n=>{e.wpcf7.resetOnMailSent?(delete e.wpcf7.resetOnMailSent,t(e,"mail_sent")):t(e,"init"),c.apiResponse=n,r(e,"reset",c)})).catch((e=>console.error(e)))}n.use(((e,r)=>{if(e.wpcf7&&"refill"===e.wpcf7.endpoint){const{form:r,detail:n}=e.wpcf7;s(r),t(r,"resetting")}return r(e)}));const i=(e,t)=>{for(const r in t){const n=t[r];e.querySelectorAll(`input[name="${r}"]`).forEach((e=>{e.value=""})),e.querySelectorAll(`img.wpcf7-captcha-${r}`).forEach((e=>{e.setAttribute("src",n)}));const a=/([0-9]+)\.(png|gif|jpeg)$/.exec(n);a&&e.querySelectorAll(`input[name="_wpcf7_captcha_challenge_${r}"]`).forEach((e=>{e.value=a[1]}))}},l=(e,t)=>{for(const r in t){const n=t[r][0],a=t[r][1];e.querySelectorAll(`.wpcf7-form-control-wrap.${r}`).forEach((e=>{e.querySelector(`input[name="${r}"]`).value="",e.querySelector(".wpcf7-quiz-label").textContent=n,e.querySelector(`input[name="_wpcf7_quiz_answer_${r}"]`).value=a}))}};function p(t){const r=new FormData(t);t.wpcf7={id:e(r.get("_wpcf7")),status:t.getAttribute("data-status"),pluginVersion:r.get("_wpcf7_version"),locale:r.get("_wpcf7_locale"),unitTag:r.get("_wpcf7_unit_tag"),containerPost:e(r.get("_wpcf7_container_post")),parent:t.closest(".wpcf7")},t.querySelectorAll(".has-spinner").forEach((e=>{e.insertAdjacentHTML("afterend",'<span class="wpcf7-spinner"></span>')})),(e=>{e.querySelectorAll(".wpcf7-exclusive-checkbox").forEach((t=>{t.addEventListener("change",(t=>{const r=t.target.getAttribute("name");e.querySelectorAll(`input[type="checkbox"][name="${r}"]`).forEach((e=>{e!==t.target&&(e.checked=!1)}))}))}))})(t),(e=>{e.querySelectorAll(".has-free-text").forEach((t=>{const r=t.querySelector("input.wpcf7-free-text"),n=t.querySelector('input[type="checkbox"], input[type="radio"]');r.disabled=!n.checked,e.addEventListener("change",(e=>{r.disabled=!n.checked,e.target===n&&n.checked&&r.focus()}))}))})(t),(e=>{e.querySelectorAll(".wpcf7-validates-as-url").forEach((e=>{e.addEventListener("change",(t=>{let r=e.value.trim();r&&!r.match(/^[a-z][a-z0-9.+-]*:/i)&&-1!==r.indexOf(".")&&(r=r.replace(/^\/+/,""),r="http://"+r),e.value=r}))}))})(t),(e=>{if(!e.querySelector(".wpcf7-acceptance")||e.classList.contains("wpcf7-acceptance-as-validation"))return;const t=()=>{let t=!0;e.querySelectorAll(".wpcf7-acceptance").forEach((e=>{if(!t||e.classList.contains("optional"))return;const r=e.querySelector('input[type="checkbox"]');(e.classList.contains("invert")&&r.checked||!e.classList.contains("invert")&&!r.checked)&&(t=!1)})),e.querySelectorAll(".wpcf7-submit").forEach((e=>{e.disabled=!t}))};t(),e.addEventListener("change",(e=>{t()})),e.addEventListener("wpcf7reset",(e=>{t()}))})(t),(t=>{const r=(t,r)=>{const n=e(t.getAttribute("data-starting-value")),a=e(t.getAttribute("data-maximum-value")),c=e(t.getAttribute("data-minimum-value")),s=t.classList.contains("down")?n-r.value.length:r.value.length;t.setAttribute("data-current-value",s),t.innerText=s,a&&a<r.value.length?t.classList.add("too-long"):t.classList.remove("too-long"),c&&r.value.length<c?t.classList.add("too-short"):t.classList.remove("too-short")},n=e=>{e={init:!1,...e},t.querySelectorAll(".wpcf7-character-count").forEach((n=>{const a=n.getAttribute("data-target-name"),c=t.querySelector(`[name="${a}"]`);c&&(c.value=c.defaultValue,r(n,c),e.init&&c.addEventListener("keyup",(e=>{r(n,c)})))}))};n({init:!0}),t.addEventListener("wpcf7reset",(e=>{n()}))})(t),window.addEventListener("load",(e=>{wpcf7.cached&&t.reset()})),t.addEventListener("reset",(e=>{wpcf7.reset(t)})),t.addEventListener("submit",(e=>{const r=e.submitter;wpcf7.submit(t,{submitter:r}),e.preventDefault()})),t.addEventListener("wpcf7submit",(e=>{e.detail.apiResponse.captcha&&i(t,e.detail.apiResponse.captcha),e.detail.apiResponse.quiz&&l(t,e.detail.apiResponse.quiz)})),t.addEventListener("wpcf7reset",(e=>{e.detail.apiResponse.captcha&&i(t,e.detail.apiResponse.captcha),e.detail.apiResponse.quiz&&l(t,e.detail.apiResponse.quiz)}))}document.addEventListener("DOMContentLoaded",(e=>{var t;if("undefined"==typeof wpcf7)return void console.error("wpcf7 is not defined.");if(void 0===wpcf7.api)return void console.error("wpcf7.api is not defined.");if("function"!=typeof window.fetch)return void console.error("Your browser doesn't support window.fetch().");if("function"!=typeof window.FormData)return void console.error("Your browser doesn't support window.FormData().");const r=document.querySelectorAll(".wpcf7 > form");"function"==typeof r.forEach?(wpcf7={init:p,submit:c,reset:o,...null!==(t=wpcf7)&&void 0!==t?t:{}},r.forEach((e=>wpcf7.init(e)))):console.error("Your browser doesn't support NodeList.forEach().")}))}();
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);t=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return t}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(n=g(b.commentReplyTitleId))&&n.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),n=t&&t.firstChild.textContent,d=this,o=m(d,"belowelement"),i=m(d,"commentid"),r=m(d,"respondelement"),t=m(d,"postid"),n=m(d,"replyto")||n;o&&i&&r&&t&&!1===v.addComment.moveForm(o,i,r,t,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i=g(e);h=g(n);var r,l,a,m,c,s=g(b.parentIdFieldId),y=g(b.postIdFieldId),p=(c=g(b.commentReplyTitleId))&&c.firstChild,u=p&&p.nextSibling;if(i&&h&&s){void 0===o&&(o=p&&p.textContent),m=h,e=b.temporaryFormId,n=g(e),c=(c=g(b.commentReplyTitleId))?c.firstChild.textContent:"",n||((n=E.createElement("div")).id=e,n.style.display="none",n.textContent=c,m.parentNode.insertBefore(n,m)),d&&y&&(y.value=d),s.value=t,I.style.display="",i.parentNode.insertBefore(h,i.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(r=C.elements[f],l=!1,"getComputedStyle"in v?a=v.getComputedStyle(r):E.documentElement.currentStyle&&(a=r.currentStyle),(r.offsetWidth<=0&&r.offsetHeight<=0||"hidden"===a.visibility)&&(l=!0),"hidden"!==r.type&&!r.disabled&&!l){r.focus();break}}catch(e){}return!1}}}}(window);
function wpss_get_ckf(e){var t=document.cookie.split(";");for(var s in t)if(t.hasOwnProperty(s))if(-1!=t[s].indexOf(e+"="))return decodeURIComponent(t[s].split("=")[1]);return""}function wpss_set_ckf(e,t,s,n,i,_){var c=new Date;c.setTime(c.getTime()),s&&(s=1e3*s*60*60*24);var r=new Date(c.getTime()+s);document.cookie=e+"="+escape(t)+(s?";expires="+r.toGMTString():"")+(n?";path="+n:"")+(i?";domain="+i:"")+(_?";secure":"")}function wpss_init_ckf(){var e=wpss_get_ckf("JCS_INENREF"),t=wpss_get_ckf("JCS_INENTIM"),s=new Date,n=s.getTime(),i=document.referrer;e||wpss_set_ckf("JCS_INENREF",i,1/24,"/"),t||wpss_set_ckf("JCS_INENTIM",n,1/24,"/");var h=window.history.length;var p=navigator.plugins.length;var q="N:"+p.toString();var u="";for(var j=0;j<p;j++){var k=j+1;u+="["+k+"]["+navigator.plugins[j].name+"] ";}var d=q+" | "+window.btoa(u);wpss_set_ckf("_wpss_h_",h,1/24,"/");wpss_set_ckf("_wpss_p_",d,1/24,"/");}wpss_init_ckf();jQuery(document).ready(function($){$("#commentform, .comment-respond form, .comment-form").removeAttr("novalidate");var f="form[method='post']";$(f).submit(function(){$("<input>").attr("type","hidden").attr("name","WP55T3S7XJS2").attr("value","7H5W8K53HX").appendTo(f);return true;})});
!function(){var h,n=this;function p(t){return void 0!==t}function aa(){}function ba(t){t.yb=function(){return t.zf?t.zf:t.zf=new t}}function ca(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function da(t){return"array"==ca(t)}function ea(t){var e=ca(t);return"array"==e||"object"==e&&"number"==typeof t.length}function q(t){return"string"==typeof t}function fa(t){return"number"==typeof t}function r(t){return"function"==ca(t)}function ga(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function ha(t,e,n){return t.call.apply(t.bind,arguments)}function ia(e,n,t){if(!e)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var t=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(t,i),e.apply(n,t)}}return function(){return e.apply(n,arguments)}}function u(t,e,n){return(u=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ha:ia).apply(null,arguments)}var ja=Date.now||function(){return+new Date};function ka(t,o){function e(){}e.prototype=o.prototype,t.ph=o.prototype,t.prototype=new e,(t.prototype.constructor=t).lh=function(t,e,n){for(var i=Array(arguments.length-2),r=2;r<arguments.length;r++)i[r-2]=arguments[r];return o.prototype[e].apply(t,i)}}function la(t){if(Error.captureStackTrace)Error.captureStackTrace(this,la);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function v(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function ma(t,e){var n,i={};for(n in t)i[n]=e.call(void 0,t[n],n,t);return i}function na(t,e){for(var n in t)if(!e.call(void 0,t[n],n,t))return!1;return!0}function oa(t){var e,n=0;for(e in t)n++;return n}function pa(t){for(var e in t)return e}function qa(t){var e,n=[],i=0;for(e in t)n[i++]=t[e];return n}function ra(t){var e,n=[],i=0;for(e in t)n[i++]=e;return n}function sa(t,e){for(var n in t)if(t[n]==e)return!0;return!1}function ta(t,e,n){for(var i in t)if(e.call(n,t[i],i,t))return i}function ua(t,e){var n=ta(t,e,void 0);return n&&t[n]}function va(t){for(var e in t)return!1;return!0}function wa(t){var e,n={};for(e in t)n[e]=t[e];return n}ka(la,Error),la.prototype.name="CustomError";var xa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ya(t,e){for(var n,i,r=1;r<arguments.length;r++){for(n in i=arguments[r])t[n]=i[n];for(var o=0;o<xa.length;o++)n=xa[o],Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}}function za(a){if(a=String(a),!/^\s*$/.test(a)&&/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a)}function Aa(){this.Vd=void 0}function Ba(t,e,n){switch(typeof e){case"string":Ca(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?e:"null");break;case"boolean":n.push(e);break;case"undefined":n.push("null");break;case"object":if(null==e){n.push("null");break}if(da(e)){var i=e.length;n.push("[");for(var r="",o=0;o<i;o++)n.push(r),r=e[o],Ba(t,t.Vd?t.Vd.call(e,String(o),r):r,n),r=",";n.push("]");break}for(o in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,o)&&("function"!=typeof(r=e[o])&&(n.push(i),Ca(o,n),n.push(":"),Ba(t,t.Vd?t.Vd.call(e,o,r):r,n),i=","));n.push("}");break;case"function":break;default:throw Error("Unknown type: "+typeof e)}}var Da={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Ea=/\uffff/.test("￿")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,w;function Ca(t,e){e.push('"',t.replace(Ea,function(t){if(t in Da)return Da[t];var e=t.charCodeAt(0),n="\\u";return e<16?n+="000":e<256?n+="00":e<4096&&(n+="0"),Da[t]=n+e.toString(16)}),'"')}function Fa(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^ja()).toString(36)}t:{var Ga=n.navigator;if(Ga){var Ha=Ga.userAgent;if(Ha){w=Ha;break t}}w=""}function Ia(){this.Ya=-1}function Ja(){this.Ya=-1,this.Ya=64,this.P=[],this.pe=[],this.eg=[],this.Od=[],this.Od[0]=128;for(var t=1;t<this.Ya;++t)this.Od[t]=0;this.ge=this.ec=0,this.reset()}function Ka(t,e,n){n=n||0;var i=t.eg;if(q(e))for(var r=0;r<16;r++)i[r]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(r=0;r<16;r++)i[r]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(r=16;r<80;r++){var o=i[r-3]^i[r-8]^i[r-14]^i[r-16];i[r]=4294967295&(o<<1|o>>>31)}e=t.P[0],n=t.P[1];var a,s=t.P[2],h=t.P[3],u=t.P[4];for(r=0;r<80;r++)a=r<40?r<20?(o=h^n&(s^h),1518500249):(o=n^s^h,1859775393):r<60?(o=n&s|h&(n|s),2400959708):(o=n^s^h,3395469782),o=(e<<5|e>>>27)+o+u+a+i[r]&4294967295,u=h,h=s,s=4294967295&(n<<30|n>>>2),n=e,e=o;t.P[0]=t.P[0]+e&4294967295,t.P[1]=t.P[1]+n&4294967295,t.P[2]=t.P[2]+s&4294967295,t.P[3]=t.P[3]+h&4294967295,t.P[4]=t.P[4]+u&4294967295}ka(Ja,Ia),Ja.prototype.reset=function(){this.P[0]=1732584193,this.P[1]=4023233417,this.P[2]=2562383102,this.P[3]=271733878,this.P[4]=3285377520,this.ge=this.ec=0},Ja.prototype.update=function(t,e){if(null!=t){p(e)||(e=t.length);for(var n=e-this.Ya,i=0,r=this.pe,o=this.ec;i<e;){if(0==o)for(;i<=n;)Ka(this,t,i),i+=this.Ya;if(q(t)){for(;i<e;)if(r[o]=t.charCodeAt(i),++i,++o==this.Ya){Ka(this,r),o=0;break}}else for(;i<e;)if(r[o]=t[i],++i,++o==this.Ya){Ka(this,r),o=0;break}}this.ec=o,this.ge+=e}};var x=Array.prototype,La=x.indexOf?function(t,e,n){return x.indexOf.call(t,e,n)}:function(t,e,n){if(n=null==n?0:n<0?Math.max(0,t.length+n):n,q(t))return q(e)&&1==e.length?t.indexOf(e,n):-1;for(;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},Ma=x.forEach?function(t,e,n){x.forEach.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=q(t)?t.split(""):t,o=0;o<i;o++)o in r&&e.call(n,r[o],o,t)},Na=x.filter?function(t,e,n){return x.filter.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=[],o=0,a=q(t)?t.split(""):t,s=0;s<i;s++)if(s in a){var h=a[s];e.call(n,h,s,t)&&(r[o++]=h)}return r},Oa=x.map?function(t,e,n){return x.map.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=Array(i),o=q(t)?t.split(""):t,a=0;a<i;a++)a in o&&(r[a]=e.call(n,o[a],a,t));return r},Pa=x.reduce?function(t,e,n,i){for(var r=[],o=1,a=arguments.length;o<a;o++)r.push(arguments[o]);return i&&(r[0]=u(e,i)),x.reduce.apply(t,r)}:function(n,i,t,r){var o=t;return Ma(n,function(t,e){o=i.call(r,o,t,e,n)}),o},Qa=x.every?function(t,e,n){return x.every.call(t,e,n)}:function(t,e,n){for(var i=t.length,r=q(t)?t.split(""):t,o=0;o<i;o++)if(o in r&&!e.call(n,r[o],o,t))return!1;return!0},Ya,ab;function Ra(t,e){var n=Sa(t,e,void 0);return n<0?null:q(t)?t.charAt(n):t[n]}function Sa(t,e,n){for(var i=t.length,r=q(t)?t.split(""):t,o=0;o<i;o++)if(o in r&&e.call(n,r[o],o,t))return o;return-1}function Ta(t,e){var n=La(t,e);0<=n&&x.splice.call(t,n,1)}function Ua(t,e,n){return arguments.length<=2?x.slice.call(t,e):x.slice.call(t,e,n)}function Va(t,e){t.sort(e||Wa)}function Wa(t,e){return e<t?1:t<e?-1:0}function Xa(t){n.setTimeout(function(){throw t},0)}function Za(){var t=n.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&-1==w.indexOf("Presto")&&(t=function(){(i=document.createElement("iframe")).style.display="none",i.src="",document.documentElement.appendChild(i);var t=i.contentWindow;(i=t.document).open(),i.write(""),i.close();var e="callImmediate"+Math.random(),n="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host,i=u(function(t){"*"!=n&&t.origin!=n||t.data!=e||this.port1.onmessage()},this);t.addEventListener("message",i,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(e,n)}}}),void 0===t||-1!=w.indexOf("Trident")||-1!=w.indexOf("MSIE"))return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("script")?function(t){var e=document.createElement("script");e.onreadystatechange=function(){e.onreadystatechange=null,e.parentNode.removeChild(e),e=null,t(),t=null},document.documentElement.appendChild(e)}:function(t){n.setTimeout(t,0)};var e=new t,i={},r=i;return e.port1.onmessage=function(){if(p(i.next)){var t=(i=i.next).hb;i.hb=null,t()}},function(t){r.next={hb:t},r=r.next,e.port2.postMessage(0)}}function $a(t,e){ab||bb(),cb||(ab(),cb=!0),db.push(new eb(t,e))}function bb(){if(n.Promise&&n.Promise.resolve){var t=n.Promise.resolve();ab=function(){t.then(fb)}}else ab=function(){var t=fb;!r(n.setImmediate)||n.Window&&n.Window.prototype&&n.Window.prototype.setImmediate==n.setImmediate?(Ya=Ya||Za())(t):n.setImmediate(t)}}var cb=!1,db=[];function fb(){for(;db.length;){var t=db;db=[];for(var e=0;e<t.length;e++){var n=t[e];try{n.yg.call(n.scope)}catch(i){Xa(i)}}}cb=!1}function eb(t,e){this.yg=t,this.scope=e}[].push(function(){cb=!1,db=[]});var gb=-1!=w.indexOf("Opera")||-1!=w.indexOf("OPR"),hb=-1!=w.indexOf("Trident")||-1!=w.indexOf("MSIE"),ib=-1!=w.indexOf("Gecko")&&-1==w.toLowerCase().indexOf("webkit")&&!(-1!=w.indexOf("Trident")||-1!=w.indexOf("MSIE")),jb=-1!=w.toLowerCase().indexOf("webkit"),Gm,Fm;Fm="",gb&&n.opera?r(Fm=n.opera.version)&&Fm():(ib?Gm=/rv\:([^\);]+)(\)|;)/:hb?Gm=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:jb&&(Gm=/WebKit\/(\S+)/),Gm&&(Fm=(Fm=Gm.exec(w))?Fm[1]:""),hb&&(Gm=(Gm=n.document)?Gm.documentMode:void 0)>parseFloat(Fm)&&String(Gm));var kb=null,lb=null,mb=null;function nb(t,e){if(!ea(t))throw Error("encodeByteArray takes an array as a parameter");ob();for(var n=e?lb:kb,i=[],r=0;r<t.length;r+=3){var o=t[r],a=r+1<t.length,s=a?t[r+1]:0,h=r+2<t.length,u=o>>2,c=(o=(3&o)<<4|s>>4,s=(15&s)<<2|(c=h?t[r+2]:0)>>6,63&c);h||(c=64,a||(s=64)),i.push(n[u],n[o],n[s],n[c])}return i.join("")}function ob(){if(!kb){kb={},lb={},mb={};for(var t=0;t<65;t++)kb[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),lb[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t),62<=(mb[lb[t]]=t)&&(mb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)]=t)}}function pb(t,e){if(this.N=qb,this.Rf=void 0,this.Ba=this.Ha=null,this.yd=this.ye=!1,t==rb)sb(this,tb,e);else try{var n=this;t.call(e,function(t){sb(n,tb,t)},function(t){if(!(t instanceof ub))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}sb(n,vb,t)})}catch(i){sb(this,vb,i)}}var qb=0,tb=2,vb=3;function rb(){}function xb(t,e){if(t.N==qb)if(t.Ha){var n=t.Ha;if(n.Ba){for(var i,r=0,o=-1,a=0;(i=n.Ba[a])&&!((i=i.o)&&(r++,i==t&&(o=a),0<=o&&1<r));a++);0<=o&&(n.N==qb&&1==r?xb(n,e):(r=n.Ba.splice(o,1)[0],yb(n,r,vb,e)))}t.Ha=null}else sb(t,vb,e)}function zb(t,e){t.Ba&&t.Ba.length||t.N!=tb&&t.N!=vb||Ab(t),t.Ba||(t.Ba=[]),t.Ba.push(e)}function wb(t,o,a,s){var e={o:null,Hf:null,Jf:null};return e.o=new pb(function(i,r){e.Hf=o?function(t){try{var e=o.call(s,t);i(e)}catch(n){r(n)}}:i,e.Jf=a?function(t){try{var e=a.call(s,t);!p(e)&&t instanceof ub?r(t):i(e)}catch(n){r(n)}}:r}),zb(e.o.Ha=t,e),e.o}function sb(t,e,n){if(t.N==qb){if(t==n)e=vb,n=new TypeError("Promise cannot resolve to itself");else{var i;if(n)try{i=!!n.$goog_Thenable}catch(a){i=!1}else i=!1;if(i)return t.N=1,void n.then(t.Yf,t.Zf,t);if(ga(n))try{var o=n.then;if(r(o))return void Bb(t,n,o)}catch(s){e=vb,n=s}}t.Rf=n,t.N=e,t.Ha=null,Ab(t),e!=vb||n instanceof ub||Cb(t,n)}}function Bb(e,t,n){function i(t){r||(r=!0,e.Zf(t))}var r=!(e.N=1);try{n.call(t,function o(t){r||(r=!0,e.Yf(t))},i)}catch(a){i(a)}}function Ab(t){t.ye||(t.ye=!0,$a(t.wg,t))}function yb(t,e,n,i){if(n==tb)e.Hf(i);else{if(e.o)for(;t&&t.yd;t=t.Ha)t.yd=!1;e.Jf(i)}}function Cb(t,e){t.yd=!0,$a(function(){t.yd&&Db.call(null,e)})}pb.prototype.then=function(t,e,n){return wb(this,r(t)?t:null,r(e)?e:null,n)},pb.prototype.then=pb.prototype.then,pb.prototype.$goog_Thenable=!0,h=pb.prototype,h.gh=function(t,e){return wb(this,null,t,e)},h.cancel=function(t){this.N==qb&&$a(function(){xb(this,new ub(t))},this)},h.Yf=function(t){this.N=qb,sb(this,tb,t)},h.Zf=function(t){this.N=qb,sb(this,vb,t)},h.wg=function(){for(;this.Ba&&this.Ba.length;){var t=this.Ba;this.Ba=null;for(var e=0;e<t.length;e++)yb(this,t[e],this.N,this.Rf)}this.ye=!1};var Db=Xa;function ub(t){la.call(this,t)}ka(ub,la),ub.prototype.name="cancel";var Eb=Eb||"2.4.2";function y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function z(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function Fb(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function Gb(t){var n={};return Fb(t,function(t,e){n[t]=e}),n}function Hb(t){return"object"==typeof t&&null!==t}function Ib(t){var n=[];return Fb(t,function(e,t){da(t)?Ma(t,function(t){n.push(encodeURIComponent(e)+"="+encodeURIComponent(t))}):n.push(encodeURIComponent(e)+"="+encodeURIComponent(t))}),n.length?"&"+n.join("&"):""}function Jb(t){var e={};return t=t.replace(/^\?/,"").split("&"),Ma(t,function(t){t&&(t=t.split("="),e[t[0]]=t[1])}),e}function Kb(t,e){if(!t)throw Lb(e)}function Lb(t){return Error("Firebase ("+Eb+") INTERNAL ASSERT FAILED: "+t)}var Mb=n.Promise||pb;function B(){var n=this;this.reject=this.resolve=null,this.D=new Mb(function(t,e){n.resolve=t,n.reject=e})}function C(n,i){return function(t,e){t?n.reject(t):n.resolve(e),r(i)&&(Nb(n.D),1===i.length?i(t):i(t,e))}}function Nb(t){t.then(void 0,aa)}function Ob(t){for(var e=[],n=0,i=0;i<t.length;i++){var r=t.charCodeAt(i);55296<=r&&r<=56319&&(r-=55296,Kb(++i<t.length,"Surrogate pair missing trail surrogate."),r=65536+(r<<10)+(t.charCodeAt(i)-56320)),r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return e}function Pb(t){for(var e=0,n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?e++:i<2048?e+=2:55296<=i&&i<=56319?(e+=4,n++):e+=3}return e}function D(t,e,n,i){var r;if(i<e?r="at least "+e:n<i&&(r=0===n?"none":"no more than "+n),r)throw Error(t+" failed: Was called with "+i+(1===i?" argument.":" arguments.")+" Expects "+r+".")}function E(t,e,n){var i="";switch(e){case 1:i=n?"first":"First";break;case 2:i=n?"second":"Second";break;case 3:i=n?"third":"Third";break;case 4:i=n?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}return t+" failed: "+i+" argument "}function F(t,e,n,i){if((!i||p(n))&&!r(n))throw Error(E(t,e,i)+"must be a valid function.")}function Qb(t,e,n){if(p(n)&&(!ga(n)||null===n))throw Error(E(t,e,!0)+"must be a valid context object.")}function Rb(t){return"undefined"!=typeof JSON&&p(JSON.parse)?JSON.parse(t):za(t)}function G(t){if("undefined"!=typeof JSON&&p(JSON.stringify))t=JSON.stringify(t);else{var e=[];Ba(new Aa,t,e),t=e.join("")}return t}function Sb(){this.Zd=H}function Tb(){}pb.prototype["catch"]=pb.prototype.gh,Sb.prototype.j=function(t){return this.Zd.S(t)},Sb.prototype.toString=function(){return this.Zd.toString()},Tb.prototype.uf=function(){return null},Tb.prototype.Ce=function(){return null};var Ub=new Tb;function Vb(t,e,n){this.bg=t,this.Oa=e,this.Nd=n}function Zb(){this.xb=[]}function $b(t,e){for(var n=null,i=0;i<e.length;i++){var r=e[i],o=r.cc();null===n||o.ea(n.cc())||(t.xb.push(n),n=null),null===n&&(n=new ac(o)),n.add(r)}n&&t.xb.push(n)}function bc(t,e,n){$b(t,n),cc(t,function(t){return t.ea(e)})}function dc(t,e,n){$b(t,n),cc(t,function(t){return t.contains(e)||e.contains(t)})}function cc(t,e){for(var n=!0,i=0;i<t.xb.length;i++){if(r=t.xb[i])if(e(r=r.cc())){for(var r=t.xb[i],o=0;o<r.xd.length;o++){var a=r.xd[o];if(null!==a){r.xd[o]=null;var s=a.Zb();ec&&fc("event: "+a.toString()),gc(s)}}t.xb[i]=null}else n=!1}n&&(t.xb=[])}function ac(t){this.ta=t,this.xd=[]}function J(t,e,n,i){this.type=t,this.Na=e,this.Za=n,this.Oe=i,this.Td=void 0}function hc(t){return new J(ic,t)}Vb.prototype.uf=function(t){var e=this.Oa.Q;return Wb(e,t)?e.j().T(t):(e=null!=this.Nd?new Xb(this.Nd,!0,!1):this.Oa.w(),this.bg.Bc(t,e))},Vb.prototype.Ce=function(t,e,n){var i=null!=this.Nd?this.Nd:Yb(this.Oa);return 0===(t=this.bg.qe(i,e,1,n,t)).length?null:t[0]},ac.prototype.add=function(t){this.xd.push(t)},ac.prototype.cc=function(){return this.ta};var ic="value";function jc(t,e,n,i){this.xe=e,this.be=n,this.Td=i,this.wd=t}function kc(t,e,n){this.xe=t,this.error=e,this.path=n}function Xb(t,e,n){this.A=t,this.ga=e,this.Yb=n}function lc(t){return t.ga}function mc(t){return t.Yb}function nc(t,e){return e.e()?t.ga&&!t.Yb:Wb(t,K(e))}function Wb(t,e){return t.ga&&!t.Yb||t.A.Fa(e)}function oc(t){this.pg=t,this.Gd=null}function pc(t,e){this.Vf={},this.hd=new oc(t),this.da=e;var n=1e4+2e4*Math.random();setTimeout(u(this.Of,this),Math.floor(n))}function qc(){this.Hc={}}function rc(t,e,n){p(n)||(n=1),y(t.Hc,e)||(t.Hc[e]=0),t.Hc[e]+=n}jc.prototype.cc=function(){var t=this.be.Mb();return"value"===this.wd?t.path:t.parent().path},jc.prototype.De=function(){return this.wd},jc.prototype.Zb=function(){return this.xe.Zb(this)},jc.prototype.toString=function(){return this.cc().toString()+":"+this.wd+":"+G(this.be.qf())},kc.prototype.cc=function(){return this.path},kc.prototype.De=function(){return"cancel"},kc.prototype.Zb=function(){return this.xe.Zb(this)},kc.prototype.toString=function(){return this.path.toString()+":cancel"},Xb.prototype.j=function(){return this.A},oc.prototype.get=function(){var t=this.pg.get(),e=wa(t);if(this.Gd)for(var n in this.Gd)e[n]-=this.Gd[n];return this.Gd=t,e},pc.prototype.Of=function(){var t,e=this.hd.get(),n={},i=!1;for(t in e)0<e[t]&&y(this.Vf,t)&&(n[t]=e[t],i=!0);i&&this.da.Ye(n),setTimeout(u(this.Of,this),Math.floor(6e5*Math.random()))},qc.prototype.get=function(){return wa(this.Hc)};var sc={},tc={};function uc(t){return t=t.toString(),sc[t]||(sc[t]=new qc),sc[t]}function vc(t,e){var n=t.toString();return tc[n]||(tc[n]=e()),tc[n]}function L(t,e){this.name=t,this.U=e}function wc(t,e){return new L(t,e)}function xc(t,e){return yc(t.name,e.name)}function zc(t,e){return yc(t,e)}function Ac(t,e,n){this.type=Bc,this.source=t,this.path=e,this.Ja=n}function Cc(t,e){this.type=Dc,this.source=t,this.path=e}function Ec(t,e){this.Pa=t,this.xa=e||Fc}function Gc(t,e){for(var n,i=t.xa,r=null;!i.e();){if(0===(n=t.Pa(e,i.key))){if(i.left.e())return r?r.key:null;for(i=i.left;!i.right.e();)i=i.right;return i.key}n<0?i=i.left:0<n&&(i=(r=i).right)}throw Error("Attempted to find predecessor key for a nonexistent key.  What gives?")}function Hc(t,e,n,i,r){for(this.Xd=r||null,this.Je=i,this.Ta=[],r=1;!t.e();)if(r=e?n(t.key,e):1,i&&(r*=-1),r<0)t=this.Je?t.left:t.right;else{if(0===r){this.Ta.push(t);break}this.Ta.push(t),t=this.Je?t.right:t.left}}function Ic(t){if(0===t.Ta.length)return null;var e,n=t.Ta.pop();if(e=t.Xd?t.Xd(n.key,n.value):{key:n.key,value:n.value},t.Je)for(n=n.left;!n.e();)t.Ta.push(n),n=n.right;else for(n=n.right;!n.e();)t.Ta.push(n),n=n.left;return e}function Jc(t){return 0===t.Ta.length?null:(e=(e=t.Ta)[e.length-1],t.Xd?t.Xd(e.key,e.value):{key:e.key,value:e.value});var e}function Kc(t,e,n,i,r){this.key=t,this.value=e,this.color=null==n||n,this.left=null!=i?i:Fc,this.right=null!=r?r:Fc}function Lc(t){return t.left.e()?t:Lc(t.left)}function Nc(t){return t.left.e()?Fc:(t.left.ha()||t.left.left.ha()||(t=Oc(t)),Mc(t=t.$(null,null,null,Nc(t.left),null)))}function Mc(t){return t.right.ha()&&!t.left.ha()&&(t=Rc(t)),t.left.ha()&&t.left.left.ha()&&(t=Pc(t)),t.left.ha()&&t.right.ha()&&(t=Qc(t)),t}function Oc(t){return(t=Qc(t)).right.left.ha()&&(t=Qc(t=Rc(t=t.$(null,null,null,null,Pc(t.right))))),t}function Rc(t){return t.right.$(null,null,t.color,t.$(null,null,!0,null,t.right.left),null)}function Pc(t){return t.left.$(null,null,t.color,null,t.$(null,null,!0,t.left.right,null))}function Qc(t){return t.$(null,null,!t.color,t.left.$(null,null,!t.left.color,null,null),t.right.$(null,null,!t.right.color,null,null))}function Sc(){}Ac.prototype.$c=function(t){return this.path.e()?new Ac(this.source,M,this.Ja.T(t)):new Ac(this.source,N(this.path),this.Ja)},Ac.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" overwrite: "+this.Ja.toString()+")"},Cc.prototype.$c=function(){return this.path.e()?new Cc(this.source,M):new Cc(this.source,N(this.path))},Cc.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" listen_complete)"},h=Ec.prototype,h.Sa=function(t,e){return new Ec(this.Pa,this.xa.Sa(t,e,this.Pa).$(null,null,!1,null,null))},h.remove=function(t){return new Ec(this.Pa,this.xa.remove(t,this.Pa).$(null,null,!1,null,null))},h.get=function(t){for(var e,n=this.xa;!n.e();){if(0===(e=this.Pa(t,n.key)))return n.value;e<0?n=n.left:0<e&&(n=n.right)}return null},h.e=function(){return this.xa.e()},h.count=function(){return this.xa.count()},h.Vc=function(){return this.xa.Vc()},h.jc=function(){return this.xa.jc()},h.ka=function(t){return this.xa.ka(t)},h.ac=function(t){return new Hc(this.xa,null,this.Pa,!1,t)},h.bc=function(t,e){return new Hc(this.xa,t,this.Pa,!1,e)},h.dc=function(t,e){return new Hc(this.xa,t,this.Pa,!0,e)},h.xf=function(t){return new Hc(this.xa,null,this.Pa,!0,t)},h=Kc.prototype,h.$=function(t,e,n,i,r){return new Kc(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=i?i:this.left,null!=r?r:this.right)},h.count=function(){return this.left.count()+1+this.right.count()},h.e=function(){return!1},h.ka=function(t){return this.left.ka(t)||t(this.key,this.value)||this.right.ka(t)},h.Vc=function(){return Lc(this).key},h.jc=function(){return this.right.e()?this.key:this.right.jc()},h.Sa=function(t,e,n){var i,r;return Mc(r=(i=n(t,(r=this).key))<0?r.$(null,null,null,r.left.Sa(t,e,n),null):0===i?r.$(null,e,null,null,null):r.$(null,null,null,null,r.right.Sa(t,e,n)))},h.remove=function(t,e){var n,i;if(e(t,(n=this).key)<0)n.left.e()||n.left.ha()||n.left.left.ha()||(n=Oc(n)),n=n.$(null,null,null,n.left.remove(t,e),null);else{if(n.left.ha()&&(n=Pc(n)),n.right.e()||n.right.ha()||n.right.left.ha()||(n=Qc(n)).left.left.ha()&&(n=Qc(n=Pc(n))),0===e(t,n.key)){if(n.right.e())return Fc;i=Lc(n.right),n=n.$(i.key,i.value,null,null,Nc(n.right))}n=n.$(null,null,null,null,n.right.remove(t,e))}return Mc(n)},h.ha=function(){return this.color},h=Sc.prototype,h.$=function(){return this},h.Sa=function(t,e){return new Kc(t,e,null)},h.remove=function(){return this},h.count=function(){return 0},h.e=function(){return!0},h.ka=function(){return!1},h.Vc=function(){return null},h.jc=function(){return null},h.ha=function(){return!1};var Fc=new Sc;function Tc(t,e){return t&&"object"==typeof t?(O(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t}function Uc(t,n){var i=new Vc;return Wc(t,new P(""),function(t,e){i.rc(t,Xc(e,n))}),i}function Xc(t,i){var r,e=Tc(e=t.C().J(),i);if(t.L()){var n=Tc(t.Ea(),i);return n!==t.Ea()||e!==t.C().J()?new Yc(n,Q(e)):t}return e!==(r=t).C().J()&&(r=r.ia(new Yc(e))),t.R(R,function(t,e){var n=Xc(e,i);n!==e&&(r=r.W(t,n))}),r}function Zc(){this.Ac={}}function $c(t){this.Ic=t,this.Sd="firebase:"}function ad(t){try{if("undefined"!=typeof window&&"undefined"!=typeof window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new $c(e)}}catch(n){}return new Zc}Zc.prototype.set=function(t,e){null==e?delete this.Ac[t]:this.Ac[t]=e},Zc.prototype.get=function(t){return y(this.Ac,t)?this.Ac[t]:null},Zc.prototype.remove=function(t){delete this.Ac[t]},Zc.prototype.Af=!0,h=$c.prototype,h.set=function(t,e){null==e?this.Ic.removeItem(this.Sd+t):this.Ic.setItem(this.Sd+t,G(e))},h.get=function(t){return null==(t=this.Ic.getItem(this.Sd+t))?null:Rb(t)},h.remove=function(t){this.Ic.removeItem(this.Sd+t)},h.Af=!1,h.toString=function(){return this.Ic.toString()};var bd=ad("localStorage"),cd=ad("sessionStorage");function dd(t,e,n,i,r){this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.ob=e,this.lc=n,this.jh=i,this.Rd=r||"",this.ab=bd.get("host:"+t)||this.host}function ed(t,e){e!==t.ab&&(t.ab=e,"s-"===t.ab.substr(0,2)&&bd.set("host:"+t.host,t.ab))}function fd(t,e,n){if(O("string"==typeof e,"typeof type must==string"),O("object"==typeof n,"typeof params must==object"),e===gd)e=(t.ob?"wss://":"ws://")+t.ab+"/.ws?";else{if(e!==hd)throw Error("Unknown connection type: "+e);e=(t.ob?"https://":"http://")+t.ab+"/.lp?"}t.host!==t.ab&&(n.ns=t.lc);var i=[];return v(n,function(t,e){i.push(e+"="+t)}),e+i.join("&")}dd.prototype.toString=function(){var t=(this.ob?"https://":"http://")+this.host;return this.Rd&&(t+="<"+this.Rd+">"),t};var id=(Ps=1,function(){return Ps++}),O=Kb,jd=Lb,Ps;function kd(t){try{var e;if("undefined"!=typeof atob)e=atob(t);else{ob();for(var n=mb,i=[],r=0;r<t.length;){var o=n[t.charAt(r++)],a=r<t.length?n[t.charAt(r)]:0,s=++r<t.length?n[t.charAt(r)]:64,h=++r<t.length?n[t.charAt(r)]:64;if(++r,null==o||null==a||null==s||null==h)throw Error();i.push(o<<2|a>>4),64!=s&&(i.push(a<<4&240|s>>2),64!=h&&i.push(s<<6&192|h))}if(i.length<8192)e=String.fromCharCode.apply(null,i);else{for(t="",n=0;n<i.length;n+=8192)t+=String.fromCharCode.apply(null,Ua(i,n,n+8192));e=t}}return e}catch(u){fc("base64Decode failed: ",u)}return null}function ld(t){var e=Ob(t);(t=new Ja).update(e);e=[];var n=8*t.ge;t.ec<56?t.update(t.Od,56-t.ec):t.update(t.Od,t.Ya-(t.ec-56));for(var i=t.Ya-1;56<=i;i--)t.pe[i]=255&n,n/=256;for(Ka(t,t.pe),i=n=0;i<5;i++)for(var r=24;0<=r;r-=8)e[n]=t.P[i]>>r&255,++n;return nb(e)}function md(t){for(var e="",n=0;n<arguments.length;n++)e=ea(arguments[n])?e+md.apply(null,arguments[n]):"object"==typeof arguments[n]?e+G(arguments[n]):e+arguments[n],e+=" ";return e}var ec=null,nd=!0;function od(t,e){Kb(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?ec=u(console.log,console):"object"==typeof console.log&&(ec=function(t){console.log(t)})),e&&cd.set("logging_enabled",!0)):r(t)?ec=t:(ec=null,cd.remove("logging_enabled"))}function fc(t){if(!0===nd&&(nd=!1,null===ec&&!0===cd.get("logging_enabled")&&od(!0)),ec){var e=md.apply(null,arguments);ec(e)}}function pd(t){return function(){fc(t,arguments)}}function qd(t){if("undefined"!=typeof console){var e="FIREBASE INTERNAL ERROR: "+md.apply(null,arguments);"undefined"!=typeof console.error?console.error(e):console.log(e)}}function rd(t){var e=md.apply(null,arguments);throw Error("FIREBASE FATAL ERROR: "+e)}function S(t){if("undefined"!=typeof console){var e="FIREBASE WARNING: "+md.apply(null,arguments);"undefined"!=typeof console.warn?console.warn(e):console.log(e)}}function sd(t){var e="",n="",i="",r="",o=!0,a="https",s=443;if(q(t)){var h=t.indexOf("//");for(0<=h&&(a=t.substring(0,h-1),t=t.substring(h+2)),-1===(h=t.indexOf("/"))&&(h=t.length),e=t.substring(0,h),r="",t=t.substring(h).split("/"),h=0;h<t.length;h++)if(0<t[h].length){var u=t[h];try{u=decodeURIComponent(u.replace(/\+/g," "))}catch(c){}r+="/"+u}3===(t=e.split(".")).length?(n=t[1],i=t[0].toLowerCase()):2===t.length&&(n=t[0]),0<=(h=e.indexOf(":"))&&(o="https"===a||"wss"===a,s=e.substring(h+1),isFinite(s)&&(s=String(s)),s=q(s)?/^\s*-?0x/i.test(s)?parseInt(s,16):parseInt(s,10):NaN)}return{host:e,port:s,domain:n,fh:i,ob:o,scheme:a,bd:r}}function td(t){return fa(t)&&(t!=t||t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)}function ud(t){if("complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}function yc(t,e){if(t===e)return 0;if("[MIN_NAME]"===t||"[MAX_NAME]"===e)return-1;if("[MIN_NAME]"===e||"[MAX_NAME]"===t)return 1;var n=vd(t),i=vd(e);return null!==n?null!==i?0==n-i?t.length-e.length:n-i:-1:null!==i?1:t<e?-1:1}function wd(t,e){if(e&&t in e)return e[t];throw Error("Missing required key ("+t+") in object: "+G(e))}function xd(t){if("object"!=typeof t||null===t)return G(t);var e,n=[];for(e in t)n.push(e);n.sort(),e="{";for(var i=0;i<n.length;i++)0!==i&&(e+=","),e+=G(n[i]),e+=":",e+=xd(t[n[i]]);return e+"}"}function yd(t,e){if(t.length<=e)return[t];for(var n=[],i=0;i<t.length;i+=e)t<i+e?n.push(t.substring(i,t.length)):n.push(t.substring(i,i+e));return n}function zd(t,e){if(da(t))for(var n=0;n<t.length;++n)e(n,t[n]);else v(t,e)}function Ad(t){var e,n,i,r;for(O(!td(t),"Invalid JSON number"),0===t?(i=n=0,e=-Infinity==1/t?1:0):(e=t<0,i=(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,Math.round(t/Math.pow(2,-1074)))),r=[],t=52;t;--t)r.push(i%2?1:0),i=Math.floor(i/2);for(t=11;t;--t)r.push(n%2?1:0),n=Math.floor(n/2);for(r.push(e?1:0),r.reverse(),e=r.join(""),n="",t=0;t<64;t+=8)1===(i=parseInt(e.substr(t,8),2).toString(16)).length&&(i="0"+i),n+=i;return n.toLowerCase()}var Bd=/^-?\d{1,10}$/;function vd(t){return Bd.test(t)&&(-2147483648<=(t=Number(t))&&t<=2147483647)?t:null}function gc(t){try{t()}catch(e){setTimeout(function(){throw S("Exception was thrown by user callback.",e.stack||""),e},Math.floor(0))}}function T(t,e){if(r(t)){var n=Array.prototype.slice.call(arguments,1).slice();gc(function(){t.apply(null,n)})}}function Cd(t){var e={},n={},i={},r="";try{var o=t.split(".");e=Rb(kd(o[0])||""),n=Rb(kd(o[1])||""),r=o[2],i=n.d||{};delete n.d}catch(a){}return{mh:e,Ec:n,data:i,bh:r}}function Dd(t){return"object"==typeof(t=Cd(t).Ec)&&t.hasOwnProperty("iat")?z(t,"iat"):null}function Ed(t){var e=(t=Cd(t)).Ec;return!!t.bh&&!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}function Fd(t){this.Y=t,this.g=t.n.g}function Gd(e,t,n,i){var r=[],o=[];return Ma(t,function(t){"child_changed"===t.type&&e.g.Dd(t.Oe,t.Na)&&o.push(new J("child_moved",t.Na,t.Za))}),Hd(e,r,"child_removed",t,i,n),Hd(e,r,"child_added",t,i,n),Hd(e,r,"child_moved",o,i,n),Hd(e,r,"child_changed",t,i,n),Hd(e,r,ic,t,i,n),r}function Hd(i,r,e,t,o,a){Va(t=Na(t,function(t){return t.type===e}),u(i.qg,i)),Ma(t,function(e){var n=Id(i,e,a);Ma(o,function(t){t.Qf(e.type)&&r.push(t.createEvent(n,i.Y))})})}function Id(t,e,n){return"value"!==e.type&&"child_removed"!==e.type&&(e.Td=n.wf(e.Za,e.Na,t.g)),e}function Jd(){this.ib={}}function Kd(t,e){var n=e.type,i=e.Za;O("child_added"==n||"child_changed"==n||"child_removed"==n,"Only child changes supported for tracking"),O(".priority"!==i,"Only non-priority child changes can be tracked.");var r=z(t.ib,i);if(r){var o=r.type;if("child_added"==n&&"child_removed"==o)t.ib[i]=new J("child_changed",e.Na,i,r.Na);else if("child_removed"==n&&"child_added"==o)delete t.ib[i];else if("child_removed"==n&&"child_changed"==o)t.ib[i]=new J("child_removed",r.Oe,i);else if("child_changed"==n&&"child_added"==o)t.ib[i]=new J("child_added",e.Na,i);else{if("child_changed"!=n||"child_changed"!=o)throw jd("Illegal combination of changes: "+e+" occurred after "+r);t.ib[i]=new J("child_changed",e.Na,i,r.Oe)}}else t.ib[i]=e}function Ld(t){this.g=t}function Md(t){var e;this.Fe=new Ld(t.g),this.g=t.g,e=t.oa?(e=Nd(t),t.g.Sc(Od(t),e)):t.g.Wc(),this.gd=e,t=t.ra?(e=Pd(t),t.g.Sc(Rd(t),e)):t.g.Tc(),this.Jc=t}function Sd(t){this.ua=new Md(t),this.g=t.g,O(t.la,"Only valid if limit has been set"),this.ma=t.ma,this.Nb=!Td(t)}function Ud(t,e,n,i,r,o){var a;if(t.Nb){var s=Vd(t.g);a=function(t,e){return s(e,t)}}else a=Vd(t.g);O(e.Hb()==t.ma,"");var h=new L(n,i),u=t.Nb?Wd(e,t.g):Xd(e,t.g),c=t.ua.matches(h);if(e.Fa(n)){var f=e.T(n);for(u=r.Ce(t.g,u,t.Nb);null!=u&&(u.name==n||e.Fa(u.name));)u=r.Ce(t.g,u,t.Nb);return r=null==u?1:a(u,h),c&&!i.e()&&0<=r?(null!=o&&Kd(o,new J("child_changed",i,n,f)),e.W(n,i)):(null!=o&&Kd(o,new J("child_removed",f,n)),e=e.W(n,H),null!=u&&t.ua.matches(u)?(null!=o&&Kd(o,new J("child_added",u.U,u.name)),e.W(u.name,u.U)):e)}return i.e()?e:c&&0<=a(u,h)?(null!=o&&(Kd(o,new J("child_removed",u.U,u.name)),Kd(o,new J("child_added",i,n))),e.W(n,i).W(u.name,H)):e}function Yd(t,e){this.me=t,this.og=e}function Zd(t){this.X=t}function ie(t,e,n,i,r,o){var a,s=e.Q;if(null!=i.xc(n))return e;if(n.e())O(lc(e.w()),"If change path is empty, we must have complete server data"),i=mc(e.w())?(r=Yb(e),i.Cc(r instanceof fe?r:H)):i.Aa(Yb(e)),o=t.X.ya(e.Q.j(),i,o);else{var h=K(n);if(".priority"==h)O(1==le(n),"Can't have a priority with additional path components"),o=s.j(),a=e.w().j(),o=null!=(i=i.nd(n,o,a))?t.X.ia(o,i):s.j();else{var u=N(n);o=null!=(i=Wb(s,h)?(a=e.w().j(),null!=(i=i.nd(n,s.j(),a))?s.j().T(h).H(u,i):s.j().T(h)):i.Bc(h,e.w()))?t.X.H(s.j(),h,i,u,r,o):s.j()}}return ge(e,o,s.ga||n.e(),t.X.Ra())}function ae(t,e,n,i,r,o,a,s){var h=e.w();if(a=a?t.X:t.X.$b(),n.e())i=a.ya(h.j(),i,null);else if(a.Ra()&&!h.Yb)i=h.j().H(n,i),i=a.ya(h.j(),i,null);else{var u=K(n);if(!nc(h,n)&&1<le(n))return e;var c=N(n);i=h.j().T(u).H(c,i),i=".priority"==u?a.ia(h.j(),i):a.H(h.j(),u,i,c,Ub,null)}return h=h.ga||n.e(),ie(t,e=new je(e.Q,new Xb(i,h,a.Ra())),n,r,new Vb(r,e,o),s)}function $d(t,e,n,i,r,o,a){var s=e.Q;if(r=new Vb(r,e,o),n.e())a=t.X.ya(e.Q.j(),i,a),t=ge(e,a,!0,t.X.Ra());else if(".priority"===(o=K(n)))a=t.X.ia(e.Q.j(),i),t=ge(e,a,s.ga,s.Yb);else{n=N(n);var h=s.j().T(o);if(!n.e()){var u=r.uf(o);i=null!=u?".priority"===me(n)&&u.S(n.parent()).e()?u:u.H(n,i):H}t=h.ea(i)?e:ge(e,a=t.X.H(s.j(),o,i,n,r,a),s.ga,t.X.Ra())}return t}function ce(i,r,o,t,a,s,h){var u=r;return ne(t,function(t,e){var n=o.o(t);Wb(r.Q,K(n))&&(u=$d(i,u,n,e,a,s,h))}),ne(t,function(t,e){var n=o.o(t);Wb(r.Q,K(n))||(u=$d(i,u,n,e,a,s,h))}),u}function oe(n,t){return ne(t,function(t,e){n=n.H(t,e)}),n}function de(i,r,t,e,o,a,s,h){if(r.w().j().e()&&!lc(r.w()))return r;var u=r;t=t.e()?e:pe(qe,t,e);var c=r.w().j();return t.children.ka(function(t,e){if(c.Fa(t)){var n=oe(n=r.w().j().T(t),e);u=ae(i,u,new P(t),n,o,a,s,h)}}),t.children.ka(function(t,e){var n=!Wb(r.w(),t)&&null==e.value;c.Fa(t)||n||(n=oe(n=r.w().j().T(t),e),u=ae(i,u,new P(t),n,o,a,s,h))}),u}function he(t,e,n,i,r,o,a){if(null!=r.xc(n))return e;var s=mc(e.w()),h=e.w();if(null==i.value)return u=qe,ne(i,function(t){var e=n.o(t);nc(h,e)&&(u=u.set(t,h.j().S(e)))}),de(t,e,n,u,r,o,s,a);if(n.e()&&h.ga||nc(h,n))return ae(t,e,n,h.j().S(n),r,o,s,a);if(n.e()){var u=qe;return h.j().R(re,function(t,e){u=u.set(new P(t),e)}),de(t,e,n,u,r,o,s,a)}return e}function se(){}Fd.prototype.qg=function(t,e){if(null==t.Za||null==e.Za)throw jd("Should only compare child_ events.");return this.g.compare(new L(t.Za,t.Na),new L(e.Za,e.Na))},h=Ld.prototype,h.H=function(t,e,n,i,r,o){return O(t.Mc(this.g),"A node must be indexed if only a child is updated"),(r=t.T(e)).S(i).ea(n.S(i))&&r.e()==n.e()?t:(null!=o&&(n.e()?t.Fa(e)?Kd(o,new J("child_removed",r,e)):O(t.L(),"A child remove without an old child only makes sense on a leaf node"):r.e()?Kd(o,new J("child_added",n,e)):Kd(o,new J("child_changed",n,e,r))),t.L()&&n.e()?t:t.W(e,n).pb(this.g))},h.ya=function(i,n,r){return null!=r&&(i.L()||i.R(R,function(t,e){n.Fa(t)||Kd(r,new J("child_removed",e,t))}),n.L()||n.R(R,function(t,e){if(i.Fa(t)){var n=i.T(t);n.ea(e)||Kd(r,new J("child_changed",e,t,n))}else Kd(r,new J("child_added",e,t))})),n.pb(this.g)},h.ia=function(t,e){return t.e()?H:t.ia(e)},h.Ra=function(){return!1},h.$b=function(){return this},h=Md.prototype,h.matches=function(t){return this.g.compare(this.gd,t)<=0&&this.g.compare(t,this.Jc)<=0},h.H=function(t,e,n,i,r,o){return this.matches(new L(e,n))||(n=H),this.Fe.H(t,e,n,i,r,o)},h.ya=function(t,e,n){e.L()&&(e=H);var i=(i=e.pb(this.g)).ia(H),r=this;return e.R(R,function(t,e){r.matches(new L(t,e))||(i=i.W(t,H))}),this.Fe.ya(t,i,n)},h.ia=function(t){return t},h.Ra=function(){return!0},h.$b=function(){return this.Fe},h=Sd.prototype,h.H=function(t,e,n,i,r,o){return this.ua.matches(new L(e,n))||(n=H),t.T(e).ea(n)?t:t.Hb()<this.ma?this.ua.$b().H(t,e,n,i,r,o):Ud(this,t,e,n,r,o)},h.ya=function(t,e,n){var i;if(e.L()||e.e())i=H.pb(this.g);else if(2*this.ma<e.Hb()&&e.Mc(this.g)){i=H.pb(this.g),e=this.Nb?e.dc(this.ua.Jc,this.g):e.bc(this.ua.gd,this.g);for(var r=0;0<e.Ta.length&&r<this.ma;){var o=Ic(e);if(!(this.Nb?this.g.compare(this.ua.gd,o)<=0:this.g.compare(o,this.ua.Jc)<=0))break;i=i.W(o.name,o.U),r++}}else{var a,s,h;if(i=(i=e.pb(this.g)).ia(H),this.Nb){e=i.xf(this.g),a=this.ua.Jc,s=this.ua.gd;var u=Vd(this.g);h=function(t,e){return u(e,t)}}else e=i.ac(this.g),a=this.ua.gd,s=this.ua.Jc,h=Vd(this.g);r=0;for(var c=!1;0<e.Ta.length;)o=Ic(e),!c&&h(a,o)<=0&&(c=!0),c&&r<this.ma&&h(o,s)<=0?r++:i=i.W(o.name,H)}return this.ua.$b().ya(t,i,n)},h.ia=function(t){return t},h.Ra=function(){return!0},h.$b=function(){return this.ua.$b()},Zd.prototype.gb=function(t,e,n,i){var r,o=new Jd;if(e.type===Bc)n=e.source.Ae?$d(this,t,e.path,e.Ja,n,i,o):(O(e.source.tf,"Unknown source."),r=e.source.ef||mc(t.w())&&!e.path.e(),ae(this,t,e.path,e.Ja,n,i,r,o));else if(e.type===be)n=e.source.Ae?ce(this,t,e.path,e.children,n,i,o):(O(e.source.tf,"Unknown source."),r=e.source.ef||mc(t.w()),de(this,t,e.path,e.children,n,i,r,o));else if(e.type===ee)if(e.Yd)if(e=e.path,null!=n.xc(e))n=t;else{if(r=new Vb(n,t,i),i=t.Q.j(),e.e()||".priority"===K(e))e=lc(t.w())?n.Aa(Yb(t)):(e=t.w().j(),O(e instanceof fe,"serverChildren would be complete if leaf node"),n.Cc(e)),e=this.X.ya(i,e,o);else{var a=K(e),s=n.Bc(a,t.w());null==s&&Wb(t.w(),a)&&(s=i.T(a)),(e=null!=s?this.X.H(i,a,s,N(e),r,o):t.Q.j().Fa(a)?this.X.H(i,a,H,N(e),r,o):i).e()&&lc(t.w())&&((i=n.Aa(Yb(t))).L()&&(e=this.X.ya(e,i,o)))}i=lc(t.w())||null!=n.xc(M),n=ge(t,e,i,this.X.Ra())}else n=he(this,t,e.path,e.Ub,n,i,o);else{if(e.type!==Dc)throw jd("Unknown operation type: "+e.type);i=e.path,r=(e=t.w()).j(),a=e.ga||i.e(),n=ie(this,new je(t.Q,new Xb(r,a,e.Yb)),i,n,Ub,o)}return o=qa(o.ib),(e=(i=n).Q).ga&&(r=e.j().L()||e.j().e(),a=ke(t),(0<o.length||!t.Q.ga||r&&!e.j().ea(a)||!e.j().C().ea(a.C()))&&o.push(hc(ke(i)))),new Yd(n,o)};var te={};function Vd(t){return u(t.compare,t)}function ve(t){O(!t.e()&&".priority"!==K(t),"Can't create PathIndex with empty path or .priority key"),this.gc=t}function xe(){}se.prototype.Dd=function(t,e){return 0!==this.compare(new L("[MIN_NAME]",t),new L("[MIN_NAME]",e))},se.prototype.Wc=function(){return ue},ka(ve,se),h=ve.prototype,h.Lc=function(t){return!t.S(this.gc).e()},h.compare=function(t,e){var n=t.U.S(this.gc),i=e.U.S(this.gc);return 0===(n=n.Gc(i))?yc(t.name,e.name):n},h.Sc=function(t,e){var n=Q(t);return new L(e,n=H.H(this.gc,n))},h.Tc=function(){return new L("[MAX_NAME]",H.H(this.gc,we))},h.toString=function(){return this.gc.slice().join("/")},ka(xe,se),h=xe.prototype,h.compare=function(t,e){var n=t.U.C(),i=e.U.C();return 0===(n=n.Gc(i))?yc(t.name,e.name):n},h.Lc=function(t){return!t.C().e()},h.Dd=function(t,e){return!t.C().ea(e.C())},h.Wc=function(){return ue},h.Tc=function(){return new L("[MAX_NAME]",new Yc("[PRIORITY-POST]",we))},h.Sc=function(t,e){return new L(e,new Yc("[PRIORITY-POST]",Q(t)))},h.toString=function(){return".priority"};var R=new xe;function ye(){}ka(ye,se),h=ye.prototype,h.compare=function(t,e){return yc(t.name,e.name)},h.Lc=function(){throw jd("KeyIndex.isDefinedOn not expected to be called.")},h.Dd=function(){return!1},h.Wc=function(){return ue},h.Tc=function(){return new L("[MAX_NAME]",H)},h.Sc=function(t){return O(q(t),"KeyIndex indexValue must always be a string."),new L(t,H)},h.toString=function(){return".key"};var re=new ye;function ze(){}ka(ze,se),h=ze.prototype,h.compare=function(t,e){var n=t.U.Gc(e.U);return 0===n?yc(t.name,e.name):n},h.Lc=function(){return!0},h.Dd=function(t,e){return!t.ea(e)},h.Wc=function(){return ue},h.Tc=function(){return Ae},h.Sc=function(t,e){return new L(e,Q(t))},h.toString=function(){return".value"};var Be=new ze;function Ce(){this.Xb=this.ra=this.Pb=this.oa=this.la=!1,this.ma=0,this.Rb="",this.ic=null,this.Bb="",this.fc=null,this.zb="",this.g=R}var De=new Ce;function Td(t){return""===t.Rb?t.oa:"l"===t.Rb}function Od(t){return O(t.oa,"Only valid if start has been set"),t.ic}function Nd(t){return O(t.oa,"Only valid if start has been set"),t.Pb?t.Bb:"[MIN_NAME]"}function Rd(t){return O(t.ra,"Only valid if end has been set"),t.fc}function Pd(t){return O(t.ra,"Only valid if end has been set"),t.Xb?t.zb:"[MAX_NAME]"}function Ee(t){var e=new Ce;return e.la=t.la,e.ma=t.ma,e.oa=t.oa,e.ic=t.ic,e.Pb=t.Pb,e.Bb=t.Bb,e.ra=t.ra,e.fc=t.fc,e.Xb=t.Xb,e.zb=t.zb,e.g=t.g,e}function Fe(t,e){var n=Ee(t);return n.g=e,n}function Ge(t){var e={};if(t.oa&&(e.sp=t.ic,t.Pb&&(e.sn=t.Bb)),t.ra&&(e.ep=t.fc,t.Xb&&(e.en=t.zb)),t.la){e.l=t.ma;var n=t.Rb;""===n&&(n=Td(t)?"l":"r"),e.vf=n}return t.g!==R&&(e.i=t.g.toString()),e}function He(t){return!(t.oa||t.ra||t.la)}function Ie(t){return He(t)&&t.g==R}function Je(t){var e,n={};return Ie(t)||(e=t.g===R?"$priority":t.g===Be?"$value":t.g===re?"$key":(O(t.g instanceof ve,"Unrecognized index type!"),t.g.toString()),n.orderBy=G(e),t.oa&&(n.startAt=G(t.ic),t.Pb&&(n.startAt+=","+G(t.Bb))),t.ra&&(n.endAt=G(t.fc),t.Xb&&(n.endAt+=","+G(t.zb))),t.la&&(Td(t)?n.limitToFirst=t.ma:n.limitToLast=t.ma)),n}function Ke(t,e){this.Ed=t,this.hc=e}function Le(a,s,h){return new Ke(ma(a.Ed,function(t,e){var n=z(a.hc,e);if(O(n,"Missing index implementation for "+e),t!==te)return i=t,(n=h.get(s.name))&&(i=i.remove(new L(s.name,n))),i.Sa(s,s.U);if(n.Lc(s.U)){for(var i=[],r=h.ac(wc),o=Ic(r);o;)o.name!=s.name&&i.push(o),o=Ic(r);return i.push(s),Me(i,Vd(n))}return te}),a.hc)}function Ne(t,n,i){return new Ke(ma(t.Ed,function(t){if(t===te)return t;var e=i.get(n.name);return e?t.remove(new L(n.name,e)):t}),t.hc)}h=Ce.prototype,h.Le=function(t){var e=Ee(this);return e.la=!0,e.ma=t,e.Rb="",e},h.Me=function(t){var e=Ee(this);return e.la=!0,e.ma=t,e.Rb="l",e},h.Ne=function(t){var e=Ee(this);return e.la=!0,e.ma=t,e.Rb="r",e},h.ce=function(t,e){var n=Ee(this);return n.oa=!0,p(t)||(t=null),n.ic=t,null!=e?(n.Pb=!0,n.Bb=e):(n.Pb=!1,n.Bb=""),n},h.vd=function(t,e){var n=Ee(this);return n.ra=!0,p(t)||(t=null),n.fc=t,p(e)?(n.Xb=!0,n.zb=e):(n.oh=!1,n.zb=""),n},h.toString=function(){return G(Ge(this))},Ke.prototype.get=function(t){var e=z(this.Ed,t);if(!e)throw Error("No index defined for "+t);return e===te?null:e};var Oe=new Ke({".priority":te},{".priority":R});function Yc(t,e){this.B=t,O(p(this.B)&&null!==this.B,"LeafNode shouldn't be created with null/undefined value."),this.ca=e||H,Pe(this.ca),this.Gb=null}var Qe=["object","boolean","number","string"];function fe(t,e,n){this.m=t,(this.ca=e)&&Pe(this.ca),t.e()&&O(!this.ca||this.ca.e(),"An empty node cannot have a priority"),this.Ab=n,this.Gb=null}h=Yc.prototype,h.L=function(){return!0},h.C=function(){return this.ca},h.ia=function(t){return new Yc(this.B,t)},h.T=function(t){return".priority"===t?this.ca:H},h.S=function(t){return t.e()?this:".priority"===K(t)?this.ca:H},h.Fa=function(){return!1},h.wf=function(){return null},h.W=function(t,e){return".priority"===t?this.ia(e):e.e()&&".priority"!==t?this:H.W(t,e).ia(this.ca)},h.H=function(t,e){var n=K(t);return null===n?e:e.e()&&".priority"!==n?this:(O(".priority"!==n||1===le(t),".priority must be the last token in a path"),this.W(n,H.H(N(t),e)))},h.e=function(){return!1},h.Hb=function(){return 0},h.R=function(){return!1},h.J=function(t){return t&&!this.C().e()?{".value":this.Ea(),".priority":this.C().J()}:this.Ea()},h.hash=function(){if(null===this.Gb){var t="";this.ca.e()||(t+="priority:"+Re(this.ca.J())+":");var e=typeof this.B;t=t+e+":",t="number"==e?t+Ad(this.B):t+this.B;this.Gb=ld(t)}return this.Gb},h.Ea=function(){return this.B},h.Gc=function(t){if(t===H)return 1;if(t instanceof fe)return-1;O(t.L(),"Unknown node type");var e=typeof t.B,n=typeof this.B,i=La(Qe,e),r=La(Qe,n);return O(0<=i,"Unknown leaf type: "+e),O(0<=r,"Unknown leaf type: "+n),i===r?"object"==n?0:this.B<t.B?-1:this.B===t.B?0:1:r-i},h.pb=function(){return this},h.Mc=function(){return!0},h.ea=function(t){return t===this||!!t.L()&&(this.B===t.B&&this.ca.ea(t.ca))},h.toString=function(){return G(this.J(!0))},h=fe.prototype,h.L=function(){return!1},h.C=function(){return this.ca||H},h.ia=function(t){return this.m.e()?this:new fe(this.m,t,this.Ab)},h.T=function(t){return".priority"===t?this.C():null===(t=this.m.get(t))?H:t},h.S=function(t){var e=K(t);return null===e?this:this.T(e).S(N(t))},h.Fa=function(t){return null!==this.m.get(t)},h.W=function(t,e){if(O(e,"We should always be passing snapshot nodes"),".priority"===t)return this.ia(e);var n,i,r=new L(t,e);return r=e.e()?(n=this.m.remove(t),Ne(this.Ab,r,this.m)):(n=this.m.Sa(t,e),Le(this.Ab,r,this.m)),i=n.e()?H:this.ca,new fe(n,i,r)},h.H=function(t,e){var n=K(t);if(null===n)return e;O(".priority"!==K(t)||1===le(t),".priority must be the last token in a path");var i=this.T(n).H(N(t),e);return this.W(n,i)},h.e=function(){return this.m.e()},h.Hb=function(){return this.m.count()};var Se=/^(0|[1-9]\d*)$/;function Wd(t,e){var n;return(n=(n=Te(t,e))?(n=n.Vc())&&n.name:t.m.Vc())?new L(n,t.m.get(n)):null}function Xd(t,e){var n;return(n=(n=Te(t,e))?(n=n.jc())&&n.name:t.m.jc())?new L(n,t.m.get(n)):null}function Te(t,e){return e===re?null:t.Ab.get(e.toString())}function Q(t,e){if(null===t)return H;var n=null;if("object"==typeof t&&".priority"in t?n=t[".priority"]:void 0!==e&&(n=e),O(null===n||"string"==typeof n||"number"==typeof n||"object"==typeof n&&".sv"in n,"Invalid priority type found: "+typeof n),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new Yc(t,Q(n));if(t instanceof Array){var i=H,r=t;return v(r,function(t,e){if(y(r,e)&&"."!==e.substring(0,1)){var n=Q(t);!n.L()&&n.e()||(i=i.W(e,n))}}),i.ia(Q(n))}var o=[],a=!1,s=t;if(Fb(s,function(t){if("string"!=typeof t||"."!==t.substring(0,1)){var e=Q(s[t]);e.e()||(a=a||!e.C().e(),o.push(new L(t,e)))}}),0==o.length)return H;var h=Me(o,xc,function(t){return t.name},zc);if(a){var u=Me(o,Vd(R));return new fe(h,Q(n),new Ke({".priority":u},{".priority":R}))}return new fe(h,Q(n),Oe)}h=fe.prototype,h.J=function(n){if(this.e())return null;var i={},r=0,o=0,a=!0;if(this.R(R,function(t,e){i[t]=e.J(n),r++,a&&Se.test(t)?o=Math.max(o,Number(t)):a=!1}),!n&&a&&o<2*r){var t,e=[];for(t in i)e[t]=i[t];return e}return n&&!this.C().e()&&(i[".priority"]=this.C().J()),i},h.hash=function(){if(null===this.Gb){var i="";this.C().e()||(i+="priority:"+Re(this.C().J())+":"),this.R(R,function(t,e){var n=e.hash();""!==n&&(i+=":"+t+":"+n)}),this.Gb=""===i?"":ld(i)}return this.Gb},h.wf=function(t,e,n){return(n=Te(this,n))?(t=Gc(n,new L(t,e)))?t.name:null:Gc(this.m,t)},h.R=function(t,e){var n=Te(this,t);return n?n.ka(function(t){return e(t.name,t.U)}):this.m.ka(e)},h.ac=function(t){return this.bc(t.Wc(),t)},h.bc=function(t,e){if(n=Te(this,e))return n.bc(t,function(t){return t});for(var n,i=Jc(n=this.m.bc(t.name,wc));null!=i&&e.compare(i,t)<0;)Ic(n),i=Jc(n);return n},h.xf=function(t){return this.dc(t.Tc(),t)},h.dc=function(t,e){if(n=Te(this,e))return n.dc(t,function(t){return t});for(var n,i=Jc(n=this.m.dc(t.name,wc));null!=i&&0<e.compare(i,t);)Ic(n),i=Jc(n);return n},h.Gc=function(t){return this.e()?t.e()?0:-1:t.L()||t.e()?1:t===we?-1:0},h.pb=function(t){if(t===re||sa(this.Ab.hc,t.toString()))return this;var e=this.Ab,n=this.m;O(t!==re,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var i=[],r=!1,o=Ic(n=n.ac(wc));o;)r=r||t.Lc(o.U),i.push(o),o=Ic(n);return i=r?Me(i,Vd(t)):te,r=t.toString(),(n=wa(e.hc))[r]=t,(t=wa(e.Ed))[r]=i,new fe(this.m,this.ca,new Ke(t,n))},h.Mc=function(t){return t===re||sa(this.Ab.hc,t.toString())},h.ea=function(t){if(t===this)return!0;if(t.L())return!1;if(this.C().ea(t.C())&&this.m.count()===t.m.count()){var e=this.ac(R);t=t.ac(R);for(var n=Ic(e),i=Ic(t);n&&i;){if(n.name!==i.name||!n.U.ea(i.U))return!1;n=Ic(e),i=Ic(t)}return null===n&&null===i}return!1},h.toString=function(){return G(this.J(!0))};var Ue=Math.log(2);function Ve(t){this.count=parseInt(Math.log(t+1)/Ue,10),this.nf=this.count-1,this.ng=t+1&parseInt(Array(this.count+1).join("1"),2)}function We(t){var e=!(t.ng&1<<t.nf);return t.nf--,e}function Me(h,t,u,e){h.sort(t);var n=function(t){function e(t,e){var n=s-t,i=s;s-=t;i=function o(t,e){if(0==(i=e-t))return null;if(1==i){var n=h[t];return new Kc(u?u(n):n,n.U,!1,null,null)}var i=o(t,n=parseInt(i/2,10)+t),r=o(n+1,e);n=h[n];return new Kc(u?u(n):n,n.U,!1,i,r)}(n+1,i),n=h[n],i=new Kc(u?u(n):n,n.U,e,null,i);r?r.left=i:a=i,r=i}for(var r=null,a=null,s=h.length,n=0;n<t.count;++n){var i=We(t),o=Math.pow(2,t.count-(n+1));i?e(o,!1):(e(o,!1),e(o,!0))}return a}(new Ve(h.length));return null!==n?new Ec(e||t,n):new Ec(e||t)}function Re(t){return"number"==typeof t?"number:"+Ad(t):"string:"+t}function Pe(t){if(t.L()){var e=t.J();O("string"==typeof e||"number"==typeof e||"object"==typeof e&&y(e,".sv"),"Priority must be a string or number.")}else O(t===we||t.e(),"priority of unexpected type.");O(t===we||t.C().e(),"Priority nodes can't have a priority of their own.")}var H=new fe(new Ec(zc),null,Oe);function Xe(){fe.call(this,new Ec(zc),H,Oe)}ka(Xe,fe),h=Xe.prototype,h.Gc=function(t){return t===this?0:1},h.ea=function(t){return t===this},h.C=function(){return this},h.T=function(){return H},h.e=function(){return!1};var we=new Xe,ue=new L("[MIN_NAME]",H),Ae=new L("[MAX_NAME]",we);function je(t,e){this.Q=t,this.ae=e}function ge(t,e,n,i){return new je(new Xb(e,n,i),t.ae)}function ke(t){return t.Q.ga?t.Q.j():null}function Yb(t){return t.ae.ga?t.ae.j():null}function Ye(t,e){var n=new Ld((i=(this.Y=t).n).g),i=He(i)?new Ld(i.g):i.la?new Sd(i):new Md(i);this.Nf=new Zd(i);var r=e.w(),o=e.Q,a=n.ya(H,r.j(),null),s=i.ya(H,o.j(),null);this.Oa=new je(new Xb(s,o.ga,i.Ra()),new Xb(a,r.ga,n.Ra())),this.$a=[],this.ug=new Fd(t)}function Ze(t){return t.Y}function af(t,e){var n=t.Oa.Q,i=[];return n.j().L()||n.j().R(R,function(t,e){i.push(new J("child_added",e,t))}),n.ga&&i.push(hc(n.j())),$e(t,i,n.j(),e)}function $e(t,e,n,i){return Gd(t.ug,e,n,i?[i]:t.$a)}function bf(t,e,n){this.type=be,this.source=t,this.path=e,this.children=n}function cf(t,e){this.f=pd("p:rest:"),this.G=t,this.Kb=e,this.Ca=null,this.ba={}}function df(t,e){return p(e)?"tag$"+e:(O(Ie(t.n),"should have a tag if it's not a default query."),t.path.toString())}function ef(e,t,n,i){(n=n||{}).format="export",e.Ca&&(n.auth=e.Ca);var r=(e.G.ob?"https://":"http://")+e.G.host+t+"?"+Ib(n);e.f("Sending REST request for "+r);var o=new XMLHttpRequest;o.onreadystatechange=function(){if(i&&4===o.readyState){e.f("REST Response for "+r+" received. status:",o.status,"response:",o.responseText);var t=null;if(200<=o.status&&o.status<300){try{t=Rb(o.responseText)}catch(n){S("Failed to parse JSON response for "+r+": "+o.responseText)}i(null,t)}else 401!==o.status&&404!==o.status&&S("Got unsuccessful REST response for "+r+" Status: "+o.status),i(o.status);i=null}},o.open("GET",r,!0),o.send()}function ff(t){O(da(t)&&0<t.length,"Requires a non-empty array"),this.fg=t,this.Rc={}}function gf(t,e){O(Ra(t.fg,function(t){return t===e}),"Unknown event: "+e)}je.prototype.w=function(){return this.ae},h=Ye.prototype,h.w=function(){return this.Oa.w().j()},h.kb=function(t){var e=Yb(this.Oa);return e&&(He(this.Y.n)||!t.e()&&!e.T(K(t)).e())?e.S(t):null},h.e=function(){return 0===this.$a.length},h.Tb=function(t){this.$a.push(t)},h.nb=function(t,e){var n=[];if(e){O(null==t,"A cancel should cancel all event registrations.");var i=this.Y.path;Ma(this.$a,function(t){(t=t.lf(e,i))&&n.push(t)})}if(t){for(var r=[],o=0;o<this.$a.length;++o){var a=this.$a[o];if(a.matches(t)){if(t.yf()){r=r.concat(this.$a.slice(o+1));break}}else r.push(a)}this.$a=r}else this.$a=[];return n},h.gb=function(t,e,n){t.type===be&&null!==t.source.Lb&&(O(Yb(this.Oa),"We should always have a full cache before handling merges"),O(ke(this.Oa),"Missing event cache, even though we have a server cache"));var i=this.Oa;return t=this.Nf.gb(i,t,e,n),e=this.Nf,n=t.me,O(n.Q.j().Mc(e.X.g),"Event snap not indexed"),O(n.w().j().Mc(e.X.g),"Server snap not indexed"),O(lc(t.me.w())||!lc(i.w()),"Once a server snap is complete, it should never go back"),this.Oa=t.me,$e(this,t.og,t.me.Q.j(),null)},bf.prototype.$c=function(t){return this.path.e()?(t=this.children.subtree(new P(t))).e()?null:t.value?new Ac(this.source,M,t.value):new bf(this.source,M,t):(O(K(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new bf(this.source,N(this.path),this.children))},bf.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},h=cf.prototype,h.Cf=function(t,e,i,r){var o=t.path.toString();this.f("Listen called for "+o+" "+t.wa());var a=df(t,i),s={};this.ba[a]=s,t=Je(t.n);var h=this;ef(this,o+".json",t,function(t,e){var n=e;404===t&&(t=n=null),null===t&&h.Kb(o,n,!1,i),z(h.ba,a)===s&&r(t?401==t?"permission_denied":"rest_error:"+t:"ok",null)})},h.$f=function(t,e){var n=df(t,e);delete this.ba[n]},h.O=function(t,e){var n=(i=Cd(this.Ca=t)).data,i=i.Ec&&i.Ec.exp;e&&e("ok",{auth:n,expires:i})},h.je=function(t){t("ok",this.Ca=null)},h.Qe=function(){},h.Gf=function(){},h.Md=function(){},h.put=function(){},h.Df=function(){},h.Ye=function(){},ff.prototype.ie=function(t,e){var n,i=(n=this.Rc[t]||[]).length;if(0<i){for(var r=Array(i),o=0;o<i;o++)r[o]=n[o];n=r}else n=[];for(i=0;i<n.length;i++)n[i].Dc.apply(n[i].Qa,Array.prototype.slice.call(arguments,1))},ff.prototype.Ib=function(t,e,n){gf(this,t),this.Rc[t]=this.Rc[t]||[],this.Rc[t].push({Dc:e,Qa:n}),(t=this.Ee(t))&&e.apply(n,t)},ff.prototype.mc=function(t,e,n){gf(this,t),t=this.Rc[t]||[];for(var i=0;i<t.length;i++)if(t[i].Dc===e&&(!n||n===t[i].Qa)){t.splice(i,1);break}};var hf=(ND=0,OD=[],function(t){var e=t===ND;ND=t;for(var n=Array(8),i=7;0<=i;i--)n[i]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(t%64),t=Math.floor(t/64);if(O(0===t,"Cannot push at time==0"),t=n.join(""),e){for(i=11;0<=i&&63===OD[i];i--)OD[i]=0;OD[i]++}else for(i=0;i<12;i++)OD[i]=Math.floor(64*Math.random());for(i=0;i<12;i++)t+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(OD[i]);return O(20===t.length,"nextPushId: Length should be 20."),t}),ND,OD;function jf(){if(ff.call(this,["online"]),this.oc=!0,"undefined"!=typeof window&&"undefined"!=typeof window.addEventListener){var t=this;window.addEventListener("online",function(){t.oc||(t.oc=!0,t.ie("online",!0))},!1),window.addEventListener("offline",function(){t.oc&&(t.oc=!1,t.ie("online",!1))},!1)}}function kf(){var e,t;if(ff.call(this,["visible"]),"undefined"!=typeof document&&"undefined"!=typeof document.addEventListener&&("undefined"!=typeof document.hidden?(t="visibilitychange",e="hidden"):"undefined"!=typeof document.mozHidden?(t="mozvisibilitychange",e="mozHidden"):"undefined"!=typeof document.msHidden?(t="msvisibilitychange",e="msHidden"):"undefined"!=typeof document.webkitHidden&&(t="webkitvisibilitychange",e="webkitHidden")),this.Sb=!0,t){var n=this;document.addEventListener(t,function(){var t=!document[e];t!==n.Sb&&(n.Sb=t,n.ie("visible",t))},!1)}}function P(t,e){if(1==arguments.length){this.u=t.split("/");for(var n=0,i=0;i<this.u.length;i++)0<this.u[i].length&&(this.u[n]=this.u[i],n++);this.u.length=n,this.aa=0}else this.u=t,this.aa=e}function lf(t,e){var n=K(t);if(null===n)return e;if(n===K(e))return lf(N(t),N(e));throw Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function mf(t,e){for(var n=t.slice(),i=e.slice(),r=0;r<n.length&&r<i.length;r++){var o=yc(n[r],i[r]);if(0!==o)return o}return n.length===i.length?0:n.length<i.length?-1:1}function K(t){return t.aa>=t.u.length?null:t.u[t.aa]}function le(t){return t.u.length-t.aa}function N(t){var e=t.aa;return e<t.u.length&&e++,new P(t.u,e)}function me(t){return t.aa<t.u.length?t.u[t.u.length-1]:null}ka(jf,ff),jf.prototype.Ee=function(t){return O("online"===t,"Unknown event type: "+t),[this.oc]},ba(jf),ka(kf,ff),kf.prototype.Ee=function(t){return O("visible"===t,"Unknown event type: "+t),[this.Sb]},ba(kf),h=P.prototype,h.toString=function(){for(var t="",e=this.aa;e<this.u.length;e++)""!==this.u[e]&&(t+="/"+this.u[e]);return t||"/"},h.slice=function(t){return this.u.slice(this.aa+(t||0))},h.parent=function(){if(this.aa>=this.u.length)return null;for(var t=[],e=this.aa;e<this.u.length-1;e++)t.push(this.u[e]);return new P(t,0)},h.o=function(t){for(var e=[],n=this.aa;n<this.u.length;n++)e.push(this.u[n]);if(t instanceof P)for(n=t.aa;n<t.u.length;n++)e.push(t.u[n]);else for(t=t.split("/"),n=0;n<t.length;n++)0<t[n].length&&e.push(t[n]);return new P(e,0)},h.e=function(){return this.aa>=this.u.length},h.ea=function(t){if(le(this)!==le(t))return!1;for(var e=this.aa,n=t.aa;e<=this.u.length;e++,n++)if(this.u[e]!==t.u[n])return!1;return!0},h.contains=function(t){var e=this.aa,n=t.aa;if(le(this)>le(t))return!1;for(;e<this.u.length;){if(this.u[e]!==t.u[n])return!1;++e,++n}return!0};var M=new P("");function nf(t,e){this.Ua=t.slice(),this.Ka=Math.max(1,this.Ua.length),this.pf=e;for(var n=0;n<this.Ua.length;n++)this.Ka+=Pb(this.Ua[n]);of(this)}function of(t){if(768<t.Ka)throw Error(t.pf+"has a key path longer than 768 bytes ("+t.Ka+").");if(32<t.Ua.length)throw Error(t.pf+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+pf(t))}function pf(t){return 0==t.Ua.length?"":"in property '"+t.Ua.join(".")+"'"}function qf(t,e){this.value=t,this.children=e||rf}nf.prototype.push=function(t){0<this.Ua.length&&(this.Ka+=1),this.Ua.push(t),this.Ka+=Pb(t),of(this)},nf.prototype.pop=function(){var t=this.Ua.pop();this.Ka-=Pb(t),0<this.Ua.length&&--this.Ka};var rf=new Ec(function(t,e){return t===e?0:t<e?-1:1});function sf(t){var n=qe;return v(t,function(t,e){n=n.set(new P(e),t)}),n}function tf(t,e,n){if(null!=t.value&&n(t.value))return{path:M,value:t.value};if(e.e())return null;var i=K(e);return null!==(t=t.children.get(i))?null!=(e=tf(t,N(e),n))?{path:new P(i).o(e.path),value:e.value}:null:null}function uf(t,e){return tf(t,e,function(){return!0})}function pe(t,e,n){if(e.e())return n;var i=K(e);return i=(e=pe(t.children.get(i)||qe,N(e),n)).e()?t.children.remove(i):t.children.Sa(i,e),new qf(t.value,i)}function vf(t,e){return wf(t,M,e)}function wf(t,n,i){var r={};return t.children.ka(function(t,e){r[t]=wf(e,n.o(t),i)}),i(n,t.value,r)}function xf(t,e,n){return yf(t,e,M,n)}function yf(t,e,n,i){var r=!!t.value&&i(n,t.value);return r||(e.e()?null:(r=K(e),(t=t.children.get(r))?yf(t,N(e),n.o(r),i):null))}function zf(t,e,n){Af(t,e,M,n)}function Af(t,e,n,i){if(e.e())return t;t.value&&i(n,t.value);var r=K(e);return(t=t.children.get(r))?Af(t,N(e),n.o(r),i):qe}function ne(t,e){Bf(t,M,e)}function Bf(t,n,i){t.children.ka(function(t,e){Bf(e,n.o(t),i)}),t.value&&i(n,t.value)}function Cf(t,n){t.children.ka(function(t,e){e.value&&n(t,e.value)})}h=qf.prototype,h.e=function(){return null===this.value&&this.children.e()},h.subtree=function(t){if(t.e())return this;var e=this.children.get(K(t));return null!==e?e.subtree(N(t)):qe},h.set=function(t,e){if(t.e())return new qf(e,this.children);var n=K(t),i=(this.children.get(n)||qe).set(N(t),e);n=this.children.Sa(n,i);return new qf(this.value,n)},h.remove=function(t){if(t.e())return this.children.e()?qe:new qf(null,this.children);var e=K(t),n=this.children.get(e);return n?(e=(t=n.remove(N(t))).e()?this.children.remove(e):this.children.Sa(e,t),null===this.value&&e.e()?qe:new qf(this.value,e)):this},h.get=function(t){if(t.e())return this.value;var e=this.children.get(K(t));return e?e.get(N(t)):null};var qe=new qf(null);function Df(t,e,n){this.type=ee,this.source=Ef,this.path=t,this.Ub=e,this.Yd=n}qf.prototype.toString=function(){var n={};return ne(this,function(t,e){n[t.toString()]=e.toString()}),G(n)},Df.prototype.$c=function(t){return this.path.e()?null!=this.Ub.value?(O(this.Ub.children.e(),"affectedTree should not have overlapping affected paths."),this):(t=this.Ub.subtree(new P(t)),new Df(M,t,this.Yd)):(O(K(this.path)===t,"operationForChild called for unrelated child."),new Df(N(this.path),this.Ub,this.Yd))},Df.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" ack write revert="+this.Yd+" affectedTree="+this.Ub+")"};var Bc=0,be=1,ee=2,Dc=3;function Ff(t,e,n,i){this.Ae=t,this.tf=e,this.Lb=n,this.ef=i,O(!i||e,"Tagged queries must be from server.")}var Ef=new Ff(!0,!1,null,!1),Gf=new Ff(!1,!0,null,!1);function Hf(t){this.Z=t}Ff.prototype.toString=function(){return this.Ae?"user":this.ef?"server(queryID="+this.Lb+")":"server"};var If=new Hf(new qf(null));function Jf(t,e,n){if(e.e())return new Hf(new qf(n));if(null==(r=uf(t.Z,e)))return new Hf(t=pe(t.Z,e,new qf(n)));var i=r.path,r=r.value;return e=lf(i,e),r=r.H(e,n),new Hf(t.Z.set(i,r))}function Kf(t,n,e){var i=t;return Fb(e,function(t,e){i=Jf(i,n.o(t),e)}),i}function Lf(t,e){var n=uf(t.Z,e);return null!=n?t.Z.get(n.path).S(lf(n.path,e)):null}function Mf(t){var n=[],e=t.Z.value;return null!=e?e.L()||e.R(R,function(t,e){n.push(new L(t,e))}):t.Z.children.ka(function(t,e){null!=e.value&&n.push(new L(t,e.value))}),n}function Nf(t,e){if(e.e())return t;var n=Lf(t,e);return new Hf(null!=n?new qf(n):t.Z.subtree(e))}function Of(n,t,i){if(null!=t.value)return i.H(n,t.value);var r=null;return t.children.ka(function(t,e){".priority"===t?(O(null!==e.value,"Priority writes must always be leaf nodes"),r=e.value):i=Of(n.o(t),e,i)}),i.S(n).e()||null===r||(i=i.H(n.o(".priority"),r)),i}function Pf(){this.V=If,this.pa=[],this.Pc=-1}function Qf(t,e){for(var n=0;n<t.pa.length;n++){var i=t.pa[n];if(i.md===e)return i}return null}function Rf(n,i){return n.Ja?n.path.contains(i):!!ta(n.children,function(t,e){return n.path.o(e).contains(i)})}function Tf(t){return t.visible}function Sf(t,e,n){for(var i=If,r=0;r<t.length;++r){var o=t[r];if(e(o)){var a=o.path;if(o.Ja)n.contains(a)?i=Jf(i,a=lf(n,a),o.Ja):a.contains(n)&&(a=lf(a,n),i=Jf(i,M,o.Ja.S(a)));else{if(!o.children)throw jd("WriteRecord should have .snap or .children");n.contains(a)?i=Kf(i,a=lf(n,a),o.children):a.contains(n)&&((a=lf(a,n)).e()?i=Kf(i,M,o.children):(o=z(o.children,K(a)))&&(o=o.S(N(a)),i=Jf(i,M,o)))}}}return i}function Uf(t,e){this.Qb=t,this.Z=e}function Vf(){this.children={},this.pd=0,this.value=null}function Wf(t,e,n){this.Jd=t||"",this.Ha=e||null,this.A=n||new Vf}function Xf(t,e){for(var n,i=e instanceof P?e:new P(e),r=t;null!==(n=K(i));)r=new Wf(n,r,z(r.A.children,n)||new Vf),i=N(i);return r}function Yf(t,e){O(void 0!==e,"Cannot set value to undefined"),t.A.value=e,Zf(t)}function $f(t,e,n,i){n&&!i&&e(t),t.R(function(t){$f(t,e,!0,i)}),n&&i&&e(t)}function ag(t,e){for(var n=t.parent();null!==n&&!e(n);)n=n.parent()}function Zf(t){if(null!==t.Ha){var e=t.Ha,n=t.Jd,i=t.e(),r=y(e.A.children,n);i&&r?(delete e.A.children[n],e.A.pd--,Zf(e)):i||r||(e.A.children[n]=t.A,e.A.pd++,Zf(e))}}Hf.prototype.Ud=function(t){return t.e()?If:new Hf(t=pe(this.Z,t,qe))},Hf.prototype.e=function(){return this.Z.e()},Hf.prototype.apply=function(t){return Of(M,this.Z,t)},h=Pf.prototype,h.Ud=function(e){var t=Sa(this.pa,function(t){return t.md===e});O(0<=t,"removeWrite called with nonexistent writeId.");var n=this.pa[t];this.pa.splice(t,1);for(var i=n.visible,r=!1,o=this.pa.length-1;i&&0<=o;){var a=this.pa[o];a.visible&&(t<=o&&Rf(a,n.path)?i=!1:n.path.contains(a.path)&&(r=!0)),o--}if(i){if(r)this.V=Sf(this.pa,Tf,M),this.Pc=0<this.pa.length?this.pa[this.pa.length-1].md:-1;else if(n.Ja)this.V=this.V.Ud(n.path);else{var s=this;v(n.children,function(t,e){s.V=s.V.Ud(n.path.o(e))})}return!0}return!1},h.Aa=function(e,t,n,i){if(n||i){var r=Nf(this.V,e);return!i&&r.e()?t:i||null!=t||null!=Lf(r,M)?(r=Sf(this.pa,function(t){return(t.visible||i)&&(!n||!(0<=La(n,t.md)))&&(t.path.contains(e)||e.contains(t.path))},e),t=t||H,r.apply(t)):null}return null!=(r=Lf(this.V,e))?r:(r=Nf(this.V,e)).e()?t:null!=t||null!=Lf(r,M)?(t=t||H,r.apply(t)):null},h.Cc=function(t,e){var i=H,n=Lf(this.V,t);if(n)n.L()||n.R(R,function(t,e){i=i.W(t,e)});else if(e){var r=Nf(this.V,t);e.R(R,function(t,e){var n=Nf(r,new P(t)).apply(e);i=i.W(t,n)}),Ma(Mf(r),function(t){i=i.W(t.name,t.U)})}else r=Nf(this.V,t),Ma(Mf(r),function(t){i=i.W(t.name,t.U)});return i},h.nd=function(t,e,n,i){return O(n||i,"Either existingEventSnap or existingServerSnap must exist"),t=t.o(e),null!=Lf(this.V,t)?null:(t=Nf(this.V,t)).e()?i.S(e):t.apply(i.S(e))},h.Bc=function(t,e,n){t=t.o(e);var i=Lf(this.V,t);return null!=i?i:Wb(n,e)?Nf(this.V,t).apply(n.j().T(e)):null},h.xc=function(t){return Lf(this.V,t)},h.qe=function(t,e,n,i,r,o){var a;if(null==(a=Lf(t=Nf(this.V,t),M))){if(null==e)return[];a=t.apply(e)}if((a=a.pb(o)).e()||a.L())return[];for(e=[],t=Vd(o),o=Ic(r=r?a.dc(n,o):a.bc(n,o));o&&e.length<i;)0!==t(o,n)&&e.push(o),o=Ic(r);return e},h=Uf.prototype,h.Aa=function(t,e,n){return this.Z.Aa(this.Qb,t,e,n)},h.Cc=function(t){return this.Z.Cc(this.Qb,t)},h.nd=function(t,e,n){return this.Z.nd(this.Qb,t,e,n)},h.xc=function(t){return this.Z.xc(this.Qb.o(t))},h.qe=function(t,e,n,i,r){return this.Z.qe(this.Qb,t,e,n,i,r)},h.Bc=function(t,e){return this.Z.Bc(this.Qb,t,e)},h.o=function(t){return new Uf(this.Qb.o(t),this.Z)},h=Wf.prototype,h.Ea=function(){return this.A.value},h.clear=function(){this.A.value=null,this.A.children={},this.A.pd=0,Zf(this)},h.zd=function(){return 0<this.A.pd},h.e=function(){return null===this.Ea()&&!this.zd()},h.R=function(n){var i=this;v(this.A.children,function(t,e){n(new Wf(e,i,t))})},h.path=function(){return new P(null===this.Ha?this.Jd:this.Ha.path()+"/"+this.Jd)},h.name=function(){return this.Jd},h.parent=function(){return this.Ha};var bg=/[\[\].#$\/\u0000-\u001F\u007F]/,cg=/[\[\].#$\u0000-\u001F\u007F]/,dg=/^[a-zA-Z][a-zA-Z._\-+]+$/;function eg(t){return q(t)&&0!==t.length&&!bg.test(t)}function fg(t){return null===t||q(t)||fa(t)&&!td(t)||ga(t)&&y(t,".sv")}function gg(t,e,n,i){i&&!p(e)||hg(E(t,1,i),e,n)}function hg(n,t,i){if(i instanceof P&&(i=new nf(i,n)),!p(t))throw Error(n+"contains undefined "+pf(i));if(r(t))throw Error(n+"contains a function "+pf(i)+" with contents: "+t.toString());if(td(t))throw Error(n+"contains "+t.toString()+" "+pf(i));if(q(t)&&t.length>10485760/3&&10485760<Pb(t))throw Error(n+"contains a string greater than 10485760 utf8 bytes "+pf(i)+" ('"+t.substring(0,50)+"...')");if(ga(t)){var o=!1,a=!1;if(Fb(t,function(t,e){if(".value"===t)o=!0;else if(".priority"!==t&&".sv"!==t&&(a=!0,!eg(t)))throw Error(n+" contains an invalid key ("+t+") "+pf(i)+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');i.push(t),hg(n,e,i),i.pop()}),o&&a)throw Error(n+' contains ".value" child '+pf(i)+" in addition to actual children.")}}function ig(t,e){var n,i;for(n=0;n<e.length;n++)for(var r=(i=e[n]).slice(),o=0;o<r.length;o++)if((".priority"!==r[o]||o!==r.length-1)&&!eg(r[o]))throw Error(t+"contains an invalid key ("+r[o]+") in path "+i.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');for(e.sort(mf),r=null,n=0;n<e.length;n++){if(i=e[n],null!==r&&r.contains(i))throw Error(t+"contains a path "+r.toString()+" that is ancestor of another path "+i.toString());r=i}}function jg(t,e,i){var r=E(t,1,!1);if(!ga(e)||da(e))throw Error(r+" must be an object containing the children to replace.");var o=[];Fb(e,function(t,e){var n=new P(t);if(hg(r,e,i.o(n)),".priority"===me(n)&&!fg(e))throw Error(r+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(n)}),ig(r,o)}function kg(t,e,n){if(td(n))throw Error(E(t,e,!1)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!fg(n))throw Error(E(t,e,!1)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}function lg(t,e,n){if(!n||p(e))switch(e){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw Error(E(t,1,n)+'must be a valid event type: "value", "child_added", "child_removed", "child_changed", or "child_moved".')}}function mg(t,e){if(p(e)&&!eg(e))throw Error(E(t,2,!0)+'was an invalid key: "'+e+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')}function ng(t,e){if(!q(e)||0===e.length||cg.test(e))throw Error(E(t,1,!1)+'was an invalid path: "'+e+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')}function og(t,e){if(".info"===K(e))throw Error(t+" failed: Can't modify data under /.info/")}function pg(t,e){if(!q(e))throw Error(E(t,1,!1)+"must be a valid credential (a string).")}function qg(t,e,n){if(!q(n))throw Error(E(t,e,!1)+"must be a valid string.")}function rg(t,e){if(qg(t,1,e),!dg.test(e))throw Error(E(t,1,!1)+"'"+e+"' is not a valid authentication provider.")}function sg(t,e,n,i){if((!i||p(n))&&(!ga(n)||null===n))throw Error(E(t,e,i)+"must be a valid object.")}function tg(t,e,n){if(!ga(e)||!y(e,n))throw Error(E(t,1,!1)+'must contain the key "'+n+'"');if(!q(z(e,n)))throw Error(E(t,1,!1)+'must contain the key "'+n+'" with type "string"')}function ug(){this.set={}}function vg(t,n){v(t.set,function(t,e){n(e,t)})}function Vc(){this.m=this.B=null}function wg(n,t){if(t.e())return n.B=null,!(n.m=null);if(null===n.B)return null===n.m||(e=K(t),t=N(t),n.m.contains(e)&&wg(n.m.get(e),t)&&n.m.remove(e),!!n.m.e()&&!(n.m=null));if(n.B.L())return!1;var e=n.B;return n.B=null,e.R(R,function(t,e){n.rc(new P(t),e)}),wg(n,t)}function Wc(t,n,i){null!==t.B?i(n,t.B):t.R(function(t,e){Wc(e,new P(n.toString()+"/"+t),i)})}h=ug.prototype,h.add=function(t,e){this.set[t]=null===e||e},h.contains=function(t){return y(this.set,t)},h.get=function(t){return this.contains(t)?this.set[t]:void 0},h.remove=function(t){delete this.set[t]},h.clear=function(){this.set={}},h.e=function(){return va(this.set)},h.count=function(){return oa(this.set)},h.keys=function(){var n=[];return v(this.set,function(t,e){n.push(e)}),n},Vc.prototype.find=function(t){if(null!=this.B)return this.B.S(t);if(t.e()||null==this.m)return null;var e=K(t);return t=N(t),this.m.contains(e)?this.m.get(e).find(t):null},Vc.prototype.rc=function(t,e){if(t.e())this.B=e,this.m=null;else if(null!==this.B)this.B=this.B.H(t,e);else{null==this.m&&(this.m=new ug);var n=K(t);this.m.contains(n)||this.m.add(n,new Vc),n=this.m.get(n),t=N(t),n.rc(t,e)}},Vc.prototype.R=function(n){null!==this.m&&vg(this.m,function(t,e){n(t,e)})};var xg="auth.firebase.com";function yg(t,e,n){this.qd=t||{},this.he=e||{},this.fb=n||{},this.qd.remember||(this.qd.remember="default")}var zg=["remember","redirectTo"];function Ag(t){var n={},i={};return Fb(t||{},function(t,e){0<=La(zg,t)?n[t]=e:i[t]=e}),new yg(n,{},i)}function Bg(t,e){this.Ue=["session",t.Rd,t.lc].join(":"),this.ee=e}function Cg(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function Dg(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Cg())}function Eg(){return"undefined"!=typeof location&&/^file:\//.test(location.href)}function Fg(t){var e=Cg();if(""===e)return!1;if("Microsoft Internet Explorer"===navigator.appName){if((e=e.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/))&&1<e.length)return parseFloat(e[1])>=t}else if(-1<e.indexOf("Trident")&&(e=e.match(/rv:([0-9]{2,2}[\.0-9]{0,})/))&&1<e.length)return parseFloat(e[1])>=t;return!1}function Gg(){var t,e=window.opener.frames;for(t=e.length-1;0<=t;t--)try{if(e[t].location.protocol===window.location.protocol&&e[t].location.host===window.location.host&&"__winchan_relay_frame"===e[t].name)return e[t]}catch(n){}return null}function Hg(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener&&t.addEventListener(e,n,!1)}function Ig(t,e,n){t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener&&t.removeEventListener(e,n,!1)}function Jg(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function Kg(t){var e="";try{var n=Jb(t=t.replace(/.*\?/,""));n&&y(n,"__firebase_request_key")&&(e=z(n,"__firebase_request_key"))}catch(i){}return e}function Lg(){try{var t=(t=(t=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")).replace(/\?$/,"")).replace(/^#+$/,"");document.location.hash=t}catch(e){}}function Mg(){var t=sd(xg);return t.scheme+"://"+t.host+"/v2"}function Ng(t){return Mg()+"/"+t+"/auth/channel"}function Og(t){var e=this;if(this.hb=t,this.fe="*",Fg(8)?this.Uc=this.Cd=Gg():(this.Uc=window.opener,this.Cd=window),!e.Uc)throw"Unable to find relay frame";Hg(this.Cd,"message",u(this.nc,this)),Hg(this.Cd,"message",u(this.Ff,this));try{Pg(this,{a:"ready"})}catch(n){Hg(this.Uc,"load",function(){Pg(e,{a:"ready"})})}Hg(window,"unload",u(this.Ng,this))}function Pg(t,e){e=G(e),Fg(8)?t.Uc.doPost(e,t.fe):t.Uc.postMessage(e,t.fe)}function Qg(t){this.tc=Fa()+Fa()+Fa(),this.Kf=t}Bg.prototype.set=function(t,e){if(!e){if(!this.ee.length)throw Error("fb.login.SessionManager:No storage options available!");e=this.ee[0]}e.set(this.Ue,t)},Bg.prototype.get=function(){var t=Oa(this.ee,u(this.Bg,this));return Va(t=Na(t,function(t){return null!==t}),function(t,e){return Dd(e.token)-Dd(t.token)}),0<t.length?t.shift():null},Bg.prototype.Bg=function(t){try{var e=t.get(this.Ue);if(e&&e.token)return e}catch(n){}return null},Bg.prototype.clear=function(){var e=this;Ma(this.ee,function(t){t.remove(e.Ue)})},Og.prototype.nc=function(t){var e,n=this;try{e=Rb(t.data)}catch(i){}e&&"request"===e.a&&(Ig(window,"message",this.nc),this.fe=t.origin,this.hb&&setTimeout(function(){n.hb(n.fe,e.d,function(t,e){n.mg=!e,n.hb=void 0,Pg(n,{a:"response",d:t,forceKeepWindowOpen:e})})},0))},Og.prototype.Ng=function(){try{Ig(this.Cd,"message",this.Ff)}catch(t){}this.hb&&(Pg(this,{a:"error",d:"unknown closed window"}),this.hb=void 0);try{window.close()}catch(e){}},Og.prototype.Ff=function(t){if(this.mg&&"die"===t.data)try{window.close()}catch(e){}},Qg.prototype.open=function(t,e){cd.set("redirect_request_id",this.tc),cd.set("redirect_request_id",this.tc),e.requestId=this.tc,e.redirectTo=e.redirectTo||window.location.href,t+=(/\?/.test(t)?"":"?")+Ib(e),window.location=t},Qg.isAvailable=function(){return!Eg()&&!Dg()},Qg.prototype.Fc=function(){return"redirect"};var Rg={NETWORK_ERROR:"Unable to contact the Firebase server.",SERVER_ERROR:"An unknown server error occurred.",TRANSPORT_UNAVAILABLE:"There are no login transports available for the requested method.",REQUEST_INTERRUPTED:"The browser redirected the page before the login request could complete.",USER_CANCELLED:"The user cancelled authentication."};function Sg(t){var e=Error(z(Rg,t),t);return e.code=t,e}function Tg(t){var e;(e=!t.window_features)||(e=-1!==(e=Cg()).indexOf("Fennec/")||-1!==e.indexOf("Firefox/")&&-1!==e.indexOf("Android")),e&&(t.window_features=void 0),t.window_name||(t.window_name="_blank"),this.options=t}function Ug(t){t.method||(t.method="GET"),t.headers||(t.headers={}),t.headers.content_type||(t.headers.content_type="application/json"),t.headers.content_type=t.headers.content_type.toLowerCase(),this.options=t}function Vg(t){this.tc=Fa()+Fa()+Fa(),this.Kf=t}function Wg(t){t.callback_parameter||(t.callback_parameter="callback"),this.options=t,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Xg(i,r,o){setTimeout(function(){try{var t=document.createElement("script");t.type="text/javascript",t.id=i,t.async=!0,t.src=r,t.onerror=function(){var t=document.getElementById(i);null!==t&&t.parentNode.removeChild(t),o&&o(Sg("NETWORK_ERROR"))};var e=document.getElementsByTagName("head");(e&&0!=e.length?e[0]:document.documentElement).appendChild(t)}catch(n){o&&o(Sg("NETWORK_ERROR"))}},0)}function Yg(t,e,n,i){ff.call(this,["auth_status"]),this.G=t,this.hf=e,this.ih=n,this.Pe=i,this.wc=new Bg(t,[bd,cd]),this.qb=null,this.We=!1,Zg(this)}function Zg(n){cd.get("redirect_request_id")&&$g(n);var i=n.wc.get();i&&i.token?(ah(n,i),n.hf(i.token,function(t,e){bh(n,t,e,!1,i.token,i)},function(t,e){ch(n,"resumeSession()",t,e)})):ah(n,null)}function dh(n,i,r,o,a,s){"firebaseio-demo.com"===n.G.domain&&S("Firebase authentication is not supported on demo Firebases (*.firebaseio-demo.com). To secure your Firebase, create a production Firebase at https://www.firebase.com."),n.hf(i,function(t,e){bh(n,t,e,!0,i,r,o||{},a)},function(t,e){ch(n,"auth()",t,e,s)})}function eh(t,r){t.wc.clear(),ah(t,null),t.ih(function(t,e){if("ok"===t)T(r,null);else{var n=(t||"error").toUpperCase(),i=n;e&&(i+=": "+e),(i=Error(i)).code=n,T(r,i)}})}function bh(t,e,n,i,r,o,a,s){"ok"===e?(i&&(e=n.auth,o.auth=e,o.expires=n.expires,o.token=Ed(r)?r:"",n=null,e&&y(e,"uid")?n=z(e,"uid"):y(o,"uid")&&(n=z(o,"uid")),o.uid=n,n="custom",e&&y(e,"provider")?n=z(e,"provider"):y(o,"provider")&&(n=z(o,"provider")),o.provider=n,t.wc.clear(),Ed(r)&&(n=bd,"sessionOnly"===(a=a||{}).remember&&(n=cd),"none"!==a.remember&&t.wc.set(o,n)),ah(t,o)),T(s,null,o)):(t.wc.clear(),ah(t,null),o=t=(e||"error").toUpperCase(),n&&(o+=": "+n),(o=Error(o)).code=t,T(s,o))}function ch(t,e,n,i,r){S(e+" was canceled: "+i),t.wc.clear(),ah(t,null),(t=Error(i)).code=n.toUpperCase(),T(r,t)}function fh(t,e,n,i,r){gh(t),hh(t,[Ug,Wg],"/auth/"+e,n=new yg(i||{},{},n||{}),r)}function ih(t,e,n,i){gh(t);var r=[Tg,Vg];n=Ag(n);var o=625;"anonymous"===e||"password"===e?setTimeout(function(){T(i,Sg("TRANSPORT_UNAVAILABLE"))},0):("github"===e&&(o=1025),n.he.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width="+o+",top="+("object"==typeof screen?.5*(screen.height-625):0)+",left="+("object"==typeof screen?.5*(screen.width-o):0),n.he.relay_url=Ng(t.G.lc),n.he.requestWithCredential=u(t.uc,t),hh(t,r,"/auth/"+e,n,i))}function $g(t){if(n=cd.get("redirect_request_id")){var e=cd.get("redirect_client_options");cd.remove("redirect_request_id"),cd.remove("redirect_client_options");var n,i=[Ug,Wg];e=new yg(e,{},n={requestId:n,requestKey:Kg(document.location.hash)});t.We=!0,Lg(),hh(t,i,"/auth/session",e,function(){this.We=!1}.bind(t))}}function hh(n,t,e,i,r){jh(n,t,e,i,function(t,e){!t&&e&&e.token&&e.uid?dh(n,e.token,e,i.qd,function(t,e){t?T(r,t):T(r,null,e)}):T(r,t||Sg("UNKNOWN_ERROR"))})}function jh(t,e,n,i,r){0===(e=Na(e,function(t){return"function"==typeof t.isAvailable&&t.isAvailable()})).length?setTimeout(function(){T(r,Sg("TRANSPORT_UNAVAILABLE"))},0):(e=new(e.shift())(i.he),(i=Gb(i.fb)).v="js-"+Eb,i.transport=e.Fc(),i.suppress_status_codes=!0,t=Mg()+"/"+t.G.lc+n,e.open(t,i,function(t,e){if(t)T(r,t);else if(e&&e.error){var n=Error(e.error.message);n.code=e.error.code,n.details=e.error.details,T(r,n)}else T(r,null,e)}))}function ah(t,e){var n=null!==t.qb||null!==e;t.qb=e,n&&t.ie("auth_status",e),t.Pe(null!==e)}function gh(t){var e=t.G;if("firebaseio.com"!==e.domain&&"firebaseio-demo.com"!==e.domain&&"auth.firebase.com"===xg)throw Error("This custom Firebase server ('"+t.G.domain+"') does not support delegated login.")}Tg.prototype.open=function(t,e,n){function i(t){if(o&&(document.body.removeChild(o),o=void 0),c=c&&clearInterval(c),Ig(window,"message",r),Ig(window,"unload",i),u&&!t)try{u.close()}catch(e){a.postMessage("die",h)}u=a=void 0}function r(t){if(t.origin===h)try{var e=Rb(t.data);"ready"===e.a?a.postMessage(f,h):"error"===e.a?(i(!1),n&&(n(e.d),n=null)):"response"===e.a&&(i(e.forceKeepWindowOpen),n&&(n(null,e.d),n=null))}catch(r){}}var o,a,s=Fg(8);if(!this.options.relay_url)return n(Error("invalid arguments: origin of url and relay_url must match"));var h=Jg(t);if(h!==Jg(this.options.relay_url))n&&setTimeout(function(){n(Error("invalid arguments: origin of url and relay_url must match"))},0);else{s&&((o=document.createElement("iframe")).setAttribute("src",this.options.relay_url),o.style.display="none",o.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(o),a=o.contentWindow),t+=(/\?/.test(t)?"":"?")+Ib(e);var u=window.open(t,this.options.window_name,this.options.window_features);a=a||u;var c=setInterval(function(){u&&u.closed&&(i(!1),n&&(n(Sg("USER_CANCELLED")),n=null))},500),f=G({a:"request",d:e});Hg(window,"unload",i),Hg(window,"message",r)}},Tg.isAvailable=function(){var t;return(t="postMessage"in window&&!Eg())&&((t=Dg()||"undefined"!=typeof navigator&&(!!Cg().match(/Windows Phone/)||!!window.Windows&&/^ms-appx:/.test(location.href)))||(t=Cg(),t="undefined"!=typeof navigator&&"undefined"!=typeof window&&!!(t.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i)||t.match(/CriOS/)||t.match(/Twitter for iPhone/)||t.match(/FBAN\/FBIOS/)||window.navigator.standalone)),t=!t),t&&!Cg().match(/PhantomJS/)},Tg.prototype.Fc=function(){return"popup"},Ug.prototype.open=function(t,e,n){function i(){n&&(n(Sg("REQUEST_INTERRUPTED")),n=null)}var r,o=new XMLHttpRequest,a=this.options.method.toUpperCase();if(Hg(window,"beforeunload",i),o.onreadystatechange=function(){if(n&&4===o.readyState){var t;if(200<=o.status&&o.status<300){try{t=Rb(o.responseText)}catch(e){}n(null,t)}else 500<=o.status&&o.status<600?n(Sg("SERVER_ERROR")):n(Sg("NETWORK_ERROR"));n=null,Ig(window,"beforeunload",i)}},"GET"===a)t+=(/\?/.test(t)?"":"?")+Ib(e),r=null;else{var s=this.options.headers.content_type;"application/json"===s&&(r=G(e)),"application/x-www-form-urlencoded"===s&&(r=Ib(e))}for(var h in o.open(a,t,!0),ya(t={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},this.options.headers),t)o.setRequestHeader(h,t[h]);o.send(r)},Ug.isAvailable=function(){var t;return(t=!!window.XMLHttpRequest)&&(t=!((t=Cg()).match(/MSIE/)||t.match(/Trident/))||Fg(10)),t},Ug.prototype.Fc=function(){return"json"},Vg.prototype.open=function(t,e,o){function a(){o&&(o(Sg("USER_CANCELLED")),o=null)}var s,h=this,u=sd(xg);e.requestId=this.tc,e.redirectTo=u.scheme+"://"+u.host+"/blank/page.html",t+=/\?/.test(t)?"":"?",t+=Ib(e),(s=window.open(t,"_blank","location=no"))&&r(s.addEventListener)?(s.addEventListener("loadstart",function(t){var e;if(e=t&&t.url)t:{try{var n=document.createElement("a");n.href=t.url,e=n.host===u.host&&"/blank/page.html"===n.pathname;break t}catch(i){}e=!1}e&&(t=Kg(t.url),s.removeEventListener("exit",a),s.close(),t=new yg(null,null,{requestId:h.tc,requestKey:t}),h.Kf.requestWithCredential("/auth/session",t,o),o=null)}),s.addEventListener("exit",a)):o(Sg("TRANSPORT_UNAVAILABLE"))},Vg.isAvailable=function(){return Dg()},Vg.prototype.Fc=function(){return"redirect"},Wg.prototype.open=function(t,n,i){function r(){i&&(i(Sg("REQUEST_INTERRUPTED")),i=null)}var o="fn"+(new Date).getTime()+Math.floor(99999*Math.random());n[this.options.callback_parameter]="__firebase_auth_jsonp."+o,t+=(/\?/.test(t)?"":"?")+Ib(n),Hg(window,"beforeunload",r),window.__firebase_auth_jsonp[o]=function(t){i&&(i(null,t),i=null),function e(){setTimeout(function(){window.__firebase_auth_jsonp[o]=void 0,va(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var t=document.getElementById(o);t&&t.parentNode.removeChild(t)}catch(n){}},1),Ig(window,"beforeunload",r)}()},Xg(o,t,i)},Wg.isAvailable=function(){return"undefined"!=typeof document&&null!=document.createElement},Wg.prototype.Fc=function(){return"json"},ka(Yg,ff),h=Yg.prototype,h.Be=function(){return this.qb||null},h.ve=function(t,n){gh(this);var e=Ag(t);e.fb._method="POST",this.uc("/users",e,function(t,e){t?T(n,t):T(n,t,e)})},h.Xe=function(t,n){var i=this;gh(this);var e="/users/"+encodeURIComponent(t.email),r=Ag(t);r.fb._method="DELETE",this.uc(e,r,function(t,e){!t&&e&&e.uid&&i.qb&&i.qb.uid&&i.qb.uid===e.uid&&eh(i),T(n,t)})},h.se=function(t,e){gh(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=Ag(t);i.fb._method="PUT",i.fb.password=t.newPassword,this.uc(n,i,function(t){T(e,t)})},h.re=function(t,e){gh(this);var n="/users/"+encodeURIComponent(t.oldEmail)+"/email",i=Ag(t);i.fb._method="PUT",i.fb.email=t.newEmail,i.fb.password=t.password,this.uc(n,i,function(t){T(e,t)})},h.Ze=function(t,e){gh(this);var n="/users/"+encodeURIComponent(t.email)+"/password",i=Ag(t);i.fb._method="POST",this.uc(n,i,function(t){T(e,t)})},h.uc=function(t,e,n){jh(this,[Ug,Wg],t,e,n)},h.Ee=function(t){return O("auth_status"===t,'initial event must be of type "auth_status"'),this.We?null:[this.qb]};var gd="websocket",hd="long_polling",oh,ph;function kh(t){this.nc=t,this.Qd=[],this.Wb=0,this.te=-1,this.Jb=null}function lh(t,e,n){t.te=e,t.Jb=n,t.te<t.Wb&&(t.Jb(),t.Jb=null)}function mh(t,e,n){for(t.Qd[e]=n;t.Qd[t.Wb];){var i=t.Qd[t.Wb];delete t.Qd[t.Wb];for(var r=0;r<i.length;++r)if(i[r]){var o=t;gc(function(){o.nc(i[r])})}if(t.Wb===t.te){t.Jb&&(clearTimeout(t.Jb),t.Jb(),t.Jb=null);break}t.Wb++}}function nh(t,e,n,i){this.ue=t,this.f=pd(t),this.rb=this.sb=0,this.Xa=uc(e),this.Xf=n,this.Kc=!1,this.Fb=i,this.ld=function(t){return fd(e,hd,t)}}function rh(t,e){var n=G(e).length;t.rb+=n,rc(t.Xa,"bytes_received",n)}function qh(t,e,n,i){if(this.ld=i,this.lb=n,this.Te=new ug,this.cd=[],this.we=Math.floor(1e8*Math.random()),this.$d=!0,this.ke=id(),window["pLPCommand"+this.ke]=t,window["pRTLPCB"+this.ke]=e,(t=document.createElement("iframe")).style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||fc("No IE domain setting required")}catch(r){t.src="javascript:void((function(){document.open();document.domain='"+document.domain+"';document.close();})())"}t.contentDocument?t.jb=t.contentDocument:t.contentWindow?t.jb=t.contentWindow.document:t.document&&(t.jb=t.document),this.Ga=t,t="",this.Ga.src&&"javascript:"===this.Ga.src.substr(0,11)&&(t='<script>document.domain="'+document.domain+'";<\/script>'),t="<html><body>"+t+"</body></html>";try{this.Ga.jb.open(),this.Ga.jb.write(t),this.Ga.jb.close()}catch(o){fc("frame writing exception"),o.stack&&fc(o.stack),fc(o)}}function th(t){if(t.oe&&t.$d&&t.Te.count()<(0<t.cd.length?2:1)){t.we++,(e={}).id=t.Gg,e.pw=t.Hg,e.ser=t.we;for(var e=t.ld(e),n="",i=0;0<t.cd.length&&t.cd[0].of.length+30+n.length<=1870;){var r=t.cd.shift();n=n+"&seg"+i+"="+r.Yg+"&ts"+i+"="+r.hh+"&d"+i+"="+r.of;i++}return uh(t,e+n,t.we),!0}return!1}function uh(t,e,n){function i(){t.Te.remove(n),th(t)}t.Te.add(n,1);var r=setTimeout(i,Math.floor(25e3));sh(t,e,function(){clearTimeout(r),i()})}function sh(n,i,r){setTimeout(function(){try{if(n.$d){var e=n.Ga.jb.createElement("script");e.type="text/javascript",e.async=!0,e.src=i,e.onload=e.onreadystatechange=function(){var t=e.readyState;t&&"loaded"!==t&&"complete"!==t||(e.onload=e.onreadystatechange=null,e.parentNode&&e.parentNode.removeChild(e),r())},e.onerror=function(){fc("Long-poll script failed to load: "+i),n.$d=!1,n.close()},n.Ga.jb.body.appendChild(e)}}catch(t){}},Math.floor(1))}nh.prototype.open=function(t,e){this.mf=0,this.na=e,this.Ef=new kh(t),this.Db=!1;var o=this;this.ub=setTimeout(function(){o.f("Timed out trying to connect."),o.bb(),o.ub=null},Math.floor(3e4)),ud(function(){if(!o.Db){o.Wa=new qh(function(t,e,n,i,r){if(rh(o,arguments),o.Wa)if(o.ub&&(clearTimeout(o.ub),o.ub=null),o.Kc=!0,"start"==t)o.id=e,o.Mf=n;else{if("close"!==t)throw Error("Unrecognized command received: "+t);e?(o.Wa.$d=!1,lh(o.Ef,e,function(){o.bb()})):o.bb()}},function(t,e){rh(o,arguments),mh(o.Ef,t,e)},function(){o.bb()},o.ld);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),o.Wa.ke&&(t.cb=o.Wa.ke),t.v="5",o.Xf&&(t.s=o.Xf),o.Fb&&(t.ls=o.Fb),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),t=o.ld(t),o.f("Connecting via long-poll to "+t),sh(o.Wa,t,function(){})}})},nh.prototype.start=function(){var t=this.Wa,e=this.Mf;for(t.Gg=this.id,t.Hg=e,t.oe=!0;th(t););t=this.id,e=this.Mf,this.kc=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.kc.src=this.ld(n),this.kc.style.display="none",document.body.appendChild(this.kc)},nh.isAvailable=function(){return oh||!ph&&"undefined"!=typeof document&&null!=document.createElement&&!("object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"==typeof Windows&&"object"==typeof Windows.kh)&&!0},h=nh.prototype,h.Hd=function(){},h.fd=function(){this.Db=!0,this.Wa&&(this.Wa.close(),this.Wa=null),this.kc&&(document.body.removeChild(this.kc),this.kc=null),this.ub&&(clearTimeout(this.ub),this.ub=null)},h.bb=function(){this.Db||(this.f("Longpoll is closing itself"),this.fd(),this.na&&(this.na(this.Kc),this.na=null))},h.close=function(){this.Db||(this.f("Longpoll is being closed."),this.fd())},h.send=function(t){t=G(t),this.sb+=t.length,rc(this.Xa,"bytes_sent",t.length),t=yd(t=nb(t=Ob(t),!0),1840);for(var e=0;e<t.length;e++){var n=this.Wa;n.cd.push({Yg:this.mf,hh:t.length,of:t[e]}),n.oe&&th(n),this.mf++}},qh.prototype.close=function(){if(this.oe=!1,this.Ga){this.Ga.jb.body.innerHTML="";var t=this;setTimeout(function(){null!==t.Ga&&(document.body.removeChild(t.Ga),t.Ga=null)},Math.floor(0))}var e=this.lb;e&&(this.lb=null,e())};var vh=null,xh;function wh(t,e,n,i){this.ue=t,this.f=pd(this.ue),this.frames=this.Nc=null,this.rb=this.sb=this.ff=0,this.Xa=uc(e),t={v:"5"},"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),n&&(t.s=n),i&&(t.ls=i),this.jf=fd(e,gd,t)}function zh(t,e){if(t.frames.push(e),t.frames.length==t.ff){var n=t.frames.join("");t.frames=null,n=Rb(n),t.Lg(n)}}function yh(t){clearInterval(t.Nc),t.Nc=setInterval(function(){t.La&&Ah(t,"0"),yh(t)},Math.floor(45e3))}function Ah(t,e){try{t.La.send(e)}catch(n){t.f("Exception thrown from WebSocket.send():",n.message||n.data,"Closing connection."),setTimeout(u(t.bb,t),0)}}function Bh(t){Ch(this,t)}"undefined"!=typeof MozWebSocket?vh=MozWebSocket:"undefined"!=typeof WebSocket&&(vh=WebSocket),wh.prototype.open=function(t,e){this.lb=e,this.Lg=t,this.f("Websocket connecting to "+this.jf),this.Kc=!1,bd.set("previous_websocket_failure",!0);try{this.La=new vh(this.jf)}catch(r){this.f("Error instantiating WebSocket.");var n=r.message||r.data;return n&&this.f(n),void this.bb()}var i=this;this.La.onopen=function(){i.f("Websocket connected."),i.Kc=!0},this.La.onclose=function(){i.f("Websocket connection was disconnected."),i.La=null,i.bb()},this.La.onmessage=function(t){if(null!==i.La)if(t=t.data,i.rb+=t.length,rc(i.Xa,"bytes_received",t.length),yh(i),null!==i.frames)zh(i,t);else{t:{if(O(null===i.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e)){i.ff=e,i.frames=[],t=null;break t}}i.ff=1,i.frames=[]}null!==t&&zh(i,t)}},this.La.onerror=function(t){i.f("WebSocket error.  Closing connection."),(t=t.message||t.data)&&i.f(t),i.bb()}},wh.prototype.start=function(){},wh.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1<e.length&&parseFloat(e[1])<4.4&&(t=!0)}return!t&&null!==vh&&!xh},wh.responsesRequiredToBeHealthy=2,wh.healthyTimeout=3e4,h=wh.prototype,h.Hd=function(){bd.remove("previous_websocket_failure")},h.send=function(t){yh(this),t=G(t),this.sb+=t.length,rc(this.Xa,"bytes_sent",t.length),1<(t=yd(t,16384)).length&&Ah(this,String(t.length));for(var e=0;e<t.length;e++)Ah(this,t[e])},h.fd=function(){this.Db=!0,this.Nc&&(clearInterval(this.Nc),this.Nc=null),this.La&&(this.La.close(),this.La=null)},h.bb=function(){this.Db||(this.f("WebSocket is closing itself"),this.fd(),this.lb&&(this.lb(this.Kc),this.lb=null))},h.close=function(){this.Db||(this.f("WebSocket is being closed"),this.fd())};var Dh=[nh,wh];function Ch(t,e){var n=wh&&wh.isAvailable(),i=n&&!(bd.Af||!0===bd.get("previous_websocket_failure"));if(e.jh&&(n||S("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),i=!0),i)t.jd=[wh];else{var r=t.jd=[];zd(Dh,function(t,e){e&&e.isAvailable()&&r.push(e)})}}function Eh(t){if(0<t.jd.length)return t.jd[0];throw Error("No transports available")}function Fh(t,e,n,i,r,o,a){this.id=t,this.f=pd("c:"+this.id+":"),this.nc=n,this.Zc=i,this.na=r,this.Re=o,this.G=e,this.Pd=[],this.kf=0,this.Wf=new Bh(e),this.N=0,this.Fb=a,this.f("Connection created"),Gh(this)}function Gh(t){var e=Eh(t.Wf);t.K=new e("c:"+t.id+":"+t.kf++,t.G,void 0,t.Fb),t.Ve=e.responsesRequiredToBeHealthy||0;var n=Hh(t,t.K),i=Ih(t,t.K);t.kd=t.K,t.ed=t.K,t.F=null,t.Eb=!1,setTimeout(function(){t.K&&t.K.open(n,i)},Math.floor(0)),0<(e=e.healthyTimeout||0)&&(t.Bd=setTimeout(function(){t.Bd=null,t.Eb||(t.K&&102400<t.K.rb?(t.f("Connection exceeded healthy timeout but has received "+t.K.rb+" bytes.  Marking connection healthy."),t.Eb=!0,t.K.Hd()):t.K&&10240<t.K.sb?t.f("Connection exceeded healthy timeout but has sent "+t.K.sb+" bytes.  Leaving connection alive."):(t.f("Closing unhealthy connection after timeout."),t.close()))},Math.floor(e)))}function Ih(e,n){return function(t){n===e.K?(e.K=null,t||0!==e.N?1===e.N&&e.f("Realtime connection lost."):(e.f("Realtime connection failed."),"s-"===e.G.ab.substr(0,2)&&(bd.remove("host:"+e.G.host),e.G.ab=e.G.host)),e.close()):n===e.F?(e.f("Secondary connection lost."),t=e.F,e.F=null,e.kd!==t&&e.ed!==t||e.close()):e.f("closing an old connection")}}function Hh(r,o){return function(t){if(2!=r.N)if(o===r.ed){var e=wd("t",t);if(t=wd("d",t),"c"==e){if(e=wd("t",t),"d"in t)if(t=t.d,"h"===e){e=t.ts;var n=t.v,i=t.h;r.Uf=t.s,ed(r.G,i),0==r.N&&(r.K.start(),Jh(r,r.K,e),"5"!==n&&S("Protocol version mismatch detected"),(t=1<(t=r.Wf).jd.length?t.jd[1]:null)&&Kh(r,t))}else if("n"===e){for(r.f("recvd end transmission on primary"),r.ed=r.F,t=0;t<r.Pd.length;++t)r.Ld(r.Pd[t]);r.Pd=[],Lh(r)}else"s"===e?(r.f("Connection shutdown command received. Shutting down..."),r.Re&&(r.Re(t),r.Re=null),r.na=null,r.close()):"r"===e?(r.f("Reset packet received.  New host: "+t),ed(r.G,t),1===r.N?r.close():(Mh(r),Gh(r))):"e"===e?qd("Server Error: "+t):"o"===e?(r.f("got pong on primary."),Nh(r),Oh(r)):qd("Unknown control packet command: "+e)}else"d"==e&&r.Ld(t)}else if(o===r.F)if(e=wd("t",t),t=wd("d",t),"c"==e)"t"in t&&("a"===(t=t.t)?Ph(r):"r"===t?(r.f("Got a reset on secondary, closing it"),r.F.close(),r.kd!==r.F&&r.ed!==r.F||r.close()):"o"===t&&(r.f("got pong on secondary."),r.Tf--,Ph(r)));else{if("d"!=e)throw Error("Unknown protocol layer: "+e);r.Pd.push(t)}else r.f("message on old connection")}}function Lh(t){t.kd===t.F&&t.ed===t.F&&(t.f("cleaning up and promoting a connection: "+t.F.ue),t.K=t.F,t.F=null)}function Ph(t){t.Tf<=0?(t.f("Secondary connection is healthy."),t.Eb=!0,t.F.Hd(),t.F.start(),t.f("sending client ack on secondary"),t.F.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.K.send({t:"c",d:{t:"n",d:{}}}),t.kd=t.F,Lh(t)):(t.f("sending ping on secondary."),t.F.send({t:"c",d:{t:"p",d:{}}}))}function Nh(t){t.Eb||(t.Ve--,t.Ve<=0&&(t.f("Primary connection is healthy."),t.Eb=!0,t.K.Hd()))}function Kh(t,e){t.F=new e("c:"+t.id+":"+t.kf++,t.G,t.Uf),t.Tf=e.responsesRequiredToBeHealthy||0,t.F.open(Hh(t,t.F),Ih(t,t.F)),setTimeout(function(){t.F&&(t.f("Timed out trying to upgrade."),t.F.close())},Math.floor(6e4))}function Jh(t,e,n){t.f("Realtime connection established."),t.K=e,t.N=1,t.Zc&&(t.Zc(n,t.Uf),t.Zc=null),0===t.Ve?(t.f("Primary connection is healthy."),t.Eb=!0):setTimeout(function(){Oh(t)},Math.floor(5e3))}function Oh(t){t.Eb||1!==t.N||(t.f("sending ping on primary."),Qh(t,{t:"c",d:{t:"p",d:{}}}))}function Qh(t,e){if(1!==t.N)throw"Connection is not connected";t.kd.send(e)}function Mh(t){t.f("Shutting down all connections"),t.K&&(t.K.close(),t.K=null),t.F&&(t.F.close(),t.F=null),t.Bd&&(clearTimeout(t.Bd),t.Bd=null)}function Rh(t,e,n,i){this.id=Sh++,this.f=pd("p:"+this.id+":"),this.Bf=this.Ie=!1,this.ba={},this.sa=[],this.ad=0,this.Yc=[],this.qa=!1,this.eb=1e3,this.Id=3e5,this.Kb=e,this.Xc=n,this.Se=i,this.G=t,this.wb=this.Ca=this.Ma=this.Fb=this.$e=null,this.Sb=!1,this.Wd={},this.Xg=0,this.rf=!0,this.Oc=this.Ke=null,Th(this,0),kf.yb().Ib("visible",this.Og,this),-1===t.host.indexOf("fblocal")&&jf.yb().Ib("online",this.Mg,this)}Fh.prototype.Ia=function(t){Qh(this,{t:"d",d:t})},Fh.prototype.Ld=function(t){Nh(this),this.nc(t)},Fh.prototype.close=function(){2!==this.N&&(this.f("Closing realtime connection."),this.N=2,Mh(this),this.na&&(this.na(),this.na=null))};var Sh=0,Uh=0;function Vh(r,o){var a=o.Ug,s=a.path.toString(),h=a.wa();r.f("Listen on "+s+" for "+h);var t={p:s};o.tag&&(t.q=Ge(a.n),t.t=o.tag),t.h=o.Ad(),r.Ia("q",t,function(t){var e=t.d,n=t.s;if(e&&"object"==typeof e&&y(e,"w")){var i=z(e,"w");da(i)&&0<=La(i,"no_index")&&S('Using an unspecified index. Consider adding ".indexOn": "'+a.n.g.toString()+'" at '+a.path.toString()+" to your security rules for better performance")}(r.ba[s]&&r.ba[s][h])===o&&(r.f("listen response",t),"ok"!==n&&Wh(r,s,h),o.I&&o.I(n,e))})}function Xh(n){var i=n.Ca;n.qa&&i&&n.Ia("auth",{cred:i.rg},function(t){var e=t.s;t=t.d||"error","ok"!==e&&n.Ca===i&&(n.Ca=null),i.sf?"ok"!==e&&i.od&&i.od(e,t):(i.sf=!0,i.Dc&&i.Dc(e,t))})}function Yh(t,e,n,i,r){n={p:n,d:i},t.f("onDisconnect "+e,n),t.Ia(e,n,function(t){r&&setTimeout(function(){r(t.s,t.d)},Math.floor(0))})}function Zh(t,e,n,i,r,o){i={p:n,d:i},p(o)&&(i.h=o),t.sa.push({action:e,Pf:i,I:r}),t.ad++,e=t.sa.length-1,t.qa?$h(t,e):t.f("Buffering put: "+n)}function $h(e,n){var i=e.sa[n].action,t=e.sa[n].Pf,r=e.sa[n].I;e.sa[n].Vg=e.qa,e.Ia(i,t,function(t){e.f(i+" response",t),delete e.sa[n],e.ad--,0===e.ad&&(e.sa=[]),r&&r(t.s,t.d)})}function Th(t,e){O(!t.Ma,"Scheduling a connect when we're already connected/ing?"),t.wb&&clearTimeout(t.wb),t.wb=setTimeout(function(){t.wb=null,ci(t)},Math.floor(e))}function ci(e){if(di(e)){e.f("Making a connection attempt"),e.Ke=(new Date).getTime(),e.Oc=null;var t=u(e.Ld,e),n=u(e.Zc,e),i=u(e.If,e),r=e.id+":"+Uh++;e.Ma=new Fh(r,e.G,t,n,i,function(t){S(t+" ("+e.G.toString()+")"),e.Bf=!0},e.Fb)}}function ai(t,e,n){(t=Wh(t,e,n=n?Oa(n,function(t){return xd(t)}).join("$"):"default"))&&t.I&&t.I("permission_denied")}function Wh(t,e,n){var i;return e=new P(e).toString(),p(t.ba[e])?(i=t.ba[e][n],delete t.ba[e][n],0===oa(t.ba[e])&&delete t.ba[e]):i=void 0,i}function bi(e){Xh(e),v(e.ba,function(t){v(t,function(t){Vh(e,t)})});for(var t=0;t<e.sa.length;t++)e.sa[t]&&$h(e,t);for(;e.Yc.length;)t=e.Yc.shift(),Yh(e,t.action,t.bd,t.data,t.I)}function di(t){var e;return e=jf.yb().oc,!t.Bf&&!t.Ie&&e}h=Rh.prototype,h.Ia=function(t,e,n){var i=++this.Xg;t={r:i,a:t,b:e},this.f(G(t)),O(this.qa,"sendRequest call when we're not connected not allowed."),this.Ma.Ia(t),n&&(this.Wd[i]=n)},h.Cf=function(t,e,n,i){var r=t.wa(),o=t.path.toString();this.f("Listen called for "+o+" "+r),this.ba[o]=this.ba[o]||{},O(Ie(t.n)||!He(t.n),"listen() called for non-default but complete query"),O(!this.ba[o][r],"listen() called twice for same path/queryId."),t={I:i,Ad:e,Ug:t,tag:n},this.ba[o][r]=t,this.qa&&Vh(this,t)},h.O=function(t,e,n){this.Ca={rg:t,sf:!1,Dc:e,od:n},this.f("Authenticating using credential: "+t),Xh(this),(e=40==t.length)||(e="object"==typeof(t=Cd(t).Ec)&&!0===z(t,"admin")),e&&(this.f("Admin auth credential detected.  Reducing max reconnect time."),this.Id=3e4)},h.je=function(e){this.Ca=null,this.qa&&this.Ia("unauth",{},function(t){e(t.s,t.d)})},h.$f=function(t,e){var n=t.path.toString(),i=t.wa();if(this.f("Unlisten called for "+n+" "+i),O(Ie(t.n)||!He(t.n),"unlisten() called for non-default but complete query"),Wh(this,n,i)&&this.qa){var r=Ge(t.n);this.f("Unlisten on "+n+" for "+i),n={p:n},e&&(n.q=r,n.t=e),this.Ia("n",n)}},h.Qe=function(t,e,n){this.qa?Yh(this,"o",t,e,n):this.Yc.push({bd:t,action:"o",data:e,I:n})},h.Gf=function(t,e,n){this.qa?Yh(this,"om",t,e,n):this.Yc.push({bd:t,action:"om",data:e,I:n})},h.Md=function(t,e){this.qa?Yh(this,"oc",t,null,e):this.Yc.push({bd:t,action:"oc",data:null,I:e})},h.put=function(t,e,n,i){Zh(this,"p",t,e,n,i)},h.Df=function(t,e,n,i){Zh(this,"m",t,e,n,i)},h.Ye=function(t){this.qa&&(t={c:t},this.f("reportStats",t),this.Ia("s",t,function(t){"ok"!==t.s&&this.f("reportStats","Error sending stats: "+t.d)}))},h.Ld=function(t){if("r"in t){this.f("from server: "+G(t));var e=t.r,n=this.Wd[e];n&&(delete this.Wd[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&(e=t.a,n=t.b,this.f("handleServerMessage",e,n),"d"===e?this.Kb(n.p,n.d,!1,n.t):"m"===e?this.Kb(n.p,n.d,!0,n.t):"c"===e?ai(this,n.p,n.q):"ac"===e?(t=n.s,e=n.d,n=this.Ca,this.Ca=null,n&&n.od&&n.od(t,e)):"sd"===e?this.$e?this.$e(n):"msg"in n&&"undefined"!=typeof console&&console.log("FIREBASE: "+n.msg.replace("\n","\nFIREBASE: ")):qd("Unrecognized action received from server: "+G(e)+"\nAre you using the latest client?"))}},h.Zc=function(t,e){if(this.f("connection ready"),this.qa=!0,this.Oc=(new Date).getTime(),this.Se({serverTimeOffset:t-(new Date).getTime()}),this.Fb=e,this.rf){var n={};n["sdk.js."+Eb.replace(/\./g,"-")]=1,Dg()?n["framework.cordova"]=1:"object"==typeof navigator&&"ReactNative"===navigator.product&&(n["framework.reactnative"]=1),this.Ye(n)}bi(this),this.rf=!1,this.Xc(!0)},h.Og=function(t){t&&!this.Sb&&this.eb===this.Id&&(this.f("Window became visible.  Reducing delay."),this.eb=1e3,this.Ma||Th(this,0)),this.Sb=t},h.Mg=function(t){t?(this.f("Browser went online."),this.eb=1e3,this.Ma||Th(this,0)):(this.f("Browser went offline.  Killing connection."),this.Ma&&this.Ma.close())},h.If=function(){this.f("data client disconnected"),this.qa=!1,this.Ma=null;for(var t=0;t<this.sa.length;t++){var e=this.sa[t];e&&"h"in e.Pf&&e.Vg&&(e.I&&e.I("disconnect"),delete this.sa[t],this.ad--)}0===this.ad&&(this.sa=[]),this.Wd={},di(this)&&(this.Sb?this.Oc&&(3e4<(new Date).getTime()-this.Oc&&(this.eb=1e3),this.Oc=null):(this.f("Window isn't visible.  Delaying reconnect."),this.eb=this.Id,this.Ke=(new Date).getTime()),t=Math.max(0,this.eb-((new Date).getTime()-this.Ke)),t*=Math.random(),this.f("Trying to reconnect in "+t+"ms"),Th(this,t),this.eb=Math.min(this.Id,1.3*this.eb)),this.Xc(!1)},h.Cb=function(){this.Ie=!0,this.Ma?this.Ma.close():(this.wb&&(clearTimeout(this.wb),this.wb=null),this.qa&&this.If())},h.vc=function(){this.Ie=!1,this.eb=1e3,this.Ma||Th(this,0)};var U={zg:function(){oh=xh=!0}};function ei(t,e){this.committed=t,this.snapshot=e}function V(t,e){this.dd=t,this.ta=e}function W(t,e,n){this.A=t,this.Y=e,this.g=n}function ii(t,e,n){this.Vb=t,this.tb=e,this.vb=n||null}function ji(t,e,n){this.ja=t,this.tb=e,this.vb=n}function ki(){this.za={}}function mi(t){return Na(qa(t.za),function(t){return!He(t.Y.n)})}function ni(t,e){if(He(e.n))return li(t);var n=e.wa();return z(t.za,n)}function li(t){return ua(t.za,function(t){return He(t.Y.n)})||null}function oi(t){this.va=qe,this.mb=new Pf,this.df={},this.qc={},this.Qc=t}function pi(t,e,n,i,r){var o=t.mb,a=r;return O(i>o.Pc,"Stacking an older write on top of newer ones"),p(a)||(a=!0),o.pa.push({path:e,Ja:n,md:i,visible:a}),a&&(o.V=Jf(o.V,e,n)),o.Pc=i,r?qi(t,new Ac(Ef,e,n)):[]}function ri(t,e,n,i){var r=t.mb;return O(i>r.Pc,"Stacking an older merge on top of newer ones"),r.pa.push({path:e,children:n,md:i,visible:!0}),r.V=Kf(r.V,e,n),r.Pc=i,n=sf(n),qi(t,new bf(Ef,e,n))}function si(t,e,n){n=n||!1;var i=Qf(t.mb,e);if(t.mb.Ud(e)){var r=qe;return null!=i.Ja?r=r.set(M,!0):Fb(i.children,function(t,e){r=r.set(new P(t),e)}),qi(t,new Df(i.path,r,n))}return[]}function ti(t,e,n){return n=sf(n),qi(t,new bf(Gf,e,n))}function ui(t,e,n,i){if(null==(i=vi(t,i)))return[];var r=wi(i);return i=r.path,r=r.Lb,e=lf(i,e),xi(t,i,n=new Ac(new Ff(!1,!0,r,!0),e,n))}function yi(t,e,n,i){if(i=vi(t,i)){var r=wi(i);return i=r.path,r=r.Lb,e=lf(i,e),n=sf(n),xi(t,i,n=new bf(new Ff(!1,!0,r,!0),e,n))}return[]}function Ci(t){return vf(t,function(t,e,n){if(e&&null!=li(e))return[li(e)];var i=[];return e&&(i=mi(e)),v(n,function(t){i=i.concat(t)}),i})}function Gi(t,e){for(var n=0;n<e.length;++n){if(!He((i=e[n]).n)){var i=zi(i),r=t.qc[i];delete t.qc[i],delete t.df["_"+r]}}}function Ei(t){return He(t.n)&&!Ie(t.n)?t.Mb():t}function Bi(t,e,n){var i=e.path,r=Fi(t,e);if(n=Di(t,n),e=t.Qc.af(Ei(e),r,n.Ad,n.I),i=t.va.subtree(i),r)O(null==li(i.value),"If we're adding a query, it shouldn't be shadowed");else for(r=vf(i,function(t,e,n){if(!t.e()&&e&&null!=li(e))return[Ze(li(e))];var i=[];return e&&(i=i.concat(Oa(mi(e),function(t){return t.Y}))),v(n,function(t){i=i.concat(t)}),i}),i=0;i<r.length;++i)n=r[i],t.Qc.de(Ei(n),Fi(t,n));return e}function Di(i,t){var r=t.Y,o=Fi(i,r);return{Ad:function(){return(t.w()||H).hash()},I:function(t){if("ok"!==t)return e="Unknown Error","too_big"===t?e="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==t?e="Client doesn't have permission to access the desired data.":"unavailable"==t&&(e="The service is unavailable"),(e=Error(t+" at "+r.path.toString()+": "+e)).code=t.toUpperCase(),i.nb(r,null,e);if(o){var e=r.path;if(t=vi(i,o)){var n=wi(t);t=n.path,n=n.Lb,e=lf(t,e),e=new Cc(new Ff(!1,!0,n,!0),e),t=xi(i,t,e)}else t=[]}else t=qi(i,new Cc(Gf,r.path));return t}}}function zi(t){return t.path.toString()+"$"+t.wa()}function wi(t){var e=t.indexOf("$");return O(-1!==e&&e<t.length-1,"Bad queryKey."),{Lb:t.substr(e+1),path:new P(t.substr(0,e))}}function vi(t,e){var n=t.df,i="_"+e;return i in n?n[i]:void 0}function Fi(t,e){var n=zi(e);return z(t.qc,n)}U.forceLongPolling=U.zg,U.Ag=function(){ph=!0},U.forceWebSockets=U.Ag,U.Eg=function(){return wh.isAvailable()},U.isWebSocketsAvailable=U.Eg,U.ah=function(t,e){t.k.Va.$e=e},U.setSecurityDebugCallback=U.ah,U.bf=function(t,e){t.k.bf(e)},U.stats=U.bf,U.cf=function(t,e){t.k.cf(e)},U.statsIncrementCounter=U.cf,U.ud=function(t){return t.k.ud},U.dataUpdateCount=U.ud,U.Dg=function(t,e){t.k.He=e},U.interceptServerData=U.Dg,U.Kg=function(t){new Og(t)},U.onPopupOpen=U.Kg,U.Zg=function(t){xg=t},U.setAuthenticationServer=U.Zg,V.prototype.cancel=function(t){D("Firebase.onDisconnect().cancel",0,1,arguments.length),F("Firebase.onDisconnect().cancel",1,t,!0);var e=new B;return this.dd.Md(this.ta,C(e,t)),e.D},V.prototype.cancel=V.prototype.cancel,V.prototype.remove=function(t){D("Firebase.onDisconnect().remove",0,1,arguments.length),og("Firebase.onDisconnect().remove",this.ta),F("Firebase.onDisconnect().remove",1,t,!0);var e=new B;return fi(this.dd,this.ta,null,C(e,t)),e.D},V.prototype.remove=V.prototype.remove,V.prototype.set=function(t,e){D("Firebase.onDisconnect().set",1,2,arguments.length),og("Firebase.onDisconnect().set",this.ta),gg("Firebase.onDisconnect().set",t,this.ta,!1),F("Firebase.onDisconnect().set",2,e,!0);var n=new B;return fi(this.dd,this.ta,t,C(n,e)),n.D},V.prototype.set=V.prototype.set,V.prototype.Ob=function(t,e,n){D("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),og("Firebase.onDisconnect().setWithPriority",this.ta),gg("Firebase.onDisconnect().setWithPriority",t,this.ta,!1),kg("Firebase.onDisconnect().setWithPriority",2,e),F("Firebase.onDisconnect().setWithPriority",3,n,!0);var i=new B;return gi(this.dd,this.ta,t,e,C(i,n)),i.D},V.prototype.setWithPriority=V.prototype.Ob,V.prototype.update=function(t,e){if(D("Firebase.onDisconnect().update",1,2,arguments.length),og("Firebase.onDisconnect().update",this.ta),da(t)){for(var n={},i=0;i<t.length;++i)n[""+i]=t[i];t=n,S("Passing an Array to Firebase.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}return jg("Firebase.onDisconnect().update",t,this.ta),F("Firebase.onDisconnect().update",2,e,!0),n=new B,hi(this.dd,this.ta,t,C(n,e)),n.D},V.prototype.update=V.prototype.update,W.prototype.J=function(){return D("Firebase.DataSnapshot.val",0,0,arguments.length),this.A.J()},W.prototype.val=W.prototype.J,W.prototype.qf=function(){return D("Firebase.DataSnapshot.exportVal",0,0,arguments.length),this.A.J(!0)},W.prototype.exportVal=W.prototype.qf,W.prototype.xg=function(){return D("Firebase.DataSnapshot.exists",0,0,arguments.length),!this.A.e()},W.prototype.exists=W.prototype.xg,W.prototype.o=function(t){D("Firebase.DataSnapshot.child",0,1,arguments.length),fa(t)&&(t=String(t)),ng("Firebase.DataSnapshot.child",t);var e=new P(t),n=this.Y.o(e);return new W(this.A.S(e),n,R)},W.prototype.child=W.prototype.o,W.prototype.Fa=function(t){D("Firebase.DataSnapshot.hasChild",1,1,arguments.length),ng("Firebase.DataSnapshot.hasChild",t);var e=new P(t);return!this.A.S(e).e()},W.prototype.hasChild=W.prototype.Fa,W.prototype.C=function(){return D("Firebase.DataSnapshot.getPriority",0,0,arguments.length),this.A.C().J()},W.prototype.getPriority=W.prototype.C,W.prototype.forEach=function(n){if(D("Firebase.DataSnapshot.forEach",1,1,arguments.length),F("Firebase.DataSnapshot.forEach",1,n,!1),this.A.L())return!1;var i=this;return!!this.A.R(this.g,function(t,e){return n(new W(e,i.Y.o(t),R))})},W.prototype.forEach=W.prototype.forEach,W.prototype.zd=function(){return D("Firebase.DataSnapshot.hasChildren",0,0,arguments.length),!this.A.L()&&!this.A.e()},W.prototype.hasChildren=W.prototype.zd,W.prototype.name=function(){return S("Firebase.DataSnapshot.name() being deprecated. Please use Firebase.DataSnapshot.key() instead."),D("Firebase.DataSnapshot.name",0,0,arguments.length),this.key()},W.prototype.name=W.prototype.name,W.prototype.key=function(){return D("Firebase.DataSnapshot.key",0,0,arguments.length),this.Y.key()},W.prototype.key=W.prototype.key,W.prototype.Hb=function(){return D("Firebase.DataSnapshot.numChildren",0,0,arguments.length),this.A.Hb()},W.prototype.numChildren=W.prototype.Hb,W.prototype.Mb=function(){return D("Firebase.DataSnapshot.ref",0,0,arguments.length),this.Y},W.prototype.ref=W.prototype.Mb,h=ii.prototype,h.Qf=function(t){return"value"===t},h.createEvent=function(t,e){var n=e.n.g;return new jc("value",this,new W(t.Na,e.Mb(),n))},h.Zb=function(t){var e=this.vb;if("cancel"===t.De()){O(this.tb,"Raising a cancel event on a listener with no cancel callback");var n=this.tb;return function(){n.call(e,t.error)}}var i=this.Vb;return function(){i.call(e,t.be)}},h.lf=function(t,e){return this.tb?new kc(this,t,e):null},h.matches=function(t){return t instanceof ii&&(!t.Vb||!this.Vb||t.Vb===this.Vb&&t.vb===this.vb)},h.yf=function(){return null!==this.Vb},h=ji.prototype,h.Qf=function(t){return("children_removed"===(t="children_added"===t?"child_added":t)?"child_removed":t)in this.ja},h.lf=function(t,e){return this.tb?new kc(this,t,e):null},h.createEvent=function(t,e){O(null!=t.Za,"Child events should have a childName.");var n=e.Mb().o(t.Za);return new jc(t.type,this,new W(t.Na,n,e.n.g),t.Td)},h.Zb=function(t){var e=this.vb;if("cancel"===t.De()){O(this.tb,"Raising a cancel event on a listener with no cancel callback");var n=this.tb;return function(){n.call(e,t.error)}}var i=this.ja[t.wd];return function(){i.call(e,t.be,t.Td)}},h.matches=function(n){if(n instanceof ji){if(!this.ja||!n.ja)return!0;if(this.vb===n.vb)if((t=oa(n.ja))===oa(this.ja)){if(1!==t)return na(this.ja,function(t,e){return n.ja[e]===t});var t=pa(n.ja),e=pa(this.ja);return!(e!==t||n.ja[t]&&this.ja[e]&&n.ja[t]!==this.ja[e])}}return!1},h.yf=function(){return null!==this.ja},h=ki.prototype,h.e=function(){return va(this.za)},h.gb=function(e,n,i){var t=e.source.Lb;if(null!==t)return t=z(this.za,t),O(null!=t,"SyncTree gave us an op for an invalid query."),t.gb(e,n,i);var r=[];return v(this.za,function(t){r=r.concat(t.gb(e,n,i))}),r},h.Tb=function(t,e,n,i,r){var o=t.wa();if(!(a=z(this.za,o))){var a,s=!1;s=!!(a=n.Aa(r?i:null))||(a=i instanceof fe?n.Cc(i):H,!1),a=new Ye(t,new je(new Xb(a,s,!1),new Xb(i,r,!1))),this.za[o]=a}return a.Tb(e),af(a,e)},h.nb=function(t,n,i){var e=t.wa(),r=[],o=[],a=null!=li(this);if("default"===e){var s=this;v(this.za,function(t,e){o=o.concat(t.nb(n,i)),t.e()&&(delete s.za[e],He(t.Y.n)||r.push(t.Y))})}else{var h=z(this.za,e);h&&(o=o.concat(h.nb(n,i)),h.e()&&(delete this.za[e],He(h.Y.n)||r.push(h.Y)))}return a&&null==li(this)&&r.push(new X(t.k,t.path)),{Wg:r,vg:o}},h.kb=function(e){var n=null;return v(this.za,function(t){n=n||t.kb(e)}),n},oi.prototype.Tb=function(t,e){var i=t.path,r=null,o=!1;zf(this.va,i,function(t,e){var n=lf(t,i);r=r||e.kb(n),o=o||null!=li(e)});var n,a=this.va.get(i);a?(o=o||null!=li(a),r=r||a.kb(M)):(a=new ki,this.va=this.va.set(i,a)),null!=r?n=!0:(n=!1,r=H,Cf(this.va.subtree(i),function(t,e){var n=e.kb(M);n&&(r=r.W(t,n))}));var s=null!=ni(a,t);if(!s&&!He(t.n)){var h=zi(t);O(!(h in this.qc),"View does not exist, but we have a tag");var u=Ai++;this.qc[h]=u,this.df["_"+u]=h}return n=a.Tb(t,e,new Uf(i,this.mb),r,n),s||o||(a=ni(a,t),n=n.concat(Bi(this,t,a))),n},oi.prototype.nb=function(t,e,n){var i=t.path,r=this.va.get(i),o=[];if(r&&("default"===t.wa()||null!=ni(r,t))){o=r.nb(t,e,n),r.e()&&(this.va=this.va.remove(i)),r=o.Wg,o=o.vg,e=-1!==Sa(r,function(t){return He(t.n)});var a=xf(this.va,i,function(t,e){return null!=li(e)});if(e&&!a&&!(i=this.va.subtree(i)).e()){i=Ci(i);for(var s=0;s<i.length;++s){var h=(u=i[s]).Y,u=Di(this,u);this.Qc.af(Ei(h),Fi(this,h),u.Ad,u.I)}}if(!a&&0<r.length&&!n)if(e)this.Qc.de(Ei(t),null);else{var c=this;Ma(r,function(t){t.wa();var e=c.qc[zi(t)];c.Qc.de(Ei(t),e)})}Gi(this,r)}return o},oi.prototype.Aa=function(i,t){var e=this.mb,n=xf(this.va,i,function(t,e){var n=lf(t,i);if(n=e.kb(n))return n});return e.Aa(i,n,t,!0)};var Ai=1;function xi(t,e,n){var i=t.va.get(e);return O(i,"Missing sync point for query tag that we're tracking"),i.gb(n,new Uf(e,t.mb),null)}function qi(t,e){return Hi(t,e,t.va,null,new Uf(M,t.mb))}function Hi(t,e,n,i,r){if(e.path.e())return Ii(t,e,n,i,r);var o=n.get(M);null==i&&null!=o&&(i=o.kb(M));var a=[],s=K(e.path),h=e.$c(s);if((n=n.children.get(s))&&h){var u=i?i.T(s):null;s=r.o(s),a=a.concat(Hi(t,h,n,u,s))}return o&&(a=a.concat(o.gb(e,r,i))),a}function Ii(o,a,t,s,h){var e=t.get(M);null==s&&null!=e&&(s=e.kb(M));var u=[];return t.children.ka(function(t,e){var n=s?s.T(t):null,i=h.o(t),r=a.$c(t);r&&(u=u.concat(Ii(o,r,e,n,i)))}),e&&(u=u.concat(e.gb(a,h,s))),u}function Ji(t,e){this.G=t,this.Xa=uc(t),this.hd=null,this.fa=new Zb,this.Kd=1,this.Va=null,e||0<=("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)?(this.da=new cf(this.G,u(this.Kb,this)),setTimeout(u(this.Xc,this,!0),0)):this.da=this.Va=new Rh(this.G,u(this.Kb,this),u(this.Xc,this),u(this.Se,this)),this.eh=vc(t,u(function(){return new pc(this.Xa,this.da)},this)),this.yc=new Wf,this.Ge=new Sb;var o=this;this.Fd=new oi({af:function(t,e,n,i){return e=[],(n=o.Ge.j(t.path)).e()||(e=qi(o.Fd,new Ac(Gf,t.path,n)),setTimeout(function(){i("ok")},0)),e},de:aa}),Ki(this,"connected",!1),this.na=new Vc,this.O=new Yg(t,u(this.da.O,this.da),u(this.da.je,this.da),u(this.Pe,this)),this.ud=0,this.He=null,this.M=new oi({af:function(i,t,e,r){return o.da.Cf(i,e,t,function(t,e){var n=r(t,e);dc(o.fa,i.path,n)}),[]},de:function(t,e){o.da.$f(t,e)}})}function Li(t){return t=t.Ge.j(new P(".info/serverTimeOffset")).J()||0,(new Date).getTime()+t}function Mi(t){return(t=t={timestamp:Li(t)}).timestamp=t.timestamp||(new Date).getTime(),t}function Ki(t,e,n){e=new P("/.info/"+e),n=Q(n);var i=t.Ge;i.Zd=i.Zd.H(e,n),n=qi(t.Fd,new Ac(Gf,e,n)),dc(t.fa,e,n)}function Oi(i){i.f("onDisconnectEvents");var t=Mi(i),r=[];Wc(Uc(i.na,t),M,function(t,e){r=r.concat(qi(i.M,new Ac(Gf,t,e)));var n=Qi(i,t);Ni(i,n)}),i.na=new Vc,dc(i.fa,M,r)}function fi(n,i,t,r){var o=Q(t);n.da.Qe(i.toString(),o.J(!0),function(t,e){"ok"===t&&n.na.rc(i,o),Pi(r,t,e)})}function gi(n,i,t,e,r){var o=Q(t,e);n.da.Qe(i.toString(),o.J(!0),function(t,e){"ok"===t&&n.na.rc(i,o),Pi(r,t,e)})}function hi(r,o,a,s){var t,e=!0;for(t in a)e=!1;e?(fc("onDisconnect().update() called with empty data.  Don't do anything."),Pi(s,"ok")):r.da.Gf(o.toString(),a,function(t,e){if("ok"===t)for(var n in a){var i=Q(a[n]);r.na.rc(o.o(n),i)}Pi(s,t,e)})}function Ri(t,e,n){n=".info"===K(e.path)?t.Fd.Tb(e,n):t.M.Tb(e,n),bc(t.fa,e.path,n)}function Pi(n,i,r){n&&gc(function(){if("ok"==i)n(null);else{var t=(i||"error").toUpperCase(),e=t;r&&(e+=": "+r),(e=Error(e)).code=t,n(e)}})}function Si(t,e,n,i,r){function o(){}t.f("transaction on "+e);var a=new X(t,e);if(a.Ib("value",o),n={path:e,update:n,I:i,status:null,Lf:id(),gf:r,Sf:0,le:function(){a.mc("value",o)},ne:null,Da:null,rd:null,sd:null,td:null},i=t.M.Aa(e,void 0)||H,n.rd=i,p(i=n.update(i.J()))){hg("transaction failed: Data returned ",i,n.path),n.status=1;var s=(r=Xf(t.yc,e)).Ea()||[];s.push(n),Yf(r,s),"object"==typeof i&&null!==i&&y(i,".priority")?(s=z(i,".priority"),O(fg(s),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.")):s=(t.M.Aa(e)||H).C().J(),r=Mi(t),r=Xc(i=Q(i,s),r),n.sd=i,n.td=r,n.Da=t.Kd++,n=pi(t.M,e,r,n.Da,n.gf),dc(t.fa,e,n),Ti(t)}else n.le(),n.sd=null,n.td=null,n.I&&(t=new W(n.rd,new X(t,n.path),R),n.I(null,!1,t))}function Ti(e,t){var n=t||e.yc;if(t||Ui(e,n),null!==n.Ea()){var i=Vi(e,n);O(0<i.length,"Sending zero length transaction queue"),Qa(i,function(t){return 1===t.status})&&Wi(e,n.path(),i)}else n.zd()&&n.R(function(t){Ti(e,t)})}function Wi(r,o,a){for(var t=Oa(a,function(t){return t.Da}),e=(t=e=r.M.Aa(o,t)||H,e.hash()),s=0;s<a.length;s++){var n=a[s];O(1===n.status,"tryToSendTransactionQueue_: items in queue should all be run."),n.status=2,n.Sf++;var i=lf(o,n.path);t=t.H(i,n.sd)}t=t.J(!0),r.da.put(o.toString(),t,function(t){r.f("transaction put response",{path:o.toString(),status:t});var e=[];if("ok"===t){for(t=[],s=0;s<a.length;s++){if(a[s].status=3,e=e.concat(si(r.M,a[s].Da)),a[s].I){var n=a[s].td,i=new X(r,a[s].path);t.push(u(a[s].I,null,null,!0,new W(n,i,R)))}a[s].le()}for(Ui(r,Xf(r.yc,o)),Ti(r),dc(r.fa,o,e),s=0;s<t.length;s++)gc(t[s])}else{if("datastale"===t)for(s=0;s<a.length;s++)a[s].status=4===a[s].status?5:1;else for(S("transaction at "+o.toString()+" failed: "+t),s=0;s<a.length;s++)a[s].status=5,a[s].ne=t;Ni(r,o)}},e)}function Ni(t,e){var n,i=(n=Xi(t,e)).path();return Yi(t,n=Vi(t,n),i),i}function Yi(t,e,n){if(0!==e.length){for(var i=[],r=[],o=Na(e,function(t){return 1===t.status}),a=(o=Oa(o,function(t){return t.Da}),0);a<e.length;a++){var s,h=e[a],c=lf(n,h.path),f=!1;if(O(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),5===h.status)f=!0,s=h.ne,r=r.concat(si(t.M,h.Da,!0));else if(1===h.status)if(25<=h.Sf)f=!0,s="maxretry",r=r.concat(si(t.M,h.Da,!0));else{var l=t.M.Aa(h.path,o)||H;h.rd=l;var d=e[a].update(l.J());r=p(d)?(hg("transaction failed: Data returned ",d,h.path),c=Q(d),"object"==typeof d&&null!=d&&y(d,".priority")||(c=c.ia(l.C())),l=h.Da,d=Xc(c,d=Mi(t)),h.sd=c,h.td=d,h.Da=t.Kd++,Ta(o,l),(r=r.concat(pi(t.M,h.path,d,h.Da,h.gf))).concat(si(t.M,l,!0))):(f=!0,s="nodata",r.concat(si(t.M,h.Da,!0)))}dc(t.fa,n,r),r=[],f&&(e[a].status=3,setTimeout(e[a].le,Math.floor(0)),e[a].I&&("nodata"===s?(h=new X(t,e[a].path),i.push(u(e[a].I,null,null,!1,new W(e[a].rd,h,R)))):i.push(u(e[a].I,null,Error(s),!1,null))))}for(Ui(t,t.yc),a=0;a<i.length;a++)gc(i[a]);Ti(t)}}function Xi(t,e){for(var n,i=t.yc;null!==(n=K(e))&&null===i.Ea();)i=Xf(i,n),e=N(e);return i}function Vi(t,e){var n=[];return Zi(t,e,n),n.sort(function(t,e){return t.Lf-e.Lf}),n}function Zi(e,t,n){var i=t.Ea();if(null!==i)for(var r=0;r<i.length;r++)n.push(i[r]);t.R(function(t){Zi(e,t,n)})}function Ui(e,t){var n=t.Ea();if(n){for(var i=0,r=0;r<n.length;r++)3!==n[r].status&&(n[i]=n[r],i++);n.length=i,Yf(t,0<n.length?n:null)}t.R(function(t){Ui(e,t)})}function Qi(e,t){var n=Xi(e,t).path(),i=Xf(e.yc,t);return ag(i,function(t){$i(e,t)}),$i(e,i),$f(i,function(t){$i(e,t)}),n}function $i(t,e){var n=e.Ea();if(null!==n){for(var i=[],r=[],o=-1,a=0;a<n.length;a++)4!==n[a].status&&(2===n[a].status?(O(o===a-1,"All SENT items should be at beginning of queue."),n[o=a].status=4,n[a].ne="set"):(O(1===n[a].status,"Unexpected transaction status in abort"),n[a].le(),r=r.concat(si(t.M,n[a].Da,!0)),n[a].I&&i.push(u(n[a].I,null,Error("set"),!1,null))));for(-1===o?Yf(e,null):n.length=o+1,dc(t.fa,e.path(),r),a=0;a<i.length;a++)gc(i[a])}}function aj(){this.sc={},this.ag=!1}function Y(t,e,n,i){this.k=t,this.path=e,this.n=n,this.pc=i}function bj(t){var e=null,n=null;if(t.oa&&(e=Od(t)),t.ra&&(n=Rd(t)),t.g===re){if(t.oa){if("[MIN_NAME]"!=Nd(t))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if("string"!=typeof e)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.")}if(t.ra){if("[MAX_NAME]"!=Pd(t))throw Error("Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().");if("string"!=typeof n)throw Error("Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.")}}else if(t.g===R){if(null!=e&&!fg(e)||null!=n&&!fg(n))throw Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(O(t.g instanceof ve||t.g===Be,"unknown index type."),null!=e&&"object"==typeof e||null!=n&&"object"==typeof n)throw Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")}function cj(t){if(t.oa&&t.ra&&t.la&&(!t.la||""===t.Rb))throw Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")}function dj(t,e){if(!0===t.pc)throw Error(e+": You can't combine multiple orderBy calls.")}function ej(t,e,n){var i={cancel:null,Qa:null};if(e&&n)i.cancel=e,F(t,3,i.cancel,!0),i.Qa=n,Qb(t,4,i.Qa);else if(e)if("object"==typeof e&&null!==e)i.Qa=e;else{if("function"!=typeof e)throw Error(E(t,3,!0)+" must either be a cancel callback or a context object.");i.cancel=e}return i}h=Ji.prototype,h.toString=function(){return(this.G.ob?"https://":"http://")+this.G.host},h.name=function(){return this.G.lc},h.Kb=function(t,e,n,i){this.ud++;var r=new P(t);e=this.He?this.He(t,e):e,t=[],t=i?n?(e=ma(e,function(t){return Q(t)}),yi(this.M,r,e,i)):(e=Q(e),ui(this.M,r,e,i)):n?(i=ma(e,function(t){return Q(t)}),ti(this.M,r,i)):(i=Q(e),qi(this.M,new Ac(Gf,r,i))),i=r,0<t.length&&(i=Ni(this,r)),dc(this.fa,i,t)},h.Xc=function(t){Ki(this,"connected",t),!1===t&&Oi(this)},h.Se=function(t){var n=this;zd(t,function(t,e){Ki(n,e,t)})},h.Pe=function(t){Ki(this,"authenticated",t)},h.Ob=function(i,t,e,r){this.f("set",{path:i.toString(),value:t,nh:e});var n=Mi(this),o=(n=Xc(t=Q(t,e),n),this.Kd++);n=pi(this.M,i,n,o,!0);$b(this.fa,n);var a=this;this.da.put(i.toString(),t.J(!0),function(t,e){var n="ok"===t;n||S("set at "+i+" failed: "+t),n=si(a.M,o,!n),dc(a.fa,i,n),Pi(r,t,e)}),Ni(this,n=Qi(this,i)),dc(this.fa,n,[])},h.update=function(r,t,o){this.f("update",{path:r.toString(),value:t});var i=!0,a=Mi(this),s={};if(v(t,function(t,e){i=!1;var n=Q(t);s[e]=Xc(n,a)}),i)fc("update() called with empty data.  Don't do anything."),Pi(o,"ok");else{var h=this.Kd++,e=ri(this.M,r,s,h);$b(this.fa,e);var u=this;this.da.Df(r.toString(),t,function(t,e){(n="ok"===t)||S("update at "+r+" failed: "+t);var n=si(u.M,h,!n),i=r;0<n.length&&(i=Ni(u,r)),dc(u.fa,i,n),Pi(o,t,e)}),Ni(this,t=Qi(this,r)),dc(this.fa,r,[])}},h.Md=function(n,i){var r=this;this.da.Md(n.toString(),function(t,e){"ok"===t&&wg(r.na,n),Pi(i,t,e)})},h.Cb=function(){this.Va&&this.Va.Cb()},h.vc=function(){this.Va&&this.Va.vc()},h.bf=function(t){if("undefined"!=typeof console){t=t?(this.hd||(this.hd=new oc(this.Xa)),this.hd.get()):this.Xa.get();var e,n=Pa(ra(t),function(t,e){return Math.max(e.length,t)},0);for(e in t){for(var i=t[e],r=e.length;r<n+2;r++)e+=" ";console.log(e+i)}}},h.cf=function(t){rc(this.Xa,t),this.eh.Vf[t]=!0},h.f=function(t){var e="";this.Va&&(e=this.Va.id+":"),fc(e,arguments)},aj.prototype.Cb=function(){for(var t in this.sc)this.sc[t].Cb()},aj.prototype.vc=function(){for(var t in this.sc)this.sc[t].vc()},aj.prototype.ze=function(){this.ag=!0},ba(aj),aj.prototype.interrupt=aj.prototype.Cb,aj.prototype.resume=aj.prototype.vc,h=Y.prototype,h.Mb=function(){return D("Query.ref",0,0,arguments.length),new X(this.k,this.path)},h.Ib=function(t,e,n,i){D("Query.on",2,4,arguments.length),lg("Query.on",t,!1),F("Query.on",2,e,!1);var r=ej("Query.on",n,i);if("value"===t)Ri(this.k,this,new ii(e,r.cancel||null,r.Qa||null));else{var o={};o[t]=e,Ri(this.k,this,new ji(o,r.cancel,r.Qa))}return e},h.mc=function(t,e,n){D("Query.off",0,3,arguments.length),lg("Query.off",t,!0),F("Query.off",2,e,!0),Qb("Query.off",3,n);var i=null,r=null;"value"===t?i=new ii(e||null,null,n||null):t&&(e&&((r={})[t]=e),i=new ji(r,null,n||null)),r=this.k,i=".info"===K(this.path)?r.Fd.nb(this,i):r.M.nb(this,i),bc(r.fa,this.path,i)},h.Pg=function(e,n){function i(t){a&&(a=!1,o.mc(e,i),n&&n.call(r.Qa,t),s.resolve(t))}D("Query.once",1,4,arguments.length),lg("Query.once",e,!1),F("Query.once",2,n,!0);var r=ej("Query.once",arguments[2],arguments[3]),o=this,a=!0,s=new B;return Nb(s.D),this.Ib(e,i,function(t){o.mc(e,i),r.cancel&&r.cancel.call(r.Qa,t),s.reject(t)}),s.D},h.Le=function(t){if(S("Query.limit() being deprecated. Please use Query.limitToFirst() or Query.limitToLast() instead."),D("Query.limit",1,1,arguments.length),!fa(t)||Math.floor(t)!==t||t<=0)throw Error("Query.limit: First argument must be a positive integer.");if(this.n.la)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var e=this.n.Le(t);return cj(e),new Y(this.k,this.path,e,this.pc)},h.Me=function(t){if(D("Query.limitToFirst",1,1,arguments.length),!fa(t)||Math.floor(t)!==t||t<=0)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.n.la)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.n.Me(t),this.pc)},h.Ne=function(t){if(D("Query.limitToLast",1,1,arguments.length),!fa(t)||Math.floor(t)!==t||t<=0)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.n.la)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.n.Ne(t),this.pc)},h.Qg=function(t){if(D("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');ng("Query.orderByChild",t),dj(this,"Query.orderByChild");var e=new P(t);if(e.e())throw Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");return e=new ve(e),bj(e=Fe(this.n,e)),new Y(this.k,this.path,e,!0)},h.Rg=function(){D("Query.orderByKey",0,0,arguments.length),dj(this,"Query.orderByKey");var t=Fe(this.n,re);return bj(t),new Y(this.k,this.path,t,!0)},h.Sg=function(){D("Query.orderByPriority",0,0,arguments.length),dj(this,"Query.orderByPriority");var t=Fe(this.n,R);return bj(t),new Y(this.k,this.path,t,!0)},h.Tg=function(){D("Query.orderByValue",0,0,arguments.length),dj(this,"Query.orderByValue");var t=Fe(this.n,Be);return bj(t),new Y(this.k,this.path,t,!0)},h.ce=function(t,e){D("Query.startAt",0,2,arguments.length),gg("Query.startAt",t,this.path,!0),mg("Query.startAt",e);var n=this.n.ce(t,e);if(cj(n),bj(n),this.n.oa)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return p(t)||(e=t=null),new Y(this.k,this.path,n,this.pc)},h.vd=function(t,e){D("Query.endAt",0,2,arguments.length),gg("Query.endAt",t,this.path,!0),mg("Query.endAt",e);var n=this.n.vd(t,e);if(cj(n),bj(n),this.n.ra)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.k,this.path,n,this.pc)},h.tg=function(t,e){if(D("Query.equalTo",1,2,arguments.length),gg("Query.equalTo",t,this.path,!1),mg("Query.equalTo",e),this.n.oa)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.n.ra)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.ce(t,e).vd(t,e)},h.toString=function(){D("Query.toString",0,0,arguments.length);for(var t=this.path,e="",n=t.aa;n<t.u.length;n++)""!==t.u[n]&&(e+="/"+encodeURIComponent(String(t.u[n])));return this.k.toString()+(e||"/")},h.wa=function(){var t=xd(Ge(this.n));return"{}"===t?"default":t},Y.prototype.ref=Y.prototype.Mb,Y.prototype.on=Y.prototype.Ib,Y.prototype.off=Y.prototype.mc,Y.prototype.once=Y.prototype.Pg,Y.prototype.limit=Y.prototype.Le,Y.prototype.limitToFirst=Y.prototype.Me,Y.prototype.limitToLast=Y.prototype.Ne,Y.prototype.orderByChild=Y.prototype.Qg,Y.prototype.orderByKey=Y.prototype.Rg,Y.prototype.orderByPriority=Y.prototype.Sg,Y.prototype.orderByValue=Y.prototype.Tg,Y.prototype.startAt=Y.prototype.ce,Y.prototype.endAt=Y.prototype.vd,Y.prototype.equalTo=Y.prototype.tg,Y.prototype.toString=Y.prototype.toString;var Z={};function X(t,e){var n,i,r;if(t instanceof Ji)n=t,i=e;else{var o;if(D("new Firebase",1,2,arguments.length),n=(i=sd(t)).fh,"firebase"===i.domain&&rd(i.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||rd("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),i.ob||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&S("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),n=new dd(i.host,i.ob,n,"ws"===i.scheme||"wss"===i.scheme),r=(i=new P(i.bd)).toString(),!(o=!q(n.host)||0===n.host.length||!eg(n.lc))&&(o=0!==r.length)&&(o=!(q(r=r&&r.replace(/^\/*\.info(\/|$)/,"/"))&&0!==r.length&&!cg.test(r))),o)throw Error(E("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(e)if(e instanceof aj)r=e;else{if(!q(e))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");r=aj.yb(),n.Rd=e}else r=aj.yb();o=n.toString();var a=z(r.sc,o);a||(a=new Ji(n,r.ag),r.sc[o]=a),n=a}Y.call(this,n,i,De,!1),this.then=void 0,this["catch"]=void 0}Z.zc=Rh,Z.DataConnection=Z.zc,Rh.prototype.dh=function(t,e){this.Ia("q",{p:t},e)},Z.zc.prototype.simpleListen=Z.zc.prototype.dh,Rh.prototype.sg=function(t,e){this.Ia("echo",{d:t},e)},Z.zc.prototype.echo=Z.zc.prototype.sg,Rh.prototype.interrupt=Rh.prototype.Cb,Z.dg=Fh,Z.RealTimeConnection=Z.dg,Fh.prototype.sendRequest=Fh.prototype.Ia,Fh.prototype.close=Fh.prototype.close,Z.Cg=function(r){var o=Rh.prototype.put;return Rh.prototype.put=function(t,e,n,i){p(i)&&(i=r()),o.call(this,t,e,n,i)},function(){Rh.prototype.put=o}},Z.hijackHash=Z.Cg,Z.cg=dd,Z.ConnectionTarget=Z.cg,Z.wa=function(t){return t.wa()},Z.queryIdentifier=Z.wa,Z.Fg=function(t){return t.k.Va.ba},Z.listens=Z.Fg,Z.ze=function(t){t.ze()},Z.forceRestClient=Z.ze,ka(X,Y);var fj=X,gj=["Firebase"],hj=n,ij;gj[0]in hj||!hj.execScript||hj.execScript("var "+gj[0]);for(;gj.length&&(ij=gj.shift());)!gj.length&&p(fj)?hj[ij]=fj:hj=hj[ij]?hj[ij]:hj[ij]={};X.goOffline=function(){D("Firebase.goOffline",0,0,arguments.length),aj.yb().Cb()},X.goOnline=function(){D("Firebase.goOnline",0,0,arguments.length),aj.yb().vc()},X.enableLogging=od,X.ServerValue={TIMESTAMP:{".sv":"timestamp"}},X.SDK_VERSION=Eb,X.INTERNAL=U,X.Context=aj,X.TEST_ACCESS=Z,X.prototype.name=function(){return S("Firebase.name() being deprecated. Please use Firebase.key() instead."),D("Firebase.name",0,0,arguments.length),this.key()},X.prototype.name=X.prototype.name,X.prototype.key=function(){return D("Firebase.key",0,0,arguments.length),this.path.e()?null:me(this.path)},X.prototype.key=X.prototype.key,X.prototype.o=function(t){if(D("Firebase.child",1,1,arguments.length),fa(t))t=String(t);else if(!(t instanceof P))if(null===K(this.path)){var e=t;ng("Firebase.child",e=e&&e.replace(/^\/*\.info(\/|$)/,"/"))}else ng("Firebase.child",t);return new X(this.k,this.path.o(t))},X.prototype.child=X.prototype.o,X.prototype.parent=function(){D("Firebase.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new X(this.k,t)},X.prototype.parent=X.prototype.parent,X.prototype.root=function(){D("Firebase.ref",0,0,arguments.length);for(var t=this;null!==t.parent();)t=t.parent();return t},X.prototype.root=X.prototype.root,X.prototype.set=function(t,e){D("Firebase.set",1,2,arguments.length),og("Firebase.set",this.path),gg("Firebase.set",t,this.path,!1),F("Firebase.set",2,e,!0);var n=new B;return this.k.Ob(this.path,t,null,C(n,e)),n.D},X.prototype.set=X.prototype.set,X.prototype.update=function(t,e){if(D("Firebase.update",1,2,arguments.length),og("Firebase.update",this.path),da(t)){for(var n={},i=0;i<t.length;++i)n[""+i]=t[i];t=n,S("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}return jg("Firebase.update",t,this.path),F("Firebase.update",2,e,!0),n=new B,this.k.update(this.path,t,C(n,e)),n.D},X.prototype.update=X.prototype.update,X.prototype.Ob=function(t,e,n){if(D("Firebase.setWithPriority",2,3,arguments.length),og("Firebase.setWithPriority",this.path),gg("Firebase.setWithPriority",t,this.path,!1),kg("Firebase.setWithPriority",2,e),F("Firebase.setWithPriority",3,n,!0),".length"===this.key()||".keys"===this.key())throw"Firebase.setWithPriority failed: "+this.key()+" is a read-only object.";var i=new B;return this.k.Ob(this.path,t,e,C(i,n)),i.D},X.prototype.setWithPriority=X.prototype.Ob,X.prototype.remove=function(t){return D("Firebase.remove",0,1,arguments.length),og("Firebase.remove",this.path),F("Firebase.remove",1,t,!0),this.set(null,t)},X.prototype.remove=X.prototype.remove,X.prototype.transaction=function(t,i,e){if(D("Firebase.transaction",1,3,arguments.length),og("Firebase.transaction",this.path),F("Firebase.transaction",1,t,!1),F("Firebase.transaction",2,i,!0),p(e)&&"boolean"!=typeof e)throw Error(E("Firebase.transaction",3,!0)+"must be a boolean.");if(".length"===this.key()||".keys"===this.key())throw"Firebase.transaction failed: "+this.key()+" is a read-only object.";void 0===e&&(e=!0);var o=new B;return r(i)&&Nb(o.D),Si(this.k,this.path,t,function(t,e,n){t?o.reject(t):o.resolve(new ei(e,n)),r(i)&&i(t,e,n)},e),o.D},X.prototype.transaction=X.prototype.transaction,X.prototype.$g=function(t,e){D("Firebase.setPriority",1,2,arguments.length),og("Firebase.setPriority",this.path),kg("Firebase.setPriority",1,t),F("Firebase.setPriority",2,e,!0);var n=new B;return this.k.Ob(this.path.o(".priority"),t,null,C(n,e)),n.D},X.prototype.setPriority=X.prototype.$g,X.prototype.push=function(t,e){D("Firebase.push",0,2,arguments.length),og("Firebase.push",this.path),gg("Firebase.push",t,this.path,!0),F("Firebase.push",2,e,!0);var n=Li(this.k),i=hf(n);n=this.o(i);if(null!=t){var o=this,a=n.set(t,e).then(function(){return o.o(i)});n.then=u(a.then,a),n["catch"]=u(a.then,a,void 0),r(e)&&Nb(a)}return n},X.prototype.push=X.prototype.push,X.prototype.lb=function(){return og("Firebase.onDisconnect",this.path),new V(this.k,this.path)},X.prototype.onDisconnect=X.prototype.lb,X.prototype.O=function(t,e,n){S("FirebaseRef.auth() being deprecated. Please use FirebaseRef.authWithCustomToken() instead."),D("Firebase.auth",1,3,arguments.length),pg("Firebase.auth",t),F("Firebase.auth",2,e,!0),F("Firebase.auth",3,e,!0);var i=new B;return dh(this.k.O,t,{},{remember:"none"},C(i,e),n),i.D},X.prototype.auth=X.prototype.O,X.prototype.je=function(t){D("Firebase.unauth",0,1,arguments.length),F("Firebase.unauth",1,t,!0);var e=new B;return eh(this.k.O,C(e,t)),e.D},X.prototype.unauth=X.prototype.je,X.prototype.Be=function(){return D("Firebase.getAuth",0,0,arguments.length),this.k.O.Be()},X.prototype.getAuth=X.prototype.Be,X.prototype.Jg=function(t,e){D("Firebase.onAuth",1,2,arguments.length),F("Firebase.onAuth",1,t,!1),Qb("Firebase.onAuth",2,e),this.k.O.Ib("auth_status",t,e)},X.prototype.onAuth=X.prototype.Jg,X.prototype.Ig=function(t,e){D("Firebase.offAuth",1,2,arguments.length),F("Firebase.offAuth",1,t,!1),Qb("Firebase.offAuth",2,e),this.k.O.mc("auth_status",t,e)},X.prototype.offAuth=X.prototype.Ig,X.prototype.hg=function(t,e,n){D("Firebase.authWithCustomToken",1,3,arguments.length),2===arguments.length&&Hb(e)&&(n=e,e=void 0),pg("Firebase.authWithCustomToken",t),F("Firebase.authWithCustomToken",2,e,!0),sg("Firebase.authWithCustomToken",3,n,!0);var i=new B;return dh(this.k.O,t,{},n||{},C(i,e)),i.D},X.prototype.authWithCustomToken=X.prototype.hg,X.prototype.ig=function(t,e,n){D("Firebase.authWithOAuthPopup",1,3,arguments.length),2===arguments.length&&Hb(e)&&(n=e,e=void 0),rg("Firebase.authWithOAuthPopup",t),F("Firebase.authWithOAuthPopup",2,e,!0),sg("Firebase.authWithOAuthPopup",3,n,!0);var i=new B;return ih(this.k.O,t,n,C(i,e)),i.D},X.prototype.authWithOAuthPopup=X.prototype.ig,X.prototype.jg=function(t,e,n){D("Firebase.authWithOAuthRedirect",1,3,arguments.length),2===arguments.length&&Hb(e)&&(n=e,e=void 0),rg("Firebase.authWithOAuthRedirect",t),F("Firebase.authWithOAuthRedirect",2,e,!1),sg("Firebase.authWithOAuthRedirect",3,n,!0);var i=new B,r=this.k.O,o=n,a=C(i,e);gh(r);var s=[Qg];o=Ag(o);return"anonymous"===t||"firebase"===t?T(a,Sg("TRANSPORT_UNAVAILABLE")):(cd.set("redirect_client_options",o.qd),hh(r,s,"/auth/"+t,o,a)),i.D},X.prototype.authWithOAuthRedirect=X.prototype.jg,X.prototype.kg=function(t,e,n,i){D("Firebase.authWithOAuthToken",2,4,arguments.length),3===arguments.length&&Hb(n)&&(i=n,n=void 0),rg("Firebase.authWithOAuthToken",t),F("Firebase.authWithOAuthToken",3,n,!0),sg("Firebase.authWithOAuthToken",4,i,!0);var r=new B;return q(e)?(qg("Firebase.authWithOAuthToken",2,e),fh(this.k.O,t+"/token",{access_token:e},i,C(r,n))):(sg("Firebase.authWithOAuthToken",2,e,!1),fh(this.k.O,t+"/token",e,i,C(r,n))),r.D},X.prototype.authWithOAuthToken=X.prototype.kg,X.prototype.gg=function(t,e){D("Firebase.authAnonymously",0,2,arguments.length),1===arguments.length&&Hb(t)&&(e=t,t=void 0),F("Firebase.authAnonymously",1,t,!0),sg("Firebase.authAnonymously",2,e,!0);var n=new B;return fh(this.k.O,"anonymous",{},e,C(n,t)),n.D},X.prototype.authAnonymously=X.prototype.gg,X.prototype.lg=function(t,e,n){D("Firebase.authWithPassword",1,3,arguments.length),2===arguments.length&&Hb(e)&&(n=e,e=void 0),sg("Firebase.authWithPassword",1,t,!1),tg("Firebase.authWithPassword",t,"email"),tg("Firebase.authWithPassword",t,"password"),F("Firebase.authWithPassword",2,e,!0),sg("Firebase.authWithPassword",3,n,!0);var i=new B;return fh(this.k.O,"password",t,n,C(i,e)),i.D},X.prototype.authWithPassword=X.prototype.lg,X.prototype.ve=function(t,e){D("Firebase.createUser",1,2,arguments.length),sg("Firebase.createUser",1,t,!1),tg("Firebase.createUser",t,"email"),tg("Firebase.createUser",t,"password"),F("Firebase.createUser",2,e,!0);var n=new B;return this.k.O.ve(t,C(n,e)),n.D},X.prototype.createUser=X.prototype.ve,X.prototype.Xe=function(t,e){D("Firebase.removeUser",1,2,arguments.length),sg("Firebase.removeUser",1,t,!1),tg("Firebase.removeUser",t,"email"),tg("Firebase.removeUser",t,"password"),F("Firebase.removeUser",2,e,!0);var n=new B;return this.k.O.Xe(t,C(n,e)),n.D},X.prototype.removeUser=X.prototype.Xe,X.prototype.se=function(t,e){D("Firebase.changePassword",1,2,arguments.length),sg("Firebase.changePassword",1,t,!1),tg("Firebase.changePassword",t,"email"),tg("Firebase.changePassword",t,"oldPassword"),tg("Firebase.changePassword",t,"newPassword"),F("Firebase.changePassword",2,e,!0);var n=new B;return this.k.O.se(t,C(n,e)),n.D},X.prototype.changePassword=X.prototype.se,X.prototype.re=function(t,e){D("Firebase.changeEmail",1,2,arguments.length),sg("Firebase.changeEmail",1,t,!1),tg("Firebase.changeEmail",t,"oldEmail"),tg("Firebase.changeEmail",t,"newEmail"),tg("Firebase.changeEmail",t,"password"),F("Firebase.changeEmail",2,e,!0);var n=new B;return this.k.O.re(t,C(n,e)),n.D},X.prototype.changeEmail=X.prototype.re,X.prototype.Ze=function(t,e){D("Firebase.resetPassword",1,2,arguments.length),sg("Firebase.resetPassword",1,t,!1),tg("Firebase.resetPassword",t,"email"),F("Firebase.resetPassword",2,e,!0);var n=new B;return this.k.O.Ze(t,C(n,e)),n.D},X.prototype.resetPassword=X.prototype.Ze}();
!function(z){var w,e={className:"autosizejs",id:"autosizejs",append:"\n",callback:!1,resizeDelay:10,placeholder:!0},f=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","whiteSpace"],b=z('<textarea aria-hidden="true" tabindex="-1"/>').data("autosize",!0)[0];b.style.cssText="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;",(b.style.lineHeight="99px")===z(b).css("lineHeight")&&f.push("lineHeight"),b.style.lineHeight="",z.fn.autosize=function(p){return this.length?(p=z.extend({},e,p||{}),b.parentNode!==document.body&&z(document.body).append(b),this.each(function(){var a,o,e,n=this,s=z(n),r=0,l=z.isFunction(p.callback),t={height:n.style.height,overflow:n.style.overflow,overflowY:n.style.overflowY,wordWrap:n.style.wordWrap,resize:n.style.resize},i=s.width(),d=s.css("resize");function c(){var o,i=window.getComputedStyle?window.getComputedStyle(n,null):null;i?(o=parseFloat(i.width),"border-box"!==i.boxSizing&&"border-box"!==i.webkitBoxSizing&&"border-box"!==i.mozBoxSizing||z.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,t){o-=parseFloat(i[t])})):o=s.width(),b.style.width=Math.max(o,0)+"px"}function h(){var e,t;w!==n?function i(){var o={};if(w=n,b.className=p.className,b.id=p.id,a=parseFloat(s.css("maxHeight")),z.each(f,function(e,t){o[t]=s.css(t)}),z(b).css(o).attr("wrap",s.attr("wrap")),c(),window.chrome){var e=n.style.width;n.style.width="0px";n.offsetWidth;n.style.width=e}}():c(),!n.value&&p.placeholder?b.value=s.attr("placeholder")||"":b.value=n.value,b.value+=p.append||"",b.style.overflowY=n.style.overflowY,t=parseFloat(n.style.height)||0,b.scrollTop=0,b.scrollTop=9e4,e=b.scrollTop,a&&a<e?(n.style.overflowY="scroll",e=a):(n.style.overflowY="hidden",e<o&&(e=o)),e+=r,.01<Math.abs(t-e)&&(n.style.height=e+"px",b.className=b.className,l&&p.callback.call(n,n),s.trigger("autosize.resized"))}function u(){clearTimeout(e),e=setTimeout(function(){var e=s.width();e!==i&&(i=e,h())},parseInt(p.resizeDelay,10))}s.data("autosize")||(s.data("autosize",!0),"border-box"!==s.css("box-sizing")&&"border-box"!==s.css("-moz-box-sizing")&&"border-box"!==s.css("-webkit-box-sizing")||(r=s.outerHeight()-s.height()),o=Math.max(parseFloat(s.css("minHeight"))-r||0,s.height()),s.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),"vertical"===d?s.css("resize","none"):"both"===d&&s.css("resize","horizontal"),"onpropertychange"in n?"oninput"in n?s.on("input.autosize keyup.autosize",h):s.on("propertychange.autosize",function(){"value"===event.propertyName&&h()}):s.on("input.autosize",h),!1!==p.resizeDelay&&z(window).on("resize.autosize",u),s.on("autosize.resize",h),s.on("autosize.resizeIncludeStyle",function(){w=null,h()}),s.on("autosize.destroy",function(){w=null,clearTimeout(e),z(window).off("resize",u),s.off("autosize").off(".autosize").css(t).removeData("autosize")}),h())})):this}}(jQuery||$);
!function(d,h,p,c){var e="plugin_ylc",t={app_id:"",render:!0,display_login:!0,user_info:{user_id:null,user_name:null,user_email:null,gravatar:null,user_type:null,avatar_type:null,avatar_image:null,current_page:null,user_ip:null},styles:{bg_color:"#009EDB",x_pos:"right",y_pos:"bottom",border_radius:"5px 5px 0 0",popup_width:370,btn_width:260,btn_height:0,btn_type:"classic",form_width:260,animation_type:"bounceIn",autoplay:!0,autoplay_delay:1e3}},l=null,s={end_chat_frontend:function(t){if(t){var e=new Date;this.trigger_premium("save_user_data",this.data.user.conversation_id,!0,e.getTime(),!0)}},premium_frontend:function(){var a=this,n=!1,i=!1,e=!1;if(d(p).on("click","#YLC_send_btn",function(t){if(n)return!1;if(ylc.gdpr&&!d("#YLC_gdpr_acceptance").is(":checked"))return a.display_ntf(a.strings.msg.field_empty,"error","#YLC_offline_ntf"),!1;a.display_ntf(a.strings.msg.sending+"...","sending ","#YLC_offline_ntf");var e=d("#YLC_popup_form").serializeArray(),i=e.length-1;return d.each(e,function(t,e){if(a.data.current_form[e.name]=e.value,!e.value)return a.display_ntf(a.strings.msg.field_empty,"error","#YLC_offline_ntf"),!1;if("email"===e.name){if(!a.validate_email(e.value))return a.display_ntf(a.strings.msg.invalid_email,"error","#YLC_offline_ntf"),!1}else if("name"===e.name&&!a.validate_username(e.value))return a.display_ntf(a.strings.msg.invalid_username,"error","#YLC_offline_ntf"),!1;if(t===i){n=!0;var s=d("#YLC_popup_form").serialize()+"&vendor_id="+ylc.active_vendor.vendor_id;a.post("ylc_ajax_offline_form",s,function(t){n=!1,t.error?a.display_ntf(t.error,"error","#YLC_offline_ntf"):t.warn?(a.display_ntf(t.warn,"success","#YLC_offline_ntf"),setTimeout(function(){a.clean_ntf(),a.minimize()},4e3)):(a.display_ntf(t.msg,"success","#YLC_offline_ntf"),setTimeout(function(){a.clean_ntf(),a.minimize()},2e3))})}}),!1}),d(p).on("mouseenter","#YLC_send_btn",function(){d(this).css("background-color",a.data.primary_hover)}),d(p).on("mouseleave","#YLC_send_btn",function(){d(this).css("background-color",a.opts.styles.bg_color)}),d(p).on("click","#YLC_good_btn, #YLC_bad_btn",function(t){if(i)return!1;i=!0,a.display_ntf(a.strings.msg.sending+"...","sending","#YLC_end_chat_ntf");var e="YLC_good_btn"===d(this).attr("id")?"good":"bad",s=d("#YLC_request_chat").is(":checked")?1:0;return a.post("ylc_ajax_chat_evaluation",{conversation_id:a.data.user.conversation_id,evaluation:e,receive_copy:s,user_email:a.data.user.user_email,chat_with:a.data.user.chat_with},function(){i=!1}),a.minimize(),!1}),d(p).on("click","#YLC_chat_request",function(t){if(e)return!1;e=!0,a.display_ntf(a.strings.msg.sending+"...","sending","#YLC_end_chat_ntf");return a.post("ylc_ajax_chat_evaluation",{conversation_id:a.data.user.conversation_id,evaluation:"",receive_copy:1,user_email:a.data.user.user_email,chat_with:a.data.user.chat_with},function(){e=!1}),a.minimize(),!1}),"round"==this.opts.styles.btn_type){var t=this.opts.styles.btn_width/2;d("#YLC_chat_btn.btn-round").css({color:this.data.primary_fg,"background-color":this.opts.styles.bg_color,width:this.opts.styles.btn_width+"px",height:this.opts.styles.btn_width+"px","-webkit-border-radius":t+"px","-moz-border-radius":t+"px","border-radius":t+"px",right:"right"===this.opts.styles.x_pos?"20px":"auto",left:"right"===this.opts.styles.x_pos?"auto":"20px",top:"top"===this.opts.styles.y_pos?"20px":"auto",bottom:"top"===this.opts.styles.y_pos?"auto":"20px"}),d("#YLC_chat_btn .chat-ico.chat").css({width:this.opts.styles.btn_width+"px"}),d("#YLC_chat_btn div").css({"line-height":this.opts.styles.btn_width+"px"})}else d("#YLC_chat_btn").css({color:this.data.primary_fg,"background-color":this.opts.styles.bg_color,width:this.opts.styles.btn_width+"px","-webkit-border-radius":this.opts.styles.border_radius,"-moz-border-radius":this.opts.styles.border_radius,"border-radius":this.opts.styles.border_radius,right:"right"===this.opts.styles.x_pos?"20px":"auto",left:"right"===this.opts.styles.x_pos?"auto":"20px",top:"top"===this.opts.styles.y_pos?"0":"auto",bottom:"top"===this.opts.styles.y_pos?"auto":"0"});d("#YLC_chat").css({"-webkit-border-radius":this.opts.styles.border_radius,"-moz-border-radius":this.opts.styles.border_radius,"border-radius":this.opts.styles.border_radius,right:"right"===this.opts.styles.x_pos?"40px":"auto",left:"right"===this.opts.styles.x_pos?"auto":"40px",top:"top"===this.opts.styles.y_pos?"0":"auto",bottom:"top"===this.opts.styles.y_pos?"auto":"0"}),d("#YLC_chat_header").css({color:this.data.primary_fg,"background-color":this.opts.styles.bg_color}),d(".chat-form-btn").css({color:this.data.primary_fg,"background-color":this.opts.styles.bg_color}),"bottom"!==this.opts.styles.y_pos&&d(".chat-body").css({"-webkit-border-radius":this.opts.styles.border_radius,"-moz-border-radius":this.opts.styles.border_radius,"border-radius":this.opts.styles.border_radius})},chat_duration:function(t,e){if(""==e||""==t)return"00:00:00";var s=.001*(e-t)>>0,i=s/60>>0,a=i/60>>0;return(a=(a%=60)<10?"0"+a:a)+":"+(i=(i%=60)<10?"0"+i:i)+":"+(s=(s%=60)<10?"0"+s:s)},save_user_data:function(r,_,a,u,l){var c=this;this.data.ref_cnv.child(r).once("value",function(t){var e=null!==t.val(),s=t.val();if(e){var o=s.user_id,i=c.trigger_premium("chat_duration",s.accepted_at,a);c.data.ref_users.child(o).once("value",function(t){var n=t.val();n.created_at=s.created_at,n.evaluation=s.evaluation,n.duration=i,n.receive_copy=s.receive_copy,n.send_email=u,c.data.ref_msgs.once("value",function(t){var e=t.val(),s=e?Object.keys(e).length:0,i=0,a={};e?d.each(e,function(t,e){i+=1,e.conversation_id===r&&(a[t]=e,_&&c.data.ref_msgs.child(t).remove()),s===i&&(n.msgs=a,c.post("ylc_ajax_save_chat",n,function(t){l&&l(t)}))}):l&&l({}),_&&(c.data.ref_users.child(o).remove(),c.data.ref_cnv.child(r).remove())})})}else l&&l({})})},set_avatar_premium:function(t,e){if("admin"!=t)return"https://www.gravatar.com/avatar/"+e.gravatar+".jpg?s=60&d="+ylc.default_user_avatar;switch(e.avatar_type){case"gravatar":return"https://www.gravatar.com/avatar/"+e.gravatar+".jpg?s=60&d="+ylc.default_admin_avatar;case"image":return e.avatar_image;default:return""!=ylc.company_avatar?ylc.company_avatar:this.data.assets_url+"/images/default-avatar-"+t+".png"}},logged_users_auth:function(){""!=this.opts.user_info.user_name&&""!=this.opts.user_info.user_email&&(d("#YLC_field_name").val(this.opts.user_info.user_name),d("#YLC_msg_name").val(this.opts.user_info.user_name),d("#YLC_field_email").val(this.opts.user_info.user_email),d("#YLC_msg_email").val(this.opts.user_info.user_email))},autoplay:function(){0<this.opts.styles.autoplay_delay&&setTimeout(function(){d("#YLC_chat_btn").click()},this.opts.styles.autoplay_delay)}};function i(){this.opts=d.extend(t,ylc.defaults),this.premium=d.extend({},s)}i.prototype={init:function(){this.data={auth:null,ref:null,is_mobile:!1,active_user_id:0,mode:"offline",logged:!1,assets_url:ylc.plugin_url,animation_delay:1e3,show_delay:ylc.show_delay,guest_prefix:"Guest-",primary_fg:null,primary_hover:null,popup_status:"close",user:{},current_form:{},online_ops:{}},this.strings=ylc.strings,this.objs={btn:null,popup:null,popup_header:null,cnv:null};var e=this;this.trigger_premium("logged_users_auth"),this.trigger_premium("premium_frontend"),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(this.data.is_mobile=!0),this.post("ylc_ajax_get_token",{},function(t){t.error||(e.data.auth_token=t.token,e.render_chat(),e.trigger_premium("autoplay"))})},auth:function(t){this.opts.app_id?(null==this.data.ref&&(this.data.ref=new Firebase("https://"+this.opts.app_id+".firebaseIO.com"),this.data.ref_conn=new Firebase("https://"+this.opts.app_id+".firebaseIO.com/.info/connected"),this.data.ref_cnv=new Firebase("https://"+this.opts.app_id+".firebaseIO.com/chat_sessions"),this.data.ref_msgs=new Firebase("https://"+this.opts.app_id+".firebaseIO.com/chat_messages"),this.data.ref_users=new Firebase("https://"+this.opts.app_id+".firebaseIO.com/chat_users")),this.opts.display_login?this.login(!1,t):this.login(!0,t)):console.error("App ID not provided")},login:function(t,_){var u=this;this.purge_firebase(),this.manage_connections(),this.data._new_user=t,this.data.auth=this.data.ref.authWithCustomToken(this.data.auth_token,function(t){t?(console.error(t.code,t.message),u.display_ntf(u.strings.msg.conn_err,"error","#YLC_login_ntf")):(u.data.logged=!0,u.data.ref_users.once("value",function(t){var e=t.val(),s=0,i=!1,a=0,n=!1,o=!1;if(null!==e){var r=Object.keys(e).length;d.each(e,function(t,e){a++,e&&("operator"==e.user_type&&"online"===e.status?u.valid_operator(e.vendor_id)&&(u.data.online_ops[e.user_id]=e):"operator"!=e.user_type&&(e.user_name!==c&&e.user_id!=u.opts.user_info.user_id&&s++,e.user_email!==c&&u.data.current_form.user_email!==c&&(e.user_email!=u.data.current_form.user_email||ylc.frontend_op_access||(e.user_ip==u.opts.user_info.user_ip?"online"===e.status&&e.user_id!=u.opts.user_info.user_id?n=!0:o=e.conversation_id:n=!0)))),n?u.display_ntf(u.strings.msg.already_logged,"error","#YLC_login_ntf"):a===r&&(u.total_online_ops()||o?"operator"==u.opts.user_info.user_type||s<ylc.max_guests||0==ylc.max_guests?(null!=l&&clearInterval(l),u.opts.display_login?u.show_login():u.show_cnv(!0)):(i=!0,u.show_offline(!0)):u.show_offline(),u.check_user(u.opts.user_info.user_id,i,o))})}else u.show_offline(),u.check_user(u.opts.user_info.user_id,!1);_&&_(i)}))})},logout:function(t){var e=this;this.data.user.user_id&&(e.data.ref_user.off(),e.data.ref_users.off(),e.data.ref_msgs.off()),d(".chat-body").hide(),d("#YLC_end_chat").show(),ylc.is_premium?e.trigger_premium("end_chat_frontend",t):(t&&e.clear_user_data(e.data.user.conversation_id),setTimeout(function(){e.be_offline(),e.minimize()},2e3)),e.objs.cnv.empty(),e.objs.popup_header.click(function(){e.minimize(),e.objs.popup_header.off("click")}),d(h).trigger("resize")},be_offline:function(){this.data.mode="offline",this.data.ref_user&&(this.data.ref_user.child("status").set("offline"),this.data.ref_user.child("last_online").set(Firebase.ServerValue.TIMESTAMP)),this.check_mode(!0)},check_mode:function(t){var e=this.data.mode;if(t)this.show_connecting(),this.data.mode="offline";else if(this.total_online_ops())"offline"===e&&(d("#YLC_cnv_reply").removeClass("chat-disabled").removeAttr("disabled"),this.clean_ntf()),this.data.mode=this.opts.display_login&&"online"!=e?"login":"online";else{switch(e){case"login":this.show_offline();break;case"online":ylc.is_premium||(this.opts.display_login?(d("#YLC_cnv_reply").addClass("chat-disabled").attr("disabled","disabled"),this.display_ntf(this.strings.msg.no_op+"!","error","#YLC_popup_ntf")):this.show_offline())}this.data.mode="offline"}},show_offline:function(t){var i=this;this.data.mode="offline",this.allow_chatbox()&&(i.objs.popup.parent().removeClass().addClass("chat-offline"),d(".chat-body").hide(),d("#YLC_offline .chat-lead").hide(),d("#YLC_offline").show(),t?(ylc.show_busy_form||d("#YLC_popup_form").hide(),d("#YLC_offline .chat-lead.op-busy").show(),null!=l&&clearInterval(l),l=setInterval(function(){i.data.ref_users.once("value",function(t){var e=t.val(),s=0;null!==e&&d.each(e,function(t,e){e&&e.user_name!==c&&"operator"!=e.user_type&&e.user_id!=i.opts.user_info.user_id&&s++}),s<ylc.max_guests&&(i.opts.display_login?i.login(!1):i.login(!0))})},3e4)):d("#YLC_offline .chat-lead.op-offline").show(),d(h).trigger("resize"))},show_connecting:function(){d(".chat-body").hide(),d("#YLC_connecting").show()},show_login:function(){var e=this;this.allow_chatbox()&&(this.opts.display_login&&this.total_online_ops()&&this.objs.popup?(this.data.mode="login",this.objs.popup.parent().removeClass().addClass("chat-login"),d(".chat-body").hide(),d("#YLC_login").show(),d(h).trigger("resize"),d("#YLC_login_btn").hover(function(){d(this).css("background-color",e.data.primary_hover)},function(){d(this).css("background-color",e.opts.styles.bg_color)}).click(function(){e.send_login_form()}),d("#YLC_login_form").keydown(function(t){13!=t.keyCode||t.shiftKey||(t.preventDefault(),e.send_login_form())})):"online"===e.data.mode?this.show_cnv():this.show_offline())},send_login_form:function(){var s=this;if(ylc.chat_gdpr&&!d("#YLC_chat_gdpr_acceptance").is(":checked"))return s.display_ntf(s.strings.msg.field_empty,"error","#YLC_login_ntf"),!1;this.display_ntf(this.strings.msg.connecting+"...","sending","#YLC_login_ntf");var t=d("#YLC_login_form").serializeArray(),i=t.length-1;d.each(t,function(t,e){if(s.data.current_form[e.name]=e.value,!e.value)return s.display_ntf(s.strings.msg.field_empty,"error","#YLC_login_ntf"),!1;if("user_email"===e.name){if(!s.validate_email(e.value))return s.display_ntf(s.strings.msg.invalid_email,"error","#YLC_login_ntf"),!1;s.data.current_form.gravatar=s.md5(e.value)}else if(!s.validate_username(e.value))return s.display_ntf(s.strings.msg.invalid_username,"error","#YLC_login_ntf"),!1;t===i&&setTimeout(function(){s.login(!0)},1e4)})},check_user:function(s,t,i){var a=this;this.data.ref_user=this.data.ref_users.child(s),t?this.data.ref_user.child("status").set("wait"):(this.data.ref_user.once("value",function(t){var e=t.val();e=e||{},a.get_user(s,e,i)}),this.data.ref_user.child("chat_with").on("value",function(t){var e=t.val();null!=e&&(a.data.user.chat_with=e)})),this.data.ref_users.on("child_removed",function(t){var e=t.val();e&&s===e.user_id&&a.logout()})},get_user:function(t,e,s,i){var a=this;if(e.user_id)this.data.user=e,this.data.ref_user.child("status").set("online"),this.data.ref_user.child("user_ip").set(a.opts.user_info.user_ip),this.data.ref_user.child("current_page").set(a.opts.user_info.current_page),this.data.ref_user.child("vendor_id").set(ylc.active_vendor.vendor_id),this.data.ref_user.child("vendor_name").set(ylc.active_vendor.vendor_name),this.data.ref_user.child("chat_with").set("free"),this.total_online_ops()?this.show_cnv():this.show_offline(),this.manage_connections(),a.listen_users(),i&&i();else if(!0===this.data._new_user){var n={user_id:t,conversation_id:this.data.ref_cnv.push({user_id:t,created_at:Firebase.ServerValue.TIMESTAMP,accepted_at:"",evaluation:"",user_type:"visitor",receive_copy:!1}).key(),last_online:"",is_mobile:this.data.is_mobile,chat_with:"free",status:"online",vendor_id:ylc.active_vendor.vendor_id,vendor_name:ylc.active_vendor.vendor_name};for(var o in this.opts.user_info)n[o]=this.opts.user_info[o];for(var r in this.data.current_form)n[r]=this.data.current_form[r];n.user_name||(n.user_email?n.user_name=n.user_email.substring(0,n.user_email.indexOf("@")):n.user_name=this.data.guest_prefix+this.random_id(1e3,5e3)),this.data.user=n,this.data.ref_user.set(n,function(t){if(!t&&(a.show_cnv(),a.manage_connections(),a.listen_users(),s))if(ylc.is_premium){var e=new Date;a.trigger_premium("save_user_data",s,!0,e.getTime(),!1)}else a.clear_user_data(s);i&&i()})}else a.listen_users()},show_cnv:function(t){var e=this;this.data.mode="online",this.allow_chatbox()&&(this.objs.popup.parent().removeClass().addClass("chat-online"),d(".chat-body").hide(),d("#YLC_chat_body").show(),this.objs.cnv=d("#YLC_cnv"),t?setTimeout(function(){d("#YLC_cnv_reply").focus().autosize({append:""}).trigger("autosize.resize")},this.data.animation_delay):d("#YLC_cnv_reply").focus().autosize({append:""}).trigger("autosize.resize"),d(h).trigger("resize"),this.listen_msgs(),d("#YLC_tool_end_chat").click(function(){e.push_msg("-- "+e.strings.msg.close_msg_user+" --"),e.data.ref_cnv.child(e.data.user.conversation_id).child("status").set("closed"),e.logout(!0)}),this.manage_reply_box())},listen_users:function(){var a=this;this.data.last_changed_id=null,this.data.ref_users.once("value",function(t){var e=t.val(),s=0;if(null!==e){var i=Object.keys(e).length;a.data.online_ops={},d.each(e,function(t,e){s+=1,e&&a.valid_operator(e.vendor_id)&&"operator"===e.user_type&&("online"===e.status?a.data.online_ops[e.user_id]=e:delete a.data.online_ops[e.user_id]),s===i&&(a.check_mode(),a.listen_new_users())})}})},listen_new_users:function(t){var s=this;this.data.ref_users.on("value",function(t){var e=t.val();d.each(e,function(t,e){s.update_user(e)})})},update_user:function(t,e){t&&!t.user_id||(t&&(t.conversation_id?("operator"===t.user_type&&("online"===t.status?this.data.online_ops[t.user_id]=t:delete this.data.online_ops[t.user_id]),this.check_mode()):this.clean_user_data(t.user_id)),this.data.last_changed_id=e)},clean_user_data:function(s){var i=this,a=this.data.ref_users.child(s);a.once("value",function(t){var e=t.val();a.remove(),e.conversation_id&&i.ref_cnv.child(e.conversation_id),i.data.ref_msgs.once("value",function(t){var e=t.val();e&&d.each(e,function(t,e){e.user_id===s&&i.data.ref_msgs.child(t).remove()})})})},set_avatar:function(t,e){return t="operator"==t?"admin":"user",ylc.is_premium?this.trigger_premium("set_avatar_premium",t,e):this.data.assets_url+"/images/default-avatar-"+t+".png"},time:function(t,e){return this.strings.time[t]&&this.strings.time[t].replace(/%d/i,Math.abs(Math.round(e)))},timeago:function(t){if(!t)return"";var e=.001*((new Date).getTime()-t)>>0,s=e/60,i=s/60,a=i/24,n=a/365;return(e<45&&this.time("seconds",e)||e<90&&this.time("minute",1)||s<45&&this.time("minutes",s)||s<90&&this.time("hour",1)||i<24&&this.time("hours",i)||i<42&&this.time("day",1)||a<30&&this.time("days",a)||a<45&&this.time("month",1)||a<365&&this.time("months",a/30)||n<1.5&&this.time("year",1)||this.time("years",n))+" "+this.strings.time.suffix},listen_msgs:function(){var a=this;this.data.ref_msgs.off(),this.data.ref_msgs.once("value",function(t){var e=t.val(),s=e?Object.keys(e).length:0,i=1;e?d.each(e,function(t,e){a.data.user.conversation_id==e.conversation_id&&(e.id=t,a.add_msg(e)),e.first_load=!0,s==i&&a.listen_new_msgs(t),i+=1}):a.listen_new_msgs()})},listen_new_msgs:function(t){var s=this,e=t?s.data.ref_msgs.startAt(null,t):s.data.ref_msgs,i=!0;t||(i=!1),e.on("child_added",function(t){var e=t.val();e.id=t.key(),s.data.user.conversation_id==e.conversation_id&&(i||s.add_msg(e)),i||s.show_popup(),i=!1})},add_msg:function(t){var e=new Date,s=new Date(t.msg_time),i=s.getHours()+":"+(s.getMinutes()<10?"0":"")+s.getMinutes(),a=this.sanitize_msg(t.msg),n=s.toDateString()==e.toDateString()?i:s.getUTCDate()+" "+this.strings.months_short[s.getUTCMonth()]+", "+i;if(this.objs.cnv.find(".chat-welc").hide(),this.objs.cnv){var o=t.user_id==this.data.user.user_id?" chat-you":"",r=s.getUTCDate()+" "+this.strings.months[s.getUTCMonth()]+" "+s.getUTCFullYear()+" "+i,_=this.set_avatar(t.user_type,{gravatar:t.gravatar,avatar_type:t.avatar_type,avatar_image:t.avatar_image});this.objs.cnv.append('<div id="YLC_msg_'+t.id+'" class="chat-cnv-line'+o+'"><div title="'+r+'" class="chat-cnv-time">'+n+'</div><div class="chat-avatar"><img src="'+_+'" /></div><div class="chat-cnv-msg"><div class="chat-cnv-author">'+t.user_name+"</div>"+a+'</div></div><div class="chat-clear"></div>').scrollTop(this.objs.cnv.prop("scrollHeight"))}},sanitize_msg:function(t){var e,s,i,a,n={"&":"&amp;","<":"&lt;",">":"&gt;"};return a=/\n/gim,e=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim,s=/(^|[^\/])(www\.[\S]+(\b|$))/gim,i=/(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim,t.replace(/[&<>]/g,function(t){return n[t]||t}).replace(a,"<br />").replace(e,'<a href="$1" target="_blank">$1</a>').replace(s,'$1<a href="http://$2" target="_blank">$2</a>').replace(i,'<a href="mailto:$1">$1</a>')},manage_reply_box:function(t){var s,a=this,i=!1,e=d("#YLC_cnv_reply"),n=(s=0,function(t,e){clearTimeout(s),s=setTimeout(t,e)});this.data.ref_cnv.child(this.data.user.conversation_id+"/typing").remove(),e.keydown(function(t){if(13!==t.keyCode||t.shiftKey){if(!i){switch(t.keyCode){case 17:case 18:case 16:case 9:case 8:case 224:case 17:case 91:case 93:return}a.data.ref_cnv.child(a.data.user.conversation_id+"/typing/"+a.data.user.user_id).set(a.data.user.user_name),i=!0}n(function(){a.data.ref_cnv.child(a.data.user.conversation_id+"/typing/"+a.data.user.user_id).remove(),i=!1},1300)}else{t.preventDefault();var e=d(this).val();e&&(d(this).val("").trigger("autosize.resize"),a.push_msg(e),a.data.ref_cnv.child(a.data.user.conversation_id+"/typing/"+a.data.user.user_id).remove())}}),t&&this.data.ref_cnv.child(t+"/typing").off(),this.data.ref_cnv.child(this.data.user.conversation_id+"/typing").on("value",function(t){var s=0,e=t.val(),i=e?Object.keys(e).length:0;e?d.each(e,function(t,e){null==t||t==a.data.user.user_id?(i===s&&a.clean_ntf(),s+=1):a.display_ntf(a.strings.msg.writing.replace(/%s/i,e),"typing","#YLC_popup_ntf")}):a.clean_ntf()}),this.objs.popup.find(".chat-cnv-reply").click(function(){e.focus()})},reload_cnv:function(s){this.data.ref_msgs.once("value",function(t){new Date;var e=t.val();e&&Object.keys(e).length;e&&d.each(e,function(t,e){e.conversation_id==s&&(e.old_msg=!0,1)})})},push_msg:function(t){this.data.ref_msgs.push({user_id:this.data.user.user_id,user_type:this.data.user.user_type,conversation_id:this.data.user.conversation_id,user_name:this.data.user.user_name||this.data.user.user_email,gravatar:this.data.user.gravatar,avatar_type:this.data.user.avatar_type,avatar_image:this.data.user.avatar_image,msg:t,msg_time:Firebase.ServerValue.TIMESTAMP,vendor_id:ylc.active_vendor.vendor_id,read:!1})},get_user_data:function(t,s){this.data.ref_users.child(t).once("value",function(t){var e=t.val();s(e)})},render_chat:function(){var c=this;this.data.primary_fg=this.use_white(this.opts.styles.bg_color)?"#ffffff":"#444444",this.data.primary_hover=this.shade_color(this.opts.styles.bg_color,7),this.objs.btn=d("#YLC_chat_btn"),this.objs.btn.hover(function(){if(d(this).css("background-color",c.data.primary_hover),"round"==c.opts.styles.btn_type&&ylc.button_animation){var t=d(this).css("width","auto").width();d(this).width(c.opts.styles.btn_width).animate({width:t+10},250)}},function(){d(this).css("background-color",c.opts.styles.bg_color),"round"==c.opts.styles.btn_type&&ylc.button_animation&&d(this).animate({width:c.opts.styles.btn_width},250)}),this.objs.btn.click(function(){d(this).hide(),c.show_popup(),c.auth()}),setTimeout(function(){c.show_btn()},this.data.show_delay),this.show_connecting(),this.objs.popup=d("#YLC_chat"),this.objs.popup_header=d("#YLC_chat_header"),d(p).on("hover","#YLC_send_btn",function(){d(this).css("background-color",c.data.primary_hover)},function(){d(this).css("background-color",c.opts.styles.bg_color)}),d(h).resize(function(){var t=h,e=p,s=e.documentElement,i=e.getElementsByTagName("body")[0],a=(t.innerWidth||s.clientWidth||i.clientWidth,t.innerHeight||s.clientHeight||i.clientHeight),n=c.objs.popup.height(),o=c.objs.popup_header.height(),r=parseInt(c.objs.popup.css("bottom"),10),_=n<a?"auto":a,u=n<a?"auto":a-o-r;c.objs.popup.css("height",_),d("#YLC_chat_body, #YLC_offline").css("height",u);var l=d(h).width();"round"==c.opts.styles.btn_type?c.objs.btn.css({width:c.opts.styles.btn_width+"px",left:"right"===c.opts.styles.x_pos?"auto":"20px",right:"left"===c.opts.styles.x_pos?"auto":"20px"}):480<l?c.objs.btn.css({width:c.opts.styles.btn_width+"px",left:"right"===c.opts.styles.x_pos?"auto":"40px",right:"left"===c.opts.styles.x_pos?"auto":"40px"}):c.objs.btn.css({width:"",left:"right"===c.opts.styles.x_pos?"auto":0,right:"left"===c.opts.styles.x_pos?"auto":0}),480<l?(c.objs.popup.css({left:"right"===c.opts.styles.x_pos?"auto":"40px",right:"left"===c.opts.styles.x_pos?"auto":"40px"}),d(".chat-body.chat-online").css("width",c.opts.styles.popup_width+"px"),d(".chat-body.chat-form").css("width",c.opts.styles.form_width+"px")):(c.objs.popup.css({left:"right"===c.opts.styles.x_pos?"auto":0,right:"left"===c.opts.styles.x_pos?"auto":0}),d(".chat-body").css("width",""))}).trigger("resize")},show_popup:function(){if("open"!=this.data.popup_status){var t=this;this.objs.popup.show(),this.animate(this.objs.popup,this.opts.styles.animation_type),setTimeout(function(){t.objs.popup_header.click(function(){t.be_offline(),t.minimize(),t.objs.popup_header.off("click")})},3e3),setTimeout(function(){switch(t.data.mode){case"online":d("#YLC_cnv_reply").focus(),t.objs.cnv.scrollTop(t.objs.cnv.prop("scrollHeight"));break;case"offline":case"login":d("#YLC_login_form .chat-line:first-child input").focus()}t.data.popup_status="open"},this.data.animation_delay)}},show_btn:function(t){this.allow_chatbox()&&(this.objs.btn.show(),this.objs.btn.find(".chat-title").html(t),this.animate(this.objs.btn,this.opts.styles.animation_type))},minimize:function(){this.data.popup_status="close",this.objs.popup&&(this.objs.popup.hide(),this.show_connecting()),this.objs.btn.show(),this.animate(this.objs.btn,this.opts.styles.animation_type)},manage_connections:function(){var e=this;this.data.ref_user&&this.data.ref_conn.on("value",function(t){!0===t.val()?(e.data.ref_user.child("connections").push(!0).onDisconnect().remove(),e.data.ref_user.child("status").set("online"),e.data.ref_user.child("status").onDisconnect().set("offline"),e.data.ref_user.child("last_online").onDisconnect().set(Firebase.ServerValue.TIMESTAMP),e.data.ref_cnv.child(e.data.user.conversation_id+"/typing/"+e.data.user.user_id).onDisconnect().remove()):e.show_offline()})},post:function(e,t,s){d.post(ylc.ajax_url+"?action="+e,t,s,"json").fail(function(t){return console.log(e,": ",t),!1})},trigger_premium:function(t,e,s,i,a,n,o){if(ylc.is_premium)return this.premium[t].call(this,e,s,i,a,n,o)},display_ntf:function(t,e,s){var i;switch(e){case"success":case"error":case"typing":i='<span class="ylc-icons ylc-icons-'+e+'"></span> ';break;default:i=""}d(s).removeClass().addClass("chat-ntf chat-"+e).html(i+t).fadeIn(300)},clean_ntf:function(){d(".chat-ntf").html("").hide()},clear_user_data:function(n,o){var r=this;this.data.ref_cnv.child(n).once("value",function(t){var e=t.val();if(e){var a=e.user_id;r.data.ref_msgs.once("value",function(t){var e=t.val(),s=e?Object.keys(e).length:0,i=0;e?d.each(e,function(t,e){i+=1,e.conversation_id===n&&r.data.ref_msgs.child(t).remove(),s===i&&o&&o()}):o&&o(),r.data.ref_users.child(a).remove(),r.data.ref_cnv.child(n).remove()})}})},total_online_ops:function(){return this.data.online_ops?Object.keys(this.data.online_ops).length:0},allow_chatbox:function(){return!!this.opts.render},animate:function(t,e){d(h).trigger("resize");var s="top"===this.opts.styles.y_pos?"Down":"Up";t.addClass("chat-anim chat-"+e+s),setTimeout(function(){t.removeClass("chat-anim chat-"+e+s)},this.data.animation_delay)},shade_color:function(t,e){var s=parseInt(t.slice(1),16),i=Math.round(2.55*e),a=(s>>16)+i,n=(s>>8&255)+i,o=(255&s)+i;return"#"+(16777216+65536*(a<255?a<1?0:a:255)+256*(n<255?n<1?0:n:255)+(o<255?o<1?0:o:255)).toString(16).slice(1)},use_white:function(t){t=t.substring(1);var e=parseInt(t,16);return.2126*(e>>16&255)+.7152*(e>>8&255)+.0722*(e>>0&255)<180},validate_email:function(t){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)},validate_username:function(t){return/^[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u017F\u0180-\u024F\u0370-\u03FF\u0400-\u04FF\u0530-\u058F\u0590-\u05FF\u0600-\u06FF\u1100-\u11FF\u3130-\u318F\uAC00-\uD7AF\u2E80-\u2EFF\u3000-\u303F\u31C0-\u31EF\u3200-\u32FF\u3300-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFE30-\uFE4F\u3040-\u309F\u30A0-\u30FF\u31F0-\u31FF\u0020\u002D\u002E\u0040\u005F]+$/gim.test(t)},md5:function(t){function r(t,e){var s,i,a,n,o;return a=2147483648&t,n=2147483648&e,o=(1073741823&t)+(1073741823&e),(s=1073741824&t)&(i=1073741824&e)?2147483648^o^a^n:s|i?1073741824&o?3221225472^o^a^n:1073741824^o^a^n:o^a^n}function e(t,e,s,i,a,n,o){return r((t=r(t,r(r(e&s|~e&i,a),o)))<<n|t>>>32-n,e)}function s(t,e,s,i,a,n,o){return r((t=r(t,r(r(e&i|s&~i,a),o)))<<n|t>>>32-n,e)}function i(t,e,s,i,a,n,o){return r((t=r(t,r(r(e^s^i,a),o)))<<n|t>>>32-n,e)}function a(t,e,s,i,a,n,o){return r((t=r(t,r(r(s^(e|~i),a),o)))<<n|t>>>32-n,e)}function n(t){var e,s="",i="";for(e=0;e<=3;e++)s+=(i="0"+(i=t>>>8*e&255).toString(16)).substr(i.length-2,2);return s}var o,_,u,l,c,d,h,p,f;for(o=function(t){for(var e,s=t.length,i=16*(((e=s+8)-e%64)/64+1),a=Array(i-1),n=0,o=0;o<s;)n=o%4*8,a[e=(o-o%4)/4]|=t.charCodeAt(o)<<n,o++;return a[e=(o-o%4)/4]|=128<<o%4*8,a[i-2]=s<<3,a[i-1]=s>>>29,a}(t=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",s=0;s<t.length;s++){var i=t.charCodeAt(s);i<128?e+=String.fromCharCode(i):(127<i&&i<2048?e+=String.fromCharCode(i>>6|192):(e+=String.fromCharCode(i>>12|224),e+=String.fromCharCode(i>>6&63|128)),e+=String.fromCharCode(63&i|128))}return e}(t)),d=1732584193,h=4023233417,p=2562383102,f=271733878,t=0;t<o.length;t+=16)h=a(h=a(h=a(h=a(h=i(h=i(h=i(h=i(h=s(h=s(h=s(h=s(h=e(h=e(h=e(h=e(u=h,p=e(l=p,f=e(c=f,d=e(_=d,h,p,f,o[t+0],7,3614090360),h,p,o[t+1],12,3905402710),d,h,o[t+2],17,606105819),f,d,o[t+3],22,3250441966),p=e(p,f=e(f,d=e(d,h,p,f,o[t+4],7,4118548399),h,p,o[t+5],12,1200080426),d,h,o[t+6],17,2821735955),f,d,o[t+7],22,4249261313),p=e(p,f=e(f,d=e(d,h,p,f,o[t+8],7,1770035416),h,p,o[t+9],12,2336552879),d,h,o[t+10],17,4294925233),f,d,o[t+11],22,2304563134),p=e(p,f=e(f,d=e(d,h,p,f,o[t+12],7,1804603682),h,p,o[t+13],12,4254626195),d,h,o[t+14],17,2792965006),f,d,o[t+15],22,1236535329),p=s(p,f=s(f,d=s(d,h,p,f,o[t+1],5,4129170786),h,p,o[t+6],9,3225465664),d,h,o[t+11],14,643717713),f,d,o[t+0],20,3921069994),p=s(p,f=s(f,d=s(d,h,p,f,o[t+5],5,3593408605),h,p,o[t+10],9,38016083),d,h,o[t+15],14,3634488961),f,d,o[t+4],20,3889429448),p=s(p,f=s(f,d=s(d,h,p,f,o[t+9],5,568446438),h,p,o[t+14],9,3275163606),d,h,o[t+3],14,4107603335),f,d,o[t+8],20,1163531501),p=s(p,f=s(f,d=s(d,h,p,f,o[t+13],5,2850285829),h,p,o[t+2],9,4243563512),d,h,o[t+7],14,1735328473),f,d,o[t+12],20,2368359562),p=i(p,f=i(f,d=i(d,h,p,f,o[t+5],4,4294588738),h,p,o[t+8],11,2272392833),d,h,o[t+11],16,1839030562),f,d,o[t+14],23,4259657740),p=i(p,f=i(f,d=i(d,h,p,f,o[t+1],4,2763975236),h,p,o[t+4],11,1272893353),d,h,o[t+7],16,4139469664),f,d,o[t+10],23,3200236656),p=i(p,f=i(f,d=i(d,h,p,f,o[t+13],4,681279174),h,p,o[t+0],11,3936430074),d,h,o[t+3],16,3572445317),f,d,o[t+6],23,76029189),p=i(p,f=i(f,d=i(d,h,p,f,o[t+9],4,3654602809),h,p,o[t+12],11,3873151461),d,h,o[t+15],16,530742520),f,d,o[t+2],23,3299628645),p=a(p,f=a(f,d=a(d,h,p,f,o[t+0],6,4096336452),h,p,o[t+7],10,1126891415),d,h,o[t+14],15,2878612391),f,d,o[t+5],21,4237533241),p=a(p,f=a(f,d=a(d,h,p,f,o[t+12],6,1700485571),h,p,o[t+3],10,2399980690),d,h,o[t+10],15,4293915773),f,d,o[t+1],21,2240044497),p=a(p,f=a(f,d=a(d,h,p,f,o[t+8],6,1873313359),h,p,o[t+15],10,4264355552),d,h,o[t+6],15,2734768916),f,d,o[t+13],21,1309151649),p=a(p,f=a(f,d=a(d,h,p,f,o[t+4],6,4149444226),h,p,o[t+11],10,3174756917),d,h,o[t+2],15,718787259),f,d,o[t+9],21,3951481745),d=r(d,_),h=r(h,u),p=r(p,l),f=r(f,c);return(n(d)+n(h)+n(p)+n(f)).toLowerCase()},random_id:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},purge_firebase:function(s){var l=this;this.data.ref_users.once("value",function(t){var e=t.val(),i=0,a=[],n=[],o=[],r=s?0:3600;if(null!==e){var _=Object.keys(e).length,u=new Date;d.each(e,function(t,e){if(i++,e)if("offline"===e.status){var s=.001*(u.getTime()-e.last_online)>>0;r<=s&&("operator"!=e.user_type?null!=e.conversation_id?n.push(e.conversation_id):a.push(t):(a.push(t),o.push(e.conversation_id)))}else if("wait"===e.status)if(e.last_online===c)a.push(t);else{s=.001*(u.getTime()-e.last_online)>>0;2*r<=s&&a.push(t)}i===_&&(d.each(a,function(t,e){l.data.ref_users.child(e).remove()}),d.each(o,function(t,e){l.data.ref_cnv.child(e).remove()}),d.each(n,function(t,e){ylc.is_premium?l.trigger_premium("save_user_data",e,!0,u.getTime()):l.clear_user_data(e)}))})}})},valid_operator:function(t){return!ylc.yith_wpv_active||(!(!ylc.yith_wpv_active||ylc.active_vendor.vendor_id!==t)||!(!ylc.yith_wpv_active||"0"!==t||ylc.vendor_only_chat))}},d.fn.ylc=function(){var t;this.data(e)instanceof i||this.data(e,new i(this)),(t=this.data(e)).el=this,t.init()},d(p).ready(function(){d.post(p.location.href,function(t){if(""!==t){var e=d("<div></div>").html(t).find("#YLC");d("#YLC").html(e.html()).ylc(),d('a[href="#yith-live-chat"]').click(function(t){t.preventDefault(),d("#YLC_chat_btn").click()})}})})}(jQuery,window,document);