muu

DEPRECATED lightweight JS framework
git clone https://git.ce9e.org/muu.git

commit
289c08d68a923b9e4606fbc087a903504fe17bfa
parent
7e34e9f2e67fbe215151d9c0829441331e8fb9ce
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2016-02-19 23:18
build

Diffstat

M dist/muu-core.js 68 +++++++++++++++++++++++++++++++------------------------------
M dist/muu-core.min.js 16 ++++++++--------
M dist/muu.js 100 +++++++++++++++++++++++++++++++------------------------------
M dist/muu.min.js 40 ++++++++++++++++++++--------------------

4 files changed, 114 insertions, 110 deletions


diff --git a/dist/muu-core.js b/dist/muu-core.js

@@ -2,7 +2,9 @@
    2     2     var name = 'muu';
    3     3 
    4     4     (function(factory) {
    5    -1         if (typeof define === 'function' && define.amd) {
   -1     5         if (typeof module === 'object' && typeof module.exports === 'object') {
   -1     6             module.exports = factory(require('lodash'));
   -1     7         } else if (typeof define === 'function' && define.amd) {
    6     8             define(name, ['lodash'], factory);
    7     9         } else {
    8    10             window[name] = factory(window._);
@@ -45,11 +47,31 @@
   45    47         };
   46    48 
   47    49         /**
   -1    50          * This module gives access to the following objects:
   -1    51          *
   -1    52          * -   `Registry` - {@link Registry}
   -1    53          * -   `$` - {@link module:dom-helpers}
   -1    54          * -   `$location` - {@link module:location}
   -1    55          *
   -1    56          * @module muu
   -1    57          */
   -1    58         _define('muu', ['registry', 'dom-helpers', 'location'], function(Registry, $, $location) {
   -1    59             "use strict";
   -1    60 
   -1    61             var module = {};
   -1    62 
   -1    63             module.Registry = Registry;
   -1    64             module.$ = $;
   -1    65             module.$location = $location;
   -1    66 
   -1    67             return module;
   -1    68         });
   -1    69         /**
   48    70          * Exports the {@link Directive} class.
   49    -1          * @module muu-directive
   -1    71          * @module directive
   50    72          * @ignore
   51    73          */
   52    -1         _define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers'], function($, _) {
   -1    74         _define('directive', ['dom-helpers', 'js-helpers'], function($, _) {
   53    75             "use strict";
   54    76 
   55    77             /**
@@ -100,7 +122,7 @@
  100   122                  * Rerender `template` with `data` and push the changes to the DOM.
  101   123                  *
  102   124                  * @param {Object.<string, *>} data
  103    -1                  * @see {@link module:muu-update-dom} for details.
   -1   125                  * @see {@link module:update-dom} for details.
  104   126                  * @see The templating system can be defined in the {@link Registry}.
  105   127                  */
  106   128                 this.update = function(data) {
@@ -244,9 +266,9 @@
  244   266         });
  245   267         /**
  246   268          * DOM related helper functions
  247    -1          * @module muu-dom-helpers
   -1   269          * @module dom-helpers
  248   270          */
  249    -1         _define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   -1   271         _define("dom-helpers", ['js-helpers'], function(_) {
  250   272             "use strict";
  251   273 
  252   274             var entityMap = {
@@ -258,7 +280,7 @@
  258   280                 '/': '&#x2F;'
  259   281             };
  260   282 
  261    -1             /** @lends module:muu-dom-helpers */
   -1   283             /** @lends module:dom-helpers */
  262   284             var $ = {};
  263   285 
  264   286             $.DELAY = 1000;
@@ -422,31 +444,11 @@
  422   444             return $;
  423   445         });
  424   446         /**
  425    -1          * This module gives access to the following objects:
  426    -1          *
  427    -1          * -   `Registry` - {@link Registry}
  428    -1          * -   `$` - {@link module:muu-dom-helpers}
  429    -1          * -   `$location` - {@link module:muu-location}
  430    -1          *
  431    -1          * @module muu
  432    -1          */
  433    -1         _define('muu', ['muu-registry', 'muu-dom-helpers', 'muu-location'], function(Registry, $, $location) {
  434    -1             "use strict";
  435    -1 
  436    -1             var module = {};
  437    -1 
  438    -1             module.Registry = Registry;
  439    -1             module.$ = $;
  440    -1             module.$location = $location;
  441    -1 
  442    -1             return module;
  443    -1         });
  444    -1         /**
  445   447          * Exports the {@link Registry} class.
  446    -1          * @module muu-registry
   -1   448          * @module registry
  447   449          * @ignore
  448   450          */
  449    -1         _define('muu-registry', ['muu-template', 'muu-update-dom', 'muu-directive', 'muu-js-helpers', 'muu-dom-helpers'], function(muuTemplate, muuUpdateDOM, Directive, _, $) {
   -1   451         _define('registry', ['template', 'update-dom', 'directive', 'js-helpers', 'dom-helpers'], function(muuTemplate, muuUpdateDOM, Directive, _, $) {
  450   452             "use strict";
  451   453 
  452   454             /**
@@ -457,9 +459,9 @@
  457   459              *   directive objects are available as properties from the DOM as
  458   460              *   `element.directive`.
  459   461              * - **renderer** - `{function(string, Object): string}` - The template
  460    -1              *   renderer to be used. Defaults to {@link module:muu-template}.
   -1   462              *   renderer to be used. Defaults to {@link module:template}.
  461   463              * - **updateDOM** - `{function(Node, string)}` - The DOM updater to be
  462    -1              *   used. Defaults to {@link module:muu-update-dom}.
   -1   464              *   used. Defaults to {@link module:update-dom}.
  463   465              */
  464   466             var Registry = function(config) {
  465   467                 var self = this;
@@ -600,11 +602,11 @@
  600   602          *
  601   603          * All classes prefixed with `muu-` will be preserved.
  602   604          *
  603    -1          * @module muu-update-dom
   -1   605          * @module update-dom
  604   606          * @param {Node} target
  605   607          * @param {string} html
  606   608          */
  607    -1         _define('muu-update-dom', ['muu-js-helpers'], function(_) {
   -1   609         _define('update-dom', ['js-helpers'], function(_) {
  608   610             "use strict";
  609   611 
  610   612             var updateAttributes = function(target, source) {

diff --git a/dist/muu-core.min.js b/dist/muu-core.min.js

@@ -1,11 +1,11 @@
    1    -1 (function(r,q,n){(function(k){"function"===typeof define&&define.amd?define("muu",["lodash"],k):r.muu=k(r._)})(function(k){var p={};p["muu-js-helpers"]={instance:k};var t=function(d,f){for(var g=[],a=0;a<d.length;a++)g.push(f(d[a]));return g};k=function(d,f,g){p[d]={deps:f,factory:g}};var s=function(d){if(!p[d])return n;p[d].instance||(p[d].instance=p[d].factory.apply(n,t(p[d].deps,s)));return p[d].instance};k("muu-directive",["muu-dom-helpers","muu-js-helpers"],function(d,f){return function(g,a,
    2    -1 b){var c=this;g.innerHTML="";var m=function(a){var e=a.currentTarget,h="data-on"+a.type;-1!==f.indexOf(c.querySelectorAll("["+h+"]"),e)&&(e=e.getAttribute(h),a=d.createEvent("muu-"+e,n,n,a),g.dispatchEvent(a))};this.update=function(l){b.updateDOM(g,b.renderer(a,l));f.forEach(b.events,function(e){f.forEach(c.querySelectorAll("[data-on"+e+"]"),function(a){a.addEventListener(e,m,!1)})});var e=d.createEvent("muu-parent-update");l=c.querySelectorAll("muu.muu-initialised");f.forEach(l,function(a){a.dispatchEvent(e)});
    3    -1 b.linkAll(c)};this.querySelectorAll=function(a){var e=g.querySelectorAll(a),h=g.querySelectorAll(".muu-isolate"),h=f.union.apply(f,f.map(h,function(e){return e.querySelectorAll(a)}));return f.difference(e,h)};this.querySelector=function(a){a=c.querySelectorAll(a);if(0<a.length)return a[0]};this.on=function(a,e){return d.on(g,"muu-"+a,function(a){return e(a.detail)})};this.getModel=function(a,e){if(a===n){var h={};f.forEach(c.querySelectorAll("[name]"),function(a){h[a.name]=c.getModel(a.name)});return h}var b=
    4    -1 c.querySelector("[name="+a+"]");return b===n?e:"number"===b.getAttribute("type")?parseFloat(b.value):"checkbox"===b.getAttribute("type")?b.checked:"radio"===b.getAttribute("type")?(b=c.querySelectorAll("[name="+a+"]"),d.getRadio(b)||e):b.value};this.setModel=function(a,e){if(c.getModel(a)!==e){var b=c.querySelector("[name="+a+"]");"checkbox"===b.getAttribute("type")?b.checked=e:"radio"===b.getAttribute("type")?(b=c.querySelectorAll("[name="+a+"]"),d.setRadio(b,e)):b.value=e}}}});k("muu-dom-helpers",
    5    -1 ["muu-js-helpers"],function(d){var f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},g={DELAY:1E3,escapeHtml:function(a){return String(a).replace(/[&<>"'\/]/g,function(a){return f[a]})},createEvent:function(a,b,c,d){if("function"===typeof CustomEvent)return new CustomEvent(a,{detail:d,bubbles:b,cancelable:c});var g=q.createEvent("CustomEvent");g.initCustomEvent(a,b,c,d);return g},on:function(a,b,c){a.addEventListener(b,c,!1);return function(){a.removeEventListener(b,c,!1)}},
    6    -1 ready:function(a){a=d.once(a);if("complete"===q.readyState)return a(),function(){};var b=g.on(q,"DOMContentLoaded",a),c=g.on(r,"load",a);return function(){b();c()}},isDescendant:function(a,b){return!!a&&(a===b||g.isDescendant(a.parentNode,b))},destroy:function(a,b){var c;if(r.MutationObserver){var f=new MutationObserver(function(){g.isDescendant(a,q)||(b(),c())});f.observe(q,{childList:!0,subtree:!0});c=d.once(function(){f.disconnect();f=n})}else{var l=setInterval(function(){g.isDescendant(a,q)||
    7    -1 (b(),c())},g.DELAY);c=function(){clearInterval(l)}}return c},getRadio:function(a){for(var b=0;b<a.length;b++)if(a[b].checked)return a[b].value},setRadio:function(a,b){d.forEach(a,function(a){a.checked=a.value===b?!0:!1})}};return g});k("muu",["muu-registry","muu-dom-helpers","muu-location"],function(d,f,g){var a={};a.Registry=d;a.$=f;a.$location=g;return a});k("muu-registry",["muu-template","muu-update-dom","muu-directive","muu-js-helpers","muu-dom-helpers"],function(d,f,g,a,b){return function(c){var m=
   -1     1 (function(r,q,n){(function(k){"object"===typeof module&&"object"===typeof module.exports?module.exports=k(require("lodash")):"function"===typeof define&&define.amd?define("muu",["lodash"],k):r.muu=k(r._)})(function(k){var p={};p["muu-js-helpers"]={instance:k};var t=function(d,f){for(var g=[],a=0;a<d.length;a++)g.push(f(d[a]));return g};k=function(d,f,g){p[d]={deps:f,factory:g}};var s=function(d){if(!p[d])return n;p[d].instance||(p[d].instance=p[d].factory.apply(n,t(p[d].deps,s)));return p[d].instance};
   -1     2 k("muu",["registry","dom-helpers","location"],function(d,f,g){var a={};a.Registry=d;a.$=f;a.$location=g;return a});k("directive",["dom-helpers","js-helpers"],function(d,f){return function(g,a,b){var c=this;g.innerHTML="";var m=function(a){var e=a.currentTarget,h="data-on"+a.type;-1!==f.indexOf(c.querySelectorAll("["+h+"]"),e)&&(e=e.getAttribute(h),a=d.createEvent("muu-"+e,n,n,a),g.dispatchEvent(a))};this.update=function(l){b.updateDOM(g,b.renderer(a,l));f.forEach(b.events,function(e){f.forEach(c.querySelectorAll("[data-on"+
   -1     3 e+"]"),function(a){a.addEventListener(e,m,!1)})});var e=d.createEvent("muu-parent-update");l=c.querySelectorAll("muu.muu-initialised");f.forEach(l,function(a){a.dispatchEvent(e)});b.linkAll(c)};this.querySelectorAll=function(a){var e=g.querySelectorAll(a),h=g.querySelectorAll(".muu-isolate"),h=f.union.apply(f,f.map(h,function(e){return e.querySelectorAll(a)}));return f.difference(e,h)};this.querySelector=function(a){a=c.querySelectorAll(a);if(0<a.length)return a[0]};this.on=function(a,e){return d.on(g,
   -1     4 "muu-"+a,function(a){return e(a.detail)})};this.getModel=function(a,e){if(a===n){var h={};f.forEach(c.querySelectorAll("[name]"),function(a){h[a.name]=c.getModel(a.name)});return h}var b=c.querySelector("[name="+a+"]");return b===n?e:"number"===b.getAttribute("type")?parseFloat(b.value):"checkbox"===b.getAttribute("type")?b.checked:"radio"===b.getAttribute("type")?(b=c.querySelectorAll("[name="+a+"]"),d.getRadio(b)||e):b.value};this.setModel=function(a,e){if(c.getModel(a)!==e){var b=c.querySelector("[name="+
   -1     5 a+"]");"checkbox"===b.getAttribute("type")?b.checked=e:"radio"===b.getAttribute("type")?(b=c.querySelectorAll("[name="+a+"]"),d.setRadio(b,e)):b.value=e}}}});k("dom-helpers",["js-helpers"],function(d){var f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},g={DELAY:1E3,escapeHtml:function(a){return String(a).replace(/[&<>"'\/]/g,function(a){return f[a]})},createEvent:function(a,b,c,d){if("function"===typeof CustomEvent)return new CustomEvent(a,{detail:d,bubbles:b,cancelable:c});
   -1     6 var g=q.createEvent("CustomEvent");g.initCustomEvent(a,b,c,d);return g},on:function(a,b,c){a.addEventListener(b,c,!1);return function(){a.removeEventListener(b,c,!1)}},ready:function(a){a=d.once(a);if("complete"===q.readyState)return a(),function(){};var b=g.on(q,"DOMContentLoaded",a),c=g.on(r,"load",a);return function(){b();c()}},isDescendant:function(a,b){return!!a&&(a===b||g.isDescendant(a.parentNode,b))},destroy:function(a,b){var c;if(r.MutationObserver){var f=new MutationObserver(function(){g.isDescendant(a,
   -1     7 q)||(b(),c())});f.observe(q,{childList:!0,subtree:!0});c=d.once(function(){f.disconnect();f=n})}else{var l=setInterval(function(){g.isDescendant(a,q)||(b(),c())},g.DELAY);c=function(){clearInterval(l)}}return c},getRadio:function(a){for(var b=0;b<a.length;b++)if(a[b].checked)return a[b].value},setRadio:function(a,b){d.forEach(a,function(a){a.checked=a.value===b?!0:!1})}};return g});k("registry",["template","update-dom","directive","js-helpers","dom-helpers"],function(d,f,g,a,b){return function(c){var m=
    8     8 this,l={};this.config=c||{};this.renderer=m.config.renderer||d;this.updateDOM=m.config.updateDOM||f;this.events=["keydown","keyup","click","change","search"];this.registerDirective=function(a,b,c){l[a]={template:b,link:c};return m};this.registerModule=function(a){a(m);return m};this.link=function(a,c){c===n&&(c=a.getAttribute("type"));if(!l.hasOwnProperty(c))throw Error("Unknown directive type: "+c);var d=l[c].link,f=new g(a,l[c].template,m),d=d(f,a);a.classList.add("muu-isolate");a.classList.add("muu-initialised");
    9    -1 m.config.debug&&(a.directive=f);d!==n&&b.destroy(a,d);return f};this.linkAll=function(b){b=a.filter(b.querySelectorAll("muu"),function(a){return!a.classList.contains("muu-initialised")});return a.map(b,function(a){return m.link(a)})}}});k("muu-update-dom",["muu-js-helpers"],function(d){var f=function(a,b){var c=d.filter(a.classList,function(a){return 0===a.lastIndexOf("muu-",0)}),f=d.map(a.attributes,function(a){return a.name}),g=d.map(b.attributes,function(a){return a.name});d.forEach(f,function(c){b.hasAttribute(c)||
   -1     9 m.config.debug&&(a.directive=f);d!==n&&b.destroy(a,d);return f};this.linkAll=function(b){b=a.filter(b.querySelectorAll("muu"),function(a){return!a.classList.contains("muu-initialised")});return a.map(b,function(a){return m.link(a)})}}});k("update-dom",["js-helpers"],function(d){var f=function(a,b){var c=d.filter(a.classList,function(a){return 0===a.lastIndexOf("muu-",0)}),f=d.map(a.attributes,function(a){return a.name}),g=d.map(b.attributes,function(a){return a.name});d.forEach(f,function(c){b.hasAttribute(c)||
   10    10 "__IE8__"===c.substr(0,7)||a.removeAttribute(c)});d.forEach(g,function(c){a.getAttribute(c)!==b.getAttribute(c)&&a.setAttribute(c,b.getAttribute(c))});d.forEach(c,function(b){a.classList.add(b)})},g=function(a,b){for(var c=a.childNodes.length,d=b.childNodes.length,l=0,e=d;e<c;e++)a.removeChild(a.childNodes[d]);for(e=c;e<d;e++)a.appendChild(b.childNodes[c]);for(e=0;e<c&&e<d;e++){var h=a.childNodes[e],k=b.childNodes[e-l];h.nodeType===k.nodeType&&h.nodeName===k.nodeName&&h.type===k.type?(1===h.nodeType?
   11    11 f(h,k):3===h.nodeType&&(h.nodeValue=k.nodeValue),3===h.nodeType||h.classList.contains("muu-isolate")||g(h,k)):(h.parentNode.replaceChild(k,h),l+=1)}};return function(a,b){var c=q.createElement("div");c.innerHTML=b;g(a,c)}});return s("muu")})})(window,document,void 0);

diff --git a/dist/muu.js b/dist/muu.js

@@ -2,7 +2,9 @@
    2     2     var name = 'muu';
    3     3 
    4     4     (function(factory) {
    5    -1         if (typeof define === 'function' && define.amd) {
   -1     5         if (typeof module === 'object' && typeof module.exports === 'object') {
   -1     6             module.exports = factory();
   -1     7         } else if (typeof define === 'function' && define.amd) {
    6     8             define(name, [], factory);
    7     9         } else {
    8    10             window[name] = factory(window._);
@@ -46,10 +48,10 @@
   46    48 
   47    49         /**
   48    50          * Exports the {@link Directive} class.
   49    -1          * @module muu-directive
   -1    51          * @module directive
   50    52          * @ignore
   51    53          */
   52    -1         _define('muu-directive', ['muu-dom-helpers', 'muu-js-helpers'], function($, _) {
   -1    54         _define('directive', ['dom-helpers', 'js-helpers'], function($, _) {
   53    55             "use strict";
   54    56 
   55    57             /**
@@ -100,7 +102,7 @@
  100   102                  * Rerender `template` with `data` and push the changes to the DOM.
  101   103                  *
  102   104                  * @param {Object.<string, *>} data
  103    -1                  * @see {@link module:muu-update-dom} for details.
   -1   105                  * @see {@link module:update-dom} for details.
  104   106                  * @see The templating system can be defined in the {@link Registry}.
  105   107                  */
  106   108                 this.update = function(data) {
@@ -244,9 +246,9 @@
  244   246         });
  245   247         /**
  246   248          * DOM related helper functions
  247    -1          * @module muu-dom-helpers
   -1   249          * @module dom-helpers
  248   250          */
  249    -1         _define("muu-dom-helpers", ['muu-js-helpers'], function(_) {
   -1   251         _define("dom-helpers", ['js-helpers'], function(_) {
  250   252             "use strict";
  251   253 
  252   254             var entityMap = {
@@ -258,7 +260,7 @@
  258   260                 '/': '&#x2F;'
  259   261             };
  260   262 
  261    -1             /** @lends module:muu-dom-helpers */
   -1   263             /** @lends module:dom-helpers */
  262   264             var $ = {};
  263   265 
  264   266             $.DELAY = 1000;
@@ -422,13 +424,33 @@
  422   424             return $;
  423   425         });
  424   426         /**
   -1   427          * This module gives access to the following objects:
   -1   428          *
   -1   429          * -   `Registry` - {@link Registry}
   -1   430          * -   `$` - {@link module:dom-helpers}
   -1   431          * -   `$location` - {@link module:location}
   -1   432          *
   -1   433          * @module muu
   -1   434          */
   -1   435         _define('muu', ['registry', 'dom-helpers', 'location'], function(Registry, $, $location) {
   -1   436             "use strict";
   -1   437 
   -1   438             var module = {};
   -1   439 
   -1   440             module.Registry = Registry;
   -1   441             module.$ = $;
   -1   442             module.$location = $location;
   -1   443 
   -1   444             return module;
   -1   445         });
   -1   446         /**
  425   447          * Minimal implementation of an underscore/lodash subset.
  426    -1          * @module muu-js-helpers
   -1   448          * @module js-helpers
  427   449          */
  428    -1         _define('muu-js-helpers', [], function() {
   -1   450         _define('js-helpers', [], function() {
  429   451             "use strict";
  430   452 
  431    -1             /** @lends module:muu-js-helpers */
   -1   453             /** @lends module:js-helpers */
  432   454             var _ = {};
  433   455 
  434   456             /**
@@ -612,12 +634,12 @@
  612   634         });
  613   635         /**
  614   636          * angular inspired location service.
  615    -1          * @module muu-location
   -1   637          * @module location
  616   638          */
  617    -1         _define('muu-location', ['muu-search'], function(q) {
   -1   639         _define('location', ['search'], function(q) {
  618   640             "use strict";
  619   641 
  620    -1             /** @lends module:muu-location */
   -1   642             /** @lends module:location */
  621   643             var loc = {};
  622   644 
  623   645             /**
@@ -634,7 +656,7 @@
  634   656              *//**
  635   657              * @param {string} value
  636   658              * @param {boolean} [replace]
  637    -1              * @return {muu-location}
   -1   659              * @return {location}
  638   660              */
  639   661             loc.url = function(value, replace) {
  640   662                 if (value === undefined) {
@@ -677,7 +699,7 @@
  677   699              *//**
  678   700              * @param {string} value
  679   701              * @param {boolean} [replace]
  680    -1              * @return {muu-location}
   -1   702              * @return {location}
  681   703              */
  682   704             loc.path = function(value, replace) {
  683   705                 if (value === undefined) {
@@ -711,12 +733,12 @@
  711   733              * @nosideeffects
  712   734              *//**
  713   735              * @param {string|object} value
  714    -1              * @return {muu-location}
   -1   736              * @return {location}
  715   737              *//**
  716   738              * @param {string} key
  717   739              * @param {*} value
  718   740              * @param {boolean} [replace]
  719    -1              * @return {muu-location}
   -1   741              * @return {location}
  720   742              */
  721   743             loc.search = function(key, value, replace) {
  722   744                 if (key !== undefined) {
@@ -738,7 +760,7 @@
  738   760              *//**
  739   761              * @param {string} value
  740   762              * @param {boolean} [replace]
  741    -1              * @return {muu-location}
   -1   763              * @return {location}
  742   764              */
  743   765             loc.hash = function(value, replace) {
  744   766                 if (value === undefined) {
@@ -757,7 +779,7 @@
  757   779             /**
  758   780              * @param {string} eventName
  759   781              * @param {Function} fn
  760    -1              * @return {muu-location}
   -1   782              * @return {location}
  761   783              */
  762   784             loc.addEventListener = function(eventName, fn) {
  763   785                 if (eventName === 'change') {
@@ -769,7 +791,7 @@
  769   791             /**
  770   792              * @param {string} eventName
  771   793              * @param {Function} fn
  772    -1              * @return {muu-location}
   -1   794              * @return {location}
  773   795              */
  774   796             loc.removeEventListener = function(eventName, fn) {
  775   797                 if (eventName === 'change') {
@@ -782,10 +804,10 @@
  782   804         });
  783   805         /**
  784   806          * Exports the {@link Registry} class.
  785    -1          * @module muu-registry
   -1   807          * @module registry
  786   808          * @ignore
  787   809          */
  788    -1         _define('muu-registry', ['muu-template', 'muu-update-dom', 'muu-directive', 'muu-js-helpers', 'muu-dom-helpers'], function(muuTemplate, muuUpdateDOM, Directive, _, $) {
   -1   810         _define('registry', ['template', 'update-dom', 'directive', 'js-helpers', 'dom-helpers'], function(muuTemplate, muuUpdateDOM, Directive, _, $) {
  789   811             "use strict";
  790   812 
  791   813             /**
@@ -796,9 +818,9 @@
  796   818              *   directive objects are available as properties from the DOM as
  797   819              *   `element.directive`.
  798   820              * - **renderer** - `{function(string, Object): string}` - The template
  799    -1              *   renderer to be used. Defaults to {@link module:muu-template}.
   -1   821              *   renderer to be used. Defaults to {@link module:template}.
  800   822              * - **updateDOM** - `{function(Node, string)}` - The DOM updater to be
  801    -1              *   used. Defaults to {@link module:muu-update-dom}.
   -1   823              *   used. Defaults to {@link module:update-dom}.
  802   824              */
  803   825             var Registry = function(config) {
  804   826                 var self = this;
@@ -918,7 +940,7 @@
  918   940 
  919   941             return Registry;
  920   942         });
  921    -1         _define('muu-search', ['muu-js-helpers'], function(_) {
   -1   943         _define('search', ['js-helpers'], function(_) {
  922   944             "use strict";
  923   945 
  924   946             var q = {};
@@ -1039,13 +1061,13 @@
 1039  1061          * muuTemplate('{{#this}}{{this}}{{/this}}', [1, 2]);
 1040  1062          * ```
 1041  1063          *
 1042    -1          * @module muu-template
   -1  1064          * @module template
 1043  1065          * @param {string} template
 1044  1066          * @param {Object} data
 1045  1067          * @return {string}
 1046  1068          * @nosideeffects
 1047  1069          */
 1048    -1         _define('muu-template', ['muu-js-helpers', 'muu-dom-helpers'], function(_, $) {
   -1  1070         _define('template', ['js-helpers', 'dom-helpers'], function(_, $) {
 1049  1071             "use strict";
 1050  1072 
 1051  1073             var openTag = '{{';
@@ -1226,11 +1248,11 @@
 1226  1248          *
 1227  1249          * All classes prefixed with `muu-` will be preserved.
 1228  1250          *
 1229    -1          * @module muu-update-dom
   -1  1251          * @module update-dom
 1230  1252          * @param {Node} target
 1231  1253          * @param {string} html
 1232  1254          */
 1233    -1         _define('muu-update-dom', ['muu-js-helpers'], function(_) {
   -1  1255         _define('update-dom', ['js-helpers'], function(_) {
 1234  1256             "use strict";
 1235  1257 
 1236  1258             var updateAttributes = function(target, source) {
@@ -1298,26 +1320,6 @@
 1298  1320                 updateDOM(target, tmp);
 1299  1321             }
 1300  1322         });
 1301    -1         /**
 1302    -1          * This module gives access to the following objects:
 1303    -1          *
 1304    -1          * -   `Registry` - {@link Registry}
 1305    -1          * -   `$` - {@link module:muu-dom-helpers}
 1306    -1          * -   `$location` - {@link module:muu-location}
 1307    -1          *
 1308    -1          * @module muu
 1309    -1          */
 1310    -1         _define('muu', ['muu-registry', 'muu-dom-helpers', 'muu-location'], function(Registry, $, $location) {
 1311    -1             "use strict";
 1312    -1 
 1313    -1             var module = {};
 1314    -1 
 1315    -1             module.Registry = Registry;
 1316    -1             module.$ = $;
 1317    -1             module.$location = $location;
 1318    -1 
 1319    -1             return module;
 1320    -1         });
 1321  1323 
 1322  1324         return _require(name);
 1323  1325     });

diff --git a/dist/muu.min.js b/dist/muu.min.js

@@ -1,20 +1,20 @@
    1    -1 (function(q,l,k){(function(k){"function"===typeof define&&define.amd?define("muu",[],k):q.muu=k(q._)})(function(g){var n={};n["muu-js-helpers"]={instance:g};var t=function(d,c){for(var e=[],a=0;a<d.length;a++)e.push(c(d[a]));return e};g=function(d,c,e){n[d]={deps:c,factory:e}};var s=function(d){if(!n[d])return k;n[d].instance||(n[d].instance=n[d].factory.apply(k,t(n[d].deps,s)));return n[d].instance};g("muu-directive",["muu-dom-helpers","muu-js-helpers"],function(d,c){return function(e,a,b){var h=
    2    -1 this;e.innerHTML="";var f=function(a){var b=a.currentTarget,m="data-on"+a.type;-1!==c.indexOf(h.querySelectorAll("["+m+"]"),b)&&(b=b.getAttribute(m),a=d.createEvent("muu-"+b,k,k,a),e.dispatchEvent(a))};this.update=function(p){b.updateDOM(e,b.renderer(a,p));c.forEach(b.events,function(a){c.forEach(h.querySelectorAll("[data-on"+a+"]"),function(b){b.addEventListener(a,f,!1)})});var r=d.createEvent("muu-parent-update");p=h.querySelectorAll("muu.muu-initialised");c.forEach(p,function(a){a.dispatchEvent(r)});
    3    -1 b.linkAll(h)};this.querySelectorAll=function(a){var b=e.querySelectorAll(a),d=e.querySelectorAll(".muu-isolate"),d=c.union.apply(c,c.map(d,function(b){return b.querySelectorAll(a)}));return c.difference(b,d)};this.querySelector=function(a){a=h.querySelectorAll(a);if(0<a.length)return a[0]};this.on=function(a,b){return d.on(e,"muu-"+a,function(a){return b(a.detail)})};this.getModel=function(a,b){if(a===k){var m={};c.forEach(h.querySelectorAll("[name]"),function(a){m[a.name]=h.getModel(a.name)});return m}var e=
    4    -1 h.querySelector("[name="+a+"]");return e===k?b:"number"===e.getAttribute("type")?parseFloat(e.value):"checkbox"===e.getAttribute("type")?e.checked:"radio"===e.getAttribute("type")?(e=h.querySelectorAll("[name="+a+"]"),d.getRadio(e)||b):e.value};this.setModel=function(a,b){if(h.getModel(a)!==b){var c=h.querySelector("[name="+a+"]");"checkbox"===c.getAttribute("type")?c.checked=b:"radio"===c.getAttribute("type")?(c=h.querySelectorAll("[name="+a+"]"),d.setRadio(c,b)):c.value=b}}}});g("muu-dom-helpers",
    5    -1 ["muu-js-helpers"],function(d){var c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},e={DELAY:1E3,escapeHtml:function(a){return String(a).replace(/[&<>"'\/]/g,function(a){return c[a]})},createEvent:function(a,b,c,d){if("function"===typeof CustomEvent)return new CustomEvent(a,{detail:d,bubbles:b,cancelable:c});var e=l.createEvent("CustomEvent");e.initCustomEvent(a,b,c,d);return e},on:function(a,b,c){a.addEventListener(b,c,!1);return function(){a.removeEventListener(b,c,!1)}},
    6    -1 ready:function(a){a=d.once(a);if("complete"===l.readyState)return a(),function(){};var b=e.on(l,"DOMContentLoaded",a),c=e.on(q,"load",a);return function(){b();c()}},isDescendant:function(a,b){return!!a&&(a===b||e.isDescendant(a.parentNode,b))},destroy:function(a,b){var c;if(q.MutationObserver){var f=new MutationObserver(function(){e.isDescendant(a,l)||(b(),c())});f.observe(l,{childList:!0,subtree:!0});c=d.once(function(){f.disconnect();f=k})}else{var p=setInterval(function(){e.isDescendant(a,l)||
    7    -1 (b(),c())},e.DELAY);c=function(){clearInterval(p)}}return c},getRadio:function(a){for(var b=0;b<a.length;b++)if(a[b].checked)return a[b].value},setRadio:function(a,b){d.forEach(a,function(a){a.checked=a.value===b?!0:!1})}};return e});g("muu-js-helpers",[],function(){var d={isString:function(c){return"string"===typeof c||"[object String]"===Object.prototype.toString.call(c)}};d.isArray=Array.isArray;d.isFunction=function(c){return"function"===typeof c};d.once=function(c){var d,a=!1;return function(){a||
    8    -1 (d=c.apply(this,arguments),a=!0);return d}};d.indexOf=function(c,d){if("indexOf"in c)return c.indexOf(d);for(var a=c.length,b=0;b<a;b++)if(c[b]===d)return b;return-1};d.forEach=function(c,d){if("forEach"in c)return c.forEach(d);for(var a=c.length,b=0;b<a;b++)d(c[b],b,c)};d.map=function(c,e){if("map"in c)return c.map(e);var a=[];d.forEach(c,function(b){a.push(e(b))});return a};d.filter=function(c,e){if("filter"in c)return c.filter(e);var a=[];d.forEach(c,function(b){e(b)&&a.push(b)});return a};d.union=
    9    -1 function(c){var e=[];d.forEach(arguments,function(a){d.forEach(a,function(a){-1===d.indexOf(e,a)&&e.push(a)})});return e};d.difference=function(c,e){for(var a=[],b=0;b<c.length;b++)-1===d.indexOf(e,c[b])&&a.push(c[b]);return a};d.flatten=function(c){var e=[];d.forEach(c,function(a){d.isArray(a)?e=e.concat(d.flatten(a)):e.push(a)});return e};return d});g("muu-location",["muu-search"],function(d){var c={absUrl:function(){return location.href},url:function(a,b){if(a===k)return location.pathname+location.search+
   10    -1 location.hash;b?history.replaceState(null,null,a):history.pushState(null,null,a);return c},protocol:function(){return location.protocol},host:function(){return location.host},port:function(){return location.port},path:function(a,b){if(a===k)return location.pathname;c.url(a+location.search+location.hash,b);return c}},e=function(a,b){if(a===k)return location.search;a&&"?"!==a[0]&&(a="?"+a);1===a.length&&(a="");c.url(location.pathname+a+location.hash,b);return c};c.search=function(a,b,c){if(a!==k){if(b!==
   11    -1 k){var f=d.parse(e());f[a]=b;return e(d.unparse(f),c)}return e(d.unparse(a),c)}return d.parse(e())};c.hash=function(a,b){if(a===k)return location.hash?location.hash.slice(1):"";c.url(location.pathname+location.search+"#"+a,b);return c};c.addEventListener=function(a,b){"change"===a&&q.addEventListener("popstate",b,!1);return c};c.removeEventListener=function(a,b){"change"===a&&q.removeEventListener("popstate",b,!1);return c};return c});g("muu-registry",["muu-template","muu-update-dom","muu-directive",
   12    -1 "muu-js-helpers","muu-dom-helpers"],function(d,c,e,a,b){return function(h){var f=this,p={};this.config=h||{};this.renderer=f.config.renderer||d;this.updateDOM=f.config.updateDOM||c;this.events=["keydown","keyup","click","change","search"];this.registerDirective=function(a,b,c){p[a]={template:b,link:c};return f};this.registerModule=function(a){a(f);return f};this.link=function(a,c){c===k&&(c=a.getAttribute("type"));if(!p.hasOwnProperty(c))throw Error("Unknown directive type: "+c);var d=p[c].link,h=
   13    -1 new e(a,p[c].template,f),d=d(h,a);a.classList.add("muu-isolate");a.classList.add("muu-initialised");f.config.debug&&(a.directive=h);d!==k&&b.destroy(a,d);return h};this.linkAll=function(b){b=a.filter(b.querySelectorAll("muu"),function(a){return!a.classList.contains("muu-initialised")});return a.map(b,function(a){return f.link(a)})}}});g("muu-search",["muu-js-helpers"],function(d){var c={parse:function(a){var b={},c=function(a,c){b.hasOwnProperty(a)?d.isArray(b[a])?b[a].push(c):b[a]=[b[a],c]:b[a]=
   14    -1 c};d.forEach(a.substring(1).split("&"),function(a){a=d.map(a.split("="),decodeURIComponent);2===a.length?c(a[0],a[1]):a[0]&&c(a[0],!0)});return b}},e=function(a,b){return b===k||null===b||!1===b?[]:d.isArray(b)?d.flatten(d.map(b,function(b){return e(a,b)})):!0===b?[encodeURIComponent(a)]:[encodeURIComponent(a)+"="+encodeURIComponent(b)]};c.unparse=function(a){if(d.isString(a))return a;var b=[],c;for(c in a)a.hasOwnProperty(c)&&(b=b.concat(e(c,a[c])));return 0<b.length?"?"+b.join("&"):""};return c});
   15    -1 g("muu-template",["muu-js-helpers","muu-dom-helpers"],function(d,c){var e=function(a,b){return"this"===a?b:b[a]},a=function(a){if(-1===a.indexOf(":"))return function(b){(b=e(a,b))||0===b||(b="");return c.escapeHtml(b)};var b=d.map(a.split(","),function(a){var b=a.split(":");a=b[0].trim();b=b.slice(1).join(":").trim();return[a,b]});return function(a){var h=d.map(d.filter(b,function(b){return e(b[1],a)}),function(a){return a[0]});return c.escapeHtml(h.join(" "))}},b=function(a,b,c){var f=h(b,a);return{render:function(b){var r=
   16    -1 e(a,b),h="";c?r||(h+=f.render(b)):d.isArray(r)?d.forEach(r,function(a){h+=f.render(a)}):r&&(h+=f.render(b));return h},afterBlock:f.afterBlock}},h=function(c,d){var e=c.indexOf("{{");if(-1===e){if(d===k)return{render:function(){return c},afterBlock:""};throw Error("unclosed loop: "+d);}var f=c.slice(0,e),g=c.slice(e),n=g.indexOf("}}");if(-1===n)throw Error("unclosed tag: "+g);var e=g.slice(2,n),g=g.slice(n+2),n=!0,l={render:function(){return""},afterBlock:g};if(0===e.lastIndexOf("#",0))l=b(e.substr(1),
   17    -1 g);else if(0===e.lastIndexOf("^",0))l=b(e.substr(1),g,!0);else if(0===e.lastIndexOf("/",0)){if(n=!1,e.substr(1)!==d)throw Error("unexpected closing loop: "+e);}else 0!==e.lastIndexOf("!",0)&&(l.render=a(e));if(n){var q=h(l.afterBlock,d);return{render:function(a){return f+l.render(a)+q.render(a)},afterBlock:q.afterBlock}}return{render:function(a){return f+l.render(a)},afterBlock:l.afterBlock}},f={};return function(a,b){f[a]===k&&(f[a]=h(a));return f[a].render(b)}});g("muu-update-dom",["muu-js-helpers"],
   18    -1 function(d){var c=function(a,b){var c=d.filter(a.classList,function(a){return 0===a.lastIndexOf("muu-",0)}),e=d.map(a.attributes,function(a){return a.name}),k=d.map(b.attributes,function(a){return a.name});d.forEach(e,function(c){b.hasAttribute(c)||"__IE8__"===c.substr(0,7)||a.removeAttribute(c)});d.forEach(k,function(c){a.getAttribute(c)!==b.getAttribute(c)&&a.setAttribute(c,b.getAttribute(c))});d.forEach(c,function(b){a.classList.add(b)})},e=function(a,b){for(var d=a.childNodes.length,f=b.childNodes.length,
   19    -1 k=0,g=f;g<d;g++)a.removeChild(a.childNodes[f]);for(g=d;g<f;g++)a.appendChild(b.childNodes[d]);for(g=0;g<d&&g<f;g++){var m=a.childNodes[g],l=b.childNodes[g-k];m.nodeType===l.nodeType&&m.nodeName===l.nodeName&&m.type===l.type?(1===m.nodeType?c(m,l):3===m.nodeType&&(m.nodeValue=l.nodeValue),3===m.nodeType||m.classList.contains("muu-isolate")||e(m,l)):(m.parentNode.replaceChild(l,m),k+=1)}};return function(a,b){var c=l.createElement("div");c.innerHTML=b;e(a,c)}});g("muu",["muu-registry","muu-dom-helpers",
   20    -1 "muu-location"],function(d,c,e){var a={};a.Registry=d;a.$=c;a.$location=e;return a});return s("muu")})})(window,document,void 0);
   -1     1 (function(q,l,k){(function(k){"object"===typeof module&&"object"===typeof module.exports?module.exports=k():"function"===typeof define&&define.amd?define("muu",[],k):q.muu=k(q._)})(function(g){var n={};n["muu-js-helpers"]={instance:g};var t=function(d,c){for(var e=[],a=0;a<d.length;a++)e.push(c(d[a]));return e};g=function(d,c,e){n[d]={deps:c,factory:e}};var s=function(d){if(!n[d])return k;n[d].instance||(n[d].instance=n[d].factory.apply(k,t(n[d].deps,s)));return n[d].instance};g("directive",["dom-helpers",
   -1     2 "js-helpers"],function(d,c){return function(e,a,b){var h=this;e.innerHTML="";var f=function(a){var b=a.currentTarget,m="data-on"+a.type;-1!==c.indexOf(h.querySelectorAll("["+m+"]"),b)&&(b=b.getAttribute(m),a=d.createEvent("muu-"+b,k,k,a),e.dispatchEvent(a))};this.update=function(p){b.updateDOM(e,b.renderer(a,p));c.forEach(b.events,function(a){c.forEach(h.querySelectorAll("[data-on"+a+"]"),function(b){b.addEventListener(a,f,!1)})});var r=d.createEvent("muu-parent-update");p=h.querySelectorAll("muu.muu-initialised");
   -1     3 c.forEach(p,function(a){a.dispatchEvent(r)});b.linkAll(h)};this.querySelectorAll=function(a){var b=e.querySelectorAll(a),d=e.querySelectorAll(".muu-isolate"),d=c.union.apply(c,c.map(d,function(b){return b.querySelectorAll(a)}));return c.difference(b,d)};this.querySelector=function(a){a=h.querySelectorAll(a);if(0<a.length)return a[0]};this.on=function(a,b){return d.on(e,"muu-"+a,function(a){return b(a.detail)})};this.getModel=function(a,b){if(a===k){var m={};c.forEach(h.querySelectorAll("[name]"),
   -1     4 function(a){m[a.name]=h.getModel(a.name)});return m}var e=h.querySelector("[name="+a+"]");return e===k?b:"number"===e.getAttribute("type")?parseFloat(e.value):"checkbox"===e.getAttribute("type")?e.checked:"radio"===e.getAttribute("type")?(e=h.querySelectorAll("[name="+a+"]"),d.getRadio(e)||b):e.value};this.setModel=function(a,b){if(h.getModel(a)!==b){var c=h.querySelector("[name="+a+"]");"checkbox"===c.getAttribute("type")?c.checked=b:"radio"===c.getAttribute("type")?(c=h.querySelectorAll("[name="+
   -1     5 a+"]"),d.setRadio(c,b)):c.value=b}}}});g("dom-helpers",["js-helpers"],function(d){var c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},e={DELAY:1E3,escapeHtml:function(a){return String(a).replace(/[&<>"'\/]/g,function(a){return c[a]})},createEvent:function(a,b,c,d){if("function"===typeof CustomEvent)return new CustomEvent(a,{detail:d,bubbles:b,cancelable:c});var e=l.createEvent("CustomEvent");e.initCustomEvent(a,b,c,d);return e},on:function(a,b,c){a.addEventListener(b,c,
   -1     6 !1);return function(){a.removeEventListener(b,c,!1)}},ready:function(a){a=d.once(a);if("complete"===l.readyState)return a(),function(){};var b=e.on(l,"DOMContentLoaded",a),c=e.on(q,"load",a);return function(){b();c()}},isDescendant:function(a,b){return!!a&&(a===b||e.isDescendant(a.parentNode,b))},destroy:function(a,b){var c;if(q.MutationObserver){var f=new MutationObserver(function(){e.isDescendant(a,l)||(b(),c())});f.observe(l,{childList:!0,subtree:!0});c=d.once(function(){f.disconnect();f=k})}else{var p=
   -1     7 setInterval(function(){e.isDescendant(a,l)||(b(),c())},e.DELAY);c=function(){clearInterval(p)}}return c},getRadio:function(a){for(var b=0;b<a.length;b++)if(a[b].checked)return a[b].value},setRadio:function(a,b){d.forEach(a,function(a){a.checked=a.value===b?!0:!1})}};return e});g("muu",["registry","dom-helpers","location"],function(d,c,e){var a={};a.Registry=d;a.$=c;a.$location=e;return a});g("js-helpers",[],function(){var d={isString:function(c){return"string"===typeof c||"[object String]"===Object.prototype.toString.call(c)}};
   -1     8 d.isArray=Array.isArray;d.isFunction=function(c){return"function"===typeof c};d.once=function(c){var d,a=!1;return function(){a||(d=c.apply(this,arguments),a=!0);return d}};d.indexOf=function(c,d){if("indexOf"in c)return c.indexOf(d);for(var a=c.length,b=0;b<a;b++)if(c[b]===d)return b;return-1};d.forEach=function(c,d){if("forEach"in c)return c.forEach(d);for(var a=c.length,b=0;b<a;b++)d(c[b],b,c)};d.map=function(c,e){if("map"in c)return c.map(e);var a=[];d.forEach(c,function(b){a.push(e(b))});return a};
   -1     9 d.filter=function(c,e){if("filter"in c)return c.filter(e);var a=[];d.forEach(c,function(b){e(b)&&a.push(b)});return a};d.union=function(c){var e=[];d.forEach(arguments,function(a){d.forEach(a,function(a){-1===d.indexOf(e,a)&&e.push(a)})});return e};d.difference=function(c,e){for(var a=[],b=0;b<c.length;b++)-1===d.indexOf(e,c[b])&&a.push(c[b]);return a};d.flatten=function(c){var e=[];d.forEach(c,function(a){d.isArray(a)?e=e.concat(d.flatten(a)):e.push(a)});return e};return d});g("location",["search"],
   -1    10 function(d){var c={absUrl:function(){return location.href},url:function(a,b){if(a===k)return location.pathname+location.search+location.hash;b?history.replaceState(null,null,a):history.pushState(null,null,a);return c},protocol:function(){return location.protocol},host:function(){return location.host},port:function(){return location.port},path:function(a,b){if(a===k)return location.pathname;c.url(a+location.search+location.hash,b);return c}},e=function(a,b){if(a===k)return location.search;a&&"?"!==
   -1    11 a[0]&&(a="?"+a);1===a.length&&(a="");c.url(location.pathname+a+location.hash,b);return c};c.search=function(a,b,c){if(a!==k){if(b!==k){var f=d.parse(e());f[a]=b;return e(d.unparse(f),c)}return e(d.unparse(a),c)}return d.parse(e())};c.hash=function(a,b){if(a===k)return location.hash?location.hash.slice(1):"";c.url(location.pathname+location.search+"#"+a,b);return c};c.addEventListener=function(a,b){"change"===a&&q.addEventListener("popstate",b,!1);return c};c.removeEventListener=function(a,b){"change"===
   -1    12 a&&q.removeEventListener("popstate",b,!1);return c};return c});g("registry",["template","update-dom","directive","js-helpers","dom-helpers"],function(d,c,e,a,b){return function(h){var f=this,p={};this.config=h||{};this.renderer=f.config.renderer||d;this.updateDOM=f.config.updateDOM||c;this.events=["keydown","keyup","click","change","search"];this.registerDirective=function(a,b,c){p[a]={template:b,link:c};return f};this.registerModule=function(a){a(f);return f};this.link=function(a,c){c===k&&(c=a.getAttribute("type"));
   -1    13 if(!p.hasOwnProperty(c))throw Error("Unknown directive type: "+c);var d=p[c].link,h=new e(a,p[c].template,f),d=d(h,a);a.classList.add("muu-isolate");a.classList.add("muu-initialised");f.config.debug&&(a.directive=h);d!==k&&b.destroy(a,d);return h};this.linkAll=function(b){b=a.filter(b.querySelectorAll("muu"),function(a){return!a.classList.contains("muu-initialised")});return a.map(b,function(a){return f.link(a)})}}});g("search",["js-helpers"],function(d){var c={parse:function(a){var b={},c=function(a,
   -1    14 c){b.hasOwnProperty(a)?d.isArray(b[a])?b[a].push(c):b[a]=[b[a],c]:b[a]=c};d.forEach(a.substring(1).split("&"),function(a){a=d.map(a.split("="),decodeURIComponent);2===a.length?c(a[0],a[1]):a[0]&&c(a[0],!0)});return b}},e=function(a,b){return b===k||null===b||!1===b?[]:d.isArray(b)?d.flatten(d.map(b,function(b){return e(a,b)})):!0===b?[encodeURIComponent(a)]:[encodeURIComponent(a)+"="+encodeURIComponent(b)]};c.unparse=function(a){if(d.isString(a))return a;var b=[],c;for(c in a)a.hasOwnProperty(c)&&
   -1    15 (b=b.concat(e(c,a[c])));return 0<b.length?"?"+b.join("&"):""};return c});g("template",["js-helpers","dom-helpers"],function(d,c){var e=function(a,b){return"this"===a?b:b[a]},a=function(a){if(-1===a.indexOf(":"))return function(b){(b=e(a,b))||0===b||(b="");return c.escapeHtml(b)};var b=d.map(a.split(","),function(a){var b=a.split(":");a=b[0].trim();b=b.slice(1).join(":").trim();return[a,b]});return function(a){var h=d.map(d.filter(b,function(b){return e(b[1],a)}),function(a){return a[0]});return c.escapeHtml(h.join(" "))}},
   -1    16 b=function(a,b,c){var f=h(b,a);return{render:function(b){var r=e(a,b),h="";c?r||(h+=f.render(b)):d.isArray(r)?d.forEach(r,function(a){h+=f.render(a)}):r&&(h+=f.render(b));return h},afterBlock:f.afterBlock}},h=function(c,d){var e=c.indexOf("{{");if(-1===e){if(d===k)return{render:function(){return c},afterBlock:""};throw Error("unclosed loop: "+d);}var f=c.slice(0,e),g=c.slice(e),n=g.indexOf("}}");if(-1===n)throw Error("unclosed tag: "+g);var e=g.slice(2,n),g=g.slice(n+2),n=!0,l={render:function(){return""},
   -1    17 afterBlock:g};if(0===e.lastIndexOf("#",0))l=b(e.substr(1),g);else if(0===e.lastIndexOf("^",0))l=b(e.substr(1),g,!0);else if(0===e.lastIndexOf("/",0)){if(n=!1,e.substr(1)!==d)throw Error("unexpected closing loop: "+e);}else 0!==e.lastIndexOf("!",0)&&(l.render=a(e));if(n){var q=h(l.afterBlock,d);return{render:function(a){return f+l.render(a)+q.render(a)},afterBlock:q.afterBlock}}return{render:function(a){return f+l.render(a)},afterBlock:l.afterBlock}},f={};return function(a,b){f[a]===k&&(f[a]=h(a));
   -1    18 return f[a].render(b)}});g("update-dom",["js-helpers"],function(d){var c=function(a,b){var c=d.filter(a.classList,function(a){return 0===a.lastIndexOf("muu-",0)}),e=d.map(a.attributes,function(a){return a.name}),k=d.map(b.attributes,function(a){return a.name});d.forEach(e,function(c){b.hasAttribute(c)||"__IE8__"===c.substr(0,7)||a.removeAttribute(c)});d.forEach(k,function(c){a.getAttribute(c)!==b.getAttribute(c)&&a.setAttribute(c,b.getAttribute(c))});d.forEach(c,function(b){a.classList.add(b)})},
   -1    19 e=function(a,b){for(var d=a.childNodes.length,f=b.childNodes.length,k=0,g=f;g<d;g++)a.removeChild(a.childNodes[f]);for(g=d;g<f;g++)a.appendChild(b.childNodes[d]);for(g=0;g<d&&g<f;g++){var m=a.childNodes[g],l=b.childNodes[g-k];m.nodeType===l.nodeType&&m.nodeName===l.nodeName&&m.type===l.type?(1===m.nodeType?c(m,l):3===m.nodeType&&(m.nodeValue=l.nodeValue),3===m.nodeType||m.classList.contains("muu-isolate")||e(m,l)):(m.parentNode.replaceChild(l,m),k+=1)}};return function(a,b){var c=l.createElement("div");
   -1    20 c.innerHTML=b;e(a,c)}});return s("muu")})})(window,document,void 0);