Correios class
@example
```
var Correios = require('node-correios'),
correios = new Correios();

correios.calcPreco(args, function (err, result) {
console.log(result);
});
```
965475
function () {
  // If is not instance of Correios return a new instance
  if (false === (this instanceof Correios)) {
    return new Correios();
  }

  // Default URl's
  this.calcPrecoUrl = 'http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx?wsdl';
  this.cepUrl       = 'http://viacep.com.br/ws/{CEP}/json';

  // Default args for price calculation
  this.calcArgs = {
    nCdEmpresa         : '',
    sDsSenha           : '',
    sCdMaoPropria      : 'N',
    nVlValorDeclarado  : 0,
    sCdAvisoRecebimento: 'N'
  };

  // Default args for CEP search
  this.cepArgs = {
    cepEntrada: '',
    metodo    : 'buscarCep'
  };
}
110171
function init(\CharlotteDunois\Livia\Client $client): \React\Promise\ExtendedPromiseInterface {
        $this->client = $client;
        $this->attachListeners();
        
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) {
            $this->runQuery('CREATE TABLE IF NOT EXISTS `settings` (`guild` VARCHAR(20) NOT NULL, `settings` TEXT NOT NULL, PRIMARY KEY (`guild`))')->then(function () {
                return $this->runQuery('SELECT * FROM `settings`')->then(function ($result) {
                    foreach($result->resultRows as $row) {
                        $this->loadRow($row);
                    }
                    
                    if($this->settings->has('global')) {
                        return null;
                    }
                    
                    return $this->create('global')->then(function () {
                        return null;
                    });
                });
            })->done($resolve, $reject);
        }));
    }
1085921
function findOrCreate(params, cb) {
	/* istanbul ignore next */
	if (typeof cb !== 'function') {
		throw new Error('Callback must be a function');
	}

	db.findOne(params, (err, doc) => {
		/* istanbul ignore next: hard-to-invoke error */
		if (err) {
			cb(err);
			return;
		}

		if (doc) {
			cb(null, doc.token);
		} else {
			params.token = uuid();
			db.insert(params, (err, newDoc) => {
				/* istanbul ignore next: hard-to-invoke error */
				if (err) {
					cb(err);
					return;
				}

				cb(null, newDoc.token);
			});
		}
	});
}
858372
function require(names, callback, errback, referer) {
      // in amd, first arg can be a config object... we just ignore
      if (typeof names == 'object' && !(names instanceof Array))
        return require.apply(null, Array.prototype.splice.call(arguments, 1, arguments.length - 1));

      // amd require
      if (typeof names == 'string' && typeof callback == 'function')
        names = [names];
      if (names instanceof Array) {
        var dynamicRequires = [];
        for (var i = 0; i < names.length; i++)
          dynamicRequires.push(loader['import'](names[i], referer));
        Promise.all(dynamicRequires).then(function(modules) {
          if (callback)
            callback.apply(null, modules);
        }, errback);
      }

      // commonjs require
      else if (typeof names == 'string') {
        var defaultJSExtension = loader.defaultJSExtensions && names.substr(names.length - 3, 3) != '.js';
        var normalized = loader.decanonicalize(names, referer);
        if (defaultJSExtension && normalized.substr(normalized.length - 3, 3) == '.js')
          normalized = normalized.substr(0, normalized.length - 3);
        var module = loader.get(normalized);
        if (!module)
          throw new Error('Module not already loaded loading "' + names + '" as ' + normalized + (referer ? ' from "' + referer + '".' : '.'));
        return module.__useDefault ? module['default'] : module;
      }

      else
        throw new TypeError('Invalid require');
    }
