<NME> apprun.js.map <BEF> {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/apprun.js","webpack:///webpack/bootstrap 34faa1100aa1f0068c04","webpack:///./src/apprun.ts","webpack:///./src/app.ts","webpack:///./src/decorator.ts","webpack:///./src/vdom-my.ts","webpack:///./src/vdom.ts","webpack:///./src/createComponent.tsx","webpack:///./src/component.ts","webpack:///./src/router.ts"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","app_1","vdom_1","component_1","Component","router_1","decorator_1","on","update","default","createElement","render","start","element","model","view","options","opts","assign","global_event","component","mount","_app","window","document","addEventListener","App","_events","fn","debug","console","log","push","run","_this","args","_i","arguments","length","subscribers","assert","filter","sub","delay","apply","once","_t","clearTimeout","setTimeout","target","key","descriptor","Reflect","defineMetadata","action","meta","WeakMap","metadataKey","metadataValue","has","set","getMetadataKeys","getPrototypeOf","keys","getMetadata","collect","children","ch","undefined","forEach","Array","isArray","tag","props","__isAppRunComponent","id","idx","createComponent_1","node","firstChild","appendChild","create","same","el","nodeName","toUpperCase","parentNode","replaceChild","len","Math","min","childNodes","child","textContent","nodeType","createText","old","keyCache","removeChild","lastChild","createDocumentFragment","updateProps","indexOf","div","insertAdjacentHTML","substring","createTextNode","JSON","stringify","createElementNS","mergeProps","a","b","cached","ATTR_PROPS","name_1","style","cssText","Fragment","updateElement","html","vdom_my_1","default_1","componentClass","cache","__assign","t","state","_history","_history_idx","renderState","getElementById","rendered","setState","Promise","then","catch","err","error","history","enable_history","concat","callback","prev","next","add_actions","is_global_event","startsWith","add_action","newState","actions","all","split","trim","_a","Router","hash","route","onpopstate","e","location","url","rest","slice"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBA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AACrC,EAAAuC,EAAA,GAAMQ,EAAAR,EAAAS,MAAA,EACblK,GAAAQ,QAAIwB,IAAGW,MAAP3C,EAAAQ,SAAQ0G,GAAI0B,OAAKqB,IACjBjK,EAAAQ,QAAIwB,IAAGW,MAAP3C,EAAAQ,SATe,KASO0G,GAAI0B,OAAKqB,QAE/BjK,GAAAQ,QAAIwB,IAAIgI,GACRhK,EAAAQ,QAAIwB,IAZW,KAYOgI,IAS5BN,ITgnBA3L,GAAQyC,QAAUkJ","file":"dist/apprun.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar vdom_1 = __webpack_require__(4);\nvar component_1 = __webpack_require__(6);\nexports.Component = component_1.Component;\nvar router_1 = __webpack_require__(7);\nvar decorator_1 = __webpack_require__(2);\nexports.on = decorator_1.on;\nexports.update = decorator_1.update;\napp_1.default.createElement = vdom_1.createElement;\napp_1.default.render = vdom_1.render;\napp_1.default.start = function (element, model, view, update, options) {\n var opts = Object.assign(options || {}, { render: true, global_event: true });\n var component = new component_1.Component(model, view, update);\n component.mount(element, opts);\n return component;\n};\nvar _app = app_1.default;\nif (typeof window === 'object') {\n if (window['app'] && window['app']['start']) {\n _app = window['app'];\n }\n else {\n window['app'] = _app;\n document.addEventListener(\"DOMContentLoaded\", function () { return new router_1.default(); });\n }\n}\nexports.default = _app;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar App = /** @class */ (function () {\n function App() {\n this._events = {};\n }\n App.prototype.on = function (name, fn, options) {\n if (options === void 0) { options = {}; }\n if (options.debug)\n console.log('on: ' + name);\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn: fn, options: options });\n };\n App.prototype.run = function (name) {\n var _this = this;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var subscribers = this._events[name];\n console.assert(!!subscribers, 'No subscriber for event: ' + name);\n if (subscribers)\n this._events[name] = subscribers.filter(function (sub) {\n var fn = sub.fn, options = sub.options;\n if (options.delay) {\n _this.delay(name, fn, args, options);\n }\n else {\n if (options.debug)\n console.log('run: ' + name, args);\n fn.apply(_this, args);\n }\n return !sub.options.once;\n });\n };\n App.prototype.delay = function (name, fn, args, options) {\n var _this = this;\n if (options._t)\n clearTimeout(options._t);\n options._t = setTimeout(function () {\n clearTimeout(options._t);\n if (options.debug)\n console.log(\"run-delay \" + options.delay + \":\" + name, args);\n fn.apply(_this, args);\n }, options.delay);\n };\n return App;\n}());\nexports.App = App;\nexports.default = new App();\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Reflect = {\n meta: new WeakMap(),\n defineMetadata: function (metadataKey, metadataValue, target) {\n if (!this.meta.has(target))\n this.meta.set(target, {});\n this.meta.get(target)[metadataKey] = metadataValue;\n },\n getMetadataKeys: function (target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? Object.keys(this.meta.get(target)) : [];\n },\n getMetadata: function (metadataKey, target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? this.meta.get(target)[metadataKey] : null;\n }\n};\nfunction update(name, options) {\n if (options === void 0) { options = {}; }\n return function (target, key, descriptor) {\n name = \"\" + key + (name ? ',' + name : '');\n exports.Reflect.defineMetadata(\"apprun-update:\" + name, { name: name, action: [descriptor.value, options] }, target);\n return descriptor;\n };\n}\nexports.update = update;\nfunction on(name, options) {\n if (options === void 0) { options = {}; }\n return function (target, key) {\n name = \"\" + key + (name ? ',' + name : '');\n exports.Reflect.defineMetadata(\"apprun-update:\" + name, { name: name, key: key }, target);\n };\n}\nexports.on = on;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar createComponent_1 = __webpack_require__(5);\nvar ATTR_PROPS = '_props';\nfunction collect(children) {\n var ch = [];\n var push = function (c) {\n if (c !== null && c !== undefined && c !== '') {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : \"\" + c);\n }\n };\n children && children.forEach(function (c) {\n if (Array.isArray(c)) {\n c.forEach(function (i) { return push(i); });\n }\n else {\n push(c);\n }\n });\n return ch;\n}\nfunction createElement(tag, props) {\n var children = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n children[_i - 2] = arguments[_i];\n }\n var ch = collect(children);\n if (typeof tag === 'string')\n return { tag: tag, props: props, children: ch };\n else if (tag === undefined && children)\n return ch; // JSX fragments\n else if (Object.getPrototypeOf(tag).__isAppRunComponent) {\n var id = props && props['id'] || \"_\" + tag.name + \"_\" + ++idx;\n return createComponent_1.default(tag, id, props);\n }\n else\n return tag(props, ch);\n}\nexports.createElement = createElement;\n;\nvar idx = 0;\nvar keyCache = {};\nexports.updateElement = render;\nfunction render(element, node) {\n // console.log('render', element, node);\n idx = 0;\n if (!node || !element)\n return;\n if (!element.firstChild) {\n element.appendChild(create(node));\n }\n else {\n update(element.firstChild, node);\n }\n}\nexports.render = render;\nfunction same(el, node) {\n // if (!el || !node) return false;\n var key1 = el.nodeName;\n var key2 = \"\" + (node.tag || '');\n return key1 === key2.toUpperCase();\n}\nfunction update(element, node) {\n console.assert(!!element);\n //console.log('update', element, node);\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node), element);\n return;\n }\n var len = Math.min(element.childNodes.length, node.children.length);\n for (var i = 0; i < len; i++) {\n var child = node.children[i];\n var el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.textContent = child;\n }\n else {\n element.replaceChild(createText(child), el);\n }\n }\n }\n else {\n var key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child);\n }\n else {\n var old = key && keyCache[key];\n if (old) {\n element.replaceChild(old, el);\n element.appendChild(el);\n update(element.childNodes[i], child);\n }\n else {\n element.appendChild(create(node), el);\n update(element.childNodes[i], child);\n }\n }\n }\n else {\n update(element.childNodes[i], child);\n }\n }\n }\n var n = element.childNodes.length;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n if (node.children.length > len) {\n var d = document.createDocumentFragment();\n for (var i = len; i < node.children.length; i++) {\n d.appendChild(create(node.children[i]));\n }\n element.appendChild(d);\n }\n updateProps(element, node.props);\n}\nfunction createText(node) {\n if (node.indexOf('_html:') === 0) {\n var div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6));\n return div;\n }\n else {\n return document.createTextNode(node);\n }\n}\nfunction create(node) {\n console.assert(node !== null && node !== undefined);\n // console.log('create', node, typeof node);\n if (typeof node === \"string\")\n return createText(node);\n if (!node.tag)\n return createText(JSON.stringify(node));\n var element = (node.tag === \"svg\")\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n updateProps(element, node.props);\n if (node.children)\n node.children.forEach(function (child) { return element.appendChild(create(child)); });\n return element;\n}\nfunction mergeProps(a, b) {\n var props = {};\n if (a)\n Object.keys(a).forEach(function (p) { return props[p] = ''; });\n if (b)\n Object.keys(b).forEach(function (p) { return props[p] = b[p]; });\n return props;\n}\nfunction updateProps(element, props) {\n console.assert(!!element);\n // console.log('updateProps', element, props);\n var cached = element[ATTR_PROPS] || {};\n props = mergeProps(cached, props);\n element[ATTR_PROPS] = props;\n for (var name_1 in props) {\n var value = props[name_1];\n if (cached[name_1] === value)\n continue;\n // console.log('updateProps', name, value);\n if (name_1 === 'style') {\n if (element.style.cssText)\n element.style.cssText = '';\n for (var s in value) {\n if (element.style[s] !== value[s])\n element.style[s] = value[s];\n }\n }\n else {\n if (element[name_1] !== value)\n element[name_1] = value;\n if (name_1 === 'key' && value)\n keyCache[value] = element;\n }\n }\n}\nfunction Fragment(props) {\n var children = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n children[_i - 1] = arguments[_i];\n }\n return collect(children);\n}\nexports.Fragment = Fragment;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vdom_my_1 = __webpack_require__(3);\nexports.createElement = vdom_my_1.createElement;\nfunction render(element, html) {\n console.assert(!!element);\n vdom_my_1.updateElement(element, html);\n}\nexports.render = render;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar cache = {};\nfunction default_1(componentClass, id, props) {\n var component = cache[id] ? cache[id] :\n (cache[id] = new componentClass(props).mount(id));\n return app_1.default.createElement(\"div\", { id: id }, component.render && component.render());\n}\nexports.default = default_1;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar decorator_1 = __webpack_require__(2);\nvar Component = /** @class */ (function () {\n function Component(state, view, update, options) {\n var _this = this;\n this.state = state;\n this.view = view;\n this.update = update;\n this.options = options;\n this._app = new app_1.App();\n this._history = [];\n this._history_idx = -1;\n this.start = function (element, options) {\n if (element === void 0) { element = null; }\n if (options === void 0) { options = { render: true }; }\n return _this.mount(element, __assign({}, options, { render: true }));\n };\n this.render = function () { return _this.view(_this.state); };\n }\n Component.prototype.renderState = function (state) {\n if (!this.view)\n return;\n var html = this.view(state);\n var el = (typeof this.element === 'string') ?\n document.getElementById(this.element) : this.element;\n if (el)\n el['_component'] = this;\n if (el && app_1.default.render) {\n app_1.default.render(el, html);\n if (this.rendered)\n (this.rendered(this.state));\n }\n };\n Component.prototype.setState = function (state, options) {\n var _this = this;\n if (state instanceof Promise) {\n // Promise will not be saved nor rendered saved\n // state will be saved and rendered when promise is resolved\n state.then(function (s) {\n _this.setState(s, options);\n }).catch(function (err) {\n console.error(err);\n throw err;\n });\n }\n else {\n if (state == null)\n return;\n this.state = state;\n if (options.render !== false)\n this.renderState(state);\n if (options.history !== false && this.enable_history) {\n this._history = this._history.concat([state]);\n this._history_idx = this._history.length - 1;\n }\n if (typeof options.callback === 'function')\n options.callback(this.state);\n }\n };\n Component.prototype.mount = function (element, options) {\n var _this = this;\n if (element === void 0) { element = null; }\n console.assert(!this.element, 'Component already mounted.');\n this.options = options = Object.assign(this.options || {}, options);\n this.element = element;\n this.global_event = options.global_event;\n this.enable_history = !!options.history;\n if (this.enable_history) {\n var prev = function () {\n _this._history_idx--;\n if (_this._history_idx >= 0) {\n _this.setState(_this._history[_this._history_idx], { render: true, history: false });\n }\n else {\n _this._history_idx = 0;\n }\n };\n var next = function () {\n _this._history_idx++;\n if (_this._history_idx < _this._history.length) {\n _this.setState(_this._history[_this._history_idx], { render: true, history: false });\n }\n else {\n _this._history_idx = _this._history.length - 1;\n }\n };\n this.on(options.history.prev || 'history-prev', prev);\n this.on(options.history.next || 'history-next', next);\n }\n this.add_actions();\n if (this.state === undefined)\n this.state = this['model'] || {};\n if (options.render) {\n this.setState(this.state, { render: true, history: true });\n }\n else {\n this.setState(this.state, { render: false, history: true });\n }\n return this;\n };\n Component.prototype.is_global_event = function (name) {\n return name && (name.startsWith('#') || name.startsWith('/'));\n };\n Component.prototype.add_action = function (name, action, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n if (!action || typeof action !== 'function')\n return;\n this.on(name, function () {\n var p = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n p[_i] = arguments[_i];\n }\n var newState = action.apply(void 0, [_this.state].concat(p));\n _this.setState(newState, options);\n }, options);\n };\n Component.prototype.add_actions = function () {\n var _this = this;\n var actions = this.update || {};\n decorator_1.Reflect.getMetadataKeys(this).forEach(function (key) {\n if (key.startsWith('apprun-update:')) {\n var meta = decorator_1.Reflect.getMetadata(key, _this);\n actions[meta.name] = meta.action || _this[meta.key];\n }\n });\n var all = {};\n Object.keys(actions).forEach(function (name) {\n var action = actions[name];\n if (typeof action === 'function' || Array.isArray(action)) {\n name.split(',').forEach(function (n) { return all[n.trim()] = action; });\n }\n });\n Object.keys(all).forEach(function (name) {\n var action = all[name];\n if (typeof action === 'function') {\n _this.add_action(name, action);\n }\n else if (Array.isArray(action)) {\n _this.add_action(name, action[0], action[1]);\n }\n });\n };\n Component.prototype.run = function (name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return this.global_event || this.is_global_event(name) ? app_1.default.run.apply(app_1.default, [name].concat(args)) : (_a = this._app).run.apply(_a, [name].concat(args));\n var _a;\n };\n Component.prototype.on = function (name, fn, options) {\n return this.global_event || this.is_global_event(name) ?\n app_1.default.on(name, fn, options) :\n this._app.on(name, fn, options);\n };\n Component.__isAppRunComponent = true;\n return Component;\n}());\nexports.Component = Component;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar ROUTER_EVENT = '//';\nvar Router = /** @class */ (function () {\n function Router() {\n var _this = this;\n app_1.default.on('route', function (hash) { return _this.route(hash); });\n window.onpopstate = function (e) { return _this.route(location.hash); };\n this.route(location.hash);\n }\n Router.prototype.route = function (url) {\n if (!url)\n url = '#';\n if (url.indexOf('/') > 0) {\n var _a = url.split('/'), name_1 = _a[0], rest = _a.slice(1);\n app_1.default.run.apply(app_1.default, [name_1].concat(rest));\n app_1.default.run.apply(app_1.default, [ROUTER_EVENT, name_1].concat(rest));\n }\n else {\n app_1.default.run(url);\n app_1.default.run(ROUTER_EVENT, url);\n }\n };\n return Router;\n}());\nexports.default = Router;\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// dist/apprun.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 34faa1100aa1f0068c04","import app from './app';\nimport { createElement, render } from './vdom';\nimport { Component } from './component';\nimport Router from './router';\nimport { on, update } from './decorator';\n\nexport type Model = any;\nexport type View = (model: Model) => string | Function;\nexport type Action = (model: Model, ...p) => Model;\nexport type Update = { [name: string]: Action | {}[] };\n\napp.createElement = createElement;\napp.render = render;\n\napp.start = (element: HTMLElement | string, model: Model, view: View, update: Update, options?: { history }) => {\n const opts = Object.assign(options || {}, { render: true, global_event: true} )\n const component = new Component(model, view, update);\n component.mount(element, opts);\n return component;\n}\n\nlet _app = app;\nif (typeof window === 'object') {\n if (window['app'] && window['app']['start']) {\n _app = window['app'];\n } else {\n window['app'] = _app;\n document.addEventListener(\"DOMContentLoaded\", () => new Router());\n }\n}\n\nexport default _app;\nexport { Component, on, update };\n\n\n// WEBPACK FOOTER //\n// ./src/apprun.ts","export class App {\n\n private _events: Object;\n\n public start;\n public createElement;\n public render;\n\n constructor() {\n this._events = {};\n }\n\n on(name: string, fn: (...args) => void, options: any = {}) {\n if (options.debug) console.log('on: ' + name);\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn: fn, options: options });\n }\n\n run(name: string, ...args) {\n const subscribers = this._events[name];\n console.assert(!!subscribers, 'No subscriber for event: ' + name);\n if (subscribers) this._events[name] = subscribers.filter((sub) => {\n let { fn, options } = sub;\n if (options.delay) {\n this.delay(name, fn, args, options);\n } else {\n if (options.debug) console.log('run: ' + name, args);\n fn.apply(this, args);\n }\n return !sub.options.once;\n });\n }\n\n private delay(name, fn, args, options) {\n if (options._t) clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n if (options.debug) console.log(`run-delay ${options.delay}:` + name, args);\n fn.apply(this, args);\n }, options.delay);\n }\n}\n\nexport default new App();\n\n\n\n// WEBPACK FOOTER //\n// ./src/app.ts","export const Reflect = {\n\n meta: new WeakMap(),\n\n defineMetadata(metadataKey, metadataValue, target) {\n if (!this.meta.has(target)) this.meta.set(target, {});\n this.meta.get(target)[metadataKey] = metadataValue;\n },\n\n getMetadataKeys(target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? Object.keys(this.meta.get(target)) : [];\n },\n\n getMetadata(metadataKey, target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? this.meta.get(target)[metadataKey] : null;\n }\n}\n\nexport function update(name?: string, options: any = {}) {\n return (target: any, key: string, descriptor: any) => {\n name = `${key}${name ? ',' + name : ''}`;\n Reflect.defineMetadata(`apprun-update:${name}`,\n { name, action: [descriptor.value, options] }, target);\n return descriptor;\n }\n}\n\nexport function on(name?: string, options: any = {}) {\n return function (target: any, key: string) {\n name = `${key}${name ? ',' + name : ''}`; \n Reflect.defineMetadata(`apprun-update:${name}`, { name, key }, target)\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/decorator.ts","import createComponent from './createComponent';\n\nexport type VNode = {\n tag: string,\n props: {},\n children: Array<VNode | string>\n}\n\nexport type Element = any; //HTMLElement | SVGSVGElement | SVGElement;\n\nconst ATTR_PROPS = '_props';\n\nfunction collect(children) {\n const ch = [];\n const push = (c) => {\n if (c !== null && c !== undefined && c !== '') {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : `${c}`);\n }\n }\n children && children.forEach(c => {\n if (Array.isArray(c)) {\n c.forEach(i => push(i));\n } else {\n push(c);\n }\n });\n return ch;\n}\n\nexport function createElement (tag: string | Function, props: {}, ...children) {\n const ch = collect(children);\n if (typeof tag === 'string') return { tag, props, children: ch };\n else if (tag === undefined && children) return ch; // JSX fragments\n else if (Object.getPrototypeOf(tag).__isAppRunComponent) {\n const id = props && props['id'] || `_${tag.name}_${++idx}`;\n return createComponent(tag, id, props);\n }\n else\n return tag(props, ch);\n};\n\nlet idx = 0;\nconst keyCache = {};\n\nexport const updateElement = render;\n\nexport function render(element: Element, node: VNode) {\n // console.log('render', element, node);\n idx = 0;\n\n if (!node || !element) return;\n if (!element.firstChild) {\n element.appendChild(create(node));\n } else {\n update(element.firstChild, node);\n }\n}\n\nfunction same(el: Element, node: VNode) {\n // if (!el || !node) return false;\n const key1 = el.nodeName;\n const key2 = `${node.tag || ''}`;\n return key1 === key2.toUpperCase();\n}\n\nfunction update(element: Element, node: VNode) {\n console.assert(!!element);\n //console.log('update', element, node);\n\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node), element);\n return;\n }\n\n const len = Math.min(element.childNodes.length, node.children.length);\n for (let i = 0; i < len; i++) {\n const child = node.children[i];\n const el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.textContent = child\n } else {\n element.replaceChild(createText(child), el);\n }\n }\n } else {\n const key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child);\n } else {\n const old = key && keyCache[key];\n if (old) {\n element.replaceChild(old, el);\n element.appendChild(el);\n update(element.childNodes[i], child);\n } else {\n element.appendChild(create(node), el);\n update(element.childNodes[i], child);\n }\n }\n } else {\n update(element.childNodes[i], child);\n }\n }\n }\n\n let n = element.childNodes.length;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n\n if (node.children.length > len) {\n const d = document.createDocumentFragment();\n for (let i = len; i < node.children.length; i++) {\n d.appendChild(create(node.children[i]));\n }\n element.appendChild(d);\n }\n\n updateProps(element, node.props);\n\n}\n\nfunction createText(node) {\n if (node.indexOf('_html:') === 0) { // ?\n const div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6))\n return div;\n } else {\n return document.createTextNode(node);\n }\n}\n\nfunction create(node: VNode | string): Element {\n console.assert(node !== null && node !== undefined);\n // console.log('create', node, typeof node);\n\n if (typeof node === \"string\") return createText(node);\n if (!node.tag) return createText(JSON.stringify(node));\n\n const element = (node.tag === \"svg\")\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n\n updateProps(element, node.props);\n\n if (node.children) node.children.forEach(child => element.appendChild(create(child)));\n\n return element\n}\n\nfunction mergeProps(a: {}, b: {}): {} {\n const props = {};\n if (a) Object.keys(a).forEach(p => props[p] = '');\n if (b) Object.keys(b).forEach(p => props[p] = b[p]);\n return props;\n}\n\nfunction updateProps(element: Element, props: {}) {\n console.assert(!!element);\n // console.log('updateProps', element, props);\n\n const cached = element[ATTR_PROPS] || {};\n props = mergeProps(cached, props);\n element[ATTR_PROPS] = props;\n for (let name in props) {\n const value = props[name];\n if (cached[name] === value) continue;\n // console.log('updateProps', name, value);\n if (name === 'style') {\n if (element.style.cssText) element.style.cssText = '';\n for (let s in value) {\n if (element.style[s] !== value[s]) element.style[s] = value[s];\n }\n } else {\n if (element[name] !== value) element[name] = value;\n if (name === 'key' && value) keyCache[value] = element;\n }\n }\n}\n\nexport function Fragment(props, ...children) {\n return collect(children);\n}\n\n\n// WEBPACK FOOTER //\n// ./src/vdom-my.ts","import { createElement, updateElement } from './vdom-my';\nexport function render(element, html) {\n console.assert(!!element);\n updateElement(element, html);\n}\nexport { createElement };\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/vdom.ts","import app from './app';\n\nconst cache = {}\n\nexport default function (componentClass, id, props) {\n const component = cache[id] ? cache[id] :\n (cache[id] = new componentClass(props).mount(id))\n return <div id={id}>\n {component.render && component.render()}\n </div>\n}\n\n\n// WEBPACK FOOTER //\n// ./src/createComponent.tsx","\r\nimport app, { App } from './app';\r\nimport { Reflect } from './decorator'\r\nexport class Component {\r\n static __isAppRunComponent = true;\r\n private _app = new App();\r\n\r\n element;\r\n private _history = [];\r\n private _history_idx = -1;\r\n private enable_history;\r\n private global_event;\r\n protected rendered;\r\n\r\n private renderState(state) {\r\n if (!this.view) return;\r\n const html = this.view(state);\r\n const el = (typeof this.element === 'string') ?\r\n document.getElementById(this.element) : this.element;\r\n if (el) el['_component'] = this;\r\n if (el && app.render) {\r\n app.render(el, html);\r\n if (this.rendered) (this.rendered(this.state));\r\n }\r\n }\r\n\r\n public setState(state, options: {render:boolean, history:boolean, callback?}) {\r\n if (state instanceof Promise) {\r\n // Promise will not be saved nor rendered saved\r\n // state will be saved and rendered when promise is resolved\r\n state.then(s => {\r\n this.setState(s, options)\r\n }).catch(err => {\r\n console.error(err);\r\n throw err;\r\n })\r\n } else {\r\n if (state == null) return;\r\n this.state = state;\r\n if (options.render !== false) this.renderState(state);\r\n if (options.history !== false && this.enable_history) {\r\n this._history = [...this._history, state];\r\n this._history_idx = this._history.length - 1;\r\n }\r\n if (typeof options.callback === 'function') options.callback(this.state);\r\n }\r\n }\r\n\r\n constructor(\r\n protected state?,\r\n protected view?,\r\n protected update?,\r\n protected options?) {\r\n }\r\n\r\n public mount(element = null, options?: { render?: boolean, history?, global_event?: boolean}) {\r\n\r\n console.assert(!this.element, 'Component already mounted.')\r\n this.options = options = Object.assign(this.options || {}, options);\r\n this.element = element;\r\n this.global_event = options.global_event;\r\n this.enable_history = !!options.history;\r\n\r\n if (this.enable_history) {\r\n const prev = () => {\r\n this._history_idx --;\r\n if (this._history_idx >=0) {\r\n this.setState(this._history[this._history_idx], { render: true, history: false });\r\n }\r\n else {\r\n this._history_idx = 0;\r\n }\r\n };\r\n\r\n const next = () => {\r\n this._history_idx ++;\r\n if (this._history_idx < this._history.length) {\r\n this.setState(this._history[this._history_idx], { render: true, history: false });\r\n }\r\n else {\r\n this._history_idx = this._history.length - 1;\r\n }\r\n };\r\n this.on(options.history.prev || 'history-prev', prev)\r\n this.on(options.history.next || 'history-next', next)\r\n }\r\n this.add_actions();\r\n if (this.state === undefined) this.state = this['model'] || {};\r\n if (options.render) {\r\n this.setState(this.state, { render: true, history: true });\r\n } else {\r\n this.setState(this.state, { render: false, history: true });\r\n }\r\n return this;\r\n }\r\n\r\n is_global_event(name: string): boolean {\r\n return name && (name.startsWith('#') || name.startsWith('/'));\r\n }\r\n\r\n add_action(name, action, options: any = {}) {\r\n if (!action || typeof action !== 'function') return;\r\n this.on(name, (...p) => {\r\n const newState = action(this.state, ...p);\r\n this.setState(newState, options)\r\n }, options);\r\n }\r\n\r\n add_actions() {\r\n const actions = this.update || {};\r\n Reflect.getMetadataKeys(this).forEach(key => {\r\n if (key.startsWith('apprun-update:')) {\r\n const meta = Reflect.getMetadata(key, this)\r\n actions[meta.name] = meta.action || this[meta.key]\r\n }\r\n })\r\n const all = {};\r\n Object.keys(actions).forEach(name => {\r\n const action = actions[name];\r\n if (typeof action === 'function' || Array.isArray(action)) {\r\n name.split(',').forEach(n => all[n.trim()] = action)\r\n }\r\n })\r\n\r\n Object.keys(all).forEach(name => {\r\n const action = all[name];\r\n if (typeof action === 'function') {\r\n this.add_action(name, action);\r\n } else if (Array.isArray(action)) {\r\n this.add_action(name, action[0], action[1]);\r\n }\r\n });\r\n }\r\n\r\n start = (element = null,\r\n options: { render?: boolean, history?, global_event?: boolean }= { render: true }): Component => {\r\n return this.mount(element, { ...options, render: true });\r\n }\r\n\r\n render = () => this.view(this.state);\r\n\r\n public run(name: string, ...args) {\r\n return this.global_event || this.is_global_event(name) ?\r\n app.run(name, ...args) :\r\n this._app.run(name, ...args);\r\n }\r\n\r\n public on(name: string, fn: (...args) => void, options?: any) {\r\n return this.global_event || this.is_global_event(name) ?\r\n app.on(name, fn, options) :\r\n this._app.on(name, fn, options);\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/component.ts","import app from './app';\n\nconst ROUTER_EVENT = '//';\n\nexport default class Router {\n\n route(url: string) {\n if (!url) url = '#';\n if (url.indexOf('/') > 0) {\n const [name, ...rest] = url.split('/');\n app.run(name, ...rest);\n app.run(ROUTER_EVENT, name, ...rest);\n } else {\n app.run(url);\n app.run(ROUTER_EVENT, url);\n }\n }\n\n constructor() {\n app.on('route', hash => this.route(hash));\n window.onpopstate = e => this.route(location.hash);\n this.route(location.hash);\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/router.ts"],"sourceRoot":""} <MSG> update changelog and compile <DFF> @@ -1,1 +1,1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/apprun.js","webpack:///webpack/bootstrap 34faa1100aa1f0068c04","webpack:///./src/apprun.ts","webpack:///./src/app.ts","webpack:///./src/decorator.ts","webpack:///./src/vdom-my.ts","webpack:///./src/vdom.ts","webpack:///./src/createComponent.tsx","webpack:///./src/component.ts","webpack:///./src/router.ts"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","app_1","vdom_1","component_1","Component","router_1","decorator_1","on","update","default","createElement","render","start","element","model","view","options","opts","assign","global_event","component","mount","_app","window","document","addEventListener","App","_events","fn","debug","console","log","push","run","_this","args","_i","arguments","length","subscribers","assert","filter","sub","delay","apply","once","_t","clearTimeout","setTimeout","target","key","descriptor","Reflect","defineMetadata","action","meta","WeakMap","metadataKey","metadataValue","has","set","getMetadataKeys","getPrototypeOf","keys","getMetadata","collect","children","ch","undefined","forEach","Array","isArray","tag","props","__isAppRunComponent","id","idx","createComponent_1","node","firstChild","appendChild","create","same","el","nodeName","toUpperCase","parentNode","replaceChild","len","Math","min","childNodes","child","textContent","nodeType","createText","old","keyCache","removeChild","lastChild","createDocumentFragment","updateProps","indexOf","div","insertAdjacentHTML","substring","createTextNode","JSON","stringify","createElementNS","mergeProps","a","b","cached","ATTR_PROPS","name_1","style","cssText","Fragment","updateElement","html","vdom_my_1","default_1","componentClass","cache","__assign","t","state","_history","_history_idx","renderState","getElementById","rendered","setState","Promise","then","catch","err","error","history","enable_history","concat","callback","prev","next","add_actions","is_global_event","startsWith","add_action","newState","actions","all","split","trim","_a","Router","hash","route","onpopstate","e","location","url","rest","slice"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAM,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,GAIAV,EAAAW,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QA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/BtE,IAtJapC,GAAAoC,aRumBP,SAAUnC,EAAQD,EAASO,GAEjC,YAEAY,QAAOC,eAAepB,EAAS,cAAgBgC,OAAO,GS9mBtD,IAAAC,GAAA1B,EAAA,GAIAoL,EAAA,WAcE,QAAAA,KAAA,GAAAzH,GAAA7D,IACE4B,GAAAQ,QAAIF,GAAG,QAAS,SAAAqJ,GAAQ,MAAA1H,GAAK2H,MAAMD,KACnCrI,OAAOuI,WAAa,SAAAC,GAAK,MAAA7H,GAAK2H,MAAMG,SAASJ,OAC7CvL,KAAKwL,MAAMG,SAASJ,MAExB,MAjBED,GAAA/J,UAAAiK,MAAA,SAAMI,GAEJ,GADKA,IAAKA,EAAM,KACZA,EAAI3D,QAAQ,KAAO,EAAG,CAClB,GAAAoD,GAAAO,EAAAT,MAAA,KAACrC,EAAAuC,EAAA,GAAMQ,EAAAR,EAAAS,MAAA,EACblK,GAAAQ,QAAIwB,IAAGW,MAAP3C,EAAAQ,SAAQ0G,GAAI0B,OAAKqB,IACjBjK,EAAAQ,QAAIwB,IAAGW,MAAP3C,EAAAQ,SATe,KASO0G,GAAI0B,OAAKqB,QAE/BjK,GAAAQ,QAAIwB,IAAIgI,GACRhK,EAAAQ,QAAIwB,IAZW,KAYOgI,IAS5BN,ITgnBA3L,GAAQyC,QAAUkJ","file":"dist/apprun.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar vdom_1 = __webpack_require__(4);\nvar component_1 = __webpack_require__(6);\nexports.Component = component_1.Component;\nvar router_1 = __webpack_require__(7);\nvar decorator_1 = __webpack_require__(2);\nexports.on = decorator_1.on;\nexports.update = decorator_1.update;\napp_1.default.createElement = vdom_1.createElement;\napp_1.default.render = vdom_1.render;\napp_1.default.start = function (element, model, view, update, options) {\n var opts = Object.assign(options || {}, { render: true, global_event: true });\n var component = new component_1.Component(model, view, update);\n component.mount(element, opts);\n return component;\n};\nvar _app = app_1.default;\nif (typeof window === 'object') {\n if (window['app'] && window['app']['start']) {\n _app = window['app'];\n }\n else {\n window['app'] = _app;\n document.addEventListener(\"DOMContentLoaded\", function () { return new router_1.default(); });\n }\n}\nexports.default = _app;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar App = /** @class */ (function () {\n function App() {\n this._events = {};\n }\n App.prototype.on = function (name, fn, options) {\n if (options === void 0) { options = {}; }\n if (options.debug)\n console.log('on: ' + name);\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn: fn, options: options });\n };\n App.prototype.run = function (name) {\n var _this = this;\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var subscribers = this._events[name];\n console.assert(!!subscribers, 'No subscriber for event: ' + name);\n if (subscribers)\n this._events[name] = subscribers.filter(function (sub) {\n var fn = sub.fn, options = sub.options;\n if (options.delay) {\n _this.delay(name, fn, args, options);\n }\n else {\n if (options.debug)\n console.log('run: ' + name, args);\n fn.apply(_this, args);\n }\n return !sub.options.once;\n });\n };\n App.prototype.delay = function (name, fn, args, options) {\n var _this = this;\n if (options._t)\n clearTimeout(options._t);\n options._t = setTimeout(function () {\n clearTimeout(options._t);\n if (options.debug)\n console.log(\"run-delay \" + options.delay + \":\" + name, args);\n fn.apply(_this, args);\n }, options.delay);\n };\n return App;\n}());\nexports.App = App;\nexports.default = new App();\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Reflect = {\n meta: new WeakMap(),\n defineMetadata: function (metadataKey, metadataValue, target) {\n if (!this.meta.has(target))\n this.meta.set(target, {});\n this.meta.get(target)[metadataKey] = metadataValue;\n },\n getMetadataKeys: function (target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? Object.keys(this.meta.get(target)) : [];\n },\n getMetadata: function (metadataKey, target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? this.meta.get(target)[metadataKey] : null;\n }\n};\nfunction update(name, options) {\n if (options === void 0) { options = {}; }\n return function (target, key, descriptor) {\n name = \"\" + key + (name ? ',' + name : '');\n exports.Reflect.defineMetadata(\"apprun-update:\" + name, { name: name, action: [descriptor.value, options] }, target);\n return descriptor;\n };\n}\nexports.update = update;\nfunction on(name, options) {\n if (options === void 0) { options = {}; }\n return function (target, key) {\n name = \"\" + key + (name ? ',' + name : '');\n exports.Reflect.defineMetadata(\"apprun-update:\" + name, { name: name, key: key }, target);\n };\n}\nexports.on = on;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar createComponent_1 = __webpack_require__(5);\nvar ATTR_PROPS = '_props';\nfunction collect(children) {\n var ch = [];\n var push = function (c) {\n if (c !== null && c !== undefined && c !== '') {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : \"\" + c);\n }\n };\n children && children.forEach(function (c) {\n if (Array.isArray(c)) {\n c.forEach(function (i) { return push(i); });\n }\n else {\n push(c);\n }\n });\n return ch;\n}\nfunction createElement(tag, props) {\n var children = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n children[_i - 2] = arguments[_i];\n }\n var ch = collect(children);\n if (typeof tag === 'string')\n return { tag: tag, props: props, children: ch };\n else if (tag === undefined && children)\n return ch; // JSX fragments\n else if (Object.getPrototypeOf(tag).__isAppRunComponent) {\n var id = props && props['id'] || \"_\" + tag.name + \"_\" + ++idx;\n return createComponent_1.default(tag, id, props);\n }\n else\n return tag(props, ch);\n}\nexports.createElement = createElement;\n;\nvar idx = 0;\nvar keyCache = {};\nexports.updateElement = render;\nfunction render(element, node) {\n // console.log('render', element, node);\n idx = 0;\n if (!node || !element)\n return;\n if (!element.firstChild) {\n element.appendChild(create(node));\n }\n else {\n update(element.firstChild, node);\n }\n}\nexports.render = render;\nfunction same(el, node) {\n // if (!el || !node) return false;\n var key1 = el.nodeName;\n var key2 = \"\" + (node.tag || '');\n return key1 === key2.toUpperCase();\n}\nfunction update(element, node) {\n console.assert(!!element);\n //console.log('update', element, node);\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node), element);\n return;\n }\n var len = Math.min(element.childNodes.length, node.children.length);\n for (var i = 0; i < len; i++) {\n var child = node.children[i];\n var el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.textContent = child;\n }\n else {\n element.replaceChild(createText(child), el);\n }\n }\n }\n else {\n var key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child);\n }\n else {\n var old = key && keyCache[key];\n if (old) {\n element.replaceChild(old, el);\n element.appendChild(el);\n update(element.childNodes[i], child);\n }\n else {\n element.appendChild(create(node), el);\n update(element.childNodes[i], child);\n }\n }\n }\n else {\n update(element.childNodes[i], child);\n }\n }\n }\n var n = element.childNodes.length;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n if (node.children.length > len) {\n var d = document.createDocumentFragment();\n for (var i = len; i < node.children.length; i++) {\n d.appendChild(create(node.children[i]));\n }\n element.appendChild(d);\n }\n updateProps(element, node.props);\n}\nfunction createText(node) {\n if (node.indexOf('_html:') === 0) {\n var div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6));\n return div;\n }\n else {\n return document.createTextNode(node);\n }\n}\nfunction create(node) {\n console.assert(node !== null && node !== undefined);\n // console.log('create', node, typeof node);\n if (typeof node === \"string\")\n return createText(node);\n if (!node.tag)\n return createText(JSON.stringify(node));\n var element = (node.tag === \"svg\")\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n updateProps(element, node.props);\n if (node.children)\n node.children.forEach(function (child) { return element.appendChild(create(child)); });\n return element;\n}\nfunction mergeProps(a, b) {\n var props = {};\n if (a)\n Object.keys(a).forEach(function (p) { return props[p] = ''; });\n if (b)\n Object.keys(b).forEach(function (p) { return props[p] = b[p]; });\n return props;\n}\nfunction updateProps(element, props) {\n console.assert(!!element);\n // console.log('updateProps', element, props);\n var cached = element[ATTR_PROPS] || {};\n props = mergeProps(cached, props);\n element[ATTR_PROPS] = props;\n for (var name_1 in props) {\n var value = props[name_1];\n if (cached[name_1] === value)\n continue;\n // console.log('updateProps', name, value);\n if (name_1 === 'style') {\n if (element.style.cssText)\n element.style.cssText = '';\n for (var s in value) {\n if (element.style[s] !== value[s])\n element.style[s] = value[s];\n }\n }\n else {\n if (element[name_1] !== value)\n element[name_1] = value;\n if (name_1 === 'key' && value)\n keyCache[value] = element;\n }\n }\n}\nfunction Fragment(props) {\n var children = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n children[_i - 1] = arguments[_i];\n }\n return collect(children);\n}\nexports.Fragment = Fragment;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vdom_my_1 = __webpack_require__(3);\nexports.createElement = vdom_my_1.createElement;\nfunction render(element, html) {\n console.assert(!!element);\n vdom_my_1.updateElement(element, html);\n}\nexports.render = render;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar cache = {};\nfunction default_1(componentClass, id, props) {\n var component = cache[id] ? cache[id] :\n (cache[id] = new componentClass(props).mount(id));\n return app_1.default.createElement(\"div\", { id: id }, component.render && component.render());\n}\nexports.default = default_1;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar decorator_1 = __webpack_require__(2);\nvar Component = /** @class */ (function () {\n function Component(state, view, update, options) {\n var _this = this;\n this.state = state;\n this.view = view;\n this.update = update;\n this.options = options;\n this._app = new app_1.App();\n this._history = [];\n this._history_idx = -1;\n this.start = function (element, options) {\n if (element === void 0) { element = null; }\n if (options === void 0) { options = { render: true }; }\n return _this.mount(element, __assign({}, options, { render: true }));\n };\n this.render = function () { return _this.view(_this.state); };\n }\n Component.prototype.renderState = function (state) {\n if (!this.view)\n return;\n var html = this.view(state);\n var el = (typeof this.element === 'string') ?\n document.getElementById(this.element) : this.element;\n if (el)\n el['_component'] = this;\n if (el && app_1.default.render) {\n app_1.default.render(el, html);\n if (this.rendered)\n (this.rendered(this.state));\n }\n };\n Component.prototype.setState = function (state, options) {\n var _this = this;\n if (state instanceof Promise) {\n // Promise will not be saved nor rendered saved\n // state will be saved and rendered when promise is resolved\n state.then(function (s) {\n _this.setState(s, options);\n }).catch(function (err) {\n console.error(err);\n throw err;\n });\n }\n else {\n if (state == null)\n return;\n this.state = state;\n if (options.render !== false)\n this.renderState(state);\n if (options.history !== false && this.enable_history) {\n this._history = this._history.concat([state]);\n this._history_idx = this._history.length - 1;\n }\n if (typeof options.callback === 'function')\n options.callback(this.state);\n }\n };\n Component.prototype.mount = function (element, options) {\n var _this = this;\n if (element === void 0) { element = null; }\n console.assert(!this.element, 'Component already mounted.');\n this.options = options = Object.assign(this.options || {}, options);\n this.element = element;\n this.global_event = options.global_event;\n this.enable_history = !!options.history;\n if (this.enable_history) {\n var prev = function () {\n _this._history_idx--;\n if (_this._history_idx >= 0) {\n _this.setState(_this._history[_this._history_idx], { render: true, history: false });\n }\n else {\n _this._history_idx = 0;\n }\n };\n var next = function () {\n _this._history_idx++;\n if (_this._history_idx < _this._history.length) {\n _this.setState(_this._history[_this._history_idx], { render: true, history: false });\n }\n else {\n _this._history_idx = _this._history.length - 1;\n }\n };\n this.on(options.history.prev || 'history-prev', prev);\n this.on(options.history.next || 'history-next', next);\n }\n this.add_actions();\n if (this.state === undefined)\n this.state = this['model'] || {};\n if (options.render) {\n this.setState(this.state, { render: true, history: true });\n }\n else {\n this.setState(this.state, { render: false, history: true });\n }\n return this;\n };\n Component.prototype.is_global_event = function (name) {\n return name && (name.startsWith('#') || name.startsWith('/'));\n };\n Component.prototype.add_action = function (name, action, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n if (!action || typeof action !== 'function')\n return;\n this.on(name, function () {\n var p = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n p[_i] = arguments[_i];\n }\n var newState = action.apply(void 0, [_this.state].concat(p));\n _this.setState(newState, options);\n }, options);\n };\n Component.prototype.add_actions = function () {\n var _this = this;\n var actions = this.update || {};\n decorator_1.Reflect.getMetadataKeys(this).forEach(function (key) {\n if (key.startsWith('apprun-update:')) {\n var meta = decorator_1.Reflect.getMetadata(key, _this);\n actions[meta.name] = meta.action || _this[meta.key];\n }\n });\n var all = {};\n Object.keys(actions).forEach(function (name) {\n var action = actions[name];\n if (typeof action === 'function' || Array.isArray(action)) {\n name.split(',').forEach(function (n) { return all[n.trim()] = action; });\n }\n });\n Object.keys(all).forEach(function (name) {\n var action = all[name];\n if (typeof action === 'function') {\n _this.add_action(name, action);\n }\n else if (Array.isArray(action)) {\n _this.add_action(name, action[0], action[1]);\n }\n });\n };\n Component.prototype.run = function (name) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return this.global_event || this.is_global_event(name) ? app_1.default.run.apply(app_1.default, [name].concat(args)) : (_a = this._app).run.apply(_a, [name].concat(args));\n var _a;\n };\n Component.prototype.on = function (name, fn, options) {\n return this.global_event || this.is_global_event(name) ?\n app_1.default.on(name, fn, options) :\n this._app.on(name, fn, options);\n };\n Component.__isAppRunComponent = true;\n return Component;\n}());\nexports.Component = Component;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar ROUTER_EVENT = '//';\nvar Router = /** @class */ (function () {\n function Router() {\n var _this = this;\n app_1.default.on('route', function (hash) { return _this.route(hash); });\n window.onpopstate = function (e) { return _this.route(location.hash); };\n this.route(location.hash);\n }\n Router.prototype.route = function (url) {\n if (!url)\n url = '#';\n if (url.indexOf('/') > 0) {\n var _a = url.split('/'), name_1 = _a[0], rest = _a.slice(1);\n app_1.default.run.apply(app_1.default, [name_1].concat(rest));\n app_1.default.run.apply(app_1.default, [ROUTER_EVENT, name_1].concat(rest));\n }\n else {\n app_1.default.run(url);\n app_1.default.run(ROUTER_EVENT, url);\n }\n };\n return Router;\n}());\nexports.default = Router;\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// dist/apprun.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 34faa1100aa1f0068c04","import app from './app';\nimport { createElement, render } from './vdom';\nimport { Component } from './component';\nimport Router from './router';\nimport { on, update } from './decorator';\n\nexport type Model = any;\nexport type View = (model: Model) => string | Function;\nexport type Action = (model: Model, ...p) => Model;\nexport type Update = { [name: string]: Action | {}[] };\n\napp.createElement = createElement;\napp.render = render;\n\napp.start = (element: HTMLElement | string, model: Model, view: View, update: Update, options?: { history }) => {\n const opts = Object.assign(options || {}, { render: true, global_event: true} )\n const component = new Component(model, view, update);\n component.mount(element, opts);\n return component;\n}\n\nlet _app = app;\nif (typeof window === 'object') {\n if (window['app'] && window['app']['start']) {\n _app = window['app'];\n } else {\n window['app'] = _app;\n document.addEventListener(\"DOMContentLoaded\", () => new Router());\n }\n}\n\nexport default _app;\nexport { Component, on, update };\n\n\n// WEBPACK FOOTER //\n// ./src/apprun.ts","export class App {\n\n private _events: Object;\n\n public start;\n public createElement;\n public render;\n\n constructor() {\n this._events = {};\n }\n\n on(name: string, fn: (...args) => void, options: any = {}) {\n if (options.debug) console.log('on: ' + name);\n this._events[name] = this._events[name] || [];\n this._events[name].push({ fn: fn, options: options });\n }\n\n run(name: string, ...args) {\n const subscribers = this._events[name];\n console.assert(!!subscribers, 'No subscriber for event: ' + name);\n if (subscribers) this._events[name] = subscribers.filter((sub) => {\n let { fn, options } = sub;\n if (options.delay) {\n this.delay(name, fn, args, options);\n } else {\n if (options.debug) console.log('run: ' + name, args);\n fn.apply(this, args);\n }\n return !sub.options.once;\n });\n }\n\n private delay(name, fn, args, options) {\n if (options._t) clearTimeout(options._t);\n options._t = setTimeout(() => {\n clearTimeout(options._t);\n if (options.debug) console.log(`run-delay ${options.delay}:` + name, args);\n fn.apply(this, args);\n }, options.delay);\n }\n}\n\nexport default new App();\n\n\n\n// WEBPACK FOOTER //\n// ./src/app.ts","export const Reflect = {\n\n meta: new WeakMap(),\n\n defineMetadata(metadataKey, metadataValue, target) {\n if (!this.meta.has(target)) this.meta.set(target, {});\n this.meta.get(target)[metadataKey] = metadataValue;\n },\n\n getMetadataKeys(target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? Object.keys(this.meta.get(target)) : [];\n },\n\n getMetadata(metadataKey, target) {\n target = Object.getPrototypeOf(target);\n return this.meta.get(target) ? this.meta.get(target)[metadataKey] : null;\n }\n}\n\nexport function update(name?: string, options: any = {}) {\n return (target: any, key: string, descriptor: any) => {\n name = `${key}${name ? ',' + name : ''}`;\n Reflect.defineMetadata(`apprun-update:${name}`,\n { name, action: [descriptor.value, options] }, target);\n return descriptor;\n }\n}\n\nexport function on(name?: string, options: any = {}) {\n return function (target: any, key: string) {\n name = `${key}${name ? ',' + name : ''}`; \n Reflect.defineMetadata(`apprun-update:${name}`, { name, key }, target)\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/decorator.ts","import createComponent from './createComponent';\n\nexport type VNode = {\n tag: string,\n props: {},\n children: Array<VNode | string>\n}\n\nexport type Element = any; //HTMLElement | SVGSVGElement | SVGElement;\n\nconst ATTR_PROPS = '_props';\n\nfunction collect(children) {\n const ch = [];\n const push = (c) => {\n if (c !== null && c !== undefined && c !== '') {\n ch.push((typeof c === 'function' || typeof c === 'object') ? c : `${c}`);\n }\n }\n children && children.forEach(c => {\n if (Array.isArray(c)) {\n c.forEach(i => push(i));\n } else {\n push(c);\n }\n });\n return ch;\n}\n\nexport function createElement (tag: string | Function, props: {}, ...children) {\n const ch = collect(children);\n if (typeof tag === 'string') return { tag, props, children: ch };\n else if (tag === undefined && children) return ch; // JSX fragments\n else if (Object.getPrototypeOf(tag).__isAppRunComponent) {\n const id = props && props['id'] || `_${tag.name}_${++idx}`;\n return createComponent(tag, id, props);\n }\n else\n return tag(props, ch);\n};\n\nlet idx = 0;\nconst keyCache = {};\n\nexport const updateElement = render;\n\nexport function render(element: Element, node: VNode) {\n // console.log('render', element, node);\n idx = 0;\n\n if (!node || !element) return;\n if (!element.firstChild) {\n element.appendChild(create(node));\n } else {\n update(element.firstChild, node);\n }\n}\n\nfunction same(el: Element, node: VNode) {\n // if (!el || !node) return false;\n const key1 = el.nodeName;\n const key2 = `${node.tag || ''}`;\n return key1 === key2.toUpperCase();\n}\n\nfunction update(element: Element, node: VNode) {\n console.assert(!!element);\n //console.log('update', element, node);\n\n if (!same(element, node)) {\n element.parentNode.replaceChild(create(node), element);\n return;\n }\n\n const len = Math.min(element.childNodes.length, node.children.length);\n for (let i = 0; i < len; i++) {\n const child = node.children[i];\n const el = element.childNodes[i];\n if (typeof child === 'string') {\n if (el.textContent !== child) {\n if (el.nodeType === 3) {\n el.textContent = child\n } else {\n element.replaceChild(createText(child), el);\n }\n }\n } else {\n const key = child.props && child.props['key'];\n if (key) {\n if (el.key === key) {\n update(element.childNodes[i], child);\n } else {\n const old = key && keyCache[key];\n if (old) {\n element.replaceChild(old, el);\n element.appendChild(el);\n update(element.childNodes[i], child);\n } else {\n element.appendChild(create(node), el);\n update(element.childNodes[i], child);\n }\n }\n } else {\n update(element.childNodes[i], child);\n }\n }\n }\n\n let n = element.childNodes.length;\n while (n > len) {\n element.removeChild(element.lastChild);\n n--;\n }\n\n if (node.children.length > len) {\n const d = document.createDocumentFragment();\n for (let i = len; i < node.children.length; i++) {\n d.appendChild(create(node.children[i]));\n }\n element.appendChild(d);\n }\n\n updateProps(element, node.props);\n\n}\n\nfunction createText(node) {\n if (node.indexOf('_html:') === 0) { // ?\n const div = document.createElement('div');\n div.insertAdjacentHTML('afterbegin', node.substring(6))\n return div;\n } else {\n return document.createTextNode(node);\n }\n}\n\nfunction create(node: VNode | string): Element {\n console.assert(node !== null && node !== undefined);\n // console.log('create', node, typeof node);\n\n if (typeof node === \"string\") return createText(node);\n if (!node.tag) return createText(JSON.stringify(node));\n\n const element = (node.tag === \"svg\")\n ? document.createElementNS(\"http://www.w3.org/2000/svg\", node.tag)\n : document.createElement(node.tag);\n\n updateProps(element, node.props);\n\n if (node.children) node.children.forEach(child => element.appendChild(create(child)));\n\n return element\n}\n\nfunction mergeProps(a: {}, b: {}): {} {\n const props = {};\n if (a) Object.keys(a).forEach(p => props[p] = '');\n if (b) Object.keys(b).forEach(p => props[p] = b[p]);\n return props;\n}\n\nfunction updateProps(element: Element, props: {}) {\n console.assert(!!element);\n // console.log('updateProps', element, props);\n\n const cached = element[ATTR_PROPS] || {};\n props = mergeProps(cached, props);\n element[ATTR_PROPS] = props;\n for (let name in props) {\n const value = props[name];\n if (cached[name] === value) continue;\n // console.log('updateProps', name, value);\n if (name === 'style') {\n if (element.style.cssText) element.style.cssText = '';\n for (let s in value) {\n if (element.style[s] !== value[s]) element.style[s] = value[s];\n }\n } else {\n if (element[name] !== value) element[name] = value;\n if (name === 'key' && value) keyCache[value] = element;\n }\n }\n}\n\nexport function Fragment(props, ...children) {\n return collect(children);\n}\n\n\n// WEBPACK FOOTER //\n// ./src/vdom-my.ts","import { createElement, updateElement } from './vdom-my';\nexport function render(element, html) {\n console.assert(!!element);\n updateElement(element, html);\n}\nexport { createElement };\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/vdom.ts","import app from './app';\n\nconst cache = {}\n\nexport default function (componentClass, id, props) {\n const component = cache[id] ? cache[id] :\n (cache[id] = new componentClass(props).mount(id))\n return <div id={id}>\n {component.render && component.render()}\n </div>\n}\n\n\n// WEBPACK FOOTER //\n// ./src/createComponent.tsx","\r\nimport app, { App } from './app';\r\nimport { Reflect } from './decorator'\r\nexport class Component {\r\n static __isAppRunComponent = true;\r\n private _app = new App();\r\n\r\n element;\r\n private _history = [];\r\n private _history_idx = -1;\r\n private enable_history;\r\n private global_event;\r\n protected rendered;\r\n\r\n private renderState(state) {\r\n if (!this.view) return;\r\n const html = this.view(state);\r\n const el = (typeof this.element === 'string') ?\r\n document.getElementById(this.element) : this.element;\r\n if (el) el['_component'] = this;\r\n if (el && app.render) {\r\n app.render(el, html);\r\n if (this.rendered) (this.rendered(this.state));\r\n }\r\n }\r\n\r\n public setState(state, options: {render:boolean, history:boolean, callback?}) {\r\n if (state instanceof Promise) {\r\n // Promise will not be saved nor rendered saved\r\n // state will be saved and rendered when promise is resolved\r\n state.then(s => {\r\n this.setState(s, options)\r\n }).catch(err => {\r\n console.error(err);\r\n throw err;\r\n })\r\n } else {\r\n if (state == null) return;\r\n this.state = state;\r\n if (options.render !== false) this.renderState(state);\r\n if (options.history !== false && this.enable_history) {\r\n this._history = [...this._history, state];\r\n this._history_idx = this._history.length - 1;\r\n }\r\n if (typeof options.callback === 'function') options.callback(this.state);\r\n }\r\n }\r\n\r\n constructor(\r\n protected state?,\r\n protected view?,\r\n protected update?,\r\n protected options?) {\r\n }\r\n\r\n public mount(element = null, options?: { render?: boolean, history?, global_event?: boolean}) {\r\n\r\n console.assert(!this.element, 'Component already mounted.')\r\n this.options = options = Object.assign(this.options || {}, options);\r\n this.element = element;\r\n this.global_event = options.global_event;\r\n this.enable_history = !!options.history;\r\n\r\n if (this.enable_history) {\r\n const prev = () => {\r\n this._history_idx --;\r\n if (this._history_idx >=0) {\r\n this.setState(this._history[this._history_idx], { render: true, history: false });\r\n }\r\n else {\r\n this._history_idx = 0;\r\n }\r\n };\r\n\r\n const next = () => {\r\n this._history_idx ++;\r\n if (this._history_idx < this._history.length) {\r\n this.setState(this._history[this._history_idx], { render: true, history: false });\r\n }\r\n else {\r\n this._history_idx = this._history.length - 1;\r\n }\r\n };\r\n this.on(options.history.prev || 'history-prev', prev)\r\n this.on(options.history.next || 'history-next', next)\r\n }\r\n this.add_actions();\r\n if (this.state === undefined) this.state = this['model'] || {};\r\n if (options.render) {\r\n this.setState(this.state, { render: true, history: true });\r\n } else {\r\n this.setState(this.state, { render: false, history: true });\r\n }\r\n return this;\r\n }\r\n\r\n is_global_event(name: string): boolean {\r\n return name && (name.startsWith('#') || name.startsWith('/'));\r\n }\r\n\r\n add_action(name, action, options: any = {}) {\r\n if (!action || typeof action !== 'function') return;\r\n this.on(name, (...p) => {\r\n const newState = action(this.state, ...p);\r\n this.setState(newState, options)\r\n }, options);\r\n }\r\n\r\n add_actions() {\r\n const actions = this.update || {};\r\n Reflect.getMetadataKeys(this).forEach(key => {\r\n if (key.startsWith('apprun-update:')) {\r\n const meta = Reflect.getMetadata(key, this)\r\n actions[meta.name] = meta.action || this[meta.key]\r\n }\r\n })\r\n const all = {};\r\n Object.keys(actions).forEach(name => {\r\n const action = actions[name];\r\n if (typeof action === 'function' || Array.isArray(action)) {\r\n name.split(',').forEach(n => all[n.trim()] = action)\r\n }\r\n })\r\n\r\n Object.keys(all).forEach(name => {\r\n const action = all[name];\r\n if (typeof action === 'function') {\r\n this.add_action(name, action);\r\n } else if (Array.isArray(action)) {\r\n this.add_action(name, action[0], action[1]);\r\n }\r\n });\r\n }\r\n\r\n start = (element = null,\r\n options: { render?: boolean, history?, global_event?: boolean }= { render: true }): Component => {\r\n return this.mount(element, { ...options, render: true });\r\n }\r\n\r\n render = () => this.view(this.state);\r\n\r\n public run(name: string, ...args) {\r\n return this.global_event || this.is_global_event(name) ?\r\n app.run(name, ...args) :\r\n this._app.run(name, ...args);\r\n }\r\n\r\n public on(name: string, fn: (...args) => void, options?: any) {\r\n return this.global_event || this.is_global_event(name) ?\r\n app.on(name, fn, options) :\r\n this._app.on(name, fn, options);\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/component.ts","import app from './app';\n\nconst ROUTER_EVENT = '//';\n\nexport default class Router {\n\n route(url: string) {\n if (!url) url = '#';\n if (url.indexOf('/') > 0) {\n const [name, ...rest] = url.split('/');\n app.run(name, ...rest);\n app.run(ROUTER_EVENT, name, ...rest);\n } else {\n app.run(url);\n app.run(ROUTER_EVENT, url);\n }\n }\n\n constructor() {\n app.on('route', hash => this.route(hash));\n window.onpopstate = e => this.route(location.hash);\n this.route(location.hash);\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./src/router.ts"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///dist/apprun.js","webpack:///webpack/bootstrap 34faa1100aa1f0068c04","webpack:///./src/apprun.ts","webpack:///./src/app.ts","webpack:///./src/decorator.ts","webpack:///./src/vdom-my.ts","webpack:///./src/vdom.ts","webpack:///./src/createComponent.tsx","webpack:///./src/component.ts","webpack:///./src/router.ts"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","app_1","vdom_1","component_1","Component","router_1","decorator_1","on","update","default","createElement","render","start","element","model","view","options","opts","assign","global_event","component","mount","_app","window","document","addEventListener","App","_events","fn","debug","console","log","push","run","_this","args","_i","arguments","length","subscribers","assert","filter","sub","delay","apply","once","_t","clearTimeout","setTimeout","target","key","descriptor","Reflect","defineMetadata","action","meta","WeakMap","metadataKey","metadataValue","has","set","getMetadataKeys","getPrototypeOf","keys","getMetadata","collect","children","ch","undefined","forEach","Array","isArray","tag","props","__isAppRunComponent","id","idx","createComponent_1","node","firstChild","appendChild","create","same","el","nodeName","toUpperCase","parentNode","replaceChild","len","Math","min","childNodes","child","textContent","nodeType","createText","old","keyCache","removeChild","lastChild","createDocumentFragment","updateProps","indexOf","div","insertAdjacentHTML","substring","createTextNode","JSON","stringify","createElementNS","mergeProps","a","b","cached","ATTR_PROPS","name_1","style","cssText","Fragment","updateElement","html","vdom_my_1","default_1","componentClass","cache","__assign","t","state","_history","_history_idx","renderState","getElementById","rendered","setState","Promise","then","catch","err","error","history","enable_history","concat","callback","prev","next","add_actions","is_global_event","startsWith","add_action","newState","actions","all","split","trim","_a","Router","hash","route","onpopstate","e","location","url","rest","slice"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,OAAAD,IAEAD,EAAA,OAAAC,KACC,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QA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ZW,KAYOgI,IAS5BN,ITgnBA3L,GAAQyC,QAAUkJ","file":"dist/apprun.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"apprun\"] = factory();\n\telse\n\t\troot[\"apprun\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar app_1 = __webpack_require__(1);\nvar vdom_1 = __webpack_require__(4);\nvar component_1 = __webpack_require__(6);\nexports.Component = component_1.Component;\nvar router_1 = __webpack_require__(7);\nvar decorator_1 = __webpack_require__(2);\nexports.on = decorator_1.on;\nexports.update = decorator_1.update;\napp_1.default.createElement = vdom_1.createElement;\napp_1.default.render = vdom_1.render;\napp_1.default.start = function (element, model, view, update, options) {\n var opts = Object.assign(options || {}, { render: true, global_event: true });\n var component = new component_1.Component(model, view, update);\n component.mount(element, opts);\n return component;\n};\nvar _app = app_1.default;\nif (typeof window === 'object') {\n if (window['app'] && window['app']['start']) {\n _app = window['app'];\n }\n else {\n window['app'] = _app;\n document.addEventListener(\"DOMContentLoaded\", function () { return new router_1.default(); });\n }\n}\nexports.default = _app;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar App = /** @class */ (function () {\n function App() {\n this._events = {};\n }\n App.prototype.on = function (name, fn, options) {\n if
{'addition_count': 1, 'commit_subject': 'update changelog and compile', 'deletion_count': 1, 'file_extension': '.map', 'lang': 'js', 'license': 'mit', 'repo_name': 'yysun/apprun'}