Reference to mobx https://github.com/mobxjs/mobx-react-vue/blob/master/src/observer.js
977026
function observer (componentClass) {
  if (typeof componentClass === 'function' &&
    (!componentClass.prototype || !componentClass.prototype.render) && !componentClass.isReactClass && !React.Component.isPrototypeOf(componentClass)
  ) {
    var ObserverComponent = (function (superclass) {
      function ObserverComponent () {
        superclass.apply(this, arguments);
      }

      if ( superclass ) ObserverComponent.__proto__ = superclass;
      ObserverComponent.prototype = Object.create( superclass && superclass.prototype );
      ObserverComponent.prototype.constructor = ObserverComponent;

      ObserverComponent.prototype.render = function render () {
        return componentClass.call(this, this.props, this.context)
      };

      return ObserverComponent;
    }(React.Component));
    ObserverComponent.displayName = componentClass.displayName || componentClass.name;
    ObserverComponent.contextTypes = componentClass.contextTypes;
    ObserverComponent.propTypes = componentClass.propTypes;
    ObserverComponent.defaultProps = componentClass.defaultProps;
    return observer(ObserverComponent)
  }

  if (!componentClass) {
    throw new Error("Please pass a valid component to 'observer'")
  }

  var target = componentClass.prototype || componentClass;
  mixinLifecycleEvents(target);
  return componentClass
}
433350
function jsxWrapperAST(plugin, ref) {
  const func = t.identifier("func");
  const args = t.identifier("args");

  /**
   * function _jsxWrapper(func, args) {
   *   return {
   *     __jsxDOMWrapper: true,
   *     func: func,
   *     args: args,
   *   };
   * }
   */
  return t.functionExpression(
    ref,
    [func, args],
    t.blockStatement([
      t.returnStatement(t.objectExpression([
        t.objectProperty(t.identifier("__jsxDOMWrapper"), t.booleanLiteral(true)),
        t.objectProperty(func, func),
        t.objectProperty(args, args)
      ]))
    ])
  );
}
77411
function (v) {

/*Line 486 - 'AtomControl.js' */                var vm = this._localViewModel;
/*Line 487 - 'AtomControl.js' */                if (vm && vm.dispose) {
/*Line 488 - 'AtomControl.js' */                    vm.dispose();
/*Line 489 - 'AtomControl.js' */                }

/*Line 491 - 'AtomControl.js' */                this._localViewModel = v;

/*Line 493 - 'AtomControl.js' */                function propogate(e) {
/*Line 494 - 'AtomControl.js' */                    var ae = new ChildEnumerator(e);
/*Line 495 - 'AtomControl.js' */                    while (ae.next()) {
/*Line 496 - 'AtomControl.js' */                        var child = ae.current();
/*Line 497 - 'AtomControl.js' */                        if (child.atomControl && child.atomControl._created) {
/*Line 498 - 'AtomControl.js' */                            var ctrl = child.atomControl;
/*Line 499 - 'AtomControl.js' */                            if (ctrl._localViewModel !== undefined)
/*Line 500 - 'AtomControl.js' */                                continue;
/*Line 501 - 'AtomControl.js' */                            Atom.refresh(ctrl, "localViewModel");
/*Line 502 - 'AtomControl.js' */                        }
/*Line 503 - 'AtomControl.js' */                        propogate(child);
/*Line 504 - 'AtomControl.js' */                    }
/*Line 505 - 'AtomControl.js' */                };
/*Line 506 - 'AtomControl.js' */                propogate(this._element);
/*Line 507 - 'AtomControl.js' */            }
288189
def property_observer(self, name):
        """"""
        def wrapper(fun):
            self.observe_property(name, fun)
            fun.unobserve_mpv_properties = lambda: self.unobserve_property(name, fun)
            return fun
        return wrapper
125648
function (v) {
/*Line 405 - 'AtomItemsControl.js' */                var _this = this;
/*Line 406 - 'AtomItemsControl.js' */                if (this._items) {
/*Line 407 - 'AtomItemsControl.js' */                    this.unbindEvent(this._items, "CollectionChanged", null);
/*Line 408 - 'AtomItemsControl.js' */                }
/*Line 409 - 'AtomItemsControl.js' */                this._items = v;
/*Line 410 - 'AtomItemsControl.js' */                this._filteredItems = null;
/*Line 411 - 'AtomItemsControl.js' */                // try starting observing....
/*Line 412 - 'AtomItemsControl.js' */                if (v != null) {
/*Line 413 - 'AtomItemsControl.js' */                    this.bindEvent(this._items, "CollectionChanged", function () {
/*Line 414 - 'AtomItemsControl.js' */                        _this.onCollectionChangedInternal.apply(_this, arguments);
/*Line 415 - 'AtomItemsControl.js' */                    });
/*Line 416 - 'AtomItemsControl.js' */                    this.onCollectionChangedInternal("refresh", -1, null);
/*Line 417 - 'AtomItemsControl.js' */                }
/*Line 418 - 'AtomItemsControl.js' */            }
547933
function observeRoot(widget, attributes, callback, skipSetState) {
    attributes.forEach(attribute => {
        Object.defineProperty(widget.el, attribute, {
            get() {
                return widget.state[attribute];
            },
            set(value) {
                if (!skipSetState) {
                    widget.setState(attribute, value);
                }
                if (callback) {
                    callback(value);
                }
            }
        });
    });
}
817076
function (vnode, callback) {
    const {
      isArray
    } = utils
    if (isArray(vnode)) {
      if (process.env.NODE_ENV === 'development') {
        console.warn('[vue-render] the ref passed to animation.transitionOnce is a array.')
      }
      vnode = vnode[0]
    }
    const scale = window.weex.config.env.scale
    const info = {
      result: false
    }
    const rectKeys = ['width', 'height', 'top', 'bottom', 'left', 'right']

    function recalc (rect) {
      const res = {}
      rectKeys.forEach(key => {
        if (rect[key]) {
          res[key] = rect[key] / scale
        }
      })
      return res
    }
    if (vnode && vnode === 'viewport') {
      info.result = true
      info.size = recalc({
        width: document.documentElement.clientWidth,
        height: document.documentElement.clientHeight,
        top: 0,
        left: 0,
        right: document.documentElement.clientWidth,
        bottom: document.documentElement.clientHeight
      })
    }
    else if (vnode) {
      const el = vnode instanceof HTMLElement
        ? vnode
        : vnode.$el
      if (el.getBoundingClientRect) {
        info.result = true
        info.size = recalc(el.getBoundingClientRect())
      }
      else {
        info.result = false
      }
    }
    const message = info.result ? info : {
      result: false,
      errMsg: 'Illegal parameter'
    }
    callback && callback(message)
    return message
  }
551632
function compileVueToRn(resource) {
  const code = resource.toString();
  const cparsed = compiler.parseComponent(code, { pad: 'line' });

  // console.log(cparsed);

  let output = '';
  let mappings = '';

  // add react-vue import
  output += `import ${constants.VUE}, { observer as ${
    constants.OBSERVER
    } } from 'vue-native-core'`;
  output += '\n';

  // // add react import
  // output += `import ${constants.REACT} from 'react'`
  // output += '\n';

  // add react-native import
  output += `import ${constants.REACT_NATIVE} from 'react-native'`;
  output += '\n';

  // add prop-type import
  output += `import ${constants.PROP_TYPE} from 'prop-types'`;
  output += '\n';

  // add component builder import
  output += `import { buildNativeComponent as ${
    constants.BUILD_COMPONENT
    } } from 'vue-native-helper'`;
  output += '\n';

  // parse template
  const template = cparsed.template;

  //Consider the start of template for debugging
  //
  let templateStartIndex = code.indexOf("<");
  let tempStringBeforeStart = code.substring(0, templateStartIndex);
  let templateLineNumber = tempStringBeforeStart.split(splitRE).length - 1;

  // Get tags and location of tags from template
  //
  let nodes = [];
  const templateFragments = parse5.parseFragment(cparsed.template.content, { sourceCodeLocationInfo: true });
  if (templateFragments.childNodes) {
    traverse(templateFragments, nodes);
  }


  let templateParsed = DEFAULT_OUTPUT.template;
  if (template) {
    const templateContent = template.content.replace(/\/\/\n/g, '').trim();
    if (templateContent) {
      templateParsed = parseTemplate(templateContent);
    }
  }

  // add render dep import
  output += templateParsed.import;
  output += '\n';

  // parse script
  const script = cparsed.script;
  let scriptParsed = DEFAULT_OUTPUT.script;
  if (script) {
    const scriptContent = script.content.replace(/\/\/\n/g, '').trim();
    scriptParsed = parseScript(scriptContent);
    mappings = generateSourceMap(code);
  }

  if (mappings) {
    // Start of the script content
    //
    var beforeLines = output.split(splitRE).length;
    // Start of the script content of the original code
    //
    var scriptLine = code.slice(0, cparsed.script.start).split(splitRE).length + 1;
    var exportDefaultIndex = code.indexOf('export default');
    var tempString = code.substring(0, exportDefaultIndex);
    var exportDefaultLineNumber = tempString.split('\n').length;
  }

  // add vue options
  output += scriptParsed;
  output += '\n\n';

  var endLines = output.split(splitRE).length - 1;
  for (; scriptLine < endLines; scriptLine++) {
    //Skip export default line
    if (scriptLine !== exportDefaultLineNumber) {
      mappings.addMapping({
        source: mappings._hashedFilename,
        generated: {
          line: beforeLines,
          column: 0
        },
        original: {
          line: scriptLine,
          column: 0
        }
      });
    }
    beforeLines++;
  }

  // add render funtion
  let beautifiedRender = beautify(addvm(templateParsed.render, { indent_size: 2 }));
  output += beautifiedRender;
  output += '\n\n';

  // Get last line of render code
  //
  let renderEndLine = beautifiedRender.split(splitRE).length - 1;

  // Search Elements and postion based on render function
  //
  var reactVueElementRegex = /__react__vue__createElement/;
  let foundLines = lineNumber(beautifiedRender, reactVueElementRegex);
  if (mappings) {
    foundLines.forEach((line, index) => {
      let renderJsLine = endLines + line.number;
      if (foundLines[index + 1]) {
        for (let i = line.number; i < foundLines[index + 1].number; i++) {
          // Add Mapping
          if (nodes[index]) {
            mappings.addMapping({
              source: mappings._hashedFilename,
              generated: {
                line: renderJsLine++,
                column: 0
              },
              original: {
                line: nodes[index].startTag.startLine + templateLineNumber,
                column: 0
              }
            });
          }
        }
      } else if (nodes[index] && nodes[index].startTag) {
        // Last Line
        for (let i = line.number; i < renderEndLine; i++) {
          // Add Mapping
          mappings.addMapping({
            source: mappings._hashedFilename,
            generated: {
              line: renderJsLine++,
              column: 0
            },
            original: {
              line: nodes[index].startTag.startLine + templateLineNumber,
              column: 0
            }
          });
        }
      }
    });
  }

  // parse css
  const styles = cparsed.styles;
  let cssParsed = {};
  styles.forEach(function (v) {
    const cssAst = cssParse(v.content);
    cssParsed = Object.assign({}, cssParsed, parseCss(cssAst));
  });

  // add css obj
  output += `const ${constants.CSS} = ${JSON.stringify(cssParsed)}`;
  output += '\n\n';

  // add builder
  output += `const ${constants.COMPONENT_BUILDED} = ${
    constants.BUILD_COMPONENT
    }(${constants.TEMPLATE_RENDER}, ${constants.SCRIPT_OPTIONS}, {Component: ${
    constants.COMPONENT
    }, PropTypes: ${constants.PROP_TYPE}, Vue: ${constants.VUE}, ReactNative: ${
    constants.REACT_NATIVE
    }, css: ${constants.CSS}})`;
  output += '\n\n';

  // export default
  output += `export default ${constants.OBSERVER}(${
    constants.COMPONENT_BUILDED
    })`;

  // beautiful
  // output = beautify(output, { indent_size: 2 });
  return { output, mappings: mappings ? mappings.toJSON() : null };

  // fs.writeFile(name.replace(FILTER, '.js'), output, function(err) {
  //   if (err) {
  //     throw err;
  //   }
  // });
}
1208824
function makeAccessController(rerun) {
  // `accesses` is a map indexed by object,
  // containing "access" entries with values of `{names: [], observer}`.
  // `names` of null means to watch properties of any name.
  // It is built by calls to `notifyAccess`, invoked through `accessNotifier`.
  var accesses = new Map();

  function unobserve() {
    accesses.forEach(({observer}) => observer.unobserve());
  }

  function observe() {
    accesses.forEach(({observer}) => observer.observe(['update', 'add', 'delete']));
  }

  // Start capturing accessed dependencies.
  function capture() {
    accesses.clear();
    accessNotifier.push(notifyAccess);
  }

  // Stop capturing accessed dependencies.
  function uncapture() {
    accessNotifier.pop();
  }

  function start() {
    unobserve();
    capture();
  }

  function stop() {
    uncapture();
    observe();
  }

  // `notifyAccess` is the callback invoked by upwardables when a property is accessed.
  // It records the access in the `accesses` map.
  function notifyAccess({object, name}) {

    // Create an observer for changes in properties accessed during execution of this function.
    function makeAccessedObserver() {
      return Observer(object, function(changes) {
        changes.forEach(({type, name}) => {
          var {names} = accessEntry;
          if (!names || type === 'update' && names.indexOf(name) !== -1)
            rerun();
        });
      });
    }

    // Make a new entry in the access table, containing initial property name if any
    // and observer for properties accessed on the object.
    function makeAccessEntry() {
      accesses.set(object, {
        names:    name ? [name] : null,
        observer: makeAccessedObserver()
      });
    }

    // If properties on this object are already being watched, there is already an entry
    // in the access table for it. Add a new property name to the existing entry.
    function setAccessEntry() {
      if (name && accessEntry.names) accessEntry.names.push(name);
      else accessEntry.names = null;
    }

    var accessEntry = accesses.get(object);
    if (accessEntry) setAccessEntry();
    else makeAccessEntry();
  }

  return {start, stop};
}
1029638
function PluginDocLink({ plugin, onClick }) {
	  if (!plugin) {
	    return null;
	  }

	  const href = `https://www.npmjs.com/package/${ plugin }`;
	  return React.createElement(
	    "a",
	    { className: "snapshot__helper", target: "_blank", href: href, onClick: onClick },
	    "?"
	  );
	}