262319
function (module, exports, __webpack_require__) {

  "use strict";

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _vuex = __webpack_require__(92);

  exports.default = {
    computed: (0, _vuex.mapGetters)(['evenOrOdd']),
    methods: (0, _vuex.mapActions)(['increment', 'decrement', 'incrementIfOdd', 'incrementAsync'])
  }; //
  //
  //
  //
  //
  //
  //
  //
  //
  //

  /***/
}
789145
function defineModule() {

    /* Object based definition */
    if ((arguments.length == 1)
      && arguments[0].name
      && arguments[0].constructor) {
        var module = arguments[0];
        return defineModule(module.name,
                            module.dependencies || [], //optional
                            module.constructor);
    }

    /* Normal arguments-based definition */
    var args = normalize(arguments);

    /* Our variables */
    var name;
    var dependencies = [];
    var constructor;

    /* Name and dependencies */
    if (!args.arguments.length) {
      throw new EsquireError("No module name specified");
    } else {
      name = globalName(args.arguments.splice(0, 1)[0]);
      dependencies = args.arguments;
    }

    /* Watch out for double definitions */
    if (modules[name]) {
      throw new EsquireError("Module '" + name + "' already defined");
    }

    /* Constructor function */
    if (!args.function) {
      throw new EsquireError("No constructor function specified for module '" + name + "'");
    } else {
      constructor = args.function;
    }

    /* Create and remember our new module */
    var module = modules[name] = new Module(name, dependencies, constructor);

    /* Notify all "define" listeners */
    for (var i in listeners['define']) {
      try {
        listeners['define'][i](module);
      } catch (error) {
        console.error("Error notifying listener", error);
      }
    }

    /* Resolve our deferred if someone was waiting for this */
    if (deferredModules[module.name]) {
      deferredModules[module.name].resolve(module);
      delete deferredModules[module.name];
    }

    /* Return our defined module */
    return module;
  }
116508
function VError()
{
	var args, obj, parsed, cause, ctor, message, k;

	args = Array.prototype.slice.call(arguments, 0);

	/*
	 * This is a regrettable pattern, but JavaScript's built-in Error class
	 * is defined to work this way, so we allow the constructor to be called
	 * without "new".
	 */
	if (!(this instanceof VError)) {
		obj = Object.create(VError.prototype);
		VError.apply(obj, arguments);
		return (obj);
	}

	/*
	 * For convenience and backwards compatibility, we support several
	 * different calling forms.  Normalize them here.
	 */
	parsed = parseConstructorArguments({
	    'argv': args,
	    'strict': false
	});

	/*
	 * If we've been given a name, apply it now.
	 */
	if (parsed.options.name) {
		mod_assertplus.string(parsed.options.name,
		    'error\'s "name" must be a string');
		this.name = parsed.options.name;
	}

	/*
	 * For debugging, we keep track of the original short message (attached
	 * this Error particularly) separately from the complete message (which
	 * includes the messages of our cause chain).
	 */
	this.jse_shortmsg = parsed.shortmessage;
	message = parsed.shortmessage;

	/*
	 * If we've been given a cause, record a reference to it and update our
	 * message appropriately.
	 */
	cause = parsed.options.cause;
	if (cause) {
		mod_assertplus.ok(mod_isError(cause), 'cause is not an Error');
		this.jse_cause = cause;

		if (!parsed.options.skipCauseMessage) {
			message += ': ' + cause.message;
		}
	}

	/*
	 * If we've been given an object with properties, shallow-copy that
	 * here.  We don't want to use a deep copy in case there are non-plain
	 * objects here, but we don't want to use the original object in case
	 * the caller modifies it later.
	 */
	this.jse_info = {};
	if (parsed.options.info) {
		for (k in parsed.options.info) {
			this.jse_info[k] = parsed.options.info[k];
		}
	}

	this.message = message;
	Error.call(this, message);

	if (Error.captureStackTrace) {
		ctor = parsed.options.constructorOpt || this.constructor;
		Error.captureStackTrace(this, ctor);
	}

	return (this);
}
352718
function () {
                if (!this.enabled || this.enabling) {
                    return;
                }

                var err, cjsModule,
                    id = this.map.id,
                    depExports = this.depExports,
                    exports = this.exports,
                    factory = this.factory;

                if (!this.inited) {
                    this.fetch();
                } else if (this.error) {
                    this.emit('error', this.error);
                } else if (!this.defining) {
                    //The factory could trigger another require call
                    //that would result in checking this module to
                    //define itself again. If already in the process
                    //of doing that, skip this work.
                    this.defining = true;

                    if (this.depCount < 1 && !this.defined) {
                        if (isFunction(factory)) {
                            //If there is an error listener, favor passing
                            //to that instead of throwing an error. However,
                            //only do it for define()'d  modules. require
                            //errbacks should not be called for failures in
                            //their callbacks (#699). However if a global
                            //onError is set, use that.
                            if ((this.events.error && this.map.isDefine) ||
                                req.onError !== defaultOnError) {
                                try {
                                    exports = context.execCb(id, factory, depExports, exports);
                                } catch (e) {
                                    err = e;
                                }
                            } else {
                                exports = context.execCb(id, factory, depExports, exports);
                            }

                            // Favor return value over exports. If node/cjs in play,
                            // then will not have a return value anyway. Favor
                            // module.exports assignment over exports object.
                            if (this.map.isDefine && exports === undefined) {
                                cjsModule = this.module;
                                if (cjsModule) {
                                    exports = cjsModule.exports;
                                } else if (this.usingExports) {
                                    //exports already set the defined value.
                                    exports = this.exports;
                                }
                            }

                            if (err) {
                                err.requireMap = this.map;
                                err.requireModules = this.map.isDefine ? [this.map.id] : null;
                                err.requireType = this.map.isDefine ? 'define' : 'require';
                                return onError((this.error = err));
                            }

                        } else {
                            //Just a literal value
                            exports = factory;
                        }

                        this.exports = exports;

                        if (this.map.isDefine && !this.ignore) {
                            defined[id] = exports;

                            if (req.onResourceLoad) {
                                req.onResourceLoad(context, this.map, this.depMaps);
                            }
                        }

                        //Clean up
                        cleanRegistry(id);

                        this.defined = true;
                    }

                    //Finished the define stage. Allow calling check again
                    //to allow define notifications below in the case of a
                    //cycle.
                    this.defining = false;

                    if (this.defined && !this.defineEmitted) {
                        this.defineEmitted = true;
                        this.emit('defined', this.exports);
                        this.defineEmitComplete = true;
                    }

                }
            }
