text:
/**
 * Author: Denis Zatsepin
 * Email: denis@zatsepin.spb.ru
 * Date: 05.09.13
 */

const Router  = require('koa-router');
const Body    = require('koa-body');

/**
 * This function gets handlers and base path and associate handlers with routes.
 * @param {String} path
 * @param {Array} handlers
 */
module.exports = function(handlers) {
	var path = '/';
	var router = new Router();
  for (var actionName in handlers) {
    var handler = handlers[actionName];
    var route = '';

    switch(actionName) {
      case 'index':
        router.get(path, handler);
        break;
      case 'new':
        route = path + 'new';
        router.get(route, handler);
        break;
      case 'create':
        router.post(path, Body(), handler);
        break;
      case 'show':
        route = path + ':id';
        router.get(route, handler);
        break;
      case 'edit':
        route = path + ':id/edit';
        router.get(rotue, handler);
        break;
      case 'update':
        route = path + ':id';
        router.put(route, Body(), handler);
        break;
      case 'destroy':
        route = path + ':id';
        router.delete(route, handler);
        break;
      default:
        router.get(route, Body(), handler);
    }
  }
	return router;
};

domain: javascript


text:
const flipSign = (x) => x * -1;
function getElementViewportOffset(element, offset = 0) {
    const rect = element.getBoundingClientRect();
    return {
        top: rect.top - offset,
        bottom: flipSign(rect.bottom - window.innerHeight) - offset,
        left: rect.left - offset,
        right: flipSign(rect.right - window.innerWidth) - offset
    };
}
export function alignWebPopoverIfRequired(style, anchorElement, popoverElement) {
    const offsetHeight = anchorElement.offsetHeight;
    const offset = getElementViewportOffset(anchorElement, 0);
    const popoverOffsetWidth = popoverElement.offsetWidth;
    const popoverOffsetHeight = popoverElement.offsetHeight;
    const isOverflowingRight = offset.left + popoverOffsetWidth > window.innerWidth;
    const isOverflowingLeft = offset.right + popoverOffsetWidth > window.innerWidth;
    const isOverflowingBottom = offset.top + popoverOffsetHeight > window.innerHeight - 40;
    const isOverflowingTop = offset.bottom + popoverOffsetHeight > window.innerHeight - 40;
    if (isOverflowingRight) {
        style.right = 0;
        style.transform = undefined;
    }
    if (isOverflowingLeft) {
        style.left = 0;
        style.transform = undefined;
    }
    if (isOverflowingBottom) {
        style.top = undefined;
        style.bottom = offsetHeight;
    }
    if (isOverflowingTop) {
        style.bottom = undefined;
        style.top = offsetHeight;
    }
    return style;
}
//# sourceMappingURL=alignWebPopoverIfRequired.js.map


text:
'use strict';

define([], function() {

	return function() {

		function show(scope, element, title, lead, text, buttons) {

			var deferred = Promise.defer();

			element.find(".modal-title").html(title);
			element.find(".lead").html(lead);
			element.find(".modal-text").html(text);

			var buttonContainer = element.find(".modal-buttons");
			buttonContainer.empty();

			for (var i in buttons) {
				var b = buttons[i];

				var btn = $("<a/>");

				btn.addClass("button primary radius");
				btn.html(b.caption);

				if(b.target)
					btn.attr("target", b.target);

				if (b.href)
					btn.attr("href", b.href);

				btn.on("click", function(i, e) {
					deferred.resolve(buttons[i].value);
				}.bind(null, i));

				buttonContainer.append(btn);
			}

			scope.cancel = function() {
				deferred.reject("cancel");
			}

			// Deal with cancel by esc.
			function keyup(e) {
				if (e.which == 27)
					scope.cancel();
			}

			function hide() {
				scope.modal.foundation("reveal", "close");
				$("body").off("keyup", keyup);
			}

			deferred.promise.then(hide, hide);

			scope.modal.foundation("reveal", "open");
			$("body").one("click", ".reveal-modal-bg", scope.cancel);
			$("body").on("keyup", keyup);

			return deferred.promise;
		}

		return {

			scope: {
				ctrl: "=",
			},

			restrict: 'EA',

			templateUrl: "partials/directives/Modal.html",

			link: function(scope, element, attrs) {

				scope.modal = element.find(".reveal-modal");
				$(document).foundation();

				scope.ctrl.show = show.bind(this, scope, element);

			},
		};
	};
});


text:
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'image2', 'zh-cn', {
	alt: '替换文本',
	btnUpload: '上传到服务器',
	captioned: '带标题图像',
	captionPlaceholder: '标题',
	infoTab: '图像信息',
	lockRatio: '锁定比例',
	menu: '图像属性',
	pathName: '图像',
	pathNameCaption: '标题',
	resetSize: '原始尺寸',
	resizer: '点击并拖拽以改变尺寸',
	title: '图像属性',
	uploadTab: '上传',
	urlMissing: '缺少图像源文件地址',
	altMissing: '缺少替换文本'
} );


text:
/**
 * {@link http://www.focus-ui.com}
 *
 * @version 1.1
 * @namespace
 */
var z = {};

/**
 * Releases the hold on the z shortcut identifier, so that other scripts can use it.
 *
 * @return {z}reference     - A reference to z, that you can save in a variable, for later use
 *
 * @example
 * var zx = z.noConflict();
 * console.log(zx.util.isString("abc"));
 */
z.noConflict = function () {
};

/**
 * @memberOf z
 * @namespace
 */
z.util = {
    /**
     * Determines whether the passed value is an Array.
     *
     * @param value         - The value to be checked.
     *
     * @return {Boolean}    - true if the value is an Array; otherwise, false.
     *
     * @example
     * z.util.isArray([1,2]);//true
     * z.util.isArray([]);//true
     * z.util.isArray(new Array(1,2));//true
     */
    isArray: function (value) {
    },

    /**
     * Determines whether the passed value is a String.
     *
     * @param value         - The value to be checked.
     *
     * @return {Boolean}    - true if the value is a String; otherwise, false.
     *
     * @example
     * z.util.isString("abc");//true
     * z.util.isString("");//true
     * z.util.isString(new String("abc"));//true
     */
    isString: function (value) {
    },

    /**
     * Determines whether the passed value is a Boolean
     *
     * @param value         - The value to be checked.
     *
     * @return {Boolean}    - true if the value is a Boolean; otherwise, false.
     *
     * @example
     * z.util.isBoolean(true);//true
     * z.util.isBoolean(false);//true
     * z.util.isBoolean(new Boolean(true));//true
     */
    isBoolean: function (value) {
    },

    /**
     * Determines whether the passed value is an Object
     *
     * @param value         - The value to be checked.
     *
     * @return {Boolean}    - true if the value is an Object; otherwise, false.
     *
     * @example
     * z.util.isObject({name:"focus-ui"});//true
     * z.util.isObject({});//true
     * z.util.isObject(Object.create(null));//true
     *
     * z.util.isObject(null) == false;
     * z.util.isObject(undefined) == false;
     */
    isObject: function (value) {
    },

    /**
     * Determines whether the passed value is a Function
     *
     * @param value         - The value to be checked.
     *
     * @return {Boolean}    - true if the value is a Function; otherwise, false.
     *
     * @example
     * z.util.isFunction(function(){});//true
     * z.util.isFunction(Math.abs);//true
     */
    isFunction: function (value) {
    },

    /**
     * Determines whether the passed value is a Number
     *
     * @param value         - The value to be checked.
     *
     * @return {Boolean}    - true if the value is a Number; otherwise, false.
     *
     * @example
     * z.util.isNumber(0);//true
     * z.util.isNumber(-1);//true
     * z.util.isNumber(new Number(0));//true
     */
    isNumber: function (value) {
    },

    /**
     * Merges one or more arrays to the target array
     *
     * @param {Array}targetArray    - The target array.
     * @param {Array}srcArrays      - The source array(s).
     *
     * @return {Array}targetArray   - The target array.
     *
     * @example
     * z.util.mergeArray([1,2],[3,4]);//[1,2,3,4]
     * z.util.mergeArray([1, 2], [3], [4], [[5, 6]]);//[1, 2, 3, 4, [5, 6]]
     */
    mergeArray: function (targetArray, srcArrays) {
    },

    /**
     * Executes a provided function once for each array element.
     * ★The callback function returns false to break the loop. If the loop will not be broken, just uses array.forEach.
     *
     * @param {Array}array          - The array that eachArray is being applied to.
     * @param {Function}callback    - Function to execute for each element,Returns false to break the loop., taking two arguments:
     *

     *
currentValue
   - The value of the current element being processed in the array.
     *
index
          - The index of the current element being processed in the array.
     *

     * @param {Object}[thisArg] - Value to use as this (i.e the reference Object) when executing callback.
     *
     * @return void
     *
     * @example
     *

     * var array = [1, 2, 3]
     * z.util.eachArray(function (item, index) {
     *    console.log(item);
     * });
     * var has2 = false;
     * z.util.eachArray(function (item, index) {
     *   console.log(item);
     *   if (item === 2) {
     *       has2 = true;
     *       return false;//stop
     *   }
     * });
     *

     */
    eachArray: function (array, callback, thisArg) {
    },

    /**
     * Creates a new array with all elements that pass the test implemented by the provided function.
     *
     * @param {Array}array          - The array filterArray was called upon.
     * @param {Function}callback    - Function is a predicate, to test each element of the array.
     *                                ★Return true to keep the element, false otherwise. It accepts two arguments:
     *

     *
element
 - The current element being processed in the array.
     *
index
 - The index of the current element being processed in the array.
     *

     * @param {Object}[thisArg]     - Value to use as this when executing callback.
     *
     * @return {Array}newArray - A new array with the elements that pass the test. If no elements pass the test, an empty array[] will be returned.
     *
     * @example
     *

     * var arr = [10,20,30];
     * var newArr = z.util.filterArray(arr,function (item) {
     *    return item > 10;
     * });
     * console.log(newArr);//[20,30]
     *

     */
    filterArray: function (array, callback, thisArg) {
    },

    /**
     * Returns the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.
     *
     * @param {Array}array - The array findArray was called upon.
     * @param {Function}callback - Function to execute on each value in the array, taking two arguments:
     *

     *
element
The current element being processed in the array.
     *
index
The index of the current element being processed in the array.
     *

     * @param {Object}[thisArg] - Value to use as this when executing callback.
     *
     * @return {*}item - The first element in the array that satisfies the provided testing function(★return true); otherwise, undefined is returned.
     *
     * @example
     *

     * var arr = [
     *    {name:"a"},
     *    {name:"b"},
     *    {name:"c"}
     * ];
     * var c = z.util.findArray(arr,function (item) {
     *    return item.name === "c"
     * });
     * console.log(c);//{name:"c"}
     *

     */
    findArray: function (array, callback, thisArg) {
    },

    /**
     *  Removes the first element in the array that satisfies the provided testing function.
     *
     * @param {Array}array          - The array removeArrayItem was called upon.
     * @param {Function}callback    - Function to execute on each value in the array, taking two arguments:
     *

     *
element
 - The current element being processed in the array.
     *
index
 - The index of the current element being processed in the array.
     *

     *                                  ★If the callback function returns true, the item will be removed and returned
     * @param {Object}[thisArg]     - Value to use as this when executing callback.
     *
     * @return removedItem          - The first element in the array that satisfies the provided testing function; otherwise, undefined is returned.
     *
     * @example
     *

     * var arr = [
     *    {name: "a"},
     *    {name: "b"},
     *    {name: "c"}
     * ];
     * var bItem = z.util.removeArrayItem(arr, function (item) {
     *    return item.name === "b";
     * });
     * console.log(bItem);//{name:"b"}
     * console.log(arr);//[{name: "a"},{name: "c"}]
     *

     */
    removeArrayItem: function (array, callback, thisArg) {
    },

    /**
     * Creates an object composed of keys generated from the results of running each element of array.
     *
     * @param {Array}array                          - The specified array to be converted
     * @param {(String|Function)}keyOrFunction      - The specified key property or the function to generate the key.
     * @param {Object}[thisArg]                     - Value to use as this when executing key function. If keyOrFunction is not a function, it will be ignored.
     *
     * @return {Object}mapObject                    - The composed aggregate object.
     *
     * @example
     *

     * var array = [
     *      {name: "a", value: 10},
     *      {name: "b", value: 20},
     *      {name: "c", value: 30}
     * ];
     * var map1 = z.util.toArrayMap(array, "name");
     * console.log(map1);//{a:{"name":"a","value":10},b:{"name":"b","value":20},c:{"name":"c","value":30}}
     * var map2 = z.util.toArrayMap(array, function (item) {
     *      return "_" + item.name;
     * });
     * console.log(map2);//{_a:{"name":"a","value":10},_b:{"name":"b","value":20},_c:{"name":"c","value":30}}
     *
     *

     */
    toArrayMap: function (array, keyOrFunction, thisArg) {
    },

    /**
     * Merges the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
     * *Properties in the target object will be overwritten by properties in the sources if they have the same key.
     * *Later sources' properties will similarly overwrite earlier ones.
     * *For deep merge, please see {@link z.util.deepMergeObject}.
     *
     * @param {Object}targetObject          - The target object.
     * @param {...Object}sourceObjects      - The source object(s).
     *
     * @return {Object}targetObject         - The target object.
     *
     *
     * @example
     *

     * console.log(z.util.mergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {d: 4}, {e: "a"}));
     * {
     *   a: 1,
     *   b: 2,
     *   c: {x: 100, y: 200},
     *   d: 4,
     *   e: "a"
     * }
     *
     * console.log(z.util.mergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: 4}, {e: "a"}));
     * {
     *   a: 1,
     *   b: 2,
     *   c: 4,
     *   e: "a"
     * }
     *
     * console.log(z.util.mergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: {z: 300}}, {e: "a"}));
     * {
     *   a: 1,
     *   b: 2,
     *   c: {z: 300},
     *   e: "a"
     * }
     *

     */
    mergeObject: function (targetObject, sourceObjects) {
    },

    /**
     * Merges the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.
     * *The difference between {@link z.util.deepMergeObject} and {@link z.util.mergeObject} is that for the Object type property,
     *

     *
mergeObject
only makes a simple assignment
     *
deepMergeObject
creates a new object and assigns to the targetObject
     *

     *
     * @param {Object}targetObject          - The target object.
     * @param {...Object}sourceObjects      - The source object(s).
     *
     * @return {Object}targetObject         - The target object.
     *
     *
     * @example
     *

     * console.log(z.util.deepMergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {d: 4}, {e: "a"}));
     * //same as mergeObject
     * {
     *   a: 1,
     *   b: 2,
     *   c: {x: 100, y: 200},
     *   d: 4,
     *   e: "a"
     * }
     *
     * console.log(z.util.deepMergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: 4}, {e: "a"}));
     * //same as mergeObject
     * {
     *   a: 1,
     *   b: 2,
     *   c: 4,
     *   e: "a"
     * }
     *
     * console.log(z.util.deepMergeObject({a: 1, b: 2, c: {x: 100, y: 200}}, {c: {z: 300}}, {e: "a"}));
     * //Different from mergeObject
     * {
     *   a: 1,
     *   b: 2,
     *   c:{x: 100, y: 200, z: 300},
     *   e: "a"
     * }
     *

     */
    deepMergeObject: function (targetObject, sourceObjects) {
    },

    /**
     * Executes a provided function once for each object enumerable own property.
     *
     * @param {Object}object        - The object that eachObject is being applied to.
     * @param {Function}callback    - Function to execute for each property, taking two arguments:
     *

     *
key
     - The key of the current property being processed in the object.
     *
value
   - The value of the current property being processed in the object.
     *

     *          *If the callback function returns false, the eachObject will stop
     * @param {Object}[thisArg] -Value to use as this when executing callback.
     *
     * @return void
     *
     * @example
     *

     * var obj = {name:"focus-ui",version:0.6};
     * z.util.eachObject(obj,function (key, value) {
     *    console.log(key,value);
     * });
     *

     */
    eachObject: function (object, callback, thisArg) {
    },

    /**
     *  Creates a new object with all enumerable own properties that pass the test implemented by the provided function.
     *
     * @param {Object}object        - The object that filterObject is being applied to.
     * @param {Function}callback    -  Function is a predicate, to test each enumerable own property of the object. Return true to keep the property, false otherwise. It accepts two arguments:
     *

     *
key
     - The key of the current property being processed in the object.
     *
value
   - The value of the current property being processed in the object.
     *

     *
     * @param {Object}[thisArg]     - Value to use as this when executing callback.
     *
     * @return {Object}newObject   - A new object with the enumerable own properties that pass the test. If no properties pass the test, an empty object will be returned.
     *
     * @example
     *

     * var object = {
     *      a: 1,
     *      b: 2,
     *      c: {x: 100, y: 200},
     *      d: "abc",
     *      e: "123"
     *  };
     * var stringObject = z.util.filterObject(object, function (key, value) {
     *    return z.util.isString(value);
     * });
     * console.log(stringObject);//{d:"abc",e:"123"}
     *

     *
     */
    filterObject: function (object, callback, thisArg) {
    },

    /**
     *  Gets the value at path of object.
     *  Only processing object, array is not processed
     * @param {Object}object            - The object to query
     * @param {String}deepPath          - The path of the property to get
     *
     * @param {String}[pathSeparator]   - Optional. Specifies the character, or the regular expression, to use for splitting the path. default "."
     *
     * @return {*}value   -  the result value.
     *
     * @example
     *

     * var object = {
     *     c: {
     *         x: 100,
     *         y: 200,
     *         z: {
     *             a: "abc",
     *             b: "xyz"
     *         }
     *     }
     * };
     * var czb = z.util.getObjectDeepValue(object, "c.z.b");//"xyz"
     *

     */
    getObjectDeepValue: function (object, deepPath, pathSeparator) {
    },

    /**
     *  Sets the value at path of object. If a portion of path doesn't exist, it's created
     *  Only processing object, array is not processed
     *
     * @param {Object}object            - The object to modify
     * @param {String}deepPath          - The path of the property to set.
     * @param {*}value                  - The value to set.
     * @param {String}[pathSeparator]   - Optional. Specifies the character, or the regular expression, to use for splitting the path. default "."
     *
     * @return void
     *
     * @example
     *

     * var object = {
     *     c: {
     *         x: 100, y: 200, z: { a: "abc",b: "xyz"}
     *     }
     * };
     * z.util.setObjectDeepValue(object, "a", "1");
     * z.util.setObjectDeepValue(object, "b.m", "1000");
     * z.util.setObjectDeepValue(object, "c.z.c", 123);
     * console.log(object)
     * /!*{
     *       a: "1",
     *       b: {m: "1000" },
     *      c: {x: 100, y: 200, z: {a: "abc", b: "xyz", c: 123}}
     *   }*!/
     *

     */
    setObjectDeepValue: function (object, deepPath, value, pathSeparator) {
    },

    /**
     * Returns an array of a given object's own enumerable property values.
     *
     * @param {Object}object            - The object whose enumerable own property values are to be returned.
     * @return {Array}valueArray        - An array containing the given object's own enumerable property values.
     *
     * @example
     *

     * var object = {
     *    a: 'a',
     *    b: 1,
     *    c: false
     * };
     * console.log(z.util.getObjectValues(object));//["a", 1, false]
     *

     *
     */
    getObjectValues: function (object) {
    },

    /*#callBatch*/
    /**
     *  Calls a function after a specified number of milliseconds.
     *
     * @param {Function}callBack        - The function that will be executed
     * @param {Number}[delay]           - The number of milliseconds to wait before executing the code. If omitted, the value 20 is used
     * @param {Object}[thisArg]         - Value to use as this when executing callback.
     *
     * @return {String} callLaterID     - A string type value, representing the ID value of the timer that is set.
     *                                     Use this value with the cancelCallLater() method to cancel the timer.
     *
     * @example
     *

     * z.util.callLater(function () {
     *     console.log("1s later")
     * }, 1000)
     *

     * @see {@link z.util.cancelCallLater}
     */
    callLater: function (callBack, delay, thisArg) {
    },

    /**
     *
     * Cancels the function set with the callLater() to execute:
     *
     * @param {(String|Function)}idOrFunction     - The identifier/function you want to cancel callLater.
     *

     *
IF it is id
that should be returned by the corresponding call to callLater().
     *
IF it is function
that should be the callBack function
     *

     *
     * @param {Number}[delay]       - The number of milliseconds to wait before executing the code. If omitted, the value 20 is used
     * @param {Object}[thisArg]     - Value to use as this when executing callback.
     *
     * @return void
     *
     * @example
     *

     * //id
     * var id = z.util.callLater(function () {
     *     console.log("never called")
     * }, 1000);
     * z.util.cancelCallLater(id);
     *
     * //function
     * var callBack = function () {
     *     console.log("never called")
     * };
     * z.util.callLater(callBack, 1000);
     * z.util.cancelCallLater(callBack, 1000);
     *

     *
     * @see {@link z.util.callLater}
     */
    cancelCallLater: function (idOrFunction, delay, thisArg) {
    },

    /**
     * Calls a function with a fixed time delay between each call
     *
     * @param {Function}callBack            - The function that will be executed.
     *                                          If the callback function returns false, the callInterval will stop.
     * @param {Number}[intervals]           - The intervals (in milliseconds) on how often to execute the code. If omitted, the value 20 is used.


text:
import React from "react";

const Footer = () => {
  return (

                About us

                Blog

                Press

                iOS App

                Android App

                  <ion-icon name="logo-facebook" className="facebook-icon"></ion-icon>

                  <ion-icon name="logo-twitter" className="twitter-icon"></ion-icon>

                  <ion-icon name="logo-googleplus" className="googleplus-icon"></ion-icon>

                  <ion-icon name="logo-instagram" className="instagram-icon"></ion-icon>

Copyright © 2021 | ZBlock | All rights reserved.

  );
};

export default Footer;


text:
import Validator from '../Validator';

export const messages = {
  title: {
    required: 'Title is required.',
    max: 'Title should not exceed 255 characters.'
  },
  description: {
    max: 'Description should not exceed 255 characters.'
  }
};

export const validateTitle = value => {
  let errors = [];

  if (Validator.required(value)) {
    errors.push(messages.title.required);
  }

  if (Validator.max(value)) {
    errors.push(messages.title.max);
  }

  return errors;
};

export const validateDescription = value => {
  let errors = [];

  if (Validator.max(value)) {
    errors.push(messages.description.max);
  }

  return errors;
};

export const allowSubmit = fields => {
  for (let a in fields) {
    if (!fields[a].title.value.length || fields[a].title.errors.length
    || fields[a].description.errors.length) {
      return false;
    }
  }

  return true;
};


text:
const path = require('path')
const PnpWebpackPlugin = require(`pnp-webpack-plugin`)
const WebpackUserscript = require('webpack-userscript')
const { isDev } = require('./utils')
const pkg = require('./package')

const HOST = process.env.HOST || 'localhost'
const PORT = process.env.PORT || 9000

const BASE_URL = `https://${HOST}:${PORT}/`

const corsHeaders = {
  "Access-Control-Allow-Origin": "*",
  "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
  "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
}

module.exports = {
  mode: isDev ? 'development' : 'production',
  entry: require.resolve('./src/index.js'),
  target: 'web',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: `${pkg.name}.user.js`,
    globalObject: "this",
    publicPath: isDev ? BASE_URL : '',
    jsonpFunction: "userscriptJsonpFunction"
  },
  optimization: {
    minimize: false
  },
  devServer: {
    port: PORT,
    https: true,
    headers: corsHeaders,
    disableHostCheck: true,
    contentBase: path.join(__dirname, 'dist'),
    compress: false,
    hot: true,
    hotOnly: true
  },
  resolve: {
    plugins: [
      PnpWebpackPlugin
    ]
  },
  resolveLoader: {
    plugins: [
      PnpWebpackPlugin.moduleLoader(module),
    ],
  },
  module: {
    rules: [
      {
        test: /\.m?js$/,
        use: {
          loader: require.resolve('babel-loader')
        },
        exclude: [
          /node_modules\/(?!(consola)\/).*/,
          /userscripts\/packages\/polyfills.*/
        ]
      }
    ]
  },
  plugins: [
    new WebpackUserscript({
      headers: require.resolve('./header.js'),
      proxyScript: {
        baseUrl: BASE_URL,
        filename: '[basename].proxy.user.js',
        enable: isDev
      }
    })
  ]
}