1260142
function (fn, cb) {
  return subscribe.call(this, fn, function (value) {
    return VM.createElement(value);
  }, function (value) {
    cb(this.value = VM.setTagName(this.value, value));
  }).value;
}
1160889
function install (_Vue) {
  Vue = _Vue
  Vue.mixin(VueWildMixin)

  var mergeStrats = Vue.config.optionMergeStrategies
  mergeStrats.wilddog = mergeStrats.provide

  // extend instance methods
  Vue.prototype.$bindAsObject = function (key, source, cancelCallback, readyCallback) {
    ensureRefs(this)
    bind(this, key, {
      source: source,
      asObject: true,
      cancelCallback: cancelCallback,
      readyCallback: readyCallback
    })
  }

  Vue.prototype.$bindAsArray = function (key, source, cancelCallback, readyCallback) {
    ensureRefs(this)
    bind(this, key, {
      source: source,
      cancelCallback: cancelCallback,
      readyCallback: readyCallback
    })
  }

  Vue.prototype.$unbind = function (key) {
    unbind(this, key)
  }
}
692980
function collectTargetObservablesAndContext(templateObject) {
  var targets = [];
  var contexts = [];

  /**
   *
   * ```
   *   // context index sample (`x` == Observable)
   *   {
   *     foo: x, // => ['foo']
   *     bar: {
   *       foo: x, // => ['bar', 'foo']
   *       bar: [_, _, x]  // => ['bar', 'bar', 2]
   *     },
   *     baz: [_, x, _], // => ['baz', 1]
   *     qux: {
   *       foo: {
   *         foo: x // => ['qux', 'foo', 'foo']
   *       }
   *     }
   *   }
   * ```
   *
   * @param {Array<*>|Object<*>} list
   * @param {Array<Array<number|string>>} parentContext like [0, 3, 2...]
   */
  function walker(list, parentContext) {

    if (Array.isArray(list)) {
      list.forEach(evaluator);
    } else {
      Object.keys(list).forEach(function(key) {
        evaluator(list[key], key);
      });
    }

    function evaluator(value, key) {
      var context = parentContext.slice();
      context.push(key);

      // maybe isObservable
      if (value != null && value.subscribe != null && value.publish != null) {
        targets.push(value);
        contexts.push(context);

        // isArray || isObject
      } else if (Array.isArray(value) || (!!value && typeof value === 'object')) {
        walker(value, context);
      }
    }
  }

  walker(templateObject, []);

  return {
    targets  : targets,
    contexts : contexts
  };
}
411286
function (VMType, ViewType) {
        var vm = new VMType();
        var vmFunctionProps = getFunctionalPropertiesMap(vm);
        var VConnect = /** @class */ (function (_super) {
            __extends(VConnect, _super);
            function VConnect() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            VConnect.prototype.render = function () {
                var props = this.props;
                return (react_1.default.createElement(ViewType, __assign({ vm: vm }, vmFunctionProps, props)));
            };
            return VConnect;
        }(react_1.default.PureComponent));
        return VConnect;
    }
