diff --git a/dist/handlebars.binding.js b/dist/handlebars.binding.js index 0c94c04..4ae0c62 100644 --- a/dist/handlebars.binding.js +++ b/dist/handlebars.binding.js @@ -1,6 +1,6 @@ // handlebars.binding // ------------------ -// v0.3.7 +// v0.3.8 // // Copyright (c) 2013-2017 Mateus Maso // Distributed under MIT license @@ -1133,7 +1133,7 @@ function isObject(object) { } function isString(object) { - return toString.call(object) == '[object String]'; + return typeof object === 'string' || object instanceof String; } function uniqueId() { diff --git a/dist/handlebars.binding.min.js b/dist/handlebars.binding.min.js index 949e476..95ca6a4 100644 --- a/dist/handlebars.binding.min.js +++ b/dist/handlebars.binding.min.js @@ -1,10 +1,10 @@ // handlebars.binding // ------------------ -// v0.3.7 +// v0.3.8 // // Copyright (c) 2013-2017 Mateus Maso // Distributed under MIT license // // -!function e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[o]={exports:{}};t[o][0].call(h.exports,function(e){var n=t[o][1][e];return i(n||e)},h,h.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o'}},{key:"createAttribute",value:function(){return"hb-binding-"+this.id}},{key:"initialize",value:function(){return this.options.hash.attr?this.initializeAttribute():this.options.fn?this.initializeBlock():this.initializeInline()}},{key:"initializeAttribute",value:function(e){var t=this,n="binding-"+this.id;return u.default.Handlebars.registerAttribute(n,function(e){return null},{ready:function(e){t.setNode(e),t.render({initialize:!0}),t.observe(),delete u.default.Handlebars.attributes[n]}}),this.createAttribute()}},{key:"initializeInline",value:function(){return this.setNode(document.createTextNode("")),this.render({initialize:!0}),this.observe(),u.default.Handlebars.store.hold(this.id,(0,a.getUtils)().flatten([this.node])),new u.default.Handlebars.SafeString(this.createElement())}},{key:"initializeBlock",value:function(){this.setMarker(document.createTextNode("")),this.setDelimiter(document.createTextNode(""));var e=this.render({initialize:!0});return this.observe(),u.default.Handlebars.store.hold(this.id,(0,a.getUtils)().flatten([this.marker,e,this.delimiter])),new u.default.Handlebars.SafeString(this.createElement())}},{key:"runOutput",value:function(){this.options.fn?this.setOutput(this.options.fn(this.context)):this.setOutput(this.value)}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.runOutput(),this.options.hash.attr?this.renderAttribute(e):this.options.fn?this.renderBlock(e):this.renderInline(e)}},{key:"renderAttribute",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];1==this.options.hash.attr?this.previousOutput!=this.output&&(this.node.removeAttribute(this.previousOutput),this.node.setAttribute(this.output,"")):"class"==this.options.hash.attr?((0,o.removeClass)(this.node,this.previousOutput),(0,o.addClass)(this.node,this.output)):this.node.setAttribute(this.options.hash.attr,this.output)}},{key:"renderInline",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,a.getUtils)().isString(this.output)?this.node.textContent=(0,a.getUtils)().escapeExpression(new u.default.Handlebars.SafeString(this.output)):this.node.textContent=(0,a.getUtils)().escapeExpression(this.output)}},{key:"renderBlock",value:function(){if((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).initialize)return u.default.Handlebars.parseHTML(this.output);(0,o.removeBetween)(this.marker,this.delimiter).forEach(function(e){return(0,l.unbind)(e)}),(0,a.getUtils)().insertAfter(this.marker,u.default.Handlebars.parseHTML(this.output))}},{key:"observe",value:function(){var e=this;(0,a.getUtils)().isArray(this.value)?(this.setObserver(new s.ArrayObserver(this.value)),this.observer.open(function(){return e.render()})):(0,a.getUtils)().isObject(this.value)?(this.setObserver(new s.ObjectObserver(this.value)),this.observer.open(function(){return e.render()})):(this.setObserver(new s.PathObserver(this.context,this.keypath)),this.observer.open(function(t){e.value=t,e.render()}))}},{key:"stopObserving",value:function(){this.observer&&this.observer.close()}}]),e}();n.default=h},{"../core":5,"../deps":6,"../utils":8,"observe-js":14}],2:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(!e.splice)return u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,e);var n=e.splice;if(n.removed.length>0)for(var r=0,i=n.index;i0)for(var s=n.index;s0&&void 0!==arguments[0]&&arguments[0];1==this.options.hash.attr?(this.node.removeAttribute(this.previousOutput),this.output&&this.node.setAttribute(this.output,"")):"class"==this.options.hash.attr?((0,d.removeClass)(this.node,this.previousOutput),(0,d.addClass)(this.node,this.output)):this.node.setAttribute(this.options.hash.attr,this.output)}}]),t}(h.default);n.default=f},{"../deps":6,"../utils":8,"./binding":1,"observe-js":14}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.EachBinding=n.IfBinding=n.Binding=void 0;var i=r(e("./binding")),s=r(e("./if_binding")),o=r(e("./each_binding"));n.Binding=i.default,n.IfBinding=s.default,n.EachBinding=o.default},{"./binding":1,"./each_binding":2,"./if_binding":3}],5:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){(0,l.traverse)(e,function(e){e.binding?e.binding.observe():e.bindings&&e.bindings.forEach(function(e){return e.observe()})})}function s(e){(0,l.traverse)(e,function(e){e.binding?e.binding.stopObserving():e.bindings&&e.bindings.forEach(function(e){return e.stopObserving()})})}function o(){Platform.performMicrotaskCheckpoint()}function a(){c.default.Handlebars.registerHelper("bind",function(e,t){return new u.Binding(this,e,null,t).initialize()}),c.default.Handlebars.registerHelper("if",function(e,t){var n;return t.hash.bindAttr&&(t.hash.attr=t.hash.bindAttr,t.hash.bind=!0),t.hash.bind&&(0,h.getUtils)().isString(e)&&(n=e,e=(0,l.path)(this,n)),new u.IfBinding(this,n,e,t).initialize()}),c.default.Handlebars.registerHelper("each",function(e,t){return new u.EachBinding(this,null,e,t).initialize()}),c.default.Handlebars.registerHelper("unless",function(e,t){var n=t.fn,r=t.inverse,i=t.hash.then,s=t.hash.else;return t.fn=r,t.inverse=n,t.hash.then=s,t.hash.else=i,c.default.Handlebars.helpers.if.apply(this,[e,t])}),c.default.Handlebars.registerElement("binding",function(e){return e.id})}Object.defineProperty(n,"__esModule",{value:!0}),n.bind=i,n.unbind=s,n.update=o,n.register=a;r(e("observe-js"));var u=e("../bindings"),l=e("../utils"),h=e("../deps"),c=r(h)},{"../bindings":4,"../deps":6,"../utils":8,"observe-js":14}],6:[function(e,t,n){"use strict";function r(){return i.Handlebars.Utils}Object.defineProperty(n,"__esModule",{value:!0}),n.getUtils=r;var i={};n.default=i},{}],7:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(!l.default.Handlebars){(0,s.default)(e);var t=e.Utils.extend;t(l.default,{Handlebars:e}),t(e,{Binding:o.Binding,IfBinding:o.IfBinding,EachBinding:o.EachBinding,bind:a.bind,unbind:a.unbind,update:a.update}),t(e.Utils,{path:u.path,traverse:u.traverse,removeBetween:u.removeBetween,nodesBetween:u.nodesBetween,removeClass:u.removeClass,addClass:u.addClass,hasClass:u.hasClass,isFalsy:u.isFalsy}),(0,a.register)()}return e}Object.defineProperty(n,"__esModule",{value:!0}),n.default=i;var s=r(e("handlebars.element")),o=e("./bindings"),a=e("./core"),u=e("./utils"),l=r(e("./deps"));"undefined"!=typeof window&&window.Handlebars&&i(window.Handlebars)},{"./bindings":4,"./core":5,"./deps":6,"./utils":8,"handlebars.element":11}],8:[function(e,t,n){"use strict";function r(e){return!e||(0,c.getUtils)().isEmpty(e)}function i(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function s(e,t){if(!i(e,t))return 0==e.className.length?e.className=t:e.className+=" "+t}function o(e,t){if(i(e,t))return e.className=e.className.replace(new RegExp("(\\s|^)"+t+"(\\s|$)"),"")}function a(e,t){for(var n=e.nextSibling,r=[];n&&n!=t;){var i=n.nextSibling;r.push(n),n=i}return r}function u(e,t){var n=a(e,t);return n.forEach(function(e){return e.remove()}),n}function l(e,t){for(t.apply(this,[e]),e=e.firstChild;e;)l(e,t),e=e.nextSibling}function h(e,t){var n=t.split("."),r=e[n.shift()];return n.forEach(function(e){return r=r[e]}),r}Object.defineProperty(n,"__esModule",{value:!0}),n.isFalsy=r,n.hasClass=i,n.addClass=s,n.removeClass=o,n.nodesBetween=a,n.removeBetween=u,n.traverse=l,n.path=h;var c=e("../deps");!function(e){e&&e.__esModule}(c)},{"../deps":6}],9:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){t.options=n||{},c[e]=t}function s(e,t,n){t.options=n||{},d[e]=t}function o(e,t){var n=l.default[e];return n?e=n:"true"==e?e=!0:"false"==e?e=!1:"null"==e?e=void 0:"undefined"==e?e=void 0:isNaN(e)||""==e||(e=parseFloat(e)),t?!(!e&&""!==e):""===e?void 0:e}function a(e){var t=[];if(e instanceof h.default.Handlebars.SafeString&&(e=e.toString()),(0,u.isString)(e)){var n=document.createElement("div");n.innerHTML=e.trim();r=n.childNodes}else var r=e;for(var i=(0,u.flatten)(r);0!=i.length;){for(var s=[],o=0;o0)&&t.unshift(a)}i=s}for(o=0;o0)for(f=0;f=0;y[_]=this.parseValue(j.nodeValue,x)}var w=m.apply(p,[y]);(0,u.replaceWith)(p,w);for(f=0;f>>0&&""!==e}function i(e){return+e}function s(e){return e===Object(e)}function o(e,t){return e===t?0!==e||1/e==1/t:!(!q(e)||!q(t))||e!==e&&t!==t}function a(e){if(void 0===e)return"eof";var t=e.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return e;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return 97<=t&&t<=122||65<=t&&t<=90?"ident":49<=t&&t<=57?"number":"else"}function u(){}function l(e){for(var t,n,r,i,s,o,l,h=[],c=-1,d="beforePath",f={push:function(){void 0!==r&&(h.push(r),r=void 0)},append:function(){void 0===r?r=n:r+=n}};d;)if(c++,"\\"!=(t=e[c])||!function(){if(!(c>=e.length)){var t=e[c+1];return"inSingleQuote"==d&&"'"==t||"inDoubleQuote"==d&&'"'==t?(c++,n=t,f.append(),!0):void 0}}()){if(i=a(t),l=$[d],"error"==(s=l[i]||l.else||"error"))return;if(d=s[0],o=f[s[1]]||u,n=void 0===s[2]?t:s[2],o(),"afterPath"===d)return h}}function h(e){return Q.test(e)}function c(e,t){if(t!==W)throw Error("Use Path.get to retrieve path objects");for(var n=0;n0}function p(e){for(var t in e)return!1;return!0}function b(e){return p(e.added)&&p(e.removed)&&p(e.changed)}function _(e,t){var n,r={},i={},s={};for(n in t){var o=e[n];void 0!==o&&o===t[n]||(n in e?o!==t[n]&&(s[n]=o):i[n]=void 0)}for(n in e)n in t||(r[n]=e[n]);return Array.isArray(e)&&e.length!==t.length&&(s.length=e.length),{added:r,removed:i,changed:s}}function g(){if(!X.length)return!1;for(var e=0;e0)){for(var t=0;t=0){e.splice(a,1),a--,o-=u.addedCount-u.removed.length,i.addedCount+=u.addedCount-l;var h=i.removed.length+u.removed.length-l;if(i.addedCount||h){if(n=u.removed,i.indexu.index+u.addedCount){var d=i.removed.slice(u.index+u.addedCount-i.index);Array.prototype.push.apply(n,d)}i.removed=n,u.index0||n>0;)if(0!=t)if(0!=n){var s,o=e[t-1][n-1],a=e[t-1][n],u=e[t][n-1];(s=a'}},{key:"createAttribute",value:function(){return"hb-binding-"+this.id}},{key:"initialize",value:function(){return this.options.hash.attr?this.initializeAttribute():this.options.fn?this.initializeBlock():this.initializeInline()}},{key:"initializeAttribute",value:function(e){var t=this,n="binding-"+this.id;return u.default.Handlebars.registerAttribute(n,function(e){return null},{ready:function(e){t.setNode(e),t.render({initialize:!0}),t.observe(),delete u.default.Handlebars.attributes[n]}}),this.createAttribute()}},{key:"initializeInline",value:function(){return this.setNode(document.createTextNode("")),this.render({initialize:!0}),this.observe(),u.default.Handlebars.store.hold(this.id,(0,a.getUtils)().flatten([this.node])),new u.default.Handlebars.SafeString(this.createElement())}},{key:"initializeBlock",value:function(){this.setMarker(document.createTextNode("")),this.setDelimiter(document.createTextNode(""));var e=this.render({initialize:!0});return this.observe(),u.default.Handlebars.store.hold(this.id,(0,a.getUtils)().flatten([this.marker,e,this.delimiter])),new u.default.Handlebars.SafeString(this.createElement())}},{key:"runOutput",value:function(){this.options.fn?this.setOutput(this.options.fn(this.context)):this.setOutput(this.value)}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.runOutput(),this.options.hash.attr?this.renderAttribute(e):this.options.fn?this.renderBlock(e):this.renderInline(e)}},{key:"renderAttribute",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];1==this.options.hash.attr?this.previousOutput!=this.output&&(this.node.removeAttribute(this.previousOutput),this.node.setAttribute(this.output,"")):"class"==this.options.hash.attr?((0,o.removeClass)(this.node,this.previousOutput),(0,o.addClass)(this.node,this.output)):this.node.setAttribute(this.options.hash.attr,this.output)}},{key:"renderInline",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,a.getUtils)().isString(this.output)?this.node.textContent=(0,a.getUtils)().escapeExpression(new u.default.Handlebars.SafeString(this.output)):this.node.textContent=(0,a.getUtils)().escapeExpression(this.output)}},{key:"renderBlock",value:function(){if((arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).initialize)return u.default.Handlebars.parseHTML(this.output);(0,o.removeBetween)(this.marker,this.delimiter).forEach(function(e){return(0,l.unbind)(e)}),(0,a.getUtils)().insertAfter(this.marker,u.default.Handlebars.parseHTML(this.output))}},{key:"observe",value:function(){var e=this;(0,a.getUtils)().isArray(this.value)?(this.setObserver(new s.ArrayObserver(this.value)),this.observer.open(function(){return e.render()})):(0,a.getUtils)().isObject(this.value)?(this.setObserver(new s.ObjectObserver(this.value)),this.observer.open(function(){return e.render()})):(this.setObserver(new s.PathObserver(this.context,this.keypath)),this.observer.open(function(t){e.value=t,e.render()}))}},{key:"stopObserving",value:function(){this.observer&&this.observer.close()}}]),e}();n.default=h},{"../core":5,"../deps":6,"../utils":8,"observe-js":14}],2:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};if(!e.splice)return u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,e);var n=e.splice;if(n.removed.length>0)for(var r=0,i=n.index;i0)for(var s=n.index;s0&&void 0!==arguments[0]&&arguments[0];1==this.options.hash.attr?(this.node.removeAttribute(this.previousOutput),this.output&&this.node.setAttribute(this.output,"")):"class"==this.options.hash.attr?((0,d.removeClass)(this.node,this.previousOutput),(0,d.addClass)(this.node,this.output)):this.node.setAttribute(this.options.hash.attr,this.output)}}]),t}(h.default);n.default=f},{"../deps":6,"../utils":8,"./binding":1,"observe-js":14}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0}),n.EachBinding=n.IfBinding=n.Binding=void 0;var i=r(e("./binding")),s=r(e("./if_binding")),o=r(e("./each_binding"));n.Binding=i.default,n.IfBinding=s.default,n.EachBinding=o.default},{"./binding":1,"./each_binding":2,"./if_binding":3}],5:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){(0,l.traverse)(e,function(e){e.binding?e.binding.observe():e.bindings&&e.bindings.forEach(function(e){return e.observe()})})}function s(e){(0,l.traverse)(e,function(e){e.binding?e.binding.stopObserving():e.bindings&&e.bindings.forEach(function(e){return e.stopObserving()})})}function o(){Platform.performMicrotaskCheckpoint()}function a(){c.default.Handlebars.registerHelper("bind",function(e,t){return new u.Binding(this,e,null,t).initialize()}),c.default.Handlebars.registerHelper("if",function(e,t){var n;return t.hash.bindAttr&&(t.hash.attr=t.hash.bindAttr,t.hash.bind=!0),t.hash.bind&&(0,h.getUtils)().isString(e)&&(n=e,e=(0,l.path)(this,n)),new u.IfBinding(this,n,e,t).initialize()}),c.default.Handlebars.registerHelper("each",function(e,t){return new u.EachBinding(this,null,e,t).initialize()}),c.default.Handlebars.registerHelper("unless",function(e,t){var n=t.fn,r=t.inverse,i=t.hash.then,s=t.hash.else;return t.fn=r,t.inverse=n,t.hash.then=s,t.hash.else=i,c.default.Handlebars.helpers.if.apply(this,[e,t])}),c.default.Handlebars.registerElement("binding",function(e){return e.id})}Object.defineProperty(n,"__esModule",{value:!0}),n.bind=i,n.unbind=s,n.update=o,n.register=a;r(e("observe-js"));var u=e("../bindings"),l=e("../utils"),h=e("../deps"),c=r(h)},{"../bindings":4,"../deps":6,"../utils":8,"observe-js":14}],6:[function(e,t,n){"use strict";function r(){return i.Handlebars.Utils}Object.defineProperty(n,"__esModule",{value:!0}),n.getUtils=r;var i={};n.default=i},{}],7:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(!l.default.Handlebars){(0,s.default)(e);var t=e.Utils.extend;t(l.default,{Handlebars:e}),t(e,{Binding:o.Binding,IfBinding:o.IfBinding,EachBinding:o.EachBinding,bind:a.bind,unbind:a.unbind,update:a.update}),t(e.Utils,{path:u.path,traverse:u.traverse,removeBetween:u.removeBetween,nodesBetween:u.nodesBetween,removeClass:u.removeClass,addClass:u.addClass,hasClass:u.hasClass,isFalsy:u.isFalsy}),(0,a.register)()}return e}Object.defineProperty(n,"__esModule",{value:!0}),n.default=i;var s=r(e("handlebars.element")),o=e("./bindings"),a=e("./core"),u=e("./utils"),l=r(e("./deps"));"undefined"!=typeof window&&window.Handlebars&&i(window.Handlebars)},{"./bindings":4,"./core":5,"./deps":6,"./utils":8,"handlebars.element":11}],8:[function(e,t,n){"use strict";function r(e){return!e||(0,c.getUtils)().isEmpty(e)}function i(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function s(e,t){if(!i(e,t))return 0==e.className.length?e.className=t:e.className+=" "+t}function o(e,t){if(i(e,t))return e.className=e.className.replace(new RegExp("(\\s|^)"+t+"(\\s|$)"),"")}function a(e,t){for(var n=e.nextSibling,r=[];n&&n!=t;){var i=n.nextSibling;r.push(n),n=i}return r}function u(e,t){var n=a(e,t);return n.forEach(function(e){return e.remove()}),n}function l(e,t){for(t.apply(this,[e]),e=e.firstChild;e;)l(e,t),e=e.nextSibling}function h(e,t){var n=t.split("."),r=e[n.shift()];return n.forEach(function(e){return r=r[e]}),r}Object.defineProperty(n,"__esModule",{value:!0}),n.isFalsy=r,n.hasClass=i,n.addClass=s,n.removeClass=o,n.nodesBetween=a,n.removeBetween=u,n.traverse=l,n.path=h;var c=e("../deps");!function(e){e&&e.__esModule}(c)},{"../deps":6}],9:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){t.options=n||{},c[e]=t}function s(e,t,n){t.options=n||{},d[e]=t}function o(e,t){var n=l.default[e];return n?e=n:"true"==e?e=!0:"false"==e?e=!1:"null"==e?e=void 0:"undefined"==e?e=void 0:isNaN(e)||""==e||(e=parseFloat(e)),t?!(!e&&""!==e):""===e?void 0:e}function a(e){var t=[];if(e instanceof h.default.Handlebars.SafeString&&(e=e.toString()),(0,u.isString)(e)){var n=document.createElement("div");n.innerHTML=e.trim();r=n.childNodes}else var r=e;for(var i=(0,u.flatten)(r);0!=i.length;){for(var s=[],o=0;o0)&&t.unshift(a)}i=s}for(o=0;o0)for(f=0;f=0;y[_]=this.parseValue(j.nodeValue,x)}var w=m.apply(p,[y]);(0,u.replaceWith)(p,w);for(f=0;f>>0&&""!==e}function i(e){return+e}function s(e){return e===Object(e)}function o(e,t){return e===t?0!==e||1/e==1/t:!(!q(e)||!q(t))||e!==e&&t!==t}function a(e){if(void 0===e)return"eof";var t=e.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return e;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return 97<=t&&t<=122||65<=t&&t<=90?"ident":49<=t&&t<=57?"number":"else"}function u(){}function l(e){for(var t,n,r,i,s,o,l,h=[],c=-1,d="beforePath",f={push:function(){void 0!==r&&(h.push(r),r=void 0)},append:function(){void 0===r?r=n:r+=n}};d;)if(c++,"\\"!=(t=e[c])||!function(){if(!(c>=e.length)){var t=e[c+1];return"inSingleQuote"==d&&"'"==t||"inDoubleQuote"==d&&'"'==t?(c++,n=t,f.append(),!0):void 0}}()){if(i=a(t),l=$[d],"error"==(s=l[i]||l.else||"error"))return;if(d=s[0],o=f[s[1]]||u,n=void 0===s[2]?t:s[2],o(),"afterPath"===d)return h}}function h(e){return Q.test(e)}function c(e,t){if(t!==W)throw Error("Use Path.get to retrieve path objects");for(var n=0;n0}function p(e){for(var t in e)return!1;return!0}function b(e){return p(e.added)&&p(e.removed)&&p(e.changed)}function _(e,t){var n,r={},i={},s={};for(n in t){var o=e[n];void 0!==o&&o===t[n]||(n in e?o!==t[n]&&(s[n]=o):i[n]=void 0)}for(n in e)n in t||(r[n]=e[n]);return Array.isArray(e)&&e.length!==t.length&&(s.length=e.length),{added:r,removed:i,changed:s}}function g(){if(!X.length)return!1;for(var e=0;e0)){for(var t=0;t=0){e.splice(a,1),a--,o-=u.addedCount-u.removed.length,i.addedCount+=u.addedCount-l;var h=i.removed.length+u.removed.length-l;if(i.addedCount||h){if(n=u.removed,i.indexu.index+u.addedCount){var d=i.removed.slice(u.index+u.addedCount-i.index);Array.prototype.push.apply(n,d)}i.removed=n,u.index0||n>0;)if(0!=t)if(0!=n){var s,o=e[t-1][n-1],a=e[t-1][n],u=e[t][n-1];(s=a