text:
/**
 * 338. Counting Bits
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.

Example:
For num = 5 you should return [0,1,1,2,1,2].

Follow up:

It is very easy to come up with a solution with run time O(n*sizeof(integer)). But can you do it in linear time O(n) /possibly in a single pass?
Space complexity should be O(n).
Can you do it like a boss? Do it without using any builtin function like __builtin_popcount in c++ or in any other language.
 *
 * @param {number} num
 * @return {number[]}
 */
function countBits1(num) {
    let arr =[0];
    for(let i=1;i<=num;i++){
        let count = i.toString(2).match(/1/g).length
        arr.push(count);
    }
    return arr;
};
function countBits2(num){
	let arr =[0];
    for(let i=1;i<=num;i++){
        let count = i.toString(2).match(/1/g).length
        arr.push(count);
    }
    return arr;
}
module.exports = [countBits1,countBits2];


text:
// Data structure that holds captions for the videos
var videoCaptions = [
  [{"text":"Okay, so the rest of what you said is, 'are there any words in the titles that are used a lot in spam?' So basically you wanna look at other spam messages, and [student answers, inaudible] figure out what vocabulary they might use, and hope that there is something in terms of the vocabularies of the titles, as you suggested, that is common.","width":1921},{"text":"Other suggestions?","width":212},{"text":"[student answers inaudibly] What do you mean by training a program?","width":886},{"text":"[student explains, inaudible] So what do you mean by 'similar emails?' So the question is: in what sense are the next messages, which you've never seen, similar to what you have seen before.","width":2138},{"text":"That's key here.","width":59},{"text":"Yeah?","width":158},{"text":"[student answers inaudibly] Okay, so here is a suggestion to formulate the problem: take an email message; map it somehow to a vector, let's say a real valued vector of dimensionality 75.","width":1887},{"text":"If you can do this to all email messages, then there is a well-defined notion of a distance, maybe the cosine between these vectors.","width":653},{"text":"That solves your problem, because now you have a notion of distance, and things that are similar to the spam that you've seen, we're gonna say, 'these are spam'.","width":743},{"text":"Things that are not, you'll say, 'these are NOT spam'.","width":259},{"text":"What is the technical difficulty here?","width":306},{"text":"What is the difficult step in doing what we just said?","width":255},{"text":"[student answers inaudibly] What do you mean by evaluating the similarity?","width":253},{"text":"[student explains, inaudible] Even before evaluating the similarity, the difficulty.","width":723},{"text":"Over there.","width":116},{"text":"[student answers, inaudible] Right, so the key issue is what's in this message is important for it being spam, and what is not.","width":948},{"text":"So just mapping it to a vector, just a technical thing- you can- it's already a vector, the way it's written here.","width":471},{"text":"I don't necessarily need to map it to another vector, maybe I will, but the key issue is what do I look at in this message?","width":492},{"text":"Do I look at the fact that some of this font is blue, and some is red?","width":238},{"text":"Do I look at the size of the font?","width":142},{"text":"Do I look at the characters?","width":195},{"text":"Do I look at...","width":87},{"text":"what do I look at?","width":110},{"text":"Do I look at the sender?","width":93},{"text":"Do I look at the date?","width":62},{"text":"What do I look at in the message to determine that this is spam.","width":437},{"text":"If I don't know what to look at in the message, if I don't tell my program what it really sees here, then we have no chance, right?","width":850},{"text":"Because the key thing is that you have seen this message, for the first time I assume, nevertheless, you can say something about whether for you it's spam.","width":829},{"text":"By the way, it could be that it's spam for you, and not spam for someone else.","width":410},{"text":"So there is a question of developing a model, or a classifier, and this is really what we wanna do in this class.","width":684},{"text":"We wanna be able to study algorithms and techniques that will allow us to lean models from past data.","width":659},{"text":"Here are a few other examples that, again, I wanna kind of trigger your thinking about this because these are...","width":370},{"text":"all of them have to do with stacks, or natural language, but they are very very different types of examples.","width":377},{"text":"So the first one, at the top here, can I have a peace of cake?","width":295},{"text":"We probably didn't mean this kind of peace, this is very similar to the poem problem that I asked before, we probably mean this kind of piece.","width":520},{"text":"Again, you can ask yourself; this is a binary decision.","width":218},{"text":"You see it in a word in a sentence, and you wanna decide: is this the appropriate word to use there?","width":377},{"text":"Is this the appropriate word or should I use something else?","width":269},{"text":"How would you decide?","width":150},{"text":"How would you write a program to decide?","width":354}],
  [{"text":"Right?","width":124},{"text":"So how you abstract, how you represent things is really crucial here.","width":326},{"text":"Next problem, this is a sentence that says, 'this can will rust', and the task here, is simply to determine what is the part of speech tag of each word in the context of this sentence.","width":1073},{"text":"'This' is an article, 'can' is a noun, 'will' is a kind of a model verb, 'rust' is a verb.","width":502},{"text":"Very easy, sometime you can question, 'why do I need to know this', but it's sometimes important to know whether 'can', in the context of this sentence...","width":757},{"text":"in most cases, 'can' is actually a verb, in this case, 'can' is a noun, and you know this.","width":562},{"text":"Again, it's a prediction problem.","width":242},{"text":"There are multiple part of speech tags, for example, in english, common vocabulary or part of speech tags would have forty five different labels, and you want to determine which one it is.","width":893},{"text":"What makes this problem somewhat different than the earlier problems on the same slide?","width":1020},{"text":"Again, it's a prediction.","width":66},{"text":"I look at the word, 'can', or 'will', that also can have multiple part of speech tags (think about it for a second).","width":529},{"text":"Here, it's a model verb, it could be a noun, it could be other things.","width":332},{"text":"What makes this prediction challenge different than, say, the 'peace/piece' problem?","width":758},{"text":"Yeah?","width":100},{"text":"[student answers, inaudible] So the first one was binary, and this is not binary.","width":637},{"text":"That's one thing.","width":92},{"text":"There are more labels here.","width":160},{"text":"That's one difference.","width":74},{"text":"Another one?","width":57},{"text":"Yeah?","width":55},{"text":"[student answers, inaudible] It depends on the context, but the first sentence also, the context matters.","width":644},{"text":"So, whether it's 'peace', or...","width":557},{"text":"This sentence makes sense either way, and what I wanna know is some kind of property outside the sentence.","width":460},{"text":"That's what I was looking for.","width":458},{"text":"So there are other differences, and you are all right, but this is a key different thing.","width":355},{"text":"Whether one word is a noun depends not only on the sentence it's in, but also on what is the role in the sentence of other things.","width":636},{"text":"For example, in english, it's unlikely that you have two consecutive verbs.","width":294},{"text":"Could happen, unlikely though.","width":128},{"text":"So if I decided that this word is a verb, it's unlikely that I'll decide that the next one is a verb.","width":394},{"text":"So maybe, I don't need to think about this as one prediction per word, but rather I need to think about it globally, the whole sentence together, because the decisions I'm going to make, actually are interdependent.","width":1093},{"text":"So in this case it's a sequence.","width":114},{"text":"In some other cases it will not be a sequence, it will be some kind of other structure, but there will be interdependencies between predictions that I'm making, and that's important.","width":791},{"text":"That's a problem that we sometimes call structured prediction problem.","width":294},{"text":"Finally, the last example that I have here, two sentences, 'the dog bit the kid.","width":444},{"text":"He was taken to a...' vet, or he was taken to a hospital.","width":294},{"text":"Hopefully you agree that what 'he' refers to is determined by which sentence I choose, a vet or a hospital, agreed?","width":1169},{"text":"How do you know?","width":133},{"text":"What do you have to equip your program with, in order for the program to know?","width":621},{"text":"So here is an option: we need to equip the program with some knowledge of what is a vet, what is a hospital, what do the serve.","width":684},{"text":"Yeah?","width":7},{"text":"[student asks question, inaudible] What is a dog?","width":301},{"text":"What is a kid?","width":626},{"text":"[student asks question, inaudible] .", "width":1027}],
  [{"text":"Say something, what do you see Objects yeah That's correct, that's the easy level of the answer but I think you can say more.","width":1109},{"text":"Animals, cars Yeah the cars and the animals are in different orientations.","width":570},{"text":"That is unintentional...","width":207},{"text":"uhh Back So yeah, four legged animals You probably see few others, few other things that you see here.","width":1773},{"text":"I know but what I am asking is what do you see, what have you recognized?","width":379},{"text":"Vegetables, Ok so basically there are a lot of objects and what you have done is that you have clustered them into groups.","width":804},{"text":"You said I see shoes, cars, vegetables.","width":259},{"text":"Now notice that we made it difficult for you but it wasn't difficult.","width":389},{"text":"The sizes are completely wrong here, right The relative size of these things on the image vs the relative sizes in life.","width":882},{"text":"If you really look at it into the pixel level.","width":221},{"text":"Just choose a shoe and a car for example.","width":259},{"text":"Some of the shoes are a lot more similar at the pixel level to some of the cars than to other shoes and vice versa.","width":776},{"text":"Nevertheless it doesn't bother you at all, you were able to cluster it and moreover much how the problem you were able to name the clusters, which by the way is still a problem today.","width":888},{"text":"We can do a lot about clustering, naming clusters is actually a very difficult problem for different reasons.","width":532},{"text":"So this is another aspect of machine learning, we are gonna discuss this semester.","width":337},{"text":"If you think about this specific example you will see that it is extremely difficult because we have taken a lot of the natural features of these objects away for example size, orientation, colours context etc.","width":1057},{"text":"but it doesn't bother you at all.","width":214},{"text":"Ok, so what is machine learning?","width":319},{"text":"Where do we need it?","width":94},{"text":"Hopefully, the example I have given so far indicate to you you know, it is a core of a lot of things.","width":433},{"text":"Most of the examples I have given are, it is a core of understanding high level cognition In general I like to think about this as knowledge intensive instances, because all the tasks I have given you, you need a lot of knowledge in order to be able to think about them, make predictions.","width":1264},{"text":"It's at a core of building adaptive intelligence systems, whatever definition you want to put into this.","width":464},{"text":"In general dealing with messy, real world data.","width":317},{"text":"Which is really what a lot of computer science and many other applications are doing today.","width":495},{"text":"We are done dealing with good clean data people have organized for class and we are trying to deal with more naturally occuring data of different sorts and this is where machine learning is going to be easy and necessary Has to do with analytics, which became some kind of code buzz word for...","width":1360},{"text":"use a lot of data and tell me about this data.","width":173},{"text":"So it tells a lot of goals, for knowledge acquisition to the integration of various knowledge sources, to ensure adaptations, to supportin decision making.","width":1118},{"text":"In all this context you can find needs for machine learning.","width":315},{"text":"So what is machine learning?","width":149},{"text":"I am not gonna wait for a definition from you, cause we will have 250 definitions.","width":396},{"text":"I am going to use a definition that Hebb Simon who was a computer scientist, economist given probably 50 years ago or so He said, learning denotes changes in the system that are adaptive in the sense that they enable the system to do the task or tasks drawn from the same population more efficiently and more effectively the next time.","width":2098}],
  [{"text":"which is, if you think about it, a pretty good definition of what learning is.","width":402},{"text":"And I wanna emphasize one thing here, 'drawn from the sample population'.","width":277},{"text":"This is actually the key.","width":124},{"text":"If you haven't thought about it yet, think about it, and you will have to think about it in the course of this semester.","width":349},{"text":"Because this is one key starting point for us, as computer scientists, to think about this problem, if we wanna think about machine learning in any formal way.","width":760},{"text":"So that we can write programs.","width":142},{"text":"So that we can analyze programs.","width":126},{"text":"So that we can say something about the performance of a machine learning program.","width":297},{"text":"Can we say whether it's gonna do well on previously unseen examples?","width":296},{"text":"Can we say something about how well ti's gonna do?","width":223},{"text":"Can we give some guarantees on performance, which is the job we have as computer scientists?","width":446},{"text":"It all hinges on this part of this statement, 'drawn from the same population'.","width":372},{"text":"If we don't make this kind of assumptions, or similar assumptions, there's nothing we can do.","width":430},{"text":"And this is gonna be a core component of what we are gonna do in this class.","width":264},{"text":"We're gonna try to think about why does it work, or when does it work, and when it doesn't.","width":393},{"text":"So I wanna actually augment the definition and I wanna think about machine learning mostly as the ability to perform a task in a situation which has never been encountered before.","width":840},{"text":"So to me, learning is really generalization, or abstraction if you want.","width":256},{"text":"If you think about it, all the examples that I've given before were example that for vast majority of you were new.","width":535},{"text":"Nevertheless, it didn't bothered you.","width":125},{"text":"You could do the prediction quite easily.","width":166},{"text":"In fact, almost any situation that you encounter in life at the very fine level of representation, it's new.","width":612},{"text":"When you are listening to what I'm saying now, behind my fine accent, you have no problem of understanding it even though it's a new signal for you.","width":730},{"text":"When you look around, every time yo see a completely different image, nevertheless, you can interpret it.","width":531},{"text":"So the key question is how do you do the subtraction.","width":291},{"text":"This is really what machine learning is about, so don't lose track of it even though we're gonna force you to lose track of it because it's gonna be more technical, but this is really what we are aiming at.","width":762},{"text":"To figure out how to generalize.","width":248},{"text":"And again, you can think about the spam filter, whenever you see a spam message, you know it's spam even though you've never seen it before.","width":775},{"text":"And you won't just, in this case, do the simple thing- decide yes or no in this case.","width":432},{"text":"So this learner able or at least attempts to classify items it has never seen before.","width":600},{"text":"And you gave a lot of ideas on what does it mean that it is able to do it.","width":323},{"text":"And what should we look at in this representation, and this is the key.","width":317},{"text":"In what sense is this message similar to others and different from others that you have seen before.","width":538},{"text":"And if you are able to figure out this representational issues, then you have a chance of writing a program that will predict correctly on this.","width":976},{"text":"If you wanna think about learning as generalization, you can dream up a lot of examples and I'm just gonna run through this example very quickly, it happens everywhere.","width":633},{"text":"Classification problem like medical diagnosis.","width":194},{"text":"Credit card applications, that for years already, are using machine learning technology.","width":366},{"text":"Or recognizing hand writing letters.","width":184},{"text":"And many other things.","width":112},{"text":"You can see it in other more involved scenarios, like planning and acting, navigation, self-driving cars, game-playing.","width":617},{"text":"You can see it in skills, how to balance a ball, how to play tennis.","width":345},{"text":"These are all learning activities that rely on the ability to generalize from previous situation to future unseen situations.","width":1009},{"text":"And, of course, common sense reasoning, whatever that means, for example things that dictate natural language interactions, scene interpretations, and other things.","width":766},{"text":"So really I wanna highlight the underlying all these abilities is really the basic ability to perform a task in a situation which has never been encountered before.","width":1024},{"text":"And while this class is about algorithms, so we are gonna talk a lot about machine learning algorithms, I want you to keep thinking about this notion of representation that is as important and as crucial to the ability of machine learning programs to work as the algorithm.","width":1502},{"text":"And in fact, perhaps even more important.","width":167},{"text":"That does not mean that we are gonna spend more time on representation than on algorithms, the reason is that we have less to say about representation than on algorithms.","width":734},{"text":"But it's really a crucial thing.","width":195},{"text":"So why do we wanna study learning?","width":169},{"text":"A lot of opportunities.","width":264}],
  [{"text":"Basically you can think about a quipping computer system with new capabilities, things that we cannot program conventionally.","width":621},{"text":"Programs that cannot automatically adapt, customize themselves.","width":406},{"text":"too many things.","width":110},{"text":"And of course discovering things that are out there in the data and wanna be able to do this automatically.","width":530},{"text":"So you can dream up many many applications, I ma not gonna spend a lot of time.","width":410},{"text":"But there are applications in the area of you know computer systems with new capabilities, you can think about applications with respect to cognition.","width":619},{"text":"Human biological learning and even think about understanding teaching better.","width":369},{"text":"Different notion of the word learning perhaps, still highly related and the key thing the reason why so many of you are here because the time is right.","width":691},{"text":"People have realized in the last few years that actually we can do something with machine learning.","width":491},{"text":"There are initial algorithms and theory in place as you will see as this might be a little disappointing to some of you in the course of this semester, most of the algorithms, mos tof the key algorithmic ideas that we are going to cover in the class were out there in the 60's.","width":1145},{"text":"Really the basic algorithmic ideas were out there.","width":211},{"text":"I am going to point this out.","width":148},{"text":"What has changed is that we have developed theory and we understand what they do, when they do and how they work and how they don't work pretty well now.","width":504},{"text":"And the theory has been developed say in the last 20-30 years.","width":336},{"text":"We have a lot more data and we have a lot more computing power.","width":589},{"text":"Both CPU and other versions and memory, and this actually has made huge impact on our ability to use algorithmic ideas with a few new tricks, but minor tricks.","width":986},{"text":"To get machine learning to actually do something significant.","width":312},{"text":"Not to say we know everything, there is a lot of things we still don't know in machine learning, and hopefully the media hasn't convinced you yet, someone has solved all the problems, they haven't.","width":1333},{"text":"We can do a lot things.","width":134},{"text":"As I say it is also necessary, things that computer science and other areas are trying to do today, we realized that we cannot do them without machine learning.","width":718},{"text":"To me this is going to be key.","width":154},{"text":"Almost everything we are gonna do in the future, dealing with real world messy data will necessitate using machine learning techniques, influenced techniques.","width":922},{"text":"So in this sense you are in the right place.","width":321},{"text":"As I said many unresolved issues, so something for you to work on!","width":664},{"text":"I want to move on to what is this class about and what I think you should know, before that machine learning touches a lot of areas.","width":696},{"text":"Both at the application level and at the technique level, it makes use of probability, statistics, linear algebra, statistics again, theory of computation and so on.","width":930},{"text":"I expect you know some of it, or been exposed to some of it before you came here.","width":605},{"text":"One important thing again to that has perhaps to do something with the expectation you have from this class is that it is an extremely active field.","width":746},{"text":"Hundreds of papers being written as we speak.","width":431}],


text:
import { Util } from 'discord.js';
export default class extends Command {
    constructor(options) {
        super(options);
        this.description = "Convert common text to binary";
    }
    async run(bot, message, args) {
        if (!args[1]) return message.channel.send("Put some text");
        const input = args.slice(1).join(" ");
        const output = [];
        for (let i = 0; i < input.length; i++) {
            if(output.length >= 2000) break;
            output.push(input[i].charCodeAt(0).toString(2));
        }
        await message.channel.send(`\`Output:\` ${Util.splitMessage(output.join(" "), { char: " ", maxLength: 1900 })[0]}`);
    }
}


text:
import {createStore, combineReducers, applyMiddleware} from 'redux'
import createLogger from 'redux-logger'
import thunkMiddleware from 'redux-thunk'
import {composeWithDevTools} from 'redux-devtools-extension'
import user from './user'
import newt from './newt'

const reducer = combineReducers({user, newt})
const middleware = composeWithDevTools(applyMiddleware(
  thunkMiddleware,
  createLogger({collapsed: true})
))
const store = createStore(reducer, middleware)

export default store
export * from './user'
export * from './newt'


text:
(function () {
    'use strict';

    angular
        .module('qorDash.core')
        .factory('eventBus', eventBus);

    /**
     *
     */
    function eventBus(EVENTS_URL, $rootScope) {
        var self = {
            initConnection: initConnection
        };

        /**
         *
         */
        function initConnection() {
            self.connection = self.connection || new EventSource(EVENTS_URL);

            self.connection.addEventListener('Event', function(event){
                var eventType = JSON.parse(event.data).type;

                $rootScope.$broadcast('eventBus:all', event);
                $rootScope.$broadcast('eventBus:' + eventType, event);
            });
        }

        return self;
    }

})();


text:
import React, { Component } from 'react';
import { StyleSheet, View, TouchableOpacity, Dimensions, Alert, Text, FlatList ,Animated} from 'react-native';
import TabNavigator from 'react-native-tab-navigator';
import Search from 'react-native-search-box';

import { Card, Toast, Modal, WingBlank, WhiteSpace, List, SwipeAction, Icon } from '@ant-design/react-native';
import IconConfig from '../../config/IconConfig'
import ScreenConfig from '../../config/ScreenConfig';
import {HistoryArrayGroup} from '../../config/StorageModule'
import UserModule from '../../config/UserModule'
import {StyleConfig,FontStyleConfig} from '../../config/StyleConfig';

const { width, height } = Dimensions.get('window');

class ziweiHistoryPage extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isLoading: false,
      errorMessage: undefined,
      popupShowed: false,
      dataSource:[],
    };
  }
  rowTranslateAnimatedValues = {};
  animationIsRunning=false
  static navigationOptions = ({ navigation }) => {
    const { navigate } = navigation;

    return {
    title:RouteConfig["ziweiHistoryPage"].name,
  };
}

  /*
  handleFingerprintShowed = () => {
    this.setState({ popupShowed: true });
  };

  handleFingerprintDismissed = (any) => {
    this.setState({ popupShowed: false });
    if(false==any)
    {
      this.props.navigation.goBack()
    }
    else
    {
      this.timer = setTimeout(
        () => {
          this.refreshlist()
        },
        200
      );
    }

  };
  */

  componentDidMount() {
    this.refreshlist()
    /*
    FingerprintScanner
    .isSensorAvailable()
    .then(
      this.handleFingerprintShowed()
    )
    .catch(
      error =>{
        if(error.name == "FingerprintScannerNotSupported")
        {this.handleFingerprintDismissed(true)}
      }
    );
    */
  }

  componentWillUnmount() {
    // 如果存在this.timer，则使用clearTimeout清空。
    // 如果你使用多个timer，那么用多个变量，或者用个数组来保存引用，然后逐个clear
    //FingerprintScanner.release();
    this.timer && clearInterval(this.timer);
  }
  _starRow(rowData){
    HistoryArrayGroup.loadid( 'eightrandom',rowData.id ).then(async(ret) => {
      var Jobj = JSON.parse(ret);
      Jobj.star = true == Jobj.star ? false : true
      Jobj.sync = false
      ret = JSON.stringify(Jobj)
      let T = await UserModule.SyncFileServer("eightrandom",rowData.id,ret)
      if(undefined!=T && 2000==T.code)
      {
        ret = HistoryArrayGroup.MakeJsonSync(ret)
      }
      await HistoryArrayGroup.saveid('eightrandom',rowData.id, ret )
      this.refreshlist();
    })
  }
  _updateRow(rowData) {
    console.log(rowData)
    Modal.prompt(
      '八字提示',
      '',
      (newtips: any) => this._updateStorage(rowData, newtips),
      'default',
      '',
      [rowData.tip],
    );
  };
  _updateStorage(rowData, newtips) {
    HistoryArrayGroup.loadid( 'eightrandom',rowData.id ).then(async(ret) => {
      var Jobj = JSON.parse(ret);
      Jobj.sync = false
      Jobj.tip = newtips;
      ret = JSON.stringify(Jobj)
      let T = await UserModule.SyncFileServer("eightrandom",rowData.id,ret)
      if(undefined!=T && 2000==T.code)
        {
            ret = HistoryArrayGroup.MakeJsonSync(ret)
        }
      await HistoryArrayGroup.saveid('eightrandom', rowData.id, ret )
      this.refreshlist();
    })
  }

  _deleteRow(rowData) {
    Alert.alert(
      '提示',
      '删除: ' + rowData.name,
      [
        { text: '取消', onPress: () => console.log('Cancel Pressed'), style: 'cancel' },
        { text: '删除', onPress: () => this._deletehistory(rowData) },
      ],
      { cancelable: false }
    )

  }
  async _deletehistory(rowData) {
    HistoryArrayGroup.loadid('eightrandom', rowData.id).then(async (ret) => {
      var Jobj = JSON.parse(ret);
      let T = await UserModule.SyncFileServer("eightrandom", Jobj.id, "")
      if (undefined != T && 2000 == T.code) {
        T.data.forEach(async (element) => {
          filename = element.File
          if (-1 != filename.indexOf(String(rowData.id))) {
            await HistoryArrayGroup.remove("eightrandom", rowData.id);
          }
        });
      }
      else {
        await HistoryArrayGroup.remove("eightrandom", rowData.id);
        await HistoryArrayGroup.remove("name", rowData.id);
      }
      this.Animaterefreshlist(rowData)
    })
  }
  Animaterefreshlist(rowData) {
    if (!this.animationIsRunning) {
      this.animationIsRunning = true;
      Animated.timing(this.rowTranslateAnimatedValues[rowData.id], { toValue: 0, duration: 500 }).start(() => {
        Animated.timing(this.rowTranslateAnimatedValues[rowData.id], { toValue: 1, duration: 10 }).start(() => {
          this.animationIsRunning = false;
          this.refreshlist();
        })
      });
    }
  }

  refreshlist() {
      HistoryArrayGroup.GetEightRandomHistory().then(ids=>{
        if (ids.length == 0) {
          ScreenConfig.DeviceToast("暂无历史数据")
          this.props.navigation.goBack()
          return
        }
        var filterArray = []
        for (var i = 0; i < ids.length; i++) {
          if (10==ids[i].ret.length) {
            filterArray.push(ids[i])
          }
        }
        this.setState({dataSource: filterArray})
      })
  }

  onSearch = (searchText) => {
    return new Promise((resolve, reject) => {
        if(this.state.dataSource.length>0)
        {
          var filterArray = []
          for (var i = 0, len = this.state.dataSource.length; i < len; i++) {
            console.log(searchText,this.state.dataSource[i].name);
            if (this.state.dataSource[i].tip.match(searchText)) {
              filterArray.push(this.state.dataSource[i])
            }
          }
          this.setState({dataSource:filterArray})
        }
        resolve();
    });
}
  onSearchCancel= () => {
    return new Promise((resolve, reject) => {
      HistoryArrayGroup.GetEightRandomHistory().then(ids=>{
          this.setState({dataSource: ids})

        })
        resolve();
    });
}
changeViewLayout(e,data) {
  h = e.nativeEvent.layout.height
  /*
  var it = this.refs[data.item.id]
  console.log("changeViewLayout",it)

  this.refs[data.item.id].setNativeProps({
      style:{height: this.rowTranslateAnimatedValues[data.item.id].interpolate({
            inputRange: [0, 1],
            outputRange: [0,h],})
    }})
  */

}

  render() {
    this.animationIsRunning=false
    this.rowTranslateAnimatedValues = {};
    rowlist = this.state.dataSource
    rowlist.forEach((element, i) => {
        this.rowTranslateAnimatedValues[`${element.id}`] = new Animated.Value(1);
    });
    const { errorMessage, popupShowed } = this.state;
    const { navigate } = this.props.navigation;
    return(
      <View>
        <Search
          ref="search_box"
          onSearch={this.onSearch}
          onCancel={this.onSearchCancel}
          //defaultValue="搜索"
          placeholder="搜索"
          cancelTitle="取消"
          //returnKeyType="搜索"
          keyboardDismissOnSubmit={true}
          backgroundColor="#ffffff"
          titleCancelColor="#000000"
          /**
          * There many props that can customizable
          * Please scroll down to Props section
          */
        />
        <FlatList
          useFlatList={true}
          //1数据的获取和渲染
          data={this.state.dataSource}
          keyExtractor={(item, index) => index.toString()}
          renderItem={(data,index) => {
            var ret = data.item.ret
            ret = ret.split(0,7)
            return(
            <View >
              <SwipeAction

                autoClose
                style={{ backgroundColor: 'transparent' }}
                right={[
                  {
                    text: IconConfig.IconAddTip,
                    onPress: () => this._updateRow(data.item),
                  },
                  {
                    text: IconConfig.IconDelete,
                    onPress: () => this._deleteRow(data.item),
                  },
                ]}
                left={[{
                  onPress: () => this._starRow(data.item),
                  text: IconConfig.IconAddStar,
                }]}
                onOpen={() => console.log('open')}
                onClose={() => console.log('close')}
              >

                <WingBlank size="md" >
                  <View onLayout={(e)=>this.changeViewLayout(e,data)}>
                <Animated.View style={
                    {
                      height: this.rowTranslateAnimatedValues[data.item.id].interpolate({
                            inputRange: [0, 1],
                            outputRange: [0,120 + (data.item.tip.length)/30 * 13],
                        })
                    }}
                    ref={ref => { this.refs[data.item.id] = ref }}
                     >
                <Card style={{ width: width - 20,paddingLeft:10 } } >
                  <TouchableOpacity onPress={() => navigate('ziweiMainPage', data.item.url)}>
                    <Card.Header
                      title={<Text style={{fontSize:FontStyleConfig.getFontApplySize()+14}}>{ret}</Text>}
                      //thumbStyle={{ width: 30, height: 30 }}
                      thumb={true == data.item.star ? IconConfig.IconStar : IconConfig.IconUStar}
                      extra={<Text style={{fontSize:FontStyleConfig.getFontApplySize()+14}}>{data.item.time}</Text>} />
                    <Card.Body>
                      <View >
                        <Text style={{fontSize:FontStyleConfig.getFontApplySize()+14, marginLeft: 16,marginRight:16}}>{data.item.name}:{data.item.tip}</Text>
                      </View>
                    </Card.Body>
                    <Card.Footer content="" extra={<Text style={{fontSize:FontStyleConfig.getFontApplySize()+14}}>{data.item.birth}</Text>}/>
                  </TouchableOpacity>
                </Card>
                </Animated.View>
                </View>
                </WingBlank>
              </SwipeAction>
              <WhiteSpace size="xs" />
            </View>
          )}}
        />
        <WhiteSpace size="xl" />
        <WhiteSpace size="xl" />
        <WhiteSpace size="xl" />
        <WhiteSpace size="xl" />
        <Text style={{fontSize:FontStyleConfig.getFontApplySize()+11,color:"#DDDDDD",textAlign:"center"}}>--end--</Text>
        <WhiteSpace size="xl" />
      </View>

    )
  }

}

