/*
bindable.bind("a.b.c.d.e", fn);
768229
function watchChain (bindable, hasComputed, chain, fn) {

  var listeners = [], values = hasComputed ? [] : undefined, self;

  var onChange = function () {
    dispose();
    listeners = [];
    values = hasComputed ? [] : void 0;
    bind(bindable, chain);
    self.now();
  };


  if (hasComputed && process.browser) {
    onChange = _.debounce(onChange, 1);
  }

  function runComputed (eachChain, pushValues) {
    return function (item) {
      if (!item) return;

        // wrap around bindable object as a helper
        if (!item.__isBindable) {
          item = new module.exports.BindableObject(item);
        }

        bind(item, eachChain, pushValues);
    };
  }

  function bind (target, chain, pushValues) {

    var currentChain = [], subValue, currentProperty, i, j, n, computed, hadComputed, pv, cv = target;

    // need to run through all variations of the property chain incase it changes
    // in the bindable.object. For instance:
    // target.bind("a.b.c", fn); 
    // triggers on
    // target.set("a", obj);
    // target.set("a.b", obj);
    // target.set("a.b.c", obj);

    // does it have @each in there? could be something like
    // target.bind("friends.@each.name", function (names) { })
    if (hasComputed) {

      i = 0;
      n = chain.length;

      for (; i < n; i++) {

        currentChain.push(chain[i]);
        currentProperty = chain[i];

        target.emit("watching", currentChain);

        // check for @ at the beginning
        computed = (currentProperty.charCodeAt(0) === 64);

        if (computed) {
          hadComputed = true;
          // remove @ - can't be used to fetch the propertyy
          currentChain[i] = currentProperty = currentChain[i].substr(1);
        }
        
        pv = cv;
        if (cv) cv = cv[currentProperty];

        if (computed && cv) {


          // used in cases where the collection might change that would affect 
          // this binding. length for instance on the collection...
          if (cv.compute) {
            for (j = cv.compute.length; j--;) {
              bind(target, [cv.compute[j]], false);
            }
          }

          // the sub chain for each of the items from the loop
          var eachChain = chain.slice(i + 1);

          // call the function, looping through items
          cv.call(pv, runComputed(eachChain, pushValues));
          break;
        } else if (cv && cv.__isBindable && i !== n - 1) {
          bind(cv, chain.slice(i + 1), false);
          cv = cv.__context;
        }

        listeners.push(target.on("change:" +  currentChain.join("."), onChange));

      } 

      if (!hadComputed && pushValues !== false) {
        values.push(cv);
      }

    } else {
      i = 0;
      n = chain.length;

      for (; i < n; i++) {
        currentProperty = chain[i];
        currentChain.push(currentProperty);

        target.emit("watching", currentChain);

        if (cv) cv = cv[currentProperty];

        // pass the watch onto the bindable object, but also listen 
        // on the current target for any
        if (cv && cv.__isBindable && i !== n - 1) {
          bind(cv, chain.slice(i + 1), false);
        }

        listeners.push(target.on("change:" + currentChain.join("."), onChange));
      }

      if (pushValues !== false) values = cv;
    }
  }

  function dispose () {
    if (!listeners) return;
    for (var i = listeners.length; i--;) {
      listeners[i].dispose();
    }
    listeners = [];
  }

  self = {
    target: bindable,
    now: function () {
      fn.call(self, values);
      return self;
    },
    dispose: dispose,
    pause: function () {
      self.dispose();
      self.now = function () { return this; };
    },
    resume: function () {
      self.pause();
      _.extend(self, watchChain(bindable, hasComputed, chain, fn));
      return self;
    }
  };

  bind(bindable, chain);

  return self;
}
57549
function getBindingsForNode(fragments, node, view) {
  var bindings = [];
  var Binder, binding, expr, bound, match, attr, i, l;

  if (node.nodeType === Node.TEXT_NODE) {
    splitTextNode(fragments, node);

    // Find any binding for the text node
    if (fragments.isBound('text', node.nodeValue)) {
      expr = fragments.codifyExpression('text', node.nodeValue);
      node.nodeValue = '';
      Binder = fragments.findBinder('text', expr);
      if (Binder.expression) {
        // the expression is the wildcard inside a text binder
        expr = expr.match(Binder.expression)[1];
      }
      binding = new Binder({ node: node, view: view, expression: expr, fragments: fragments });
      if (binding.compiled() !== false) {
        bindings.push(binding);
      }
    }
  } else {
    // If the element is removed from the DOM, stop. Check by looking at its parentNode
    var parent = node.parentNode;
    var DefaultBinder = fragments.getAttributeBinder('__default__');
    bound = [];

    // Find any binding for the element
    Binder = fragments.findBinder('element', node.tagName.toLowerCase());
    if (Binder) {
      bound.push([ Binder ]);
    }

    // Find and add any attribute bindings on an element. These can be attributes whose name matches a binding, or
    // they can be attributes which have a binding in the value such as `href="/post/{{ post.id }}"`.
    var attributes = slice.call(node.attributes);
    for (i = 0, l = attributes.length; i < l; i++) {
      attr = attributes[i];
      Binder = fragments.findBinder('attribute', attr.name, attr.value);
      if (Binder) {
        bound.push([ Binder, attr ]);
      }
    }

    // Make sure to create and process them in the correct priority order so if a binding create a template from the
    // node it doesn't process the others.
    bound.sort(sortBindings);

    for (i = 0; i < bound.length; i++) {
      Binder = bound[i][0];
      attr = bound[i][1];

      if (attr) {
        if (!node.hasAttribute(attr.name)) {
          // If this was removed already by another binding, don't process.
          continue;
        }
        var name = attr.name;
        var value = attr.value;
        if (Binder.expression) {
          match = name.match(Binder.expression);
          if (match) match = match[1];
        } else {
          match = null;
        }

        if (attr && node.hasAttribute(attr.name)) {
          node.removeAttribute(attr.name);
        }

        binding = new Binder({
          node: node,
          view: view,
          name: name,
          match: match,
          expression: value ? fragments.codifyExpression('attribute', value, Binder !== DefaultBinder) : null,
          fragments: fragments
        });
      } else {
        binding = new Binder({ node: node, view: view, fragments: fragments });
      }

      if (binding.compiled() !== false) {
        bindings.push(binding);
      } else if (attr && Binder !== DefaultBinder && fragments.isBound('attribute', value)) {
        // Revert to default if this binding doesn't take
        bound.push([ DefaultBinder, attr ]);
      } else if (attr) {
        node.setAttributeNode(attr);
      }

      if (node.parentNode !== parent) {
        break;
      }
    }
  }

  return bindings;
}
1005824
function BINDING_anchor($scope, key, element, getControl, bindings) {
        bindings.push($scope.$watch(key, function (newValue, oldValue) {
            newValue = typeof newValue === "string" ? select(newValue, element) : newValue;
            oldValue = typeof oldValue === "string" ? select(oldValue, element) : oldValue;
            if (oldValue && oldValue._anchorClick) {
                oldValue.removeEventListener("click", oldValue._anchorClick);
                oldValue._anchorClick = null;
            }
            if (newValue && !newValue._anchorClick) {
                newValue._anchorClick = function () { getControl().show(); };
                newValue.addEventListener("click", newValue._anchorClick);
            }
            return newValue;
        }));
        var anchor = $scope[key];
        return typeof anchor === "string" ? select(anchor, element) : anchor;
    }
1354881
function bind(elements) {
      for (var i = 0; i < elements.length; i++) {
        Binder.on('click', elements[i], this.click);
        Binder.on('touchstart', elements[i], this.click, capture);
      }
    }
6682
function makeBindable(component, _valueProp) {
    var Bind = /** @class */ (function (_super) {
        __extends(Bind, _super);
        function Bind() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.onChange = function (newValue) {
                var valueToSet;
                if (newValue.target) {
                    valueToSet = newValue.target[_valueProp || _this.props.valueProp || 'value'];
                }
                else {
                    valueToSet = newValue;
                }
                var imState = _this.props.value;
                if (imState === null || imState === undefined) {
                    throw new Error('[pastate] The binding value cannot be null or undefined. If you want to support null and undefined, you can use store + bind props.');
                }
                var store = imState.__store__;
                if (!store) {
                    throw new Error('[pastate] You can only give state node from this.props to pastate two-ways binding HOC component');
                }
                store.set(imState, valueToSet);
                store.currentActionName = '[binding]';
                store.sync();
                _this.props.afterChange && _this.props.afterChange(valueToSet);
            };
            return _this;
        }
        Bind.prototype.render = function () {
            if (Array.isArray(this.props.children)) {
                throw new Error('[pastate] you can only give only one child to Bind component');
            }
            var _a = this.props, valueProp = _a.valueProp, afterChange = _a.afterChange, parentProps = __rest(_a, ["valueProp", "afterChange"]);
            var props = Object.assign({}, parentProps, (_b = {},
                _b[_valueProp || valueProp || 'value'] = unpack(this.props.value),
                _b.onChange = this.onChange,
                _b));
            return React.createElement(component, props, this.props.children);
            var _b;
        };
        return Bind;
    }(React.PureComponent));
    return Bind;
}
1290206
public static String getBindValue(EntityColumn column, String value) {
        StringBuilder sql = new StringBuilder();
        sql.append("<bind name=\"");
        sql.append(column.getProperty()).append("_bind\" ");
        sql.append("value='").append(value).append("'/>");
        return sql.toString();
    }
556179
function bindEvent(element, type, handler, context) {
    /**
     * Event handler
     * @param {Event} e - event object
     */
    function eventHandler(e) {
        handler.call(context || element, e || window.event);
    }

    /**
     * Event handler for normalize mouseenter event
     * @param {MouseEvent} e - event object
     */
    function mouseEnterHandler(e) {
        e = e || window.event;

        if (checkMouse(element, e)) {
            eventHandler(e);
        }
    }

    if ('addEventListener' in element) {
        if (type === 'mouseenter' || type === 'mouseleave') {
            type = (type === 'mouseenter') ? 'mouseover' : 'mouseout';
            element.addEventListener(type, mouseEnterHandler);
            memorizeHandler(element, type, handler, mouseEnterHandler);
        } else {
            element.addEventListener(type, eventHandler);
            memorizeHandler(element, type, handler, eventHandler);
        }
    } else if ('attachEvent' in element) {
        element.attachEvent(`on${type}`, eventHandler);
        memorizeHandler(element, type, handler, eventHandler);
    }
}
714744
function _bind (events, selector, callback, remove) {
  // fail silently if you pass null or undefined as an alement
  // in the Delegator constructor
  if (!this.element) {
    return;
  }

  if (!(events instanceof Array)) {
    events = [events];
  }

  if (!callback && typeof (selector) === 'function') {
    callback = selector;
    selector = '_root';
  }

  if (selector instanceof window.Element) {
    let id;
    if (selector.hasAttribute('bind-event-id')) {
      id = selector.getAttribute('bind-event-id');
    } else {
      id = nextEventId();
      selector.setAttribute('bind-event-id', id);
    }
    selector = `[bind-event-id="${id}"]`;
  }

  let id = this.id;
  let i;

  function _getGlobalCallback (type) {
    return function (e) {
      _handleEvent(id, e, type);
    };
  }

  for (i = 0; i < events.length; i++) {
    _aliases(events[i]).forEach(alias => {
      if (remove) {
        _removeHandler(this, alias, selector, callback);
        return;
      }

      if (!_handlers[id] || !_handlers[id][alias]) {
        Delegator.addEvent(this, alias, _getGlobalCallback(alias));
      }

      _addHandler(this, alias, selector, callback);
    });
  }

  return this;
}
158486
private void updateBind(Node n) {
    CodingConvention.Bind bind =
        compiler.getCodingConvention().describeFunctionBind(n, false, true);
    if (bind == null) {
      return;
    }

    Node target = bind.target;
    FunctionType callTargetFn = getJSType(target)
        .restrictByNotNullOrUndefined().toMaybeFunctionType();
    if (callTargetFn == null) {
      return;
    }

    if (bind.thisValue != null && target.isFunction()) {
      JSType thisType = getJSType(bind.thisValue);
      if (thisType.toObjectType() != null && !thisType.isUnknownType()
          && callTargetFn.getTypeOfThis().isUnknownType()) {
        callTargetFn =
            FunctionType.builder(registry)
                .copyFromOtherFunction(callTargetFn)
                .withTypeOfThis(thisType.toObjectType())
                .build();
        target.setJSType(callTargetFn);
      }
    }

    n.setJSType(
        callTargetFn.getBindReturnType(
            // getBindReturnType expects the 'this' argument to be included.
            bind.getBoundParameterCount() + 1));
  }
611371
public void bind(SQLiteStatement statement) {
		if (this.compiledStatement != null) {
			// already binded
			return;
		}

		int index = 1;

		statement.clearBindings();
		Object value;

		for (int j = 0; j < args.size(); j++) {
			value = args.get(j);
			switch (valueType.get(index - 1)) {
			case BOOLEAN:
				statement.bindLong(index, (long) (((Boolean) value) == true ? 1 : 0));
				break;
			case BYTE:
				statement.bindLong(index, (byte) value);
				break;
			case SHORT:
				statement.bindLong(index, (short) value);
				break;
			case INTEGER:
				statement.bindLong(index, (int) value);
				break;
			case CHARACTER:
				statement.bindLong(index, Character.getNumericValue((char)value));
				break;
			case LONG:
				statement.bindLong(index, (long) value);
				break;
			case BYTE_ARRAY:
				statement.bindBlob(index, (byte[]) value);
				break;
			case FLOAT:
				statement.bindDouble(index, (float) value);
				break;
			case DOUBLE:
				statement.bindDouble(index, (double) value);
				break;
			case NULL:
				statement.bindNull(index);
				break;
			case STRING:
				statement.bindString(index, (String) value);
				break;
			}
			index++;
		}

		for (int i = 0; i < whereArgs.size(); i++, index++) {
			statement.bindString(index, whereArgs.get(i));
		}
	}
