Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flea

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flea - npm Package Compare versions

Comparing version 0.0.21 to 0.0.22

13

app.js

@@ -11,3 +11,5 @@ var patch = require("snabbdom").init([

var model = options.model,
view = options.view || function () { return document.body },
view = options.view || function () {
return document.body
},
routes = typeof view === "function" ? undefined : view,

@@ -21,3 +23,5 @@ params = {},

onUpdate: Function.prototype,
onError: function (err) { throw err }
onError: function (err) {
throw err
}
}, options.hooks),

@@ -97,3 +101,5 @@ node = options.root || document.body.appendChild(document.createElement("div"))

}
return typeof source === "string" || typeof source === "number" ? source : target
return typeof source === "string"
|| typeof source === "number"
|| typeof source === "boolean" ? source : target
}

@@ -164,1 +170,2 @@

}

@@ -1,1 +0,1 @@

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.app=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var patch=require("snabbdom").init([require("snabbdom/modules/class"),require("snabbdom/modules/props"),require("snabbdom/modules/style"),require("snabbdom/modules/attributes"),require("snabbdom/modules/eventlisteners")]);module.exports=function(o){function t(){return location.hash?location.hash.substr(1):location.pathname}function n(o){document.addEventListener?document.addEventListener("DOMContentLoaded",o):window.attachEvent("onload",o)}function e(o,t){for(var n in t)o[n]=t[n];return"string"==typeof t||"number"==typeof t?t:o}function r(o,t,n){patch(n,l=t(o,i))}function i(o,t){h.onAction(o,t);var n=f[o];if("function"==typeof n)return void n(u,i,t,h.onError);var a=d[o],c=u;if(void 0===a)throw new TypeError(o+" is not a reducer or effect");r(u=e(u,a(u,t)),s,l),h.onUpdate(c,u,t)}function a(o,t){function n(o){var t=[],n="^"+o.replace(/\//g,"\\/").replace(/:([A-Za-z0-9_]+)/g,function(o,n){return t.push(n),"([A-Za-z0-9_]+)"})+"/?$";return{exp:n,slugs:t}}for(var e in o)if("*"!==e){var r,i=n(e),a={};if(t.replace(new RegExp(i.exp,"g"),function(){for(var t=1;t<arguments.length-2;t++)a[i.slugs.shift()]=arguments[t];r=function(t,n){return o[e](t,n,a)}}),r)return r}return o["*"]}var u=o.model,s=o.view||function(){return document.body},c="function"==typeof s?void 0:s,d=o.update||{},f=o.effects||{},p=o.subs||o.subscriptions||{},h=e({onAction:Function.prototype,onUpdate:Function.prototype,onError:function(o){throw o}},o.hooks),l=o.root||document.body.appendChild(document.createElement("div"));c&&(s=a(c,t()),i.setLocation=function(o){history&&history.pushState?(r(u,s=a(c,o),l),history.pushState({},"",o)):window.location.hash=o},window[history&&history.pushState?"onpopstate":"onhashchange"]=function(){r(u,s=a(c,t()),l)},window.onclick=function(o){if(!(o.metaKey||o.shiftKey||o.ctrlKey||o.altKey)){for(var t=o.target;t&&"a"!==t.localName;)t=t.parentNode;t&&t.host===location.host&&!t.hasAttribute("data-no-routing")&&(i.setLocation(t.pathname),o.preventDefault())}});for(var m in e(e({},d),f)){if(d[m]&&f[m])throw TypeError(m+" already defined as reducer or effect");!function(o){i[o]=function(t){i(o,t)}}(m)}n(function(){for(var o in p)p[o](u,i,h.onError)}),r(u,s,l)}},{snabbdom:10,"snabbdom/modules/attributes":5,"snabbdom/modules/class":6,"snabbdom/modules/eventlisteners":7,"snabbdom/modules/props":8,"snabbdom/modules/style":9}],2:[function(require,module,exports){"use strict";function addNS(e,i,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==i)for(var d=0;d<i.length;++d){var o=i[d].data;void 0!==o&&addNS(o,i[d].children,i[d].sel)}}function h(e,i,r){var d,o,v,t={};if(void 0!==r?(t=i,is.array(r)?d=r:is.primitive(r)?o=r:r&&r.sel&&(d=[r])):void 0!==i&&(is.array(i)?d=i:is.primitive(i)?o=i:i&&i.sel?d=[i]:t=i),is.array(d))for(v=0;v<d.length;++v)is.primitive(d[v])&&(d[v]=vnode_1.vnode(void 0,void 0,void 0,d[v]));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||addNS(t,d,e),vnode_1.vnode(e,t,d,o,void 0)}var vnode_1=require("./vnode"),is=require("./is");exports.h=h,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h},{"./is":4,"./vnode":12}],3:[function(require,module,exports){"use strict";function createElement(e){return document.createElement(e)}function createElementNS(e,t){return document.createElementNS(e,t)}function createTextNode(e){return document.createTextNode(e)}function insertBefore(e,t,n){e.insertBefore(t,n)}function removeChild(e,t){e.removeChild(t)}function appendChild(e,t){e.appendChild(t)}function parentNode(e){return e.parentNode}function nextSibling(e){return e.nextSibling}function tagName(e){return e.tagName}function setTextContent(e,t){e.textContent=t}exports.htmlDomApi={createElement:createElement,createElementNS:createElementNS,createTextNode:createTextNode,insertBefore:insertBefore,removeChild:removeChild,appendChild:appendChild,parentNode:parentNode,nextSibling:nextSibling,tagName:tagName,setTextContent:setTextContent},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.htmlDomApi},{}],4:[function(require,module,exports){"use strict";function primitive(r){return"string"==typeof r||"number"==typeof r}exports.array=Array.isArray,exports.primitive=primitive},{}],5:[function(require,module,exports){"use strict";function updateAttrs(e,t){var a,r,s,o,l=t.elm,d=e.data.attrs,i=t.data.attrs;if(d||i){d=d||{},i=i||{};for(a in i)r=i[a],s=d[a],s!==r&&(!r&&booleanAttrsDict[a]?l.removeAttribute(a):(o=a.split(":"),o.length>1&&NamespaceURIs.hasOwnProperty(o[0])?l.setAttributeNS(NamespaceURIs[o[0]],a,r):l.setAttribute(a,r)));for(a in d)a in i||l.removeAttribute(a)}}for(var NamespaceURIs={xlink:"http://www.w3.org/1999/xlink"},booleanAttrs=["allowfullscreen","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","draggable","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","spellcheck","translate","truespeed","typemustmatch","visible"],booleanAttrsDict=Object.create(null),i=0,len=booleanAttrs.length;i<len;i++)booleanAttrsDict[booleanAttrs[i]]=!0;exports.attributesModule={create:updateAttrs,update:updateAttrs},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.attributesModule},{}],6:[function(require,module,exports){"use strict";function updateClass(s,e){var a,t,l=e.elm,d=s.data.class,o=e.data.class;if(d||o){d=d||{},o=o||{};for(t in d)o[t]||l.classList.remove(t);for(t in o)a=o[t],a!==d[t]&&l.classList[a?"add":"remove"](t)}}exports.classModule={create:updateClass,update:updateClass},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.classModule},{}],7:[function(require,module,exports){"use strict";function invokeHandler(e,t,n){if("function"==typeof e)e.call(t,n,t);else if("object"==typeof e)if("function"==typeof e[0])if(2===e.length)e[0].call(t,e[1],n,t);else{var r=e.slice(1);r.push(n),r.push(t),e[0].apply(t,r)}else for(var i=0;i<e.length;i++)invokeHandler(e[i])}function handleEvent(e,t){var n=e.type,r=t.data.on;r&&r[n]&&invokeHandler(r[n],t,e)}function createListener(){return function e(t){handleEvent(t,e.vnode)}}function updateEventListeners(e,t){var n,r=e.data.on,i=e.listener,s=e.elm,o=t&&t.data.on,a=t&&t.elm;if(r!==o){if(r&&i)if(o)for(n in r)o[n]||s.removeEventListener(n,i,!1);else for(n in r)s.removeEventListener(n,i,!1);if(o){var l=t.listener=e.listener||createListener();if(l.vnode=t,r)for(n in o)r[n]||a.addEventListener(n,l,!1);else for(n in o)a.addEventListener(n,l,!1)}}}exports.eventListenersModule={create:updateEventListeners,update:updateEventListeners,destroy:updateEventListeners},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.eventListenersModule},{}],8:[function(require,module,exports){"use strict";function updateProps(e,p){var o,r,t,s=p.elm,a=e.data.props,d=p.data.props;if(a||d){a=a||{},d=d||{};for(o in a)d[o]||delete s[o];for(o in d)r=d[o],t=a[o],t===r||"value"===o&&s[o]===r||(s[o]=r)}}exports.propsModule={create:updateProps,update:updateProps},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.propsModule},{}],9:[function(require,module,exports){"use strict";function setNextFrame(e,t,r){nextFrame(function(){e[t]=r})}function updateStyle(e,t){var r,a,o=t.elm,l=e.data.style,n=t.data.style;if(l||n){l=l||{},n=n||{};var s="delayed"in l;for(a in l)n[a]||(a.startsWith("--")?o.style.removeProperty(a):o.style[a]="");for(a in n)if(r=n[a],"delayed"===a)for(a in n.delayed)r=n.delayed[a],s&&r===l.delayed[a]||setNextFrame(o.style,a,r);else"remove"!==a&&r!==l[a]&&(a.startsWith("--")?o.style.setProperty(a,r):o.style[a]=r)}}function applyDestroyStyle(e){var t,r,a=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(r in t)a.style[r]=t[r]}function applyRemoveStyle(e,t){var r=e.data.style;if(!r||!r.remove)return void t();var a,o,l=e.elm,n=0,s=r.remove,y=0,i=[];for(a in s)i.push(a),l.style[a]=s[a];o=getComputedStyle(l);for(var d=o["transition-property"].split(", ");n<d.length;++n)i.indexOf(d[n])!==-1&&y++;l.addEventListener("transitionend",function(e){e.target===l&&--y,0===y&&t()})}var raf="undefined"!=typeof window&&window.requestAnimationFrame||setTimeout,nextFrame=function(e){raf(function(){raf(e)})};exports.styleModule={create:updateStyle,update:updateStyle,destroy:applyDestroyStyle,remove:applyRemoveStyle},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styleModule},{}],10:[function(require,module,exports){"use strict";function isUndef(e){return void 0===e}function isDef(e){return void 0!==e}function sameVnode(e,t){return e.key===t.key&&e.sel===t.sel}function isVnode(e){return void 0!==e.sel}function createKeyToOldIdx(e,t,i){var o,n,r={};for(o=t;o<=i;++o)n=e[o].key,void 0!==n&&(r[n]=o);return r}function init(e,t){function i(e){var t=e.id?"#"+e.id:"",i=e.className?"."+e.className.split(" ").join("."):"";return vnode_1.default(m.tagName(e).toLowerCase()+t+i,{},[],void 0,e)}function o(e,t){return function(){if(0===--t){var i=m.parentNode(e);m.removeChild(i,e)}}}function n(e,t){var i,o=e.data;void 0!==o&&isDef(i=o.hook)&&isDef(i=i.init)&&(i(e),o=e.data);var r=e.children,s=e.sel;if(void 0!==s){var d=s.indexOf("#"),f=s.indexOf(".",d),l=d>0?d:s.length,a=f>0?f:s.length,h=d!==-1||f!==-1?s.slice(0,Math.min(l,a)):s,v=e.elm=isDef(o)&&isDef(i=o.ns)?m.createElementNS(i,h):m.createElement(h);if(l<a&&(v.id=s.slice(l+1,a)),f>0&&(v.className=s.slice(a+1).replace(/\./g," ")),is.array(r))for(i=0;i<r.length;++i)m.appendChild(v,n(r[i],t));else is.primitive(e.text)&&m.appendChild(v,m.createTextNode(e.text));for(i=0;i<u.create.length;++i)u.create[i](emptyNode,e);i=e.data.hook,isDef(i)&&(i.create&&i.create(emptyNode,e),i.insert&&t.push(e))}else e.elm=m.createTextNode(e.text);return e.elm}function r(e,t,i,o,r,s){for(;o<=r;++o)m.insertBefore(e,n(i[o],s),t)}function s(e){var t,i,o=e.data;if(void 0!==o){for(isDef(t=o.hook)&&isDef(t=t.destroy)&&t(e),t=0;t<u.destroy.length;++t)u.destroy[t](e);if(void 0!==e.children)for(i=0;i<e.children.length;++i)t=e.children[i],"string"!=typeof t&&s(t)}}function d(e,t,i,n){for(;i<=n;++i){var r=void 0,d=void 0,f=void 0,l=t[i];if(isDef(l))if(isDef(l.sel)){for(s(l),d=u.remove.length+1,f=o(l.elm,d),r=0;r<u.remove.length;++r)u.remove[r](l,f);isDef(r=l.data)&&isDef(r=r.hook)&&isDef(r=r.remove)?r(l,f):f()}else m.removeChild(e,l.elm)}}function f(e,t,i,o){for(var s,f,a,h,u=0,v=0,c=t.length-1,p=t[0],D=t[c],g=i.length-1,x=i[0],k=i[g];u<=c&&v<=g;)isUndef(p)?p=t[++u]:isUndef(D)?D=t[--c]:sameVnode(p,x)?(l(p,x,o),p=t[++u],x=i[++v]):sameVnode(D,k)?(l(D,k,o),D=t[--c],k=i[--g]):sameVnode(p,k)?(l(p,k,o),m.insertBefore(e,p.elm,m.nextSibling(D.elm)),p=t[++u],k=i[--g]):sameVnode(D,x)?(l(D,x,o),m.insertBefore(e,D.elm,p.elm),D=t[--c],x=i[++v]):(void 0===s&&(s=createKeyToOldIdx(t,u,c)),f=s[x.key],isUndef(f)?(m.insertBefore(e,n(x,o),p.elm),x=i[++v]):(a=t[f],a.sel!==x.sel?m.insertBefore(e,n(x,o),p.elm):(l(a,x,o),t[f]=void 0,m.insertBefore(e,a.elm,p.elm)),x=i[++v]));u>c?(h=isUndef(i[g+1])?null:i[g+1].elm,r(e,h,i,v,g,o)):v>g&&d(e,t,u,c)}function l(e,t,i){var o,n;isDef(o=t.data)&&isDef(n=o.hook)&&isDef(o=n.prepatch)&&o(e,t);var s=t.elm=e.elm,l=e.children,a=t.children;if(e!==t){if(isDef(t.data)){for(o=0;o<u.update.length;++o)u.update[o](e,t);o=t.data.hook,isDef(o)&&isDef(o=o.update)&&o(e,t)}isUndef(t.text)?isDef(l)&&isDef(a)?l!==a&&f(s,l,a,i):isDef(a)?(isDef(e.text)&&m.setTextContent(s,""),r(s,null,a,0,a.length-1,i)):isDef(l)?d(s,l,0,l.length-1):isDef(e.text)&&m.setTextContent(s,""):e.text!==t.text&&m.setTextContent(s,t.text),isDef(n)&&isDef(o=n.postpatch)&&o(e,t)}}var a,h,u={},m=void 0!==t?t:htmldomapi_1.default;for(a=0;a<hooks.length;++a)for(u[hooks[a]]=[],h=0;h<e.length;++h)void 0!==e[h][hooks[a]]&&u[hooks[a]].push(e[h][hooks[a]]);return function(e,t){var o,r,s,f=[];for(o=0;o<u.pre.length;++o)u.pre[o]();for(isVnode(e)||(e=i(e)),sameVnode(e,t)?l(e,t,f):(r=e.elm,s=m.parentNode(r),n(t,f),null!==s&&(m.insertBefore(s,t.elm,m.nextSibling(r)),d(s,[e],0,0))),o=0;o<f.length;++o)f[o].data.hook.insert(f[o]);for(o=0;o<u.post.length;++o)u.post[o]();return t}}var vnode_1=require("./vnode"),is=require("./is"),htmldomapi_1=require("./htmldomapi"),emptyNode=vnode_1.default("",{},[],void 0,void 0),hooks=["create","update","remove","destroy","pre","post"],h_1=require("./h");exports.h=h_1.h;var thunk_1=require("./thunk");exports.thunk=thunk_1.thunk,exports.init=init},{"./h":2,"./htmldomapi":3,"./is":4,"./thunk":11,"./vnode":12}],11:[function(require,module,exports){"use strict";function copyToThunk(t,a){a.elm=t.elm,t.data.fn=a.data.fn,t.data.args=a.data.args,a.data=t.data,a.children=t.children,a.text=t.text,a.elm=t.elm}function init(t){var a=t.data,n=a.fn.apply(void 0,a.args);copyToThunk(n,t)}function prepatch(t,a){var n,e=t.data,o=a.data,r=e.args,i=o.args;for(e.fn===o.fn&&r.length===i.length||copyToThunk(o.fn.apply(void 0,i),a),n=0;n<i.length;++n)if(r[n]!==i[n])return void copyToThunk(o.fn.apply(void 0,i),a);copyToThunk(t,a)}var h_1=require("./h");exports.thunk=function(t,a,n,e){return void 0===e&&(e=n,n=a,a=void 0),h_1.h(t,{key:a,hook:{init:init,prepatch:prepatch},fn:n,args:e})},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.thunk},{"./h":2}],12:[function(require,module,exports){"use strict";function vnode(e,t,o,d,r){var n=void 0===t?void 0:t.key;return{sel:e,data:t,children:o,text:d,elm:r,key:n}}exports.vnode=vnode,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=vnode},{}]},{},[1])(1)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.app=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var patch=require("snabbdom").init([require("snabbdom/modules/class").default,require("snabbdom/modules/props").default,require("snabbdom/modules/style").default,require("snabbdom/modules/attributes").default,require("snabbdom/modules/eventlisteners").default]);module.exports=function(t){function o(){return location.hash?location.hash.substr(1):location.pathname}function n(t){document.addEventListener?document.addEventListener("DOMContentLoaded",t):window.attachEvent("onload",t)}function e(t,o){for(var n in o)t[n]=o[n];return"string"==typeof o||"number"==typeof o||"boolean"==typeof o?o:t}function r(t,o,n){patch(n,h=o(t,a))}function a(t,o){l.onAction(t,o);var n=d[t];if("function"==typeof n)return void n(u,a,o,l.onError);var i=f[t],c=u;if(void 0===i)throw new TypeError(t+" is not a reducer or effect");r(u=e(u,i(u,o)),s,h),l.onUpdate(c,u,o)}function i(t,o){function n(t){var o=[],n="^"+t.replace(/\//g,"\\/").replace(/:([A-Za-z0-9_]+)/g,function(t,n){return o.push(n),"([A-Za-z0-9_]+)"})+"/?$";return{exp:n,slugs:o}}for(var e in t)if("*"!==e){var r,a=n(e),i={};if(o.replace(new RegExp(a.exp,"g"),function(){for(var o=1;o<arguments.length-2;o++)i[a.slugs.shift()]=arguments[o];r=function(o,n){return t[e](o,n,i)}}),r)return r}return t["*"]}var u=t.model,s=t.view||function(){return document.body},c="function"==typeof s?void 0:s,f=t.update||{},d=t.effects||{},p=t.subs||t.subscriptions||{},l=e({onAction:Function.prototype,onUpdate:Function.prototype,onError:function(t){throw t}},t.hooks),h=t.root||document.body.appendChild(document.createElement("div"));c&&(s=i(c,o()),a.setLocation=function(t){history&&history.pushState?(r(u,s=i(c,t),h),history.pushState({},"",t)):window.location.hash=t},window[history&&history.pushState?"onpopstate":"onhashchange"]=function(){r(u,s=i(c,o()),h)},window.onclick=function(t){if(!(t.metaKey||t.shiftKey||t.ctrlKey||t.altKey)){for(var o=t.target;o&&"a"!==o.localName;)o=o.parentNode;o&&o.host===location.host&&!o.hasAttribute("data-no-routing")&&(a.setLocation(o.pathname),t.preventDefault())}});for(var m in e(e({},f),d)){if(f[m]&&d[m])throw TypeError(m+" already defined as reducer or effect");!function(t){a[t]=function(o){a(t,o)}}(m)}n(function(){for(var t in p)p[t](u,a,l.onError)}),r(u,s,h)}},{snabbdom:10,"snabbdom/modules/attributes":5,"snabbdom/modules/class":6,"snabbdom/modules/eventlisteners":7,"snabbdom/modules/props":8,"snabbdom/modules/style":9}],2:[function(require,module,exports){"use strict";function addNS(e,i,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==i)for(var d=0;d<i.length;++d){var o=i[d].data;void 0!==o&&addNS(o,i[d].children,i[d].sel)}}function h(e,i,r){var d,o,v,t={};if(void 0!==r?(t=i,is.array(r)?d=r:is.primitive(r)?o=r:r&&r.sel&&(d=[r])):void 0!==i&&(is.array(i)?d=i:is.primitive(i)?o=i:i&&i.sel?d=[i]:t=i),is.array(d))for(v=0;v<d.length;++v)is.primitive(d[v])&&(d[v]=vnode_1.vnode(void 0,void 0,void 0,d[v]));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||addNS(t,d,e),vnode_1.vnode(e,t,d,o,void 0)}var vnode_1=require("./vnode"),is=require("./is");exports.h=h,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h},{"./is":4,"./vnode":12}],3:[function(require,module,exports){"use strict";function createElement(e){return document.createElement(e)}function createElementNS(e,t){return document.createElementNS(e,t)}function createTextNode(e){return document.createTextNode(e)}function insertBefore(e,t,n){e.insertBefore(t,n)}function removeChild(e,t){e.removeChild(t)}function appendChild(e,t){e.appendChild(t)}function parentNode(e){return e.parentNode}function nextSibling(e){return e.nextSibling}function tagName(e){return e.tagName}function setTextContent(e,t){e.textContent=t}exports.htmlDomApi={createElement:createElement,createElementNS:createElementNS,createTextNode:createTextNode,insertBefore:insertBefore,removeChild:removeChild,appendChild:appendChild,parentNode:parentNode,nextSibling:nextSibling,tagName:tagName,setTextContent:setTextContent},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.htmlDomApi},{}],4:[function(require,module,exports){"use strict";function primitive(r){return"string"==typeof r||"number"==typeof r}exports.array=Array.isArray,exports.primitive=primitive},{}],5:[function(require,module,exports){"use strict";function updateAttrs(e,t){var a,r,s,o,l=t.elm,d=e.data.attrs,i=t.data.attrs;if(d||i){d=d||{},i=i||{};for(a in i)r=i[a],s=d[a],s!==r&&(!r&&booleanAttrsDict[a]?l.removeAttribute(a):(o=a.split(":"),o.length>1&&NamespaceURIs.hasOwnProperty(o[0])?l.setAttributeNS(NamespaceURIs[o[0]],a,r):l.setAttribute(a,r)));for(a in d)a in i||l.removeAttribute(a)}}for(var NamespaceURIs={xlink:"http://www.w3.org/1999/xlink"},booleanAttrs=["allowfullscreen","async","autofocus","autoplay","checked","compact","controls","declare","default","defaultchecked","defaultmuted","defaultselected","defer","disabled","draggable","enabled","formnovalidate","hidden","indeterminate","inert","ismap","itemscope","loop","multiple","muted","nohref","noresize","noshade","novalidate","nowrap","open","pauseonexit","readonly","required","reversed","scoped","seamless","selected","sortable","spellcheck","translate","truespeed","typemustmatch","visible"],booleanAttrsDict=Object.create(null),i=0,len=booleanAttrs.length;i<len;i++)booleanAttrsDict[booleanAttrs[i]]=!0;exports.attributesModule={create:updateAttrs,update:updateAttrs},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.attributesModule},{}],6:[function(require,module,exports){"use strict";function updateClass(s,e){var a,t,l=e.elm,d=s.data.class,o=e.data.class;if(d||o){d=d||{},o=o||{};for(t in d)o[t]||l.classList.remove(t);for(t in o)a=o[t],a!==d[t]&&l.classList[a?"add":"remove"](t)}}exports.classModule={create:updateClass,update:updateClass},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.classModule},{}],7:[function(require,module,exports){"use strict";function invokeHandler(e,t,n){if("function"==typeof e)e.call(t,n,t);else if("object"==typeof e)if("function"==typeof e[0])if(2===e.length)e[0].call(t,e[1],n,t);else{var r=e.slice(1);r.push(n),r.push(t),e[0].apply(t,r)}else for(var i=0;i<e.length;i++)invokeHandler(e[i])}function handleEvent(e,t){var n=e.type,r=t.data.on;r&&r[n]&&invokeHandler(r[n],t,e)}function createListener(){return function e(t){handleEvent(t,e.vnode)}}function updateEventListeners(e,t){var n,r=e.data.on,i=e.listener,s=e.elm,o=t&&t.data.on,a=t&&t.elm;if(r!==o){if(r&&i)if(o)for(n in r)o[n]||s.removeEventListener(n,i,!1);else for(n in r)s.removeEventListener(n,i,!1);if(o){var l=t.listener=e.listener||createListener();if(l.vnode=t,r)for(n in o)r[n]||a.addEventListener(n,l,!1);else for(n in o)a.addEventListener(n,l,!1)}}}exports.eventListenersModule={create:updateEventListeners,update:updateEventListeners,destroy:updateEventListeners},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.eventListenersModule},{}],8:[function(require,module,exports){"use strict";function updateProps(e,p){var o,r,t,s=p.elm,a=e.data.props,d=p.data.props;if(a||d){a=a||{},d=d||{};for(o in a)d[o]||delete s[o];for(o in d)r=d[o],t=a[o],t===r||"value"===o&&s[o]===r||(s[o]=r)}}exports.propsModule={create:updateProps,update:updateProps},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.propsModule},{}],9:[function(require,module,exports){"use strict";function setNextFrame(e,t,r){nextFrame(function(){e[t]=r})}function updateStyle(e,t){var r,a,o=t.elm,l=e.data.style,n=t.data.style;if(l||n){l=l||{},n=n||{};var s="delayed"in l;for(a in l)n[a]||(a.startsWith("--")?o.style.removeProperty(a):o.style[a]="");for(a in n)if(r=n[a],"delayed"===a)for(a in n.delayed)r=n.delayed[a],s&&r===l.delayed[a]||setNextFrame(o.style,a,r);else"remove"!==a&&r!==l[a]&&(a.startsWith("--")?o.style.setProperty(a,r):o.style[a]=r)}}function applyDestroyStyle(e){var t,r,a=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(r in t)a.style[r]=t[r]}function applyRemoveStyle(e,t){var r=e.data.style;if(!r||!r.remove)return void t();var a,o,l=e.elm,n=0,s=r.remove,y=0,i=[];for(a in s)i.push(a),l.style[a]=s[a];o=getComputedStyle(l);for(var d=o["transition-property"].split(", ");n<d.length;++n)i.indexOf(d[n])!==-1&&y++;l.addEventListener("transitionend",function(e){e.target===l&&--y,0===y&&t()})}var raf="undefined"!=typeof window&&window.requestAnimationFrame||setTimeout,nextFrame=function(e){raf(function(){raf(e)})};exports.styleModule={create:updateStyle,update:updateStyle,destroy:applyDestroyStyle,remove:applyRemoveStyle},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.styleModule},{}],10:[function(require,module,exports){"use strict";function isUndef(e){return void 0===e}function isDef(e){return void 0!==e}function sameVnode(e,t){return e.key===t.key&&e.sel===t.sel}function isVnode(e){return void 0!==e.sel}function createKeyToOldIdx(e,t,i){var o,n,r={};for(o=t;o<=i;++o)n=e[o].key,void 0!==n&&(r[n]=o);return r}function init(e,t){function i(e){var t=e.id?"#"+e.id:"",i=e.className?"."+e.className.split(" ").join("."):"";return vnode_1.default(m.tagName(e).toLowerCase()+t+i,{},[],void 0,e)}function o(e,t){return function(){if(0===--t){var i=m.parentNode(e);m.removeChild(i,e)}}}function n(e,t){var i,o=e.data;void 0!==o&&isDef(i=o.hook)&&isDef(i=i.init)&&(i(e),o=e.data);var r=e.children,s=e.sel;if(void 0!==s){var d=s.indexOf("#"),f=s.indexOf(".",d),l=d>0?d:s.length,a=f>0?f:s.length,h=d!==-1||f!==-1?s.slice(0,Math.min(l,a)):s,v=e.elm=isDef(o)&&isDef(i=o.ns)?m.createElementNS(i,h):m.createElement(h);if(l<a&&(v.id=s.slice(l+1,a)),f>0&&(v.className=s.slice(a+1).replace(/\./g," ")),is.array(r))for(i=0;i<r.length;++i)m.appendChild(v,n(r[i],t));else is.primitive(e.text)&&m.appendChild(v,m.createTextNode(e.text));for(i=0;i<u.create.length;++i)u.create[i](emptyNode,e);i=e.data.hook,isDef(i)&&(i.create&&i.create(emptyNode,e),i.insert&&t.push(e))}else e.elm=m.createTextNode(e.text);return e.elm}function r(e,t,i,o,r,s){for(;o<=r;++o)m.insertBefore(e,n(i[o],s),t)}function s(e){var t,i,o=e.data;if(void 0!==o){for(isDef(t=o.hook)&&isDef(t=t.destroy)&&t(e),t=0;t<u.destroy.length;++t)u.destroy[t](e);if(void 0!==e.children)for(i=0;i<e.children.length;++i)t=e.children[i],"string"!=typeof t&&s(t)}}function d(e,t,i,n){for(;i<=n;++i){var r=void 0,d=void 0,f=void 0,l=t[i];if(isDef(l))if(isDef(l.sel)){for(s(l),d=u.remove.length+1,f=o(l.elm,d),r=0;r<u.remove.length;++r)u.remove[r](l,f);isDef(r=l.data)&&isDef(r=r.hook)&&isDef(r=r.remove)?r(l,f):f()}else m.removeChild(e,l.elm)}}function f(e,t,i,o){for(var s,f,a,h,u=0,v=0,c=t.length-1,p=t[0],D=t[c],g=i.length-1,x=i[0],k=i[g];u<=c&&v<=g;)isUndef(p)?p=t[++u]:isUndef(D)?D=t[--c]:sameVnode(p,x)?(l(p,x,o),p=t[++u],x=i[++v]):sameVnode(D,k)?(l(D,k,o),D=t[--c],k=i[--g]):sameVnode(p,k)?(l(p,k,o),m.insertBefore(e,p.elm,m.nextSibling(D.elm)),p=t[++u],k=i[--g]):sameVnode(D,x)?(l(D,x,o),m.insertBefore(e,D.elm,p.elm),D=t[--c],x=i[++v]):(void 0===s&&(s=createKeyToOldIdx(t,u,c)),f=s[x.key],isUndef(f)?(m.insertBefore(e,n(x,o),p.elm),x=i[++v]):(a=t[f],a.sel!==x.sel?m.insertBefore(e,n(x,o),p.elm):(l(a,x,o),t[f]=void 0,m.insertBefore(e,a.elm,p.elm)),x=i[++v]));u>c?(h=isUndef(i[g+1])?null:i[g+1].elm,r(e,h,i,v,g,o)):v>g&&d(e,t,u,c)}function l(e,t,i){var o,n;isDef(o=t.data)&&isDef(n=o.hook)&&isDef(o=n.prepatch)&&o(e,t);var s=t.elm=e.elm,l=e.children,a=t.children;if(e!==t){if(isDef(t.data)){for(o=0;o<u.update.length;++o)u.update[o](e,t);o=t.data.hook,isDef(o)&&isDef(o=o.update)&&o(e,t)}isUndef(t.text)?isDef(l)&&isDef(a)?l!==a&&f(s,l,a,i):isDef(a)?(isDef(e.text)&&m.setTextContent(s,""),r(s,null,a,0,a.length-1,i)):isDef(l)?d(s,l,0,l.length-1):isDef(e.text)&&m.setTextContent(s,""):e.text!==t.text&&m.setTextContent(s,t.text),isDef(n)&&isDef(o=n.postpatch)&&o(e,t)}}var a,h,u={},m=void 0!==t?t:htmldomapi_1.default;for(a=0;a<hooks.length;++a)for(u[hooks[a]]=[],h=0;h<e.length;++h)void 0!==e[h][hooks[a]]&&u[hooks[a]].push(e[h][hooks[a]]);return function(e,t){var o,r,s,f=[];for(o=0;o<u.pre.length;++o)u.pre[o]();for(isVnode(e)||(e=i(e)),sameVnode(e,t)?l(e,t,f):(r=e.elm,s=m.parentNode(r),n(t,f),null!==s&&(m.insertBefore(s,t.elm,m.nextSibling(r)),d(s,[e],0,0))),o=0;o<f.length;++o)f[o].data.hook.insert(f[o]);for(o=0;o<u.post.length;++o)u.post[o]();return t}}var vnode_1=require("./vnode"),is=require("./is"),htmldomapi_1=require("./htmldomapi"),emptyNode=vnode_1.default("",{},[],void 0,void 0),hooks=["create","update","remove","destroy","pre","post"],h_1=require("./h");exports.h=h_1.h;var thunk_1=require("./thunk");exports.thunk=thunk_1.thunk,exports.init=init},{"./h":2,"./htmldomapi":3,"./is":4,"./thunk":11,"./vnode":12}],11:[function(require,module,exports){"use strict";function copyToThunk(t,a){a.elm=t.elm,t.data.fn=a.data.fn,t.data.args=a.data.args,a.data=t.data,a.children=t.children,a.text=t.text,a.elm=t.elm}function init(t){var a=t.data,n=a.fn.apply(void 0,a.args);copyToThunk(n,t)}function prepatch(t,a){var n,e=t.data,o=a.data,r=e.args,i=o.args;for(e.fn===o.fn&&r.length===i.length||copyToThunk(o.fn.apply(void 0,i),a),n=0;n<i.length;++n)if(r[n]!==i[n])return void copyToThunk(o.fn.apply(void 0,i),a);copyToThunk(t,a)}var h_1=require("./h");exports.thunk=function(t,a,n,e){return void 0===e&&(e=n,n=a,a=void 0),h_1.h(t,{key:a,hook:{init:init,prepatch:prepatch},fn:n,args:e})},Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.thunk},{"./h":2}],12:[function(require,module,exports){"use strict";function vnode(e,t,o,d,r){var n=void 0===t?void 0:t.key;return{sel:e,data:t,children:o,text:d,elm:r,key:n}}exports.vnode=vnode,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=vnode},{}]},{},[1])(1)});

@@ -1,1 +0,1 @@

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports=require("hyperx")(require("hyperx-to-snabbdom")(require("snabbdom/h")))},{hyperx:4,"hyperx-to-snabbdom":3,"snabbdom/h":5}],2:[function(require,module,exports){function attributeToProperty(r){return function(t,o,e){for(var n in o)n in transform&&(o[transform[n]]=o[n],delete o[n]);return r(t,o,e)}}module.exports=attributeToProperty;var transform={"class":"className","for":"htmlFor","http-equiv":"httpEquiv"}},{}],3:[function(require,module,exports){module.exports=function(s){return function(r,t,o){var a={"class":{},props:{},style:{},attrs:{},hook:{},on:{}};for(var e in t)if(void 0!==e&&t.hasOwnProperty(e)){var n=t[e];if("className"===e)for(var l=n.split(" "),u=0;u<l.length;u++)a.class[l[u]]=!0;else"style"===e?a.style=n:"on"===e.substr(0,2)?a.on[e.substr(2)]=n:"data-hook-"===e.substr(0,10)?a.hook[e.substr(10)]=n:a.props[e]=a.attrs[e]="true"===n||"false"!==n&&n}return s(r,a,o?[].concat.apply([],o):o)}}},{}],4:[function(require,module,exports){function quot(T){return T===ATTR_VALUE_SQ||T===ATTR_VALUE_DQ}function has(T,e){return hasOwn.call(T,e)}function selfClosing(T){return closeRE.test(T)}var attrToProp=require("hyperscript-attribute-to-property"),VAR=0,TEXT=1,OPEN=2,CLOSE=3,ATTR=4,ATTR_KEY=5,ATTR_KEY_W=6,ATTR_VALUE_W=7,ATTR_VALUE=8,ATTR_VALUE_SQ=9,ATTR_VALUE_DQ=10,ATTR_EQ=11,ATTR_BREAK=12;module.exports=function(T,e){function A(T){return"function"==typeof T?T:"string"==typeof T?T:T&&"object"==typeof T?T:t("",T)}T=attrToProp(T),e||(e={});var t=e.concat||function(T,e){return String(T)+String(e)};return function(e){function r(T){var e=[];R===ATTR_VALUE_W&&(R=ATTR);for(var A=0;A<T.length;A++){var t=T.charAt(A);R===TEXT&&"<"===t?(n.length&&e.push([TEXT,n]),n="",R=OPEN):">"!==t||quot(R)?R===TEXT?n+=t:R===OPEN&&/\s/.test(t)?(e.push([OPEN,n]),n="",R=ATTR):R===OPEN?n+=t:R===ATTR&&/[\w-]/.test(t)?(R=ATTR_KEY,n=t):R===ATTR&&/\s/.test(t)?(n.length&&e.push([ATTR_KEY,n]),e.push([ATTR_BREAK])):R===ATTR_KEY&&/\s/.test(t)?(e.push([ATTR_KEY,n]),n="",R=ATTR_KEY_W):R===ATTR_KEY&&"="===t?(e.push([ATTR_KEY,n],[ATTR_EQ]),n="",R=ATTR_VALUE_W):R===ATTR_KEY?n+=t:R!==ATTR_KEY_W&&R!==ATTR||"="!==t?R!==ATTR_KEY_W&&R!==ATTR||/\s/.test(t)?R===ATTR_VALUE_W&&'"'===t?R=ATTR_VALUE_DQ:R===ATTR_VALUE_W&&"'"===t?R=ATTR_VALUE_SQ:R===ATTR_VALUE_DQ&&'"'===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R===ATTR_VALUE_SQ&&"'"===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE_W||/\s/.test(t)?R===ATTR_VALUE&&/\s/.test(t)?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE&&R!==ATTR_VALUE_SQ&&R!==ATTR_VALUE_DQ||(n+=t):(R=ATTR_VALUE,A--):(e.push([ATTR_BREAK]),/[\w-]/.test(t)?(n+=t,R=ATTR_KEY):R=ATTR):(e.push([ATTR_EQ]),R=ATTR_VALUE_W):(R===OPEN?e.push([OPEN,n]):R===ATTR_KEY?e.push([ATTR_KEY,n]):R===ATTR_VALUE&&n.length&&e.push([ATTR_VALUE,n]),e.push([CLOSE]),n="",R=TEXT)}return R===TEXT&&n.length?(e.push([TEXT,n]),n=""):R===ATTR_VALUE&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_DQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_SQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_KEY&&(e.push([ATTR_KEY,n]),n=""),e}for(var R=TEXT,n="",E=arguments.length,_=[],s=0;s<e.length;s++)if(s<E-1){var o=arguments[s+1],l=r(e[s]),h=R;h===ATTR_VALUE_DQ&&(h=ATTR_VALUE),h===ATTR_VALUE_SQ&&(h=ATTR_VALUE),h===ATTR_VALUE_W&&(h=ATTR_VALUE),h===ATTR&&(h=ATTR_KEY),l.push([VAR,h,o]),_.push.apply(_,l)}else _.push.apply(_,r(e[s]));for(var i=[null,{},[]],f=[[i,-1]],s=0;s<_.length;s++){var a=f[f.length-1][0],l=_[s],p=l[0];if(p===OPEN&&/^\//.test(l[1])){var u=f[f.length-1][1];f.length>1&&(f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0))}else if(p===OPEN){var g=[l[1],{},[]];a[2].push(g),f.push([g,a[2].length-1])}else if(p===ATTR_KEY||p===VAR&&l[1]===ATTR_KEY){for(var L,V="";s<_.length;s++)if(_[s][0]===ATTR_KEY)V=t(V,_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_KEY)break;if("object"!=typeof _[s][2]||V)V=t(V,_[s][2]);else for(L in _[s][2])_[s][2].hasOwnProperty(L)&&!a[1][L]&&(a[1][L]=_[s][2][L])}_[s][0]===ATTR_EQ&&s++;for(var U=s;s<_.length;s++)if(_[s][0]===ATTR_VALUE||_[s][0]===ATTR_KEY)a[1][V]?a[1][V]=t(a[1][V],_[s][1]):a[1][V]=A(_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_VALUE&&_[s][1]!==ATTR_KEY){!V.length||a[1][V]||s!==U||_[s][0]!==CLOSE&&_[s][0]!==ATTR_BREAK||(a[1][V]=V.toLowerCase());break}a[1][V]?a[1][V]=t(a[1][V],_[s][2]):a[1][V]=A(_[s][2])}}else if(p===ATTR_KEY)a[1][l[1]]=!0;else if(p===VAR&&l[1]===ATTR_KEY)a[1][l[2]]=!0;else if(p===CLOSE){if(selfClosing(a[0])&&f.length){var u=f[f.length-1][1];f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0)}}else if(p===VAR&&l[1]===TEXT)void 0===l[2]||null===l[2]?l[2]="":l[2]||(l[2]=t("",l[2])),Array.isArray(l[2][0])?a[2].push.apply(a[2],l[2]):a[2].push(l[2]);else if(p===TEXT)a[2].push(l[1]);else if(p!==ATTR_EQ&&p!==ATTR_BREAK)throw new Error("unhandled: "+p)}if(i[2].length>1&&/^\s*$/.test(i[2][0])&&i[2].shift(),i[2].length>2||2===i[2].length&&/\S/.test(i[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(i[2][0])&&"string"==typeof i[2][0][0]&&Array.isArray(i[2][0][2])&&(i[2][0]=T(i[2][0][0],i[2][0][1],i[2][0][2])),i[2][0]}};var hasOwn=Object.prototype.hasOwnProperty,closeRE=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$")},{"hyperscript-attribute-to-property":2}],5:[function(require,module,exports){"use strict";function addNS(e,i,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==i)for(var d=0;d<i.length;++d){var o=i[d].data;void 0!==o&&addNS(o,i[d].children,i[d].sel)}}function h(e,i,r){var d,o,v,t={};if(void 0!==r?(t=i,is.array(r)?d=r:is.primitive(r)?o=r:r&&r.sel&&(d=[r])):void 0!==i&&(is.array(i)?d=i:is.primitive(i)?o=i:i&&i.sel?d=[i]:t=i),is.array(d))for(v=0;v<d.length;++v)is.primitive(d[v])&&(d[v]=vnode_1.vnode(void 0,void 0,void 0,d[v]));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||addNS(t,d,e),vnode_1.vnode(e,t,d,o,void 0)}var vnode_1=require("./vnode"),is=require("./is");exports.h=h,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h},{"./is":6,"./vnode":7}],6:[function(require,module,exports){"use strict";function primitive(r){return"string"==typeof r||"number"==typeof r}exports.array=Array.isArray,exports.primitive=primitive},{}],7:[function(require,module,exports){"use strict";function vnode(e,t,o,d,r){var n=void 0===t?void 0:t.key;return{sel:e,data:t,children:o,text:d,elm:r,key:n}}exports.vnode=vnode,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=vnode},{}]},{},[1])(1)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){module.exports=require("hyperx")(require("hyperx-to-snabbdom")(require("snabbdom/h").h))},{hyperx:4,"hyperx-to-snabbdom":3,"snabbdom/h":5}],2:[function(require,module,exports){function attributeToProperty(r){return function(t,o,e){for(var n in o)n in transform&&(o[transform[n]]=o[n],delete o[n]);return r(t,o,e)}}module.exports=attributeToProperty;var transform={"class":"className","for":"htmlFor","http-equiv":"httpEquiv"}},{}],3:[function(require,module,exports){module.exports=function(s){return function(r,t,o){var a={"class":{},props:{},style:{},attrs:{},hook:{},on:{}};for(var e in t)if(void 0!==e&&t.hasOwnProperty(e)){var n=t[e];if("className"===e)for(var l=n.split(" "),u=0;u<l.length;u++)a.class[l[u]]=!0;else"style"===e?a.style=n:"on"===e.substr(0,2)?a.on[e.substr(2)]=n:"data-hook-"===e.substr(0,10)?a.hook[e.substr(10)]=n:a.props[e]=a.attrs[e]="true"===n||"false"!==n&&n}return s(r,a,o?[].concat.apply([],o):o)}}},{}],4:[function(require,module,exports){function quot(T){return T===ATTR_VALUE_SQ||T===ATTR_VALUE_DQ}function has(T,e){return hasOwn.call(T,e)}function selfClosing(T){return closeRE.test(T)}var attrToProp=require("hyperscript-attribute-to-property"),VAR=0,TEXT=1,OPEN=2,CLOSE=3,ATTR=4,ATTR_KEY=5,ATTR_KEY_W=6,ATTR_VALUE_W=7,ATTR_VALUE=8,ATTR_VALUE_SQ=9,ATTR_VALUE_DQ=10,ATTR_EQ=11,ATTR_BREAK=12;module.exports=function(T,e){function A(T){return"function"==typeof T?T:"string"==typeof T?T:T&&"object"==typeof T?T:t("",T)}T=attrToProp(T),e||(e={});var t=e.concat||function(T,e){return String(T)+String(e)};return function(e){function r(T){var e=[];R===ATTR_VALUE_W&&(R=ATTR);for(var A=0;A<T.length;A++){var t=T.charAt(A);R===TEXT&&"<"===t?(n.length&&e.push([TEXT,n]),n="",R=OPEN):">"!==t||quot(R)?R===TEXT?n+=t:R===OPEN&&/\s/.test(t)?(e.push([OPEN,n]),n="",R=ATTR):R===OPEN?n+=t:R===ATTR&&/[\w-]/.test(t)?(R=ATTR_KEY,n=t):R===ATTR&&/\s/.test(t)?(n.length&&e.push([ATTR_KEY,n]),e.push([ATTR_BREAK])):R===ATTR_KEY&&/\s/.test(t)?(e.push([ATTR_KEY,n]),n="",R=ATTR_KEY_W):R===ATTR_KEY&&"="===t?(e.push([ATTR_KEY,n],[ATTR_EQ]),n="",R=ATTR_VALUE_W):R===ATTR_KEY?n+=t:R!==ATTR_KEY_W&&R!==ATTR||"="!==t?R!==ATTR_KEY_W&&R!==ATTR||/\s/.test(t)?R===ATTR_VALUE_W&&'"'===t?R=ATTR_VALUE_DQ:R===ATTR_VALUE_W&&"'"===t?R=ATTR_VALUE_SQ:R===ATTR_VALUE_DQ&&'"'===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R===ATTR_VALUE_SQ&&"'"===t?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE_W||/\s/.test(t)?R===ATTR_VALUE&&/\s/.test(t)?(e.push([ATTR_VALUE,n],[ATTR_BREAK]),n="",R=ATTR):R!==ATTR_VALUE&&R!==ATTR_VALUE_SQ&&R!==ATTR_VALUE_DQ||(n+=t):(R=ATTR_VALUE,A--):(e.push([ATTR_BREAK]),/[\w-]/.test(t)?(n+=t,R=ATTR_KEY):R=ATTR):(e.push([ATTR_EQ]),R=ATTR_VALUE_W):(R===OPEN?e.push([OPEN,n]):R===ATTR_KEY?e.push([ATTR_KEY,n]):R===ATTR_VALUE&&n.length&&e.push([ATTR_VALUE,n]),e.push([CLOSE]),n="",R=TEXT)}return R===TEXT&&n.length?(e.push([TEXT,n]),n=""):R===ATTR_VALUE&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_DQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_VALUE_SQ&&n.length?(e.push([ATTR_VALUE,n]),n=""):R===ATTR_KEY&&(e.push([ATTR_KEY,n]),n=""),e}for(var R=TEXT,n="",E=arguments.length,_=[],s=0;s<e.length;s++)if(s<E-1){var o=arguments[s+1],l=r(e[s]),h=R;h===ATTR_VALUE_DQ&&(h=ATTR_VALUE),h===ATTR_VALUE_SQ&&(h=ATTR_VALUE),h===ATTR_VALUE_W&&(h=ATTR_VALUE),h===ATTR&&(h=ATTR_KEY),l.push([VAR,h,o]),_.push.apply(_,l)}else _.push.apply(_,r(e[s]));for(var i=[null,{},[]],f=[[i,-1]],s=0;s<_.length;s++){var a=f[f.length-1][0],l=_[s],p=l[0];if(p===OPEN&&/^\//.test(l[1])){var u=f[f.length-1][1];f.length>1&&(f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0))}else if(p===OPEN){var g=[l[1],{},[]];a[2].push(g),f.push([g,a[2].length-1])}else if(p===ATTR_KEY||p===VAR&&l[1]===ATTR_KEY){for(var L,V="";s<_.length;s++)if(_[s][0]===ATTR_KEY)V=t(V,_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_KEY)break;if("object"!=typeof _[s][2]||V)V=t(V,_[s][2]);else for(L in _[s][2])_[s][2].hasOwnProperty(L)&&!a[1][L]&&(a[1][L]=_[s][2][L])}_[s][0]===ATTR_EQ&&s++;for(var U=s;s<_.length;s++)if(_[s][0]===ATTR_VALUE||_[s][0]===ATTR_KEY)a[1][V]?a[1][V]=t(a[1][V],_[s][1]):a[1][V]=A(_[s][1]);else{if(_[s][0]!==VAR||_[s][1]!==ATTR_VALUE&&_[s][1]!==ATTR_KEY){!V.length||a[1][V]||s!==U||_[s][0]!==CLOSE&&_[s][0]!==ATTR_BREAK||(a[1][V]=V.toLowerCase());break}a[1][V]?a[1][V]=t(a[1][V],_[s][2]):a[1][V]=A(_[s][2])}}else if(p===ATTR_KEY)a[1][l[1]]=!0;else if(p===VAR&&l[1]===ATTR_KEY)a[1][l[2]]=!0;else if(p===CLOSE){if(selfClosing(a[0])&&f.length){var u=f[f.length-1][1];f.pop(),f[f.length-1][0][2][u]=T(a[0],a[1],a[2].length?a[2]:void 0)}}else if(p===VAR&&l[1]===TEXT)void 0===l[2]||null===l[2]?l[2]="":l[2]||(l[2]=t("",l[2])),Array.isArray(l[2][0])?a[2].push.apply(a[2],l[2]):a[2].push(l[2]);else if(p===TEXT)a[2].push(l[1]);else if(p!==ATTR_EQ&&p!==ATTR_BREAK)throw new Error("unhandled: "+p)}if(i[2].length>1&&/^\s*$/.test(i[2][0])&&i[2].shift(),i[2].length>2||2===i[2].length&&/\S/.test(i[2][1]))throw new Error("multiple root elements must be wrapped in an enclosing tag");return Array.isArray(i[2][0])&&"string"==typeof i[2][0][0]&&Array.isArray(i[2][0][2])&&(i[2][0]=T(i[2][0][0],i[2][0][1],i[2][0][2])),i[2][0]}};var hasOwn=Object.prototype.hasOwnProperty,closeRE=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$")},{"hyperscript-attribute-to-property":2}],5:[function(require,module,exports){"use strict";function addNS(e,i,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==i)for(var d=0;d<i.length;++d){var o=i[d].data;void 0!==o&&addNS(o,i[d].children,i[d].sel)}}function h(e,i,r){var d,o,v,t={};if(void 0!==r?(t=i,is.array(r)?d=r:is.primitive(r)?o=r:r&&r.sel&&(d=[r])):void 0!==i&&(is.array(i)?d=i:is.primitive(i)?o=i:i&&i.sel?d=[i]:t=i),is.array(d))for(v=0;v<d.length;++v)is.primitive(d[v])&&(d[v]=vnode_1.vnode(void 0,void 0,void 0,d[v]));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||addNS(t,d,e),vnode_1.vnode(e,t,d,o,void 0)}var vnode_1=require("./vnode"),is=require("./is");exports.h=h,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=h},{"./is":6,"./vnode":7}],6:[function(require,module,exports){"use strict";function primitive(r){return"string"==typeof r||"number"==typeof r}exports.array=Array.isArray,exports.primitive=primitive},{}],7:[function(require,module,exports){"use strict";function vnode(e,t,o,d,r){var n=void 0===t?void 0:t.key;return{sel:e,data:t,children:o,text:d,elm:r,key:n}}exports.vnode=vnode,Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=vnode},{}]},{},[1])(1)});
{
"name": "flea",
"description": "Tiny UI library based in Snabbdom and ES6 tagged template literals",
"version": "0.0.21",
"version": "0.0.22",
"main": "index.js",

@@ -6,0 +6,0 @@ "author": "Jorge Bucaran",

@@ -253,4 +253,2 @@ # flea

> Flea's `html` function translates [Hyperx] into a [Snabbdom/h](https://github.com/snabbdom/snabbdom/blob/master/src/h.ts) function call.
## app

@@ -262,11 +260,11 @@

A value or object that represents the state of your app.
A value or object that represents the entire state of your app.
You never modify the model directly, instead, send actions describing how the model should change. See [view](#view).
To update the model, you send actions describing how the model should change. See [view](#view).
### update
Object composed of functions known as reducers. These are a kind of action you can send.
An object composed of functions known as reducers. These are a kind of action you send to update the model.
A reducer describes how the model should change and returns a new model or part of a model.
A reducer describes how the model should change by returning a new model or part of a model.

@@ -299,2 +297,4 @@ ```js

To send an action
```js

@@ -304,2 +304,22 @@ msg.action(data)

where `data` is any data you want to share with the reducer or effect.
<details>
<summary><i>Example</i></summary>
```js
app({
model: true,
view: (model, msg) => html`<button onclick=${msg.toggle}>${model+""}</button>`,
update: {
toggle: model => !model
}
})
```
[View online](http://codepen.io/jbucaran/pen/ZLGGzy?editors=0010)
</details>
Alternatively, a view can be an object with multiple views. In this case, each view should a key binding it to a [route](#routing).
### effects

@@ -319,15 +339,33 @@

```js
const wait = time => new Promise(resolve => setTimeout(_ => resolve(), time))
const model = {
counter: 0,
waiting: false
}
const view = (model, msg) =>
html`
<button
onclick=${msg.waitThenAdd}
disabled=${model.waiting}>${model.counter}
</button>`
const update = {
add: model => ({ counter: model.counter + 1 }),
toggle: model => ({ waiting: !model.waiting})
}
const effects = {
randomColor: _ =>
document.body.style.backgroundColor = "#" + ((1<<24) * Math.random() | 0).toString(16)
waitThenAdd: (model, msg) => {
msg.toggle()
wait(1000).then(msg.add).then(msg.toggle)
}
}
const subs = [
(_, msg) => addEventListener("mousemove", msg.randomColor)
]
app({ effects, subs })
app({ model, view, update, effects })
```
[View online](http://codepen.io/jbucaran/pen/OWPvPj?editors=0010)
[View online](http://codepen.io/jbucaran/pen/jyEKmw?editors=0010)
</details>

@@ -334,0 +372,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc