/*-------------------------------------------------[ Internal-Helpers ]---------------------------------------------------
768622
private Header newHeader(AsciiString name){
        Header header = new Header(name);
        if(first==null)
            first = header;
        else{
            header.prev = first.prev;
            first.prev.next = header;
            first.prev = header;
        }
        return header;
    }
987067
function(token,i,tokens) {
		
		var type = token._type;
		
		if (!seenSingle && token.fromThen) {
			return true;
		};
		
		var ifelse = type == 'IF' || type == 'UNLESS' || type == 'ELSE';
		
		if (ifelse || type === 'CATCH') {
			seenSingle = true;
		};
		
		if (ifelse || type === 'SWITCH' || type == 'TRY') {
			seenControl = true;
		};
		
		var prev = self.tokenType(i - 1);
		
		if ((type == '.' || type == '?.' || type == '::') && prev === OUTDENT) {
			return true;
		};
		
		if (endCallAtTerminator && (type === INDENT || type === TERMINATOR)) {
			return true;
		};
		
		if ((type == 'WHEN' || type == 'BY') && !seenFor) {
			// console.log "dont close implicit call outside for"
			return false;
		};
		
		var post = (tokens.length > (i + 1)) ? tokens[i + 1] : null;
		var postTyp = post && post._type;
		
		if (token.generated || prev === ',') {
			return false;
		};
		
		var cond1 = (IMPLICIT_END_MAP[type] || (type == INDENT && !seenControl) || (type == 'DOS' && prev != '='));
		
		if (!cond1) {
			return false;
		};
		
		if (type !== INDENT) {
			return true;
		};
		
		if (!IMPLICIT_BLOCK_MAP[prev] && self.tokenType(i - 2) != 'CLASS' && !(post && ((post.generated && postTyp == '{') || IMPLICIT_CALL_MAP[postTyp]))) {
			return true;
		};
		
		return false;
	}
49852
function() {
                var selectors = [], s, rules;
                save();

                s = $(this.selector);
                while (s) {
                    selectors.push(s);
                    while ($(this.comment)) {
                        // do nothing
                    }
                    if (! $(',')) { break; }
                    while ($(this.comment)) {
                        // do nothing
                    }
                    s = $(this.selector);
                }
                if (s) {
                    while ($(this.comment)) {
                        // do nothing
                    }
                }

                if (selectors.length > 0 && (rules = $(this.block))) {
                    if (selectors.length === 1 &&
                        selectors[0].elements.length &&
                        selectors[0].elements[0].value === 'Map') {
                        var rs = new tree.Ruleset(selectors, rules);
                        rs.isMap = true;
                        return rs;
                    }
                    return new tree.Ruleset(selectors, rules);
                } else {
                    // Backtrack
                    restore();
                }
            }
781255
function(selector) {

	var allMatches = localnwt.all(selector),
		testNode = this._node,
		ancestor = null,
		maxDepth = 0;

	if( allMatches.size() == 0 ) {
		return null;
	}

	while( true ) {

		// Iterate through all matches for each parent, and exit as soon as we have a match
		// Pretty bad performance, but super small. TODO: Omtimize
		allMatches.each(function (el) {
			if (el._node == testNode) {
				ancestor = el;
			}
		});

		var parentNode = testNode.parentNode;

		if( ancestor || !parentNode) { break; }
		testNode = parentNode;
	}

	if( ancestor ) {
		return ancestor;
	} else {
		return null;
	}
}
1210792
function(init) {
  var fulfillCallbacks = new Backlog();
  var rejectCallbacks = new Backlog();
  var value;
  var error;
  var state = "pending";

  if (underTest) {
    Object.defineProperties(this, {
      _value: _readOnlyProperty(function() { return value; }),
      _error: _readOnlyProperty(function() { return error; }),
      _state: _readOnlyProperty(function() { return state; }),
    });
  }

  Object.defineProperties(this, {
    _addAcceptCallback: _pseudoPrivate(
      function(cb) {
        // console.log("adding fulfill callback:", cb);
        fulfillCallbacks.push(cb);
        if (state == "fulfilled") {
          fulfillCallbacks.pump(value);
        }
      }
    ),
    _addRejectCallback: _pseudoPrivate(
      function(cb) {
        // console.log("adding reject callback:", cb);
        rejectCallbacks.push(cb);
        if (state == "rejected") {
          rejectCallbacks.pump(error);
        }
      }
    ),
  });
  var r = new Resolver(this,
                       fulfillCallbacks, rejectCallbacks,
                       function(v) { value = v; },
                       function(e) { error = e; },
                       function(s) { state = s; })
  try {
    if (init) { init(r); }
  } catch(e) {
    r.reject(e);
  }
}
1343266
function(html) {
		if (!this._spirit.life.destructed) {
			this._updates = new edbml.UpdateCollector();
			this._functions = {};
			if (!this._olddom) {
				this._first(html);
			} else {
				this._next(html);
				this._updates.collect(
					new edbml.FunctionUpdate(this._doc).setup(
						this._keyid,
						this._functions
					)
				);
			}
			this._updates.eachRelevant(function(update) {
				update.update();
				update.dispose();
			});
			if (this._updates) { // huh? how can it be null?
				this._updates.dispose();
			}
			this._updates = null;
		}
	}
699672
public void putInt(String key, int i) {
		checkNotNull(key);
		put(key, Integer.toString(i));
	}
334733
function (str) {
      var index = this.html.indexOf(str, this.currentChar) + str.length;
      if (index === -1)
        this.currentChar = this.html.length;
      this.currentChar = index;
    }
1353979
function (i) {
        var deferred = $.Deferred();
        deferreds.push(deferred);

        var originalVal = changes[i][3];
        var lowercaseVal = typeof originalVal === 'string' ? originalVal.toLowerCase() : null;

        return function (source) {
          var found = false;
          for (var s = 0, slen = source.length; s < slen; s++) {
            if (originalVal === source[s]) {
              found = true; //perfect match
              break;
            }
            else if (lowercaseVal === source[s].toLowerCase()) {
              changes[i][3] = source[s]; //good match, fix the case
              found = true;
              break;
            }
          }
          if (!found) {
            changes[i] = null;
          }
          deferred.resolve();
        }
      }
1185067
function () {
                    var elements = [], e, c, argsSemiColon = [], argsComma = [], args, delim, arg, nameLoop, expressions, isSemiColonSeperated, expressionContainsNamed, index = i, s = input.charAt(i), name, value, important = false;

                    if (s !== '.' && s !== '#') { return }
                    
                    save(); // stop us absorbing part of an invalid selector

                    while (e = $(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)) {
                        elements.push(new(tree.Element)(c, e, i));
                        c = $('>');
                    }
                    if ($('(')) {
                        expressions = [];
                        while (arg = $(this.expression)) {
                            nameLoop = null;
                            value = arg;

                            // Variable
                            if (arg.value.length == 1) {
                                var val = arg.value[0];
                                if (val instanceof tree.Variable) {
                                    if ($(':')) {
                                        if (expressions.length > 0) {
                                            if (isSemiColonSeperated) {
                                                error("Cannot mix ; and , as delimiter types");
                                            }
                                            expressionContainsNamed = true;
                                        }
                                        value = expect(this.expression);
                                        nameLoop = (name = val.name);
                                    }
                                }
                            }
                            
                            expressions.push(value);
                            
                            argsComma.push({ name: nameLoop, value: value });
                            
                            if ($(',')) {
                                continue;
                            }
                            
                            if ($(';') || isSemiColonSeperated) {
                            
                                if (expressionContainsNamed) {
                                    error("Cannot mix ; and , as delimiter types");
                                }
                            
                                isSemiColonSeperated = true;
                                                        
                                if (expressions.length > 1) {
                                    value = new(tree.Value)(expressions);
                                }
                                argsSemiColon.push({ name: name, value: value });
                            
                                name = null;
                                expressions = [];
                                expressionContainsNamed = false;
                            }
                        }

                        expect(')');
                    }

                    args = isSemiColonSeperated ? argsSemiColon : argsComma;

                    if ($(this.important)) {
                        important = true;
                    }

                    if (elements.length > 0 && ($(';') || peek('}'))) {
                        return new(tree.mixin.Call)(elements, args, index, env.filename, important);
                    }
                    
                    restore();
                }
857182
function filter(/*DOM*/ elem) {

		// execute and remove jbst:oninit method
		var method = popMethod(elem, INIT);
		if ('function' === typeof method) {
			// execute in context of element
			method.call(elem);
		}

		// execute and remove jbst:onload method
		method = popMethod(elem, LOAD);
		if ('function' === typeof method) {
			// queue up to execute after insertion into parentNode
			setTimeout(function() {
				// execute in context of element
				method.call(elem);
				method = elem = null;
			}, 0);
		}

		if (JsonML.BST.filter) {
			return JsonML.BST.filter(elem);
		}

		return elem;
	}