33377
protected Binding bindAnnotatedWithNameToInstance(TypeReference bind, String name, String to,
			String functionName) {
		String tmpName = Strings.emptyIfNull(name);
		if (tmpName.startsWith(REFERENCE_PREFIX)) {
			tmpName = tmpName.substring(REFERENCE_PREFIX.length()).trim();
		} else {
			tmpName = "\"" + tmpName + "\""; //$NON-NLS-1$//$NON-NLS-2$
		}
		final String unferencedName = tmpName;
		final StringConcatenationClient client = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation builder) {
				builder.append("binder.bind("); //$NON-NLS-1$
				builder.append(bind);
				builder.append(".class).annotatedWith(Names.named("); //$NON-NLS-1$
				builder.append(unferencedName);
				builder.append(")).toInstance("); //$NON-NLS-1$
				builder.append(to);
				builder.append(".class);"); //$NON-NLS-1$
			}
		};
		String fctname = functionName;
		if (Strings.isEmpty(fctname)) {
			fctname = name;
		}
		final BindKey key = new GuiceModuleAccess.BindKey(formatFunctionName(fctname), null, false, false);
		final BindValue statements = new BindValue(null, null, false, Collections.singletonList(client));
	    return new Binding(key, statements, true, this.name);
	}
471264
function functionBind(f, obj) {
  if (NATIVE_FUNCTION_BIND) {
    return NATIVE_FUNCTION_BIND.call(f, obj);
  }

  return function boundFunction_() {
    return f.apply(obj, arguments);
  };
}
1159657
private void validateStringPropBinding(LocalComponentProp localComponentProp) {
    if (localComponentProp.getType().toString().equals(String.class.getCanonicalName())) {
      return;
    }

    logger.error("Passing a String to a non String Prop: \""
        + localComponentProp.getPropName()
        + "\". "
        + "If you want to pass a boolean or an int you should use v-bind. "
        + "For example: v-bind:my-prop=\"12\" (or using the short syntax, :my-prop=\"12\") instead of my-prop=\"12\".");
  }
