/*
/////////////////////////////////////////
Private helper methods
/////////////////////////////////////////
352765
private static String cleanSystemId(final String sysId)
    {
        int ix = sysId.indexOf('|');
        if (ix > 0 && URI_WINDOWS_FILE_PATTERN.matcher(sysId).matches()) {
            StringBuilder sb = new StringBuilder(sysId);
            sb.setCharAt(ix, ':');
            return sb.toString();
        }
        return sysId;
    }
54035
function (paths, obj, defaultValue = null) {
        if (!Array.isArray(paths)) {
            throw new Error("paths must be an array of strings");
        }

        let res = defaultValue;
        paths.some(path => {
            const result = this.getFlattened(path, obj, defaultValue);
            if (result !== defaultValue) {
                res = result;
                return true;
            }
            return false;
        });

        return res;
    }
934460
function(id) {
            for (var i in this.ids) {
                if (this.ids[i][id]) {
                    return this.ids[i][id];
                }
            }
            return null;
        }
640008
function (error, response) {
        if (!_.isNull(error)) {
            error = _.createError(error);
        } else if (!_.isNull(response) && (response.status >= 400 || response.status === 0)) {
            error = _.createError(null, response);
            response = null;
        }
        callback(error, response);
    }
79013
function f_id(_ihale_id, _tahta_id, _opts) {

        function f_ihale_detaylarini_bagla(_ihale, _optsIhale) {

            //ihale yoksa null dön
            if (!_ihale) {
                return null;
            }

            var olusan_ihale = schema.f_create_default_object(schema.SCHEMA.IHALE);
            olusan_ihale = _.extend(olusan_ihale, _ihale);

            return result.dbQ.Q.all([
                    _optsIhale.bYapanKurum ? f_yapan_kurum(_ihale.Id) : {Id: 0},
                    _optsIhale.bTakip ? result.dbQ.sismember(result.kp.tahta.ssetTakiptekiIhaleleri(_tahta_id), _ihale.Id) : 0,
                    opts.bArrKalemleri ? f_kalem_tumu(_ihale.Id, _tahta_id, _optsIhale.optKalem) : []])
                .then(function (_arrResults) {
                    olusan_ihale.Kurum = _arrResults[0];
                    olusan_ihale.Takip = _arrResults[1];
                    olusan_ihale.Kalemler = _arrResults[2];
                    return olusan_ihale;
                });

            /* arrPromises.push(_optsIhale.bYapanKurum
             ? f_yapan_kurum(_ihale.Id)
             : null);

             arrPromises.push(_optsIhale.bTakip
             ? result.dbQ.sismember(result.kp.tahta.ssetTakiptekiIhaleleri(_tahta_id), _ihale.Id)
             : 0);

             arrPromises.push(opts.bArrKalemleri
             ? f_kalem_tumu(_ihale.Id, _tahta_id, _optsIhale.optKalem)
             : []);

             return arrPromises.allX()
             .then(function (_arrResults) {
             console.log("_arrResults")
             console.log(JSON.stringify(_arrResults))

             olusan_ihale.Kurum = _arrResults[0];
             //olusan_ihale.Kurum_Id = olusan_ihale.Kurum.Id;
             olusan_ihale.Takip = _arrResults[1];
             olusan_ihale.Kalemler = _arrResults[2];
             return olusan_ihale;
             });*/
        }

        var opts = result.OptionsIhale(_opts);

        return (Array.isArray(_ihale_id)
            ? result.dbQ.hmget_json_parse(result.kp.ihale.tablo, _ihale_id)
            : result.dbQ.hget_json_parse(result.kp.ihale.tablo, _ihale_id))
            .then(function (_dbIhale) {
                if (_dbIhale == null) {
                    return null;
                } else {

                    // Ihale dizimizin kurumlarını çekerek herbirine bağlayalım
                    if (Array.isArray(_dbIhale)) {
                        opts.bYapanKurum = false;

                        return _dbIhale
                            .mapX(null, f_ihale_detaylarini_bagla, opts)
                            .allX()
                            .then(function (dbIhaleBilgilerle) {
                                return f_yapan_kurum(_ihale_id)
                                    .then(function (dbYapanKurumlar) {

                                        dbIhaleBilgilerle.forEach(function (_elm, _idx, _arr) {
                                            if (_elm) {
                                                _arr[_idx].Kurum = dbYapanKurumlar[_idx];
                                            }
                                        });

                                        return dbIhaleBilgilerle;
                                    });
                            });

                    } else {
                        return f_ihale_detaylarini_bagla(_dbIhale, opts)
                    }
                }
            });
    }
93036
function() {
        var key = this.formId;

        var formFields = this.formFields || [];

        //Iterating over all form fields
        for (var formFieldIdx = 0; formFieldIdx < formFields.length; formFieldIdx++) {
          var formField = formFields[formFieldIdx];

          var fieldValues = formField.fieldValues || [];

          //Iterating over all of the field values
          for (var fieldValueIdx = 0 ; fieldValueIdx < fieldValues.length ; fieldValueIdx++) {
            var fieldValue = fieldValues[fieldValueIdx] || {};

            //If the value has a file size associated with it, then emit that file size
            if (fieldValue.fileSize) {
              emit(key, fieldValue.fileSize); // eslint-disable-line no-undef
            }
          }
        }
      }
296870
function _dispatchFieldErrors({ node, callerId }, errorResult) {
    const isMultiNode = Array.isArray(node);
    const data = {};
    if (isMultiNode) {
        node.forEach((nd) => {
            data[nd] = (errorResult || {})[nd] || null;
        });
    } else {
        data[node] = errorResult;
    }

    const errorStatus = {
        name: 'error',
        isLoading: false
    };
    let newStatus = {};
    if (isMultiNode) {
        node.forEach((nd) => {
            newStatus[nd] = errorStatus;
        });
    } else {
        newStatus[node] = errorStatus;
    }
    dispatcher.handleServerAction({
        data,
        type: 'updateError',
        status: newStatus,
        callerId
    });
}
1129415
function getHelperMetadata(file) {
  const globals = new Set();
  const localBindingNames = new Set();
  // Maps imported identifier -> helper name
  const dependencies = new Map();

  let exportName;
  let exportPath;
  const exportBindingAssignments = [];
  const importPaths = [];
  const importBindingsReferences = [];

  traverse(file, {
    ImportDeclaration(child) {
      const name = child.node.source.value;
      if (!helpers[name]) {
        throw child.buildCodeFrameError(`Unknown helper ${name}`);
      }
      if (
        child.get("specifiers").length !== 1 ||
        !child.get("specifiers.0").isImportDefaultSpecifier()
      ) {
        throw child.buildCodeFrameError(
          "Helpers can only import a default value",
        );
      }
      const bindingIdentifier = child.node.specifiers[0].local;
      dependencies.set(bindingIdentifier, name);
      importPaths.push(makePath(child));
    },
    ExportDefaultDeclaration(child) {
      const decl = child.get("declaration");

      if (decl.isFunctionDeclaration()) {
        if (!decl.node.id) {
          throw decl.buildCodeFrameError(
            "Helpers should give names to their exported func declaration",
          );
        }

        exportName = decl.node.id.name;
      }
      exportPath = makePath(child);
    },
    ExportAllDeclaration(child) {
      throw child.buildCodeFrameError("Helpers can only export default");
    },
    ExportNamedDeclaration(child) {
      throw child.buildCodeFrameError("Helpers can only export default");
    },
    Statement(child) {
      if (child.isModuleDeclaration()) return;

      child.skip();
    },
  });

  traverse(file, {
    Program(path) {
      const bindings = path.scope.getAllBindings();

      Object.keys(bindings).forEach(name => {
        if (name === exportName) return;
        if (dependencies.has(bindings[name].identifier)) return;

        localBindingNames.add(name);
      });
    },
    ReferencedIdentifier(child) {
      const name = child.node.name;
      const binding = child.scope.getBinding(name, /* noGlobal */ true);
      if (!binding) {
        globals.add(name);
      } else if (dependencies.has(binding.identifier)) {
        importBindingsReferences.push(makePath(child));
      }
    },
    AssignmentExpression(child) {
      const left = child.get("left");

      if (!(exportName in left.getBindingIdentifiers())) return;

      if (!left.isIdentifier()) {
        throw left.buildCodeFrameError(
          "Only simple assignments to exports are allowed in helpers",
        );
      }

      const binding = child.scope.getBinding(exportName);

      if (binding && binding.scope.path.isProgram()) {
        exportBindingAssignments.push(makePath(child));
      }
    },
  });

  if (!exportPath) throw new Error("Helpers must default-export something.");

  // Process these in reverse so that mutating the references does not invalidate any later paths in
  // the list.
  exportBindingAssignments.reverse();

  return {
    globals: Array.from(globals),
    localBindingNames: Array.from(localBindingNames),
    dependencies,
    exportBindingAssignments,
    exportPath,
    exportName,
    importBindingsReferences,
    importPaths,
  };
}
724055
function(file, lint, isError, isWarning, errorLocation) {
        var lintId = (isError) ? colors.bgRed(colors.white(lint.id)) : colors.bgYellow(colors.white(lint.id));
        var message = '';
        if (errorLocation) {
            message = file.path + ':' + (errorLocation.line + 1) + ':' + (errorLocation.column + 1) + ' ' + lintId + ' ' + lint.message;
        } else {
            message = file.path + ': ' + lintId + ' ' + lint.message;
        }

        if (isError) {
            log.error(message);
        } else {
            log.warning(message);
        }
    }
