From 2698e3b1ae7e6584af8c39de9cc40de032dd44b1 Mon Sep 17 00:00:00 2001 From: dntzhang Date: Tue, 27 Nov 2018 09:24:42 +0800 Subject: [PATCH] build --- packages/omi/config/properties.json | 5 +++-- packages/omi/dist/omi.dev.js | 18 +++++++++++------- packages/omi/dist/omi.dev.js.map | 2 +- packages/omi/dist/omi.esm.js | 18 +++++++++++------- packages/omi/dist/omi.esm.js.map | 2 +- packages/omi/dist/omi.js | 13 ++++++++----- packages/omi/dist/omi.js.map | 2 +- packages/omi/dist/omi.min.js | 2 +- packages/omi/dist/omi.min.js.map | 2 +- 9 files changed, 38 insertions(+), 26 deletions(-) diff --git a/packages/omi/config/properties.json b/packages/omi/config/properties.json index c7f7de64e..de3f69400 100644 --- a/packages/omi/config/properties.json +++ b/packages/omi/config/properties.json @@ -1,6 +1,6 @@ { "props": { - "cname": 35, + "cname": 36, "props": { "$_dirty": "__d", "$_disable": "__x", @@ -34,7 +34,8 @@ "$___touchY": "G", "$___scrollTop": "H", "$__elementId": "I", - "$_willUpdate": "J" + "$_willUpdate": "J", + "$_preCss": "K" } }, "vars": { diff --git a/packages/omi/dist/omi.dev.js b/packages/omi/dist/omi.dev.js index e82d3bf05..c54dff05b 100644 --- a/packages/omi/dist/omi.dev.js +++ b/packages/omi/dist/omi.dev.js @@ -1,5 +1,5 @@ /** - * omi v5.0.2 http://omijs.org + * omi v5.0.3 http://omijs.org * Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -713,17 +713,17 @@ will emit {op: replace, path: '/arr/1', value: arr_2} {op: remove, path: '/arr/2'} - by default, the second operation would revoke the proxy, and this renders arr revoked. + by default, the second operation would revoke the proxy, and this renders arr revoked. That's why we need to remember the proxies that are inherited. */ var revokableInstance = instance.proxifiedObjectsMap.get(newValue); /* Why do we need to check instance.isProxifyingTreeNow? - We need to make sure we mark revokables as inherited ONLY when we're observing, + We need to make sure we mark revokables as inherited ONLY when we're observing, because throughout the first proxification, a sub-object is proxified and then assigned to its parent object. This assignment of a pre-proxified object can fool us into thinking that it's a proxified object moved around, while in fact it's the first assignment ever. - Checking isProxifyingTreeNow ensures this is not happening in the first proxification, + Checking isProxifyingTreeNow ensures this is not happening in the first proxification, but in fact is is a proxified object moved around the tree */ if (revokableInstance && !instance.isProxifyingTreeNow) { @@ -801,7 +801,7 @@ this is an inherited proxy (an already proxified object that was moved around), we shouldn't revoke it, because even though it was removed from path1, it is still used in path2. And we know that because we mark moved proxies with `inherited` flag when we move them - it is a good idea to remove this flag if we come across it here, in deleteProperty trap. + it is a good idea to remove this flag if we come across it here, in deleteProperty trap. We DO want to revoke the proxy if it was removed again. */ revokableProxyInstance.inherited = false; @@ -1328,7 +1328,7 @@ args[key] = arguments[key]; } - return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _WeElement.call.apply(_WeElement, [this].concat(args))), _this), _this._useId = 0, _this._useMap = {}, _temp), _possibleConstructorReturn$1(_this, _ret); + return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _WeElement.call.apply(_WeElement, [this].concat(args))), _this), _this._useId = 0, _this._useMap = {}, _this._preCss = null, _temp), _possibleConstructorReturn$1(_this, _ret); } Element.prototype.render = function render(props, data) { @@ -1340,6 +1340,10 @@ }; Element.prototype.useCss = function useCss(css) { + if (css === this._preCss) { + return; + } + this._preCss = css; var style = this.shadowRoot.querySelector('style'); style && this.shadowRoot.removeChild(style); this.shadowRoot.appendChild(cssToDom(css)); @@ -1509,7 +1513,7 @@ }; options.root.Omi = omi; - options.root.Omi.version = '5.0.2'; + options.root.Omi.version = '5.0.3'; if (typeof module != 'undefined') module.exports = omi;else self.Omi = omi; }()); diff --git a/packages/omi/dist/omi.dev.js.map b/packages/omi/dist/omi.dev.js.map index c97980f44..836a76fc8 100644 --- a/packages/omi/dist/omi.dev.js.map +++ b/packages/omi/dist/omi.dev.js.map @@ -1 +1 @@ -{"version":3,"file":"omi.dev.js","sources":["../src/vnode.js","../src/options.js","../src/h.js","../src/util.js","../src/constants.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/model-view.js","../src/omi.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n if (\r\n typeof global !== 'object' ||\r\n !global ||\r\n global.Math !== Math ||\r\n global.Array !== Array\r\n ) {\r\n return (\r\n self ||\r\n window ||\r\n global ||\r\n (function() {\r\n return this\r\n })()\r\n )\r\n }\r\n return global\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n store: null,\r\n root: getGlobal()\r\n}\r\n","import { VNode } from './vnode'\r\nimport options from './options'\r\n\r\nconst stack = []\r\nconst EMPTY_CHILDREN = []\r\n\r\nexport function h(nodeName, attributes) {\r\n let children = EMPTY_CHILDREN,\r\n lastSimple,\r\n child,\r\n simple,\r\n i\r\n for (i = arguments.length; i-- > 2; ) {\r\n stack.push(arguments[i])\r\n }\r\n if (attributes && attributes.children != null) {\r\n if (!stack.length) stack.push(attributes.children)\r\n delete attributes.children\r\n }\r\n while (stack.length) {\r\n if ((child = stack.pop()) && child.pop !== undefined) {\r\n for (i = child.length; i--; ) stack.push(child[i])\r\n } else {\r\n if (typeof child === 'boolean') child = null\r\n\r\n if ((simple = typeof nodeName !== 'function')) {\r\n if (child == null) child = ''\r\n else if (typeof child === 'number') child = String(child)\r\n else if (typeof child !== 'string') simple = false\r\n }\r\n\r\n if (simple && lastSimple) {\r\n children[children.length - 1] += child\r\n } else if (children === EMPTY_CHILDREN) {\r\n children = [child]\r\n } else {\r\n children.push(child)\r\n }\r\n\r\n lastSimple = simple\r\n }\r\n }\r\n\r\n let p = new VNode()\r\n p.nodeName = nodeName\r\n p.children = children\r\n p.attributes = attributes == null ? undefined : attributes\r\n p.key = attributes == null ? undefined : attributes.key\r\n\r\n // if a \"vnode hook\" is defined, pass every created VNode to it\r\n if (options.vnode !== undefined) options.vnode(p)\r\n\r\n return p\r\n}\r\n","/**\r\n * @license\r\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n/**\r\n * This shim allows elements written in, or compiled to, ES5 to work on native\r\n * implementations of Custom Elements v1. It sets new.target to the value of\r\n * this.constructor so that the native HTMLElement constructor can access the\r\n * current under-construction element's definition.\r\n */\r\n;(function() {\r\n if (\r\n // No Reflect, no classes, no need for shim because native custom elements\r\n // require ES2015 classes or Reflect.\r\n window.Reflect === undefined ||\r\n window.customElements === undefined ||\r\n // The webcomponentsjs custom elements polyfill doesn't require\r\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\r\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\r\n ) {\r\n return\r\n }\r\n const BuiltInHTMLElement = HTMLElement\r\n window.HTMLElement = function HTMLElement() {\r\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n }\r\n HTMLElement.prototype = BuiltInHTMLElement.prototype\r\n HTMLElement.prototype.constructor = HTMLElement\r\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\nexport function cssToDom(css) {\r\n const node = document.createElement('style')\r\n node.textContent = css\r\n return node\r\n}\r\n\r\nexport function npn(str) {\r\n return str.replace(/-(\\w)/g, ($, $1) => {\r\n return $1.toUpperCase()\r\n })\r\n}\r\n\r\nexport function extend(obj, props) {\r\n for (let i in props) obj[i] = props[i]\r\n return obj\r\n}\r\n\r\n/** Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} [ref=null]\r\n * @param {any} [value]\r\n */\r\nexport function applyRef(ref, value) {\r\n if (ref != null) {\r\n if (typeof ref == 'function') ref(value)\r\n else ref.current = value\r\n }\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n * @type {(callback: function) => void}\r\n */\r\nexport const defer =\r\n typeof Promise == 'function'\r\n ? Promise.resolve().then.bind(Promise.resolve())\r\n : setTimeout\r\n\r\nexport function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props) {\r\n if (!props || isArray(props)) return {}\r\n const result = {}\r\n Object.keys(props).forEach(key => {\r\n result[key] = props[key].value\r\n })\r\n return result\r\n}\r\n","// render modes\r\n\r\nexport const NO_RENDER = 0\r\nexport const SYNC_RENDER = 1\r\nexport const FORCE_RENDER = 2\r\nexport const ASYNC_RENDER = 3\r\n\r\nexport const ATTR_KEY = '__omiattr_'\r\n\r\n// DOM properties that should NOT have \"px\" added when numeric\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\r\n","import { extend } from '../util'\r\n\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n return node.splitText !== undefined\r\n }\r\n if (typeof vnode.nodeName === 'string') {\r\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n }\r\n return hydrating || node._componentConstructor === vnode.nodeName\r\n}\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n return (\r\n node.normalizedNodeName === nodeName ||\r\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\r\n )\r\n}\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n let props = extend({}, vnode.attributes)\r\n props.children = vnode.children\r\n\r\n let defaultProps = vnode.nodeName.defaultProps\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i]\r\n }\r\n }\r\n }\r\n\r\n return props\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants'\r\nimport { applyRef } from '../util'\r\nimport options from '../options'\r\n\r\n/**\r\n * Create an element with the given nodeName.\r\n * @param {string} nodeName The DOM node to create\r\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\r\n * namespace.\r\n * @returns {Element} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n /** @type {Element} */\r\n let node = isSvg\r\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\r\n : document.createElement(nodeName)\r\n node.normalizedNodeName = nodeName\r\n return node\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n let parentNode = node.parentNode\r\n if (parentNode) parentNode.removeChild(node)\r\n}\r\n\r\n/**\r\n * Set a named attribute on the given Node, with special behavior for some names\r\n * and event handlers. If `value` is `null`, the attribute/handler will be\r\n * removed.\r\n * @param {Element} node An element to mutate\r\n * @param {string} name The name/key to set, such as an event or attribute name\r\n * @param {*} old The last value that was set for this name/node pair\r\n * @param {*} value An attribute value, such as a function to be used as an\r\n * event handler\r\n * @param {boolean} isSvg Are we currently diffing inside an svg?\r\n * @private\r\n */\r\nexport function setAccessor(node, name, old, value, isSvg) {\r\n if (name === 'className') name = 'class'\r\n\r\n if (name === 'key') {\r\n // ignore\r\n } else if (name === 'ref') {\r\n applyRef(old, null)\r\n applyRef(value, node)\r\n } else if (name === 'class' && !isSvg) {\r\n node.className = value || ''\r\n } else if (name === 'style') {\r\n if (!value || typeof value === 'string' || typeof old === 'string') {\r\n node.style.cssText = value || ''\r\n }\r\n if (value && typeof value === 'object') {\r\n if (typeof old !== 'string') {\r\n for (let i in old) if (!(i in value)) node.style[i] = ''\r\n }\r\n for (let i in value) {\r\n node.style[i] =\r\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\r\n ? value[i] + 'px'\r\n : value[i]\r\n }\r\n }\r\n } else if (name === 'dangerouslySetInnerHTML') {\r\n if (value) node.innerHTML = value.__html || ''\r\n } else if (name[0] == 'o' && name[1] == 'n') {\r\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\r\n name = name.toLowerCase().substring(2)\r\n if (value) {\r\n if (!old) {\r\n node.addEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.addEventListener('touchstart', touchStart, useCapture)\r\n node.addEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n } else {\r\n node.removeEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.removeEventListener('touchstart', touchStart, useCapture)\r\n node.removeEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n ;(node._listeners || (node._listeners = {}))[name] = value\r\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\r\n // Attempt to set a DOM property to the given value.\r\n // IE & FF throw for certain property-value combinations.\r\n try {\r\n node[name] = value == null ? '' : value\r\n } catch (e) {}\r\n if ((value == null || value === false) && name != 'spellcheck')\r\n node.removeAttribute(name)\r\n } else {\r\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\r\n // spellcheck is treated differently than all other boolean values and\r\n // should not be removed when the value is `false`. See:\r\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n if (value == null || value === false) {\r\n if (ns)\r\n node.removeAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase()\r\n )\r\n else node.removeAttribute(name)\r\n } else if (typeof value === 'string') {\r\n if (ns) {\r\n node.setAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase(),\r\n value\r\n )\r\n } else {\r\n node.setAttribute(name, value)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n return this._listeners[e.type]((options.event && options.event(e)) || e)\r\n}\r\n\r\nfunction touchStart(e) {\r\n this.___touchX = e.touches[0].pageX\r\n this.___touchY = e.touches[0].pageY\r\n this.___scrollTop = document.body.scrollTop\r\n}\r\n\r\nfunction touchEnd(e) {\r\n if (\r\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\r\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\r\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\r\n ) {\r\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\r\n }\r\n}\r\n","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn, isArray } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n let ret\r\n if (!diffLevel++) {\r\n // when first starting the diff, check if we're diffing an SVG or within an SVG\r\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\r\n\r\n // hydration is indicated by the existing element to be diffed not having a prop cache\r\n hydrating = dom != null && !(ATTR_KEY in dom)\r\n }\r\n if (isArray(vnode)) {\r\n ret = []\r\n let parentNode = null\r\n if (isArray(dom)) {\r\n let domLength = dom.length\r\n let vnodeLength = vnode.length\r\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\r\n parentNode = dom[0].parentNode\r\n for (let i = 0; i < maxLength; i++) {\r\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\r\n ret.push(ele)\r\n if (i > domLength - 1) {\r\n parentNode.appendChild(ele)\r\n }\r\n }\r\n } else {\r\n vnode.forEach(function(item) {\r\n let ele = idiff(dom, item, context, mountAll, componentRoot)\r\n ret.push(ele)\r\n parent && parent.appendChild(ele)\r\n })\r\n }\r\n } else {\r\n if (isArray(dom)) {\r\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\r\n } else {\r\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n }\r\n // append the element if its a new parent\r\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\r\n }\r\n\r\n // diffLevel being reduced to 0 means we're exiting the diff\r\n if (!--diffLevel) {\r\n hydrating = false\r\n // invoke queued componentDidMount lifecycle methods\r\n }\r\n\r\n return ret\r\n}\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n if (dom && vnode && dom.props) {\r\n dom.props.children = vnode.children\r\n }\r\n let out = dom,\r\n prevSvgMode = isSvgMode\r\n\r\n // empty values (null, undefined, booleans) render as empty Text nodes\r\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\r\n\r\n // Fast case: Strings & Numbers create/update Text nodes.\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n // update if it's already a Text node:\r\n if (\r\n dom &&\r\n dom.splitText !== undefined &&\r\n dom.parentNode &&\r\n (!dom._component || componentRoot)\r\n ) {\r\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n if (dom.nodeValue != vnode) {\r\n dom.nodeValue = vnode\r\n }\r\n } else {\r\n // it wasn't a Text node: replace it with one and recycle the old Element\r\n out = document.createTextNode(vnode)\r\n if (dom) {\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n out[ATTR_KEY] = true\r\n\r\n return out\r\n }\r\n\r\n // If the VNode represents a Component, perform a component diff:\r\n let vnodeName = vnode.nodeName\r\n\r\n // Tracks entering and exiting SVG namespace when descending through the tree.\r\n isSvgMode =\r\n vnodeName === 'svg'\r\n ? true\r\n : vnodeName === 'foreignObject'\r\n ? false\r\n : isSvgMode\r\n\r\n // If there's no existing element or it's the wrong type, create a new one:\r\n vnodeName = String(vnodeName)\r\n if (!dom || !isNamedNode(dom, vnodeName)) {\r\n out = createNode(vnodeName, isSvgMode)\r\n\r\n if (dom) {\r\n // move children into the replacement node\r\n while (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n // if the previous Element was mounted into the DOM, replace it inline\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n // recycle the old element (skips non-Element node types)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n let fc = out.firstChild,\r\n props = out[ATTR_KEY],\r\n vchildren = vnode.children\r\n\r\n if (props == null) {\r\n props = out[ATTR_KEY] = {}\r\n for (let a = out.attributes, i = a.length; i--; )\r\n props[a[i].name] = a[i].value\r\n }\r\n\r\n // Optimization: fast-path for elements containing a single TextNode:\r\n if (\r\n !hydrating &&\r\n vchildren &&\r\n vchildren.length === 1 &&\r\n typeof vchildren[0] === 'string' &&\r\n fc != null &&\r\n fc.splitText !== undefined &&\r\n fc.nextSibling == null\r\n ) {\r\n if (fc.nodeValue != vchildren[0]) {\r\n fc.nodeValue = vchildren[0]\r\n }\r\n }\r\n // otherwise, if there are existing or new children, diff them:\r\n else if ((vchildren && vchildren.length) || fc != null) {\r\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\r\n innerDiffNode(\r\n out,\r\n vchildren,\r\n context,\r\n mountAll,\r\n hydrating || props.dangerouslySetInnerHTML != null\r\n )\r\n }\r\n }\r\n\r\n // Apply attributes/props from VNode to the DOM Element:\r\n diffAttributes(out, vnode.attributes, props, vnode.children)\r\n if (out.props) {\r\n out.props.children = vnode.children\r\n }\r\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n isSvgMode = prevSvgMode\r\n\r\n return out\r\n}\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n let originalChildren = dom.childNodes,\r\n children = [],\r\n keyed = {},\r\n keyedLen = 0,\r\n min = 0,\r\n len = originalChildren.length,\r\n childrenLen = 0,\r\n vlen = vchildren ? vchildren.length : 0,\r\n j,\r\n c,\r\n f,\r\n vchild,\r\n child\r\n\r\n // Build up a map of keyed children and an Array of unkeyed children:\r\n if (len !== 0) {\r\n for (let i = 0; i < len; i++) {\r\n let child = originalChildren[i],\r\n props = child[ATTR_KEY],\r\n key =\r\n vlen && props\r\n ? child._component\r\n ? child._component.__key\r\n : props.key\r\n : null\r\n if (key != null) {\r\n keyedLen++\r\n keyed[key] = child\r\n } else if (\r\n props ||\r\n (child.splitText !== undefined\r\n ? isHydrating\r\n ? child.nodeValue.trim()\r\n : true\r\n : isHydrating)\r\n ) {\r\n children[childrenLen++] = child\r\n }\r\n }\r\n }\r\n\r\n if (vlen !== 0) {\r\n for (let i = 0; i < vlen; i++) {\r\n vchild = vchildren[i]\r\n child = null\r\n\r\n // attempt to find a node based on key matching\r\n let key = vchild.key\r\n if (key != null) {\r\n if (keyedLen && keyed[key] !== undefined) {\r\n child = keyed[key]\r\n keyed[key] = undefined\r\n keyedLen--\r\n }\r\n }\r\n // attempt to pluck a node of the same type from the existing children\r\n else if (!child && min < childrenLen) {\r\n for (j = min; j < childrenLen; j++) {\r\n if (\r\n children[j] !== undefined &&\r\n isSameNodeType((c = children[j]), vchild, isHydrating)\r\n ) {\r\n child = c\r\n children[j] = undefined\r\n if (j === childrenLen - 1) childrenLen--\r\n if (j === min) min++\r\n break\r\n }\r\n }\r\n }\r\n\r\n // morph the matched/found/created DOM child to match vchild (deep)\r\n child = idiff(child, vchild, context, mountAll)\r\n\r\n f = originalChildren[i]\r\n if (child && child !== dom && child !== f) {\r\n if (f == null) {\r\n dom.appendChild(child)\r\n } else if (child === f.nextSibling) {\r\n removeNode(f)\r\n } else {\r\n dom.insertBefore(child, f)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // remove unused keyed children:\r\n if (keyedLen) {\r\n for (let i in keyed)\r\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\r\n }\r\n\r\n // remove orphaned unkeyed children:\r\n while (min <= childrenLen) {\r\n if ((child = children[childrenLen--]) !== undefined)\r\n recollectNodeTree(child, false)\r\n }\r\n}\r\n\r\n/** Recursively recycle (or just unmount) a node and its descendants.\r\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\r\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\r\n */\r\nexport function recollectNodeTree(node, unmountOnly) {\r\n // If the node's VNode had a ref function, invoke it with null here.\r\n // (this is part of the React spec, and smart for unsetting references)\r\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\r\n\r\n if (unmountOnly === false || node[ATTR_KEY] == null) {\r\n removeNode(node)\r\n }\r\n\r\n removeChildren(node)\r\n}\r\n\r\n/** Recollect/unmount all children.\r\n *\t- we use .lastChild here because it causes less reflow than .firstChild\r\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\r\n */\r\nexport function removeChildren(node) {\r\n node = node.lastChild\r\n while (node) {\r\n let next = node.previousSibling\r\n recollectNodeTree(node, true)\r\n node = next\r\n }\r\n}\r\n\r\n/** Apply differences in attributes from a VNode to the given DOM Element.\r\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\r\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\r\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\r\n */\r\nfunction diffAttributes(dom, attrs, old, children) {\r\n let name\r\n let update = false\r\n let isWeElement = dom.update\r\n // remove attributes no longer present on the vnode by setting them to undefined\r\n for (name in old) {\r\n if (!(attrs && attrs[name] != null) && old[name] != null) {\r\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\r\n if (isWeElement) {\r\n delete dom.props[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n // add new & update changed attributes\r\n for (name in attrs) {\r\n //diable when using store system?\r\n //!dom.store &&\r\n if (isWeElement && typeof attrs[name] === 'object') {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n } else if (\r\n name !== 'children' &&\r\n name !== 'innerHTML' &&\r\n (!(name in old) ||\r\n attrs[name] !==\r\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\r\n ) {\r\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\r\n if (isWeElement) {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n if (isWeElement && dom.parentNode) {\r\n if (update || children.length > 0) {\r\n dom.receiveProps(dom.props, dom.data)\r\n dom.update()\r\n }\r\n }\r\n}\r\n","/*!\r\n * https://github.com/Palindrom/JSONPatcherProxy\r\n * (c) 2017 Starcounter\r\n * MIT license\r\n */\r\n\r\n/** Class representing a JS Object observer */\r\nconst JSONPatcherProxy = (function() {\r\n /**\r\n * Deep clones your object and returns a new object.\r\n */\r\n function deepClone(obj) {\r\n switch (typeof obj) {\r\n case 'object':\r\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\r\n case 'undefined':\r\n return null //this is how JSON.stringify behaves for array items\r\n default:\r\n return obj //no need to clone primitives\r\n }\r\n }\r\n JSONPatcherProxy.deepClone = deepClone\r\n\r\n function escapePathComponent(str) {\r\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\r\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\r\n }\r\n JSONPatcherProxy.escapePathComponent = escapePathComponent\r\n\r\n /**\r\n * Walk up the parenthood tree to get the path\r\n * @param {JSONPatcherProxy} instance\r\n * @param {Object} obj the object you need to find its path\r\n */\r\n function findObjectPath(instance, obj) {\r\n const pathComponents = []\r\n let parentAndPath = instance.parenthoodMap.get(obj)\r\n while (parentAndPath && parentAndPath.path) {\r\n // because we're walking up-tree, we need to use the array as a stack\r\n pathComponents.unshift(parentAndPath.path)\r\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\r\n }\r\n if (pathComponents.length) {\r\n const path = pathComponents.join('/')\r\n return '/' + path\r\n }\r\n return ''\r\n }\r\n /**\r\n * A callback to be used as th proxy set trap callback.\r\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the affected object\r\n * @param {String} key the effect property's name\r\n * @param {Any} newValue the value being set\r\n */\r\n function setTrap(instance, target, key, newValue) {\r\n const parentPath = findObjectPath(instance, target)\r\n\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n if (instance.proxifiedObjectsMap.has(newValue)) {\r\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\r\n\r\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\r\n parent: target,\r\n path: key\r\n })\r\n }\r\n /*\r\n mark already proxified values as inherited.\r\n rationale: proxy.arr.shift()\r\n will emit\r\n {op: replace, path: '/arr/1', value: arr_2}\r\n {op: remove, path: '/arr/2'}\r\n\r\n by default, the second operation would revoke the proxy, and this renders arr revoked.\r\n That's why we need to remember the proxies that are inherited.\r\n */\r\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\r\n /*\r\n Why do we need to check instance.isProxifyingTreeNow?\r\n\r\n We need to make sure we mark revokables as inherited ONLY when we're observing,\r\n because throughout the first proxification, a sub-object is proxified and then assigned to\r\n its parent object. This assignment of a pre-proxified object can fool us into thinking\r\n that it's a proxified object moved around, while in fact it's the first assignment ever.\r\n\r\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\r\n but in fact is is a proxified object moved around the tree\r\n */\r\n if (revokableInstance && !instance.isProxifyingTreeNow) {\r\n revokableInstance.inherited = true\r\n }\r\n\r\n // if the new value is an object, make sure to watch it\r\n if (\r\n newValue &&\r\n typeof newValue == 'object' &&\r\n !instance.proxifiedObjectsMap.has(newValue)\r\n ) {\r\n instance.parenthoodMap.set(newValue, {\r\n parent: target,\r\n path: key\r\n })\r\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\r\n }\r\n // let's start with this operation, and may or may not update it later\r\n const operation = {\r\n op: 'remove',\r\n path: destinationPropKey\r\n }\r\n if (typeof newValue == 'undefined') {\r\n // applying De Morgan's laws would be a tad faster, but less readable\r\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\r\n // `undefined` is being set to an already undefined value, keep silent\r\n return Reflect.set(target, key, newValue)\r\n }\r\n // when array element is set to `undefined`, should generate replace to `null`\r\n if (Array.isArray(target)) {\r\n // undefined array elements are JSON.stringified to `null`\r\n ;(operation.op = 'replace'), (operation.value = null)\r\n }\r\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\r\n // was the deleted a proxified object?\r\n if (oldValue) {\r\n instance.parenthoodMap.delete(target[key])\r\n instance.disableTrapsForProxy(oldValue)\r\n instance.proxifiedObjectsMap.delete(oldValue)\r\n }\r\n } else {\r\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\r\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\r\n if (key != 'length') {\r\n console.warn(\r\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\r\n )\r\n }\r\n return Reflect.set(target, key, newValue)\r\n }\r\n operation.op = 'add'\r\n if (target.hasOwnProperty(key)) {\r\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\r\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\r\n }\r\n }\r\n operation.value = newValue\r\n }\r\n operation.oldValue = target[key]\r\n const reflectionResult = Reflect.set(target, key, newValue)\r\n instance.defaultCallback(operation)\r\n return reflectionResult\r\n }\r\n /**\r\n * A callback to be used as th proxy delete trap callback.\r\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the effected object\r\n * @param {String} key the effected property's name\r\n */\r\n function deleteTrap(instance, target, key) {\r\n if (typeof target[key] !== 'undefined') {\r\n const parentPath = findObjectPath(instance, target)\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\r\n target[key]\r\n )\r\n\r\n if (revokableProxyInstance) {\r\n if (revokableProxyInstance.inherited) {\r\n /*\r\n this is an inherited proxy (an already proxified object that was moved around),\r\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\r\n And we know that because we mark moved proxies with `inherited` flag when we move them\r\n\r\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\r\n We DO want to revoke the proxy if it was removed again.\r\n */\r\n revokableProxyInstance.inherited = false\r\n } else {\r\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\r\n instance.disableTrapsForProxy(revokableProxyInstance)\r\n instance.proxifiedObjectsMap.delete(target[key])\r\n }\r\n }\r\n const reflectionResult = Reflect.deleteProperty(target, key)\r\n\r\n instance.defaultCallback({\r\n op: 'remove',\r\n path: destinationPropKey\r\n })\r\n\r\n return reflectionResult\r\n }\r\n }\r\n /* pre-define resume and pause functions to enhance constructors performance */\r\n function resume() {\r\n this.defaultCallback = operation => {\r\n this.isRecording && this.patches.push(operation)\r\n this.userCallback && this.userCallback(operation)\r\n }\r\n this.isObserving = true\r\n }\r\n function pause() {\r\n this.defaultCallback = () => {}\r\n this.isObserving = false\r\n }\r\n /**\r\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\r\n * @param {Object|Array} root - the object you want to wrap\r\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\r\n * @returns {JSONPatcherProxy}\r\n * @constructor\r\n */\r\n function JSONPatcherProxy(root, showDetachedWarning) {\r\n this.isProxifyingTreeNow = false\r\n this.isObserving = false\r\n this.proxifiedObjectsMap = new Map()\r\n this.parenthoodMap = new Map()\r\n // default to true\r\n if (typeof showDetachedWarning !== 'boolean') {\r\n showDetachedWarning = true\r\n }\r\n\r\n this.showDetachedWarning = showDetachedWarning\r\n this.originalObject = root\r\n this.cachedProxy = null\r\n this.isRecording = false\r\n this.userCallback\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Restores callback back to the original one provided to `observe`.\r\n */\r\n this.resume = resume.bind(this)\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Replaces your callback with a noop function.\r\n */\r\n this.pause = pause.bind(this)\r\n }\r\n\r\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\r\n if (!obj) {\r\n return obj\r\n }\r\n const traps = {\r\n set: (target, key, value, receiver) =>\r\n setTrap(this, target, key, value, receiver),\r\n deleteProperty: (target, key) => deleteTrap(this, target, key)\r\n }\r\n const revocableInstance = Proxy.revocable(obj, traps)\r\n // cache traps object to disable them later.\r\n revocableInstance.trapsInstance = traps\r\n revocableInstance.originalObject = obj\r\n\r\n /* keeping track of object's parent and path */\r\n\r\n this.parenthoodMap.set(obj, { parent, path })\r\n\r\n /* keeping track of all the proxies to be able to revoke them later */\r\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\r\n return revocableInstance.proxy\r\n }\r\n // grab tree's leaves one by one, encapsulate them into a proxy and return\r\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\r\n parent,\r\n root,\r\n path\r\n ) {\r\n for (let key in root) {\r\n if (root.hasOwnProperty(key)) {\r\n if (root[key] instanceof Object) {\r\n root[key] = this._proxifyObjectTreeRecursively(\r\n root,\r\n root[key],\r\n escapePathComponent(key)\r\n )\r\n }\r\n }\r\n }\r\n return this.generateProxyAtPath(parent, root, path)\r\n }\r\n // this function is for aesthetic purposes\r\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\r\n /*\r\n while proxyifying object tree,\r\n the proxyifying operation itself is being\r\n recorded, which in an unwanted behavior,\r\n that's why we disable recording through this\r\n initial process;\r\n */\r\n this.pause()\r\n this.isProxifyingTreeNow = true\r\n const proxifiedObject = this._proxifyObjectTreeRecursively(\r\n undefined,\r\n root,\r\n ''\r\n )\r\n /* OK you can record now */\r\n this.isProxifyingTreeNow = false\r\n this.resume()\r\n return proxifiedObject\r\n }\r\n /**\r\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\r\n * @param {Proxy} proxy - The target proxy object\r\n */\r\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\r\n revokableProxyInstance\r\n ) {\r\n if (this.showDetachedWarning) {\r\n const message =\r\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\r\n\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.deleteProperty = (\r\n targetObject,\r\n propKey\r\n ) => {\r\n return Reflect.deleteProperty(targetObject, propKey)\r\n }\r\n } else {\r\n delete revokableProxyInstance.trapsInstance.set\r\n delete revokableProxyInstance.trapsInstance.get\r\n delete revokableProxyInstance.trapsInstance.deleteProperty\r\n }\r\n }\r\n /**\r\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\r\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\r\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\r\n */\r\n JSONPatcherProxy.prototype.observe = function(record, callback) {\r\n if (!record && !callback) {\r\n throw new Error('You need to either record changes or pass a callback')\r\n }\r\n this.isRecording = record\r\n this.userCallback = callback\r\n /*\r\n I moved it here to remove it from `unobserve`,\r\n this will also make the constructor faster, why initiate\r\n the array before they decide to actually observe with recording?\r\n They might need to use only a callback.\r\n */\r\n if (record) this.patches = []\r\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\r\n return this.cachedProxy\r\n }\r\n /**\r\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\r\n */\r\n JSONPatcherProxy.prototype.generate = function() {\r\n if (!this.isRecording) {\r\n throw new Error('You should set record to true to get patches later')\r\n }\r\n return this.patches.splice(0, this.patches.length)\r\n }\r\n /**\r\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\r\n */\r\n JSONPatcherProxy.prototype.revoke = function() {\r\n this.proxifiedObjectsMap.forEach(el => {\r\n el.revoke()\r\n })\r\n }\r\n /**\r\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\r\n */\r\n JSONPatcherProxy.prototype.disableTraps = function() {\r\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\r\n }\r\n return JSONPatcherProxy\r\n})()\r\n\r\nexport default JSONPatcherProxy\r\n","const callbacks = []\r\nconst nextTickCallback = []\r\n\r\nexport function tick(fn, scope) {\r\n callbacks.push({ fn, scope })\r\n}\r\n\r\nexport function fireTick() {\r\n callbacks.forEach(item => {\r\n item.fn.call(item.scope)\r\n })\r\n\r\n nextTickCallback.forEach(nextItem => {\r\n nextItem.fn.call(nextItem.scope)\r\n })\r\n nextTickCallback.length = 0\r\n}\r\n\r\nexport function nextTick(fn, scope) {\r\n nextTickCallback.push({ fn, scope })\r\n}\r\n","import JSONProxy from './proxy'\r\nimport { fireTick } from './tick'\r\n\r\nexport function observe(target) {\r\n target.observe = true\r\n}\r\n\r\nexport function proxyUpdate(ele) {\r\n let timeout = null\r\n ele.data = new JSONProxy(ele.data).observe(false, info => {\r\n if (\r\n ele._willUpdate ||\r\n (info.op === 'replace' && info.oldValue === info.value)\r\n ) {\r\n return\r\n }\r\n\r\n clearTimeout(timeout)\r\n\r\n timeout = setTimeout(() => {\r\n ele.update()\r\n fireTick()\r\n }, 0)\r\n })\r\n}\r\n","import { cssToDom, nProps, isArray } from './util'\r\nimport { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport { proxyUpdate } from './observe'\r\n\r\nlet id = 0\r\n\r\nexport default class WeElement extends HTMLElement {\r\n static is = 'WeElement'\r\n\r\n constructor() {\r\n super()\r\n this.props = Object.assign(\r\n nProps(this.constructor.props),\r\n this.constructor.defaultProps\r\n )\r\n this.__elementId = id++\r\n this.data = this.constructor.data || {}\r\n }\r\n\r\n connectedCallback() {\r\n if (!this.constructor.pure) {\r\n let p = this.parentNode\r\n while (p && !this.store) {\r\n this.store = p.store\r\n p = p.parentNode || p.host\r\n }\r\n if (this.store) {\r\n this.store.instances.push(this)\r\n }\r\n }\r\n this.beforeInstall()\r\n !this._isInstalled && this.install()\r\n this.afterInstall()\r\n let shadowRoot\r\n if (!this.shadowRoot) {\r\n shadowRoot = this.attachShadow({\r\n mode: 'open'\r\n })\r\n } else {\r\n shadowRoot = this.shadowRoot\r\n let fc\r\n while ((fc = shadowRoot.firstChild)) {\r\n shadowRoot.removeChild(fc)\r\n }\r\n }\r\n\r\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\r\n !this._isInstalled && this.beforeRender()\r\n options.afterInstall && options.afterInstall(this)\r\n if (this.constructor.observe) {\r\n this.beforeObserve()\r\n proxyUpdate(this)\r\n this.observed()\r\n }\r\n this.host = diff(\r\n null,\r\n this.render(this.props, this.data, this.store),\r\n {},\r\n false,\r\n null,\r\n false\r\n )\r\n this.rendered()\r\n if (isArray(this.host)) {\r\n this.host.forEach(function(item) {\r\n shadowRoot.appendChild(item)\r\n })\r\n } else {\r\n shadowRoot.appendChild(this.host)\r\n }\r\n !this._isInstalled && this.installed()\r\n this._isInstalled = true\r\n }\r\n\r\n disconnectedCallback() {\r\n this.uninstall()\r\n this._isInstalled = false\r\n if (this.store) {\r\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\r\n if (this.store.instances[i] === this) {\r\n this.store.instances.splice(i, 1)\r\n break\r\n }\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n this._willUpdate = true\r\n this.beforeUpdate()\r\n this.beforeRender()\r\n this.host = diff(\r\n this.host,\r\n this.render(this.props, this.data, this.store),\r\n null,\r\n null,\r\n this.shadowRoot\r\n )\r\n this.afterUpdate()\r\n this.updated()\r\n this._willUpdate = false\r\n }\r\n\r\n fire(name, data) {\r\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\r\n }\r\n\r\n beforeInstall() {}\r\n\r\n install() {}\r\n\r\n afterInstall() {}\r\n\r\n installed() {}\r\n\r\n uninstall() {}\r\n\r\n beforeUpdate() {}\r\n\r\n afterUpdate() {} //deprecated, please use updated\r\n\r\n updated() {}\r\n\r\n beforeRender() {}\r\n\r\n rendered() {}\r\n\r\n receiveProps() {}\r\n\r\n beforeObserve() {}\r\n\r\n observed() {}\r\n}\r\n","import { diff } from './vdom/diff'\r\nimport JSONProxy from './proxy'\r\n\r\nexport function render(vnode, parent, store) {\r\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n if (store) {\r\n store.instances = []\r\n extendStoreUpate(store)\r\n let timeout = null\r\n let patchs = {}\r\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\r\n clearTimeout(timeout)\r\n if (patch.op === 'remove') {\r\n // fix arr splice\r\n const kv = getArrayPatch(patch.path, store)\r\n patchs[kv.k] = kv.v\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n } else {\r\n const key = fixPath(patch.path)\r\n patchs[key] = patch.value\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n }\r\n })\r\n parent.store = store\r\n }\r\n return diff(null, vnode, {}, false, parent, false)\r\n}\r\n\r\nfunction update(patch, store) {\r\n store.update(patch)\r\n}\r\n\r\nfunction extendStoreUpate(store) {\r\n store.update = function(patch) {\r\n const updateAll = matchGlobalData(this.globalData, patch)\r\n\r\n if (Object.keys(patch).length > 0) {\r\n this.instances.forEach(instance => {\r\n if (\r\n updateAll ||\r\n this.updateAll ||\r\n (instance.constructor.updatePath &&\r\n needUpdate(patch, instance.constructor.updatePath))\r\n ) {\r\n instance.update()\r\n }\r\n })\r\n this.onChange && this.onChange(patch)\r\n }\r\n }\r\n}\r\n\r\nexport function matchGlobalData(globalData, diffResult) {\r\n if (!globalData) return false\r\n for (let keyA in diffResult) {\r\n if (globalData.indexOf(keyA) > -1) {\r\n return true\r\n }\r\n for (let i = 0, len = globalData.length; i < len; i++) {\r\n if (includePath(keyA, globalData[i])) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function needUpdate(diffResult, updatePath) {\r\n for (let keyA in diffResult) {\r\n if (updatePath[keyA]) {\r\n return true\r\n }\r\n for (let keyB in updatePath) {\r\n if (includePath(keyA, keyB)) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nfunction includePath(pathA, pathB) {\r\n if (pathA.indexOf(pathB) === 0) {\r\n const next = pathA.substr(pathB.length, 1)\r\n if (next === '[' || next === '.') {\r\n return true\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function fixPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n arr.forEach((item, index) => {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n })\r\n return mpPath\r\n}\r\n\r\nfunction getArrayPatch(path, store) {\r\n const arr = path.replace('/', '').split('/')\r\n let current = store.data[arr[0]]\r\n for (let i = 1, len = arr.length; i < len - 1; i++) {\r\n current = current[arr[i]]\r\n }\r\n return { k: fixArrPath(path), v: current }\r\n}\r\n\r\nfunction fixArrPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n const len = arr.length\r\n arr.forEach((item, index) => {\r\n if (index < len - 1) {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n }\r\n })\r\n return mpPath\r\n}\r\n","import WeElement from './we-element'\r\nimport { cssToDom } from './util'\r\n\r\nconst OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n if (ctor.is === 'WeElement') {\r\n customElements.define(name, ctor)\r\n if (ctor.data && !ctor.pure) {\r\n ctor.updatePath = getUpdatePath(ctor.data)\r\n }\r\n } else {\r\n class Element extends WeElement {\r\n _useId = 0\r\n\r\n _useMap = {}\r\n\r\n render(props, data) {\r\n return ctor.call(this, props, data)\r\n }\r\n\r\n beforeRender() {\r\n this._useId = 0\r\n }\r\n\r\n useCss(css) {\r\n const style = this.shadowRoot.querySelector('style')\r\n style && this.shadowRoot.removeChild(style)\r\n this.shadowRoot.appendChild(cssToDom(css))\r\n }\r\n\r\n useData(data) {\r\n return this.use({ data: data })\r\n }\r\n\r\n use(option) {\r\n this._useId++\r\n const updater = newValue => {\r\n const item = this._useMap[updater.id]\r\n\r\n item.data = newValue\r\n\r\n this.update()\r\n item.effect && item.effect()\r\n }\r\n\r\n updater.id = this._useId\r\n if (!this._isInstalled) {\r\n this._useMap[this._useId] = option\r\n return [option.data, updater]\r\n }\r\n\r\n return [this._useMap[this._useId].data, updater]\r\n }\r\n\r\n installed() {\r\n this._isInstalled = true\r\n }\r\n }\r\n customElements.define(name, Element)\r\n }\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n const result = {}\r\n dataToPath(data, result)\r\n return result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n Object.keys(data).forEach(key => {\r\n result[key] = true\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n Object.keys(data).forEach(key => {\r\n result[path + '.' + key] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], path + '.' + key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], path + '.' + key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n data.forEach((item, index) => {\r\n result[path + '[' + index + ']'] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(item)\r\n if (type === OBJECTTYPE) {\r\n _objToPath(item, path + '[' + index + ']', result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(item, path + '[' + index + ']', result)\r\n }\r\n })\r\n}\r\n","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n return function(target) {\r\n target.pure = pure\r\n define(name, target)\r\n }\r\n}\r\n","import { extend } from './util'\r\nimport { h } from './h'\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n return h(\r\n vnode.nodeName,\r\n extend(extend({}, vnode.attributes), props),\r\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\r\n )\r\n}\r\n","export function getHost(ele) {\r\n let p = ele.parentNode\r\n while (p) {\r\n if (p.host) {\r\n return p.host\r\n } else {\r\n p = p.parentNode\r\n }\r\n }\r\n}\r\n","export function rpx(str) {\r\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\r\n return (window.innerWidth * Number(b)) / 750 + 'px'\r\n })\r\n}\r\n","import WeElement from './we-element'\r\n\r\nexport default class ModelView extends WeElement {\r\n static observe = true\r\n\r\n beforeInstall() {\r\n this.data = this.vm.data\r\n }\r\n\r\n observed() {\r\n this.vm.data = this.data\r\n }\r\n}\r\n","import { h, h as createElement } from './h'\r\nimport options from './options'\r\nimport WeElement from './we-element'\r\nimport { render } from './render'\r\nimport { define } from './define'\r\nimport { tag } from './tag'\r\nimport { observe } from './observe'\r\nimport { cloneElement } from './clone-element'\r\nimport { getHost } from './get-host'\r\nimport { rpx } from './rpx'\r\nimport { tick, nextTick } from './tick'\r\nimport ModelView from './model-view'\r\n\r\nconst Component = WeElement\r\n\r\nconst omi = {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n\r\noptions.root.Omi = omi\r\noptions.root.Omi.version = '5.0.2'\r\n\r\nexport default omi\r\n\r\nexport {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n","\n\t\t\t\timport Omi from './omi';\n\t\t\t\tif (typeof module!='undefined') module.exports = Omi;\n\t\t\t\telse self.Omi = Omi;\n\t\t\t"],"names":["VNode","getGlobal","global","Math","Array","self","window","store","root","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","Object","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","toString","call","nProps","result","keys","forEach","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","name","old","className","style","cssText","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","touchStart","touchEnd","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ret","ownerSVGElement","domLength","vnodeLength","maxLength","ele","idiff","appendChild","item","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","firstChild","fc","vchildren","a","nextSibling","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","unmountOnly","removeChildren","lastChild","next","previousSibling","attrs","update","isWeElement","receiveProps","data","JSONPatcherProxy","deepClone","JSON","parse","stringify","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","get","path","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","set","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","Number","isInteger","console","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","splice","revoke","el","disableTraps","callbacks","nextTickCallback","tick","fn","scope","fireTick","nextItem","nextTick","proxyUpdate","timeout","JSONProxy","_willUpdate","info","clearTimeout","id","WeElement","assign","defaultProps","__elementId","connectedCallback","pure","host","instances","beforeInstall","_isInstalled","install","afterInstall","shadowRoot","attachShadow","mode","beforeRender","beforeObserve","observed","render","rendered","installed","disconnectedCallback","uninstall","beforeUpdate","afterUpdate","updated","fire","querySelector","extendStoreUpate","patchs","patch","kv","getArrayPatch","k","v","fixPath","updateAll","matchGlobalData","globalData","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","arr","split","index","isNaN","fixArrPath","OBJECTTYPE","ARRAYTYPE","define","ctor","getUpdatePath","Element","_useId","_useMap","useCss","useData","use","option","updater","effect","dataToPath","_objToPath","_arrayToPath","tag","cloneElement","slice","getHost","rpx","b","innerWidth","ModelView","vm","Component","omi","Omi","version","module","exports"],"mappings":";;;;;;;;;;;EAAA;AACA,EAAO,SAASA,KAAT,GAAiB;;ECDxB,SAASC,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,WACEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAW;EACV,aAAO,IAAP;EACD,KAFD,EAJF;EAQD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,SAAO,IADM;EAEbC,QAAMP;EAFO,CAAf;;MCpBMQ,QAAQ,EAAd;EACA,IAAMC,iBAAiB,EAAvB;;AAEA,EAAO,SAASC,CAAT,CAAWC,QAAX,EAAqBC,UAArB,EAAiC;EACtC,MAAIC,WAAWJ,cAAf;EAAA,MACEK,mBADF;EAAA,MAEEC,cAFF;EAAA,MAGEC,eAHF;EAAA,MAIEC,UAJF;EAKA,OAAKA,IAAIC,UAAUC,MAAnB,EAA2BF,MAAM,CAAjC,GAAsC;EACpCT,UAAMY,IAAN,CAAWF,UAAUD,CAAV,CAAX;EACD;EACD,MAAIL,cAAcA,WAAWC,QAAX,IAAuB,IAAzC,EAA+C;EAC7C,QAAI,CAACL,MAAMW,MAAX,EAAmBX,MAAMY,IAAN,CAAWR,WAAWC,QAAtB;EACnB,WAAOD,WAAWC,QAAlB;EACD;EACD,SAAOL,MAAMW,MAAb,EAAqB;EACnB,QAAI,CAACJ,QAAQP,MAAMa,GAAN,EAAT,KAAyBN,MAAMM,GAAN,KAAcC,SAA3C,EAAsD;EACpD,WAAKL,IAAIF,MAAMI,MAAf,EAAuBF,GAAvB;EAA8BT,cAAMY,IAAN,CAAWL,MAAME,CAAN,CAAX;EAA9B;EACD,KAFD,MAEO;EACL,UAAI,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;;;IAToC2F;;EAAlB+E,UACZvG,UAAU;;ECUnB,IAAMyG,YAAYjF,SAAlB;;EAEA,IAAMkF,MAAM;EACVV,UADU;EAEVxE,sBAFU;EAGViF,sBAHU;EAIV/D,gBAJU;EAKV1R,MALU;EAMVgC,kBANU;EAOVhB,kBAPU;EAQViT,gBARU;EASVjF,kBATU;EAUViG,4BAVU;EAWVE,kBAXU;EAYVC,UAZU;EAaVzF,YAbU;EAcVK,oBAdU;EAeVuF;EAfU,CAAZ;;EAkBAvU,QAAQnB,IAAR,CAAa8V,GAAb,GAAmBD,GAAnB;EACA1U,QAAQnB,IAAR,CAAa8V,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;EChCI,IAAI,OAAOC,MAAP,IAAe,WAAnB,EAAgCA,OAAOC,OAAP,GAAiBH,GAAjB,CAAhC,KACKjW,KAAKiW,GAAL,GAAWA,GAAX;;"} \ No newline at end of file +{"version":3,"file":"omi.dev.js","sources":["../src/vnode.js","../src/options.js","../src/h.js","../src/util.js","../src/constants.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/model-view.js","../src/omi.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function() {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal()\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n p.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function npn(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n","// render modes\n\nexport const NO_RENDER = 0\nexport const SYNC_RENDER = 1\nexport const FORCE_RENDER = 2\nexport const ASYNC_RENDER = 3\n\nexport const ATTR_KEY = '__omiattr_'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import { extend } from '../util'\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchstart', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchstart', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value === 'string') {\n if (ns) {\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n } else {\n node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn, isArray } from '../util'\nimport { removeNode } from '../dom/index'\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n if (isArray(vnode)) {\n ret = []\n let parentNode = null\n if (isArray(dom)) {\n let domLength = dom.length\n let vnodeLength = vnode.length\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\n parentNode = dom[0].parentNode\n for (let i = 0; i < maxLength; i++) {\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\n ret.push(ele)\n if (i > domLength - 1) {\n parentNode.appendChild(ele)\n }\n }\n } else {\n vnode.forEach(function(item) {\n let ele = idiff(dom, item, context, mountAll, componentRoot)\n ret.push(ele)\n parent && parent.appendChild(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\n } else {\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, vnode.children)\n if (out.props) {\n out.props.children = vnode.children\n }\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, children) {\n let name\n let update = false\n let isWeElement = dom.update\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n if (isWeElement) {\n delete dom.props[name]\n update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n //diable when using store system?\n //!dom.store &&\n if (isWeElement && typeof attrs[name] === 'object') {\n dom.props[npn(name)] = attrs[name]\n update = true\n } else if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n if (isWeElement) {\n dom.props[npn(name)] = attrs[name]\n update = true\n }\n }\n }\n\n if (isWeElement && dom.parentNode) {\n if (update || children.length > 0) {\n dom.receiveProps(dom.props, dom.data)\n dom.update()\n }\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import JSONProxy from './proxy'\nimport { fireTick } from './tick'\n\nexport function observe(target) {\n target.observe = true\n}\n\nexport function proxyUpdate(ele) {\n let timeout = null\n ele.data = new JSONProxy(ele.data).observe(false, info => {\n if (\n ele._willUpdate ||\n (info.op === 'replace' && info.oldValue === info.value)\n ) {\n return\n }\n\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n })\n}\n","import { cssToDom, nProps, isArray } from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { proxyUpdate } from './observe'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n static is = 'WeElement'\n\n constructor() {\n super()\n this.props = Object.assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps\n )\n this.__elementId = id++\n this.data = this.constructor.data || {}\n }\n\n connectedCallback() {\n if (!this.constructor.pure) {\n let p = this.parentNode\n while (p && !this.store) {\n this.store = p.store\n p = p.parentNode || p.host\n }\n if (this.store) {\n this.store.instances.push(this)\n }\n }\n this.beforeInstall()\n !this._isInstalled && this.install()\n this.afterInstall()\n let shadowRoot\n if (!this.shadowRoot) {\n shadowRoot = this.attachShadow({\n mode: 'open'\n })\n } else {\n shadowRoot = this.shadowRoot\n let fc\n while ((fc = shadowRoot.firstChild)) {\n shadowRoot.removeChild(fc)\n }\n }\n\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\n !this._isInstalled && this.beforeRender()\n options.afterInstall && options.afterInstall(this)\n if (this.constructor.observe) {\n this.beforeObserve()\n proxyUpdate(this)\n this.observed()\n }\n this.host = diff(\n null,\n this.render(this.props, this.data, this.store),\n {},\n false,\n null,\n false\n )\n this.rendered()\n if (isArray(this.host)) {\n this.host.forEach(function(item) {\n shadowRoot.appendChild(item)\n })\n } else {\n shadowRoot.appendChild(this.host)\n }\n !this._isInstalled && this.installed()\n this._isInstalled = true\n }\n\n disconnectedCallback() {\n this.uninstall()\n this._isInstalled = false\n if (this.store) {\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\n if (this.store.instances[i] === this) {\n this.store.instances.splice(i, 1)\n break\n }\n }\n }\n }\n\n update() {\n this._willUpdate = true\n this.beforeUpdate()\n this.beforeRender()\n this.host = diff(\n this.host,\n this.render(this.props, this.data, this.store),\n null,\n null,\n this.shadowRoot\n )\n this.afterUpdate()\n this.updated()\n this._willUpdate = false\n }\n\n fire(name, data) {\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\n }\n\n beforeInstall() {}\n\n install() {}\n\n afterInstall() {}\n\n installed() {}\n\n uninstall() {}\n\n beforeUpdate() {}\n\n afterUpdate() {} //deprecated, please use updated\n\n updated() {}\n\n beforeRender() {}\n\n rendered() {}\n\n receiveProps() {}\n\n beforeObserve() {}\n\n observed() {}\n}\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n clearTimeout(timeout)\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n }\n })\n parent.store = store\n }\n return diff(null, vnode, {}, false, parent, false)\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import WeElement from './we-element'\nimport { cssToDom } from './util'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n if (ctor.data && !ctor.pure) {\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n } else {\n class Element extends WeElement {\n _useId = 0\n\n _useMap = {}\n\n _preCss = null\n\n render(props, data) {\n return ctor.call(this, props, data)\n }\n\n beforeRender() {\n this._useId = 0\n }\n\n useCss(css) {\n if (css === this._preCss) {\n return\n }\n this._preCss = css\n const style = this.shadowRoot.querySelector('style')\n style && this.shadowRoot.removeChild(style)\n this.shadowRoot.appendChild(cssToDom(css))\n }\n\n useData(data) {\n return this.use({ data: data })\n }\n\n use(option) {\n this._useId++\n const updater = newValue => {\n const item = this._useMap[updater.id]\n\n item.data = newValue\n\n this.update()\n item.effect && item.effect()\n }\n\n updater.id = this._useId\n if (!this._isInstalled) {\n this._useMap[this._useId] = option\n return [option.data, updater]\n }\n\n return [this._useMap[this._useId].data, updater]\n }\n\n installed() {\n this._isInstalled = true\n }\n }\n customElements.define(name, Element)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\n","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else {\n p = p.parentNode\n }\n }\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","import WeElement from './we-element'\n\nexport default class ModelView extends WeElement {\n static observe = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n\n observed() {\n this.vm.data = this.data\n }\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { observe } from './observe'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { tick, nextTick } from './tick'\nimport ModelView from './model-view'\n\nconst Component = WeElement\n\nconst omi = {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n\noptions.root.Omi = omi\noptions.root.Omi.version = '5.0.3'\n\nexport default omi\n\nexport {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n","\n\t\t\t\timport Omi from './omi';\n\t\t\t\tif (typeof module!='undefined') module.exports = Omi;\n\t\t\t\telse self.Omi = Omi;\n\t\t\t"],"names":["VNode","getGlobal","global","Math","Array","self","window","store","root","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","Object","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","toString","call","nProps","result","keys","forEach","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","name","old","className","style","cssText","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","touchStart","touchEnd","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ret","ownerSVGElement","domLength","vnodeLength","maxLength","ele","idiff","appendChild","item","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","firstChild","fc","vchildren","a","nextSibling","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","unmountOnly","removeChildren","lastChild","next","previousSibling","attrs","update","isWeElement","receiveProps","data","JSONPatcherProxy","deepClone","JSON","parse","stringify","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","get","path","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","set","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","Number","isInteger","console","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","splice","revoke","el","disableTraps","callbacks","nextTickCallback","tick","fn","scope","fireTick","nextItem","nextTick","proxyUpdate","timeout","JSONProxy","_willUpdate","info","clearTimeout","id","WeElement","assign","defaultProps","__elementId","connectedCallback","pure","host","instances","beforeInstall","_isInstalled","install","afterInstall","shadowRoot","attachShadow","mode","beforeRender","beforeObserve","observed","render","rendered","installed","disconnectedCallback","uninstall","beforeUpdate","afterUpdate","updated","fire","querySelector","extendStoreUpate","patchs","patch","kv","getArrayPatch","k","v","fixPath","updateAll","matchGlobalData","globalData","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","arr","split","index","isNaN","fixArrPath","OBJECTTYPE","ARRAYTYPE","define","ctor","getUpdatePath","Element","_useId","_useMap","_preCss","useCss","useData","use","option","updater","effect","dataToPath","_objToPath","_arrayToPath","tag","cloneElement","slice","getHost","rpx","b","innerWidth","ModelView","vm","Component","omi","Omi","version","module","exports"],"mappings":";;;;;;;;;;;EAAA;AACA,EAAO,SAASA,KAAT,GAAiB;;ECDxB,SAASC,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,WACEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAW;EACV,aAAO,IAAP;EACD,KAFD,EAJF;EAQD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,SAAO,IADM;EAEbC,QAAMP;EAFO,CAAf;;MCpBMQ,QAAQ,EAAd;EACA,IAAMC,iBAAiB,EAAvB;;AAEA,EAAO,SAASC,CAAT,CAAWC,QAAX,EAAqBC,UAArB,EAAiC;EACtC,MAAIC,WAAWJ,cAAf;EAAA,MACEK,mBADF;EAAA,MAEEC,cAFF;EAAA,MAGEC,eAHF;EAAA,MAIEC,UAJF;EAKA,OAAKA,IAAIC,UAAUC,MAAnB,EAA2BF,MAAM,CAAjC,GAAsC;EACpCT,UAAMY,IAAN,CAAWF,UAAUD,CAAV,CAAX;EACD;EACD,MAAIL,cAAcA,WAAWC,QAAX,IAAuB,IAAzC,EAA+C;EAC7C,QAAI,CAACL,MAAMW,MAAX,EAAmBX,MAAMY,IAAN,CAAWR,WAAWC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ACF;;WCTe4Q,GAAT,CAAalT,GAAb,EAAkB;EACvB,SAAOA,IAAIC,OAAJ,CAAY,0BAAZ,EAAwC,UAACyG,CAAD,EAAIyM,CAAJ,EAAU;EACvD,WAAQ3V,OAAO4V,UAAP,GAAoBtI,OAAOqI,CAAP,CAArB,GAAkC,GAAlC,GAAwC,IAA/C;EACD,GAFM,CAAP;EAGD;;;;;;;;MCFoBE;;;;;;;;;wBAGnBxE,yCAAgB;EACd,SAAKnG,IAAL,GAAY,KAAK4K,EAAL,CAAQ5K,IAApB;EACD;;wBAED4G,+BAAW;EACT,SAAKgE,EAAL,CAAQ5K,IAAR,GAAe,KAAKA,IAApB;EACD;;;IAToC2F;;EAAlBgF,UACZxG,UAAU;;ECUnB,IAAM0G,YAAYlF,SAAlB;;EAEA,IAAMmF,MAAM;EACVV,UADU;EAEVzE,sBAFU;EAGVkF,sBAHU;EAIVhE,gBAJU;EAKV1R,MALU;EAMVgC,kBANU;EAOVhB,kBAPU;EAQViT,gBARU;EASVjF,kBATU;EAUVkG,4BAVU;EAWVE,kBAXU;EAYVC,UAZU;EAaV1F,YAbU;EAcVK,oBAdU;EAeVwF;EAfU,CAAZ;;EAkBAxU,QAAQnB,IAAR,CAAa+V,GAAb,GAAmBD,GAAnB;EACA3U,QAAQnB,IAAR,CAAa+V,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;EChCI,IAAI,OAAOC,MAAP,IAAe,WAAnB,EAAgCA,OAAOC,OAAP,GAAiBH,GAAjB,CAAhC,KACKlW,KAAKkW,GAAL,GAAWA,GAAX;;"} \ No newline at end of file diff --git a/packages/omi/dist/omi.esm.js b/packages/omi/dist/omi.esm.js index e4b3df221..5cc178676 100644 --- a/packages/omi/dist/omi.esm.js +++ b/packages/omi/dist/omi.esm.js @@ -1,5 +1,5 @@ /** - * omi v5.0.2 http://omijs.org + * omi v5.0.3 http://omijs.org * Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -710,17 +710,17 @@ var JSONPatcherProxy = function () { will emit {op: replace, path: '/arr/1', value: arr_2} {op: remove, path: '/arr/2'} - by default, the second operation would revoke the proxy, and this renders arr revoked. + by default, the second operation would revoke the proxy, and this renders arr revoked. That's why we need to remember the proxies that are inherited. */ var revokableInstance = instance.proxifiedObjectsMap.get(newValue); /* Why do we need to check instance.isProxifyingTreeNow? - We need to make sure we mark revokables as inherited ONLY when we're observing, + We need to make sure we mark revokables as inherited ONLY when we're observing, because throughout the first proxification, a sub-object is proxified and then assigned to its parent object. This assignment of a pre-proxified object can fool us into thinking that it's a proxified object moved around, while in fact it's the first assignment ever. - Checking isProxifyingTreeNow ensures this is not happening in the first proxification, + Checking isProxifyingTreeNow ensures this is not happening in the first proxification, but in fact is is a proxified object moved around the tree */ if (revokableInstance && !instance.isProxifyingTreeNow) { @@ -798,7 +798,7 @@ operation.op = 'replace', operation.value = null; this is an inherited proxy (an already proxified object that was moved around), we shouldn't revoke it, because even though it was removed from path1, it is still used in path2. And we know that because we mark moved proxies with `inherited` flag when we move them - it is a good idea to remove this flag if we come across it here, in deleteProperty trap. + it is a good idea to remove this flag if we come across it here, in deleteProperty trap. We DO want to revoke the proxy if it was removed again. */ revokableProxyInstance.inherited = false; @@ -1325,7 +1325,7 @@ function define(name, ctor) { args[key] = arguments[key]; } - return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _WeElement.call.apply(_WeElement, [this].concat(args))), _this), _this._useId = 0, _this._useMap = {}, _temp), _possibleConstructorReturn$1(_this, _ret); + return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _WeElement.call.apply(_WeElement, [this].concat(args))), _this), _this._useId = 0, _this._useMap = {}, _this._preCss = null, _temp), _possibleConstructorReturn$1(_this, _ret); } Element.prototype.render = function render(props, data) { @@ -1337,6 +1337,10 @@ function define(name, ctor) { }; Element.prototype.useCss = function useCss(css) { + if (css === this._preCss) { + return; + } + this._preCss = css; var style = this.shadowRoot.querySelector('style'); style && this.shadowRoot.removeChild(style); this.shadowRoot.appendChild(cssToDom(css)); @@ -1506,7 +1510,7 @@ var omi = { }; options.root.Omi = omi; -options.root.Omi.version = '5.0.2'; +options.root.Omi.version = '5.0.3'; export default omi; export { tag, WeElement, Component, render, h, h as createElement, options, define, observe, cloneElement, getHost, rpx, tick, nextTick, ModelView }; diff --git a/packages/omi/dist/omi.esm.js.map b/packages/omi/dist/omi.esm.js.map index 987516a39..7e6f14a8f 100644 --- a/packages/omi/dist/omi.esm.js.map +++ b/packages/omi/dist/omi.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"omi.esm.js","sources":["../src/vnode.js","../src/options.js","../src/h.js","../src/util.js","../src/constants.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/model-view.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n if (\r\n typeof global !== 'object' ||\r\n !global ||\r\n global.Math !== Math ||\r\n global.Array !== Array\r\n ) {\r\n return (\r\n self ||\r\n window ||\r\n global ||\r\n (function() {\r\n return this\r\n })()\r\n )\r\n }\r\n return global\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n store: null,\r\n root: getGlobal()\r\n}\r\n","import { VNode } from './vnode'\r\nimport options from './options'\r\n\r\nconst stack = []\r\nconst EMPTY_CHILDREN = []\r\n\r\nexport function h(nodeName, attributes) {\r\n let children = EMPTY_CHILDREN,\r\n lastSimple,\r\n child,\r\n simple,\r\n i\r\n for (i = arguments.length; i-- > 2; ) {\r\n stack.push(arguments[i])\r\n }\r\n if (attributes && attributes.children != null) {\r\n if (!stack.length) stack.push(attributes.children)\r\n delete attributes.children\r\n }\r\n while (stack.length) {\r\n if ((child = stack.pop()) && child.pop !== undefined) {\r\n for (i = child.length; i--; ) stack.push(child[i])\r\n } else {\r\n if (typeof child === 'boolean') child = null\r\n\r\n if ((simple = typeof nodeName !== 'function')) {\r\n if (child == null) child = ''\r\n else if (typeof child === 'number') child = String(child)\r\n else if (typeof child !== 'string') simple = false\r\n }\r\n\r\n if (simple && lastSimple) {\r\n children[children.length - 1] += child\r\n } else if (children === EMPTY_CHILDREN) {\r\n children = [child]\r\n } else {\r\n children.push(child)\r\n }\r\n\r\n lastSimple = simple\r\n }\r\n }\r\n\r\n let p = new VNode()\r\n p.nodeName = nodeName\r\n p.children = children\r\n p.attributes = attributes == null ? undefined : attributes\r\n p.key = attributes == null ? undefined : attributes.key\r\n\r\n // if a \"vnode hook\" is defined, pass every created VNode to it\r\n if (options.vnode !== undefined) options.vnode(p)\r\n\r\n return p\r\n}\r\n","/**\r\n * @license\r\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n/**\r\n * This shim allows elements written in, or compiled to, ES5 to work on native\r\n * implementations of Custom Elements v1. It sets new.target to the value of\r\n * this.constructor so that the native HTMLElement constructor can access the\r\n * current under-construction element's definition.\r\n */\r\n;(function() {\r\n if (\r\n // No Reflect, no classes, no need for shim because native custom elements\r\n // require ES2015 classes or Reflect.\r\n window.Reflect === undefined ||\r\n window.customElements === undefined ||\r\n // The webcomponentsjs custom elements polyfill doesn't require\r\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\r\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\r\n ) {\r\n return\r\n }\r\n const BuiltInHTMLElement = HTMLElement\r\n window.HTMLElement = function HTMLElement() {\r\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n }\r\n HTMLElement.prototype = BuiltInHTMLElement.prototype\r\n HTMLElement.prototype.constructor = HTMLElement\r\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\nexport function cssToDom(css) {\r\n const node = document.createElement('style')\r\n node.textContent = css\r\n return node\r\n}\r\n\r\nexport function npn(str) {\r\n return str.replace(/-(\\w)/g, ($, $1) => {\r\n return $1.toUpperCase()\r\n })\r\n}\r\n\r\nexport function extend(obj, props) {\r\n for (let i in props) obj[i] = props[i]\r\n return obj\r\n}\r\n\r\n/** Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} [ref=null]\r\n * @param {any} [value]\r\n */\r\nexport function applyRef(ref, value) {\r\n if (ref != null) {\r\n if (typeof ref == 'function') ref(value)\r\n else ref.current = value\r\n }\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n * @type {(callback: function) => void}\r\n */\r\nexport const defer =\r\n typeof Promise == 'function'\r\n ? Promise.resolve().then.bind(Promise.resolve())\r\n : setTimeout\r\n\r\nexport function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props) {\r\n if (!props || isArray(props)) return {}\r\n const result = {}\r\n Object.keys(props).forEach(key => {\r\n result[key] = props[key].value\r\n })\r\n return result\r\n}\r\n","// render modes\r\n\r\nexport const NO_RENDER = 0\r\nexport const SYNC_RENDER = 1\r\nexport const FORCE_RENDER = 2\r\nexport const ASYNC_RENDER = 3\r\n\r\nexport const ATTR_KEY = '__omiattr_'\r\n\r\n// DOM properties that should NOT have \"px\" added when numeric\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\r\n","import { extend } from '../util'\r\n\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n return node.splitText !== undefined\r\n }\r\n if (typeof vnode.nodeName === 'string') {\r\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n }\r\n return hydrating || node._componentConstructor === vnode.nodeName\r\n}\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n return (\r\n node.normalizedNodeName === nodeName ||\r\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\r\n )\r\n}\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n let props = extend({}, vnode.attributes)\r\n props.children = vnode.children\r\n\r\n let defaultProps = vnode.nodeName.defaultProps\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i]\r\n }\r\n }\r\n }\r\n\r\n return props\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants'\r\nimport { applyRef } from '../util'\r\nimport options from '../options'\r\n\r\n/**\r\n * Create an element with the given nodeName.\r\n * @param {string} nodeName The DOM node to create\r\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\r\n * namespace.\r\n * @returns {Element} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n /** @type {Element} */\r\n let node = isSvg\r\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\r\n : document.createElement(nodeName)\r\n node.normalizedNodeName = nodeName\r\n return node\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n let parentNode = node.parentNode\r\n if (parentNode) parentNode.removeChild(node)\r\n}\r\n\r\n/**\r\n * Set a named attribute on the given Node, with special behavior for some names\r\n * and event handlers. If `value` is `null`, the attribute/handler will be\r\n * removed.\r\n * @param {Element} node An element to mutate\r\n * @param {string} name The name/key to set, such as an event or attribute name\r\n * @param {*} old The last value that was set for this name/node pair\r\n * @param {*} value An attribute value, such as a function to be used as an\r\n * event handler\r\n * @param {boolean} isSvg Are we currently diffing inside an svg?\r\n * @private\r\n */\r\nexport function setAccessor(node, name, old, value, isSvg) {\r\n if (name === 'className') name = 'class'\r\n\r\n if (name === 'key') {\r\n // ignore\r\n } else if (name === 'ref') {\r\n applyRef(old, null)\r\n applyRef(value, node)\r\n } else if (name === 'class' && !isSvg) {\r\n node.className = value || ''\r\n } else if (name === 'style') {\r\n if (!value || typeof value === 'string' || typeof old === 'string') {\r\n node.style.cssText = value || ''\r\n }\r\n if (value && typeof value === 'object') {\r\n if (typeof old !== 'string') {\r\n for (let i in old) if (!(i in value)) node.style[i] = ''\r\n }\r\n for (let i in value) {\r\n node.style[i] =\r\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\r\n ? value[i] + 'px'\r\n : value[i]\r\n }\r\n }\r\n } else if (name === 'dangerouslySetInnerHTML') {\r\n if (value) node.innerHTML = value.__html || ''\r\n } else if (name[0] == 'o' && name[1] == 'n') {\r\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\r\n name = name.toLowerCase().substring(2)\r\n if (value) {\r\n if (!old) {\r\n node.addEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.addEventListener('touchstart', touchStart, useCapture)\r\n node.addEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n } else {\r\n node.removeEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.removeEventListener('touchstart', touchStart, useCapture)\r\n node.removeEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n ;(node._listeners || (node._listeners = {}))[name] = value\r\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\r\n // Attempt to set a DOM property to the given value.\r\n // IE & FF throw for certain property-value combinations.\r\n try {\r\n node[name] = value == null ? '' : value\r\n } catch (e) {}\r\n if ((value == null || value === false) && name != 'spellcheck')\r\n node.removeAttribute(name)\r\n } else {\r\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\r\n // spellcheck is treated differently than all other boolean values and\r\n // should not be removed when the value is `false`. See:\r\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n if (value == null || value === false) {\r\n if (ns)\r\n node.removeAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase()\r\n )\r\n else node.removeAttribute(name)\r\n } else if (typeof value === 'string') {\r\n if (ns) {\r\n node.setAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase(),\r\n value\r\n )\r\n } else {\r\n node.setAttribute(name, value)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n return this._listeners[e.type]((options.event && options.event(e)) || e)\r\n}\r\n\r\nfunction touchStart(e) {\r\n this.___touchX = e.touches[0].pageX\r\n this.___touchY = e.touches[0].pageY\r\n this.___scrollTop = document.body.scrollTop\r\n}\r\n\r\nfunction touchEnd(e) {\r\n if (\r\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\r\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\r\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\r\n ) {\r\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\r\n }\r\n}\r\n","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn, isArray } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n let ret\r\n if (!diffLevel++) {\r\n // when first starting the diff, check if we're diffing an SVG or within an SVG\r\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\r\n\r\n // hydration is indicated by the existing element to be diffed not having a prop cache\r\n hydrating = dom != null && !(ATTR_KEY in dom)\r\n }\r\n if (isArray(vnode)) {\r\n ret = []\r\n let parentNode = null\r\n if (isArray(dom)) {\r\n let domLength = dom.length\r\n let vnodeLength = vnode.length\r\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\r\n parentNode = dom[0].parentNode\r\n for (let i = 0; i < maxLength; i++) {\r\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\r\n ret.push(ele)\r\n if (i > domLength - 1) {\r\n parentNode.appendChild(ele)\r\n }\r\n }\r\n } else {\r\n vnode.forEach(function(item) {\r\n let ele = idiff(dom, item, context, mountAll, componentRoot)\r\n ret.push(ele)\r\n parent && parent.appendChild(ele)\r\n })\r\n }\r\n } else {\r\n if (isArray(dom)) {\r\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\r\n } else {\r\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n }\r\n // append the element if its a new parent\r\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\r\n }\r\n\r\n // diffLevel being reduced to 0 means we're exiting the diff\r\n if (!--diffLevel) {\r\n hydrating = false\r\n // invoke queued componentDidMount lifecycle methods\r\n }\r\n\r\n return ret\r\n}\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n if (dom && vnode && dom.props) {\r\n dom.props.children = vnode.children\r\n }\r\n let out = dom,\r\n prevSvgMode = isSvgMode\r\n\r\n // empty values (null, undefined, booleans) render as empty Text nodes\r\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\r\n\r\n // Fast case: Strings & Numbers create/update Text nodes.\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n // update if it's already a Text node:\r\n if (\r\n dom &&\r\n dom.splitText !== undefined &&\r\n dom.parentNode &&\r\n (!dom._component || componentRoot)\r\n ) {\r\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n if (dom.nodeValue != vnode) {\r\n dom.nodeValue = vnode\r\n }\r\n } else {\r\n // it wasn't a Text node: replace it with one and recycle the old Element\r\n out = document.createTextNode(vnode)\r\n if (dom) {\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n out[ATTR_KEY] = true\r\n\r\n return out\r\n }\r\n\r\n // If the VNode represents a Component, perform a component diff:\r\n let vnodeName = vnode.nodeName\r\n\r\n // Tracks entering and exiting SVG namespace when descending through the tree.\r\n isSvgMode =\r\n vnodeName === 'svg'\r\n ? true\r\n : vnodeName === 'foreignObject'\r\n ? false\r\n : isSvgMode\r\n\r\n // If there's no existing element or it's the wrong type, create a new one:\r\n vnodeName = String(vnodeName)\r\n if (!dom || !isNamedNode(dom, vnodeName)) {\r\n out = createNode(vnodeName, isSvgMode)\r\n\r\n if (dom) {\r\n // move children into the replacement node\r\n while (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n // if the previous Element was mounted into the DOM, replace it inline\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n // recycle the old element (skips non-Element node types)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n let fc = out.firstChild,\r\n props = out[ATTR_KEY],\r\n vchildren = vnode.children\r\n\r\n if (props == null) {\r\n props = out[ATTR_KEY] = {}\r\n for (let a = out.attributes, i = a.length; i--; )\r\n props[a[i].name] = a[i].value\r\n }\r\n\r\n // Optimization: fast-path for elements containing a single TextNode:\r\n if (\r\n !hydrating &&\r\n vchildren &&\r\n vchildren.length === 1 &&\r\n typeof vchildren[0] === 'string' &&\r\n fc != null &&\r\n fc.splitText !== undefined &&\r\n fc.nextSibling == null\r\n ) {\r\n if (fc.nodeValue != vchildren[0]) {\r\n fc.nodeValue = vchildren[0]\r\n }\r\n }\r\n // otherwise, if there are existing or new children, diff them:\r\n else if ((vchildren && vchildren.length) || fc != null) {\r\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\r\n innerDiffNode(\r\n out,\r\n vchildren,\r\n context,\r\n mountAll,\r\n hydrating || props.dangerouslySetInnerHTML != null\r\n )\r\n }\r\n }\r\n\r\n // Apply attributes/props from VNode to the DOM Element:\r\n diffAttributes(out, vnode.attributes, props, vnode.children)\r\n if (out.props) {\r\n out.props.children = vnode.children\r\n }\r\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n isSvgMode = prevSvgMode\r\n\r\n return out\r\n}\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n let originalChildren = dom.childNodes,\r\n children = [],\r\n keyed = {},\r\n keyedLen = 0,\r\n min = 0,\r\n len = originalChildren.length,\r\n childrenLen = 0,\r\n vlen = vchildren ? vchildren.length : 0,\r\n j,\r\n c,\r\n f,\r\n vchild,\r\n child\r\n\r\n // Build up a map of keyed children and an Array of unkeyed children:\r\n if (len !== 0) {\r\n for (let i = 0; i < len; i++) {\r\n let child = originalChildren[i],\r\n props = child[ATTR_KEY],\r\n key =\r\n vlen && props\r\n ? child._component\r\n ? child._component.__key\r\n : props.key\r\n : null\r\n if (key != null) {\r\n keyedLen++\r\n keyed[key] = child\r\n } else if (\r\n props ||\r\n (child.splitText !== undefined\r\n ? isHydrating\r\n ? child.nodeValue.trim()\r\n : true\r\n : isHydrating)\r\n ) {\r\n children[childrenLen++] = child\r\n }\r\n }\r\n }\r\n\r\n if (vlen !== 0) {\r\n for (let i = 0; i < vlen; i++) {\r\n vchild = vchildren[i]\r\n child = null\r\n\r\n // attempt to find a node based on key matching\r\n let key = vchild.key\r\n if (key != null) {\r\n if (keyedLen && keyed[key] !== undefined) {\r\n child = keyed[key]\r\n keyed[key] = undefined\r\n keyedLen--\r\n }\r\n }\r\n // attempt to pluck a node of the same type from the existing children\r\n else if (!child && min < childrenLen) {\r\n for (j = min; j < childrenLen; j++) {\r\n if (\r\n children[j] !== undefined &&\r\n isSameNodeType((c = children[j]), vchild, isHydrating)\r\n ) {\r\n child = c\r\n children[j] = undefined\r\n if (j === childrenLen - 1) childrenLen--\r\n if (j === min) min++\r\n break\r\n }\r\n }\r\n }\r\n\r\n // morph the matched/found/created DOM child to match vchild (deep)\r\n child = idiff(child, vchild, context, mountAll)\r\n\r\n f = originalChildren[i]\r\n if (child && child !== dom && child !== f) {\r\n if (f == null) {\r\n dom.appendChild(child)\r\n } else if (child === f.nextSibling) {\r\n removeNode(f)\r\n } else {\r\n dom.insertBefore(child, f)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // remove unused keyed children:\r\n if (keyedLen) {\r\n for (let i in keyed)\r\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\r\n }\r\n\r\n // remove orphaned unkeyed children:\r\n while (min <= childrenLen) {\r\n if ((child = children[childrenLen--]) !== undefined)\r\n recollectNodeTree(child, false)\r\n }\r\n}\r\n\r\n/** Recursively recycle (or just unmount) a node and its descendants.\r\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\r\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\r\n */\r\nexport function recollectNodeTree(node, unmountOnly) {\r\n // If the node's VNode had a ref function, invoke it with null here.\r\n // (this is part of the React spec, and smart for unsetting references)\r\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\r\n\r\n if (unmountOnly === false || node[ATTR_KEY] == null) {\r\n removeNode(node)\r\n }\r\n\r\n removeChildren(node)\r\n}\r\n\r\n/** Recollect/unmount all children.\r\n *\t- we use .lastChild here because it causes less reflow than .firstChild\r\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\r\n */\r\nexport function removeChildren(node) {\r\n node = node.lastChild\r\n while (node) {\r\n let next = node.previousSibling\r\n recollectNodeTree(node, true)\r\n node = next\r\n }\r\n}\r\n\r\n/** Apply differences in attributes from a VNode to the given DOM Element.\r\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\r\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\r\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\r\n */\r\nfunction diffAttributes(dom, attrs, old, children) {\r\n let name\r\n let update = false\r\n let isWeElement = dom.update\r\n // remove attributes no longer present on the vnode by setting them to undefined\r\n for (name in old) {\r\n if (!(attrs && attrs[name] != null) && old[name] != null) {\r\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\r\n if (isWeElement) {\r\n delete dom.props[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n // add new & update changed attributes\r\n for (name in attrs) {\r\n //diable when using store system?\r\n //!dom.store &&\r\n if (isWeElement && typeof attrs[name] === 'object') {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n } else if (\r\n name !== 'children' &&\r\n name !== 'innerHTML' &&\r\n (!(name in old) ||\r\n attrs[name] !==\r\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\r\n ) {\r\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\r\n if (isWeElement) {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n if (isWeElement && dom.parentNode) {\r\n if (update || children.length > 0) {\r\n dom.receiveProps(dom.props, dom.data)\r\n dom.update()\r\n }\r\n }\r\n}\r\n","/*!\r\n * https://github.com/Palindrom/JSONPatcherProxy\r\n * (c) 2017 Starcounter\r\n * MIT license\r\n */\r\n\r\n/** Class representing a JS Object observer */\r\nconst JSONPatcherProxy = (function() {\r\n /**\r\n * Deep clones your object and returns a new object.\r\n */\r\n function deepClone(obj) {\r\n switch (typeof obj) {\r\n case 'object':\r\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\r\n case 'undefined':\r\n return null //this is how JSON.stringify behaves for array items\r\n default:\r\n return obj //no need to clone primitives\r\n }\r\n }\r\n JSONPatcherProxy.deepClone = deepClone\r\n\r\n function escapePathComponent(str) {\r\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\r\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\r\n }\r\n JSONPatcherProxy.escapePathComponent = escapePathComponent\r\n\r\n /**\r\n * Walk up the parenthood tree to get the path\r\n * @param {JSONPatcherProxy} instance\r\n * @param {Object} obj the object you need to find its path\r\n */\r\n function findObjectPath(instance, obj) {\r\n const pathComponents = []\r\n let parentAndPath = instance.parenthoodMap.get(obj)\r\n while (parentAndPath && parentAndPath.path) {\r\n // because we're walking up-tree, we need to use the array as a stack\r\n pathComponents.unshift(parentAndPath.path)\r\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\r\n }\r\n if (pathComponents.length) {\r\n const path = pathComponents.join('/')\r\n return '/' + path\r\n }\r\n return ''\r\n }\r\n /**\r\n * A callback to be used as th proxy set trap callback.\r\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the affected object\r\n * @param {String} key the effect property's name\r\n * @param {Any} newValue the value being set\r\n */\r\n function setTrap(instance, target, key, newValue) {\r\n const parentPath = findObjectPath(instance, target)\r\n\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n if (instance.proxifiedObjectsMap.has(newValue)) {\r\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\r\n\r\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\r\n parent: target,\r\n path: key\r\n })\r\n }\r\n /*\r\n mark already proxified values as inherited.\r\n rationale: proxy.arr.shift()\r\n will emit\r\n {op: replace, path: '/arr/1', value: arr_2}\r\n {op: remove, path: '/arr/2'}\r\n\r\n by default, the second operation would revoke the proxy, and this renders arr revoked.\r\n That's why we need to remember the proxies that are inherited.\r\n */\r\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\r\n /*\r\n Why do we need to check instance.isProxifyingTreeNow?\r\n\r\n We need to make sure we mark revokables as inherited ONLY when we're observing,\r\n because throughout the first proxification, a sub-object is proxified and then assigned to\r\n its parent object. This assignment of a pre-proxified object can fool us into thinking\r\n that it's a proxified object moved around, while in fact it's the first assignment ever.\r\n\r\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\r\n but in fact is is a proxified object moved around the tree\r\n */\r\n if (revokableInstance && !instance.isProxifyingTreeNow) {\r\n revokableInstance.inherited = true\r\n }\r\n\r\n // if the new value is an object, make sure to watch it\r\n if (\r\n newValue &&\r\n typeof newValue == 'object' &&\r\n !instance.proxifiedObjectsMap.has(newValue)\r\n ) {\r\n instance.parenthoodMap.set(newValue, {\r\n parent: target,\r\n path: key\r\n })\r\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\r\n }\r\n // let's start with this operation, and may or may not update it later\r\n const operation = {\r\n op: 'remove',\r\n path: destinationPropKey\r\n }\r\n if (typeof newValue == 'undefined') {\r\n // applying De Morgan's laws would be a tad faster, but less readable\r\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\r\n // `undefined` is being set to an already undefined value, keep silent\r\n return Reflect.set(target, key, newValue)\r\n }\r\n // when array element is set to `undefined`, should generate replace to `null`\r\n if (Array.isArray(target)) {\r\n // undefined array elements are JSON.stringified to `null`\r\n ;(operation.op = 'replace'), (operation.value = null)\r\n }\r\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\r\n // was the deleted a proxified object?\r\n if (oldValue) {\r\n instance.parenthoodMap.delete(target[key])\r\n instance.disableTrapsForProxy(oldValue)\r\n instance.proxifiedObjectsMap.delete(oldValue)\r\n }\r\n } else {\r\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\r\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\r\n if (key != 'length') {\r\n console.warn(\r\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\r\n )\r\n }\r\n return Reflect.set(target, key, newValue)\r\n }\r\n operation.op = 'add'\r\n if (target.hasOwnProperty(key)) {\r\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\r\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\r\n }\r\n }\r\n operation.value = newValue\r\n }\r\n operation.oldValue = target[key]\r\n const reflectionResult = Reflect.set(target, key, newValue)\r\n instance.defaultCallback(operation)\r\n return reflectionResult\r\n }\r\n /**\r\n * A callback to be used as th proxy delete trap callback.\r\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the effected object\r\n * @param {String} key the effected property's name\r\n */\r\n function deleteTrap(instance, target, key) {\r\n if (typeof target[key] !== 'undefined') {\r\n const parentPath = findObjectPath(instance, target)\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\r\n target[key]\r\n )\r\n\r\n if (revokableProxyInstance) {\r\n if (revokableProxyInstance.inherited) {\r\n /*\r\n this is an inherited proxy (an already proxified object that was moved around),\r\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\r\n And we know that because we mark moved proxies with `inherited` flag when we move them\r\n\r\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\r\n We DO want to revoke the proxy if it was removed again.\r\n */\r\n revokableProxyInstance.inherited = false\r\n } else {\r\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\r\n instance.disableTrapsForProxy(revokableProxyInstance)\r\n instance.proxifiedObjectsMap.delete(target[key])\r\n }\r\n }\r\n const reflectionResult = Reflect.deleteProperty(target, key)\r\n\r\n instance.defaultCallback({\r\n op: 'remove',\r\n path: destinationPropKey\r\n })\r\n\r\n return reflectionResult\r\n }\r\n }\r\n /* pre-define resume and pause functions to enhance constructors performance */\r\n function resume() {\r\n this.defaultCallback = operation => {\r\n this.isRecording && this.patches.push(operation)\r\n this.userCallback && this.userCallback(operation)\r\n }\r\n this.isObserving = true\r\n }\r\n function pause() {\r\n this.defaultCallback = () => {}\r\n this.isObserving = false\r\n }\r\n /**\r\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\r\n * @param {Object|Array} root - the object you want to wrap\r\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\r\n * @returns {JSONPatcherProxy}\r\n * @constructor\r\n */\r\n function JSONPatcherProxy(root, showDetachedWarning) {\r\n this.isProxifyingTreeNow = false\r\n this.isObserving = false\r\n this.proxifiedObjectsMap = new Map()\r\n this.parenthoodMap = new Map()\r\n // default to true\r\n if (typeof showDetachedWarning !== 'boolean') {\r\n showDetachedWarning = true\r\n }\r\n\r\n this.showDetachedWarning = showDetachedWarning\r\n this.originalObject = root\r\n this.cachedProxy = null\r\n this.isRecording = false\r\n this.userCallback\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Restores callback back to the original one provided to `observe`.\r\n */\r\n this.resume = resume.bind(this)\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Replaces your callback with a noop function.\r\n */\r\n this.pause = pause.bind(this)\r\n }\r\n\r\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\r\n if (!obj) {\r\n return obj\r\n }\r\n const traps = {\r\n set: (target, key, value, receiver) =>\r\n setTrap(this, target, key, value, receiver),\r\n deleteProperty: (target, key) => deleteTrap(this, target, key)\r\n }\r\n const revocableInstance = Proxy.revocable(obj, traps)\r\n // cache traps object to disable them later.\r\n revocableInstance.trapsInstance = traps\r\n revocableInstance.originalObject = obj\r\n\r\n /* keeping track of object's parent and path */\r\n\r\n this.parenthoodMap.set(obj, { parent, path })\r\n\r\n /* keeping track of all the proxies to be able to revoke them later */\r\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\r\n return revocableInstance.proxy\r\n }\r\n // grab tree's leaves one by one, encapsulate them into a proxy and return\r\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\r\n parent,\r\n root,\r\n path\r\n ) {\r\n for (let key in root) {\r\n if (root.hasOwnProperty(key)) {\r\n if (root[key] instanceof Object) {\r\n root[key] = this._proxifyObjectTreeRecursively(\r\n root,\r\n root[key],\r\n escapePathComponent(key)\r\n )\r\n }\r\n }\r\n }\r\n return this.generateProxyAtPath(parent, root, path)\r\n }\r\n // this function is for aesthetic purposes\r\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\r\n /*\r\n while proxyifying object tree,\r\n the proxyifying operation itself is being\r\n recorded, which in an unwanted behavior,\r\n that's why we disable recording through this\r\n initial process;\r\n */\r\n this.pause()\r\n this.isProxifyingTreeNow = true\r\n const proxifiedObject = this._proxifyObjectTreeRecursively(\r\n undefined,\r\n root,\r\n ''\r\n )\r\n /* OK you can record now */\r\n this.isProxifyingTreeNow = false\r\n this.resume()\r\n return proxifiedObject\r\n }\r\n /**\r\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\r\n * @param {Proxy} proxy - The target proxy object\r\n */\r\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\r\n revokableProxyInstance\r\n ) {\r\n if (this.showDetachedWarning) {\r\n const message =\r\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\r\n\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.deleteProperty = (\r\n targetObject,\r\n propKey\r\n ) => {\r\n return Reflect.deleteProperty(targetObject, propKey)\r\n }\r\n } else {\r\n delete revokableProxyInstance.trapsInstance.set\r\n delete revokableProxyInstance.trapsInstance.get\r\n delete revokableProxyInstance.trapsInstance.deleteProperty\r\n }\r\n }\r\n /**\r\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\r\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\r\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\r\n */\r\n JSONPatcherProxy.prototype.observe = function(record, callback) {\r\n if (!record && !callback) {\r\n throw new Error('You need to either record changes or pass a callback')\r\n }\r\n this.isRecording = record\r\n this.userCallback = callback\r\n /*\r\n I moved it here to remove it from `unobserve`,\r\n this will also make the constructor faster, why initiate\r\n the array before they decide to actually observe with recording?\r\n They might need to use only a callback.\r\n */\r\n if (record) this.patches = []\r\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\r\n return this.cachedProxy\r\n }\r\n /**\r\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\r\n */\r\n JSONPatcherProxy.prototype.generate = function() {\r\n if (!this.isRecording) {\r\n throw new Error('You should set record to true to get patches later')\r\n }\r\n return this.patches.splice(0, this.patches.length)\r\n }\r\n /**\r\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\r\n */\r\n JSONPatcherProxy.prototype.revoke = function() {\r\n this.proxifiedObjectsMap.forEach(el => {\r\n el.revoke()\r\n })\r\n }\r\n /**\r\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\r\n */\r\n JSONPatcherProxy.prototype.disableTraps = function() {\r\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\r\n }\r\n return JSONPatcherProxy\r\n})()\r\n\r\nexport default JSONPatcherProxy\r\n","const callbacks = []\r\nconst nextTickCallback = []\r\n\r\nexport function tick(fn, scope) {\r\n callbacks.push({ fn, scope })\r\n}\r\n\r\nexport function fireTick() {\r\n callbacks.forEach(item => {\r\n item.fn.call(item.scope)\r\n })\r\n\r\n nextTickCallback.forEach(nextItem => {\r\n nextItem.fn.call(nextItem.scope)\r\n })\r\n nextTickCallback.length = 0\r\n}\r\n\r\nexport function nextTick(fn, scope) {\r\n nextTickCallback.push({ fn, scope })\r\n}\r\n","import JSONProxy from './proxy'\r\nimport { fireTick } from './tick'\r\n\r\nexport function observe(target) {\r\n target.observe = true\r\n}\r\n\r\nexport function proxyUpdate(ele) {\r\n let timeout = null\r\n ele.data = new JSONProxy(ele.data).observe(false, info => {\r\n if (\r\n ele._willUpdate ||\r\n (info.op === 'replace' && info.oldValue === info.value)\r\n ) {\r\n return\r\n }\r\n\r\n clearTimeout(timeout)\r\n\r\n timeout = setTimeout(() => {\r\n ele.update()\r\n fireTick()\r\n }, 0)\r\n })\r\n}\r\n","import { cssToDom, nProps, isArray } from './util'\r\nimport { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport { proxyUpdate } from './observe'\r\n\r\nlet id = 0\r\n\r\nexport default class WeElement extends HTMLElement {\r\n static is = 'WeElement'\r\n\r\n constructor() {\r\n super()\r\n this.props = Object.assign(\r\n nProps(this.constructor.props),\r\n this.constructor.defaultProps\r\n )\r\n this.__elementId = id++\r\n this.data = this.constructor.data || {}\r\n }\r\n\r\n connectedCallback() {\r\n if (!this.constructor.pure) {\r\n let p = this.parentNode\r\n while (p && !this.store) {\r\n this.store = p.store\r\n p = p.parentNode || p.host\r\n }\r\n if (this.store) {\r\n this.store.instances.push(this)\r\n }\r\n }\r\n this.beforeInstall()\r\n !this._isInstalled && this.install()\r\n this.afterInstall()\r\n let shadowRoot\r\n if (!this.shadowRoot) {\r\n shadowRoot = this.attachShadow({\r\n mode: 'open'\r\n })\r\n } else {\r\n shadowRoot = this.shadowRoot\r\n let fc\r\n while ((fc = shadowRoot.firstChild)) {\r\n shadowRoot.removeChild(fc)\r\n }\r\n }\r\n\r\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\r\n !this._isInstalled && this.beforeRender()\r\n options.afterInstall && options.afterInstall(this)\r\n if (this.constructor.observe) {\r\n this.beforeObserve()\r\n proxyUpdate(this)\r\n this.observed()\r\n }\r\n this.host = diff(\r\n null,\r\n this.render(this.props, this.data, this.store),\r\n {},\r\n false,\r\n null,\r\n false\r\n )\r\n this.rendered()\r\n if (isArray(this.host)) {\r\n this.host.forEach(function(item) {\r\n shadowRoot.appendChild(item)\r\n })\r\n } else {\r\n shadowRoot.appendChild(this.host)\r\n }\r\n !this._isInstalled && this.installed()\r\n this._isInstalled = true\r\n }\r\n\r\n disconnectedCallback() {\r\n this.uninstall()\r\n this._isInstalled = false\r\n if (this.store) {\r\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\r\n if (this.store.instances[i] === this) {\r\n this.store.instances.splice(i, 1)\r\n break\r\n }\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n this._willUpdate = true\r\n this.beforeUpdate()\r\n this.beforeRender()\r\n this.host = diff(\r\n this.host,\r\n this.render(this.props, this.data, this.store),\r\n null,\r\n null,\r\n this.shadowRoot\r\n )\r\n this.afterUpdate()\r\n this.updated()\r\n this._willUpdate = false\r\n }\r\n\r\n fire(name, data) {\r\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\r\n }\r\n\r\n beforeInstall() {}\r\n\r\n install() {}\r\n\r\n afterInstall() {}\r\n\r\n installed() {}\r\n\r\n uninstall() {}\r\n\r\n beforeUpdate() {}\r\n\r\n afterUpdate() {} //deprecated, please use updated\r\n\r\n updated() {}\r\n\r\n beforeRender() {}\r\n\r\n rendered() {}\r\n\r\n receiveProps() {}\r\n\r\n beforeObserve() {}\r\n\r\n observed() {}\r\n}\r\n","import { diff } from './vdom/diff'\r\nimport JSONProxy from './proxy'\r\n\r\nexport function render(vnode, parent, store) {\r\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n if (store) {\r\n store.instances = []\r\n extendStoreUpate(store)\r\n let timeout = null\r\n let patchs = {}\r\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\r\n clearTimeout(timeout)\r\n if (patch.op === 'remove') {\r\n // fix arr splice\r\n const kv = getArrayPatch(patch.path, store)\r\n patchs[kv.k] = kv.v\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n } else {\r\n const key = fixPath(patch.path)\r\n patchs[key] = patch.value\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n }\r\n })\r\n parent.store = store\r\n }\r\n return diff(null, vnode, {}, false, parent, false)\r\n}\r\n\r\nfunction update(patch, store) {\r\n store.update(patch)\r\n}\r\n\r\nfunction extendStoreUpate(store) {\r\n store.update = function(patch) {\r\n const updateAll = matchGlobalData(this.globalData, patch)\r\n\r\n if (Object.keys(patch).length > 0) {\r\n this.instances.forEach(instance => {\r\n if (\r\n updateAll ||\r\n this.updateAll ||\r\n (instance.constructor.updatePath &&\r\n needUpdate(patch, instance.constructor.updatePath))\r\n ) {\r\n instance.update()\r\n }\r\n })\r\n this.onChange && this.onChange(patch)\r\n }\r\n }\r\n}\r\n\r\nexport function matchGlobalData(globalData, diffResult) {\r\n if (!globalData) return false\r\n for (let keyA in diffResult) {\r\n if (globalData.indexOf(keyA) > -1) {\r\n return true\r\n }\r\n for (let i = 0, len = globalData.length; i < len; i++) {\r\n if (includePath(keyA, globalData[i])) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function needUpdate(diffResult, updatePath) {\r\n for (let keyA in diffResult) {\r\n if (updatePath[keyA]) {\r\n return true\r\n }\r\n for (let keyB in updatePath) {\r\n if (includePath(keyA, keyB)) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nfunction includePath(pathA, pathB) {\r\n if (pathA.indexOf(pathB) === 0) {\r\n const next = pathA.substr(pathB.length, 1)\r\n if (next === '[' || next === '.') {\r\n return true\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function fixPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n arr.forEach((item, index) => {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n })\r\n return mpPath\r\n}\r\n\r\nfunction getArrayPatch(path, store) {\r\n const arr = path.replace('/', '').split('/')\r\n let current = store.data[arr[0]]\r\n for (let i = 1, len = arr.length; i < len - 1; i++) {\r\n current = current[arr[i]]\r\n }\r\n return { k: fixArrPath(path), v: current }\r\n}\r\n\r\nfunction fixArrPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n const len = arr.length\r\n arr.forEach((item, index) => {\r\n if (index < len - 1) {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n }\r\n })\r\n return mpPath\r\n}\r\n","import WeElement from './we-element'\r\nimport { cssToDom } from './util'\r\n\r\nconst OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n if (ctor.is === 'WeElement') {\r\n customElements.define(name, ctor)\r\n if (ctor.data && !ctor.pure) {\r\n ctor.updatePath = getUpdatePath(ctor.data)\r\n }\r\n } else {\r\n class Element extends WeElement {\r\n _useId = 0\r\n\r\n _useMap = {}\r\n\r\n render(props, data) {\r\n return ctor.call(this, props, data)\r\n }\r\n\r\n beforeRender() {\r\n this._useId = 0\r\n }\r\n\r\n useCss(css) {\r\n const style = this.shadowRoot.querySelector('style')\r\n style && this.shadowRoot.removeChild(style)\r\n this.shadowRoot.appendChild(cssToDom(css))\r\n }\r\n\r\n useData(data) {\r\n return this.use({ data: data })\r\n }\r\n\r\n use(option) {\r\n this._useId++\r\n const updater = newValue => {\r\n const item = this._useMap[updater.id]\r\n\r\n item.data = newValue\r\n\r\n this.update()\r\n item.effect && item.effect()\r\n }\r\n\r\n updater.id = this._useId\r\n if (!this._isInstalled) {\r\n this._useMap[this._useId] = option\r\n return [option.data, updater]\r\n }\r\n\r\n return [this._useMap[this._useId].data, updater]\r\n }\r\n\r\n installed() {\r\n this._isInstalled = true\r\n }\r\n }\r\n customElements.define(name, Element)\r\n }\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n const result = {}\r\n dataToPath(data, result)\r\n return result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n Object.keys(data).forEach(key => {\r\n result[key] = true\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n Object.keys(data).forEach(key => {\r\n result[path + '.' + key] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], path + '.' + key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], path + '.' + key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n data.forEach((item, index) => {\r\n result[path + '[' + index + ']'] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(item)\r\n if (type === OBJECTTYPE) {\r\n _objToPath(item, path + '[' + index + ']', result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(item, path + '[' + index + ']', result)\r\n }\r\n })\r\n}\r\n","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n return function(target) {\r\n target.pure = pure\r\n define(name, target)\r\n }\r\n}\r\n","import { extend } from './util'\r\nimport { h } from './h'\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n return h(\r\n vnode.nodeName,\r\n extend(extend({}, vnode.attributes), props),\r\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\r\n )\r\n}\r\n","export function getHost(ele) {\r\n let p = ele.parentNode\r\n while (p) {\r\n if (p.host) {\r\n return p.host\r\n } else {\r\n p = p.parentNode\r\n }\r\n }\r\n}\r\n","export function rpx(str) {\r\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\r\n return (window.innerWidth * Number(b)) / 750 + 'px'\r\n })\r\n}\r\n","import WeElement from './we-element'\r\n\r\nexport default class ModelView extends WeElement {\r\n static observe = true\r\n\r\n beforeInstall() {\r\n this.data = this.vm.data\r\n }\r\n\r\n observed() {\r\n this.vm.data = this.data\r\n }\r\n}\r\n","import { h, h as createElement } from './h'\r\nimport options from './options'\r\nimport WeElement from './we-element'\r\nimport { render } from './render'\r\nimport { define } from './define'\r\nimport { tag } from './tag'\r\nimport { observe } from './observe'\r\nimport { cloneElement } from './clone-element'\r\nimport { getHost } from './get-host'\r\nimport { rpx } from './rpx'\r\nimport { tick, nextTick } from './tick'\r\nimport ModelView from './model-view'\r\n\r\nconst Component = WeElement\r\n\r\nconst omi = {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n\r\noptions.root.Omi = omi\r\noptions.root.Omi.version = '5.0.2'\r\n\r\nexport default omi\r\n\r\nexport {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","Object","toString","call","nProps","result","keys","forEach","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","name","old","className","style","cssText","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","touchStart","touchEnd","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ret","ownerSVGElement","domLength","vnodeLength","maxLength","ele","idiff","appendChild","item","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","firstChild","fc","vchildren","a","nextSibling","is","noSlot","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","recollectNodeTree","unmountOnly","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","update","isWeElement","receiveProps","data","JSONPatcherProxy","deepClone","JSON","parse","stringify","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","get","path","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","set","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","Number","isInteger","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","root","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","splice","revoke","disableTraps","callbacks","nextTickCallback","tick","fn","scope","fireTick","nextItem","nextTick","proxyUpdate","timeout","JSONProxy","_willUpdate","info","id","WeElement","assign","defaultProps","__elementId","connectedCallback","pure","store","host","instances","beforeInstall","_isInstalled","install","afterInstall","shadowRoot","attachShadow","beforeRender","beforeObserve","observed","render","rendered","installed","disconnectedCallback","uninstall","beforeUpdate","afterUpdate","updated","fire","querySelector","patchs","patch","kv","getArrayPatch","k","v","fixPath","extendStoreUpate","updateAll","matchGlobalData","globalData","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","arr","split","index","isNaN","fixArrPath","OBJECTTYPE","ARRAYTYPE","define","ctor","getUpdatePath","Element","_useId","_useMap","useCss","useData","use","option","updater","effect","dataToPath","_objToPath","_arrayToPath","tag","cloneElement","slice","getHost","rpx","b","innerWidth","ModelView","vm","Component","omi","Omi","version"],"mappings":";;;;;;;;AAAA;AACA,SAAgBA,KAAT,GAAiB;;ACDxB,SAASC,SAAT,GAAqB;MAEjB,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;WAEEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAW;aACH,IAAP;KADF,EAJF;;SASKA,MAAP;;;;;;;AAOF,cAAe;SACN,IADM;QAEPD;CAFR;;ICpBMM,QAAQ,EAAd;AACA,IAAMC,iBAAiB,EAAvB;;AAEA,SAAgBC,CAAT,CAAWC,QAAX,EAAqBC,UAArB,EAAiC;MAClCC,WAAWJ,cAAf;MACEK,mBADF;MAEEC,cAFF;MAGEC,eAHF;MAIEC,UAJF;OAKKA,IAAIC,UAAUC,MAAnB,EAA2BF,MAAM,CAAjC,GAAsC;UAC9BG,IAAN,CAAWF,UAAUD,CAAV,CAAX;;MAEEL,cAAcA,WAAWC,QAAX,IAAuB,IAAzC,EAA+C;QACzC,CAACL,MAAMW,MAAX,EAAmBX,MAAMY,IAAN,CAAWR,WAAWC,QAAtB;WACZD,WAAWC,QAAlB;;SAEKL,MAAMW,MAAb,EAAqB;QACf,CAACJ,QAAQP,MAAMa,GAAN,EAAT,KAAyBN,MAAMM,GAAN,KAAcC,SAA3C,EAAsD;WAC/CL,IAA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aACH/P,EAAE+P,IAAT;KADF,MAEO;UACD/P,EAAE2D,UAAN;;;;;SCNUyQ,GAAT,CAAahT,GAAb,EAAkB;SAChBA,IAAIC,OAAJ,CAAY,0BAAZ,EAAwC,UAACyG,CAAD,EAAIuM,CAAJ,EAAU;WAC/CtV,OAAOuV,UAAP,GAAoBnI,OAAOkI,CAAP,CAArB,GAAkC,GAAlC,GAAwC,IAA/C;GADK,CAAP;;;;;;;;;ICCmBE;;;;;;;;;sBAGnBtE,yCAAgB;SACTlG,IAAL,GAAY,KAAKyK,EAAL,CAAQzK,IAApB;;;sBAGF0G,+BAAW;SACJ+D,EAAL,CAAQzK,IAAR,GAAe,KAAKA,IAApB;;;;EARmCyF;;AAAlB+E,UACZrG,UAAU;;ICUbuG,YAAYjF,SAAlB;;AAEA,IAAMkF,MAAM;UAAA;sBAAA;sBAAA;gBAAA;MAAA;kBAAA;kBAAA;gBAAA;kBAAA;4BAAA;kBAAA;UAAA;YAAA;oBAAA;;CAAZ;;AAkBAxU,QAAQ+M,IAAR,CAAa0H,GAAb,GAAmBD,GAAnB;AACAxU,QAAQ+M,IAAR,CAAa0H,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;;"} \ No newline at end of file +{"version":3,"file":"omi.esm.js","sources":["../src/vnode.js","../src/options.js","../src/h.js","../src/util.js","../src/constants.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/proxy.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/tag.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/model-view.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function() {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal()\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n p.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function npn(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n","// render modes\n\nexport const NO_RENDER = 0\nexport const SYNC_RENDER = 1\nexport const FORCE_RENDER = 2\nexport const ASYNC_RENDER = 3\n\nexport const ATTR_KEY = '__omiattr_'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import { extend } from '../util'\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchstart', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchstart', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value === 'string') {\n if (ns) {\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n } else {\n node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn, isArray } from '../util'\nimport { removeNode } from '../dom/index'\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n if (isArray(vnode)) {\n ret = []\n let parentNode = null\n if (isArray(dom)) {\n let domLength = dom.length\n let vnodeLength = vnode.length\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\n parentNode = dom[0].parentNode\n for (let i = 0; i < maxLength; i++) {\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\n ret.push(ele)\n if (i > domLength - 1) {\n parentNode.appendChild(ele)\n }\n }\n } else {\n vnode.forEach(function(item) {\n let ele = idiff(dom, item, context, mountAll, componentRoot)\n ret.push(ele)\n parent && parent.appendChild(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\n } else {\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, vnode.children)\n if (out.props) {\n out.props.children = vnode.children\n }\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, children) {\n let name\n let update = false\n let isWeElement = dom.update\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n if (isWeElement) {\n delete dom.props[name]\n update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n //diable when using store system?\n //!dom.store &&\n if (isWeElement && typeof attrs[name] === 'object') {\n dom.props[npn(name)] = attrs[name]\n update = true\n } else if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n if (isWeElement) {\n dom.props[npn(name)] = attrs[name]\n update = true\n }\n }\n }\n\n if (isWeElement && dom.parentNode) {\n if (update || children.length > 0) {\n dom.receiveProps(dom.props, dom.data)\n dom.update()\n }\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import JSONProxy from './proxy'\nimport { fireTick } from './tick'\n\nexport function observe(target) {\n target.observe = true\n}\n\nexport function proxyUpdate(ele) {\n let timeout = null\n ele.data = new JSONProxy(ele.data).observe(false, info => {\n if (\n ele._willUpdate ||\n (info.op === 'replace' && info.oldValue === info.value)\n ) {\n return\n }\n\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n })\n}\n","import { cssToDom, nProps, isArray } from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { proxyUpdate } from './observe'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n static is = 'WeElement'\n\n constructor() {\n super()\n this.props = Object.assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps\n )\n this.__elementId = id++\n this.data = this.constructor.data || {}\n }\n\n connectedCallback() {\n if (!this.constructor.pure) {\n let p = this.parentNode\n while (p && !this.store) {\n this.store = p.store\n p = p.parentNode || p.host\n }\n if (this.store) {\n this.store.instances.push(this)\n }\n }\n this.beforeInstall()\n !this._isInstalled && this.install()\n this.afterInstall()\n let shadowRoot\n if (!this.shadowRoot) {\n shadowRoot = this.attachShadow({\n mode: 'open'\n })\n } else {\n shadowRoot = this.shadowRoot\n let fc\n while ((fc = shadowRoot.firstChild)) {\n shadowRoot.removeChild(fc)\n }\n }\n\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\n !this._isInstalled && this.beforeRender()\n options.afterInstall && options.afterInstall(this)\n if (this.constructor.observe) {\n this.beforeObserve()\n proxyUpdate(this)\n this.observed()\n }\n this.host = diff(\n null,\n this.render(this.props, this.data, this.store),\n {},\n false,\n null,\n false\n )\n this.rendered()\n if (isArray(this.host)) {\n this.host.forEach(function(item) {\n shadowRoot.appendChild(item)\n })\n } else {\n shadowRoot.appendChild(this.host)\n }\n !this._isInstalled && this.installed()\n this._isInstalled = true\n }\n\n disconnectedCallback() {\n this.uninstall()\n this._isInstalled = false\n if (this.store) {\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\n if (this.store.instances[i] === this) {\n this.store.instances.splice(i, 1)\n break\n }\n }\n }\n }\n\n update() {\n this._willUpdate = true\n this.beforeUpdate()\n this.beforeRender()\n this.host = diff(\n this.host,\n this.render(this.props, this.data, this.store),\n null,\n null,\n this.shadowRoot\n )\n this.afterUpdate()\n this.updated()\n this._willUpdate = false\n }\n\n fire(name, data) {\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\n }\n\n beforeInstall() {}\n\n install() {}\n\n afterInstall() {}\n\n installed() {}\n\n uninstall() {}\n\n beforeUpdate() {}\n\n afterUpdate() {} //deprecated, please use updated\n\n updated() {}\n\n beforeRender() {}\n\n rendered() {}\n\n receiveProps() {}\n\n beforeObserve() {}\n\n observed() {}\n}\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n clearTimeout(timeout)\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n }\n })\n parent.store = store\n }\n return diff(null, vnode, {}, false, parent, false)\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import WeElement from './we-element'\nimport { cssToDom } from './util'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n if (ctor.data && !ctor.pure) {\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n } else {\n class Element extends WeElement {\n _useId = 0\n\n _useMap = {}\n\n _preCss = null\n\n render(props, data) {\n return ctor.call(this, props, data)\n }\n\n beforeRender() {\n this._useId = 0\n }\n\n useCss(css) {\n if (css === this._preCss) {\n return\n }\n this._preCss = css\n const style = this.shadowRoot.querySelector('style')\n style && this.shadowRoot.removeChild(style)\n this.shadowRoot.appendChild(cssToDom(css))\n }\n\n useData(data) {\n return this.use({ data: data })\n }\n\n use(option) {\n this._useId++\n const updater = newValue => {\n const item = this._useMap[updater.id]\n\n item.data = newValue\n\n this.update()\n item.effect && item.effect()\n }\n\n updater.id = this._useId\n if (!this._isInstalled) {\n this._useMap[this._useId] = option\n return [option.data, updater]\n }\n\n return [this._useMap[this._useId].data, updater]\n }\n\n installed() {\n this._isInstalled = true\n }\n }\n customElements.define(name, Element)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\n","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else {\n p = p.parentNode\n }\n }\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","import WeElement from './we-element'\n\nexport default class ModelView extends WeElement {\n static observe = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n\n observed() {\n this.vm.data = this.data\n }\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { observe } from './observe'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { tick, nextTick } from './tick'\nimport ModelView from './model-view'\n\nconst Component = WeElement\n\nconst omi = {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n\noptions.root.Omi = omi\noptions.root.Omi.version = '5.0.3'\n\nexport default omi\n\nexport {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","Object","toString","call","nProps","result","keys","forEach","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","name","old","className","style","cssText","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","touchStart","touchEnd","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ret","ownerSVGElement","domLength","vnodeLength","maxLength","ele","idiff","appendChild","item","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","firstChild","fc","vchildren","a","nextSibling","is","noSlot","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","recollectNodeTree","unmountOnly","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","update","isWeElement","receiveProps","data","JSONPatcherProxy","deepClone","JSON","parse","stringify","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","get","path","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","set","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","Number","isInteger","warn","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","root","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","splice","revoke","disableTraps","callbacks","nextTickCallback","tick","fn","scope","fireTick","nextItem","nextTick","proxyUpdate","timeout","JSONProxy","_willUpdate","info","id","WeElement","assign","defaultProps","__elementId","connectedCallback","pure","store","host","instances","beforeInstall","_isInstalled","install","afterInstall","shadowRoot","attachShadow","beforeRender","beforeObserve","observed","render","rendered","installed","disconnectedCallback","uninstall","beforeUpdate","afterUpdate","updated","fire","querySelector","patchs","patch","kv","getArrayPatch","k","v","fixPath","extendStoreUpate","updateAll","matchGlobalData","globalData","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","arr","split","index","isNaN","fixArrPath","OBJECTTYPE","ARRAYTYPE","define","ctor","getUpdatePath","Element","_useId","_useMap","_preCss","useCss","useData","use","option","updater","effect","dataToPath","_objToPath","_arrayToPath","tag","cloneElement","slice","getHost","rpx","b","innerWidth","ModelView","vm","Component","omi","Omi","version"],"mappings":";;;;;;;;AAAA;AACA,SAAgBA,KAAT,GAAiB;;ACDxB,SAASC,SAAT,GAAqB;MAEjB,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;WAEEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAW;aACH,IAAP;KADF,EAJF;;SASKA,MAAP;;;;;;;AAOF,cAAe;SACN,IADM;QAEPD;CAFR;;ICpBMM,QAAQ,EAAd;AACA,IAAMC,iBAAiB,EAAvB;;AAEA,SAAgBC,CAAT,CAAWC,QAAX,EAAqBC,UAArB,EAAiC;MAClCC,WAAWJ,cAAf;MACEK,mBADF;MAEEC,cAFF;MAGEC,eAHF;MAIEC,UAJF;OAKKA,IAAIC,UAAUC,MAAnB,EAA2BF,MAAM,CAAjC,GAAsC;UAC9BG,IAAN,CAAWF,UAAUD,CAAV,CAAX;;MAEEL,cAAcA,WAAWC,QAAX,IAAuB,IAAzC,EAA+C;QACzC,CAACL,MAAMW,MAAX,EAAmBX,MAAMY,IAAN,CAAWR,WAAWC,QAAtB;WACZD,WAAWC,QAAlB;;SAEKL,MAAMW,MAAb,EAAqB;QACf,CA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,CAAc/C,SAAd,EAAyB,CAAzB,CAAvB,GAAqDS,MAAMd,QAHtD,CAAP;;;SCVc+U,OAAT,CAAiBpN,GAAjB,EAAsB;MACvBhH,IAAIgH,IAAIrD,UAAZ;SACO3D,CAAP,EAAU;QACJA,EAAE+P,IAAN,EAAY;aACH/P,EAAE+P,IAAT;KADF,MAEO;UACD/P,EAAE2D,UAAN;;;;;SCNU0Q,GAAT,CAAajT,GAAb,EAAkB;SAChBA,IAAIC,OAAJ,CAAY,0BAAZ,EAAwC,UAACyG,CAAD,EAAIwM,CAAJ,EAAU;WAC/CvV,OAAOwV,UAAP,GAAoBpI,OAAOmI,CAAP,CAArB,GAAkC,GAAlC,GAAwC,IAA/C;GADK,CAAP;;;;;;;;;ICCmBE;;;;;;;;;sBAGnBvE,yCAAgB;SACTlG,IAAL,GAAY,KAAK0K,EAAL,CAAQ1K,IAApB;;;sBAGF0G,+BAAW;SACJgE,EAAL,CAAQ1K,IAAR,GAAe,KAAKA,IAApB;;;;EARmCyF;;AAAlBgF,UACZtG,UAAU;;ICUbwG,YAAYlF,SAAlB;;AAEA,IAAMmF,MAAM;UAAA;sBAAA;sBAAA;gBAAA;MAAA;kBAAA;kBAAA;gBAAA;kBAAA;4BAAA;kBAAA;UAAA;YAAA;oBAAA;;CAAZ;;AAkBAzU,QAAQ+M,IAAR,CAAa2H,GAAb,GAAmBD,GAAnB;AACAzU,QAAQ+M,IAAR,CAAa2H,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;;"} \ No newline at end of file diff --git a/packages/omi/dist/omi.js b/packages/omi/dist/omi.js index a13d021e8..707769cff 100644 --- a/packages/omi/dist/omi.js +++ b/packages/omi/dist/omi.js @@ -442,7 +442,7 @@ _classCallCheck$1(this, Element); for (var _len = arguments.length, args = Array(_len), key = 0; key < _len; key++) args[key] = arguments[key]; return _ret = (_temp = _this = _possibleConstructorReturn$1(this, _WeElement.call.apply(_WeElement, [ this ].concat(args))), - _this.C = 0, _this.D = {}, _temp), _possibleConstructorReturn$1(_this, _ret); + _this.C = 0, _this.D = {}, _this.K = null, _temp), _possibleConstructorReturn$1(_this, _ret); } _inherits$1(Element, _WeElement); Element.prototype.render = function(props, data) { @@ -452,9 +452,12 @@ this.C = 0; }; Element.prototype.useCss = function(css) { - var style = this.shadowRoot.querySelector('style'); - style && this.shadowRoot.removeChild(style); - this.shadowRoot.appendChild(cssToDom(css)); + if (css !== this.K) { + this.K = css; + var style = this.shadowRoot.querySelector('style'); + style && this.shadowRoot.removeChild(style); + this.shadowRoot.appendChild(cssToDom(css)); + } }; Element.prototype.useData = function(data) { return this.use({ @@ -893,7 +896,7 @@ ModelView: ModelView }; options.root.Omi = omi; - options.root.Omi.version = '5.0.2'; + options.root.Omi.version = '5.0.3'; if ('undefined' != typeof module) module.exports = omi; else self.Omi = omi; }(); //# sourceMappingURL=omi.js.map \ No newline at end of file diff --git a/packages/omi/dist/omi.js.map b/packages/omi/dist/omi.js.map index f897fd27b..55e20bfca 100644 --- a/packages/omi/dist/omi.js.map +++ b/packages/omi/dist/omi.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/options.js","../src/proxy.js","../src/model-view.js","../src/omi.js"],"names":["VNode","h","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","key","options","vnode","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","isArray","Object","prototype","toString","call","nProps","result","keys","forEach","isSameNodeType","hydrating","_componentConstructor","createNode","removeNode","name","isSvg","className","old","style","cssText","IS_NON_DIMENSIONAL","test","useCapture","substring","toLowerCase","addEventListener","touchStart","touchEnd","eventProxy","removeEventListener","e","removeAttribute","ns","removeAttributeNS","setAttribute","this","___touchX","_listeners","type","pageX","___touchY","touches","pageY","Math","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","isSvgMode","parent","ownerSVGElement","dom","ret","vnodeLength","parentNode","domLength","context","mountAll","componentRoot","maxLength","appendChild","ele","idiff","item","out","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","vchildren","firstChild","fc","a","splitText","nextSibling","constructor","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","min","len","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","_component","__key","trim","isHydrating","c","f","unmountOnly","removeChildren","update","attrs","isWeElement","setAccessor","receiveProps","data","callbacks","fn","scope","tick","nextItem","nextTick","nextTickCallback","target","observe","JSONPatcherProxy","info","clearTimeout","_willUpdate","timeout","setTimeout","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","HTMLElement","WeElement","extendStoreUpate","store","instances","patch","getArrayPatch","JSONProxy","path","v","patchs","diff","_this","updateAll","globalData","matchGlobalData","updatePath","needUpdate","onChange","diffResult","keyA","indexOf","keyB","includePath","pathA","pathB","next","substr","fixPath","mpPath","arr","split","index","Number","fixArrPath","_classCallCheck$1","_possibleConstructorReturn$1","OBJECTTYPE","getUpdatePath","ctor","Element","_WeElement","_len","args","Array","render","beforeRender","_useId","useCss","shadowRoot","querySelector","use","_this2","updater","newValue","_useMap","id","effect","installed","_isInstalled","customElements","define","dataToPath","_objToPath","_arrayToPath","ARRAYTYPE","cloneElement","rpx","b","_inherits$2","subClass","superClass","create","enumerable","writable","configurable","setPrototypeOf","__proto__","root","global","window","Reflect","hasOwnProperty","BuiltInHTMLElement","construct","Promise","resolve","then","bind","diffLevel","deepClone","JSON","escapePathComponent","pathComponents","parentAndPath","parenthoodMap","get","parentPath","newValueOriginalObject","revokableInstance","inherited","proxifiedObjectsMap","has","set","operation","destinationPropKey","op","oldValue","delete","disableTrapsForProxy","console","warn","reflectionResult","revokableProxyInstance","defaultCallback","resume","patches","userCallback","pause","isObserving","showDetachedWarning","cachedProxy","receiver","deleteProperty","deleteTrap","Proxy","revocable","revocableInstance","trapsInstance","traps","originalObject","_proxifyObjectTreeRecursively","proxifyObjectTree","isProxifyingTreeNow","proxifiedObject","targetObject","message","propKey","record","callback","generate","isRecording","revoke","el","disableTraps","assign","defaultProps","connectedCallback","pure","host","beforeInstall","afterInstall","attachShadow","mode","removeChild","proxyUpdate","beforeObserve","observed","disconnectedCallback","uninstall","splice","beforeUpdate","updated","fire","install","afterUpdate","rendered","Component","ModelView","tag","getHost","omi","Omi","version","module","exports"],"mappings":";;IACO,SAASA;ICKT,SAASC,EAAEC,UAAUC;QAC1B,IACEC,YACAC,OACAC,QACAC,GAJEC,WAAWC;QAKf,KAAKF,IAAIG,UAAUC,QAAQJ,MAAM,KAC/BK,MAAMC,KAAKH,UAAUH;QAEvB,IAAIJ,cAAqC,QAAvBA,WAAWK,UAAkB;YAC7C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEpB,OAAOI,MAAMD,QACX,KAAKN,QAAQO,MAAME,eAAwBC,MAAdV,MAAMS,KACjC,KAAKP,IAAIF,MAAMM,QAAQJ,OAAOK,MAAMC,KAAKR,MAAME,UAC1C;YACL,IAAqB,oBAAVF,OAAqBA,QAAQ;YAExC,IAAKC,SAA6B,qBAAbJ,UACnB,IAAa,QAATG,OAAeA,QAAQ,SACtB,IAAqB,mBAAVA,OAAoBA,QAAQW,OAAOX,aAC9C,IAAqB,mBAAVA,OAAoBC,UAAS;YAG/C,IAAIA,UAAUF,YACZI,SAASA,SAASG,SAAS,MAAMN,YAC5B,IAAIG,aAAaC,gBACtBD,aAAYH,cAEZG,SAASK,KAAKR;YAGhBD,aAAaE;;QAIjB,IAAIW,IAAI,IAAIjB;QACZiB,EAAEf,WAAWA;QACbe,EAAET,WAAWA;QACbS,EAAEd,aAA2B,QAAdA,kBAAqBY,IAAYZ;QAChDc,EAAEC,M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EClK,UAAAnI,UAAAsS,UAAA;4BAEDd,eAAAA;4BAEAc,YAAAA;4BAEAb,YAAAA;4BAEA7F,eAAAA;4BAEAqG,cAAAA;4BAEAE,UAAAA;4BAEAI,eAAAA;4BAEAH,WAAAA;4BAEApH,eAAAA;4BAEAwH,gBAAAA;4BAEA9L,WAAAA;;;;;;;;;;;;;;;;QQ1HE,OAAKC;MACNwB;;IAIA,IAAAsK,YAAAtK;;QAToCA,KAAAA;;QAAlBuK,WACZtL;;QCUT7J,GAAMkV;;QAENhU,SAAYA;QACVkU,QADU5G;QAEV5D,SAAAA;QACAsK,cAAAA;QACA1H,SAAAA;QACAxN,KALU8O;QAMVtN,MAAAA;QACAN,UAAAA;QACAsN,WAAAA;;IAGA6G,QAAAA,KAAAA,MAXUC;IAYVxG,QAAAA,KAZUyG,IAAAC,UAAA;IAcV9L,IAdU,sBAcVA,QAdU+L,OAAAC,UAAAJ,UAAA7K,KAAA8K,MAAAD","file":"omi.js","sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","import { VNode } from './vnode'\r\nimport options from './options'\r\n\r\nconst stack = []\r\nconst EMPTY_CHILDREN = []\r\n\r\nexport function h(nodeName, attributes) {\r\n let children = EMPTY_CHILDREN,\r\n lastSimple,\r\n child,\r\n simple,\r\n i\r\n for (i = arguments.length; i-- > 2; ) {\r\n stack.push(arguments[i])\r\n }\r\n if (attributes && attributes.children != null) {\r\n if (!stack.length) stack.push(attributes.children)\r\n delete attributes.children\r\n }\r\n while (stack.length) {\r\n if ((child = stack.pop()) && child.pop !== undefined) {\r\n for (i = child.length; i--; ) stack.push(child[i])\r\n } else {\r\n if (typeof child === 'boolean') child = null\r\n\r\n if ((simple = typeof nodeName !== 'function')) {\r\n if (child == null) child = ''\r\n else if (typeof child === 'number') child = String(child)\r\n else if (typeof child !== 'string') simple = false\r\n }\r\n\r\n if (simple && lastSimple) {\r\n children[children.length - 1] += child\r\n } else if (children === EMPTY_CHILDREN) {\r\n children = [child]\r\n } else {\r\n children.push(child)\r\n }\r\n\r\n lastSimple = simple\r\n }\r\n }\r\n\r\n let p = new VNode()\r\n p.nodeName = nodeName\r\n p.children = children\r\n p.attributes = attributes == null ? undefined : attributes\r\n p.key = attributes == null ? undefined : attributes.key\r\n\r\n // if a \"vnode hook\" is defined, pass every created VNode to it\r\n if (options.vnode !== undefined) options.vnode(p)\r\n\r\n return p\r\n}\r\n","/**\r\n * @license\r\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n/**\r\n * This shim allows elements written in, or compiled to, ES5 to work on native\r\n * implementations of Custom Elements v1. It sets new.target to the value of\r\n * this.constructor so that the native HTMLElement constructor can access the\r\n * current under-construction element's definition.\r\n */\r\n;(function() {\r\n if (\r\n // No Reflect, no classes, no need for shim because native custom elements\r\n // require ES2015 classes or Reflect.\r\n window.Reflect === undefined ||\r\n window.customElements === undefined ||\r\n // The webcomponentsjs custom elements polyfill doesn't require\r\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\r\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\r\n ) {\r\n return\r\n }\r\n const BuiltInHTMLElement = HTMLElement\r\n window.HTMLElement = function HTMLElement() {\r\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n }\r\n HTMLElement.prototype = BuiltInHTMLElement.prototype\r\n HTMLElement.prototype.constructor = HTMLElement\r\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\nexport function cssToDom(css) {\r\n const node = document.createElement('style')\r\n node.textContent = css\r\n return node\r\n}\r\n\r\nexport function npn(str) {\r\n return str.replace(/-(\\w)/g, ($, $1) => {\r\n return $1.toUpperCase()\r\n })\r\n}\r\n\r\nexport function extend(obj, props) {\r\n for (let i in props) obj[i] = props[i]\r\n return obj\r\n}\r\n\r\n/** Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} [ref=null]\r\n * @param {any} [value]\r\n */\r\nexport function applyRef(ref, value) {\r\n if (ref != null) {\r\n if (typeof ref == 'function') ref(value)\r\n else ref.current = value\r\n }\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n * @type {(callback: function) => void}\r\n */\r\nexport const defer =\r\n typeof Promise == 'function'\r\n ? Promise.resolve().then.bind(Promise.resolve())\r\n : setTimeout\r\n\r\nexport function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props) {\r\n if (!props || isArray(props)) return {}\r\n const result = {}\r\n Object.keys(props).forEach(key => {\r\n result[key] = props[key].value\r\n })\r\n return result\r\n}\r\n","import { extend } from '../util'\r\n\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n return node.splitText !== undefined\r\n }\r\n if (typeof vnode.nodeName === 'string') {\r\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n }\r\n return hydrating || node._componentConstructor === vnode.nodeName\r\n}\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n return (\r\n node.normalizedNodeName === nodeName ||\r\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\r\n )\r\n}\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n let props = extend({}, vnode.attributes)\r\n props.children = vnode.children\r\n\r\n let defaultProps = vnode.nodeName.defaultProps\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i]\r\n }\r\n }\r\n }\r\n\r\n return props\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants'\r\nimport { applyRef } from '../util'\r\nimport options from '../options'\r\n\r\n/**\r\n * Create an element with the given nodeName.\r\n * @param {string} nodeName The DOM node to create\r\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\r\n * namespace.\r\n * @returns {Element} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n /** @type {Element} */\r\n let node = isSvg\r\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\r\n : document.createElement(nodeName)\r\n node.normalizedNodeName = nodeName\r\n return node\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n let parentNode = node.parentNode\r\n if (parentNode) parentNode.removeChild(node)\r\n}\r\n\r\n/**\r\n * Set a named attribute on the given Node, with special behavior for some names\r\n * and event handlers. If `value` is `null`, the attribute/handler will be\r\n * removed.\r\n * @param {Element} node An element to mutate\r\n * @param {string} name The name/key to set, such as an event or attribute name\r\n * @param {*} old The last value that was set for this name/node pair\r\n * @param {*} value An attribute value, such as a function to be used as an\r\n * event handler\r\n * @param {boolean} isSvg Are we currently diffing inside an svg?\r\n * @private\r\n */\r\nexport function setAccessor(node, name, old, value, isSvg) {\r\n if (name === 'className') name = 'class'\r\n\r\n if (name === 'key') {\r\n // ignore\r\n } else if (name === 'ref') {\r\n applyRef(old, null)\r\n applyRef(value, node)\r\n } else if (name === 'class' && !isSvg) {\r\n node.className = value || ''\r\n } else if (name === 'style') {\r\n if (!value || typeof value === 'string' || typeof old === 'string') {\r\n node.style.cssText = value || ''\r\n }\r\n if (value && typeof value === 'object') {\r\n if (typeof old !== 'string') {\r\n for (let i in old) if (!(i in value)) node.style[i] = ''\r\n }\r\n for (let i in value) {\r\n node.style[i] =\r\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\r\n ? value[i] + 'px'\r\n : value[i]\r\n }\r\n }\r\n } else if (name === 'dangerouslySetInnerHTML') {\r\n if (value) node.innerHTML = value.__html || ''\r\n } else if (name[0] == 'o' && name[1] == 'n') {\r\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\r\n name = name.toLowerCase().substring(2)\r\n if (value) {\r\n if (!old) {\r\n node.addEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.addEventListener('touchstart', touchStart, useCapture)\r\n node.addEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n } else {\r\n node.removeEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.removeEventListener('touchstart', touchStart, useCapture)\r\n node.removeEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n ;(node._listeners || (node._listeners = {}))[name] = value\r\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\r\n // Attempt to set a DOM property to the given value.\r\n // IE & FF throw for certain property-value combinations.\r\n try {\r\n node[name] = value == null ? '' : value\r\n } catch (e) {}\r\n if ((value == null || value === false) && name != 'spellcheck')\r\n node.removeAttribute(name)\r\n } else {\r\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\r\n // spellcheck is treated differently than all other boolean values and\r\n // should not be removed when the value is `false`. See:\r\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n if (value == null || value === false) {\r\n if (ns)\r\n node.removeAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase()\r\n )\r\n else node.removeAttribute(name)\r\n } else if (typeof value === 'string') {\r\n if (ns) {\r\n node.setAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase(),\r\n value\r\n )\r\n } else {\r\n node.setAttribute(name, value)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n return this._listeners[e.type]((options.event && options.event(e)) || e)\r\n}\r\n\r\nfunction touchStart(e) {\r\n this.___touchX = e.touches[0].pageX\r\n this.___touchY = e.touches[0].pageY\r\n this.___scrollTop = document.body.scrollTop\r\n}\r\n\r\nfunction touchEnd(e) {\r\n if (\r\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\r\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\r\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\r\n ) {\r\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\r\n }\r\n}\r\n","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn, isArray } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n let ret\r\n if (!diffLevel++) {\r\n // when first starting the diff, check if we're diffing an SVG or within an SVG\r\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\r\n\r\n // hydration is indicated by the existing element to be diffed not having a prop cache\r\n hydrating = dom != null && !(ATTR_KEY in dom)\r\n }\r\n if (isArray(vnode)) {\r\n ret = []\r\n let parentNode = null\r\n if (isArray(dom)) {\r\n let domLength = dom.length\r\n let vnodeLength = vnode.length\r\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\r\n parentNode = dom[0].parentNode\r\n for (let i = 0; i < maxLength; i++) {\r\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\r\n ret.push(ele)\r\n if (i > domLength - 1) {\r\n parentNode.appendChild(ele)\r\n }\r\n }\r\n } else {\r\n vnode.forEach(function(item) {\r\n let ele = idiff(dom, item, context, mountAll, componentRoot)\r\n ret.push(ele)\r\n parent && parent.appendChild(ele)\r\n })\r\n }\r\n } else {\r\n if (isArray(dom)) {\r\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\r\n } else {\r\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n }\r\n // append the element if its a new parent\r\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\r\n }\r\n\r\n // diffLevel being reduced to 0 means we're exiting the diff\r\n if (!--diffLevel) {\r\n hydrating = false\r\n // invoke queued componentDidMount lifecycle methods\r\n }\r\n\r\n return ret\r\n}\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n if (dom && vnode && dom.props) {\r\n dom.props.children = vnode.children\r\n }\r\n let out = dom,\r\n prevSvgMode = isSvgMode\r\n\r\n // empty values (null, undefined, booleans) render as empty Text nodes\r\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\r\n\r\n // Fast case: Strings & Numbers create/update Text nodes.\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n // update if it's already a Text node:\r\n if (\r\n dom &&\r\n dom.splitText !== undefined &&\r\n dom.parentNode &&\r\n (!dom._component || componentRoot)\r\n ) {\r\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n if (dom.nodeValue != vnode) {\r\n dom.nodeValue = vnode\r\n }\r\n } else {\r\n // it wasn't a Text node: replace it with one and recycle the old Element\r\n out = document.createTextNode(vnode)\r\n if (dom) {\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n out[ATTR_KEY] = true\r\n\r\n return out\r\n }\r\n\r\n // If the VNode represents a Component, perform a component diff:\r\n let vnodeName = vnode.nodeName\r\n\r\n // Tracks entering and exiting SVG namespace when descending through the tree.\r\n isSvgMode =\r\n vnodeName === 'svg'\r\n ? true\r\n : vnodeName === 'foreignObject'\r\n ? false\r\n : isSvgMode\r\n\r\n // If there's no existing element or it's the wrong type, create a new one:\r\n vnodeName = String(vnodeName)\r\n if (!dom || !isNamedNode(dom, vnodeName)) {\r\n out = createNode(vnodeName, isSvgMode)\r\n\r\n if (dom) {\r\n // move children into the replacement node\r\n while (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n // if the previous Element was mounted into the DOM, replace it inline\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n // recycle the old element (skips non-Element node types)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n let fc = out.firstChild,\r\n props = out[ATTR_KEY],\r\n vchildren = vnode.children\r\n\r\n if (props == null) {\r\n props = out[ATTR_KEY] = {}\r\n for (let a = out.attributes, i = a.length; i--; )\r\n props[a[i].name] = a[i].value\r\n }\r\n\r\n // Optimization: fast-path for elements containing a single TextNode:\r\n if (\r\n !hydrating &&\r\n vchildren &&\r\n vchildren.length === 1 &&\r\n typeof vchildren[0] === 'string' &&\r\n fc != null &&\r\n fc.splitText !== undefined &&\r\n fc.nextSibling == null\r\n ) {\r\n if (fc.nodeValue != vchildren[0]) {\r\n fc.nodeValue = vchildren[0]\r\n }\r\n }\r\n // otherwise, if there are existing or new children, diff them:\r\n else if ((vchildren && vchildren.length) || fc != null) {\r\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\r\n innerDiffNode(\r\n out,\r\n vchildren,\r\n context,\r\n mountAll,\r\n hydrating || props.dangerouslySetInnerHTML != null\r\n )\r\n }\r\n }\r\n\r\n // Apply attributes/props from VNode to the DOM Element:\r\n diffAttributes(out, vnode.attributes, props, vnode.children)\r\n if (out.props) {\r\n out.props.children = vnode.children\r\n }\r\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n isSvgMode = prevSvgMode\r\n\r\n return out\r\n}\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n let originalChildren = dom.childNodes,\r\n children = [],\r\n keyed = {},\r\n keyedLen = 0,\r\n min = 0,\r\n len = originalChildren.length,\r\n childrenLen = 0,\r\n vlen = vchildren ? vchildren.length : 0,\r\n j,\r\n c,\r\n f,\r\n vchild,\r\n child\r\n\r\n // Build up a map of keyed children and an Array of unkeyed children:\r\n if (len !== 0) {\r\n for (let i = 0; i < len; i++) {\r\n let child = originalChildren[i],\r\n props = child[ATTR_KEY],\r\n key =\r\n vlen && props\r\n ? child._component\r\n ? child._component.__key\r\n : props.key\r\n : null\r\n if (key != null) {\r\n keyedLen++\r\n keyed[key] = child\r\n } else if (\r\n props ||\r\n (child.splitText !== undefined\r\n ? isHydrating\r\n ? child.nodeValue.trim()\r\n : true\r\n : isHydrating)\r\n ) {\r\n children[childrenLen++] = child\r\n }\r\n }\r\n }\r\n\r\n if (vlen !== 0) {\r\n for (let i = 0; i < vlen; i++) {\r\n vchild = vchildren[i]\r\n child = null\r\n\r\n // attempt to find a node based on key matching\r\n let key = vchild.key\r\n if (key != null) {\r\n if (keyedLen && keyed[key] !== undefined) {\r\n child = keyed[key]\r\n keyed[key] = undefined\r\n keyedLen--\r\n }\r\n }\r\n // attempt to pluck a node of the same type from the existing children\r\n else if (!child && min < childrenLen) {\r\n for (j = min; j < childrenLen; j++) {\r\n if (\r\n children[j] !== undefined &&\r\n isSameNodeType((c = children[j]), vchild, isHydrating)\r\n ) {\r\n child = c\r\n children[j] = undefined\r\n if (j === childrenLen - 1) childrenLen--\r\n if (j === min) min++\r\n break\r\n }\r\n }\r\n }\r\n\r\n // morph the matched/found/created DOM child to match vchild (deep)\r\n child = idiff(child, vchild, context, mountAll)\r\n\r\n f = originalChildren[i]\r\n if (child && child !== dom && child !== f) {\r\n if (f == null) {\r\n dom.appendChild(child)\r\n } else if (child === f.nextSibling) {\r\n removeNode(f)\r\n } else {\r\n dom.insertBefore(child, f)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // remove unused keyed children:\r\n if (keyedLen) {\r\n for (let i in keyed)\r\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\r\n }\r\n\r\n // remove orphaned unkeyed children:\r\n while (min <= childrenLen) {\r\n if ((child = children[childrenLen--]) !== undefined)\r\n recollectNodeTree(child, false)\r\n }\r\n}\r\n\r\n/** Recursively recycle (or just unmount) a node and its descendants.\r\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\r\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\r\n */\r\nexport function recollectNodeTree(node, unmountOnly) {\r\n // If the node's VNode had a ref function, invoke it with null here.\r\n // (this is part of the React spec, and smart for unsetting references)\r\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\r\n\r\n if (unmountOnly === false || node[ATTR_KEY] == null) {\r\n removeNode(node)\r\n }\r\n\r\n removeChildren(node)\r\n}\r\n\r\n/** Recollect/unmount all children.\r\n *\t- we use .lastChild here because it causes less reflow than .firstChild\r\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\r\n */\r\nexport function removeChildren(node) {\r\n node = node.lastChild\r\n while (node) {\r\n let next = node.previousSibling\r\n recollectNodeTree(node, true)\r\n node = next\r\n }\r\n}\r\n\r\n/** Apply differences in attributes from a VNode to the given DOM Element.\r\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\r\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\r\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\r\n */\r\nfunction diffAttributes(dom, attrs, old, children) {\r\n let name\r\n let update = false\r\n let isWeElement = dom.update\r\n // remove attributes no longer present on the vnode by setting them to undefined\r\n for (name in old) {\r\n if (!(attrs && attrs[name] != null) && old[name] != null) {\r\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\r\n if (isWeElement) {\r\n delete dom.props[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n // add new & update changed attributes\r\n for (name in attrs) {\r\n //diable when using store system?\r\n //!dom.store &&\r\n if (isWeElement && typeof attrs[name] === 'object') {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n } else if (\r\n name !== 'children' &&\r\n name !== 'innerHTML' &&\r\n (!(name in old) ||\r\n attrs[name] !==\r\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\r\n ) {\r\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\r\n if (isWeElement) {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n if (isWeElement && dom.parentNode) {\r\n if (update || children.length > 0) {\r\n dom.receiveProps(dom.props, dom.data)\r\n dom.update()\r\n }\r\n }\r\n}\r\n","const callbacks = []\r\nconst nextTickCallback = []\r\n\r\nexport function tick(fn, scope) {\r\n callbacks.push({ fn, scope })\r\n}\r\n\r\nexport function fireTick() {\r\n callbacks.forEach(item => {\r\n item.fn.call(item.scope)\r\n })\r\n\r\n nextTickCallback.forEach(nextItem => {\r\n nextItem.fn.call(nextItem.scope)\r\n })\r\n nextTickCallback.length = 0\r\n}\r\n\r\nexport function nextTick(fn, scope) {\r\n nextTickCallback.push({ fn, scope })\r\n}\r\n","import JSONProxy from './proxy'\r\nimport { fireTick } from './tick'\r\n\r\nexport function observe(target) {\r\n target.observe = true\r\n}\r\n\r\nexport function proxyUpdate(ele) {\r\n let timeout = null\r\n ele.data = new JSONProxy(ele.data).observe(false, info => {\r\n if (\r\n ele._willUpdate ||\r\n (info.op === 'replace' && info.oldValue === info.value)\r\n ) {\r\n return\r\n }\r\n\r\n clearTimeout(timeout)\r\n\r\n timeout = setTimeout(() => {\r\n ele.update()\r\n fireTick()\r\n }, 0)\r\n })\r\n}\r\n","import { cssToDom, nProps, isArray } from './util'\r\nimport { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport { proxyUpdate } from './observe'\r\n\r\nlet id = 0\r\n\r\nexport default class WeElement extends HTMLElement {\r\n static is = 'WeElement'\r\n\r\n constructor() {\r\n super()\r\n this.props = Object.assign(\r\n nProps(this.constructor.props),\r\n this.constructor.defaultProps\r\n )\r\n this.__elementId = id++\r\n this.data = this.constructor.data || {}\r\n }\r\n\r\n connectedCallback() {\r\n if (!this.constructor.pure) {\r\n let p = this.parentNode\r\n while (p && !this.store) {\r\n this.store = p.store\r\n p = p.parentNode || p.host\r\n }\r\n if (this.store) {\r\n this.store.instances.push(this)\r\n }\r\n }\r\n this.beforeInstall()\r\n !this._isInstalled && this.install()\r\n this.afterInstall()\r\n let shadowRoot\r\n if (!this.shadowRoot) {\r\n shadowRoot = this.attachShadow({\r\n mode: 'open'\r\n })\r\n } else {\r\n shadowRoot = this.shadowRoot\r\n let fc\r\n while ((fc = shadowRoot.firstChild)) {\r\n shadowRoot.removeChild(fc)\r\n }\r\n }\r\n\r\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\r\n !this._isInstalled && this.beforeRender()\r\n options.afterInstall && options.afterInstall(this)\r\n if (this.constructor.observe) {\r\n this.beforeObserve()\r\n proxyUpdate(this)\r\n this.observed()\r\n }\r\n this.host = diff(\r\n null,\r\n this.render(this.props, this.data, this.store),\r\n {},\r\n false,\r\n null,\r\n false\r\n )\r\n this.rendered()\r\n if (isArray(this.host)) {\r\n this.host.forEach(function(item) {\r\n shadowRoot.appendChild(item)\r\n })\r\n } else {\r\n shadowRoot.appendChild(this.host)\r\n }\r\n !this._isInstalled && this.installed()\r\n this._isInstalled = true\r\n }\r\n\r\n disconnectedCallback() {\r\n this.uninstall()\r\n this._isInstalled = false\r\n if (this.store) {\r\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\r\n if (this.store.instances[i] === this) {\r\n this.store.instances.splice(i, 1)\r\n break\r\n }\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n this._willUpdate = true\r\n this.beforeUpdate()\r\n this.beforeRender()\r\n this.host = diff(\r\n this.host,\r\n this.render(this.props, this.data, this.store),\r\n null,\r\n null,\r\n this.shadowRoot\r\n )\r\n this.afterUpdate()\r\n this.updated()\r\n this._willUpdate = false\r\n }\r\n\r\n fire(name, data) {\r\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\r\n }\r\n\r\n beforeInstall() {}\r\n\r\n install() {}\r\n\r\n afterInstall() {}\r\n\r\n installed() {}\r\n\r\n uninstall() {}\r\n\r\n beforeUpdate() {}\r\n\r\n afterUpdate() {} //deprecated, please use updated\r\n\r\n updated() {}\r\n\r\n beforeRender() {}\r\n\r\n rendered() {}\r\n\r\n receiveProps() {}\r\n\r\n beforeObserve() {}\r\n\r\n observed() {}\r\n}\r\n","import { diff } from './vdom/diff'\r\nimport JSONProxy from './proxy'\r\n\r\nexport function render(vnode, parent, store) {\r\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n if (store) {\r\n store.instances = []\r\n extendStoreUpate(store)\r\n let timeout = null\r\n let patchs = {}\r\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\r\n clearTimeout(timeout)\r\n if (patch.op === 'remove') {\r\n // fix arr splice\r\n const kv = getArrayPatch(patch.path, store)\r\n patchs[kv.k] = kv.v\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n } else {\r\n const key = fixPath(patch.path)\r\n patchs[key] = patch.value\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n }\r\n })\r\n parent.store = store\r\n }\r\n return diff(null, vnode, {}, false, parent, false)\r\n}\r\n\r\nfunction update(patch, store) {\r\n store.update(patch)\r\n}\r\n\r\nfunction extendStoreUpate(store) {\r\n store.update = function(patch) {\r\n const updateAll = matchGlobalData(this.globalData, patch)\r\n\r\n if (Object.keys(patch).length > 0) {\r\n this.instances.forEach(instance => {\r\n if (\r\n updateAll ||\r\n this.updateAll ||\r\n (instance.constructor.updatePath &&\r\n needUpdate(patch, instance.constructor.updatePath))\r\n ) {\r\n instance.update()\r\n }\r\n })\r\n this.onChange && this.onChange(patch)\r\n }\r\n }\r\n}\r\n\r\nexport function matchGlobalData(globalData, diffResult) {\r\n if (!globalData) return false\r\n for (let keyA in diffResult) {\r\n if (globalData.indexOf(keyA) > -1) {\r\n return true\r\n }\r\n for (let i = 0, len = globalData.length; i < len; i++) {\r\n if (includePath(keyA, globalData[i])) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function needUpdate(diffResult, updatePath) {\r\n for (let keyA in diffResult) {\r\n if (updatePath[keyA]) {\r\n return true\r\n }\r\n for (let keyB in updatePath) {\r\n if (includePath(keyA, keyB)) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nfunction includePath(pathA, pathB) {\r\n if (pathA.indexOf(pathB) === 0) {\r\n const next = pathA.substr(pathB.length, 1)\r\n if (next === '[' || next === '.') {\r\n return true\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function fixPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n arr.forEach((item, index) => {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n })\r\n return mpPath\r\n}\r\n\r\nfunction getArrayPatch(path, store) {\r\n const arr = path.replace('/', '').split('/')\r\n let current = store.data[arr[0]]\r\n for (let i = 1, len = arr.length; i < len - 1; i++) {\r\n current = current[arr[i]]\r\n }\r\n return { k: fixArrPath(path), v: current }\r\n}\r\n\r\nfunction fixArrPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n const len = arr.length\r\n arr.forEach((item, index) => {\r\n if (index < len - 1) {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n }\r\n })\r\n return mpPath\r\n}\r\n","import WeElement from './we-element'\r\nimport { cssToDom } from './util'\r\n\r\nconst OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n if (ctor.is === 'WeElement') {\r\n customElements.define(name, ctor)\r\n if (ctor.data && !ctor.pure) {\r\n ctor.updatePath = getUpdatePath(ctor.data)\r\n }\r\n } else {\r\n class Element extends WeElement {\r\n _useId = 0\r\n\r\n _useMap = {}\r\n\r\n render(props, data) {\r\n return ctor.call(this, props, data)\r\n }\r\n\r\n beforeRender() {\r\n this._useId = 0\r\n }\r\n\r\n useCss(css) {\r\n const style = this.shadowRoot.querySelector('style')\r\n style && this.shadowRoot.removeChild(style)\r\n this.shadowRoot.appendChild(cssToDom(css))\r\n }\r\n\r\n useData(data) {\r\n return this.use({ data: data })\r\n }\r\n\r\n use(option) {\r\n this._useId++\r\n const updater = newValue => {\r\n const item = this._useMap[updater.id]\r\n\r\n item.data = newValue\r\n\r\n this.update()\r\n item.effect && item.effect()\r\n }\r\n\r\n updater.id = this._useId\r\n if (!this._isInstalled) {\r\n this._useMap[this._useId] = option\r\n return [option.data, updater]\r\n }\r\n\r\n return [this._useMap[this._useId].data, updater]\r\n }\r\n\r\n installed() {\r\n this._isInstalled = true\r\n }\r\n }\r\n customElements.define(name, Element)\r\n }\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n const result = {}\r\n dataToPath(data, result)\r\n return result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n Object.keys(data).forEach(key => {\r\n result[key] = true\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n Object.keys(data).forEach(key => {\r\n result[path + '.' + key] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], path + '.' + key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], path + '.' + key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n data.forEach((item, index) => {\r\n result[path + '[' + index + ']'] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(item)\r\n if (type === OBJECTTYPE) {\r\n _objToPath(item, path + '[' + index + ']', result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(item, path + '[' + index + ']', result)\r\n }\r\n })\r\n}\r\n","import { extend } from './util'\r\nimport { h } from './h'\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n return h(\r\n vnode.nodeName,\r\n extend(extend({}, vnode.attributes), props),\r\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\r\n )\r\n}\r\n","export function getHost(ele) {\r\n let p = ele.parentNode\r\n while (p) {\r\n if (p.host) {\r\n return p.host\r\n } else {\r\n p = p.parentNode\r\n }\r\n }\r\n}\r\n","export function rpx(str) {\r\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\r\n return (window.innerWidth * Number(b)) / 750 + 'px'\r\n })\r\n}\r\n","function getGlobal() {\r\n if (\r\n typeof global !== 'object' ||\r\n !global ||\r\n global.Math !== Math ||\r\n global.Array !== Array\r\n ) {\r\n return (\r\n self ||\r\n window ||\r\n global ||\r\n (function() {\r\n return this\r\n })()\r\n )\r\n }\r\n return global\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n store: null,\r\n root: getGlobal()\r\n}\r\n","/*!\r\n * https://github.com/Palindrom/JSONPatcherProxy\r\n * (c) 2017 Starcounter\r\n * MIT license\r\n */\r\n\r\n/** Class representing a JS Object observer */\r\nconst JSONPatcherProxy = (function() {\r\n /**\r\n * Deep clones your object and returns a new object.\r\n */\r\n function deepClone(obj) {\r\n switch (typeof obj) {\r\n case 'object':\r\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\r\n case 'undefined':\r\n return null //this is how JSON.stringify behaves for array items\r\n default:\r\n return obj //no need to clone primitives\r\n }\r\n }\r\n JSONPatcherProxy.deepClone = deepClone\r\n\r\n function escapePathComponent(str) {\r\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\r\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\r\n }\r\n JSONPatcherProxy.escapePathComponent = escapePathComponent\r\n\r\n /**\r\n * Walk up the parenthood tree to get the path\r\n * @param {JSONPatcherProxy} instance\r\n * @param {Object} obj the object you need to find its path\r\n */\r\n function findObjectPath(instance, obj) {\r\n const pathComponents = []\r\n let parentAndPath = instance.parenthoodMap.get(obj)\r\n while (parentAndPath && parentAndPath.path) {\r\n // because we're walking up-tree, we need to use the array as a stack\r\n pathComponents.unshift(parentAndPath.path)\r\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\r\n }\r\n if (pathComponents.length) {\r\n const path = pathComponents.join('/')\r\n return '/' + path\r\n }\r\n return ''\r\n }\r\n /**\r\n * A callback to be used as th proxy set trap callback.\r\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the affected object\r\n * @param {String} key the effect property's name\r\n * @param {Any} newValue the value being set\r\n */\r\n function setTrap(instance, target, key, newValue) {\r\n const parentPath = findObjectPath(instance, target)\r\n\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n if (instance.proxifiedObjectsMap.has(newValue)) {\r\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\r\n\r\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\r\n parent: target,\r\n path: key\r\n })\r\n }\r\n /*\r\n mark already proxified values as inherited.\r\n rationale: proxy.arr.shift()\r\n will emit\r\n {op: replace, path: '/arr/1', value: arr_2}\r\n {op: remove, path: '/arr/2'}\r\n\r\n by default, the second operation would revoke the proxy, and this renders arr revoked.\r\n That's why we need to remember the proxies that are inherited.\r\n */\r\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\r\n /*\r\n Why do we need to check instance.isProxifyingTreeNow?\r\n\r\n We need to make sure we mark revokables as inherited ONLY when we're observing,\r\n because throughout the first proxification, a sub-object is proxified and then assigned to\r\n its parent object. This assignment of a pre-proxified object can fool us into thinking\r\n that it's a proxified object moved around, while in fact it's the first assignment ever.\r\n\r\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\r\n but in fact is is a proxified object moved around the tree\r\n */\r\n if (revokableInstance && !instance.isProxifyingTreeNow) {\r\n revokableInstance.inherited = true\r\n }\r\n\r\n // if the new value is an object, make sure to watch it\r\n if (\r\n newValue &&\r\n typeof newValue == 'object' &&\r\n !instance.proxifiedObjectsMap.has(newValue)\r\n ) {\r\n instance.parenthoodMap.set(newValue, {\r\n parent: target,\r\n path: key\r\n })\r\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\r\n }\r\n // let's start with this operation, and may or may not update it later\r\n const operation = {\r\n op: 'remove',\r\n path: destinationPropKey\r\n }\r\n if (typeof newValue == 'undefined') {\r\n // applying De Morgan's laws would be a tad faster, but less readable\r\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\r\n // `undefined` is being set to an already undefined value, keep silent\r\n return Reflect.set(target, key, newValue)\r\n }\r\n // when array element is set to `undefined`, should generate replace to `null`\r\n if (Array.isArray(target)) {\r\n // undefined array elements are JSON.stringified to `null`\r\n ;(operation.op = 'replace'), (operation.value = null)\r\n }\r\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\r\n // was the deleted a proxified object?\r\n if (oldValue) {\r\n instance.parenthoodMap.delete(target[key])\r\n instance.disableTrapsForProxy(oldValue)\r\n instance.proxifiedObjectsMap.delete(oldValue)\r\n }\r\n } else {\r\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\r\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\r\n if (key != 'length') {\r\n console.warn(\r\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\r\n )\r\n }\r\n return Reflect.set(target, key, newValue)\r\n }\r\n operation.op = 'add'\r\n if (target.hasOwnProperty(key)) {\r\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\r\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\r\n }\r\n }\r\n operation.value = newValue\r\n }\r\n operation.oldValue = target[key]\r\n const reflectionResult = Reflect.set(target, key, newValue)\r\n instance.defaultCallback(operation)\r\n return reflectionResult\r\n }\r\n /**\r\n * A callback to be used as th proxy delete trap callback.\r\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the effected object\r\n * @param {String} key the effected property's name\r\n */\r\n function deleteTrap(instance, target, key) {\r\n if (typeof target[key] !== 'undefined') {\r\n const parentPath = findObjectPath(instance, target)\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\r\n target[key]\r\n )\r\n\r\n if (revokableProxyInstance) {\r\n if (revokableProxyInstance.inherited) {\r\n /*\r\n this is an inherited proxy (an already proxified object that was moved around),\r\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\r\n And we know that because we mark moved proxies with `inherited` flag when we move them\r\n\r\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\r\n We DO want to revoke the proxy if it was removed again.\r\n */\r\n revokableProxyInstance.inherited = false\r\n } else {\r\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\r\n instance.disableTrapsForProxy(revokableProxyInstance)\r\n instance.proxifiedObjectsMap.delete(target[key])\r\n }\r\n }\r\n const reflectionResult = Reflect.deleteProperty(target, key)\r\n\r\n instance.defaultCallback({\r\n op: 'remove',\r\n path: destinationPropKey\r\n })\r\n\r\n return reflectionResult\r\n }\r\n }\r\n /* pre-define resume and pause functions to enhance constructors performance */\r\n function resume() {\r\n this.defaultCallback = operation => {\r\n this.isRecording && this.patches.push(operation)\r\n this.userCallback && this.userCallback(operation)\r\n }\r\n this.isObserving = true\r\n }\r\n function pause() {\r\n this.defaultCallback = () => {}\r\n this.isObserving = false\r\n }\r\n /**\r\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\r\n * @param {Object|Array} root - the object you want to wrap\r\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\r\n * @returns {JSONPatcherProxy}\r\n * @constructor\r\n */\r\n function JSONPatcherProxy(root, showDetachedWarning) {\r\n this.isProxifyingTreeNow = false\r\n this.isObserving = false\r\n this.proxifiedObjectsMap = new Map()\r\n this.parenthoodMap = new Map()\r\n // default to true\r\n if (typeof showDetachedWarning !== 'boolean') {\r\n showDetachedWarning = true\r\n }\r\n\r\n this.showDetachedWarning = showDetachedWarning\r\n this.originalObject = root\r\n this.cachedProxy = null\r\n this.isRecording = false\r\n this.userCallback\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Restores callback back to the original one provided to `observe`.\r\n */\r\n this.resume = resume.bind(this)\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Replaces your callback with a noop function.\r\n */\r\n this.pause = pause.bind(this)\r\n }\r\n\r\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\r\n if (!obj) {\r\n return obj\r\n }\r\n const traps = {\r\n set: (target, key, value, receiver) =>\r\n setTrap(this, target, key, value, receiver),\r\n deleteProperty: (target, key) => deleteTrap(this, target, key)\r\n }\r\n const revocableInstance = Proxy.revocable(obj, traps)\r\n // cache traps object to disable them later.\r\n revocableInstance.trapsInstance = traps\r\n revocableInstance.originalObject = obj\r\n\r\n /* keeping track of object's parent and path */\r\n\r\n this.parenthoodMap.set(obj, { parent, path })\r\n\r\n /* keeping track of all the proxies to be able to revoke them later */\r\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\r\n return revocableInstance.proxy\r\n }\r\n // grab tree's leaves one by one, encapsulate them into a proxy and return\r\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\r\n parent,\r\n root,\r\n path\r\n ) {\r\n for (let key in root) {\r\n if (root.hasOwnProperty(key)) {\r\n if (root[key] instanceof Object) {\r\n root[key] = this._proxifyObjectTreeRecursively(\r\n root,\r\n root[key],\r\n escapePathComponent(key)\r\n )\r\n }\r\n }\r\n }\r\n return this.generateProxyAtPath(parent, root, path)\r\n }\r\n // this function is for aesthetic purposes\r\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\r\n /*\r\n while proxyifying object tree,\r\n the proxyifying operation itself is being\r\n recorded, which in an unwanted behavior,\r\n that's why we disable recording through this\r\n initial process;\r\n */\r\n this.pause()\r\n this.isProxifyingTreeNow = true\r\n const proxifiedObject = this._proxifyObjectTreeRecursively(\r\n undefined,\r\n root,\r\n ''\r\n )\r\n /* OK you can record now */\r\n this.isProxifyingTreeNow = false\r\n this.resume()\r\n return proxifiedObject\r\n }\r\n /**\r\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\r\n * @param {Proxy} proxy - The target proxy object\r\n */\r\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\r\n revokableProxyInstance\r\n ) {\r\n if (this.showDetachedWarning) {\r\n const message =\r\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\r\n\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.deleteProperty = (\r\n targetObject,\r\n propKey\r\n ) => {\r\n return Reflect.deleteProperty(targetObject, propKey)\r\n }\r\n } else {\r\n delete revokableProxyInstance.trapsInstance.set\r\n delete revokableProxyInstance.trapsInstance.get\r\n delete revokableProxyInstance.trapsInstance.deleteProperty\r\n }\r\n }\r\n /**\r\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\r\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\r\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\r\n */\r\n JSONPatcherProxy.prototype.observe = function(record, callback) {\r\n if (!record && !callback) {\r\n throw new Error('You need to either record changes or pass a callback')\r\n }\r\n this.isRecording = record\r\n this.userCallback = callback\r\n /*\r\n I moved it here to remove it from `unobserve`,\r\n this will also make the constructor faster, why initiate\r\n the array before they decide to actually observe with recording?\r\n They might need to use only a callback.\r\n */\r\n if (record) this.patches = []\r\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\r\n return this.cachedProxy\r\n }\r\n /**\r\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\r\n */\r\n JSONPatcherProxy.prototype.generate = function() {\r\n if (!this.isRecording) {\r\n throw new Error('You should set record to true to get patches later')\r\n }\r\n return this.patches.splice(0, this.patches.length)\r\n }\r\n /**\r\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\r\n */\r\n JSONPatcherProxy.prototype.revoke = function() {\r\n this.proxifiedObjectsMap.forEach(el => {\r\n el.revoke()\r\n })\r\n }\r\n /**\r\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\r\n */\r\n JSONPatcherProxy.prototype.disableTraps = function() {\r\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\r\n }\r\n return JSONPatcherProxy\r\n})()\r\n\r\nexport default JSONPatcherProxy\r\n","import WeElement from './we-element'\r\n\r\nexport default class ModelView extends WeElement {\r\n static observe = true\r\n\r\n beforeInstall() {\r\n this.data = this.vm.data\r\n }\r\n\r\n observed() {\r\n this.vm.data = this.data\r\n }\r\n}\r\n","import { h, h as createElement } from './h'\r\nimport options from './options'\r\nimport WeElement from './we-element'\r\nimport { render } from './render'\r\nimport { define } from './define'\r\nimport { tag } from './tag'\r\nimport { observe } from './observe'\r\nimport { cloneElement } from './clone-element'\r\nimport { getHost } from './get-host'\r\nimport { rpx } from './rpx'\r\nimport { tick, nextTick } from './tick'\r\nimport ModelView from './model-view'\r\n\r\nconst Component = WeElement\r\n\r\nconst omi = {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n\r\noptions.root.Omi = omi\r\noptions.root.Omi.version = '5.0.2'\r\n\r\nexport default omi\r\n\r\nexport {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/options.js","../src/proxy.js","../src/model-view.js","../src/omi.js"],"names":["VNode","h","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","key","options","vnode","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","isArray","Object","prototype","toString","call","nProps","result","keys","forEach","isSameNodeType","hydrating","_componentConstructor","createNode","removeNode","name","isSvg","className","old","style","cssText","IS_NON_DIMENSIONAL","test","useCapture","substring","toLowerCase","addEventListener","touchStart","touchEnd","eventProxy","removeEventListener","e","removeAttribute","ns","removeAttributeNS","setAttribute","this","___touchX","_listeners","type","pageX","___touchY","touches","pageY","Math","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","isSvgMode","parent","ownerSVGElement","dom","ret","vnodeLength","parentNode","domLength","context","mountAll","componentRoot","maxLength","appendChild","ele","idiff","item","out","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","vchildren","firstChild","fc","a","splitText","nextSibling","constructor","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","min","len","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","_component","__key","trim","isHydrating","c","f","unmountOnly","removeChildren","update","attrs","isWeElement","setAccessor","receiveProps","data","callbacks","fn","scope","tick","nextItem","nextTick","nextTickCallback","target","observe","JSONPatcherProxy","info","clearTimeout","_willUpdate","timeout","setTimeout","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","HTMLElement","WeElement","extendStoreUpate","store","instances","patch","getArrayPatch","JSONProxy","path","v","patchs","diff","_this","updateAll","globalData","matchGlobalData","updatePath","needUpdate","onChange","diffResult","keyA","indexOf","keyB","includePath","pathA","pathB","next","substr","fixPath","mpPath","arr","split","index","Number","fixArrPath","_classCallCheck$1","_possibleConstructorReturn$1","OBJECTTYPE","getUpdatePath","ctor","Element","_WeElement","_len","args","Array","render","beforeRender","_useId","useCss","_preCss","shadowRoot","querySelector","useData","use","_this2","updater","newValue","_useMap","id","effect","installed","_isInstalled","customElements","define","dataToPath","_objToPath","_arrayToPath","ARRAYTYPE","cloneElement","rpx","b","_inherits$2","subClass","superClass","create","enumerable","writable","configurable","setPrototypeOf","__proto__","root","global","window","Reflect","hasOwnProperty","BuiltInHTMLElement","construct","Promise","resolve","then","bind","diffLevel","deepClone","JSON","escapePathComponent","pathComponents","parentAndPath","parenthoodMap","get","parentPath","newValueOriginalObject","revokableInstance","inherited","proxifiedObjectsMap","has","set","operation","destinationPropKey","op","oldValue","delete","disableTrapsForProxy","console","warn","reflectionResult","revokableProxyInstance","defaultCallback","resume","patches","userCallback","pause","isObserving","showDetachedWarning","cachedProxy","receiver","deleteProperty","deleteTrap","Proxy","revocable","revocableInstance","trapsInstance","traps","originalObject","_proxifyObjectTreeRecursively","proxifyObjectTree","isProxifyingTreeNow","proxifiedObject","targetObject","message","propKey","record","callback","generate","isRecording","revoke","el","disableTraps","assign","defaultProps","connectedCallback","pure","host","beforeInstall","afterInstall","attachShadow","mode","removeChild","proxyUpdate","beforeObserve","observed","disconnectedCallback","uninstall","splice","beforeUpdate","updated","fire","install","afterUpdate","rendered","Component","ModelView","tag","getHost","omi","Omi","version","module","exports"],"mappings":";;IACO,SAASA;ICKT,SAASC,EAAEC,UAAUC;QAC1B,IACEC,YACAC,OACAC,QACAC,GAJEC,WAAWC;QAKf,KAAKF,IAAIG,UAAUC,QAAQJ,MAAM,KAC/BK,MAAMC,KAAKH,UAAUH;QAEvB,IAAIJ,cAAqC,QAAvBA,WAAWK,UAAkB;YAC7C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEpB,OAAOI,MAAMD,QACX,KAAKN,QAAQO,MAAME,eAAwBC,MAAdV,MAAMS,KACjC,KAAKP,IAAIF,MAAMM,QAAQJ,OAAOK,MAAMC,KAAKR,MAAME,UAC1C;YACL,IAAqB,oBAAVF,OAAqBA,QAAQ;YAExC,IAAKC,SAA6B,qBAAbJ,UACnB,IAAa,QAATG,OAAeA,QAAQ,SACtB,IAAqB,mBAAVA,OAAoBA,QAAQW,OAAOX,aAC9C,IAAqB,mBAAVA,OAAoBC,UAAS;YAG/C,IAAIA,UAAUF,YACZI,SAASA,SAASG,SAAS,MAAMN,YAC5B,IAAIG,aAAaC,gBACtBD,aAAYH,cAEZG,SAASK,KAAKR;YAGhBD,aAAaE;;QAIjB,IAAIW,IAAI,IAAIjB;QACZiB,EAAEf,WAAWA;QACbe,EAAET,WAAWA;QACbS,EAAEd,aAA2B,QAAdA,kBAAqBY,IAAYZ;QAChDc,EAAEC,MAAoB,QAAdf,kBAAqBY,IAAYZ,WAAWe;QAGpD,SAAsBH,MAAlBI,QAAQC,OAAqBD,QAAQC,MAAMH;QAE/C,OAAOA;;ICfF,SAASI,SAASC;QACvB,IAAMC,OAAOC,SAASC,cAAc;QACpCF,KAAKG,cAAcJ;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A7F,eAAAA;4BAEAqG,cAAAA;4BAEAE,UAAAA;4BAEAI,eAAAA;4BAEAH,WAAAA;4BAEAtH,eAAAA;4BAEA0H,gBAAAA;4BAEAhM,WAAAA;;;;;;;;;;;;;;;;QQ1HE,OAAKC;MACNwB;;IAIA,IAAAwK,YAAAxK;;QAToCA,KAAAA;;QAAlByK,WACZxL;;QCUT7J,GAAMoV;;QAENlU,SAAYA;QACVoU,QADU5G;QAEV9D,SAAAA;QACAwK,cAAAA;QACA5H,SAAAA;QACAxN,KALUgP;QAMVxN,MAAAA;QACAN,UAAAA;QACAwN,WAAAA;;IAGA6G,QAAAA,KAAAA,MAXUC;IAYVxG,QAAAA,KAZUyG,IAAAC,UAAA;IAcVhM,IAdU,sBAcVA,QAdUiM,OAAAC,UAAAJ,UAAA/K,KAAAgL,MAAAD","file":"omi.js","sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n p.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function npn(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n","import { extend } from '../util'\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchstart', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchstart', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value === 'string') {\n if (ns) {\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n } else {\n node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn, isArray } from '../util'\nimport { removeNode } from '../dom/index'\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n if (isArray(vnode)) {\n ret = []\n let parentNode = null\n if (isArray(dom)) {\n let domLength = dom.length\n let vnodeLength = vnode.length\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\n parentNode = dom[0].parentNode\n for (let i = 0; i < maxLength; i++) {\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\n ret.push(ele)\n if (i > domLength - 1) {\n parentNode.appendChild(ele)\n }\n }\n } else {\n vnode.forEach(function(item) {\n let ele = idiff(dom, item, context, mountAll, componentRoot)\n ret.push(ele)\n parent && parent.appendChild(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\n } else {\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, vnode.children)\n if (out.props) {\n out.props.children = vnode.children\n }\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, children) {\n let name\n let update = false\n let isWeElement = dom.update\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n if (isWeElement) {\n delete dom.props[name]\n update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n //diable when using store system?\n //!dom.store &&\n if (isWeElement && typeof attrs[name] === 'object') {\n dom.props[npn(name)] = attrs[name]\n update = true\n } else if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n if (isWeElement) {\n dom.props[npn(name)] = attrs[name]\n update = true\n }\n }\n }\n\n if (isWeElement && dom.parentNode) {\n if (update || children.length > 0) {\n dom.receiveProps(dom.props, dom.data)\n dom.update()\n }\n }\n}\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import JSONProxy from './proxy'\nimport { fireTick } from './tick'\n\nexport function observe(target) {\n target.observe = true\n}\n\nexport function proxyUpdate(ele) {\n let timeout = null\n ele.data = new JSONProxy(ele.data).observe(false, info => {\n if (\n ele._willUpdate ||\n (info.op === 'replace' && info.oldValue === info.value)\n ) {\n return\n }\n\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n })\n}\n","import { cssToDom, nProps, isArray } from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { proxyUpdate } from './observe'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n static is = 'WeElement'\n\n constructor() {\n super()\n this.props = Object.assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps\n )\n this.__elementId = id++\n this.data = this.constructor.data || {}\n }\n\n connectedCallback() {\n if (!this.constructor.pure) {\n let p = this.parentNode\n while (p && !this.store) {\n this.store = p.store\n p = p.parentNode || p.host\n }\n if (this.store) {\n this.store.instances.push(this)\n }\n }\n this.beforeInstall()\n !this._isInstalled && this.install()\n this.afterInstall()\n let shadowRoot\n if (!this.shadowRoot) {\n shadowRoot = this.attachShadow({\n mode: 'open'\n })\n } else {\n shadowRoot = this.shadowRoot\n let fc\n while ((fc = shadowRoot.firstChild)) {\n shadowRoot.removeChild(fc)\n }\n }\n\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\n !this._isInstalled && this.beforeRender()\n options.afterInstall && options.afterInstall(this)\n if (this.constructor.observe) {\n this.beforeObserve()\n proxyUpdate(this)\n this.observed()\n }\n this.host = diff(\n null,\n this.render(this.props, this.data, this.store),\n {},\n false,\n null,\n false\n )\n this.rendered()\n if (isArray(this.host)) {\n this.host.forEach(function(item) {\n shadowRoot.appendChild(item)\n })\n } else {\n shadowRoot.appendChild(this.host)\n }\n !this._isInstalled && this.installed()\n this._isInstalled = true\n }\n\n disconnectedCallback() {\n this.uninstall()\n this._isInstalled = false\n if (this.store) {\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\n if (this.store.instances[i] === this) {\n this.store.instances.splice(i, 1)\n break\n }\n }\n }\n }\n\n update() {\n this._willUpdate = true\n this.beforeUpdate()\n this.beforeRender()\n this.host = diff(\n this.host,\n this.render(this.props, this.data, this.store),\n null,\n null,\n this.shadowRoot\n )\n this.afterUpdate()\n this.updated()\n this._willUpdate = false\n }\n\n fire(name, data) {\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\n }\n\n beforeInstall() {}\n\n install() {}\n\n afterInstall() {}\n\n installed() {}\n\n uninstall() {}\n\n beforeUpdate() {}\n\n afterUpdate() {} //deprecated, please use updated\n\n updated() {}\n\n beforeRender() {}\n\n rendered() {}\n\n receiveProps() {}\n\n beforeObserve() {}\n\n observed() {}\n}\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n clearTimeout(timeout)\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n }\n })\n parent.store = store\n }\n return diff(null, vnode, {}, false, parent, false)\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import WeElement from './we-element'\nimport { cssToDom } from './util'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n if (ctor.data && !ctor.pure) {\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n } else {\n class Element extends WeElement {\n _useId = 0\n\n _useMap = {}\n\n _preCss = null\n\n render(props, data) {\n return ctor.call(this, props, data)\n }\n\n beforeRender() {\n this._useId = 0\n }\n\n useCss(css) {\n if (css === this._preCss) {\n return\n }\n this._preCss = css\n const style = this.shadowRoot.querySelector('style')\n style && this.shadowRoot.removeChild(style)\n this.shadowRoot.appendChild(cssToDom(css))\n }\n\n useData(data) {\n return this.use({ data: data })\n }\n\n use(option) {\n this._useId++\n const updater = newValue => {\n const item = this._useMap[updater.id]\n\n item.data = newValue\n\n this.update()\n item.effect && item.effect()\n }\n\n updater.id = this._useId\n if (!this._isInstalled) {\n this._useMap[this._useId] = option\n return [option.data, updater]\n }\n\n return [this._useMap[this._useId].data, updater]\n }\n\n installed() {\n this._isInstalled = true\n }\n }\n customElements.define(name, Element)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else {\n p = p.parentNode\n }\n }\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function() {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal()\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import WeElement from './we-element'\n\nexport default class ModelView extends WeElement {\n static observe = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n\n observed() {\n this.vm.data = this.data\n }\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { observe } from './observe'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { tick, nextTick } from './tick'\nimport ModelView from './model-view'\n\nconst Component = WeElement\n\nconst omi = {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n\noptions.root.Omi = omi\noptions.root.Omi.version = '5.0.3'\n\nexport default omi\n\nexport {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n"]} \ No newline at end of file diff --git a/packages/omi/dist/omi.min.js b/packages/omi/dist/omi.min.js index e5565160f..598bccb86 100644 --- a/packages/omi/dist/omi.min.js +++ b/packages/omi/dist/omi.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function t(){}function e(e,n){var r,o,i,a,s=nt;for(a=arguments.length;a-- >2;)et.push(arguments[a]);n&&null!=n.children&&(et.length||et.push(n.children),delete n.children);while(et.length)if((o=et.pop())&&void 0!==o.pop)for(a=o.length;a--;)et.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===nt?s=[o]:s.push(o),r=i;var c=new t;return c.nodeName=e,c.children=s,c.attributes=null==n?void 0:n,c.key=null==n?void 0:n.key,void 0!==tt.vnode&&tt.vnode(c),c}function n(t){var e=document.createElement("style");return e.textContent=t,e}function r(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function o(t,e){for(var n in e)t[n]=e[n];return t}function i(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}function a(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t){if(!t||a(t))return{};var e={};return Object.keys(t).forEach(function(n){e[n]=t[n].value}),e}function c(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&l(t,e.nodeName):n||t._componentConstructor===e.nodeName}function l(t,e){return t.__n===e||t.nodeName.toLowerCase()===e.toLowerCase()}function u(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.__n=t,n}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function f(t,e,n,r,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i(n,null),i(r,t);else if("class"!==e||o)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(t.style[a]="");for(var a in r)t.style[a]="number"==typeof r[a]&&!1===rt.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||(t.addEventListener(e,h,s),"tap"==e&&(t.addEventListener("touchstart",d,s),t.addEventListener("touchstart",y,s))):(t.removeEventListener(e,h,s),"tap"==e&&(t.removeEventListener("touchstart",d,s),t.removeEventListener("touchstart",y,s))),(t.__l||(t.__l={}))[e]=r}else if("list"!==e&&"type"!==e&&!o&&e in t){try{t[e]=null==r?"":r}catch(t){}null!=r&&!1!==r||"spellcheck"==e||t.removeAttribute(e)}else{var c=o&&e!==(e=e.replace(/^xlink:?/,""));null==r||!1===r?c?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"string"==typeof r&&(c?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function h(t){return this.__l[t.type](tt.event&&tt.event(t)||t)}function d(t){this.F=t.touches[0].pageX,this.G=t.touches[0].pageY,this.H=document.body.scrollTop}function y(t){Math.abs(t.changedTouches[0].pageX-this.F)<30&&Math.abs(t.changedTouches[0].pageY-this.G)<30&&Math.abs(document.body.scrollTop-this.H)<30&&this.dispatchEvent(new CustomEvent("tap",{detail:t}))}function v(t,e,n,r,o,i){var s;if(ot++||(it=null!=o&&void 0!==o.ownerSVGElement,at=null!=t&&!("__omiattr_"in t)),a(e)){s=[];var c=null;if(a(t)){var l=t.length,u=e.length,p=l>=u?l:u;c=t[0].parentNode;for(var f=0;fl-1&&c.appendChild(h)}}else e.forEach(function(e){var a=b(t,e,n,r,i);s.push(a),o&&o.appendChild(a)})}else s=a(t)?b(t[0],e,n,r,i):b(t,e,n,r,i),o&&s.parentNode!==o&&o.appendChild(s);return--ot||(at=!1),s}function b(t,e,n,r,o){t&&e&&t.props&&(t.props.children=e.children);var i=t,a=it;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),m(t,!0))),i.__omiattr_=!0,i;var s=e.nodeName;if(it="svg"===s||"foreignObject"!==s&&it,s+="",(!t||!l(t,s))&&(i=u(s,it),t)){while(t.firstChild)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),m(t,!0)}var c=i.firstChild,p=i.__omiattr_,f=e.children;if(null==p){p=i.__omiattr_={};for(var h=i.attributes,d=h.length;d--;)p[h[d].name]=h[d].value}return!at&&f&&1===f.length&&"string"==typeof f[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=f[0]&&(c.nodeValue=f[0]):(f&&f.length||null!=c)&&("WeElement"==i.constructor.is&&i.constructor.noSlot||g(i,f,n,r,at||null!=p.dangerouslySetInnerHTML)),O(i,e.attributes,p,e.children),i.props&&(i.props.children=e.children),it=a,i}function g(t,e,n,r,o){var i,a,s,l,u,f=t.childNodes,h=[],d={},y=0,v=0,g=f.length,w=0,O=e?e.length:0;if(0!==g)for(var j=0;j0)&&(t.receiveProps(t.props,t.data),t.update())}function j(t,e){ct.push({fn:t,scope:e})}function _(){ct.forEach(function(t){t.fn.call(t.scope)}),lt.forEach(function(t){t.fn.call(t.scope)}),lt.length=0}function x(t,e){lt.push({fn:t,scope:e})}function C(t){t.observe=!0}function E(t){var e=null;t.data=new st(t.data).observe(!1,function(n){t.J||"replace"===n.op&&n.oldValue===n.value||(clearTimeout(e),e=setTimeout(function(){t.update(),_()},0))})}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function M(t,e,n){if(e="string"==typeof e?document.querySelector(e):e,n){n.instances=[],A(n);var r=null,o={};n.data=new st(n.data).observe(!1,function(t){if(clearTimeout(r),"remove"===t.op){var e=H(t.path,n);o[e.k]=e.v,r=setTimeout(function(){k(o,n),o={}},0)}else{var i=I(t.path);o[i]=t.value,r=setTimeout(function(){k(o,n),o={}},0)}}),e.store=n}return v(null,t,{},!1,e,!1)}function k(t,e){e.update(t)}function A(t){t.update=function(t){var e=this,n=R(this.globalData,t);Object.keys(t).length>0&&(this.instances.forEach(function(r){(n||e.updateAll||r.constructor.updatePath&&S(t,r.constructor.updatePath))&&r.update()}),this.onChange&&this.onChange(t))}}function R(t,e){if(!t)return!1;for(var n in e){if(t.indexOf(n)>-1)return!0;for(var r=0,o=t.length;r2?[].slice.call(arguments,2):t.children)}function $(t){var e=t.parentNode;while(e){if(e.host)return e.host;e=e.parentNode}}function z(t){return t.replace(/([1-9]\d*|0)(\.\d*)*rpx/g,function(t,e){return window.innerWidth*+e/750+"px"})}function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Z(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var tt={store:null,root:function(){return"object"==typeof global&&global&&global.Math===Math&&global.Array===Array?global:self||window||global||function(){return this}()}()},et=[],nt=[];!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var t=HTMLElement;window.HTMLElement=function(){return Reflect.construct(t,[],this.constructor)},HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var rt=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ot=0,it=!1,at=!1,st=function(){function t(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function e(t){return-1==t.indexOf("/")&&-1==t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function n(t,e){var n=[],r=t.parenthoodMap.get(e);while(r&&r.path)n.unshift(r.path),r=t.parenthoodMap.get(r.parent);if(n.length){return"/"+n.join("/")}return""}function r(t,r,o,i){var a=n(t,r),s=a+"/"+e(o);if(t.proxifiedObjectsMap.has(i)){t.parenthoodMap.set(t.proxifiedObjectsMap.get(i).originalObject,{parent:r,path:o})}var c=t.proxifiedObjectsMap.get(i);c&&!t.isProxifyingTreeNow&&(c.inherited=!0),i&&"object"==typeof i&&!t.proxifiedObjectsMap.has(i)&&(t.parenthoodMap.set(i,{parent:r,path:o}),i=t.A(r,i,o));var l={op:"remove",path:s};if(void 0===i){if(!Array.isArray(r)&&!r.hasOwnProperty(o))return Reflect.set(r,o,i);Array.isArray(r)&&(l.op="replace",l.value=null);var u=t.proxifiedObjectsMap.get(r[o]);u&&(t.parenthoodMap.delete(r[o]),t.disableTrapsForProxy(u),t.proxifiedObjectsMap.delete(u))}else{if(Array.isArray(r)&&!Number.isInteger(+(""+o)))return"length"!=o&&console.warn("JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch"),Reflect.set(r,o,i);l.op="add",r.hasOwnProperty(o)&&(void 0!==r[o]||Array.isArray(r))&&(l.op="replace"),l.value=i}l.oldValue=r[o];var p=Reflect.set(r,o,i);return t.defaultCallback(l),p}function o(t,r,o){if(void 0!==r[o]){var i=n(t,r),a=i+"/"+e(o),s=t.proxifiedObjectsMap.get(r[o]);s&&(s.inherited?s.inherited=!1:(t.parenthoodMap.delete(s.originalObject),t.disableTrapsForProxy(s),t.proxifiedObjectsMap.delete(r[o])));var c=Reflect.deleteProperty(r,o);return t.defaultCallback({op:"remove",path:a}),c}}function i(){var t=this;this.defaultCallback=function(e){t.isRecording&&t.patches.push(e),t.userCallback&&t.userCallback(e)},this.isObserving=!0}function a(){this.defaultCallback=function(){},this.isObserving=!1}function s(t,e){this.isProxifyingTreeNow=!1,this.isObserving=!1,this.proxifiedObjectsMap=new Map,this.parenthoodMap=new Map,"boolean"!=typeof e&&(e=!0),this.showDetachedWarning=e,this.originalObject=t,this.cachedProxy=null,this.isRecording=!1,this.resume=i.bind(this),this.pause=a.bind(this)}return s.deepClone=t,s.escapePathComponent=e,s.prototype.generateProxyAtPath=function(t,e,n){var i=this;if(!e)return e;var a={set:function(t,e,n){return r(i,t,e,n)},deleteProperty:function(t,e){return o(i,t,e)}},s=Proxy.revocable(e,a);return s.trapsInstance=a,s.originalObject=e,this.parenthoodMap.set(e,{parent:t,path:n}),this.proxifiedObjectsMap.set(s.proxy,s),s.proxy},s.prototype.A=function(t,n,r){for(var o in n)n.hasOwnProperty(o)&&n[o]instanceof Object&&(n[o]=this.A(n,n[o],e(o)));return this.generateProxyAtPath(t,n,r)},s.prototype.proxifyObjectTree=function(t){this.pause(),this.isProxifyingTreeNow=!0;var e=this.A(void 0,t,"");return this.isProxifyingTreeNow=!1,this.resume(),e},s.prototype.disableTrapsForProxy=function(t){if(this.showDetachedWarning){var e="You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects";t.trapsInstance.set=function(t,n,r){return console.warn(e),Reflect.set(t,n,r)},t.trapsInstance.set=function(t,n,r){return console.warn(e),Reflect.set(t,n,r)},t.trapsInstance.deleteProperty=function(t,e){return Reflect.deleteProperty(t,e)}}else delete t.trapsInstance.set,delete t.trapsInstance.get,delete t.trapsInstance.deleteProperty},s.prototype.observe=function(t,e){if(!t&&!e)throw Error("You need to either record changes or pass a callback");return this.isRecording=t,this.userCallback=e,t&&(this.patches=[]),this.cachedProxy=this.proxifyObjectTree(this.originalObject)},s.prototype.generate=function(){if(!this.isRecording)throw Error("You should set record to true to get patches later");return this.patches.splice(0,this.patches.length)},s.prototype.revoke=function(){this.proxifiedObjectsMap.forEach(function(t){t.revoke()})},s.prototype.disableTraps=function(){this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy,this)},s}(),ct=[],lt=[],ut=0,pt=function(t){function e(){P(this,e);var n=T(this,t.call(this));return n.props=Object.assign(s(n.constructor.props),n.constructor.defaultProps),n.I=ut++,n.data=n.constructor.data||{},n}return N(e,t),e.prototype.connectedCallback=function(){if(!this.constructor.pure){var t=this.parentNode;while(t&&!this.store)this.store=t.store,t=t.parentNode||t.host;this.store&&this.store.instances.push(this)}this.beforeInstall(),!this.B&&this.install(),this.afterInstall();var e;if(this.shadowRoot){e=this.shadowRoot;var r;while(r=e.firstChild)e.removeChild(r)}else e=this.attachShadow({mode:"open"});this.css&&e.appendChild(n(this.css())),!this.B&&this.beforeRender(),tt.afterInstall&&tt.afterInstall(this),this.constructor.observe&&(this.beforeObserve(),E(this),this.observed()),this.host=v(null,this.render(this.props,this.data,this.store),{},!1,null,!1),this.rendered(),a(this.host)?this.host.forEach(function(t){e.appendChild(t)}):e.appendChild(this.host),!this.B&&this.installed(),this.B=!0},e.prototype.disconnectedCallback=function(){if(this.uninstall(),this.B=!1,this.store)for(var t=0,e=this.store.instances.length;t2;)et.push(arguments[a]);n&&null!=n.children&&(et.length||et.push(n.children),delete n.children);while(et.length)if((o=et.pop())&&void 0!==o.pop)for(a=o.length;a--;)et.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof e)&&(null==o?o="":"number"==typeof o?o+="":"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===nt?s=[o]:s.push(o),r=i;var c=new t;return c.nodeName=e,c.children=s,c.attributes=null==n?void 0:n,c.key=null==n?void 0:n.key,void 0!==tt.vnode&&tt.vnode(c),c}function n(t){var e=document.createElement("style");return e.textContent=t,e}function r(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function o(t,e){for(var n in e)t[n]=e[n];return t}function i(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}function a(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t){if(!t||a(t))return{};var e={};return Object.keys(t).forEach(function(n){e[n]=t[n].value}),e}function c(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&l(t,e.nodeName):n||t._componentConstructor===e.nodeName}function l(t,e){return t.__n===e||t.nodeName.toLowerCase()===e.toLowerCase()}function u(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.__n=t,n}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function f(t,e,n,r,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i(n,null),i(r,t);else if("class"!==e||o)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var a in n)a in r||(t.style[a]="");for(var a in r)t.style[a]="number"==typeof r[a]&&!1===rt.test(a)?r[a]+"px":r[a]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||(t.addEventListener(e,h,s),"tap"==e&&(t.addEventListener("touchstart",d,s),t.addEventListener("touchstart",y,s))):(t.removeEventListener(e,h,s),"tap"==e&&(t.removeEventListener("touchstart",d,s),t.removeEventListener("touchstart",y,s))),(t.__l||(t.__l={}))[e]=r}else if("list"!==e&&"type"!==e&&!o&&e in t){try{t[e]=null==r?"":r}catch(t){}null!=r&&!1!==r||"spellcheck"==e||t.removeAttribute(e)}else{var c=o&&e!==(e=e.replace(/^xlink:?/,""));null==r||!1===r?c?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"string"==typeof r&&(c?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function h(t){return this.__l[t.type](tt.event&&tt.event(t)||t)}function d(t){this.F=t.touches[0].pageX,this.G=t.touches[0].pageY,this.H=document.body.scrollTop}function y(t){Math.abs(t.changedTouches[0].pageX-this.F)<30&&Math.abs(t.changedTouches[0].pageY-this.G)<30&&Math.abs(document.body.scrollTop-this.H)<30&&this.dispatchEvent(new CustomEvent("tap",{detail:t}))}function v(t,e,n,r,o,i){var s;if(ot++||(it=null!=o&&void 0!==o.ownerSVGElement,at=null!=t&&!("__omiattr_"in t)),a(e)){s=[];var c=null;if(a(t)){var l=t.length,u=e.length,p=l>=u?l:u;c=t[0].parentNode;for(var f=0;fl-1&&c.appendChild(h)}}else e.forEach(function(e){var a=b(t,e,n,r,i);s.push(a),o&&o.appendChild(a)})}else s=a(t)?b(t[0],e,n,r,i):b(t,e,n,r,i),o&&s.parentNode!==o&&o.appendChild(s);return--ot||(at=!1),s}function b(t,e,n,r,o){t&&e&&t.props&&(t.props.children=e.children);var i=t,a=it;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),m(t,!0))),i.__omiattr_=!0,i;var s=e.nodeName;if(it="svg"===s||"foreignObject"!==s&&it,s+="",(!t||!l(t,s))&&(i=u(s,it),t)){while(t.firstChild)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),m(t,!0)}var c=i.firstChild,p=i.__omiattr_,f=e.children;if(null==p){p=i.__omiattr_={};for(var h=i.attributes,d=h.length;d--;)p[h[d].name]=h[d].value}return!at&&f&&1===f.length&&"string"==typeof f[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=f[0]&&(c.nodeValue=f[0]):(f&&f.length||null!=c)&&("WeElement"==i.constructor.is&&i.constructor.noSlot||g(i,f,n,r,at||null!=p.dangerouslySetInnerHTML)),O(i,e.attributes,p,e.children),i.props&&(i.props.children=e.children),it=a,i}function g(t,e,n,r,o){var i,a,s,l,u,f=t.childNodes,h=[],d={},y=0,v=0,g=f.length,w=0,O=e?e.length:0;if(0!==g)for(var j=0;j0)&&(t.receiveProps(t.props,t.data),t.update())}function j(t,e){ct.push({fn:t,scope:e})}function _(){ct.forEach(function(t){t.fn.call(t.scope)}),lt.forEach(function(t){t.fn.call(t.scope)}),lt.length=0}function x(t,e){lt.push({fn:t,scope:e})}function C(t){t.observe=!0}function E(t){var e=null;t.data=new st(t.data).observe(!1,function(n){t.J||"replace"===n.op&&n.oldValue===n.value||(clearTimeout(e),e=setTimeout(function(){t.update(),_()},0))})}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function M(t,e,n){if(e="string"==typeof e?document.querySelector(e):e,n){n.instances=[],A(n);var r=null,o={};n.data=new st(n.data).observe(!1,function(t){if(clearTimeout(r),"remove"===t.op){var e=H(t.path,n);o[e.k]=e.v,r=setTimeout(function(){k(o,n),o={}},0)}else{var i=I(t.path);o[i]=t.value,r=setTimeout(function(){k(o,n),o={}},0)}}),e.store=n}return v(null,t,{},!1,e,!1)}function k(t,e){e.update(t)}function A(t){t.update=function(t){var e=this,n=R(this.globalData,t);Object.keys(t).length>0&&(this.instances.forEach(function(r){(n||e.updateAll||r.constructor.updatePath&&S(t,r.constructor.updatePath))&&r.update()}),this.onChange&&this.onChange(t))}}function R(t,e){if(!t)return!1;for(var n in e){if(t.indexOf(n)>-1)return!0;for(var r=0,o=t.length;r2?[].slice.call(arguments,2):t.children)}function X(t){var e=t.parentNode;while(e){if(e.host)return e.host;e=e.parentNode}}function $(t){return t.replace(/([1-9]\d*|0)(\.\d*)*rpx/g,function(t,e){return window.innerWidth*+e/750+"px"})}function z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Z(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var tt={store:null,root:function(){return"object"==typeof global&&global&&global.Math===Math&&global.Array===Array?global:self||window||global||function(){return this}()}()},et=[],nt=[];!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.hasOwnProperty("polyfillWrapFlushCallback")){var t=HTMLElement;window.HTMLElement=function(){return Reflect.construct(t,[],this.constructor)},HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}(),"function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var rt=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,ot=0,it=!1,at=!1,st=function(){function t(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function e(t){return-1==t.indexOf("/")&&-1==t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function n(t,e){var n=[],r=t.parenthoodMap.get(e);while(r&&r.path)n.unshift(r.path),r=t.parenthoodMap.get(r.parent);if(n.length){return"/"+n.join("/")}return""}function r(t,r,o,i){var a=n(t,r),s=a+"/"+e(o);if(t.proxifiedObjectsMap.has(i)){t.parenthoodMap.set(t.proxifiedObjectsMap.get(i).originalObject,{parent:r,path:o})}var c=t.proxifiedObjectsMap.get(i);c&&!t.isProxifyingTreeNow&&(c.inherited=!0),i&&"object"==typeof i&&!t.proxifiedObjectsMap.has(i)&&(t.parenthoodMap.set(i,{parent:r,path:o}),i=t.A(r,i,o));var l={op:"remove",path:s};if(void 0===i){if(!Array.isArray(r)&&!r.hasOwnProperty(o))return Reflect.set(r,o,i);Array.isArray(r)&&(l.op="replace",l.value=null);var u=t.proxifiedObjectsMap.get(r[o]);u&&(t.parenthoodMap.delete(r[o]),t.disableTrapsForProxy(u),t.proxifiedObjectsMap.delete(u))}else{if(Array.isArray(r)&&!Number.isInteger(+(""+o)))return"length"!=o&&console.warn("JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch"),Reflect.set(r,o,i);l.op="add",r.hasOwnProperty(o)&&(void 0!==r[o]||Array.isArray(r))&&(l.op="replace"),l.value=i}l.oldValue=r[o];var p=Reflect.set(r,o,i);return t.defaultCallback(l),p}function o(t,r,o){if(void 0!==r[o]){var i=n(t,r),a=i+"/"+e(o),s=t.proxifiedObjectsMap.get(r[o]);s&&(s.inherited?s.inherited=!1:(t.parenthoodMap.delete(s.originalObject),t.disableTrapsForProxy(s),t.proxifiedObjectsMap.delete(r[o])));var c=Reflect.deleteProperty(r,o);return t.defaultCallback({op:"remove",path:a}),c}}function i(){var t=this;this.defaultCallback=function(e){t.isRecording&&t.patches.push(e),t.userCallback&&t.userCallback(e)},this.isObserving=!0}function a(){this.defaultCallback=function(){},this.isObserving=!1}function s(t,e){this.isProxifyingTreeNow=!1,this.isObserving=!1,this.proxifiedObjectsMap=new Map,this.parenthoodMap=new Map,"boolean"!=typeof e&&(e=!0),this.showDetachedWarning=e,this.originalObject=t,this.cachedProxy=null,this.isRecording=!1,this.resume=i.bind(this),this.pause=a.bind(this)}return s.deepClone=t,s.escapePathComponent=e,s.prototype.generateProxyAtPath=function(t,e,n){var i=this;if(!e)return e;var a={set:function(t,e,n){return r(i,t,e,n)},deleteProperty:function(t,e){return o(i,t,e)}},s=Proxy.revocable(e,a);return s.trapsInstance=a,s.originalObject=e,this.parenthoodMap.set(e,{parent:t,path:n}),this.proxifiedObjectsMap.set(s.proxy,s),s.proxy},s.prototype.A=function(t,n,r){for(var o in n)n.hasOwnProperty(o)&&n[o]instanceof Object&&(n[o]=this.A(n,n[o],e(o)));return this.generateProxyAtPath(t,n,r)},s.prototype.proxifyObjectTree=function(t){this.pause(),this.isProxifyingTreeNow=!0;var e=this.A(void 0,t,"");return this.isProxifyingTreeNow=!1,this.resume(),e},s.prototype.disableTrapsForProxy=function(t){if(this.showDetachedWarning){var e="You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects";t.trapsInstance.set=function(t,n,r){return console.warn(e),Reflect.set(t,n,r)},t.trapsInstance.set=function(t,n,r){return console.warn(e),Reflect.set(t,n,r)},t.trapsInstance.deleteProperty=function(t,e){return Reflect.deleteProperty(t,e)}}else delete t.trapsInstance.set,delete t.trapsInstance.get,delete t.trapsInstance.deleteProperty},s.prototype.observe=function(t,e){if(!t&&!e)throw Error("You need to either record changes or pass a callback");return this.isRecording=t,this.userCallback=e,t&&(this.patches=[]),this.cachedProxy=this.proxifyObjectTree(this.originalObject)},s.prototype.generate=function(){if(!this.isRecording)throw Error("You should set record to true to get patches later");return this.patches.splice(0,this.patches.length)},s.prototype.revoke=function(){this.proxifiedObjectsMap.forEach(function(t){t.revoke()})},s.prototype.disableTraps=function(){this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy,this)},s}(),ct=[],lt=[],ut=0,pt=function(t){function e(){P(this,e);var n=T(this,t.call(this));return n.props=Object.assign(s(n.constructor.props),n.constructor.defaultProps),n.I=ut++,n.data=n.constructor.data||{},n}return N(e,t),e.prototype.connectedCallback=function(){if(!this.constructor.pure){var t=this.parentNode;while(t&&!this.store)this.store=t.store,t=t.parentNode||t.host;this.store&&this.store.instances.push(this)}this.beforeInstall(),!this.B&&this.install(),this.afterInstall();var e;if(this.shadowRoot){e=this.shadowRoot;var r;while(r=e.firstChild)e.removeChild(r)}else e=this.attachShadow({mode:"open"});this.css&&e.appendChild(n(this.css())),!this.B&&this.beforeRender(),tt.afterInstall&&tt.afterInstall(this),this.constructor.observe&&(this.beforeObserve(),E(this),this.observed()),this.host=v(null,this.render(this.props,this.data,this.store),{},!1,null,!1),this.rendered(),a(this.host)?this.host.forEach(function(t){e.appendChild(t)}):e.appendChild(this.host),!this.B&&this.installed(),this.B=!0},e.prototype.disconnectedCallback=function(){if(this.uninstall(),this.B=!1,this.store)for(var t=0,e=this.store.instances.length;t 2; ) {\r\n stack.push(arguments[i])\r\n }\r\n if (attributes && attributes.children != null) {\r\n if (!stack.length) stack.push(attributes.children)\r\n delete attributes.children\r\n }\r\n while (stack.length) {\r\n if ((child = stack.pop()) && child.pop !== undefined) {\r\n for (i = child.length; i--; ) stack.push(child[i])\r\n } else {\r\n if (typeof child === 'boolean') child = null\r\n\r\n if ((simple = typeof nodeName !== 'function')) {\r\n if (child == null) child = ''\r\n else if (typeof child === 'number') child = String(child)\r\n else if (typeof child !== 'string') simple = false\r\n }\r\n\r\n if (simple && lastSimple) {\r\n children[children.length - 1] += child\r\n } else if (children === EMPTY_CHILDREN) {\r\n children = [child]\r\n } else {\r\n children.push(child)\r\n }\r\n\r\n lastSimple = simple\r\n }\r\n }\r\n\r\n let p = new VNode()\r\n p.nodeName = nodeName\r\n p.children = children\r\n p.attributes = attributes == null ? undefined : attributes\r\n p.key = attributes == null ? undefined : attributes.key\r\n\r\n // if a \"vnode hook\" is defined, pass every created VNode to it\r\n if (options.vnode !== undefined) options.vnode(p)\r\n\r\n return p\r\n}\r\n","/**\r\n * @license\r\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n/**\r\n * This shim allows elements written in, or compiled to, ES5 to work on native\r\n * implementations of Custom Elements v1. It sets new.target to the value of\r\n * this.constructor so that the native HTMLElement constructor can access the\r\n * current under-construction element's definition.\r\n */\r\n;(function() {\r\n if (\r\n // No Reflect, no classes, no need for shim because native custom elements\r\n // require ES2015 classes or Reflect.\r\n window.Reflect === undefined ||\r\n window.customElements === undefined ||\r\n // The webcomponentsjs custom elements polyfill doesn't require\r\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\r\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\r\n ) {\r\n return\r\n }\r\n const BuiltInHTMLElement = HTMLElement\r\n window.HTMLElement = function HTMLElement() {\r\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n }\r\n HTMLElement.prototype = BuiltInHTMLElement.prototype\r\n HTMLElement.prototype.constructor = HTMLElement\r\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\nexport function cssToDom(css) {\r\n const node = document.createElement('style')\r\n node.textContent = css\r\n return node\r\n}\r\n\r\nexport function npn(str) {\r\n return str.replace(/-(\\w)/g, ($, $1) => {\r\n return $1.toUpperCase()\r\n })\r\n}\r\n\r\nexport function extend(obj, props) {\r\n for (let i in props) obj[i] = props[i]\r\n return obj\r\n}\r\n\r\n/** Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} [ref=null]\r\n * @param {any} [value]\r\n */\r\nexport function applyRef(ref, value) {\r\n if (ref != null) {\r\n if (typeof ref == 'function') ref(value)\r\n else ref.current = value\r\n }\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n * @type {(callback: function) => void}\r\n */\r\nexport const defer =\r\n typeof Promise == 'function'\r\n ? Promise.resolve().then.bind(Promise.resolve())\r\n : setTimeout\r\n\r\nexport function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props) {\r\n if (!props || isArray(props)) return {}\r\n const result = {}\r\n Object.keys(props).forEach(key => {\r\n result[key] = props[key].value\r\n })\r\n return result\r\n}\r\n","import { extend } from '../util'\r\n\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n return node.splitText !== undefined\r\n }\r\n if (typeof vnode.nodeName === 'string') {\r\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n }\r\n return hydrating || node._componentConstructor === vnode.nodeName\r\n}\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n return (\r\n node.normalizedNodeName === nodeName ||\r\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\r\n )\r\n}\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n let props = extend({}, vnode.attributes)\r\n props.children = vnode.children\r\n\r\n let defaultProps = vnode.nodeName.defaultProps\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i]\r\n }\r\n }\r\n }\r\n\r\n return props\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants'\r\nimport { applyRef } from '../util'\r\nimport options from '../options'\r\n\r\n/**\r\n * Create an element with the given nodeName.\r\n * @param {string} nodeName The DOM node to create\r\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\r\n * namespace.\r\n * @returns {Element} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n /** @type {Element} */\r\n let node = isSvg\r\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\r\n : document.createElement(nodeName)\r\n node.normalizedNodeName = nodeName\r\n return node\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n let parentNode = node.parentNode\r\n if (parentNode) parentNode.removeChild(node)\r\n}\r\n\r\n/**\r\n * Set a named attribute on the given Node, with special behavior for some names\r\n * and event handlers. If `value` is `null`, the attribute/handler will be\r\n * removed.\r\n * @param {Element} node An element to mutate\r\n * @param {string} name The name/key to set, such as an event or attribute name\r\n * @param {*} old The last value that was set for this name/node pair\r\n * @param {*} value An attribute value, such as a function to be used as an\r\n * event handler\r\n * @param {boolean} isSvg Are we currently diffing inside an svg?\r\n * @private\r\n */\r\nexport function setAccessor(node, name, old, value, isSvg) {\r\n if (name === 'className') name = 'class'\r\n\r\n if (name === 'key') {\r\n // ignore\r\n } else if (name === 'ref') {\r\n applyRef(old, null)\r\n applyRef(value, node)\r\n } else if (name === 'class' && !isSvg) {\r\n node.className = value || ''\r\n } else if (name === 'style') {\r\n if (!value || typeof value === 'string' || typeof old === 'string') {\r\n node.style.cssText = value || ''\r\n }\r\n if (value && typeof value === 'object') {\r\n if (typeof old !== 'string') {\r\n for (let i in old) if (!(i in value)) node.style[i] = ''\r\n }\r\n for (let i in value) {\r\n node.style[i] =\r\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\r\n ? value[i] + 'px'\r\n : value[i]\r\n }\r\n }\r\n } else if (name === 'dangerouslySetInnerHTML') {\r\n if (value) node.innerHTML = value.__html || ''\r\n } else if (name[0] == 'o' && name[1] == 'n') {\r\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\r\n name = name.toLowerCase().substring(2)\r\n if (value) {\r\n if (!old) {\r\n node.addEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.addEventListener('touchstart', touchStart, useCapture)\r\n node.addEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n } else {\r\n node.removeEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.removeEventListener('touchstart', touchStart, useCapture)\r\n node.removeEventListener('touchstart', touchEnd, useCapture)\r\n }\r\n }\r\n ;(node._listeners || (node._listeners = {}))[name] = value\r\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\r\n // Attempt to set a DOM property to the given value.\r\n // IE & FF throw for certain property-value combinations.\r\n try {\r\n node[name] = value == null ? '' : value\r\n } catch (e) {}\r\n if ((value == null || value === false) && name != 'spellcheck')\r\n node.removeAttribute(name)\r\n } else {\r\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\r\n // spellcheck is treated differently than all other boolean values and\r\n // should not be removed when the value is `false`. See:\r\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n if (value == null || value === false) {\r\n if (ns)\r\n node.removeAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase()\r\n )\r\n else node.removeAttribute(name)\r\n } else if (typeof value === 'string') {\r\n if (ns) {\r\n node.setAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase(),\r\n value\r\n )\r\n } else {\r\n node.setAttribute(name, value)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n return this._listeners[e.type]((options.event && options.event(e)) || e)\r\n}\r\n\r\nfunction touchStart(e) {\r\n this.___touchX = e.touches[0].pageX\r\n this.___touchY = e.touches[0].pageY\r\n this.___scrollTop = document.body.scrollTop\r\n}\r\n\r\nfunction touchEnd(e) {\r\n if (\r\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\r\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\r\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\r\n ) {\r\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\r\n }\r\n}\r\n","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn, isArray } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n let ret\r\n if (!diffLevel++) {\r\n // when first starting the diff, check if we're diffing an SVG or within an SVG\r\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\r\n\r\n // hydration is indicated by the existing element to be diffed not having a prop cache\r\n hydrating = dom != null && !(ATTR_KEY in dom)\r\n }\r\n if (isArray(vnode)) {\r\n ret = []\r\n let parentNode = null\r\n if (isArray(dom)) {\r\n let domLength = dom.length\r\n let vnodeLength = vnode.length\r\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\r\n parentNode = dom[0].parentNode\r\n for (let i = 0; i < maxLength; i++) {\r\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\r\n ret.push(ele)\r\n if (i > domLength - 1) {\r\n parentNode.appendChild(ele)\r\n }\r\n }\r\n } else {\r\n vnode.forEach(function(item) {\r\n let ele = idiff(dom, item, context, mountAll, componentRoot)\r\n ret.push(ele)\r\n parent && parent.appendChild(ele)\r\n })\r\n }\r\n } else {\r\n if (isArray(dom)) {\r\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\r\n } else {\r\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n }\r\n // append the element if its a new parent\r\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\r\n }\r\n\r\n // diffLevel being reduced to 0 means we're exiting the diff\r\n if (!--diffLevel) {\r\n hydrating = false\r\n // invoke queued componentDidMount lifecycle methods\r\n }\r\n\r\n return ret\r\n}\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n if (dom && vnode && dom.props) {\r\n dom.props.children = vnode.children\r\n }\r\n let out = dom,\r\n prevSvgMode = isSvgMode\r\n\r\n // empty values (null, undefined, booleans) render as empty Text nodes\r\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\r\n\r\n // Fast case: Strings & Numbers create/update Text nodes.\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n // update if it's already a Text node:\r\n if (\r\n dom &&\r\n dom.splitText !== undefined &&\r\n dom.parentNode &&\r\n (!dom._component || componentRoot)\r\n ) {\r\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n if (dom.nodeValue != vnode) {\r\n dom.nodeValue = vnode\r\n }\r\n } else {\r\n // it wasn't a Text node: replace it with one and recycle the old Element\r\n out = document.createTextNode(vnode)\r\n if (dom) {\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n out[ATTR_KEY] = true\r\n\r\n return out\r\n }\r\n\r\n // If the VNode represents a Component, perform a component diff:\r\n let vnodeName = vnode.nodeName\r\n\r\n // Tracks entering and exiting SVG namespace when descending through the tree.\r\n isSvgMode =\r\n vnodeName === 'svg'\r\n ? true\r\n : vnodeName === 'foreignObject'\r\n ? false\r\n : isSvgMode\r\n\r\n // If there's no existing element or it's the wrong type, create a new one:\r\n vnodeName = String(vnodeName)\r\n if (!dom || !isNamedNode(dom, vnodeName)) {\r\n out = createNode(vnodeName, isSvgMode)\r\n\r\n if (dom) {\r\n // move children into the replacement node\r\n while (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n // if the previous Element was mounted into the DOM, replace it inline\r\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n // recycle the old element (skips non-Element node types)\r\n recollectNodeTree(dom, true)\r\n }\r\n }\r\n\r\n let fc = out.firstChild,\r\n props = out[ATTR_KEY],\r\n vchildren = vnode.children\r\n\r\n if (props == null) {\r\n props = out[ATTR_KEY] = {}\r\n for (let a = out.attributes, i = a.length; i--; )\r\n props[a[i].name] = a[i].value\r\n }\r\n\r\n // Optimization: fast-path for elements containing a single TextNode:\r\n if (\r\n !hydrating &&\r\n vchildren &&\r\n vchildren.length === 1 &&\r\n typeof vchildren[0] === 'string' &&\r\n fc != null &&\r\n fc.splitText !== undefined &&\r\n fc.nextSibling == null\r\n ) {\r\n if (fc.nodeValue != vchildren[0]) {\r\n fc.nodeValue = vchildren[0]\r\n }\r\n }\r\n // otherwise, if there are existing or new children, diff them:\r\n else if ((vchildren && vchildren.length) || fc != null) {\r\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\r\n innerDiffNode(\r\n out,\r\n vchildren,\r\n context,\r\n mountAll,\r\n hydrating || props.dangerouslySetInnerHTML != null\r\n )\r\n }\r\n }\r\n\r\n // Apply attributes/props from VNode to the DOM Element:\r\n diffAttributes(out, vnode.attributes, props, vnode.children)\r\n if (out.props) {\r\n out.props.children = vnode.children\r\n }\r\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n isSvgMode = prevSvgMode\r\n\r\n return out\r\n}\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n let originalChildren = dom.childNodes,\r\n children = [],\r\n keyed = {},\r\n keyedLen = 0,\r\n min = 0,\r\n len = originalChildren.length,\r\n childrenLen = 0,\r\n vlen = vchildren ? vchildren.length : 0,\r\n j,\r\n c,\r\n f,\r\n vchild,\r\n child\r\n\r\n // Build up a map of keyed children and an Array of unkeyed children:\r\n if (len !== 0) {\r\n for (let i = 0; i < len; i++) {\r\n let child = originalChildren[i],\r\n props = child[ATTR_KEY],\r\n key =\r\n vlen && props\r\n ? child._component\r\n ? child._component.__key\r\n : props.key\r\n : null\r\n if (key != null) {\r\n keyedLen++\r\n keyed[key] = child\r\n } else if (\r\n props ||\r\n (child.splitText !== undefined\r\n ? isHydrating\r\n ? child.nodeValue.trim()\r\n : true\r\n : isHydrating)\r\n ) {\r\n children[childrenLen++] = child\r\n }\r\n }\r\n }\r\n\r\n if (vlen !== 0) {\r\n for (let i = 0; i < vlen; i++) {\r\n vchild = vchildren[i]\r\n child = null\r\n\r\n // attempt to find a node based on key matching\r\n let key = vchild.key\r\n if (key != null) {\r\n if (keyedLen && keyed[key] !== undefined) {\r\n child = keyed[key]\r\n keyed[key] = undefined\r\n keyedLen--\r\n }\r\n }\r\n // attempt to pluck a node of the same type from the existing children\r\n else if (!child && min < childrenLen) {\r\n for (j = min; j < childrenLen; j++) {\r\n if (\r\n children[j] !== undefined &&\r\n isSameNodeType((c = children[j]), vchild, isHydrating)\r\n ) {\r\n child = c\r\n children[j] = undefined\r\n if (j === childrenLen - 1) childrenLen--\r\n if (j === min) min++\r\n break\r\n }\r\n }\r\n }\r\n\r\n // morph the matched/found/created DOM child to match vchild (deep)\r\n child = idiff(child, vchild, context, mountAll)\r\n\r\n f = originalChildren[i]\r\n if (child && child !== dom && child !== f) {\r\n if (f == null) {\r\n dom.appendChild(child)\r\n } else if (child === f.nextSibling) {\r\n removeNode(f)\r\n } else {\r\n dom.insertBefore(child, f)\r\n }\r\n }\r\n }\r\n }\r\n\r\n // remove unused keyed children:\r\n if (keyedLen) {\r\n for (let i in keyed)\r\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\r\n }\r\n\r\n // remove orphaned unkeyed children:\r\n while (min <= childrenLen) {\r\n if ((child = children[childrenLen--]) !== undefined)\r\n recollectNodeTree(child, false)\r\n }\r\n}\r\n\r\n/** Recursively recycle (or just unmount) a node and its descendants.\r\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\r\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\r\n */\r\nexport function recollectNodeTree(node, unmountOnly) {\r\n // If the node's VNode had a ref function, invoke it with null here.\r\n // (this is part of the React spec, and smart for unsetting references)\r\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\r\n\r\n if (unmountOnly === false || node[ATTR_KEY] == null) {\r\n removeNode(node)\r\n }\r\n\r\n removeChildren(node)\r\n}\r\n\r\n/** Recollect/unmount all children.\r\n *\t- we use .lastChild here because it causes less reflow than .firstChild\r\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\r\n */\r\nexport function removeChildren(node) {\r\n node = node.lastChild\r\n while (node) {\r\n let next = node.previousSibling\r\n recollectNodeTree(node, true)\r\n node = next\r\n }\r\n}\r\n\r\n/** Apply differences in attributes from a VNode to the given DOM Element.\r\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\r\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\r\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\r\n */\r\nfunction diffAttributes(dom, attrs, old, children) {\r\n let name\r\n let update = false\r\n let isWeElement = dom.update\r\n // remove attributes no longer present on the vnode by setting them to undefined\r\n for (name in old) {\r\n if (!(attrs && attrs[name] != null) && old[name] != null) {\r\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\r\n if (isWeElement) {\r\n delete dom.props[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n // add new & update changed attributes\r\n for (name in attrs) {\r\n //diable when using store system?\r\n //!dom.store &&\r\n if (isWeElement && typeof attrs[name] === 'object') {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n } else if (\r\n name !== 'children' &&\r\n name !== 'innerHTML' &&\r\n (!(name in old) ||\r\n attrs[name] !==\r\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\r\n ) {\r\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\r\n if (isWeElement) {\r\n dom.props[npn(name)] = attrs[name]\r\n update = true\r\n }\r\n }\r\n }\r\n\r\n if (isWeElement && dom.parentNode) {\r\n if (update || children.length > 0) {\r\n dom.receiveProps(dom.props, dom.data)\r\n dom.update()\r\n }\r\n }\r\n}\r\n","const callbacks = []\r\nconst nextTickCallback = []\r\n\r\nexport function tick(fn, scope) {\r\n callbacks.push({ fn, scope })\r\n}\r\n\r\nexport function fireTick() {\r\n callbacks.forEach(item => {\r\n item.fn.call(item.scope)\r\n })\r\n\r\n nextTickCallback.forEach(nextItem => {\r\n nextItem.fn.call(nextItem.scope)\r\n })\r\n nextTickCallback.length = 0\r\n}\r\n\r\nexport function nextTick(fn, scope) {\r\n nextTickCallback.push({ fn, scope })\r\n}\r\n","import JSONProxy from './proxy'\r\nimport { fireTick } from './tick'\r\n\r\nexport function observe(target) {\r\n target.observe = true\r\n}\r\n\r\nexport function proxyUpdate(ele) {\r\n let timeout = null\r\n ele.data = new JSONProxy(ele.data).observe(false, info => {\r\n if (\r\n ele._willUpdate ||\r\n (info.op === 'replace' && info.oldValue === info.value)\r\n ) {\r\n return\r\n }\r\n\r\n clearTimeout(timeout)\r\n\r\n timeout = setTimeout(() => {\r\n ele.update()\r\n fireTick()\r\n }, 0)\r\n })\r\n}\r\n","import { cssToDom, nProps, isArray } from './util'\r\nimport { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport { proxyUpdate } from './observe'\r\n\r\nlet id = 0\r\n\r\nexport default class WeElement extends HTMLElement {\r\n static is = 'WeElement'\r\n\r\n constructor() {\r\n super()\r\n this.props = Object.assign(\r\n nProps(this.constructor.props),\r\n this.constructor.defaultProps\r\n )\r\n this.__elementId = id++\r\n this.data = this.constructor.data || {}\r\n }\r\n\r\n connectedCallback() {\r\n if (!this.constructor.pure) {\r\n let p = this.parentNode\r\n while (p && !this.store) {\r\n this.store = p.store\r\n p = p.parentNode || p.host\r\n }\r\n if (this.store) {\r\n this.store.instances.push(this)\r\n }\r\n }\r\n this.beforeInstall()\r\n !this._isInstalled && this.install()\r\n this.afterInstall()\r\n let shadowRoot\r\n if (!this.shadowRoot) {\r\n shadowRoot = this.attachShadow({\r\n mode: 'open'\r\n })\r\n } else {\r\n shadowRoot = this.shadowRoot\r\n let fc\r\n while ((fc = shadowRoot.firstChild)) {\r\n shadowRoot.removeChild(fc)\r\n }\r\n }\r\n\r\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\r\n !this._isInstalled && this.beforeRender()\r\n options.afterInstall && options.afterInstall(this)\r\n if (this.constructor.observe) {\r\n this.beforeObserve()\r\n proxyUpdate(this)\r\n this.observed()\r\n }\r\n this.host = diff(\r\n null,\r\n this.render(this.props, this.data, this.store),\r\n {},\r\n false,\r\n null,\r\n false\r\n )\r\n this.rendered()\r\n if (isArray(this.host)) {\r\n this.host.forEach(function(item) {\r\n shadowRoot.appendChild(item)\r\n })\r\n } else {\r\n shadowRoot.appendChild(this.host)\r\n }\r\n !this._isInstalled && this.installed()\r\n this._isInstalled = true\r\n }\r\n\r\n disconnectedCallback() {\r\n this.uninstall()\r\n this._isInstalled = false\r\n if (this.store) {\r\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\r\n if (this.store.instances[i] === this) {\r\n this.store.instances.splice(i, 1)\r\n break\r\n }\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n this._willUpdate = true\r\n this.beforeUpdate()\r\n this.beforeRender()\r\n this.host = diff(\r\n this.host,\r\n this.render(this.props, this.data, this.store),\r\n null,\r\n null,\r\n this.shadowRoot\r\n )\r\n this.afterUpdate()\r\n this.updated()\r\n this._willUpdate = false\r\n }\r\n\r\n fire(name, data) {\r\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\r\n }\r\n\r\n beforeInstall() {}\r\n\r\n install() {}\r\n\r\n afterInstall() {}\r\n\r\n installed() {}\r\n\r\n uninstall() {}\r\n\r\n beforeUpdate() {}\r\n\r\n afterUpdate() {} //deprecated, please use updated\r\n\r\n updated() {}\r\n\r\n beforeRender() {}\r\n\r\n rendered() {}\r\n\r\n receiveProps() {}\r\n\r\n beforeObserve() {}\r\n\r\n observed() {}\r\n}\r\n","import { diff } from './vdom/diff'\r\nimport JSONProxy from './proxy'\r\n\r\nexport function render(vnode, parent, store) {\r\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n if (store) {\r\n store.instances = []\r\n extendStoreUpate(store)\r\n let timeout = null\r\n let patchs = {}\r\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\r\n clearTimeout(timeout)\r\n if (patch.op === 'remove') {\r\n // fix arr splice\r\n const kv = getArrayPatch(patch.path, store)\r\n patchs[kv.k] = kv.v\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n } else {\r\n const key = fixPath(patch.path)\r\n patchs[key] = patch.value\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n }\r\n })\r\n parent.store = store\r\n }\r\n return diff(null, vnode, {}, false, parent, false)\r\n}\r\n\r\nfunction update(patch, store) {\r\n store.update(patch)\r\n}\r\n\r\nfunction extendStoreUpate(store) {\r\n store.update = function(patch) {\r\n const updateAll = matchGlobalData(this.globalData, patch)\r\n\r\n if (Object.keys(patch).length > 0) {\r\n this.instances.forEach(instance => {\r\n if (\r\n updateAll ||\r\n this.updateAll ||\r\n (instance.constructor.updatePath &&\r\n needUpdate(patch, instance.constructor.updatePath))\r\n ) {\r\n instance.update()\r\n }\r\n })\r\n this.onChange && this.onChange(patch)\r\n }\r\n }\r\n}\r\n\r\nexport function matchGlobalData(globalData, diffResult) {\r\n if (!globalData) return false\r\n for (let keyA in diffResult) {\r\n if (globalData.indexOf(keyA) > -1) {\r\n return true\r\n }\r\n for (let i = 0, len = globalData.length; i < len; i++) {\r\n if (includePath(keyA, globalData[i])) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function needUpdate(diffResult, updatePath) {\r\n for (let keyA in diffResult) {\r\n if (updatePath[keyA]) {\r\n return true\r\n }\r\n for (let keyB in updatePath) {\r\n if (includePath(keyA, keyB)) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nfunction includePath(pathA, pathB) {\r\n if (pathA.indexOf(pathB) === 0) {\r\n const next = pathA.substr(pathB.length, 1)\r\n if (next === '[' || next === '.') {\r\n return true\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function fixPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n arr.forEach((item, index) => {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n })\r\n return mpPath\r\n}\r\n\r\nfunction getArrayPatch(path, store) {\r\n const arr = path.replace('/', '').split('/')\r\n let current = store.data[arr[0]]\r\n for (let i = 1, len = arr.length; i < len - 1; i++) {\r\n current = current[arr[i]]\r\n }\r\n return { k: fixArrPath(path), v: current }\r\n}\r\n\r\nfunction fixArrPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n const len = arr.length\r\n arr.forEach((item, index) => {\r\n if (index < len - 1) {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n }\r\n })\r\n return mpPath\r\n}\r\n","import WeElement from './we-element'\r\nimport { cssToDom } from './util'\r\n\r\nconst OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n if (ctor.is === 'WeElement') {\r\n customElements.define(name, ctor)\r\n if (ctor.data && !ctor.pure) {\r\n ctor.updatePath = getUpdatePath(ctor.data)\r\n }\r\n } else {\r\n class Element extends WeElement {\r\n _useId = 0\r\n\r\n _useMap = {}\r\n\r\n render(props, data) {\r\n return ctor.call(this, props, data)\r\n }\r\n\r\n beforeRender() {\r\n this._useId = 0\r\n }\r\n\r\n useCss(css) {\r\n const style = this.shadowRoot.querySelector('style')\r\n style && this.shadowRoot.removeChild(style)\r\n this.shadowRoot.appendChild(cssToDom(css))\r\n }\r\n\r\n useData(data) {\r\n return this.use({ data: data })\r\n }\r\n\r\n use(option) {\r\n this._useId++\r\n const updater = newValue => {\r\n const item = this._useMap[updater.id]\r\n\r\n item.data = newValue\r\n\r\n this.update()\r\n item.effect && item.effect()\r\n }\r\n\r\n updater.id = this._useId\r\n if (!this._isInstalled) {\r\n this._useMap[this._useId] = option\r\n return [option.data, updater]\r\n }\r\n\r\n return [this._useMap[this._useId].data, updater]\r\n }\r\n\r\n installed() {\r\n this._isInstalled = true\r\n }\r\n }\r\n customElements.define(name, Element)\r\n }\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n const result = {}\r\n dataToPath(data, result)\r\n return result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n Object.keys(data).forEach(key => {\r\n result[key] = true\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n Object.keys(data).forEach(key => {\r\n result[path + '.' + key] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], path + '.' + key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], path + '.' + key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n data.forEach((item, index) => {\r\n result[path + '[' + index + ']'] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(item)\r\n if (type === OBJECTTYPE) {\r\n _objToPath(item, path + '[' + index + ']', result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(item, path + '[' + index + ']', result)\r\n }\r\n })\r\n}\r\n","import { extend } from './util'\r\nimport { h } from './h'\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n return h(\r\n vnode.nodeName,\r\n extend(extend({}, vnode.attributes), props),\r\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\r\n )\r\n}\r\n","export function getHost(ele) {\r\n let p = ele.parentNode\r\n while (p) {\r\n if (p.host) {\r\n return p.host\r\n } else {\r\n p = p.parentNode\r\n }\r\n }\r\n}\r\n","export function rpx(str) {\r\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\r\n return (window.innerWidth * Number(b)) / 750 + 'px'\r\n })\r\n}\r\n","function getGlobal() {\r\n if (\r\n typeof global !== 'object' ||\r\n !global ||\r\n global.Math !== Math ||\r\n global.Array !== Array\r\n ) {\r\n return (\r\n self ||\r\n window ||\r\n global ||\r\n (function() {\r\n return this\r\n })()\r\n )\r\n }\r\n return global\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n store: null,\r\n root: getGlobal()\r\n}\r\n","/*!\r\n * https://github.com/Palindrom/JSONPatcherProxy\r\n * (c) 2017 Starcounter\r\n * MIT license\r\n */\r\n\r\n/** Class representing a JS Object observer */\r\nconst JSONPatcherProxy = (function() {\r\n /**\r\n * Deep clones your object and returns a new object.\r\n */\r\n function deepClone(obj) {\r\n switch (typeof obj) {\r\n case 'object':\r\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\r\n case 'undefined':\r\n return null //this is how JSON.stringify behaves for array items\r\n default:\r\n return obj //no need to clone primitives\r\n }\r\n }\r\n JSONPatcherProxy.deepClone = deepClone\r\n\r\n function escapePathComponent(str) {\r\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\r\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\r\n }\r\n JSONPatcherProxy.escapePathComponent = escapePathComponent\r\n\r\n /**\r\n * Walk up the parenthood tree to get the path\r\n * @param {JSONPatcherProxy} instance\r\n * @param {Object} obj the object you need to find its path\r\n */\r\n function findObjectPath(instance, obj) {\r\n const pathComponents = []\r\n let parentAndPath = instance.parenthoodMap.get(obj)\r\n while (parentAndPath && parentAndPath.path) {\r\n // because we're walking up-tree, we need to use the array as a stack\r\n pathComponents.unshift(parentAndPath.path)\r\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\r\n }\r\n if (pathComponents.length) {\r\n const path = pathComponents.join('/')\r\n return '/' + path\r\n }\r\n return ''\r\n }\r\n /**\r\n * A callback to be used as th proxy set trap callback.\r\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the affected object\r\n * @param {String} key the effect property's name\r\n * @param {Any} newValue the value being set\r\n */\r\n function setTrap(instance, target, key, newValue) {\r\n const parentPath = findObjectPath(instance, target)\r\n\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n if (instance.proxifiedObjectsMap.has(newValue)) {\r\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\r\n\r\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\r\n parent: target,\r\n path: key\r\n })\r\n }\r\n /*\r\n mark already proxified values as inherited.\r\n rationale: proxy.arr.shift()\r\n will emit\r\n {op: replace, path: '/arr/1', value: arr_2}\r\n {op: remove, path: '/arr/2'}\r\n\r\n by default, the second operation would revoke the proxy, and this renders arr revoked.\r\n That's why we need to remember the proxies that are inherited.\r\n */\r\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\r\n /*\r\n Why do we need to check instance.isProxifyingTreeNow?\r\n\r\n We need to make sure we mark revokables as inherited ONLY when we're observing,\r\n because throughout the first proxification, a sub-object is proxified and then assigned to\r\n its parent object. This assignment of a pre-proxified object can fool us into thinking\r\n that it's a proxified object moved around, while in fact it's the first assignment ever.\r\n\r\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\r\n but in fact is is a proxified object moved around the tree\r\n */\r\n if (revokableInstance && !instance.isProxifyingTreeNow) {\r\n revokableInstance.inherited = true\r\n }\r\n\r\n // if the new value is an object, make sure to watch it\r\n if (\r\n newValue &&\r\n typeof newValue == 'object' &&\r\n !instance.proxifiedObjectsMap.has(newValue)\r\n ) {\r\n instance.parenthoodMap.set(newValue, {\r\n parent: target,\r\n path: key\r\n })\r\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\r\n }\r\n // let's start with this operation, and may or may not update it later\r\n const operation = {\r\n op: 'remove',\r\n path: destinationPropKey\r\n }\r\n if (typeof newValue == 'undefined') {\r\n // applying De Morgan's laws would be a tad faster, but less readable\r\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\r\n // `undefined` is being set to an already undefined value, keep silent\r\n return Reflect.set(target, key, newValue)\r\n }\r\n // when array element is set to `undefined`, should generate replace to `null`\r\n if (Array.isArray(target)) {\r\n // undefined array elements are JSON.stringified to `null`\r\n ;(operation.op = 'replace'), (operation.value = null)\r\n }\r\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\r\n // was the deleted a proxified object?\r\n if (oldValue) {\r\n instance.parenthoodMap.delete(target[key])\r\n instance.disableTrapsForProxy(oldValue)\r\n instance.proxifiedObjectsMap.delete(oldValue)\r\n }\r\n } else {\r\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\r\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\r\n if (key != 'length') {\r\n console.warn(\r\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\r\n )\r\n }\r\n return Reflect.set(target, key, newValue)\r\n }\r\n operation.op = 'add'\r\n if (target.hasOwnProperty(key)) {\r\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\r\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\r\n }\r\n }\r\n operation.value = newValue\r\n }\r\n operation.oldValue = target[key]\r\n const reflectionResult = Reflect.set(target, key, newValue)\r\n instance.defaultCallback(operation)\r\n return reflectionResult\r\n }\r\n /**\r\n * A callback to be used as th proxy delete trap callback.\r\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the effected object\r\n * @param {String} key the effected property's name\r\n */\r\n function deleteTrap(instance, target, key) {\r\n if (typeof target[key] !== 'undefined') {\r\n const parentPath = findObjectPath(instance, target)\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\r\n target[key]\r\n )\r\n\r\n if (revokableProxyInstance) {\r\n if (revokableProxyInstance.inherited) {\r\n /*\r\n this is an inherited proxy (an already proxified object that was moved around),\r\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\r\n And we know that because we mark moved proxies with `inherited` flag when we move them\r\n\r\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\r\n We DO want to revoke the proxy if it was removed again.\r\n */\r\n revokableProxyInstance.inherited = false\r\n } else {\r\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\r\n instance.disableTrapsForProxy(revokableProxyInstance)\r\n instance.proxifiedObjectsMap.delete(target[key])\r\n }\r\n }\r\n const reflectionResult = Reflect.deleteProperty(target, key)\r\n\r\n instance.defaultCallback({\r\n op: 'remove',\r\n path: destinationPropKey\r\n })\r\n\r\n return reflectionResult\r\n }\r\n }\r\n /* pre-define resume and pause functions to enhance constructors performance */\r\n function resume() {\r\n this.defaultCallback = operation => {\r\n this.isRecording && this.patches.push(operation)\r\n this.userCallback && this.userCallback(operation)\r\n }\r\n this.isObserving = true\r\n }\r\n function pause() {\r\n this.defaultCallback = () => {}\r\n this.isObserving = false\r\n }\r\n /**\r\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\r\n * @param {Object|Array} root - the object you want to wrap\r\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\r\n * @returns {JSONPatcherProxy}\r\n * @constructor\r\n */\r\n function JSONPatcherProxy(root, showDetachedWarning) {\r\n this.isProxifyingTreeNow = false\r\n this.isObserving = false\r\n this.proxifiedObjectsMap = new Map()\r\n this.parenthoodMap = new Map()\r\n // default to true\r\n if (typeof showDetachedWarning !== 'boolean') {\r\n showDetachedWarning = true\r\n }\r\n\r\n this.showDetachedWarning = showDetachedWarning\r\n this.originalObject = root\r\n this.cachedProxy = null\r\n this.isRecording = false\r\n this.userCallback\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Restores callback back to the original one provided to `observe`.\r\n */\r\n this.resume = resume.bind(this)\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Replaces your callback with a noop function.\r\n */\r\n this.pause = pause.bind(this)\r\n }\r\n\r\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\r\n if (!obj) {\r\n return obj\r\n }\r\n const traps = {\r\n set: (target, key, value, receiver) =>\r\n setTrap(this, target, key, value, receiver),\r\n deleteProperty: (target, key) => deleteTrap(this, target, key)\r\n }\r\n const revocableInstance = Proxy.revocable(obj, traps)\r\n // cache traps object to disable them later.\r\n revocableInstance.trapsInstance = traps\r\n revocableInstance.originalObject = obj\r\n\r\n /* keeping track of object's parent and path */\r\n\r\n this.parenthoodMap.set(obj, { parent, path })\r\n\r\n /* keeping track of all the proxies to be able to revoke them later */\r\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\r\n return revocableInstance.proxy\r\n }\r\n // grab tree's leaves one by one, encapsulate them into a proxy and return\r\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\r\n parent,\r\n root,\r\n path\r\n ) {\r\n for (let key in root) {\r\n if (root.hasOwnProperty(key)) {\r\n if (root[key] instanceof Object) {\r\n root[key] = this._proxifyObjectTreeRecursively(\r\n root,\r\n root[key],\r\n escapePathComponent(key)\r\n )\r\n }\r\n }\r\n }\r\n return this.generateProxyAtPath(parent, root, path)\r\n }\r\n // this function is for aesthetic purposes\r\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\r\n /*\r\n while proxyifying object tree,\r\n the proxyifying operation itself is being\r\n recorded, which in an unwanted behavior,\r\n that's why we disable recording through this\r\n initial process;\r\n */\r\n this.pause()\r\n this.isProxifyingTreeNow = true\r\n const proxifiedObject = this._proxifyObjectTreeRecursively(\r\n undefined,\r\n root,\r\n ''\r\n )\r\n /* OK you can record now */\r\n this.isProxifyingTreeNow = false\r\n this.resume()\r\n return proxifiedObject\r\n }\r\n /**\r\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\r\n * @param {Proxy} proxy - The target proxy object\r\n */\r\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\r\n revokableProxyInstance\r\n ) {\r\n if (this.showDetachedWarning) {\r\n const message =\r\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\r\n\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.deleteProperty = (\r\n targetObject,\r\n propKey\r\n ) => {\r\n return Reflect.deleteProperty(targetObject, propKey)\r\n }\r\n } else {\r\n delete revokableProxyInstance.trapsInstance.set\r\n delete revokableProxyInstance.trapsInstance.get\r\n delete revokableProxyInstance.trapsInstance.deleteProperty\r\n }\r\n }\r\n /**\r\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\r\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\r\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\r\n */\r\n JSONPatcherProxy.prototype.observe = function(record, callback) {\r\n if (!record && !callback) {\r\n throw new Error('You need to either record changes or pass a callback')\r\n }\r\n this.isRecording = record\r\n this.userCallback = callback\r\n /*\r\n I moved it here to remove it from `unobserve`,\r\n this will also make the constructor faster, why initiate\r\n the array before they decide to actually observe with recording?\r\n They might need to use only a callback.\r\n */\r\n if (record) this.patches = []\r\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\r\n return this.cachedProxy\r\n }\r\n /**\r\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\r\n */\r\n JSONPatcherProxy.prototype.generate = function() {\r\n if (!this.isRecording) {\r\n throw new Error('You should set record to true to get patches later')\r\n }\r\n return this.patches.splice(0, this.patches.length)\r\n }\r\n /**\r\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\r\n */\r\n JSONPatcherProxy.prototype.revoke = function() {\r\n this.proxifiedObjectsMap.forEach(el => {\r\n el.revoke()\r\n })\r\n }\r\n /**\r\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\r\n */\r\n JSONPatcherProxy.prototype.disableTraps = function() {\r\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\r\n }\r\n return JSONPatcherProxy\r\n})()\r\n\r\nexport default JSONPatcherProxy\r\n","import WeElement from './we-element'\r\n\r\nexport default class ModelView extends WeElement {\r\n static observe = true\r\n\r\n beforeInstall() {\r\n this.data = this.vm.data\r\n }\r\n\r\n observed() {\r\n this.vm.data = this.data\r\n }\r\n}\r\n","import { h, h as createElement } from './h'\r\nimport options from './options'\r\nimport WeElement from './we-element'\r\nimport { render } from './render'\r\nimport { define } from './define'\r\nimport { tag } from './tag'\r\nimport { observe } from './observe'\r\nimport { cloneElement } from './clone-element'\r\nimport { getHost } from './get-host'\r\nimport { rpx } from './rpx'\r\nimport { tick, nextTick } from './tick'\r\nimport ModelView from './model-view'\r\n\r\nconst Component = WeElement\r\n\r\nconst omi = {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n\r\noptions.root.Omi = omi\r\noptions.root.Omi.version = '5.0.2'\r\n\r\nexport default omi\r\n\r\nexport {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/tick.js","../src/observe.js","../src/we-element.js","../src/render.js","../src/define.js","../src/clone-element.js","../src/get-host.js","../src/rpx.js","../src/options.js","../src/proxy.js","../src/model-view.js","../src/omi.js"],"names":["VNode","h","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","String","p","key","options","vnode","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","isArray","Object","prototype","toString","call","nProps","result","keys","forEach","isSameNodeType","hydrating","_componentConstructor","createNode","removeNode","name","isSvg","old","style","cssText","IS_NON_DIMENSIONAL","test","useCapture","substring","toLowerCase","addEventListener","touchStart","touchEnd","eventProxy","removeEventListener","e","removeAttribute","ns","removeAttributeNS","setAttribute","className","this","___touchX","_listeners","type","pageX","___touchY","touches","pageY","Math","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","isSvgMode","parent","ownerSVGElement","dom","ret","vnodeLength","parentNode","domLength","context","mountAll","componentRoot","maxLength","appendChild","ele","idiff","item","out","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","__omiattr_","vchildren","firstChild","fc","a","splitText","nextSibling","constructor","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","min","len","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","_component","__key","trim","isHydrating","c","f","unmountOnly","removeChildren","update","attrs","isWeElement","setAccessor","receiveProps","data","callbacks","fn","scope","tick","nextItem","nextTick","nextTickCallback","target","observe","JSONPatcherProxy","info","clearTimeout","_willUpdate","timeout","setTimeout","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","HTMLElement","WeElement","extendStoreUpate","store","instances","patch","getArrayPatch","JSONProxy","path","v","patchs","diff","_this","updateAll","globalData","matchGlobalData","updatePath","needUpdate","onChange","diffResult","keyA","indexOf","keyB","includePath","pathA","pathB","next","substr","fixPath","mpPath","split","index","arr","fixArrPath","_classCallCheck$1","_possibleConstructorReturn$1","OBJECTTYPE","getUpdatePath","ctor","Element","_WeElement","_len","args","Array","render","beforeRender","_useId","useCss","_preCss","shadowRoot","querySelector","useData","use","_this2","updater","newValue","_useMap","id","effect","installed","_isInstalled","customElements","define","dataToPath","_objToPath","_arrayToPath","ARRAYTYPE","cloneElement","rpx","b","_inherits$2","subClass","superClass","create","enumerable","writable","configurable","setPrototypeOf","__proto__","root","global","window","Reflect","hasOwnProperty","BuiltInHTMLElement","construct","Promise","resolve","then","bind","diffLevel","deepClone","JSON","escapePathComponent","pathComponents","parentAndPath","parenthoodMap","get","parentPath","newValueOriginalObject","revokableInstance","inherited","proxifiedObjectsMap","has","set","operation","destinationPropKey","op","oldValue","delete","disableTrapsForProxy","console","warn","reflectionResult","revokableProxyInstance","defaultCallback","resume","patches","userCallback","pause","isObserving","showDetachedWarning","cachedProxy","deleteProperty","deleteTrap","Proxy","revocable","revocableInstance","trapsInstance","traps","originalObject","_proxifyObjectTreeRecursively","proxifyObjectTree","isProxifyingTreeNow","proxifiedObject","targetObject","message","propKey","record","callback","generate","isRecording","revoke","el","disableTraps","assign","defaultProps","connectedCallback","pure","host","beforeInstall","afterInstall","attachShadow","mode","removeChild","proxyUpdate","beforeObserve","observed","disconnectedCallback","uninstall","splice","beforeUpdate","updated","fire","install","afterUpdate","rendered","Component","ModelView","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,yBAEDd,aAAAA,yBAEAc,UAAAA,yBAEAb,UAAAA,yBAEA5F,aAAAA,yBAEAoG,YAAAA,yBAEAE,QAAAA,yBAEAI,aAAAA,yBAEAH,SAAAA,yBAEArH,aAAAA,yBAEAyH,cAAAA,yBAEA9L,SAAAA,gIQ1HE,mIAAKC,GACNwB,iBAIA,IAAAsK,IAAAtK,OAToCA,IAAAA,eAAlBuK,UACZtL,YCUT7J,EAAMkV,kBAENjU,QAAYA,GACVmU,OADU3G,EAEV7D,QAAAA,EACAsK,aAAAA,EACA3H,QAAAA,EACAvN,IALU+O,EAMVxN,KAAAA,EACAN,SAAAA,EACAwN,UAAAA,GAGA4G,IAAAA,KAAAA,IAXUC,GAYVvG,GAAAA,KAZUwG,IAAAC,QAAA,QAAA,mBAcV9L,QAdU+L,OAAAC,QAAAJ,GAAA7K,KAAA8K,IAAAD","file":"omi.min.js","sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n p.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function npn(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n","import { extend } from '../util'\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchstart', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchstart', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value === 'string') {\n if (ns) {\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n } else {\n node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn, isArray } from '../util'\nimport { removeNode } from '../dom/index'\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n if (isArray(vnode)) {\n ret = []\n let parentNode = null\n if (isArray(dom)) {\n let domLength = dom.length\n let vnodeLength = vnode.length\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\n parentNode = dom[0].parentNode\n for (let i = 0; i < maxLength; i++) {\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\n ret.push(ele)\n if (i > domLength - 1) {\n parentNode.appendChild(ele)\n }\n }\n } else {\n vnode.forEach(function(item) {\n let ele = idiff(dom, item, context, mountAll, componentRoot)\n ret.push(ele)\n parent && parent.appendChild(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\n } else {\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, vnode.children)\n if (out.props) {\n out.props.children = vnode.children\n }\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, children) {\n let name\n let update = false\n let isWeElement = dom.update\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n if (isWeElement) {\n delete dom.props[name]\n update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n //diable when using store system?\n //!dom.store &&\n if (isWeElement && typeof attrs[name] === 'object') {\n dom.props[npn(name)] = attrs[name]\n update = true\n } else if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n if (isWeElement) {\n dom.props[npn(name)] = attrs[name]\n update = true\n }\n }\n }\n\n if (isWeElement && dom.parentNode) {\n if (update || children.length > 0) {\n dom.receiveProps(dom.props, dom.data)\n dom.update()\n }\n }\n}\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import JSONProxy from './proxy'\nimport { fireTick } from './tick'\n\nexport function observe(target) {\n target.observe = true\n}\n\nexport function proxyUpdate(ele) {\n let timeout = null\n ele.data = new JSONProxy(ele.data).observe(false, info => {\n if (\n ele._willUpdate ||\n (info.op === 'replace' && info.oldValue === info.value)\n ) {\n return\n }\n\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n })\n}\n","import { cssToDom, nProps, isArray } from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { proxyUpdate } from './observe'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n static is = 'WeElement'\n\n constructor() {\n super()\n this.props = Object.assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps\n )\n this.__elementId = id++\n this.data = this.constructor.data || {}\n }\n\n connectedCallback() {\n if (!this.constructor.pure) {\n let p = this.parentNode\n while (p && !this.store) {\n this.store = p.store\n p = p.parentNode || p.host\n }\n if (this.store) {\n this.store.instances.push(this)\n }\n }\n this.beforeInstall()\n !this._isInstalled && this.install()\n this.afterInstall()\n let shadowRoot\n if (!this.shadowRoot) {\n shadowRoot = this.attachShadow({\n mode: 'open'\n })\n } else {\n shadowRoot = this.shadowRoot\n let fc\n while ((fc = shadowRoot.firstChild)) {\n shadowRoot.removeChild(fc)\n }\n }\n\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\n !this._isInstalled && this.beforeRender()\n options.afterInstall && options.afterInstall(this)\n if (this.constructor.observe) {\n this.beforeObserve()\n proxyUpdate(this)\n this.observed()\n }\n this.host = diff(\n null,\n this.render(this.props, this.data, this.store),\n {},\n false,\n null,\n false\n )\n this.rendered()\n if (isArray(this.host)) {\n this.host.forEach(function(item) {\n shadowRoot.appendChild(item)\n })\n } else {\n shadowRoot.appendChild(this.host)\n }\n !this._isInstalled && this.installed()\n this._isInstalled = true\n }\n\n disconnectedCallback() {\n this.uninstall()\n this._isInstalled = false\n if (this.store) {\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\n if (this.store.instances[i] === this) {\n this.store.instances.splice(i, 1)\n break\n }\n }\n }\n }\n\n update() {\n this._willUpdate = true\n this.beforeUpdate()\n this.beforeRender()\n this.host = diff(\n this.host,\n this.render(this.props, this.data, this.store),\n null,\n null,\n this.shadowRoot\n )\n this.afterUpdate()\n this.updated()\n this._willUpdate = false\n }\n\n fire(name, data) {\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\n }\n\n beforeInstall() {}\n\n install() {}\n\n afterInstall() {}\n\n installed() {}\n\n uninstall() {}\n\n beforeUpdate() {}\n\n afterUpdate() {} //deprecated, please use updated\n\n updated() {}\n\n beforeRender() {}\n\n rendered() {}\n\n receiveProps() {}\n\n beforeObserve() {}\n\n observed() {}\n}\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n clearTimeout(timeout)\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n }\n })\n parent.store = store\n }\n return diff(null, vnode, {}, false, parent, false)\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import WeElement from './we-element'\nimport { cssToDom } from './util'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n if (ctor.data && !ctor.pure) {\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n } else {\n class Element extends WeElement {\n _useId = 0\n\n _useMap = {}\n\n _preCss = null\n\n render(props, data) {\n return ctor.call(this, props, data)\n }\n\n beforeRender() {\n this._useId = 0\n }\n\n useCss(css) {\n if (css === this._preCss) {\n return\n }\n this._preCss = css\n const style = this.shadowRoot.querySelector('style')\n style && this.shadowRoot.removeChild(style)\n this.shadowRoot.appendChild(cssToDom(css))\n }\n\n useData(data) {\n return this.use({ data: data })\n }\n\n use(option) {\n this._useId++\n const updater = newValue => {\n const item = this._useMap[updater.id]\n\n item.data = newValue\n\n this.update()\n item.effect && item.effect()\n }\n\n updater.id = this._useId\n if (!this._isInstalled) {\n this._useMap[this._useId] = option\n return [option.data, updater]\n }\n\n return [this._useMap[this._useId].data, updater]\n }\n\n installed() {\n this._isInstalled = true\n }\n }\n customElements.define(name, Element)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else {\n p = p.parentNode\n }\n }\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function() {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal()\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","import WeElement from './we-element'\n\nexport default class ModelView extends WeElement {\n static observe = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n\n observed() {\n this.vm.data = this.data\n }\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { observe } from './observe'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { tick, nextTick } from './tick'\nimport ModelView from './model-view'\n\nconst Component = WeElement\n\nconst omi = {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n\noptions.root.Omi = omi\noptions.root.Omi.version = '5.0.3'\n\nexport default omi\n\nexport {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView\n}\n"]} \ No newline at end of file