6497
function resolveBindingValue(oldValue, value) {
    if (value === undefined && oldValue === null) {
      return value;
    }
    return (value === null || value === undefined) ? oldValue : value;
  }
1142166
public VarBindingDef bind( VarDef varDef, VarValueDef valueDef)
    {
    if( valueDef != null && !varDef.isApplicable( valueDef))
      {
      throw new IllegalArgumentException( "Value=" + valueDef + " is not defined for var=" + varDef);
      }
    
    varDef_ = varDef;
    valueDef_ = valueDef;
    effCondition_ = null;

    return this;
    }
579826
function parseBindings(bindings) {
        var config = {};

        switch (typeof bindings.value) {
            case 'string':
            case 'function':
                config.title = bindings.value;
                break
            case 'object':
                config = Object.assign({}, bindings.value);
        }

        // Parse args (eg: v-d-tooltip:my-container)
        if (bindings.arg) {
            config.container = "#" + (bindings.arg); // #my-container
        }

        // Parse modifiers. eg: v-d-tooltip.my-modifier
        Object.keys(bindings.modifiers).forEach(function (mod) {
            // Parse if the title allows HTML
            if (/^html$/.test(mod)) {
                config.html = true;

            // Parse animation
            } else if (/^nofade$/.test(mod)) {
                config.animation = false;

            // Parse placement
            } else if (/^(auto|top(left|right)?|bottom(left|right)?|left(top|bottom)?|right(top|bottom)?)$/.test(mod)) {
                config.placement = mod;

            // Parse boundary
            } else if (/^(window|viewport)$/.test(mod)) {
                config.boundary = mod;

            // Parse delay
            } else if (/^d\d+$/.test(mod)) {
                var delay = parseInt(mod.slice(1), 10) || 0;
                if (delay) {
                    config.delay = delay;
                }

            // Parse offset
            }  else if (/^o-?\d+$/.test(mod)) {
                var offset = parseInt(mod.slice(1), 10) || 0;
                if (offset) {
                    config.offset = offset;
                }
            }
        });

        // Parse selected triggers.
        var selectedTriggers = {};
        var triggers = typeof config.trigger === 'string' ? config.trigger.trim().split(/\s+/) : [];

        triggers.forEach(function (trigger) {
            if (validTriggers[trigger]) {
                selectedTriggers[trigger] = true;
            }
        });

        // Parse trigger modifiers. eg: v-d-tooltip.click
        Object.keys(validTriggers).forEach(function (trigger) {
            if (bindings.modifiers[trigger]) {
                selectedTriggers[trigger] = true;
            }
        });

        config.trigger = Object.keys(selectedTriggers).join(' ');

        // Convert `blur` to `focus`
        if (config.trigger === 'blur') {
            config.trigger = 'focus';
        }

        // If there's no trigger assigned, just delete the key.
        if (!config.trigger) {
            delete config.trigger;
        }

        return config
    }
988390
function bind(fn) {
  if (typeof fn !== 'function') return;
  if (support) return events.bind(window, 'hashchange', fn);
  if (running) return;
  running = true;
  fix(fn);
  return fn;
}