820805
function install(Vue) {
  var bus = new Vue();
  Object.defineProperty(Vue.prototype, '$bus', {
    value: bus,
    configurable: false,
    writable: false
  });

  Vue.mixin({
    created: function created() {
      var this$1 = this;

      if (this.$isServer) {
        return
      }
      var busEvents = this.$options.$_busEvents &&
        this.$options.$_busEvents.bind(this)();
      if (!busEvents) {
        return
      }
      var map = Object.create(null);
      this.$options.$_busEventsMap = map;

      Object.entries(busEvents).forEach(
        function (ref) {
          var event = ref[0];
          var listenerConfig = ref[1];

          if (Array.isArray(listenerConfig)) {
            listenerConfig.forEach(function (conf) {
              subscribeFn(event, conf, map, this$1.$bus);
            });
          } else {
            subscribeFn(event, listenerConfig, map, this$1.$bus);
          }

          function subscribeFn(_event, _conf, _map, _bus) {
            var wayToListen = _conf.once ? '$once' : '$on';
            var fn = _conf.handler ? _conf.handler.bind(this) : _conf.bind(this);

            _map[_event]
              ? _map[_event].push(fn)
              : _map[_event] = [fn];
            _bus[wayToListen](_event, fn);
          }
        }
      );
    },
    beforeDestroy: function beforeDestroy() {
      var this$1 = this;

      if (this.$isServer) {
        return
      }
      var map = this.$options.$_busEventsMap;
      if (!map) {
        return
      }
      Object.entries(map).forEach(
        function (ref) {
          var event = ref[0];
          var listeners = ref[1];

          listeners.forEach(function (item) {
            this$1.$bus.$off(event, item);
          });
        }
      );
    }
  });
}
1362147
function (v) {
/*Line 1127 - 'AtomControl.js' */                if (this._template === v) {
/*Line 1128 - 'AtomControl.js' */                    if (this._created)
/*Line 1129 - 'AtomControl.js' */                        return;
/*Line 1130 - 'AtomControl.js' */                }
/*Line 1131 - 'AtomControl.js' */                if (!this._created) {
/*Line 1132 - 'AtomControl.js' */                    var _this = this;
/*Line 1133 - 'AtomControl.js' */                    // this is because, sometimes template change occurs while creation
/*Line 1134 - 'AtomControl.js' */                    // which creates endless loop
/*Line 1135 - 'AtomControl.js' */                    WebAtoms.dispatcher.callLater(function () {
/*Line 1136 - 'AtomControl.js' */                        _this.set_innerTemplate(v);
/*Line 1137 - 'AtomControl.js' */                    });
/*Line 1138 - 'AtomControl.js' */                    return;
/*Line 1139 - 'AtomControl.js' */                }
/*Line 1140 - 'AtomControl.js' */                this._template = v;
/*Line 1141 - 'AtomControl.js' */                // disposing all children...
/*Line 1142 - 'AtomControl.js' */                this.disposeChildren(this._element);

/*Line 1144 - 'AtomControl.js' */                this.createChildren();
/*Line 1145 - 'AtomControl.js' */                this.setProperties(this._element);
/*Line 1146 - 'AtomControl.js' */                this.initChildren(this._element);
/*Line 1147 - 'AtomControl.js' */                this.updateUI();
/*Line 1148 - 'AtomControl.js' */            }
1010272
function () {
        "use strict";
    
        var events = new Events({'bind': this});
    
        var ready;
        Object.defineProperty(this, 'ready', {
            'get': function () {
                return ready;
            }
        });
    
        var controls = [];
        Object.defineProperty(this, 'list', {
            'get': function () {
                return controls;
            }
        });
    
        this.register = function (register) {
    
            for (var name in register) {
    
                var specs = register[name];
                if (typeof specs === 'string') {
                    specs = {'path': specs};
                }
    
                controls[name] = new Control(name, specs);
    
            }
    
        };
    
        function importControls(controlsToImport, callback) {
    
            var coordinate = new Coordinate(controlsToImport, callback);
    
            for (var i in controlsToImport) {
    
                (function (control) {
    
                    control = controls[control];
                    if (!control) {
                        console.error('Control "' + controlsToImport[i] + '" is not registered.');
                        return;
                    }
    
                    control.load(coordinate[control.name]);
    
                })(controlsToImport[i]);
    
            }
    
        }
    
        this.import = function (controlsToImport, callback) {
    
            if (!ready) {
                this.done(Delegate(importControls, controlsToImport, callback));
                return;
            }
    
            importControls(controlsToImport, callback);
    
        };
    
        var callbacks = [];
        this.done = function (callback) {
    
            if (ready) {
                callback();
                return;
            }
    
            callbacks.push(callback);
    
        };
    
        // Polymer is ready when beyond is ready
        beyond.done(function () {
    
            ready = true;
            events.trigger('ready');
    
            for (var i in callbacks) {
                callbacks[i]();
            }
    
            callbacks = [];
    
        });
    
    }