1241807
def _cor_compile(rule, var, val, result_class, key, compilation_list):
        
        compilation = compilation_list.get(key, None)
        if compilation:
            if isinstance(val, ListRule):
                result = []
                for itemv in val.value:
                    result.append(compilation['callback'](itemv))

                val = compilation['listclass'](result)
            else:
                val = compilation['callback'](val)
        return result_class(rule.operation, var, val)
1303642
function _buildTree(&$rootDoc, &$class, $depth = NULL) {
        if ($depth === NULL) {
            $start = TRUE;
            $depth = 0;
        } else {
            $start = FALSE;
        }
        $output = "";
        $undefinedClass = FALSE;
        if ($class->superclass()) {
            $superclass = & $rootDoc->classNamed($class->superclass());
            if ($superclass) {
                $result = $this->_buildTree($rootDoc, $superclass, $depth);
                $output .= $result[0];
                $depth = ++$result[1];
            } else {
                $output .= $class->superclass();
                $output .= " &gt; ";
                $depth++;
                $undefinedClass = TRUE;
            }
        }
        if ($depth > 0 && !$undefinedClass) {
            $output .= " &gt; ";
        }
        if ($start) {
            $output .= "**" . $class->name() . "**\n";
        } else {
            $output .= "<a href=\"" . $this->_asURL($class) . "\">" . $class->name() . "</a>\n";
        }
        return array($output, $depth);
    }
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' */            }
752794
function () {
            var self = this, l = self.length, needClone = self.length > 1, originArgs = util.makeArray(arguments);
            var cfg = originArgs[0];
            var AnimConstructor = Anim;
            if (cfg.to) {
                AnimConstructor = cfg.Anim || Anim;
            } else {
                cfg = originArgs[1];
                if (cfg) {
                    AnimConstructor = cfg.Anim || Anim;
                }
            }
            for (var i = 0; i < l; i++) {
                var elem = self[i];
                var args = needClone ? util.clone(originArgs) : originArgs, arg0 = args[0];
                if (arg0.to) {
                    arg0.node = elem;
                    new AnimConstructor(arg0).run();
                } else {
                    AnimConstructor.apply(undefined, [elem].concat(args)).run();
                }
            }
            return self;
        }
512978
public function build()
    {
        $this->debug->groupCollapsed(__METHOD__);
        $str = '';
        $strFunctions   = '';
        $strListen      = '';
        $strOnload      = '';
        $trigs = $this->getTriggers();
        $this->debug->log('trigs', $trigs);
        foreach ($trigs as $trigName => $trig) {
            $strFunc = $this->buildOnChangeFunc($trig);
            $strFunctions .= $strFunc."\n";
            $strOnload .= "\t".$trig['funcName']."();\n";
            $trigFields = $this->getFieldsWithName($trigName);
            foreach ($trigFields as $field) {
                // Listen to this field && call func when changed
                $strListen .= $this->buildListen($field, $trig['funcName'])."\n";
            }
        }
        if (!empty($strFunctions) || !empty($strListen)) {
            $str = '<script type="text/javascript">'."\n"
                .'//<![CDATA['."\n"
                .'$(function(){'."\n"
                    .'BDKForm.init("#'.$this->form->cfg['attribs']['id'].'");'."\n"
                    .$strFunctions
                    .$strListen
                    .'$(window).on("focus", function() {'."\n"
                        // .'console.log("window focused... re calculating required");'
                        .$strOnload
                    .'});'."\n"
                .'});'."\n"
                .'//]]>'."\n"
                .'</script>';
        }
        $this->debug->log('str!!', $str);
        $this->debug->groupEnd();
        return $str;
    }