212888
function init() {
  // Retrieve any arguments passed in via the command line
  args = cliConfig.getArguments();

  // Supply usage info if help argument was passed
  if (args.help) {
    console.log(cliConfig.getUsage());
    process.exit(0);
  }

  getClientAuth(function(data) {
    parseClientAuth(data, function(err, data) {
      if (err) {
        console.error(err.message);
        process.exit(0);
      }
      writeEdgerc(data, function(err) {
        if (err) {
          if (err.errno == -13) {
            console.error("Unable to access " + err.path + ". Please make sure you " +
              "have permission to access this file or perhaps try running the " +
              "command as sudo.");
            process.exit(0);
          }
        }
        console.log("The section '" + args.section + "' has been succesfully added to " + args.path + "\n");
      });
    });
  });
}
1151154
function __() {
    var us = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    var store = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    store = typeof us === "boolean" ? us : store;
    us = typeof us === "boolean" ? [] : us;

    var seq = []; //seq is vanilla JS array + features
    seq.id = getID();
    seq.store = store;
    seq.us = us;
    seq.ds = [];
    seq.updatedTo = {};
    seq.us.map(function (u) {
      //  seq is a member of u.ds
      u.ds[u.ds.length] = seq;
      u.updatedTo[seq.id] = 0; // non-interference dependency
    });
    seq.IndexOnTimestamp = {};
    seq.TimestampOnIndex = {};
    seq.propagating = 0;
    seq.done = 0;
    seq.eqs = [];
    seq.addEq = function (eq) {
      return seq.eqs[seq.eqs.length] = eq;
    };
    seq.evalEqs = function (val) {
      var val0 = val;
      seq.eqs.map(function (eq) {
        return val = eq(val);
      });
      return seq.us.length === 0 ? val0 : val;
    };
    //api-----------------
    Object.keys(__.api).map(function (api) {
      seq[api] = __.api[api](__, seq, store);
    });
    //-----------------
    Object.defineProperties(seq, //detect t update on each seqs
    {
      t: {
        //foo.t
        get: function get() {
          return seq.valOnT;
        },
        set: function set(tval) {
          var sanityCheck = seq.propagating === 0 && seq.us.length !== 0 ? function () {
            throw new Error("Do not set a value of the sequence that depends on other sequences!");
          }() : function () {
            seq.propagating = 0;
            var core = seq.done === 0 ? function () {
              seq.valOnT = seq.evalEqs(tval); //self eqs eval
              seq.T = Date.now();
              var core1 = store ? function () {
                seq.IndexOnTimestamp[seq.T] = seq.length;
                seq.TimestampOnIndex[seq.length] = seq.T;
                seq[seq.length] = seq.valOnT; //after funcs
              }() : true;
              Object.keys(seq.updatedTo).map(function (key) {
                seq.updatedTo[key] = 1;
              });
              //clear updated us in non-interference way
              seq.us.map(function (u) {
                return u.updatedTo[seq.id] = 0;
              });
              seq.ds.map(function (d) {
                var usAllUpdated = d.us.map(function (u) {
                  return u.updatedTo[d.id];
                }).reduce(function (a, b) {
                  return a * b;
                });
                var core2 = usAllUpdated === 1 ? function () {
                  d.propagating = 1;
                  d.t = d.us.map(function (u) {
                    return u.t;
                  });
                }() : true;
              });
            }() : true;
          }();
        }
      }
    });
    return seq;
  }
262336
function parseArrayInitializer() {
        var elements = [], node = new Node(), restSpread;

        expect('[');

        while (!match(']')) {
            if (match(',')) {
                lex();
                elements.push(null);
            } else if (match('...')) {
                restSpread = new Node();
                lex();
                restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression));

                if (!match(']')) {
                    isAssignmentTarget = isBindingElement = false;
                    expect(',');
                }
                elements.push(restSpread);
            } else {
                elements.push(inheritCoverGrammar(parseAssignmentExpression));

                if (!match(']')) {
                    expect(',');
                }
            }
        }

        lex();

        return node.finishArrayExpression(elements);
    }