var styles = StyleSheet.create({
  container: {
    flex: 1
  },
  list: {
    height: 45,
    //borderWidth:1,
    marginLeft: 10,
    paddingLeft: 10,
    //borderColor: '#ccc',
    borderRadius: 4,
    justifyContent: 'center', //虽然样式中设置了 justifyContent: 'center'，但无效
    //textAlign:'center',
    //textDecorationLine:'underline'
  },

  delete: {
    color: "#d8fffa",
    marginLeft: 30,
    alignItems: 'flex-start',//水平靠右
  },
  rowFront: {
    alignItems: 'center',
    backgroundColor: 'white',
    borderBottomColor: 'black',
    borderBottomWidth: 0,
    justifyContent: 'center',
    height: 120,
  },
  rowBack: {
    alignItems: 'center',
    //backgroundColor: '#DDD',
    flex: 1,
    flexDirection: 'row',
    justifyContent: 'space-between',
    paddingLeft: 15,
  },
  backRightBtn: {
    alignItems: 'center',
    bottom: 0,
    justifyContent: 'center',
    position: 'absolute',
    top: 0,
    width: 75
  },
  backLeftBtnLeft: {
    //backgroundColor: 'blue',
    left: 0
  },
  backRightBtnLeft: {
    //backgroundColor: 'blue',
    right: 75
  },
  backRightBtnRight: {
    //backgroundColor: 'red',
    right: 0
  },
  controls: {
    alignItems: 'center',
    marginBottom: 30
  },
  switchContainer: {
    flexDirection: 'row',
    justifyContent: 'center',
    marginBottom: 5

  }
});
module.exports = ziweiHistoryPage;