1115860
function makeDiscordjsError(Base) {
  return class DiscordjsError extends Base {
    constructor(key, ...args) {
      super(message(key, args));
      this[kCode] = key;
      if (Error.captureStackTrace) Error.captureStackTrace(this, DiscordjsError);
    }

    get name() {
      return `${super.name} [${this[kCode]}]`;
    }

    get code() {
      return this[kCode];
    }
  };
}
343551
function Math() {

    var self = this;

    // /**
    //  * init
    //  * @constructor
    //  * */
    // var init = function() {
    //     if ( typeof(Math.instance) != "undefined" ) {
    //         return Math.instance
    //     } else {
    //         Math.instance = self
    //     }
    // }

    /**
     * Operate from a string value
     *
     * e.g.:
     *
     *  var operate = require("gina").utils.math.operate;
     *  var calculation = "10*2";
     *  var result = operate(calculation);
     *      => 20
     *
     *  @param {string} calcultation
     *
     *  @return {number} result
     * */
    this.operate = function(calculation) {
        return new Function('return ' + calculation)()
    }

    /**
     * Checksum
     * e.g: checksum(data, 'sha1')
     *
     * @param {string} str - Data to analyse
     * @param {string} algorithm
     * @param {string} [ encoding ] - e.g.: hex
     *
     * @return {string} checksum
     * */
    var checkSum = function (str, algorithm, encoding) {
        try {
            return crypto
                .createHash(algorithm || 'md5')
                .update(str, 'utf8')
                .digest(encoding || 'hex')
        } catch (err) {
            return err
        }
    }

    /**
     * Checksum
     *
     * @param {string} filename|data
     * @param {string} algorithm
     * @param {string} encoding
     *
     * @callback cb
     *  @param {object|string} err
     *  @param {string} checksum
     * */
    this.checkSum = function(filename, algorithm, encoding, cb) {
        var err = false, sum = null;

        if ( /\./.test(filename) ) {
            fs.readFile(filename, function (err, data) {
                sum = checkSum(data, algorithm, encoding);
                if( sum instanceof Error) {
                    err = sum;
                    sum = undefined
                }

                cb(err, sum)
            })
        } else {
            sum = checkSum(filename, algorithm, encoding);
            if( sum instanceof Error) {
                err = sum;
                sum = undefined
            }

            cb(err, sum)
        }
    }

    /**
     * Check sum from file or form data
     *
     * @param {string} filename|data
     * @param {string} algorithm
     * @param {string} encoding
     *
     * @return {string} checksum
     * */
    this.checkSumSync = function(filename, algorithm, encoding) {
        var sum = null;
        try {
            if ( /(\.[a-z]{3})$/.test(filename) ) { // must be a string
                // from filename
                sum = checkSum( fs.readFileSync(filename), algorithm, encoding )
            } else {
                // from data
                sum = checkSum( filename, algorithm, encoding )
            }

            if (sum instanceof Error)
                throw sum;
            else
                return sum

        } catch (err) {
            //console.error(err.stack||err.message);
            //return undefined
            throw err
        }
    }

    // for big files only: > 1Mb
    //this.checkSumBig= function(filename, cb) {
    //    var hash = crypto.createHash('md5');
    //    var encryption = encryption || 'sha1';
    //
    //    var stream = fs.createReadStream(filename);
    //    stream.on('data', function (data) {
    //        hash.update(data, 'utf8')
    //    })
    //
    //    stream.on('end', function () {
    //        hash.digest('hex');
    //    })
    //}

    //init();
    return this
}
814109
function func(schema, defaults, options) {
  if (kindOf(schema) !== 'function') {
    if (process.env.NODE_ENV !== 'production') {
      throw new Error(
        `Function structs must be defined as a function, but you passed: ${schema}`
      )
    } else {
      throw new Error(`Invalid schema: ${schema}`)
    }
  }

  const name = 'function'
  const type = '<function>'
  const validate = (value = resolveDefaults(defaults), data) => {
    const result = schema(value, data)
    let failure = { path: [], reason: null }
    let isValid

    switch (kindOf(result)) {
      case 'boolean': {
        isValid = result
        break
      }
      case 'string': {
        isValid = false
        failure.reason = result
        break
      }
      case 'object': {
        isValid = false
        failure = { ...failure, ...result }
        break
      }
      default: {
        if (process.env.NODE_ENV !== 'production') {
          throw new Error(
            `Validator functions must return a boolean, an error reason string or an error reason object, but you passed: ${schema}`
          )
        } else {
          throw new Error(`Invalid result: ${result}`)
        }
      }
    }

    return isValid
      ? [undefined, value]
      : [{ type, value, data: value, ...failure }]
  }

  return new Kind(name, type, validate)
}
504068
function define () {
        var _args = __class._arguments.apply(this, arguments);
        var _name = _args.name,
            _super = _args.super,
            _meta = _args.meta,
            _init = _meta.methods.init;

        _meta.properties = _meta.properties || _meta.props;
        _meta.props = null;
        delete _meta.props;

        var ZNClass, _SuperClass, _prototype;

        if (_super._static_) {
            throw new Error('Static class cannot be inherited.');
        }

        if (_super._final_) {
            throw new Error('Final class cannot be inherited.');
        }

        if (_name && _meta.partial) {
            ZNClass = zn.path(GLOBAL, _name);
        }

        if (_meta.static) {
            if (ZNClass) {
                if (!ZNClass._static_) {
                    throw new Error('Partial class "' + _name + '" must be static.');
                }
            } else {
                ZNClass = function () {
                    throw new Error('Cannot instantiate static class.');
                };
            }

            _prototype = ZNClass.prototype;
        } else {
            if (ZNClass) {
                if (ZNClass._static_) {
                    throw new Error('Partial class "' + _name + '" must not be static.');
                }

                if (ZNClass._super_ !== _super && ZNClass._super_ !== ZNObject) {
                    throw new Error('Partial class "' + _name + '" must have consistent super class.');
                }

            } else {
                ZNClass = _meta.abstract ?
                    function () {
                        throw new Error('Cannot instantiate abstract class.');
                    } :
                    function () {
                        var _mixins = ZNClass._mixins_ || [],
                            _ctors = ZNClass._ctors_ || [],
                            _ctor_ = null,
                            _arguments = arguments;

                        this.__id__ = __id__++;
                        this.__handlers__ = {};
                        this.__initializing__ = true;
                        this.__afters__ = [];

                        var _mixin = null,
                            _ctor = null;

                        for (var i = 0, _len = _mixins.length; i < _len; i++) {
                            _mixin = _mixins[i];
                            if(_mixin['@init']){
                                _ctor = _mixin['@init'].meta;
                                _ctor = zn.is(_ctor, 'function') ? _ctor : _ctor.value;
                                __execSuperCtor(_mixin.prototype.__super__, this, _arguments);
                                if (_ctor) {
                                    _ctor.call(this);
                                }
                            }else {
                                __execSuperCtor(_mixin.prototype.__super__, this, _arguments);
                            }
                        }

                        __execSuperCtor(this.__super__, this, _arguments);

                        for (var j = 0, _ctorLen = _ctors.length; j < _ctorLen; j++) {
                            _ctor_ = _ctors[j];
                            _ctor_ = zn.is(_ctor_, 'function') ? _ctor_ : _ctor_.value;
                            if (_ctor_) {
                                _ctor_.apply(this, _arguments);
                            }
                        }

                        while(this.__afters__.length>0){
                            var _after = this.__afters__.pop();
                            _after.handler.apply(_after.context, _arguments);
                        }

                        this.__afters__ = null;
                        delete this.__afters__;


                        this.__initializing__ = false;
                    };

                ZNClass._ctors_ = [];
            }

            if (ZNClass._super_ !== _super) {
                _SuperClass = function () { };
                _SuperClass.prototype = _super.prototype;
                _prototype = new _SuperClass();
                _prototype.constructor = ZNClass;
                _prototype.__type__ = _name || 'Anonymous';
                _prototype.__super__ = _super;


                ZNClass.prototype = _prototype;
            } else {
                _prototype = ZNClass.prototype;
            }

            _prototype.class = _prototype.constructor;

            if (_init) {
                ZNClass._ctors_.push(_init);
                if(!_prototype.__ctor__){
                    _prototype.__ctor__ = _init;
                }
            }

        }

        __class._meta(ZNClass, _args);

        if (_prototype.__define__) {
            _prototype.__define__.call(ZNClass);
        }

        if(_name){
            zn.path(GLOBAL, _name, ZNClass);
        }

        return ZNClass;
    }