312225
function generateWhenAndNotHelpers(currentState, currentData, parsedStates) {
  const buildWhenFnBody = state => callback => {
    if (currentState.name !== state) {
      return null
    }
    return callback instanceof Function ? callback(currentData) : callback
  }

  const buildNotFnBody = state => callback => {
    if (currentState.name === state) {
      return null
    }
    return callback instanceof Function ? callback() : callback
  }

  return parsedStates
    .reduce(
      (helpers, state) => ({
        ...helpers,
        [buildFnName('when', state.name)]: buildWhenFnBody(state.name),
        [buildFnName('not', state.name)]: buildNotFnBody(state.name),
      }),
      {}
    )
}
619373
function(inst) {
		var onClose = this._get(inst, 'onClose');
		if (onClose)
			onClose.apply((inst.input ? inst.input[0] : null),
						  [(inst.input ? inst.input.val() : ''), inst]);
	}
609898
function (name, id, bytes, parser) {
  this.name = name;
  this.id = id;
  this.bytes = bytes;

  // the parser is null by default, otherwise the specified function
  this.parser = _.isFunction(parser) ? parser : function () {};
}
1165087
function(fallbackImage, onProgress) {
    /**
     * @type {?function({status: boolean, value: HTMLImageElement})}
     */
    this.onProgress = typeof onProgress === 'function' ? onProgress : null;
    /**
     * @type {?String|HTMLImageElement}
     */
    this.fallbackImage = typeof fallbackImage === 'string' || fallbackImage instanceof HTMLImageElement ? fallbackImage : null;
}
439025
function () {
/*Line 74 - 'AtomWizard.js' */                $(this._element).addClass('atom-wizard');

/*Line 76 - 'AtomWizard.js' */                baseType.init.call(this);

/*Line 78 - 'AtomWizard.js' */                var _this = this;

/*Line 80 - 'AtomWizard.js' */                var vs = this._viewPresenter;

/*Line 82 - 'AtomWizard.js' */                this.goNextCommand = function (scope, sender, evt) {
/*Line 83 - 'AtomWizard.js' */                    if (_this.get_isLastStep()) {
/*Line 84 - 'AtomWizard.js' */                        _this.invokeAction(_this._next, evt);
/*Line 85 - 'AtomWizard.js' */                        AtomBinder.setValue(_this, "canMoveBack", false);
/*Line 86 - 'AtomWizard.js' */                    } else {
/*Line 87 - 'AtomWizard.js' */                        AtomBinder.setValue(_this, "currentStep", _this._currentStep + 1);
/*Line 88 - 'AtomWizard.js' */                    }
/*Line 89 - 'AtomWizard.js' */                };

/*Line 91 - 'AtomWizard.js' */                this.goPrevCommand = function () {
/*Line 92 - 'AtomWizard.js' */                    AtomBinder.setValue(_this, "currentStep", _this._currentStep - 1);
/*Line 93 - 'AtomWizard.js' */                };

/*Line 95 - 'AtomWizard.js' */                this.resetCommand = function () {
/*Line 96 - 'AtomWizard.js' */                    _this.createWizard();
/*Line 97 - 'AtomWizard.js' */                    AtomBinder.setValue(_this, "currentStep", 0);
/*Line 98 - 'AtomWizard.js' */                    AtomBinder.setValue(_this, "canMoveBack", true);
/*Line 99 - 'AtomWizard.js' */                };

/*Line 101 - 'AtomWizard.js' */                // create children...
/*Line 102 - 'AtomWizard.js' */                this.createWizard();

/*Line 104 - 'AtomWizard.js' */                this.nextCommand = function (scope, sender, evt) {
/*Line 105 - 'AtomWizard.js' */                    var child = vs.atomControl.get_selectedChild().atomControl;
/*Line 106 - 'AtomWizard.js' */                    if (child._next) {
/*Line 107 - 'AtomWizard.js' */                        child.invokeAction(child._next);
/*Line 108 - 'AtomWizard.js' */                        return;
/*Line 109 - 'AtomWizard.js' */                    } else {
/*Line 110 - 'AtomWizard.js' */                        _this.goNextCommand(scope, sender, evt);
/*Line 111 - 'AtomWizard.js' */                    }
/*Line 112 - 'AtomWizard.js' */                };

/*Line 114 - 'AtomWizard.js' */            }
261328
function(typeEvents) {
    var elemClasses, elemClass;

    // Iterate over previously passed elements to check for any delegated events
    var activePathLength = activePath.length;
    for (var i = 0; i < activePathLength; i++) {
      elemClasses = activePath[i].classes;
      // Once stopPropagation is called stop
      if (!evt.isPropagationStopped()) {
        var elemClassesLength = elemClasses.length;
        for (var j = 0; j < elemClassesLength; j++) {
          elemClass = elemClasses[j];
          if (typeEvents[elemClass]) {
            triggerEventFunctions(activePath[i].element, typeEvents[elemClass], elemClass, elem);
          }
        }
      }
    }

    // Check for any non-delegated events
    if (!evt.isPropagationStopped() && typeEvents.self) {
      triggerEventFunctions(elem, typeEvents.self);
    }
  }