text:
import React, { Component } from "react";
import axios from "axios";
import { Link } from "react-router-dom";
import Spinner from "../layout/Spinner";
export default class Lyrics extends Component {
  state = {
    track: {},
    lyrics: {},
  };
  componentDidMount() {
    axios
      .get(
        `https://cors-anywhere.herokuapp.com/https://api.musixmatch.com/ws/1.1/track.lyrics.get?track_id=${this.props.match.params.id}&apikey=${process.env.REACT_APP_MM_KEY}`
      )
      .then((res) => {
        this.setState({ lyrics: res.data.message.body.lyrics });
        // console.log(res.data);
        return axios
          .get(
            `https://cors-anywhere.herokuapp.com/https://api.musixmatch.com/ws/1.1/track.get?track_id=${this.props.match.params.id}&apikey=${process.env.REACT_APP_MM_KEY}`
          )
          .then((res) => {
            //  console.log(res.data)
            this.setState({ track: res.data.message.body.track });
          })
          .catch((err) => console.log(err));
      })
      .catch((err) => console.log(err));
  }
  render() {
    const { track, lyrics } = this.state;

    if (
      track === undefined ||
      lyrics === undefined ||
      Object.keys(track).length === 0 ||
      Object.keys(lyrics).length === 0
    ) {
      return <Spinner />;
    } else {
      return (
        <React.Fragment>
          <Link to="/" className="btn btn-dark btn-sm mb-4">
            Go Back
          </Link>

              {track.track_name} by {""}

            {track.artist_name}

{lyrics.lyrics_body}

              Album ID:
              {track.track_id}

              Genre:
              {
                track.primary_genres.music_genre_list[0].music_genre
                  .music_genre_name
              }

              Explicit:
              {track.explicit === 0 ? "No" : "Yes"}

              Release Date:
              {track.updated_time}

        </React.Fragment>
      );
    }
  }
}