994384
function f_idler_aktif_tarih_araligindakiler(_tahta_id, _tarih1, _tarih2) {
        console.log("f_idler_aktif_tarih_araligindakiler")
        return f_tahta_ihale_idler_aktif(_tahta_id)
            .then(function (_ihale_idler) {
                var tarih1 = _tarih1 ? _tarih1 : "-inf",
                    tarih2 = _tarih2 ? _tarih2 : "+inf";

                return result.dbQ.zunionstore(result.kp.temp.zsetTahtaIhaleTarihineGore(_tahta_id), 2, result.kp.ihale.zsetYapilmaTarihi, result.kp.temp.ssetTahtaIhale(_tahta_id))
                    .then(function () {
                        return result.dbQ.zrangebyscore(result.kp.temp.zsetTahtaIhaleTarihineGore(_tahta_id), tarih1, tarih2);
                    })
                    .then(function (_ihale_idler) {
                        if (Array.isArray(_ihale_idler) && _ihale_idler.length > 0) {
                            return _ihale_idler;
                        } else {
                            return [];
                        }
                    });
            });
    }
323554
public void f(int i, Object... args) {
    setIndex(i);
    setArguments(args);
    if (args.length == 1 && args[0] instanceof JavaScriptObject) {
      if (JsUtils.isElement((JavaScriptObject) args[0])) {
        setElement((com.google.gwt.dom.client.Element) args[0]);
        f(getElement(), i);
      } else if (JsUtils.isEvent((JavaScriptObject) args[0])) {
        setEvent((Event) args[0]);
        f(getEvent());
      } else {
        f();
      }
    }
  }
105702
function () {
                    var name, nameLC, args, alpha_ret, index = i;

                    name = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(current);
                    if (!name) { return; }

                    name = name[1];
                    nameLC = name.toLowerCase();
                    if (nameLC === 'url') {
                        return null;
                    }

                    i += name.length;

                    if (nameLC === 'alpha') {
                        alpha_ret = parsers.alpha();
                        if(typeof alpha_ret !== 'undefined') {
                            return alpha_ret;
                        }
                    }

                    $char('('); // Parse the '(' and consume whitespace.

                    args = this.arguments();

                    if (! $char(')')) {
                        return;
                    }

                    if (name) { return new(tree.Call)(name, args, index, env.currentFileInfo); }
                }
1239424
function(sUri) {
		this.mParams = {};
		var sQueryString = sUri;

		if (sQueryString) {
			if (sQueryString.indexOf('#') >= 0 ) {
				sQueryString = sQueryString.slice(0, sQueryString.indexOf('#'));
			}
			if (sQueryString.indexOf("?") >= 0) {
				sQueryString = sQueryString.slice(sQueryString.indexOf("?") + 1);
				var aParameters = sQueryString.split("&"),
					mParameters = {},
					sName,
					sValue,
					iPos;
				for (var i = 0; i < aParameters.length; i++) {
					sName = aParameters[i];
					sValue = "";
					iPos = sName.indexOf("=");
					if ( iPos >= 0 ) {
						sValue = decodeURIComponent(sName.slice(iPos + 1).replace(/\+/g,' '));
						sName = sName.slice(0, iPos);
					}
					sName = decodeURIComponent(sName.replace(/\+/g,' '));
					if (sName) {
						if (!Object.prototype.hasOwnProperty.call(mParameters, sName)) {
							mParameters[sName] = [];
						}
						mParameters[sName].push(sValue);
					}
				}
				this.mParams = mParameters;
			}

		}
	}
556200
function commandAttr(context, attributes) {
    let ii, jj, len, jlen, result;
    let entity = context.entity;
    // let debug = context.debug;
    const componentIDs = context.componentIDs;

    // printIns( context,1 );
    // if( debug ){ console.log('ATTR> ' + stringify(componentIDs) + ' ' + stringify( _.rest(arguments))  ); }

    // if( !componentIDs ){
    //     throw new Error('no componentIDs in context');
    // }

    if (!entity) {
        // console.log('ATTR> no entity');
        return (context.last = [VALUE, null]);
    }

    attributes = Array.isArray(attributes) ? attributes : [attributes];
    // components = entity.components;
    result = [];

    const components = entity.getComponents(componentIDs);

    // console.log('commandComponentAttribute', attributes);
    for (ii = 0, len = components.length; ii < len; ii++) {
        const component = components[ii];
        for (jj = 0, jlen = attributes.length; jj < jlen; jj++) {
            const attr = attributes[jj];
            const val = component.get(attr);
            if (val !== undefined) {
                result.push(val);
            }
        }
    }

    if (result.length === 0) {
        result = null;
    } else if (result.length === 1) {
        result = result[0];
    }

    return (context.last = [VALUE, result]);
}