text:
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App/App'
import './styles/index.scss'
//import reportWebVitals from './reportWebVitals';
import Amplify from '@aws-amplify/core'
import { Auth } from 'aws-amplify'
import awsconfig from './aws-exports'
import 'react-toastify/dist/ReactToastify.css'

Amplify.configure(awsconfig)
Auth.configure(awsconfig)
ReactDOM.render(<App />, document.getElementById('root'))

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
// reportWebVitals();


text:
import DnaScroll from "@/modules/dna.scroll.core.js";

class DnaScrollDown {
  constructor() {
    console.log("scrolldown constructor");

    // Keep track of if we are scrolled down or up
    this.scrolledDown = false;

    // The number of pixels down to detect we have scrolled down from top
    this.scrollDownDetectStart = 50;

    // How many more pixels needed to scroll back up to trigger up scroll
    // This prevents the browsers micro-scrolls if the header reduces in
    // size and causes a few pixels of scroll to happen making a constant
    // loop of adding/removing the scorll classes
    this.scrollBackOverdrive = 40;

    // Get any elements that want to listen to scroll down events
    this.scrollDownItems = document.querySelectorAll("[data-scrolldown-class]");

    // Every time the page scrolls...
    DnaScroll.OnScroll(() => {
      // Get scroll position
      var windowTop = DnaScroll.ScrollPositionY();

      // If we have not scrolled down
      // and we are now scrolled down...
      if (!this.scrolledDown && windowTop > this.scrollDownDetectStart) {
        // Flag we have scrolled down
        this.scrolledDown = true;

        // For each element...
        ForEach(this.scrollDownItems, function(item) {
          // Add the desired class
          item.classList.add(item.getAttribute("data-scrolldown-class"));
        });
      }
      // Else if we scrolled back up (at least 20px )...
      else if (
        this.scrolledDown &&
        windowTop <=
          Math.max(0, this.scrollDownDetectStart - this.scrollBackOverdrive)
      ) {
        // Flag we are not scrolled down
        this.scrolledDown = false;

        // For each element...
        ForEach(this.scrollDownItems, function(item) {
          // Add the desired class
          item.classList.remove(item.getAttribute("data-scrolldown-class"));
        });
      }
    });
  }

  // Hook all elements that want to monitor for scroll
  // scrollDownDetectStart = position in pixels at which to start detecting a scroll
  Hook(scrollDownDetectStart = 50) {
    console.log("scroll hooked");

    this.scrollDownDetectStart = scrollDownDetectStart;

    // Find any elements with a data-scrolldown-class attribute
    // and adds that class to them when we scroll from the top of the the page
    this.scrollDownItems = document.querySelectorAll("[data-scrolldown-class]");
  }

  Unhook() {
    console.log("scroll unhooked");
    this.scrollDownItems = null;
  }
}

// Single global instance
window.$DnaScrollDown = new DnaScrollDown();

export default window.$DnaScrollDown;


text:
class ArticleListCtrl {
  constructor(Articles, $scope) {
    'ngInject';

    this._Articles = Articles;

    this.setListTo(this.listConfig);

    $scope.$on('setListTo', (ev, newList) => {
      this.setListTo(newList);
    });

    $scope.$on('setPageTo', (ev, pageNumber) => {
      this.setPageTo(pageNumber);
    });

  }

  setListTo(newList) {
    // Set the current list to an empty array
    this.list = [];

    // Set listConfig to the new list's config
    this.listConfig = newList;

    this.runQuery();
  }

  setPageTo(pageNumber) {
    this.listConfig.currentPage = pageNumber;

    this.runQuery();
  }

 runQuery() {
    // Show the loading indicator
    this.loading = true;
    this.listConfig = this.listConfig || {};

    // Create an object for this query
    let queryConfig = {
      type: this.listConfig.type || undefined,
      filters: this.listConfig.filters || {}
    };

    // Set the limit filter from the component's attribute
    queryConfig.filters.limit = this.limit;

    // If there is no page set, set page as 1
    if (!this.listConfig.currentPage) {
      this.listConfig.currentPage = 1;
    }

    // Add the offset filter
    queryConfig.filters.offset = (this.limit * (this.listConfig.currentPage - 1));

    // Run the query
    this._Articles
      .query(queryConfig)
      .then(
        (res) => {
          this.loading = false;

          // Update list and total pages
          this.list = res.articles;

          this.listConfig.totalPages = Math.ceil(res.articlesCount / this.limit);
        }
      );
  }

}

let ArticleList = {
  bindings: {
    limit: '=',
    listConfig: '='
  },
  controller: ArticleListCtrl,
  template: require('../../components/article-helpers/article-list.html')
};

export default ArticleList;


text:
/* eslint react/prop-types: 0 */
import React from 'react'
import creteStore from '../src/index'
import withLoading from './withLoading'

const { Provider, connect } = creteStore(
  {
    loading: false,
    posts: [],
  },
  {
    onChange: subreddit => async (dispatch) => {
      if (subreddit === '') return { posts: [], loading: false }
      const response = await fetch(`https://www.reddit.com/r/${subreddit}.json`)
      const json = await response.json()
      const posts = json.data.children.map(child => child.data)
      return dispatch({ posts, loading: false })
    },
    setLoading: loading => dispatch => dispatch({ loading }),
  },
)

let Picker = ({ value, onChange, options }) => (

{value}

    <select
      onChange={e => onChange(e.target.value)}
      value={value}
    >
      <option value="">Please Select</option>
      {options.map(option =>
          (
            <option value={option} key={option}>
              {option}
            </option>))
        }
    </select>

)

Picker = connect(({ selectedSubreddit }, { onChange, setLoading }) => ({
  value: selectedSubreddit,
  onChange: (value) => {
    setLoading(true)
    onChange(value)
  },
}))(Picker)

let Posts = ({ posts }) => (

    {
      posts.map((post, i) =>

{post.title}
)
    }

)

Posts = connect(({ posts, loading }) => ({ posts, loading }))(withLoading(Posts))

const AsyncPosts = () => (
  <Provider>
    <Picker options={['reactjs', 'vuejs', 'angularjs']} />
    <Posts />
  </Provider>
)

export default AsyncPosts


text:
import { __assign } from "tslib";
import * as React from 'react';
import { StyledIconBase } from '@styled-icons/styled-icon';
export var Vial = React.forwardRef(function (props, ref) {
    var attrs = {
        "fill": "currentColor",
        "xmlns": "http://www.w3.org/2000/svg",
    };
    return (React.createElement(StyledIconBase, __assign({ iconAttrs: attrs, iconVerticalAlign: "middle", iconViewBox: "0 0 24 24" }, props, { ref: ref }),
        React.createElement("path", { d: "M7 22a4.965 4.965 0 003.535-1.465l9.193-9.193.707.708 1.414-1.414-8.485-8.486-1.414 1.414.708.707-9.193 9.193C2.521 14.408 2 15.664 2 17s.521 2.592 1.465 3.535A4.965 4.965 0 007 22zM18.314 9.928L15.242 13H6.758l7.314-7.314 4.242 4.242z", key: "k0" })));
});
Vial.displayName = 'Vial';
export var VialDimensions = { height: 24, width: 24 };


text:
#!/usr/bin/env node

// Usage: npm run scaffold <componentName>

/* eslint-disable no-console */

const { readFileSync, writeFileSync, mkdirSync } = require('fs')
const { resolve } = require('path')
const { camel, kebab } = require('case')
const readline = require('readline')

const read = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
})

let componentName = process.argv[2]

const getComponentName = async () => {
  return new Promise(res => {
    read.question(
      "What is the name of your component?\nPlease use PascalCase. (E.g. 'ToggleSwitch' will become `@tds/community-toggle-switch` when deployed to npm)\nName: ",
      answer => {
        componentName = answer
        res()
      }
    )
  })
}

const getJourney = async () => {
  return new Promise(res => {
    read.question(
      'Are you building a stable component, starting at version 1.0.0?\nEnter "no" to start building a beta component, starting at version 0.1.0\n(yes/no): ',
      answer => {
        const a = answer.toLowerCase()
        if (a === 'yes' || a === 'y') {
          res(true)
        }
        res(false)
      }
    )
  })
}

const startScaffold = async () => {
  if (!componentName) {
    await getComponentName()
  }

  const isStableJourney = await getJourney()
  const basePath = `packages/${componentName}`
  let visibleName = ''
  let version = ''
  let configPath = '../../'

  if (isStableJourney) {
    version = '1.0.0'
    configPath = '../../'
  } else {
    version = '0.1.0'
    visibleName = `\n * @visibleName ${componentName} (beta)`
  }

  const scaffold = (template, destination) => {
    const contents = readFileSync(resolve('scripts', 'scaffolding', template), 'utf8')
      .replace(/\$COMPONENT\$/g, componentName)
      .replace(/\$COMPONENT_CAMEL\$/g, camel(componentName))
      .replace(/\$COMPONENT_KEBAB\$/g, kebab(componentName))
      .replace(/\$VERSION_START\$/g, version)
      .replace(/\$CONFIG_PATH\$/g, configPath)
      .replace(/\$VISIBLE_NAME\$/g, visibleName)

    writeFileSync(resolve(basePath, destination), contents)

    console.log(`Created ${basePath}/${destination}`)
  }

  mkdirSync(resolve(basePath), { recursive: true })
  mkdirSync(resolve(basePath, '__tests__'), { recursive: true })

  scaffold('Component.jsx', `${componentName}.jsx`)
  scaffold('Component.md', `${componentName}.md`)
  scaffold('Component.spec.jsx', `__tests__/${componentName}.spec.jsx`)
  scaffold('index.cjs.js', 'index.cjs.js')
  scaffold('index.es.js', 'index.es.js')
  scaffold('package.json', 'package.json')
  scaffold('README.md', 'README.md')
  scaffold('rollup.config.js', 'rollup.config.js')

  read.close()
}

startScaffold()


text:
const BackboneElement = require('./BackboneElement');
const Reference = require('./Reference');

class MessageDefinition_AllowedResponse extends BackboneElement {

	constructor ( opts ) {
		super();
		Object.assign(this, opts);
	}

	static get __resourceType () {
		return 'MessageDefinition_AllowedResponse';
	}

	// A reference to the message definition that must be adhered to by this supported response.
	get message () {
		return this._message;
	}

	set message ( new_value ) {
		this._message = new Reference(new_value);
	}

	// Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses).
	get situation () {
		return this._situation;
	}

	set situation ( new_value ) {
		this._situation = new_value;
	}

	toJSON () {
		return Object.assign(super.toJSON(), {
			message: this._message,
			situation: this._situation
		});
	}

}

module.exports = MessageDefinition_AllowedResponse;


text:
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./node_modules/axios/index.js":
/*!*************************************!*\
  !*** ./node_modules/axios/index.js ***!
  \*************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");

/***/ }),

/***/ "./node_modules/axios/lib/adapters/xhr.js":
/*!************************************************!*\
  !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  \************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");

module.exports = function xhrAdapter(config) {
  return new Promise(function dispatchXhrRequest(resolve, reject) {
    var requestData = config.data;
    var requestHeaders = config.headers;

    if (utils.isFormData(requestData)) {
      delete requestHeaders['Content-Type']; // Let the browser set it
    }

    var request = new XMLHttpRequest();

    // HTTP basic authentication
    if (config.auth) {
      var username = config.auth.username || '';
      var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
      requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
    }

    var fullPath = buildFullPath(config.baseURL, config.url);
    request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);

    // Set the request timeout in MS
    request.timeout = config.timeout;

    // Listen for ready state
    request.onreadystatechange = function handleLoad() {
      if (!request || request.readyState !== 4) {
        return;
      }

      // The request errored out and we didn't get a response, this will be
      // handled by onerror instead
      // With one exception: request that using file: protocol, most browsers
      // will return status as 0 even though it's a successful request
      if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
        return;
      }

      // Prepare the response
      var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
      var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
      var response = {
        data: responseData,
        status: request.status,
        statusText: request.statusText,
        headers: responseHeaders,
        config: config,
        request: request
      };

      settle(resolve, reject, response);

      // Clean up request
      request = null;
    };

    // Handle browser request cancellation (as opposed to a manual cancellation)
    request.onabort = function handleAbort() {
      if (!request) {
        return;
      }

      reject(createError('Request aborted', config, 'ECONNABORTED', request));

      // Clean up request
      request = null;
    };

    // Handle low level network errors
    request.onerror = function handleError() {
      // Real errors are hidden from us by the browser
      // onerror should only fire if it's a network error
      reject(createError('Network Error', config, null, request));

      // Clean up request
      request = null;
    };

    // Handle timeout
    request.ontimeout = function handleTimeout() {
      var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
      if (config.timeoutErrorMessage) {
        timeoutErrorMessage = config.timeoutErrorMessage;
      }
      reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
        request));

      // Clean up request
      request = null;
    };

    // Add xsrf header
    // This is only done if running in a standard browser environment.
    // Specifically not if we're in a web worker, or react-native.
    if (utils.isStandardBrowserEnv()) {
      // Add xsrf header
      var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
        cookies.read(config.xsrfCookieName) :
        undefined;

      if (xsrfValue) {
        requestHeaders[config.xsrfHeaderName] = xsrfValue;
      }
    }

    // Add headers to the request
    if ('setRequestHeader' in request) {
      utils.forEach(requestHeaders, function setRequestHeader(val, key) {
        if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
          // Remove Content-Type if data is undefined
          delete requestHeaders[key];
        } else {
          // Otherwise add header to the request
          request.setRequestHeader(key, val);
        }
      });
    }

    // Add withCredentials to request if needed
    if (!utils.isUndefined(config.withCredentials)) {
      request.withCredentials = !!config.withCredentials;
    }

    // Add responseType to request if needed
    if (config.responseType) {
      try {
        request.responseType = config.responseType;
      } catch (e) {
        // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
        // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
        if (config.responseType !== 'json') {
          throw e;
        }
      }
    }

    // Handle progress if needed
    if (typeof config.onDownloadProgress === 'function') {
      request.addEventListener('progress', config.onDownloadProgress);
    }

    // Not all browsers support upload events
    if (typeof config.onUploadProgress === 'function' && request.upload) {
      request.upload.addEventListener('progress', config.onUploadProgress);
    }

    if (config.cancelToken) {
      // Handle cancellation
      config.cancelToken.promise.then(function onCanceled(cancel) {
        if (!request) {
          return;
        }

        request.abort();
        reject(cancel);
        // Clean up request
        request = null;
      });
    }

    if (!requestData) {
      requestData = null;
    }

    // Send the request
    request.send(requestData);
  });
};

/***/ }),

/***/ "./node_modules/axios/lib/axios.js":
/*!*****************************************!*\
  !*** ./node_modules/axios/lib/axios.js ***!
  \*****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");

/**
 * Create an instance of Axios
 *
 * @param {Object} defaultConfig The default config for the instance
 * @return {Axios} A new instance of Axios
 */
function createInstance(defaultConfig) {
  var context = new Axios(defaultConfig);
  var instance = bind(Axios.prototype.request, context);

  // Copy axios.prototype to instance
  utils.extend(instance, Axios.prototype, context);

  // Copy context to instance
  utils.extend(instance, context);

  return instance;
}

// Create the default instance to be exported
var axios = createInstance(defaults);

// Expose Axios class to allow class inheritance
axios.Axios = Axios;

// Factory for creating new instances
axios.create = function create(instanceConfig) {
  return createInstance(mergeConfig(axios.defaults, instanceConfig));
};

// Expose Cancel & CancelToken
axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");

// Expose all/spread
axios.all = function all(promises) {
  return Promise.all(promises);
};
axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");

// Expose isAxiosError
axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js");

module.exports = axios;

// Allow use of default import syntax in TypeScript
module.exports.default = axios;

/***/ }),

/***/ "./node_modules/axios/lib/cancel/Cancel.js":
/*!*************************************************!*\
  !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  \*************************************************/
/***/ ((module) => {

"use strict";

/**
 * A `Cancel` is an object that is thrown when an operation is canceled.
 *
 * @class
 * @param {string=} message The message.
 */
function Cancel(message) {
  this.message = message;
}

Cancel.prototype.toString = function toString() {
  return 'Cancel' + (this.message ? ': ' + this.message : '');
};

Cancel.prototype.__CANCEL__ = true;

module.exports = Cancel;

/***/ }),

/***/ "./node_modules/axios/lib/cancel/CancelToken.js":
/*!******************************************************!*\
  !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  \******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");

/**
 * A `CancelToken` is an object that can be used to request cancellation of an operation.
 *
 * @class
 * @param {Function} executor The executor function.
 */
function CancelToken(executor) {
  if (typeof executor !== 'function') {
    throw new TypeError('executor must be a function.');
  }

  var resolvePromise;
  this.promise = new Promise(function promiseExecutor(resolve) {
    resolvePromise = resolve;
  });

  var token = this;
  executor(function cancel(message) {
    if (token.reason) {
      // Cancellation has already been requested
      return;
    }

    token.reason = new Cancel(message);
    resolvePromise(token.reason);
  });
}

/**
 * Throws a `Cancel` if cancellation has been requested.
 */
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  if (this.reason) {
    throw this.reason;
  }
};

/**
 * Returns an object that contains a new `CancelToken` and a function that, when called,
 * cancels the `CancelToken`.
 */
CancelToken.source = function source() {
  var cancel;
  var token = new CancelToken(function executor(c) {
    cancel = c;
  });
  return {
    token: token,
    cancel: cancel
  };
};

module.exports = CancelToken;

/***/ }),

/***/ "./node_modules/axios/lib/cancel/isCancel.js":
/*!***************************************************!*\
  !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  \***************************************************/
/***/ ((module) => {

"use strict";

module.exports = function isCancel(value) {
  return !!(value && value.__CANCEL__);
};

/***/ }),

/***/ "./node_modules/axios/lib/core/Axios.js":
/*!**********************************************!*\
  !*** ./node_modules/axios/lib/core/Axios.js ***!
  \**********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");

/**
 * Create a new instance of Axios
 *
 * @param {Object} instanceConfig The default config for the instance
 */
function Axios(instanceConfig) {
  this.defaults = instanceConfig;
  this.interceptors = {
    request: new InterceptorManager(),
    response: new InterceptorManager()
  };
}

/**
 * Dispatch a request
 *
 * @param {Object} config The config specific for this request (merged with this.defaults)
 */
Axios.prototype.request = function request(config) {
  /*eslint no-param-reassign:0*/
  // Allow for axios('example/url'[, config]) a la fetch API
  if (typeof config === 'string') {
    config = arguments[1] || {};
    config.url = arguments[0];
  } else {
    config = config || {};
  }

  config = mergeConfig(this.defaults, config);

  // Set config.method
  if (config.method) {
    config.method = config.method.toLowerCase();
  } else if (this.defaults.method) {
    config.method = this.defaults.method.toLowerCase();
  } else {
    config.method = 'get';
  }

  // Hook up interceptors middleware
  var chain = [dispatchRequest, undefined];
  var promise = Promise.resolve(config);

  this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
    chain.unshift(interceptor.fulfilled, interceptor.rejected);
  });

  this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
    chain.push(interceptor.fulfilled, interceptor.rejected);
  });

  while (chain.length) {
    promise = promise.then(chain.shift(), chain.shift());
  }

  return promise;
};

Axios.prototype.getUri = function getUri(config) {
  config = mergeConfig(this.defaults, config);
  return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
};

// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  /*eslint func-names:0*/
  Axios.prototype[method] = function(url, config) {
    return this.request(mergeConfig(config || {}, {
      method: method,
      url: url,
      data: (config || {}).data
    }));
  };
});

utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  /*eslint func-names:0*/
  Axios.prototype[method] = function(url, data, config) {
    return this.request(mergeConfig(config || {}, {
      method: method,
      url: url,
      data: data
    }));
  };
});

module.exports = Axios;

/***/ }),

/***/ "./node_modules/axios/lib/core/InterceptorManager.js":
/*!***********************************************************!*\
  !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  \***********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");

function InterceptorManager() {
  this.handlers = [];
}

/**
 * Add a new interceptor to the stack
 *
 * @param {Function} fulfilled The function to handle `then` for a `Promise`
 * @param {Function} rejected The function to handle `reject` for a `Promise`
 *
 * @return {Number} An ID used to remove interceptor later
 */
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  this.handlers.push({
    fulfilled: fulfilled,
    rejected: rejected
  });
  return this.handlers.length - 1;
};

/**
 * Remove an interceptor from the stack
 *
 * @param {Number} id The ID that was returned by `use`
 */
InterceptorManager.prototype.eject = function eject(id) {
  if (this.handlers[id]) {
    this.handlers[id] = null;
  }
};

/**
 * Iterate over all the registered interceptors
 *
 * This method is particularly useful for skipping over any
 * interceptors that may have become `null` calling `eject`.
 *
 * @param {Function} fn The function to call for each interceptor
 */
InterceptorManager.prototype.forEach = function forEach(fn) {
  utils.forEach(this.handlers, function forEachHandler(h) {
    if (h !== null) {
      fn(h);
    }
  });
};

module.exports = InterceptorManager;

/***/ }),

/***/ "./node_modules/axios/lib/core/buildFullPath.js":
/*!******************************************************!*\
  !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  \******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");

/**
 * Creates a new URL by combining the baseURL with the requestedURL,
 * only when the requestedURL is not already an absolute URL.
 * If the requestURL is absolute, this function returns the requestedURL untouched.
 *
 * @param {string} baseURL The base URL
 * @param {string} requestedURL Absolute or relative URL to combine
 * @returns {string} The combined full path
 */
module.exports = function buildFullPath(baseURL, requestedURL) {
  if (baseURL && !isAbsoluteURL(requestedURL)) {
    return combineURLs(baseURL, requestedURL);
  }
  return requestedURL;
};

/***/ }),

/***/ "./node_modules/axios/lib/core/createError.js":
/*!****************************************************!*\
  !*** ./node_modules/axios/lib/core/createError.js ***!
  \****************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");

/**
 * Create an Error with the specified message, config, error code, request and response.
 *
 * @param {string} message The error message.
 * @param {Object} config The config.
 * @param {string} [code] The error code (for example, 'ECONNABORTED').
 * @param {Object} [request] The request.
 * @param {Object} [response] The response.
 * @returns {Error} The created error.
 */
module.exports = function createError(message, config, code, request, response) {
  var error = new Error(message);
  return enhanceError(error, config, code, request, response);
};

/***/ }),

/***/ "./node_modules/axios/lib/core/dispatchRequest.js":
/*!********************************************************!*\
  !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  \********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

"use strict";

var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");

/**
 * Throws a `Cancel` if cancellation has been requested.
 */
function throwIfCancellationRequested(config) {
  if (config.cancelToken) {


text:
"use strict"
const Storage=class
{
	error=null
	constructor(dependencies)
	{
		try
		{
			let storage=dependencies.multer.diskStorage({
				destination:(req,file,next)=>
				{
					const uniqueSuffix=Date.now()+'-'+Math.round(Math.random()*1E9)
					const d=(new Date()).toLocaleDateString().split('/')
					const p=dependencies.path.join(__dirname,'../../',process.env.MULTER_UPLOAD||'public/upload',d[2],d[1],d[0],uniqueSuffix)
					file.location=`${d[2]}/${d[1]}/${d[0]}/${uniqueSuffix}`
					dependencies.fs.mkdirSync(p,{recursive:true})
					next(null,p)
				},
				filename:(req,file,next)=>
				{
					const type=file.originalname.split('.').reverse()[0]
					next(null,`original.${type}`)
				}
			})
			this.multer=dependencies.multer({storage:storage})
		}
		catch(error)
		{
			this.error=error
		}
	}
	getUpload=_=>
	{
		return this.multer
	}
	after=next=>
	{
		if(!this.error)
			next()
		return this
	}
	catch=next=>
	{
		if(this.error)
			next(this.error)
		return this
	}
}
module.exports=Storage